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
Gets the productId for the resource.
public String getProductId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getProductId() {\n return productId;\n }", "public String getProductId() {\n return productId;\n }", "public String getProductId() {\n return productId;\n }", "public String getProductId() {\n return productId;\n }", "public String getProductId() {\n return productId;\n }", "public String getProductId() {\r\n\t\treturn productId;\r\n\t}", "public Integer getProductId() {\n\t\treturn productId;\n\t}", "public Integer getProductId() {\r\n return productId;\r\n }", "public Integer getProductId() {\r\n return productId;\r\n }", "protected String getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public Integer getProductId() {\n return productId;\n }", "public int getProductId() {\n\t\treturn productId;\n\t}", "public int getProduct_id() {\r\n\t\treturn product_id;\r\n\t}", "public int getProduct_id() {\n\t\treturn product_id;\n\t}", "public Long getProductId() {\n\t\treturn productId;\n\t}", "public String getProductID() {\r\n return productID;\r\n }", "public int getProductId() {\n return productId;\n }", "public int getProductId() {\n return productId;\n }", "public String getProduct_id() {\n return product_id;\n }", "public String getProduct_id() {\n return product_id;\n }", "public short getIdProduct() {\r\n\t\treturn idProduct;\r\n\t}", "public Product getProductFromId(Integer prodId) throws BackendException;", "public String getProductid() {\n return productid;\n }", "Product getProductByID(Long id);", "Product getProductById(Integer productId);", "Product getProductById(Integer productId);", "CafeProduct getProductById(final Integer productId);", "public String getProductoId() {\n\t\treturn productoId;\n\t}", "public String getProductID() {\n final byte[] data = new byte[12];\n mem.getBytes(16, data, 0, data.length);\n return new String(data).trim();\n }", "public int getM_Product_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Product_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int getM_Product_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Product_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int getM_Product_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Product_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "Product getProductById(Integer productID);", "String getProductId();", "@Override\n\tpublic Product getProduct(@Min(value = 1, message = \"Invalid Product ID.\") long id) {\n\t\treturn productRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(\"Product not found\"));\n\t}", "@ApiModelProperty(required = true, value = \"Unique identifier of the product\")\n @JsonProperty(\"id\")\n @NotNull\n public String getId() {\n return id;\n }", "@Override\n\tpublic long getId() {\n\t\treturn _buySellProducts.getId();\n\t}", "@ApiModelProperty(value = \"Identifier for the product that is related to the referenced one\")\n public String getId() {\n return id;\n }", "@Override\r\n\tpublic Long getID(ProductIngredientParam param) {\n\t\treturn param.getId();\r\n\t}", "@ApiOperation(value = \"Product by ID\", response = Product.class)\n\t@ApiResponses(value = {\n @ApiResponse(code = 200, message = \"Return a Product Object.\", response = Product.class ),\n @ApiResponse(code = 400, message = \"Return a error object\", response = error.class) })\n\t\n\t@GetMapping(path = \"/api/products/{product_id}\")\n\tpublic ResponseEntity<Optional<Product>> getById(\n\t\t\t@PathVariable(name = \"product_id\", required = true) Integer productId) {\n\t\treturn ResponseEntity.ok(productService.findById(productId));\n\t}", "public Product findProduct(int productId) {\n\t\treturn null;\n\t}", "public int getM_Product_ID();", "public int getM_Product_ID();", "@Override\r\n\tpublic Product getProduct(int productId) {\n\t\treturn dao.getProduct(productId);\r\n\t}", "Product findProductById(Long id);", "@JsonGetter(\"product_id\")\n public Integer getProductId ( ) { \n return this.productId;\n }", "public String getProductId() ;", "public int getProdId() {\n\t\treturn prodId;\n\t}", "public Product getProduct(long productId) {\n\t\tProduct product = restTemplate.getForObject(\"http://PRODUCT-SERVICE/products/product-id/\" + productId, Product.class);\n\t\treturn product;\n\t}", "Product getProductById(Serializable productId);", "public Integer getProductTypeId() {\r\n return productTypeId;\r\n }", "@Override\n\t@Transactional\n\tpublic Product getProductById(int productId) {\n\t\tOptional<Product>product = productDAO.findById(productId);\n\t\tif(product.isPresent()) return product.get();\n\t\telse return null;\n\t}", "@Override\r\n\tpublic Product getProduct(String productId) {\n\t\treturn dao.getProduct(productId);\r\n\t}", "public Integer getProductUomId() {\n return productUomId;\n }", "public Integer getProductUomId() {\n return productUomId;\n }", "public Product findProductById(Integer id) {\n\t\treturn null;\n\t}", "public Integer getResourceId() {\n return resourceId;\n }", "public java.lang.CharSequence getRequestingProductId() {\n return requesting_product_id;\n }", "@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET, produces = \"application/json\")\n\tpublic ResponseEntity<Product> getSingleProduct(@PathVariable int productId) {\n\t\tProduct productById = pm.getProductById(productId);\n\t\tif (productById != null) {\n\t\t\treturn new ResponseEntity<Product>(productById, HttpStatus.OK);\n\t\t}\n\t\treturn new ResponseEntity<Product>(productById, HttpStatus.NOT_FOUND);\n\t}", "public java.lang.CharSequence getRequestingProductId() {\n return requesting_product_id;\n }", "int getProductKey();", "public Integer getProductAttributeValueId() {\n return productAttributeValueId;\n }", "@Override\n\tpublic Product getById(int productId) {\n\t\treturn session.get(Product.class, productId);\n\t}", "@Override\r\n\tpublic ProductMaster getProductById(int productId) {\n\t\treturn this.repository.findById(productId).orElse(null);\r\n\t}", "@Exclude\n public String getIdProduct() {\n return idProduct;\n }", "public Product lookupProduct(int productId) {\n for( Product product : allProducts ) {\n if(product.getId() == productId) {\n return product;\n }\n }\n return null;\n }", "public void setProductId(Integer productId) {\r\n this.productId = productId;\r\n }", "public void setProductId(Integer productId) {\r\n this.productId = productId;\r\n }", "public Product lookupProduct(int productId) {\n for(Product product : allProducts) {\n if(product.getId() == productId) {\n return product;\n }\n }\n \n return null;\n }", "Product findById(long id);", "@GetMapping(\"/products/{id}\")\r\n\t@ApiOperation(value=\"Return unique product.\")\r\n\tpublic Product showOneProduct(@PathVariable(value=\"id\") long id){\n\t\treturn productRepository.findById(id);\r\n\t}", "public com.flexnet.operations.webservices.ProductIdentifierType[] getProductIdentifier() {\n return productIdentifier;\n }", "public String getExternalproductid() {\r\n return externalproductid;\r\n }", "@GetMapping(VERSION + \"/product/{productId}\")\n public ResponseEntity<?> retrieveProductDetails(@PathVariable(\"productId\") String productId) {\n ProductDto productDto = productCompositeService.fetchProductById(productId);\n return ResponseEntity.ok().body(productDto);\n }", "@Override\r\n\tpublic Product getProduct(String id) {\n\t\treturn null;\r\n\t}", "Product getProductDetails(int idproduct) throws DataBaseException;", "public static String generateProductID() {\n\tproductID++;\n\treturn String.valueOf(productID);\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public void setProductId(Integer productId) {\n this.productId = productId;\n }", "public String getIdProducto() {\n\t\treturn idProducto;\n\t}", "public String getResourceId() {\n return resourceId;\n }", "public static Product lookupProduct(int productId) {\n for (int index = 0; index < Inventory.getAllProducts().size(); index++) {\n Product currentProduct = Inventory.getAllProducts().get(index);\n if (currentProduct.getId() == productId) {\n return currentProduct;\n }\n }\n return null;\n }", "public Long getProductCertificateId() {\r\n return productCertificateId;\r\n }", "@RequestMapping(value = \"/api/products/{id}\", method = RequestMethod.GET)\n\tpublic Product getOneProduct(@PathVariable(\"id\") long id) {\n\t\treturn this.productRepo.findById(id).orElseThrow(() -> {\n\t\t\tthrow new ProductNotFoundException();\n\t\t});\n\t}", "public Product GetProductbyid(int Id) {\n\t\treturn null;\n\t}", "public List<Product> getProductByID() {\n List<Product> listProduct= productBean.getProductByID(productId);\n return listProduct;\n }", "public String getProd_id() {\r\n\t\treturn prod_id;\r\n\t}", "@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET)\n\t public ResponseEntity<ProductData> getProductDetails(@PathVariable int productId){\t\t\t\t\t\n\t ProductData product = productService.getProduct(productId);\n\t return new ResponseEntity<>(product, HttpStatus.OK);\n\t }", "public int getResourceId() {\n\t\t\treturn resourceId;\n\t\t}", "public String getProID() {\n\t\treturn sh_ProductID;\n\t}", "String getTheirProductId();" ]
[ "0.7320712", "0.7320712", "0.7320712", "0.7320712", "0.7320712", "0.72804826", "0.7267517", "0.72403187", "0.72403187", "0.723003", "0.721322", "0.721322", "0.721322", "0.721322", "0.721322", "0.721322", "0.7153001", "0.7150218", "0.71429765", "0.7115671", "0.70035154", "0.6978349", "0.6978349", "0.6970331", "0.6970331", "0.689601", "0.6854868", "0.6840383", "0.67647207", "0.6729407", "0.6729407", "0.66946983", "0.66102767", "0.6598487", "0.6593635", "0.6593635", "0.6593635", "0.6563976", "0.6534593", "0.64972395", "0.6496098", "0.64602846", "0.6457537", "0.6444859", "0.6391879", "0.636499", "0.63571656", "0.63571656", "0.6331362", "0.63254166", "0.63215816", "0.6314416", "0.6297802", "0.62700325", "0.6242412", "0.6229415", "0.619753", "0.61878884", "0.61637545", "0.61637545", "0.6127346", "0.612486", "0.6124074", "0.61228323", "0.6111771", "0.61010355", "0.6078237", "0.60672325", "0.6065575", "0.60575926", "0.6050773", "0.6050191", "0.6050191", "0.604199", "0.60397875", "0.60358286", "0.6033804", "0.60332125", "0.603245", "0.6031287", "0.60270584", "0.6024021", "0.6023396", "0.6023396", "0.6023396", "0.6023396", "0.6023396", "0.6023396", "0.601603", "0.6009963", "0.6009916", "0.59958386", "0.5994155", "0.5991862", "0.59885174", "0.59878427", "0.5985215", "0.5977645", "0.597615", "0.5971876" ]
0.65912294
37
Gets the edition of the product, if applicable.
public String getProductEdition();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getEdition() {\n return edition;\n }", "public double getEdition() {\n return edition;\n }", "public int getEdition() {\n return edition;\n }", "public int getEdition() {\n\treturn edition;\n}", "public String getEdition() {\n return FxSharedUtils.getFlexiveEdition();\n }", "EditionPattern getEditionPattern();", "public Calendar getEditionDate() {\n\t\treturn editionDate;\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getBookEdition();", "public boolean hasEditionId() {\n return result.hasEditionId();\n }", "public String editProduct() {\n ConversationContext<Product> ctx = ProductController.newEditContext(products.getSelectedRow());\n ctx.setLabelWithKey(\"part_products\");\n ctx.setCallBack(editProductCallBack);\n getCurrentConversation().setNextContextSub(ctx);\n return ctx.view();\n }", "public Product getProductToModify()\n {\n if (productTable.getSelectionModel().getSelectedItem() != null)\n {\n return ((Product) productTable.getSelectionModel().getSelectedItem());\n }\n return null;\n }", "public String getEditionFull() {\n return FxSharedUtils.getFlexiveEditionFull();\n }", "public String getDatabaseEdition() {\n return this.databaseEdition;\n }", "@Override\n public String getEISProductVersion() throws ResourceException {\n return repository.getDescriptor(Repository.REP_VERSION_DESC);\n }", "public void setEdition(int edition) {\n\tthis.edition = edition;\n}", "public void setEdition(double edition) {\n this.edition = edition;\n }", "public void setEdition(double edition) {\n this.edition = edition;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.APDProduct getProduct();", "void printEditionInformation();", "public java.lang.String getProduct() {\n return product;\n }", "public void setBookEdition(java.lang.String value);", "public ProductModel getProduct()\n\t{\n\t\treturn product;\n\t}", "public Product getProduct() {\n\t\treturn product;\n\t}", "public String getProduct() {\r\n return this.product;\r\n }", "public String getProduct() {\n return this.product;\n }", "@Override\n\tpublic Product getProduct() {\n\t\treturn product;\n\t}", "public String getProduct() {\n return product;\n }", "public String getProduct() {\n return product;\n }", "public String product() {\n return this.product;\n }", "public String getProduct()\n {\n return product;\n }", "Form getPropertyEditionForm(ProjectEntity entity, String propertyTypeName);", "public ProductType getProduct() {\n return product;\n }", "Object getProduct();", "public String getProductOwner();", "public String getProductVersion();", "public String getAcsProduct() {\n return acsProduct;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.APDProductLine getProductLine();", "protected final Product getProduct() {\n Product.Builder product = new Product.Builder()\n .implementationTitle(getClass())\n .implementationVersion(getClass());\n Optional.ofNullable(getClass().getPackage())\n .flatMap(p -> Optional.ofNullable(p.getSpecificationVersion()))\n .map(specVersion -> \"(specification \" + specVersion + \")\")\n .ifPresent(product::comment);\n return product.build();\n }", "public org.mrk.grpc.catalog.Product getProduct() {\n return product_ == null ? org.mrk.grpc.catalog.Product.getDefaultInstance() : product_;\n }", "String currentProduct() {\n if (PageFlowContext.getPolicy() != null && PageFlowContext.getPolicy().getProductTypeId() != null) {\n return PageFlowContext.getPolicy().getProductTypeId();\n } else {\n return \"\";\n }\n }", "public String getProductReference() {\n return productReference;\n }", "public EditPanel getEditPanel() { return ep; }", "public String getDatabaseProduct();", "String getProduct();", "public RepriceDocEditModelBean getRepriceDocModel()\n\t{\n\t\treturn ModelsAccessPoint.read(getRepriceDocModelKey(),\n\t\t RepriceDocEditModelBean.class);\n\t}", "public String getUserecommendedproduct() {\r\n return userecommendedproduct;\r\n }", "public String getProductCode() {\n return productCode;\n }", "public String getProductExt() {\n return (String)getAttributeInternal(PRODUCTEXT);\n }", "@Override\n public String getEISProductName() throws ResourceException {\n return repository.getDescriptor(Repository.REP_NAME_DESC);\n }", "public Integer getProductCode() {\n\t\treturn productCode;\n\t}", "public boolean getEditResourceImage() {\n\t\treturn isEditResourceImage;\n\t}", "public byte getIProduct() {\r\n\t\treturn iProduct;\r\n\t}", "@Override\n\tpublic Product getProduct() {\n\t\treturn productDao.getProduct();\n\t}", "public DistributionModeInternal getMode() {\n return this.mode;\n }", "public T getProduct() {\n return this.product;\n }", "public boolean getEditfact() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((Boolean) __getCache(\"editfact\")).booleanValue());\n }", "public java.lang.Boolean getEdit() {\n return edit;\n }", "public java.lang.Boolean getAllowInvoiceEdit() {\n return allowInvoiceEdit;\n }", "public String getProductCode() {\n return this.productCode;\n }", "@Override\n\tpublic java.lang.String getLicense() {\n\t\treturn _scienceApp.getLicense();\n\t}", "public org.mrk.grpc.catalog.ProductOrBuilder getProductOrBuilder() {\n return getProduct();\n }", "public String getEditCalSuiteName() {\n return editCalSuiteName;\n }", "public String getProductType() {\n\t\treturn productType;\n\t}", "public boolean getEditing() {\r\n return this.editing;\r\n }", "public org.mrk.grpc.catalog.Product getProduct() {\n if (productBuilder_ == null) {\n return product_ == null ? org.mrk.grpc.catalog.Product.getDefaultInstance() : product_;\n } else {\n return productBuilder_.getMessage();\n }\n }", "public String getProductToCompare() {\n return mProductToCompare;\n }", "public AbstractEdificio getEdificio() {\r\n return Edificio;\r\n }", "public String getEditor() {\n return (String)getAttributeInternal(EDITOR);\n }", "public String getEditor() {\n return (String)getAttributeInternal(EDITOR);\n }", "public interface ComboPropertiesEditionPart {\n\n\t/**\n\t * @return the combo\n\t */\n\tpublic Object getCombo();\n\n\t/**\n\t * Init the combo\n\t * @param eClass the eClass to manage\n\t * @param current the current value\n\t */\n\tpublic void initCombo(ResourceSet allResources, EObject current);\n\n\t/**\n\t * Defines a new combo\n\t * @param newValue the new combo to set\n\t */\n\tpublic void setCombo(Object newValue);\n\n\t/**\n\t * Adds the given filter to the combo edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t */\n\tpublic void addFilterToCombo(ViewerFilter filter);\n\n\n\n\n\n\n\t/**\n\t * @return the comboRO\n\t */\n\tpublic Object getComboRO();\n\n\t/**\n\t * Init the comboRO\n\t * @param eClass the eClass to manage\n\t * @param current the current value\n\t */\n\tpublic void initComboRO(ResourceSet allResources, EObject current);\n\n\t/**\n\t * Defines a new comboRO\n\t * @param newValue the new comboRO to set\n\t */\n\tpublic void setComboRO(Object newValue);\n\n\t/**\n\t * Adds the given filter to the comboRO edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t */\n\tpublic void addFilterToComboRO(ViewerFilter filter);\n\n\n\n\n\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "public short getIdProduct() {\r\n\t\treturn idProduct;\r\n\t}", "java.lang.String getProductDescription();", "public java.lang.String getProductInfo () {\n\t\treturn productInfo;\n\t}", "public String getProductID() {\r\n return productID;\r\n }", "@Accessor(qualifier = \"mode\", type = Accessor.Type.GETTER)\n\tpublic ImpExValidationModeEnum getMode()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(MODE);\n\t}", "java.lang.String getOfficeVersion();", "String getEditore();", "public CarEdition() {\n ELContext context = FacesContext.getCurrentInstance().getELContext();\n app = (CarsaleApplication) FacesContext.getCurrentInstance().getApplication().getELResolver().getValue(context, null, \"carsaleApplication\");\n try {\n this.carId = Integer.valueOf(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"carId\"));\n this.car = searchCar(this.carId);\n } catch (Exception ex) {\n Logger.getLogger(CarDetail.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected MigrationEditorOperation getEditor() {\n IEditorPart editorPart = PluginUtil.getActiveEditor();\n if (editorPart instanceof MigrationEditorOperation) {\n return (MigrationEditorOperation) editorPart;\n }\n return null;\n }", "public int getEmlVersion() {\n return emlVersion;\n }", "public String getProductNo() {\n\t\treturn productNo;\n\t}", "public String getProductLine() {\n return productLine;\n }", "public OsmDataLayer getEditLayer() {\n\t\treturn null;\n\t}", "@Override\n public Productor getProductor() {\n return new ProductorImp1();\n }", "public Integer getEvaluationFormVersion() {\n return this.evaluationFormVersion;\n }", "public int getProduct_id() {\r\n\t\treturn product_id;\r\n\t}", "public Product getProductInventory() {\n return productInventory;\n }", "public int getProduct_id() {\n\t\treturn product_id;\n\t}", "public String getProductDescription() {\r\n/* 221 */ return this._productDescription;\r\n/* */ }", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product getProduct();", "public DesignEducationalElements getDesignEducationalAccess() {\n\t\treturn pDesignEducational;\n\t}", "Product editProduct(Product product);", "public String getProductInstallType();", "public void Editproduct(Product objproduct) {\n\t\t\n\t}", "public String getProductNumber() {\n\t\treturn productNumber;\n\t}", "public String getKind_of_product() {\r\n return kind_of_product;\r\n }", "public String getProductPack() {\n return (String)getAttributeInternal(PRODUCTPACK);\n }", "java.lang.String getProductCode();", "public String getLicenseModel() {\n return this.licenseModel;\n }", "public String getLicenseModel() {\n return this.licenseModel;\n }" ]
[ "0.78713894", "0.78713894", "0.7823473", "0.7614431", "0.7234818", "0.7102713", "0.70049727", "0.6900168", "0.65479296", "0.6503037", "0.6447659", "0.6402883", "0.63987887", "0.62741643", "0.62233347", "0.6156554", "0.6156554", "0.5982481", "0.59403217", "0.5914501", "0.58833057", "0.5854079", "0.5843858", "0.5835164", "0.5826404", "0.5823386", "0.5779602", "0.5779602", "0.5697234", "0.56875783", "0.567087", "0.5653364", "0.5534207", "0.5528637", "0.5526817", "0.55067414", "0.55015236", "0.54983115", "0.5474919", "0.54721564", "0.5460786", "0.54564667", "0.54544216", "0.5449994", "0.5436898", "0.5434108", "0.54105467", "0.5402237", "0.5401527", "0.539898", "0.5392351", "0.5391892", "0.5379278", "0.53692234", "0.53608626", "0.53495955", "0.5349291", "0.5345268", "0.5333033", "0.53265846", "0.53254044", "0.53220886", "0.53166515", "0.53105265", "0.53010786", "0.52850974", "0.5281105", "0.52746725", "0.52746725", "0.525483", "0.52535415", "0.52511525", "0.52507883", "0.5247251", "0.52458787", "0.52388155", "0.520158", "0.51954335", "0.519281", "0.51767945", "0.5176202", "0.5173484", "0.51665163", "0.5163116", "0.51595014", "0.51592904", "0.5157623", "0.51388633", "0.5133449", "0.51301485", "0.5124749", "0.51209486", "0.5120242", "0.51164615", "0.51124704", "0.51101124", "0.5108633", "0.51029027", "0.50962484", "0.50962484" ]
0.8217413
0
Gets the install type of the product (e.g. "Archive")
public String getProductInstallType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.math.BigInteger getInstallmentType();", "public String getType() {\r\n\t\treturn productType;\r\n\t}", "org.apache.xmlbeans.XmlInteger xgetInstallmentType();", "public String getProductType() {\n\t\treturn productType;\n\t}", "IntegerResource installationType();", "public Class getType() {\n return SSProduct.class;\n }", "public TypeProduct getTypeProduct() {\r\n\t\treturn typeProduct;\r\n\t}", "String productKind();", "public String getPackingType() {\n return (String)getAttributeInternal(PACKINGTYPE);\n }", "public static String getProductType(String name)\n {\n return PLUGIN_MAP.get(name) + \".\" + name;\n }", "public String getProductClass() {\n return (String)getAttributeInternal(PRODUCTCLASS);\n }", "@java.lang.Override public com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType getDisplayUploadProductType() {\n com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType result = com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType.forNumber(displayUploadProductType_);\n return result == null ? com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType.UNRECOGNIZED : result;\n }", "java.lang.String getAppType();", "@java.lang.Override public int getDisplayUploadProductTypeValue() {\n return displayUploadProductType_;\n }", "@java.lang.Override public int getDisplayUploadProductTypeValue() {\n return displayUploadProductType_;\n }", "boolean isSetInstallmentType();", "@java.lang.Override\n public com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType getDisplayUploadProductType() {\n com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType result = com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType.forNumber(displayUploadProductType_);\n return result == null ? com.google.ads.googleads.v14.enums.DisplayUploadProductTypeEnum.DisplayUploadProductType.UNRECOGNIZED : result;\n }", "public String getProductTypeName() {\r\n return productTypeName;\r\n }", "public String getProductionType() {\n return (String) getAttributeInternal(PRODUCTIONTYPE);\n }", "public String getTypeSpecification(){\n return productRelation.getTypeSpecification();\n }", "public final Class getProductClass() {\n\treturn productClass;\n }", "private String getType( )\n\t{\n\t\treturn this.getModuleName( ) + \"$\" + this.getSimpleName( ) + \"$\" + this.getSystem( );\n\t}", "x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType.Enum getProductType();", "String primaryImplementationType();", "public String getProductPack() {\n return (String)getAttributeInternal(PRODUCTPACK);\n }", "@Override\n\tpublic java.lang.String getAppType() {\n\t\treturn _scienceApp.getAppType();\n\t}", "static String getArtifactClassifier( Product product, TargetEnvironment environment )\n {\n final String artifactClassifier;\n if ( product.getAttachId() == null )\n {\n artifactClassifier = getOsWsArch( environment, '.' );\n }\n else\n {\n artifactClassifier = product.getAttachId() + \"-\" + getOsWsArch( environment, '.' );\n }\n return artifactClassifier;\n }", "public Type getType() {\n \t\tif(type == null) {\n \t\t\ttry {\n \t\t\t\tsetType(B3BackendActivator.instance.getBundle().loadClass(getQualifiedName()));\n \t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO: ?? Need to handle this, so the \"not found\" surfaces to the user...\n\t\t\t\t// Handled via model validation - type can not be null\n \t\t\t}\n \t\t}\n \t\treturn type;\n \t}", "x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType xgetProductType();", "public PlatformType getPlatformType();", "public static String getProductType(Long Id) throws SQLException, ClassNotFoundException {\n\n\t\tProductModel.LazyLoading();\n\t\treturn product.findproductType(Id);\n\n\t}", "boolean isInstalled();", "java.lang.String getProductCode();", "public String getKind_of_product() {\r\n return kind_of_product;\r\n }", "java.lang.String getMachineType();", "public static String getType() {\n\t\treturn type;\n\t}", "BundleType getType();", "public Short getPackageType() {\n\t\treturn packageType;\n\t}", "public String getType() {\n return (String) getObject(\"type\");\n }", "public SoftwareType getSoftwareType() {\n return softwareType;\n }", "public static String getFileType(){\n\t\t//Get the selected file type\n\t\tString type = (String) fileType.getSelectedItem();\n\t\t//Re-enable the combobox, since download has already started\n\t\tfileType.setEnabled(true);\n\t\t//Reset the default file type\n\t\tfileType.setSelectedIndex(0);\n\t\treturn type;\n\t}", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "public ProductType getProduct() {\n return product;\n }", "public final String type() {\n return type;\n }", "public String getProductEdition();", "public String getProductVersion();", "public String obtenirType() {\n\t\treturn this.type;\n\t}", "static int askProductType() {\n\n int choice; // initialize return variable\n\n choice = Validate.readInt(ASK_PRODUCT_TYPE, 2); // display options to user for products and store result if valid choice\n\n return choice; // return users choice\n }", "public String getModuleTypeClass();", "public com.profitbricks.api.ws.OsType getOsType() {\r\n return osType;\r\n }", "public static String getType() {\n type = getProperty(\"type\");\n if (type == null) type = \"png\";\n return type;\n }", "public PowerUpType getType() {\n\t\treturn powerUpType;\n\t}", "public void setType(String type) {\r\n\t\tthis.productType = type;\r\n\t}", "@Theme int getType();", "public String getType()\n\t{\n\t\treturn type;\n\t}", "public String getType() {\r\r\n\t\treturn type;\r\r\n\t}", "public String getType()\r\n\t{\r\n\t\treturn type;\r\n\t}", "public String getLaunchType() {\n return this.launchType;\n }", "public String getLaunchType() {\n return this.launchType;\n }", "String getType() {\n return type;\n }", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "public String getType() {\n\t\treturn type;\n\t}", "@Transient\r\n\tpublic Class<?> getClassType() {\r\n\t\treturn TVendor.class;\r\n\t}", "public String getType() {\r\n\t\treturn type_;\r\n\t}", "io.opencannabis.schema.commerce.CommercialOrder.OrderType getType();", "public java.lang.String getVersionType() {\r\n return versionType;\r\n }" ]
[ "0.7291171", "0.7072623", "0.69923115", "0.69607747", "0.66720223", "0.63932824", "0.62202746", "0.6182165", "0.6107353", "0.6037285", "0.59868747", "0.5980379", "0.59407884", "0.59111947", "0.5909157", "0.58858156", "0.58817166", "0.5831464", "0.5826283", "0.5820893", "0.57921904", "0.57842624", "0.57521456", "0.5719927", "0.5713271", "0.56974995", "0.5686912", "0.5682044", "0.563185", "0.56314564", "0.56301033", "0.55410814", "0.5531804", "0.55183476", "0.551561", "0.5512341", "0.55013037", "0.5486829", "0.5469657", "0.54563177", "0.54496807", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.54392934", "0.5436714", "0.5430121", "0.5397408", "0.53863627", "0.53831273", "0.53829557", "0.53796726", "0.53759414", "0.5374132", "0.53738445", "0.5358319", "0.53566694", "0.53498113", "0.53431183", "0.5342557", "0.5339794", "0.5339794", "0.5338648", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334798", "0.5334571", "0.5333916", "0.5331765", "0.5320558" ]
0.8874255
0
Gets the version of the product
public String getProductVersion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String getEISProductVersion() throws ResourceException {\n return repository.getDescriptor(Repository.REP_VERSION_DESC);\n }", "public String getVersion()\n {\n return ver;\n }", "public Version getVersion();", "int getCurrentVersion();", "public String getVersion () {\r\n return version;\r\n }", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public static String getVersion() {\n\t\treturn version;\r\n\t}", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public static String getVersion() {\n\t\treturn version;\n\t}", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n return version;\n }", "public String getVersion(){\r\n return version;\r\n }", "public String getVersion() {\r\n return version;\r\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion () {\n return this.version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public java.lang.String getVersion() {\r\n return version;\r\n }", "public String getVersion() {\n return version;\n }", "public static final String getVersion() { return version; }", "public static final String getVersion() { return version; }", "public String getVersion() {\n return _version;\n }", "public final String getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public Long getVersion() {\n return version;\n }", "public String getCurrentVersion() {\n return this.currentVersion;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String getVersion() {\n\t\treturn version;\n\t}", "public static String getVersion() {\r\n\t\treturn VERSION;\r\n\t}", "Version getVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "public static synchronized String getVersion(String name) {\r\n try {\r\n Document doc = getDocument();\r\n Element root = doc.getRootElement();\r\n Iterator iter = root.elementIterator(\"product\");\r\n while (iter.hasNext()) {\r\n Element product = (Element)iter.next();\r\n if (product.attributeValue(\"name\").equals(name)) {\r\n return product.attributeValue(\"version\");\r\n }\r\n }\r\n }\r\n catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }", "public String getVersion() {\r\n\t\treturn version;\r\n\t}", "String offerVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public String getVersion() {\n return this.version;\n }", "public String getVersion() {\n\t\treturn _version;\n\t}", "public long getVersion() {\n return version;\n }", "public long getVersion() {\n return version;\n }", "public String getVer() {\r\n return this.ver;\r\n }", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "public java.lang.String getVersion() {\n return version_;\n }", "public Number getVersion() {\n return (Number) getAttributeInternal(VERSION);\n }", "public Version getVersion() {\n return version;\n }", "public static String getAppVersion(){\r\n return getProperty(\"version\");\r\n }", "public String getVersion() {\n\t\treturn (VERSION);\n\t}", "public Integer getVer() {\n return ver;\n }", "java.lang.String getApplicationVersion();", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "public String getVersion() {\n return \"1.0.4-SNAPSHOT\";\n }", "Long getVersion();", "public int getVersion()\n {\n return info.getVersion().intValueExact();\n }", "public Long getNatProductVersion() {\n return this.NatProductVersion;\n }", "public static String getVersion() {\n\t\treturn \"0.9.4-SNAPSHOT\";\n\t}", "public Long getVersion() {\n return this.version;\n }", "public Long getVersion() {\n return this.version;\n }" ]
[ "0.7762599", "0.7355577", "0.73547435", "0.73122674", "0.73016304", "0.72783947", "0.72783947", "0.72783947", "0.72783947", "0.7269519", "0.72597057", "0.72534865", "0.72534865", "0.7250847", "0.72448206", "0.72448206", "0.7237518", "0.7220687", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.7218813", "0.72006404", "0.71961755", "0.71961755", "0.7184017", "0.71639955", "0.71585464", "0.71585464", "0.7151475", "0.71512735", "0.71505296", "0.71505296", "0.71505296", "0.71505296", "0.7142971", "0.71367997", "0.71367997", "0.71367997", "0.71367997", "0.71222115", "0.7111307", "0.710974", "0.710974", "0.710974", "0.710974", "0.71027976", "0.7100558", "0.70997554", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.70913744", "0.7081049", "0.707958", "0.7072301", "0.7072301", "0.70561737", "0.7053469", "0.7053469", "0.7053469", "0.7053469", "0.7053469", "0.7053469", "0.7053469", "0.7053469", "0.7044168", "0.70392346", "0.7029855", "0.7013014", "0.70111316", "0.7002131", "0.69894844", "0.6987489", "0.6987489", "0.6987489", "0.6987489", "0.6987489", "0.6985275", "0.6982062", "0.6981738", "0.6979708", "0.6975765", "0.69530356", "0.6951669", "0.6951669" ]
0.87450445
0
Gets the features included in this product
public Collection<String> getProvideFeature();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Feature> getFeatures();", "public FeatureSet getFeatures() {\n\treturn features;\n }", "@Nonnull\r\n public Set<Feature> getFeatures() {\r\n return features;\r\n }", "public List<String> getFeatures() {\n return features;\n }", "List<String> getFeatures();", "java.util.List<iet.distributed.telemetry.Feature> \n getFeatureList();", "public Set<String> getFeatures();", "java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();", "java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();", "public final native GEFeatureContainer getFeatures() /*-{\r\n\t\treturn this.getFeatures();\r\n\t}-*/;", "public Iterator<SimpleFeature> getFeatures() {\n \treturn this.iterator();\n }", "@Override\n public synchronized Set<FeatureType> getFeatures() {\n return features = nonNullSet(features, FeatureType.class);\n }", "public java.util.List getFeature() \n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{ \t\n \t\tList list = instance.getFeature(this.refMofId());\n \t\tlist.addAll(super_getFeature());\n \t\t\n \t\treturn list; \t\t\n \t}\n \n \treturn super_getFeature();\n }", "public Feature[] getFeatures() {\n Feature[] features = new Feature[rows.size()];\n for(int i=0;i<features.length;i++){\n features[i] = (Feature)rows.elementAt(i);\n }\n return features;\n }", "java.util.List<java.lang.String> getFeaturesList();", "List<IFeature> getFeatureList();", "public vis.smart.webservice.ProteinFeaturesFeature[] getFeature() {\n return feature;\n }", "public WebServiceFeature[] getFeatures() {\n\t\treturn null;\n\t}", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return SurfaceImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { SurfaceImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return SurfaceImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "public DasFeature[] getAllFeatures() {\n Vector feats = new Vector();\n while (iXml.indexOf(\"<FEATURE\", lastFeatureEndPosition + 9) != -1) {\n String feature = iXml.substring(iXml.indexOf(\"<FEATURE\", lastFeatureEndPosition + 9), iXml.indexOf(\"</FEATURE>\", lastFeatureEndPosition + 9) + 10);\n lastFeatureEndPosition = iXml.indexOf(\"</FEATURE>\", lastFeatureEndPosition + 9);\n if (feature.indexOf(\"<NOTE>No features found for the segment</NOTE>\") < 0) {\n DasFeature f = new DasFeature(feature);\n feats.add(f);\n }\n }\n DasFeature[] features = new DasFeature[feats.size()];\n feats.toArray(features);\n return features;\n }", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return IntersectionImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { IntersectionImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return IntersectionImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "public FeatureCursor queryFeatures() {\n return featureDao.queryIn(queryIdsSQL());\n }", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return GPSSetupImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { GPSSetupImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return GPSSetupImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "public FeatureElements getFeatureAccess() {\n\t\treturn pFeature;\n\t}", "protected Vector getFeatureSet()\n {\n // get the superclass' vector\n Vector v = super.getFeatureSet();\n\n // add the features\n\n // return the vector\n return v;\n }", "public String getFeature() {\r\n return feature;\r\n }", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$14, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public Feature[] getFeatures() throws JsonMappingException, IOException {\n \tfinal String uri = \"http://localhost:12300/featureflags\";\n RestTemplate restTemplate = new RestTemplate();\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n HttpEntity<String> entity = new HttpEntity<String>(\"parameters\", headers);\n ResponseEntity<String> result = restTemplate.exchange(uri, HttpMethod.GET, entity, String.class);\n String body = result.getBody();\n ObjectMapper mapper = new ObjectMapper();\n Feature[] features = mapper.readValue(body, Feature[].class);\n return features;\n }", "org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();", "org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();", "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 }", "java.lang.String getFeatures(int index);", "java.util.List<org.landxml.schema.landXML11.PlanFeatureDocument.PlanFeature> getPlanFeatureList();", "public Integer getFeature() {\n return feature;\n }", "long getFeaturesUsed();", "List<PolicyEngineFeatureApi> getFeatureProviders();", "private List<String> extractFeatures() {\n List<String> result = new ArrayList<String>();\n\n int startPoint = -1;\n\n List<TextPosition> featureItem;\n for (int i = 0; i < infoBlock.size(); i++) {\n // To get index of the text in the information block, if the text does not exist, the index will be -1.\n int index = CommonUtils.collectTextBuffer(infoBlock.get(i)).indexOf(FEATURE_KEY);\n if (index != -1) {\n startPoint = i + 1;\n\n // To locate the PDF object from the text feature to the end of the information block.\n featureItem = infoBlock.get(i).subList(index, index + FEATURE_KEY.length());\n\n // To extract information vertically. startPoint now is where the information block next to the\n // one that contains text feature.\n if (startPoint != -1) {\n result = filterTextBuffersVerical(featureItem, infoBlock, startPoint, 10);\n/*\t\t\t\t\t\tfor(String item: result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(item);\n\t\t\t\t\t\t}*/\n }\n\n break;\n }\n }\n\n return result;\n }", "public Features getFeatures (SootMethod method) {\n if (propagatedFeaturesMap.containsKey(method)) {\n return propagatedFeaturesMap.get(method);\n } else if (featuresMap.containsKey(method)) {\n return featuresMap.get(method);\n } else if (featuresLibMap.containsKey(method)) {\n return featuresLibMap.get(method);\n } else {\n Features features = new Features(method);\n featuresLibMap.put(method, features);\n return features;\n }\n }", "public String feature() {\n return feature;\n }", "Collection<Feature> getReference();", "iet.distributed.telemetry.Feature getFeature(int index);", "@Override\n public synchronized Set<FeatureType> getFeatureInstances() {\n return featureInstances = nonNullSet(featureInstances, FeatureType.class);\n }", "public AbstractMFeature2 getFeature() {\n return feature;\n }", "private List<WebServiceFeature> getFeatures(AssertionSet alternative) {\n return Collections.emptyList();\n }", "public int getNumberOfFeatures() {\n\t\treturn numberOfFeatures;\n\t}", "com.google.protobuf.ByteString getFeaturesBytes(int index);", "public org.pentaho.pms.cwm.pentaho.meta.core.CwmStructuralFeature getFeature();", "String getFeature();", "String getFeature();", "public static String supportedFeatures() {\n\t\tStringBuilder buf = new StringBuilder(\"Filesystem features: \");\n\n\t\tClass<Feature> c = Feature.class;\n\t\tfor (Method m : c.getDeclaredMethods()) {\n\t\t\tint mod = m.getModifiers();\n\t\t\tString name = m.getName();\n\n\t\t\tif (!name.equals(\"supportedFeatures\") && Modifier.isStatic(mod) && Modifier.isPublic(mod)) {\n\t\t\t\ttry {\n\t\t\t\t\tboolean ret = (Boolean)m.invoke(null);\n\t\t\t\t\tif (ret) {\n\t\t\t\t\t\tbuf.append(m.getName());\n\t\t\t\t\t\tbuf.append(\" \");\n\t\t\t\t\t}\n\t\t\t\t} catch (IllegalArgumentException ignored) {\n\t\t\t\t} catch (IllegalAccessException ignored) {\n\t\t\t\t} catch (InvocationTargetException ignored) {\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tbuf.append(\"\\n\");\n\t\treturn buf.toString();\n\t}", "public ArrayList<Feature> getAlternativeFeatures(){\r\n\t\tArrayList<Feature> res = new ArrayList<Feature>();\r\n\t\t//The first feature group contains variant fatures\r\n\t\tFeatureGroup featureGroup = null;\r\n\t\tfor(int i = 1; i < this.getAlternativeFeatureGroup().size(); i++ ){\r\n\t\t\tfeatureGroup = this.getAlternativeFeatureGroup().get(i);\r\n\t\t\tfor(int j = 0; j < featureGroup.getFeatures().size(); j++){\r\n\t\t\t\tres.add(featureGroup.getFeatures().get(j));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t\t\r\n\t}", "org.landxml.schema.landXML11.FeatureDocument.Feature getFeatureArray(int i);", "org.landxml.schema.landXML11.FeatureDocument.Feature getFeatureArray(int i);", "public java.util.List<sparqles.avro.analytics.EPViewInteroperabilityData> getSPARQL11Features() {\n return SPARQL11Features;\n }", "Feature getFeature();", "Feature getFeature();", "boolean hasFeaturesUsed();", "Collection<StructuralFeature> getTypedFeatures();", "public int getFeaturesCount();", "public java.util.List<sparqles.avro.analytics.EPViewInteroperabilityData> getSPARQL11Features() {\n return SPARQL11Features;\n }", "public Integer getProductFeatureId() {\r\n\t\treturn productFeatureId;\r\n\t}", "public Iterator<Feature> featureIterator(){\n\t\treturn indexByFeature.keySet().iterator();\n\t}", "public FSList getProducts() {\n if (Reaction_Type.featOkTst && ((Reaction_Type)jcasType).casFeat_products == null)\n jcasType.jcas.throwFeatMissing(\"products\", \"uk.ac.bbk.REx.types.Reaction\");\n return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Reaction_Type)jcasType).casFeatCode_products)));}", "public final Set<AnalysisFeature<?>> getOutputFeatures() {\n return outputFeatures;\n }", "java.util.List<? extends iet.distributed.telemetry.FeatureOrBuilder> \n getFeatureOrBuilderList();", "public int getFeatureCount() {\n\r\n\t\treturn _features.length;\r\n\t}", "public void setFeatures(List<String> features) {\n this.features = features;\n }", "public List<Product> findHot() {\n\t\t\treturn productDao.findHot();\n\t\t}", "public java.lang.Boolean getFeatureCapabilitiesSupported() {\r\n return featureCapabilitiesSupported;\r\n }", "FeatureProvider getFeatureProvider() {\n return this.provider;\n }", "Iterator features();", "int getFeaturesCount();", "public ListOfOnixElement<ResourceFileFeatureDescription, String> resourceFileFeatureDescriptions() {\n _initialize();\n return resourceFileFeatureDescriptions;\n }", "public Features() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "private String[] detectFeatures() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tfeaturesChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.featuresChangeStampIsValid = false;\n \n \t\t\tfeatures = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate feature entries on site\n \t\t\tFile siteRoot = new File(resolvedURL.getFile().replace('/', File.separatorChar));\n \t\t\tFile root = new File(siteRoot, FEATURES);\n \n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + FEATURE_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tfeatures.add(FEATURES + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + features.size() + \" feature(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) features.toArray(new String[0]);\n \t\t}", "List<FeatureController<MODEL>> getFeatureControllers() {\n return featureItems.getFeatureControllers();\n }", "public java.lang.String getClientFeatures(int index) {\n return clientFeatures_.get(index);\n }", "iet.distributed.telemetry.FeatureOrBuilder getFeatureOrBuilder(\n int index);", "private Map<String, Feature> initializeFeatures(GameState state) {\n // initializes the features (values will be set within getFeatures)\n Map<String, Feature> features = new HashMap<>();\n\n // adds the 'global' features\n features.put(FeatureNames.RESOURCES_OWN, new Feature(FeatureNames.RESOURCES_OWN, 0, 0, 20));\n features.put(FeatureNames.RESOURCES_OPP, new Feature(FeatureNames.RESOURCES_OPP, 0, 0, 20));\n features.put(FeatureNames.GAME_TIME, new Feature(FeatureNames.GAME_TIME, 0, 0, 12000));\n features.put(FeatureNames.BIAS, new Feature(FeatureNames.BIAS, 1, 0, 1));\n\n // adds the 'per-quadrant' features\n int horizQuadLength = state.getPhysicalGameState().getWidth() / numQuadrants;\n int vertQuadLength = state.getPhysicalGameState().getHeight() / numQuadrants;\n\n int tilesPerQuadrant = horizQuadLength * vertQuadLength;\n\n // FIXME hardcoded to the HP of the base (which is the highest in microRTS)\n int maxHitPoints = 10;\n\n // the first two for traverse the quadrants\n for (int horizQuad = 0; horizQuad < numQuadrants; horizQuad++) {\n for (int vertQuad = 0; vertQuad < numQuadrants; vertQuad++) {\n\n // the third for traverses the players\n for (int player = 0; player < 2; player++) {\n String healthFeatName = FeatureNames.avgHealthPerQuad(horizQuad, vertQuad, player);\n\n features.put(healthFeatName, new Feature(healthFeatName, 0, 0, tilesPerQuadrant * maxHitPoints));\n\n // the fourth for traverses the unit types\n for (UnitType type : state.getUnitTypeTable().getUnitTypes()) {\n if (type.isResource)\n continue; // ignores resources\n String countFeatName = FeatureNames.unitsOfTypePerQuad(horizQuad, vertQuad, player, type);\n features.put(countFeatName, new Feature(countFeatName, 0, 0, tilesPerQuadrant));\n }\n }\n }\n }\n\n return features;\n }", "FTCommand getFeature();", "@RequestLine(\"GET /v1/users/{userId}/features\")\n @Headers({\n \"Accept: application/json\",\n })\n List<Feature> listFeaturesUsers(@Param(\"userId\") String userId);", "public FeatureCollection<SimpleFeatureType,SimpleFeature> getCollection() {\n return (SimpleFeatureCollection) collection;\n }", "ArrayList<Feature> getFeatures(String userid, String project)throws Exception;", "public java.lang.String getClientFeatures(int index) {\n return clientFeatures_.get(index);\n }", "public String getTapOccurrenceFeatures() {\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString();\n }", "public Feature[] getFeatures(Extent ex) throws DataSourceException {\n //TODO: this diff when not null bit could be more elegent\n Extent toLoad[];\n if(loadedExtent!=null){\n toLoad = loadedExtent.difference(ex);\n }\n else{\n toLoad = new Extent[]{ex};\n }\n \n for(int i=0;i<toLoad.length;i++){\n //TODO: move this code to its own method?\n if(toLoad[i]!=null){\n datasource.importFeatures(this,toLoad[i]);\n if(loadedExtent==null){\n loadedExtent = toLoad[i];\n }\n else{\n loadedExtent = loadedExtent.combine(toLoad[i]);\n }\n }\n }\n return getFeatures();\n }", "@Override\n public String getFeature() {\n return this.exteriorFeature;\n }", "public HashMap<Position, RoadFeature> getCoveredFeatures() { return coveredFeatures; }", "public Set<SimpleFeature> getFeatures(Name name) throws Exception {\n\t\tif (typeNameIndex.get(name)==null) throw new Exception(\"Type not found\");\n\t\treturn typeNameIndex.get(name);\n\t}", "public ComponentFeature getFeature(int index) {\r\n\t\tif (index >= features.length)\r\n\t\t\treturn null;\r\n\r\n\t\treturn features[index];\r\n\t}", "@Override\n public Class<? extends Feature> getFeatureClass() {\n\treturn VersionFeatures.class;\n }", "@Override\n public FeatureContainer getFeatureContainer() {\n return featureContainer;\n }", "public com.google.protobuf.ProtocolStringList\n getClientFeaturesList() {\n return clientFeatures_;\n }", "@ApiModelProperty(value = \"The features of the OS that the artifact applys to\")\n public List<String> getOsFeatures() {\n return osFeatures;\n }", "public Collection<String> getRequireFeature();", "@Override\n\t\tpublic List<ProductInfo> getProducts() {\n\t\t\treturn TargetProducts;\n\t\t}", "public static List<Feature> getList(int id) throws SQLException {\r\n\t\tString VideoIdColumnName = \"VIDEO_ID\";\r\n\t\tResultSet rs = operation.getRow(\"VENDOR_MODEL\", VideoIdColumnName, id);\r\n\t\t\t\t\r\n\t\tList<Feature> list = new ArrayList<Feature>();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t\t\r\n\t\t\tFeature feature = new Feature()\r\n\t\t\t\t\t.setFeatureId(rs.getString(\"FEATURE_ID\"))\r\n\t\t\t\t\t.setVideoId(rs.getString(\"VIDEO_ID\"))\r\n\t\t\t\t\t.setFeatureName(rs.getString(\"FEATURE_NAME\"))\r\n\t\t\t\t\t.setFeatureVector(rs.getString(\"FEATURE_VECTOR\"))\r\n\t\t\t\t\t.setCreationDate(rs.getString(\"CREATION_DATE\"));\r\n\r\n\t\t\tlist.add(feature);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(list.size());\r\n\t\treturn list;\r\n\t}", "public IDataSet extractFeatures(String featureType);" ]
[ "0.8055995", "0.77862865", "0.7673076", "0.7645578", "0.7557232", "0.73792696", "0.7367158", "0.7190845", "0.7190845", "0.7161573", "0.715554", "0.7092604", "0.7071797", "0.70208555", "0.6999656", "0.69833374", "0.6877577", "0.6863652", "0.66978735", "0.666207", "0.66570026", "0.6614234", "0.66089433", "0.6592049", "0.65909207", "0.65672565", "0.6553503", "0.6553503", "0.65511304", "0.65493757", "0.65451056", "0.65451056", "0.65328836", "0.64565176", "0.6444103", "0.6414102", "0.6388539", "0.6367343", "0.636311", "0.62652326", "0.62464935", "0.6244156", "0.6230918", "0.6226889", "0.6189783", "0.61866546", "0.61698455", "0.61552554", "0.6150495", "0.6139164", "0.6139164", "0.6132758", "0.61311495", "0.6124199", "0.6124199", "0.611648", "0.6091838", "0.6091838", "0.60915947", "0.60842013", "0.6070655", "0.6068105", "0.60431355", "0.60359126", "0.6009658", "0.59869814", "0.59744865", "0.5970695", "0.594178", "0.59274805", "0.59215105", "0.59153706", "0.5904556", "0.5894953", "0.58948916", "0.5887055", "0.58708394", "0.58538103", "0.5847357", "0.5843076", "0.5833837", "0.58290565", "0.5825266", "0.5821276", "0.58199877", "0.58179283", "0.5809827", "0.57988566", "0.5797729", "0.5791209", "0.5784062", "0.57835007", "0.5777972", "0.5773473", "0.5750976", "0.57489127", "0.5746725", "0.57433754", "0.57411236", "0.5727226" ]
0.6726068
18
Gets the features that this product depends on
public Collection<String> getRequireFeature();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Feature> getFeatures();", "java.util.List<iet.distributed.telemetry.Feature> \n getFeatureList();", "public java.util.List getFeature() \n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{ \t\n \t\tList list = instance.getFeature(this.refMofId());\n \t\tlist.addAll(super_getFeature());\n \t\t\n \t\treturn list; \t\t\n \t}\n \n \treturn super_getFeature();\n }", "public FeatureDependencyElements getFeatureDependencyAccess() {\r\n\t\treturn pFeatureDependency;\r\n\t}", "public FeatureSet getFeatures() {\n\treturn features;\n }", "Collection<Feature> getReference();", "public Collection<String> getProvideFeature();", "java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();", "java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();", "@Nonnull\r\n public Set<Feature> getFeatures() {\r\n return features;\r\n }", "public List<String> getFeatures() {\n return features;\n }", "List<String> getFeatures();", "public WebServiceFeature[] getFeatures() {\n\t\treturn null;\n\t}", "public Set<String> getFeatures();", "java.util.List<org.landxml.schema.landXML11.PlanFeatureDocument.PlanFeature> getPlanFeatureList();", "public final native GEFeatureContainer getFeatures() /*-{\r\n\t\treturn this.getFeatures();\r\n\t}-*/;", "@Override\n public synchronized Set<FeatureType> getFeatures() {\n return features = nonNullSet(features, FeatureType.class);\n }", "public FeatureElements getFeatureAccess() {\n\t\treturn pFeature;\n\t}", "public Feature[] getFeatures() {\n Feature[] features = new Feature[rows.size()];\n for(int i=0;i<features.length;i++){\n features[i] = (Feature)rows.elementAt(i);\n }\n return features;\n }", "private String[] detectFeatures() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tfeaturesChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.featuresChangeStampIsValid = false;\n \n \t\t\tfeatures = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate feature entries on site\n \t\t\tFile siteRoot = new File(resolvedURL.getFile().replace('/', File.separatorChar));\n \t\t\tFile root = new File(siteRoot, FEATURES);\n \n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + FEATURE_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tfeatures.add(FEATURES + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + features.size() + \" feature(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) features.toArray(new String[0]);\n \t\t}", "Feature getFeature();", "Feature getFeature();", "List<IFeature> getFeatureList();", "boolean hasFeaturesUsed();", "long getFeaturesUsed();", "public Iterator<SimpleFeature> getFeatures() {\n \treturn this.iterator();\n }", "org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();", "org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();", "public Feature[] getFeatures() throws JsonMappingException, IOException {\n \tfinal String uri = \"http://localhost:12300/featureflags\";\n RestTemplate restTemplate = new RestTemplate();\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n HttpEntity<String> entity = new HttpEntity<String>(\"parameters\", headers);\n ResponseEntity<String> result = restTemplate.exchange(uri, HttpMethod.GET, entity, String.class);\n String body = result.getBody();\n ObjectMapper mapper = new ObjectMapper();\n Feature[] features = mapper.readValue(body, Feature[].class);\n return features;\n }", "iet.distributed.telemetry.Feature getFeature(int index);", "public IPath[] getAdditionalDependencies();", "private boolean evaluateForFeatureDependency(BaseFeature feature) {\n\t\tif (!feature.getClass().getSuperclass().equals(BaseFeature.class)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (BaseFeature featureBase : features) {\n\t\t\tif (CollectionUtils.isNotEmpty(featureBase.getRequiredFeatures())) {\n\t\t\t\tfor (BaseFeature requiredFeature : featureBase.getRequiredFeatures()) {\n\t\t\t\t\tif (feature == requiredFeature) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$14, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "@RequiresLock(\"SeaLock\")\r\n @Vouch(\"controlled alias of f_dependents for performance\")\r\n protected final Set<Drop> getDependentsReference() {\r\n return f_dependents;\r\n }", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "@Override\n public String getFeature() {\n return this.exteriorFeature;\n }", "java.util.List<java.lang.String> getFeaturesList();", "public abstract List<QualifiedName> getAffectedFeatureTypes();", "private List<WebServiceFeature> getFeatures(AssertionSet alternative) {\n return Collections.emptyList();\n }", "public vis.smart.webservice.ProteinFeaturesFeature[] getFeature() {\n return feature;\n }", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return GPSSetupImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { GPSSetupImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return GPSSetupImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "java.util.List<? extends iet.distributed.telemetry.FeatureOrBuilder> \n getFeatureOrBuilderList();", "public Features getFeatures (SootMethod method) {\n if (propagatedFeaturesMap.containsKey(method)) {\n return propagatedFeaturesMap.get(method);\n } else if (featuresMap.containsKey(method)) {\n return featuresMap.get(method);\n } else if (featuresLibMap.containsKey(method)) {\n return featuresLibMap.get(method);\n } else {\n Features features = new Features(method);\n featuresLibMap.put(method, features);\n return features;\n }\n }", "@Override\n public Class<? extends Feature> getFeatureClass() {\n\treturn VersionFeatures.class;\n }", "Collection<StructuralFeature> getTypedFeatures();", "List<PolicyEngineFeatureApi> getFeatureProviders();", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return SurfaceImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { SurfaceImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return SurfaceImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "public String getFeature() {\r\n return feature;\r\n }", "public final HashSet<Drop> getDependents() {\r\n synchronized (f_seaLock) {\r\n return new HashSet<>(f_dependents);\r\n }\r\n }", "public DasFeature[] getAllFeatures() {\n Vector feats = new Vector();\n while (iXml.indexOf(\"<FEATURE\", lastFeatureEndPosition + 9) != -1) {\n String feature = iXml.substring(iXml.indexOf(\"<FEATURE\", lastFeatureEndPosition + 9), iXml.indexOf(\"</FEATURE>\", lastFeatureEndPosition + 9) + 10);\n lastFeatureEndPosition = iXml.indexOf(\"</FEATURE>\", lastFeatureEndPosition + 9);\n if (feature.indexOf(\"<NOTE>No features found for the segment</NOTE>\") < 0) {\n DasFeature f = new DasFeature(feature);\n feats.add(f);\n }\n }\n DasFeature[] features = new DasFeature[feats.size()];\n feats.toArray(features);\n return features;\n }", "public org.pentaho.pms.cwm.pentaho.meta.core.CwmStructuralFeature getFeature();", "public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return IntersectionImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { IntersectionImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return IntersectionImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }", "public List<Integer> getDependsOn() {\r\n return dependsOn;\r\n }", "private List<String> extractFeatures() {\n List<String> result = new ArrayList<String>();\n\n int startPoint = -1;\n\n List<TextPosition> featureItem;\n for (int i = 0; i < infoBlock.size(); i++) {\n // To get index of the text in the information block, if the text does not exist, the index will be -1.\n int index = CommonUtils.collectTextBuffer(infoBlock.get(i)).indexOf(FEATURE_KEY);\n if (index != -1) {\n startPoint = i + 1;\n\n // To locate the PDF object from the text feature to the end of the information block.\n featureItem = infoBlock.get(i).subList(index, index + FEATURE_KEY.length());\n\n // To extract information vertically. startPoint now is where the information block next to the\n // one that contains text feature.\n if (startPoint != -1) {\n result = filterTextBuffersVerical(featureItem, infoBlock, startPoint, 10);\n/*\t\t\t\t\t\tfor(String item: result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(item);\n\t\t\t\t\t\t}*/\n }\n\n break;\n }\n }\n\n return result;\n }", "Set<String> getDependencies();", "public Feature[] getFeatures(Extent ex) throws DataSourceException {\n //TODO: this diff when not null bit could be more elegent\n Extent toLoad[];\n if(loadedExtent!=null){\n toLoad = loadedExtent.difference(ex);\n }\n else{\n toLoad = new Extent[]{ex};\n }\n \n for(int i=0;i<toLoad.length;i++){\n //TODO: move this code to its own method?\n if(toLoad[i]!=null){\n datasource.importFeatures(this,toLoad[i]);\n if(loadedExtent==null){\n loadedExtent = toLoad[i];\n }\n else{\n loadedExtent = loadedExtent.combine(toLoad[i]);\n }\n }\n }\n return getFeatures();\n }", "public ListOfOnixElement<ResourceFileFeatureDescription, String> resourceFileFeatureDescriptions() {\n _initialize();\n return resourceFileFeatureDescriptions;\n }", "public final Set<AnalysisFeature<?>> getOutputFeatures() {\n return outputFeatures;\n }", "public static String supportedFeatures() {\n\t\tStringBuilder buf = new StringBuilder(\"Filesystem features: \");\n\n\t\tClass<Feature> c = Feature.class;\n\t\tfor (Method m : c.getDeclaredMethods()) {\n\t\t\tint mod = m.getModifiers();\n\t\t\tString name = m.getName();\n\n\t\t\tif (!name.equals(\"supportedFeatures\") && Modifier.isStatic(mod) && Modifier.isPublic(mod)) {\n\t\t\t\ttry {\n\t\t\t\t\tboolean ret = (Boolean)m.invoke(null);\n\t\t\t\t\tif (ret) {\n\t\t\t\t\t\tbuf.append(m.getName());\n\t\t\t\t\t\tbuf.append(\" \");\n\t\t\t\t\t}\n\t\t\t\t} catch (IllegalArgumentException ignored) {\n\t\t\t\t} catch (IllegalAccessException ignored) {\n\t\t\t\t} catch (InvocationTargetException ignored) {\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tbuf.append(\"\\n\");\n\t\treturn buf.toString();\n\t}", "public int getIntrinsicDependencies() {\n int d = super.getIntrinsicDependencies();\n if (argument.length == 0) {\n d |= StaticProperty.DEPENDS_ON_CONTEXT_ITEM;\n }\n return d;\n }", "String getFeature();", "String getFeature();", "public static Feature[] getFeaturesInFenceOrInLayer(PlugInContext context, Layer layer) {\r\n SelectionTools st = new SelectionTools(context);\r\n Feature[] featureToBeUsed = null;\r\n\r\n if (st.getFenceGeometry() == null) {\r\n featureToBeUsed = FeatureCollectionTools.FeatureCollection2FeatureArray(layer.getFeatureCollectionWrapper().getUltimateWrappee());\r\n } else {\r\n featureToBeUsed = SelectionTools.getFeaturesInFenceInLayer(layer, st.getFenceGeometry());\r\n }\r\n\r\n return featureToBeUsed;\r\n }", "public Set< UseCase > useCaseDependencies() {\r\n\t\tSet< UseCase > useCases = new LinkedHashSet< UseCase >();\r\n\t\tList< Step > steps = getSteps();\r\n\t\tfor ( Step s : steps ) {\r\n\t\t\tif ( ! s.kind().equals( StepKind.USE_CASE_CALL ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tUseCaseCallStep uccs = (UseCaseCallStep) s;\r\n\t\t\tuseCases.add( uccs.getUseCase() ); // Add the use case (if not already exists)\r\n\t\t}\r\n\t\treturn useCases;\r\n\t}", "public String[] getResolvedDependencies();", "Requires getRequires();", "public ArrayList<Feature> getAlternativeFeatures(){\r\n\t\tArrayList<Feature> res = new ArrayList<Feature>();\r\n\t\t//The first feature group contains variant fatures\r\n\t\tFeatureGroup featureGroup = null;\r\n\t\tfor(int i = 1; i < this.getAlternativeFeatureGroup().size(); i++ ){\r\n\t\t\tfeatureGroup = this.getAlternativeFeatureGroup().get(i);\r\n\t\t\tfor(int j = 0; j < featureGroup.getFeatures().size(); j++){\r\n\t\t\t\tres.add(featureGroup.getFeatures().get(j));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t\t\r\n\t}", "public String[] getDependencies()\r\n {\r\n return m_dependencies;\r\n }", "public AbstractMFeature2 getFeature() {\n return feature;\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 }", "@RequiresLock(\"SeaLock\")\r\n @Vouch(\"controlled alias of f_dependents for performance\")\r\n protected final Set<Drop> getDeponentsReference() {\r\n return f_deponents;\r\n }", "public static interface AdditionalFeature {\n\n\t\tString getAdditionalFeature();\n\t}", "org.landxml.schema.landXML11.PlanFeatureDocument.PlanFeature[] getPlanFeatureArray();", "public String feature() {\n return feature;\n }", "public Integer getFeature() {\n return feature;\n }", "org.landxml.schema.landXML11.FeatureDocument.Feature getFeatureArray(int i);", "org.landxml.schema.landXML11.FeatureDocument.Feature getFeatureArray(int i);", "FeatureProvider getFeatureProvider() {\n return this.provider;\n }", "FeatureCall getFec();", "private LinkedList<String> getActivatedFeatureArgs(\r\n\t\t\tList<String> myActivatedFeatures) {\r\n\t\tLinkedList<String> args = new LinkedList<String>();\r\n\t\tfor (String feature : myActivatedFeatures) {\r\n\t\t\targs.add(\"-D\" + feature);\r\n\t\t}\r\n\t\treturn args;\r\n\r\n\t}", "protected Vector getFeatureSet()\n {\n // get the superclass' vector\n Vector v = super.getFeatureSet();\n\n // add the features\n\n // return the vector\n return v;\n }", "public List<String> getDependencies() {\n return new ArrayList<>(mDependencies);\n }", "public final ImageDimension[] getDependency()\n {\n return dependency;\n }", "public List getDependencies() {\n return Collections.unmodifiableList(dependencies);\n }", "public final List<DepFunction> getFunctions() {\n\t\treturn new LinkedList<>(this.functionMap.values());\n\t}", "iet.distributed.telemetry.FeatureOrBuilder getFeatureOrBuilder(\n int index);", "public org.pentaho.pms.cwm.pentaho.meta.expressions.CwmFeatureNode getFeatureNode();", "public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {\n/* 457 */ return new CompositeIterator(this.elResolvers, this.size, context, base);\n/* */ }", "String getApplicationDependencies();", "@Override\n\tpublic Collection<Class<? extends IFloodlightService>> getModuleDependencies() {\n\t\tCollection<Class<? extends IFloodlightService>> l =\n\t\t new ArrayList<Class<? extends IFloodlightService>>();\n\t\t l.add(IFloodlightProviderService.class);\n\t\t l.add(ITopologyService.class);\n\t\t return l;\n\t}", "java.lang.String getFeatures(int index);", "public ComponentFeature getFeature(int index) {\r\n\t\tif (index >= features.length)\r\n\t\t\treturn null;\r\n\r\n\t\treturn features[index];\r\n\t}", "public Set<ModuleRevisionId> getDependencies() { return this.dependencies; }", "@Stub\n\tpublic String[] getDependencies()\n\t{\n\t\treturn new String[] {};\n\t}", "protected void addFeaturesPropertyDescriptor(Object object) {\n itemPropertyDescriptors.add\n (createItemPropertyDescriptor\n (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n getResourceLocator(),\n getString(\"_UI_Reference_features_feature\"),\n getString(\"_UI_PropertyDescriptor_description\", \"_UI_Reference_features_feature\", \"_UI_Reference_type\"),\n NoSQLSchemaPackage.Literals.REFERENCE__FEATURES,\n true,\n false,\n true,\n null,\n null,\n null));\n }", "@Override\n public FeatureContainer getFeatureContainer() {\n return featureContainer;\n }", "public String getHoldingHandFeatures() {\n double[] angle = new double[] {getAngle(linAccSample)};\n\n // 15 linear accelerometer features (means etc across 3 axes)\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n angle,\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString();\n }", "public com.google.protobuf.ProtocolStringList\n getClientFeaturesList() {\n return clientFeatures_;\n }", "public String[] getUnresolvedDependencies();" ]
[ "0.66412234", "0.664028", "0.6566074", "0.65434813", "0.64407855", "0.63807654", "0.6312146", "0.63080114", "0.63080114", "0.6275546", "0.62729007", "0.62291664", "0.6091692", "0.5980149", "0.59268516", "0.5914572", "0.5875133", "0.5844355", "0.5817895", "0.58163947", "0.58055407", "0.58055407", "0.5803217", "0.5798479", "0.5796513", "0.5784809", "0.578115", "0.578115", "0.5752267", "0.5737483", "0.5731697", "0.57169026", "0.57132363", "0.57093805", "0.5701724", "0.5701724", "0.5694828", "0.5687936", "0.5681387", "0.56652105", "0.56600374", "0.5656652", "0.5650109", "0.56495255", "0.563982", "0.5624265", "0.5599831", "0.5594788", "0.5588389", "0.5586178", "0.5580089", "0.5528903", "0.5514259", "0.55111253", "0.5496356", "0.54369473", "0.5430954", "0.5427607", "0.54248977", "0.5421386", "0.54087526", "0.5403934", "0.5403934", "0.5393223", "0.5392209", "0.5389172", "0.5375991", "0.53704613", "0.5363828", "0.53634405", "0.5355718", "0.5340596", "0.533858", "0.5329881", "0.53161466", "0.53158253", "0.5301048", "0.5301048", "0.52975404", "0.5268728", "0.52637696", "0.5238035", "0.5228092", "0.5221958", "0.52075756", "0.5204254", "0.5202161", "0.52009654", "0.51854867", "0.51611257", "0.5157495", "0.5149684", "0.5145855", "0.51444155", "0.513316", "0.513314", "0.5129325", "0.51270765", "0.5124876", "0.5124678" ]
0.60494995
13
Gets the collection of OSGi requirements this product has
public Collection<Requirement> getGenericRequirements();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract List<AbstractRequirement> getRequirements();", "public List<? extends Requirement> getRequirements();", "ImmutableList<ResourceRequirement> getRequirements();", "public String getRequirements() { \n\t\treturn getRequirementsElement().getValue();\n\t}", "public java.util.List<DocumentRequires> getRequires() {\n if (requires == null) {\n requires = new com.amazonaws.internal.SdkInternalList<DocumentRequires>();\n }\n return requires;\n }", "Requires getRequires();", "public Collection<String> getRequireFeature();", "public String getProductServiceSpecificationOperationalRequirements() {\n return productServiceSpecificationOperationalRequirements;\n }", "protected void getRequires() {\n System.out.println(\"\\nRequires: \");\n /******************************************/\n myIterator.next();\n myRequires = new Expression(myIterator, mye);\n /******************************************/\n System.out.println(\"\\n\");\n }", "public Requirement getRequirement() {\n return requirement;\n }", "@Override\n\tpublic Set<PartType> getRequirements(PartType reference) {\n\t\treturn null;\n\t}", "Collection<? extends Equipment> getUses();", "public Map<String, NGPackageSpecification<WebObjectSpecification>> getWebComponentSpecifications()\n\t{\n\t\treturn reader.getWebComponentSpecifications();\n\t}", "public String[] requires() { return new String[0]; }", "private List<String> initializeRequiredCapabilities() {\n // Required device capabilities\n\n String[] capabilityEntries = {V3PO_CAPABILITY, INTERFACES_CAPABILITY};\n return Arrays.asList(capabilityEntries);\n }", "Set<Capability> getAvailableCapability();", "com.microsoft.schemas.crm._2011.contracts.ArrayOfRequiredResource getRequiredResources();", "public Collection<String> getProvideFeature();", "Quality_requirements_metamodelPackage getQuality_requirements_metamodelPackage();", "public java.lang.String getRequires()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(REQUIRES$28);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public Field getPerformanceRequirements() {\n\t\treturn _performanceReq;\n\t}", "@Override\n\tpublic List<Product_Requirement> findByName(String name) {\n\t\treturn productR.findByName(name);\n\t}", "public StringDt getRequirementsElement() { \n\t\tif (myRequirements == null) {\n\t\t\tmyRequirements = new StringDt();\n\t\t}\n\t\treturn myRequirements;\n\t}", "public String getProductServiceSpecificationUsageGuidelines() {\n return productServiceSpecificationUsageGuidelines;\n }", "Set<String> getDependencies();", "public WebObjectSpecification[] getAllWebComponentSpecifications()\n\t{\n\t\treturn reader.getAllWebComponentSpecifications();\n\t}", "public String getProductServiceSpecificationAllowedUsage() {\n return productServiceSpecificationAllowedUsage;\n }", "@Override\n\tpublic Map<Ingredient, Integer> getRequirementsForABeverage(String beverage){\n\t\treturn requirementSpecificationMap.get(beverage);\n\t}", "public String getExperienceRequirements() {\r\n return experienceRequirements;\r\n }", "public List<Constraint> getConstraints();", "public Set<String> getAvailableProducts() {\n\t\treturn availableProducts.keySet();\n\t}", "public List<String> getRequired() {\n\t\treturn required;\n\t}", "@Programmatic\n public Collection<ObjectSpecification> allSpecifications() {\n return Lists.newArrayList(allCachedSpecifications());\n }", "private boolean hasRequirements() {\n \t\tif (checkHasRequirements) {\n \t\t\thasRequirements = pullRequired(requiredInput, false);\n \t\t\tcheckHasRequirements = false;\n \t\t}\n \t\treturn hasRequirements;\n \t}", "protected StoreComp.Requires requires() {\n assert this.selfComponent != null: \"This is a bug.\";\n if (!this.init) {\n \tthrow new RuntimeException(\"requires() can't be accessed until a component has been created from this implementation, use start() instead of the constructor if requires() is needed to initialise the component.\");\n }\n return this.selfComponent.bridge;\n }", "public List<ContextConstraint> getConstraints() {\n return getConstraintList();\n }", "protected DListUI<IC_OperationsForList> createRequirementsField() {\r\n\t\tAbstractModelController mc = new AbstractModelController() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Object getValue() {\r\n\t\t\t\treturn _updateState.getDefinition().getRequirements();\r\n\t\t\t}\r\n\r\n\t\t\tpublic void notifieValueChanged(UIField field, Object value) {\r\n\t\t\t\t// do nothing\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// retrieve list of update operations\r\n\t\tIC_OperationsForList ic = new IC_OperationsForList(_updateState, OperationCategory.REQUIREMENTS) {\r\n\t\t\t@Override\r\n\t\t\tpublic void initAfterUI() {\r\n\t\t\t\tsuper.initAfterUI();\r\n\r\n\t\t\t\t((FilteredTree) _requirementsField.getMainControl()).getViewer()\r\n\t\t\t\t\t\t.addSelectionChangedListener(\r\n\t\t\t\t\t\t\t\tnew ISelectionChangedListener() {\r\n\r\n\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\tpublic void selectionChanged(\r\n\t\t\t\t\t\t\t\t\t\t\tSelectionChangedEvent event) {\r\n\t\t\t\t\t\t\t\t\t\t_selectedRequirement = (Operation) ((TreeSelection) event.getSelection()).getFirstElement();\r\n\t\t\t\t\t\t\t\t\t\trefreshRequirementsFields();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\treturn\t_swtuiPlatforms.createDListUI(_page, \"#listOfRequirements\",\r\n\t\t\t\t\"Requirements\", EPosLabel.top, mc, ic, false, false, false, false);\r\n\t}", "List<ResourceSkuCapabilities> capabilities();", "@Override\n public String getApplicationDependencies() {\n List<String> orderedNames = new ArrayList<String>();\n \n //deprecated: Current way of configuring pu dependencies in Cloudify is by entering a groovy list of the pu names in the format \"[a,b,c]\"\n String deprecatedDependenciesValue = getBeanLevelProperties().getContextProperties().getProperty(APPLICATION_DEPENDENCIES_CONTEXT_PROPERTY);\n if (deprecatedDependenciesValue != null) {\n String trimmedDeprecatedDependenciesValue = deprecatedDependenciesValue.replace('[', ' ').replace(']', ' ').trim();\n String[] deprecatedDependencies = StringUtils.delimitedListToStringArray(trimmedDeprecatedDependenciesValue,\",\");\n for (String name : deprecatedDependencies) {\n if (!orderedNames.contains(name)) {\n orderedNames.add(name);\n }\n }\n }\n \n // Admin API way for configuring pu dependencies\n for (String name : dependencies.getDeploymentDependencies().getRequiredProcessingUnitsNames()) {\n if (!orderedNames.contains(name)) {\n orderedNames.add(name);\n }\n }\n if (orderedNames.isEmpty()) {\n //backwards compatibility\n return \"\";\n }\n return \"[\" + StringUtils.collectionToCommaDelimitedString(orderedNames) +\"]\";\n }", "public List<Constraint> getConstraints() {\r\n\t\treturn constraints;\r\n\t}", "public abstract List<AbstractCapability> getCapabilities();", "protected Set<IService> getContributedServices() {\n \t\tServiceModelManager smm = ServiceModelManager.getInstance();\n \t\tSet<IService> cppServices = smm.getServices(CCProjectNature.CC_NATURE_ID);\n \t\tSet<IService> cServices = smm.getServices(CProjectNature.C_NATURE_ID);\n \n \t\tSet<IService> allApplicableServices = new LinkedHashSet<IService>();\n \t\tallApplicableServices.addAll(cppServices);\n \t\tallApplicableServices.addAll(cServices);\n \n \t\treturn allApplicableServices;\n \t}", "String getApplicationDependencies();", "public default int getActiveRequirementCount() {\n\t\tint result = 0;\n\t\tif (getRequirements() != null) {\n\t\t\tfor (Requirement req : getRequirements()) {\n\t\t\t\tif (!req.isArchived()) {\n\t\t\t\t\tresult++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic Set<Class<? extends IndexingItemHandler>> getDependencies() {\n\t\treturn null;\n\t}", "private void generalizeCSARequirements(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Requirement> reqs = new ArrayList<Requirement>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\treqs = this.data.getRequirements();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Requirement r : reqs){\n\t\t\t\tRequirement temp = new Requirement();\n\t\t\t\ttry {\n\t\t\t\t\tBeanUtils.copyProperties(temp, r);\n\t\t\t\t\t//System.out.println(r.toString());\n\t\t\t\t\t//System.out.println(temp.toString());\n\t\t\t\t\tc.addReq(temp);\n\t\t\t\t} catch (IllegalAccessException | InvocationTargetException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "List<ResourceSkuRestrictions> restrictions();", "public String[] getResolvedDependencies();", "public String getAcademicRequirements() {\r\n return academicRequirements;\r\n }", "public int getGems() {\n\t\treturn gems;\n\t}", "public boolean hasMinRequirements() {\n\t\t// FIXME MIN input\n\t\treturn true;\n\t}", "public Field getFunctionRequirements() {\n\t\treturn _functionReq;\n\t}", "public org.apache.xmlbeans.XmlString xgetRequires()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlString target = null;\r\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(REQUIRES$28);\r\n return target;\r\n }\r\n }", "@Stub\n\tpublic String[] getDependencies()\n\t{\n\t\treturn new String[] {};\n\t}", "public String toString() {\n StringBuilder out = new StringBuilder(\"Requirements:\\n\");\n for (Fact fact: requiredFacts) {\n out.append(fact.toString());\n if (requiredFacts.indexOf(fact) < requiredFacts.size() - 1) out.append(reqIsAnd ? \"AND\\n\" : \"OR\\n\");\n }\n return out.toString();\n }", "public List<Qualification> getQualifications() {\n return qualifications;\n }", "@Override\n public int getRequirementTotal() {\n return mutants.length;\n }", "public List<ConditionalRequirement> getConditions() {\r\n return conditions;\r\n }", "public Field getDataRequirements() {\n\t\treturn _dataReq;\n\t}", "public String[] getDependencies()\r\n {\r\n return m_dependencies;\r\n }", "@Override\n\tpublic Optional<Product_Requirement> listProduct_RequirementId(long id) {\n\t\treturn productR.findById(id);\n\t}", "public List<ServiceNode> getRelevantServices() {\n\t\treturn relevantServices;\n\t}", "public int getIntrinsicDependencies() {\n int d = super.getIntrinsicDependencies();\n if (argument.length == 0) {\n d |= StaticProperty.DEPENDS_ON_CONTEXT_ITEM;\n }\n return d;\n }", "public synchronized Set<Bundle> getRequiringBundles(Bundle bundle)\n {\n Set<Bundle> result = new HashSet<Bundle>();\n\n // Get all requirers for all revisions of the bundle.\n for (BundleRevision revision : bundle.adapt(BundleRevisions.class).getRevisions())\n {\n Map<BundleCapability, Set<BundleWire>>\n caps = m_dependentsMap.get(revision);\n if (caps != null)\n {\n for (Entry<BundleCapability, Set<BundleWire>> entry : caps.entrySet())\n {\n if (entry.getKey().getNamespace()\n .equals(BundleRevision.BUNDLE_NAMESPACE))\n {\n for (BundleWire dependentWire : entry.getValue())\n {\n result.add(dependentWire.getRequirer().getBundle());\n }\n }\n }\n }\n }\n\n // Return the results.\n return result;\n }", "public List<String> getDependencies() throws IOException {\n\t\tPackageJSON packageJSON = new ObjectMapper()\n\t\t\t\t.readValue(this.getClass().getClassLoader().getResourceAsStream(\"package.json\"), PackageJSON.class);\n\t\treturn packageJSON.getDependencies();\n\t}", "public boolean isSetRequirement() {\n return this.requirement != null;\n }", "public default String[] getDependencies() {\r\n\t\treturn new String[0];\r\n\t}", "public Collection<Resolver> getSupports() {\r\n return Collections.unmodifiableCollection(supports);\r\n }", "public abstract List<Requirement> getFailedChecks();", "public Map<String, Set<String>> getDependencies() {\n return new HashMap<String, Set<String>>(dependencies);\n }", "public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements)\r\n/* 21: */ {\r\n/* 22:28 */ requirements.add(new ur(amq.y));\r\n/* 23: */ }", "@Override\n public int requestAvailableCapacity() {\n int total = facility.getCapacity();\n for (Facility facility : facilities) {\n total += facility.getCapacity();\n }\n return total;\n }", "public int getSupplies() {\n\t\treturn supplies;\n\t}", "Set<String> listCapabilities();", "public boolean isSetRequires()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(REQUIRES$28) != null;\r\n }\r\n }", "public List getDependencies() {\n return Collections.unmodifiableList(dependencies);\n }", "public List<String> getCapabilities() {\n if (capabilities == null) {\n return new ArrayList<>();\n }\n return capabilities;\n }", "public List<String> requiredMembers() {\n return this.requiredMembers;\n }", "public List<String> getSpecifications() {\n\t\tString sql =\"select specification from specifications\";\n\t\tList<String> res = jdbcTemplate.queryForList(sql, String.class);\n\t\treturn res;\n\t}", "@Override\n\tpublic List<SkillRequirement> findListOfSkillReq(Skill skill) {\n\t\treturn null;\n\t}", "public String getDisablebuyerrequirements() {\r\n return disablebuyerrequirements;\r\n }", "private void initiaLizeRequirements() {\n\n\t\ttry {\n\t\t\tstFoodDataEntry = cnFoodDataEntry.createStatement();\n\n\t\t\tString sql = \"select energysourceid, unit, conversionfactor from energysourcedetail where energysourceid in (select sourceid from energysource where energytypeid =\"\n\t\t\t\t\t+ FOOD + \") order by energysourceid asc\";\n\t\t\trsFoodDataEntry = stFoodDataEntry.executeQuery(sql);\n\n\t\t\tMap<String, Double> unitConversionF = null;\n\t\t\t// List<Map<String, Double>> listUnitConversionF;\n\t\t\tenergySourceDetail = new LinkedHashMap<Integer, Map<String, Double>>();\n\n\t\t\tint energysourceId;\n\t\t\tString unit;\n\t\t\tDouble coversionFactor;\n\n\t\t\twhile (rsFoodDataEntry.next()) {\n\t\t\t\tenergysourceId = rsFoodDataEntry.getInt(\"energysourceid\");\n\t\t\t\tunit = rsFoodDataEntry.getString(\"unit\");\n\t\t\t\tcoversionFactor = rsFoodDataEntry.getDouble(\"conversionfactor\");\n\n\t\t\t\tif (energySourceDetail.containsKey(energysourceId)) {\n\t\t\t\t\tenergySourceDetail.remove(energysourceId);\n\t\t\t\t} else {\n\t\t\t\t\tunitConversionF = new LinkedHashMap<String, Double>();\n\t\t\t\t}\n\t\t\t\tunitConversionF.put(unit, coversionFactor);\n\t\t\t\tenergySourceDetail.put(energysourceId, unitConversionF);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public List<String> capabilities() {\n return this.capabilities;\n }", "public Object[] getGlobalResourceList() {\n return this.getList(AbstractGIS.INQUIRY_GLOBAL_RESOURCE_LIST);\n }", "ImmutableList<SchemaOrgType> getLicenseList();", "@Override\n public NSISInstallation[] getInstallations() {\n return Jenkins.getInstance().getDescriptorByType(NSIS.DescriptorImpl.class).getInstallations();\n }", "public String getVersionsSupported();", "public DependencySatisfaction satisfied() {\n\t\treturn satisfied(new HashSet<String>(), new HashSet<String>());\n\t}", "public List<CriticalComponent> getCriticalComponents();", "public String getQualities() {\n \treturn \"Icy \"+super.getQualities();\n }", "ImmutableList<SchemaOrgType> getEducationalUseList();", "public final String getUseVersions() {\n return properties.get(USE_VERSIONS_PROPERTY);\n }", "public IPath[] getAdditionalDependencies();", "public List<String> getDependencies() {\n return new ArrayList<>(mDependencies);\n }", "private List<ProductQuantity> getQuantities() {\n List<ProductQuantity> quantities = new ArrayList<>();\n for (int i = 1; i <= QUANTITY_MAX; i++) {\n ProductQuantity q = new ProductQuantity(i, i + \"x\");\n quantities.add(q);\n }\n return quantities;\n }", "default ImmutableSet<Class<? extends ManagedService>> getDependencies()\n\t{\n\t\treturn Sets.immutable.empty();\n\t}", "public List<Resource> getAvailableResources();", "public static List<String> getRequiredAttributes2() {\n\t\treturn TestObject.REQUIRED_ATTRIBUTES;\n\t}", "List<Constraint> getQualifier();", "public Collection getSpecialisation()\n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{\n \t\tCollection col = new ArrayList();\n \t\tcol = instance.getSpecialization(this.refMofId());\n \t\t\n \t\treturn col; \t\t\n \t}\n \n \treturn ((Uml15Package)this.refOutermostPackage()).getCore().getAParentSpecialization().getSpecialization(this);\n }" ]
[ "0.7720788", "0.74510455", "0.7306929", "0.6999446", "0.68782234", "0.6607148", "0.63954854", "0.63538873", "0.6314893", "0.61852324", "0.5926041", "0.58594805", "0.5855279", "0.5852072", "0.57914954", "0.57912034", "0.57469785", "0.57045233", "0.56565803", "0.5640375", "0.55402803", "0.54949033", "0.5494237", "0.5484382", "0.5465517", "0.5461121", "0.5455707", "0.5450025", "0.54495263", "0.54439634", "0.5437804", "0.54220814", "0.5405901", "0.5405252", "0.5348536", "0.53451216", "0.5326067", "0.5320549", "0.5316319", "0.5308272", "0.530818", "0.53029925", "0.5292971", "0.529186", "0.52879614", "0.52524054", "0.5249002", "0.5246149", "0.52447146", "0.52195704", "0.5217389", "0.5216724", "0.5212494", "0.5200573", "0.5180889", "0.5177282", "0.5175126", "0.5163059", "0.51612496", "0.5159279", "0.5150957", "0.5148074", "0.51376504", "0.512598", "0.51174915", "0.51166624", "0.5102945", "0.5095297", "0.5079919", "0.5076916", "0.5075017", "0.50725627", "0.50645727", "0.5061315", "0.5057792", "0.50481486", "0.5045594", "0.50426644", "0.50387484", "0.5028061", "0.5021194", "0.5011904", "0.50076574", "0.5003635", "0.49868667", "0.49812812", "0.49805033", "0.4979978", "0.4979727", "0.4971468", "0.49659503", "0.49574724", "0.4957128", "0.4953062", "0.49428478", "0.49408644", "0.49185157", "0.49173823", "0.49123758", "0.49110004" ]
0.7534911
1
Gets the version information for the Java packaged with this product
public String getPackagedJava();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getProductVersion();", "public static String getJavaVersion() {\n return JavaEnvUtils.getJavaVersion();\n }", "public String getOctaveInJavaVersion() {\n\t//System.out.println(\"MANIFEST_INFO: \"+MANIFEST_INFO);\n\t//return MANIFEST_INFO.getImplVersion();\n\treturn this.getClass().getPackage().getImplementationVersion();\n }", "public static String getJavaVersion() {\r\n\t\treturn javaVersion;\r\n\t}", "public static String getImplementationVersion() {\r\n return getJarInfo(\"Implementation-Version\");\r\n }", "public static String getVersionInfo() {\n return getCommonManifestEntry(getJarPathFromClassPath(getAppJarName()),null);\n }", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "protected static native String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public static final String getVersion() { return version; }", "public static final String getVersion() { return version; }", "java.lang.String getApplicationVersion();", "public Version getVersion();", "public java.lang.String getVersion() {\r\n return version;\r\n }", "public static String getVersion() {\r\n\t\treturn VERSION;\r\n\t}", "Version getVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "public String getVersion()\n {\n return ver;\n }", "public static String getVersion() {\n\t\treturn version;\r\n\t}", "public String getVersion () {\r\n return version;\r\n }", "public static String getVersion() {\n\t\treturn version;\n\t}", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n return version;\n }", "public static String getAppVersion(){\r\n return getProperty(\"version\");\r\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion() {\r\n return version;\r\n }", "private static String getVersion() throws IOException {\n URL res = Main.class.getResource(\"/META-INF/MANIFEST.MF\");\n if(res!=null) {\n Manifest manifest = new Manifest(res.openStream());\n String v = manifest.getMainAttributes().getValue(\"Implementation-Version\");\n if(v!=null)\n return v;\n }\n return \"?\";\n }", "String version();", "public static String getPackageVersion() {\n return mPackageName + \" V\" + mVersion + \" [\" + mBuildDate + \"]\";\n }", "@CheckForNull\n String getVersion();", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion(){\r\n return version;\r\n }", "public int getVersion()\n {\n return info.getVersion().intValueExact();\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "int getCurrentVersion();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "@Override\n\tpublic java.lang.String getVersion() {\n\t\treturn _scienceApp.getVersion();\n\t}", "public abstract String getVersion();", "public abstract String getVersion();", "public abstract String getVersion();", "public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}", "public String getVersion() {\n\t\tString version = \"0.0.0\";\n\n\t\tPackageManager packageManager = getPackageManager();\n\t\ttry {\n\t\t\tPackageInfo packageInfo = packageManager.getPackageInfo(\n\t\t\t\t\tgetPackageName(), 0);\n\t\t\tversion = packageInfo.versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn version;\n\t}", "public final native String getVersion() /*-{ return this.version; }-*/;", "public java.lang.String getVersion() {\n return version_;\n }", "public String getServiceVersion();", "int getPackageVersion(String packageName);", "public final String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String getVersion() {\r\n\t\treturn version;\r\n\t}", "public String getVersion() {\n\t\treturn version;\n\t}", "public String getVersion () {\n return this.version;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "public Integer getVersion() {\r\n return version;\r\n }", "public int getLibVersionNumber();", "public String getVersion() {\n return this.version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }", "public Integer getVersion() {\n return version;\n }" ]
[ "0.71770877", "0.71294916", "0.70831376", "0.70239097", "0.69561017", "0.6921743", "0.6888995", "0.6888995", "0.6888995", "0.6888995", "0.6870502", "0.6870502", "0.6870502", "0.6870502", "0.6870502", "0.6870502", "0.6870502", "0.6870502", "0.67938256", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6756218", "0.6668637", "0.6668637", "0.6639847", "0.6635549", "0.6614968", "0.6589328", "0.6586313", "0.6586313", "0.6586313", "0.6586313", "0.6576144", "0.6571913", "0.6550811", "0.6541401", "0.6530841", "0.6530841", "0.6529026", "0.6521578", "0.65209776", "0.6506732", "0.6504479", "0.65016717", "0.64905655", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6474944", "0.6471513", "0.64639515", "0.6461019", "0.6461019", "0.64495695", "0.64495695", "0.6447946", "0.64463556", "0.64370865", "0.6435664", "0.6435664", "0.6435664", "0.6430805", "0.6430805", "0.6427871", "0.64215004", "0.64093375", "0.6408744", "0.64084864", "0.64034224", "0.63992643", "0.63992643", "0.63992643", "0.63992643", "0.63957644", "0.63694555", "0.63370794", "0.6320579", "0.6320579", "0.6320579", "0.6320579", "0.6319354", "0.63015884", "0.6300392", "0.6272021", "0.6272021", "0.6272021" ]
0.0
-1
Step 1: Allocate a database 'Connection' object MySQL: "jdbc:mysql://hostname:port/databaseName", "username", "password"
public static Connection getInstance() { Connection conn = null; try { conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/restaurant?useSSL=false", "root", "1234"); } catch (SQLException e) { e.getStackTrace(); } return conn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "public void createConnection()\n\t{\n\t\ttry\n {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n // Get a connection\n conn = DriverManager.getConnection(dbURL, \"root\", \"root\"); \n System.out.println(\"Connected...\");\n }\n catch (Exception except)\n {\n except.printStackTrace();\n }\n\t}", "private void createDBConnection() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n Connection con = DriverManager.getConnection(\n \"jdbc:mysql://10.27.8.144:3306/databasename5\", \"user5\", \"p4ssw0rd\");\n Statement stmt = con.createStatement();\n ResultSet rs = stmt.executeQuery(\"select * from emp\");\n while (rs.next())\n System.out.println(rs.getInt(1) + \" \" + rs.getString(2) + \" \" + rs.getString(3));\n con.close();\n } catch (Exception e) {\n System.out.println(e);\n }\n }", "public static void createConnection() {\n\n try{\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/mydb\", \"tobymac208\", \"Sparta_!3712\");\n // Database how now been successfully connected.\n System.err.println(\"Database was successfully connected.\");\n }catch (ClassNotFoundException e) {\n System.err.println(\"Class not found.\");\n }catch (SQLException e) {\n System.err.println(\"SQL exception thrown.\");\n }\n }", "public void establishConnection() throws SQLException {\n if (!connectToDB(\"jdbc:mysql://localhost/EmployeesProject\")) {\n createDBAndTable();\n }\n }", "@Override\n public void initializeConnection() throws SQLException, ClassNotFoundException {\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n //setConnection(DriverManager.getConnection(\"jdbc:mysql://localhost/rabidusDB\",\"root\",\"password\"));\n setConnection(DriverManager.getConnection( host + \":3306/\" + databaseName, user, password));\n \n }", "Connection getConnection(String database, String schema, String jdbcURL, String jdbcURLParameters, String user, String password, boolean createDB, boolean createSchema, boolean dropDBIfExist) throws Exception;", "public static Connection initializeDatabase()\n throws SQLException, ClassNotFoundException\n {\n \t\n \tString dbDriver = \"com.mysql.cj.jdbc.Driver\";\n String dbURL = \"jdbc:mysql://localhost:3306/\";\n // Database name, database user and password to access\n String dbName = \"jaltantra_db\";\n String dbUsername = \"root\";\n String dbPassword = \"jaldb@2050\";\n \n Class.forName(dbDriver);\n Connection conn = DriverManager.getConnection(dbURL + dbName ,dbUsername, dbPassword);\n return conn;\n }", "public Connection getConnection() throws SQLException, ClassNotFoundException{\n\t\t\t Class.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t System.out.println(\"MySQL JDBC Driver Registered\");\n\t\t\t return connection = DriverManager.getConnection(\"jdbc:mysql://www.papademas.net:3306/510labs?\", \"db510\",\"510\");\n\t}", "private static void connect() {\n\t\ttry {\n\t\t\tif (connection == null) {\n\t\t\t\tClass.forName(\"org.mariadb.jdbc.Driver\");\n\t\t\t\tconnection = DriverManager.getConnection(url, user, password);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "private static void getConnection() throws ClassNotFoundException, SQLException {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/yuechu\", \"root\", \"1\");\n\t}", "private Connection createDatabase() {\n\t\tSystem.out.println(\"We are creating a database\");\n\t\ttry (\n\t\t\t\t// Step 1: Allocate a database \"Connection\" object\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:\" + PORT_NUMBER + \"/\", \n\t\t\t\t\t\t\"root\", \"root\"); // MySQL\n\t\t\t\t// Step 2: Allocate a \"Statement\" object in the Connection\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\t) {\n\t\t\t// Step 3 - create our database\n\t\t\tString sql = \"CREATE DATABASE IF NOT EXISTS experiences\";\n\t\t\tstmt.execute(sql);\n\t\t\treturn conn;\n\t\t\t\n\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null; }\n\t}", "public void initConnection(){\n \t String HOST = \"jdbc:mysql://10.20.63.22:3306/cloud\";\n String USERNAME = \"root\";\n String PASSWORD = \"test\";\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (ClassNotFoundException ex) {\n ex.printStackTrace();\n }\n \n try {\n conn = DriverManager.getConnection(HOST, USERNAME, PASSWORD);\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "private Connection createConnection() {\n try {\n return DriverManager.getConnection(\"jdbc:mysql://\" + host + \":\" + port + \"/\" + db, user, password);\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "private static void dbConnect() {\r\n\t\tif (conn == null)\r\n\t\t\ttry {\r\n\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost/sims?user=root&password=12345&useSSL=true\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public void connectionSql()\r\n { \r\n try{\r\n //STEP 2: Register JDBC driver\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n\r\n //STEP 3: Open a connection\r\n System.out.println(\"Connecting to database...\");\r\n conn = DriverManager.getConnection(DB_URL, USER, PASS);\r\n\r\n //STEP 4: Execute a query\r\n System.out.println(\"Creating database...\");\r\n stmt = conn.createStatement();\r\n \r\n String sql = \"CREATE DATABASE IF NOT EXISTS demo\";\r\n stmt.executeUpdate(sql);\r\n System.out.println(\"Database created successfully...\");\r\n \r\n stmt = conn.createStatement();\r\n String sqlSelect = \"USE demo;\";\r\n stmt.executeUpdate(sqlSelect);\r\n System.out.println(\"DATABASE IS SELECTED\");\r\n \r\n }catch(SQLException se){\r\n //Handle errors for JDBC\r\n se.printStackTrace();\r\n }catch(Exception e){\r\n //Handle errors for Class.forName\r\n e.printStackTrace();\r\n }\r\n /*\r\n finally{\r\n //finally block used to close resources\r\n try{\r\n if(stmt!=null)\r\n stmt.close();\r\n }catch(SQLException se2){\r\n }// nothing we can do\r\n try{\r\n if(conn!=null)\r\n conn.close();\r\n }\r\n catch(SQLException se)\r\n {\r\n se.printStackTrace();\r\n }//end finally try\r\n }//end try\r\n System.out.println(\"Goodbye!\");\r\n */\r\n}", "private void makeConnection() {\n try {\n InitialContext ic = new InitialContext();\n DataSource ds = (DataSource) ic.lookup(dbName);\n\n con = ds.getConnection();\n } catch (Exception ex) {\n throw new EJBException(\"Unable to connect to database. \" + ex.getMessage());\n }\n }", "public DatabaseConnector() {\n String dbname = \"jdbc/jobs\";\n\n try {\n ds = (DataSource) new InitialContext().lookup(\"java:comp/env/\" + dbname);\n } catch (NamingException e) {\n System.err.println(dbname + \" is missing: \" + e.toString());\n }\n }", "public void initConnection() throws SQLException{\n\t\tuserCon = new UserDBHandler(\"jdbc:mysql://127.0.0.1:3306/users\", \"admin\", \"admin\");\n\t\tproductCon = new ProductDBHandler(\"jdbc:mysql://127.0.0.1:3306/products\", \"admin\", \"admin\");\n\t}", "void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\"); // Driver is located in src/mysql-connector...\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n System.out.println(\"Connecting to database...\");\n\n try {\n // Make the connection\n con = DriverManager.getConnection(DB_URL, USER, PASS);\n System.out.println(\"Connection established!\");\n System.out.println(\"Creating statement...\");\n\n // Create a statement (not for output)\n st = con.createStatement();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void connectToDB(){\n\ttry {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\tconnection=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/patient\",\"root\",\"7417899737\");\n\t} catch (ClassNotFoundException e) {\n\t\t\n\t\te.printStackTrace();\n\t} catch (SQLException e) {\n\t\t\n\t\te.printStackTrace();\n\t}\n\t\n}", "void getConnectiondb() throws SQLException, ClassNotFoundException{\n // TODO code application logic here\n \n String user = \"root\";\n String pass = \"test\";\n\n myConn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/aud_jdbms\", user, pass);\n \n\n \n }", "private void initConnection() {\n\t\tMysqlDataSource ds = new MysqlDataSource();\n\t\tds.setServerName(\"localhost\");\n\t\tds.setDatabaseName(\"sunshine\");\n\t\tds.setUser(\"root\");\n\t\tds.setPassword(\"sqlyella\");\n\t\ttry {\n\t\t\tConnection c = ds.getConnection();\n\t\t\tSystem.out.println(\"Connection ok\");\n\t\t\tthis.setConn(c);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Connection\");\n //characterEncoding=latin1&\n //Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n //Connection conn = new Connection();\n url += \"?characterEncoding=latin1&useConfigs=maxPerformance&useSSL=false\";\n conn = DriverManager.getConnection(url, userName, password);\n if (conn != null) {\n System.out.println(\"Established connection to \"+url+\" Database\");\n }\n }\n catch(SQLException e) {\n throw new IllegalStateException(\"Cannot connect the database \"+url, e);\n }\n catch(ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public void connectToDatabase(){\n\t\ttry{\n\t\t connection = DriverManager.getConnection(dbConfig.getUrl(), dbConfig.getUser(), dbConfig.getPassword());\n\t\t System.out.println(\"Successfully connected to database.\");\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(\"An error occurred while attempting to connect to the database.\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void connect()\n\t{\n\t\t//Database driver required for connection\n\t\tString jdbcDriver = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//Loading JDBC Driver class at run-time\n\t\t\tClass.forName(jdbcDriver);\n\t\t}\n\t\tcatch (Exception excp)\n\t\t{\n\t\t\tlog.error(\"Unexpected exception occurred while attempting user schema DB connection... \" + excp.getMessage());\n\t\t}\t\t\n\t\t\n\t\tlog.info(\"Initiating connection to user schema database \" + dbUrl + \"...\");\n\t\t\n\t\ttry\n\t\t{\n\t\t\tdbConnection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n\t\t}\n\t\tcatch (SQLException sqle)\n\t\t{\n\t\t\tdbConnection = null;\n\t\t\tlog.error(\"SQLException occurred while connecting to user schema database... \" + sqle.getMessage());\n\t\t}\n\t}", "private void connect() {\n connectionString = \"jdbc:mysql://\" + Config.getInstance().getMySQLServerName() + \":\" + Config.getInstance().getMySQLServerPort() + \"/\" + Config.getInstance().getMySQLDatabaseName();\n\n try {\n Assassin.p.getLogger().info(\"Attempting connection to MySQL...\");\n\n // Force driver to load if not yet loaded\n Class.forName(\"com.mysql.jdbc.Driver\");\n Properties connectionProperties = new Properties();\n connectionProperties.put(\"user\", Config.getInstance().getMySQLUserName());\n connectionProperties.put(\"password\", Config.getInstance().getMySQLUserPassword());\n connectionProperties.put(\"autoReconnect\", \"false\");\n connectionProperties.put(\"maxReconnects\", \"0\");\n connection = DriverManager.getConnection(connectionString, connectionProperties);\n\n Assassin.p.getLogger().info(\"Connection to MySQL was a success!\");\n }\n catch (SQLException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"Connection to MySQL failed!\");\n printErrors(ex);\n }\n }\n catch (ClassNotFoundException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"MySQL database driver not found!\");\n }\n }\n }", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "public void initConnection() throws DatabaseConnectionException, SQLException {\n\t\t\tString connectionString = DBMS+\"://\" + SERVER + \":\" + PORT + \"/\" + DATABASE;\n\t\t\ttry{\n\t\t\t\tClass.forName(DRIVER_CLASS_NAME).newInstance();\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE TROVARE DRIVER\");\n\t\t\t\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tconn=DriverManager.getConnection(connectionString, USER_ID, PASSWORD);\n\t\t\t\t\n\t\t\t}catch(SQLException e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE STABILIRE CONNESSIONE DATABASE\");\n\t\t\t\t\n\t\t\t}\n\t\t}", "public static Connection getConnection() {\r\n Connection con = null;\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n //step-1: get a connection to the db\r\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/user\", \"root\", \"\");\r\n }catch(Exception e) {\r\n System.out.println(\"error\" + e);\r\n }\r\n return con;\r\n\r\n }", "public DatabaseManager() {\n try {\n con = DriverManager.getConnection(DB_URL, \"root\", \"marko\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void setupDB(){\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n String url = \"jdbc:oracle:thin:@localhost:1521:orcl\";\n String username = \"sys as sysdba\"; //Provide username for your database\n String password = \"oracle\"; //provide password for your database\n\n con = DriverManager.getConnection(url, username, password);\n }\n catch(Exception e){\n System.out.println(e);\n }\n }", "private void setupDatabase() throws SQLException {\n\t\tdb.open(\"localhost\", 3306, \"wow\", \"greeneconomyapple\");\n\t\tdb.use(\"auctionscan\");\n\t}", "private void connect() throws Exception {\n\t\tConnection c = DriverManager.getConnection(\"jdbc:mysql://\" + details[0] + \":3306/\" + details[3], details[1], details[2]);\n\t\tsetConnection(c);\n\t}", "private static void setConnection(){\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/novel_rental\",\"root\",\"\");\n } catch (Exception e) {\n Logger.getLogger(NovelRepository.class.getName()).log(Level.SEVERE, null, e);\n System.out.println(e.getMessage());\n }\n }", "public DatabaseController()\n\t{\n\t\tconnectionString = \"jdbc:mysql://localhost/?user=root\";\n\t\tcheckDriver();\n\t\tsetupConnection();\n\t}", "public static void createConnection() {\n\t\ttry {\r\n\t\t\tClass.forName(\"org.apache.derby.jdbc.EmbeddedDriver\").newInstance(); //specifies driver\r\n\t\t\t\r\n\t\t\tconn = DriverManager.getConnection(host); //Get a connection \r\n\t\t\tJOptionPane.showMessageDialog(null, \"Database Connection Successful\"); //this notifies the user that the program has sucessfully connected to the database\r\n\t\t} catch (Exception except) {\r\n\t\t\texcept.printStackTrace(); //for debugging purposes\r\n\t\t\tSystem.out.println(\"Database connection failed: \" + except.getMessage()); //for debugging purposes\r\n\t\t\tComponent frame = null; //new frame\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Database connection failed: \" + except.getMessage()); //this notifies the user that the program has not sucessfully connected to the database\r\n\t\t}\r\n\t}", "@Override\n\tpublic void connect() throws SQLException {\n if (jdbcConnection == null || jdbcConnection.isClosed()) {\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n } catch (ClassNotFoundException e) {\n throw new SQLException(e);\n }\n jdbcConnection = DriverManager.getConnection(\n jdbcURL, jdbcUsername, jdbcPassword);\n }\t\t \n\t\t\n\t}", "private Connection connect_db() {\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setUser(db_user);\n dataSource.setPassword(db_pass);\n dataSource.setServerName(db_url);\n dataSource.setDatabaseName(db_database);\n\n Connection conn = null;\n try {\n conn = dataSource.getConnection();\n conn.setAutoCommit(false);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return conn;\n }", "public Connection getConnection() throws ClassNotFoundException, SQLException {\n logger.info(\"Create DB connection\");\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n return DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/prod\",\"root\",\"rootroot\");\n }", "private void apriConnessione() throws SQLException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {\n\t\tString password, user;\n\t\tDatabaseProps dbConf = config.getDb();\n\n\t\tClass.forName(dbConf.getDriver()).getDeclaredConstructor().newInstance();\n\n\t\tuser = dbConf.getUsername();\n\t\tpassword = dbConf.getPassword();\n\n\t\tString uri = String.format(\"jdbc:%s://%s:%d/%s\", dbConf.getDbms(), dbConf.getHost(), dbConf.getPort(), dbConf.getName());\n\n\t\tconnessioneDB = DriverManager.getConnection(uri, user, password);\n\t}", "public static Connection getConnection() throws SQLException, ClassNotFoundException{\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n //STEP 3: Open a connection\n conn = DriverManager.getConnection(DB_URL,USER,PASS);\n \n return conn;\n }", "private JDBCConnection() {\n System.out.println(\"Created JDBC Connection Object\");\n \n try {\n // Connect to JDBC data base\n connection = DriverManager.getConnection(DATABASE_URL, DATABASE_USERNAME, DATABASE_PASSWORD);\n } catch (SQLException e) {\n // If there is an error, lets just print the error\n System.err.println(e.getMessage());\n }\n }", "public static void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n DataBaseConnect.connect = DriverManager\n .getConnection(\"jdbc:mysql://localhost/magazyn?\"\n + \"user=root&password=\");\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e1) {\n e1.printStackTrace();\n }\n }", "public void conectar() {\n try {\n //Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n Class.forName(\"org.mariadb.jdbc.Driver\"); \n\n //con = DriverManager.getConnection(\"jdbc:mariadb://192.168.194.131:3306/arquitectura\", \"root\", \"duocadmin\"); \n con = DriverManager.getConnection(\"jdbc:mariadb://192.168.194.131:3306/arquitectura\", \"root\", \"duocadmin\");\n state = con.createStatement();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public DataBaseConnector()\n {\n dataSource = new SQLServerDataSource();\n dataSource.setServerName(\"EASV-DB2\");\n dataSource.setPortNumber(1433);\n dataSource.setDatabaseName(\"AutistMovies\");\n dataSource.setUser(\"CS2017A_15\");\n dataSource.setPassword(\"Bjoernhart1234\");\n }", "private Database() throws SQLException {\n con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:MusicAlbums\", \"c##dba\", \"sql\");\n }", "private MySQL() {\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\n\t\t\tBoneCPConfig config = new BoneCPConfig();\n\t\t\tconfig.setJdbcUrl(\"jdbc:mysql://localhost:3306/moviedb\"); \n\t\t\tconfig.setUsername(\"testuser\");\n\t\t\tconfig.setPassword(\"testpass\");\n\t\t\tconfig.setMinConnectionsPerPartition(5);\n\t\t\tconfig.setMaxConnectionsPerPartition(100);\n\t\t\tconfig.setPartitionCount(1);\n\t\t\tconnectionPool = new BoneCP(config); // setup the connection pool\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public DatabaseManagement() throws SQLException {\n\t\n\t\ttry {\n\t\t\t//use driver\n\t\t\tClass.forName(MYSQL_DRIVER);\n\t\t System.out.println(\"Class Loaded....\");\n\t\t\t\n\t\t //get connection to database\n\t\t\tmyConn = DriverManager.getConnection(getDbUrl(), getUserName(), getPassword());\n\t\t\t//System.out.println(\"Connected to database...\");\n\t\t\t\n\t\t\t//create a statement\n\t\t\tmyStmt = myConn.createStatement();\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\tcatch (Exception exc){\n\t\t\texc.printStackTrace();\n\t\t}\t\t\n\t}", "public void openConnection(){\r\n try {\r\n Driver dr = new FabricMySQLDriver();\r\n DriverManager.registerDriver(dr);\r\n log.info(\"registrable driver\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n try {\r\n connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n log.info(\"get connection\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "private void makeSQLConn() {\n\t\ttry {\n\t\t\tmyDB = new MySQLAccess();\n\t\t} catch (Exception e) { e.printStackTrace(); }\n\t}", "public void makeConnection(){\n\t\t\n\t\t\n\t\t\n\t\ttry{\n\t\t\tmySqlConn=new MySqlConnection(server,databaseName,userName,passWord);\n\t\t\tst=mySqlConn.conn.createStatement();\n\t\t }\n\t\tcatch(SQLException s){\n\t\t\tSystem.out.println(\"SQL not able to execute\");\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void connectToDb(){\n\t log.info(\"Fetching the database name and other details ... \");\n\t dbConnect.setDbName(properties.getProperty(\"dbName\"));\n\t dbConnect.setUsrName(properties.getProperty(\"dbUsrname\"));\n\t dbConnect.setPassword(properties.getProperty(\"dbPassword\"));\n\t dbConnect.setSQLType(properties.getProperty(\"sqlServer\").toLowerCase());\n\t log.info(\"Trying to connect to the database \"+dbConnect.getDbName()+\" ...\\n with user name \"+dbConnect.getUsrname()+\" and password ****** \");\n\t dbConnect.connectToDataBase(dbConnect.getSQLType(), dbConnect.getDbName(), dbConnect.getUsrname(), dbConnect.getPswd());\n\t log.info(\"Successfully connected to the database \"+dbConnect.getDbName());\n }", "public void DBConnect() {\n \tdatabase = new DatabaseAccess();\n \tif (database != null) {\n \t\ttry {\n \t\t\tString config = getServletContext().getInitParameter(\"dbConfig\");\n \t\t\tdatabase.GetConnectionProperties(config);\n \t\t\tdatabase.DatabaseConnect();\n \t\t}\n \t\tcatch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n }", "protected void openConnection() throws SQLException {\n connection = DriverManager.getConnection(\"jdbc:mysql://stusql.dcs.shef.ac.uk/team021\", \"team021\", \"5f4306d9\");\n }", "private static Connection getConnection() throws SQLException, IOException {\n Properties properties = new Properties();\n properties.setProperty(\"user\", \"root\");\n properties.setProperty(\"password\", \"bulgariavarna\");\n\n return DriverManager.getConnection(CONNECTION_STRING + \"minions_db\", properties);\n }", "public static void initConnection() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{\r\n\t\t//create database connection only once\r\n\t\tif(dbCon == null){\t\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tdbCon = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/wip?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\",\"root\",\"\");\r\n\t\t}\r\n\t}", "private Connection database() {\n Connection con = null;\n String db_url = \"jdbc:mysql://localhost:3306/hospitalms\";\n String db_driver = \"com.mysql.jdbc.Driver\";\n String db_username = \"root\";\n String db_password = \"\";\n \n try {\n Class.forName(db_driver);\n con = DriverManager.getConnection(db_url,db_username,db_password);\n } \n catch (SQLException | ClassNotFoundException ex) { JOptionPane.showMessageDialog(null,ex); }\n return con;\n }", "@SuppressWarnings(\"unchecked\")\npublic final void initDatabase()throws SQLException {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n con =(Connection) DriverManager.getConnection(\"jdbc:mysql://localhost:3306/yajnab?zeroDateTimeBehavior=convertToNull\",\"root\",\"11\"); \n } \n catch (ClassNotFoundException | SQLException e) {\n }\n }", "private void openConnection() {\n try {\n dbConnection\n = DriverManager.getConnection(url, user, password);\n } catch (SQLException ex) {\n System.err.println(\"Exception in connecting to mysql database\");\n System.err.println(ex.getMessage());\n }\n }", "public ConnexionBD() throws ClassNotFoundException, SQLException {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\") ;\n\t\tconnexion = DriverManager.getConnection(dbURL,user,password) ;\n\t}", "public void initializeConnection(){\n try{\n dbConnect = DriverManager.getConnection(DBURL, USERNAME, PASSWORD);\n } catch (SQLException ex){\n ex.printStackTrace();\n }\n }", "public DataBase(String jdbc,String type,String link,String port,String db,String username, String password) throws SQLException{\r\n\t\tcon = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"org.postgresql.Driver\");\r\n\t\t\tcon = DriverManager.getConnection(jdbc+\":\"+type+\"://\"+link+\":\"+port+\"/\"+db,username, password);\r\n\t\t\tcon.setAutoCommit(false);\r\n\t\t\tSystem.out.println(\"Opened database successfully\");\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "private String getConnectionURI(){\n\t\treturn \"jdbc:mysql://\"\n\t\t\t+ mServerAddress + \":\" + mServerPort\n\t\t\t+ \"/\" + mDbName + \"?\"\n\t\t\t+ \"user=\" + mDbUsername + \"&password=\" + mDbPassword;\n\t}", "public static void main(String[] args) {\n String url = \"jdbc:mysql://localhost:3306/\";\n // we are connecting to the addressBook database we created earlier\n String database = \"addressBook\";\n // we login as \"root\" user with password \"mysql123\"\n String userName = \"root\";\n String password = \"mysql123\";\n try (Connection connection = DriverManager.getConnection\n (url + database, userName, password)){\n System.out.println(\"Database connection: Successful\");\n } catch (Exception e) {\n System.out.println(\"Database connection: Failed\");\n e.printStackTrace();\n }\n }", "private Database() throws SQLException, ClassNotFoundException {\r\n Class.forName(\"org.postgresql.Driver\");\r\n con = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/postgres\", \"postgres\", \"kuka\");\r\n }", "public static Connection getConnection() throws Exception{\r\n\t\t\tConnection dbConn = null;\r\n\t try{\r\n\t\tString url = \"jdbc:mysql://localhost:3307/durgadb\";\r\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\tdbConn = DriverManager.getConnection(url, \"root\", \"root\");\r\n\t\t}\r\n\t catch (SQLException sqle) {\r\n\t\t sqle.printStackTrace();\r\n\t\t throw sqle;\r\n\t\t}\r\n catch(Exception e) {\r\n\t\t e.printStackTrace();\r\n\t\t throw e;\r\n\t\t}\r\n\treturn dbConn;\r\n\t}", "public setup() {\n dbConnection = \"jdbc:\"+DEFAULT_DB_TYPE+\"://\"+DEFAULT_DB_HOST+\":\"+DEFAULT_DB_PORT+\"/\"+DEFAULT_DB_PATH;\n dbType = DEFAULT_DB_TYPE;\n dbUser = DEFAULT_DB_USER;\n dbPass = DEFAULT_DB_PASSWORD;\n beginSetup();\n }", "@Override\n\tpublic void construct() {\n\t\tSystem.out.println(\"Getting a MySQL Database Connection\");\n\n\t}", "private static Connection connect(String url) throws SQLException {\n\ttry {\r\n\t\tDatabaseUtil.loadDatabaseDriver(url);\r\n\t} catch (ClassNotFoundException e) {\r\n\t\tlog.error(\"Could not find JDBC driver class.\", e);\r\n\t\tthrow (SQLException) e.fillInStackTrace();\r\n\t}\r\n\r\n\t// Step 2: Establish the connection to the database.\r\n\tString username = Context.getRuntimeProperties().getProperty(\r\n\t\"connection.username\");\r\n\tString password = Context.getRuntimeProperties().getProperty(\r\n\t\"connection.password\");\r\n\tlog.debug(\"connecting to DATABASE: \" + OpenmrsConstants.DATABASE_NAME\r\n\t\t\t+ \" USERNAME: \" + username + \" URL: \" + url);\r\n\treturn DriverManager.getConnection(url, username, password);\r\n}", "public void init(){\n\n stmt = null;\n\n try{\n\n Class.forName(\"com.mysql.jdbc.Driver\");\n myConnection=DriverManager.getConnection(DBUrl,userName,password);\n stmt=myConnection.createStatement();\n }\n catch(ClassNotFoundException | SQLException e){\n System.out.println(\"Failed to get connection\");\n }\n return;\n }", "private DatabaseManager(String database, String user, String password) throws SQLException, ClassNotFoundException {\n\t\tthis.conn = DriverManager.getConnection(database, user, password);\t\n\t}", "public static String getConnectionDB(){\n return \"jdbc:mysql://\" + hostname +\":\"+ port+\"/\" + database;\n }", "public static void init()\n {\n try\n {\n // The newInstance() call is a work around for some broken Java implementations\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\n // Create a new configuration object\n BoneCPConfig config = new BoneCPConfig();\n\n // Setup the configuration\n config.setJdbcUrl(\"jdbc:mysql://cs304.c0mk5mvcjljr.us-west-2.rds.amazonaws.com/cs304\"); // jdbc url specific to your database, eg jdbc:mysql://127.0.0.1/yourdb\n config.setUsername(\"cs304\");\n config.setPassword(\"ubccs304\");\n config.setConnectionTestStatement(\"SELECT 1\");\n config.setConnectionTimeout(10, TimeUnit.SECONDS);\n config.setMinConnectionsPerPartition(5);\n config.setMaxConnectionsPerPartition(10);\n config.setPartitionCount(1);\n\n // Setup the connection pool\n _pool = new BoneCP(config);\n\n // Log\n LogManager.getLogger(DatabasePoolManager.class).info(\"Database configuration initialized\");\n }\n catch (Exception ex)\n {\n // Log\n LogManager.getLogger(DatabasePoolManager.class).fatal(\"Could not initialize Database configuration\", ex);\n }\n\n }", "public Connection createConnection(){\n Connection conn = null;\n registerDriver();\n createURL();\n\n try {\n conn = DriverManager.getConnection(urlDB,username,password);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n System.out.println((conn != null)?\"You made it, take control your database now!\":\"Failed to make connection!\");\n\n return conn;\n}", "public static void setUpConnection()\n\t{\n\t\ttry{\n\t\t\t//The information necessary to create a connection to the database, need to figure out what this will be\n\t\n\t\t\n\t\t\t// Register driver by finding the class that corresponds do it \n\t\t\tString driverName = \"oracle.jdbc.OracleDriver\"; \n\t\t\tClass.forName(driverName);\n\t\t\n\t\t\tconn = DriverManager.getConnection(URL, USR, PWD);\n\t\t\n\t\t\tSystem.out.println(\"Connected to C325.\");\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setupConnection()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdatabaseConnection = DriverManager.getConnection(connectionString);\n\t\t}\n\t\tcatch (SQLException currentException)\n\t\t{\n\t\t\tdisplaySQLErrors(currentException);\n\t\t}\n\t}", "public void connect(){\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (ClassNotFoundException ex) {\n System.out.println(\"ClassNotFoundException in connect()\");\n }\n try {\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/pmt\", \"root\", \"\");\n } catch (SQLException ex) {\n System.out.println(\"SQLException in connect()\");\n }\n \n }", "public void connect()throws SQLException{\r\n try {\r\n synchronized (this) {\r\n if(connection != null && !connection.isClosed()) {\r\n throw new SQLException(\"You can't have two identical connections opened\");\r\n }\r\n\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n try {\r\n connection = (DriverManager.getConnection(\r\n \"jdbc:mysql://\"+this.host+ \":\"+ this.port + \"/\"+ this.database, this.username, this.password));\r\n }catch (Exception exception) {\r\n error = \"Credentials\";\r\n throw new SQLException(\"Database doesn't exist or credentials are wrong\");\r\n }\r\n }\r\n }catch (SQLException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void connectDB() {\n\t\tSystem.out.println(\"CONNECTING TO DB\");\n\t\tSystem.out.print(\"Username: \");\n\t\tusername = scan.nextLine();\n\t\tConsole console = System.console(); // Hides password input in console\n\t\tpassword = new String(console.readPassword(\"Password: \"));\n\t\ttry {\n\t\t\tDriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t} catch(Exception Ex) {\n\t\t\tSystem.out.println(\"Error connecting to database. Machine Error: \" + Ex.toString());\n\t\t\tEx.printStackTrace();\n\t\t\tSystem.out.println(\"\\nCONNECTION IS REQUIRED: EXITING\");\n\t\t\tSystem.exit(0); // No need to make sure connection is closed since it wasn't made\n\t\t}\n\t}", "private SQLConnector() throws IOException, SQLException {\n\t\tProperties props = readProperties();\n\t\tString drivers = props.getProperty(\"jdbc.drivers\");\n\t\tif (drivers != null) System.setProperty(\"jdbc.drivers\", drivers);\n\t\tString url = props.getProperty(\"jdbc.url\");\n\t\tString username = props.getProperty(\"jdbc.username\");\n\t\tString password = props.getProperty(\"jdbc.password\");\n\n\t\tconnection = DriverManager.getConnection( url, username, password);\n\t}", "private Connection connect()\n\t{\n\t\tConnection con = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\n\t\t\t//Provide the correct details: DBServer/DBName, username, password\n\t\t\tcon = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:3306/project? useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\", \"root\", \"\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n \n\t\treturn con;\n \n\t}", "public static Connection createDBConnection() throws ClassNotFoundException, SQLException\r\n\t{\r\n\t\tString strDbUser = properties.getProperty(\"jdbc.username\"); // database login username\r\n String strDbPassword = properties.getProperty(\"jdbc.password\"); // database login password\r\n String remoteHost = properties.getProperty(\"remote.host\"); // remote host url (ie cloud server url\t\r\n String remotePort = properties.getProperty(\"remote.port\"); // remote post number\r\n String databaseName = properties.getProperty(\"databaseName\");\r\n Connection con;\r\n \r\n System.out.println(\"Trying connection \");\r\n \r\n\t\tClass.forName(\"org.postgresql.Driver\");\r\n// \tClass.forName(\"com.mysql.jdbc.Driver\");\r\n// con = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:\"+tunnelPort+\"/cos420?user=\"+strDbUser+\"&password=\"+strDbPassword);\r\n\t\tString connectString = \"jdbc:postgresql://\" + remoteHost +\":\" + remotePort + \"/\"+databaseName; \r\n\t\tcon = DriverManager.getConnection(connectString , strDbUser,strDbPassword);\r\n\r\n \tif(!con.isClosed())\r\n System.out.println(\"Successfully connected to Postgres server using TCP/IP...\");\r\n\r\n return con;\r\n\t}", "public void openDB() {\n\n\t\t// Connect to the database\n\t\tString url = \"jdbc:mysql://localhost:2000/X__367_2020?user=X__367&password=X__367\";\n\t\t\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"using url:\"+url);\n\t\t\tSystem.out.println(\"problem connecting to MariaDB: \"+ e.getMessage());\t\t\t\n\t\t\t//e.printStackTrace();\n\t\t}\n\n\t}", "public DatabaseConnector() {\n HikariConfig config = new HikariConfig();\n config.setJdbcUrl(\"jdbc:postgresql://localhost:5547/go_it_homework\");\n config.setUsername(\"postgres\");\n config.setPassword(\"Sam@64hd!+4\");\n this.ds = new HikariDataSource(config);\n ds.setMaximumPoolSize(5);\n }", "private static void connectDatabase(){\n\t\t// register the driver\n\t\ttry{\n\t\t\tClass.forName(DRIVER).newInstance();\n\t\t\tconnection = DriverManager.getConnection(CONNECTION_URL);\n\t\t} catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private Connection connect() {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\n\t\t\t// Provide the correct details: DBServer/DBName, username, password\n\t\t\tcon = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:3306/paymentdb?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\", \"root\", \"\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn con;\n\t}", "public static Connection getConnection() throws SQLException, ClassNotFoundException{\n \tClass.forName(\"com.mysql.jdbc.Driver\");\n return DriverManager.getConnection(databaseUrl, databaseUsername, databasePassword);\n }", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n try {\r\n con = DriverManager.getConnection(\"jdbc:derby://localhost:1527/BracuConnect\", \"sayeem\", \"17101009\");\r\n } catch (SQLException e) {\r\n }\r\n }", "private void open_db() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\"); \n Con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/projectlaundry\",\"root\",\"\");\n stm = Con.createStatement();\n }\n catch (Exception e){\n JOptionPane.showMessageDialog(null,\"Koneksi gagal\");\n System.out.println(e.getMessage());\n }\n }", "public void connect()\n\t{\n try{\n \tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n \tconn = DriverManager.getConnection(url,user,pwd);\n \tSystem.out.println(\"Connected...\");\n }\n \n catch(Exception se){\n \tse.printStackTrace();\n }\n\t}", "private void connectToDB() throws Exception\n\t{\n\t\tcloseConnection();\n\t\t\n\t\tcon = Env.getConnectionBradawl();\n\t}", "public Database() throws SQLException {\n conn = DriverManager.getConnection(dbURL, username, password);\n }", "public void openConnection(){\n\n\t\tString dbIP = getConfig().getString(\"mysql.ip\");\n\t\tString dbDB = getConfig().getString(\"mysql.databaseName\");\n\t\tString dbUN = getConfig().getString(\"mysql.username\");\n\t\tString dbPW = getConfig().getString(\"mysql.password\");\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://\" + dbIP + \"/\" + dbDB, dbUN, dbPW);\n\t\t\tgetLogger().info(\"Connected to databse!\");\n\t\t} catch (SQLException ex) {\n\t\t\t// handle any errors\n\t\t\tgetLogger().info(\"SQLException: \" + ex.getMessage());\n\t\t\tgetLogger().info(\"SQLState: \" + ex.getSQLState());\n\t\t\tgetLogger().info(\"VendorError: \" + ex.getErrorCode());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tgetLogger().info(\"Gabe, you done goof'd!\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void openConn()\r\n {\r\n try\r\n {\r\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\r\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/voteandordersystem\",\"root\",\"hello\");\r\n \r\n \r\n }\r\n catch (ClassNotFoundException | SQLException e)\r\n {\r\n JOptionPane.showMessageDialog(null,\"Invalid Entry\\n(\" + e + \")\");\r\n }\r\n }", "public DataConnection() {\n\t\ttry {\n\t\t\tString dbClass = \"com.mysql.jdbc.Driver\";\n\t\t\tClass.forName(dbClass).newInstance();\n\t\t\tConnection con = DriverManager.getConnection(DIR_DB, USER_DB, PASS_DB);\n\t\t\tstatement = con.createStatement();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public GosplPopulationInDatabase() {\n\t\ttry {\n\t\t\tthis.connection = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:hsqldb:mem:\"+mySqlDBname+\";shutdown=true\", \"SA\", \"\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"error while trying to initialize the HDSQL database engine in memory: \"+e.getMessage(), e);\n\t\t}\n\t}", "public static Connection connect() {\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\t\t\t\t\t\t\n\t\t\treturn DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:mysql://83.212.125.138:3306/st_database\", \"admin\", \"admin\");\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t}", "private void connect() {\n if (this.connection == null && !this.connected) {\n try {\n this.connection = DriverManager.getConnection(this.dbUrl, this.dbUser, this.dbPassword);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }", "private Connection getConnection() throws SQLException{\n return DriverManager.getConnection(\"jdbc:h2:file:./target/db/testdb;MODE=MYSQL\", \"anonymous\", \"\");\n }", "public Connection DbConnection() throws Exception {\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n // Creating a new connection\n // String myDB = \"jdbc:sqlite:C:\\\\Users\\\\kapersky\\\\Documents\\\\NetBeansProjects\\\\Library Management System\\\\src\\\\librarydb.db\";\n String myDB = \"jdbc:mysql://localhost:3306/librarydb\";\n con = DriverManager.getConnection(myDB, \"root\", \"\");\n return con;\n\n }" ]
[ "0.75183207", "0.74943197", "0.74652916", "0.7392174", "0.73391974", "0.73247284", "0.7304147", "0.7298469", "0.7292554", "0.72408265", "0.71750736", "0.7165007", "0.7152659", "0.7139173", "0.7128113", "0.71159285", "0.71126276", "0.71064645", "0.7062888", "0.70565575", "0.70487446", "0.7041504", "0.7034924", "0.70173246", "0.70101607", "0.70092905", "0.6969683", "0.6968312", "0.6952825", "0.6945091", "0.69318455", "0.6925797", "0.6919224", "0.69190645", "0.6907262", "0.6894988", "0.68949234", "0.6892804", "0.6882185", "0.6876742", "0.6873157", "0.6870853", "0.6870107", "0.6866843", "0.6862086", "0.6853978", "0.6851448", "0.6849831", "0.68497014", "0.68437034", "0.683306", "0.6830217", "0.68254876", "0.6822921", "0.6809356", "0.6809036", "0.6806226", "0.679561", "0.67930603", "0.67883164", "0.67785376", "0.6772881", "0.67586917", "0.675592", "0.6742278", "0.6739674", "0.6727509", "0.67272574", "0.6726101", "0.67259467", "0.67223567", "0.67218906", "0.67208", "0.6717631", "0.67105", "0.67083603", "0.6700219", "0.6698137", "0.6692113", "0.6684659", "0.6679875", "0.66791385", "0.6679046", "0.66729844", "0.66697335", "0.666607", "0.66613483", "0.6658356", "0.6654375", "0.6650566", "0.6646531", "0.6645736", "0.6645541", "0.6637153", "0.66211987", "0.66123945", "0.66087437", "0.66059345", "0.6604297", "0.65772414", "0.65766567" ]
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Pet)) { return false; } Pet other = (Pet) object; if ((this.idPet == null && other.idPet != null) || (this.idPet != null && !this.idPet.equals(other.idPet))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "protected abstract String getId();", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public int getID() {return id;}", "public int getID() {return id;}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "public int getId(){\r\n return localId;\r\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "public void setId(Long id){\n this.id = id;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "private void clearId() {\n \n id_ = 0;\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "public abstract Long getId();", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public Long getId() \n {\n return id;\n }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public int getID(){\n return id;\n }", "public int getId()\n {\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6896886", "0.6838461", "0.67056817", "0.66419715", "0.66419715", "0.6592331", "0.6579151", "0.6579151", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.65624106", "0.65624106", "0.65441847", "0.65243006", "0.65154546", "0.6487427", "0.6477893", "0.6426692", "0.6418966", "0.6416817", "0.6401561", "0.63664836", "0.63549376", "0.63515353", "0.6347672", "0.6324549", "0.6319196", "0.6301484", "0.62935394", "0.62935394", "0.62832105", "0.62710917", "0.62661785", "0.6265274", "0.6261401", "0.6259253", "0.62559646", "0.6251244", "0.6247282", "0.6247282", "0.6245526", "0.6238957", "0.6238957", "0.6232451", "0.62247443", "0.6220427", "0.6219304", "0.6211484", "0.620991", "0.62023336", "0.62010616", "0.6192621", "0.61895776", "0.61895776", "0.61893976", "0.61893976", "0.61893976", "0.6184292", "0.618331", "0.61754644", "0.6173718", "0.6168409", "0.6166131", "0.6161708", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.61556244", "0.61556244", "0.61430943", "0.61340135", "0.6128617", "0.6127841", "0.61065215", "0.61043483", "0.61043483", "0.6103568", "0.61028486", "0.61017346", "0.6101399", "0.6098963", "0.6094214", "0.6094", "0.6093529", "0.6093529", "0.6091623", "0.60896", "0.6076881", "0.60723215", "0.6071593", "0.6070138", "0.6069936", "0.6069529" ]
0.0
-1
Add_place reads in a string for the attribute place
public void Add_place(String p) { place = new String(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPlace(String place){\n this.place = place;\n }", "Builder addContentLocation(Place value);", "@Override\n\tpublic synchronized Place addPlace(String label) {\n\t\tPlace p = new Place(this, label);\n\t\tthis.places.add(p);\n\t\tgraphElementAdded(p);\n\t\treturn p;\n\t}", "public String Get_place() \n {\n\n return place;\n }", "public void add(Place place) {\n\t\tthis.places.add(place);\n\t}", "private static void createPlace(Place place) {\r\n\t\tint tempInt = -1;\r\n\t\tContainerNII placeNii = new ContainerNII();\r\n\t\tGeoCoordinate position = new GeoCoordinate();\r\n\t\tMedia media = new Media();\r\n\t\t\r\n\t\tinsertNIIValues(placeNii, \"place\");\r\n\t\tplace.setNii(placeNii);\r\n\t\t\t\t\r\n\t\tif ((tempInt = insertInteger(\"place radius: \")) != -1)\r\n\t\t\t\tplace.setRadius(tempInt);\r\n\t\t\r\n\t\tinsertPosition(position);\r\n\t\tplace.setPosition(position);\r\n\t\t\r\n\t\tinsertMedia(media);\r\n\t\tplace.setMedia(media);\r\n\t}", "public Builder setUiPlace(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n uiPlace_ = value;\n onChanged();\n return this;\n }", "public void addPlace(String key, Place place)\n {\n if(mMap!=null) {\n Double lon, lat;\n lat = Double.parseDouble(place.getLat());\n lon = Double.parseDouble(place.getLon());\n String name = place.getName();\n String type = place.getType();\n LatLng placeLatLng = new LatLng(lat, lon);\n\n if (placesMarkers.containsKey(key)) {\n //Already Marker is present,\n\n //Just update the marker\n placesMarkers.get(key).setPosition(placeLatLng);\n placesMarkers.get(key).setTitle(name);\n\n\n } else {\n //Adding marker first time\n\n //Create marker with necessary variables\n placesMarkers.put(key, mMap.addMarker(new MarkerOptions().position(placeLatLng).\n title(name).\n icon(BitmapDescriptorFactory.fromBitmap(unknownUser))));\n }\n\n //Set the icon of marker based on type\n\n if (type.equals(\"home\")) {\n placesMarkers.get(key).setIcon(\n BitmapDescriptorFactory.fromResource(R.drawable.place_home)\n );\n } else if (type.equals(\"date\")) {\n placesMarkers.get(key).setIcon(\n BitmapDescriptorFactory.fromResource(R.drawable.place_dating)\n );\n } else if (type.equals(\"education\")) {\n placesMarkers.get(key).setIcon(\n BitmapDescriptorFactory.fromResource(R.drawable.place_education)\n );\n }\n }\n }", "Builder addContentLocation(Place.Builder value);", "public void setPlace(String place) {\n\t\tthis.place = place == null ? null : place.trim();\n\t}", "public String getPlace(){\n return place;\n }", "public void addAddress(String Address, Coord coord);", "public void setActplace(String actplace) {\r\n this.actplace = actplace;\r\n }", "public void addPos(String word, IPosition pos);", "Builder addLocationCreated(Place value);", "public String getPlace() {\n\t\treturn place;\n\t}", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public void addPlace(Place place){\n if(!places.contains(place)){\n places.add(place);\n }\n if(!place.hasShip()){\n place.placeShip(this);\n }\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "Builder addPosition(String value);", "public void Print_place()\n {\n\n System.out.println(\"Place: \" + place);\n }", "@Override\n public void onPlaceSelected(Place place) {\n Log.i(TAG, \"Place: \" + place.getName());\n editTextBusinessName.setText(place.getName());\n editTextLocation.setText(place.getAddress());\n editTextPhone.setText(place.getPhoneNumber());\n barCoordinates = place.getLatLng();\n //editTextBusinessDescription.setText(place.getAttributions());\n\n }", "@Override\n public void onPlaceSelected(Place place) {\n\n place_str[0] = place.getName() + \",\" + place.getId();\n }", "public static String placePostData()\r\n\t{\t\r\n\t\tString res=\"/maps/api/place/add/json\";\r\n\t\treturn res;\r\n\t}", "public void insertOrUpdate(Place place) {\n ContentValues values = new ContentValues();\n values.put(IPlace.PLACE_NAME_COLUMN, place.getName());\n values.put(IPlace.PLACE_CATEGORY_COLUMN, place.getCategory());\n values.put(IPlace.PLACE_NEIGHBOURHOOD_COLUMN, place.getNeighbourhood());\n values.put(IPlace.PLACE_COORDINATE_X_COLUMN, place.getX());\n values.put(IPlace.PLACE_COORDINATE_Y_COLUMN, place.getY());\n String[] args = {String.valueOf(place.getObjectId())};\n boolean success = super.update(IPlace.PLACE_OBJECT_ID_COLUMN, args, values);\n if (!success) {\n values.put(IPlace.PLACE_OBJECT_ID_COLUMN, place.getObjectId());\n super.insert(values);\n }\n }", "Builder addLocationCreated(Place.Builder value);", "Place getPlace();", "public Place(String name) {\r\n\t\tthis.name = name;\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "Builder addPosition(Text value);", "@Before(\"@DeletePlace_UsingHooks\")\n\tpublic void addPlaceHook() throws IOException {\n\t\t\n\t\tif(APIStepDefinition.placeID==null) {\n\t\taPIStepDefinition.add_place_payload_with(\"Honey\", \"English\", \"Africa\");\n\t\taPIStepDefinition.call_with_http_request(\"AddPlaecAPI\", \"Post\");\n\t\taPIStepDefinition.api_call_got_success_with_status_code(200);\n\t\taPIStepDefinition.verify_placeID_got_created_having_using(\"name\", \"Honey\" , \"GetPlaecAPI\");\t\n\t}\n\t}", "@Override\n\t@XmlElement\n\tpublic void setPlaceCode(String placeCode) {\n\t\t\n\t}", "public Place(String name, LinkedHashMap<Integer, Data> data) {\r\n\t\tthis.name = name;\r\n\t\tthis.data = data;\r\n\t}", "public String getActplace() {\r\n return actplace;\r\n }", "public void addPlaced(Block placed) {\n\t\tlastPlaced.put(placed, System.currentTimeMillis());\n\t}", "public void setPlace(int num) {\n\t\tplace = num;\n\t}", "public Place() {\r\n\t\tthis.name = \"Unknown Place\";\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "@Override\r\n\tpublic void savePlace(Place place) {\n\t\tif (conn == null) {\r\n\t\t\tSystem.err.println(\"DB connection failed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tString sql = \"INSERT IGNORE INTO places VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\r\n\t\t\tps.setString(1, place.getPlaceId());\r\n\t\t\tps.setString(2, place.getName());\r\n\t\t\tps.setDouble(3, place.getRating());\r\n\t\t\tps.setString(4, place.getAddress());\r\n\t\t\tps.setString(5, place.getIcon());\r\n\t\t\tps.setDouble(6, place.getLat());\r\n\t\t\tps.setDouble(7, place.getLon());\r\n\t\t\tps.setString(8, place.getCity());\r\n\t\t\tps.execute();\r\n\r\n\t\t\tif (place.getTypes() != null) {\r\n\t\t\t\tsql = \"INSERT IGNORE INTO types VALUES(?, ?)\";\r\n\t\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\t\tps.setString(1, place.getPlaceId());\r\n\t\t\t\tfor (String type : place.getTypes()) {\r\n\t\t\t\t\tps.setString(2, type);\r\n\t\t\t\t\tps.execute();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (place.getPhotos() != null) {\r\n\t\t\t\tsql = \"INSERT IGNORE INTO photos VALUES(?, ?)\";\r\n\t\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\t\tps.setString(1, place.getPlaceId());\r\n\t\t\t\tfor (String photo : place.getPhotos()) {\r\n\t\t\t\t\tps.setString(2, photo);\r\n\t\t\t\t\tps.execute();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getplaceName() {\n\t\treturn placeName;\n\t}", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n }\n }", "private static Place buildPlace(Place parent, BindingSet bindings) {\n Value placeValue = bindings.getValue(\"place\");\n Value featureValue = bindings.getValue(\"feature\");\n Value latitudeValue = bindings.getValue(\"latitude\");\n Value longitudeValue = bindings.getValue(\"longitude\");\n Value populationValue = bindings.getValue(\"population\");\n\n // extract GeoNames ID from GeoNames URL\n int geoID;\n try {\n String geoURL = placeValue.stringValue();\n int startPos = Place.URL_PREFIX.length();\n int endPos = geoURL.length() - Place.URL_SUFFIX.length();\n geoID = Integer.parseInt(geoURL.substring(startPos, endPos));\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot extract ID from URL: \" + placeValue.stringValue(), e);\n return null; // cannot build place without ID\n }\n\n // parse coordinates if available\n double latitude = 0;\n double longitude = 0;\n try {\n latitude = Double.parseDouble(latitudeValue.stringValue());\n longitude = Double.parseDouble(longitudeValue.stringValue());\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot parse coordinates\", e);\n }\n\n // parse population if available\n long population = 0;\n if (populationValue != null) {\n try {\n population = Long.parseLong(populationValue.stringValue());\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot parse population\", e);\n }\n }\n\n // extract feature if available\n String feature = \"\";\n String featureURL = featureValue.stringValue();\n if (featureURL.startsWith(FEATURE_PREFIX)) feature = featureURL.substring(FEATURE_PREFIX.length());\n else LOGGER.warn(\"cannot extract feature from URL: \" + featureURL);\n\n // build place\n return new Place(geoID, latitude, longitude, population, feature, parent);\n }", "public Builder setUiPlaceBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n uiPlace_ = value;\n onChanged();\n return this;\n }", "public void add_one_place_to_tour(entities.PlaceOfInterestTour place) {\n\t\tPlaceofInterestItem sp = new PlaceofInterestItem(place);\n\t\t// delete buttons from list of item (place)\n\t\tsp.add_edit_layout();\n\n\t\tsp.setOnDragOver(event -> {\n\t\t\tfinal Dragboard dragboard = event.getDragboard();\n\t\t\tif (dragboard.hasString() && TAB_DRAG_KEY.equals(dragboard.getString()) && draggingTab.get() != null) {\n\t\t\t\tevent.acceptTransferModes(TransferMode.MOVE);\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\t\tsp.setOnDragDetected(event -> {\n\t\t\tDragboard dragboard = sp.startDragAndDrop(TransferMode.MOVE);\n\t\t\tClipboardContent clipboardContent = new ClipboardContent();\n\t\t\tclipboardContent.putString(TAB_DRAG_KEY);\n\t\t\tdragboard.setContent(clipboardContent);\n\t\t\tSnapshotParameters spp = new SnapshotParameters();\n\t\t\tspp.setFill(Color.WHITE);\n\t\t\tdragboard.setDragView(sp.snapshot(spp, null), event.getX(), event.getY());\n\t\t\tdraggingTab.set(sp);\n\t\t\tevent.consume();\n\t\t});\n\t\tsp.setOnDragDropped(event -> {\n\n\t\t\tDragboard db = event.getDragboard();\n\t\t\tboolean success = false;\n\t\t\tif (db.hasString()) {\n\t\t\t\tVBox parent = (VBox) sp.getParent();\n\t\t\t\tPlaceofInterestItem source = (PlaceofInterestItem) event.getGestureSource();\n\t\t\t\tint sourceIndex = parent.getChildren().indexOf(source);\n\t\t\t\tint targetIndex = parent.getChildren().indexOf(sp);\n\t\t\t\tList<Node> nodes = new ArrayList<Node>(parent.getChildren());\n\t\t\t\tif (sourceIndex < targetIndex) {\n\t\t\t\t\tCollections.rotate(nodes.subList(sourceIndex, targetIndex + 1), -1);\n\t\t\t\t} else {\n\t\t\t\t\tCollections.rotate(nodes.subList(targetIndex, sourceIndex + 1), 1);\n\t\t\t\t}\n\t\t\t\tparent.getChildren().clear();\n\t\t\t\tparent.getChildren().addAll(nodes);\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\tevent.setDropCompleted(success);\n\t\t\tevent.consume();\n\n\t\t});\n\n\t\tsp.setOnMouseEntered(event -> {\n\t\t\tsp.setStyle(\"-fx-background-color : #BDBBC3\");\n\t\t});\n\t\tsp.setOnMouseExited(event -> {\n\t\t\tsp.setStyle(\"-fx-background-color : #EBE8F9\");\n\t\t});\n\n\t\tPlatform.runLater(() -> {\n\t\t\tpnItems.getChildren().add(sp);\n\t\t\tnew SlideInUp(sp).play();\n\t\t});\n\n\t}", "private void addPlacesToWorld(ArrayList<Place> places, GameWorld world) {\n for (int i = 0; i < places.size(); i++) {\n world.addPlace(places.get(i));\n }\n }", "public static void add_word_place_info(String word,String book,int chapter_no,int verse_no)\n\t{\n\t if(word.length()>0)\n\t {\n\t boolean tag_studied=word_place.containsKey(word);\n\t if(true==tag_studied)\n\t {\n\t Map<String,Map<Integer,Integer> > item_1=word_place.get(word);\n\t tag_studied=item_1.containsKey(book);\n\t if(true==tag_studied)\n\t {\n\t\tMap<Integer,Integer> item_2=item_1.get(book);\n\t\ttag_studied=item_2.containsKey(chapter_no);\n\t\tif(true==tag_studied)\n\t\t{\n\t\t ;\n\t\t}\n\t\telse\n\t\t{\n\t\t item_2.put(chapter_no,verse_no);\n\t\t}\n\t }\n\t else\n\t {\n\t\tMap<Integer,Integer> place_chapter_verse=new HashMap();\n\t\tplace_chapter_verse.put(chapter_no,verse_no);\n\t\t\n\t\titem_1.put(book,place_chapter_verse);\n\t }\n\t }\n\t else\n\t {\n\t Map<Integer,Integer> place_chapter_verse=new HashMap();\n\t place_chapter_verse.put(chapter_no,verse_no);\n\t \n\t Map<String,Map<Integer,Integer> > place_book_chapter_verse=new HashMap();\n\t place_book_chapter_verse.put(book,place_chapter_verse);\n\t \n\t word_place.put(word,place_book_chapter_verse);\n\t }\n\t }\n\t}", "public abstract void addValue(String str, Type type);", "private void add(String thestring) {\n\t\t\n\t}", "private Place getPlace(String identifierPlace) {\n\t\tPlace place = null;\n\t\tfor(Place p: places ){\n\t\t\tif(p.getName().equals(identifierPlace)){\n\t\t\t\tplace = p;\n\t\t\t}\n\t\t}\n\t\treturn place;\n\t}", "@Override\n public void onPlaceSelected(Place place) {\n latLng = place.getLatLng();\n locationName = place.getName().toString();\n locationAddress = place.getAddress().toString();\n Log.i(TAG, \"Location:latitude: \" + place.getLatLng().latitude);\n Log.i(TAG, \"Location:Address: \" + place.getAddress());\n Log.i(TAG, \"Location:Web: \" + place.getWebsiteUri());\n Log.i(TAG, \"Location:Place: \" + place.getName());\n mMap.addMarker(new MarkerOptions().position(latLng).title(locationName).snippet(locationAddress)).showInfoWindow();\n mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n }", "@Override\n public void onPlaceSelected(Place place) {\n\n Log.i(\"place_autocomplete\", \"Place: \" + place.getName() + \", \" + place.getId() + \", \" + place.getLatLng());\n LatLng latLng = place.getLatLng();\n setLocationWork(latLng.latitude, latLng.longitude);\n }", "public void place(Position position) { this.position = position; }", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\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 uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc addNewLoc();", "public void setListPlaceType(String s) {\n editor.putString(Constans.KeyPreference.LIST_PLACE_TYPE, s);\n editor.commit();\n }", "public\n void insertString(int offset, String str, AttributeSet a) throws BadLocationException {\n if (str == null) {\n return;\n }\n\n /* Insert the string if it is formatted properly. */\n try {\n double d = Double.parseDouble(str);\n } catch (NumberFormatException e) {\n\n /* Handle decimal points the first time they appear. */\n if (!str.equals(\".\")) {\n return;\n } else if (str.equals(\".\") && !firstDecimal) {\n return;\n } else {\n firstDecimal = false;\n }\n }\n\n\n /* If the string was successfully parsed but had a decimal point\n in it (as could happen when this class is instantiated with\n a given value), the firstDecimal flag must be set. */\n if (str.indexOf(\".\") != -1) {\n firstDecimal = false;\n }\n\n /* Insert the string into the field. */\n super.insertString(offset, str, a);\n }", "void addHasAddress(String newHasAddress);", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void add(String str);", "public void add(String str);", "public int getPlace() {\n\t\treturn place;\n\t}", "public interface PlaceInfo {\n\n\t\n\t/**\n\t * Return the place name\n\t * @return the place name\n\t */\n\tpublic String getName();\n\t\n\t\n\t/**\n\t * Return the place description\n\t * @return the place description\n\t */\n\tpublic String getDescription();\n\n\n\t/**\n\t * Is this place the space ship?\n\t * @return true if the place represents a space ship\n\t */\n\tpublic boolean isSpaceship();\n}", "@Override\n\tpublic void insertString(int offs, String str, AttributeSet a) throws BadLocationException {\n\t\tsuper.insertString(offs, str.replaceAll(\"[^0-9]\", \"\"), a);\n\t}", "private void updateLocationUI() {\n mCurrentLocationStr = mCurrentPlace.getAddress().toString();\n mCurrentLatLng = mCurrentPlace.getLatLng();\n if(mCurrentLocationStr.isEmpty())\n mCurrentLocationStr = String.format(\"(%.2f, %.2f)\",mCurrentLatLng.latitude, mCurrentLatLng.longitude);\n\n mAddLocation.setText(mCurrentLocationStr);\n mAddLocation.setTextColor(mSecondaryTextColor);\n mClearLocation.setVisibility(View.VISIBLE);\n }", "public void addWord(Word word);", "public static boolean addTouristPlace ( String touristPlace, int price) {\n\t\t\n\t\tif(allTouristPlace.containsKey(touristPlace))//checking if already exits cannot add\n\t\t{\n\t\t\tSystem.out.println(\"...Already Exit...\");\n\t\t}\n\t\telse {\n\t\t\tallTouristPlace.put(touristPlace,price);\n\t\t\tSystem.out.println(\"....Place Added...\");\n\t\t}\n\t\t\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public void setPlaceId(String placeId) {\n this.placeId = placeId;\n }", "public void placeRobot(String validPlaceCmd, Robot robot) {\r\n\t\ttry {\r\n\t\t\tString[] placePositionFaceArr = this\r\n\t\t\t\t\t.getRobotPositionAndFace(validPlaceCmd);\r\n\t\t\t\r\n\t\t\tif (placePositionFaceArr.length == 3) {\r\n\t\t\t\tint row = RobotSimulator.isInteger(placePositionFaceArr[0]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[0]) : -1;\r\n\t\t\t\tint col = RobotSimulator.isInteger(placePositionFaceArr[1]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[1]) : -1;\r\n\r\n\t\t\t\trobot.setRow(row);\r\n\t\t\t\trobot.setCol(col);\r\n\r\n\t\t\t\tint faceId = robot.getFaceId(placePositionFaceArr[2]);\r\n\t\t\t\trobot.setFace(faceId);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Place robot exception: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public Place addPlace(String name, String address, String zone, String privateResidence,String country) throws MeetingException{\n \tPlace place = null;\n \tif(this.existCountryOrPlace(country, name)){\n \t\tthrow new PlaceAlreadyExist();\n \t}else{\n \t\tPlace p = new Place(name, address, zone, (privateResidence.equals(\"yes\"))?true:false, country);\n \t\tp.newIdPlace();\n \t\tplaces.add(p);\n \t\tplace = p;\n \t}\n \treturn place;\n }", "public void insert(String word, Point point)\r\n\t{\r\n\t\t//call insert\r\n\t\troot.insert(new Data(word, point));\r\n\t}", "public void setFormFields(PlaceDescription place)\n {\n EditText locationName = (EditText) findViewById(R.id.nameInput);\n EditText locationDesc = (EditText) findViewById(R.id.descInput);\n EditText locationCat = (EditText) findViewById(R.id.categoryInput);\n EditText locAddrTitle = (EditText) findViewById(R.id.addrTitleInput);\n EditText locAddrStreet = (EditText) findViewById(R.id.addrStreetInput);\n EditText locElevation = (EditText) findViewById(R.id.elevationInput);\n EditText locLatitude = (EditText) findViewById(R.id.latitudeInput);\n EditText locLongitude = (EditText) findViewById(R.id.longitudeInput);\n\n // Set values to match place description provided\n locationName.setText(place.name);\n locationDesc.setText(place.description);\n locationCat.setText(place.category);\n locAddrTitle.setText(place.addrTitle);\n locAddrStreet.setText(place.addrStreet);\n locElevation.setText(Float.toString(place.elevation));\n locLatitude.setText(Float.toString(place.latitude));\n locLongitude.setText(Float.toString(place.longitude));\n }", "Place resolveLocation( Place place );", "void place_character(Character character, Town town) throws IllegalStateException;", "private void addToList(Place place) {\n if(!checkDuplicates(place.placeid))\n restaurantsList.add(place);\n\n\n Collections.sort(restaurantsList, new Comparator<Place>() {\n @Override\n public int compare(Place lhs, Place rhs) {\n return lhs.distance.compareTo(rhs.distance);\n }\n });\n HomepageAdapter adapterStores = new HomepageAdapter(activity, restaurantsList, mAddressOutput);\n adapterStores.setOnClickListener(new HomepageAdapter.onClickListener() {\n @Override\n public void OnClick(int position) {\n Bundle args = new Bundle();\n args.putString(\"placeid\", restaurantsList.get(position).placeid);\n activity.replaceFragments(RestaurantDetailsFragment.class, args);\n }\n });\n shimmerRecycler.setAdapter(adapterStores);\n }", "public int getPlaceName() {\n return mPlaceName;\n }", "public void addInputPlace(Place p, int amount) {\r\n\t\tif (defaultMode != null) {\r\n\t\t\tdefaultMode.addInputPlace(p, amount);\r\n\t\t} else {\r\n\t\t\tsendWarning(\r\n\t\t\t\t\t\"Trying to add an input place to a Transition that \"\r\n\t\t\t\t\t\t\t+ \"possibly has multiple modes\",\r\n\t\t\t\t\t\"Transition: \" + getName() + \"; Place: \" + p.getName(),\r\n\t\t\t\t\t\"Method addInputPlace(Place p, int amount) is only to be \"\r\n\t\t\t\t\t\t\t+ \"used on Transitions that only have a single mode and are\"\r\n\t\t\t\t\t\t\t+ \" constructed as such\",\r\n\t\t\t\t\t\"To create a Transition with only a single mode, use the\"\r\n\t\t\t\t\t\t\t+ \" public Transition(Model owner, PetriNet ownerNet, String\"\r\n\t\t\t\t\t\t\t+ \" name, NumericalDist<Double> waitDist, NumericalDist<Double>\"\r\n\t\t\t\t\t\t\t+ \" durationDist, boolean showInReport, boolean showInTrace) constructor\");\r\n\t\t}\r\n\t}", "public void add(String word, String file, int position) {\n\t \taddHelper(word, file, position);\n\t}", "public String getPlaceId() {\n return placeId;\n }", "void addHasCity(String newHasCity);", "public void setPlaces(int places) {\r\n this.places = places;\r\n }", "public void removePlace(Place place){\n places.remove(place);\n }", "public boolean insert(T t, int place) {\n if (place >= a.length-1 || place<0) {\n System.out.println(\"Error, there is no such place.\");\n return false;\n }\n if (a[place]==null) {\n a[place]=t;\n return true;\n } else {\n System.out.println(\"There is no place on this bookshelf.\");\n return false;\n }\n }", "int placeElement(String elementName, Point2D startCoordinates);", "public void addInputPlace(Place p, Map<TokenType, Integer> amounts) {\r\n\t\tif (defaultMode != null) {\r\n\t\t\tdefaultMode.addInputPlace(p, amounts);\r\n\t\t} else {\r\n\t\t\tsendWarning(\r\n\t\t\t\t\t\"Trying to add an input place to a Transition that \"\r\n\t\t\t\t\t\t\t+ \"possibly has multiple modes\",\r\n\t\t\t\t\t\"Transition: \" + getName() + \"; Place: \" + p.getName(),\r\n\t\t\t\t\t\"Method addInputPlace(Place p, int amount) is only to be \"\r\n\t\t\t\t\t\t\t+ \"used on Transitions that only have a single mode and are\"\r\n\t\t\t\t\t\t\t+ \" constructed as such\",\r\n\t\t\t\t\t\"To create a Transition with only a single mode, use the\"\r\n\t\t\t\t\t\t\t+ \" public Transition(Model owner, PetriNet ownerNet, String\"\r\n\t\t\t\t\t\t\t+ \" name, NumericalDist<Double> waitDist, NumericalDist<Double>\"\r\n\t\t\t\t\t\t\t+ \" durationDist, boolean showInReport, boolean showInTrace) constructor\");\r\n\t\t}\r\n\t}", "private void addPollingPlace() {\n\n\t\t// when the election is not open,\n\t\tif (!election.pollsStatus()) {\n\t\t\tSystem.out.println(\"The election is closed.\");\n\t\t\tSystem.out.println(\"No more polling places may be added.\");\n\t\t}else {\n\n\t\t\tString pollingPlaceName = ValidInputReader.getValidString(\"Name of polling place:\", \"^[a-zA-Z0-9 ]+$\");\n\t\t\ttry {\n\t\t\t\telection.addPollingPlace(pollingPlaceName);\n\t\t\t\tSystem.out.println(\"Added \" + pollingPlaceName + \".\");\n\n\t\t\t}catch(FileNotFoundException fnfError){\n\t\t\t\t// when the polling place is not found,\n\t\t\t\tSystem.out.println(fnfError.getMessage());\n\t\t\t}\n\n\t\t}\n\t}", "Location( String placeName, String placeDescript, String altDescript, boolean canDrive){\n\t\t\tlocationName = placeName;\n\t\t\tlocationDescription = placeDescript;\n\t\t\taltDescription = altDescript;\n\t\t\tdrivable = canDrive;\n\t\t}", "void add(String value);", "public void storePlaceData(String id, String name, String type, double latitude, double longitude) {\n\t\t\n\t\tArrayList<String> place_data = new ArrayList<String>();\n\t\t\n\t\tlong position = mPref.getLong(\"KEY_DATA_POSITION\", 0);\n\n\t\t// Store id, name, type, latitude, longitude to ArrayList\n\t\tplace_data.add(id);\n\t\tplace_data.add(name);\n\t\tplace_data.add(type);\n\t\tplace_data.add(String.valueOf(latitude));\n\t\tplace_data.add(String.valueOf(longitude));\n\t\t\n\t\t\t\n\t\t// Store key = position of selected ListView item, value = [id, name, type, latitude, longitude] in SharedPrefs\n\t\tmEditor.putString(\"USER_DATA_\" + position, place_data.toString());\n\t\tmEditor.commit();\n\t}", "public static String getWaypointFromPlace(Place place) {\n return \"geo!\" + place.getLatitude() + \",\" + place.getLongitude();\n }", "public Place(String Location, String Name) {\n mLocation = Location;\n mName = Name;\n }", "public void place(Object animal, Position position) {\n field[position.getRow()][position.getColumn()] = animal;\n }", "public interface Placeable {\n}", "public void add(T word);", "private void clickAddManualPlaceButton() {\n // scroll to save button to make sure Espresso can click it\n onView(withId(R.id.btn_manual_add_place))\n .perform(scrollTo());\n // save manual place\n onView(withId(R.id.btn_manual_add_place)).perform(click());\n }", "public void setType(PlaceType type) {\n\t\tthis.type = type;\n\t}", "public void insertString (int pos, String str, AttributeSet attr) \r\n\t\tthrows BadLocationException {\r\n\r\n\t\tif (str == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint len = str.length();\r\n\t\tif (len == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint curLength = getLength();\r\n\t\tif (maxLength > 0) {\r\n\t\t\tif (curLength + len > maxLength) {\r\n\t\t\t\tbeep();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif (len > 1) {\r\n\r\n\t\t\tdontValidate = true;\r\n\t\t\tint j = 0;\r\n\t\t\tfor (int i = pos; i < len; i++, j++) {\r\n\r\n\t\t\t\tif (i == len - 1) {\r\n\t\t\t\t\tdontValidate = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString s = str.substring(j, j + 1);\t\r\n\t\t\t\tinsertString(i, s, attr);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\t/*\r\n\t\t * If it's a digit character then go on, otherwise enter the \r\n\t\t * special checking mode\r\n\t\t */\r\n\t\tchar digit_char = str.charAt(0);\r\n\t\tif (!Character.isDigit(digit_char) && digit_char != '-'\r\n\t\t\t&& digit_char != '+' && digit_char != '.'\r\n\t\t\t&& digit_char != 'E' && digit_char != 'e') {\r\n\r\n\t\t\t/*\r\n\t\t\t * Invalid data - don't modify\r\n\t\t\t */\t\t\t\r\n\t\t\tbeep();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tString buf = getText(0, curLength).toLowerCase();\r\n\t\tif (digit_char == '-' || digit_char == '+') {\r\n\r\n\t\t\tif (pos == 0 && buf.length() > 0\r\n\t\t\t\t\t&& (buf.charAt(0) == '-' || buf.charAt(0) == '+')) {\r\n\t\t\t\t/*\r\n\t\t\t\t * don't let user begin line with 2 sign characters\r\n\t\t\t\t */\r\n\t\t\t\tbeep();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * other than the first character, only allow a +/- to\r\n\t\t\t * sign the exponent (i.e. -5.09e-3)\r\n\t\t\t */\r\n\t\t\tboolean sign_okay = \r\n\t\t\t\t(pos == 0) || (pos > 1 && buf.charAt(pos - 1) == 'e');\r\n\t\t\tif (!sign_okay) {\r\n\t\t\t\tbeep();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (digit_char == '.' && buf.indexOf(\".\") > -1) {\r\n\t\t\tbeep();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ((digit_char == 'e' || digit_char == 'E') && buf.indexOf(\"e\") > -1) {\r\n\t\t\tbeep();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\tif (dontValidate || (minValue == null && maxValue == null)) {\r\n\t\t\tsuper.insertString(pos, str, attr);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\t\r\n\r\n\t\t/*\r\n\t\t * Build up the string and validate it's numeric value \r\n\t\t */\r\n\t\tString s = getText(0, curLength);\r\n\t\tStringBuffer number = new StringBuffer();;\r\n\t\tif (pos > 0) {\r\n\r\n\t\r\n\t\t\tif (pos <= curLength) {\r\n\t\t\t\tnumber.append(s.substring(0, pos));\r\n\t\t\t}\r\n\r\n\t\t\tnumber.append(str);\r\n\t\t\r\n\t\t\tif (pos < curLength) {\r\n\t\t\t\tnumber.append(s.substring(pos));\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\tnumber.append(str);\r\n\t\t\tif (s != null) {\r\n\t\t\t\tnumber.append(s);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\ttry {\r\n\r\n\t\t\tDouble val = new Double(number.toString());\r\n\t\t\tif (validateMin && minValue != null &&\r\n\t\t\t\t\tminValue.compareTo(val) > 0) {\r\n\r\n\t\t\t\tbeep();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (maxValue != null && maxValue.compareTo(val) < 0) {\r\n\r\n\t\t\t\tbeep();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t} catch (NumberFormatException e) {\r\n\r\n\t\t\tbeep();\r\n\t\t\treturn;\r\n\t\t}\t\t\t\r\n\r\n\r\n\t\tsuper.insertString(pos, str, attr);\r\n\t}" ]
[ "0.6783822", "0.64325875", "0.6420108", "0.623437", "0.6224436", "0.6207527", "0.60566956", "0.603804", "0.59895873", "0.5984708", "0.59641737", "0.594609", "0.5945657", "0.59439605", "0.59381986", "0.5937254", "0.5936523", "0.5936523", "0.5936523", "0.5936523", "0.58870757", "0.588683", "0.588683", "0.588683", "0.5811369", "0.5753949", "0.5686333", "0.5678828", "0.5632537", "0.5616381", "0.56161183", "0.5608759", "0.5594494", "0.5586965", "0.5576753", "0.55259657", "0.5518685", "0.54538614", "0.5450738", "0.54489684", "0.5414914", "0.53817534", "0.5379235", "0.5370835", "0.534648", "0.5343646", "0.53394836", "0.53389966", "0.5338015", "0.52948517", "0.52922124", "0.52897406", "0.528562", "0.5265565", "0.52635723", "0.5262994", "0.5258998", "0.52547836", "0.5243276", "0.5235473", "0.5233178", "0.52141255", "0.5186871", "0.5186871", "0.51771855", "0.5139706", "0.51339597", "0.51225615", "0.51173073", "0.5101701", "0.5100963", "0.5098871", "0.5090746", "0.5084425", "0.5082785", "0.5077471", "0.5073848", "0.5064057", "0.5053129", "0.504084", "0.5040453", "0.50212175", "0.50200295", "0.5017419", "0.50155467", "0.50125897", "0.50080264", "0.49918026", "0.49901816", "0.49849075", "0.49812645", "0.49743527", "0.49740365", "0.49524605", "0.4952064", "0.4942052", "0.4938804", "0.49299303", "0.4925303", "0.4917056" ]
0.7887497
0
Get_place Returns the value of place.
public String Get_place() { return place; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPlace() {\n\t\treturn place;\n\t}", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public final native PlaceResult getPlace() /*-{\n return this.getPlace();\n }-*/;", "Place getPlace();", "public int getPlace() {\n\t\treturn place;\n\t}", "public String getPlace(){\n return place;\n }", "public void Print_place()\n {\n\n System.out.println(\"Place: \" + place);\n }", "public Place getPlace() {\n\t\treturn null;\r\n\t}", "public int getPlaceLocation() {\n return mPlaceLocation;\n }", "private Place getPlace(String identifierPlace) {\n\t\tPlace place = null;\n\t\tfor(Place p: places ){\n\t\t\tif(p.getName().equals(identifierPlace)){\n\t\t\t\tplace = p;\n\t\t\t}\n\t\t}\n\t\treturn place;\n\t}", "public String getplaceName() {\n\t\treturn placeName;\n\t}", "public String getActplace() {\r\n return actplace;\r\n }", "public String getPlaceId() {\n return placeId;\n }", "public int getPlaceName() {\n return mPlaceName;\n }", "public String getPlacecode() {\n return placecode;\n }", "public String getOtherPlace() {\r\n return otherPlace;\r\n }", "static Place getPlaceByID ( int key)\r\n\t{\r\n\t\treturn tm.get(key);\r\n\t}", "private Place getPlace(Integer idPlace) {\n\t\tPlace place = null;\n\t\tfor(Place p: places ){\n\t\t\tif(p.getId().equals(idPlace)){\n\t\t\t\tplace = p;\n\t\t\t}\n\t\t}\n\t\treturn place;\n\t}", "public Integer getQueryplace() {\n\t\treturn queryplace;\n\t}", "public int getPlaceDescription() {\n return mPlaceDescription;\n }", "public void setPlace(String place){\n this.place = place;\n }", "public String getLivingPlace() {\n return livingPlace;\n }", "static Place getRandomPlace()\r\n\t{\r\n\t\tPlace randomPlace = knownPlaces.get( new Random().nextInt ( knownPlaces.size()));\r\n\t\treturn randomPlace;\r\n\t}", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n }\n }", "public String idOfPlace()\n {\n return id;\n }", "public String getCustomerPlace() {\r\n return town.getName();\r\n }", "public String getValue(int place) {\n ListElement current = head;\n if (place <= count) {\n for (int i = 1; i < place; i++) {\n current = current.next();\n }\n return current.getValue();\n } else {\n return \"error\";\n }\n }", "protected Place getPlace(int row, int col) {\n\t\treturn this.places.get(row * b.size() + col);\n\t}", "public int getPlaces() {\r\n return places;\r\n }", "@Test\n public void getPlace() {\n Place result = mDbHelper.getPlace(Realm.getInstance(testConfig), \"1234\");\n\n // Check place\n Assert.assertNotNull(result);\n\n // Check place id\n Assert.assertEquals(\"1234\", result.getId());\n\n }", "public final String zzb() {\n return this.placeId;\n }", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\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 uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String getPlace(String place) {\n if (place != null\n && place.contains(\" of \")) {\n return place.substring(place.lastIndexOf(\" of \") + \" of \".length());\n }\n return place;\n }", "@Override\r\n\tpublic DiaryEventEditPlace getPlace() {\n\t\treturn null;\r\n\t}", "public Place getStartingPlace() {\n return startingPlace;\n }", "public String getOwnerPlace() {\r\n return ownerPlace;\r\n }", "@Override\n public void onPlaceSelected(Place place) {\n Log.i(TAG, \"Place: \" + place.getName());\n editTextBusinessName.setText(place.getName());\n editTextLocation.setText(place.getAddress());\n editTextPhone.setText(place.getPhoneNumber());\n barCoordinates = place.getLatLng();\n //editTextBusinessDescription.setText(place.getAttributions());\n\n }", "public int getPlaceImage() {\n return mPlaceImage;\n }", "public String getOwnerPlace(int idPlace) throws Exception {\n if (idPlace > 40 || idPlace < 1) {\n\n throw new Exception(\"Place doesn't exist\");\n } else {\n String dono = (String) Donos.get(idPlace);\n if (dono.equals(\"noOwner\") || dono.equals(\"Luxury Tax\") || dono.equals(\"Income Tax\")) {\n throw new Exception(\"This place can't be owned\");\n } else {\n return (String) Donos.get(idPlace);\n }\n }\n }", "public Placement getPlacement() {\n return getEntity();\n }", "public Pull<Place> thisPlace();", "@Override\r\n\t\tpublic Place getItem(int position) {\n\t\t\treturn mPlaceList.get(position);\r\n\t\t}", "public int getPlaceGeoData() {\n return mPlaceGeoData;\n }", "public ArrayList<Place> getPlaceList() {\n\t\treturn this.places;\n\t}", "public PlaceType getType() {\n\t\treturn type;\n\t}", "Place resolveLocation( Place place );", "public int getPlacesY()\n {\n return this.placesY;\n }", "public synchronized Place getPlace() throws InterruptedException {\n\t\tif (!spatialCheckThread.isAlive())\n\t\t\tspatialCheckThread.start();\n\n\t\tif (currentPlace == null)\n\t\t\twait();\n\t\treturn currentPlace;\n\t}", "public IPlace getPlace(int row, int column) {\n \t\tIPlace[][] students = this.getStudents();\n \t\tif (students != null) {\n \t\t\treturn students[row][column];\n \t\t}\n \t\tthrow new IllegalStateException();\n \t}", "public int getNumberOfPlaces()\n {\n return this.numberOfPlaces;\n }", "public int getPlacesX()\n {\n return this.placesX;\n }", "public List<String> getPlaces() {\n\t\treturn places;\n\t}", "private Place getPlaceWithTelephoneNumber() {\n\n // finds nearby place according the slot value\n List<Place> places = PlaceFinder.findNearbyPlace(GeoCoder.getLatLng(deviceAddress), slotBankNameValue);\n\n // check the list of places for one with opening hours\n return PlaceFinder.findTelephoneNumberPlace(places, slotBankNameValue);\n }", "public void setPlace(int num) {\n\t\tplace = num;\n\t}", "public static String getWaypointFromPlace(Place place) {\n return \"geo!\" + place.getLatitude() + \",\" + place.getLongitude();\n }", "private HashMap<String, String> getPlace(JSONObject jPlace) {\n\n HashMap<String, String> place = new HashMap<String, String>();\n\n String id = \"\";\n String reference = \"\";\n String description = \"\";\n\n try {\n\n description = jPlace.getString(\"description\");\n id = jPlace.getString(\"place_id\");\n reference = jPlace.getString(\"reference\");\n\n place.put(\"description\", description);\n place.put(\"_id\", id);\n place.put(\"reference\", reference);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return place;\n }", "public void GetPlace(String placeid,\n String key,\n Callback<GooglePlaceData> cb) {\n if (CMAppGlobals.DEBUG) Logger.i(TAG, \":: GoogleModel.GetAutocomplete placeid : \" + placeid\n + \" : key : \" + key\n + \" : cb : \" + cb);\n\n Call<GooglePlaceData> googleGeocodeCall = googleService.GetPlace(placeid, key);\n googleGeocodeCall.enqueue(cb);\n\n }", "@Override\n\tpublic String getPlaceCode() {\n\t\treturn null;\n\t}", "@Override\n\tpublic synchronized Collection<Place> getPlaces() {\n\t\treturn this.places;\n\t}", "private PlacesReadTask getPlace(JSONObject googlePlaceJson) {\n PlacesReadTask record=new PlacesReadTask();;\n String placeName = \"-NA-\";\n String id = \"-NA-\";\n String latitude = \"\";\n String longitude = \"\";\n String reference = \"\";\n String rating=\"\";\n\n try {\n if (!googlePlaceJson.isNull(\"name\")) {\n placeName = googlePlaceJson.getString(\"school_name\");\n }\n if (!googlePlaceJson.isNull(\"vicinity\")) {\n id = googlePlaceJson.getString(\"dbn\");\n }\n\n record.setSchool_name(placeName);\n record.setId(id);\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return record;\n }", "public int getPlaceDepth() {\n return placeDepth;\n }", "public java.lang.String getPlaceOfOrigin () {\n\t\treturn placeOfOrigin;\n\t}", "public WorkPlaceC2A getWorkPlace()\r\n\t{\r\n\t\treturn workPlace;\r\n\t}", "public Integer getPlacement() {\n return placement;\n }", "public java.lang.String getSignPlace() {\n\t\treturn _tempNoTiceShipMessage.getSignPlace();\n\t}", "@Override\n public void onPlaceSelected(Place place) {\n\n Log.i(\"place_autocomplete\", \"Place: \" + place.getName() + \", \" + place.getId() + \", \" + place.getLatLng());\n LatLng latLng = place.getLatLng();\n setLocationWork(latLng.latitude, latLng.longitude);\n }", "public interface PlaceInfo {\n\n\t\n\t/**\n\t * Return the place name\n\t * @return the place name\n\t */\n\tpublic String getName();\n\t\n\t\n\t/**\n\t * Return the place description\n\t * @return the place description\n\t */\n\tpublic String getDescription();\n\n\n\t/**\n\t * Is this place the space ship?\n\t * @return true if the place represents a space ship\n\t */\n\tpublic boolean isSpaceship();\n}", "private void getPlace(String _id) {\n this.binding.main.setVisibility(View.GONE);\n this.binding.loading.setVisibility(View.VISIBLE);\n\n ParseQuery<Place> query = ParseQuery.getQuery(Place.class);\n query.whereEqualTo(Place.KEY_OBJECT_ID, _id);\n query.include(Place.KEY_CATEGORY);\n query.include(Place.KEY_USER);\n query.getFirstInBackground(new GetCallback<Place>() {\n @Override\n public void done(Place object, ParseException e) {\n if(e == null) {\n place = object;\n bindInformation();\n enterReveal();\n } else {\n Toast.makeText(PlaceDetailActivity.this, \"Place not found\", Toast.LENGTH_LONG).show();\n finish();\n }\n }\n });\n\n // Set up elements visibility\n binding.fabCall.setVisibility(View.INVISIBLE);\n binding.fabLike.setVisibility(View.INVISIBLE);\n binding.main.setVisibility(View.VISIBLE);\n binding.loading.setVisibility(View.GONE);\n }", "public String getBirthPlace() {\n return birthPlace;\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n\t\tthis.place = place == null ? null : place.trim();\n\t}", "@XmlTransient\n public List<Place> getPlace() {\n return place;\n }", "public Matrix getPlaceMatrix() {\n return placeMatrix;\n }", "@Override\r\n public void onPlaceSelected(Place place) {\n Log.i(\"city\",place.toString());\r\n Log.i(TAG, \"Place: \" + place.getName());\r\n city2=place.getName().toString();\r\n String a[]=place.getAddress().toString().split(\",\");\r\n int len=a.length;\r\n String h=city2;\r\n if(len>=3) {\r\n h = a[len - 3];\r\n }\r\n city2=h;\r\n\r\n }", "public com.hps.july.persistence.StoragePlaceKey getStoragePlaceKey() {\n\tcom.hps.july.persistence.StoragePlaceKey temp = null;\n\ttemp = new com.hps.july.persistence.StoragePlaceKey();\n\tboolean storagePlace_NULLTEST = true;\n\tstoragePlace_NULLTEST &= (storagePlace_storageplace == null);\n\ttemp.storageplace = ((storagePlace_storageplace == null) ? 0 : storagePlace_storageplace.intValue());\n\tif (storagePlace_NULLTEST) temp = null;\n\treturn temp;\n}", "public java.lang.String getStudent_placeOfBirth() {\n\t\treturn _primarySchoolStudent.getStudent_placeOfBirth();\n\t}", "@Override\n public void onPlaceSelected(Place place) {\n\n place_str[0] = place.getName() + \",\" + place.getId();\n }", "public void Add_place(String p)\n {\n\n place = new String(p);\n }", "public void scanCurrentPlace()\r\n\t{\r\n\t\tSystem.out.println(this.getCurrentPlace().toString());\r\n\t\tSystem.out.println(\"The place contains these objects: \");\r\n\t\tSystem.out.println(this.getCurrentPlace().getItems().toString());\r\n\t}", "public Storageplace getStorageplace(int storageplaceKey){\r\n\t\t List<Storageplace> storageplaces = getAll();\r\n\t for(Storageplace storageplace: storageplaces){\r\n\t if(storageplace.getStorageplaceKey() == storageplaceKey){\r\n\t return storageplace;\r\n\t }\r\n\t }\r\n\t return null;\r\n\t }", "@Override\r\n public void onPlaceSelected(Place place) {\n Log.i(TAG, \"Place: \" + place.getName());\r\n city1=place.getName().toString();\r\n Log.i(TAG,place.getAddress().toString());\r\n String a[]=place.getAddress().toString().split(\",\");\r\n int len=a.length;\r\n String h=city1;\r\n if(len>=3) {\r\n h = a[len - 3];\r\n }\r\n city1=h;\r\n\r\n }", "public void setActplace(String actplace) {\r\n this.actplace = actplace;\r\n }", "@Override\r\n\tpublic LatLong findLatLong(String place) { // place can be a postal code string or an address string\r\n\t\t// some simple code inspired by http://stackoverflow.com/questions/7467568/parsing-json-from-url\r\n\t\tLatLong aLatLong = null;\r\n\t\ttry {\r\n\t\t\tJSONObject geoCodeJSON = new JSONObject(readUrl(\"http://maps.googleapis.com/maps/api/geocode/json?address=\" + place + \"&sensor=false\"));\r\n\t\t\tString latit = geoCodeJSON.getJSONArray(\"results\").getJSONObject(0).getJSONObject(\"geometry\").getJSONObject(\"location\").getString(\"lat\");\r\n\t\t\tString longit = geoCodeJSON.getJSONArray(\"results\").getJSONObject(0).getJSONObject(\"geometry\").getJSONObject(\"location\").getString(\"lng\");\r\n\t\t\taLatLong = new LatLong(Double.parseDouble(latit), Double.parseDouble(longit));\r\n\t\t\tSystem.out.println(\"latitude, longitude are\" + latitude + \" \" + longitude);\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn aLatLong;\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn aLatLong;\r\n\t\t}\r\n\t\treturn aLatLong;\r\n\t}", "public Place() {\r\n\t\tthis.name = \"Unknown Place\";\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "public PlaceGeometry getGeometry() {\n return geometry;\n }", "public void setPlaceId(String placeId) {\n this.placeId = placeId;\n }", "private Place getPlaceWithOpeningHours() {\n\n // finds nearby place according the slot value\n List<Place> places = PlaceFinder.findNearbyPlace(GeoCoder.getLatLng(deviceAddress), slotBankNameValue);\n\n // check the list of places for one with opening hours\n return PlaceFinder.findOpeningHoursPlace(places, slotBankNameValue);\n }", "@Override\n public void onPlaceSelected(Place place) {\n destination = place.getName().toString();\n destinationLatLng = place.getLatLng();\n }", "@Override\n public void onPlaceSelected(Place place) {\n latLng = place.getLatLng();\n locationName = place.getName().toString();\n locationAddress = place.getAddress().toString();\n Log.i(TAG, \"Location:latitude: \" + place.getLatLng().latitude);\n Log.i(TAG, \"Location:Address: \" + place.getAddress());\n Log.i(TAG, \"Location:Web: \" + place.getWebsiteUri());\n Log.i(TAG, \"Location:Place: \" + place.getName());\n mMap.addMarker(new MarkerOptions().position(latLng).title(locationName).snippet(locationAddress)).showInfoWindow();\n mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n }", "public PlaceMonsterMove getPlace(GameState state, Monster mon) {\n if (Tony == null) assignPlayers(state);\n if (castle1 == null) assignCastles(state);\n /*\n if (mon == Monster.SLAYER) {\n if (state.getMonsters(castle1, notTony).contains(Monster.DRAGON))\n return new PlaceMonsterMove(Tony, castle1, mon);\n else\n return new PlaceMonsterMove(Tony, castle2, mon);\n }\n\n CastleID castleChoice = castle1;\n if (mon.value > avgStr) {\n //try to place at castle2\n castleChoice = findValidPlacement(castle2, castle1, castle3, state);\n } else {\n //try to place at castle1\n castleChoice = findValidPlacement(castle1, castle2, castle3, state);\n }\n */\n\n CastleID castleChoice = findValidPlacement(castle2, castle1, castle3, state);\n System.out.println(Tony + \" is placing \" + mon + \" at \" + castleChoice);\n\n return new PlaceMonsterMove(Tony, castleChoice, mon);\n }", "public void searchPlace(String value)\n\t\t{ \n\t\t Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); \n\t\t try {\n\t\t List<Address> addresses = geoCoder.getFromLocationName(\n\t\t value, 5);\t\t \n\t\t if (addresses.size() > 0) {\n\t\t \t\n\t\t \tdouble latitude= 0.0, longtitude= 0.0;\n\t\t \tGeoPoint p = new GeoPoint(\n\t\t (int) (addresses.get(0).getLatitude() * 1E6), \n\t\t (int) (addresses.get(0).getLongitude() * 1E6));\n\t\t \tlatitude=p.getLatitudeE6()/1E6;\n\t\t\t\t\t\tlongtitude=p.getLongitudeE6()/1E6;\t \n\t\t\t\t\t\tlat = String.valueOf(latitude);\n\t\t\t\t\t\tlongi = String.valueOf(longtitude);\n\t\t\t\t\t\torigin = new LatLng(latitude,longtitude);\n\t\t \tmap.moveCamera( CameraUpdateFactory.newLatLngZoom(origin, (float) 14.0) ); \n\t\t } \n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\n\n\n\t\t \n\n\t\t}", "@Override\n\tpublic Place find(Place obj) {\n\t\treturn null;\n\t}", "public static String getPlaceID(String placeName) {\r\n\t\tString output = \"\";\r\n\t\ttry {\r\n\t\t\tURL url = new URL(\"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\"+placeName+\"&inputtype=textquery&fields=place_id&key=AIzaSyAcM2vc8-2JY9I5P7jgvt61TCYa1vo0b98\");\r\n\t\t\tHttpURLConnection conn = (HttpURLConnection)url.openConnection();\r\n\t\t\tconn.setRequestMethod(\"GET\");\r\n\t\t\tconn.connect();\r\n\t\t\tint responsecode = conn.getResponseCode();\r\n\t\t\tif(responsecode != 200) {\r\n\t\t\t\tthrow new RuntimeException(\"HttpResponseCode: \"+responsecode);\r\n\t\t\t} else {\r\n\t\t\t\tJSONParser parse = new JSONParser();\r\n\t\t\t\tScanner scanner = new Scanner(url.openStream());\r\n\t\t\t\twhile (scanner.hasNext()) {\r\n\t\t\t\t\toutput+=scanner.nextLine();\r\n\t\t\t\t}\r\n\t\t\t\tJSONObject jsonobject = (JSONObject)parse.parse(output);\r\n\t\t\t\tJSONArray resultArray = (JSONArray) jsonobject.get(\"candidates\");\r\n\t\t\t\tfor(int count=0; count<1;count++) {\r\n\t\t\t\t\tJSONObject jsonobject1 = (JSONObject)resultArray.get(count);\r\n\t\t\t\t\tSystem.out.println(placeName+\" Place ID: \"+jsonobject1.get(\"place_id\"));\r\n\t\t\t\t\toutput = (String) jsonobject1.get(\"place_id\");\r\n\t\t\t\t}\r\n\t\t\t\tscanner.close();\r\n\t\t\t}\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\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} catch (ParseException 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 output;\r\n\t}" ]
[ "0.8034997", "0.8024391", "0.8024391", "0.8024391", "0.8024391", "0.7943908", "0.79275817", "0.781501", "0.7646749", "0.7229443", "0.72151566", "0.70971924", "0.70960224", "0.7041194", "0.7013578", "0.69819343", "0.6937602", "0.69082105", "0.6868974", "0.6847638", "0.6828572", "0.6743732", "0.6742505", "0.6700512", "0.6677116", "0.6648196", "0.65791535", "0.65603614", "0.6533395", "0.653306", "0.6508579", "0.6482449", "0.64449096", "0.6405298", "0.6400411", "0.6367846", "0.6361515", "0.6351112", "0.63510513", "0.63461065", "0.63051474", "0.62979704", "0.62557864", "0.6251567", "0.625148", "0.62435466", "0.62312335", "0.62231445", "0.6216557", "0.6207123", "0.61854374", "0.61670077", "0.61633897", "0.61141086", "0.6112023", "0.6087045", "0.6062972", "0.6060956", "0.6015288", "0.59983426", "0.59714556", "0.5954096", "0.5938327", "0.5937117", "0.5936953", "0.5930572", "0.591864", "0.5918197", "0.5909818", "0.58939654", "0.5892085", "0.5879763", "0.58629036", "0.58565885", "0.58031297", "0.58031297", "0.58031297", "0.57963496", "0.57937074", "0.5780624", "0.5778731", "0.5732479", "0.5725121", "0.57163215", "0.5708039", "0.5691122", "0.56724995", "0.56594515", "0.56588835", "0.5651309", "0.56475747", "0.5631439", "0.56285125", "0.5626096", "0.5625138", "0.5623263", "0.5613605", "0.5605573", "0.5597284", "0.55949205" ]
0.82944494
0
Add_date reads in a string for the attribute date
public void Add_date(String d) { date = new String(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addDate(Date value) {\n/* 132 */ addDateToSeq(\"date\", value);\n/* */ }", "public abstract void add(Date212 date);", "public final void addDate(final String date, final String type)\n throws RIFCSException {\n this.addDate(date, type, \"W3C\");\n }", "@AutoEscape\n\tpublic String getEntityAddDate();", "public final void addDate(final Date date,\n final String type) throws RIFCSException {\n DateFormat df = new SimpleDateFormat(TEMPORAL_DATE_FORMAT);\n String text = df.format(date);\n String result = text.substring(0, TEMPORAL_DATE_FORMAT_LENGTH)\n + \":\" + text.substring(TEMPORAL_DATE_FORMAT_LENGTH);\n this.addDate(result, type);\n }", "public void addDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), DATE, value);\r\n\t}", "public void setEntityAddDate(String entityAddDate);", "Builder addDateCreated(String value);", "@attribute(value = \"\", required = true)\t\r\n\tpublic void addDateField(DateField f) {\r\n\t\tfields.put(\"\" + fieldCount++, f);\r\n\t}", "public void addRecordingDate(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), RECORDINGDATE, value);\r\n\t}", "Builder addDatePublished(String value);", "Builder addDateCreated(Date value);", "Builder addDatePublished(Date value);", "public void addDateField(Date date) {\n\t\tput(\"BIRTHDAY\", Constants.TIME_FMT.format(date));\n\t}", "public FluentExp<Number> dateAdd (SQLExpression<?> expr)\n {\n return new Add<Number>(this, expr);\n }", "private static void addDateIfValid(AnalysisResults.Builder analysisBuilder, String date) {\n String separator = date.contains(\"-\") ? \"-\" : \"/\";\n String formatterPattern = \"M\" + separator + \"d\" + separator;\n\n // Determine if the date has 2 or 4 digits for the year\n if (date.lastIndexOf(separator) + 3 == date.length()) {\n formatterPattern += \"yy\";\n } else {\n formatterPattern += \"yyyy\";\n }\n\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(formatterPattern);\n\n try {\n ZonedDateTime dateAndTime = LocalDate.parse(date, formatter).atStartOfDay(ZoneOffset.UTC);\n dateAndTime = fixYearIfInFuture(dateAndTime);\n\n long timestamp = dateAndTime.toInstant().toEpochMilli();\n analysisBuilder.setTransactionTimestamp(timestamp);\n } catch (DateTimeParseException e) {\n // Invalid month or day\n return;\n }\n }", "public static void addDate( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(model, instanceResource, DATE, value);\r\n\t}", "public static void AddDateTimeAttribute( DataSet DS, long date)\n {\n if( date <= 0 )\n date = System.currentTimeMillis( );\n \n Util.AddDateTimeAttribute( DS, new Date( date ));\n }", "public java.util.Date getDate(String attr) {\n return (java.util.Date) super.get(attr);\n }", "protected void addDay(Date date) throws Exception {\n Calendar cal = DateHelper.newCalendarUTC();\n cal.setTime(date);\n String datecode = cal.get(Calendar.YEAR) + \"-\" + (cal.get(Calendar.MONTH) + 1) + \"-\" + cal.get(Calendar.DAY_OF_MONTH);\n affectedDays.put(datecode, date);\n Date rDate = DateHelper.roundDownLocal(date);\n datesTodo.add(rDate);\n }", "public void addDate(java.util.Calendar value) {\r\n\t\tBase.add(this.model, this.getResource(), DATE, value);\r\n\t}", "public static String incrementDateByOneDay() {\n\t\ttry {\n\t\t\tcalendar.setTime(sdf.parse(newDateStr));\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcalendar.add(Calendar.DATE, 1); // number of days to add\n\t\tnewDateForTable = sdf.format(calendar.getTime());\n\t\treturn newDateForTable;\n\t}", "public static void AddDateTimeAttribute( DataSet DS, Date date )\n {\n if( date == null )\n date = new Date( System.currentTimeMillis( ));\n \n java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();\n \n sdf.applyPattern( \"dd-MMM-yy\" );\n \n DS.setAttribute( new StringAttribute( Attribute.END_DATE , sdf\n .format( date ) ) );\n \n sdf.applyPattern( \"HH:mm:ss\" );\n \n DS.setAttribute( new StringAttribute( Attribute.END_TIME , sdf\n .format( date ) ) );\n }", "@Override\n public void addDateHeader(String arg0, long arg1) {\n\n }", "public String addDate(String object, String data) {\n\t\tlogger.debug(\"Adding Date to input with comma seperated data\");\n\t\ttry {\n\t\t\tString temp = data.replace(\",\", \"/\");\n\t\t\tWebElement ele = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object))));\n\t\t\t\n\t\t\tele.clear();\n\n\t ((JavascriptExecutor) driver).executeScript(\"arguments[0].value = arguments[1]\", ele,temp);\n\n\t\t} catch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\t\t}\n\t\treturn Constants.KEYWORD_PASS + \"--\" + data;\n\t}", "org.hl7.fhir.DateTime addNewAppliesDateTime();", "Builder addDateModified(Date value);", "public void setDateAdded(Date dateAdded);", "@Override\n\tpublic void addDateHeader(String name, long date) {\n\t}", "Builder addDateModified(String value);", "public static void addDate(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.util.Calendar value) {\r\n\t\tBase.add(model, instanceResource, DATE, value);\r\n\t}", "public void addRecordingDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), RECORDINGDATE, value);\r\n\t}", "@Test\n public void addition_isCorrect() {\n\n long longDate = 20190620;\n\n String strDate = String.valueOf(longDate);\n\n int year = Integer.parseInt(strDate.substring(0, 4));\n int month = Integer.parseInt(strDate.substring(4, 6));\n int day = Integer.parseInt(strDate.substring(6, 8));\n\n assertEquals(2019, year);\n assertEquals(6, month);\n assertEquals(20, day);\n }", "public String dateAddDaysToCurrentSystemDate(int addDays) throws NumberFormatException, IOException {\n\t\t\t\ttry{\n\t\t\t\t\tlong fingerprint = dateAddDaysToCurrentTimeMilliseconds(addDays);\t\t\t\t\n\t\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"M/dd/yyyy\");\n\t\t\t\t\tfileWriterPrinter(\"\\nCurrent System Date: \" + dateFormat.format(new Date()));\t\t\t\t\n\t\t\t\t\tString dateToSet = dateFormat.format(new Date(fingerprint));\t\t\t\t\t\n\t\t\t\t\tfileWriterPrinter(\"Changed System Date: \" + dateToSet + \"\\n\");\n\t\t\t\t\tRuntime.getRuntime().exec(\"cmd /C date \" + dateToSet); // M/dd/yyyy\n\t\t\t\t\treturn dateToSet;\n\t\t\t\t} catch(Exception e) { fileWriterPrinter(e); return null;}\t\t\t\t\n\t\t\t}", "public final void addDate(final String date,\n final String type, final String dateFormat) throws RIFCSException {\n DateWithTypeDateFormat de = this.newDate();\n de.setType(type);\n de.setDateFormat(dateFormat);\n de.setValue(date);\n this.getElement().appendChild(de.getElement());\n this.dates.add((DateWithTypeDateFormat) de);\n }", "public static String getSysDateAndAddDays(String number) {\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.setTime(new Date());\n\t\tc.add(Calendar.DATE, Integer.parseInt(number));\n\t\tString date = simpleDateFormat.format(c.getTime());\n\t\treturn date;\n\t}", "public void addDateHeader(String s, long l) {\n\t\t\n\t}", "public static String addYearsToDate(String date, int numberOfYears) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.UK);\r\n\t\t\tDateTime dt = new DateTime((Date) sdf.parse(date));\r\n\t\t\tDateTime dt2 = dt.plusYears(numberOfYears);\r\n\t\t\treturn dt2.toString(\"yyyy-MM-dd\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn date;\r\n\t\t}\r\n\t}", "public ValueDateRec addValueDate(ValueDateRec valueDate, UserRec usr, String source) \n throws BacException {\n try{\n valueDate = configDM.addValueDate(valueDate, usr, source);\n }catch(Exception ex){\n LOGGER.log(INFO, \"addValueDate DB exception {0}\", ex.getLocalizedMessage());\n throw new BacException(\"Could not save value date \",\"VALDT:01\");\n }\n LOGGER.log(INFO, \"BasicSetup.addValueDate returns value date with id {0}\", valueDate.getId());\n return valueDate;\n }", "public static String addDate(int num, String formato, java.util.Date fecha)\n {\n try\n {\n DateFormat formatter = null;\n formatter=new SimpleDateFormat(formato); \n Calendar c1 = Calendar.getInstance();\n c1.setTime(fecha);\n c1.add(Calendar.DATE, num); \n String dato=formatter.format(c1.getTime());\n return dato;\n }\n catch(Exception e)\n {\n System.out.println(\"Error getdate:\" + e);\n return null;\n }\n }", "public Date getDateAdded();", "public CisaData withDateAdded(java.util.Date dateAdded) {\n setDateAdded(dateAdded);\n return this;\n }", "private static void formatDate (XmlDoc.Element date) throws Throwable {\n\t\tString in = date.value();\n\t\tString out = DateUtil.convertDateString(in, \"dd-MMM-yyyy\", \"yyyy-MM-dd\");\n\t\tdate.setValue(out);\n\t}", "@JsonSetter(\"dateAdded\")\r\n public void setDateAdded (String value) { \r\n this.dateAdded = value;\r\n }", "Builder addDateCreated(DateTime value);", "public String dateAddDaysToCurrentDate(int addDays) {\n\t\t\t\treturn convertCalendarMillisecondsAsLongToDate(dateAddDaysToCurrentTimeMilliseconds(addDays));\n\t\t\t}", "public static void addRecordingDate(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.add(model, instanceResource, RECORDINGDATE, value);\r\n\t}", "Date getDateField();", "private Date plusDays(Date orderDate, String brand, String level) {\n Calendar c = Calendar.getInstance();\n c.setTime(orderDate);\n int numberDays = PriceList.returnNumberDays(brand, level);\n c.add(Calendar.DATE, numberDays);\n return c.getTime();\n }", "public static Date addDate(final Date date, final int years, final int months, final int days) {\n final Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.add(Calendar.YEAR, years);\n calendar.add(Calendar.MONTH, months);\n calendar.add(Calendar.DAY_OF_YEAR, days);\n return calendar.getTime();\n }", "public static Date add(Date inputDate, int increment) {\n if (inputDate == null) {\n return null;\n }\n Calendar cal = Calendar.getInstance();\n cal.setTime(inputDate);\n cal.add(Calendar.DAY_OF_MONTH, increment);\n return cal.getTime();\n }", "public abstract void add(T input, List<Method> methods, List<String> dateTypes);", "public void setDate(String date) {\n while (!date.endsWith(\"00\")){\n date+=\"0\";\n }\n try{\n this.date = FORMATTER.parse(date.trim());\n }catch (ParseException e){\n throw new RuntimeException(e);\n }\n\n }", "public void setAddtime(Date addtime) {\r\n this.addtime = addtime;\r\n }", "private static Date add(final Date date, final int units, final int field) {\n if (date == null) {\n throw new NullPointerException(\"date\");\n }\n\n final Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.setTime(date);\n calendar.setTimeZone(Dates.TIMEZONE_UTC);\n calendar.add(field, units);\n return calendar.getTime();\n }", "public static String addMonthsToDate(String date, int numberOfMonths) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.UK);\r\n\t\t\tDateTime dt = new DateTime((Date) sdf.parse(date));\r\n\t\t\tDateTime dt2 = dt.plusMonths(numberOfMonths);\r\n\t\t\treturn dt2.toString(\"yyyy-MM-dd\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn date;\r\n\t\t}\r\n\t}", "public void add(DiaryCalendarEvent event){\n this.dates.add(new CalendarDay(event.getYear(),event.getMonth(),event.getDay()));\n }", "public void setAddtime(Date addtime) {\n this.addtime = addtime;\n }", "void setDate(java.lang.String date);", "private static void addDates(StringBuilder xml, final String input) {\n\t\tString table = StringMethods.getDelimitedSubstring(input,\n\t\t\t\t\"<table summary=\\\"Übersicht über alle Veranstaltungstermine\\\">\",\n\t\t\t\t\"</table>\");\n\t\t\n\t\tif(table == null)\n\t\t\treturn;\n\t\t\n\t\tString[] rows = table.split(\"</?tr>\");\n\t\t\n\t\tfor (int i = 2; i < rows.length; i++) {\n\t\t\t// ignore first row\n\t\t\tString[] cells = rows[i].split(\"</?td>\");\n\t\t\t\n\t\t\tif (cells.length > 4) {\n\t\t\t\taddTag(xml, \"termin\", cells[0] + \"<br>\" + cells[4]);\n\t\t\t}\n\t\t}\n\t}", "public void addOrderedString(String orderedDay) {\n if(orderedDay == null) return;\n String res = StringUtils.substringBetween(orderedDay, \"'\", \"'\");\n if(res.length() > 0){\n String yysd = StringUtils.substringBetween(orderedDay,\"\\\"\",\"\\\"\");\n if(yysd.length() > 0){\n if(yysd.equals(\"812\")){\n res += \"-上午\";\n }else if(yysd.equals(\"15\")){\n res += \"-下午\";\n }else {\n res += \"-晚上\";\n }\n orderedDate.add(res);\n }\n }\n }", "public void enterDateField(String date) {\n Reporter.addStepLog(\"Enter date \" + date + \" to date field \" + _dateField.toString());\n sendTextToElement(_dateField, date);\n log.info(\"Enter date \" + date + \" to date field \" + _dateField.toString());\n }", "public static String addWeeksToDate(String date, int numberOfWeeks) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.UK);\r\n\t\t\tDateTime dt = new DateTime((Date) sdf.parse(date));\r\n\t\t\tDateTime dt2 = dt.plusWeeks(numberOfWeeks);\r\n\t\t\treturn dt2.toString(\"yyyy-MM-dd\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn date;\r\n\t\t}\r\n\t}", "public void nextDay() {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"d/M/yyyy\");\n localDate = LocalDate.parse(irlDate, formatter);\n localDate = localDate.plusDays(1);\n irlDate = DateTimeFormatter.ofPattern(\"d/M/yyyy\").format(localDate);\n System.out.println(irlDate);\n currentDay = Integer.parseInt(DateTimeFormatter.ofPattern(\"d\").format(localDate));\n currentMonth = Integer.parseInt(DateTimeFormatter.ofPattern(\"M\").format(localDate)) - 1;\n currentYear = Integer.parseInt(DateTimeFormatter.ofPattern(\"yyyy\").format(localDate));\n }", "private LocalDate createDate(String date) {\n LocalDate localDate = LocalDate.parse(date);\n\n return localDate;\n }", "date initdate(date iDate)\n {\n iDate.updateElementValue(\"date\");\n return iDate;\n }", "public void addBonus() {\r\n game.settings.setBonusDay(strDate);\r\n }", "String addDay(String userName, int dayOfYear);", "void addDate(long t) {\n\tif (act != null) {\n\t long date = act.getDate() + t;\n\t act.setLocation(act.getMap(), act.getX(), act.getY(), date);\n\t}\n }", "public void setDate(String date){\n this.date = date;\n }", "public void produceDateFromDay(String dayInput, int plus) {\n LocalDate date = null;\n \n if (plus == 2) {\n date = LocalDate.now().plusWeeks(1);\n } else if (plus == 3) {\n date = LocalDate.now().plusMonths(1);\n } else if (plus == 4) {\n date = LocalDate.now().plusYears(1);\n } else if (plus == 5) {\n date = LocalDate.now();\n } else if (plus == 6) {\n date = LocalDate.now().plusDays(1);\n } else {\n for (int n = 0; n < Constants.DAYS_LIST.length; n++) {\n if (dayInput.toLowerCase().matches(Constants.DAYS_LIST[n])) {\n int days = (n+1) - LocalDate.now().getDayOfWeek().getValue();\n\n if (days >= 0) {\n if (plus == 1) {\n date = LocalDate.now().plusDays(days+7);\n } else {\n date = LocalDate.now().plusDays(days);\n }\n } else {\n date = LocalDate.now().plusDays(days+7);\n }\n\n break;\n }\n }\n }\n startDate = date.getDayOfMonth() + \"/\" + date.getMonthValue() + \"/\" +date.getYear();\n }", "private Date getDateAttribute(Element element, String attributeName)\n {\n return parseDate(getAttribute(element,attributeName));\n }", "public void setDateAdded(java.util.Date dateAdded) {\n this.dateAdded = dateAdded;\n }", "public String Get_date() \n {\n \n return date;\n }", "public void setDate(java.lang.String date) {\n this.date = date;\n }", "@Test\r\n public void testAddDay2(){\n int amount = 10;\r\n dateTime myDate = new dateTime(25, 4, 2019);\r\n System.out.println(\"The day before increment is: 25-4-2019\");\r\n dateTime addOrSubDays = myDate.addOrSubDays(amount);\r\n System.out.println(\"The day after increment is: \" + addOrSubDays.getDay() + \"-\" + addOrSubDays.getMonth() + \"-\" + addOrSubDays.getYear());\r\n assertEquals(\"The day after increment is: 4-5-2019\",\"The day after increment is: \" + addOrSubDays.getDay() + \"-\" + addOrSubDays.getMonth() + \"-\" + addOrSubDays.getYear());\r\n }", "public static Date add(final Date date, final int years, final int months, final int days, final int hours,\n final int minutes, final int seconds) {\n final Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.add(Calendar.YEAR, years);\n calendar.add(Calendar.MONTH, months);\n calendar.add(Calendar.DAY_OF_YEAR, days);\n calendar.add(Calendar.HOUR_OF_DAY, hours);\n calendar.add(Calendar.MINUTE, minutes);\n calendar.add(Calendar.SECOND, seconds);\n return calendar.getTime();\n }", "public void setDateOfAdded(Date dateOfAdded) {\n\t\tthis.dateOfAdded = dateOfAdded;\n\t}", "public String getDate(){ return this.start_date;}", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "java.lang.String getDate();", "public static void addRecordingDate( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(model, instanceResource, RECORDINGDATE, value);\r\n\t}", "public Date212 (String s){ //initial constructor\n full_Date = s;\n // System.out.println(full_Date + \"jdjdj\");\n if (!isValidDate(full_Date)) throw new IllegalArgumentException(\"Invalid Date Format!\"); \n //If it is not true that the date is valid then throw a error.\n /* \n The substring methods to pull out the Year, Month, and Day.\n */\n Year = Integer.parseInt(full_Date.substring(0,3)); \n Month = Integer.parseInt(full_Date.substring(4,5));\n Day = Integer.parseInt(full_Date.substring(6,7));\n count++; \n addArray(this); //Calling the function \"addArray\" with 'this isntance of date212'\n // System.out.println(myDates[i]);\n\n }", "DateLiteral createDateLiteral();", "public ToDoBuilder addDueDate(String due) throws ParseException {\n if(!due.equals(\"null\") && !due.equals(\"?\")){\n this.due = DATE_FORMAT.parse(due);\n }\n return this;\n }", "public Date getDatePlusDays(Date date, int days) {\n//\t\tlong newTime = date.getTime() + (days * (24 * 60 * 60 * 1000));\n\t\tDate newDate = new Date();\n\t\tnewDate.setTime(date.getTime());\n\t\tCalendarUtil.addDaysToDate(newDate, days);\n\t\treturn newDate;\n\t}", "public void setDate(String date){\n this.date = date;\n }", "private static void incrementDate() {\n\t\ttry {\r\n\t\t\tint days = Integer.valueOf(input(\"Enter number of days: \")).intValue();\r\n\t\t\tcalculator.incrementDate(days); // variable name changes CAL to calculator\r\n\t\t\tlibrary.checkCurrentLoans(); // variable name changes LIB to library\r\n\t\t\toutput(sdf.format(cal.date())); // variable name changes SDF to sdf , CAL to cal , method changes Date() to date()\r\n\t\t\t\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\t output(\"\\nInvalid number of days\\n\");\r\n\t\t}\r\n\t}", "private String concatenateYearAndMonthAsString(Date date){\n\t\tString concatenatedYearAndMonth=\"\";\n\t\tCalendar cal = Calendar.getInstance(); // creates calendar\n\t\tcal.setTime(date);\n\t\tconcatenatedYearAndMonth = String.valueOf(cal.get(Calendar.YEAR))\n\t\t\t\t\t\t\t\t\t\t .concat(String.valueOf(cal.get(Calendar.MONTH) + 1));\n\t\t\t\t\t\t\t\t\t\t \n\t\treturn concatenatedYearAndMonth;\n\t}", "public Date getUtilDate(HttpServletRequest request, String name) {\n/* 61 */ String dateStr = ServletRequestUtils.getStringParameter((ServletRequest)request, name, \"\"); try { }\n/* 62 */ catch (ParseException parseException) {} return new Date();\n/* */ }", "public void setDate (String s) {\n date = s;\n }", "@Override\n public void addDateHeader(String name, long date) {\n this._getHttpServletResponse().addDateHeader(name, date);\n }", "public E_Date(String value) throws ParseException {\n\t\tsuper(DATE_TIME.parse(value).toDate());\n\t}", "public boolean setDateFromString(String s){\n String[] strs = s.split(\"/\");\n if(strs.length != 3){\n return false;\n }\n try {\n this.year = Integer.parseInt(strs[0].toString());\n this.month = Integer.parseInt(strs[1].toString());\n this.dayOfMonth = Integer.parseInt(strs[2].toString());\n }catch (NumberFormatException e){\n e.printStackTrace();\n return false;\n }\n this.dateString = s;\n return true;\n }", "public void getDateElement(ModifyRequest modifyRequest, Attribute attr,\n\t\t\tModifyRequest logModifyReq) {\n\t\tLOG.info(\"BEGIN\");\n\n\t\tString sAttrName = attr.getName().toString();\n\n\t\t// ///////////////////////////////////////\n\t\t// Handling validto and validfrom date\n\t\t// ///////////////////////////////////////\n\n\t\tif (sAttrName.equalsIgnoreCase(VALID_TO)\n\t\t\t\t|| sAttrName.equalsIgnoreCase(VALID_FROM)) {\n\t\t\tLong lDate = null;\n\t\t\tString sSourceDate = attr.getValue().get(0).toString();\n\t\t\ttry {\n\t\t\t\tlDate = new Long(sSourceDate);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// Date from OW is coming in the format\n\t\t\t\t// 'E MMM d HH:mm:ss Z yyyy'.\n\t\t\t\t// This has to be formatted as long value\n\t\t\t\ttry {\n\t\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(OW_DATE_FORMAT);\n\t\t\t\t\tDate dFormatedDate = sdf.parse(sSourceDate);\n\t\t\t\t\tlDate = dFormatedDate.getTime();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tLOG.error(ex, configuration\n\t\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_INV_DATE\"),ex.getMessage());\n\t\t\t\t\tthrow new ConnectorException(configuration\n\t\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_INV_DATE\")\n\t\t\t\t\t\t\t+ \" \" + ex.getMessage(), ex);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Converting Long to date format ex:june 04, 1984,sun\n\t\t\tDate d = new Date(lDate);\n\t\t\tDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT);\n\t\t\t// Converting above date format to \"yyyyMMddHHmmss'Z'\" which\n\t\t\t// is a target date format\n\t\t\tmodifyRequest.addModification(sAttrName, dateFormatter.format(d));\n\n\t\t\t// Logs SPML request if user requires to print request in LOG\n\t\t\tif (configuration.getLogSPMLRequest())\n\t\t\t\tlogModifyReq\n\t\t\t\t\t\t.addModification(sAttrName, dateFormatter.format(d));\n\t\t}\n\n\t\t// ///////////////////////////////\n\t\t// Enables/Disable user accounts\n\t\t// ///////////////////////////////\n\n\t\telse if (sAttrName.equalsIgnoreCase(ENABLENAME)) {\n\t\t\tString date = null;\n\t\t\t// __ENABLE__ = \"true\" to enable user\n\t\t\t// __ENABLE__ = \"false\" to disable user\n\t\t\tif (attr.getValue().get(0).toString().equalsIgnoreCase(\"true\")) {\n\t\t\t\tString dateValue = configuration.getEnableDate();\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(CONFIG_DATE_FORMAT);\n\t\t\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(\n\t\t\t\t\t\tDATE_FORMAT);\n\t\t\t\ttry {\n\t\t\t\t\tif (dateValue != null) {\n\t\t\t\t\t\tdate = dateFormatter.format((dateFormat\n\t\t\t\t\t\t\t\t.parse(dateValue)));\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\tLOG.error(e, configuration.getMessage(\"SAPUME_ERR_PARSE\"),e.getMessage());\n\t\t\t\t\tthrow new ConnectorException(configuration\n\t\t\t\t\t\t\t.getMessage(\"SAPUME_ERR_PARSE\")\n\t\t\t\t\t\t\t+ \" \" + e.getMessage(), e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Get the currect date from OW/OIM server and set it as\n\t\t\t\t// end for user account in target\n\n\t\t\t\t// Get the currect date from OW/OIM server\n\t\t\t\tDate currentDate = new Date();\n\t\t\t\t// Convert to milli seconds\n\t\t\t\tlong millisecCurrentDate = currentDate.getTime();\n\t\t\t\t// Users end date of account validity is current date minus 1\n\t\t\t\t// day i.e., yesterday\n\t\t\t\tmillisecCurrentDate = millisecCurrentDate - 24 * 60 * 60 * 1000;\n\t\t\t\tDate yesterday = new Date(millisecCurrentDate);\n\n\t\t\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(\n\t\t\t\t\t\tDATE_FORMAT);\n\t\t\t\tdate = dateFormatter.format(yesterday).toString();\n\t\t\t}\n\n\t\t\tmodifyRequest.addModification(VALID_TO, date);\n\n\t\t\t// Logs SPML request if user requires to print request in LOG\n\t\t\tif (configuration.getLogSPMLRequest())\n\t\t\t\tlogModifyReq.addModification(VALID_TO, date);\n\t\t}\n\n\t\tLOG.info(\"END\");\n\t}", "public static void setDate(String dateString) {\n\t\tdate = dateString;\n\t}", "@Test\n public void testClaimAdmDate() {\n new ClaimFieldTester()\n .verifyDateStringFieldTransformedCorrectly(\n FissClaim.Builder::setAdmDateCymd,\n RdaFissClaim::getAdmDate,\n RdaFissClaim.Fields.admDate);\n }", "public static String incrementDateByTwoDay() {\n\t\ttry {\n\t\t\tcalendar.setTime(sdf.parse(newDateStr));\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcalendar.add(Calendar.DATE, 2); // number of days to add\n\t\tnewDateForTable = sdf.format(calendar.getTime());\n\t\treturn newDateForTable;\n\t}", "private void setDate() {\n\t\tthis.date = Integer.parseInt(this.year + String.format(\"%02d\", this.calenderWeek));\n\n\t}", "@Test\r\n public void testAddDaysToDate() {\r\n LocalDate date1 = LocalDate.parse(\"2018-03-21\");\r\n Date res1 = DateUtil.addDaysToDate(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()), 6);\r\n assertTrue(LocalDate.parse(\"2018-03-28\").equals(res1.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));\r\n\r\n date1 = LocalDate.parse(\"2018-04-06\");\r\n Date res2 = DateUtil.addDaysToDate(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()), 4);\r\n assertTrue(LocalDate.parse(\"2018-04-11\").equals(res2.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));\r\n\r\n date1 = LocalDate.parse(\"2018-12-21\");\r\n Date res3 = DateUtil.addDaysToDate(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()), 5);\r\n assertTrue(LocalDate.parse(\"2018-12-28\").equals(res3.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));\r\n\r\n }" ]
[ "0.6981904", "0.69288236", "0.67722154", "0.6748723", "0.66766626", "0.6494159", "0.6311572", "0.6177558", "0.6156085", "0.6146589", "0.61413527", "0.612744", "0.610419", "0.6095237", "0.59750026", "0.59717757", "0.59616435", "0.595714", "0.5930002", "0.59283495", "0.5900202", "0.5801429", "0.57860416", "0.5754847", "0.5747899", "0.57429665", "0.5738362", "0.57342917", "0.57087", "0.5702587", "0.56293863", "0.56069326", "0.56009436", "0.5598113", "0.5592786", "0.55680877", "0.555837", "0.55546826", "0.5538892", "0.55367166", "0.55209965", "0.551278", "0.55077225", "0.5507339", "0.5494128", "0.54930043", "0.54550976", "0.5449765", "0.5448748", "0.5434291", "0.54109216", "0.5396484", "0.5388246", "0.5373316", "0.53566533", "0.5347292", "0.5337856", "0.5331755", "0.53147954", "0.5308927", "0.53078216", "0.53056", "0.5276351", "0.52710515", "0.52646327", "0.5252382", "0.5246893", "0.5243928", "0.5228213", "0.52028704", "0.5196698", "0.51958567", "0.51908344", "0.51775956", "0.5172241", "0.5169717", "0.5167248", "0.51649195", "0.51605755", "0.51580405", "0.51567227", "0.515362", "0.5151311", "0.51446414", "0.5143556", "0.5141664", "0.5133432", "0.5121301", "0.5116795", "0.51087093", "0.51062024", "0.5105336", "0.5103393", "0.50900537", "0.5082966", "0.50824934", "0.5078442", "0.50763524", "0.5066787", "0.50659007" ]
0.7088601
0
Get_date Returns the value of date.
public String Get_date() { return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Date getDate();", "Date getDate();", "Date getDate();", "java.lang.String getDate();", "public Date getdate() {\n\t\treturn new Date(date.getTime());\n\t}", "String getDate();", "String getDate();", "Date getEDate();", "Date getForDate();", "java.lang.String getToDate();", "public String getDate() {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\treturn sdf.format(txtDate.getDate());\n\t}", "public Date GetDate();", "public static String getDate()\n {\n Date date = new Date();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n return dateFormat.format(date);\n }", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "public java.util.Date getDate() {\n\t}", "public static String getDate() {\n return getDate(DateUtils.BASE_DATE_FORMAT);\n }", "public String getdate() {\n\t\treturn date;\n\t}", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public String getDate()\n\t\t{\n\t\t\treturn date;\n\t\t}", "@NotNull\r\n public String getDate() {\r\n return date;\r\n }", "Date getPostedDate();", "public Date getDate()\n\t{\n\t\treturn date;\n\t}", "public String getDate(){\n\t\t\n\t\treturn this.date;\n\t}", "public java.lang.String getDate() {\n return date;\n }", "Date getDateField();", "ValuationDate getValuationDate();", "public String getDate() {\n if (MetadataUGWD_Type.featOkTst && ((MetadataUGWD_Type)jcasType).casFeat_date == null)\n jcasType.jcas.throwFeatMissing(\"date\", \"de.aitools.ie.uima.type.argumentation.MetadataUGWD\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((MetadataUGWD_Type)jcasType).casFeatCode_date);}", "Date getCreateDate();", "Date getCreateDate();", "public Date getDate(){\n\t\treturn date;\n\t}", "String getStartDate();", "public Date getDate() {\n\t\n\t\treturn date;\n\t\n\t}", "public Date getDate()\n\t{\n\t\tif (m_nType == AT_DATE)\n\t\t\treturn (Date)m_oData;\n\t\telse\n\t\t\treturn null;\n\t}", "public String getEventDate()\n {\n EventDate = createEvent.getText();\n return EventDate;\n }", "public String getDate() {\r\n\t\treturn date;\r\n\t}", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "public Date getDate() {\n DateTimeField dateField = obtainField(FieldName.DATE);\n if (dateField == null)\n return null;\n\n return dateField.getDate();\n }", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "Date getFechaNacimiento();", "@FXML\r\n\tString getDate() {\r\n\t\t\tLocalDate creditCardExpiryDate = dpCreditCardExpiryDate.getValue();\r\n\t\t\tDateTimeFormatter formattedExpiryDate = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\r\n\t\t\treturn formattedExpiryDate.format(creditCardExpiryDate);\r\n\t}", "public final Date dateValue() {\n if (calValue != null)\n return calValue.getTime();\n else\n return null;\n }", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:date\")\n public Calendar getDate() {\n return getProperty(DATE);\n }", "public String getReturnDate();", "public String getDate() {\r\n\t\treturn this.date;\r\n\t}", "public String getDate() {\n\t\treturn date;\n\t}", "public String getDate() {\n\t\treturn date;\n\t}", "public Date getDate(Date defaultVal) {\n return get(ContentType.DateType, defaultVal);\n }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public Date getDate() {\r\n\t\treturn date;\r\n\t}", "public Date getDate() {\r\n\t\treturn date;\r\n\t}", "public String getDate() {\r\n return date;\r\n }", "public String getDate() {\t\n\t\treturn mDate;\n\t}", "public String getReturnDate() {\n\t\treturn returnDateElement.getAttribute(\"value\");\n\t}", "public Date getDate() {\r\n\t\treturn this.date;\r\n\t}", "final public synchronized Date getDate() {\n return new Date(crtime) ;\n }", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "public String getDate() {\n\t\treturn this.date;\n\t}", "@Test\n\tpublic void systemDate_Get()\n\t{\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\t\n\t\t// Created object of Date, to get system current date\n\t\tDate date = new Date();\n\t\t\n\t\tString currDate = dateFormat.format(date);\n\t\t\n\t\tSystem.out.println(\"Today's date is : \"+currDate);\n\n\t}", "protected String getDateString() {\n String result = null;\n if (!suppressDate) {\n result = currentDateStr;\n }\n return result;\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public Date getDate() {\n\t\treturn date_;\n\t}", "public String retrieveDate() {\n // Check if there's a valid event date.\n String date = _dateET.getText().toString();\n if (date == null || date.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a valid date.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n Pattern p = Pattern.compile(\"^(0[1-9]|1[012])/(0[1-9]|[12][0-9]|3[01])/(19|20)\\\\d\\\\d$\");\n Matcher m = p.matcher(date);\n if (!m.find()) {\n Toast.makeText(AddActivity.this, \"Please input a valid date in mm/dd/yyyy format.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return date;\n }", "public Date date (){\r\n\t\t\treturn _date;\r\n\t\t}", "public java.sql.Date getDatetest() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.sql.Date) __getCache(\"datetest\")));\n }", "java.lang.String getFoundingDate();", "public java.util.Date getValue() {\n return this.value;\n }", "public Date getDate() {\n\t\treturn date;\n\t}", "public Date getDate() {\n\t\treturn date;\n\t}", "LocalDate getDate();", "long getDate();", "java.lang.String getStartDateYYYYMMDD();", "public String getDateAsString(){\n\t\t//\tGet Date\n Date date = getDate();\n if(date != null)\n \treturn backFormat.format(date);\n\t\treturn null;\n\t}", "public Date getDate()\n {\n return this.date;\n }", "public String getDate() {\n\t\treturn this.mDate;\n\t}", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public Date getDate()\n {\n return date;\n }", "public Date getDate() {\n\t\treturn _date;\n\t}", "Date getStartDate();", "Date getStartDate();", "Date getStartDate();", "public Date getDate(){\n\t\treturn day.date;\n\t}", "public String getDate(){\n\n return this.date;\n }", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "public Date getDate() {\r\n return date;\r\n }", "public static Date date() {\n GregorianCalendar cal = new GregorianCalendar();\n return cal.getTime();\n }", "public String getDate() {\n return date;\n }", "public Date getGioBatDau();", "java.lang.String getStartDate();", "public Date date()\n\t{\n\t\treturn this.date;\n\t}", "public String getDate()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"EE d MMM yyyy\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "public static String getDate() {\n return annotation != null ? annotation.date() : \"Unknown\";\n }", "public String getDate() {\n return this.date;\n }", "public String getDate() {\n return this.date;\n }" ]
[ "0.7163515", "0.7163515", "0.7163515", "0.6893597", "0.6832022", "0.6771611", "0.6771611", "0.6761479", "0.6732777", "0.67267334", "0.67191917", "0.66410846", "0.65730447", "0.65045923", "0.6485778", "0.64810944", "0.64667135", "0.6438686", "0.6438686", "0.64089715", "0.6372918", "0.63716", "0.63379127", "0.6327769", "0.6324467", "0.6318814", "0.63117146", "0.6251076", "0.6238257", "0.6238257", "0.6223244", "0.6207202", "0.6206427", "0.6205307", "0.6197683", "0.6181344", "0.61749446", "0.6173253", "0.6167345", "0.6158738", "0.6158324", "0.61560315", "0.6145773", "0.614281", "0.6129011", "0.61272645", "0.61272645", "0.6125669", "0.61191016", "0.6109793", "0.6109793", "0.61082053", "0.61071354", "0.6103126", "0.61025345", "0.61017543", "0.6092244", "0.60915697", "0.60892826", "0.60871756", "0.60864604", "0.608456", "0.60820776", "0.6078686", "0.6075132", "0.60729223", "0.6069775", "0.606644", "0.606644", "0.6058646", "0.6049632", "0.6047554", "0.60409236", "0.60346687", "0.60283", "0.60259646", "0.60259646", "0.60259646", "0.60259646", "0.60259646", "0.60231876", "0.60200405", "0.601245", "0.601245", "0.601245", "0.60122156", "0.6005614", "0.59952503", "0.59952503", "0.59952503", "0.59949684", "0.5991832", "0.59899646", "0.59852964", "0.5968375", "0.5963124", "0.5958364", "0.5951216", "0.5950703", "0.5950703" ]
0.7124135
3
Add_event_value Reads in a string for the attribute event_value
public void Add_event_value(String v) { event_value = new String(v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Get_event_value() \n {\n\n return event_value;\n }", "public void setAttrEventValue(String attrEventValue) {\r\n\t\tthis.attrEventValue = attrEventValue;\r\n\t}", "@JsonSetter(\"event\")\r\n public void setEvent (String value) { \r\n this.event = value;\r\n }", "public void addEvent(String eventString) {\n String eventInfo[] = eventString.split(\",\");\n if (eventInfo[EVENT_TYPE_POS_IN_EVENT_STRING].equals(DelayEvent.DELAY_EVENT)) {\n int delay = Integer.parseInt(eventInfo[DELAY_POS_IN_EVENT_STRING]);\n events.add(new DelayEvent(delay));\n } else {\n int spawnNumber = Integer.parseInt(eventInfo[SLICER_NUMBER_POS_IN_EVENT_STRING]);\n String slicerType = eventInfo[SLICER_TYPE_POS_IN_EVENT_STRING];\n int spawnDelay = Integer.parseInt(eventInfo[SPAWN_DELAY_IN_EVENT_STRING]);\n events.add(new SpawnEvent(spawnNumber, slicerType, spawnDelay));\n }\n }", "void add(String value);", "public String getAttrEventValue() {\r\n\t\treturn attrEventValue;\r\n\t}", "public abstract void addValue(String str, Type type);", "public void add(String value);", "public void addValue(String variable, String str_value) {\n\t\tDate date = new Date();\n\t\tGregorianCalendar gc = new GregorianCalendar();\n\t\tgc.setTime(date);\n\t\tgc.add(Calendar.HOUR_OF_DAY, -6);\n\t\tdate = gc.getTime();\n\t\tDatabaseStore ds = DatabaseStore.DatabaseTextStore(variable,\n\t\t\t\tstr_value.toString(), date);\n\t\taddQuestion(ds);\n\t}", "public void addValue(String value) {\n synchronized (values) {\n values.add(value);\n }\n }", "public void Print_event_value(String v)\n {\n\n System.out.println(v + \": \" + event_value);\n }", "public void addEvent(Event event) {\n\t\t\n\t}", "public void setEvent(String event) {\n this.event = event;\n }", "public Builder setEventValue(int value) {\n event_ = value;\n onChanged();\n return this;\n }", "public void addEvent()\n throws StringIndexOutOfBoundsException, ArrayIndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n String taskDescription = userIn.split(EVENT_IDENTIFIER)[DESCRIPTION].substring(EVENT_HEADER);\n String timing = userIn.split(EVENT_IDENTIFIER)[TIMING];\n Event event = new Event(taskDescription, timing);\n tasks.add(event);\n storage.writeToFile(event);\n ui.echoUserInput(event, tasks.taskIndex);\n } catch (StringIndexOutOfBoundsException e) {\n ui.printStringIndexOOB();\n } catch (ArrayIndexOutOfBoundsException e) {\n ui.printArrayIndexOOB();\n }\n System.out.println(LINEBAR);\n }", "public void addToEvents(final SessionContext ctx, final SapEvent value)\n\t{\n\t\tEVENTSHANDLER.addValue( ctx, this, value );\n\t}", "public void setAttribute_value(String string) {\n this.attribute_value = string;\n }", "com.walgreens.rxit.ch.cda.EIVLEvent addNewEvent();", "private void _add(final String value) {\n appended();\n\n buffer.encode(value);\n }", "public void addNVPairToEventDetails(final String key, final String value,\n final EventDetails eventDetails)\n {\n\n // check key and value are not null\n NameValuePair nv = null;\n\n if (key != null && key.length() > 0 && value != null && value.length() > 0) {\n\n // Add the pair passed in.\n nv = eventDetails.addNewNameValuePair();\n nv.setName(key);\n nv.addValue(value);\n\n }\n\n }", "public void addToEvents(final SapEvent value)\n\t{\n\t\taddToEvents( getSession().getSessionContext(), value );\n\t}", "public void setEvent(String event) {\r\n\t\tthis.event = event;\r\n\t}", "public void add(String value) {\n add(value, false);\n }", "public void addExpression(ValueChangeEvent event) throws ManagerBeanException {\r\n \tgetController().addExpression( event );\r\n }", "@Override\n public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {\n return addHandler(handler, ValueChangeEvent.getType());\n }", "public void addInputDataValue(String inputDataValue) {\n\t\tif (inputDataValue.startsWith(\"\\\"\") || inputDataValue.startsWith(\"\\'\")) {\n\t\t\tinputDataValue = inputDataValue.substring(1);\n\t\t}\n\t\tif (inputDataValue.endsWith(\"\\\"\") || inputDataValue.endsWith(\"\\'\")) {\n\t\t\tinputDataValue = inputDataValue.substring(0, inputDataValue.length()-1);\n\t\t}\n\t\tthis.inputDataValues.add(inputDataValue);\n\t}", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setEventId(java.lang.String value) {\n validate(fields()[13], value);\n this.eventId = value;\n fieldSetFlags()[13] = true;\n return this;\n }", "@Override\r\n\tpublic void attributeAdded(ServletRequestAttributeEvent event) {\n\t\tname=event.getName();\r\n\t\tvalue=event.getValue();\r\n\t\tSystem.out.println(event.getServletRequest()+\"范围内添加了名为\"+name+\",值为\"+value+\"的属性!\");\r\n\t}", "org.hl7.fhir.String addNewValueString();", "public EventParameter(String key, int value) {\n this.key = key;\n this.value = value;\n this.summary = \"\";\n this.valueDescription = \"\";\n }", "public <T> Builder put(@NotNull String name, @NotNull T value) {\n event.put(name, value);\n return this;\n }", "Builder addReleasedEvent(String value);", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "public void setEventName(String name);", "public void setEVENT_CODE(java.lang.String value)\n {\n if ((__EVENT_CODE == null) != (value == null) || (value != null && ! value.equals(__EVENT_CODE)))\n {\n _isDirty = true;\n }\n __EVENT_CODE = value;\n }", "@Override\n\t\tpublic void onEvent(Event event) throws Exception {\n\t\t\tInputEvent inputEvent = (InputEvent) event;\n\t\t\tString input = inputEvent.getValue();\n\t\t\tloadData(input);\n\t\t}", "public void InsertValue(WebElement e,String value) {\n\t\te.sendKeys(value);\n\t\t}", "Builder addRecordedAt(Event value);", "void vpaid_fireEvent(String type, String value);", "public Value(String inputValue) {\n this.inputValue = inputValue;\n }", "public void handleAddEvent(ActionEvent event)\n {\n if(eventDate.getValue() == null)\n {\n MessageAlert.showErrorMessage(null, \"Date was not selected!\");\n return;\n }\n if(eventHour.getValue() == null)\n {\n MessageAlert.showErrorMessage(null, \"Hour was not selected!\");\n return;\n }\n if(eventMinute.getValue() == null)\n {\n MessageAlert.showErrorMessage(null, \"Minute was not selected!\");\n return;\n }\n DecimalFormat decimalFormat = new DecimalFormat(\"00\");\n String date = eventDate.getValue().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\")) + \" \" + decimalFormat.format(eventHour.getValue()) + \":\" + decimalFormat.format(eventMinute.getValue());\n try\n {\n service.addEvent(new Event(mainPage.getId(), eventName.getText(), date, new ArrayList<Long>()));\n MessageAlert.showMessage(null, Alert.AlertType.CONFIRMATION, \"SUCCESS!\", \"Event added successfully!\");\n\n Node node = (Node) event.getSource();\n Stage thisStage = (Stage) node.getScene().getWindow();\n thisStage.hide();\n }\n catch (ValidationException e)\n {\n MessageAlert.showErrorMessage(null, e.getMessage());\n }\n }", "public <T>void addFieldValue(Field<T> field, T value)\n\t{\n\t\t this.addKeyValue(field.getAPIName(), value);\n\n\t}", "private void addString(String value) {\n\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Adding String '\" + value + \"'\");\n }\n\n int index = stringTable.getIndex(value);\n addInt(index);\n }", "public void add(String value) {\n root.add(value, true);\n }", "public Builder setEvent(EventType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n event_ = value.getNumber();\n onChanged();\n return this;\n }", "private void addMetadataByString(Metadata metadata, String name, String value) {\n if (value != null) {\n metadata.add(name, value);\n }\n }", "protected abstract void pushStringValue();", "protected void giveValueToListeners(String value, MinMaxEvent evt) {\n for(int i = 0; i < listeners.size(); i++) {\n listeners.get(i).setValueOfNode(value, evt);\n }\n }", "int getEventValue();", "public abstract void trackEvent(@NotNull String eventCategory,\n @NotNull String eventAction,\n @Nullable String eventLabel,\n @Nullable Integer eventValue);", "public void addMessage(EventMessage message) {\n }", "public void addValue() {\n addValue(1);\n }", "public void addMetrics(String value) {\n value.getClass();\n ensureMetricsIsMutable();\n this.metrics_.add(value);\n }", "public void add(String value) {\n\t\t// if consistent\n\t\tif (value != null) {\n\t\t\t// checks if contains separator\n\t\t\tif (value.contains(Constants.LINE_SEPARATOR)) {\n\t\t\t\t// splits the string by separator\n\t\t\t\t// and adds to object as array\n\t\t\t\tarray.push(ArrayString.fromOrEmpty(value.split(Constants.LINE_SEPARATOR)));\n\t\t\t} else {\n\t\t\t\t// pushes to JS array\n\t\t\t\tarray.push(value);\n\t\t\t}\n\t\t}\n\t}", "public void addEvPEC(Event ev);", "void setEvent(com.walgreens.rxit.ch.cda.EIVLEvent event);", "public void add(Object value) {\n\n\t}", "public void addValue(String listValue) {\n\t\tthis.listValues.add(listValue);\n\t}", "Property addValue(PropertyValue<?, ?> value);", "public HandlerRegistration addValueChangeHandler(ValueChangeHandler<SSDate> handler) {\n return box.addValueChangeHandler(handler);\n }", "@Override\n\tpublic void valueChange(ValueChangeEvent event) {\n\t\t\n\t}", "public void handleEvent(Event event)\n {\n Date d = (Date) getValue();\n settings.setAttribute(param,d != null ? HBCI.DATEFORMAT.format(d) : null);\n cache.put(param,d);\n }", "public void addValue(Object value)\n\t{\n\t\tif (!values.contains(value))\n\t\t{\n\t\t\tvalues.add(value + \"\");\n\t\t}\n\t}", "public boolean add(String value){\n int index=findIndexBinary(value);\n super.add(index,value);\n return true;\n }", "@Override\n\tpublic ContinuousValue addValue(String value) {\n\t\tif(excludedValues.contains(value))\n\t\t\treturn this.getEmptyValue();\n\t\tContinuousValue iv = getValue(value);\n\t\tif(value == null) {\n\t\t\tiv = this.getInstanceValue(value);\n\t\t\tvalues.put(iv.getActualValue(), iv);\n\t\t}\n\t\treturn iv;\n\t}", "public void addProperty(String key, String value);", "@Override\r\n\tpublic void addValue(final IScope scope, final T value) {}", "public void assignAddingEvent(final boolean val) {\n addingEvent = val;\n }", "void add(String name, int value);", "public void addProperty(String key,\n Object value) {\n if (this.ignoreCase) {\n key = key.toUpperCase();\n }\n\n this.attributes.put(key, value.toString());\n }", "public void registerStateSpecificEventHandler(Model model, String event, EventInitializer value, String stateName)\n {\n statesModel.registerStateSpecificEventHandler(model, event, value, stateName);\n }", "boolean add(String val);", "@Override\r\n public void createEvent(String metricId, int eventValue) {\r\n route(metricId, (metricAggregator) ->\r\n metricAggregator.event(resolve(metricId), eventValue));\r\n }", "public boolean addEvent (Message event) {\n Logger.write(\"VERBOSE\", \"DB\", \"addEvent(...)\");\n try {\n execute(DBStrings.addEvent.replace(\"__sig__\", event.getSig())\n .replace(\"__startTime__\", Long.toString(event.EVNTgetStart()))\n .replace(\"__endTime\", Long.toString(event.EVNTgetEnd()))\n .replace(\"__creatorKey__\", Crypto.encodeKey(getSignatory(event)))\n .replace(\"__accepted__\", \"0\")\n .replace(\"__name__\", event.EVNTgetName())\n .replace(\"__creationTime__\", Long.toString(event.getTimestamp())));\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n return false;\n }\n \n return true;\n }", "public static void addStringData(OWLIndividual owlIndi, String value, String property, OWLOntology onto, OWLDataFactory factory, OWLOntologyManager manager){\n\t\tOWLDataProperty p = factory.getOWLDataProperty(IRI.create(Settings.uri+property));\n\t\tOWLLiteral owlc = factory.getOWLLiteral(value, factory.getOWLDatatype(xsdString));\n\t manager.applyChange(new AddAxiom(onto, factory.getOWLDataPropertyAssertionAxiom(p, owlIndi, owlc)));\n\t}", "public void setEventType(ValueExpression eventType) {\n this.eventType = eventType;\n }", "public void addEvent(Event e) {\n\t\t\n\t}", "public void addEvent(Event e) {\n\t\t\n\t}", "private void addEvent() {\n String name = selectString(\"What is the name of this event?\");\n ReferenceFrame frame = selectFrame(\"Which frame would you like to define the event in?\");\n double time = selectDouble(\"When does the event occur (in seconds)?\");\n double x = selectDouble(\"Where does the event occur (in light-seconds)?\");\n world.addEvent(new Event(name, time, x, frame));\n System.out.println(\"Event added!\");\n }", "public void setEventID(int value) {\r\n this.eventID = value;\r\n }", "private void setCustomInstrumentationData(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(CUSTOMINSTRUMENTATIONDATA_PROP.get(), value);\n }", "public void addEvent(Event event) {\n events.add(event);\n }", "public void setEventCode(java.lang.Integer value) {\n\t\tsetValue(org.jooq.examples.cubrid.demodb.tables.Record.RECORD.EVENT_CODE, value);\n\t}", "public void addValueLine(String line) {\n\t\tvaluesBuilder.append(line);\n\t\tif (!line.endsWith(NEW_LINE)) {\n\t\t\tvaluesBuilder.append(NEW_LINE);\n\t\t}\n\t\tthis.dirtyAttributes.add(Constants.VALUES);\n\t}", "public int getEventValue() {\n return event_;\n }", "@Override\n public void getValueString(StringBuffer stringBuffer)\n {\n stringBuffer.append(val);\n\n }", "public void setEventMessage(String eventMessage) {\n this.eventMessage = eventMessage;\n }", "public void setValue (String Value);", "Builder addRecordedAt(Event.Builder value);", "public Builder addStrValues(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureStrValuesIsMutable();\n strValues_.add(value);\n onChanged();\n return this;\n }", "public Context addValue(String value) {\n String squery = getQueryString();\n if (getURI() == null && squery != null) {\n setQueryString(squery + value);\n }\n return this;\n }", "public void add(int index, String value){\n add(value);\n }", "public void addEvent(String s, boolean isLast) {\r\n\t\tevents.add(s);\r\n\t\tif (events.size() > 12) events.remove(0);\r\n\t\tif (isLast) {\r\n\t\t\tupdateEvents(false);\r\n\t\t}\r\n\t}", "public abstract void parseValue(String value);", "@Override\n protected String toCloudEventsValue(final Object value) {\n return value.toString();\n }", "void visitStringValue(StringValue value);", "void entityValueChange(String name, String value);", "public void addEncodedArgument(String name, String value) {\n this.addEncodedArgument(name, value, ARG_VAL_SEP);\n }", "public void addEncodedArgument(String name, String value) {\n this.addEncodedArgument(name, value, ARG_VAL_SEP);\n }" ]
[ "0.6474325", "0.63055027", "0.624733", "0.60754764", "0.58851254", "0.5882504", "0.582215", "0.57181394", "0.5668108", "0.5653604", "0.56228507", "0.5586326", "0.55564255", "0.55560696", "0.554705", "0.5534963", "0.5524146", "0.55066925", "0.55029595", "0.5484205", "0.5454229", "0.54370236", "0.5435006", "0.5426656", "0.5422985", "0.54157346", "0.5390098", "0.5373123", "0.534118", "0.53337884", "0.5309487", "0.5298622", "0.52801776", "0.52801776", "0.52771556", "0.52545065", "0.52541476", "0.52350557", "0.52350277", "0.5221817", "0.521484", "0.5207326", "0.5203669", "0.5192276", "0.5160664", "0.51483333", "0.5147972", "0.5147403", "0.5129123", "0.5120708", "0.50792485", "0.50791365", "0.50722384", "0.50653785", "0.5062144", "0.50581264", "0.5057403", "0.5054515", "0.501166", "0.501115", "0.4988261", "0.49872792", "0.49678478", "0.49678105", "0.49653715", "0.49594957", "0.4949288", "0.49399972", "0.49344578", "0.4924699", "0.49220642", "0.49202472", "0.49177107", "0.49039608", "0.48999086", "0.4883059", "0.48796815", "0.4877487", "0.4877487", "0.48706535", "0.48655334", "0.4865183", "0.4862873", "0.4858589", "0.48582107", "0.4853269", "0.4848217", "0.48458272", "0.48444837", "0.4835687", "0.4829985", "0.482772", "0.48226568", "0.48164776", "0.48139498", "0.48097593", "0.48089102", "0.4803645", "0.48001269", "0.48001269" ]
0.79784846
0
Get_event_value Returns the value of event_value.
public String Get_event_value() { return event_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getEventValue() {\n return event_;\n }", "public int getEventValue() {\n return event_;\n }", "public String getAttrEventValue() {\r\n\t\treturn attrEventValue;\r\n\t}", "int getEventValue();", "public E getValue() {\r\n return value;\r\n }", "public E getValue() {\n\t\treturn value;\n\t}", "@Override\n public V getValue() {\n return m_value;\n }", "public Object getValue()\r\n\t{\r\n\t\treturn m_value;\r\n\t}", "public E getValue()\n {\n return value;\n }", "public Object getEvent() {\r\n return event;\r\n }", "public String getValue() {\n\t\tString value;\n\t\ttry {\n\t\t\tvalue = this.getString(\"value\");\n\t\t} catch (Exception e) {\n\t\t\tvalue = null;\n\t\t}\n\t\treturn value;\n\t}", "public String getEvent() {\n return this.event;\n }", "public T getValue() {\n\t\t\treturn this.entry.value;\n\t\t}", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "public String getValue() {\n\t\treturn (String) get_Value(\"Value\");\n\t}", "public Object getValue() {\n\t\t\treturn value;\n\t\t}", "public Event getEvent(){\n\t\t\treturn event;\n\t\t}", "@javax.persistence.Column(name = \"event_code\", nullable = false)\n\tpublic java.lang.Integer getEventCode() {\n\t\treturn getValue(org.jooq.examples.cubrid.demodb.tables.Record.RECORD.EVENT_CODE);\n\t}", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public Object getValue()\n {\n return value;\n }", "public Event getEvent() {\n\t\treturn event;\n\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\r\n\t\treturn value;\r\n\t}", "public Object getValue() {\r\n return value;\r\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "protected V getValue() {\n return this.value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public String getEvent_code() {\n\t\treturn event_code;\n\t}", "public Object getValue() { return _value; }", "public String getValue() {\n return getMethodValue(\"value\");\n }", "public Number getValue() {\n return (Number) getAttributeInternal(VALUE);\n }", "V getValue() {\n return value;\n }", "public String getValue(){\n\t\treturn _value;\n\t}", "public Value getValue(){\n return this.value;\n }", "public Object getValue() { return this.value; }", "public Object getValue()\n {\n\treturn value;\n }", "public Object getValue(){\n \treturn this.value;\n }", "public String getValue()\r\n\t{\r\n\t\treturn value;\r\n\t}", "public org.apache.calcite.avatica.proto.Common.TypedValue getValue() {\n if (valueBuilder_ == null) {\n return value_ == null ? org.apache.calcite.avatica.proto.Common.TypedValue.getDefaultInstance() : value_;\n } else {\n return valueBuilder_.getMessage();\n }\n }", "public final Object getValue()\n {\n return m_Value;\n }", "public V getValue()\r\n\t\t{\r\n\t\t\treturn val;\r\n\t\t}", "public java.lang.String getEVENT_CODE()\n {\n \n return __EVENT_CODE;\n }", "public String getValue()\n {\n return fValue;\n }", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public String getValue()\n {\n return value;\n }", "public AXValue getValue() {\n return value;\n }", "public Object getValue() {\r\n return oValue;\r\n }", "public String getValue()\n {\n return value;\n }", "public int getValue() \n {\n return value;\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue() {\r\n return value;\r\n }", "public String getValue(){\n\t\treturn this.value;\n\t}", "public int getValue()\r\n {\r\n return value;\r\n }", "public String getValue()\n {\n return this.value;\n }", "final public Object getValue()\n {\n return getProperty(VALUE_KEY);\n }", "public int getValue() {\n return value_;\n }", "public int getValue() {\n return value_;\n }", "Event getE();", "public int getValue() {\n return _value;\n }", "public int getValue() {\r\n return value;\r\n }", "public int getValue() {\r\n return value;\r\n }", "public int getValue()\n {\n return value;\n }", "public int getValue()\n {\n return value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue() {\n return this.value;\n }", "public String getValue()\n {\n return value;\n }", "public String getValue()\n {\n return value;\n }", "Event getEvent();", "public int getValue() {\n return value_;\n }", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}", "public int getValue() {\n return value_;\n }", "E getValue();", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }" ]
[ "0.7812749", "0.78095925", "0.7215722", "0.7148197", "0.6017698", "0.6014344", "0.5993876", "0.59918797", "0.59906197", "0.59687877", "0.59638673", "0.59403276", "0.58968556", "0.58909386", "0.58870345", "0.5839991", "0.58289057", "0.5824276", "0.5819932", "0.5811286", "0.5811286", "0.5811286", "0.5811286", "0.5809806", "0.5809806", "0.58064353", "0.580448", "0.58015406", "0.58015406", "0.57989144", "0.57877654", "0.578598", "0.578598", "0.5781675", "0.57798964", "0.57798964", "0.57798964", "0.57798964", "0.57798964", "0.5768822", "0.5763362", "0.57573175", "0.57554895", "0.57482517", "0.5747455", "0.5747038", "0.5743966", "0.57319844", "0.57249355", "0.5704199", "0.5688199", "0.5687856", "0.56845146", "0.5677584", "0.56768775", "0.56595445", "0.56478006", "0.564357", "0.56407076", "0.5639129", "0.56379986", "0.5632706", "0.5631794", "0.5631794", "0.5631794", "0.5631794", "0.5631794", "0.56301385", "0.5627735", "0.5626321", "0.5620829", "0.56188536", "0.56188536", "0.5617405", "0.5616864", "0.5616127", "0.5609324", "0.56072795", "0.56067413", "0.56053936", "0.56053936", "0.56053936", "0.56053936", "0.56053936", "0.56053936", "0.56053936", "0.55988914", "0.55988914", "0.55985165", "0.55955446", "0.5595027", "0.5595027", "0.5594013", "0.5590769", "0.5586304", "0.5586304", "0.5586304", "0.5586304", "0.5586304", "0.5586304" ]
0.8394332
0
Print_place Prints the value of place.
public void Print_place() { System.out.println("Place: " + place); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printList(ETPlace place) {\n place.getName();\n\n\n }", "public String getPlace() {\n\t\treturn place;\n\t}", "public String Get_place() \n {\n\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public String getPlace() {\n return place;\n }", "public void print () {\r\n System.out.println(\"Place \"+name+\": lat \"+lat+\" lon \"+lon+\r\n \" elevation \"+ele);\r\n }", "public void setPlace(String place){\n this.place = place;\n }", "public int getPlace() {\n\t\treturn place;\n\t}", "public String getPlace(){\n return place;\n }", "public void setPlace(int num) {\n\t\tplace = num;\n\t}", "public void scanCurrentPlace()\r\n\t{\r\n\t\tSystem.out.println(this.getCurrentPlace().toString());\r\n\t\tSystem.out.println(\"The place contains these objects: \");\r\n\t\tSystem.out.println(this.getCurrentPlace().getItems().toString());\r\n\t}", "public String getplaceName() {\n\t\treturn placeName;\n\t}", "Place getPlace();", "public String getActplace() {\r\n return actplace;\r\n }", "@Override\n public void onPlaceSelected(Place place) {\n\n place_str[0] = place.getName() + \",\" + place.getId();\n }", "public void Add_place(String p)\n {\n\n place = new String(p);\n }", "public static String getWaypointFromPlace(Place place) {\n return \"geo!\" + place.getLatitude() + \",\" + place.getLongitude();\n }", "public final native PlaceResult getPlace() /*-{\n return this.getPlace();\n }-*/;", "void put(){\n System.out.print(name + \" from \" + address + \". \");\n }", "public void setPlace(String place) {\n\t\tthis.place = place == null ? null : place.trim();\n\t}", "public void printBoard() {\n System.out.println(\"---+---+---\");\n for (int x = 0; x < boardLength; x++) {\n for (int y = 0; y < boardWidth; y++) {\n char currentPlace = getFromCoordinates(x, y);\n System.out.print(String.format(\" %s \", currentPlace));\n\n if (y != 2) {\n System.out.print(\"|\");\n }\n }\n System.out.println();\n System.out.println(\"---+---+---\");\n }\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public void setPlace(String place) {\n this.place = place == null ? null : place.trim();\n }", "public int getPlaceName() {\n return mPlaceName;\n }", "public int getPlaceDescription() {\n return mPlaceDescription;\n }", "void printPlaceArtifacts()\r\n\t{\r\n\t\tfor( Map.Entry <String, Artifact> entry : artPlace.entrySet()) \r\n\t\t{\r\n\t\t\t String key = entry.getKey();\r\n\t\t\t Artifact value = entry.getValue();\r\n\t\t\t \r\n\t\t\t // System.out.println(\"Place Name: \" + this.name());\r\n\t\t\t \r\n\t\t\t System.out.println(\" Artifact Name----->\" + value.getName());\r\n\t\t\t System.out.println(\"Size-----> \" + value.getSize());\r\n\t\t\t System.out.println(\"Value-----> \" + value.getValue() + \" \\n\");\t\r\n\t\t}\r\n\t}", "public String print(){\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.trackNumber, \r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.numRailCars, \r\n\t\t\t\tthis.destCity);\r\n\t\t}", "public Place getPlace() {\n\t\treturn null;\r\n\t}", "@Override\n public void onPlaceSelected(Place place) {\n Log.i(TAG, \"Place: \" + place.getName());\n editTextBusinessName.setText(place.getName());\n editTextLocation.setText(place.getAddress());\n editTextPhone.setText(place.getPhoneNumber());\n barCoordinates = place.getLatLng();\n //editTextBusinessDescription.setText(place.getAttributions());\n\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Place [name=\" + name + \", address=\" + address + \", photo=\" \n\t\t\t\t+ photo + \", phoneNumber=\" + phoneNumber + \", url=\" + url \n\t\t\t\t+ \", comment=\" + comment + \", date=\" + date + \", rate=\" \n\t\t\t\t+ rate + \"]\";\n\t}", "public void setActplace(String actplace) {\r\n this.actplace = actplace;\r\n }", "public String getPlaceId() {\n return placeId;\n }", "public void printLocationInfo()\n {\n System.out.println(currentRoom.getLongDescription());\n System.out.println();\n }", "public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }", "public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}", "public String getOtherPlace() {\r\n return otherPlace;\r\n }", "public interface PlaceInfo {\n\n\t\n\t/**\n\t * Return the place name\n\t * @return the place name\n\t */\n\tpublic String getName();\n\t\n\t\n\t/**\n\t * Return the place description\n\t * @return the place description\n\t */\n\tpublic String getDescription();\n\n\n\t/**\n\t * Is this place the space ship?\n\t * @return true if the place represents a space ship\n\t */\n\tpublic boolean isSpaceship();\n}", "public void displayValues()\n {\n \tSystem.out.println(\"The name of a bicycle is \"+name);\n \tSystem.out.println(\"The cost of a bicycle is \"+cost);\n \tSystem.out.println(\"The total numer of gears \"+gears);\n \t\n \t\n }", "public void setPlaces(int places) {\r\n this.places = places;\r\n }", "public void displayWord() {\n System.out.println(String.valueOf(display));\n }", "public String getValue(int place) {\n ListElement current = head;\n if (place <= count) {\n for (int i = 1; i < place; i++) {\n current = current.next();\n }\n return current.getValue();\n } else {\n return \"error\";\n }\n }", "static void print_the_address(int print_address){\n\t\tSystem.out.print(decimel_to_hexa(print_address)+\" : \");\n\t}", "public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}", "private void printMove(int row, int column)\n\t{\n\t\tSystem.out.println(toRowChar(row) + toColChar(column));\n\t}", "public int getPlaceLocation() {\n return mPlaceLocation;\n }", "@Override\n public void onPlaceSelected(Place place) {\n destination = place.getName().toString();\n destinationLatLng = place.getLatLng();\n }", "private static void createPlace(Place place) {\r\n\t\tint tempInt = -1;\r\n\t\tContainerNII placeNii = new ContainerNII();\r\n\t\tGeoCoordinate position = new GeoCoordinate();\r\n\t\tMedia media = new Media();\r\n\t\t\r\n\t\tinsertNIIValues(placeNii, \"place\");\r\n\t\tplace.setNii(placeNii);\r\n\t\t\t\t\r\n\t\tif ((tempInt = insertInteger(\"place radius: \")) != -1)\r\n\t\t\t\tplace.setRadius(tempInt);\r\n\t\t\r\n\t\tinsertPosition(position);\r\n\t\tplace.setPosition(position);\r\n\t\t\r\n\t\tinsertMedia(media);\r\n\t\tplace.setMedia(media);\r\n\t}", "public void printAddress()\r\n {\r\n address.printAddress();\r\n }", "public void printAddress()\r\n {\r\n address.printAddress();\r\n }", "public void print() {\r\n System.out.println(c() + \"(\" + x + \", \" + y + \")\");\r\n }", "@Override\r\n\tpublic void Print() {\r\n\t\tSystem.out.print(this.tav+\" \");\r\n\t\t\r\n\t}", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String print(){\r\n\t\t\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.companyName, \r\n\t\t\t\tthis.numberOfRailCars, \r\n\t\t\t\tthis.destinationCity);\r\n\t}", "public String getOwnerPlace() {\r\n return ownerPlace;\r\n }", "public void print() {\n System.out.print(\"[ \" + value + \":\" + numSides + \" ]\");\n }", "public int getPlaceDepth() {\n return placeDepth;\n }", "public String getLivingPlace() {\n return livingPlace;\n }", "public String getCustomerPlace() {\r\n return town.getName();\r\n }", "public String getPlacecode() {\n return placecode;\n }", "public java.lang.String getUiPlace() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n uiPlace_ = s;\n }\n return s;\n }\n }", "private void showCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n // Get the likely places - that is, the businesses and other points of interest that\n // are the best match for the device's current location.\n @SuppressWarnings(\"MissingPermission\")\n PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi\n .getCurrentPlace(mGoogleApiClient, null);\n result.setResultCallback(new ResultCallback<PlaceLikelihoodBuffer>() {\n @Override\n public void onResult(@NonNull PlaceLikelihoodBuffer likelyPlaces) {\n int i = 0;\n mLikelyPlaceNames = new String[mMaxEntries];\n mLikelyPlaceAddresses = new String[mMaxEntries];\n mLikelyPlaceAttributions = new String[mMaxEntries];\n mLikelyPlaceLatLngs = new LatLng[mMaxEntries];\n for (PlaceLikelihood placeLikelihood : likelyPlaces) {\n // Build a list of likely places to show the user. Max 5.\n Place place = placeLikelihood.getPlace();\n mLikelyPlaceNames[i] = (String) place.getName();\n mLikelyPlaceAddresses[i] = (String) place.getAddress();\n mLikelyPlaceAttributions[i] = (String) place.getAttributions();\n mLikelyPlaceLatLngs[i] = place.getLatLng();\n\n i++;\n if (i > (mMaxEntries - 1)) {\n break;\n }\n }\n // Release the place likelihood buffer, to avoid memory leaks.\n likelyPlaces.release();\n\n // Show a dialog offering the user the list of likely places, and add a\n // marker at the selected place.\n openPlacesDialog();\n }\n });\n } else {\n // Add a default marker, because the user hasn't selected a place.\n /*mMap.addMarker(new MarkerOptions()\n .title(getString(R.string.default_info_title))\n .position(mDefaultLocation)\n .snippet(getString(R.string.default_info_snippet)));*/\n }\n }", "public Place() {\r\n\t\tthis.name = \"Unknown Place\";\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "private void printInfo() {\n for (Coordinate c1 : originCells) {\n System.out.println(\"Origin: \" + c1.toString());\n }\n for (Coordinate c2 : destCells) {\n System.out.println(\"destination: \" + c2.toString());\n }\n for (Coordinate c3 : waypointCells) {\n System.out.println(\"way point: \" + c3.toString());\n }\n }", "public void place(Position position) { this.position = position; }", "public String idOfPlace()\n {\n return id;\n }", "public void setPlace(IPlace place) {\n\t\tthis.place = place;\r\n\t\t\r\n\t\t/*\r\n\t\t * 主建筑物的位置,决定了子建筑物的位置\r\n\t\t */\r\n\t\tfor(AbstractBuilding building : getBuildings()){\r\n\t\t\tbuilding.setPlace(place);\r\n\t\t}\r\n\t}", "public void display() {\n\t\tSystem.out.println(x + \" \" + y + \" \" + z);\n\t}", "private Place getPlace(String identifierPlace) {\n\t\tPlace place = null;\n\t\tfor(Place p: places ){\n\t\t\tif(p.getName().equals(identifierPlace)){\n\t\t\t\tplace = p;\n\t\t\t}\n\t\t}\n\t\treturn place;\n\t}", "@Override\n\tpublic void print() {\n System.out.println(\"Leaf [isbn=\"+number+\", title=\"+title+\"]\");\n\t}", "public void Show(int _order){\n\t\tSystem.out.println(_order + \": \" + name + \" is at floor #\" + actualFloor + \", he wants to go to floor #\" + targetFloor);\n\t}", "public int getPlaces() {\r\n return places;\r\n }", "@Override\n public void onPlaceSelected(Place place) {\n\n Log.i(\"place_autocomplete\", \"Place: \" + place.getName() + \", \" + place.getId() + \", \" + place.getLatLng());\n LatLng latLng = place.getLatLng();\n setLocationWork(latLng.latitude, latLng.longitude);\n }", "public void print()\n\t{\n\t\tDNode tem=first;\n\t\tSystem.out.print(tem.distance+\" \");\n\t\twhile(tem.nextDNode!=null)\n\t\t{\n\t\t\ttem=tem.nextDNode;\n\t\t\tSystem.out.print(tem.distance+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\r\n\tpublic void goTo(Place place) {\r\n\t\tclientFactory.getPlaceController().goTo(place);\r\n\t}", "void displayFragmentPlaceTypeList(Location location);", "public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public int getNumberOfPlaces()\n {\n return this.numberOfPlaces;\n }", "public void printCoordinates ()\n\t{\n\t\tfor (int a = 0; a < object.size(); a++)\n\t\t{\n\t\t\tSystem.out.println(\"Polygon \" + (a+1) + \":\");\n\t\t\tobject.get(a).detailedPrint();\n\t\t\tSystem.out.println(\"**********\");\n\t\t}\n\t}", "public static String getPlace(String place) {\n if (place != null\n && place.contains(\" of \")) {\n return place.substring(place.lastIndexOf(\" of \") + \" of \".length());\n }\n return place;\n }", "private static void print(Test29 ob) {\n\t\tSystem.out.printf(\"원의 넓이 : %f\",ob.area(3));\n\t\tSystem.out.printf(\"\\n사각형의 넓이 : %.2f\",ob.area(4,5));\n\t\tSystem.out.printf(\"\\n사다리꼴의 넓이 : %.2f\",ob.area(3,4,7));\n\t}", "void printParking();", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\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 uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}", "public void print() {\r\n\t\t System.out.println(toString());\r\n\t }", "public void print() {\n\t// Skriv ut en grafisk representation av kösituationen\n\t// med hjälp av klassernas toString-metoder\n System.out.println(\"A -> B\");\n System.out.println(r0);\n System.out.println(\"B -> C\");\n System.out.println(r1);\n System.out.println(\"turn\");\n System.out.println(r2);\n //System.out.println(\"light 1\");\n System.out.println(s1);\n //System.out.println(\"light 2\");\n System.out.println(s2);\n }", "public Integer getQueryplace() {\n\t\treturn queryplace;\n\t}", "private void printMap() {\n\t\tfor(Integer key: location.keySet()){\n\t\t\tString val= location.get(key).toString();\n\t\t\tSystem.out.println(\"(\" + key.toString() + \", \" + val+ \")\");\n\t\t}\n\t}", "public void printToScreen() {\n String type = \"\";\n switch (this.type) {\n case 1:\n type = \"Fashion\";\n break;\n case 2:\n type = \"Electronic\";\n break;\n case 3:\n type = \"Consumable\";\n break;\n case 4:\n type = \"Household appliance\";\n break;\n }\n// System.out.println(\"Type : \" + type);\n System.out.printf(\"%6d%15s%6f%20s\\n\", id, name, price, type);\n }", "public void printMap(GameMap map);", "public com.google.protobuf.ByteString\n getUiPlaceBytes() {\n java.lang.Object ref = uiPlace_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n uiPlace_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void print(){\r\n System.out.println(toString());\r\n }", "@Override\r\n\tpublic DiaryEventEditPlace getPlace() {\n\t\treturn null;\r\n\t}", "public void printResult(){\n StringBuilder sb = new StringBuilder(20);\n sb.append(left_value)\n .append(space)\n .append(symbol)\n .append(space)\n .append(right_value)\n .append(space)\n .append('=')\n .append(space)\n .append(result);\n System.out.println(sb);\n }", "public void printG(){\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\t}", "public void updateToPlace(int p) {\n\t\t_units.setText(\"Units to place: \"+p);\n\t\tvalidate();\n\t\trepaint();\n\t}", "Place resolveLocation( Place place );", "private void putSymbol(String symbol, String type, String eqn){\n System.out.println(symbol+ \" \"+ type + \" \"+ eqn);\n }" ]
[ "0.75413656", "0.726943", "0.7171017", "0.7164454", "0.7164454", "0.7164454", "0.7164454", "0.71511084", "0.69163734", "0.68637645", "0.67184055", "0.6538329", "0.64284915", "0.6420717", "0.63103026", "0.62643903", "0.6179832", "0.6179768", "0.6113513", "0.6113118", "0.60945797", "0.6080072", "0.60503405", "0.6040197", "0.6040197", "0.6040197", "0.59861314", "0.59167224", "0.5906354", "0.5905143", "0.58934724", "0.5888091", "0.5884231", "0.58813965", "0.58442056", "0.5831673", "0.5797509", "0.5794303", "0.5772222", "0.57634044", "0.5743923", "0.5743188", "0.57416093", "0.57321006", "0.57256347", "0.5718032", "0.571216", "0.57110494", "0.56956327", "0.56942815", "0.56902635", "0.56902635", "0.5674611", "0.56741697", "0.5665192", "0.56645906", "0.5658067", "0.5657984", "0.56526", "0.5652462", "0.5645573", "0.5642758", "0.5640039", "0.56358826", "0.561636", "0.5615021", "0.5607448", "0.55870265", "0.55806994", "0.5576264", "0.5562765", "0.55556786", "0.55548245", "0.5546487", "0.55284166", "0.5514992", "0.5513272", "0.5509298", "0.5507943", "0.55022496", "0.55003536", "0.54935217", "0.54789525", "0.5469209", "0.54687357", "0.54490346", "0.54487777", "0.54433525", "0.5438484", "0.5437724", "0.5435861", "0.5434597", "0.5432938", "0.5418746", "0.5413958", "0.541119", "0.5409631", "0.5402463", "0.5401715", "0.53995925" ]
0.90599316
0
Print_date Prints the value of date.
public void Print_date() { System.out.println("Date: " + date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void printdate(date iDate)\n {\n System.out.println(iDate.getElementValue());\n }", "public void printDate() {\r\n printDayOfWeek();\r\n System.out.println(cur.getDay());\r\n printMonth();\r\n System.out.println(cur.getYear());\r\n }", "public void displayDate() {\n\t\tSystem.out.print(year + \"/\" + month + \"/\" + day);\r\n\t}", "@Override\r\n\tpublic void date() {\n\t\tSystem.out.println(\"10/19/21\");\r\n\t}", "public String getPrintFormattedDate() {\n return this.date.format(DateTimeFormatter.ofPattern(\"MMM d yyyy\"));\n }", "public Date getPrintdate() {\n return printdate;\n }", "public void setPrintdate(Date printdate) {\n this.printdate = printdate;\n }", "public static void printDate(GregorianCalendar data){\n\t\tSystem.out.println(\"la data è \" + data.get(Calendar.YEAR) + \"/\" \n\t\t\t\t\t\t\t+ data.get(Calendar.MONTH) + \"/\" \n\t\t\t\t\t\t\t+ data.get(Calendar.DAY_OF_MONTH));\n\t}", "public static String printFedoraDateString(Date date) {\r\n return FEDORA_DATE_FORMAT.format(date);\r\n }", "public Date printDate(String date){\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/mm/yyyy\");\r\n\t\ttry{\r\n\t\t\treturn sdf.parse(date);\r\n\t\t}\r\n\t\tcatch(ParseException pe){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "String printListDate(String date);", "public static String toDisplayString(HISDate date) {\r\n String foo = \"\";\r\n if (date != null) {\r\n foo = date.toDisplayString();\r\n }\r\n\r\n return foo;\r\n }", "void showDate()\n {\n Date d=new Date();\n SimpleDateFormat s=new SimpleDateFormat(\"dd-MM-yyyy\");\n date.setText(s.format(d));\n }", "public static void main(String[] args) {\n\n LocalDate date = LocalDate.now();\n System.out.println(\"print date- \"+date);\n // print day \n DayOfWeek dow = date.getDayOfWeek();\n System.out.println(\"print day name - \"+ dow);\n int dateNo = date.getDayOfMonth();\n System.out.println(\"print day (number) - \"+ dateNo);\n // print month \n Month monthName = date.getMonth();\n System.out.println(\"print month name - \"+ monthName);\n int monthNo = date.getMonthValue();\n System.out.println(\"print month (Number) - \"+ monthNo);\n // print month \n int year = date.getYear();\n System.out.println(\"print year - \"+ year);\n // print particuller date like birth day\n LocalDate birthDay = LocalDate.of(1990, Month.NOVEMBER, 20);\n System.out.println(\"print particuller date - \"+birthDay);\n }", "@Override\n\tpublic void show(String t, Date u) {\n\t\tSystem.out.println(t);\n\t\tSystem.out.println(u);\n\t}", "public String Get_date() \n {\n \n return date;\n }", "public String toString() {\r\n String date = month + \"/\" + day;\r\n return date;\r\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "@Override\n\tpublic String print(Date object, Locale locale) {\n\t\treturn null;\n\t}", "public String getdate() {\n\t\treturn date;\n\t}", "default String toDisplay(Date date) {\n return getDisplayDateFormat().format(date);\n }", "@Test\n public void fieldPrintDate() throws Exception {\n Document doc = new Document(getMyDir() + \"Field sample - PRINTDATE.docx\");\n\n // When a document is printed by a printer or printed as a PDF (but not exported to PDF),\n // PRINTDATE fields will display the print operation's date/time.\n // If no printing has taken place, these fields will display \"0/0/0000\".\n FieldPrintDate field = (FieldPrintDate) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"3/25/2020 12:00:00 AM\", field.getResult());\n Assert.assertEquals(\" PRINTDATE \", field.getFieldCode());\n\n // Below are three different calendar types according to which the PRINTDATE field\n // can display the date and time of the last printing operation.\n // 1 - Islamic Lunar Calendar:\n field = (FieldPrintDate) doc.getRange().getFields().get(1);\n\n Assert.assertTrue(field.getUseLunarCalendar());\n Assert.assertEquals(\"8/1/1441 12:00:00 AM\", field.getResult());\n Assert.assertEquals(\" PRINTDATE \\\\h\", field.getFieldCode());\n\n field = (FieldPrintDate) doc.getRange().getFields().get(2);\n\n // 2 - Umm al-Qura calendar:\n Assert.assertTrue(field.getUseUmAlQuraCalendar());\n Assert.assertEquals(\"8/1/1441 12:00:00 AM\", field.getResult());\n Assert.assertEquals(\" PRINTDATE \\\\u\", field.getFieldCode());\n\n field = (FieldPrintDate) doc.getRange().getFields().get(3);\n\n // 3 - Indian National Calendar:\n Assert.assertTrue(field.getUseSakaEraCalendar());\n Assert.assertEquals(\"1/5/1942 12:00:00 AM\", field.getResult());\n Assert.assertEquals(\" PRINTDATE \\\\s\", field.getFieldCode());\n //ExEnd\n }", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public String getDate()\r\n\t{\r\n\t\treturn date;\r\n\t}", "void showdate(){\n \n Date d = new Date();\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd\");\n jLabel4.setText(s.format(d));\n}", "public String dateToString() {\n\t\treturn new String(year + \"/\"\n\t\t\t\t+ month + \"/\"\n\t\t\t\t+ day);\n }", "private String stringifyDate(Date date){\n\t\tDateFormat dateFormatter = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\treturn dateFormatter.format(date);\n\t}", "public java.lang.String getDate() {\n return date;\n }", "public Date date (){\r\n\t\t\treturn _date;\r\n\t\t}", "java.lang.String getDate();", "public static void displayDate(Locale locale)\n\t{\n\t\tDateFormat dateFormat = DateFormat.getDateInstance(DateFormat.DEFAULT, locale);\n\t\tDate currentDate = new Date();\n\t\tString date = dateFormat.format(currentDate);\n\t\tSystem.out.println(\"Date value in \" + locale + \" locale = \" + date);\n\t}", "public Date getPrint_time(){\r\n\t\treturn this.print_time ;\r\n\t}", "public String getDate()\n\t\t{\n\t\t\treturn date;\n\t\t}", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "public static void main(String[] args) {\n\t String str = String.format(\"%tc\", new Date());\r\n\t System.out.printf(str);\r\n\t \r\n//\t // display time and date\r\n//\t System.out.printf(\" Today is : %1$s %2$tB %2$td, %2$tY\", \"Due date : \", new Date());\r\n//\r\n\r\n\t System.out.println( new SimpleDateFormat(\"E yyyy.MM.dd 'at' hh:mm:ss a zzz\").format(new Date()));\r\n\t System.out.println( new SimpleDateFormat(\"EEEE, MMMM d, yyyy\").format(new Date()));\r\n\t}", "public String getDate() {\r\n\t\treturn date;\r\n\t}", "public String printByDateOpen() {\n StringBuilder result = new StringBuilder(\"--Printing statements by date opened--\\n\\n\");\n sortByDateOpen();\n result.append(orderedPrint());\n return result.toString();\n }", "public static void main(String[] args) {\n\t\t\t\tDate d = new Date();\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat (\"dd.mm.yyyy\");\n\t\t\t\tString s = sdf.format(d);\n\t\t\t\tSystem.out.println(s);\n\t\t\t\tJOptionPane.showMessageDialog(null, (s));\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\n\n\t}", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "public String getDate() {\n\t\treturn date;\n\t}", "public String getDate() {\n\t\treturn date;\n\t}", "public static void main(String[] args) {\n String s = FormatFecha.format(FormatFecha.FMT_ISO, new Date());\n System.out.println(\"Fecha: \" + s);\n //\"10/6/2010\" 2010-06-10\n }", "public String getDate() {\r\n return date;\r\n }", "public static String getDate()\n {\n Date date = new Date();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n return dateFormat.format(date);\n }", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "public Date date() {\r\n\t\treturn date;\r\n\t}", "public static String dateToString(Date date) {\n\t\tDateTime dt = new DateTime(date.getTime());\n\t\tDateTimeFormatter fmt = DateTimeFormat.forPattern(SmartMoneyConstants.DATE_FORMAT);\n\t\tString dtStr = fmt.print(dt);\n\n\t\treturn dtStr;\n\t}", "public String getDate() {\n return date;\n }", "@Override\n public int doStartTag() throws JspException {\n final DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(Locale.getDefault());\n final String currentDate = formatter.format(LocalDate.now());\n final JspWriter out = pageContext.getOut();\n try {\n out.println(currentDate);\n } catch (IOException e) {\n throw new JspException(e.getMessage());\n }\n return SKIP_BODY;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "public String getDate() {\n return date;\n }", "private String setDate() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n return sdf.format(new Date());\n }", "public Date date()\n\t{\n\t\treturn this.date;\n\t}", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "@Override\n\tpublic String toString() {\n\t\ttry {\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\t\tDate date = formatter.parse(month + \"/\" + day + \"/\" + year);\n\n\t\t\treturn formatter.format(date);\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public String getDate(){\n\t\t\n\t\treturn this.date;\n\t}", "public void print(String message) {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy hh:mm:ss.S\");\n\t\tSystem.out.println(sdf.format(date) + \"\t: \" + message);\n\t}", "@Test\n\tpublic void testPrintingDayName() throws Exception {\n\t DateTime oneSunnyWednesday = new DateTime(2014, 10, 15, 0, 0);\n\t DateTimeFormatter format = DateTimeFormat.forPattern(\"EEEE d/M/y\");\n\t String dayNameAndDate = format.print(oneSunnyWednesday);\n\t \n\t assertEquals(\"Wednesday 15/10/2014\", dayNameAndDate);\n\t}", "public static void date(int num) {\n String date = \"\";\n // Tests for what day of the week it is by using modulus to allign with a day.\n if (num%7==0) {\n date = \"Saturday\";\n } else if (num%7 == 1) {\n date = \"Sunday\";\n } else if (num%7 == 2) {\n date = \"Monday\";\n } else if (num%7 == 3) {\n date = \"Tuesday\";\n } else if (num%7 == 4) {\n date = \"Wednesday\";\n } else if (num%7 == 5) {\n date = \"Thursday\";\n } else if (num%7 == 6) {\n date = \"Friday\";\n }\n // Prints name of day inputted date falls on.\n System.out.println(\"That day is a \"+date);\n }", "public String date() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public String toString(){\n\t\treturn \"Name: \"+name +\" Date: \"+date.getDate();\n\t}", "public static String dateOnly() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "private void setDate() {\n java.util.Date d1 = new java.util.Date();\n SimpleDateFormat df = new SimpleDateFormat(\"YYYY-MM-dd\");\n String formateDate = df.format(d1);\n lblDate.setText(formateDate); \n }", "@Override\n public String toString() {\n return String.format(year + \",\" + month + \",\" + day);\n\n }", "public String getDate(){\n\t\treturn toString();\n\t}", "String getDate();", "String getDate();", "@Test\n\tpublic void systemDate_Get()\n\t{\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\t\n\t\t// Created object of Date, to get system current date\n\t\tDate date = new Date();\n\t\t\n\t\tString currDate = dateFormat.format(date);\n\t\t\n\t\tSystem.out.println(\"Today's date is : \"+currDate);\n\n\t}", "@Override\n public String toString() {\n return date.format(DateTimeFormatter.ofPattern(\"dd.MM.yyyy\")) + \" - \" + note;\n }", "private void printDays() {\n for (int dayOfMonth = 1; dayOfMonth <= daysInMonth; ) {\n for (int j = ((dayOfMonth == 1) ? dayOfWeek - 1 : 0); j < 7 && (dayOfMonth <= daysInMonth); j++) {\n if (this.isDateChosen == true && date.getDate() == dayOfMonth) {\n String space = date.getDate() >= 10 ? \" \" : \" \";\n System.out.print(space + ANSI_GREEN + dayOfMonth + ANSI_RESET + \" \");\n } else {\n System.out.printf(\"%4d \", dayOfMonth);\n }\n dayOfMonth++;\n }\n System.out.println();\n }\n }", "public String getDate() {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\treturn sdf.format(txtDate.getDate());\n\t}", "public String getDate() {\r\n\t\treturn this.date;\r\n\t}", "private String dateToString(Date d){\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.format(d);\r\n\t}", "public static String toStringFormat_4(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_4);\r\n\t}", "public static String printTime(LocalDate time) {\n return time.format(DateTimeFormatter.ofPattern(\"MMM d yyyy\"));\n }", "public String getDate() {\n return this.date;\n }", "public String getDate() {\n return this.date;\n }", "@Override\n public String toString() {\n return month + \"/\" + day + \"/\" + year;\n }", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "public static void main(String[] args) {\n\n\t\tDate date = new Date();\n\t\tSystem.out.println(date.toString());\n\t\t\n\t\t//If date is required in specific format\n\t\t\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"M/d/yyyy hh::mm::ss\");\n\t\tsdf.format(date);\n\t\tSystem.out.println(\"In required date format \"+sdf.format(date));\n\t\t\n\t\t//Using calendar objects\n\t\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tSimpleDateFormat sdf1 = new SimpleDateFormat(\"M/d/yyyy hh::mm::ss\");\n\t\tSystem.out.println(\"Using the Calendar objects \"+sdf1.format(cal.getTime()));\n\t\tSystem.out.println(\"Methods in Calendar \"+Calendar.DAY_OF_WEEK_IN_MONTH);\n\t\t\n\t\t\n\t}", "public void print() {\n System.out.print(datum+\" \");\n if (next != null) {\n next.print();\n }\n }", "public String marshal( Date value )\n {\n String val = \"\";\n \tif (value != null) {\n \tCalendar cal = new GregorianCalendar();\n \tcal.setTime( value );\n \treturn DatatypeConverter.printDateTime( cal );\n }\n\t\t\n\t\tSystem.out.println(\"Date value: \" + value);\n return val;\n }", "public static void main(String[] args) {\n\t\t\n\t\tLocalDate date = LocalDate.now(); \n\t\tSystem.out.println(date);\n\t\t//date.atStartOfDay();\n\t\t int d=date.getDayOfMonth();\n\t\t System.out.println(d);\n\t\t int y=date.getYear();\n\t\t System.out.println(y);\n\t\t int m=date.getMonthValue();\n\t\t System.out.println(m);\n\t\t\n\t\t \n\t\t \n\t\t \n\t\t\n\t\t \n\t\t \n\t}", "LocalDate getDate();", "public void print() {\n\tfor (int i = 0; i &lt; mCalendarMarkings.sizeCalendarMarkingList(); i++) {\n\t CalendarMarking marking = mCalendarMarkings.getCalendarMarking(i);\n\t // get first occurrence:\n\t Calendar firstDay = Calendar.getInstance();\n\t firstDay.setTimeInMillis(marking.getStartDate());\n\t RepetitionHandler handler = sHandlerMap.get(marking.getRepeatType());\n\t firstDay = handler.getFirst(firstDay, marking);\n\t printDate(firstDay);\n\t while (firstDay != null) {\n\t\tfirstDay = handler.getNext(firstDay, marking);\n\t\tprintDate(firstDay);\n\t }\n\t}\n }", "public String getDate() {\n\t\treturn this.date;\n\t}", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "private static String setDate() {\n mDate = new Date();\n DateFormat dateFormat = DateFormat.getDateInstance();\n String dateString = dateFormat.format(mDate);\n return dateString;\n }", "public static String formatDateForQuery(java.util.Date date){\n return (new SimpleDateFormat(\"yyyy-MM-dd\")).format(date);\n }", "public static String getStandardDate(Date date){\n\t\t\n\t\tif(date == null)\n\t\t\tthrow new RuntimeException(\"Given date object is null...\");\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\treturn format.format(date.getTime());\n\t}", "public static String formatDate(Date date) {\n final SimpleDateFormat formatter = new SimpleDateFormat(\"MM-dd-yyyy\");\n return formatter.format(date);\n }", "@Override\n public String print(){\n String ret = super.print();\n ret += \"\\nYears Until Tenure: \" + m_yearsUntilTenure;\n return ret;\n }", "public static String getDate(Date date)\n\t{\n\t\treturn getFormatString(date, getDateFormat());\n\t}", "@FXML\r\n\tString getDate() {\r\n\t\t\tLocalDate creditCardExpiryDate = dpCreditCardExpiryDate.getValue();\r\n\t\t\tDateTimeFormatter formattedExpiryDate = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\r\n\t\t\treturn formattedExpiryDate.format(creditCardExpiryDate);\r\n\t}", "public String getDate(){\n\n return this.date;\n }", "public static String dateToString(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n return df.format(date);\r\n }", "public static String formatDate(Date date) {\n return DateFormat.getDateFormat(BaracusApplicationContext.getContext()).format(date);\n }" ]
[ "0.7863891", "0.78035843", "0.77932817", "0.7405534", "0.7231651", "0.7113416", "0.6998862", "0.6985278", "0.68750054", "0.6830458", "0.6810138", "0.67284536", "0.67283887", "0.67143273", "0.65176105", "0.65018976", "0.6410196", "0.6391906", "0.63139015", "0.6305351", "0.62671745", "0.6239608", "0.62257665", "0.62257665", "0.6223713", "0.62140095", "0.6205572", "0.6204357", "0.62008923", "0.61815864", "0.6166947", "0.6164554", "0.6130099", "0.6118064", "0.6117297", "0.6111833", "0.6111811", "0.60904175", "0.6082696", "0.60542524", "0.60542524", "0.6050911", "0.6050261", "0.6038833", "0.60285485", "0.6024149", "0.60237336", "0.6016731", "0.60120535", "0.6008864", "0.6008864", "0.6008864", "0.6008864", "0.6008864", "0.6008556", "0.6004233", "0.60010904", "0.59936935", "0.5993181", "0.5991161", "0.5982744", "0.59736824", "0.5969199", "0.5959237", "0.5955275", "0.59495795", "0.59345907", "0.593433", "0.5913871", "0.5913871", "0.5906923", "0.59046334", "0.59009105", "0.5897134", "0.589161", "0.58843416", "0.5879081", "0.5875971", "0.5869058", "0.5869058", "0.5868299", "0.58632845", "0.5861006", "0.58592576", "0.5854304", "0.58499914", "0.5847639", "0.58461875", "0.58446866", "0.58345294", "0.5832516", "0.5831037", "0.5828328", "0.582373", "0.58212847", "0.579905", "0.5794388", "0.5786971", "0.5782246", "0.57805127" ]
0.8647693
0
Print_event_value Prints the value of event_value.
public void Print_event_value(String v) { System.out.println(v + ": " + event_value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String Get_event_value() \n {\n\n return event_value;\n }", "protected void printEvent(Event event) {\n System.out.println(\"\\t\" + event.getName());\n System.out.println(\"\\t\" + event.getDate().getDate());\n System.out.println(\"\\t\" + event.getTime().get12HTime());\n\n if (event.getDuration() != 0) {\n System.out.println(\"\\tFor \" + event.getDuration() + \" minutes\");\n }\n }", "public void Add_event_value(String v)\n {\n\n event_value = new String(v);\t\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn this.event;\r\n\t}", "public int getEventValue() {\n return event_;\n }", "int getEventValue();", "public String getAttrEventValue() {\r\n\t\treturn attrEventValue;\r\n\t}", "public int getEventValue() {\n return event_;\n }", "public void printVenueCharges (Event _event) {\n\t}", "@Override\n protected String toCloudEventsValue(final Object value) {\n return value.toString();\n }", "public void print(String value){\r\n System.out.println(value);\r\n }", "public void handleEvent(Event event) {\n\t\t\t\tprintingHandle.handlePrint(text.getText());\n\t\t\t}", "@Override\n public void onNext(TransportEvent value) {\n LOG.log(Level.FINEST, \"{0}\", value);\n stage.onNext(value);\n }", "@Override\n\tpublic void valueChange(ValueChangeEvent event) {\n\t\t\n\t}", "@Override\n\tpublic String formatEvent(Event event) {\n\t\treturn event.getStartingTime() + \":00 - \"\n\t\t\t + event.getEndingTime() + \":00: \" + event.getEventName() + '\\n';\n\t}", "@Override\n public void handle(ActionEvent event) {\n if (event.getSource() == Kajatipus) {\n System.out.println(Kajatipus.getValue());\n \n }\n\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(valueType+\": \"+value);\n\t}", "private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\", \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n\n\n }", "protected void printValConfig(){\n\t\t//System.out.println(\"writing values\");\n\t\tif(valueFxn.compareToIgnoreCase(\"additive\")==0){\n\t\t\tprintAdditive();\n\n\t\t}else if(valueFxn.compareToIgnoreCase(\"schedule\")==0){\n\t\t\tprintSchedule();\n\n\n\t\t}else if(valueFxn.compareToIgnoreCase(\"contract\")==0){\n\t\t\tprintContracts();\n\n\t\t}else{\n\t\t\tSystem.out.println(\"Value function not set correctly.\");\n\t\t}\n\t}", "public synchronized void event(String s){\n\t\tif(printStdOut){\n\t\t\tSystem.out.println(s);\n\t\t}\n\t\tif(eventLogPath != null){\n\t\t\teventLogWriter.println(s);\n\t\t}\n\t}", "private void dumpEvent(MotionEvent event) {\n\t\tString names[] = { \"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\", \"POINTER_DOWN\", \"POINTER_UP\",\n\t\t\t\t\"7?\", \"8?\", \"9?\" };\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint action = event.getAction();\n\t\tint actionCode = action & MotionEvent.ACTION_MASK;\n\t\tsb.append(\"event ACTION_\").append(names[actionCode]);\n\t\tif (actionCode == MotionEvent.ACTION_POINTER_DOWN\n\t\t\t\t|| actionCode == MotionEvent.ACTION_POINTER_UP) {\n\t\t\tsb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_INDEX_SHIFT);\n\t\t\tsb.append(\")\");\n\t\t}\n\t\tsb.append(\"[\");\n\t\tfor (int i = 0; i < event.getPointerCount(); i++) {\n\t\t\tsb.append(\"#\").append(i);\n\t\t\tsb.append(\"(pid \").append(event.getPointerId(i));\n\t\t\tsb.append(\")=\").append((int) event.getX(i));\n\t\t\tsb.append(\",\").append((int) event.getY(i));\n\t\t\tif (i + 1 < event.getPointerCount())\n\t\t\t\tsb.append(\";\");\n\t\t}\n\t\tsb.append(\"]\");\n\t\tLog.d(TAG_DUMP, sb.toString());\n\t}", "private static void dumpEvent(MotionEvent event)\n {\n String[] names = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\n \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN\n || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(\n action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n sb.append(\"]\");\n LogHelper.d(TAG, sb.toString());\n }", "@FXML\r\n private void displayPostion(MouseEvent event) {\r\n status.setText(\"X = \" + event.getX() + \". Y = \" + event.getY() + \".\");\r\n }", "private void display(int key, String value)\n {\n System.out.println(\"Value for id \" + key + \": \" + value);\n }", "private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\", \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n sb.append(\"]\");\n Log.d(\"Touch Events ---------\", sb.toString());\n }", "public Builder setEventValue(int value) {\n event_ = value;\n onChanged();\n return this;\n }", "@Override\n public void printDetails() {\n super.printDetails(); // uses its superclass version of the method to print the basic attributes\n System.out.print(\"Time: \" + this.getTime()); // printing the time of the event\n }", "@Override\n public String toString(){\n return String.valueOf(value);\n }", "@SuppressWarnings(\"deprecation\")\n @TargetApi(Build.VERSION_CODES.ECLAIR)\n @SuppressLint(\"NewApi\")\n private void dumpEvent(MotionEvent event) {\n String names[] = {\"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\n \"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\"};\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN\n || actionCode == MotionEvent.ACTION_POINTER_UP) {\n sb.append(\"(pid \").append(\n action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n sb.append(\"]\");\n }", "@Override\n\tpublic String toString() {\n\t\treturn this.getStringEventId();\n\t}", "@Override\n public String toString()\n {\n return \"xValue: \" + xValue;\n }", "private static void showvalue(int n) {\n\t\tSystem.out.println(\"n is\"+ n);\r\n\t}", "private void dumpEvent(MotionEvent event) \n {\n String names[] = { \"DOWN\", \"UP\", \"MOVE\", \"CANCEL\", \"OUTSIDE\",\"POINTER_DOWN\", \"POINTER_UP\", \"7?\", \"8?\", \"9?\" };\n StringBuilder sb = new StringBuilder();\n int action = event.getAction();\n int actionCode = action & MotionEvent.ACTION_MASK;\n sb.append(\"event ACTION_\").append(names[actionCode]);\n\n if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) \n {\n sb.append(\"(pid \").append(action >> MotionEvent.ACTION_POINTER_ID_SHIFT);\n sb.append(\")\");\n }\n\n sb.append(\"[\");\n for (int i = 0; i < event.getPointerCount(); i++) \n {\n sb.append(\"#\").append(i);\n sb.append(\"(pid \").append(event.getPointerId(i));\n sb.append(\")=\").append((int) event.getX(i));\n sb.append(\",\").append((int) event.getY(i));\n if (i + 1 < event.getPointerCount())\n sb.append(\";\");\n }\n\n sb.append(\"]\");\n Log.d(\"Touch Events ---------\", sb.toString());\n }", "@Override\n public final String toString() {\n return this.value;\n }", "public final EObject ruleEventValueReferenceExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n Token otherlv_2=null;\r\n Token otherlv_4=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3494:28: ( ( () otherlv_1= 'valueof' otherlv_2= '(' ( ( ruleFQN ) ) otherlv_4= ')' ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3495:1: ( () otherlv_1= 'valueof' otherlv_2= '(' ( ( ruleFQN ) ) otherlv_4= ')' )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3495:1: ( () otherlv_1= 'valueof' otherlv_2= '(' ( ( ruleFQN ) ) otherlv_4= ')' )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3495:2: () otherlv_1= 'valueof' otherlv_2= '(' ( ( ruleFQN ) ) otherlv_4= ')'\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3495:2: ()\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3496:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getEventValueReferenceExpressionAccess().getEventValueReferenceExpressionAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,53,FOLLOW_53_in_ruleEventValueReferenceExpression8012); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getEventValueReferenceExpressionAccess().getValueofKeyword_1());\r\n \r\n }\r\n otherlv_2=(Token)match(input,27,FOLLOW_27_in_ruleEventValueReferenceExpression8024); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_2, grammarAccess.getEventValueReferenceExpressionAccess().getLeftParenthesisKeyword_2());\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3509:1: ( ( ruleFQN ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3510:1: ( ruleFQN )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3510:1: ( ruleFQN )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:3511:3: ruleFQN\r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n \t\t\tif (current==null) {\r\n \t current = createModelElement(grammarAccess.getEventValueReferenceExpressionRule());\r\n \t }\r\n \r\n }\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getEventValueReferenceExpressionAccess().getValueEventCrossReference_3_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleFQN_in_ruleEventValueReferenceExpression8047);\r\n ruleFQN();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_4=(Token)match(input,29,FOLLOW_29_in_ruleEventValueReferenceExpression8059); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_4, grammarAccess.getEventValueReferenceExpressionAccess().getRightParenthesisKeyword_4());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public String toString(){\n return \"Eventtype: \" + eventType + \", event time: \" + eventTime + \", Tally time: \" + tallyTime + \", cash: \" + cash;\n }", "@Override\n\tpublic String toString() {\n\t\treturn value;\n\t}", "public String printEventFormat() {\n return \" (;´・д・`) Doesn't match the event format.\\n\"\n + \"Please use \\\"event ... /at dd/mm/yyyy 0000\\\" (in 24hr).\\n\";\n }", "@Override\n\tpublic void fireEvent(EventObject event, boolean blocked) {\n\t\tSystem.out.println(event);\n\t}", "@Override\n public String toString() {\n return String.valueOf(value());\n }", "@Override\n public String toString() {\n return \"\" + this.value;\n }", "public void printEvent(ICompletionEvent event) throws FileNotFoundException {\n\n\t\ttry(FileWriter fw = new FileWriter(directory+File.separator+\"Event_RunOf_\"+timeOfRun+\".txt\", true);\n\t\t\t BufferedWriter bw = new BufferedWriter(fw);\n\t\t\t PrintWriter out = new PrintWriter(bw)){\n\t\t\t\n\t\t\tout.println(event.toString());\n\t\t\tout.println(\"===================================================================\\r\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not write to Event file. Exception was:\"+e.getStackTrace()); \n\t\t}\n\t}", "public void setAttrEventValue(String attrEventValue) {\r\n\t\tthis.attrEventValue = attrEventValue;\r\n\t}", "public abstract void trackEvent(@NotNull String eventCategory,\n @NotNull String eventAction,\n @Nullable String eventLabel,\n @Nullable Integer eventValue);", "public String toString() {\n return value;\r\n }", "public String toString() {\n return value;\n }", "public void printEeventList() {\n PriorityQueue<Event> events = this.getEventList();\n while (!events.isEmpty()) {\n Event event = events.poll();\n if (!(event instanceof ServerRestEvent || event instanceof ServerBackEvent)) {\n System.out.println(event);\n }\n\n }\n }", "public void printCode( String value )\r\n\t{\r\n\t\tSystem.out.println(\"A suitable number for this : \");\r\n\t\tSystem.out.println(value);\r\n\t}", "public String getEvent() {\n return this.event;\n }", "public void mousePrint(String eventDescription, MouseEvent e) {\n\t\ttextArea.append(\"Mouse \" + eventDescription + \" at (\" + \n\t\t\t\t\t e.getX() + \", \" + e.getY() + \")\" + \"\\n\");\n\t}", "void printestateName(estateName iEstateName)\n {\n System.out.println(iEstateName.getElementValue());\n }", "public static String eventTypeToString(EventType e) {\n return TypeToString.eventTypeToString(e);\n }", "@Override\n public String getValue() {\n return this.value.toString();\n }", "java.lang.String getEventType();", "private void printNode() {\n System.out.println(\"value:\" + value + \" next:\" + nextNode);\n }", "private void printMotionEvent(final MotionEvent ev, final boolean handled) {\n//\t\tString message;\n//\t\tswitch (ev.getActionMasked()) {\n//\t\tcase MotionEvent.ACTION_DOWN:\n//\t\t\tmessage = \"DOWN\";\n//\t\t\tbreak;\n//\t\tcase MotionEvent.ACTION_MOVE:\n//\t\t\tmessage = \"MOVE\";\n//\t\t\tbreak;\n//\t\tcase MotionEvent.ACTION_UP:\n//\t\t\tmessage = \"UP\";\n//\t\t\tbreak;\n//\t\tcase MotionEvent.ACTION_CANCEL:\n//\t\t\tmessage = \"CANCEL\";\n//\t\t\tbreak;\n//\t\tdefault:\n//\t\t\treturn;\n//\t\t}\n//\t\tLog.i(TAG, message + \"\\t\" + handled);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s:%s\", type, value);\n\t}", "protected void displayOperatedValue(int value) {\n \tstack.push(value);\n \tcurrent = value;\n \tshow(current);\n \tcurrent = 0;\n }", "public void controlEvent(ControlEvent theEvent) {\n\n\n\n if (theEvent.isGroup()) {\n // an event from a group e.g. scrollList\n println(theEvent.group().value()+\" from \"+theEvent.group());\n }\n \n if(theEvent.isFrom(r)) {\n print(\"got an event from \"+theEvent.getName()+\"\\t\");\n for(int i=0;i<theEvent.getGroup().getArrayValue().length;i++) {\n print(PApplet.parseInt(theEvent.getGroup().getArrayValue()[i]));\n }\n println(\"\\t \"+theEvent.getValue());\n mode = theEvent.getValue();\n }\n\n if(theEvent.isFrom(s)) {\n print(\"got an event from \"+theEvent.getName()+\"\\t\");\n for(int i=0;i<theEvent.getGroup().getArrayValue().length;i++) {\n print(PApplet.parseInt(theEvent.getGroup().getArrayValue()[i]));\n }\n println(\"\\t \"+theEvent.getValue());\n soundmodevar = theEvent.getValue();\n }\n\n}", "public String toString()\r\n\t{\r\n\t\treturn \" \" + this.value;\r\n\t}", "public void buttonClick(ClickEvent event) {\n\t\t\t\t\t\t JavaScript.getCurrent().execute(\"print();\");\n\t\t\t\t\t\t }", "public String getEventName();", "public void printVal()\n {\n for (int i=0;i<intData.length;i++)\n System.out.print(intData[i] + \" \");\n System.out.println();\n System.out.println(\"Sum: \" + sum + \", Avg: \" + avg + \", Prod: \" + prod);\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn value + \"\";\r\n\t}", "public void dropDown1_processValueChange(ValueChangeEvent event) {\n \n }", "protected String formatValue (Object value)\n {\n return String.valueOf(value);\n }", "public void handleEvent(Event event)\n {\n letzteZahlung.getValue();\n }", "@Override\n\tpublic String getValue() {\n\t\treturn PushyView.c.getValue();\n\t}", "public void priceChanged(final PriceChangeEvent event) {\n System.out.println(\n mName + \": \" + event.getTicker() + \" \" + event.getPrice());\n }", "public final String toString ()\r\n {\r\n return _name + \" = \" + _value;\r\n }", "public void nativeMouseClicked(NativeMouseEvent e) {\r\n\t\tSystem.out.println(\"Mouse Clicked: \" + e.getClickCount());\r\n\t\twriteFile(2, valueButton, e.getClickCount());\r\n\t}", "@Override\n public String toString(){\n return this.getValue();\n }", "@Override\n \tpublic void logVarChanged(String var, String value) {\n\t\tSystem.out.println(\"\\tNew Variable Value: \" + var + \" = \" + value);\n \t}", "@Override\r\n\tpublic String toString() \r\n\t{\n\t\treturn \"I am in to String DrawEvent\";\r\n\t}", "@Override\n public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event) {\n System.out.println(\" --> GPIO PIN STATE CHANGE: \" + event.getPin() + \" = \" + event.getState());\n }", "public void handle(Event event) {\n showDiceResult();\n }", "private String getOutputValue(double value, boolean enablePrecision) {\n if(enablePrecision) {\n switch(this.getPrecisionType()) {\n case FLOAT7:\n return DECIMAL_FORMAT.format(value);\n case FLOAT16:\n return \"\" + toFloat(fromFloat((float) value));\n case DOUBLE64:\n return value + \"\";\n case FLOAT32:\n default:\n return ((float) value) + \"\";\n }\n } else {\n return ((float) value) + \"\";\n }\n }", "void printTotalCFT(TotalCFT iTotalCFT)\n {\n System.out.println(iTotalCFT.getElementValue());\n }", "public String toString()\n {\n return this.getGeoEvent().toString();\n }", "@Override\n\tpublic void handleEvent(StateEventT stateNow) {\n\t\tSystem.out.println(stateNow.getState());\n\t}", "@Override\r\n public void infixDisplay() {\r\n System.out.print(value);\r\n }", "public String doPrint() {\n\t\t// Get the event title.\n\t\tString event = \"\";\n\t\tswitch (eventType) {\n\t\t\tcase \"IND\": event = \"Individual\";\n\t\t\t\t\t\tbreak;\n\t\t\tcase \"GRP\": event = \"Group\";\n\t\t\t\t\t\tbreak;\n\t\t\tcase \"PARIND\": event = \"Parallel Individual\";\n\t\t\t\t\t\t break;\n\t\t\tcase \"PARGRP\": event = \"Parallel Group\";\n\t\t\t\t\t\t break;\n\t\t default:\tevent = \"\";\n\t\t \t\t\tbreak;\n\t\t}\n\t\t\n\t\tString out = \"RUN BIB TIME\t \" + event +\"\\n\";\n\t\t\n\t\t// Print completed runs.\n\t\tfor ( Run run : completedRuns ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\t// Print inProgress runs.\n\t\tfor ( Run run : finishQueue ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\t// Print waiting runs.\n\t\tfor ( Run run : startQueue ) {\n\t\t\tout += run.print() + \"\\n\";\n\t\t}\n\t\t\n\t\treturn out;\n\t}", "public EventParameter(String key, int value) {\n this.key = key;\n this.value = value;\n this.summary = \"\";\n this.valueDescription = \"\";\n }", "public String getExampleEvent() {\n return exampleEvent;\n }", "String getValue()\n {\n return value.toString();\n }", "public void printTurn(MouseEvent event) {\n\n if(winner != null) {\n showWindow(winner);\n } else {\n Label textId = (Label) event.getSource();\n if(single && textId.getText().isEmpty())\n disableLabel();\n\n if (textId.getText().isEmpty()) {\n if (playerX.equals(whoseTurn)) {\n textId.setText(\"X\");\n whoseTurn = playerO;\n } else {\n textId.setText(\"O\");\n whoseTurn = playerX;\n }\n }\n computeWinLose();\n label.setText(whoseTurn + \"'s turn to play\");\n\n if (single && whoseTurn.equals(playerO)) {\n printO();\n computeWinLose();\n }\n }\n }", "void printtCFT(tCFT iTCFT)\n {\n System.out.println(iTCFT.getElementValue());\n }", "public void logEvent(String message) {\n System.out.println(\"PC Log.listener: \"+message);\n\n }", "public String echo(String value) {\n\t\treturn value;\n\t}", "private static String getEventString(final JobLogEvent event)\n {\n if (event == null) {\n return \"NullJobEvent\";\n }\n final StringBuilder sb = new StringBuilder();\n if (event.getScheduler() != null) {\n sb.append(\" Scheduler=\").append(event.getScheduler()).append(\"\\n\");\n }\n // if (event.getRunner() != null) {\n // sb.append(\" Runner=\").append(event.getRunner()).append(\"\\n\");\n // }\n if (event.getJob() != null) {\n sb.append(\" Job=\").append(event.getJob()).append(\"\\n\");\n }\n if (event.getJobDefinition() != null) {\n sb.append(\" Definition=\").append(event.getJobDefinition()).append(\"\\n\");\n }\n if (event.getJobResult() != null) {\n sb.append(\" Result=\").append(event.getJobResult()).append(\"\\n\");\n }\n if (event.getJobStatus() != null) {\n sb.append(\" Status=\").append(event.getJobStatus()).append(\"\\n\");\n }\n return sb.toString();\n }", "public String getEventInfo()\n {\n return \"Event ID: \" + this.hashCode() + \" | Recorded User\\n\" + String.format(\"\\tName %s \\n\\tDate of Birth %s \\n\\tEmail %s \\n\\tContact Number %s \\n\\tAge %d \\nDate %s \\nTime %s \\nParty Size %d \\nEstablishment \\n\\tName: %s \\n\\tAddress: %s\",\n user.getName(), user.getDateOfBirthAsString(), user.getEmail(), user.getPhoneNumber(), \n user.getAge(), getEventDateAsString(), getEventTimeAsString(), partyNumber, establishment.getName(), establishment.getAddress());\n }", "public String getValue() {\r\n return xValue;\r\n }", "@Override\n public String toString() {\n StringBuilder newString = new StringBuilder();\n newString.append(\"Event{\" +\n \"eventID: \" + eventID + \", \" +\n \"descendant: \" + descendant + \", \" +\n \"personID: \" + personID + \", \" +\n \"eventType: \" + eventType + \", latitude: \" + latitude +\n \", longitude: \" + longitude +\n \", country: \" + country +\n \", city: \" + city +\n \", year: \" + year + \"}\");\n return newString.toString();\n }", "@Override\n\tpublic String toString() {\n\t\treturn rawValue;\n\t}", "public String getXpeEventNumber() {\n return (String) getAttributeInternal(XPEEVENTNUMBER);\n }", "public void actionPerformed(ActionEvent ae) \r\n {\r\n \tSystem.out.println(var1);\r\n }", "public void actionPerformed(ActionEvent ae) \r\n {\r\n \tSystem.out.println(var1);\r\n }", "public void displayStateValues()\n\t{\n\t\tfor (State s : stateSpace)\n\t\t{\n\t\t\tSystem.out.println(s.state + \"\\t\" + this.value.get(s));\n\t\t}\n\t}", "public String getValue() { return value; }", "@Override\r\n public String toString() {\r\n return (value == null) ? \"\" : value;\r\n }" ]
[ "0.7413669", "0.6773892", "0.62231934", "0.6115133", "0.59720945", "0.5948886", "0.59378666", "0.586366", "0.58474517", "0.5662734", "0.5633647", "0.55550325", "0.5537706", "0.54763734", "0.54512995", "0.5399315", "0.5389286", "0.5387289", "0.53725487", "0.5359013", "0.53553385", "0.5339614", "0.5312432", "0.5295444", "0.5294152", "0.52613926", "0.52482057", "0.52439684", "0.52353686", "0.5231691", "0.5227939", "0.5212719", "0.52067465", "0.5203386", "0.51781213", "0.5172072", "0.5171255", "0.51609063", "0.5156249", "0.51546896", "0.51432675", "0.5131845", "0.51200354", "0.5110779", "0.50985724", "0.5094536", "0.50932366", "0.50802815", "0.50773585", "0.5045518", "0.5038765", "0.50191045", "0.5001269", "0.49949032", "0.49784994", "0.49701607", "0.49688172", "0.49622568", "0.49551016", "0.49538478", "0.49473053", "0.4947299", "0.4939793", "0.49345738", "0.49211508", "0.49174723", "0.49173203", "0.491573", "0.48913038", "0.48850045", "0.486877", "0.4868242", "0.48663282", "0.4861873", "0.48454085", "0.48267046", "0.48197904", "0.48192993", "0.48179224", "0.48096758", "0.48085162", "0.4808335", "0.48080653", "0.4807761", "0.48074985", "0.48009968", "0.48006558", "0.47972393", "0.47939718", "0.47936037", "0.4788414", "0.4786886", "0.47822973", "0.47805318", "0.47747532", "0.47606596", "0.47606596", "0.47603887", "0.47562948", "0.47553352" ]
0.8052603
0
Instantiates a new Config service.
@Autowired public ConfigService(ConfigRepository repo, RedisTemplate<String, Serializable> redisTemplate) { super(repo); this.redisTemplate = redisTemplate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Config() {\n this(System.getProperties());\n\n }", "public ConfigManager() {\n // Nobody here.\n }", "public DirectProjectCPConfigServiceImpl() {\r\n // Empty\r\n }", "private Config() {\n }", "public ConfigExample() {\n }", "public Config() {\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t}", "public interface ConfigService {\n\n\n /**\n * eureka配置\n *\n * @param sb\n * @param addr\n */\n void eureka(StringBuilder sb, String addr);\n\n /**\n * redis配置\n *\n * @param sb\n * @param addr\n */\n void redis(StringBuilder sb, String addr);\n\n\n /**\n * 数据源配置\n *\n * @param sb\n */\n void thymeleafAndDatasource(StringBuilder sb);\n\n\n /**\n * 关于mybatis的配置\n *\n * @param sb\n * @param packages\n */\n void mybatis(StringBuilder sb, String packages);\n\n\n /**\n * 分页插件配置\n *\n * @param sb\n */\n void pagehelper(StringBuilder sb);\n\n /**\n * 生成application.yml\n *\n * @param name\n */\n void application(String name);\n\n\n /**\n * 生成application-xxx.yml\n *\n * @param branch\n * @param packages\n */\n void applicationBranch(String branch, String packages);\n\n\n /**\n * log文件\n *\n */\n void logBack();\n}", "ServiceConfig getServiceConfig();", "ServiceConfig getServiceConfig();", "CdapServiceInstanceConfiguration createCdapServiceInstanceConfiguration();", "abstract public Config createConfig(String path);", "public void initialize(ServiceProviderConfig config) {\r\n\t\tsetConfiguration(config);\r\n\t}", "private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }", "public TestService(ServiceConfiguration config) {\n this.config = config;\n System.out.println(\"starting service...\");\n this.start();\n }", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Config getInstance()\n {\n if(sINSTANCE == null)\n {\n synchronized (Config.class)\n {\n if(sINSTANCE == null)\n {\n sINSTANCE = new Config();\n if( !sINSTANCE.isRemoteConfigLoaded() )\n {\n sINSTANCE.loadRemoteConfig();\n }\n }\n }\n }\n return sINSTANCE;\n }", "public static Service newInstance() {\n return newInstance(DEFAULT_PROVIDER_NAME);\n }", "public interface ConfigService {\n\n /**\n * Retrieve instance with application configuration.\n * Instance is cached and updated when new config is stored.\n *\n * @return may return {@code null} if there is no config yet.\n */\n AppConfig retrieveApplicationConfig();\n\n /**\n * Store config - only config will be overrode and lost.\n * Also update cached config.\n *\n * @param appConfig to store\n */\n void storeApplicationConfig(AppConfig appConfig);\n}", "public static Config getInstance() {\r\n\t\tif (instance == null) {\r\n\t\t\tGson gson = new Gson();\r\n\t\t\ttry {\r\n\t\t\t\tinstance = gson.fromJson(FileUtil.getResourceContent(\"config.data\"), Config.class);\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.err.println(ex.getMessage());\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn instance;\r\n\t}", "void init(Config config);", "public Config createConfig(String filename);", "public ServiceConstructorArguments(\n Class<? extends Service> implementation,\n Class<?> configClass,\n String configID,\n Object config\n ) {\n this(implementation, configClass, configID, config, null, null, null);\n }", "private ConfigProperties() {\n\n }", "public MecBasicsConfig()\n {\n\n }", "public static WPVService createInstance() {\n if ( CONFIG != null )\n return new WPVService( CONFIG );\n return null;\n }", "public CMSFormClientServices() {\n // Set up the configuration manager.\n config = new ConfigMgr(\"form.cfg\");\n }", "public ConfigsUtils() {\r\n mConfig = new Properties();\r\n try {\r\n mConfig.load(new FileInputStream(CONFIG_FILE_PATH));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public InitService() {\n super(\"InitService\");\n }", "private Config()\n {\n try\n {\n // Load settings from file\n load();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "private static StandardServiceRegistry configureServiceRegistry() {\n return new StandardServiceRegistryBuilder()\n .applySettings(getProperties())\n .build();\n }", "@Autowired\n\tpublic void setConfigService(ConfigService configService) {\n\t\tthis.configService = configService;\n\t}", "private void initConfigServices() {\n List<ServiceDTO> customizedConfigServices = getCustomizedConfigService();\n\n if (customizedConfigServices != null) {\n setConfigServices(customizedConfigServices);\n return;\n }\n\n // update from meta service\n this.tryUpdateConfigServices();\n this.schedulePeriodicRefresh();\n }", "public AntConfig(Config config) {\n\t\tthis.messageUtil = new MessageUtil(config.getColor());\n\t\tthis.service = config.getService();\n\t}", "private ServiceFactory() {}", "public Adsconfig() {\n this(\"AdsConfig\", null);\n }", "private ProjectConfigurationFactory()\n {}", "private ModuleServiceImpl(){\n\t\t//initialize local data.\n\t\tfactories = new ConcurrentHashMap<String, IModuleFactory>();\n\t\tstorages = new ConcurrentHashMap<String, IModuleStorage>();\n\t\tcache = new ConcurrentHashMap<String, Module>();\n\t\tmoduleListeners = new ConcurrentHashMap<String, IModuleListener>();\n\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\"Created new ModuleServiceImplementation\");\n\t\t}\n\n\t\tConfigurationManager.INSTANCE.configure(this);\n\t}", "public static SPSConfig createSPSConfig() {\n return new SPSConfig();\n }", "public static AvarioCoreConfig getInstance(Context context) {\n if (AvarioCoreConfig.instance == null) {\n AvarioCoreConfig.instance = new AvarioCoreConfig(context);\n }\n\n return AvarioCoreConfig.instance;\n }", "private ApiConfig() {\n }", "public static ServiceFactory init() {\n\t\ttry {\n\t\t\tServiceFactory theServiceFactory = (ServiceFactory)EPackage.Registry.INSTANCE.getEFactory(ServicePackage.eNS_URI);\n\t\t\tif (theServiceFactory != null) {\n\t\t\t\treturn theServiceFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new ServiceFactoryImpl();\n\t}", "private ServiceLocator(){}", "public Configuration() {\n\t\tpackages(\"apiservice.services\");\n\t\tregister(CORSFilter.class);\n\t\tregister(AuthenticationFilter.class);\n\t}", "private void GetConfig()\n {\n boolean useClassPath = false;\n if(configFile_ == null)\n {\n useClassPath = true;\n configFile_ = \"data.config.lvg\";\n }\n // read in configuration file\n if(conf_ == null)\n {\n conf_ = new Configuration(configFile_, useClassPath);\n }\n }", "@NonNull\n\t\tConfig build();", "public JerseyConfig() {\n\t\tregister(StudentService.class);\n\t\tregister(PromotionService.class);\n\t\tregister(GroupService.class);\n\t\tregister(RoleService.class);\n\t\tregister(RightService.class);\n\t\tregister(AccountService.class);\n\t\tregister(TimesheetService.class);\n\t\tthis.configureSwagger();\n\t}", "public Configuration(Config config){\n String error = fromConfig(config);\n if(errors){\n throw new RuntimeException(error);\n }\n }", "abstract public Core createCoreWithConfig(Config config, Object systemContext);", "public OServerConfiguration() {}", "void init (Map<String, String> conf) throws ConfigException;", "private ConfigHelper() {\n //does nothing\n }", "public ServiceConfig(ServiceConfig source) {\n if (source.Product != null) {\n this.Product = new String(source.Product);\n }\n if (source.UniqVpcId != null) {\n this.UniqVpcId = new String(source.UniqVpcId);\n }\n if (source.Url != null) {\n this.Url = new String(source.Url);\n }\n if (source.Path != null) {\n this.Path = new String(source.Path);\n }\n if (source.Method != null) {\n this.Method = new String(source.Method);\n }\n if (source.UpstreamId != null) {\n this.UpstreamId = new String(source.UpstreamId);\n }\n if (source.CosConfig != null) {\n this.CosConfig = new CosConfig(source.CosConfig);\n }\n }", "private ServiceConstructorArguments(\n Class<? extends Service> implementation,\n Class<?> configClass,\n String configID,\n Object config,\n String serviceID,\n Class<? extends Service> serviceClass,\n Service serviceInstance\n ) {\n this.implementation = implementation;\n this.configClass = configClass;\n this.configID = configID;\n this.config = config;\n this.serviceID = serviceID;\n this.serviceClass = serviceClass;\n this.serviceInstance = serviceInstance;\n }", "public FabricConfigurator() {\n\n }", "public ServiceFactoryImpl() {\n\t\tsuper();\n\t}", "abstract public Config createConfigWithFactory(String path, String factoryPath);", "protected static ServiceDescription createServiceConfig( Element elem, String webinfPath )\n throws XMLParsingException, IOException {\n Map<String, Service> services = createServices( XMLTools.getElement( elem, StringTools.concat( 100, \"./\",\n dotPrefix,\n \"Services\" ),\n cnxt ), webinfPath );\n List<Integer> testIntervals = createTestIntervals( XMLTools.getElement( elem,\n StringTools.concat( 100, \"./\",\n dotPrefix,\n \"TestInterval\" ),\n cnxt ) );\n\n return new ServiceDescription( testIntervals, services );\n }", "public KafkaConfig() { }", "private SparkeyServiceSingleton(){}", "public AuthenticationService()\n\t\t\tthrows StorageInitException, AuthConfigurationException {\n\t\tquietLogger();\n\t\tfinal AuthConfig c = new KBaseAuthConfig();\n\t\tlogger = c.getLogger();\n\t\ttry {\n\t\t\tbuildApp(c);\n\t\t} catch (StorageInitException e) {\n\t\t\tLoggerFactory.getLogger(getClass()).error(\n\t\t\t\t\t\"Failed to initialize storage engine: \" + e.getMessage(),\n\t\t\t\t\te);\n\t\t\tthrow e;\n\t\t} catch (AuthConfigurationException e) {\n\t\t\tLoggerFactory.getLogger(getClass()).error(\n\t\t\t\t\t\"Invalid configuration: \" + e.getMessage(), e);\n\t\t\tthrow e;\n\t\t}\n\t}", "@Override\n public void init() throws Exception {\n config = new Config();\n }", "public PanoramaConfig() {\n }", "void config(Config config);", "public StorageConfig() {\n }", "public InitService(String name) {\n super(\"InitService\");\n }", "public Service(){\n\t\t\n\t}", "private OspfConfigUtil() {\n\n }", "private AuthService() {\n configureAccessTokens();\n configure();\n ConfigurationWatcher.registerListener(this, JOSSO_GATEWAY_CONFIGURATION.getAbsolutePath());\n ConfigurationWatcher.registerListener(this, FOUNDATION_CONFIGURATION.getAbsolutePath());\n log.debug(\"AuthService listening for changes to \" + JOSSO_GATEWAY_CONFIGURATION + \" and \" + FOUNDATION_CONFIGURATION);\n }", "protected Configuration() {\r\n }", "private OptimoveConfig() {\n }", "Factory getFactory()\n {\n return configfile.factory;\n }", "public ConfigParserHandler() {\n\t}", "ConfigModel createInstanceOfConfigModel();", "Fog_Services createFog_Services();", "public RiftsawServiceLocator() {\n }", "public static WPVService getInstance( WPVSConfiguration config ) {\n return new WPVService( config );\n }", "@Override\n\t\tpublic void init(final DaemonContext daemonContext) throws Exception {\n\t\t\tloadConfigFile(null);\n\t\t\t// create service options from configuration\n\t\t\tfinal VertxOptions vertxOptions = createVertxOptions(clustered);\t\t\n\t\t\tfinal DeploymentOptions deploymentOptions = createDeploymentOptions();\n\t\t\t// configure and start the service manager\n\t\t\tserviceManager = new ServiceManager(newHashSet(new VertxService(newArrayList(), vertxOptions, deploymentOptions, new SingleNodeLoadBalancer())));\t\t\n\t\t\tsuper.init(daemonContext);\n\t\t}", "public abstract CONFIG build();", "public Slf4jLogService() {\n this(System.getProperties());\n }", "public interface ConfigService {\n\n ConfigDto getImplementationConfig();\n\n}", "public static Config config() {\n return LiveEventBusCore.get().config();\n }", "Service newService();", "private ConfigReader() {\r\n\t\tsuper();\r\n\t}", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public AbstractRepositoryImplConfig() {\n\t}", "public interface ConfigurationService {\n /**\n * Get configuration by key\n *\n * @param configKey\n * @return\n */\n Configuration getConfigByKey(String configKey);\n}", "public static Configuration getInstance() {\r\n if (INSTANCE == null)\r\n INSTANCE = new Configuration();\r\n else\r\n INSTANCE.loadConfigurationFromDisk();\r\n\r\n return INSTANCE;\r\n }", "public static AppConfigLoader getInstance() {\r\n\t\tif (_myInstance == null) {\r\n\t\t\t_myInstance = new AppConfigLoader();\r\n\t\t}\r\n\t\treturn _myInstance;\r\n\t}", "public ProfileService() {\n\t\tthis(DEFAULT_ENDPOINT_NAME, DEFAULT_CACHE_SIZE);\n\t}", "public ManagedConfiguration createConfiguration() throws SmartFrogException, RemoteException {\n return ManagedConfiguration.createConfiguration(this, true, isClusterRequired(), false);\n }", "public static <S> S createService(Context context, Class<S> serviceClass) {\n return ApiClient.getClient(RemoteConfiguration.BASE_URL).create(serviceClass);\n }", "void construct() throws FndException\n {\n if (DEBUG) debug(\"ASPConfig.construct()\");\n String cfgdir = getASPManager().getASPConfigFileDir();\n\n synchronized(getClass())\n {\n configfile = ASPConfigFile.getDir(cfgdir);\n if( !configfile.initialized ) configfile.construct(getASPPage());\n }\n parameters = (Hashtable)configfile.params.clone();\n srv_fmt = (ServerFormatter)configfile.srv_fmt.clone();\n }", "protected abstract void _init(DynMap config);", "public void initialize(String id, ConfigMap configMap) {}", "public ProfileService() {\n \t\tthis(DEFAULT_ENDPOINT_NAME, DEFAULT_CACHE_SIZE);\n \t\tinitializeCache(DEFAULT_CACHE_SIZE);\n \t}", "public synchronized static void load()\n throws Exception\n { \n if (!isBootstrap) {\n String basedir = System.getProperty(JVM_OPT_BOOTSTRAP);\n if (load(basedir, false) == null) {\n throw new ConfiguratorException(\n \"configurator.cannot.bootstrap\");\n }\n SystemProperties.initializeProperties(\"com.iplanet.am.naming.url\",\n SystemProperties.getServerInstanceName() + \"/namingservice\");\n }\n }", "public abstract ServiceLocator create(String name);", "CustomerServiceProviderConfiguration getConfiguration(String serviceProviderId);", "public static synchronized void init() {\n String registryClassName = System.getProperty(REGISTRY_CLASS_NAME,\n DefaultServiceRegistry.class.getName());\n String endpointProviderClassName = System.getProperty(ENDPOINT_PROVIDER_CLASS_NAME,\n DefaultEndpointProvider.class.getName());\n\n try {\n registry = getRegistry(registryClassName);\n endpointProvider = getEndpointProvider(endpointProviderClassName);\n transformers = new BaseTransformerRegistry();\n } catch (NullPointerException npe) {\n throw new RuntimeException(npe);\n }\n }" ]
[ "0.65935326", "0.6531135", "0.6429633", "0.6329788", "0.6248292", "0.6174046", "0.6154654", "0.6151816", "0.6151816", "0.60678136", "0.6038498", "0.60374737", "0.60240227", "0.6008803", "0.5984282", "0.5984282", "0.59826547", "0.59784466", "0.59599763", "0.5901279", "0.5898643", "0.5894475", "0.58883965", "0.58817905", "0.5879466", "0.58783996", "0.5858078", "0.5833555", "0.5826365", "0.5757521", "0.57435346", "0.5723056", "0.5699046", "0.56796396", "0.56724364", "0.56623137", "0.56527364", "0.5639936", "0.56393635", "0.5634587", "0.56244856", "0.5616638", "0.5609327", "0.5603382", "0.5580827", "0.5577177", "0.55750614", "0.5568116", "0.5567897", "0.5565834", "0.55638623", "0.5560683", "0.5560093", "0.5553936", "0.554584", "0.55361295", "0.550866", "0.55005985", "0.5500022", "0.5491577", "0.54908454", "0.5489017", "0.54654765", "0.54650944", "0.5464814", "0.5449376", "0.5448474", "0.54473007", "0.5443237", "0.5439111", "0.54311925", "0.5422321", "0.54216653", "0.5414515", "0.54093564", "0.5407675", "0.5406989", "0.538386", "0.5368031", "0.5365212", "0.5361947", "0.5349039", "0.53374887", "0.5327601", "0.5323483", "0.53216517", "0.53171885", "0.53161675", "0.53109", "0.53091395", "0.53064907", "0.530552", "0.53014976", "0.52970546", "0.5296206", "0.5288377", "0.5285956", "0.5282156", "0.5280811", "0.5276769" ]
0.5653752
36
TODO Autogenerated method stub
@Override public void run() { super.run(); try { join.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "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
Generates/calculates firebasefashion unique messagethreadID by appending lexicographically bigger uid to the smaller uid. It represents one_to_one unique relationship and can be used to store unique Data object into firebase facilitating its retrieval by enforcing consistent protocol
public static String calculateMessageThreadID(String uid1, String uid2) { // TODO again no need for second id , this is always calculated for currently logged in user of application - me // compare user ids lexicographically , we always want smaller uid at start if (uid1.compareTo(uid2) < 0) { // should be equivalent to uid1 < uid2 return uid1 + uid2; } else { return uid2 + uid1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getToUid();", "public int genID() {\n int uid = this.hashCode();\n if (uid < 0) {\n uid = Math.abs(uid);\n uid = uid * 15551;\n }\n return uid;\n }", "long getUid();", "long getUid();", "@Override\n\tpublic native final String createUniqueId() /*-{\n // In order to force uid's to be document-unique across multiple modules,\n // we hang a counter from the document.\n if (!this.gwt_uid) {\n this.gwt_uid = 1;\n }\n\n return \"gwt-uid-\" + this.gwt_uid++;\n\t}-*/;", "public int generateId() {\n if (allMessage.size() ==0) {\n return 1000;\n }\n return allMessage.get(allMessage.size() - 1).getId() + 1;\n }", "protected int generateUniqueId() {\n\t\tint id = super.getUniqueId();\n\t\tsuper.setUniqueId(getUniqueId() + 1);\n\t\treturn id;\n\t}", "java.lang.String getToUid();", "private String creatUniqueID(){\n long ID = System.currentTimeMillis();\n return Long.toString(ID).substring(9,13);\n }", "long getUID() throws UidGenerateException;", "public int generateUniqueID(){\n\n int uniqueID = 100; \n int maxID =getMaxId() ;\n \n uniqueID = uniqueID + maxID;\n\n return uniqueID;\n }", "@Override\n\tpublic UUID getUniqueId() {\n\t\treturn uid;\n\t}", "public long getToUid() {\n return toUid_;\n }", "public static int generateUniqueId(){\r\n String returnme = GregorianCalendar.getInstance().getTimeInMillis() + \"\";\r\n return Integer.parseInt(returnme.substring(returnme.length() - 9, returnme.length()));\r\n }", "UUID getUniqueId();", "int getUid();", "int getUid();", "java.lang.String getUid();", "java.lang.String getUid();", "public String gerarUID() {\n //String id1 = UUID.randomUUID().toString().replace(\"-\", \"\");\n String id1 = UUID.randomUUID().toString();\n return id1;\n }", "public int generateUID() {\n if(mdb == null) {\n return -1;\n }\n TreeSet<Integer> sortedSet = new TreeSet<Integer>();\n Set<String> players = mdb.getKeys(false);\n for (String player : players) {\n List<Integer> messageids = mdb.getIntegerList(player + \".messageids\");\n if (messageids != null) {\n // add all messageids found for this player to our ordered set\n sortedSet.addAll(messageids);\n }\n }\n // make sure we don't enter negative number territory\n for(int i=Courier.MIN_ID; i<Courier.MAX_ID; i++) {\n if(sortedSet.add(i)) {\n // i wasn't in the set\n return i;\n }\n }\n return -1;\n }", "public long getToUid() {\n return toUid_;\n }", "private Long createId() {\n return System.currentTimeMillis() % 1000;\n }", "String getUniqueId();", "public static String combinedUniqueId() {\n\t\t// generate combined unique id using device id, pseudo unique id and\n\t\t// android id\n\t\tString _combinedUniqueId = deviceId() + pseudoUniqueId() + androidId();\n\n\t\tLog.d(LOG_TAG, \"The combined unique id = \" + _combinedUniqueId);\n\n\t\treturn StringUtils.md5(_combinedUniqueId);\n\t}", "String createUniqueID(String n){\n String uniqueID =UUID.randomUUID().toString();\n return n + uniqueID;\n }", "private String generateUID()\n {\n String uid;\n int nbAccounts = this.getNumberOfAccounts();\n String host = this.registration.getHost();\n int nbAccountsForHost = this.getNbAccountForHost(host);\n \n if (nbAccounts == 0 || (this.isModification() && nbAccounts == 1) ||\n nbAccountsForHost == 0 || (this.isModification() && nbAccountsForHost == 1))\n {\n // We create the first account or we edit the onlyone\n // Or we create the first account for this server or edit the onlyone\n uid = host;\n }\n else\n {\n uid = host + \":\" + this.registration.getPort();\n }\n \n return uid;\n }", "private Integer getUniqueId(Object object) {\n/* 89 */ Integer id = this.idCache.get(object);\n/* 90 */ if (id == null) {\n/* 91 */ id = Integer.valueOf(this.uidGenerator.incrementAndGet());\n/* 92 */ Integer existing = this.idCache.putIfAbsent(object, id);\n/* 93 */ if (existing != null) {\n/* 94 */ return existing;\n/* */ }\n/* */ } \n/* 97 */ return id;\n/* */ }", "long getUID();", "String getUid();", "String generateUID();", "private String getNewConversationId( )\r\n {\r\n return UUID.randomUUID( ).toString( );\r\n }", "public String getUniqueID(Context ctx)\n {\n String m_szDevIDShort = \"\";\n String m_szAndroidID = \"\";\n String m_szWLANMAC = \"\";\n\n try {\n m_szDevIDShort = \"35\" + // we make this look like a valid IMEI\n Build.BOARD.length() % 10 + Build.BRAND.length() % 10 +\n Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 +\n Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 +\n Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 +\n Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 +\n Build.TAGS.length() % 10 + Build.TYPE.length() % 10 +\n Build.USER.length() % 10;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n m_szAndroidID = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n WifiManager wm = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);\n m_szWLANMAC = wm.getConnectionInfo().getMacAddress();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n String m_szLongID = m_szWLANMAC + m_szDevIDShort + m_szAndroidID;\n\n MessageDigest m = null;\n try {\n m = MessageDigest.getInstance(\"MD5\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n m.update(m_szLongID.getBytes(), 0, m_szLongID.length());\n byte p_md5Data[] = m.digest();\n\n //noinspection RedundantStringConstructorCall\n String m_szUniqueID = new String();\n for (int i = 0; i < p_md5Data.length; i++) {\n int b = (0xFF & p_md5Data[i]);\n // if it is a single digit, make sure it have 0 in front (proper\n // padding)\n if (b <= 0xF)\n m_szUniqueID += \"0\";\n // add number to string\n m_szUniqueID += Integer.toHexString(b);\n }\n\n return m_szUniqueID;\n }", "public java.lang.String getToUid() {\n java.lang.Object ref = toUid_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n toUid_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "protected String generateUserID() {\n Random r = new Random();\n String userID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n userID = String.valueOf(randomIDnum);\n } while (this.userMap.containsKey(userID));\n return userID;\n }", "private String generateUniqueIdString() {\r\n return TimeBasedUUID.getUUIDAsString();\r\n }", "public Long getUid() {\n\t\treturn null;\n\t}", "public long getUserID() {\n //userID++;\n return userID++;\n }", "private void addMessageId(long value) {\n ensureMessageIdIsMutable();\n messageId_.addLong(value);\n }", "public String getUniqueId() {\n\t\treturn m_serverName + \" - \" + m_userId + \" - \" + m_timestampMillisecs;\n\t}", "public java.lang.String getToUid() {\n java.lang.Object ref = toUid_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n toUid_ = s;\n }\n return s;\n }\n }", "public String getUid() {\n Object ref = uid_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n uid_ = s;\n return s;\n }\n }", "private String getNextQueueIdentifier() {\n String qid = PropertyUtils.genGUID(25);\n updateCachedCounts();\n return qid;\n }", "private int generateNewId() {\n int size = userListCtrl.getUsers().size();\n \n if (size == 0) {\n return 1;\n } else {\n return userListCtrl.getUsers().get(size-1).getUserID()+1;\n }\n }", "public long threadId();", "private long generateID() {\n\t\treturn ++lastID;\n\t}", "public int getUID() {\n return 0;\n }", "private synchronized int generateUserID(){\r\n\t\tint i;\r\n\t\tfor(i = 1; users.containsKey(i);i++);\r\n\t\treturn i;\r\n\t}", "public void generateID()\n {\n ID = this.hashCode();\n }", "public String getUid() {\n Object ref = uid_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n uid_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "static String generateId() {\r\n\t\treturn UUID.randomUUID().toString().replaceAll(\"-\", \"\");\r\n\t}", "public int getUniqueId() {\r\n\t\treturn uniqueId;\r\n\t}", "public long getUid() {\n return uid_;\n }", "public int getUid() {\n return uid_;\n }", "public int getUid() {\n return uid_;\n }", "public String getUniqueID ( ) { return _uniqueID; }", "private static String pseudoUniqueId() {\n\t\t// decimal\n\t\tfinal Integer DECIMAL = 10;\n\n\t\t// return the android device some common info(board, brand, CPU type +\n\t\t// ABI convention, device, display, host, id, manufacturer, model,\n\t\t// product, tags, type and user) combined string\n\t\treturn new StringBuilder().append(Build.BOARD.length() % DECIMAL)\n\t\t\t\t.append(Build.BRAND.length() % DECIMAL)\n\t\t\t\t.append(Build.CPU_ABI.length() % DECIMAL)\n\t\t\t\t.append(Build.DEVICE.length() % DECIMAL)\n\t\t\t\t.append(Build.DISPLAY.length() % DECIMAL)\n\t\t\t\t.append(Build.HOST.length() % DECIMAL)\n\t\t\t\t.append(Build.ID.length() % DECIMAL)\n\t\t\t\t.append(Build.MANUFACTURER.length() % DECIMAL)\n\t\t\t\t.append(Build.MODEL.length() % DECIMAL)\n\t\t\t\t.append(Build.PRODUCT.length() % DECIMAL)\n\t\t\t\t.append(Build.TAGS.length() % DECIMAL)\n\t\t\t\t.append(Build.TYPE.length() % DECIMAL)\n\t\t\t\t.append(Build.USER.length() % DECIMAL).toString();\n\t}", "private synchronized int generateJobID() {\n\t\t/* generate JobID */\n\t\tint jobID = lastJobID;\n\t\tlastJobID += 1;\n\t\treturn jobID;\n\t}", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public int getUid() {\n return uid;\n }", "public static String uniqueId() {\r\n return UUID.randomUUID().toString();\r\n }", "@Override\n public long getUid() {\n return uid;\n }", "protected int getUniqueID() {\n\t\treturn uniqueID;\n\t}", "String uniqueId();", "private static String getUniqueId()\n\t{\n\t\tfinal int limit = 100000000;\n\t\tint current;\n\t\tsynchronized (DiskFileItem.class)\n\t\t{\n\t\t\tcurrent = counter.nextInt();\n\t\t}\n\t\tString id = Integer.toString(current);\n\n\t\t// If you manage to get more than 100 million of ids, you'll\n\t\t// start getting ids longer than 8 characters.\n\t\tif (current < limit)\n\t\t{\n\t\t\tid = (\"00000000\" + id).substring(id.length());\n\t\t}\n\t\treturn id;\n\t}", "public int getUid() {\n return uid;\n }", "public static String generateNewUserId() {\r\n\t\tDate date = new Date();\r\n\t\treturn String.format(\"%s-%s\", UUID.randomUUID().toString(),\r\n\t\t\t\tString.valueOf(date.getTime()));\r\n\t}", "public int getUid() {\n return uid_;\n }", "public int getUid() {\n return uid_;\n }", "com.google.protobuf.ByteString getUidBytes();", "int nextMessageID()\n {\n int msgID = nextMessageID.incrementAndGet();\n if (msgID > 0)\n {\n return msgID;\n }\n\n while (true)\n {\n if (nextMessageID.compareAndSet(msgID, 1))\n {\n return 1;\n }\n\n msgID = nextMessageID.incrementAndGet();\n if (msgID > 0)\n {\n return msgID;\n }\n }\n }", "public int getUid() {\n return uid;\n }", "public long getUid() {\n return uid_;\n }", "public static String uniqueId() {\n return UUID.randomUUID().toString();\n }", "public UUID createMsgId() {\r\n return UUIDFactory.newSeqUUID();\r\n }", "public static String generate() {\n return StringUtil.join(\n '.',\n PROCESS_ID,\n String.valueOf(Thread.currentThread().getId()),\n String.valueOf(THREAD_ID_SEQUENCE.get().nextSeq())\n );\n }", "public String getUniqueID();", "public int getUniqueID() { \n return -1;\n }", "@Override\n public String getIdentityId() {\n\n // Load the identityId from the cache\n// identityId = cachedIdentityId;\n\n if (identityId == null) {\n // Call to your backend\n identityId = mFirebaseRef.getAuth().getUid();\n }\n return identityId;\n }", "public String getUniqueId() {\n return _uniqueId;\n }", "private String getRandomUniqueId() {\r\n return \"WEBSOCKET.\" + new Random().nextInt(100);\r\n }", "String getUniqueID();", "public String getUid() { return null; }", "int getUid() {\n return uid;\n }", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public Long getUid() {\r\n return uid;\r\n }", "public Long getUid() {\n\t\treturn uid;\n\t}", "public Integer getCreateUid() {\n return createUid;\n }", "public Integer getCreateUid() {\n return createUid;\n }", "public Integer getCreateUid() {\n return createUid;\n }", "public Integer getCreateUid() {\n return createUid;\n }", "public Integer getCreateUid() {\n return createUid;\n }", "private byte[] uniqueMessageID(Random rand){\n \tbyte[] messageID = new byte[Constants.MESSAGE_ID_LEN];\n \t\n synchronized (this.messageIDs) {\n boolean uniqueID = false;\n while (!uniqueID) {\n rand.nextBytes(messageID); //Fills messageID with random bytes\n uniqueID = true;\n for (byte[] i : messageIDs){\n if (Arrays.equals(i, messageID)) {\n Log.d(TAG, \"Message already recieved, ID starts with: \" //Message exists in messageIDs\n + messageID[0]);\n uniqueID = false;\n break; //Regenerates a random ID and tries again.\n }\n }\n }\n }\n \n return messageID;\n }" ]
[ "0.62189597", "0.6055563", "0.60514736", "0.60514736", "0.6026451", "0.5999047", "0.5826949", "0.58262956", "0.582424", "0.5802511", "0.5797746", "0.579699", "0.5789358", "0.57813585", "0.5717971", "0.57179475", "0.57179475", "0.5715978", "0.5715978", "0.57131726", "0.5707318", "0.57020676", "0.5691138", "0.5667189", "0.56531405", "0.56438446", "0.5640894", "0.5607482", "0.55899525", "0.55806774", "0.55800664", "0.55764174", "0.55739677", "0.5559235", "0.55541015", "0.5549961", "0.55385596", "0.55279154", "0.5522174", "0.5512842", "0.5511473", "0.5496536", "0.5488483", "0.54855055", "0.54647446", "0.5460997", "0.5459974", "0.54431444", "0.5424197", "0.5417289", "0.54058534", "0.5397186", "0.5388716", "0.5386059", "0.5386059", "0.53825265", "0.53819394", "0.53806883", "0.5370145", "0.5370145", "0.5370145", "0.5370145", "0.5370145", "0.5370145", "0.5370145", "0.5361382", "0.53591007", "0.5357963", "0.53470874", "0.53406227", "0.53344417", "0.5333669", "0.53272235", "0.53272235", "0.5320072", "0.5317675", "0.5313695", "0.53073007", "0.53020966", "0.52975655", "0.5279817", "0.5279137", "0.5278117", "0.5264728", "0.52532256", "0.52466345", "0.5245302", "0.52414936", "0.5235392", "0.5230652", "0.5230652", "0.5230652", "0.52275795", "0.521909", "0.52177274", "0.52177274", "0.52177274", "0.52177274", "0.52177274", "0.5215958" ]
0.6482643
0
"ddMMyyyy kk:mm:ss" format or any other provided combination, calculated from timestamp
public static String calcDateStringFromTimestamp(String s, long timestamp) { Calendar cal = Calendar.getInstance(Locale.ENGLISH); cal.setTimeInMillis(timestamp); String date = DateFormat.format(s, cal).toString(); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "private String syncTimeStamp(String timestamp){\r\n StringBuilder dateBuilder = new StringBuilder(timestamp);\r\n String time = dateBuilder.toString().split(\"T\")[1].substring(0, 8);\r\n String[] timeArr = time.split(\":\");\r\n String seconds = timeArr[2];\r\n String dd = dateBuilder.toString().split(\"T\")[0].split(\"-\")[2];\r\n String mm = dateBuilder.toString().split(\"T\")[0].split(\"-\")[1];\r\n String yyyy = dateBuilder.toString().split(\"T\")[0].split(\"-\")[0];\r\n int hour = Integer.parseInt(timeArr[0]);\r\n int minutes = Integer.parseInt(timeArr[1]);\r\n minutes += 30;\r\n hour+=5;\r\n if (minutes>=60){\r\n hour += 1;\r\n minutes -= 60;\r\n }\r\n if (hour >= 24){\r\n hour -= 24;\r\n dd = Integer.toString(Integer.parseInt(dd) + 1);\r\n if (Integer.parseInt(dd) < 10)\r\n dd = \"0\" + dd;\r\n }\r\n String minutesString;\r\n if (minutes < 10)\r\n minutesString = \"0\" + Integer.toString(minutes);\r\n else\r\n minutesString = Integer.toString(minutes);\r\n\r\n String hoursString;\r\n if (hour < 10)\r\n hoursString = \"0\" + Integer.toString(hour);\r\n else\r\n hoursString = Integer.toString(hour);\r\n String finalTime = hoursString + \":\" + minutesString + \":\" + seconds;\r\n String finalDate = dd + \"-\" + mm + \"-\" + yyyy;\r\n\r\n return (finalDate + \" \" + finalTime);\r\n }", "public static String timestampTilStrengForKalender(Timestamp timestamp) {\r\n\t\tString dato = timestamp.toString();\r\n\t\tif (dato == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tString[] datoOgKlokke = dato.split(\" \");\r\n\t\tString[] fiksdatoen = datoOgKlokke[0].split(\"-\");\r\n\t\tString str = String.join(\"-\", fiksdatoen);\r\n\t\tString finalDato = str + \"T\" + datoOgKlokke[1];\r\n\t\treturn finalDato.substring(0, 16) + \":00\";\r\n\t}", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public static String formattedDate(long timestamp) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(timestamp*1000);\n DateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy HH:mm:ss\");\n return dateFormat.format(cal.getTime());\n\n }", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "public static String getTimeStamp(String pattern){\n Timestamp timestamp = new Timestamp(System.currentTimeMillis());\n SimpleDateFormat sdf = new SimpleDateFormat(pattern);\n return String.valueOf(sdf.format(timestamp));\n\n }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public static String getFormattedTime(long timestamp){\n\t\tif(timestamp != -1){\t\t\t\n\t\t\tDate date = new Date(timestamp); // *1000 is to convert seconds to milliseconds\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd.MM.YYYY - HH:mm:ss\"); // the format of your date\n\t\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // give a timezone reference for formating (see comment at the bottom\n\t\t\tString formattedDate = sdf.format(date);\n\t\t\treturn formattedDate;\n\t\t} \n\t\treturn \"no date available\";\n\t}", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "private String m36904a(long timeStamp) {\n if (timeStamp == -1) {\n return null;\n }\n return new SimpleDateFormat(\"M/d/yy hh:mm:ss a z\", Locale.US).format(new Date(timeStamp));\n }", "public static String formatDate(java.sql.Timestamp timestamp) {\n if (timestamp == null)\n return \"\";\n DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.FULL);\n java.util.Date date = timestamp;\n return df.format(date);\n }", "String getTimestamp();", "String getTimestamp();", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "String getTimestampFunction();", "java.lang.String getTimestamp();", "java.lang.String getTimestamp();", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public static String formatDate(String format, long timestamp) {\n return DateFormat.format(format, new Date(timestamp)).toString();\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "static public String getTimeStamp(long timestamp) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy.MM.dd-HH:mm:ss\", Locale.US);\n return sdf.format(new Date(timestamp));\n }", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "public static String getAppropriateFormat(long timestamp) {\n String str = \"\";\n long now = System.currentTimeMillis();\n str = \"\" + DateUtils.getRelativeTimeSpanString(timestamp, now, 0);\n return str;\n }", "public void testFormatDateStringFromTimestamp_other() {\n calendar.set(\n /* year = */ 1991,\n /* month = */ Calendar.MONTH,\n /* day = */ 11);\n assertEquals(\"March 11\",\n ContactInteractionUtil.formatDateStringFromTimestamp(calendar.getTimeInMillis(),\n getContext()));\n }", "public static String formatDateForDetails(Timestamp date) {\n SimpleDateFormat format = new SimpleDateFormat(\"dd MMM yyyy | hh:mm aaa\", Locale.getDefault());\n return format.format(new Date(date.getTime()));\n }", "private static Timestamp parseWithDefaultPattern(String ts){\n\n final int[] comps = new int[7];\n\n /*\n * The component that is currently being parsed, starting with 0\n * for the year, and up to 6 for the fractional seconds\n */\n int comp = 0;\n\n int val = 0;\n int ndigits = 0;\n\n int len = ts.length();\n boolean isBC = (ts.charAt(0) == '-');\n\n for (int i = (isBC ? 1 : 0); i < len; ++i) {\n\n char ch = ts.charAt(i);\n\n if (comp < 6) {\n\n switch (ch) {\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n val = val * 10 + (ch - '0');\n ++ndigits;\n break;\n default:\n if (ch == compSeparators[comp]) {\n checkAndSetValue(comps, comp, val, ndigits, ts);\n ++comp;\n val = 0;\n ndigits = 0;\n\n } else {\n raiseParseError(\n ts, \"invalid character '\" + ch +\n \"' while parsing component \" + compNames[comp]);\n }\n }\n } else {\n assert(comp == 6);\n\n switch (ch) {\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n val = val * 10 + (ch - '0');\n ndigits++;\n break;\n default:\n raiseParseError(\n ts, \"invalid character '\" + ch +\n \"' while parsing component \" + compNames[comp]);\n }\n }\n }\n\n /* Set the last component */\n checkAndSetValue(comps, comp, val, ndigits, ts);\n\n if (comp < 2) {\n raiseParseError(\n ts, \"the timestamp string must have at least the 3 \" +\n \"date components\");\n }\n\n if (comp == 6 && comps[6] > 0) {\n\n if (ndigits > MAX_PRECISION) {\n raiseParseError(\n ts, \"the fractional-seconds part contains more than \" +\n MAX_PRECISION + \" digits\");\n } else if (ndigits < MAX_PRECISION) {\n /* Nanosecond *= 10 ^ (MAX_PRECISION - s.length()) */\n comps[6] *= (int)Math.pow(10, MAX_PRECISION - ndigits);\n }\n }\n\n if (isBC) {\n comps[0] = -comps[0];\n }\n\n return createTimestamp(comps);\n }", "public static String longToYYYYMMDDHHMM(long longTime)\r\n/* 157: */ {\r\n/* 158:232 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\r\n/* 159:233 */ Date strtodate = new Date(longTime);\r\n/* 160:234 */ return formatter.format(strtodate);\r\n/* 161: */ }", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "public void testFormatDateStringFromTimestamp_todayDoubleMinutePm() {\n calendar.set(Calendar.HOUR_OF_DAY, 22);\n calendar.set(Calendar.MINUTE, 18);\n assertEquals(\"10:18 PM\",\n ContactInteractionUtil.formatDateStringFromTimestamp(calendar.getTimeInMillis(),\n getContext()));\n }", "public static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "private static DateFormat getTimestampFormat(ConfigurationObject config) {\r\n // Get timestamp format to be used in the email\r\n String timestampFormatStr = Helper.getPropertyValue(config, TIMESTAMP_FORMAT_KEY, false, false);\r\n\r\n try {\r\n return new SimpleDateFormat((timestampFormatStr == null) ? DEFAULT_TIME_FORMAT : timestampFormatStr);\r\n } catch (IllegalArgumentException e) {\r\n throw new LateDeliverablesTrackerConfigurationException(\"Invaid timestamp format value.\", e);\r\n }\r\n }", "public static Timestamp formaterDatoTilStamp(String dato, String klokkeslett) throws ParseException {\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd.MM.yyyy HH:mm\");\r\n\t\tjava.util.Date startDato = df.parse(dato + \" \" + klokkeslett);\r\n\t\tjava.sql.Timestamp sq = new java.sql.Timestamp(startDato.getTime());\r\n\t\treturn sq;\r\n\t}", "public static String convertTimestampToReadable(long timestamp) {\n java.text.DateFormat formatter = new SimpleDateFormat(\"dd.MM.yy HH:mm\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String dateFormatted = formatter.format(timestamp);\n\n return dateFormatted;\n }", "@SuppressWarnings(\"deprecation\")\r\n\tpublic String format(Date date,boolean time){\n\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyyMMdd\");\r\n\tString timestamp=dateFormat.format(date)+\"T\";\r\n\tif(time){\r\n\t\tdateFormat = new SimpleDateFormat(\"HH:mm:ssZ\");\r\n\t\ttimestamp+=dateFormat.format(date);\r\n\t}\r\n else{\r\n \tdate.setHours(12);\r\n \tdate.setMinutes(0);\r\n \tdate.setSeconds(0);\r\n \tdateFormat = new SimpleDateFormat(\"HH:mm:ss\");\r\n \ttimestamp+=dateFormat.format(date);\r\n \ttimestamp+=\"+0000\";\r\n }\r\n\treturn timestamp;\r\n }", "public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "private static String zuluFormat(String beginTimestamp) {\n\t\tStringBuffer buf = new StringBuffer(beginTimestamp);\n\t\tbuf.insert(4, '-');\n\t\tbuf.insert(7, '-');\n\t\tbuf.insert(10, 'T');\n\t\tbuf.insert(13, ':');\n\t\tbuf.insert(16, ':');\n\t\tbuf.append('Z');\n\t\treturn buf.toString();\n\t}", "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "static String formatString(Timestamp value) {\n return formatString(value, null, true, true, 0);\n }", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static String m34537a(long j) {\n Formatter format;\n if (j <= 0 || j >= LogBuilder.MAX_INTERVAL) {\n return \"00:00\";\n }\n long j2 = j / 1000;\n int i = (int) (j2 % 60);\n int i2 = (int) ((j2 / 60) % 60);\n int i3 = (int) (j2 / 3600);\n Formatter formatter = new Formatter(new StringBuilder(), Locale.getDefault());\n if (i3 > 0) {\n format = formatter.format(\"%d:%02d:%02d\", Integer.valueOf(i3), Integer.valueOf(i2), Integer.valueOf(i));\n } else {\n format = formatter.format(\"%02d:%02d\", Integer.valueOf(i2), Integer.valueOf(i));\n }\n return format.toString();\n }", "void fromUnixtime(HplsqlParser.Expr_func_paramsContext ctx) {\n int cnt = getParamCount(ctx);\n if (cnt == 0) {\n evalNull();\n return;\n }\n long epoch = evalPop(ctx.func_param(0).expr()).longValue();\n String format = \"yyyy-MM-dd HH:mm:ss\";\n if (cnt > 1) {\n format = evalPop(ctx.func_param(1).expr()).toString();\n }\n evalString(new SimpleDateFormat(format).format(new Date(epoch * 1000)));\n }", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "public String getSQLTimestampFormat();", "public Timestamp changeDateFormat(String inputDate) {\n String input = inputDate;\n\n String INPUT_FORMAT = \"yyyy-MM-dd\";\n String OUTPUT_FORMAT = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\n DateFormat inputFormatter = new SimpleDateFormat(INPUT_FORMAT);\n DateFormat outputFormatter = new SimpleDateFormat(OUTPUT_FORMAT);\n\n java.util.Date date = null;\n String output = null;\n Timestamp ts = null;\n try {\n date = inputFormatter.parse(input);\n\n output = outputFormatter.format(date);\n\n ts = Timestamp.valueOf(output);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ts;\n }", "public static String getTimestamp() {\r\n\t\t\r\n\t\treturn new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t}", "Long timestamp();", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "private static String dateFormatLocal(Long timestamp) {\n DateFormat df = dateFormatLocal.get(); \n if (timestamp == null) {\n timestamp = System.currentTimeMillis();\n }\n \n return df.format(new Date(timestamp));\n }", "private String formatDateForVSS(Date d) {\n SimpleDateFormat sdf = new SimpleDateFormat(this.dateFormat + \";hh:mma\");\n \t\tString vssFormattedDate = sdf.format(d);\n \t\treturn vssFormattedDate.substring(0, vssFormattedDate.length() - 1);\n \t}", "private String unixToHHMMSS(String unixTime){\r\n\t\tlong unixSeconds = Long.parseLong(unixTime);\r\n\t\tDate date = new Date(unixSeconds*1000L); // convert seconds to milliseconds\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss\"); // date format\r\n\r\n\t\tString formattedDate = sdf.format(date);\r\n\t\treturn formattedDate;\r\n\t}", "public static Date formaterStampTilDato(Timestamp timestamp) {\r\n\t\tDate date = new Date(timestamp.getTime());\r\n\t\treturn date;\r\n\t}", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static String date(Long time, Context context){\n\t\t\n //FORMAT TIME\n\t\tString res = \"\";\n Long tsLong = System.currentTimeMillis()/1000;\t\n \tlong dv = Long.valueOf(time)*1000;// its need to be in milisecond\n \tDate df = new java.util.Date(dv);\n \t//LESS THAN 24\n \tif((tsLong-time)<86400){\n \t\tDateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(context);\n \t\tres = timeFormat.format(df);\n \t}else{\n \t\tDateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(context);\n \t\tres = dateFormat.format(df);\n \t}\t\n \tif(time.equals(0l)){\n \t\t\n \t\tres = context.getResources().getString(R.string.never);\n \t}\n \treturn res;\n\t}", "public static String generateTimeStamp(String format)\n\t{\n\t\tif (Utils.isEmpty(format)) format = \"yyyy/MM/dd HH:mm:ss\";\n\n\t\tDateFormat dateFormat = new SimpleDateFormat(format);\n\t\tDate date = new Date();\n\t\treturn dateFormat.format(date);\n\t}", "protected Timestamp getDate (String value, UnmarshalContext context) {\n\t\tSimpleDateFormat sdf = context.getDateFormat ();\n\t\tTimestamp result = null;\n\t\tif (dateFormatStrings != null) {\n\t\t\tfor (int i=0; i < dateFormatStrings.length && result == null; i++) {\n\t\t\t\tif (dateFormatStrings[i].length () == value.length ()) {\n\t\t\t\t\tsdf.applyPattern (dateFormatStrings[i]);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = new Timestamp (sdf.parse(value).getTime ());\n\t\t\t\t\t} catch (Exception e) { } // nothing for now ..\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (result == null) { // still nothing try integer\n\t\t\tresult = new Timestamp (Long.parseLong (value));\n\t\t}\n\t\treturn result;\n\t}", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "private String prettyTime() {\n String[] dt = time.split(\"T\");\n String[] ymd = dt[0].split(\"-\");\n String[] hms = dt[1].split(\":\");\n\n int hour = Integer.parseInt(hms[0]);\n\n String date = getMonth(Integer.parseInt(ymd[1])) + \" \" + ymd[2] + \", \" + ymd[0];\n String time = (hour > 12 ? hour - 12 : hour) + \":\" + hms[1] + \":\" + hms[2].substring(0, hms[2].indexOf(\".\"));\n return date + \" at \" + time;\n }", "public StringBuffer format(long t_sec, StringBuffer toAppendTo, FieldPosition pos){\n\t\tlong t_l = 1000 * t_sec;\n\t\treturn dateFormat.format(new java.util.Date(t_l), toAppendTo, pos);\n\t}", "int getTimestamp();", "public static String formatTimeStamp(Date dateTime, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n return formatter.format(dateTime);\n }", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static String displayTimeInJakarta(long timestamp, String pattern) {\n SimpleDateFormat formatOutgoing = new SimpleDateFormat(pattern);\n TimeZone tz = TimeZone.getTimeZone(\"Asia/Jakarta\");\n// System.out.println(tz.getDisplayName(false, TimeZone.SHORT, Locale.ENGLISH)); // WIB\n\n formatOutgoing.setTimeZone(tz);\n String ss = formatOutgoing.format(new Date(timestamp));\n\n return ss;\n// String ss = formatOutgoing.format(formatIncoming.parse(\"Tue Mar 03 00:00:00 WIB 2015\"));\n\n }", "private String getDayFromUTCTimeStamp(String stDate_in) {\n try {\n long timeStamp = Long.parseLong(stDate_in) * 1000L;\n SimpleDateFormat sdfDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat sdfDateTime = new SimpleDateFormat(\"E MM/dd/yyyy HH:mm:ss\");\n Date netDate = (new Date(timeStamp));\n return sdfDay.format(netDate);\n } catch (Exception e) {\n AppDataLog.TPostExep(e);\n return null;\n }\n }", "public static String getDateFromTimestamp(long timestamp) {\n\n Calendar cal = Calendar.getInstance(Locale.ENGLISH);\n cal.setTimeInMillis(timestamp * 1000);\n return DateFormat.format(\"dd-MMM-yyyy\", cal).toString();\n }", "public static String getHoraMinutoSegundoTimestamp(Timestamp timestamp) {\r\n\t\tLong time = timestamp.getTime();\r\n\r\n\t\tString retorno = new SimpleDateFormat(\"HH:mm:ss\", new Locale(\"pt\", \"BR\")).format(new Date(time));\r\n\r\n\t\treturn retorno;\r\n\t}", "public static String timeCalc(String createdAt){\n String relativeDate = Utility.relativeTime(createdAt);\n String d = Utility.formatDate(createdAt);\n return d;\n\n }", "public static Timestamp changeStrToDate(String strInput)\n\t{\n\t\tSimpleDateFormat sdfmt1 = new SimpleDateFormat(\"MM/dd/yyyy hh:mm a\");\n\t\tSimpleDateFormat sdfmt2= new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\tjava.util.Date dDate = new Date();\n\t\ttry {\n\t\t\tdDate = sdfmt1.parse( strInput );\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString strOutput = sdfmt2.format( dDate );\n\t\tDateTimeFormatter formattert = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n\t\tLocalDateTime ldt = LocalDateTime.parse(strOutput,formattert);\n\t\tTimestamp dt = Timestamp.valueOf(ldt);\n\t\t//System.out.println(dDate + \" \" + strOutput + \" \" + dt);\n\t\t//System.out.println(dt);\n\t\treturn dt;\n\n\t}", "public static String getShortDate(Timestamp timestamp) {\n if (timestamp != null) {\n long lnMilisegundos = timestamp.getTime() + (timestamp.getNanos() / 1000000);\n java.sql.Date sqlDate = new java.sql.Date(lnMilisegundos);\n return sqlDate.toString();\n }\n return \"\";\n }", "public static String timestamp() {\n\t\tString t = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\").format(new Date());\n\t\t// File f=new\n\t\t// File(String.format(\"%s.%s\",t,RandomStringUtils.randomAlphanumeric(8)));\n\t\tSystem.out.println(\"Time is :\" + t);\n\t\treturn t;\n\t}", "public static String timestampToString(int timestamp, String format) {\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(format);\r\n\t\tfinal Calendar c = Calendar.getInstance();\r\n\t\tc.setTimeInMillis((long) timestamp * 1000);\r\n\t\treturn sdf.format(c.getTime());\r\n\t}", "void get_timestamp (int reversed)\n{\n BytePtr str = new BytePtr(20);\n int i;\n\n if (timestamp != 0) return;\n str.at(19, (byte)0);\n if (reversed != 0)\n for (i=19; i-- != 0; ) str.at(i, (byte)CTOJ.fgetc(ifp));\n else\n CTOJ.fread (str, 19, 1, ifp);\n\n int year = ( str.at(0) - '0')*1000 + (str.at(1) - '0')*100 + (str.at(2) - '0' )*10 + str.at(3) - '0';\n int mon = (str.at(5) - '0')*10 + str.at(6)-'0';\n int day = (str.at(8) - '0')*10 + str.at(9)-'0';\n int hour = (str.at(11) - '0')*10 + str.at(12)-'0';\n int min = (str.at(14) - '0')*10 + str.at(15)-'0';\n int sec = (str.at(17) - '0')*10 + str.at(18)-'0';\n \n Calendar cal = new GregorianCalendar();\n cal.set(year,mon-1,day,hour,min,sec);\n timestamp = cal.getTimeInMillis();\n}", "private String TimeConversion() {\n\n int hours, minutes, seconds, dayOfWeek, date, month, year;\n\n seconds = ((raw[27] & 0xF0) >> 4) + ((raw[28] & 0x03) << 4);\n minutes = ((raw[28] & 0xFC) >> 2);\n hours = (raw[29] & 0x1F);\n dayOfWeek = ((raw[29] & 0xE0) >> 5);\n date = (raw[30]) & 0x1F;\n month = ((raw[30] & 0xE0) >> 5) + ((raw[31] & 0x01) << 3);\n year = (((raw[31] & 0xFE) >> 1) & 255) + 2000;\n\n\n\n return hR(month) + \"/\" + hR(date) + \"/\" + year + \" \" + hR(hours) + \":\" + hR(minutes) + \":\" + hR(seconds) + \":00\";\n }", "public static String convertToString(long value) {\r\n Date date = convertToDate(value);\r\n\r\n String dateFormat = ResourceUtil.getMessageResourceString(\"application.pattern.timestamp\");\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);\r\n String result = simpleDateFormat.format(date);\r\n\r\n return result;\r\n }", "long getTimestamp();", "private static String timeHandler(String date) {\n SimpleDateFormat dbFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\n SimpleDateFormat dayFormat = new SimpleDateFormat(\"MM-dd\");\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm\");\n dbFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String today = dayFormat.format(new Date());\n String day = \"\";\n String time = \"\";\n try {\n time = timeFormat.format(dbFormat.parse(date));\n day = dayFormat.format(dbFormat.parse(date));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if (day.equals(today)) {\n return \"Today \" + time;\n } else if (day.equals(dayFormat.format(yesterday()))) {\n return \"Yesterday \" + time;\n } else {\n return day + \" \" + time;\n }\n }", "public static String formatDatetime(java.sql.Timestamp timeStamp) {\n\t\tif (timeStamp == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\n\t\t\t\t\t\"dd/MM/yyyy HH:mm:ss\");\n\t\t\treturn dateFormat.format(timeStamp);\n\t\t}\n\t}", "@Override\n\tpublic String getTimestamp()\n\t{\n\t\treturn new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\").format(new Date());\n\t}" ]
[ "0.6691057", "0.6664041", "0.6418683", "0.64054537", "0.62668663", "0.62503487", "0.6152484", "0.61452156", "0.61101615", "0.61014545", "0.60937357", "0.60646045", "0.60570574", "0.60430664", "0.60430664", "0.60307455", "0.6024836", "0.60236347", "0.60236347", "0.59774345", "0.59774345", "0.5972382", "0.5960008", "0.5949915", "0.5927236", "0.59087694", "0.59072375", "0.5903015", "0.59026253", "0.5896621", "0.5872901", "0.58712", "0.58570015", "0.5834636", "0.5799443", "0.5793966", "0.5792691", "0.5782192", "0.5766708", "0.57584083", "0.5755055", "0.57385206", "0.5696339", "0.5695043", "0.5694519", "0.5686696", "0.5684256", "0.56812125", "0.56802976", "0.5676311", "0.5669536", "0.565242", "0.5649571", "0.56440663", "0.56345963", "0.5623421", "0.55985594", "0.55885035", "0.5588066", "0.5585161", "0.55749065", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.5555972", "0.55449444", "0.5541604", "0.5538844", "0.55209374", "0.55090725", "0.55083835", "0.55068094", "0.55051845", "0.5502536", "0.55024904", "0.5489126", "0.54876727", "0.54785514", "0.5476792", "0.5468094", "0.54652077", "0.5463719", "0.54592365", "0.54540944", "0.54417133", "0.54331505", "0.5432365", "0.5415784" ]
0.6071519
11
Used for testing to inject a writer.
public static int execute(String[] args, Writer writer) { return new CommandLine(new Main(args, writer)).execute(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupWriter() {\n output = new StringWriter();\n writer = new PrintWriter(output);\n }", "public void setWriter(Writer writer) {\n this.writer = writer;\n }", "@Test\r\n\tpublic void testWriter() {\r\n\t\tString s = \"This is a test of the writer\";\r\n\t\tWriter w = new Writer();\r\n\t\tassertThat(w, is(notNullValue()));\r\n\t\t\r\n\t\tw.write(s);\r\n\t\tassertThat(w.read(), is(s));\r\n\t}", "public MockJspWriter(Writer targetWriter) {\n\t\tthis(null, targetWriter);\n\t}", "public MockJspWriter(HttpServletResponse response, Writer targetWriter) {\n\t\tsuper(DEFAULT_BUFFER, true);\n\t\tthis.response = (response != null ? response : new MockHttpServletResponse());\n\t\tif (targetWriter instanceof PrintWriter) {\n\t\t\tthis.targetWriter = (PrintWriter) targetWriter;\n\t\t}\n\t\telse if (targetWriter != null) {\n\t\t\tthis.targetWriter = new PrintWriter(targetWriter);\n\t\t}\n\t}", "public void setWriter(final Writer writer) {\n this.writer = writer;\n }", "public static JsonWriter newWriter(Writer writer) {\n if (provider == JsonProvider.UNKNOWN) {\n init();\n }\n return provider.newWriter(writer);\n }", "Write createWrite();", "public abstract JsonWriter newWriter(Writer writer);", "private WriterFactory() {\n }", "public ReaderWriterProvider readerWriterProvider() { return _readerProvider; }", "public IInitWriter getWriterInit();", "public String getWriter() {\r\n return writer;\r\n }", "public Writer getWriter ()\n {\n\tif (myWriter == null)\n\t{\n\t myWriter = new MyWriter ();\n\t}\n\n\treturn myWriter;\n }", "public MarkupWriterMock() {\n this.document.newRootElement(\"html\");\n this.currentElement = this.document.getRootElement();\n }", "protected OpenFile(final BufferedWriter writer) {\n this.writer = writer;\n }", "public PipedWriter() { throw new RuntimeException(\"Stub!\"); }", "public BootstrapInstrumentor(PrintWriter w) {\n this.w = w;\n }", "public PipedWriter(java.io.PipedReader snk) throws java.io.IOException { throw new RuntimeException(\"Stub!\"); }", "public MockSNSWriter getMockWriter()\n {\n return (MockSNSWriter)writer;\n }", "protected void genWriter() {\n\t\t\n\t\tfixWriter_h();\n\t\tfixWriter_cpp();\n\t}", "public DeclWriter(PrintWriter writer) {\n super();\n outFile = writer;\n debug = Chicory.debug_decl_print;\n }", "public interface IWriter {\n void write(int b) throws WriterException;\n}", "public interface Writer extends Transformer {\n\n /**\n * Writes an entity to the outputstream\n *\n * @param response an outcoming response\n * @param request an incoming provider\n */\n void writeTo(InternalResponse<?> response, InternalRequest<?> request);\n\n /**\n * Figures out whether is writer compatible for the given route\n *\n * @param route compared route\n * @return returns {@code true} if the writer is compatible with the given route\n */\n boolean isWriterCompatible(InternalRoute route);\n\n}", "public void setWriter(String writer) {\r\n this.writer = writer == null ? null : writer.trim();\r\n }", "@Test\n\tpublic void testWrite(){\n\t\tGameWorld gw = getGameWorld();\n\t\ttry{\n\t\t\tXMLWriter writer = new XMLWriter(\"testWrite\");\n\t\t\twriter.write(gw);\n\t\t\twriter.close();\n\t\t} catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t\tfail(\"XMLWriter, testWrite.xml not found\");\n\t\t} catch(IntrospectionException e){\n\t\t\te.printStackTrace();\n\t\t\tfail(\"XMLWriter, introspection failure\");\n\t\t}\n\t}", "public void setDataWriter(DataWriter dataWriter);", "public void setWriter(PrintWriter writer) {\n this.writer= writer;\n }", "public void testCreateProxy() throws Exception {\n XMLStreamWriter result = openFilteredWriter(new StringWriter(), factory);\n\n assertNotNull(result);\n }", "@Override\n public PrintWriter getWriter() throws IOException {\n return this.writer;\n }", "private void setDataWriterForFilename(String filename) throws KettleException {\n\t\t// First handle the writers themselves.\n\t\t// If we didn't have a writer yet, we create one.\n\t\t// Basically we open a new file\n\t\tdata.writer = data.fileWriterMap.get(filename);\n\t\tif (data.writer==null) {\n\t\t\topenNewFile(filename);\n\t\t\tdata.oneFileOpened = true;\n\n\t\t\tdata.fileWriterMap.put(filename, data.writer);\n\t\t\n\t\t\t// If it's the first time we open it and we have a header, we write a header...\n\t\t\t//\n\t\t\tif (!meta.isFileAppended() && meta.isHeaderEnabled()) {\n\t\t\t\tif (writeHeader()) {\n\t\t\t\t\tincrementLinesOutput();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public abstract JsonWriter newWriter(OutputStream out);", "void identity(Writer writer);", "Writer run(Writer writer, List<Object> scopes);", "public static FactoryWriter getInstance() {\n return FactoryWriterHolder.INSTANCE;\n }", "CompressingMessageWriter(MessageWriter wr) {\n this.writer = wr;\n }", "public interface ContentWriter {\n\t// *** Class Members ***\n\n\t// *** Public Methods ***\n\t\n\t// --- Writer State ---\n\tpublic Name getName();\n\tpublic List<Name> getElementNameStack();\n\t\n\t// --- Escaped Text Content ---\n\tpublic void text(Text text) throws IOException;\n\tpublic void text(String text) throws IOException;\n\tpublic Writer text() throws IOException;\n\tpublic Writer cdata() throws IOException;\n\t\n\t// --- Character Data Content---\n\tpublic void characters(CharData charData) throws IOException;\n\tpublic void cdata(CData cdata) throws IOException;\n\t\n\t// --- Reference Content ---\n\tpublic void reference(CharRef charRef) throws IOException;\n\tpublic void reference(Name entityName) throws IOException;\n\t\n\t// --- Namespaces ---\n\tpublic void defaultNamespace(NamespaceURI uri) throws IOException;\n\tpublic void namespace(NamespaceURI uri) throws IOException;\n\t\n\t// --- Element Content ---\n\tpublic ContentWriter element(Name elementName) throws IOException;\n\tpublic ContentWriter element(Name elementName, Attribute... attributes) throws IOException;\n\t\n\t// --- Misc Content ---\n\tpublic void comment(Comment c) throws IOException;\n\tpublic void pi(Target target, Instruction instruction) throws IOException;\n\tpublic void space(Whitespace space) throws IOException;\n\t\n\t// --- Custom Content ---\n\tpublic void content(Content c) throws IOException;\n}", "void messageWriter(MessageWriter messageWriter);", "@Override\r\n\tpublic PrintWriter getWriter() throws IOException {\n\t\treturn null;\r\n\t}", "public MockJspWriter(HttpServletResponse response) {\n\t\tthis(response, null);\n\t}", "void decorate(Writer out, String content) throws IOException;", "private void initReportWriter() {\n\t\tfinal XMLOutputFactory xmlof = XMLOutputFactory.newInstance();\r\n\r\n\t\t// Create an XML stream writer\r\n\t\tfinal File reportFile = new File(getOutputDirectory(), \"report.xml\");\r\n\t\ttry {\r\n\t\t\treportWriter = xmlof.createXMLStreamWriter(new FileWriter(reportFile));\r\n\r\n\t\t} catch (final XMLStreamException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (final IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void setWriter(Writer xmlWriter) \r\n\t{\r\n\twriter = xmlWriter;\r\n\treturn;\r\n\t}", "private final void inject() {\n }", "private HFile.Writer getNewWriter(final HFile.Writer writer,\n final Path familydir)\n throws IOException {\n close(writer);\n return new HFile.Writer(fs, StoreFile.getUniqueFile(fs, familydir),\n blocksize, compression, KeyValue.KEY_COMPARATOR);\n }", "public interface ICodeWriter {\n\n boolean write(String code);\n\n}", "private void inject() {\n }", "public WebWriteCollector(final Writer writer, final String format) {\n this.writer = writer;\n this.format = format;\n }", "private BufferedWriter getWriter(int secretPos) throws IOException {\n\t\tFile file = new File(\"reportingTool_tmp\" + sep + this.uniqueName + \"-\" + \"histogram_\" + this.dataset.getSecrets().get(secretPos).getFileName() + \".txt\");\n\t\tFileWriter writer = new FileWriter(file);\n\t\tBufferedWriter bw = new BufferedWriter(writer);\n\t\treturn bw;\n\t}", "public interface Provider {\n\n Repository<WriterEntity> writerRepository();\n}", "private PrintWriterUtil() {}", "public OPDSManifestWriters()\n {\n\n }", "private void init(Writer writer, String encoding) {\n\t\tsetOutput(writer, encoding);\n\t}", "public WriterBasedJsonGenerator(IOContext ctxt, int features, com.fasterxml.jackson.core.ObjectCodec codec, Writer w)\n/* */ {\n/* 87 */ super(ctxt, features, codec);\n/* 88 */ this._writer = w;\n/* 89 */ this._outputBuffer = ctxt.allocConcatBuffer();\n/* 90 */ this._outputEnd = this._outputBuffer.length;\n/* */ }", "public interface Writer {\n\n void write(ResultEntry resultEntry) throws IOException;\n\n}", "@Override\n public Writer getOutputStreamWriter() throws IOException {\n return new OutputStreamWriter(getOutputStream());\n }", "@Override\n public LogWriter getLogWriter() {\n return logWriter;\n }", "protected PrintWriter getTargetWriter() throws IOException {\n\t\tif (this.targetWriter == null) {\n\t\t\tthis.targetWriter = this.response.getWriter();\n\t\t}\n\t\treturn this.targetWriter;\n\t}", "@Bean(name=\"com.glyde.mall.batch.job.sample.sampleParameterWriter\")\n @StepScope\n public ItemWriter<TestDto> sampleWriter(){\n return new MyBatisBatchItemWriterBuilder<TestDto>()\n .sqlSessionFactory(sqlSessionFactory)\n .statementId(\"com.glyde.mall.batch.job.sample.mapper.TestMapper.update\")\n .assertUpdates(true)\n .build();\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/* */ }", "private void createWriter() throws IOException {\n if (outputFile.exists()) {\n outputFile.delete();\n }\n FileWriter outFw = null;\n try {\n outFw = new FileWriter(outputFile.getAbsolutePath());\n } catch (IOException e) {\n LOG.error(\"Can not create writer for {} {}\", outputFile.getAbsolutePath(), e);\n throw e;\n }\n this.bufferedWriter = new BufferedWriter(outFw);\n writeOutputLine(\"User Agent - started\");\n }", "public Writer openWriter() throws IOException {\n return new NoCloseWriter(response.getWriter());\n }", "public void setItemWriter(ItemWriter itemWriter) {\n this.itemWriter = itemWriter;\n }", "public static JsonWriter newWriter(OutputStream out) {\n if (provider == JsonProvider.UNKNOWN) {\n init();\n }\n return provider.newWriter(out);\n }", "public void setLogWriter(PrintWriter out) throws ResourceException {\n log.finest(\"setLogWriter()\");\n logwriter = out;\n }", "protected java.io.PrintWriter getPrintWriter(java.io.Writer writer){\n if (writer instanceof java.io.PrintWriter){\n return (java.io.PrintWriter)writer;\n }\n return new java.io.PrintWriter(writer);\n }", "public void startWrite() throws ThingsException;", "private JsonWriter(JsonGenerator jgen, com.sample.masking.json.JsonView result, Match currentMatch, SerializerProvider serializerProvider) {\n this.jgen = jgen;\n this.result = result;\n this.currentMatch = currentMatch;\n this.serializerProvider = serializerProvider;\n }", "@Test\n public void testWriteToPrintWriter() throws Exception {\n System.out.println(\"writeToPrintWriter\");\n PrintWriter output = new PrintWriter(\"tmp.log\");\n String data = \"abc\";\n boolean expResult = true;\n boolean result = IOUtil.writeToPrintWriter(output, data);\n assertEquals(expResult, result);\n result = IOUtil.writeToPrintWriter(output, null);\n assertEquals(false, result);\n\n }", "public Object getOutputTarget()\n/* */ {\n/* 101 */ return this._writer;\n/* */ }", "@Provides\r\n public DataOutput provideOutputWriter() {\r\n DataOutput out = null;\r\n final PrintWriter oWriter = outWriter;\r\n if ((oWriter != null) && (outputFormat != null)) {\r\n if (\"csv\".equalsIgnoreCase(outputFormat)) {\r\n out = new CSVDataOutput(oWriter);\r\n } else if (\"json\".equalsIgnoreCase(outputFormat)) {\r\n out = new JSONDataOutput(oWriter);\r\n } else\r\n throw new IllegalArgumentException(\"Output format \"\r\n + outputFormat + \" not supported.\"\r\n + \" Valid types are csv, json\");\r\n out.verboseOptions(verboseStream, verbose);\r\n }\r\n return out;\r\n }", "public void prepareToWrite(RecordWriter writer) {\n UDFContext udfc = UDFContext.getUDFContext();\n Properties p =\n udfc.getUDFProperties(this.getClass(), new String[]{ udfContextSignature });\n\n String strSchema = p.getProperty(SCHEMA_SIGNATURE);\n if (strSchema != null) {\n // Parse the schema from the string stored in the properties object.\n try {\n schema = new ResourceSchema(Utils.getSchemaFromString(strSchema));\n } catch (ParserException pex) {\n logger.warn(\"Could not parse schema for storing.\");\n }\n }\n\n if (headerTreatment == Headers.DEFAULT) {\n headerTreatment = Headers.SKIP_OUTPUT_HEADER;\n }\n\n // PigStorage's prepareToWrite()\n super.prepareToWrite(writer);\n }", "public void enableWriter(boolean enabled) {\n this.useWriter = enabled;\n }", "private PrintWriter getWriter(String signature) throws IOException {\n\n\tFile f = signature2file.get(signature);\n\n\tif (f == null) {\n\n\t throw new IllegalStateException(\"Supposed to have file name for \"\n\t\t + signature + \", but don't???\");\n\t}\n\n\t// Create a FileWriter with 'append'\n\treturn new PrintWriter(new FileWriter(f, true));\n }", "private IndexWriter getIndexWriter() throws IOException {\n\n\t\tAnalyzer a = getAnaLyzer();\n\n\t\tif (idxWriter == null) {\n\n\t\t\tindexPath = this.analyzer + \" index-directory\";\n\t\t\tDirectory indexDir = FSDirectory.open(Paths.get(indexPath));\n\t\t\tIndexWriterConfig config = new IndexWriterConfig(a);\n\n\t\t\tconfig.setOpenMode(OpenMode.CREATE);\n\n\t\t\tidxWriter = new IndexWriter(indexDir, config);\n\t\t}\n\n\t\treturn idxWriter;\n\t}", "public static interface Writer {\n /**\n * Write object.\n *\n * @param writer Writer.\n * @param obj Object.\n * @param err Error.\n */\n public void write(BinaryRawWriterEx writer, Object obj, Throwable err);\n\n /**\n * Determines whether this writer can write given data.\n *\n * @param obj Object.\n * @param err Error.\n * @return Value indicating whether this writer can write given data.\n */\n public boolean canWrite(Object obj, Throwable err);\n }", "@Override\n protected synchronized void addWriter(ChannelHandlerWriteSubscription subscription) {\n super.addWriter(subscription);\n }", "private JsonWriter(JsonGenerator jgen, JsonView result, Match currentMatch,\n String currentPath, Stack<String> path, JsonViewSerializer.AccessibleProperty referringField, SerializerProvider serializerProvider) {\n this.jgen = jgen;\n this.result = result;\n this.currentMatch = currentMatch;\n this.currentPath = currentPath;\n this.referringField = referringField;\n this.path = path;\n this.serializerProvider = serializerProvider;\n }", "public Writer getWriter(String cliParameter) {\n Writer writer = null;\n if(\"csv\".equals(cliParameter)){\n writer = new WriterCSV();\n }\n \n return writer;\n }", "public JsonOutput(Writer writer)\n\t{\n\t\tthis(writer, false);\n\t}", "private StringWriter createStringWriter(String str)\n\t{\n\t\treturn new StringWriter((int) (str.length() + (str.length() * 0.1)));\n\t}", "private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }", "@Override\n public void write() {\n\n }", "public void write(Writer writer) {\n this.write(writer, 0);\n }", "@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }", "interface InWriter { // In interface class, all methods are abstract. (You can't specify the body)\n // public abstract void write(); By default all methods are public and abstract\n void write();\n}", "public BufferedMCLWriter getWriter() {\n\t\treturn writer;\n\t}", "public void writeTo(IonWriter writer)\n throws IOException;", "@Override\n public void setWriteListener(WriteListener arg0) {\n }", "@Override\r\n\tpublic void write() {\n\t\t\r\n\t}", "public abstract void getReport(java.io.Writer writer);", "public RandomAccessOutputStream(RandomAccessWrite writer)\n {\n this.writer = writer;\n // we don't have to maintain a position, as each COSStream can only have one writer.\n }", "protected void writeFile(Document model, FileWriter writer)\n throws IOException, Exception {\n writer.loadTemplate();\n\n String className = model.getDocumentElement().getAttribute(\"name\");\n writer.createOutFile(null, className); //pass in null as the package\n\n // use the global resolver\n writer.parse(model, resolver);\n }", "@Test\n void fileWriter() {\n\n\n ArrayList<String> fileLines = Name_Sorter.fileRead(this.readFile, \"src/main/java/oop/assignment3/ex41/base/testFile-ex41\");\n Collections.sort(fileLines);\n this.writeFile = Name_Sorter.fileWriter(this.writeFile, fileLines, \"src/main/java/oop/assignment3/ex41/base/ex41-testOutputFile.txt\");\n boolean actualOutput = this.writeFile != null;\n Assertions.assertTrue(actualOutput);\n }", "@FunctionalInterface\n protected interface StreamWriter<TargetType> {\n void accept(TargetType source, RevisionDataOutput output) throws IOException;\n }", "public PrintWriter getLogWriter() throws ResourceException {\n log.finest(\"getLogWriter()\");\n return logwriter;\n }", "public static JSONWriter getInstance(){\n\t\treturn new JSONWriter();\n\t}", "public Writer openWriter() throws IOException {\n return new FileWriter(this);\n }", "public void resetWriter() {\n\t\tinit();\n\t}", "public WstxOutputFactory() {\n mConfig = WriterConfig.createFullDefaults();\n }", "@Override\n\tpublic void generateSetter(PrintWriter writer)\n\t{\n\t\tgenerateSetter(writer, \"int\", String.format(\"buffer.data[offset+%d] = (byte)value;\", annotation.offset()));\n\t}" ]
[ "0.692939", "0.65342605", "0.6349006", "0.6240684", "0.6212027", "0.616109", "0.6087653", "0.60698694", "0.6055255", "0.6051559", "0.6037211", "0.60327387", "0.6027639", "0.5928061", "0.58913594", "0.581808", "0.5811306", "0.57975817", "0.57829905", "0.5741914", "0.57378376", "0.5715999", "0.57002556", "0.56967956", "0.5694586", "0.56910396", "0.5678125", "0.56712794", "0.56675905", "0.5663613", "0.5627521", "0.561736", "0.5609021", "0.5600312", "0.55872864", "0.5584283", "0.55663306", "0.5562006", "0.55443734", "0.55403066", "0.55339354", "0.5526262", "0.5513838", "0.5512504", "0.54900473", "0.5482554", "0.54805714", "0.54794276", "0.54791117", "0.54756486", "0.5473813", "0.546421", "0.5460645", "0.5455256", "0.545514", "0.5453498", "0.54407567", "0.5427768", "0.54259455", "0.5407706", "0.5387", "0.5376344", "0.5376201", "0.53588086", "0.5353587", "0.5334444", "0.532263", "0.531591", "0.5308271", "0.5307102", "0.529639", "0.52843684", "0.5282427", "0.52807236", "0.5265632", "0.5260055", "0.52583086", "0.5251003", "0.52384335", "0.52356505", "0.52330834", "0.52307564", "0.5225918", "0.5222771", "0.52186304", "0.52180976", "0.52180505", "0.5217946", "0.5215667", "0.52122414", "0.5200374", "0.5189459", "0.5188141", "0.5180211", "0.5179975", "0.51791537", "0.5177759", "0.5168403", "0.51573855", "0.51547474", "0.51531744" ]
0.0
-1
set system properties as soon as possible
@Override public Integer call() { if (properties != null && !properties.isEmpty()) { System.getProperties().putAll(properties); } final List<File> templateDirectories = getTemplateDirectories(baseDir); final Settings settings = Settings.builder() .setArgs(args) .setTemplateDirectories(templateDirectories) .setTemplateName(template) .setSourceEncoding(sourceEncoding) .setOutputEncoding(outputEncoding) .setOutputFile(outputFile) .setInclude(include) .setLocale(locale) .isReadFromStdin(readFromStdin) .isEnvironmentExposed(isEnvironmentExposed) .setSources(sources != null ? sources : new ArrayList<>()) .setProperties(properties != null ? properties : new HashMap<>()) .setWriter(writer(outputFile, outputEncoding)) .build(); try { return new FreeMarkerTask(settings).call(); } finally { if (settings.hasOutputFile()) { close(settings.getWriter()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSystemProperties() {\n Properties systemP = System.getProperties();\n Enumeration e = systemP.propertyNames();\n while (e.hasMoreElements()) {\n String propertyName = (String) e.nextElement();\n String value = systemP.getProperty(propertyName);\n this.setPropertyInternal(propertyName, value);\n }\n }", "private static void registerToSystem() {\n Enumeration<?> enumeration = properties.propertyNames();\r\n while (enumeration.hasMoreElements()) {\r\n String name = (String) enumeration.nextElement();\r\n String value = properties.getProperty(name);\r\n if (value != null) {\r\n System.setProperty(name, value);\r\n }\r\n }\r\n\t}", "private static void addSettingsPropertiesToSystem(){\n \t\tProperties props;\n \t\ttry {\n \t\t\tprops = SettingsLoader.loadSettingsFile();\n \t\t\tif(props != null){\n \t\t\t\tIterator it = props.keySet().iterator();\n \t\t\t\twhile(it.hasNext()){\n \t\t\t\t\tString key = (String) it.next();\n \t\t\t\t\tString value = props.getProperty(key);\n \t\t\t\t\tSystem.setProperty(key, value);\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\tthrow new Error(e);\n \t\t}\n \t}", "private void setSysProperties() {\n Properties sysProperties = System.getProperties();\n\n // SMTP properties\n sysProperties.put(\"mail.smtp.auth\", \"true\");\n sysProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n sysProperties.put(\"mail.smtp.host\", smtpHost);\n sysProperties.put(\"mail.smtp.port\", \"587\");\n\n //IMAP properties\n sysProperties.put(\"mail.store.protocol\", \"imaps\");\n\n // Credentials\n sysProperties.put(\"mail.user\", username);\n sysProperties.put(\"mail.password\", password);\n\n __logger.info(\"Set system properties\");\n }", "private void loadSystemConfig() {\r\n try {\r\n Properties systemProperties = System.getProperties();\r\n for (Enumeration e = systemProperties.keys(); e.hasMoreElements(); ) {\r\n String key = (String) e.nextElement();\r\n if (key.startsWith(DEFAULT_PROPERTY_PREFIX)) {\r\n Object value = systemProperties.getProperty(key);\r\n properties.put(key, value);\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"Override Scope property \" + key + \" with \" + value);\r\n }\r\n }\r\n }\r\n } catch (SecurityException e) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"Can't access System properties\", e);\r\n }\r\n }\r\n }", "public void updateSystemSettings()\r\n {\r\n System.setProperty( \"http.agent\", Environment.getPhexVendor() );\r\n if ( isHttpProxyUsed )\r\n {\r\n System.setProperty( \"http.proxyHost\", httpProxyHost );\r\n System.setProperty( \"http.proxyPort\", String.valueOf( httpProxyPort ) );\r\n }\r\n else\r\n {\r\n System.setProperty( \"http.proxyHost\", \"\" );\r\n System.setProperty( \"http.proxyPort\", \"\" );\r\n }\r\n \r\n // cache DNS name lookups for only 30 minutes\r\n System.setProperty( \"networkaddress.cache.ttl\", \"1800\" );\r\n Security.setProperty( \"networkaddress.cache.ttl\", \"1800\" );\r\n }", "public void setSystemProperties(String systemProperties) {\n this.systemProperties = systemProperties;\n }", "T setSystemProperty(String key, String value);", "private SystemPropertiesRemoteSettings() {}", "private SystemProperties() {}", "public static void bindSystemProperties(Binder binder) {\n bindProperties(binder, System.getProperties());\n }", "void setEnvironment(Properties properties);", "public static final String setSystemProperty(String key, String value) {\n\t\tif (!saveInSystem) {\n\t\t\tlog.warn(\"Attempting to set System Property \" + key + \" to \"\n\t\t\t\t\t+ value\n\t\t\t\t\t+ \" but the file System Properties have not yet been read.\");\n\t\t}\n\t\treturn System.setProperty(key, value);\n\t}", "void setSystem(java.lang.String system);", "@Override\n public void lifeCycleStarting(LifeCycle anyLifeCycle) {\n System.getProperties().putAll(toSet);\n }", "@Override\n public SystemProperties getSystemProperties() {\n return null;\n }", "private void initializeProperties () throws Exception {\n String userHome = System.getProperty(\"user.home\");\n String userDir = System.getProperty(\"user.dir\");\n String hackyHome = userHome + \"/.hackystat\";\n String sensorBaseHome = hackyHome + \"/sensorbase\"; \n String propFile = userHome + \"/.hackystat/sensorbase/sensorbase.properties\";\n this.properties = new Properties();\n // Set defaults\n properties.setProperty(ADMIN_EMAIL_KEY, \"[email protected]\");\n properties.setProperty(ADMIN_PASSWORD_KEY, \"[email protected]\");\n properties.setProperty(CONTEXT_ROOT_KEY, \"sensorbase\");\n properties.setProperty(DB_DIR_KEY, sensorBaseHome + \"/db\");\n properties.setProperty(DB_IMPL_KEY, \"org.hackystat.sensorbase.db.derby.DerbyImplementation\");\n properties.setProperty(HOSTNAME_KEY, \"localhost\");\n properties.setProperty(LOGGING_LEVEL_KEY, \"INFO\");\n properties.setProperty(SMTP_HOST_KEY, \"mail.hawaii.edu\");\n properties.setProperty(PORT_KEY, \"9876\");\n properties.setProperty(XML_DIR_KEY, userDir + \"/xml\");\n properties.setProperty(TEST_INSTALL_KEY, \"false\");\n properties.setProperty(TEST_DOMAIN_KEY, \"hackystat.org\");\n FileInputStream stream = null;\n try {\n stream = new FileInputStream(propFile);\n properties.load(stream);\n System.out.println(\"Loading SensorBase properties from: \" + propFile);\n }\n catch (IOException e) {\n System.out.println(propFile + \" not found. Using default sensorbase properties.\");\n }\n finally {\n if (stream != null) {\n stream.close();\n }\n }\n // Now add to System properties. Since the Mailer class expects to find this stuff on the \n // System Properties, we will add everything to it. In general, however, clients should not\n // use the System Properties to get at these values, since that precludes running several\n // SensorBases in a single JVM. And just is generally bogus. \n Properties systemProperties = System.getProperties();\n systemProperties.putAll(properties);\n System.setProperties(systemProperties);\n }", "public void doRefresh() {\n\t\tArrayList<SystemProperty> props = new ArrayList<>();\n\t\t\n\t\tfor (Entry<Object, Object> entry: System.getProperties().entrySet()) {\n\t\t\tprops.add(new SystemProperty(entry.getKey().toString(), entry.getValue().toString()));\n\t\t}\n\t\tCollections.sort(props);\n\t\tthis.properties = props;\n\t}", "@Override\r\n public boolean isSystemProperty() throws Exception\r\n {\n return false;\r\n }", "public static void setSystemAttributes() throws InvalidDBTransferException {\n \texecuteInitialization(CHECK_ATTRIBUTES, INIT_ATTRIBUTES);\n }", "public static void systemPropertyTest() {\n\n Properties properties = System.getProperties();\n properties.list(System.out);\n }", "private Properties getSystemPropertiesPost71() {\n Properties props = getSystemProperties();\n return props;\n }", "public static void loadProperties() {\n properties = new Properties();\n try {\n File f = new File(\"system.properties\");\n if (!(f.exists())) {\n OutputStream out = new FileOutputStream(f);\n }\n InputStream is = new FileInputStream(f);\n properties.load(is);\n lastDir = getLastDir();\n if (lastDir == null) {\n lastDir = \"~\";\n setLastDir(lastDir);\n }\n properties.setProperty(\"lastdir\", lastDir);\n\n // Try loading properties from the file (if found)\n properties.load(is);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static Properties setup() {\n Properties props = System.getProperties();\n try {\n props.load(new FileInputStream(new File(\"src/config.properties\")));\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(-1);\n }\n return props;\n }", "private static void setPropertiesFromRuntime(RuntimeConfigManager manager) {\n try {\n if (manager != null) {\n if (manager.getDeploymentId() != null && System.getProperty(COMPSsConstants.DEPLOYMENT_ID) == null) {\n System.setProperty(COMPSsConstants.DEPLOYMENT_ID, manager.getDeploymentId());\n }\n if (manager.getMasterName() != null && System.getProperty(COMPSsConstants.MASTER_NAME) == null) {\n System.setProperty(COMPSsConstants.MASTER_NAME, manager.getMasterName());\n }\n if (manager.getMasterPort() != null && System.getProperty(COMPSsConstants.MASTER_PORT) == null) {\n System.setProperty(COMPSsConstants.MASTER_PORT, manager.getMasterPort());\n }\n if (manager.getAppName() != null && System.getProperty(COMPSsConstants.APP_NAME) == null) {\n System.setProperty(COMPSsConstants.APP_NAME, manager.getAppName());\n }\n if (manager.getTaskSummary() != null && System.getProperty(COMPSsConstants.TASK_SUMMARY) == null) {\n System.setProperty(COMPSsConstants.TASK_SUMMARY, manager.getTaskSummary());\n }\n if (manager.getCOMPSsBaseLogDir() != null && System.getProperty(COMPSsConstants.BASE_LOG_DIR) == null) {\n System.setProperty(COMPSsConstants.BASE_LOG_DIR, manager.getCOMPSsBaseLogDir());\n }\n if (manager.getSpecificLogDir() != null && System.getProperty(COMPSsConstants.SPECIFIC_LOG_DIR) == null) {\n System.setProperty(COMPSsConstants.SPECIFIC_LOG_DIR, manager.getSpecificLogDir());\n }\n if (manager.getLog4jConfiguration() != null && System.getProperty(COMPSsConstants.LOG4J) == null) {\n System.setProperty(COMPSsConstants.LOG4J, manager.getLog4jConfiguration());\n }\n if (manager.getResourcesFile() != null && System.getProperty(COMPSsConstants.RES_FILE) == null) {\n System.setProperty(COMPSsConstants.RES_FILE, manager.getResourcesFile());\n }\n if (manager.getResourcesSchema() != null && System.getProperty(COMPSsConstants.RES_SCHEMA) == null) {\n System.setProperty(COMPSsConstants.RES_SCHEMA, manager.getResourcesSchema());\n }\n if (manager.getProjectFile() != null && System.getProperty(COMPSsConstants.PROJ_FILE) == null) {\n System.setProperty(COMPSsConstants.PROJ_FILE, manager.getProjectFile());\n }\n if (manager.getProjectSchema() != null && System.getProperty(COMPSsConstants.PROJ_SCHEMA) == null) {\n System.setProperty(COMPSsConstants.PROJ_SCHEMA, manager.getProjectSchema());\n }\n\n if (manager.getScheduler() != null && System.getProperty(COMPSsConstants.SCHEDULER) == null) {\n System.setProperty(COMPSsConstants.SCHEDULER, manager.getScheduler());\n }\n if (manager.getMonitorInterval() > 0 && System.getProperty(COMPSsConstants.MONITOR) == null) {\n System.setProperty(COMPSsConstants.MONITOR, Long.toString(manager.getMonitorInterval()));\n }\n if (manager.getGATAdaptor() != null && System.getProperty(COMPSsConstants.GAT_ADAPTOR_PATH) == null) {\n System.setProperty(COMPSsConstants.GAT_ADAPTOR_PATH, manager.getGATAdaptor());\n }\n if (manager.getGATBrokerAdaptor() != null && System.getProperty(COMPSsConstants.GAT_BROKER_ADAPTOR) == null) {\n System.setProperty(COMPSsConstants.GAT_BROKER_ADAPTOR, manager.getGATBrokerAdaptor());\n }\n if (manager.getGATFileAdaptor() != null && System.getProperty(COMPSsConstants.GAT_FILE_ADAPTOR) == null) {\n System.setProperty(COMPSsConstants.GAT_FILE_ADAPTOR, manager.getGATFileAdaptor());\n }\n\n if (manager.getWorkerCP() != null && System.getProperty(COMPSsConstants.WORKER_CP) == null) {\n System.setProperty(COMPSsConstants.WORKER_CP, manager.getWorkerCP());\n }\n if (manager.getWorkerJVMOpts() != null && System.getProperty(COMPSsConstants.WORKER_JVM_OPTS) == null) {\n System.setProperty(COMPSsConstants.WORKER_JVM_OPTS, manager.getWorkerJVMOpts());\n }\n if (System.getProperty(COMPSsConstants.WORKER_CPU_AFFINITY) == null\n || System.getProperty(COMPSsConstants.WORKER_CPU_AFFINITY).isEmpty()) {\n System.setProperty(COMPSsConstants.WORKER_CPU_AFFINITY, Boolean.toString(manager.isWorkerCPUAffinityEnabled()));\n }\n if (System.getProperty(COMPSsConstants.WORKER_GPU_AFFINITY) == null\n || System.getProperty(COMPSsConstants.WORKER_GPU_AFFINITY).isEmpty()) {\n System.setProperty(COMPSsConstants.WORKER_GPU_AFFINITY, Boolean.toString(manager.isWorkerGPUAffinityEnabled()));\n }\n\n if (manager.getServiceName() != null && System.getProperty(COMPSsConstants.SERVICE_NAME) == null) {\n System.setProperty(COMPSsConstants.SERVICE_NAME, manager.getServiceName());\n }\n if (System.getProperty(COMPSsConstants.COMM_ADAPTOR) == null) {\n if (manager.getCommAdaptor() != null) {\n System.setProperty(COMPSsConstants.COMM_ADAPTOR, manager.getCommAdaptor());\n } else {\n System.setProperty(COMPSsConstants.COMM_ADAPTOR, COMPSsConstants.DEFAULT_ADAPTOR);\n }\n }\n if (System.getProperty(COMPSsConstants.CONN) == null) {\n if (manager.getConn() != null) {\n System.setProperty(COMPSsConstants.CONN, manager.getConn());\n } else {\n System.setProperty(COMPSsConstants.CONN, COMPSsConstants.DEFAULT_CONNECTOR);\n }\n }\n if (System.getProperty(COMPSsConstants.GAT_DEBUG) == null) {\n System.setProperty(COMPSsConstants.GAT_DEBUG, Boolean.toString(manager.isGATDebug()));\n }\n if (System.getProperty(COMPSsConstants.LANG) == null) {\n System.setProperty(COMPSsConstants.LANG, manager.getLang());\n }\n if (System.getProperty(COMPSsConstants.GRAPH) == null) {\n System.setProperty(COMPSsConstants.GRAPH, Boolean.toString(manager.isGraph()));\n }\n if (System.getProperty(COMPSsConstants.TRACING) == null) {\n System.setProperty(COMPSsConstants.TRACING, String.valueOf(manager.getTracing()));\n }\n if (System.getProperty(COMPSsConstants.EXTRAE_CONFIG_FILE) == null) {\n System.setProperty(COMPSsConstants.EXTRAE_CONFIG_FILE, manager.getCustomExtraeFile());\n }\n if (System.getProperty(COMPSsConstants.TASK_EXECUTION) == null\n || System.getProperty(COMPSsConstants.TASK_EXECUTION).equals(\"\")) {\n System.setProperty(COMPSsConstants.TASK_EXECUTION, COMPSsConstants.EXECUTION_INTERNAL);\n }\n\n if (manager.getContext() != null) {\n System.setProperty(COMPSsConstants.COMPSS_CONTEXT, manager.getContext());\n }\n System.setProperty(COMPSsConstants.COMPSS_TO_FILE, Boolean.toString(manager.isToFile()));\n } else {\n setDefaultProperties();\n }\n } catch (Exception e) {\n System.err.println(WARN_IT_FILE_NOT_READ);\n e.printStackTrace();\n }\n }", "public static void main(String[] args){\n\n System.setProperty(\"myKey\",\"myValue\");\n\n String value = System.getProperty(\"os.name\");\n sop(value);\n// for(Object obj : prop.keySet()){\n// String value = (String)prop.get(obj);\n// sop(value);\n// }\n\n }", "private static void initialiseDriverConfig() {\n driverConfig = System.getProperty(Constants.DRIVER_CONFIG_PROPERTY_NAME);\n\n /**\n * This is a mandatory system property, which means that if the user didn't provide it, we need\n * to halt the execution as we can't move on without it.\n */\n if (driverConfig == null) {\n throw new RuntimeException(\n String.format(\n Constants.MANDATORY_SYSTEM_PROPERTY_NOT_DECLARED_MESSAGE,\n Constants.DRIVER_CONFIG_PROPERTY_NAME));\n }\n LOGGER.debug(\n String.format(\n Constants.FOUND_SYSTEM_PROPERTY_MESSAGE,\n Constants.DRIVER_CONFIG_PROPERTY_NAME,\n driverConfig));\n }", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "public void testGetSystemProperties() {\n Map<String, String> props = mb.getSystemProperties();\n assertNotNull(props);\n assertTrue(props.size() > 0);\n assertTrue(props.size() == System.getProperties().size());\n for (Map.Entry<String, String> entry : props.entrySet()) {\n assertNotNull(entry.getKey());\n assertNotNull(entry.getValue());\n }\n }", "private static void prepareLoggingSystemEnviroment() {\n\t\t// property configuration relies on this parameter\n\t\tSystem.setProperty(\"log.directory\", getLogFolder());\n\t\t//create the log directory if not yet existing:\n\t\t//removed code as log4j is now capable of doing that automatically\n\t}", "String setEnvironmentProperty(String key, String value);", "@Override\r\n protected boolean validateSystemSettings() {\n return true;\r\n }", "@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\tSystem.out.println(\"call afterPropertiesSet()...\");\n//\t\tadminId = env.getProperty(\"adminid\");\n//\t\tadminPw = env.getProperty(\"adminpw\");\t\t\n\t}", "public static void setSystemPropertyChromeWebDriverOriginal() {\n\t\tString fullPath = getFullPathToSrcTestResourceFolder();\n\t\t\n\t\tString os = getOperationalSystemName();\n\t\t\n\t\tString chromeDriver = CHROME_DRIVER_WINDOWS;\n\t\tif ( os.equals(OS_MAC_OS_X) ) {\n\t\t\tchromeDriver = CHROME_DRIVER_MAC;\n\t\t}\n\t\t\n\t\tSystem.setProperty(\n\t\t\tWEBDRIVER_CHROME_DRIVER, \n\t\t\tfullPath + chromeDriver);\n\t}", "private static void checkSystemProperties() \n\tthrows ArgumentMissingException {\n\n\t\tif (System.getProperty(\"properties\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the properties file, \" +\n\t\t\t\"e.g. using -Dproperties=/path/to/file.\");\t\t\t\n\t\t}\n\n\t\tif (System.getProperty(\"gold\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Gold trees, \" +\n\t\t\t\"e.g. using -Dgold=/path/to/file.\");\n\t\t}\n\n\t\tif (System.getProperty(\"test\") == null) {\n\t\t\tthrow new ArgumentMissingException(\n\t\t\t\t\t\"Please specify the path to the Test trees, \" +\n\t\t\t\"e.g. using -Dtest=/path/to/file.\");\n\t\t}\t\t\n\n\t}", "public void setSysShutdown() {\n\t\t//Log.v(TAG, \"------------setSysShutdown=\");\n\t\tbSystemShutdown = true;\n\t}", "@BeforeSuite\n\t\n\tpublic void setUp()\n\t{\n\t\t\n\t\tSystem.out.println(\" set system property for chrome\");\n\t}", "public void setSystemPath(String path) {\r\n\t\ttry {\r\n\t\t\tPaths.get(path);\r\n\t\t} catch (InvalidPathException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tthis.settings.setProperty(\"systemPath\", path);\r\n\t\tthis.saveChanges();\r\n\t}", "@SynchronizedMethod(lockType = MethodLockType.EXPLICIT,\n description = \"An explicit private lock which cannot be shared from outside.\",\n otherSynchronizedMethods = {\"getSystemConfigProperties\"})\n public static void storeSystemConfigProperties() {\n synchronized (LOCK) {\n\n if (systemConfigProperties == null) {\n SystemLogger.warn(SystemConfigPropertiesFactory.class, MessageFactory.getMessage(WarnType.ATTEMPT_WRITE_EMPTY_CONFIG_FILE));\n }\n String repositoryPath = SystemConstants.USER_HOME + File.separator + SystemConstants.APPLICATION_HOME_NAME;\n String configPath = repositoryPath + File.separator + SystemConstants.SYSTEM_CONFIG_FILE_NAME;\n FileOutputStream fileOutputStream = null;\n try {\n systemConfigProperties.properties.store(new FileOutputStream(new File(configPath)), MessageFactory.getMessage(InfoType.STORE_CONFIG_FILE));\n SystemLogger.info(SystemConfigPropertiesFactory.class, MessageFactory.getMessage(InfoType.STORE_CONFIG_FILE_SUCCESS));\n } catch (IOException ex) {\n SystemLogger.warn(SystemConfigPropertiesFactory.class, MessageFactory.getMessage(WarnType.CANNOT_STORE_CONFIG_FILE, repositoryPath), ex);\n } finally {\n if (fileOutputStream != null) {\n try {\n fileOutputStream.close();\n } catch (IOException ex) {\n SystemLogger.warn(SystemConfigPropertiesFactory.class, MessageFactory.getMessage(WarnType.CANNOT_CLOSE_CONFIG_FILE, repositoryPath), ex);\n }\n }\n\n }\n }\n }", "public void setSysShutdown() {\n Log.v(TAG, \"------------setSysShutdown=\");\n bSystemShutdown = true;\n }", "private void initialize(String configLocation) throws IOException {\n\t\tInputStream input = null;\n\t\tProperties props = null;\n\t\ttry {\n\t\t\tinput = SystemListener.class.getResourceAsStream(configLocation);\n\t\t\tprops = new Properties();\n\t\t\tprops.load(input);\t\t\t\n\t\t} finally {\n\t\t\tif (input != null) {\n\t\t\t\tinput.close();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"System Configration initialize Details:\");\n\t\t\n\t\tfor (Entry<Object, Object> entry : props.entrySet()) {\n\t\t String key=(String)entry.getKey();\n\t\t String value=(String)entry.getValue();\n\t\t System.out.println(\"|------ key[\"+key+\"];value[\"+value+\"]\");\n\t\t\tSystem.setProperty(key , value);\n\t\t}\n\t\tSystem.out.println(\"-------finish\");\n\t}", "SystemPropertiesType createSystemPropertiesType();", "public static void loadProperties()\n {\n Properties props = new Properties();\n try {\n props.load( new BufferedInputStream( ClassLoader.getSystemResourceAsStream(\"bench.properties\") ) );\n } catch (IOException ioe)\n {\n logger.log(Level.SEVERE, ioe.getMessage());\n }\n props.putAll(System.getProperties()); //overwrite\n System.getProperties().putAll(props);\n }", "public final void resetSystemVars() {\n if (CMLib.lang() != null)\n CMLib.lang().setLocale(getStr(\"LANGUAGE\"), getStr(\"COUNTRY\"));\n\n TIME_TICK = getLong(\"TICKTIME\");\n if (TIME_TICK < 500)\n TIME_TICK = 4000;\n TIME_TICK_DOUBLE = TIME_TICK;\n TICKS_PER_RLMIN = (int) Math.round(60000.0 / TIME_TICK_DOUBLE);\n TICKS_PER_RLHOUR = TICKS_PER_RLMIN * 60;\n TICKS_PER_RLDAY = TICKS_PER_RLHOUR * 24;\n MILLIS_PER_MUDHOUR = getLong(\"MILLISPERMUDHOUR\");\n if (MILLIS_PER_MUDHOUR < TIME_TICK)\n MILLIS_PER_MUDHOUR = 600000;\n\n final List<String> privateList = CMParms.parseCommas(getStr(\"PRIVATERESOURCES\").toUpperCase(), true);\n privateSet.clear();\n for (final String s : privateList)\n privateSet.put(s.trim(), Thread.currentThread().getThreadGroup());\n\n setVar(Str.BADNAMES, getStr(\"BADNAMES\"));\n setVar(Str.MULTICLASS, getStr(\"CLASSSYSTEM\"));\n setVar(Str.PKILL, getStr(\"PLAYERKILL\"));\n setVar(Str.PLAYERDEATH, getStr(\"PLAYERDEATH\"));\n setVar(Str.ITEMLOOTPOLICY, getStr(\"ITEMLOOTPOLICY\"));\n setVar(Str.MOBDEATH, getStr(\"MOBDEATH\"));\n setVar(Str.PLAYERFLEE, getStr(\"FLEE\"));\n setVar(Str.SHOWDAMAGE, getStr(\"SHOWDAMAGE\"));\n setVar(Str.EMAILREQ, getStr(\"EMAILREQ\"));\n setVar(Str.ESC0, getStr(\"ESCAPE0\"));\n setVar(Str.ESC1, getStr(\"ESCAPE1\"));\n setVar(Str.ESC2, getStr(\"ESCAPE2\"));\n setVar(Str.ESC3, getStr(\"ESCAPE3\"));\n setVar(Str.ESC4, getStr(\"ESCAPE4\"));\n setVar(Str.ESC5, getStr(\"ESCAPE5\"));\n setVar(Str.ESC6, getStr(\"ESCAPE6\"));\n setVar(Str.ESC7, getStr(\"ESCAPE7\"));\n setVar(Str.ESC8, getStr(\"ESCAPE8\"));\n setVar(Str.ESC9, getStr(\"ESCAPE9\"));\n setVar(Str.MSPPATH, getStr(\"SOUNDPATH\"), false);\n setVar(Str.AUTOPURGE, getStr(\"AUTOPURGE\"));\n setIntVar(Int.ACCOUNTPURGEDAYS, getStr(\"ACCOUNTPURGE\"), 14);\n setVar(Str.IDLETIMERS, getStr(\"IDLETIMERS\"));\n setVar(Str.CORPSEGUARD, getStr(\"CORPSEGUARD\"));\n setUpLowVar(Str.MUDDOMAIN, getStr(\"DOMAIN\"));\n String adminEmail = getStr(\"ADMINEMAIL\");\n if ((adminEmail == null) || (adminEmail.trim().length() == 0))\n adminEmail = getStr(\"I3EMAIL\");\n setVar(Str.ADMINEMAIL, adminEmail);\n setUpLowVar(Str.I3ROUTERS, getStr(\"I3ROUTERS\"));\n setVar(Str.AUTOREACTION, getStr(\"AUTOREACTION\"));\n setVar(Str.WIZLISTMASK, getStr(\"WIZLISTMASK\"));\n setUpLowVar(Str.DEFAULTPARENTAREA, getStr(\"DEFAULTPARENTAREA\"));\n setUpLowVar(Str.CLANWEBSITES, getStr(\"CLANWEBSITES\"));\n setVar(Str.CHANNELBACKLOG, getStr(\"CHANNELBACKLOG\"));\n setUpLowVar(Str.CLANFORUMDATA, getStr(\"CLANFORUMDATA\"));\n setUpLowVar(Str.STARTINGITEMS, getStr(\"STARTINGITEMS\", \"1 Waterskin, 1 Ration, 1 Torch\"));\n setVar(Str.PREJUDICE, getStr(\"PREJUDICE\"));\n setUpLowVar(Str.PRICEFACTORS, getStr(\"PRICEFACTORS\"));\n setVar(Str.IGNOREMASK, getStr(\"IGNOREMASK\"));\n setVar(Str.BUDGET, getStr(\"BUDGET\"));\n setVar(Str.DEVALUERATE, getStr(\"DEVALUERATE\"));\n setVar(Str.INVRESETRATE, getStr(\"INVRESETRATE\"));\n setVar(Str.AUCTIONRATES, getStr(\"AUCTIONRATES\", \"0,10,0.1%,10%,5%,1,168\"));\n setUpLowVar(Str.DEFAULTPROMPT, getStr(\"DEFAULTPROMPT\"));\n String promptBehavior = getStr(\"PROMPTBEHAVIOR\", \"NORMAL\");\n promptSuffix = new byte[0];\n if (!promptBehavior.equalsIgnoreCase(\"NORMAL\") && promptBehavior.length() > 0) {\n for (int i = 0; i < promptBehavior.length() - 1; i += 2) {\n final String cStr = promptBehavior.substring(i, i + 2);\n if (cStr.equalsIgnoreCase(\"CR\")) {\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + 1);\n promptSuffix[promptSuffix.length - 1] = (byte) '\\n';\n } else if (cStr.equalsIgnoreCase(\"LF\")) {\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + 1);\n promptSuffix[promptSuffix.length - 1] = (byte) '\\r';\n } else if (cStr.equalsIgnoreCase(\"GA\")) {\n final int pos = promptSuffix.length;\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + Session.TELNETGABYTES.length);\n System.arraycopy(Session.TELNETGABYTES, 0, promptSuffix, pos, Session.TELNETGABYTES.length);\n } else {\n final int pos = promptSuffix.length;\n byte[] bytes;\n try {\n bytes = cStr.trim().getBytes(getVar(Str.CHARSETINPUT));\n promptSuffix = Arrays.copyOf(promptSuffix, promptSuffix.length + bytes.length);\n System.arraycopy(bytes, 0, promptSuffix, pos, bytes.length);\n } catch (UnsupportedEncodingException e) {\n }\n }\n }\n }\n for (final ListFile lfVar : ListFile.values()) {\n sysLstFileLists[lfVar.ordinal()] = null;\n sysLstFileSet[lfVar.ordinal()] = null;\n }\n setVar(Str.EMOTEFILTER, getStr(\"EMOTEFILTER\"));\n p().emoteFilter.clear();\n p().emoteFilter.addAll(CMParms.parse((getStr(\"EMOTEFILTER\")).toUpperCase()));\n setVar(Str.POSEFILTER, getStr(\"POSEFILTER\"));\n setVar(Str.STATCOSTS, getStr(\"STATCOSTS\", \"<18 1, <22 2, <25 3, <99 5\"));\n setVar(Str.REMORTMASK, getStr(\"REMORTMASK\", \"-LEVEL +>60\"));\n setVar(Str.REMORTRETAIN, getStr(\"REMORTRETAIN\", \"SKILLSAT100\"));\n\n p().poseFilter.clear();\n p().poseFilter.addAll(CMParms.parse((getStr(\"POSEFILTER\")).toUpperCase()));\n setVar(Str.SAYFILTER, getStr(\"SAYFILTER\"));\n p().sayFilter.clear();\n p().sayFilter.addAll(CMParms.parse((getStr(\"SAYFILTER\")).toUpperCase()));\n setVar(Str.CHANNELFILTER, getStr(\"CHANNELFILTER\"));\n p().channelFilter.clear();\n p().channelFilter.addAll(CMParms.parse((getStr(\"CHANNELFILTER\")).toUpperCase()));\n setVar(Str.CLANTROPAREA, getStr(\"CLANTROPAREA\"));\n setVar(Str.CLANTROPCP, getStr(\"CLANTROPCP\"));\n setVar(Str.CLANTROPEXP, getStr(\"CLANTROPEXP\"));\n setVar(Str.CLANTROPPK, getStr(\"CLANTROPPK\"));\n setVar(Str.CLANTROPMB, getStr(\"CLANTROPMB\"));\n setVar(Str.CLANTROPLVL, getStr(\"CLANTROPLVL\"));\n setVar(Str.COLORSCHEME, getStr(\"COLORSCHEME\"));\n setUpLowVar(Str.SMTPSERVERNAME, getStr(\"SMTPSERVERNAME\"));\n setVar(Str.EXPCONTACTLINE, getStr(\"EXPCONTACTLINE\"));\n setVar(Str.AUTOWEATHERPARMS, getStr(\"AUTOWEATHERPARMS\"));\n setVar(Str.DEFAULTPLAYERFLAGS, getStr(\"DEFAULTPLAYERFLAGS\"));\n setUpLowVar(Str.AUTOAREAPROPS, getStr(\"AUTOAREAPROPS\"));\n setUpLowVar(Str.MXPIMAGEPATH, getStr(\"MXPIMAGEPATH\"));\n setBoolVar(Bool.ACCOUNTEXPIRATION, getStr(\"ACCOUNTEXPIRATION\").equalsIgnoreCase(\"YES\") ? true : false);\n setBoolVar(Bool.INTRODUCTIONSYSTEM, getStr(\"INTRODUCTIONSYSTEM\").equalsIgnoreCase(\"YES\") ? true : false);\n setBoolVar(Bool.HASHPASSWORDS, getStr(\"HASHPASSWORDS\").equalsIgnoreCase(\"YES\") ? true : false);\n setUpLowVar(Str.PREFACTIONS, getStr(\"FACTIONS\"));\n setUpLowVar(Str.CHARCREATIONSCRIPTS, getStr(\"CHARCREATIONSCRIPTS\"));\n setUpLowVar(Str.CHARSETINPUT, getStr(\"CHARSETINPUT\", \"iso-8859-1\"));\n setUpLowVar(Str.CHARSETOUTPUT, getStr(\"CHARSETOUTPUT\", \"iso-8859-1\"));\n setUpCosts(\"COMMONCOST\", commonCost, CMParms.parseCommas(getStr(\"COMMONCOST\", \"1 TRAIN\"), true));\n setUpCosts(\"SKILLCOST\", skillsCost, CMParms.parseCommas(getStr(\"SKILLCOST\", \"1 TRAIN\"), true));\n setUpCosts(\"LANGCOST\", languageCost, CMParms.parseCommas(getStr(\"LANGCOST\", \"3 PRACTICE\"), true));\n setVar(Str.RACEMIXING, getStr(\"RACEMIXING\"));\n String[] hungerCodes = CMParms.parseCommas(getStr(\"HUNGER\", \"500,100,100\"), true).toArray(new String[3]);\n setIntVar(Int.HUNGER_FULL, hungerCodes.length > 0 ? CMath.s_int(hungerCodes[0]) : 500);\n setIntVar(Int.HUNGER_GAIN_PCT, hungerCodes.length > 1 ? CMath.s_int(CMStrings.deleteAllofChar(hungerCodes[1], '%')) : 100);\n setIntVar(Int.HUNGER_LOSS_PCT, hungerCodes.length > 2 ? CMath.s_int(CMStrings.deleteAllofChar(hungerCodes[2], '%')) : 100);\n String[] thirstCodes = CMParms.parseCommas(getStr(\"THIRST\", \"1000,100,100\"), true).toArray(new String[3]);\n setIntVar(Int.THIRST_FULL, thirstCodes.length > 0 ? CMath.s_int(thirstCodes[0]) : 500);\n setIntVar(Int.THIRST_GAIN_PCT, thirstCodes.length > 1 ? CMath.s_int(CMStrings.deleteAllofChar(thirstCodes[1], '%')) : 100);\n setIntVar(Int.THIRST_LOSS_PCT, thirstCodes.length > 2 ? CMath.s_int(CMStrings.deleteAllofChar(thirstCodes[2], '%')) : 100);\n setIntVar(Int.MOB_HP_BASE, CMath.s_int(getStr(\"MOB_HP_BASE\", \"11\")));\n\n setUpLowVar(Str.BLACKLISTFILE, getStr(\"BLACKLISTFILE\", \"/resources/ipblock.ini\"));\n setWhitelist(CMProps.WhiteList.CONNS, getStr(\"WHITELISTIPSCONN\"));\n setWhitelist(CMProps.WhiteList.LOGINS, getStr(\"WHITELISTLOGINS\"));\n setWhitelist(CMProps.WhiteList.NEWPLAYERS, getStr(\"WHITELISTIPSNEWPLAYERS\"));\n\n if (p().sysBools[Bool.MUDSHUTTINGDOWN.ordinal()] == null)\n p().sysBools[Bool.MUDSHUTTINGDOWN.ordinal()] = Boolean.FALSE;\n\n for (final StrList strListVar : StrList.values()) {\n final String list = getStr(strListVar.toString().toUpperCase().trim());\n if ((list != null) && (list.trim().length() > 0))\n setListVar(strListVar, CMParms.parseCommas(list, false).toArray(new String[0]));\n }\n\n if (CMLib.color() != null)\n CMLib.color().clearLookups();\n if (getStr(\"MANACONSUMEAMT\").trim().equalsIgnoreCase(\"LEVEL\"))\n setIntVar(Int.MANACONSUMEAMT, -100);\n else if (getStr(\"MANACONSUMEAMT\").trim().equalsIgnoreCase(\"SPELLLEVEL\"))\n setIntVar(Int.MANACONSUMEAMT, -200);\n else\n setIntVar(Int.MANACONSUMEAMT, CMath.s_int(getStr(\"MANACONSUMEAMT\").trim()));\n String s = getStr(\"COMBATSYSTEM\");\n if (\"queue\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.QUEUE.ordinal());\n else if (\"manual\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.MANUAL.ordinal());\n else if (\"turnbased\".equalsIgnoreCase(s))\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.TURNBASED.ordinal());\n else\n setIntVar(Int.COMBATSYSTEM, CombatLibrary.CombatSystem.DEFAULT.ordinal());\n s = getStr(\"EQVIEW\");\n if (\"paragraph\".equalsIgnoreCase(s))\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_PARAGRAPH);\n else if (\"mixed\".equalsIgnoreCase(s))\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_MIXED);\n else\n setIntVar(Int.EQVIEW, CMProps.Int.EQVIEW_DEFAULT);\n s = getStr(\"EXVIEW\");\n if (\"brief\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_BRIEF);\n else if (\"paragraph\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_PARAGRAPH);\n else if (\"mixed\".equalsIgnoreCase(s))\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_MIXED);\n else\n setIntVar(Int.EXVIEW, CMProps.Int.EXVIEW_DEFAULT);\n\n s = getStr(\"EXPIRATIONS\");\n List<String> V = CMParms.parseCommas(s, false);\n for (int i = 0; i < 5; i++) {\n final int ordNum = Int.EXPIRE_MONSTER_EQ.ordinal() + i;\n final Int expEnum = Int.values()[ordNum];\n if (V.size() > 0) {\n setIntVar(expEnum, V.get(0));\n V.remove(0);\n } else\n switch (expEnum) {\n case EXPIRE_MONSTER_EQ:\n setIntVar(Int.EXPIRE_MONSTER_EQ, \"30\");\n break;\n case EXPIRE_PLAYER_DROP:\n setIntVar(Int.EXPIRE_PLAYER_DROP, \"1200\");\n break;\n case EXPIRE_RESOURCE:\n setIntVar(Int.EXPIRE_RESOURCE, \"60\");\n break;\n case EXPIRE_MONSTER_BODY:\n setIntVar(Int.EXPIRE_MONSTER_BODY, \"30\");\n break;\n case EXPIRE_PLAYER_BODY:\n setIntVar(Int.EXPIRE_PLAYER_BODY, \"1330\");\n break;\n default:\n break;\n }\n }\n\n setIntVar(Int.MANACONSUMETIME, getStr(\"MANACONSUMETIME\"));\n setIntVar(Int.PAGEBREAK, getStr(\"PAGEBREAK\"));\n setIntVar(Int.CLANENCHCOST, getStr(\"CLANENCHCOST\"));\n setIntVar(Int.FOLLOWLEVELDIFF, getStr(\"FOLLOWLEVELDIFF\"));\n setIntVar(Int.EXPRATE, getStr(\"EXPRATE\"));\n setIntVar(Int.SKYSIZE, getStr(\"SKYSIZE\"));\n setIntVar(Int.MAXSTAT, getStr(\"MAXSTATS\"));\n setIntVar(Int.BASEMAXSTAT, getStr(\"BASEMAXSTAT\", \"18\"));\n setIntVar(Int.BASEMINSTAT, getStr(\"BASEMINSTAT\", \"3\"));\n setIntVar(Int.STARTSTAT, getStr(\"STARTSTAT\"));\n setIntVar(Int.DEFCMDTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCMDTIME\"), p().cmdActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMCMDTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMCMDTIME\"), p().cmdComActionCostExceptions) * 100.0));\n setIntVar(Int.DEFABLETIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFABLETIME\"), p().skillActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMABLETIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMABLETIME\"), p().skillComActionCostExceptions) * 100.0));\n setIntVar(Int.DEFSOCTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFSOCTIME\"), p().socActionCostExceptions) * 100.0));\n setIntVar(Int.DEFCOMSOCTIME, (int) Math.round(CMProps.setExceptionCosts(getStr(\"DEFCOMSOCTIME\"), p().socComActionCostExceptions) * 100.0));\n setIntVar(Int.MANACOST, (int) CMProps.setExceptionCosts(getStr(\"MANACOST\"), p().skillMaxManaExceptions));\n setIntVar(Int.MANAMINCOST, (int) CMProps.setExceptionCosts(getStr(\"MANAMINCOST\"), p().skillMinManaExceptions));\n setIntVar(Int.EDITORTYPE, (getStr(\"EDITORTYPE\").equalsIgnoreCase(\"WIZARD\")) ? 1 : 0);\n setIntVar(Int.MINCLANMEMBERS, getStr(\"MINCLANMEMBERS\"));\n setIntVar(Int.MAXCLANMEMBERS, getStr(\"MAXCLANMEMBERS\"));\n setIntVar(Int.CLANCOST, getStr(\"CLANCOST\"));\n setIntVar(Int.DAYSCLANDEATH, getStr(\"DAYSCLANDEATH\"));\n setIntVar(Int.DAYSCLANOVERTHROW, getStr(\"DAYSCLANOVERTHROW\", \"952\"));\n setIntVar(Int.MINCLANLEVEL, getStr(\"MINCLANLEVEL\"));\n setIntVar(Int.LASTPLAYERLEVEL, getStr(\"LASTPLAYERLEVEL\"));\n setIntVar(Int.JOURNALLIMIT, getStr(\"JOURNALLIMIT\"));\n setIntVar(Int.MUDTHEME, getStr(\"MUDTHEME\"));\n setIntVar(Int.TRIALDAYS, getStr(\"TRIALDAYS\"));\n setIntVar(Int.MAXCONNSPERIP, getStr(\"MAXCONNSPERIP\"));\n setIntVar(Int.MAXCONNSPERACCOUNT, getStr(\"MAXCONNSPERACCOUNT\"));\n setIntVar(Int.MAXNEWPERIP, getStr(\"MAXNEWPERIP\"));\n setIntVar(Int.JSCRIPTS, getStr(\"JSCRIPTS\"));\n setIntVar(Int.RECOVERRATE, getStr(\"RECOVERRATE\"), 1);\n setIntVar(Int.COMMONACCOUNTSYSTEM, getStr(\"COMMONACCOUNTSYSTEM\"), 1);\n setIntVar(Int.OBJSPERTHREAD, getStr(\"OBJSPERTHREAD\"));\n setIntVar(Int.MAXCOMMONSKILLS, getStr(\"MAXCOMMONSKILLS\"), 0);\n setIntVar(Int.MAXCRAFTINGSKILLS, getStr(\"MAXCRAFTINGSKILLS\"), 2);\n setIntVar(Int.MAXNONCRAFTINGSKILLS, getStr(\"MAXNONCRAFTINGSKILLS\"), 5);\n setIntVar(Int.MAXLANGUAGES, getStr(\"MAXLANGUAGES\"), 3);\n setIntVar(Int.RACEEXPIRATIONDAYS, getStr(\"RACEEXPIRATIONDAYS\"), 365);\n setIntVar(Int.WALKCOST, getStr(\"WALKCOST\"), 1);\n setIntVar(Int.RUNCOST, getStr(\"RUNCOST\"), 2);\n setIntVar(Int.AWARERANGE, getStr(\"AWARERANGE\"), 0);\n setIntVar(Int.MINWORKERTHREADS, getStr(\"MINWORKERTHREADS\"), 1);\n setIntVar(Int.MAXWORKERTHREADS, getStr(\"MAXWORKERTHREADS\"), 100);\n setIntVar(Int.DUELTICKDOWN, getStr(\"DUELTICKDOWN\"), 5);\n V = CMParms.parseCommas(getStr(\"MAXCLANCATS\"), true);\n p().maxClanCatsMap.clear();\n for (final String cat : V) {\n if (CMath.isInteger(cat.trim()))\n p().maxClanCatsMap.put(\"\", Integer.valueOf(CMath.s_int(cat.trim())));\n else {\n final int x = cat.lastIndexOf(' ');\n if ((x > 0) && CMath.isInteger(cat.substring(x + 1).trim()))\n p().maxClanCatsMap.put(cat.substring(0, x).trim().toUpperCase(), Integer.valueOf(CMath.s_int(cat.substring(x + 1).trim())));\n }\n }\n if (!p().maxClanCatsMap.containsKey(\"\"))\n p().maxClanCatsMap.put(\"\", Integer.valueOf(1));\n\n p().publicClanCats.clear();\n V = CMParms.parseCommas(getStr(\"PUBLICCLANCATS\"), true);\n for (final String cat : V)\n p().publicClanCats.add(cat.trim().toUpperCase());\n p().publicClanCats.add(\"\");\n\n V = CMParms.parseCommas(getStr(\"INJURYSYSTEM\"), true);\n setIntVar(Int.INJPCTCHANCE, (V.size() > 0) ? CMath.s_int(V.get(0)) : 100);\n setIntVar(Int.INJPCTHP, (V.size() > 1) ? CMath.s_int(V.get(1)) : 40);\n setIntVar(Int.INJPCTHPAMP, (V.size() > 2) ? CMath.s_int(V.get(2)) : 10);\n setIntVar(Int.INJPCTCHANCEAMP, (V.size() > 3) ? CMath.s_int(V.get(3)) : 100);\n setIntVar(Int.INJMULTIPLIER, (V.size() > 4) ? CMath.s_int(V.get(4)) : 4);\n setIntVar(Int.INJMINLEVEL, (V.size() > 5) ? CMath.s_int(V.get(5)) : 10);\n setIntVar(Int.INJBLEEDMINLEVEL, (V.size() > 6) ? CMath.s_int(V.get(6)) : 15);\n setIntVar(Int.INJBLEEDPCTHP, (V.size() > 7) ? CMath.s_int(V.get(7)) : 20);\n setIntVar(Int.INJBLEEDPCTCHANCE, (V.size() > 8) ? CMath.s_int(V.get(8)) : 100);\n\n List<String> prowesses = CMParms.parseCommas(getStr(\"PROWESSOPTIONS\"), true);\n int prowValue = Int.Prowesses.ARMOR_ABSOLUTE.value |\n Int.Prowesses.ARMOR_NUMBER.value |\n Int.Prowesses.COMBAT_ABSOLUTE.value |\n Int.Prowesses.COMBAT_NUMBER.value;\n if (prowesses.size() > 0) {\n prowValue = 0;\n for (String prow : prowesses) {\n final Int.Prowesses P = (Int.Prowesses) CMath.s_valueOf(Int.Prowesses.class, prow.toUpperCase().replace('-', '_').trim());\n if (P == null)\n Log.errOut(\"CMProps\", \"Invalid PROWESSOPTIONS value: \" + prow);\n else if (P.value == 0)\n prowValue = 0;\n else\n prowValue |= P.value;\n }\n }\n setIntVar(Int.COMBATPROWESS, prowValue);\n\n String stateVar = getStr(\"STARTHP\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTHP, CMath.s_int(stateVar));\n stateVar = getStr(\"STARTMANA\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTMANA, CMath.s_int(stateVar));\n stateVar = getStr(\"STARTMOVE\");\n if ((stateVar.length() > 0) && (CMath.isNumber(stateVar)))\n setIntVar(Int.STARTMOVE, CMath.s_int(stateVar));\n\n setIntVar(Int.MAXITEMSHOWN, getStr(\"MAXITEMSHOWN\"));\n setIntVar(Int.MUDSTATE, getStr(\"MUDSTATE\"));\n\n setUpLowVar(Str.FORMULA_ATTACKADJUSTMENT, getStr(\"FORMULA_ATTACKADJUSTMENT\", \"(50+@x1+(((@x2-9)/5)*((@x3-9)/5)*((@x3-9)/5))+@x4)-(0.15*@xx*@x5)-(0.15*@xx*@x6)-(0.3*@xx*@x7)\"));\n setUpLowVar(Str.FORMULA_ARMORADJUSTMENT, getStr(\"FORMULA_ARMORADJUSTMENT\", \"(@x1-( (((@x2-9)/5)*((@x3-9)/5)*((@x3-9)/5*@x8)) +(@x4*@x8)-(0.15*@xx>0*@x5)-(0.15*@xx>0*@x6)-(0.3*@xx>0*@x7)*@x9))-100\"));\n setUpLowVar(Str.FORMULA_ATTACKFUDGEBONUS, getStr(\"FORMULA_ATTACKFUDGEBONUS\", \"@x3 * (@x1 - @x2)* (@x1 - @x2)\"));\n setUpLowVar(Str.FORMULA_PVPATTACKFUDGEBONUS, getStr(\"FORMULA_PVPATTACKFUDGEBONUS\", getVar(Str.FORMULA_ATTACKFUDGEBONUS)));\n setUpLowVar(Str.FORMULA_CHANCESPELLCRIT, getStr(\"FORMULA_CHANCESPELLCRIT\", \"(( ((@x2-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5) ))\"));\n setUpLowVar(Str.FORMULA_PVPCHANCESPELLCRIT, getStr(\"FORMULA_PVPCHANCESPELLCRIT\", getVar(Str.FORMULA_CHANCESPELLCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGESPELLCRIT, getStr(\"FORMULA_DAMAGESPELLCRIT\", \"(@x1*( ((@x2-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5)>0 * ((@x3-10+((@x8-@x9)<10))/5) )/100.0)+(@x4/2)\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGESPELLCRIT, getStr(\"FORMULA_PVPDAMAGESPELLCRIT\", getVar(Str.FORMULA_DAMAGESPELLCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGESPELLFUDGE, getStr(\"FORMULA_DAMAGESPELLFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGESPELLFUDGE, getStr(\"FORMULA_PVPDAMAGESPELLFUDGE\", getVar(Str.FORMULA_DAMAGESPELLFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGEMELEEFUDGE, getStr(\"FORMULA_DAMAGEMELEEFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEMELEEFUDGE, getStr(\"FORMULA_PVPDAMAGEMELEEFUDGE\", getVar(Str.FORMULA_DAMAGEMELEEFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDFUDGE, getStr(\"FORMULA_DAMAGERANGEDFUDGE\", \"(@x1 - ( ((@x9-@x8)>0<1.0) * @x1 * (((@x9-@x8)<12.0)*((@x9-@x8)<12.0))/120.0))>0\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGERANGEDFUDGE, getStr(\"FORMULA_PVPDAMAGERANGEDFUDGE\", getVar(Str.FORMULA_DAMAGERANGEDFUDGE)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDTARGETED, getStr(\"FORMULA_DAMAGERANGEDTARGETED\", \"((1?@x1)+((@x3-@x4)/2.5)-(0.5*@xx*@x8)+(0.5*@xx*@x9)+(0.2*@xx*@x10)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGERANGEDTARGETED, getStr(\"FORMULA_PVPDAMAGERANGEDTARGETED\", getVar(Str.FORMULA_DAMAGERANGEDTARGETED)));\n setUpLowVar(Str.FORMULA_DAMAGERANGEDSTATIC, getStr(\"FORMULA_DAMAGERANGEDSTATIC\", \"((1?@x1)+((@x3-@x4)/2.5)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_DAMAGEMELEETARGETED, getStr(\"FORMULA_DAMAGEMELEETARGETED\", \"((1?@x1)+((@x2-10+@x3-@x4)/5)-(0.5*@xx*@x8)+(0.5*@xx*@x9)+(0.2*@xx*@x10)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEMELEETARGETED, getStr(\"FORMULA_PVPDAMAGEMELEETARGETED\", getVar(Str.FORMULA_DAMAGEMELEETARGETED)));\n setUpLowVar(Str.FORMULA_DAMAGEMELEESTATIC, getStr(\"FORMULA_DAMAGEMELEESTATIC\", \"((1?@x1)+((@x2-10+@x3-@x4)/5)-(0.2*@xx*@x5)-(0.2*@xx*@x6)-(0.2*@xx*@x7))>1\"));\n setUpLowVar(Str.FORMULA_CHANCEWEAPONCRIT, getStr(\"FORMULA_CHANCEWEAPONCRIT\", \"((((@x2-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)))\"));\n setUpLowVar(Str.FORMULA_PVPCHANCEWEAPONCRIT, getStr(\"FORMULA_PVPCHANCEWEAPONCRIT\", getVar(Str.FORMULA_CHANCEWEAPONCRIT)));\n setUpLowVar(Str.FORMULA_DAMAGEWEAPONCRIT, getStr(\"FORMULA_DAMAGEWEAPONCRIT\", \"(@x1 * (((@x2-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5)>0 * ((@x3-10+((@x8-@x9)<10))/2.5))/50.0)+(@x4/2)\"));\n setUpLowVar(Str.FORMULA_PVPDAMAGEWEAPONCRIT, getStr(\"FORMULA_PVPDAMAGEWEAPONCRIT\", getVar(Str.FORMULA_DAMAGEWEAPONCRIT)));\n setUpLowVar(Str.FORMULA_NPCHITPOINTS, getStr(\"FORMULA_NPCHITPOINTS\", \"3 + @x1 + (@x1 * @x2)\"));\n setUpLowVar(Str.FORMULA_HITPOINTRECOVER, getStr(\"FORMULA_HITPOINTRECOVER\", \"5+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0))*@x2/9.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_MANARECOVER, getStr(\"FORMULA_MANARECOVER\", \"25+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0) - (@xx*@x5/2.0))*@x2/50.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_MOVESRECOVER, getStr(\"FORMULA_MOVESRECOVER\", \"25+(((@x1 - (@xx*@x3/2.0) - (@xx*@x4/2.0) - (@xx*@x5/2.0))*@x2/10.0) + (@xx*@x6*.5) + (@xx/4.0*@x7) + (@xx/4.0*@x8) - (@xx/2.0*@x9))\"));\n setUpLowVar(Str.FORMULA_TOTALCOMBATXP, getStr(\"FORMULA_TOTALCOMBATXP\", \"100 + ((25*@x1) - (@x1*((25*@x1)^.5)))\"));\n setUpLowVar(Str.FORMULA_INDCOMBATXP, getStr(\"FORMULA_INDCOMBATXP\", \"(@x1 * (@x2 / @x3)) < 100\"));\n\n final LanguageLibrary lang = CMLib.lang();\n Directions.instance().reInitialize(getInt(\"DIRECTIONS\"), new Directions.DirectionWordTranslator() {\n @Override\n public String translate(String string) {\n return lang.L(string);\n }\n });\n\n resetSecurityVars();\n statCodeExtensions = getStrsStarting(\"EXTVAR_\");\n\n // initialized elsewhere\n if (getVar(Str.MAILBOX) == null) {\n setVar(Str.MAILBOX, \"\");\n setIntVar(Int.MAXMAILBOX, 0);\n setBoolVar(Bool.EMAILFORWARDING, false);\n }\n\n CMLib.propertiesLoaded();\n this.lastReset = System.currentTimeMillis();\n }", "public static void main(String[] args) {\n\t\tgetSystemProperty();\n\t}", "void systemPropertiesCleared(String consumer);", "private static void setProperties(String sCluster) {\n\t\tSystem.setProperty(\"coherence.cluster\", sCluster);\r\n\r\n\t\tif (CLUSTER_A.equals(sCluster)) {\r\n\t\t\tSystem.setProperty(\"coherence.clusterport\", \"11100\");\r\n\t\t} else if (CLUSTER_B.equals(sCluster)) {\r\n\t\t\tSystem.setProperty(\"coherence.clusterport\", \"11200\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\tinit();\n\t}", "public void IntialProperties() {\r\n Properties prop = new Properties();\r\n try (FileInputStream input = new FileInputStream(\"./config.properties\")) {\r\n prop.load(input);\r\n generate = prop.getProperty(\"generate\");\r\n solve = prop.getProperty(\"algorithm\");\r\n setChanged();\r\n notifyObservers(\"prop\");\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void init() throws BuildException {\n setJavaVersionProperty();\n \n ComponentHelper.getComponentHelper(this).initDefaultDefinitions();\n \n setSystemProperties();\n }", "private EscidocConfiguration() throws SystemException {\r\n System.setProperty(\"java.awt.headless\", \"true\");\r\n this.properties = loadProperties();\r\n }", "public void setSystem(String value) {\r\n this.system = value;\r\n }", "@Override\n public void afterPropertiesSet() {\n }", "public static String setSystemProperty(String key, String value, String consumer) {\n String oldValue = System.setProperty(key, value);\n systemPropertyQueried(key, oldValue, consumer);\n listener().systemPropertyChanged(key, value, consumer);\n return oldValue;\n }", "public void applyWebProxySettings() {\n boolean settingsChanged = false;\n boolean enablingProxy = false;\n Properties sysprops = System.getProperties();\n if (proxyHost != null) {\n settingsChanged = true;\n if (proxyHost.length() != 0) {\n traceSettingInfo();\n enablingProxy = true;\n sysprops.put(\"http.proxyHost\", proxyHost);\n String portString = Integer.toString(proxyPort);\n sysprops.put(\"http.proxyPort\", portString);\n sysprops.put(\"https.proxyHost\", proxyHost);\n sysprops.put(\"https.proxyPort\", portString);\n sysprops.put(\"ftp.proxyHost\", proxyHost);\n sysprops.put(\"ftp.proxyPort\", portString);\n if (nonProxyHosts != null) {\n sysprops.put(\"http.nonProxyHosts\", nonProxyHosts);\n sysprops.put(\"https.nonProxyHosts\", nonProxyHosts);\n sysprops.put(\"ftp.nonProxyHosts\", nonProxyHosts);\n }\n if(proxyUser!=null) {\n sysprops.put(\"http.proxyUser\", proxyUser);\n sysprops.put(\"http.proxyPassword\", proxyPassword);\n }\n } else {\n log(\"resetting http proxy\", Project.MSG_VERBOSE);\n sysprops.remove(\"http.proxyHost\");\n sysprops.remove(\"http.proxyPort\");\n sysprops.remove(\"http.proxyUser\");\n sysprops.remove(\"http.proxyPassword\");\n sysprops.remove(\"https.proxyHost\");\n sysprops.remove(\"https.proxyPort\");\n sysprops.remove(\"ftp.proxyHost\");\n sysprops.remove(\"ftp.proxyPort\");\n }\n }\n\n //socks\n if (socksProxyHost != null) {\n settingsChanged = true;\n if (socksProxyHost.length() != 0) {\n enablingProxy = true;\n sysprops.put(\"socksProxyHost\", socksProxyHost);\n sysprops.put(\"socksProxyPort\", Integer.toString(socksProxyPort));\n if (proxyUser != null) {\n //this may be a java1.4 thingy only\n sysprops.put(\"java.net.socks.username\", proxyUser);\n sysprops.put(\"java.net.socks.password\", proxyPassword);\n }\n\n } else {\n log(\"resetting socks proxy\", Project.MSG_VERBOSE);\n sysprops.remove(\"socksProxyHost\");\n sysprops.remove(\"socksProxyPort\");\n sysprops.remove(\"java.net.socks.username\");\n sysprops.remove(\"java.net.socks.password\");\n }\n }\n\n\n //for Java1.1 we need to tell the system that the settings are new\n if (settingsChanged &&\n JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {\n legacyResetProxySettingsCall(enablingProxy);\n }\n }", "@Override\n\tpublic void prepare(Map<String, String> mapping) {\n\t\t\n\t\tfor (Entry<String, String> en : mapping.entrySet()) {\n\t\t\tString key = en.getKey();\n\t\t\tString value = System.getenv(en.getValue());\n\t\t\tif (value != null) {\n\t\t\t\tLOG.debug(\"Env {}: {}\", en.getValue(), redactValue(key, value));\n\t\t\t\tputParameter(key, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Override with system properties\n\t\t\n\t\tfor (Entry<String, String> en : mapping.entrySet()) {\n\t\t\tString key = en.getKey();\n\t\t\tString value = System.getProperty(key);\n\t\t\tif (value != null) {\n\t\t\t\tLOG.debug(\"Sys {}: {}\", key, redactValue(key, value));\n\t\t\t\tputParameter(key, value);\n\t\t\t}\n\t\t}\n }", "PropertiesTask setProperties( Properties properties );", "@Override\r\n\tpublic void setProperties(Properties arg0) {\n\r\n\t}", "public void setUp() throws Exception {\n jvmVersion = System.getProperty(\"java.class.version\");\n System.setProperty(\"java.class.version\", \"47.0\");\n vendor = System.getProperty(\"java.vendor\");\n System.setProperty(\"java.vendor\", \"Sun Microsystems\");\n }", "private static synchronized void setProperties(final String[] astrArgs) {\n try {\n final String strPropertiesFilename;\n\n if (Args.exists(astrArgs,\n AdaptiveReplicationTool.KEY_PROPERTIES_FILENAME)) {\n final Args args = AdaptiveReplicationTool.KEY_PROPERTIES_FILENAME\n .get(astrArgs);\n\n strPropertiesFilename = args.getArg(0);\n } else {\n strPropertiesFilename = DEFAULT_PROPERTIES_FILENAME;\n }\n setProperties(strPropertiesFilename);\n } catch (Exception excp) {\n throw new RuntimeException(excp);\n } // end try\n }", "private void addProperties() {\n\n\t\t/**\n\t\t * Add fusion.conf = src/test/resource\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.conf.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.conf.dir\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t\t/**\n\t\t * set fusion.process.dir\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.process.temp\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.temp.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.temp.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.home\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.home\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.home\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t}", "public static void setup() {\n/* 78 */ s_envCurrentJRE = getProperty(\"jnlpx.jpda.env\");\n/* 79 */ o_envCurrentJRE = decodeJpdaEnv(s_envCurrentJRE);\n/* */ \n/* */ \n/* */ \n/* 83 */ if (getProperty(\"jpda.notification\") != null) {\n/* 84 */ showJpdaNotificationWindow(o_envCurrentJRE);\n/* 85 */ Main.systemExit(0);\n/* */ } \n/* */ }", "protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }", "public BasicResult modifySystemProperties(UserSession userSession, String component,\n Collection<SystemProperty> properties)\n {\n SystemPropertyResourceStub proxy =\n APIStubFactory.getInstance(userSession, new SystemPropertyResourceStubImpl(),\n SystemPropertyResourceStub.class);\n\n try\n {\n return proxy.modifySystemProperties(component, properties);\n }\n catch (UserSessionException e)\n {\n return e.getResult();\n }\n }", "public void addSysproperty(Environment.Variable sysp) {\r\n getCommandLine().addSysproperty(sysp);\r\n }", "private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }", "@Test\n public void testGetProperties() throws Exception {\n logger.info(\"testGetProperties: test the basic properties file interface\");\n\n // copy system properties\n logger.info(\"Copy system properties to a file\");\n Properties prop1 = System.getProperties();\n File file1 = createFile(\"createAndReadPropertyFile-1\", prop1);\n\n // read in properties, and compare\n logger.info(\"Read in properties from new file\");\n Properties prop2 = PropertyUtil.getProperties(file1);\n\n // they should match\n assertEquals(prop1, prop2);\n\n Properties prop3 = PropertyUtil.getProperties(INTERPOLATION_PROPERTIES);\n\n assertEquals(\"no\", prop3.getProperty(INTERPOLATION_NO));\n assertEquals(System.getenv(\"HOME\"), prop3.getProperty(INTERPOLATION_ENV));\n assertEquals(LoggerUtil.ROOT_LOGGER, prop3.getProperty(INTERPOLATION_CONST));\n assertEquals(System.getProperty(\"user.home\"), prop3.getProperty(INTERPOLATION_SYS));\n\n Properties prop4 = new Properties();\n prop4.put(INTERPOLATION_NO, \"no\");\n prop4.put(INTERPOLATION_ENV, \"${env:HOME}\");\n prop4.put(INTERPOLATION_CONST, \"${const:org.onap.policy.drools.utils.logging.LoggerUtil.ROOT_LOGGER}\");\n prop4.put(INTERPOLATION_SYS, \"${sys:user.home}\");\n\n PropertyUtil.setSystemProperties(prop4);\n\n assertEquals(\"no\", System.getProperty(INTERPOLATION_NO));\n assertEquals(System.getenv(\"HOME\"), System.getProperty(INTERPOLATION_ENV));\n assertEquals(LoggerUtil.ROOT_LOGGER, System.getProperty(INTERPOLATION_CONST));\n assertEquals(System.getProperty(\"user.home\"), System.getProperty(INTERPOLATION_SYS));\n }", "protected void initialise() {\r\n loadDefaultConfig();\r\n loadCustomConfig();\r\n loadSystemConfig();\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"--- Scope properties ---\");\r\n for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n Object value = properties.get(key);\r\n LOG.debug(key + \" = \" + value);\r\n }\r\n LOG.debug(\"------------------------\");\r\n }\r\n }", "private static Properties loadProperties() throws SystemException {\r\n final Properties result;\r\n try {\r\n result = getProperties(PROPERTIES_DEFAULT_FILENAME);\r\n }\r\n catch (final IOException e) {\r\n throw new SystemException(\"properties not found.\", e);\r\n }\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Default properties: \" + result);\r\n }\r\n Properties specific;\r\n try {\r\n specific = getProperties(PROPERTIES_FILENAME);\r\n }\r\n catch (final IOException e) {\r\n specific = new Properties();\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Error on loading specific properties.\", e);\r\n }\r\n }\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Specific properties: \" + specific);\r\n }\r\n result.putAll(specific);\r\n \r\n // Load constant properties\r\n Properties constant = new Properties();\r\n try {\r\n constant = getProperties(PROPERTIES_CONSTANT_FILENAME);\r\n }\r\n catch (final IOException e) {\r\n if (LOGGER.isWarnEnabled()) {\r\n LOGGER.warn(\"Error on loading contant properties.\");\r\n }\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Error on loading contant properties.\", e);\r\n }\r\n }\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Constant properties: \" + constant);\r\n }\r\n result.putAll(constant);\r\n \r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Merged properties: \" + result);\r\n }\r\n // set Properties as System-Variables\r\n for (final Object o : result.keySet()) {\r\n final String key = (String) o;\r\n String value = result.getProperty(key);\r\n value = replaceEnvVariables(value);\r\n System.setProperty(key, value);\r\n }\r\n return result;\r\n }", "private void installProcessingBeanProperties() {\n ProcessingBeanUpdater.getInstance();\r\n }", "@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}", "public static void set_UseDefaults(boolean y) throws RuntimeException\n {\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaUseDefaultsCmd,\n \t\t (y) ? (byte) 1 : (byte) 0);\n UmlCom.check();\n }", "void setInstallGlobalService(boolean flag);", "public static void setLocalVersion() {\n Properties prop = new Properties();\n try {\n prop.setProperty(\"updateID\", \"\"+UPDATE_ID); //make sure this matches the server's updateID\n prop.setProperty(\"name\", \"\"+VERSION_NAME);\n prop.store(\n new FileOutputStream(System.getProperty(\"user.home\") + \"/sheepfarmsimulator/client.properties\"), null);\n\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "private static void setProperty(final GenericConfiguration config, final String key, final String value) {\n\t\t//Resolve system properties, so that they can be used in config values\n\t\tString val = CRUtil.resolveSystemProperties((String) value);\n\n\t\t//Set the property\n\t\tconfig.set(key, val);\n\t}", "@Test\n public void testResolveWithSysPropResolver() {\n Resolver sysPropResolver = VariableExpansion.SYS_PROP_RESOLVER;\n\n assertNull(\"System property value unexpectedly set already\", System.getProperty(testPropName));\n assertNull(\"Expected resolve to return null as property not set\", sysPropResolver.resolve(testPropName));\n\n setTestSystemProperty(testPropName, testPropValue);\n\n assertEquals(\"System property value not as expected\", testPropValue, System.getProperty(testPropName));\n assertEquals(\"Resolved variable not as expected\", testPropValue, sysPropResolver.resolve(testPropName));\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "private static void setDriverPropertyIfRequired(String propKey, String relativeToUserPath) {\n\n\t\tif (!System.getProperties().containsKey(propKey)) {\n\t\t\tString currentDir = \"C:\\\\WebDrivers\\\\\";\n\t\t\n\t\t\tString driverLocation = currentDir + relativeToUserPath;\n\t\t\tFile driverExecutable = new File(driverLocation);\n\n\t\t\ttry {\n\t\t\t\tif (driverExecutable.exists()) {\n\t\t\t\t\tSystem.setProperty(propKey, driverLocation);\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(\"The driver does not exist at that location: \" + driverLocation);\n\t\t\t}\n\t\t}\n\t}", "private void fetchSystemConfig() {\n CompletableFuture<JSONObject> response =\n networkRequest.sendSystemConfigRequest();\n response.thenAccept(jsonObject -> getBarcodeData().setSystemConfig(jsonObject));\n }", "public void setProperty(String name, String value, User user)\r\n {\r\n if (user.isGuest())\r\n {\r\n Map<String, String> prefs = getSessionPreferences();\r\n prefs.put(name, value);\r\n }\r\n else\r\n {\r\n PropertyManager.PropertyMap prefs = getPreferences(user, true);\r\n prefs.put(name, value);\r\n prefs.save();\r\n }\r\n }", "static AuditYamlConfigurationLoader withSystemProperties()\n {\n return withProperties(System.getProperties());\n }", "public void afterPropertiesSet()\r\n/* 39: */ throws NamingException\r\n/* 40: */ {\r\n/* 41:106 */ super.afterPropertiesSet();\r\n/* 42:107 */ if (this.lookupHomeOnStartup) {\r\n/* 43:109 */ refreshHome();\r\n/* 44: */ }\r\n/* 45: */ }", "private static void setUpSettingsIfNotExists(final Context context) {\n settings.setEventsTimes(PrefUtils.getTotalEventsCount(context));\n settings.setInstallDays(PrefUtils.getTotalInstallDays(context));\n settings.setLaunchTimes(PrefUtils.getTotalLaunchTimes(context));\n }", "private void setOs() {\n\t\tthis.os = System.getProperty(\"os.name\");\n\t}", "@Override\n public void afterPropertiesSet() throws Exception {\n }", "@Override\r\n public void afterPropertiesSet() throws Exception {\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "void writeProperties(java.util.Properties p) {\n p.setProperty(\"version\", \"1.0\");\n // TODO store your settings\n }", "public boolean setPropertyValue(String propName, String value) {\n System.setProperty(propName, value);\n return true;\n }", "public ShowSystemPropertiesResponse showSystemProperties(ShowSystemPropertiesRequest request) throws GPUdbException {\n ShowSystemPropertiesResponse actualResponse_ = new ShowSystemPropertiesResponse();\n submitRequest(\"/show/system/properties\", request, actualResponse_, false);\n return actualResponse_;\n }", "public void setSystemPropertiesModeName(String constantName) throws IllegalArgumentException {\r\n this.systemPropertiesMode = constants.asNumber(constantName).intValue();\r\n }" ]
[ "0.81952983", "0.80272967", "0.748038", "0.74550545", "0.7248848", "0.72217417", "0.70742136", "0.6776774", "0.6652174", "0.6522814", "0.64687127", "0.645365", "0.6429217", "0.63745683", "0.6336217", "0.63280934", "0.6272205", "0.6245196", "0.62160915", "0.6205576", "0.6158327", "0.6083149", "0.6064657", "0.60482186", "0.60441434", "0.60232687", "0.6000184", "0.5968296", "0.5962094", "0.5928349", "0.5918447", "0.59087574", "0.5898055", "0.58968484", "0.5891569", "0.5883667", "0.58794725", "0.58778155", "0.58746344", "0.5872495", "0.5871938", "0.5863504", "0.5862763", "0.5815151", "0.58089745", "0.58019435", "0.5788568", "0.57860875", "0.5782031", "0.5766363", "0.574889", "0.5702352", "0.56854147", "0.5663263", "0.56547767", "0.56474054", "0.56165963", "0.5611236", "0.5599352", "0.55990386", "0.5588025", "0.5586355", "0.55490595", "0.5548811", "0.55465287", "0.5545599", "0.5544985", "0.55429107", "0.55426663", "0.55380106", "0.5537894", "0.5527096", "0.5519501", "0.5517449", "0.55134714", "0.55119777", "0.5510988", "0.55043113", "0.55041367", "0.5499097", "0.5494486", "0.5491261", "0.5488857", "0.5487613", "0.54765016", "0.547395", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.5472322", "0.54722154", "0.5469439", "0.5460426" ]
0.0
-1
this include source, static property
public void sinclude(Context source){ for (String str : sexport.keySet()){ if (sexport.get(str) && source.get(str) != null){ set(str, source.get(str)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Source getSrc();", "@Override\n public String getSource() {\n return this.src;\n }", "public String get_source() {\n\t\treturn source;\n\t}", "public abstract String getSource();", "protected Source getSource() {\r\n return source;\r\n }", "public String getSourceFileName() { return sourceFileName; }", "@Override\n\tpublic String getSource() {\n\t\treturn source;\n\t}", "java.lang.String getSrc();", "private CanonizeSource() {}", "String getSrc();", "public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }", "public String getSource() {\r\n return source;\r\n }", "public String getSrc() {\r\n\t\treturn src;\r\n\t}", "public String getSource() {\n return source;\n }", "private String getSourceName() {\n return srcFileName;\n }", "@Override\n \tpublic String getSource() {\n \t\tif (super.source != refSource) {\n \t\t\tif (refSource == null) {\n \t\t\t\trefSource = super.source;\n \t\t\t} else {\n \t\t\t\tsuper.source = refSource;\n \t\t\t}\n \t\t}\n \t\treturn refSource;\n \t}", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public ArchillectSource() {\n super(SOURCE_NAME);\n }", "public String getSource() {\r\n return Source;\r\n }", "public String getSource ();", "@InputFiles\n @SkipWhenEmpty\n @IgnoreEmptyDirectories\n @PathSensitive(PathSensitivity.RELATIVE)\n public ConfigurableFileCollection getSource() {\n return source;\n }", "public abstract Source getSource();", "public String getSource() {\n return this.source;\n }", "public File getSource() {\n return source;\n }", "public String getSource() {\n\n return source;\n }", "StaticIncludeType createStaticIncludeType();", "public String getSouce() {\n\t\treturn source;\n\t}", "public String getSource();", "@Override\n public String getSource()\n {\n return null;\n }", "@Override\n public File getSourceFile() {\n return _file;\n }", "public native final String SRC_ADD() /*-{\n\t\treturn this.SRC_ADD;\n\t}-*/;", "private XIncluder() {}", "public java.lang.String getSource() {\r\n return localSource;\r\n }", "public Object getSource() {return source;}", "public static String sourceContent()\n {\n read_if_needed_();\n \n return _src_content;\n }", "public SourceFieldMapper() {\n\t\tthis(Defaults.NAME, Defaults.ENABLED, Defaults.FORMAT, null, -1, Defaults.INCLUDES, Defaults.EXCLUDES);\n\t}", "String getSource();", "public void setSource (String source);", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:source\")\n public String getSource() {\n return getProperty(SOURCE);\n }", "@Override\n\tpublic void renderSource() {\n\t\t\n\t}", "public String getSource() {\n return JsoHelper.getAttribute(jsObj, \"source\");\n }", "@Override\n public Artifact getMainIncludeScannerSource() {\n return getIncludeScannerSources().get(0);\n }", "public final String getSourceFile() {\n return this.sourceFile;\n }", "public abstract Object getSource();", "@FameProperty(name = \"sourceText\", derived = true)\n public String getSourceText() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }", "public String sourceResourceLocation() {\n return this.sourceResourceLocation;\n }", "public String getSource() {\n return mSource;\n }", "@Override\r\n\tpublic String getSource() {\n\t\treturn null;\r\n\t}", "public void outsource()\n\t{\n\t\tconstructPrefix();\t \n\t}", "public String toString() {\n return getClass().getName() + \"[source=\" + source + \"]\";\n }", "public Class<?> getSource() {\r\n \t\treturn source;\r\n \t}", "java.lang.String getSrcPath();", "public void setSource(String source);", "java.lang.String getSourceFile();", "public URI getSource() {\n return source;\n }", "public String getSourcePath()\r\n\t{\r\n\t\treturn sourcePath;\r\n\t}", "public void setSource(String source) {\n _source = source;\n }", "public String getSourceString() {\n return sourceString;\n }", "public String getSourceUrl() {\n return sourceUrl;\n }", "public SharedTypeWrapper sourceFile(SourceFile source_file) {\n this.source_file = source_file;\n return this;\n }", "SourceFilePath getFilePath();", "public JarIncludeHelper includeStatic(String className, EntryType entryType) throws EntryAlreadyExistsException{\n\t\treturn include(engine.getOptions().enginePath, className, entryType, \"\", LibraryEntryType.STATIC);\n\t}", "public String getSourceResource() {\r\n\t\treturn requestSource;\r\n\t}", "public String getSourcePath() {\n return sourcePath;\n }", "public List<String> getSource() {\n return this.source;\n }", "private Source() {\n throw new AssertionError(\"This class should not be instantiated.\");\n }", "@com.facebook.react.uimanager.annotations.ReactProp(name = \"src\")\n public void setSource(@javax.annotation.Nullable java.lang.String r4) {\n /*\n r3 = this;\n r0 = 0;\n if (r4 == 0) goto L_0x0017;\n L_0x0003:\n r1 = android.net.Uri.parse(r4);\t Catch:{ Exception -> 0x0021 }\n r2 = r1.getScheme();\t Catch:{ Exception -> 0x0025 }\n if (r2 != 0) goto L_0x0023;\n L_0x000d:\n if (r0 != 0) goto L_0x0017;\n L_0x000f:\n r0 = r3.E();\n r0 = m12032a(r0, r4);\n L_0x0017:\n r1 = r3.f11557g;\n if (r0 == r1) goto L_0x001e;\n L_0x001b:\n r3.x();\n L_0x001e:\n r3.f11557g = r0;\n return;\n L_0x0021:\n r1 = move-exception;\n r1 = r0;\n L_0x0023:\n r0 = r1;\n goto L_0x000d;\n L_0x0025:\n r0 = move-exception;\n goto L_0x0023;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode.setSource(java.lang.String):void\");\n }", "public FVEventHandler getSrc() {\n\t\treturn src;\n\t}", "public boolean isSource() {\r\n \t\treturn source;\r\n \t}", "@Override\n public void setIncludeSources(Collection<File> sources) throws InterruptedException\n {\n Collection<File> files = populateIncludedSourceFiles(sources);\n \n super.setIncludeSources(files.toArray(new File[files.size()]));\n }", "public void setSource(String source) {\r\n this.source = source;\r\n }", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "public String sourceUri() {\n return this.sourceUri;\n }", "public Object getSource() {\n\t\treturn source;\n\t}", "public Object getSource() {\n\t\treturn source;\n\t}", "public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }", "public Object getSource() {\n return source;\n }", "java.lang.String getSource();", "java.lang.String getSource();", "public String getGenerateSourceComments()\n {\n return generateSourceComments;\n }", "public File getFileSource() {\n\t\treturn fileSource;\n\t}", "public SyncInstanceInfo getSrcInfo() {\n return this.SrcInfo;\n }", "@ApiModelProperty(required = true, value = \"The program that generated the test results\")\n public String getSource() {\n return source;\n }", "@ApiModelProperty(value = \"The source of the data.\")\n public String getSource() {\n return source;\n }", "public List<String> getSourceList() {\n return this.sourceList; \n }", "public String getSourceString() {\n return null;\n }", "@Override\n\tpublic java.lang.String getSrcPath() {\n\t\treturn _scienceApp.getSrcPath();\n\t}", "public Agg include(Object value) {\n attrList.put(\"include\", value);\n return this;\n }", "@Override\n public String getName() {\n return source.getName();\n }", "public JarIncludeHelper includeStatic(String className, EntryType entryType, String name) throws EntryAlreadyExistsException{\n\t\treturn include(engine.getOptions().enginePath, className, entryType, name, LibraryEntryType.STATIC);\n\t}", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public String getDataSrc() {\n return dataSrc;\n }", "public Sources()\n {\n super(NAMESPACE, ELEMENT);\n }", "public Optional<String> src() {\n\t\t\treturn Optional.ofNullable(_source);\n\t\t}", "public String getSource(){\r\n\t\treturn selectedSource;\r\n\t}", "WfExecutionObject source () throws BaseException, SourceNotAvailable;", "@Override\n public NestedSet<Artifact> getDeclaredIncludeSrcs() {\n return ccCompilationContext.getDeclaredIncludeSrcs();\n }" ]
[ "0.65107346", "0.63152283", "0.6131428", "0.61141485", "0.60854405", "0.6059148", "0.60533464", "0.60355055", "0.60132587", "0.5959744", "0.5917792", "0.5898165", "0.5883429", "0.58753145", "0.58515656", "0.584464", "0.584165", "0.584165", "0.584165", "0.58378345", "0.58304405", "0.57972157", "0.5794175", "0.5762218", "0.5727365", "0.57266206", "0.57261807", "0.5715198", "0.56952095", "0.5693461", "0.56913614", "0.5686391", "0.5676013", "0.5674135", "0.5667742", "0.56474435", "0.5619413", "0.5614374", "0.5609805", "0.5608733", "0.5585885", "0.55718327", "0.5564019", "0.5560488", "0.5556963", "0.5528319", "0.5527978", "0.5520559", "0.5503684", "0.5493297", "0.54864836", "0.54839265", "0.5474882", "0.5469971", "0.54612243", "0.54582804", "0.5445059", "0.5436921", "0.54295474", "0.54254687", "0.5425044", "0.54211783", "0.5417906", "0.54156446", "0.54088855", "0.54068804", "0.54043615", "0.5396945", "0.53933495", "0.5387618", "0.53865135", "0.537972", "0.53755367", "0.5373902", "0.53706026", "0.5361865", "0.5361865", "0.535969", "0.5353975", "0.53477705", "0.53477705", "0.5345207", "0.5342636", "0.53422594", "0.53416336", "0.5336411", "0.5335509", "0.53315264", "0.532982", "0.53282136", "0.5314627", "0.5313281", "0.53078866", "0.53078866", "0.53067803", "0.5306706", "0.53028506", "0.53003883", "0.52860355", "0.5281242" ]
0.5319376
90
export this to target, dynamic property
void export(Context target){ for (String str : export.keySet()){ if (export(str)){ target.export(str, get(str)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getTarget();", "Object getTarget();", "@Override\n\tpublic VType getTarget() {\n\t\t// TODO: Add your code here\n\t\treturn super.to;\n\t}", "Variable getTargetVariable();", "public String getSetPropertyTarget() {\n \n return this.setPropertyTarget;\n }", "public Object getTargetValue(String name, Object def);", "public Object getTarget()\n {\n return __m_Target;\n }", "@InVertex\n Object getTarget();", "private GetProperty(Builder builder) {\n super(builder);\n }", "@com.exedio.cope.instrument.Generated // customize with @WrapperType(genericConstructor=...)\n\t\tprivate Target(final com.exedio.cope.SetValue<?>... setValues){super(setValues);}", "String getTarget() {\r\n return this.target;\r\n }", "Target target();", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "public void copyTo(Options target) {\n if (target.getClass() != getClass()) {\n throw new IllegalArgumentException();\n }\n\n for (Field field : getClass().getFields()) {\n if (field.isAccessible() && !Modifier.isTransient(field.getModifiers())) {\n try {\n field.set(target, field.get(this));\n } catch (Exception e) {}\n }\n }\n\n }", "public void setSetPropertyTarget(String setPropertyTarget) {\n \n this.setPropertyTarget = setPropertyTarget;\n }", "@Override\n public String getTarget()\n {\n return null;\n }", "public Object getTargetObject() {\n return targetObject;\n }", "protected abstract IMapProperty<S, K, V> doGetDelegate(S source);", "public void setTargetValue(String name, Object def);", "void copyPropertiesToMetas( Object sourceAndTarget );", "@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();", "@JsonProperty(\"target\")\n public String getTarget() {\n return target;\n }", "public Target getTarget() {\n return target;\n }", "Attribute getTarget();", "public Value makeSetter() {\n Value r = new Value(this);\n r.setters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }", "public Object getTargetValue(int idx, Object def);", "@Accessor(qualifier = \"dataExportTarget\", type = Accessor.Type.GETTER)\n\tpublic ImpExExportMediaModel getDataExportTarget()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(DATAEXPORTTARGET);\n\t}", "void copyMetasToProperties( Object sourceAndTarget );", "public String getTarget() {\n return target;\n }", "public String getTarget() {\n return target;\n }", "String getTarget();", "String getTarget();", "public IAspectVariable<V> createNewVariable(PartTarget target);", "public void exportObject(Target paramTarget) throws RemoteException {\n/* 147 */ this.ep.exportObject(paramTarget);\n/* */ }", "public String getTarget() {\n return this.target;\n }", "public EObject getTarget() {\n\t\treturn adaptee.getTarget();\n\t}", "Property createProperty();", "public Living getTarget();", "@Override\r\n\tpublic void exportThis()\r\n\t{\n\t\tsuper.exportThis();\r\n\t}", "String getTargetVariablePart();", "public abstract Object getSource();", "public Name getTarget() {\n\t\treturn getSingleName();\n\t}", "public Mob getTarget() {\r\n return target.get();\r\n }", "@Accessor(qualifier = \"dataExportTarget\", type = Accessor.Type.SETTER)\n\tpublic void setDataExportTarget(final ImpExExportMediaModel value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(DATAEXPORTTARGET, value);\n\t}", "java.lang.String getTarget();", "java.lang.String getTarget();", "TAbstractType getTarget();", "@objid (\"8fb70c43-b102-4a64-9424-c7cc07d58fcf\")\n void setTarget(Instance value);", "public Target getTarget() {\n\n return target;\n }", "public ObjectSequentialNumber getTarget() {\n return target;\n }", "public void setTarget(DmcObjectName value) {\n DmcAttribute<?> attr = get(DmpDMSAG.__target);\n if (attr == null)\n attr = new DmcTypeNameContainerSV(DmpDMSAG.__target);\n \n try{\n attr.set(value);\n set(DmpDMSAG.__target,attr);\n }\n catch(DmcValueException ex){\n throw(new IllegalStateException(\"The alternative type specific set() method shouldn't throw exceptions!\",ex));\n }\n }", "public void setTargetValue(int idx, Object value);", "public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }", "public Target getTarget() {\n\t\treturn target;\n\t}", "public Target getTarget() {\n\t\treturn target;\n\t}", "public Target getTarget() {\n\t\treturn target;\n\t}", "Object getPropertytrue();", "public Object getTarget() {\n return this.endpoints;\n }", "public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}", "Path getTargetPath()\n {\n return targetPath;\n }", "public Object call(Context cx, Scriptable xxx, Scriptable thisObj, Object[] args) {\n\t\t\t Object newValue = args[0];\n\t\t\t valueStorage = newValue;\n\t\t\t finalTarget.put(finalTargetProp, scope, newValue);\n\t\t\t return null;\n\t\t\t}", "private SetProperty(Builder builder) {\n super(builder);\n }", "public PvtFieldMutator in(Object objInstance) {\n this.targetInstance = objInstance;\n return this;\n }", "public java.lang.String getTarget() {\n return target;\n }", "public Object setPossibleProperty( Map<String, Object> context, Object target, String name, Object value )\n throws OgnlException\n {\n Object result = null;\n OgnlContext ognlContext = (OgnlContext) context;\n\n try\n {\n if ( !OgnlRuntime.setMethodValue( ognlContext, target, name, value, true ) )\n {\n result = OgnlRuntime.setFieldValue( ognlContext, target, name, value ) ? null : OgnlRuntime.NotFound;\n }\n\n if ( result == OgnlRuntime.NotFound )\n {\n Method m = OgnlRuntime.getWriteMethod( target.getClass(), name );\n if ( m != null )\n {\n result = m.invoke( target, value );\n }\n }\n } catch ( OgnlException ex )\n {\n throw ex;\n } catch ( Exception ex )\n {\n throw new OgnlException( name, ex );\n }\n\n return result;\n }", "@Accessor(qualifier = \"mediasExportTarget\", type = Accessor.Type.GETTER)\n\tpublic ImpExExportMediaModel getMediasExportTarget()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(MEDIASEXPORTTARGET);\n\t}", "public Spatial getTarget() {\r\n return target;\r\n }", "PropertyCallExp createPropertyCallExp();", "T setUrlTarget(String urlTarget);", "@Override\r\n\tprotected Method getTargetMethod(MethodInvocation methodInvocation) {\r\n\t\treturn getTargetMethod(methodInvocation, getTargetClass(methodInvocation));\r\n\t}", "void generateWriteProperty2ContentValues(Builder methodBuilder, String beanName, TypeName beanClass, ModelProperty property);", "public AstNode getTarget() {\n return target;\n }", "public void setTarget(Object method)\n {\n __m_Target = method;\n }", "public PvtFieldMutator forField(String targetFieldName) {\n this.targetName = targetFieldName;\n return this;\n }", "ReferenceProperty createReferenceProperty();", "N getTarget();", "public Reference destination() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_DESTINATION);\n }", "public Formula encodeTarget() {\n\t\tConjunction result = new Conjunction(\"target\");\n\t\tSet<CArgument> T = CAF.getTarget();\n\t\tfor(CArgument t : T) {\n\t\t\tresult.addSubformula(new Atom(\"acc_\" + t.getName()));\n\t\t}\n\t\treturn result;\n\t}", "protected void setTarget(Command target) {\n\t\tproxy.setTarget(target);\n\t}", "public abstract T getSource();", "PropertyReference createPropertyReference();", "@Mixin(EntityPlayerSP.class)\npublic interface AccessorEntityPlayerSP {\n\n @Accessor(\"handActive\")\n void gsSetHandActive(boolean value);\n\n}", "protected MetadataClass getTargetClass() {\r\n return m_targetClass;\r\n }", "@JsonProperty(\"target\")\n public void setTarget(String target) {\n this.target = target;\n }", "State getTarget();", "@Override\n public void invoke(Stack stack) {\n try {\n StackEffect se = (StackEffect) stack.pop().object;\n Symbol fieldName = (Symbol) stack.pop().object;\n Object instance = stack.pop().object;\n Object value = stack.pop().object;\n CheckedType className = se.getOutputTypes().get(0);\n\n Field field = Class.forName(className.toSymbol().symbol).getField(fieldName.symbol);\n field.set(instance,value);\n stack.push( new JavaType(instance.getClass()), instance );\n } catch (NoSuchFieldException e) {\n throw new RuntimeException(\"Unable to set instance field.\",e);\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(\"Unable to set instance field.\",e);\n } catch (IllegalAccessException e) {\n throw new RuntimeException(\"Unable to set instance field.\",e);\n }\n }", "public Integer getTargetid() {\n return targetid;\n }", "TypeDec getTarget();", "@Accessor(qualifier = \"mediasExportTarget\", type = Accessor.Type.SETTER)\n\tpublic void setMediasExportTarget(final ImpExExportMediaModel value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(MEDIASEXPORTTARGET, value);\n\t}", "public String target(String target)\n {\n return target + \":\" + this.getPort();\n }", "public int getTargetType() {\n return targetType;\n }", "public void setTarget(String val)\r\n\t{\r\n\t\t_target = val;\r\n\t}", "public interface Target {\n\n /**\n * Activates (focuses) the target.\n *\n * @param targetId\n */\n void activateTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Attaches to the target with given id.\n *\n * @param targetId\n */\n @Returns(\"sessionId\")\n String attachToTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Attaches to the target with given id.\n *\n * @param targetId\n * @param flatten Enables \"flat\" access to the session via specifying sessionId attribute in the\n * commands.\n */\n @Returns(\"sessionId\")\n String attachToTarget(\n @ParamName(\"targetId\") String targetId,\n @Experimental @Optional @ParamName(\"flatten\") Boolean flatten);\n\n /** Attaches to the browser target, only uses flat sessionId mode. */\n @Experimental\n @Returns(\"sessionId\")\n String attachToBrowserTarget();\n\n /**\n * Closes the target. If the target is a page that gets closed too.\n *\n * @param targetId\n */\n @Returns(\"success\")\n Boolean closeTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Inject object to the target's main frame that provides a communication channel with browser\n * target.\n *\n * <p>Injected object will be available as `window[bindingName]`.\n *\n * <p>The object has the follwing API: - `binding.send(json)` - a method to send messages over the\n * remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that\n * will be called for the protocol notifications and command responses.\n *\n * @param targetId\n */\n @Experimental\n void exposeDevToolsProtocol(@ParamName(\"targetId\") String targetId);\n\n /**\n * Inject object to the target's main frame that provides a communication channel with browser\n * target.\n *\n * <p>Injected object will be available as `window[bindingName]`.\n *\n * <p>The object has the follwing API: - `binding.send(json)` - a method to send messages over the\n * remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that\n * will be called for the protocol notifications and command responses.\n *\n * @param targetId\n * @param bindingName Binding name, 'cdp' if not specified.\n */\n @Experimental\n void exposeDevToolsProtocol(\n @ParamName(\"targetId\") String targetId,\n @Optional @ParamName(\"bindingName\") String bindingName);\n\n /**\n * Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\n * one.\n */\n @Experimental\n @Returns(\"browserContextId\")\n String createBrowserContext();\n\n /** Returns all browser contexts created with `Target.createBrowserContext` method. */\n @Experimental\n @Returns(\"browserContextIds\")\n @ReturnTypeParameter(String.class)\n List<String> getBrowserContexts();\n\n /**\n * Creates a new page.\n *\n * @param url The initial URL the page will be navigated to.\n */\n @Returns(\"targetId\")\n String createTarget(@ParamName(\"url\") String url);\n\n /**\n * Creates a new page.\n *\n * @param url The initial URL the page will be navigated to.\n * @param width Frame width in DIP (headless chrome only).\n * @param height Frame height in DIP (headless chrome only).\n * @param browserContextId The browser context to create the page in.\n * @param enableBeginFrameControl Whether BeginFrames for this target will be controlled via\n * DevTools (headless chrome only, not supported on MacOS yet, false by default).\n * @param newWindow Whether to create a new Window or Tab (chrome-only, false by default).\n * @param background Whether to create the target in background or foreground (chrome-only, false\n * by default).\n */\n @Returns(\"targetId\")\n String createTarget(\n @ParamName(\"url\") String url,\n @Optional @ParamName(\"width\") Integer width,\n @Optional @ParamName(\"height\") Integer height,\n @Optional @ParamName(\"browserContextId\") String browserContextId,\n @Experimental @Optional @ParamName(\"enableBeginFrameControl\") Boolean enableBeginFrameControl,\n @Optional @ParamName(\"newWindow\") Boolean newWindow,\n @Optional @ParamName(\"background\") Boolean background);\n\n /** Detaches session with given id. */\n void detachFromTarget();\n\n /**\n * Detaches session with given id.\n *\n * @param sessionId Session to detach.\n * @param targetId Deprecated.\n */\n void detachFromTarget(\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);\n\n /**\n * Deletes a BrowserContext. All the belonging pages will be closed without calling their\n * beforeunload hooks.\n *\n * @param browserContextId\n */\n @Experimental\n void disposeBrowserContext(@ParamName(\"browserContextId\") String browserContextId);\n\n /** Returns information about a target. */\n @Experimental\n @Returns(\"targetInfo\")\n TargetInfo getTargetInfo();\n\n /**\n * Returns information about a target.\n *\n * @param targetId\n */\n @Experimental\n @Returns(\"targetInfo\")\n TargetInfo getTargetInfo(@Optional @ParamName(\"targetId\") String targetId);\n\n /** Retrieves a list of available targets. */\n @Returns(\"targetInfos\")\n @ReturnTypeParameter(TargetInfo.class)\n List<TargetInfo> getTargets();\n\n /**\n * Sends protocol message over session with given id.\n *\n * @param message\n */\n void sendMessageToTarget(@ParamName(\"message\") String message);\n\n /**\n * Sends protocol message over session with given id.\n *\n * @param message\n * @param sessionId Identifier of the session.\n * @param targetId Deprecated.\n */\n void sendMessageToTarget(\n @ParamName(\"message\") String message,\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);\n\n /**\n * Controls whether to automatically attach to new targets which are considered to be related to\n * this one. When turned on, attaches to all existing related targets as well. When turned off,\n * automatically detaches from all currently attached targets.\n *\n * @param autoAttach Whether to auto-attach to related targets.\n * @param waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use\n * `Runtime.runIfWaitingForDebugger` to run paused targets.\n */\n @Experimental\n void setAutoAttach(\n @ParamName(\"autoAttach\") Boolean autoAttach,\n @ParamName(\"waitForDebuggerOnStart\") Boolean waitForDebuggerOnStart);\n\n /**\n * Controls whether to automatically attach to new targets which are considered to be related to\n * this one. When turned on, attaches to all existing related targets as well. When turned off,\n * automatically detaches from all currently attached targets.\n *\n * @param autoAttach Whether to auto-attach to related targets.\n * @param waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use\n * `Runtime.runIfWaitingForDebugger` to run paused targets.\n * @param flatten Enables \"flat\" access to the session via specifying sessionId attribute in the\n * commands.\n */\n @Experimental\n void setAutoAttach(\n @ParamName(\"autoAttach\") Boolean autoAttach,\n @ParamName(\"waitForDebuggerOnStart\") Boolean waitForDebuggerOnStart,\n @Experimental @Optional @ParamName(\"flatten\") Boolean flatten);\n\n /**\n * Controls whether to discover available targets and notify via\n * `targetCreated/targetInfoChanged/targetDestroyed` events.\n *\n * @param discover Whether to discover available targets.\n */\n void setDiscoverTargets(@ParamName(\"discover\") Boolean discover);\n\n /**\n * Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\n * `true`.\n *\n * @param locations List of remote locations.\n */\n @Experimental\n void setRemoteLocations(@ParamName(\"locations\") List<RemoteLocation> locations);\n\n /** Issued when attached to target because of auto-attach or `attachToTarget` command. */\n @EventName(\"attachedToTarget\")\n @Experimental\n EventListener onAttachedToTarget(EventHandler<AttachedToTarget> eventListener);\n\n /**\n * Issued when detached from target for any reason (including `detachFromTarget` command). Can be\n * issued multiple times per target if multiple sessions have been attached to it.\n */\n @EventName(\"detachedFromTarget\")\n @Experimental\n EventListener onDetachedFromTarget(EventHandler<DetachedFromTarget> eventListener);\n\n /**\n * Notifies about a new protocol message received from the session (as reported in\n * `attachedToTarget` event).\n */\n @EventName(\"receivedMessageFromTarget\")\n EventListener onReceivedMessageFromTarget(EventHandler<ReceivedMessageFromTarget> eventListener);\n\n /** Issued when a possible inspection target is created. */\n @EventName(\"targetCreated\")\n EventListener onTargetCreated(EventHandler<TargetCreated> eventListener);\n\n /** Issued when a target is destroyed. */\n @EventName(\"targetDestroyed\")\n EventListener onTargetDestroyed(EventHandler<TargetDestroyed> eventListener);\n\n /** Issued when a target has crashed. */\n @EventName(\"targetCrashed\")\n EventListener onTargetCrashed(EventHandler<TargetCrashed> eventListener);\n\n /**\n * Issued when some information about a target has changed. This only happens between\n * `targetCreated` and `targetDestroyed`.\n */\n @EventName(\"targetInfoChanged\")\n EventListener onTargetInfoChanged(EventHandler<TargetInfoChanged> eventListener);\n}", "@Override\n public Vertex getTarget() {\n return targetVertex;\n }", "void copyPropertiesToMetas( Object source, Object target );", "ProxyValue createProxyValue();", "private void assign(DefinitionStmt stmt) {\n \n soot.Value rightOp = stmt.getRightOp();\n Value result;\n \n if (rightOp instanceof Immediate) {\n Immediate immediate = (Immediate) rightOp;\n result = immediate(stmt, immediate);\n } else if (rightOp instanceof ThisRef) {\n result = function.getParameterRef(1);\n } else if (rightOp instanceof ParameterRef) {\n ParameterRef ref = (ParameterRef) rightOp;\n int index = (sootMethod.isStatic() ? 1 : 2) + ref.getIndex();\n Value p = new VariableRef(\"p\" + index, getType(ref.getType()));\n result = widenToI32Value(p, isUnsigned(ref.getType()));\n } else if (rightOp instanceof CaughtExceptionRef) {\n result = call(BC_EXCEPTION_CLEAR, env);\n } else if (rightOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) rightOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n if (ref.getType() instanceof NullType) {\n // The base value is always null. Do a null check which will\n // always throw NPE.\n checkNull(stmt, base);\n return;\n } else {\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n result = call(getArrayLoad(ref.getType()), base, index);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n }\n } else if (rightOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) rightOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR, OBJECT_PTR));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new GetField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env, base);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) rightOp;\n FunctionRef fn = Intrinsics.getIntrinsic(sootMethod, stmt);\n if (fn == null) {\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new GetStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n }\n result = call(fn, env);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof Expr) {\n if (rightOp instanceof BinopExpr) {\n BinopExpr expr = (BinopExpr) rightOp;\n Type rightType = getLocalType(expr.getType());\n Variable resultVar = function.newVariable(rightType);\n result = resultVar.ref();\n Value op1 = immediate(stmt, (Immediate) expr.getOp1());\n Value op2 = immediate(stmt, (Immediate) expr.getOp2());\n if (rightOp instanceof AddExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Add(resultVar, op1, op2));\n } else {\n function.add(new Fadd(resultVar, op1, op2));\n }\n } else if (rightOp instanceof AndExpr) {\n function.add(new And(resultVar, op1, op2));\n } else if (rightOp instanceof CmpExpr) {\n Variable t1 = function.newVariable(I1);\n Variable t2 = function.newVariable(I1);\n Variable t3 = function.newVariable(resultVar.getType());\n Variable t4 = function.newVariable(resultVar.getType());\n function.add(new Icmp(t1, Condition.slt, op1, op2));\n function.add(new Icmp(t2, Condition.sgt, op1, op2));\n function.add(new Zext(t3, new VariableRef(t1), resultVar.getType()));\n function.add(new Zext(t4, new VariableRef(t2), resultVar.getType()));\n function.add(new Sub(resultVar, new VariableRef(t4), new VariableRef(t3)));\n } else if (rightOp instanceof DivExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LDIV : IDIV;\n result = call(f, env, op1, op2);\n } else {\n // float or double\n function.add(new Fdiv(resultVar, op1, op2));\n }\n } else if (rightOp instanceof MulExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Mul(resultVar, op1, op2));\n } else {\n function.add(new Fmul(resultVar, op1, op2));\n }\n } else if (rightOp instanceof OrExpr) {\n function.add(new Or(resultVar, op1, op2));\n } else if (rightOp instanceof RemExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LREM : IREM;\n result = call(f, env, op1, op2);\n } else {\n FunctionRef f = rightType == DOUBLE ? DREM : FREM;\n result = call(f, env, op1, op2);\n }\n } else if (rightOp instanceof ShlExpr || rightOp instanceof ShrExpr || rightOp instanceof UshrExpr) {\n IntegerType type = (IntegerType) op1.getType();\n int bits = type.getBits();\n Variable t = function.newVariable(op2.getType());\n function.add(new And(t, op2, new IntegerConstant(bits - 1, (IntegerType) op2.getType())));\n Value shift = t.ref();\n if (((IntegerType) shift.getType()).getBits() < bits) {\n Variable tmp = function.newVariable(type);\n function.add(new Zext(tmp, shift, type));\n shift = tmp.ref();\n }\n if (rightOp instanceof ShlExpr) {\n function.add(new Shl(resultVar, op1, shift));\n } else if (rightOp instanceof ShrExpr) {\n function.add(new Ashr(resultVar, op1, shift));\n } else {\n function.add(new Lshr(resultVar, op1, shift));\n }\n } else if (rightOp instanceof SubExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Sub(resultVar, op1, op2));\n } else {\n function.add(new Fsub(resultVar, op1, op2));\n }\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof CmplExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPL : DCMPL;\n function.add(new Call(resultVar, f, op1, op2));\n } else if (rightOp instanceof CmpgExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPG : DCMPG;\n function.add(new Call(resultVar, f, op1, op2));\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else if (rightOp instanceof CastExpr) {\n Value op = immediate(stmt, (Immediate) ((CastExpr) rightOp).getOp());\n soot.Type sootTargetType = ((CastExpr) rightOp).getCastType();\n soot.Type sootSourceType = ((CastExpr) rightOp).getOp().getType();\n if (sootTargetType instanceof PrimType) {\n Type targetType = getType(sootTargetType);\n Type sourceType = getType(sootSourceType);\n if (targetType instanceof IntegerType && sourceType instanceof IntegerType) {\n // op is at least I32 and has already been widened if source type had fewer bits then I32\n IntegerType toType = (IntegerType) targetType;\n IntegerType fromType = (IntegerType) op.getType();\n Variable v = function.newVariable(toType);\n if (fromType.getBits() < toType.getBits()) {\n // Widening\n if (isUnsigned(sootSourceType)) {\n function.add(new Zext(v, op, toType));\n } else {\n function.add(new Sext(v, op, toType));\n }\n } else if (fromType.getBits() == toType.getBits()) {\n function.add(new Bitcast(v, op, toType));\n } else {\n // Narrow\n function.add(new Trunc(v, op, toType));\n }\n result = widenToI32Value(v.ref(), isUnsigned(sootTargetType));\n } else if (targetType instanceof FloatingPointType && sourceType instanceof IntegerType) {\n // we always to a signed conversion since if op is char it has already been zero extended to I32\n Variable v = function.newVariable(targetType);\n function.add(new Sitofp(v, op, targetType));\n result = v.ref();\n } else if (targetType instanceof FloatingPointType && sourceType instanceof FloatingPointType) {\n Variable v = function.newVariable(targetType);\n if (targetType == FLOAT && sourceType == DOUBLE) {\n function.add(new Fptrunc(v, op, targetType));\n } else if (targetType == DOUBLE && sourceType == FLOAT) {\n function.add(new Fpext(v, op, targetType));\n } else {\n function.add(new Bitcast(v, op, targetType));\n }\n result = v.ref();\n } else {\n // F2I, F2L, D2I, D2L\n FunctionRef f = null;\n if (targetType == I32 && sourceType == FLOAT) {\n f = F2I;\n } else if (targetType == I64 && sourceType == FLOAT) {\n f = F2L;\n } else if (targetType == I32 && sourceType == DOUBLE) {\n f = D2I;\n } else if (targetType == I64 && sourceType == DOUBLE) {\n f = D2L;\n } else {\n throw new IllegalArgumentException();\n }\n Variable v = function.newVariable(targetType);\n function.add(new Call(v, f, op));\n result = v.ref();\n }\n } else {\n if (sootTargetType instanceof soot.ArrayType \n && ((soot.ArrayType) sootTargetType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) sootTargetType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(CHECKCAST_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(sootTargetType);\n Trampoline trampoline = new Checkcast(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n }\n } else if (rightOp instanceof InstanceOfExpr) {\n Value op = immediate(stmt, (Immediate) ((InstanceOfExpr) rightOp).getOp());\n soot.Type checkType = ((InstanceOfExpr) rightOp).getCheckType();\n if (checkType instanceof soot.ArrayType \n && ((soot.ArrayType) checkType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) checkType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(INSTANCEOF_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(checkType);\n Trampoline trampoline = new Instanceof(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n } else if (rightOp instanceof NewExpr) {\n String targetClassName = getInternalName(((NewExpr) rightOp).getBaseType());\n FunctionRef fn = null;\n if (targetClassName.equals(this.className)) {\n fn = FunctionBuilder.allocator(sootMethod.getDeclaringClass()).ref();\n } else {\n Trampoline trampoline = new New(this.className, targetClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env);\n } else if (rightOp instanceof NewArrayExpr) {\n NewArrayExpr expr = (NewArrayExpr) rightOp;\n Value size = immediate(stmt, (Immediate) expr.getSize());\n if (expr.getBaseType() instanceof PrimType) {\n result = call(getNewArray(expr.getBaseType()), env, size);\n } else {\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Anewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, size);\n }\n } else if (rightOp instanceof NewMultiArrayExpr) {\n NewMultiArrayExpr expr = (NewMultiArrayExpr) rightOp;\n if (expr.getBaseType().numDimensions == 1 && expr.getBaseType().getElementType() instanceof PrimType) {\n Value size = immediate(stmt, (Immediate) expr.getSize(0));\n result = call(getNewArray(expr.getBaseType().getElementType()), env, size);\n } else {\n for (int i = 0; i < expr.getSizeCount(); i++) {\n Value size = immediate(stmt, (Immediate) expr.getSize(i));\n Variable ptr = function.newVariable(new PointerType(I32));\n function.add(new Getelementptr(ptr, dims.ref(), 0, i));\n function.add(new Store(size, ptr.ref()));\n }\n Variable dimsI32 = function.newVariable(new PointerType(I32));\n function.add(new Bitcast(dimsI32, dims.ref(), dimsI32.getType()));\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Multianewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, new IntegerConstant(expr.getSizeCount()), dimsI32.ref());\n }\n } else if (rightOp instanceof InvokeExpr) {\n result = invokeExpr(stmt, (InvokeExpr) rightOp);\n } else if (rightOp instanceof LengthExpr) {\n Value op = immediate(stmt, (Immediate) ((LengthExpr) rightOp).getOp());\n checkNull(stmt, op);\n Variable v = function.newVariable(I32);\n function.add(new Call(v, ARRAY_LENGTH, op));\n result = v.ref();\n } else if (rightOp instanceof NegExpr) {\n NegExpr expr = (NegExpr) rightOp;\n Value op = immediate(stmt, (Immediate) expr.getOp());\n Type rightType = op.getType();\n Variable v = function.newVariable(op.getType());\n if (rightType instanceof IntegerType) {\n function.add(new Sub(v, new IntegerConstant(0, (IntegerType) rightType), op));\n } else {\n function.add(new Fmul(v, new FloatingPointConstant(-1.0, (FloatingPointType) rightType), op));\n }\n result = v.ref();\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n \n soot.Value leftOp = stmt.getLeftOp();\n \n if (leftOp instanceof Local) {\n Local local = (Local) leftOp;\n VariableRef v = new VariableRef(local.getName(), new PointerType(getLocalType(leftOp.getType())));\n function.add(new Store(result, v, !sootMethod.getActiveBody().getTraps().isEmpty()));\n } else {\n Type leftType = getType(leftOp.getType());\n Value narrowedResult = narrowFromI32Value(leftType, result);\n if (leftOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) leftOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n if (leftOp.getType() instanceof RefLikeType) {\n call(BC_SET_OBJECT_ARRAY_ELEMENT, env, base, index, narrowedResult);\n } else {\n call(getArrayStore(leftOp.getType()), base, index, narrowedResult);\n }\n } else if (leftOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) leftOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, OBJECT_PTR, getType(ref.getType())));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new PutField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, base, narrowedResult);\n } else if (leftOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) leftOp;\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, getType(ref.getType())));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new PutStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, narrowedResult);\n } else {\n throw new IllegalArgumentException(\"Unknown type for leftOp: \" + leftOp.getClass());\n }\n }\n }", "public void setTarget(NameContainer value) {\n DmcAttribute<?> attr = get(DmpDMSAG.__target);\n if (attr == null)\n attr = new DmcTypeNameContainerSV(DmpDMSAG.__target);\n \n try{\n attr.set(value);\n set(DmpDMSAG.__target,attr);\n }\n catch(DmcValueException ex){\n throw(new IllegalStateException(\"The type specific set() method shouldn't throw exceptions!\",ex));\n }\n }", "public Object getDestination() { return this.d; }", "public void setProperty(String name,Object value)\n {\n ClassAnalyzer.setProperty(m_Source,name,value);\n }" ]
[ "0.5897469", "0.5897469", "0.57513446", "0.5699069", "0.5660019", "0.5503112", "0.5473593", "0.5369564", "0.5343552", "0.5302256", "0.52952445", "0.5275761", "0.5267681", "0.5267681", "0.52664053", "0.52557856", "0.5234724", "0.52119446", "0.5186113", "0.5179116", "0.5173854", "0.5161386", "0.51561767", "0.51500845", "0.5144781", "0.5141104", "0.5125128", "0.51166034", "0.51048464", "0.509337", "0.509337", "0.50919074", "0.50919074", "0.50673157", "0.50613886", "0.50523174", "0.50480217", "0.5046882", "0.5045088", "0.5042686", "0.50316554", "0.50287247", "0.502843", "0.502579", "0.5018188", "0.50170463", "0.50170463", "0.5009057", "0.50010437", "0.49986902", "0.49872756", "0.49837267", "0.49771488", "0.49741754", "0.49725655", "0.49725655", "0.49725655", "0.4959877", "0.49540457", "0.4947328", "0.49465162", "0.494265", "0.49410796", "0.49409702", "0.49163753", "0.49094212", "0.49085605", "0.48969367", "0.4888492", "0.48729017", "0.48693448", "0.48596168", "0.4851063", "0.4846255", "0.4830422", "0.48267648", "0.48261", "0.48255876", "0.48254383", "0.48234916", "0.48140064", "0.48109737", "0.48016393", "0.4794356", "0.479199", "0.47744742", "0.47710735", "0.4768087", "0.47569856", "0.47568485", "0.47521132", "0.47510502", "0.47488317", "0.47461995", "0.47443083", "0.47417116", "0.4739178", "0.4736636", "0.47359368", "0.47288373", "0.4724745" ]
0.0
-1
add values clause to query
public Context addValue(String value) { String squery = getQueryString(); if (getURI() == null && squery != null) { setQueryString(squery + value); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static DbQuery createValueQuery() {\n DbQuery query = new DbQuery();\n query.order = OrderBy.VALUE;\n return query;\n }", "@Override\n\t\tpublic String toSQL() {\n\t\t\tStringBuilder sb=new StringBuilder();\n\t\t\tsb.append(fieldName).append(\" IN (\");\n\t\t\tboolean first=true;\n\t\t\tfor(Object o :values) {\n\t\t\t\tif(first) {\n\t\t\t\t\tfirst=false;\n\t\t\t\t}else {\n\t\t\t\t\tsb.append(\",\");\n\t\t\t\t}\n\t\t\t\tsb.append(toSql(o));\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\treturn sb.toString() ;\n\t\t}", "@Test\n\tpublic void testValuesClause() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query_values.rq\", \"/tests/basic/query_values.srx\", false);\n\t}", "public InsertStatement values(AliasedFieldBuilder... fieldValues) {\r\n return copyOnWriteOrMutate(\r\n b -> b.values(fieldValues),\r\n () -> {\r\n if (fromTable != null) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a literal set of field values and a from table.\");\r\n }\r\n if (selectStatement != null) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a literal set of field values and a sub-select statement.\");\r\n }\r\n this.values.addAll(Builder.Helper.buildAll(Lists.newArrayList(fieldValues)));\r\n }\r\n );\r\n }", "private String bindData(Array value, ArrayList params) {\n String op;\n \n if (operator == null) {\n op = null;\n } else if (operator.equals(\"=\")) {\n op = \"IN\";\n } else if (operator.equals(\"!=\")) {\n op = \"NOT IN\";\n } else {\n op = operator;\n }\n if (value.size() <= 0) {\n return bindNull();\n } else {\n return cond(column, op, literal(value));\n }\n }", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "Builder values(Map<Path<?>, TypedExpression<?>> values);", "QuerySql addParamer(Object... paramers);", "public void addWhereIn(String attributeName, Collection values, String operator) {\r\n\t\tif (!values.isEmpty()) {\r\n\t\t\tString valueListString = StringUtils.join(values, ',');\r\n\t\t\taddWhere(attributeName + \" in (\"+valueListString+\")\", operator);\r\n\t\t}\r\n\t}", "private void appendSelectStatement() {\n builder.append(SELECT).append(getSelectedFields()).append(FROM);\n }", "void setOrderedQueryParameter(Query query, T value);", "public void addResult(List<String> columnHeaders, List<List<String>> rowValues) {\n }", "Condition in(QueryParameter parameter, Object... values);", "protected void addParameter(Query query, String name, Object value) {\n\t\tif (value != null) {\n\t\t\tquery.setParameter(name, value);\n\t\t}\n\t}", "public Query createQuery(String hql, Object... values) {\n Assert.hasText(hql);\n Query query = getSession().createQuery(hql);\n for (int i = 0; i < values.length; i++) {\n query.setParameter(i, values[i]);\n }\n return query;\n }", "public void setValQuery (String valQuery) {\n this.valQuery = valQuery;\n }", "public Builder addAllParameters(java.lang.Iterable<? extends datawave.webservice.query.QueryMessages.QueryImpl.Parameter> values) {\n ensureParametersIsMutable();\n super.addAll(values, parameters_);\n\n return this;\n }", "public void addValue(Row value)\n\t{\n\t\tallValues.add(value);\n\t}", "@Test\n public void testNamedParamWithImmediateValue() {\n List<Long> ids = Arrays.asList(10L, 5L);\n Person personProxy = query.from(Person.class);\n query.where(personProxy.getId()).in().named(NAMED_PARAM_1, ids);\n\n validate(\" from Person hobj1 where hobj1.id in (:np1)\", ids);\n }", "private String addParametersAsLiterals(fyiReporting.RDL.Report rpt, IDbConnection cn, String sql, boolean bValue) throws Exception {\n if (this._QueryParameters == null || this._QueryParameters.getItems() == null || this._QueryParameters.getItems().Count == 0)\n return sql;\n \n // Only do this for ODBC datasources - AddParameters handles it in other cases\n if (!RdlEngineConfig.doParameterReplacement(getProvider(),cn))\n {\n if (!_QueryParameters.getContainsArray())\n return sql;\n \n }\n \n // when array we do substitution\n StringBuilder sb = new StringBuilder(sql);\n List<QueryParameter> qlist = new List<QueryParameter>();\n if (_QueryParameters.getItems().Count <= 1)\n qlist = _QueryParameters.getItems();\n else\n {\n // need to sort the list so that longer items are first in the list\n // otherwise substitution could be done incorrectly\n qlist = new List<QueryParameter>(_QueryParameters.getItems());\n qlist.Sort();\n } \n for (Object __dummyForeachVar12 : qlist)\n {\n QueryParameter qp = (QueryParameter)__dummyForeachVar12;\n String paramName = new String();\n // force the name to start with @\n if (qp.getName().getNm()[0] == '@')\n paramName = qp.getName().getNm();\n else\n paramName = \"@\" + qp.getName().getNm(); \n // build the replacement value\n String svalue = new String();\n if (bValue)\n {\n // use the value provided\n svalue = this.parameterValue(rpt,qp);\n }\n else\n {\n // just need a place holder value that will pass parsing\n TypeCode __dummyScrutVar1 = qp.getValue().getExpr().getTypeCode();\n if (__dummyScrutVar1.equals(TypeCode.Char))\n {\n svalue = \"' '\";\n }\n else if (__dummyScrutVar1.equals(TypeCode.DateTime))\n {\n svalue = \"'1900-01-01 00:00:00'\";\n }\n else if (__dummyScrutVar1.equals(TypeCode.Decimal) || __dummyScrutVar1.equals(TypeCode.Double) || __dummyScrutVar1.equals(TypeCode.Int32) || __dummyScrutVar1.equals(TypeCode.Int64))\n {\n svalue = \"0\";\n }\n else if (__dummyScrutVar1.equals(TypeCode.Boolean))\n {\n svalue = \"'false'\";\n }\n else\n {\n svalue = \"' '\";\n } \n } \n sb.Replace(paramName, svalue);\n }\n return sb.ToString();\n }", "public ResultSet query(String cql, Object ... values) {\n\t\tLog.v(LOG_TAG, \" Query: \" + cql);\n\t\tList<Object> cqlSafeValues = this.getCqlSafeValues(values);\n\t\ttry {\t\t\t\n\t\t\tPreparedStatement prepared = this.getSession().prepare(cql);\n\t\t\tBoundStatement boundStatement = new BoundStatement(prepared);\n\t\t\tResultSet results;\n\t\t\tif (cqlSafeValues.size() > 0) {\n\t\t\t\tresults = this.getSession().execute(boundStatement.bind(cqlSafeValues.toArray()));\n\t\t\t} else {\n\t\t\t\tresults = this.getSession().execute(boundStatement);\n\t\t\t}\n\t\t\treturn results;\n\t\t} catch (Exception e) {\n\t\t\tLog.e(LOG_TAG, e);\n\t\t\tthrow new DatastoreServiceException(e);\t\t\t\n\t\t}\t\t\n\t}", "private List<Map<String, String>> getValues(String select, String where,\n\t String tableName, String uri) throws MediatorException {\n\t// prepare query; replace relevant object name with the uri\n\tString newQuery = where;\n\tnewQuery = newQuery.replaceAll(\"\\\\?o_\" + tableName + \" \", \"<\" + uri\n\t\t+ \"> \");\n\t// System.out.println(\"newq=\" + newQuery);\n\n\treturn JenaUtil.executeQueryExtractValues(model, select + newQuery);\n }", "@Override\r\n\tpublic void addValues(final IScope scope, final IContainer values) {}", "private void appendQueryContinueValues(String query, HttpUrl.Builder urlBuilder) {\n Map<String, String> continueValues = getContinueValues(query);\n if (continueValues != null && continueValues.size() > 0) {\n for (Map.Entry<String, String> entry : continueValues.entrySet()) {\n urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n }\n }\n }", "public List<?> queryByCriteria(List<String> fields, List<Object> values,\n List<String> operands) throws DataAccessLayerException {\n return queryByCriteria(fields, values, operands, null, null, false);\n }", "private String addWhere(String hql, Map<String, Object> params) {\n\t\t\thql += \" where \";\n\t\t\tint temp=0;\n\t\t\tif (params != null && !params.isEmpty()) {\n\t\t\t\tfor (String key : params.keySet()) {\n\t\t\t\t\tif(temp!=0){\n\t\t\t\t\t\thql+=\" and \";\n\t\t\t\t\t}\n\t\t\t\t\thql += \"t.\"+key+\"=:\"+key;\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hql;\n\t}", "Values values();", "public List<?> queryByCriteria(List<String> fields, List<Object> values,\n List<String> operands, String orderBy, boolean orderAscending)\n throws DataAccessLayerException {\n return queryByCriteria(fields, values, operands, null, orderBy,\n orderAscending);\n }", "private void addParameters(fyiReporting.RDL.Report rpt, IDbConnection cn, IDbCommand cmSQL, boolean bValue) throws Exception {\n if (this._QueryParameters == null || this._QueryParameters.getItems() == null || this._QueryParameters.getItems().Count == 0 || this._QueryParameters.getContainsArray())\n return ;\n \n // arrays get handled by AddParametersAsLiterals\n // AddParametersAsLiterals handles it when there is replacement\n if (RdlEngineConfig.doParameterReplacement(getProvider(),cn))\n return ;\n \n for (Object __dummyForeachVar11 : this._QueryParameters.getItems())\n {\n QueryParameter qp = (QueryParameter)__dummyForeachVar11;\n String paramName = new String();\n // force the name to start with @\n if (qp.getName().getNm()[0] == '@')\n paramName = qp.getName().getNm();\n else\n paramName = \"@\" + qp.getName().getNm(); \n Object pvalue = bValue ? qp.getValue().evaluate(rpt,null) : null;\n IDbDataParameter dp = cmSQL.CreateParameter();\n dp.ParameterName = paramName;\n if (pvalue instanceof ArrayList)\n {\n // Probably a MultiValue Report parameter result\n ArrayList ar = (ArrayList)pvalue;\n dp.Value = ar.ToArray(ar[0].GetType());\n }\n else\n dp.Value = pvalue; \n cmSQL.Parameters.Add(dp);\n }\n }", "private void select(String tableName, String colName, String value,\n boolean usePar) {\n String query;\n \n if (usePar == true){\n // Parenthesis will surrond the value making it a string\n query = \"SELECT * FROM \" + tableName + \" WHERE \" + colName + \" = \\'\" + value + \"\\'\";\n }\n else{\n // Parenthesis will not surround the value\n query = \"SELECT * FROM \" + tableName + \" WHERE \" + colName + \" = \" + value;\n }\n \n this.executeSelect(query);\n }", "public Builder addAllQueries(\n java.lang.Iterable<? extends WorldUps.UQuery> values) {\n if (queriesBuilder_ == null) {\n ensureQueriesIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, queries_);\n onChanged();\n } else {\n queriesBuilder_.addAllMessages(values);\n }\n return this;\n }", "@Override\n\tpublic TypedQuery<Plan> constructQuery(Map<String, String> customQuery) {\n\t\tCriteriaBuilder cb = null;\n\t\ttry {\n\t\t\tcb = em.getCriteriaBuilder();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tCriteriaQuery<Plan> cq = cb.createQuery(Plan.class);\n\t\tRoot<Plan> plan = cq.from(Plan.class);\n\t\tPredicate existingpredicate = null;\n\t\tint predicateCount=0;\n\t\tPredicate masterPredicate=null;\n\n\t\ttry {\n\n\t\t\tfor (Map.Entry<String,String> entry : customQuery.entrySet()) \n\t\t\t{\n\t\t\t\tif(plan.get(entry.getKey().toString()) != null)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Query for range values with comma(,) as delimiter\n\t\t\t\t\tif(entry.getValue().contains(\",\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tint minRange=Integer.parseInt(customQuery.get(entry.getKey().toString()).split(\",\")[0]);\n\t\t\t\t\t\tint maxRange=Integer.parseInt(customQuery.get(entry.getKey().toString()).split(\",\")[1]);\n\t\t\t\t\t\tif(predicateCount==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmasterPredicate = cb.between(plan.get(entry.getKey().toString()),minRange, maxRange );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texistingpredicate = cb.between(plan.get(entry.getKey().toString()),minRange, maxRange );\n\t\t\t\t\t\t\tmasterPredicate=cb.and(masterPredicate,existingpredicate);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpredicateCount++;\n\t\t\t\t\t}\n\t\t\t\t\t//Query for equals values\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(predicateCount==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmasterPredicate = cb.equal(plan.get(entry.getKey().toString()), customQuery.get(entry.getKey().toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texistingpredicate = cb.equal(plan.get(entry.getKey().toString()), customQuery.get(entry.getKey().toString()));\n\t\t\t\t\t\t\tmasterPredicate=cb.and(masterPredicate,existingpredicate);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpredicateCount++;\n\t\t\t\t\t\t//cq.where(predicate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcq.where(masterPredicate);\n\t\tTypedQuery<Plan> query = em.createQuery(cq);\n\t\treturn query;\n\t}", "private boolean update(String table,Where where, Column...values) throws SQLException {\n\n StringBuilder builder = new StringBuilder();\n\n for(Column value : values)\n builder.append(value.getKey()).append(\" = \").append(\"?,\");\n\n builder.deleteCharAt(builder.length()-1);\n\n String query =\"UPDATE \"+table+\" SET \"+builder.toString()+\" WHERE \"+where.syntax;\n PreparedStatement statement = connection.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);\n\n int index = 1;\n for(Column obj : values)\n if(!obj.shouldIgnore())\n statement.setObject(index++,obj.getValue());\n\n for(Object o : where.values)\n statement.setObject(index++,o);\n\n return statement.executeUpdate() != 0;\n }", "ParamValueRelation createParamValueRelation();", "public Sql appendList(Object[] value) {\n\n if (value == null) {\n return this;\n }\n \n formatted = false;\n \n for (int i = 0; i < value.length; i++) {\n if (i > 0) {\n appendBuffer.append(\", \");\n }\n if (value[i] instanceof Number) {\n appendBuffer.append(value[i].toString());\n } else {\n appendBuffer.append('\\'');\n appendBuffer.append(value[i].toString());\n appendBuffer.append('\\'');\n }\n }\n \n return this;\n }", "@SuppressWarnings(\"unused\")\n\t\tprivate String querySingleValue(String query, String field){\n\t\t\treturn field;\n\n\t\t/*\tJdbcTemplate jdt = new JdbcTemplate(getDataSource());\n\t \tList queryList;\n\t \tString result = \"\";\n\n\t \t queryList = jdt.queryForList(query);\n\t \t Iterator i = queryList.iterator();\n\t \t i = queryList.iterator();\n\t \t if (i.hasNext()) {\n\t\t\t\t ListOrderedMap data = (ListOrderedMap) i.next();\n\t\t\t\t if (data.get(field) == null){\n\t\t\t\t } else {\n\t\t\t\t\t result = data.get(field).toString();\n\t\t\t\t }\n\t \t }\n\t \t return result;*/\n\t\t}", "private QueryCondition buildConditionForQueryFromCondition(ParameterContext context, \r\n\t\t\tSet<String> includedTables, IConditionalQuery query, Condition condition, Object params[])\r\n\t{\r\n\t\tObject value = null;\r\n\t\t\t\t\r\n\t\t// fetch the value for current condition\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//for non-method level conditions fetch the value\r\n\t\t\tif(condition.index >= 0)\r\n\t\t\t{\r\n\t\t\t\tvalue = PropertyUtils.getProperty(context, condition.getConditionExpression());\r\n\t\t\t\t\r\n\t\t\t\tif(condition.fieldDetails != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tvalue = context.queryExecutionContext.getConversionService().convertToDBType(value, condition.fieldDetails);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//for method level conditions like null-checks and others use default value from condition\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tString strValue = condition.defaultValue;\r\n\t\t\t\t\r\n\t\t\t\t//if no repo context is specified assume empty object\r\n\t\t\t\tObject repoContext = context.queryExecutionContext.getRepositoryExecutionContext();\r\n\t\t\t\trepoContext = (repoContext != null) ? repoContext : Collections.emptyMap(); \r\n\t\t\t\t\r\n\t\t\t\t//if value is present check for expressions and replace them\r\n\t\t\t\tif(strValue != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValue = CommonUtils.replaceExpressions(repoContext, condition.defaultValue, null);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvalue = ConvertUtils.convert(strValue, condition.fieldDetails.getField().getType());\r\n\t\t\t}\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tthrow new IllegalStateException(\"An error occurred while fetching condition value for expression -\" + condition.getConditionExpression(), ex);\r\n\t\t}\r\n\t\t\r\n\t\tif(value instanceof Enum)\r\n\t\t{\r\n\t\t\tvalue = \"\" + value;\r\n\t\t}\r\n\t\t\r\n\t\tQueryCondition groupHead = null;\r\n\r\n\t\t// if value is not provided, ignore current condition\r\n\t\tif(value != null || (condition.operator.isNullable() && condition.nullable))\r\n\t\t{\r\n\t\t\t// add tables and conditions to specifies query\r\n\t\t\taddTables(query, condition.table.tableCode, includedTables);\r\n\t\t\t\r\n\t\t\tgroupHead = new QueryCondition(condition.table.tableCode, condition.fieldDetails.getDbColumnName(), condition.operator, value, condition.joinOperator, condition.ignoreCase);\r\n\t\t\tgroupHead.setDataType(condition.fieldDetails.getDbDataType());\r\n\t\t}\r\n\r\n\t\t//if no group conditions are present on this query\r\n\t\tif(condition.getGroupedConditions() == null)\r\n\t\t{\r\n\t\t\treturn groupHead;\r\n\t\t}\r\n\t\t\r\n\t\taddGroupConditions(groupHead, condition.getGroupedConditions(), context, includedTables, query, params);\r\n\t\treturn groupHead;\r\n\t}", "private void putContinueValues(String keyword, Map<String, String> values) {\n defaultKvStore.putJson(\"query_continue_\" + keyword, values);\n }", "RowValues createRowValues();", "public String getValQuery () {\n return valQuery;\n }", "public void addValues(String[] values) {\n this.values.addAll(Arrays.asList(values));\n }", "public List<?> queryByCriteria(List<String> fields, List<Object> values)\n throws DataAccessLayerException {\n return queryByCriteria(fields, values, null, null, null, false);\n }", "SelectQuery createSelectQuery();", "public CriteriaQuery query(List<CriteriaGroup> query) {\n this.query = query;\n return this;\n }", "private void bindValues(SQLiteStatement stmt, JSArray values) throws JSONException {\n for (int i = 0; i < values.length(); i++) {\n if (values.get(i) instanceof Float || values.get(i) instanceof Double) {\n stmt.bindDouble(i + 1, values.getDouble(i));\n } else if (values.get(i) instanceof Number) {\n stmt.bindLong(i + 1, values.getLong(i));\n } else if (values.isNull(i)) {\n stmt.bindNull(i + 1);\n } else {\n String str = values.getString(i);\n if (str.toUpperCase().equals(\"NULL\")) {\n stmt.bindNull(i + 1);\n } else {\n stmt.bindString(i + 1, str);\n }\n }\n }\n }", "public void setFieldValues(String op, List values)\n {\n if (op == null || op.trim().length() == 0)\n throw new IllegalArgumentException(\n \"operator must not be null or empty\");\n\n if (!isValidOperator(op))\n throw new IllegalArgumentException(\n \"Invalid operator specified for search field\");\n\n if (setValues(op, null, values))\n setDirty();\n }", "public Query all(String key, Object[] value) {\n Preconditions.checkNotNull(key);\n builder.addFilter(builder.getOperator(QueryFilterBuilder.Operators.ALL), key, value);\n return this;\n }", "public static void QueryVector() {\n for(Entry<String, List<Double>> entry: wtgMap.entrySet()){\n List<Double> queryValue = new ArrayList();\n queryValue = entry.getValue();\n double temp = queryValue.get(totaldocument);\n\n query.add(temp);\n }\n }", "private String buildQuery(String ... sql) {\n\t\tfinal StringBuffer sb = new StringBuffer();\n\t\t\n\t\tfor (String s : sql) {\n\t\t\tsb.append(ParsingUtil.QUERY + \" \" + s + \"\\n\");\n\t\t}\n\t\t\n\t\treturn sb.toString(); \n\t}", "public void addFieldAndValueInWhereClauseToDBOpEntry(DatabaseTable dbT,\n\t\t\tString whereClause, DBOpEntry dbOpEntry) throws SQLException {\n\t\t//add all primary key to the entry\n\t\tString[] primaryKeyPairs = whereClause.split(\"AND\");\n\t\tassert(primaryKeyPairs.length == dbT.get_Primary_Key_List().size());\n\t\tfor(int i = 0; i < primaryKeyPairs.length; i++) {\n\t\t\tString primaryKeyPair = primaryKeyPairs[i].replaceAll(\"\\\\s+\", \"\");\n\t\t\tString[] fieldAndValue = primaryKeyPair.split(\"=\");\n\t\t\tDataField df = dbT.get_Data_Field(fieldAndValue[0]);\n\t\t\tPrimitiveType pt = CrdtFactory.generateCrdtPrimitiveType(this.getDateFormat(), df, fieldAndValue[1], null);\n\t\t\tdbOpEntry.addPrimaryKey(pt);\n\t\t}\n\t}", "@Override\n public String getPreparedStatementQuery() throws SQLException {\n StringBuilder sb = new StringBuilder();\n\n String statementQuery = getStatementQuery();\n\n // iterate over the characters in the query replacing the parameter placeholders\n // with the actual values\n int currentParameter = 0;\n for( int pos = 0; pos < statementQuery.length(); pos ++) {\n char character = statementQuery.charAt(pos);\n if( statementQuery.charAt(pos) == '?' && currentParameter < getParameterCount()) {\n // replace with parameter value\n boolean shouldQuote = true;\n switch( parameterMetaData.getParameterType(currentParameter+1)) {\n case Types.BIT:\n case Types.TINYINT:\n case Types.SMALLINT:\n case Types.INTEGER:\n case Types.BIGINT:\n case Types.FLOAT:\n case Types.REAL:\n case Types.DOUBLE:\n case Types.NUMERIC:\n case Types.DECIMAL:\n case Types.BOOLEAN:\n shouldQuote = false;\n }\n if( parameterValues.get(currentParameter) == null) {\n sb.append(\"NULL\");\n } else {\n if( shouldQuote ) {\n sb.append(\"'\");\n }\n sb.append(parameterValues.get(currentParameter));\n if( shouldQuote ) {\n sb.append(\"'\");\n }\n }\n currentParameter++;\n } else {\n sb.append(character);\n }\n }\n\n return sb.toString();\n }", "default void append(QueryCursor cursor, String... templateProperties){\n int i = 0, len = templateProperties.length;\n for (; i < len; i++) {\n String propertyName = templateProperties[i];\n String value = null;\n try {\n value = cursor.getString(propertyName);\n }catch (Throwable t){\n logger.error(\"according column name to result set to get column value find a fail, {}\", t);\n }\n if(StringUtils.isEmpty(value)){\n value = \"\";\n }\n append(propertyName, value);\n builder().append(\",\");\n }\n }", "protected void _appendWhere(String dbsel, int op)\n {\n // WARNING: this does not make sure this selection is valid.\n String sel = StringTools.trim(dbsel);\n //Print.logInfo(\"AppendWhere: \" + sel);\n\n /* clear existing selection if 'SET' */\n if (op == WHERE_SET) {\n this.whSelect.setLength(0);\n if (!sel.equals(\"\")) {\n this.whSelect.append(\"(\");\n this.whSelect.append(sel);\n this.whSelect.append(\")\");\n }\n return;\n }\n \n /* append selection (if specified) */\n if (!sel.equals(\"\")) {\n // AND/OR selection\n if (this.whSelect.length() > 0) {\n // \"( <OldSelect> AND/OR ( <AdditionalSelect> ) )\"\n this.whSelect.insert(0,\"(\");\n if (op == WHERE_OR) {\n this.whSelect.append(\" OR \");\n } else {\n this.whSelect.append(\" AND \");\n }\n this.whSelect.append(\"(\");\n this.whSelect.append(sel);\n this.whSelect.append(\"))\");\n } else {\n // no prior selection criteria\n this.whSelect.append(\"(\");\n this.whSelect.append(sel);\n this.whSelect.append(\")\");\n }\n }\n\n }", "void collect(){\r\n\t\tif (getValues() != null){\r\n\t\t\tfor (Variable var : getValues().getVariables()){\r\n\t\t\t\tdefSelect(var);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "List<ReportPair> getParameterValues(String hsql);", "ColumnOperand createColumnOperand();", "public MappedQuery generateSql( Query query, String locale, IMetadataDomainRepository repo,\n DatabaseMeta databaseMeta, Map<String, Object> parameters, boolean genAsPreparedStatement )\n throws PentahoMetadataException {\n\n Constraint securityConstraint = null;\n\n if ( repo != null ) {\n String mqlSecurityConstraint = repo.generateRowLevelSecurityConstraint( query.getLogicalModel() );\n if ( StringUtils.isNotBlank( mqlSecurityConstraint ) ) {\n securityConstraint = new Constraint( CombinationType.AND, mqlSecurityConstraint );\n }\n }\n\n // resolve any missing parameters with default values\n if ( parameters == null && query.getParameters().size() > 0 ) {\n parameters = new HashMap<String, Object>();\n }\n for ( Parameter param : query.getParameters() ) {\n if ( !parameters.containsKey( param.getName() ) ) {\n parameters.put( param.getName(), param.getDefaultValue() );\n }\n }\n\n return getSQL( query.getLogicalModel(), query.getSelections(), query.getConstraints(), query.getOrders(),\n databaseMeta, locale, parameters, genAsPreparedStatement, query.getDisableDistinct(), query.getLimit(),\n securityConstraint );\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "public List<?> queryByCriteria(final List<String> fields,\n final List<Object> values, final List<String> operands,\n final Integer resultCount, final String orderBy,\n final boolean orderAscending) throws DataAccessLayerException {\n return queryByCriteria(fields, values, operands, resultCount, orderBy,\n orderAscending, null);\n }", "public Sql appendList(int[] value) {\n \n if (value == null) {\n return this;\n }\n \n formatted = false;\n \n for (int i = 0; i < value.length; i++) {\n if (i > 0) {\n appendBuffer.append(\", \");\n }\n appendBuffer.append(value[i]);\n }\n\n return this;\n }", "FromValuesColumns createFromValuesColumns();", "protected String buildDataQuery() {\n StringBuilder sql = new StringBuilder(\"select\");\n String delim = \" \";\n for (String vname : getColumnNames()) {\n sql.append(delim).append(vname);\n delim = \", \";\n }\n \n Element ncElement = getNetcdfElement();\n \n String table = ncElement.getAttributeValue(\"dbTable\");\n if (table == null) {\n String msg = \"No database table defined. Must set 'dbTable' attribute.\";\n _logger.error(msg);\n throw new TSSException(msg);\n }\n sql.append(\" from \" + table);\n \n String predicate = ncElement.getAttributeValue(\"predicate\");\n if (predicate != null) sql.append(\" where \" + predicate);\n \n //Order by time.\n String tname = getTimeVarName();\n sql.append(\" order by \"+tname+\" ASC\");\n \n return sql.toString();\n }", "@Override\n public void accept(ExtractedParameterValueVisitor visitor) throws FHIRPersistenceException {\n// visitor.visit(this);\n }", "public abstract Statement queryToRetrieveData();", "protected String in(String sql, String key){\n boolean isNeedDynamic = this.isNeedDynamic(key);\n if (isNeedDynamic) {\n LogUtils.debug(\"{} is equals to set default value, be delete\", key);\n return \" ( 1 = 1 or '1' = ?) \";\n }\n return sql;\n }", "RequestBuilder addQueryParameter(String key, String value);", "ValueDeclaration values( Predicate<? super ValueAssembly> specification );", "public void addFilterEqual(String column, Object value) {\n controlRelationAndAddToList(criterionList, Restrictions.eq(trimColumn(column), value), column);\n }", "long findValues(List<Object> values, List<Column> columns);", "private Cursor selectStatements(TransferObject feature) throws Exception {\r\n\t //ContentValues cv = new ContentValues(); \r\n\t List<FieldTO> fields = feature.getFields();\r\n\t String[] selectionArgs = new String[fields.size()];\r\n\t for (int i=0; i<fields.size();i++) {\r\n\t \tFieldTO fieldTO = fields.get(i);\r\n\t \tString name = fieldTO.getName();\r\n\t \tObject value = fieldTO.getValue();\r\n\t \tselectionArgs[i] = String.valueOf(value);\r\n\r\n\t\t}\r\n\t // return getDb().insert(getTableName(), null, cv);\r\n\t\tStatementFactory statement = new StatementFactory(feature);\r\n StringBuilder sqls = statement.createStatementSQL();\r\n Cursor c = getDb().rawQuery(sqls.toString(), selectionArgs);\r\n\t return c;\r\n\t}", "public Builder addAllRequestedValues(\n java.lang.Iterable<? extends java.lang.Integer> values) {\n ensureRequestedValuesIsMutable();\n super.addAll(values, requestedValues_);\n onChanged();\n return this;\n }", "private void addQuery(String query, String idsConstrain){\n this.queries.add( idsConstrain + query);\n }", "public Measurement addValues(List<ProbeValue> values) {\n\tattributes.addAll(values);\n\treturn this;\n }", "protected void applyWhere(SQL sql, MaterialTypeExample example, boolean includeExamplePhrase) {\r\n if (example == null) {\r\n return;\r\n }\r\n \r\n String parmPhrase1;\r\n String parmPhrase1_th;\r\n String parmPhrase2;\r\n String parmPhrase2_th;\r\n String parmPhrase3;\r\n String parmPhrase3_th;\r\n if (includeExamplePhrase) {\r\n parmPhrase1 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value}\";\r\n parmPhrase1_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\r\n parmPhrase2 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}\";\r\n parmPhrase2_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\r\n parmPhrase3 = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d]}\";\r\n parmPhrase3_th = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\r\n } else {\r\n parmPhrase1 = \"%s #{oredCriteria[%d].allCriteria[%d].value}\";\r\n parmPhrase1_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\r\n parmPhrase2 = \"%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}\";\r\n parmPhrase2_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\r\n parmPhrase3 = \"#{oredCriteria[%d].allCriteria[%d].value[%d]}\";\r\n parmPhrase3_th = \"#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\r\n }\r\n \r\n StringBuilder sb = new StringBuilder();\r\n List<Criteria> oredCriteria = example.getOredCriteria();\r\n boolean firstCriteria = true;\r\n for (int i = 0; i < oredCriteria.size(); i++) {\r\n Criteria criteria = oredCriteria.get(i);\r\n if (criteria.isValid()) {\r\n if (firstCriteria) {\r\n firstCriteria = false;\r\n } else {\r\n sb.append(\" or \");\r\n }\r\n \r\n sb.append('(');\r\n List<Criterion> criterions = criteria.getAllCriteria();\r\n boolean firstCriterion = true;\r\n for (int j = 0; j < criterions.size(); j++) {\r\n Criterion criterion = criterions.get(j);\r\n if (firstCriterion) {\r\n firstCriterion = false;\r\n } else {\r\n sb.append(\" and \");\r\n }\r\n \r\n if (criterion.isNoValue()) {\r\n sb.append(criterion.getCondition());\r\n } else if (criterion.isSingleValue()) {\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));\r\n } else {\r\n sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));\r\n }\r\n } else if (criterion.isBetweenValue()) {\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));\r\n } else {\r\n sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));\r\n }\r\n } else if (criterion.isListValue()) {\r\n sb.append(criterion.getCondition());\r\n sb.append(\" (\");\r\n List<?> listItems = (List<?>) criterion.getValue();\r\n boolean comma = false;\r\n for (int k = 0; k < listItems.size(); k++) {\r\n if (comma) {\r\n sb.append(\", \");\r\n } else {\r\n comma = true;\r\n }\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase3, i, j, k));\r\n } else {\r\n sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));\r\n }\r\n }\r\n sb.append(')');\r\n }\r\n }\r\n sb.append(')');\r\n }\r\n }\r\n \r\n if (sb.length() > 0) {\r\n sql.WHERE(sb.toString());\r\n }\r\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "private void addWhereClauseForCoordinate(\n\t\t\tStringBuffer sb,\n\t\t\tString type,\n\t\t\tMap<Attribute<? extends IValue>, IValue> attribute2values\n\t\t\t) {\n\t\tsb.append(\" WHERE (\");\n\t\tboolean first = true;\n\t\tfor (Attribute<? extends IValue> attribute: attribute2values.keySet()) {\n\t\t\tif (first) first = false; else sb.append(\") AND (\");\n\t\t\taddWhereClauseForAttribute(sb, type, attribute, new IValue[] {attribute2values.get(attribute)});\n\t\t}\n\t\tsb.append(\")\");\n\t}", "@Override\n\tpublic void visit(ValueListExpression arg0) {\n\t\t\n\t}", "private Object [] getFilterVals()\n throws java.sql.SQLException\n {\n Object [] ret = new Object[m_cols.length];\n\n for (int i = 0; i < m_cols.length; i++)\n {\n ret[i] = m_rs.getString((String)m_cols[i]);\n }\n return ret;\n }", "public QueryCore buildQuery() throws SQLException\n {\n if(l != null)\n {\n for(int i=0;i<l.size();i++)\n {\n prepStm.setObject(i+1,l.get(i));\n }\n }\n return this;\n }", "private List<Map<String, String>> getValues(Rule rule, String tableName,\n\t String uri) throws MediatorException {\n\t// execute each query and accumulate the values\n\t// we could have more than one query if we have a relationship table\n\t// t(var1, var2)\n\t// where D2R generates var1 tableName var2 (tableName is the property)\n\t// OR var2 tableName var1\n\tString select = getSelect(rule);\n\tList<String> where = getWhere(rule);\n\tList<Map<String, String>> rowValues = new ArrayList<Map<String, String>>();\n\tfor (int q = 0; q < where.size(); q++) {\n\t rowValues.addAll(getValues(select, where.get(q), tableName, uri));\n\t}\n\treturn rowValues;\n }", "protected abstract List<Object> getParamValues(SqlKeyWord sqlKeyWord, Object dbEntity, TableInfo tableInfo, Map<String, Object> params) throws Exception;", "@Override\n public Stream<Object> getValuesForStatement(Object obj) {\n try {\n field.setAccessible(true);\n Foreign foreign = (Foreign) field.get(obj);\n Object key = foreign != null ? foreign.getForeignKey() : null;\n\n List<Stream<Object>> futureList = MapperRegistry.getMapperSettings(domainObjectType)\n .getIds()\n .stream()\n .map(sqlFieldId -> sqlFieldId.getValuesForStatement(key)).collect(Collectors.toList());\n\n return futureList.stream().flatMap(s -> s);\n } catch (IllegalAccessException e) {\n throw new DataMapperException(e);\n }\n }", "public void addValueLine(String line) {\n\t\tvaluesBuilder.append(line);\n\t\tif (!line.endsWith(NEW_LINE)) {\n\t\t\tvaluesBuilder.append(NEW_LINE);\n\t\t}\n\t\tthis.dirtyAttributes.add(Constants.VALUES);\n\t}", "protected void applyWhere(SQL sql, CarExample example, boolean includeExamplePhrase) {\n if (example == null) {\n return;\n }\n \n String parmPhrase1;\n String parmPhrase1_th;\n String parmPhrase2;\n String parmPhrase2_th;\n String parmPhrase3;\n String parmPhrase3_th;\n if (includeExamplePhrase) {\n parmPhrase1 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value}\";\n parmPhrase1_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\n parmPhrase2 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}\";\n parmPhrase2_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\n parmPhrase3 = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d]}\";\n parmPhrase3_th = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\n } else {\n parmPhrase1 = \"%s #{oredCriteria[%d].allCriteria[%d].value}\";\n parmPhrase1_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\n parmPhrase2 = \"%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}\";\n parmPhrase2_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\n parmPhrase3 = \"#{oredCriteria[%d].allCriteria[%d].value[%d]}\";\n parmPhrase3_th = \"#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\n }\n \n StringBuilder sb = new StringBuilder();\n List<Criteria> oredCriteria = example.getOredCriteria();\n boolean firstCriteria = true;\n for (int i = 0; i < oredCriteria.size(); i++) {\n Criteria criteria = oredCriteria.get(i);\n if (criteria.isValid()) {\n if (firstCriteria) {\n firstCriteria = false;\n } else {\n sb.append(\" or \");\n }\n \n sb.append('(');\n List<Criterion> criterions = criteria.getAllCriteria();\n boolean firstCriterion = true;\n for (int j = 0; j < criterions.size(); j++) {\n Criterion criterion = criterions.get(j);\n if (firstCriterion) {\n firstCriterion = false;\n } else {\n sb.append(\" and \");\n }\n \n if (criterion.isNoValue()) {\n sb.append(criterion.getCondition());\n } else if (criterion.isSingleValue()) {\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));\n } else {\n sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));\n }\n } else if (criterion.isBetweenValue()) {\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));\n } else {\n sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));\n }\n } else if (criterion.isListValue()) {\n sb.append(criterion.getCondition());\n sb.append(\" (\");\n List<?> listItems = (List<?>) criterion.getValue();\n boolean comma = false;\n for (int k = 0; k < listItems.size(); k++) {\n if (comma) {\n sb.append(\", \");\n } else {\n comma = true;\n }\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase3, i, j, k));\n } else {\n sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));\n }\n }\n sb.append(')');\n }\n }\n sb.append(')');\n }\n }\n \n if (sb.length() > 0) {\n sql.WHERE(sb.toString());\n }\n }", "public void setParamValues(Object[] values);", "private DynamicStatement computeSQLForNonNullParamValues(\n List<Parameter> parameters, Profile p, boolean countSQL) {\n DynamicStatement ds = new DynamicStatement();\n\n /*\n * Example of a search using 0 unit-param values:\n * SELECT u.unit_id, u.profile_id, u.unit_type_id FROM u.unit\n * WHERE u.profile_id = 12\n *\n * Example of a search using 1 unit-param value:\n * SELECT u.unit_id, u.profile_id, u.unit_type_id, up1.value FROM unit u, unit_param up1 -- special for 1-param search\n * WHERE u.profile_id = 12 AND u.unit_id = up1.unit_id\n * AND up1.unit_type_param_id = 432 AND up1.value = '2011' -- special for 1-param search\n *\n * Example of a search using 2 unit-param values:\n * SELECT u.unit_id, u.profile_id, u.unit_type_id, up1.value, up2.value FROM unit u,\n * (SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND u.profile_id = 12 AND up.unit_type_param_id = 432 AND up.value = '2011') up1,\n * (SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND u.profile_id = 12 AND up.unit_type_param_id = 430 AND up.value = '10') up2\n * WHERE u.profile_id = 12 AND u.unit_id = up1.unit_id AND u.unit_id = up2.unit_id\n *\n * Example of a search using 3 unit-param values:\n * SELECT u.unit_id, u.profile_id, u.unit_type_id, up1.value, up2.value, up3.value FROM unit u,\n * (SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND u.profile_id = 12 AND up.unit_type_param_id = 432 AND up.value = '2011') up1,\n * (SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND u.profile_id = 12 AND up.unit_type_param_id = 430 AND up.value = '10') up2,\n * (SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND u.profile_id = 12 AND up.unit_type_param_id = 428 AND up.value = '27') up3\n * WHERE u.profile_id = 12 AND u.unit_id = up1.unit_id AND u.unit_id = up2.unit_id AND u.unit_id = up3.unit_id\n */\n\n if (countSQL) {\n ds.addSql(\"SELECT count(u.unit_id) \");\n } else {\n ds.addSql(\"SELECT u.unit_id, u.profile_id, u.unit_type_id, \");\n for (int i = 0; i < parameters.size(); i++) {\n ds.addSql(\"up\" + (i + 1) + \".value, \");\n }\n ds.trim(2); // remove last \", \".\n }\n ds.addSql(\" FROM unit u, \");\n if (parameters.size() == 1) {\n ds.addSql(\"unit_param up1 \");\n } else if (parameters.size() > 1) {\n for (int i = 0; i < parameters.size(); i++) {\n Parameter parameter = parameters.get(i);\n ds.addSql(\n \"(SELECT u.unit_id, up.value FROM unit u, unit_param up WHERE u.unit_id = up.unit_id AND \");\n ds.addSqlAndArguments(\"u.profile_id = ? AND \", p.getId());\n ds.addSqlAndArguments(\n \"up.unit_type_param_id = ? AND \", parameter.getUnittypeParameter().getId());\n addUnitParameterClause(\"up\", p, ds, parameter);\n ds.addSql(\") up\" + (i + 1) + \", \");\n }\n }\n ds.cleanupSQLTail();\n ds.addSqlAndArguments(\n \"WHERE u.unit_type_id = ? AND u.profile_id = ? AND \", p.getUnittype().getId(), p.getId());\n\n if (parameters.size() > 1) {\n for (int i = 0; i < parameters.size(); i++) {\n ds.addSql(\"u.unit_id = up\" + (i + 1) + \".unit_id AND \");\n }\n } else if (parameters.size() == 1) {\n ds.addSql(\"u.unit_id = up1.unit_id AND \");\n ds.addSqlAndArguments(\n \"up1.unit_type_param_id = ? AND \", parameters.get(0).getUnittypeParameter().getId());\n addUnitParameterClause(\"up1\", p, ds, parameters.get(0));\n }\n ds.cleanupSQLTail();\n return ds;\n }", "public StringBuffer addUpdateValues(String tableName, Map<String, String> columns) {\n\t\tStringBuffer sql = new StringBuffer();\n\t\t\n\t\tint index = 0;\n\t\tList<Column> nonAutoIncrementColumns = dbStructure.getTable(tableName).getNonAutoIncrementColumns();\n\t\tfor(Column column : nonAutoIncrementColumns){\n\t\t\tString castedValue = validateValue(column, columns.get(column.getName()));\n\t\t\t\n\t\t\t// If value couldn't be converted, skip this node!\n\t\t\tif(castedValue == null){\n\t\t\t\tlogger.error(\"UpdateConvertionError: Value [\" + columns.get(column.getName()) + \"] in column [ \" + column.getName() + \" ] for table [\" + tableName + \"] couldn't be converted - skipping this entry!\");\n\t\t\t\treturn new StringBuffer();\n\t\t\t}\n\t\t\t\n\t\t\tsql.append(column.getName());\n\t\t\tsql.append(Constants.EQUAL);\n\t\t\tsql.append(castedValue);\n\n\t\t\tif(++index < nonAutoIncrementColumns.size()) { \n\t\t\t\tsql.append(Constants.COMMA);\n\t\t\t\tsql.append(Constants.LINE_SPACE);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sql;\n\t}", "@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}", "String getMetadataSelectClause();", "public void setQuery(java.lang.CharSequence value) {\n this.query = value;\n }", "@Override\n List<Value> values();", "private void addWhereClauseForAttributes(\n\t\t\tStringBuffer sb,\n\t\t\tString type,\n\t\t\tMap<Attribute<? extends IValue>, Collection<IValue>> attribute2values\n\t\t\t) {\n\t\tsb.append(\" WHERE (\");\n\t\tboolean first = true;\n\t\tfor (Attribute<? extends IValue> attribute: attribute2values.keySet()) {\n\t\t\tif (first) first = false; else sb.append(\") AND (\");\n\t\t\tCollection<IValue> values = attribute2values.get(attribute);\n\t\t\tIValue[] vv = new IValue[values.size()];\n\t\t\tvalues.toArray(vv);\n\t\t\taddWhereClauseForAttribute(sb, type, attribute, vv);\n\t\t}\n\t\tsb.append(\")\");\n\t}", "@Override\r\n\tpublic String getCondition(String[] sql) {\n\t\treturn sql[4];\r\n\t}", "public void setSelectvalues(java.lang.String[] selectvalues) {\n this.selectvalues = selectvalues;\n }", "@Test\n public void testNamedParamValueInCollectionTypeValidationPassesWhenCorrect() {\n Person personProxy = query.from(Person.class);\n query.where(personProxy.getId()).in().named(NAMED_PARAM_1);\n query.named().setValue(NAMED_PARAM_1, Arrays.asList(10d, 20d));\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public Builder addQueries(\n WorldUps.UQuery.Builder builderForValue) {\n if (queriesBuilder_ == null) {\n ensureQueriesIsMutable();\n queries_.add(builderForValue.build());\n onChanged();\n } else {\n queriesBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "public JSArray querySQL(String statement, ArrayList<String> values) {\n JSArray retArray = new JSArray();\n // Open the database for reading\n SQLiteDatabase db = null;\n Boolean success = true;\n try {\n db = getConnection(true, secret);\n retArray = selectSQL(db, statement, values);\n if (retArray.length() > 0) {\n return retArray;\n } else {\n return new JSArray();\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error: querySQL failed: \", e);\n return new JSArray();\n } finally {\n if (db != null) db.close();\n }\n }", "public JSArray querySQL(String statement, ArrayList<String> values) {\n JSArray retArray = new JSArray();\n // Open the database for reading\n SQLiteDatabase db = null;\n Boolean success = true;\n try {\n db = getConnection(true, secret);\n retArray = selectSQL(db, statement, values);\n if (retArray.length() > 0) {\n return retArray;\n } else {\n return new JSArray();\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error: querySQL failed: \", e);\n return new JSArray();\n } finally {\n if (db != null) db.close();\n }\n }", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}" ]
[ "0.67134655", "0.6313303", "0.60681677", "0.5846949", "0.5820661", "0.56955767", "0.5606209", "0.5514471", "0.5476714", "0.540031", "0.5396023", "0.5357695", "0.5327121", "0.53164935", "0.53043777", "0.53036153", "0.52978015", "0.52849305", "0.5250766", "0.52507645", "0.5233452", "0.5230284", "0.5159833", "0.5141813", "0.5138321", "0.51236856", "0.50574845", "0.50321174", "0.50285214", "0.50182754", "0.5010033", "0.5000283", "0.49937236", "0.49855378", "0.4970602", "0.4967039", "0.4960399", "0.49583638", "0.49577585", "0.49520805", "0.49517584", "0.49500865", "0.49399677", "0.4936298", "0.49330986", "0.4912506", "0.49094614", "0.48904255", "0.4889681", "0.48867422", "0.4886612", "0.4886223", "0.488131", "0.48797953", "0.48757875", "0.48695284", "0.48572546", "0.48506677", "0.48505425", "0.48382127", "0.48360142", "0.48089683", "0.4805992", "0.48043367", "0.47987196", "0.47927126", "0.47911417", "0.47870952", "0.47837332", "0.4781863", "0.47774416", "0.47601518", "0.47547814", "0.47524416", "0.47363472", "0.47360098", "0.4732012", "0.47315428", "0.4729182", "0.47193125", "0.47183898", "0.47074723", "0.47069958", "0.46968645", "0.46946555", "0.46933776", "0.46855718", "0.46785533", "0.4670128", "0.46686068", "0.46641916", "0.46614495", "0.46599525", "0.4658126", "0.46536142", "0.46530685", "0.46435326", "0.4643289", "0.46391305", "0.46391305", "0.46372402" ]
0.0
-1
TODO: 2/19/19 Create a algorithm to find the words from the dictionary that exists in the input string
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public KeyWordList extractKeyWords(String input);", "public String function(HashSet<String> Dictionary, String inputString) {\n\n int[] step = new int[inputString.length() + 1];\n\n step[0] = 0;\n\n for (int i = 1; i <= inputString.length(); i++)\n {\n step[i] = -1;\n\n for ( int j = 0 ; j < i ; j++ )\n {\n if ( Dictionary.contains( inputString.substring(j, i) ) && step[j] != -1 )\n {\n step[i] = j;\n break;\n }\n }\n }\n\n // if text can not be made from the whole inputString, return an empty string\n if (step[inputString.length()] == -1)\n return \"\";\n\n // Moving backwards from the end, the words contain words in the reverse order\n ArrayList<String> words = new ArrayList<String>();\n\n for (int x = inputString.length(); x > 0; x = step[x])\n words.add(inputString.substring(step[x], x));\n\n // Create a string using a StringBuilder that contains words in the normal order\n StringBuilder sb = new StringBuilder();\n\n for (int i = words.size()-1; i >= 0; i--)\n sb.append( i > 0 ? words.get(i) + \" \" : words.get(i) );\n\n return sb.toString();\n }", "public static void findDuplicateWords(String inputString)\r\n\t{\r\n\t\t// split the words in words array \r\n\t\tString words[]= inputString.split(\" \");\r\n\t\t\r\n\t\t//Create HashMap for count the words \r\n\t\tHashMap<String, Integer> wordcount = new HashMap<String, Integer>();\r\n\t\t\r\n\t\t// to check each word in given array \r\n\t\t\r\n\t\tfor(String word: words )\r\n\t\t{\r\n\t\t\t//if word is present \r\n\t\t\tif(wordcount.containsKey(word)) {\r\n\t\t\t\twordcount.put(word.toLowerCase(), wordcount.get(word)+1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twordcount.put(word,1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//extracting all the keys of map : wordcount\r\n\t\tSet<String> wordInString = wordcount.keySet();\r\n\t\t\r\n\t\t// iterate the loop through all the wors in wordCount \r\n\t\tfor(String word : wordInString)\r\n\t\t{\r\n\t\t\tif(wordcount.get(word)>1)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(word+ \" : \" + wordcount.get(word));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean wordBreak(String s, List<String> wordDict) {\n boolean[] dp = new boolean[s.length()]; \n for (int i = 0; i <s.length(); i++) {\n if (wordDict.contains(s.substring(0, i+1))) {\n dp[i] = true;\n continue;\n }\n for (int k = 0; k < i; k++) {\n if (dp[k] && wordDict.contains(s.substring(k+1, i+1))) {\n dp[i] = true;\n System.out.println(i + \" \" +dp[i]);\n break;\n }\n }\n \n }\n return dp[s.length()-1];\n }", "private static int searchStandardDictionary(String word) {\n if (word.length() < 4) {\n return Arrays.binarySearch(STANDARD_DICTIONARY, 0, FOUR_LETTER_WORDS_OFFSET, word.toUpperCase(Locale.ENGLISH));\n } else {\n return Arrays.binarySearch(STANDARD_DICTIONARY, FOUR_LETTER_WORDS_OFFSET, STANDARD_DICTIONARY.length, word.toUpperCase(Locale.ENGLISH));\n }\n }", "public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }", "public static boolean wordBreak(String s, String[] dict) {\n boolean[] memo = new boolean[s.length() + 1];\n memo[0] = true; //set first to be true because we need initial state\n for (int i = 0; i < s.length(); i++) {\n if (!memo[i])\n continue;\n for (String current : dict) {\n int end = i + current.length();\n if (end > s.length())\n continue;\n if (memo[end])\n continue;\n if (s.substring(i, end).equals(current)) {\n memo[end] = true;\n }\n }\n }\n return memo[s.length()];\n }", "public boolean search(String word) {\n // 1. 遍历 每个 字母 去掉 从list 里去出来结果 比较list 每个结果\n for (int i = 0; i < word.length(); i++) {\n String key = word.substring(0, i) + word.substring(i+1);\n List<int[]> indexAndCharList = dictonary.getOrDefault(key, new ArrayList<>());\n for (int[] indexAndChar : indexAndCharList) {\n if (indexAndChar[0] == i && indexAndChar[1] != (word.charAt(i) - 'a')) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean wordBreak(String s, List<String> wordDict) {\n boolean[] dp = new boolean[s.length() + 1];\n\n dp[0] = true;\n\n // Maintaining dp array for all lengths from 1 to n\n for(int i = 1; i <= s.length(); i++) {\n // Checking for all characters till i if earlier sub array is true and if the\n // substring is a dictionary word\n for(int j = 0; j < i; j++) {\n if(dp[j] && wordDict.contains(s.substring(j, i))) {\n dp[i] = true;\n }\n }\n }\n\n return dp[s.length()];\n }", "public static List<Integer> findSubstringWordConcatenation(String str, String[] words) {\n assert str != null;\n assert words != null;\n List<String> wordList = new ArrayList<>();\n List<Integer> wordIndex = new ArrayList<>();\n int noOfWords = words.length, wordLength = words[0].length();\n Map<String,Integer> wordFrequencyMap = new HashMap<>();\n for(String word: words) {\n wordFrequencyMap.put(word,wordFrequencyMap.getOrDefault(word,0)+1);\n }\n\n for(int windowStart=0; windowStart <= (str.length() - (wordLength * noOfWords)); windowStart++) {\n HashMap<String, Integer> wordsSeen = new HashMap<>();\n /*now look for words*/\n for(int wrd=0; wrd<noOfWords; wrd++) {\n int wordStartIndex = windowStart + (wrd * wordLength);\n String word = str.substring(wordStartIndex, wordStartIndex+wordLength);\n if(wordFrequencyMap.containsKey(word)) {\n wordsSeen.put(word, wordsSeen.getOrDefault(word,0)+1);\n } else {\n break;// break for loop\n }\n if(wordsSeen.get(word) > wordFrequencyMap.getOrDefault(word,0)) {\n break;// frequency is more then required\n }\n if(wordsSeen.size() == wordFrequencyMap.size()) {\n wordList.add(str.substring(windowStart, wordStartIndex+wordLength));\n wordIndex.add(windowStart);\n }\n }\n }\n return wordIndex;\n }", "private String searchString(String inWord)\n {\n String line = null;\n StringBuffer rtn = new StringBuffer();\n int len = inWord.length();\n boolean found = false;\n\n if(len == 1)\n {\n if(Character.isDigit(inWord.charAt(0)))\n {\n rtn.append(inWord).append(\"I\");\n found = true;\n } // fi\n\n else if(Character.isLetter(inWord.charAt(0)))\n {\n rtn.append(inWord.toLowerCase()).append(\"S\");\n found = true;\n } // else fi\n } // fi\n\n if(!found)\n {\n int\tnum_A = 0; // Upper case\n int\tnum_L = 0; // Lower case\n int\tnum_N = 0; // Numbers\n int\tnum_P = 0; // Punctuation (numeric)\n int\tnum_Q = 0; // Quotes\n int\tnum_O = 0; // Other\n char last_ch = ' ';\n\n for(int i = 0; i < len; i++)\n {\n if((i == 0) && (inWord.charAt(i) == '-'))\n num_L++;\n\n else if(Character.isLowerCase(inWord.charAt(i)))\n num_L++;\n\n else if(Character.isUpperCase(inWord.charAt(i)))\n num_A++;\n\n else if(Character.isDigit(inWord.charAt(i)))\n num_N++;\n\n else if((inWord.charAt(i) == '=')||(inWord.charAt(i) == ':') ||\n (inWord.charAt(i) == '+')||(inWord.charAt(i) == '.') ||\n (inWord.charAt(i) == ','))\n num_P++;\n\n else if((inWord.charAt(i) == '\\'') ||\n (inWord.charAt(i) == '`') || (inWord.charAt(i) == '\"'))\n num_Q++;\n\n else\n num_O++;\n\n last_ch = inWord.charAt(i);\n } // for\n\n int pos = 0;\n if((len - ntail) > 0)\n pos = len - ntail;\n\n rtn.append(inWord.substring(pos).toLowerCase());\n\n if((num_L + num_Q) == len)\n rtn.append(\"\");\n\n else if((num_A + num_Q) == len)\n rtn.append(\"A\");\n\n else if((num_N + num_P + num_Q) == len)\n rtn.append(\"N\");\n\n else if((num_L + num_A + num_Q) == len)\n rtn.append(\"B\");\n\n else if((num_A + num_N + num_P + num_Q) == len)\n rtn.append(\"C\");\n\n else if((num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"E\");\n\n else if((num_A + num_L + num_N + num_P + num_Q) == len)\n rtn.append(\"D\");\n\n else if((num_O == 0) && (last_ch == '+'))\n rtn.append(\"F\");\n\n else\n rtn.append(\"O\");\n } // else\n\n rtn.append(\"_\");\n\n return(rtn.toString());\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner info = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the phrase:\");\r\n\t\tString sentence = info.nextLine();\r\n\t\t\r\n\t\tsentence = sentence.trim().toUpperCase();\r\n\t\t\r\n\t\tfor (int i = 0; i < sentence.length(); i++) {\r\n\t\t\tif (sentence.charAt(i) <'A' || sentence.charAt(i) > 'Z' ) {\r\n\t\t\t\tsentence = sentence.replace(\"\"+sentence.charAt(i), \"/\");\r\n//\t\t\t\tSystem.out.println(sentence);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString[] word = sentence.split(\"/\") ;\r\n\t\t\r\n\t\tint total = 0;\r\n\t\tif (word.length < 1) {\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\tHashMap hMap = new HashMap();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (word[0].length() > 0) {\r\n\t\t\t\thMap.put(word[0].length(), 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (int i = 1; i < word.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < i; j++) {\r\n\t\t\t\t\tif (word[i].length() == word[j].length()) {\r\n\t\t\t\t\t\tint cnt = (int) hMap.get(word[i].length());\r\n\t//\t\t\t\t\tSystem.out.println(\"cnt==>\"+cnt);\r\n\t\t\t\t\t\thMap.put(word[i].length(),++cnt);\r\n\t\t\t\t\t\t\t\r\n\t//\t\t\t\t\tSystem.out.println(word[i].length()+\"==>\"+hMap.get(word[i].length()));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (j == (i-1)){\r\n\t\t\t\t\t\t\thMap.put(word[i].length(), 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSet<Integer> keys1 = hMap.keySet();\r\n\t\r\n\t\t\tfor(int key:keys1) {\r\n\t\t\t\tif (key !=0) {\r\n\t\t\t\t\tSystem.out.println(hMap.get(key)+\" \"+key +\" letter words\");\r\n\t\t\t\t\ttotal += (int)hMap.get(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(total+\" total words\");\r\n\t\t\r\n\t}", "public String[][] findSuggestions(String w) {\n ArrayList<String> suggestions = new ArrayList<>();\n String word = w.toLowerCase();\n // parse through the word - changing one letter in the word\n for (int i = 0; i < word.length(); i++) {\n // go through each possible character difference\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n // get the character that will change in the word\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n \n // if the selected character is not the same as the character to change - avoids getting the same word as a suggestion\n if (c != word.charAt(i)) {\n // change the character in the word\n String check = word.substring(0, i) + c.toString() + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - adding one letter to the word\n for (int i = 0; i < word.length(); i++) {\n // if the loop is not on the last charcater\n if (i < word.length() - 1) {\n // check words with one character added between current element and next element\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word.substring(0, i) + c.toString() + ((i < word.length()) ? word.substring(i, word.length()) : \"\");\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n // if the loop is on the last character\n else {\n // check the words with one character added to the end of the word\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word + c;\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - removing one letter from the word\n for (int i = 0; i < word.length(); i++) {\n // remove the chracter at the selected index from the word\n String check = word.substring(0, i) + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n \n String[][] rtn = new String[suggestions.size()][1];\n for (int i = 0, n = suggestions.size(); i < n; i++) {\n rtn[i][0] = suggestions.get(i);\n }\n \n return rtn;\n }", "public boolean wordBreak(String s, List<String> wordDict) {\n int iIndex = 0;\n int jIndex = 0;\n int sLength = s.length();\n boolean dp[][] = new boolean[sLength][sLength];\n int i = 0;\n int j = 0;\n System.out.println(s.substring(0,0));\n System.out.println(s.substring(0,1));\n while (jIndex < sLength) {\n \ti = iIndex; \n \tj = jIndex;\n \twhile (j < sLength) {\n \t\tif (wordDict.contains(s.substring(i, j + 1))) {\n \t\t\tdp[i][j] = true;\n \t\t} else {\n \t\t\tint firstStart = 0;\n \t\t\tint firstEnd = 0;\n \t\t\tint secondStart = firstEnd + 1;\n \t\t\tint secondEnd = j;\n \t\t\twhile (secondStart <= secondEnd) {\n \t\t\t\tdp[i][j] = dp[firstStart][firstEnd] && dp[secondStart][secondEnd];\n \t\t\t\tif (dp[i][j]) {\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tfirstEnd++;\n \t\t\t\tsecondStart = firstEnd + 1;\n \t\t\t}\n \t\t}\n \t\ti++;\n \t\tj++;\n \t}\n \tiIndex = 0;\n \tjIndex++;\n }\n\n // for (int x = 0; x < dp.length; x++) {\n // \tfor (int y = 0; y < dp[0].length; y++) {\n // \t\tSystem.out.print(dp[x][y] + \" \");\n // \t}\n // \tSystem.out.println();\n // }\n\n return dp[0][sLength - 1];\n }", "private List<String> help(String s, Set<String> wordDict) {\n\t\tList<String> ret = new ArrayList<>();\n\n\t\tif (wordDict.contains(s))\n\t\t\tret.add(s);\n\t\telse\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif (wordDict.contains(s.substring(0, i + 1))) {\n\n//\t\t\t\t\tSystem.out.println(s.substring(0, i + 1));\n\n\t\t\t\t\tList<String> tmp = help(s.substring(i + 1), wordDict);\n\t\t\t\t\tif (tmp.size() > 0) {\n\t\t\t\t\t\tret.add(s.substring(0, i + 1));\n\t\t\t\t\t\tret.addAll(tmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\treturn ret;\n\t}", "public static List<Integer> findWordConcatenation(String str, String[] words) {\n List<Integer> resultIndices = new ArrayList<Integer>();\n if (str == null || str.isEmpty() || words == null || words.length == 0)\n return resultIndices;\n\n int len = words[0].length();\n Map<String, Integer> freqMap = new HashMap();\n\n for (String word : words)\n freqMap.put(word, freqMap.getOrDefault(word, 0) + 1);\n\n Map<String, Integer> curMap = new HashMap();\n int l = 0, cc = 0;\n int i = 0;\n while (i < str.length() - len + 1) {\n String cur = str.substring(i, i + len);\n if (!freqMap.containsKey(cur)) {\n curMap.clear();\n ++i; l = i;\n continue;\n }\n\n curMap.put(cur, curMap.getOrDefault(cur, 0) + 1);\n if (curMap.get(cur) == freqMap.get(cur))\n cc++;\n\n while(curMap.get(cur) > freqMap.get(cur)) {\n String word1 = str.substring(l, l + len);\n curMap.put(word1, curMap.get(word1) - 1);\n if (curMap.get(word1) < freqMap.get(word1))\n --cc;\n l+=len;\n }\n\n if (cc == freqMap.size())\n resultIndices.add(l);\n i+=len;\n }\n return resultIndices;\n }", "public String search_words(String word){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs)\n\t\t\tif(word.toLowerCase().charAt(0) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\tfound_words += child.search_words(word, 0);\n\t\t\n\t\treturn found_words;\n\t}", "public boolean isWordBreak(String s, List<String> wordDict){\n\n\t\tint[] ind = new int[s.length()+1];\n\t\tArrays.fill(ind,-1);\n\t\tind[0]=0;\n\t\t\n\t\tfor (int i = 0; i<s.length(); i++){\n\t\t\tif (ind[i]!=-1){\n\t\t\t\tfor (int j=i+1; j<=s.length(); j++){\n\t\t\t\t\tString word = s.substring(i,j);\n\t\t\t\t\tif (wordDict.contains(word)){\n\t\t\t\t\t\tind[j]=i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (ind[s.length()] == -1) return false;\n\t\t\n\t\treturn true;\n\n\t\n\t}", "public static boolean wordBreakHelper(String s, Set<String> dict, int start) {\r\n if (start == s.length()) {\r\n return true;\r\n }\r\n for (String word : dict) {\r\n int len = word.length();\r\n int end = start + len;\r\n\r\n if (end > s.length()) {\r\n continue;\r\n }\r\n\r\n if (s.substring(start, start + len).equals(word)) {\r\n if (wordBreakHelper(s, dict, start + len)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "public boolean wordBreak2(String s, List<String> wordDict) {\n int maxL =0;\n Set<String> wordSet = new HashSet<>(wordDict);\n for (String word : wordDict) {\n maxL = Math.max(maxL, word.length());\n }\n boolean[] dp = new boolean[s.length() + 1];\n dp[0] = true;\n for (int i = 1; i <= s.length(); i++) {\n for (int j = i-1; j >=0 && j >= i - maxL; j--) {\n if (dp[j] && wordSet.contains(s.substring(j, i))) {\n dp[i] = true;\n break;\n }\n }\n }\n return dp[s.length()];\n }", "public static boolean wordBreak(String s, List<String> wordDict) {\r\n\t \r\n\t char[] ch = s.toCharArray();\r\n\t int left = 0;\r\n\t boolean canSegemented = false;\r\n\t StringBuffer sb = new StringBuffer();\r\n\t while(left<ch.length){\r\n\t sb.append(ch[left]);\r\n\t if(wordDict.contains(sb.toString())){\r\n\t canSegemented = true;\r\n\t sb = new StringBuffer();\r\n\t }\r\n\t else{\r\n\t canSegemented = false;\r\n\t }\r\n\t left++;\r\n\t }\r\n\t return canSegemented;\r\n\t }", "public static boolean dp(String s, List<String> wordDict) {\n Set<String> dic = new HashSet(wordDict);\n\n // BUG: firstly try i inclusive, but it's harder.\n //start from 0, end at i(exclusive), is that available\n boolean [] board = new boolean [s.length() + 1];\n Arrays.fill(board, false);\n\n board[0] = true;\n for(int i=1; i<=s.length(); i++) {\n boolean flag = false;\n for(int j=0; j<i; j++) {\n\n // BUG: confuse = and ==\n // BUG: confuse substring(j, i) and substring(j+1, i), because define exclusive above\n if(board[j] == true && dic.contains(s.substring(j, i))) {\n flag = true;\n break;\n }\n }\n board[i] = flag;\n }\n\n return board[s.length()];\n }", "public static ArrayList<Word> search(String inputString){\n Node current = root;\n \n // remove doubles and make aphameticals\n Word tempWord = new Word(inputString);\n \n String s = tempWord.getTrieWord();\n \n ArrayList<Word> results = new ArrayList<Word>();\n ArrayList<Word> fuzzyResults = new ArrayList<Word>();\n\n while(current != null){\n \n for(int i=0;i<s.length();i++){ \n if(current.subNode(s.charAt(i)) == null){\n System.out.println(\"WE Have an extra letter ------ !!!!\");\n Collections.sort(results, new CustomComparator()); \n return results;\n }\n else\n current = current.subNode(s.charAt(i));\n \n if(i==inputString.length()-2){\n fuzzyResults.addAll(current.possibleWords);\n }\n \n }\n \n if (current.marker == true)\n results.addAll(current.possibleWords);\n \n // return results; // place here for no problems\n \n }\n \n \n \n //remove fuzzyResults from normal results\n for(int r=0; r<results.size(); r++){\n \n if(results.get(r).isFuzzy){\n results.remove(r);\n r--;\n }\n }\n \n \n // Go through fuzzy results and only accept ones that are less than 1 char of search string\n for(int r=0; r<fuzzyResults.size(); r++){\n \n if(((fuzzyResults.get(r).getWord().length()-1)==inputString.length()) && fuzzyResults.get(r).isFuzzy ){\n results.add(fuzzyResults.get(r)); \n }\n }\n \n Collections.sort(results, new CustomComparator()); \n\n return results;\n \n }", "static List<String> DFS(String s, Set<String> wordDict, HashMap<String, LinkedList<String>>map) {\n if (map.containsKey(s))\n return map.get(s);\n\n LinkedList<String>res = new LinkedList<String>();\n if (s.length() == 0) {\n res.add(\"\");\n return res;\n }\n for (String word : wordDict) {\n if (s.startsWith(word)) {\n List<String>sublist = DFS(s.substring(word.length()), wordDict, map);\n for (String sub : sublist)\n res.add(word + (sub.isEmpty() ? \"\" : \" \") + sub);\n }\n }\n map.put(s, res);\n return res;\n }", "public Map<String, Integer> wordCount(String string) {\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tString[] p = string.split(\"[\\\\W\\\\s]\");\n\t\tfor (String s : p) {\n\t\t\tif (!s.equals(\"\")) {\n\t\t\t\tif (map == null || !map.containsKey(s))\n\t\t\t\t\tmap.put(s, 1);\n\t\t\t\telse\n\t\t\t\t\tmap.replace(s, map.get(s) + 1);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public boolean[][] isWord(List<String> wordDict, String s) {\n int n = s.length();\n boolean[][] isWord = new boolean[n][n];\n \n for (int i = 0; i < n; i++) {\n for (int j = i; j < n; j++) {\n isWord[i][j] = wordDict.contains(s.substring(i, j + 1));\n }\n }\n return isWord;\n }", "public static String findReplacements(TreeSet<String> dictionary, \n\t\t\t\t\t String word)\n\t{\n\t String replacements = \"\";\n\t String leftHalf, rightHalf, newWord;\n\t int deleteAtThisIndex, insertBeforeThisIndex;\n\t char index;\n\t TreeSet<String> alreadyDoneNewWords = new TreeSet<String>();\n\t /* The above TreeSet<String> will hold words that the spell checker\n\t suggests as replacements. By keeping track of what has already\n\t been suggested, the method can make sure not to output the\n\t same recommended word twice. For instance, the word \n\t \"mispelled\" would ordinarily result in two of the same suggested\n\t replacements: \"misspelled\" (where the additional \"s\" is added to \n\t different locations.) */\n\t \n\t // First, we'll look for words to make by subtracting one letter\n\t // from the misspelled word.\n\t for(deleteAtThisIndex = 0; deleteAtThisIndex < word.length();\n\t\tdeleteAtThisIndex ++)\n\t\t{\n\t\t if(deleteAtThisIndex == 0)\n\t\t\t{\n\t\t\t leftHalf = \"\";\n\t\t\t rightHalf = word;\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0, deleteAtThisIndex);\n\t\t\t rightHalf = word.substring(deleteAtThisIndex+1,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\n\t\t newWord = \"\";\n\t\t newWord = newWord.concat(leftHalf);\n\t\t newWord = newWord.concat(rightHalf);\n\t\t if(dictionary.contains(newWord) &&\n\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t{\n\t\t\t replacements = replacements.concat(newWord + \"\\n\");\n\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t}\n\t\t}\n\n\t // The rest of this method looks for words to make by adding a \n\t // new letter to the misspelled word.\n\t for(insertBeforeThisIndex = 0; \n\t\tinsertBeforeThisIndex <= word.length();\n\t\tinsertBeforeThisIndex ++)\n\t\t{\n\t\t if(insertBeforeThisIndex == word.length())\n\t\t\t{\n\t\t\t leftHalf = word;\n\t\t\t rightHalf = \"\";\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0,insertBeforeThisIndex);\n\t\t\t rightHalf = word.substring(insertBeforeThisIndex,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\t\t \n\t\t for(index = 'a'; index <= 'z'; index ++)\n\t\t\t{\n\t\t\t newWord = \"\";\n\t\t\t newWord = newWord.concat(leftHalf);\n\t\t\t newWord = newWord.concat(\"\" + index + \"\");\n\t\t\t newWord = newWord.concat(rightHalf);\n\t\t\t \n\t\t\t if(dictionary.contains(newWord) &&\n\t\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t\t{\n\t\t\t\t replacements \n\t\t\t\t\t= replacements.concat(newWord + \"\\n\");\n\t\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t return replacements;\n\t}", "@Test \r\n public void shouldFindOneWordAtTheEnd() {\r\n \r\n String inputWord = \"bxxxxxxxe\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"be\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n \r\n assertEquals(\"be\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "public String replaceWords(List<String> dict, String sentence) {\n for(String s : dict){\n insert(s);\n }\n //builder to append strings\n StringBuilder sb = new StringBuilder();\n //to get word of the sentence, split it into words\n //and to distinguish, add spaces\n for(String word : sentence.split(\"\\\\s+\")){\n if(sb.length() > 0)\n sb.append(\" \");\n \n TrieNode curr = root;\n //now for each word till its length\n for(int i=0; i<word.length(); i++){\n //get character, compare character with children\n char c = word.charAt(i);\n //if no children found or curr.word is null\n if(curr.children[c-'a'] == null || curr.word != null){\n break;\n }\n //curr++\n curr = curr.children[c-'a'];\n }\n //replacement found or not?\n String replacement = curr.word;\n if(replacement == null){\n sb.append(word);\n }else{\n sb.append(replacement);\n }\n }\n return sb.toString();\n }", "public static List<List<String>> breakIntoWords(String longWord, Collection<String> dict) {\n List<List<String>>[] words = new ArrayList[longWord.length() + 1];\n // words[i] = list of matching words at longWord length i\n // words[longWord.length()] is answer\n Arrays.stream(words).forEach((wl) -> wl = null);\n // contains empty list of lists\n // the first element contains an emtpty list of strings\n words[0] = new ArrayList<List<String>>();\n\n int beginIndx = -1;\n while (beginIndx < longWord.length()) {\n // beginIndx starts from 0 and goes up to length of the word -1\n // start with -1 and first index where the words[beginIndx] != null is 0\n // last value for beingIndx is wordlength -1\n while ((words[++beginIndx] == null) && (beginIndx < longWord.length())) ;\n // non null List of Lists of String\n // for index 0 it will be empty. For subsequent indices it may be non empty\n List<List<String>> beginIndxLists = words[beginIndx];\n // if beginIndx has not reached the end of the word\n // last value of beingIndx is longWord.length-1\n // need to compare the last character for which substring(wordlength-1, wordlength)\n if (beginIndx < longWord.length()) {\n // beginIdx is the start of the word, end Indx is end\n // last value for endIndx is longWord.length\n for (int endIndx = beginIndx + 1; endIndx <= longWord.length(); endIndx++) {\n String matchW = longWord.substring(beginIndx, endIndx);\n if ((matchW != null) && (!matchW.isEmpty())) {\n if (dict.contains(matchW)) {\n // list of list of Strings for getting to the endIndx\n List<List<String>> mwordsList = words[endIndx];\n if (mwordsList == null) {\n mwordsList = new ArrayList<List<String>>();\n }\n if((beginIndxLists==null)||(beginIndxLists.isEmpty())) {\n mwordsList.add(new ArrayList(Arrays.asList(matchW)));\n }\n // words[endIndx] has list of list initialized\n // there is a list at beginIndx\n // get the list of words at begingIndx. It contains at least one empty list\n else {\n for (List<String> beginList : beginIndxLists) {\n // at the matched word in the list at beginIndx and then copy it to mwordsList at endIndx\n beginList.add(matchW);\n mwordsList.add(beginList);\n }\n }\n words[endIndx] = mwordsList;\n }\n }\n }\n\n }\n\n }\n return words[longWord.length()];\n }", "public static void search(String word){\n if(index.containsKey(word)){\n System.out.println(\"word \" + word + \" displays in :\");\n HashSet<String> list = index.get(word);\n for(String str:list){\n System.out.println(str);\n }\n }\n else{\n System.out.println(\"word \" + word + \" doesn't found!\");\n }\n }", "private static String lookForSentenceWhichContains(String[] words, String documentPath) throws IOException {\r\n\r\n File document = new File(documentPath);\r\n\r\n if (!document.exists()) throw new FileNotFoundException(\"File located at \"+documentPath+\" doesn't exist.\\n\");\r\n\r\n FileReader r = new FileReader(document);\r\n BufferedReader br = new BufferedReader(r);\r\n\r\n String line;\r\n String documentText = \"\";\r\n while ( (line=br.readLine()) != null) {\r\n documentText += line;\r\n }\r\n\r\n documentText = Jsoup.parse(documentText).text();\r\n\r\n String[] listOfSentences = documentText.split(\"\\\\.\");\r\n HashMap<String,String> originalToNormalized = new HashMap<>();\r\n String original;\r\n\r\n for (String sentence: listOfSentences){\r\n\r\n original = sentence;\r\n\r\n sentence = sentence.toLowerCase();\r\n sentence = StringUtils.stripAccents(sentence);\r\n sentence = sentence.replaceAll(\"[^a-z0-9-._\\\\n]\", \" \");\r\n\r\n originalToNormalized.put(original,sentence);\r\n }\r\n\r\n int matches, maxMatches = 0;\r\n String output = \"\";\r\n\r\n for (Map.Entry<String,String> sentence: originalToNormalized.entrySet()){\r\n\r\n matches = 0;\r\n\r\n for (String word: words){\r\n if (sentence.getValue().contains(word)) matches++;\r\n }\r\n\r\n if (matches == words.length) return sentence.getKey();\r\n if (matches > maxMatches){\r\n maxMatches = matches;\r\n output = sentence.getKey();\r\n }\r\n }\r\n\r\n return output;\r\n\r\n }", "public static Set<String> getUniqueWords(String input) {\r\n HashSet<String> hSet = new HashSet<String>();\r\n ArrayList<String> words = getWords(input);\r\n for(String word: words) {\r\n if(!hSet.contains(word)) {\r\n hSet.add(word);\r\n }\r\n }\r\n return hSet;\r\n }", "public int minWordBreak(String s, Set<String> dict) {\n Map<String, List<String>> map = new HashMap<String, List<String>>();\n List<String> possibles = wordBreakHelper(s,dict,map);\n int minCut = s.length();\n for (String possible: possibles) {\n int cut = possible.split(\" \").length;\n if (minCut > cut)\n minCut = cut;\n }\n return minCut;\n}", "public Map<String, Integer> wordCount(String string) {\n\t\t//Split the input string by into individual words. Takes out the spaces, commas, apostrophes\n\t\tString[] splitWords = string.split(\"[\\\\s',]\");\n\t\t//Initiate the hashmap to store unique words as keys and incrementing values with repeated keys\n\t\tMap<String, Integer> wordCount = new HashMap<>();\n\t\tfor(int i = 0; i < splitWords.length; i++ ) {\n\t\t\t//increment word count if the word is already in the hashmap. Make a new entry if word is unique to the map.\n\t\t\tif (wordCount.containsKey(splitWords[i])) {\n\t\t\t\twordCount.put(splitWords[i], wordCount.get(splitWords[i])+1);\n\t\t\t}else {\n\t\t\t\twordCount.put(splitWords[i], 1);\n\t\t\t}\t\t\n\t\t}\n\t\t//Remove the empty spaces from the map (to satisfy a test case)\n\t\twordCount.remove(\"\");\n\t\treturn wordCount;\n\t}", "private void wordSearch(String word, HashMap<String, SearchResult> resultMap, ArrayList<SearchResult> words) {\n\t\tfor (String path : index.get(word).keySet()) {\n\t\t\tint frequency = index.get(word).get(path).size();\n\t\t\tint initialPosition = index.get(word).get(path).first();\n\t\t\t\n\t\t\tif (!resultMap.containsKey(path)) {\n\t\t\t\tresultMap.put(path, new SearchResult(frequency, initialPosition, path));\n\t\t\t\twords.add(resultMap.get(path));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSearchResult searchResult = resultMap.get(path);\n\t\t\t\tsearchResult.addToFrequency(frequency);\n\t\t\t\tsearchResult.updateInitialPosition(initialPosition);\n\t\t\t}\n\t\t}\n\t}", "public Map<String, Integer> wordCount(String string) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tString foundword = \"\";\n\t\tstring = string.replaceAll(\"\\n\",\"\");\n\t\tMap<String, Integer> WordCountMap = new HashMap<>();\n\t\tList<String> stringList = new ArrayList<String>();\n\t\tfor(int i = 0; i < string.length(); i++) {\n\t\t\t//System.out.println(string.charAt(i));\n\t\t\t\n\t\t\tif(string.charAt(i) == ' ') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\telse if(string.charAt(i) == ',') {\n\t\t\t\tstringList.add(foundword);\n\t\t\t\tfoundword = \"\";\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tfoundword = foundword + string.charAt(i);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tstringList.add(foundword);\n\t\t\n\t\tfor(String name: stringList) {\n\t\t\tif(WordCountMap.containsKey(name)) {\n\t\t\t\t//The frequencyMap already contains the count for this name;\n\t\t\t\t//So we want to increase that count by 1\n\t\t\t\tint currentCount = WordCountMap.get(name);\n\t\t\t\tWordCountMap.put(name, currentCount+1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tWordCountMap.put(name, 1); //Track the name with a count of 1 if we haven't seen it before\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn WordCountMap;\n\t}", "public boolean isInDictionary(String word) {\n return isInDictionary(word, Language.ENGLISH);\n }", "public List<Integer> findSubstring(String s, String[] words) {\n if (s == null || s.isEmpty() || words == null || words.length == 0) {\n return new ArrayList<>();\n }\n\n List<Integer> res = new ArrayList<>();\n int size = words.length;\n int length = words[0].length();\n\n if (s.length() < size * length) {\n return new ArrayList<>();\n }\n\n Map<String,Integer> covered = new HashMap<>();\n\n for (int j=0; j<size; j++) {\n if (s.indexOf(words[j]) < 0) {\n return res;\n }\n\n covered.compute(words[j], (k, v) -> v != null ? covered.get(k)+1 : 1);\n }\n\n int i=0;\n int sLength = s.length();\n while(sLength -i >= size * length){\n Map<String, Integer> temp = new HashMap<>(covered);\n\n for (int j=0; j<words.length; j++){\n String testStr = s.substring(i + j*length, i + (j+1)*length);\n\n if (temp.containsKey(testStr)){\n if (temp.get(testStr) == 1)\n temp.remove(testStr);\n else\n temp.put(testStr, temp.get(testStr)-1);\n }\n else {\n break;\n }\n }\n\n if (temp.size() == 0) {\n res.add(i);\n }\n\n i++;\n }\n return res;\n }", "public String[] stringMatching(String input, int letterPosition) {\n\n\t\tString[] matchResult = new String[3];\n\n\t\t// if input is \"\" or null\n\t\tif (input == null || input.equals(\"\")) {\n\t\t\tmatchResult[0] = \"\";\n\t\t\tmatchResult[1] = \"\";\n\t\t\tmatchResult[2] = \"\";\n\t\t\treturn matchResult;\n\t\t}\n//\t\tString lowerInput = input.toLowerCase();\n\n\t\n\t\t\tTreeSet<String> DictionaryForXmlTree = DictionaryForXml\n\t\t\t\t\t.getInstance().getDictionaryTreeAt(letterPosition);\n\t\t\t// get three word closest to the input\n\t\t\tmatchResult[0] = DictionaryForXmlTree.ceiling(input);\n\t\t\tif(matchResult[0] != null){\n\t\t\t\tmatchResult[1] = DictionaryForXmlTree.higher(matchResult[0]);\n\t\t\t\tif(matchResult[1] != null){\n\t\t\t\t\tmatchResult[2] = DictionaryForXmlTree.higher(matchResult[1]);\n\t\t\t\t\tif(matchResult[2]==null)\n\t\t\t\t\t\tmatchResult[2]=\"\";\n\t\t\t\t}else {\n\t\t\t\t\tmatchResult[1] = \"\";\n\t\t\t\t\tmatchResult[2] = \"\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tmatchResult[0] = \"\";\n\t\t\t\tmatchResult[1] = \"\";\n\t\t\t\tmatchResult[2] = \"\";\n\t\t\t}\n\n\t\t\tfor(int i = 0;i<matchResult.length;i++){\n\t\t\t\tif(matchResult[i].startsWith(input) == false){\n\t\t\t\t\tmatchResult[i] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Iterator it =DictionaryForXmlTree.iterator();\n\t\t\n\t\treturn matchResult;\n\t}", "public static void main(String args[])\n {\n // Let the given dictionary be following\n String dictionary[] = {\"hit\", \"hits\", \"kilts\", \"pEg\",\"peN\",\"pentAgon\",\"slit\",\"slits\",\"sTilts\"};\n\n\n\n char boggle[][] = {{'P','W','Y','R'},\n {'E','N','T','H'},\n {'G','S','I','Q'},\n {'O','L','S','A'}\n };\n\n String[] val=findWords(boggle,dictionary);\n\n System.out.println(Arrays.toString(val));\n\n\n }", "private ArrayList<String> matchingWords(String word){\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor(int i=0; i<words.size();i++){\n\t\t\tif(oneCharOff(word,words.get(i))){\n\t\t\t\tlist.add(words.get(i));\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public String replaceWords(List<String> dict, String sentence) {\n TrieNode root = buildTrie(dict);\n \n // extract words from the given sentence\n String[] arr = sentence.split(\" \");\n StringBuilder sb = new StringBuilder();\n \n //search root for each word, if found repleace it otherwise keep it as it is.\n for(int i=0; i<arr.length; i++){\n String s = dfs(root,arr[i]);\n if(s != null){\n sb.append(s+\" \"); \n } \n else{\n sb.append(arr[i]+ \" \");\n } \n }\n return sb.toString().trim();\n }", "public String spellcheck(String word) {\n // Check if the world is already in lcDictionary.\n String lcdictionaryLookup = lcDictionary.get(word.toLowerCase());\n if(lcdictionaryLookup != null) {\n return lcdictionaryLookup;\n }\n String reducedWord = reducedWord(word);\n String rwdictionaryLookup = rwDictionary.get(reducedWord);\n if(rwdictionaryLookup != null) {\n return rwdictionaryLookup;\n }\n return \"NO SUGGESTION\";\n }", "public MySet<PageEntry> getPagesWhichContainWord (String str) {\n\t\tMySet<PageEntry> set = new MySet<>();\n\t\t\tMyLinkedList<WordEntry> Words = (MyLinkedList<WordEntry>)(ipData.getipList()[ipData.getHashIndex(str)]);\n\t\t\tWordEntry requiredWordEntry =new WordEntry();\n\t\t\tint i = 0;\n\t\t\tfor ( i = 0 ; i<Words.size() ; i++ ) {\n\t\t\t\tif (Words.getChildat(i).getWord().equals(str)) {\n\t\t\t\t\trequiredWordEntry = Words.getChildat(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i<Words.size()) {\n\t\t\t\tPageEntry p = new PageEntry();\n\t\t\t\tint sizeOPositions = requiredWordEntry.getListOfPositions().size();\n\t\t\t\tfor (int j = 0; j < sizeOPositions; j++) {\n\t\t\t\t\tp = requiredWordEntry.getListOfPositions().getChildat(j).getPageEntry();\n\t\t\t\t\tset.InsertAtFront(p);\n\t\t\t\t}\n\t\t\t}\n\t\treturn set;\n\t}", "public static List<String> DFS(String s, Set<String> wordDict, HashMap<String, LinkedList<String>>map) {\n\t if (map.containsKey(s)) \n\t return map.get(s);\n\t \n\t LinkedList<String>res = new LinkedList<String>(); \n\t if (s.length() == 0) {\n\t res.add(\"\");\n\t return res;\n\t } \n\t for (String word : wordDict) {\n\t if (s.startsWith(word)) {\n\t List<String>sublist = DFS(s.substring(word.length()), wordDict, map);\n\t for (String sub : sublist) \n\t res.add(word + (sub.isEmpty() ? \"\" : \" \") + sub); \n\t }\n\t } \n\t map.put(s, res);\n\t return res;\n\t}", "public boolean wordBreakUtil(String s,Set<String> set){\n\n if (s.length() == 0){\n return true;\n }\n\n for (int i=1; i <= s.length(); i++){\n\n // consider all prefixes of the current string\n String prefix = s.substring(0,i);\n\n // return true if the prefix is present in the dictionary and the\n // remaining string also forms a space-separated sequence of one or\n // more dictionary words\n if (set.contains(prefix) && wordBreakUtil(s.substring(i),set)){\n return true;\n }\n }\n\n return false;\n }", "private boolean checkDict(String word, String[] dict){\n int a = 0;\n int b = dict.length-1;\n while (a<=b) {\n int m = (a+b)/2;\n if (word.compareTo(dict[m]) == 0) return true;\n else if (word.compareTo(dict[m])>0) a = m+1;\n else b = m-1;\n }\n return false;\n }", "private String search_words(String word, int index){\n\t\tString found_words = \"\";\n\t\tint local_index = index +1;\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\tif(local_index > word.length()-1 || word.toLowerCase().charAt(local_index) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\tfound_words += child.search_words(word, local_index);\n\t\t}\n\t\tif(current_word != null && word.length() > current_word.length())\n\t\t\treturn found_words;\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word.toLowerCase().equals(word.toLowerCase()) ? current_word +\" & \" + definition + \"#\" + found_words +\"#\" : current_word + \"#\" + found_words;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word.toLowerCase().equals(word.toLowerCase()) ? current_word +\" & \" + definition + \"#\": current_word+ \"#\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "public WordInfo searchWord(String word) {\n\t\tSystem.out.println(\"Dic:SearchWord: \"+word);\n\n\t\tDocument doc;\n\t\ttry {\n\t\t\tdoc = Jsoup.connect(\"https://dictionary.cambridge.org/dictionary/english-vietnamese/\" + word).get();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t\tElements elements = doc.select(\".dpos-h.di-head.normal-entry\");\n\t\tif (elements.isEmpty()) {\n\t\t\tSystem.out.println(\" not found\");\n\t\t\treturn null;\n\t\t}\n\n\t\tWordInfo wordInfo = new WordInfo(word);\n\n\t\t// Word\n\t\telements = doc.select(\".tw-bw.dhw.dpos-h_hw.di-title\");\n\n\t\tif (elements.size() == 0) {\n\t\t\tSystem.out.println(\" word not found in doc!\");\n\t\t\treturn null;\n\t\t}\n\n\t\twordInfo.setWordDictionary(elements.get(0).html());\n\n\t\t// Type\n\t\telements = doc.select(\".pos.dpos\");\n\n\t\tif(elements.size() > 0) {\n\t\t\twordInfo.setType(WordInfo.getTypeShort(elements.get(0).html()));\n//\t\t\tif (wordInfo.getTypeShort().equals(\"\"))\n//\t\t\t\tSystem.out.println(\" typemis: \"+wordInfo.getType());\n\t\t}\n\n\t\t// Pronoun\n\t\telements = doc.select(\".ipa.dipa\");\n\n\t\tif (elements.size() > 0)\n\t\t\twordInfo.setAPI(\"/\"+elements.get(0).html()+\"/\");\n\n\t\t// Trans\n\t\telements = doc.select(\".trans.dtrans\");\n\n\t\tif (elements.size() > 0)\n\t\t\twordInfo.setTrans(elements.get(0).html());\n\n\t\tSystem.out.println(\" found\");\n\t\treturn wordInfo;\n\t}", "List<Integer> wordFinder(String text, String word) {\n\n List<Integer> indexes = new ArrayList<Integer>();\n String wordProper = \" \" + word + \" \";\n\n int index = 0;\n\n while (index != -1) {\n\n index = text.indexOf(wordProper, index);\n\n if (index != -1) {\n indexes.add(index);\n index++;\n }\n }\n\n return indexes;\n }", "List<String> DFS(String s, List<String> wordDict, HashMap<String, LinkedList<String>>map) {\n\t if (map.containsKey(s)) \n\t return map.get(s);\n\t \n\t LinkedList<String> res = new LinkedList<String>(); \n\t if (s.length() == 0) { //递归结束条件\n\t res.add(\"\");\n\t return res;\n\t }\n\t for (String word : wordDict) {\n\t if (s.startsWith(word)) {\n\t List<String>sublist = DFS(s.substring(word.length()), wordDict, map);\n\t for (String sub : sublist) \n\t res.add(word + (sub.isEmpty() ? \"\" : \" \") + sub); \n\t }\n\t } \n\t map.put(s, res);\n\t \n\t return res;\n\t}", "public static Set<String> signatureToWords(String signature){\n\n\t\tFile dictionary = new File(DICTIONARY_PATH); // Final Dictionary\n\t\t\n\t\t// The set of string words to return\n\t\tSet<String> out = new TreeSet<String>();\n\t\t\n\t\t// Try-catch attempting to read the file, throws an error if it isn't present\n\t\ttry { \n\t\t\tScanner scan = new Scanner(dictionary);\n\t\t\t\n\t\t\t// Scan each word in the dictionary and check if it's signature matches\n\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\n\t\t\t\tString dictWord = scan.nextLine().toLowerCase();\n\t\t\t\t\n\t\t\t\t// If the signature matches, add the word to the set\n\t\t\t\tif( signature.equals(wordToSignature(dictWord)) \n\t\t\t\t\t\t&& (out.contains(dictWord)==false)\n\t\t\t\t\t\t&& isValidWord(dictWord)) {\n\t\t\t\t\tout.add(dictWord);\n\t\t\t\t}\n\t\t\t}\n\t\t\tscan.close();\n\t\t}catch(FileNotFoundException e) {\n\t\t\t// If the file is not there print a message and the stack trace\n\t\t\tSystem.out.println(\"File not found ...\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn out;\n\t}", "public boolean checkDictionary(String word) {\n Node current = root;\n String check = word.toLowerCase().trim();\n // parse through the String word\n for (int i = 0; i < check.length(); i++) {\n // get the index of the selected character in the node array\n int index = getIndex(check.charAt(i));\n if (index < 0) {\n return false;\n }\n \n // if the iteration is not at the last character\n if (i < check.length() - 1) {\n // get the next node\n Node next = current.nexts[index];\n // if there is a next node, move to it\n if (next != null) {\n current = next;\n }\n // otherwise, the word does not exist as its path is longer than where it went in the dictionary\n else return false;\n }\n // if the iteration is on the last character\n else {\n // return true if the value at the node index is true, false otherwise\n return current.wordExists(index);\n }\n }\n // somehow the loop exitted without a return statement in the middle of it and the word does not exist\n return false;\n }", "public boolean wordPattern2(String pattern, String str) {\n\t\tString[] stra = str.split(\" \");\n if (pattern.length() != stra.length){\n return false;\n }\n HashMap<Character, String> map = new HashMap<Character, String>();\n \n for (int i = 0; i < stra.length; i++){\n Character c = pattern.charAt(i);\n String temp = stra[i];\n if (map.containsKey(c)){\n if (!temp.equals(map.get(c))){\n return false;\n }\n }\n else{\n if (map.containsValue(temp)){\n return false;\n }\n map.put(c, temp);\n }\n }\n return true;\n\t\t\n\t}", "public List<String> getRelatedWords(String word) throws IOException {\n List<String> result = new ArrayList<String>();\n IDictionary dict = new Dictionary(new File(WORDNET_LOCATION));\n try {\n dict.open();\n IStemmer stemmer = new WordnetStemmer(dict);\n for (POS pos : EnumSet.of(POS.ADJECTIVE, POS.ADVERB, POS.NOUN, POS.VERB)) {\n List<String> resultForPos = new ArrayList<String>();\n List<String> stems = new ArrayList<String>();\n stems.add(word);\n for (String stem : stemmer.findStems(word, pos)) {\n if (!stems.contains(stem))\n stems.add(stem);\n }\n for (String stem : stems) {\n if (!resultForPos.contains(stem)) {\n resultForPos.add(stem);\n IIndexWord idxWord = dict.getIndexWord(stem, pos);\n if (idxWord == null) continue;\n List<IWordID> wordIDs = idxWord.getWordIDs();\n if (wordIDs == null) continue;\n IWordID wordID = wordIDs.get(0);\n IWord iword = dict.getWord(wordID);\n \n ISynset synonyms = iword.getSynset();\n List<IWord> iRelatedWords = synonyms.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n \n List<ISynsetID> hypernymIDs = synonyms.getRelatedSynsets();\n if (hypernymIDs != null) {\n for (ISynsetID relatedSynsetID : hypernymIDs) {\n ISynset relatedSynset = dict.getSynset(relatedSynsetID);\n if (relatedSynset != null) {\n iRelatedWords = relatedSynset.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n }\n }\n }\n }\n }\n for (String relatedWord : resultForPos) {\n if (relatedWord.length() > 3\n && !relatedWord.contains(\"-\")\n && !result.contains(relatedWord)) {\n // TODO: Hack alert!\n // The - check is to prevent lucene from interpreting hyphenated words as negative search terms\n // Fix!\n result.add(relatedWord);\n }\n }\n }\n } finally {\n dict.close();\n }\n return result;\n }", "public static void main(String args[]) \n {\n String dictionary[] = {\"GEEKS\", \"FOR\", \"QUIZ\", \"GEE\"}; \n \n // root Node of trie \n TrieNode root = new TrieNode(); \n \n // insert all words of dictionary into trie \n int n = dictionary.length; \n for (int i=0; i<n; i++) \n insert(root, dictionary[i]); \n \n char boggle[][] = {{'G','I','Z'}, \n {'U','E','K'}, \n {'Q','S','E'} \n }; \n \n findWords(boggle, root); \n }", "public String getAnyWordStartingWith(String s) {\n TrieNode temp = searchNode(s);\n if (temp == null){\n return \"noWord\";\n }\n while (!temp.isWord){\n for (String c: temp.children.keySet()){\n temp = temp.children.get(c);\n s += c;\n break;\n }\n }\n return s;\n }", "private static List<String> getCandidates(String w, Set<String> words) {\n List<String> result = new LinkedList<>();\n for (int i = 0; i < w.length(); i++) {\n char[] chars = w.toCharArray();\n for (char ch = 'A'; ch <= 'Z'; ch++) {\n chars[i] = ch;\n String candidate = new String(chars);\n if (words.contains(candidate)) {\n result.add(candidate);\n }\n }\n }\n return result;\n }", "private boolean isWordInDictionaryRecursive ( String word, int begin, int end ) {\n\t\tif (begin > end )\n\t\t\treturn false;\n\t\t\n\t\tint half = (begin+end+1) / 2;\n\t\tint comparison = words.get(half).compareToIgnoreCase(word);\n\t\tif ( comparison < 0 )\n\t\t\treturn isWordInDictionaryRecursive( word, half + 1, end );\n\t\telse if ( comparison > 0 )\n\t\t\treturn isWordInDictionaryRecursive( word, begin, half - 1);\n\t\telse\n\t\t\treturn true;\n\t}", "void howManyStartsWithPrefix(String str) {\n dictionary.add(str);\n int count = 0;\n for (String word : words) {\n if (word.length() >= str.length()) {\n boolean isPrefix = true;\n for (int i = 0; i < str.length(); i++) {\n if (word.charAt(i) != str.charAt(i)) {\n isPrefix = false;\n break;\n }\n }\n if (isPrefix) {\n count++;\n }\n\n }\n }\n assertEquals(count, trie.howManyStartsWithPrefix(str));\n }", "@Override\n public boolean isWord(String s) {\n // TODO: Implement this method\n char[] c = s.toLowerCase().toCharArray();\n TrieNode predptr = root;\n for (int i = 0, n = c.length; i < n; i++) {\n TrieNode next = predptr.getChild(c[i]);\n if (next != null) {\n predptr = next;\n } else {\n return false;\n }\n\n }\n return predptr.endsWord();\n }", "private HashMap<Character, Integer> countAllLetters(String word) {\n WordToolbox otherWord = new WordToolbox(word.toLowerCase());\r\n HashMap<Character, Integer> mapOfWord = new HashMap<>();\r\n for (int i = 0; i < word.length(); i++) {\r\n mapOfWord.put(word.toLowerCase().charAt(i), otherWord.countHowMany(word.toLowerCase().charAt(i)));\r\n }\r\n return mapOfWord;\r\n }", "public ArrayList<String> FindAllCombinationWord(String str) {\r\n\r\n ArrayList<String> wordList = new ArrayList<String>();\r\n\r\n int n = str.length();\r\n ArrayList<String> combinationWord = permute(str, 0, n - 1);\r\n\r\n for (String item : combinationWord) {\r\n int j = 0;\r\n for (int i = n; i >= 2; i--) {\r\n String finalString = item.substring(j);\r\n\r\n if (!wordList.contains(finalString)) {\r\n wordList.add(finalString);\r\n }\r\n j++;\r\n }\r\n }\r\n return wordList;\r\n }", "public boolean contains(String word) {\r\n\r\n return dictionaryMap.containsKey(word.toUpperCase());\r\n\r\n }", "@Test\r\n public void shouldFindTheLongestWordInDictionary() {\r\n\r\n String inputWord = \"abppplee\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"ale\", \"apple\", \"bale\", \"kangaroo\", \r\n \"axxxxxxxxxxxxxx\", \"bddddddddddddddd\", \"cccccccccccccccccc\", \r\n \"hxxxxxxxxxxxxxx\", \"gbddddddddddddddd\", \"xccccccccccccccccc\"};\r\n\r\n assertEquals(\"apple\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "public String solve1(String s) {\n Map<String, Integer> frequency = new HashMap<>();\n String maxWord = null;\n String[] split = s.split(\" \");\n\n for (String word : split) {\n int newFrequency = frequency.getOrDefault(word, 0) + 1;\n frequency.put(word, newFrequency);\n if (newFrequency > frequency.getOrDefault(maxWord, 0)) {\n maxWord = word;\n }\n }\n\n return maxWord;\n }", "public boolean findWord ( String word ) {\n\t\tif(this.contains(word))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t\t\n\t\t/**old code written by Professor below\n\t\t * \n\t\t */\n\t\t//return isWordInDictionaryRecursive( word, 0, words.size()-1);\n\n\t}", "public boolean search(String word) {\n boolean allFlag = false;\n for (Entry<String, String> entry : dataStructure.entrySet()) {\n boolean flag = true;\n String key = entry.getKey();\n if (key.equals(word)) {\n return true;\n }\n if (key.length() != word.length()) {\n return false;\n }\n\n char[] aArr = word.toCharArray();\n char[] bArr = key.toCharArray();\n for (int i = 0; i < aArr.length; i++) {\n if (aArr[i] == '.') {\n continue;\n } else {\n if (aArr[i] != bArr[i]) {\n flag = false;\n break;\n }\n }\n\n }\n if (flag) {\n return true;\n }\n }\n return allFlag;\n }", "static boolean isEnglishWord(String str) {\r\n return localDictionary.contains(str);\r\n }", "public String[] wordSearch(String word,String[] arrayInput){\n\t\t\r\n\t\tString[] TempArray1 = new String[arrayInput.length];\r\n\t\tString[] TempArray2;\r\n\t\tint count1=0;\r\n\t\tint count2=0;\r\n\t\t\r\n\t\tfor(int i=0;i<arrayInput.length;i++){\r\n\t\t\t//create an array of all the words found in the input array\r\n\t\t\t//*note, this array is the same length as the input, therefore contains NULL values\r\n\t\t\tif(arrayInput[i].toLowerCase().contains(word.toLowerCase())){\r\n\t\t\t\tTempArray1[count1] = arrayInput[i];\r\n\t\t\t\tcount1++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\tif (count1>0){\r\n\t\t\t//1. check to see if anything was found\r\n\t\t\t//2. If found, add all the values found to a correctly sized array\r\n\t\t\t//3.return\r\n\t\t\tTempArray2 = new String[count1];\r\n\t\t\tfor(int i=0;i<arrayInput.length;i++){\r\n\t\t\t\tif(TempArray1[i] != null){\r\n\t\t\t\t\tcount2++;\r\n\t\t\t\t\tTempArray2[count2-1] = TempArray1[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn TempArray2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//nothing found, return\r\n\t\t\tTempArray1 = new String[1];\r\n\t\t\tTempArray1[0]=\"Empty\";\r\n\t\t\treturn TempArray1;\r\n\t\t}\r\n\t}", "private int numEnglishWords(String str) {\n int numWords = 0;\n String[] strings = str.split(\" \");\n for (String word : strings) {\n if (english.contains(word)) {\n numWords ++;\n }\n }\n return numWords;\n }", "public boolean wordPattern(String pattern, String str) {\n Map<Character, String> c2s = new HashMap<Character, String>();\n Map<String, Character> s2c = new HashMap<String, Character>();\n String [] sArr = str.split(\" \");\n if(pattern.length() != sArr.length) return false;\n int len = pattern.length();\n for(int i = 0; i <= len - 1; i ++){\n char c = pattern.charAt(i);\n String s = sArr[i];\n // For a given (c, s) pair, we need result to contain two mappings (c->s and s->c), check if \n // mapping from c, s exist and map to different targets (which violates one-one mapping)\n if((c2s.containsKey(c) && !c2s.get(c).equals(s)) || (s2c.containsKey(s) && s2c.get(s) != c))\n return false;\n if(!c2s.containsKey(c)){\n c2s.put(c, s);\n s2c.put(s, c);\n }\n }\n \n return true;\n }", "public static ArrayList<String> getWordsInString(String s) {\r\n\t\t// Search words in text\r\n\t\tString[] split = s.replace('-', ' ').split(\" \");\r\n\t\tArrayList<String> words = new ArrayList<String>(split.length);\r\n\t\t// Remove punctuation\r\n\t\tfor(String str : split) {\r\n\t\t\tif(str.isEmpty()) continue;\r\n\t\t\tStringBuilder wordBuilder = new StringBuilder();\r\n\t\t\tfor(int j = 0; j < str.length(); j++) {\r\n\t\t\t\tchar c = str.charAt(j);\r\n\t\t\t\tif(c >= 'A' && c <= 'Z') c = (char) (c + 'a' - 'A');\r\n\t\t\t\tif((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) {\r\n\t\t\t\t\twordBuilder.append(c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twords.add(wordBuilder.toString());\r\n\t\t}\r\n\t\treturn words;\r\n\t}", "public static void main(String[] args) {\n String s = \"applepenapple\";\n List<String> wordDict = new ArrayList<>();\n wordDict.add(\"apple\");\n wordDict.add(\"pen\");\n// String s = \"catsandog\";\n// List<String> wordDict = new ArrayList<>();\n// wordDict.add(\"cats\");\n// wordDict.add(\"dog\");\n// wordDict.add(\"sand\");\n// wordDict.add(\"cat\");\n\n System.out.println(wordBreak2(s, wordDict));\n }", "private void find(char[] m, String message, Trie cur, Trie root, int index, List<String> results) {\n // Base case 1. No match with any dictionary word. if cur == null -> no match ; return\n if (cur == null) {\n return;\n }\n // Base case 2. if out of bounds, check previously collected word and return\n if (index == message.length()) {\n // result only in case matches word\n if (cur.word != null) {\n results.add(new String(m));\n }\n return;\n }\n char c = message.charAt(index);\n if (c == SPACE) {\n // matches word or character 'e'\n // check if matches word from dictionary\n if (cur.word != null) {\n m[index] = SPACE;\n // if space - start collecting new word from beginning of Trie\n find(m, message, root, root, index + 1, results);\n }\n // otherwise ' ' -> 'e'\n c = 'e';\n }\n // considered non-space character (backtracking)\n m[index] = c;\n // get next element from try\n Trie next = cur.get(c);\n find(m, message, next, root, index + 1, results);\n }", "private boolean isWord(String word) {\n\t\treturn dict.isWord(word);\n\t}", "public double getDictionaryLookupScoreOfString(String tweet) {\n double score = 0;\n List<TaggedToken> tokens = tokenizeAndTag(tweet);\n for (TaggedToken token : tokens) {\n score += sentiWordNet.extract(token.token, getWordNetTag(token.tag));\n }\n return score;\n }", "public static List<String> validWords(List<String> words)\n\t{\n\t\tStemmer stemmer = new Stemmer();\n\t\tList<String> goodWords = new ArrayList<String>();\n\t\tfor (String word : words)\n\t\t{\n\t\t\tString stem = stemmer.stem(word);\n\t\t\tif (dictUtils.dict.containsKey(stem))\n\t\t\t{\n\t\t\t\tgoodWords.add(dictUtils.dict.get(stem));\n\t\t\t}\n\t\t}\n\t\treturn goodWords;\n\t}", "public interface Dictionary {\n\t/**\n\t * Is the provided string a prefix to a word in the dictionary?\n\t * <p>\n\t * Implementations that don't support this operation will always return true, to prevent early termination of\n\t * operations.\n\t * <p>\n\t * An empty string is considered a prefix.\n\t */\n\tboolean isPrefix(String potentialPrefix);\n\n\t/**\n\t * Is the string provided a complete string in the dictionary?\n\t * <p>\n\t * An empty string is not a word.\n\t */\n\tboolean isWord(String potentialWord);\n}", "@Test\r\n public void shouldFindTheLongestWordInDictionary2() {\r\n\r\n String inputWord = \"abppplee\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"ale\", \"apple\", \"bale\", \"kangaroo\", \r\n \"axxxxxxxxxxxxxx\", \"bddddddddddddddd\", \"cccccccccccccccccc\", \r\n \"hxxxxxxxxxxxxxx\", \"gbddddddddddddddd\", \"xccccccccccccccccc\"};\r\n\r\n assertEquals(\"apple\", wordSeeker2.lookFor(inputWord, dictionary));\r\n }", "private ArrayList<WordDocument> getDocumentsWhereWordExists(String word){\n try{\n return dictionary.get(word).getDocumentWhereWordExistsIn();\n }catch (NullPointerException ex){\n return new ArrayList<WordDocument>();\n }\n }", "public void process(int length) {\n\t\t//the result HashMap contains the word and its parts\n\t\tHashMap<String, List<String>> result = new HashMap<>();\n\t\t// retrieve a list of all tokens with the given length from the dictionary\n\t\tList<String> wordsToProcess = getDict().getWordsByLength(length);\n\t\t\n\t\t// if not empty, process it\n\t\tif (!wordsToProcess.isEmpty()) {\n\t\t\tfor (String word : wordsToProcess) {\n\t\t\t\tfor (int cut = 1; cut < length - 1; cut++) {\n\t\t\t\t\tString firstWord = word.substring(0, cut);\n\t\t\t\t\tString secondWord = word.substring(cut);\n\n\t\t\t\t\tif (dict.contains(firstWord) && dict.contains(secondWord)) {\n\t\t\t\t\t\t// if we find a match, we add it to the results\n\t\t\t\t\t\tList<String> parts = new LinkedList<String>();\n\t\t\t\t\t\tparts.add(firstWord);\n\t\t\t\t\t\tparts.add(secondWord);\n\t\t\t\t\t\tresult.put(word, parts);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// result list is returned and can be used for further processing\n\t\tsetConcatWords(result);\n\t}", "int findLengthOfMatchingSubstring(String inputMorse, String dictionaryMorse) {\n int retVal = 0;\n for (int x=0; x<inputMorse.length(); x++) {\n if (inputMorse.length()>=(x+1) && dictionaryMorse.length()>=(x+1)) {\n return retVal;\n } else if (inputMorse.charAt(x)==dictionaryMorse.charAt(x)) {\n retVal++;\n } else {\n return retVal;\n }\n }\n return retVal;\n }", "public static ArrayList<String> getWords(String input) {\r\n ArrayList<String> w = new ArrayList<String>();\r\n input = input.toLowerCase();\r\n String[] words = input.split(\"\\\\s+\");\r\n for (int i = 0; i < words.length; i++) {\r\n words[i] = words[i].replaceAll(\"[^\\\\w]\", \"\");\r\n }\r\n for(String elem: words) {\r\n w.add(elem);\r\n }\r\n return w;\r\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String initialString = \"Dong-ding-dong\";\n String secondaryString = in.nextLine();\n\n // Stage 1 : count the letters\n int letterCounter = 0;\n for (int i = 0; i < initialString.length(); i++) {\n if (Character.isLetter(initialString.charAt(i))) {\n letterCounter++;\n }\n }\n System.out.println(\"Initial string contains \" + letterCounter + \" letters.\");\n\n // Stage 2: check if hardcoded string and inputed string are equal ignoring the case\n System.out.println(\"Are the two strings equal? 0 if yes : \" + initialString.compareToIgnoreCase(secondaryString));\n\n // Stage 3: show initial string as all caps and all lowercase\n System.out.println(initialString.toUpperCase());\n System.out.println(initialString.toLowerCase());\n\n // Stage 4: show all dongdexes\n for(int i = -1; i <= initialString.length();){\n i = initialString.toLowerCase().indexOf(\"dong\", i+1);\n if(i != -1){\n System.out.println(i);\n }\n else{\n break;\n }\n }\n\n // Stage 5: replace all words \"dong\" with \"bong\"\n initialString = initialString.toLowerCase().replaceAll(\"dong\",\"bong\");\n System.out.println(initialString);\n\n // Stage 6: search for duplicated words and show their count\n String[] words = initialString.toLowerCase().split(\"-\");\n int counter = 0;\n for(String word : words){\n if(word != \"\"){\n for(int i = 0; i < words.length; i++){\n if(word.matches(words[i])){\n counter++;\n words[i] = \"\";\n }\n }\n System.out.println(\"The word \" + word + \" is repeated \" + counter + \" times.\");\n word = \"\";\n counter = 0;\n }\n }\n }", "@Test \r\n public void shouldNotFindWordIntoTheDictionary() {\r\n String inputWord = \"xxxxx\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n\r\n assertNull(wordSeeker.lookFor(inputWord, dictionary));\r\n }", "public static int countWord(String string, String word) {\n int count = 0;\n while (string.indexOf(word) > -1) {\n count++;\n string = string.substring(string.indexOf(word) + 1);\n }\n return count;\n\n }", "public static void main(String[] args) {\n MapDictionary<String> dictionary = new MapDictionary<String>();\r\n dictionary.addEntry(new DictionaryEntry<String>(\"50 Cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"XYZ120 DVD Player\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"dvd player\",\"\"));\r\n\r\n // build the dictionary-chunker:\r\n // dictionary, tokenizer factory, flag1, flag2\r\n // tokenizer will ignore thre blank space in the matching process\r\n // all matches flag:\r\n // sensitive flag: when case sensitivity is enabled, \r\n ExactDictionaryChunker dictionaryChunkerTT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerTF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,false);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,false);\r\n\r\n\r\n\r\n System.out.println(\"\\nDICTIONARY\\n\" + dictionary);\r\n \r\n String text = \"50 Cent is hard to distinguish from 50 cent and just plain cent without case.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n \r\n text = \"The product xyz120 DVD player won't match unless it's exact like XYZ120 DVD Player.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n\r\n }", "static boolean isWordPresent(String sentence, String word)\n {\n String []s = sentence.split(\" \");\n\n // To temporarily store each individual word\n for ( String temp :s)\n {\n\n // Comparing the current word\n // with the word to be searched\n// if (temp.compareTo(word) == 0)\n// {\n// return true;\n// }\n if (temp.contains(word)) return true;\n }\n return false;\n }", "public Map<String, Integer> countWordsComputeIfPresent(String passage, String... strings) {\n\n Map<String, Integer> wordCounts = new HashMap<>();\n Arrays.stream(strings).forEach(s -> wordCounts.put(s, 0));\n Arrays.stream(passage.split(\" \")).forEach(word ->\n wordCounts.computeIfPresent(word, (key, val) -> val + 1));//word,\n return wordCounts;\n\n }", "public String[] findPath(String[] dictionary, String startWord, String endWord) {\n // Use A queue to save all the words to check and use BFS\n LinkedList<String> queue = new LinkedList<>();\n queue.addFirst(startWord);\n // Use an ArrayList to save the words visited\n ArrayList<String> visited = new ArrayList<>();\n // Use an ArrayList to save the parents of the words (in visited)\n ArrayList<Integer> parent = new ArrayList<>();\n parent.add(-1);\n int index = 0;\n String current;\n boolean founded = false;\n while (!queue.isEmpty()){\n current = queue.removeFirst(); //Remove the first word\n int currentI = visited.size(); // Get index for saving parent\n visited.add(current);\n //Check all available words and save to the arrayList\n for (int i = 0; i < current.length(); i++) {\n //Replace from the first letter\n for (char j = 'A'; j <= 'Z'; j++) {\n char[] neww = current.toCharArray();\n neww[i] = j;\n String newWord = String.valueOf(neww);\n //Check if the new word is a valid word\n if (checkDict(newWord,dictionary)){\n //Check if visited or in queue\n if (visited.contains(newWord)||queue.contains(newWord)) continue;\n //Add into queue\n queue.addLast(newWord);\n //Record parents\n parent.add(currentI);\n //Check if equals to end\n if (newWord.compareTo(endWord)==0) {\n founded = true;\n break;\n }\n }\n }\n if (founded) break;\n }\n if (founded) break;\n }\n if (founded){\n LinkedList<Integer> stack = new LinkedList<>();\n stack.addFirst(parent.get(parent.size()-1));\n while (parent.get(stack.getFirst())!=-1){\n stack.addFirst(parent.get(stack.getFirst()));\n }\n int size = stack.size();\n String result[] = new String[size+1];\n result[0] = startWord;\n stack.removeFirst();\n for (int i = 1; i <size; i++) {\n result[i] = visited.get(stack.removeFirst());\n }\n result[size] = endWord;\n return result;\n }\n return new String[0];\n }", "public boolean wordBreak(String s, List<String> wordDict) {\n Set<String> dic = new HashSet(wordDict);\n return dfs(s, dic);\n }", "public Iterable<String> getAllValidWords(BoggleBoard board) {\n int rows = board.rows();\n int cols = board.cols();\n ArrayList<String> all = new ArrayList<String>();\n // 1. enumerate all strings that can be composed by adj dice\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++)\n depthFirstSearch(board, i, j, all);\n }\n\n // 2. for each string, check the longest prefix\n // 2. store the word\n wordsSoFar = all;\n return wordsSoFar;\n }", "public String phraseWords(String input) {\n document = new Annotation(input);\n // run all Annotators on this text\n pipeline.annotate(document);\n String pos = document.get(CoreAnnotations.PhraseWordsTagAnnotation.class);\n\n return pos;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString[] dict = {\"hello\",\"leetcode\"};\r\n\t\tMagicDictionary dictionary = new MagicDictionary();\r\n\t\tdictionary.buildDict(dict);\r\n\t\tSystem.out.println(dictionary.search(\"hello\"));\r\n\t\tSystem.out.println(dictionary.search(\"hhllo\"));\r\n\t\tSystem.out.println(dictionary.search(\"hell\"));\r\n\t\tSystem.out.println(dictionary.search(\"leetcoded\"));\r\n\t\t\r\n\t\tSystem.out.println();\r\n\r\n\t\tMagicDictionary1 dictionary1 = new MagicDictionary1();\r\n\t\tdictionary1.buildDict(dict);\r\n\t\tSystem.out.println(dictionary1.search(\"hello\"));\r\n\t\tSystem.out.println(dictionary1.search(\"hhllo\"));\r\n\t\tSystem.out.println(dictionary1.search(\"hell\"));\r\n\t\tSystem.out.println(dictionary1.search(\"leetcoded\"));\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(dictionary.search(\"abcabacbababdbadbfaejfoiawfjaojfaojefaowjfoawjzoawj\"));\r\n\t\t\r\n\t}", "public boolean wordBreakUtilTopDown(String s, Set<String> dict,int[] lookup)\n {\n int n = s.length();\n\n // return true if the end of the string is reached\n if (n == 0) {\n return true;\n }\n\n // if the sub problem is seen for the first time\n if (lookup[n] == -1)\n {\n // mark subproblem as seen (0 initially assuming string\n // can't be segmented)\n lookup[n] = 0;\n\n for (int i = 1; i <= n; i++)\n {\n // consider all prefixes of the current string\n String prefix = s.substring(0, i);\n\n // if the prefix is found in the dictionary, then recur for the suffix\n if (dict.contains(prefix) && wordBreakUtilTopDown(s.substring(i),dict, lookup))\n {\n // return true if the string can be segmented\n lookup[n] = 1;\n return true;\n }\n }\n }\n\n // return solution to the current sub problem\n return lookup[n] == 1;\n }", "public Map<Sentence, NavigableSet<Integer>> findInSentences (String words,\n DialogueConstraints constraints)\n {\n\n Map<Sentence, NavigableSet<Integer>> matches = new LinkedHashMap<> ();\n\n for (Paragraph p : this.paragraphs)\n {\n\n matches.putAll (p.findInSentences (words,\n constraints));\n\n }\n\n return matches;\n\n }", "public static void main(String[] args) {\n String s = \"catsanddog\";\n Set<String> dict = new HashSet<>();\n dict.add(\"cat\"); dict.add(\"cats\"); dict.add(\"and\"); dict.add(\"sand\"); dict.add(\"dog\");\n WordBreak solution = new WordBreak();\n List<String> result = solution.wordBreak(s, dict);\n System.out.println(result);\n }", "public List<String> findAllPossibleMessages(String message, Set<String> dictionaryWords) {\n Trie trie = new Trie();\n trie.insert(dictionaryWords);\n List<String> results = new ArrayList<>();\n int index = 0;\n char[] m = new char[message.length()];\n // recursively call to collect results\n find(m, message, trie, trie, index, results);\n return results;\n }", "boolean break_word (ArrayList<String> strings, int index, String word) {\n boolean withWord = false;\n if (dictionary.contains(word)) {\n strings.add(word);\n if (index == sentence.length()) {\n System.out.println (strings);\n return true;\n }\n withWord = break_word(new ArrayList<String>(strings), index, \"\");\n strings.remove(strings.size() - 1);\n }\n if (index == sentence.length())\n return false;\n word += sentence.charAt(index);\n return break_word(new ArrayList<String>(strings), index+1, word) || withWord;\n }" ]
[ "0.7241863", "0.69419086", "0.68336535", "0.67913467", "0.66508746", "0.6456609", "0.6456324", "0.6427917", "0.6417049", "0.64159477", "0.63862103", "0.63716525", "0.63514334", "0.62341434", "0.6219301", "0.6211132", "0.6151512", "0.61224145", "0.60856754", "0.60661834", "0.6053093", "0.6051334", "0.60449517", "0.60418457", "0.60393184", "0.6028468", "0.5995421", "0.59925264", "0.59896153", "0.5987825", "0.59758866", "0.59666395", "0.59656745", "0.5954817", "0.5951687", "0.5943273", "0.59429353", "0.5935113", "0.59254646", "0.5901281", "0.589741", "0.5871239", "0.58697087", "0.5858457", "0.58560956", "0.5850209", "0.5848958", "0.5842285", "0.5838791", "0.58329916", "0.58182025", "0.5817478", "0.580345", "0.5800738", "0.57952523", "0.5791942", "0.5789636", "0.5781719", "0.57735753", "0.5772553", "0.57672256", "0.57505673", "0.5746261", "0.5745521", "0.574533", "0.5741213", "0.5714587", "0.5706021", "0.5700102", "0.56951946", "0.5694043", "0.5692899", "0.5685019", "0.56827825", "0.5682229", "0.5677153", "0.5674578", "0.567298", "0.56625307", "0.5653787", "0.56475717", "0.56475306", "0.5645604", "0.56445885", "0.5642116", "0.56346256", "0.5632835", "0.5632621", "0.562901", "0.5624642", "0.5619922", "0.5618563", "0.5618229", "0.5613863", "0.5608803", "0.560511", "0.56007767", "0.55984795", "0.5581685", "0.55777067", "0.5574556" ]
0.0
-1
called each time a new line was read from the stream.
protected void append(String line) { out.append(line); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readLine() throws IOException {\n line = reader.readLine(); // null at the end of the source\n currentPos = -1;\n\n if (line != null) {\n lineNum++;\n }\n\n if (line != null) {\n sendMessage(new Message(MessageType.SOURCE_LINE, new Object[]{lineNum, line}));\n }\n }", "private String eatLine( InputStream stream ) throws IOException {\n buffer = new StringBuffer();\n for ( boolean done = false; ! done; ) {\n int c = stream.read();\n switch ( (char) c ) {\n case '\\n':\n case '\\r':\n case END:\n done = true;\n break;\n default:\n buffer.append( (char) c );\n }\n }\n return buffer.toString();\n }", "void incrementLinesRead();", "void getNextLine()\n\t\t\tthrows IOException, FileNotFoundException {\n String nextLine = \"\";\n if (reader == null) {\n nextLine = textLineReader.readLine();\n } else {\n nextLine = reader.readLine();\n }\n if (nextLine == null) {\n atEnd = true;\n line = new StringBuffer();\n } else {\n\t\t line = new StringBuffer (nextLine);\n }\n if (context.isTextile()) {\n textilize ();\n }\n\t\tlineLength = line.length();\n\t\tlineIndex = 0;\n\t}", "private synchronized void updateLineCount(long lineCount) {\r\n\t\tthis.parsedLines += lineCount;\r\n\t}", "@Override\r\n\t\tpublic void run() {\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tString buffer;\r\n\t\t\t\t\r\n\t\t\t\twhile(!exit){\r\n\t\t\t\t\tbuffer = in.readLine();\r\n\t\t\t\t\tsetChanged();\r\n\t\t\t\t\tnotifyObservers(buffer);\r\n\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} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "private String readNextLine() {\n StringBuilder sb = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n sb.append(br.readLine());\n } catch (IOException e) {\n e.fillInStackTrace();\n }\n\n return sb.toString();\n }", "private void readNext() {\n nextLine = null;\n try {\n while (nextLine == null) {\n nextLine = reader.readNext();\n reader.consumeEmptyLines();\n if (reader.eof()) {\n break;\n }\n }\n if (nextLine != null) {\n super.recordCounter++;\n if (super.readLimit > 0 && super.recordCounter > super.readLimit) {\n nextLine = null;\n }\n }\n } catch (Exception ignore) {\n // no more lines\n }\n }", "protected void processLine(String line){}", "public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}", "void onLine(Terminal terminal, String line);", "public void newBufLine() {\n this.buffer.add(new ArrayList<Integer>());\n this.columnT = 0;\n this.lineT++;\n }", "@Override\n\tpublic String readLine() throws IOException {\n\t\tString line = super.readLine();\n\t\n\t\tif(line==null){\n\t\t\treturn null;\n\t\t}\t\n\t\tline = count+\" \"+line;\n\t\tcount++;\n\t\treturn line;\n\t}", "private boolean scanLine()\r\n\t{\r\n\t\tboolean isLine=true;\r\n\t\t\r\n\t\t//Implement Filter here.\r\n\t\t\r\n\t\treturn isLine;\r\n\t}", "public void endLine() {\n if (currentLine != null) {\n lines.add(currentLine);\n currentLine = null;\n }\n }", "@Override\n public void run() {\n String data = readFileBufferedReader();\n System.out.printf(\"Using BufferedReader, append lines to String. read %d char\\n\", data.length());\n }", "@Override\n protected boolean processReceivedLine(String fullLine, String header, String value, boolean moreAvailable) throws Exception {\n if (getResponseStarted() && mFileLinesHaveStarted) {\n // Look for end marker\n if (\"AE\".equals(header)) {\n mFileLinesHaveStarted = false;\n } else if (getFileLineReceivedDelegate() != null) {\n // Allow delegate to see the line\n getFileLineReceivedDelegate().fileLineReceived(fullLine, moreAvailable);\n }\n\n // Consume all the lines\n return true;\n } else {\n if (super.processReceivedLine(fullLine, header, value, moreAvailable)) {\n return true;\n } else if (this.getResponseStarted()) {\n if (\"AB\".equals(header)) {\n mFileLinesHaveStarted = true;\n } else {\n return false;\n }\n\n return true;\n }\n }\n\n return false;\n }", "@Override\n public void onLineInserted(int y, String line) {\n if (cursor.getY() == file.getLineCount() - 1) {\n if (file.getLineCount() > 1) {\n throw new IllegalStateException();\n }\n return;\n }\n if (y <= cursor.getY()) {\n cursor.moveBy(1, 0);\n }\n fireSizeChanged();\n }", "@Override\n synchronized public void run() {\n try {\n BufferedReader bufferedReader = new BufferedReader(\n new InputStreamReader(inputStream, Charset.defaultCharset())\n );\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n this.result.add(line);\n }\n } catch (IOException ex) {\n log.error(\"Failed to consume and display the input stream of type \" + streamType + \".\", ex);\n } finally {\n this.isStopped = true;\n notify();\n }\n }", "@Override\n public void run ()\n {\n // Retrieve the iterator object of the linesInput\n Iterator <Line> linesIterator = linesInput.iterator () ;\n \n // Iterator through the iterator until all entries have been accounted for\n while ( linesIterator.hasNext () ) \n { \n // Grab the next entry in the iterator\n Line lineChange = linesIterator.next() ;\n \n /*\n * Make sure that the users know was is going on by printing that the producer is \n * doing something.\n */\n System.out.println ( \"Line Producer is Producing: \" + lineChange.content ) ;\n \n // Store the line into the messagingQueue\n Program.messagingQueue.putMessage ( lineChange ) ;\n \n // Once the iterator had finished with the entry remove it as it is no longer needed.\n linesIterator.remove () ;\n }\n \n // Add end of file message to the queue showing that we have finished producing the messages.\n Line endOfFileMessage = new Line ( \"END-OF-FILE\", -1 ) ;\n Program.messagingQueue.putMessage ( endOfFileMessage ) ;\n }", "private static boolean readLine(BufferedInputStream is, MutableString read)\n throws IOException {\n read.length(0);\n int c = is.read();\n while((c!=-1)&&c!='\\n'&&c!='\\r') {\n read.append((char)c);\n c = is.read();\n }\n if(c==-1 && read.length()==0) {\n // EOF and none read; return false\n return false;\n }\n if(c=='\\n') {\n // consume LF following CR, if present\n is.mark(1);\n if(is.read()!='\\r') {\n is.reset();\n }\n }\n // a line (possibly blank) was read\n return true;\n }", "public final void nextRow() {\n this.line++;\n }", "public void line(String line) {\n\t\t}", "void endLine() {\n\t\tif (loaded != null && loaded.length() > 0) {\n\t\t\tlineContainer.set(loaded.toString());\n\t\t}\n\t\tloaded = new StringBuilder();\n\t}", "public void finish() {\n System.out.println();\n System.out.println(\"Line processed\");\n System.out.println(\"Reseting line...\");\n try{ Thread.sleep(5000); } catch(Exception e) { System.out.println(\"Thread exception\"); }\n this.buffer.clear();\n this.buffer.add(new ArrayList<Integer>());\n this.lineT = 0;\n this.columnT = 0;\n this.inputMode = false;\n }", "@Override\n\tprotected void endOfLine() {\n\t}", "void resetLine() {\n eof = (cursor == lineMark);\n cursor = lineMark;\n }", "public VCFLine getNextLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn reader.getCurrentLine();\n\t}", "@SuppressWarnings(\"unused\")\r\n private void addReadStream(Reader asciiStream) {\n\t\taddReadSize(100);\r\n\t}", "protected void readAhead() {\n if (! reader.hasNext()) {\n this.nextLine = null;\n } else {\n this.nextLine = reader.next();\n while (this.nextLine != null && this.nextLine.isEmpty() && reader.hasNext())\n this.nextLine = reader.next();\n }\n }", "public abstract String readLine() throws IOException, InterruptedException;", "public boolean hasNextLine() {\n return nextLine != null;\n }", "@Override\r\n\tpublic void itemAdded() {\r\n\t\tif (sendLines.size() == 1){\r\n\t\t\tgrblPort.addNewLineListener(this);\r\n\t\t\tgrblPort.sendDataLine(sendLines.get(0));\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public String readLine() throws IOException {\n checkBuffer(-1);\n this.randomAccessFile.seek(this.fileOffset + this.bufferPointer.bufferOffset);\n String line = this.randomAccessFile.readLine();\n this.fileOffset = this.randomAccessFile.getFilePointer();\n this.bufferPointer.invalidate();\n return line;\n }", "public boolean hasNextLine() {\n return sc.hasNextLine();\n }", "public void onOutputLineAdded(Window window, OutputLine line) {\n\t\t\t\n\t\t\tlinesLayout.addLine(line);\n\t\t}", "public void appendLine() {\n\t\t\tmBuilder.append(NewLineChar);\n\t\t\tlastAppendNewLine = true;\n\t\t}", "public LineInputStream(InputStream is) {\n\t\tinputStream = is;\n\t}", "public void receiveGarbageLine() {\n\t\treceivedGarbageLines++;\n\t\t// overall\n\t\tgarbageLinesReceived++;\n//\t\ttry {\n//\t\t\twhile (!hasLanded) {\n//\t\t\t\tThread.sleep(10);\n//\t\t\t}\n//\t\t} catch (InterruptedException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "private static void eachLine(BufferedReader br, List<String> lines) throws IOException {\n try {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n } else {\n lines.add(line);\n }\n }\n } finally {\n br.close();\n }\n }", "@SuppressWarnings(\"unused\")\r\n private void addReadStream(InputStream asciiStream) {\n\t\taddReadSize(100);\r\n\t}", "public void setline(String line) {\n\t\t_line = line;\n\t}", "public String nextLine()\n\t{\t\t\n\t\t\n\t\treturn this.getIn().nextLine();\n\t}", "private void addLine (String line) {\n writer.write (line);\n writer.newLine();\n // blockOut.append (line);\n // blockOut.append (GlobalConstants.LINE_FEED);\n }", "@DISPID(1610940416) //= 0x60050000. The runtime will prefer the VTID if present\n @VTID(22)\n boolean atEndOfLine();", "private boolean handleSeekAdded(String line){\n if (!(line.startsWith(\"<s> \") || line.startsWith(\"<sn> \")))\n return false;\n \n SeekInfoStruct seekInfo = SeekInfoStruct.parseSeekInfoLine(line);\n\n if (!processSeekAdded(seekInfo))\n processLine(line);\n\n return true;\n }", "public int getLine() {return _line;}", "public static String readNextLine() {\n return sc.nextLine();\n }", "public void onFinishedParsingInput() {\n // To output line to file: outputLine(string);\n }", "@Override\r\n\tpublic void reading() {\n\t\tSystem.out.println(\"reading\");\r\n\t}", "public void flushCurrentLine()\n {\n line = null;\n }", "private String nextLine(BufferedReader reader) throws IOException {\n String ln = reader.readLine();\n if (ln != null) {\n int ci = ln.indexOf('#');\n if (ci >= 0)\n ln = ln.substring(0, ci);\n ln = ln.trim();\n }\n return ln;\n }", "boolean handle(String line);", "public void addLine(String line){\n if (line != null && line.trim().length() > 0){\n fileLines.add(line);\n parsed = false;\n }\n }", "@Override\n public String readLine() {\n try {\n return this.bufferedReader.readLine();\n } catch (IOException e) {\n return \"\";\n }\n }", "public abstract boolean read(String line);", "public void readFromStream(Reader r) throws IOException\n\t{\n\t\tBufferedReader br=new BufferedReader(r);\n\t\tlines=new ArrayList();\n\n\t\twhile(true) {\n\t\t\tString input=br.readLine();\n\t\t\tif(input==null)\n\t\t\t\tbreak;\n\t\t\tlines.add(input);\n\t\t}\n\t}", "int nextLine(int allocate) throws IOException {\n final int length = lineLoader.nextLine(allocate);\n if(length>=0)\n lineNumber++;\n return length;\n }", "public final void incrementRowsReadEvent() {\n rowsRead_++;\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 inputFromStream(BufferedReader dis) throws IOException {\n String line = dis.readLine();\n setFile(line);\n int lines = Str.strToInt(dis.readLine());\n if (lines != 0) {\n lineNos = new int[lines];\n for (int i = 0; i < lineNos.length; ++i) {\n lineNos[i] = Str.strToInt(dis.readLine());\n }\n }\n }", "@Override\n protected void onTextData(Reader r) throws IOException {\n\n }", "private void newline() {}", "public synchronized void addLine(Line line)\r\n\t{\r\n\t\tlines.add(line);\r\n\t}", "public void run() {\n String nextLine;\n try {\n while ((nextLine = in.readLine()) != null && !stopped) {\n game.HandleIncommingMesg(this, nextLine);\n }\n System.out.println(\"Connection with: \" + playername + \" is lost!\");\n shutdown();\n } catch (IOException e) {\n shutdown();\n }\n }", "public void processStreamInput() {\n }", "private void logStream(BufferedReader br, boolean appendSerial) {\n try {\n if (br != null) {\n while (br.ready()) {\n String line = br.readLine();\n logger.debug(\"vm> \" + line);\n\n if (appendSerial) {\n serialConsoleMessages.add(line);\n }\n }\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void processInput() {\r\n\t\ttry {\r\n\t\t\thandleInput(readLine());\r\n\t\t} catch (WrongFormatException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public Line getLine() {\n return line;\n }", "private void addLine()\n\t{\n\t\tlines.add(printerFormatter.markEOL());\n\t}", "public abstract void visit(Line line);", "String getCurrentLine();", "public static boolean hasNextLine() {\n return sc.hasNext();\n }", "@Override\r\n\tpublic void newLineRecieved() {\n\t\tString response = grblPort.readNextLine();\r\n\t\tresponse.trim();\r\n\t\tSystem.out.println(\"Recieve: \" + response);\r\n\t\t//System.out.println(\"HAHAHAH\");\r\n\t\tif (response.contains(\"ok\") && grblPort.ok == false){\t\t\t\r\n\t\t\tgrblPort.ok = true;\t\t\r\n\t\t\tSystem.out.println(\"Got ACK\");\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t\tsendLines.remove(0);\r\n\t\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \t\t\r\n\t \t}\r\n\t\t}\r\n\t\tif (response.contains(\"error\")){\r\n\t\t\tSystem.out.println(\"ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR\");\r\n\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \r\n\t\t}\r\n\t\tif (response.contains(\"<\")&&response.contains(\">\")){\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t//\tgrblPort.sendDataLine(sendLines.remove(0)); \t\t\r\n\t \t}\r\n\t\t\tresponse = response.replaceAll(\"<\", \"\");\r\n\t\t\tresponse = response.replaceAll(\">\", \"\");\r\n\t\t\tString data[] = response.split(\",\");\r\n\t\t\tfor (String string : data) {\r\n\t\t\t\tstring = string.toUpperCase();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"************************************* \"+data[0]);\r\n\t\t\tswitch (data[0].toUpperCase()) {\r\n\t\t\tcase \"IDLE\":\r\n\t\t\t\tmachineState = MachineState.IDLE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"RUN\":\r\n\t\t\t\tmachineState = MachineState.RUNNING;\r\n\t\t\t\treturn;\r\n\t\t\t\t//break;\r\n\t\t\tcase \"QUEUE\":\r\n\t\t\t\tmachineState = MachineState.QUEUE;\r\n\t\t\t\treturn;\r\n\t\t\tdefault:\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public synchronized void readLog() {\n MemoryCache instance = MemoryCache.getInstance();\n try (Stream<String> stream = Files.lines(Paths.get(path)).skip(instance.getSkipLine())) {\n stream.forEach(s -> {\n Result result = readEachLine(s);\n instance.putResult(result);\n instance.setSkipLine(instance.getSkipLine() + 1);\n });\n } catch (IOException e) {\n logger.error(\"error during reading file \" + e.getMessage());\n }\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tString TransferLine = is.readUTF();\r\n\t\t\t\tSystem.out.println(\"Recv: \" + TransferLine);\r\n\t\t\t\tSimpleAttributeSet recv = new SimpleAttributeSet();\r\n\t\t\t\tStyleConstants.setForeground(recv, Color.RED);\r\n\t\t\t\tGUIObject.addText(\"Recv: \" + TransferLine, recv);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "public void lastReaderAdded(){\r\n\t\tdoneAddingReaders = true;\r\n\t}", "private void advanceUntilNL() throws BufferEndedException {\twhile (reader.getLastDelimiter()!='\\n') reader.nextToken();}", "public void computeLine ()\r\n {\r\n line = new BasicLine();\r\n\r\n for (GlyphSection section : glyph.getMembers()) {\r\n StickSection ss = (StickSection) section;\r\n line.includeLine(ss.getLine());\r\n }\r\n\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\r\n line + \" pointNb=\" + line.getNumberOfPoints() +\r\n \" meanDistance=\" + (float) line.getMeanDistance());\r\n }\r\n }", "@Override\n\tpublic String readLine() throws IOException {\n\t\tint length = readInt();\n\t\twriteInt(length);\n\t\tbyte[] data = awaitNextPacket(new byte[length]);\n\t\treturn new String(data);\n\t}", "@Test\n public void testNextLineText() {\n System.out.println(\"nextLineText\");\n System.out.println(\"nextLineText@no line terminators in the file.\");\n for(TypeOfStream stype: TypeOfStream.values()) {\n InputStream stream = getInputStream(stype, TypeOfContent.BYTE_10, cs_UTF_8);\n @SuppressWarnings(\"deprecation\")\n BufferedCharSequence instance = new BufferedCharSequence(stream, cs_UTF_8.newDecoder(), 10);\n assertEquals(0, instance.position());\n String expResult = TypeOfContent.BYTE_10.getContent();\n String result = instance.nextLineText();\n assertEquals(expResult, result);\n assertEquals(11, instance.position());\n }\n }", "@Test\n public void testBasicRead() throws IOException {\n String output = singleLineFileInit(file, Charsets.UTF_8);\n\n PositionTracker tracker = new DurablePositionTracker(meta, file.getPath());\n ResettableInputStream in = new ResettableFileInputStream(file, tracker);\n\n String result = readLine(in, output.length());\n assertEquals(output, result);\n\n String afterEOF = readLine(in, output.length());\n assertNull(afterEOF);\n\n in.close();\n }", "protected abstract void parse(String line);", "public abstract AbstractLine newLine(byte[] data) throws IOException;", "private synchronized boolean Iteration() {\n\t if (inputStream == null) {\n\t\treturn false;\n\t }\n\t int c = -1;\n\t try {\n\t\tint avail = inputStream.available();\n\t\tif (avail > 0) {\n\t\t c = inputStream.read();\n\t\t}\n\t } catch (Exception e) {\n\t\treturn false;\n\t }\n\t if (c < 0) {\n\t\treturn true;\n\t }\n\t if (c == '\\n') {\n\t\tlines.offer(buffer);\n\t\tbuffer = new String(\"\");\n\t } else {\n\t\tbuffer += (char)c;\n\t }\n\t return true;\n\t}", "public void readLine(String line) {\n\t\tif (request == null) {\n\t\t\tswitch (type) {\n\t\t\tcase JAGGRAB:\n\t\t\t\treadJaggrabPath(line);\n\t\t\t\tbreak;\n\t\t\tcase HTTP:\n\t\t\t\treadHttpPath(line);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (type == Type.HTTP) {\n\t\t\t\tif (line.length() == 0) {\n\t\t\t\t\tserve();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean setNext() throws IOException {\n final String line = mIn.readLine();\n if (line == null) {\n mCurrent = null;\n return false;\n }\n try {\n mCurrent = mParser.parseLine(line);\n if (mCurrent.getNumberOfSamples() != mNumSamples) {\n throw new VcfFormatException(\"Expected \" + mNumSamples + \" samples, but there were \" + mCurrent.getNumberOfSamples());\n }\n } catch (final VcfFormatException e) {\n throw new VcfFormatException(\"Invalid VCF record. \" + e.getMessage() + \" on line:\" + line); // Add context information\n }\n return true;\n }", "String readLine() throws IOException\n\t{\n\t\tString line = null;\n\t\tif (haveStreams())\n\t\t\tline = m_in.readLine();\n\t\telse\n\t\t\tline = keyboardReadLine();\n\n\t\tsetCurrentLine(line);\n\t\treturn line;\n\t}", "private String readLine() throws IOException {\n/* 276 */ String line = null;\n/* */ \n/* */ \n/* 279 */ boolean isLastFilePart = (this.no == 1L);\n/* */ \n/* 281 */ int i = this.currentLastBytePos;\n/* 282 */ while (i > -1) {\n/* */ \n/* 284 */ if (!isLastFilePart && i < ReversedLinesFileReader.this.avoidNewlineSplitBufferSize) {\n/* */ \n/* */ \n/* 287 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ int newLineMatchByteCount;\n/* 292 */ if ((newLineMatchByteCount = getNewLineMatchByteCount(this.data, i)) > 0) {\n/* 293 */ int lineStart = i + 1;\n/* 294 */ int lineLengthBytes = this.currentLastBytePos - lineStart + 1;\n/* */ \n/* 296 */ if (lineLengthBytes < 0) {\n/* 297 */ throw new IllegalStateException(\"Unexpected negative line length=\" + lineLengthBytes);\n/* */ }\n/* 299 */ byte[] lineData = new byte[lineLengthBytes];\n/* 300 */ System.arraycopy(this.data, lineStart, lineData, 0, lineLengthBytes);\n/* */ \n/* 302 */ line = new String(lineData, ReversedLinesFileReader.this.encoding);\n/* */ \n/* 304 */ this.currentLastBytePos = i - newLineMatchByteCount;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 309 */ i -= ReversedLinesFileReader.this.byteDecrement;\n/* */ \n/* */ \n/* 312 */ if (i < 0) {\n/* 313 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* 319 */ if (isLastFilePart && this.leftOver != null) {\n/* */ \n/* 321 */ line = new String(this.leftOver, ReversedLinesFileReader.this.encoding);\n/* 322 */ this.leftOver = null;\n/* */ } \n/* */ \n/* 325 */ return line;\n/* */ }", "public void setLine ( String value )\n {\n line = value;\n }", "public static void readEmptyLine(BufferedReader input_file_stream) {\n try {\n input_file_stream.readLine();\n } catch (IOException e) {\n System.out.println(\"Error reading empty line from stream \" + input_file_stream.toString());\n }\n }", "void newconsume() {\n\t\tfor (;;) {\n\t\t\tif (printnewline > newinfo.maxLine)\n\t\t\t\tbreak; /* end of file */\n\t\t\tif (newinfo.other[printnewline] < 0)\n\t\t\t\tshowinsert();\n\t\t\telse showmove();\n\t\t}\n\t}", "private String nextLine() {\n if (console) {\n return con.nextLine();\n }\n return scan.nextLine();\n\n }", "private void lineCheck(int linesToAdd) {\n\n\t\tTermio terminal = new Termio();\n\n\t\tif (lineCount >= maxLinesDisplayed) {\n\n\t\t\tlineCount = 0;\n\t\t\tSystem.out.print(\"\\n*** Press Enter To Continue ***\");\n\t\t\tterminal.keyboardReadChar();\n\n\t\t} else {\n\n\t\t\tlineCount += linesToAdd;\n\n\t\t} // if\n\n\t}", "@Override\n public void run() {\n\n startPingTimer();\n String read = \"\";\n\n try {\n while ((read = in.readLine()) != null){\n\n //System.out.println(\"[CLIENT] Received: \" + read);\n messageHandler(read);\n\n }\n closeConnection();\n\n }catch (IOException e){\n\n System.out.println(\"[CLIENT] \" + e.getMessage());\n System.out.println(\"[CLIENT] Connection closed.\");\n\n }\n\n }", "@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }", "public void start (BufferedReader br) throws IOException {\n\t\treader=br;\n\t\tnextLine = reader.readLine();\n\t}", "public void newChatLine(String line) {\n\t\tSystem.out.println(line);\n\t}", "public void newLine()\n {\n rst += NEW_LINE;\n }", "private void writeLine(String s) throws IOException {\n\tfbuf.write(s, 0, s.length());\n\tfbuf.newLine();\n }", "public LineByLineDataParser(DataDescription dataDescription) {\n super(dataDescription);\n buf.clear();\n }" ]
[ "0.69549114", "0.67379844", "0.6600791", "0.640583", "0.6385043", "0.63421315", "0.6330317", "0.6183181", "0.6179803", "0.6124847", "0.61172146", "0.6111867", "0.6095812", "0.60393703", "0.5923", "0.5919681", "0.5912756", "0.5905535", "0.5900604", "0.58960426", "0.58960354", "0.5893794", "0.58700144", "0.586081", "0.58492005", "0.5827003", "0.5812604", "0.57956916", "0.5794288", "0.5765801", "0.5762204", "0.5720128", "0.57070756", "0.5686762", "0.568143", "0.5656828", "0.56433034", "0.56282", "0.56239545", "0.5620078", "0.5611763", "0.56042165", "0.5592473", "0.5587236", "0.55772525", "0.557281", "0.5567311", "0.554523", "0.554442", "0.55410546", "0.5524285", "0.5521475", "0.5520699", "0.55041903", "0.5502129", "0.54967123", "0.5488386", "0.54845077", "0.54798293", "0.54764175", "0.5472392", "0.5461567", "0.5459801", "0.5444634", "0.54417074", "0.5433592", "0.54201525", "0.5418882", "0.54152596", "0.5409722", "0.5407641", "0.54060817", "0.53959984", "0.537946", "0.5374059", "0.5369238", "0.5360164", "0.5359239", "0.5347615", "0.5330832", "0.53300416", "0.53291404", "0.5323033", "0.5320872", "0.5320111", "0.53167254", "0.531037", "0.5309214", "0.53029615", "0.529838", "0.52937347", "0.5293212", "0.528346", "0.52819705", "0.5261702", "0.5261456", "0.5247114", "0.5246329", "0.5241523", "0.522649", "0.52149606" ]
0.0
-1
attaches output readers to a process which log to stderr and strout.
public void attach(Process p) { if (stdout == null) stdout = new StdOutReader(); if (stderr == null) stderr = new StdErrReader(); attach(p, stdout, stderr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void redirectOutput() {\n Process process = _vm.process();\n _errThread = new StreamRedirectThread(\"error reader\", process.getErrorStream(), System.err);\n _outThread = new StreamRedirectThread(\"output reader\", process.getInputStream(), System.out);\n _errThread.start();\n _outThread.start();\n }", "protected void connectProcess(Process p) {\n // redirect all stdout from all the processes into a combined output stream\n // that pipes all the data into a combined input stream that serves as this\n // process sequence's input stream\n if (_stdOutRedirector==null) {\n _stdOutRedirector = new StreamRedirectThread(\"stdout Redirector \"+_index,\n p.getInputStream(),\n _combinedStdOutStream,\n false/*close*/,\n new ProcessSequenceThreadGroup(_combinedStdErrStream),\n true/*keepRunning*/);\n _stdOutRedirector.start();\n }\n else {\n _stdOutRedirector.setInputStream(p.getInputStream());\n }\n if (_stdErrRedirector==null) {\n _stdErrRedirector = new StreamRedirectThread(\"stderr Redirector \"+_index,\n p.getErrorStream(),\n _combinedStdErrStream,\n false/*close*/,\n new ProcessSequenceThreadGroup(_combinedStdErrStream),\n true/*keepRunning*/);\n _stdErrRedirector.start();\n }\n else {\n _stdErrRedirector.setInputStream(p.getErrorStream());\n }\n _combinedOutputStream = p.getOutputStream();\n }", "public static\n void hookSystemOutputStreams() {\n out();\n err();\n }", "private static void ioProcess(final Process process) {\n\t\ttry (InputStream errorStream = process.getErrorStream(); BufferedReader br = new BufferedReader(new InputStreamReader(errorStream));) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tSystem.out.println(\"[LOG] line = \" + line);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new UncheckedIOException(e);\n\t\t}\n\t}", "static public StdReader stderr(Process process, StdProcessor processor) {\n \n return new StdReader(process.getErrorStream(), processor);\n }", "private void startStreams() {\n InputStream inputStream = process.getInputStream();\n bufferedInputStream = new BufferedReader(new InputStreamReader(inputStream));\n InputStream errorStream = process.getErrorStream();\n bufferedErrorStream = new BufferedReader(new InputStreamReader(errorStream));\n }", "ProcessRunner print(PrintStream out, PrintStream err);", "ProcessExecutor cloneWithOutputStreams(PrintStream stdOutStream, PrintStream stdErrStream);", "void setOutputChannels(Appendable outP, Appendable errP);", "void drain() {\n if (stdOutReader != null) {\n stdOutReader.drain();\n }\n if (stdErrReader != null) {\n stdErrReader.drain();\n }\n }", "private void redirectSystemStreams() {\r\n\t\tOutputStream out = new OutputStream() {\r\n\t\t\t@Override\r\n\t\t\tpublic void write(int b) throws IOException {\r\n\t\t\t\tupdateTextArea(String.valueOf((char) b));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void write(byte[] b, int off, int len) throws IOException {\r\n\t\t\t\tupdateTextArea(new String(b, off, len));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void write(byte[] b) throws IOException {\r\n\t\t\t\twrite(b, 0, b.length);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tSystem.setOut(new PrintStream(out, true));\r\n\t\tSystem.setErr(new PrintStream(out, true));\r\n\t}", "public ProcessSequence(ProcessCreator[] pcs) {\n _creators = pcs;\n _processes = new Process[_creators.length];\n for(int i=0; i<_processes.length; ++i) { _processes[i] = null; }\n _combinedInputStream = new PipedInputStream();\n try {\n _combinedStdOutStream = new PipedOutputStream(_combinedInputStream);\n _combinedInputStream.connect(_combinedStdOutStream);\n }\n catch(IOException e) { /* ignore, no output if this goes wrong */ }\n _combinedErrorStream = new PipedInputStream();\n try {\n _combinedStdErrStream = new PipedOutputStream(_combinedErrorStream);\n _combinedErrorStream.connect(_combinedStdErrStream);\n }\n catch(IOException e) { /* ignore, no output if this goes wrong */ }\n \n _deathThread = new Thread(new Runnable() {\n public void run() {\n GeneralProcessCreator.LOG.log(\"ProcessSequence._deathThread running\");\n boolean interrupted = false;\n // wait for the completion of each of the subprocesses\n while(_index<_processes.length) {\n GeneralProcessCreator.LOG.log(\"Waiting for process \"+_index);\n do {\n interrupted = false;\n try {\n _processes[_index].waitFor();\n }\n catch(InterruptedException e) { interrupted = true; }\n } while(interrupted);\n GeneralProcessCreator.LOG.log(\"Process \"+_index+\" terminated\");\n // a process has just terminated\n if (_index<_processes.length-1) {\n // increase index;\n ++_index;\n try {\n _processes[_index] = _creators[_index].start();\n GeneralProcessCreator.LOG.log(\"Process \"+_index+\" started\");\n connectProcess(_processes[_index]);\n }\n catch(IOException e) {\n // could not start the process, record error but continue\n // TODO: find a way to record the error in the ExternalProcessPanel\n// DrJavaErrorHandler.record(e);\n _processes[_index] = DUMMY_PROCESS;\n }\n }\n else {\n ++_index;\n GeneralProcessCreator.LOG.log(\"Closing StdOut and StdErr streams.\");\n try {\n stopAllRedirectors();\n _combinedStdOutStream.flush();\n _combinedStdOutStream.close();\n _combinedStdErrStream.flush();\n _combinedStdErrStream.close();\n }\n catch(IOException e) { /* ignore, just don't close the streams */ }\n }\n }\n }\n },\"Process Sequence Death Thread\");\n _index = 0;\n try {\n _processes[_index] = _creators[_index].start();\n }\n catch(IOException e) {\n // could not start the process, record error but continue\n // TODO: find a way to record the error in the ExternalProcessPanel\n _processes[_index] = DUMMY_PROCESS;\n// DrJavaErrorHandler.record(e);\n }\n connectProcess(_processes[_index]);\n _deathThread.start();\n }", "public void setErr(PrintStream err);", "void appendStderr(String line);", "public void collectInputStreams(Process p, StringBuffer sbInput, StringBuffer sbError) {\n\n InputStreamThread input = new InputStreamThread(p.getInputStream(), sbInput);\n InputStreamThread error = new InputStreamThread(p.getErrorStream(), sbError);\n\n input.start();\n error.start();\n\n try {\n input.join();\n error.join();\n }\n catch (InterruptedException e) {\n }\n }", "private void _debugSystemOutAndErr() {\n try {\n File outF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"out.txt\");\n FileWriter wo = new FileWriter(outF);\n final PrintWriter outWriter = new PrintWriter(wo);\n File errF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"err.txt\");\n FileWriter we = new FileWriter(errF);\n final PrintWriter errWriter = new PrintWriter(we);\n System.setOut(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n outWriter.print(s);\n outWriter.flush();\n }\n }));\n System.setErr(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n errWriter.print(s);\n errWriter.flush();\n }\n }));\n }\n catch (IOException ioe) {}\n }", "private static IOHandlerThread redirectIOStream(Reader reader, TextOutputStream writer) {\n IOHandlerThread thr = new IOHandlerThread(reader, writer);\n thr.start();\n return thr;\n }", "public void logStreams() {\n logger.debug(\"error stream:\");\n logStream(this.bufferedErrorStream, false);\n logger.debug(\"input stream:\");\n logStream(this.bufferedInputStream, true);\n }", "public void getResults()\n\t{\n\t\tThread mOutReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tmResults.add(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t//we will process the error stream just in case\n\t\tThread mErrReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getErrorStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tmOutReader.start();\n\t\tmErrReader.start();\n\n\t\t//wait for process to end.\n\t\ttry\n\t\t{\n\t\t\tmProcess.waitFor();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.err.println(\"process exception\");\n\t\t}\n\t\tmFinished = true;\n\t}", "public abstract InputStream stderr();", "static public StdReader stdout(Process process, StdProcessor processor) {\n \n return new StdReader(process.getInputStream(), processor);\n }", "public static void readStreamOfProcess(final Process pr){\n\t\t readStreamInThread(pr.getInputStream(),false, pr);\n\t\t readStreamInThread(pr.getErrorStream(),true, pr);\n\t }", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}", "final static void pipe(Process p)\n {\n pipe(p.getInputStream(), System.out);\n pipe(p.getErrorStream(), System.err);\n }", "public static void setOutputReceiver(Consumer<String> regular, Consumer<String> error) {\n DEBUG.out = regular;\n INFO.out = regular;\n WARN.out = error;\n ERROR.out = error;\n }", "private static void enrichLostInputsException(\n Path primaryOutputPath,\n ActionLookupData actionLookupData,\n FileOutErr outErrBuffer,\n LostInputsActionExecutionException lostInputsException) {\n lostInputsException.setPrimaryAction(actionLookupData);\n lostInputsException.setPrimaryOutputPath(primaryOutputPath);\n lostInputsException.setFileOutErr(outErrBuffer);\n }", "public void turnOnSystemOutput(){\n if(originalSystemOut == null){\n originalSystemOut = System.out;\n System.setOut(new PrintStream(generalStream));\n //will cause CSS hang up\n// System.setIn(console.getInputStream());\n }\n }", "public interface OutputProcessor {\n\n void process(Reader reader, Writer writer) throws IOException;\n\n}", "@Override\n public void init() throws Exception {\n // allocate a new logger\n Logger logger = Logger.getLogger(\"processinfo\");\n\n // add some extra output channels, using mask bit 6\n try {\n outputStream = new FileOutputStream(filename);\n logger.addOutput(new PrintWriter(outputStream), new BitMask(MASK.APP));\n } catch (Exception e) {\n LoggerFactory.getLogger(TcpdumpReporter.class).error(e.getMessage());\n }\n\n }", "public void start() {\n PrintStream printStream = new PrintStream(output, true) {\n @Override\n public void close() {\n super.close();\n stop();\n }\n };\n //Redirect the System.Err and System.out to the new PrintStream that was created\n System.setErr(printStream);\n System.setOut(printStream);\n running = true;\n flushThread.start();\n }", "private void logStream(BufferedReader br, boolean appendSerial) {\n try {\n if (br != null) {\n while (br.ready()) {\n String line = br.readLine();\n logger.debug(\"vm> \" + line);\n\n if (appendSerial) {\n serialConsoleMessages.add(line);\n }\n }\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public interface StdLogOutput {\n\n /**\n * The default {@link StdLogOutput}, which logs to stdout.\n */\n public static class DefaultLogOutput implements StdLogOutput {\n\n @Override\n public void log(String msg) {\n System.out.println(msg);\n }\n\n @Override\n public void log(Throwable error) {\n error.printStackTrace();\n }\n\n @Override\n public void close() {\n }\n }\n\n /**\n * @param msg\n * the message to log.\n */\n public void log(String msg);\n\n /**\n * @param error\n * a {@link Throwable} whose stack trace should be logged.\n */\n public void log(Throwable error);\n\n /**\n * Closes this instance.\n */\n public void close();\n}", "public ProcessRunnable(I_FabSystem sys, Process process, I_Method waitForMethod) {\n processLinesOut_ = sys.newConcurrentLinkedQueue(String.class);\n processDataIn_ = sys.newConcurrentLinkedQueue(ProcessOutputData.class);\n \n process_ = process;\n \n waitForMethod_ = waitForMethod;\n processInput_ = process_.getOutputStream();\n processOutput_ = process_.getInputStream();\n }", "public static void setLogStream(PrintStream log) {\n out = log;\n }", "InputStream getStderr();", "public PrintStreamCommandOutput( PrintStream output )\n {\n this( output, System.err );\n }", "private void writeProc() throws Exception {\n\t\tWriter writer = new Writer(this.procPath,this.procDataList);\n\t\twriter.running();\n\t}", "public void process(LogReader.Log log) throws IOException {\n }", "private static void addConsoleAppender() {\n ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();\n if (!(loggerFactory instanceof LoggerContext)) {\n return;\n }\n\n LoggerContext loggerContext = (LoggerContext) loggerFactory;\n\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n URL url = classLoader.getResource(\"logback-console.xml\");\n if (url == null) {\n LOG.warn(\"Cannot find logback-console.xml from classloader\");\n return;\n }\n\n try {\n JoranConfigurator joranConfigurator = new JoranConfigurator();\n // Configure with the addition logback-console, don't reset the context so that it will add the new appender\n joranConfigurator.setContext(loggerContext);\n joranConfigurator.doConfigure(url);\n } catch (JoranException e) {\n LOG.warn(\n \"Failed to configure log appender, logs will be missing from the Dataproc Job output\");\n }\n }", "VerboseProcess(final Process process) {\n super();\n\n Objects.requireNonNull(process, \"process must not be null\");\n\n this.process = process;\n\n streamHandler =\n new PumpStreamHandler(\n new StreamPumper(process.getInputStream(), LOGGER::info),\n new StreamPumper(process.getErrorStream(), LOGGER::error));\n streamHandler.start();\n }", "public void setLogWriter(PrintWriter out) throws ResourceException {\n log.finest(\"setLogWriter()\");\n logwriter = out;\n }", "synchronized static void initStreams()\n {\n if ( !initialized )\n {\n out = ansiStream(true);\n err = ansiStream(false);\n initialized = true;\n }\n }", "public void wrap() {\n if (fSavedOut != null) {\n return;\n }\n fSavedOut = System.out;\n fSavedErr = System.err;\n final IOConsoleOutputStream out = fCurrent.newOutputStream();\n out.setColor(ConsoleUtils.getDefault().getBlack()); \n \n System.setOut(new PrintStream(out));\n final IOConsoleOutputStream err = fCurrent.newOutputStream();\n err.setColor(ConsoleUtils.getDefault().getRed()); \n \n System.setErr(new PrintStream(err));\n }", "protected void instrumentIO()\r\n {\r\n // Clear out all the stream history stuff\r\n tcIn = null;\r\n tcOut = null;\r\n tcInBuf = null;\r\n\r\n // Make sure these are history-wrapped\r\n SystemIOUtilities.out();\r\n SystemIOUtilities.err();\r\n\r\n // First, make sure the original System.in gets captured, so it\r\n // can be restored later\r\n SystemIOUtilities.replaceSystemInContents(null);\r\n\r\n // The previous line actually replaced System.in, but now we'll\r\n // \"replace the replacement\" with one that uses fail() if it\r\n // has no contents.\r\n System.setIn(new MutableStringBufferInputStream((String)null)\r\n {\r\n protected void handleMissingContents()\r\n {\r\n fail(\"Attempt to access System.in before its contents \"\r\n + \"have been set\");\r\n }\r\n });\r\n }", "public synchronized void setErrListener(LineListener errListener) {\n this.errListener = errListener;\n }", "protected void init() {\n\t\tout = new StringWriter();\n\t\ttry {\n\t\t\twriter = XMLOutputFactory.newInstance().createXMLEventWriter(out);\n\t\t} catch (XMLStreamException xmlStrExp) {\n\t\t\tthrow new GrobidException(\"An error occured while creating the Stax event readers: \" + xmlStrExp.toString());\n\t\t} catch (FactoryConfigurationError factCongExp) {\n\t\t\tthrow new GrobidException(\"An error occured while creating the Stax event readers: \" + factCongExp.toString());\n\t\t}\n\t}", "void perform(LineReader input, OutputStream output) throws IOException;", "public void setOut(PrintStream out);", "public static synchronized GridTestPrintStream acquireErr() {\n // Lazy initialization is required here to ensure that parent\n // thread group is picked off correctly by implementation.\n if (testErr == null)\n testErr = new GridTestPrintStream(sysErr);\n\n if (errCnt == 0)\n System.setErr(testErr);\n\n errCnt++;\n\n return testErr;\n }", "ListenerThreads(Process chimera, Chimera chimeraObject, CyLogger logger) {\n\t\tthis.chimera = chimera;\n\t\tthis.chimeraObject = chimeraObject;\n\t\tthis.logger = logger;\n\t\treplyLog = new HashMap<String, List<String>>();\n \t \t// Get a line-oriented reader\n \treadChan = chimera.getInputStream();\n\t\tlineReader = new BufferedReader(new InputStreamReader(readChan));\n\t}", "@Test\n public void testWorkerIO_doesWrapSystemStreams() throws Exception {\n InputStream originalInputStream = System.in;\n PrintStream originalOutputStream = System.out;\n PrintStream originalErrorStream = System.err;\n\n // Swap in the test streams to assert against\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(new byte[0]);\n System.setIn(byteArrayInputStream);\n PrintStream outputBuffer = new PrintStream(new ByteArrayOutputStream(), true);\n System.setOut(outputBuffer);\n System.setErr(outputBuffer);\n\n try (outputBuffer;\n byteArrayInputStream;\n WorkRequestHandler.WorkerIO io = WorkRequestHandler.WorkerIO.capture()) {\n // Assert that the WorkerIO returns the correct wrapped streams and the new System instance\n // has been swapped out with the wrapped one\n assertThat(io.getOriginalInputStream()).isSameInstanceAs(byteArrayInputStream);\n assertThat(System.in).isNotSameInstanceAs(byteArrayInputStream);\n\n assertThat(io.getOriginalOutputStream()).isSameInstanceAs(outputBuffer);\n assertThat(System.out).isNotSameInstanceAs(outputBuffer);\n\n assertThat(io.getOriginalErrorStream()).isSameInstanceAs(outputBuffer);\n assertThat(System.err).isNotSameInstanceAs(outputBuffer);\n } finally {\n // Swap back in the original streams\n System.setIn(originalInputStream);\n System.setOut(originalOutputStream);\n System.setErr(originalErrorStream);\n }\n }", "public void processOutput() {\n\n\t}", "public void proccessLogFile() throws IOException {\n \n for(int i = 0; i < numberOfThreads; i++){\n Thread t = new LookupThread(entries, this);\n t.start();\n }//end for\n \n String entry = in.readLine();\n while(entry != null){\n if(entries.size() > numberOfThreads){\n try{\n Thread.sleep((long)1000.0 / numberOfThreads);\n }//end try \n catch(InterruptedException iex){\n continue;\n }//end catch\n \n synchronized(entries){\n entries.add(0, entry);\n entries.notifyAll();\n }//end synchronized\n \n entry = in.readLine();\n Thread.yield(); \n }//end if\n }//end while\n \n }", "@Override\n protected void runReporter(PrintWriter writer) throws Exception {\n this.reporter = this.outFormat.create(writer);\n this.reporter.openReport();\n // Loop through the genomes. We count the number of genomes processed, the number of annotated RNAs found,\n // and the number of SILVA RNAs found.\n int gCount = 0;\n int annoRna = 0;\n int blastRna = 0;\n for (Genome genome : this.genomes) {\n gCount++;\n log.info(\"Processing genome {} of {}: {}.\", gCount, this.genomes.size(), genome);\n this.reporter.openGenome(genome);\n // Get the annotated SSU rRNAs.\n annoRna += this.searchForAnnotatedRna(genome);\n // Get the BLAST SSU rRNAs.\n blastRna += this.blastForRna(genome);\n this.reporter.closeGenome(genome);\n }\n // All done. Finish the report.\n this.reporter.finish();\n log.info(\"{} genomes processed. {} RNAs found by BLAST, {} from annotations.\", gCount, blastRna, annoRna);\n }", "public void setLogWriter(PrintWriter out) throws ResourceException {\n this.logWriter = out;\n }", "@After\n\tpublic void restoreStreams() {\n\t\tSystem.setOut(originalOut);\n\t}", "public void addOutputReceiver(Consumer<String> receiver) {\n out = out.andThen(receiver);\n }", "public void addMonomer(Monomer monomer) throws IOException,\r\n MonomerException {\r\n addMonomer(monomer, false);\r\n }", "public Reading1(BufferedReader in, PrintStream out) { // agrego al constructor conversation\n\t\tthis.in = in;\n\t\tthis.out = out;\n\t}", "@Override\n\tpublic void pipeOutput() {\n\n\t}", "protected void finalizeSystemErr() {}", "public void setOutputReceiver(Consumer<String> receiver) {\n out = receiver;\n }", "protected void finalizeSystemOut() {}", "@Before\n\tpublic void setUpStreams() {\n\t\tSystem.setOut(new PrintStream(outContent));\n\t}", "@Override\n\t\tpublic void groupReadResponse(ProcessEvent pe) {\n\t\t\tgroupWrite(pe);\n\t\t}", "public ErrorHandlerLogger(Appendable out, Callback redirects, boolean summary) {\r\n\t\t_logger = out;\r\n\t\t\r\n\t\t_summary = summary;\r\n\r\n\t\t_redirects = redirects;\r\n\t\t\r\n\t\t_errors = Collections.synchronizedList(new ArrayList<ObjectThrowable>());\r\n\t\t\r\n\t\t_status = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t_rostatus = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\r\n\t\t_cache = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t_rocache = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t\r\n\t\t_type = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t_rotype = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t\r\n\t\t_time = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t_rotime = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t\r\n\t\t_lookups = 0;\r\n\r\n\t\t_df = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss Z\", Locale.US);\r\n\t}", "void setStderrFile(File file);", "@SuppressWarnings(\"restriction\")\r\n\tpublic void addProcessConsoleInputListener() {\r\n\t\tboolean debug = true;\r\n\t\tif (debug) return;\r\n\t\tIConsole console = DebugUITools.getConsole(fConsoleInterpreter.getProcess());\r\n\t\tif (console instanceof ProcessConsole) {\r\n\t\t\tfinal ProcessConsole c = (ProcessConsole) console;\r\n\t fProcConsoleStdOut = c.getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);\r\n\t fProcConsoleErrOut = c.getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);\r\n\t\t try {\r\n\t\t\t\tfConsoleProcWriter = new PrintWriter(new OutputStreamWriter(fProcConsoleStdOut,\"UTF8\"));\r\n//\t\t\t\tfConsoleProcReader = new BufferedReader(new InputStreamReader(fProcConsoleIn,\"UTF8\"));\r\n\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\tLog.log(IStatus.ERROR, \"RIDE console unsupported encoding\", e);\r\n\t\t\t}\r\n\r\n//\t\t\tfinal List<IConsoleInputListener> participants = ExtensionHelper\r\n//\t\t\t\t\t.getParticipants(ExtensionHelper.APLDEV_DEBUG_CONSOLE_INPUT_LISTENER);\r\n//\t\t\tfinal APLDebugTarget target = this;\r\n\t\t\tc.getDocument().addDocumentListener(new IDocumentListener() {\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\r\n\t\t\t\t\t// check if present a new line symbol\r\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\t\tWriteRIDE(\"PROC_TYPE: \" + inputFound);\r\n//\t\t\t\t\t\t\t\t\t\tfor (IConsoleInputListener listener : partcipants) {\r\n//\t\t\t\t\t\t\t\t\t\t\tlistener.newLineReceived(inputFound, target);\r\n//\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error listen input for process console\", 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\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void documentChanged(DocumentEvent event) {\r\n\t\t\t\t\tfSessionViewer.getTextWidget().setCaretOffset(Integer.MAX_VALUE);\r\n\t\t\t\t\t// only report when have a new line\r\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() > 2) {\r\n\t\t\t\t\t\t\t\t\t\t// user pasted something\r\n\t\t\t\t\t\t\t\t\t\tWriteRIDE(\"PROC_PASTE: \" + event.fText);\r\n//\t\t\t\t\t\t\t\t\t\tfor (IOConsoleInputListener listener : participants) {\r\n//\t\t\t\t\t\t\t\t\t\t\tlistener.pasteReceived(event.fText, target);\r\n//\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error listen input for process console\", 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\t\t}\r\n\t}", "@Override\n \tprotected void doExecutionStarted() throws CoreException {\n \t\tfinal OpenMpiRuntimeSystem rtSystem = (OpenMpiRuntimeSystem) getRtSystem();\n \t\tfinal IPJob ipJob = PTPCorePlugin.getDefault().getUniverse().getResourceManager(rtSystem.getRmID()).getQueueById(rtSystem.getQueueID()).getJobById(getJobID());\n \t\tfinal String zeroIndexProcessID = rtSystem.createProcess(getJobID(), \"Open MPI run\", 0);\n \t\tprocessIDs = new String[] { zeroIndexProcessID } ;\n \n \t\t/*\n \t\t * Listener that saves stdout.\n \t\t */\n \t\tfinal PipedOutputStream stdoutOutputStream = new PipedOutputStream();\n \t\tfinal PipedInputStream stdoutInputStream = new PipedInputStream();\n \t\ttry {\n \t\t\tstdoutInputStream.connect(stdoutOutputStream);\n \t\t} catch (IOException e) {\n \t\t\tassert false; // This exception is not possible\n \t\t}\n \t\tfinal InputStreamListenerToOutputStream stdoutPipedStreamListener = new InputStreamListenerToOutputStream(stdoutOutputStream);\n \t\t\n \t\tThread stdoutThread = new Thread() {\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tBufferedReader stdoutBufferedReader = new BufferedReader(new InputStreamReader(stdoutInputStream));\n \t\t\t\tIPProcess ipProc = ipJob.getProcessById(zeroIndexProcessID);\n \t\t\t\ttry {\n \t\t\t\t\tString line = stdoutBufferedReader.readLine();\n \t\t\t\t\twhile (line != null) {\n \t\t\t\t\t\tsynchronized (lock1) {\n \t\t\t\t\t\t\tipProc.addAttribute(ProcessAttributes.getStdoutAttributeDefinition().create(line));\n //\t\t\t\t\t\t\tSystem.out.println(line);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tline = stdoutBufferedReader.readLine();\n \t\t\t\t\t}\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\tPTPCorePlugin.log(e);\n \t\t\t\t} finally {\n \t\t\t\t\tstdoutPipedStreamListener.disable();\n //\t\t\t\t\tif (stdoutObserver != null) {\n //\t\t\t\t\t\tstdoutObserver.removeListener(stdoutPipedStreamListener);\n //\t\t\t\t\t}\n //\t\t\t\t\ttry {\n //\t\t\t\t\t\tstdoutOutputStream.close();\n //\t\t\t\t\t} catch (IOException e) {\n //\t\t\t\t\t\tPTPCorePlugin.log(e);\n //\t\t\t\t\t}\n //\t\t\t\t\ttry {\n //\t\t\t\t\t\tstdoutInputStream.close();\n //\t\t\t\t\t} catch (IOException e) {\n //\t\t\t\t\t\tPTPCorePlugin.log(e);\n //\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t};\n \n \t\t/*\n \t\t * Listener that saves stderr.\n \t\t */\n \t\tfinal PipedOutputStream stderrOutputStream = new PipedOutputStream();\n \t\tfinal PipedInputStream stderrInputStream = new PipedInputStream();\n \t\ttry {\n \t\t\tstderrInputStream.connect(stderrOutputStream);\n \t\t} catch (IOException e) {\n \t\t\tassert false; // This exception is not possible\n \t\t}\n \t\tfinal InputStreamListenerToOutputStream stderrPipedStreamListener = new InputStreamListenerToOutputStream(stderrOutputStream);\n \t\tThread stderrThread = new Thread() {\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tfinal BufferedReader stderrBufferedReader = new BufferedReader(new InputStreamReader(stderrInputStream));\n \t\t\t\tIPProcess ipProc = ipJob.getProcessById(zeroIndexProcessID);\n \t\t\t\ttry {\n \t\t\t\t\tString line = stderrBufferedReader.readLine();\n \t\t\t\t\twhile (line != null) {\n \t\t\t\t\t\tsynchronized (lock1) {\n \t\t\t\t\t\t\tipProc.addAttribute(ProcessAttributes.getStderrAttributeDefinition().create(line));\n //\t\t\t\t\t\t\tipProc.addAttribute(ProcessAttributes.getStdoutAttributeDefinition().create(line));\n //\t\t\t\t\t\t\tSystem.err.println(line);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tline = stderrBufferedReader.readLine();\n \t\t\t\t\t}\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\tPTPCorePlugin.log(e);\n \t\t\t\t} finally {\n \t\t\t\t\tstderrPipedStreamListener.disable();\n //\t\t\t\t\tif (stderrObserver != null) {\n //\t\t\t\t\t\tstderrObserver.removeListener(stderrPipedStreamListener);\n //\t\t\t\t\t}\n //\t\t\t\t\ttry {\n //\t\t\t\t\t\tstderrOutputStream.close();\n //\t\t\t\t\t} catch (IOException e) {\n //\t\t\t\t\t\tPTPCorePlugin.log(e);\n //\t\t\t\t\t}\n //\t\t\t\t\ttry {\n //\t\t\t\t\t\tstderrInputStream.close();\n //\t\t\t\t\t} catch (IOException e) {\n //\t\t\t\t\t\tPTPCorePlugin.log(e);\n //\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t};\n \n \t\t/*\n \t\t * Thread that parses map information.\n \t\t */\n \t\tfinal PipedOutputStream parserOutputStream = new PipedOutputStream();\n \t\tfinal PipedInputStream parserInputStream = new PipedInputStream();\n \t\ttry {\n \t\t\tparserInputStream.connect(parserOutputStream);\n \t\t} catch (IOException e) {\n \t\t\tassert false; // This exception is not possible\n \t\t}\n \t\tfinal InputStreamListenerToOutputStream parserPipedStreamListener = new InputStreamListenerToOutputStream(parserOutputStream);\n \t\tThread parserThread = new Thread() {\n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tOpenMpiResourceManagerConfiguration configuration = (OpenMpiResourceManagerConfiguration) getRtSystem().getRmConfiguration();\n \t\t\t\ttry {\n \t\t\t\t\t// Parse stdout or stderr, depending on mpi 1.2 or 1.3\n \t\t\t\t\tif (configuration.getVersionId().equals(OpenMpiResourceManagerConfiguration.VERSION_12)) {\n \t\t\t\t\t\tmap = OpenMpiProcessMapText12Parser.parse(parserInputStream);\n \t\t\t\t\t} else if (configuration.getVersionId().equals(OpenMpiResourceManagerConfiguration.VERSION_13)) {\n \t\t\t\t\t\tmap = OpenMpiProcessMapXml13Parser.parse(parserInputStream, new IOpenMpiProcessMapXml13ParserListener() {\n \t\t\t\t\t\t\tpublic void startDocument() {\n \t\t\t\t\t\t\t\t// Empty\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpublic void endDocument() {\n \t\t\t\t\t\t\t\t/*\n \t\t\t\t\t\t\t\t * Turn of listener that generates input for parser when parsing finishes.\n \t\t\t\t\t\t\t\t * If not done, the parser will close the piped inputstream, making the listener\n \t\t\t\t\t\t\t\t * get IOExceptions for closed stream.\n \t\t\t\t\t\t\t\t */\n \t\t\t\t\t\t\t\tif (stderrObserver != null) {\n \t\t\t\t\t\t\t\t\tparserPipedStreamListener.disable();\n \t\t\t\t\t\t\t\t\tstderrObserver.removeListener(parserPipedStreamListener);\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} else {\n \t\t\t\t\t\tassert false;\n \t\t\t\t\t}\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\t/*\n \t\t\t\t\t * If output could not be parsed, the kill the mpi process.\n \t\t\t\t\t */\n \t\t\t\t\tparserException = e;\n \t\t\t\t\tprocess.destroy();\n \t\t\t\t} finally {\n \t\t\t\t\tparserPipedStreamListener.disable();\n \t\t\t\t\tif (stderrObserver != null) {\n \t\t\t\t\t\tstderrObserver.removeListener(parserPipedStreamListener);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t};\n \n \t\t/*\n \t\t * Create and start listeners.\n \t\t */\n \t\tstdoutThread.start();\n \t\tstderrThread.start();\n \t\tparserThread.start();\n \n \t\tstderrObserver = new InputStreamObserver(process.getErrorStream());\n \t\tstdoutObserver = new InputStreamObserver(process.getInputStream());\n \n\t\tstdoutObserver.addListener(stdoutPipedStreamListener);\n\t\tstderrObserver.addListener(stderrPipedStreamListener);\n \n \t\t// Parse stdout or stderr, depending on mpi 1.2 or 1.3\n \t\tOpenMpiResourceManagerConfiguration configuration = (OpenMpiResourceManagerConfiguration) getRtSystem().getRmConfiguration();\n \t\tif (configuration.getVersionId().equals(OpenMpiResourceManagerConfiguration.VERSION_12)) {\n \t\t\tstderrObserver.addListener(parserPipedStreamListener);\n \t\t} else if (configuration.getVersionId().equals(OpenMpiResourceManagerConfiguration.VERSION_13)) {\n \t\t\tstdoutObserver.addListener(parserPipedStreamListener);\n \t\t} else {\n \t\t\tassert false;\n \t\t}\n \n \t\tstderrObserver.start();\n \t\tstdoutObserver.start();\n \n \t\ttry {\n \t\t\tparserThread.join();\n \t\t} catch (InterruptedException e) {\n \t\t\t// Do nothing.\n \t\t}\n \n \t\tif (parserException != null) {\n \t\t\tprocess.destroy();\n \t\t\tthrow new CoreException(new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), \"Failed to parse Open Mpi run command output.\", parserException));\n \t\t}\n \n \t\t/*\n \t\t * Copy job attributes from map.\n \t\t */\n \t\trtSystem.changeJob(getJobID(), map.getAttributeManager());\n \n \t\t/*\n \t\t * Copy process attributes from map.\n \t\t */\n \t\tList<Process> newProcesses = map.getProcesses();\n \t\tprocessIDs = new String[newProcesses.size()];\n \t\tfor (Process newProcess : newProcesses) {\n \t\t\tString nodename = newProcess.getNode().getName();\n \t\t\tString nodeID = rtSystem.getNodeIDforName(nodename);\n \t\t\tif (nodeID == null) {\n \t\t\t\tprocess.destroy();\n \t\t\t\tthrow new CoreException(new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), \"Hostnames from Open MPI output do not match expected hostname.\", parserException));\n \t\t\t}\n \n \t\t\tString processName = newProcess.getName();\n \t\t\tint processIndex = newProcess.getIndex();\n \t\t\tString processID = null;\n \t\t\tif (processIndex == 0) {\n \t\t\t\tprocessID = zeroIndexProcessID;\n \t\t\t} else {\n \t\t\t\tprocessID = rtSystem.createProcess(getJobID(), processName, processIndex);\n \t\t\t}\n \t\t\tprocessIDs[processIndex] = processID;\n \n \t\t\tAttributeManager attrMgr = new AttributeManager();\n \t\t\tattrMgr.addAttribute(ElementAttributes.getNameAttributeDefinition().create(processName));\n \t\t\tattrMgr.addAttribute(ProcessAttributes.getStateAttributeDefinition().create(ProcessAttributes.State.RUNNING));\n \t\t\tattrMgr.addAttributes(newProcess.getAttributeManager().getAttributes());\n \t\t\trtSystem.changeProcess(processID, attrMgr);\n \t\t}\n \t}", "protected CombinedStreamMonitor createStreamMonitor(InputStream in,\n\t\t\tInputStream err) {\n\t\tCombinedStreamMonitor monitor = new CombinedStreamMonitor(in, err);\n\t\tmonitor.setDrainLimit(this.getTestProperties()\n\t\t\t\t.getMaxDrainOutputInBytes());\n\t\treturn monitor;\n\t}", "private void fireOutputRecovered() {\n previousEvent = OUTPUT_RECOVERED;\n ownerPool.getIPCEventProcessor().execute(new OrderedExecutorService.KeyRunnable<StreamOutputChannel<PAYLOAD>>() {\n\n @Override\n public void run() {\n for (IPCEventListener l : outputRecoverListeners) {\n l.triggered(outputRecoveredEvent);\n }\n }\n\n @Override\n public StreamOutputChannel<PAYLOAD> getKey() {\n return StreamOutputChannel.this;\n }\n });\n }", "private static void execWithOutput(String[] cmd)\n throws IOException\n {\n Process p = Runtime.getRuntime().exec(cmd);\n StreamRedirector errRedirector = new StreamRedirector(p.getErrorStream(), System.err);\n errRedirector.start();\n StreamRedirector outRedirector = new StreamRedirector(p.getInputStream(), System.out);\n outRedirector.start();\n }", "@Override\n public void start() {\n int errors = 0;\n if (this.encoder == null) {\n addStatus(new ErrorStatus(\"No encoder set for the appender named \\\"\" + name + \"\\\".\", this));\n errors++;\n }\n\n // only error free appenders should be activated\n if (errors == 0) {\n super.start();\n }\n }", "public StreamGobbler(InputStream from, PrintStream to) {\n\t\tinput = from;\n\t\toutput = to;\n\t}", "public void setLogStream(OutputStream stream) {\n\t\tcloseLogHandler();\n\t\tlogHandler = new StreamHandler(stream, L2pLogger.getGlobalConsoleFormatter());\n\t\tlogHandler.setLevel(Level.ALL);\n\t\tlogger.addHandler(logHandler);\n\t}", "private static List<String> readOutput(Process process) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n\t\tString line;\n\t\tList<String> lines = new ArrayList<>();\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tlines.add(line);\n\t\t}\n\t\treturn lines;\n\t}", "@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}", "public ManagedProcess(final String executable, final Process process) {\n myProcess = process;\n myOutput = new StringBuilder();\n\n myLock = new ReentrantLock();\n myLogUpdated = myLock.newCondition();\n\n myReader = new BufferedReader(new InputStreamReader(\n myProcess.getInputStream()));\n\n new Thread(new OutputReader(), executable + \" Process Drain\").start();\n }", "public void logToXML( Resource output ) {\r\n\t\ttry( OutputStream out = output.newOutputStream() ) {\r\n\t\t\tlogToXML( out );\r\n\t\t} catch( IOException e ) {\r\n\t\t\tthrow new FatalIOException( e );\r\n\t\t}\r\n\t}", "protected void resetIO()\r\n {\r\n // Clear out all the stream history stuff\r\n tcIn = null;\r\n tcOut = null;\r\n tcInBuf = null;\r\n\r\n // Make sure these are history-wrapped\r\n SystemIOUtilities.out().clearHistory();\r\n SystemIOUtilities.err().clearHistory();\r\n SystemIOUtilities.restoreSystemIn();\r\n }", "public void turnOffSystemOutput() {\n if (originalSystemOut != null) {\n System.setOut(originalSystemOut);\n originalSystemOut = null;\n\n // WARNING: It is not possible to reconfigure the logger here! This\n // method is called in the UI thread, so reconfiguring the logger\n // here would mean that the UI thread waits for the logger, which\n // could cause a deadlock.\n }\n }", "private void setupWriter() {\n output = new StringWriter();\n writer = new PrintWriter(output);\n }", "void appendStdout(String line);", "protected void onError(I i, Exception e)\n/* */ throws Exception\n/* */ {\n/* 95 */ log.error(\"Error occurred while processing input on pipeline [{}]\", printableName(), e);\n/* */ }", "static PrintStream outputStream() {\n return System.err;\n }", "protected ConsoleHandler() {\n super();\n setConsole(System.err);\n setFormatter(LOG_FORMATTER);\n setLevel(DEFAULT_LEVEL);\n }", "private void setupStreams() {\n\t\ttry {\n\t\t\tthis.out = new ObjectOutputStream(this.sock.getOutputStream());\n\t\t\tthis.out.flush();\n\t\t\tthis.in = new ObjectInputStream(this.sock.getInputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "synchronized static public void systemInstall() {\n if (installed == 0) {\n initStreams();\n try {\n ((AnsiPrintStream) out).install();\n ((AnsiPrintStream) err).install();\n } catch (IOException e) {\n throw new IOError(e);\n }\n System.setOut(out);\n System.setErr(err);\n }\n installed++;\n }", "protected void stopAllRedirectors() {\n _stdOutRedirector.setStopFlag();\n _stdErrRedirector.setStopFlag();\n }", "@FunctionalInterface\npublic interface BufferedReaderProcessor {\n String process(BufferedReader b) throws IOException;\n \n}", "protected void onUnrecoverableError(I i, Throwable t)\n/* */ {\n/* 105 */ log.error(\"Unrecoverable error occurred while processing input on pipeline [{}]\", printableName(), t);\n/* */ }", "public StreamRedirectThread(final String name, final InputStream in, final OutputStream out) {\n\t\tsuper(name);\n\t\tthis.in = new InputStreamReader(in);\n\t\tthis.out = new OutputStreamWriter(out);\n\t\tsetPriority(Thread.MAX_PRIORITY-1);\n\t}", "public interface TestReporterAppender {\n\n void logMessage(String sMessage, boolean bError);\n\n void logMessage(String sMessage, Throwable t);\n\n void init();\n\n void traceExecution(CommandRequest cRequest, OpResult rResult);\n\n void traceExecution(HttpOpRequest request);\n}", "public Awk(String[] args, InputStream is, PrintStream os, PrintStream es)\r\n \t\t\tthrows Exception\r\n \t{\r\n \t\tSystem.setIn(is);\r\n \t\tSystem.setOut(os);\r\n \t\tSystem.setErr(es);\r\n \t\tmain(args);\r\n \t}", "public interface EDIOutputErrorReporter {\n /**\n * Report the desired message in an application specific format. Only\n * warnings and non-fatal errors should be reported through this interface.\n *\n * Fatal errors will be thrown as {@link EDIStreamException}s.\n *\n * @param errorType\n * the type of error detected\n * @param writer\n * the EDIStreamWriter that encountered the error\n * @param location\n * the location of the error, may be different than the location\n * returned by the writer (e.g. for derived element positions)\n * @param data\n * the invalid data, may be null (e.g. for missing required\n * element errors)\n * @param typeReference\n * the schema type reference for the invalid data, if available\n * from the current schema used for validation\n */\n void report(EDIStreamValidationError errorType,\n EDIStreamWriter writer,\n Location location,\n CharSequence data,\n EDIReference typeReference);\n}", "public GecAppender() {\n setThreshold(Level.ERROR);\n this.passthroughExceptions = new HashSet<Class<? extends Throwable>>();\n this.passthroughExceptions.add(InvocationTargetException.class);\n }", "@Override\n public void setLogTracer(LogTracer log) {\n\n }", "private void logRd(String message) throws IOException {\n\t\tlog.write(\"RD \" + System.currentTimeMillis() +\n\t\t\t\": \" + message + \"\\n\");\n\t\tlog.flush();\n\t}", "public ConsoleRedirect(TextArea textArea) {\n this.textArea = textArea;\n this.saveErr = System.err;\n this.saveOut = System.out;\n\n // Set the flushThread to be a Daemon thread. A Daemon thread will continue to run after the the program finishes\n flushThread.setDaemon(true);\n }", "public void setOutput(LineStroker output) {\n this.output = output;\n }" ]
[ "0.67496043", "0.6161286", "0.61310893", "0.61011946", "0.5958091", "0.5882107", "0.5594982", "0.5517065", "0.5506713", "0.546051", "0.53689027", "0.53618854", "0.535081", "0.5265009", "0.5218081", "0.5182633", "0.513835", "0.51078546", "0.5050441", "0.50318813", "0.5021838", "0.5006321", "0.4968345", "0.4949298", "0.4935723", "0.48976064", "0.48859122", "0.48776385", "0.48760644", "0.48683897", "0.48320073", "0.4819055", "0.48065162", "0.47598615", "0.47380048", "0.47317946", "0.4730089", "0.47283667", "0.47235966", "0.47086647", "0.4706533", "0.4679312", "0.4627121", "0.46241277", "0.46200418", "0.4590985", "0.45748526", "0.45699227", "0.45676884", "0.45434928", "0.45184258", "0.45168495", "0.45110473", "0.45095795", "0.4506995", "0.4506767", "0.4506561", "0.44968957", "0.44912615", "0.44722897", "0.4470405", "0.4467492", "0.4458437", "0.44520319", "0.4431896", "0.44315535", "0.44190758", "0.44122246", "0.44104725", "0.44083264", "0.43911865", "0.4388214", "0.43751588", "0.43514794", "0.43391016", "0.43300653", "0.4328796", "0.43234065", "0.43136102", "0.43034", "0.42956403", "0.42835927", "0.42800727", "0.4277873", "0.42734572", "0.42667836", "0.4265303", "0.4258916", "0.42565128", "0.4254867", "0.42514792", "0.42409757", "0.4235885", "0.42204824", "0.42193636", "0.42191058", "0.42190853", "0.4211932", "0.4207576", "0.420209" ]
0.616533
1
TODO Autogenerated method stub
@Override public String deleteStudent(Integer studentId, Integer classId) { ClassInfo classInfo = classMapper.selectByPrimaryKey(classId); if(classInfo == null) return "fail"; Student stu = new Student(); stu.setId(studentId); stu.setIsDelete(true); int operateResult = studentMapper.updateByPrimaryKeySelective(stu); if(operateResult == 0) { return "fail"; } else { classInfo.setStudentNum(classInfo.getStudentNum() - 1); classInfo.setUpdateDate(new Date()); classMapper.updateByPrimaryKeySelective(classInfo); } return "success"; }
{ "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
setUp() method which runs before every test invocation.
@Override /* Chaque objet utilisé est alors déclaré en tant que variuable d instance de la classe de test initialisé dans la methode setUp() et eventuellement libere dans la methode tearDown */ protected void setUp() throws Exception { cruiseBean = new CruiseBean(); clientCruise = new RestClientCruise(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before public void setUp() { }", "protected void setUp() {\n\t}", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before\n\t public void setUp() {\n\t }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Before\r\n\t public void setUp(){\n\t }", "protected void setUp() {\n\n }", "public void setUp() {\n\n\t}", "@Before\r\n\tpublic void setUp() {\n\t}", "public void setUp()\r\n {\r\n //empty on purpose\r\n }", "@Before\n public final void setUp() throws Exception\n {\n // Empty\n }", "@Before\n public void setUp() {\n System.out.println(\"\\n@Before - Setting Up Stuffs: Pass \"\n + ++setUpCount);\n // write setup code that must be executed before each test method run\n }", "@Before\n\tpublic void setUp() {\n\t}", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "protected void setUp() throws Exception {\n }", "@BeforeClass\n\t public void setUp() {\n\t }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n\t\t public void setUp() throws Exception {\n\t\t\t testHelper.setUp();\n\t\t }", "protected void setUp()\n {\n /* Add any necessary initialization code here (e.g., open a socket). */\n }", "protected void setUp() throws Exception {\n super.setUp();\n }", "protected void setUp() throws Exception {\n \n }", "protected void setUp() throws Exception {\n }", "protected void setUp()\r\n {\r\n /* Add any necessary initialization code here (e.g., open a socket). */\r\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@Before\n public void setUp() throws Exception {\n }", "@Before\n public void setUp() throws Exception {\n }", "@Before\n public void setUp () {\n }", "@Override\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Before\n public void setUp() {\n }", "@Before\n\tpublic void setUp() throws Exception\n\t{\n\t}", "@Before\n public void setUp()\n throws Exception\n {\n super.setUp();\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Before\n public void setUp() throws Exception {\n\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\t\n\t}", "protected void runBeforeTest() {}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\t//This method is unused. \r\n\t}", "@Override\n public void setUp() throws Exception {}", "@org.junit.Before\n public void setUp() {\n LOGGER.log(Level.INFO, \"Starting test\");\n emptyTestDirectory();\n }", "@BeforeEach\n\tpublic void setUp() throws Exception {\n\t}", "@BeforeAll\n static void setup() {\n log.info(\"@BeforeAll - executes once before all test methods in this class\");\n }", "@BeforeClass\n public void setUp() {\n }", "@Before\n public void setUp() throws Exception{\n }", "@Override\n\tpublic void setUp() throws Exception\n\t{\n\t\tsuper.setUp();\n\t}", "@Override\n\tpublic void setUp() throws Exception\n\t{\n\t\tsuper.setUp();\n\t}", "@Override\n\tpublic void setUp() throws Exception\n\t{\n\t\tsuper.setUp();\n\t}", "@BeforeClass\n public static void setUp() {\n }", "@BeforeMethod\r\n\tpublic void beforeMethod() {\r\n\t\t//initializeTestBaseSetup();\r\n\t}", "@BeforeEach\n void setUp() {\n }", "@BeforeEach\n void setUp() {\n }", "@BeforeEach\n public void setUp() {\n\n }", "@Before\n public void setUp() {\n start(fakeApplication(inMemoryDatabase(), fakeGlobal()));\n }", "@BeforeClass\n\tpublic static void testSetup() {\n\t\t// do something before all tests\n\t}", "@BeforeEach\n void beforeEach() throws Exception {\n super.setUp();\n }", "@Before public void setUp() {\n\t\tsetUp(new ParallelLogger());\n\t}", "protected void setUp() {\n config = new ContestConfig();\n }", "@Before\r\n\tpublic void setup() {\r\n\t}", "@Before\n\tpublic void setUp() {\n\t\ttest_count++;\n\t\tSystem.out.println(\"Test \"+ test_count);\n\t}", "@BeforeClass\r\n\tpublic static void setUp() throws Exception {\r\n\r\n\t\tAbstractDiffTest.setUp();\r\n\t}", "@BeforeClass(groups = { \"WorkflowNG\" })\n\tpublic void setUp() {\n\n\t\ttry {\n\t\t\t\n\t\t\tlog.warn(\"Starting: \" + this.getClass().getSimpleName());\n\n\t\t\tIEUtil.openNewBrowser();\n\t\t\tGeneralUtil.navigateToPO();\n\t\t\tGeneralUtil.logInSuper();\n\t\t\t// -----------------------------------\n\n\t\t} catch (Exception e) {\n\t\t\tAssert.fail(\"Unexpected error or exception\", e);\n\t\t}\n\t}", "@Before\n\tpublic void setUp()\n\t{\n\t\tOptionsManager.getSingleton().setTestMode(true);\n\t\tQuestManager.resetSingleton();\n\t}", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "protected void setUp() {\n //Clear all namespace in the ConfigManager\n TestHelper.resetConfig();\n }" ]
[ "0.8813886", "0.8775346", "0.86564493", "0.86564493", "0.86564493", "0.86564493", "0.86564493", "0.86415476", "0.8626013", "0.8626013", "0.85905623", "0.8541961", "0.8474956", "0.84740394", "0.84739745", "0.8440265", "0.8432147", "0.8429436", "0.8416813", "0.84012413", "0.83775747", "0.8375356", "0.8375356", "0.8375356", "0.8375356", "0.8371237", "0.8371237", "0.8371237", "0.8371237", "0.8371237", "0.83698714", "0.8360308", "0.8360197", "0.8358762", "0.834123", "0.8326928", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.8320733", "0.83199745", "0.83199745", "0.831517", "0.831517", "0.8302893", "0.8295499", "0.8294918", "0.8243997", "0.8231959", "0.820817", "0.82069606", "0.82045007", "0.82045007", "0.8198602", "0.8178151", "0.8177269", "0.81668496", "0.8161317", "0.81502324", "0.81240183", "0.8056068", "0.8020398", "0.8009231", "0.7995939", "0.79908645", "0.7980472", "0.7980472", "0.7980472", "0.7977527", "0.79533434", "0.7932532", "0.7932532", "0.7886063", "0.78843665", "0.78838784", "0.78837514", "0.7864342", "0.7846101", "0.78391266", "0.78319854", "0.7827689", "0.7818058", "0.7799621", "0.7792543", "0.7792543", "0.7792543", "0.7768549" ]
0.0
-1
The constructor for the Weapon class is called when we want to create objects of the misc class with a specific set of instace variables.
public Misc(boolean pickup, String name, boolean useable, int weight, int capacity) { super(pickup, name, useable, weight, capacity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Weapon ()\r\n\t{\r\n\t\t//no default values for Weapon attributes are set here as the specific weapon type unspecified at super level\r\n\t}", "public Weapon() {\n this(Weapon.defaultName, 0, new Level(0), 0, 0);\n }", "public Weapon(){\n \n name = \"Claw\"; // will be treated as a sword\n type = 'R';\n advType = 'G';\n disType = 'B';\n mt = 4;\n hit = 85;\n crit = 0;\n wt = 1;\n isMagic = true;\n \n }", "public Weapon()\n {\n name = \"None\";\n speed = 2;\n damage = 1;\n range = 1;\n }", "public WeaponComponent() {\n weaponName = \"none\";\n owned = false;\n damagePower = 1;\n }", "public WeaponTest() {\r\n\r\n }", "private Weapon() {\n\t\t\tname = \"\";\n\t\t\tdamage = 0;\n\t\t\tcrippleDamage = 0;\n\t\t\tflavors = new HashMap<>();\n\t\t}", "public Weapon(Weapon weapon) \n\t{\n\t\tsuper(weapon.getName());\n\t\tweaponDamage = weapon.getWeaponDamage();\n\t}", "public Weapon (Player player) {\n\t\tthis.player = player;\n\t}", "private void createWeapons()\n {\n woodSword = new Weapon(\"wood sword\", \" | does 12 damage\", 10, true); \n rustedSword = new Weapon(\"rusted sword\", \" | does 17 damage\", 15, true);\n silverSword = new Weapon(\"silver sword\", \" | does 32 damage\", 30, true);\n goldSword = new Weapon(\"gold sword\", \" | does 22 damage\", 20, true);\n titaniumSword = new Weapon(\"titanium sword\", \" | does 52 damage\", 50, true);\n silverSpear = new Weapon(\"silver spear\", \" | does 25 damage\", 23, true);\n infantryBow = new Weapon(\"infantry bow\", \" | does 30 damage\", 28, true);\n }", "public ShotgunWeapon() {\n description = \" Weapon: Shotgun has\";\n }", "public Weapon (String name) {\n\t\tsuper(name, weight, itemDamage, 0, 0, quantity);\n\t}", "public Weapon(Player player)\n\t{\n\t\tthis.bullets=new ArrayList<Bullet>();\n\t\tthis.player=player;\n\t\tpause = cooldown;\n\t}", "public ItemWeapon(float x, float y, int width, int height) { \r\n\t\tsuper(x, y, width, height);\r\n\t}", "public Weapon(int id, String name, List<String> warnings, FireMode fireMode, ConnectionStatus connectionStatus, String ip, String mac, int batteryLevel) {\n super(id, name);\n this.warnings = warnings;\n this.fireMode = fireMode;\n this.connectionStatus = connectionStatus;\n this.setIp(ip);\n this.setMac(mac);\n this.setBatteryLevel(batteryLevel);\n }", "public Weapon(DropType dropType) {\n\t\tthis(WeaponType.getRandom().toString());\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Weapon(String name, List<String> warnings, FireMode fireMode, ConnectionStatus connectionStatus, String ip, String mac) {\n super(name);\n this.warnings = warnings;\n this.fireMode = fireMode;\n this.connectionStatus = connectionStatus;\n this.setIp(ip);\n this.setMac(mac);\n }", "@Test\r\n public void test_weapon() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 7);\r\n assertEquals(\"gun\", weapon1.getInformation().getName());\r\n assertEquals(\"that a weapon for sure\", weapon1.getInformation().getDescription());\r\n assertEquals(7, weapon1.getDamage());\r\n }", "public Weapon(int id, String name, FireMode fireMode, ConnectionStatus connectionStatus, String ip, String mac, int batteryLevel) {\n super(id, name);\n this.warnings = new ArrayList<>();\n this.fireMode = fireMode;\n this.connectionStatus = connectionStatus;\n this.setIp(ip);\n this.setMac(mac);\n this.setBatteryLevel(batteryLevel);\n }", "public WeaponPanel() {\n initComponents();\n }", "public Weapon(String name, int weaponDamage) \n\t{\n\t\tsuper(name);\n\t\tif(weaponDamage > 0) \n\t\t{\n\t\t\tthis.weaponDamage = weaponDamage;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tthis.weaponDamage = 1;\n\t\t}\n\t}", "public Weapon(int id, String name, String ip, String mac) {\n super(id, name);\n this.warnings = new ArrayList<>();\n this.fireMode = FireMode.SAFE;\n this.connectionStatus = ConnectionStatus.NO_CONNECTION;\n this.setIp(ip);\n this.setMac(mac);\n }", "public Weapon(HashMap<?, ?> hashMap) {\n\t\t// these attributes must be set\n\t\tsetName((String) hashMap.get(\"name\"));\n\t\tsetType((String) hashMap.get(\"type\"));\n\t\tsetRange(new Range((HashMap<?, ?>) hashMap.get(\"range\")));\n\n\t\t// dmg multiplicator default: 1.0\n\n\t\t// default ist -1\n\t\tsetSpeed(hashMap.containsKey(\"speed\") ? Integer\n\t\t\t\t.parseInt((String) hashMap.get(\"speed\")) : -1);\n\n\t\t// default false - no area damage\n\t\tsetArea(hashMap.containsKey(\"area\") ? Boolean\n\t\t\t\t.parseBoolean((String) hashMap.get(\"area\")) : false);\n\n\t\t// default breakthrough 0\n\t\tsetBreakthrough(hashMap.containsKey(\"breakthrough\") ? Integer\n\t\t\t\t.parseInt((String) hashMap.get(\"breakthrough\")) : 0);\n\n\t\t// only_rare default false\n\t\tsetOnly_rare(hashMap.containsKey(\"only_rare\") ? Boolean\n\t\t\t\t.parseBoolean((String) hashMap.get(\"only_rare\")) : false);\n\n\t\t// boss_drop default false\n\t\tsetBoss_drop(hashMap.containsKey(\"boss_drop\") ? Boolean\n\t\t\t\t.parseBoolean((String) hashMap.get(\"boss_drop\")) : false);\n\n\t\tdmg = (float) (hashMap.containsKey(\"dmg\") ? Float.parseFloat((String) hashMap\n\t\t\t\t.get(\"dmg\")) : 1.0F);\n\t\t\n\t\t//sets random Count at creation\n\t\tRandom randomGenerator = new Random();\n\t\tsetCount(randomGenerator.nextInt(79) + 21);\n\t\tif (type.equals(WeaponType.melee.toString()))\n\t\t\tsetCount(1);\n\t}", "public Inventory () {\n weaponsInventory = new ArrayList<>();\n pointInventory = 0;\n lenInventory = 0;\n }", "public Weapon(WeaponType type, int level) {\n \tthis.effects = new ArrayList<>();\n this.type = type;\n this.level = level;\n this.effects.add(new AttackEffect(getWeaponDamage(), getWeaponSpeed(), getWeaponRange(), Target.SELF));\n }", "public Characters() {\n setWeapon(weapon);\n }", "private void default_init(){\n id = 0;\n xPos = 0;\n yPos = 0;\n hp = 100;\n name=\"\";\n character_id = 1;\n weapons = new ArrayList<>();\n weaponEntryTracker = new LinkedList<>();\n isJumping = false;\n isFalling = false;\n initial_y= -1;\n stateOfMovement = 0;\n for(int i = 0; i < 3; i++){\n this.weapons.add(new Pair<>(NO_WEAPON_ID, (short) 0));\n }\n this.weapons.set(0,new Pair<>(PISTOL_ID,DEFAULT_PISTOL_AMMO));\n currentWeapon = this.weapons.get(0);\n bulletsFired = new ArrayList<>();\n shootingDirection = 1;\n energy = 0;\n sprint = false;\n score = 0;\n roundsWon = 0;\n ready = false;\n audioHandler = new AudioHandler();\n }", "public Weapon(int id, String name, ConnectionStatus connectionStatus, String ip, String mac) {\n super(id, name);\n this.warnings = new ArrayList<>();\n this.fireMode = FireMode.SAFE;\n this.connectionStatus = connectionStatus;\n this.setIp(ip);\n this.setMac(mac);\n }", "public sword ( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor stub\r\n\t\tsuper();\r\n\t\tthis.setDamageBuff (3);\r\n\t\tthis.setDurability (15);\r\n\t\tthis.setWeaponName (\"Sword\");\r\n\t}", "public static Weapon spawnWeapon()\r\n\t{\r\n\t\tfinal int numberOfWeapons = 5; //update as weapons are added\r\n\t\t\r\n\t\t//Create weapons in order to access attributes / randomly select a weapon\r\n\t\tSword sword = new Sword();\r\n\t\tStick stick = new Stick();\r\n\t\tBazooka bazooka = new Bazooka();\r\n\t\tAtomicBomb atomicBomb = new AtomicBomb();\r\n\t\tPotatoCannon potatoCannon = new PotatoCannon();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tWeapon[] weapons = new Weapon[] {sword, stick,bazooka,atomicBomb,potatoCannon}; //store weapons in an array to randomly grab one to use in Game\r\n\t\t\r\n\t\tint randomWeapon; //weapon chosen\t\t\r\n\t\tRandom rng = new Random (); //create generator based upon current number of weapons\r\n\t\trandomWeapon = rng.nextInt(numberOfWeapons); //get a weapon object at random from array\r\n\r\n\t\treturn (weapons[randomWeapon]); //we have no need to create separate instance\r\n\t}", "private FireWeaponScreenFactory() {\n\t}", "public Weapon(int id, ConnectionStatus connectionStatus, String ip, String mac) {\n super(id, null);\n this.warnings = new ArrayList<>();\n this.fireMode = FireMode.SAFE;\n this.connectionStatus = connectionStatus;\n this.setIp(ip);\n this.setMac(mac);\n }", "public WeaponTab(final Project project) {\n\t\tsuper(project);\n\t\ticoncache = new HashMap<String, Image>();\n\n\t\tloadFile(Type.WEAPON);\n\t}", "public EntityManager(WeaponModule playerWeapon) {\n player = new PlayerEntity(\n Settings.game_width/2 - PlayerEntity.DEF_PLAYER_WIDTH/2,\n Settings.game_height/2 - PlayerEntity.DEF_PLAYER_HEIGHT/2,\n playerWeapon\n// new MainBlasterModule(Settings.player_gun_lock)\n// new SideBlasterModule()\n );\n\n ents = new ArrayList<Entity>();\n sub_queue = new ArrayList<Entity>();\n unsub_queue = new ArrayList<Entity>();\n\n cols = new ArrayList<CollisionBox>();\n sub_cueue = new ArrayList<CollisionBox>();\n unsub_cueue = new ArrayList<CollisionBox>();\n\n particles = new ArrayList<Particle>();\n p_sub_queue = new ArrayList<Particle>();\n p_unsub_queue = new ArrayList<Particle>();\n }", "public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }", "public Weapon(String n, int spd, int dmg, int rng)\n {\n name = n;\n speed = spd;\n damage = dmg;\n range = rng;\n }", "@Test\r\n public void test_weapon_less() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 0);\r\n assertEquals(1, weapon1.getDamage());\r\n }", "public LibraryMeleeWeapon(String weaponId, String group, String name, String description, int numberOfAttacks, int cost, int tl, double weight, int minST,\n boolean throwable, boolean cannotParry, int breakage, double armorDivisor, String weaponNotes, String documentSource) {\n super(weaponId, group, name, description, numberOfAttacks, cost, tl, weight, minST, weaponNotes, documentSource);\n this.throwable = throwable;\n this.cannotParry = cannotParry;\n this.breakage = (byte) breakage;\n this.armorDivisor = (float) armorDivisor;\n setObjectType(ObjectType.LibraryObject);\n }", "public static void init(){\n\n HELMET_COPPER = new ItemModArmor(COPPERARMOR, 1, EntityEquipmentSlot.HEAD, \"helmet_copper\");\n CHESTPLATE_COPPER = new ItemModArmor(COPPERARMOR, 1, EntityEquipmentSlot.CHEST, \"chestplate_copper\");\n LEGGINGS_COPPER = new ItemModArmor(COPPERARMOR, 2, EntityEquipmentSlot.LEGS, \"leggings_copper\");\n BOOTS_COPPER = new ItemModArmor(COPPERARMOR, 1, EntityEquipmentSlot.FEET, \"boots_copper\");\n\n }", "Player()\n\t{\n\t\tiHP = 30;\n\t\tstrEquippedWeapon = \"None\";\n\t\tiLocation = 1;\n\t\tblnPlayerState = true;\n\t\tblnPlayerVictory = false;\n\t\tblnSearchedDirt = false;\n\t\tblnSearchedBarrels = false;\n\t\t\n\t}", "public Player(byte id, short xPos, short yPos, byte hp, String name, ArrayList<Pair<Byte, Short>> weapons, ArrayList<Bullet> bullets, LinkedList<Byte> trakedWeapons, boolean jumpState, boolean fallState, short initial_y, byte currentWeapon,short currWeaponammo, short shootingDirection, boolean sprint, int score, byte roundsWon, boolean ready,int stateOfMovement,byte charId){\n this.id =id;\n this.score = score;\n this.ready = ready;\n this.xPos = xPos;\n this.yPos = yPos;\n this.hp = hp;\n this.weapons = weapons;\n this.name = name;\n character_id = 1;\n this.weaponEntryTracker = trakedWeapons;\n this.isJumping=jumpState;\n this.isFalling=fallState;\n this.bulletsFired = bullets;\n this.currentWeapon = new Pair<>(currentWeapon,currWeaponammo);\n this.initial_y = initial_y;\n this.shootingDirection = shootingDirection;\n this.sprint = sprint;\n this.roundsWon = roundsWon;\n this.stateOfMovement = stateOfMovement;\n this.character_id = charId;\n audioHandler = new AudioHandler();\n }", "public Sheep()\n {\n super(\"Sheep\",3,2,0); \n \n // tagline = \"Whatever\";\n maxHealth = 5;\n currentHealth = maxHealth;\n equip(new Cloth());\n equip(new SheepClaws());\n \n \n \n engaged = false;\n aggression = 1;\n special = 0;\n hostileRange = 2;\n }", "public Gun() {\n\t\tgunName = \"pistol\";\n\t\tammo = 7;\n\t\taccuracy = 7;\n\t}", "private WeaponFactory() throws IllegalStateException {\n\t\tweapons = new ArrayList<>();\n\t\tFile file = new File(\"config/Battle_Royale_Configs/Battle_Royale_Weapons.txt\");\n\t\treadWeaponsFromFile(file);\n\t}", "public ArtilleryTracker() {\n weapons = new Hashtable<Mounted, Vector<ArtilleryModifier>>();\n }", "public PickupWeaponBase(Vec2 position, WeaponBase weaponBarrel) {\n super(position, Vec2.ZERO, new Sprite(\"items/weaponBody\"));\n setSize(new Vec2(0.7, 0.7));\n setRenderLayer(RenderLayer.RenderLayerName.HIGH_BLOCKS);\n\n this.cli = weaponBarrel;\n\n collider = new CircleCollider(this, 30);\n collider.setTag(\"Item\");\n collider.addInteractionLayer(\"Walk\");\n\n }", "Hero()\n\t{\n\t\t\n\t\tsuper(152,500,97,124);\n\t\tlife = 3;\n\t\tdoubleFire = 0;\n\t\t\n\t}", "public EngineClass()\n {\n cyl = 10;\n fuel = new String( BATT );\n }", "public WorldGenGrassUnderbean()\n {\n }", "public Weapon(float x, float y, float laserSpeed, float laserWidth) {\n\t\tthis.x = x - (HALF * laserWidth);\n\t\tthis.y = y;\n\t\tthis.laserSpeed = laserSpeed;\n\t\tthis.width = laserWidth;\n\t\tthis.height = 0;\n\t\tthis.visible = true;\n\t}", "public PotionEffect(PotionEffect paramwq)\r\n/* 35: */ {\r\n/* 36: 44 */ this.id = paramwq.id;\r\n/* 37: 45 */ this.duration = paramwq.duration;\r\n/* 38: 46 */ this.amplifier = paramwq.amplifier;\r\n/* 39: 47 */ this.ambient = paramwq.ambient;\r\n/* 40: 48 */ this.showParticles = paramwq.showParticles;\r\n/* 41: */ }", "public Potion()\r\n\t{\r\n\t\tsuper(\"Potion\");\r\n\t\thealthRecovery = 30;\r\n\t}", "public Weapon(String name, String description, String type, int size, int price, int multChanged) {\r\n\t\tsuper(name, description, type, size, price);\r\n\t\tthis.multChanged = multChanged;\r\n\t}", "public Charmander(World w)\n {\n //TODO (48): Add a third parameter of Fire to this super line\n super(700, 1);\n getImage().scale(150, 100);\n w.addObject( getHealthBar() , 300, w.getHeight() - 50 );\n }", "public EndGameAttackPotion() {\n super(\"SuperAttackPotion\", Main.END_GAME_ATTACK_POTION_AMP, Main.END_GAME_ATTACK_POTION);\n }", "public Melee(ScrGame game, Player player){\n super();\n this.game = game;\n this.player = player;\n isPlayer = true;\n\n nSpray = 0;\n nShotsPerFire = 1;\n nAmmo = 1;\n nAmmoMax = nAmmo;\n }", "@Override\n\tpublic void initializeItemFields(CharacterClass item) {\n\t\titem.setStartingMainhandInstance(weaponBag.getItem(item.getStartingMainhand()));\n\t\titem.setStartingOffhandInstance(weaponBag.getItem(item.getStartingOffhand()));\n\n\t\titem.setStartingHelmetInstance(equipmentBag.getItem(item.getStartingHelmet()));\n\t\titem.setStartingChestInstance(equipmentBag.getItem(item.getStartingChest()));\n\t\titem.setStartingGlovesInstance(equipmentBag.getItem(item.getStartingGloves()));\n\t\titem.setStartingPantsInstance(equipmentBag.getItem(item.getStartingPants()));\n\t\titem.setStartingBootsInstance(equipmentBag.getItem(item.getStartingBoots()));\n\t\titem.setStartingRing1Instance(equipmentBag.getItem(item.getStartingRing1()));\n\t\titem.setStartingRing2Instance(equipmentBag.getItem(item.getStartingRing2()));\n\t\titem.setStartingNeckInstance(equipmentBag.getItem(item.getStartingNeck()));\n\n\t\t// Initialize Skills\n\t\tif(item.getSkillInstances() == null)\n\t\t\titem.setSkillInstances(new ArrayList<>());\n\n\t\tfor(String id: item.getSkills()) {\n\t\t\tSkill skill = skillBag.getItem(id);\n\t\t\titem.getSkillInstances().add(skill);\n\t\t}\n\t}", "public Fortress(int waterCapacityInitial, Vector2 position) {\r\n\t\tthis.position =position;\r\n\t\tthis.waterCapacity = waterCapacityInitial; \r\n\t\tthis.waterLevel = 0;\r\n\t\tthis.level = 1;\r\n\t\tthis.pumpSpeed = 1; \r\n\t\t//this.weapon = new Weapon();\r\n\t}", "public void weaponInformation() {\n System.out.println(\"Weapon Name: \" + super.name() );\r\n System.out.println(\"Desc:\" + super.description() );\r\n System.out.println(\"Mobility: \" + super.mobility() ); \r\n }", "@Test\r\n public void test_weapon_more() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 16);\r\n assertEquals(1, weapon1.getDamage());\r\n }", "public FireTile() {\n super();\n setUtility(5);\n }", "@Test\n\tpublic void TestInitialization()\n\t{\n\t\t Weapon gun = new Gun();\n\t\t assertTrue(gun instanceof Gun );\n\t\t assertEquals(15,gun.getBaseDamge(),.1);\n\t\t assertEquals(30,gun.getMaxrRange(),.1);\n\t\t assertEquals(15,gun.getBaseDamge(),.1);\n\t\t assertEquals(40,((Gun) gun).getMaxAmmo(),.1);\n\t\t assertEquals(40,((Gun) gun).getActualAmmo(),.1);\n\t\t assertEquals(4,((Gun) gun).gettRateofFire(),.1);\n\t\t assertEquals(\"gun\",gun.getDescribtion());\n\t\t ((Gun) gun).setActualAmmo(10);\n\t\t assertEquals(10,((Gun) gun).getActualAmmo(),.1);\n\t}", "public SniperEnemy()\n { \n scoreBoost = 15;\n moneyBoost = 300;\n healthPoints = 500; \n fireRate = 45; \n movementCounter = 20;\n movementMod = 20;\n }", "public skills(){\n\t\tname = \"tempName\";\n\t\tmanaCost =0;\n\t\tskillDmg = 0;\n\t\tcritFactor = 0;\n\t\tcritChance = 0;\n\t\tnoOfTargets = 1;\n\t\thitChance = 0;\n\t\tmyAttribute = null;\n\t\t\n\t\t//instantiates the original values, prob will have no need\n\t\torigSkillDmg = 0;\n\t\torigCritFac = 0;\n\t\torigCritChan = 0;\n\t\torigHitChan =0;\n\t\t\n\t\t//stores the current buffs on the person\n\t\tcurrBuff = null;\n\t}", "public Enemy(Texture tex) \r\n\t{\r\n\t\tsuper(tex);\r\n\t\tm_type = \"enemy\";\r\n\t\tm_controller = new IAController();\r\n\t\tm_weapon = new AttackEmitter();\r\n\t\t\r\n\t\tm_lifeBar.setScale(new Vector2(0.3f,0.3f));\r\n\t\t\r\n\t\tm_speed = 50;\r\n\t\tm_life = 4;\r\n\t\t\r\n\t}", "public Weapon(double fireRatePerSecond,\n\t\t\t\t Projectiles projectileType)\n\t\t{\n\t\tthis.projectileType = projectileType;\n\t\tthis.projectileType.setFixtureDefSensor(true);\n\t\tthis.setupFireRate(fireRatePerSecond);\n\t\t}", "public Item() {\n\t\tthis(rand.nextDouble() * GameManager.NATIVE_WIDTH, -30.0, PowerUp[new Random().nextInt(PowerUp.length)]);\n\t}", "public DwarfEnemy()\r\n\t{\r\n\t\tdamagePower = GameStatics.Enemies.Dwarf.damagePower;\r\n\t\tspeed = GameStatics.Enemies.Dwarf.speed;\r\n\t\thp = GameStatics.Enemies.Dwarf.initHp;\r\n\t}", "public Skill(Player player){\n this.player = player;\n this.name = player.name;\n this.intellect = player.intellect;\n this.defense = player.defense;\n this.attack = player.attack;\n this.weapon = player.weapon;\n this.armor = player.armor;\n this.defense = player.defense;\n\n }", "public DefensivePlayers(){}", "public Wand() {\n damage = 5;\n damageType = \"Magic\";\n }", "public ArcherTower() {\n\t\tsuper(defaultAttack, defaultRange, defaultAttackSpeed, name);\n\t}", "public Item(double x, double y, String itemName) {\n\t\tsuper(x, y);\n\t\tswitch (itemName) {\n\t\tcase \"Powerup_Health\":\n\t\t\turl = \"img/Powerup_Health.png\";\n\t\t\tbreak;\n\t\tcase \"Powerup_Ammo\":\n\t\t\turl = \"img/Powerup_Ammo.png\";\n\t\t\tbreak;\n\t\t}\n\t\tthis.itemName = itemName;\n\t\tsprite = new ImageSprite(this, new Image(url, 48, 29, true, true));\n\t\tsprite.setZ(80);\n\t\taddScript(new ConstantSpeedMove(0, 2)).addScript(new ColliderBox(sprite.getHeight(), sprite.getWidth()))\n\t\t\t\t.addScript(new AutoRemove());\n\t}", "public BattleWeaponsSegmentAction() {\n }", "public EnemyGunBullet1() {\n super(DAMAGE, SPEED);\n setEnemyBullet(true);\n setShootSound(\"enemyShot.wav\");\n try {\n image = ImageIO.read(new File(\"res/images/tanks/bullets/enemyBullet1.png\"));\n }\n catch (IOException e) { }\n }", "Bullet(int posX,int posY,int velX,int velY,int classOfObejct,int attack){\n this.posX = posX;\n this.posY = posY;\n this.velX = velX;\n this.velY = velY;\n this.classOfObejct = classOfObejct;\n this.attack = attack;\n\n }", "public Weapon(String name, int price, Level minLevel, double damage, int numHands) {\n super(name, price, minLevel);\n\n // Validate input\n Validations.nonNegative(damage, \"damage\");\n Validations.nonNegative(numHands, \"numHands\");\n\n // Weapon specific attributes\n this.damage = damage;\n this.numHands = numHands;\n }", "public BasicWeapon(String name, int damage, int defense, int value, int weaponClass) {\n\t\t\n\t\tthis.name = name;\n\t\tthis.damage = damage;\n\t\tthis.defense = defense;\n\t\tthis.value = value;\n\t\tthis.weaponClass = weaponClass;\n\n\t}", "public PlayerPiece()\n {\n // initialise instance variables\n //Use the values listed in the comments\n //above that are next to each instance variable\n pieceName = \"no name\";\n pieceType = \"human\";\n currentHealth = 100;\n maxHealth = 100;\n locX = 7;\n locY = 8;\n attackPower = 25;\n defensePower = 20;\n currentSpecialPower = 50;\n maxSpecialPower = 50;\n \n }", "public void addWeapon(Weapon x){\n\t\tplayerWeapon=new Weapon(x);\n\t\tHealth+=x.gethealthStat();\n\t\tAttackForce+=x.getafStat();\n\t\tDefense+=x.getdefenseStat();\n\t}", "private void setWeapons()\n {\n sewers.setWeapon(woodSword);\n promenade.setWeapon(woodSword);\n depths.setWeapon(rustedSword);\n forest.setWeapon(goldSword);\n bridge.setWeapon(silverSpear);\n ramparts.setWeapon(infantryBow);\n }", "public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }", "public Weapon(String name, String description,\n URL link,\n int cost, boolean exclusive,\n int mt, int rng, WeaponClass type, WeaponRefine refine) {\n super(name, description,\n link, new Color(0xDE1336), 'W',\n cost, exclusive, rng);\n this.mt = mt;\n this.type = type;\n int[] statModifiers = StatModifier.parseStatModifiers(description);\n statModifiers[1]+= mt;\n this.statModifiers = statModifiers;\n this.refine = refine;\n }", "public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }", "public HealthyObject(String name, String des, int u, int p)\n \n {\n // initialisation des variables d'instance\n super(name, des, u);\n pointsHealthy = p;\n }", "public Human(int theShipType){\n super(theShipType);\n }", "public void generateTutorialWeapons() {\n this.loot.add(new Weapon(\"Weathered Longsword\", \"A weathered longsword - it'll do.\", 3, 1));\n this.loot.add(new Weapon(\"Weathered Battle Axe\", \"A weathered battle axe - it'll do.\", 2, 2));\n this.loot.add(new Weapon(\"Weathered Bow\", \"A weathered bow - it'll do.\", 3, 2));\n }", "public Pokemon(){\r\n this.level = 1;\r\n this.hp = 100;\r\n // this.power = 100;\r\n // this.exp = 0;\r\n }", "public static void genWeaponList() {\r\n int i;\r\n\r\n auxItemVector.clear();\r\n \r\n if(currentChar == null) return;\r\n\r\n for (i = 0; i < currentChar.getItemsNumber(); i++) {\r\n if(currentChar.getItem(i).getType() == weapon)\r\n auxItemVector.add(currentChar.getItem(i));\r\n }\r\n }", "AbstractWeapon createWeaponController(WeaponCard weaponCard);", "public Weapon getWeapon(){\n return this.weaponPos;\n }", "public BeanGame () {\n\t}", "public Item(){}", "public SysSkillConferpo()\n {\n }", "public Slayer() \r\n {\r\n super(1, \"Slayer\");\r\n setSpecialPower(\"killDragon\");\r\n }", "public ItemCollection()\n\t{\n\t\t/*\n\t\t * master list of all consumable/miscellaneous items in the game\n\t\t * \n\t\t * to add a new item to the game, add the item to the itemCollections, and if it is a consumable,\n\t\t * add the effect to the useItem method in the switch statement. If it has no effect, don't add anything.\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE\n\t\t */\n\t\t\n\t\t//CONSUMABLES\n\t\titemCollections.add(new Item(\"Polar Pop\", 1, \"Do you ever drink water?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Klondike Bar\", 20, \"What would you do for this?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Big tiddy goth GF\", 666, \"Vore.\", \"Consumable\"));\n\t\t\n\t\t//MISC, i.e. NO STATUS EFFECT\n\t\titemCollections.add(new Item(\"Sippy Cup\", 9, \"Somebody otta get their child their sippy cup back.\", \"Misc\"));\n\t\t\n\t\t/*\n\t\t * master list of equipment items in the game\n\t\t * \n\t\t * same as above\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE, DAMAGE, DEFENSE, VITALITY, INTELLIGENCE, STRENGTH, WISDOM\n\t\t */\n\t\t\n\t\t//2H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"A Big Boy's Sword\", 69, \"A two- handed sword for a big boy like you... You're growing up so fast!\", \"2H-Weapon\", 10, 0, 0, 0, 0, 0));\n\t\t\n\t\t//1H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"Red Copper Pan\", 300, \"Hey there mothafuckas it's ya girl cathy, I got some brand new shit\", \"1H-Weapon\", 250, 0, 25, 3, 25, 3));\n\t\t\n\t\t//HEAD\n\t\tequipmentCollections.add(new Equipment(\"Broken Helmet\", 1, \"Leather helmet broken from thousands of years of war and abuse\", \"Head\", 0, 3, 0, 0, 0, 0));\n\t\t\n\t\t//TORSO\n\t\tequipmentCollections.add(new Equipment(\"Bloodied Tunic\", 1, \"Tunic covered in your own blood, you can see your wounds through its holes\", \"Torso\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//ARMS\n\t\tequipmentCollections.add(new Equipment(\"Torn Gloves\", 1, \"Gloves so torn they hardly protect your hands\", \"Arms\", 0, 1, 0, 0, 0, 0));\n\t\t\n\t\t//LEGS\n\t\tequipmentCollections.add(new Equipment(\"Muddy Pants\", 1, \"Cloth pants soiled in mud\", \"Legs\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//FEET\n\t\tequipmentCollections.add(new Equipment(\"Worn Boot\", 1, \"A boot with a hole in it, but where is the other one?\", \"Feet\", 0, 1, 0, 0, 0, 0));\n\t}", "public Lunge() {\n super(SkillFactory.LUNGE, \"Lunge\", SkillDescription.lunge, 15, Pokemon.Type.BUG,\n SkillCategory.PHYSICAL, 100, 80, 1, 1.0);\n secondaryEffects.add(new AttackEffect(SecondaryEffect.Target.ENEMY, 1,\n SecondaryEffect.StatDirection.DECREASE));\n makesPhysicalContact = true;\n }", "public Enemy(int startMaxHealth, int startWalkSpeed, int startSprintSpeed, Weapon startWeapon, int startBaseContactDamage, int startBaseFieldOfView, int startBaseSightDistance, List<PassiveItem> startPassiveEffects, String characterName, String characterDescription)\n\t{\n\t\tsuper(characterName, characterDescription);\n\t\t\n\t\tmaxHealth = startMaxHealth;\n\t\tcurrentHealth = startMaxHealth;\n\t\t\n\t\tsprintSpeed = startSprintSpeed;\n\t\twalkSpeed = startWalkSpeed;\n\t\t\n\t\tweapon = startWeapon;\n\t\t\n\t\tbaseContactDamage = startBaseContactDamage;\n\t\t\n\t\tbaseFieldOfView = startBaseFieldOfView;\n\t\t\n\t\tbaseSightDistance = startBaseSightDistance;\n\t\t\n\t\tpassiveEffects = startPassiveEffects;\n\t}", "public ItemSwordAndShield(Item.ToolMaterial mat)\n/* 21: */ {\n/* 22:20 */ super(mat, \"\");\n/* 23:21 */ if (mat == Item.ToolMaterial.IRON) {\n/* 24:22 */ this.isIron = true;\n/* 25: */ } else {\n/* 26:24 */ this.isIron = false;\n/* 27: */ }\n/* 28: */ }", "public BasicEnemyMovement(Entity player) {\n super(Family.all(BasicEnemyComponent.class, ActivatedComponent.class).get());\n bodyM = ComponentMapper.getFor(BodyComponent.class);\n velocityM = ComponentMapper.getFor(VelocityComponent.class);\n positionM = ComponentMapper.getFor(PositionComponent.class);\n aggroM = ComponentMapper.getFor(AggressiveComponent.class);\n this.player = player;\n }", "public Equipas() {\r\n\t\t\r\n\t}" ]
[ "0.8390374", "0.8161041", "0.8055573", "0.8043703", "0.79443777", "0.7770105", "0.7720213", "0.7595367", "0.7421522", "0.74138236", "0.72938114", "0.7266314", "0.7151892", "0.6999681", "0.6980939", "0.6951008", "0.6936009", "0.68649304", "0.6824575", "0.6766963", "0.6765605", "0.66782653", "0.6677481", "0.6676636", "0.6658641", "0.66287374", "0.66017693", "0.6571963", "0.6546259", "0.653589", "0.6529729", "0.6458435", "0.6446222", "0.6428013", "0.6406713", "0.6395622", "0.63912994", "0.6389687", "0.63748217", "0.6373229", "0.6348881", "0.6310351", "0.6305595", "0.6304532", "0.6296402", "0.6288002", "0.6258126", "0.62384224", "0.62382346", "0.6229866", "0.6222904", "0.6213049", "0.620783", "0.6202304", "0.6193362", "0.6190895", "0.6176418", "0.6173655", "0.6170729", "0.6163724", "0.6149371", "0.61487985", "0.61428815", "0.6140397", "0.6133797", "0.6125962", "0.6124343", "0.6120163", "0.6120129", "0.61154234", "0.61150116", "0.61130023", "0.6108922", "0.6093994", "0.6080413", "0.6079398", "0.6063448", "0.6060232", "0.6059928", "0.60312796", "0.6023509", "0.60234654", "0.60168093", "0.59977645", "0.5995575", "0.5993948", "0.5979096", "0.5969021", "0.5967241", "0.5958265", "0.595796", "0.5957496", "0.5953238", "0.59526336", "0.5952213", "0.59479475", "0.5945521", "0.5937332", "0.5930216", "0.59170467", "0.59149873" ]
0.0
-1
The abstract method which is declared in the abstract class Item is overrided so that The getType method returns the enum value corresponding to this item type
@Override public ItemType getItemType() { return ItemType.MISC; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ItemType getType();", "@Override\n public int getItemType() {\n return ITEM_TYPE;\n }", "public ItemType getType()\n {\n\treturn type;\n }", "public ItemType getType() {\n return type;\n }", "@Override\n\tprotected DataTypes getDataType() {\n\t\treturn DataTypes.ITEM;\n\t}", "public String getItemType() {\n\t\treturn itemType;\n\t}", "public abstract Enum<?> getType();", "public abstract int getType();", "public abstract int getType();", "public abstract int getType();", "public com.rpg.framework.database.Protocol.ItemType getType() {\n return type_;\n }", "@Override\n public Type getItemType() {\n return Type.WEAPON;\n }", "public com.rpg.framework.database.Protocol.ItemType getType() {\n return type_;\n }", "ItemType(String itemCode) {\n code = itemCode;\n }", "Enum getType();", "protected abstract String getType();", "public Item getItem(String typeItem){\r\n if(typeItem.equals(\"coeur\")){\r\n Item coeur = new Coeur();\r\n return coeur;\r\n } else if(typeItem.equals(\"potionvie\")){\r\n Item potion = new Potion();\r\n return potion;\r\n } else if(typeItem.equals(\"hexaforce\")){\r\n Item hexa = new Hexaforce();\r\n return hexa;\r\n } else {\r\n return null;\r\n }\r\n }", "public int getType() { return type; }", "public int getType() { return type; }", "@Override public int getTypeValue() {\n return type_;\n }", "abstract public String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public int getType()\n {\n return m_type;\n }", "abstract public Type getType();", "public TypeEnum getType() {\n return type;\n }", "@Override public int getTypeValue() {\n return type_;\n }", "public ItemType getDynamicType() {\n throw new UnsupportedOperationException(\"Operation not defined\");\n }", "public Enum getType() {\n return type;\n }", "ItemType(String code) {\n this.code = code;\n }", "ItemType(String code) {\n this.code = code;\n }", "public ItemType getItemType(){return null;}", "com.rpg.framework.database.Protocol.ItemType getType();", "private static ItemType random() {\n return ITEM_TYPES.get(RANDOM.nextInt(SIZE));\n }", "public abstract Type getType();", "public abstract QCEntryType getType();", "@ApiModelProperty(example = \"DISPATCHED\", required = true, value = \"Type of the history item\")\n public TypeEnum getType() {\n return type;\n }", "public int getType() { \n return type; \n }", "@java.lang.Override\n public int getTypeValue() {\n return type_;\n }", "@java.lang.Override\n public int getTypeValue() {\n return type_;\n }", "public int getType() {\n return m_type;\n }", "public ItemType getItem() {\n\t return this.item;\n\t}", "public ItemType getItem() {\n\t return this.item;\n\t}", "@Override\n public IronGolemType getType() {\n return IronGolemType.TYPE;\n }", "@Override\n public Type getType() {\n return type;\n }", "@Override\n public Type getType() {\n return type;\n }", "@java.lang.Override public int getTypeValue() {\n return type_;\n }", "@Test\n public void getItemType () {\n Assert.assertEquals(\"SPECIAL\", bomb.getItemType().name());\n }", "@Override\r\n\tpublic int getType() {\n\t\treturn EyeTrackerItem.TYPE_INVALID;\r\n\t}", "public int getType () {\r\n return type;\r\n }", "@java.lang.Override\n public int getTypeValue() {\n return type_;\n }", "@java.lang.Override\n public int getTypeValue() {\n return type_;\n }", "public interface IItemDataEnum extends IStringSerializable{\n\t/**\n\t * This should return the unlocalized name of the sub item/block, without the mod ID or the item ID this is a sub item/block of\n\t * \n\t * @return\n\t */\n\tString getUnlocalizedName();\n\t\n\t/**\n\t * This should return the full unlocalized name for use in texture registry\n\t * \n\t * @return\n\t */\n\tString getTextureName();\n\t\n\t/**\n\t * Returns the meta value of the sub item/block\n\t * \n\t * @return\n\t */\n\tint getMeta();\n}", "public TYPE getType(){\n return this.type;\n }", "public int getType() {\n return type;\n }", "public void setItemType(String itemType) {\n\t\tthis.itemType = itemType;\n\t}", "@Override\n public String getType() {\n return this.type;\n }", "public int getType()\r\n {\r\n return type;\r\n }", "public int getType() {\n return type_;\n }", "public abstract boolean isTypeOf(ItemType type);", "@java.lang.Override public int getTypeValue() {\n return type_;\n }", "public int getType() {\n return mType;\n }", "public int getType()\r\n\t{\r\n\t\treturn type;\r\n\t}", "public int getType(){\r\n\t\treturn type;\r\n\t}", "@Override abstract public String type();", "public int getType(){\n\t\treturn this.type;\n\t}", "public int getType(){\n\t\treturn this.type;\n\t}", "public int getType() {\r\n return type;\r\n }", "public int getType() {\r\n return type;\r\n }", "public int getType() {\r\n return type;\r\n }", "@Override\r\n\tpublic byte getType() {\n\t\treturn type;\r\n\t}", "public int getType()\n {\n return this.type;\n }", "public int getType() {\n return this.type;\n }", "public int getType() // pro rozeznani kdy vyuzit ai\n {\n return this.type;\n }", "public abstract byte getType();", "public int getType() {\r\n\t\treturn type;\r\n\t}", "public String getType() {\n return m_Type;\n }", "@Override\n\tpublic String getType() {\n\t\treturn this.type;\n\t}", "public int getType(){\n return type;\n }", "public int getType()\n {\n return type;\n }", "public int getType()\n {\n return type;\n }", "public int getType() {\n return type;\n }", "public int getType () {\n return type;\n }", "public int getType () {\n return type;\n }", "public int getType(){\n\t\treturn type;\n\t}", "public String getType() {return type;}", "public int getType() {\r\n\t\treturn (type);\r\n\t}", "public int getType() {\n return theType;\n }", "public int getType() {\n return _type;\n }", "public int getType() {\n return _type;\n }", "public int getType();", "public int getType();", "public int getType();", "public int getType();" ]
[ "0.78566337", "0.7810669", "0.7571878", "0.74775463", "0.69773036", "0.69462883", "0.6875889", "0.6867293", "0.6867293", "0.6867293", "0.67873204", "0.6775534", "0.67716104", "0.6721509", "0.6661252", "0.66505814", "0.66246206", "0.65788233", "0.65788233", "0.655458", "0.65400356", "0.6534006", "0.6534006", "0.6534006", "0.6534006", "0.6534006", "0.6534006", "0.6534006", "0.6534006", "0.653127", "0.6524273", "0.65194845", "0.6485768", "0.6453993", "0.6452166", "0.64455", "0.64455", "0.6443487", "0.6439138", "0.6431093", "0.6420736", "0.6371384", "0.63708913", "0.6370565", "0.63540834", "0.63540834", "0.6349058", "0.63340855", "0.63340855", "0.63278127", "0.632565", "0.632565", "0.63085717", "0.63025826", "0.6294822", "0.62945676", "0.6290001", "0.6290001", "0.6286586", "0.6282856", "0.6269387", "0.6266994", "0.62646675", "0.6258366", "0.6256576", "0.62509173", "0.6247334", "0.62162143", "0.6215645", "0.6213017", "0.62088674", "0.6202197", "0.6202197", "0.62004703", "0.62004703", "0.62004703", "0.6199268", "0.6196354", "0.6190755", "0.6179244", "0.6155929", "0.61494213", "0.6147956", "0.6144003", "0.613651", "0.6134048", "0.6134048", "0.6133195", "0.6132996", "0.6132996", "0.612788", "0.6125781", "0.612238", "0.61171585", "0.6107783", "0.6107783", "0.61043", "0.61043", "0.61043", "0.61043" ]
0.62110287
70
Gets text of field.
private String getFieldTextValue(final JsonNode rootNode, final String fieldName) { JsonNode node = rootNode.get(fieldName); return node == null ? null : node.textValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getText()\n {\n return field.getText();\n }", "public String getText() {\r\n\r\n return field.getText();\r\n\r\n }", "public String getTextFromTextField() {\r\n\t\treturn textField.getText();\r\n\t}", "public String getText() {\n return textField.getText();\n }", "public String getText() {\r\n\t\treturn this.textfield.getText();\r\n\r\n\t}", "public String getText() {\n return (getFieldValue(fields[0]) + \".\" + getFieldValue(fields[1]) + \".\" + getFieldValue(fields[2]) + \".\" + getFieldValue(fields[3]));\n }", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "public java.lang.String getText() {\n return instance.getText();\n }", "private String getText() {\r\n\t\treturn getJTextField().getText();\r\n\t}", "public String getText() {\n return text.getText();\n }", "public String getText() {\r\n return text;\r\n }", "public String getText() {\n\t\t\treturn text.get();\n\t\t}", "protected Text getText() {\n \t\treturn text;\n \t}", "public String getText();", "public String getText();", "public String getText();", "public String getText();", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\r\n return this.text;\r\n }", "public String getText()\n {\n return (this.text);\n }", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public String getText()\n\t{\n\t\treturn text;\n\t}", "public java.lang.String getText() {\n \t\treturn text;\n \t}", "public String getText() {\r\n return text;\r\n }", "public String getText() {\r\n return text;\r\n }", "public java.lang.String getText() {\n return text_;\n }", "public String getText(){\r\n\t\treturn text;\r\n\t}", "public final String getText() {\n\t\treturn text;\n\t}", "protected Text getText()\r\n\t{\r\n\t\treturn text;\r\n\t}", "public String getText() {\r\n\t\treturn text;\r\n\t}", "public String getText() {\r\n\t\treturn text;\r\n\t}", "@Override\r\n\t\t\tpublic String getText() {\n\t\t\t\treturn text;\r\n\t\t\t}", "public String getText() {\n if (!this.a_text.isEnabled())\n return null;\n\n return this.a_text.getText();\n }", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "public final String getText() {\n return text;\n }", "public String getText() {\n return myText;\n }", "public java.lang.String getText() {\n return this.text;\n }", "String getTextValue();", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText() {\n return text;\n }", "public String getText()\r\n {\r\n return this.text;\r\n }", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn text;\n\t}", "public String getText() {\n\t\treturn this.text;\n\t}", "public String getText() {\n\t\treturn this.text;\n\t}", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "public String getText() {\n return this.text;\n }", "@NotNull\r\n public String getText() {\r\n return text;\r\n }", "@objid (\"d03ac21a-47cb-44d2-820d-6136f84aa408\")\r\n public String getText() {\r\n return this.text.getText();\r\n }", "public synchronized String getText() {\n\t\treturn text;\n\t}", "public String getText(){\r\n return text;\r\n }", "public String getText() {\n return mText;\n }", "public String getText()\n {\n return getComponent().getText();\n }", "public String getValueFieldText() {\n return valueField.getText();\n }", "public String getText () {\r\n\t\treturn (String) getStateHelper().eval(PropertyKeys.text);\r\n\t}", "public String getText() {\n\t\tif (null != this.text) {\n\t\t\treturn this.text;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"text\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@java.lang.Override\n public java.lang.String getText() {\n java.lang.Object ref = text_;\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 text_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getText() {\n java.lang.Object ref = text_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n text_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getText() {\n java.lang.Object ref = text_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n text_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getText() {\n java.lang.Object ref = text_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n text_ = s;\n return s;\n }\n }", "@Nullable\n final public String getText() {\n return mText;\n }", "public String getTextFromField(String fieldLabel){\n reporter.info(\"Get text from field \"+fieldLabel);\n return getElementText(LOCATORS.getBy(COMPONENT_NAME,\"FIELD_INPUT_BY_NAME\",fieldLabel),SHORT_TIMEOUT);\n }", "String getText ();", "public String getText() {\n return mTextContainer.getText();\n }" ]
[ "0.8807903", "0.8734828", "0.8570302", "0.84493595", "0.8277643", "0.81350434", "0.8085766", "0.8085766", "0.8085766", "0.8085766", "0.8085766", "0.8085766", "0.8085766", "0.8085766", "0.8023131", "0.7940508", "0.79340076", "0.7809905", "0.7794129", "0.77841", "0.7775876", "0.7775876", "0.7775876", "0.7775876", "0.7770343", "0.7770343", "0.7770343", "0.7770343", "0.7770343", "0.7765195", "0.7762999", "0.77617854", "0.77617854", "0.77617854", "0.7754865", "0.77481407", "0.77481407", "0.77435976", "0.7738413", "0.77268445", "0.7720727", "0.7720047", "0.7720047", "0.7718959", "0.7715889", "0.7707141", "0.7707141", "0.7707141", "0.7707141", "0.7707141", "0.7707141", "0.7707141", "0.77051383", "0.76860595", "0.76838195", "0.7683513", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682688", "0.7682488", "0.76760733", "0.76760733", "0.76760733", "0.76760733", "0.76760733", "0.76760733", "0.7674577", "0.7674577", "0.7662658", "0.7662658", "0.7662658", "0.7662658", "0.7662658", "0.7662658", "0.76575977", "0.7612796", "0.76047224", "0.75658137", "0.7554", "0.75392866", "0.74756944", "0.7462849", "0.7462545", "0.7447346", "0.7435273", "0.7435273", "0.7435273", "0.74054515", "0.73822665", "0.73814887", "0.73752224" ]
0.0
-1
TODO Autogenerated method stub
@Override public Object getModel() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
/ USER INTERFACE ACTIONS
@Override protected BaseItemsGrid createItemsGrid() { return new AdminItemGrid(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnUserActionListener {\n\n /**\n * Handles on list item click\n * @param user {@link User}\n * @param action int\n */\n\n public void onUserListItemClicked(User user, int action, int position);\n\n /**\n * Adds new user to remote database via API methods\n * @param user {@link User}\n */\n public void addUser(User user);\n\n /**\n * Edits user data stored in remote database via API methods\n * @param user {@link User}\n */\n public void editUser(User user);\n\n /**\n * Deletes user data stored in remote database via API methods\n * @param userId long\n */\n public void deleteUser(long userId);\n}", "public interface IBankWorkerAction extends INormalUserAction {\n // 查用户的信用\n void checkUserCredit();\n // 冻结用户账号\n void freezeUserAccount();\n}", "public interface IUserActionsManaged\n{\n void startCurving(PointF point, float pressure);\n void curving(PointF point, float pressure);\n void completeCurving(PointF point, float pressure);\n void cancelCurving(PointF point, float pressure);\n\n void startResizing();\n void resizing(PointF[] points);\n void completeResizing();\n\n void startDragging(PointF point);\n void dragging(PointF point);\n void completeDragging(PointF point);\n\n void showMenu();\n}", "public interface ActivityAction {\r\n public void viewedActivity(String condition, String viewerFullName);\r\n}", "public interface ICommandDisplayAction extends IAction{\r\n\r\n\t \r\n\t\r\n\tpublic void displayPallet() ;\r\n\r\n\tpublic void displayArena();\r\n\t\r\n\tpublic void displayComponent(String componentIntanceName) ;\r\n\t\r\n\tpublic void displayChain( ) ;\r\n}", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void doAction(User user) {\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "public void userAction(ElementInstance ei) {\r\n\t\t\r\n\t}", "public interface AppAction\n{\n void login(String name, String password, Handler handler);\n\n void access(Handler handler, String ...s);\n\n void gdata(Handler handler, List<EHentaiMangaInfo> list);\n\n void getMangaInfo(Handler handler);\n\n void getNews(Handler handler);\n\n void getNews(Handler handler, String title, String page);\n\n void getImg( String url, ImageView imageView,AppActionImpl.Callback<Void> callback,int height,int width);\n}", "public interface Actions extends EObject\n{\n}", "@Override\n\tpublic void action() {\n\n\t}", "public interface ICreateAction extends IAction{\r\n\t\r\n\t\r\n}", "public interface UserAction {\n\n /**\n * Begin game action\n */\n void initGame();\n\n /**\n * User choice action\n * @param x width position of cell\n * @param y height position of cell\n * @param bomb suggest of user about select cell\n */\n void select(int x, int y, boolean bomb);\n}", "public interface UIAction {\n}", "public interface IUserPageInterface {\n void OnRequestUserinfoSuccess(UserBean data);\n void OnRequestUserinfoFail();\n void OnAttendUserSuccess(boolean isAttend);\n void OnAttendUserFail();\n\n}", "@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}", "@Override\n\tpublic void doUser(UserInfo ui) {\n\n\t}", "public interface ApiAction {}", "public interface ResourceChangeForMaketService {\n\n void send(Object o,User operator);\n}", "public interface AccountControlDataAgent {\n void loginUser(String phoneNo,String password);\n void RegisterUser(String phoneNo,String password,String name);\n}", "public interface ProfileInteraction {\n public void setProfileData(String id, String username);\n// public void checkProfile();\n}", "public interface UserControllerCallback {\n void userAction(int code);\n}", "public interface PoCardAction extends UseGameUnitAction {\n}", "public interface UserInfoInterface {\n void onStartGetUserInfo();\n void onFinishedGetUserInfo(UserInfoModel userInfo, String errorMsg);\n}", "public interface EntityOpsController\n{\n\t/** @return a string representing the type of entity for use in messages. */\n\tpublic String getEntityName();\n\n\t/** Called when user presses the 'Commit' button. */\n\tpublic void commitEntity();\n\n\t/** Called when user presses the 'Close' button. */\n\tpublic void closeEntity();\n\n\t/** Called when user presses the 'Help' button. */\n\tpublic void help();\n}", "public interface ICommonAction {\n\n void obtainData(Object data, String methodIndex, int status,Map<String, String> parameterMap);\n\n\n}", "abstract void menu(User theUser);", "public interface IUMLActions {\r\n\t\r\n\t/**\r\n\t * Action for button\r\n\t * @param className is the name of the class where the action should be performed\r\n\t * @param classPath is the path to the class where the action should be performed\r\n\t */\r\n\tvoid buttonAction(String className, String classPath);\r\n\r\n}", "public interface IUserService {\n public void select();\n public void update();\n public void insert();\n public void delect();\n}", "public interface IChat {\n\n void onUserClicked(Object obj);\n\n void onActionClicked(View view, Object obj);\n}", "public interface UserInfoView {\n\n void onGetUserData(List<UserBean> followings);\n\n\n\n}", "public interface UserListClickListener\n{\n void onUserClicked(User user);\n}", "public interface UserData {\n /**\n * the run method that is run during UserNavigators\n */\n public static void run(){};\n\n String currentUser();\n}", "@ARouterRemoteAction(Key = ConfigKey.BUNDLE_USER_KEY, RemoteAction = \"/user/service\")\npublic interface RouterUserCommand {\n String goUserHomeActivity = \"goUserHomeActivity\";\n String goUserRechargeActivity = \"goUserRechargeActivity\";\n}", "public interface IQuotaConversionView extends IBaseView{\n\n void onNoAutoTransferInfo(ConversionInfoBean o);\n\n void onRefreshApis(UserAssert bankCards);\n\n void onTransfersMoney(QuotaConversionBean o);\n\n void onReconnectTransfer(QuotaConversionBean o);\n\n void onRefreshApi(ApiBean o);\n\n void selectedGame(String bankName,int index);\n\n void onRecovery(HttpResult refreshhApis);\n\n}", "public interface ReloadViewUICommand extends UICommandMdsl\n{\n}", "public interface IADCarry extends ILOLRoleAction {\n}", "interface AddUserContract {\n\n interface View {\n\n void showAddUserError();\n\n void showUserList();\n\n }\n\n interface UserActionsListener {\n\n void addUser(String lockMac, String lockName, boolean isAdmin);\n\n }\n}", "public interface Ops extends OpsOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \n{\n}", "public interface Actions {\n void initScreen();\n void getRevenues(String date, String accessToken);\n void requestWithdrawl(String accessToken, float amount);\n\n }", "public interface IUserActionService {\n enum EntityType {\n RESTAURANT,\n MENUITEM,\n VOTE\n }\n\n enum UserAction {\n CREATE,\n DELETE,\n UPDATE\n }\n\n void log(String entityName, String username, String action, String entityId);\n\n void log(EntityType etype, String username, UserAction action, String entityId);\n}", "public interface IUserInformation {\n void updateUserInformation(String teacherId, ArrayList<String> images, String tName, int sex, String college, String profession, int education, int grade, List<Integer> pbxType, String introduction, String headUrl, Response.Listener<BaseBean> listener, Response.ErrorListener errorListener);\n\n void getUserInfo(String teacherId, Response.Listener<User> listener, Response.ErrorListener errorListener);\n\n void updateUserPhone(String teacherId, String mobile, Response.Listener<BaseBean> listener, Response.ErrorListener errorListener);\n\n\n}", "public interface UICallBack {\r\n void receiveChatMessage(ChatMessage message);\r\n void receiveAnswer(Answer message);\r\n void setMark(int x, int y, FieldType markType);\r\n void resultWin();\r\n void resultLose();\r\n void resultFriendship();\r\n}", "public interface ChoiceAction {\n}", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public interface ITurnAdmin {\n /**\n * Tells the view (user) to try a move.\n * @param requestor The requestor used by the view to communicate which move it wishes to try.\n */\n public void takeTurn(IViewRequestor requestor);\n}", "public interface NotifyItemClicked {\r\n\r\n public void onUsernameCLicked(int position);\r\n public void onNotifyCLicked(int position);\r\n public void onDeleteCLicked(int position);\r\n}", "public interface OnClick{\n void action();\n }", "public interface MyActions {\n\n String GET_ROUTINES = \"get-routines\";\n String RENAME_ROUTINE = \"rename-routine\";\n String DELETE_ROUTINE = \"delete-routine\";\n String CREATE_ROUTINE = \"create-routine\";\n String UPDATE_TASKS = \"update-tasks\";\n String GET_TASKS = \"get-tasks\";\n\n String CREATE_TASK = \"create-task\";\n String DELETE_TASK = \"delete-task\";\n void deleteTask(String routine, Task task);\n String UPDATE_TASK = \"update-task\";\n String UPDATE_BREAK_INTERVAL = \"update-break-interval\";\n String GET_BREAK_INTERVAL = \"get-break-interval\";\n String SAVE_HISTORY = \"save-history\"; //save after each task completes\n String GET_HISTORY = \"get-history\";\n String LOGIN = \"login\";\n\n void getRoutines();\n\n void renameRoutine(String oldName, String newName);\n\n void deleteRoutine(String routine);\n\n void createRoutine(String name, int priority);\n\n void updateTask(String routine, Task oldTask, Task newTask, int position);\n\n void updateBreakInterval(String routine, int interval);\n\n void getBreakInterval(String routine);\n\n void getTasks(String routine);\n\n void createTask(String routine, Task task, int priority);\n\n void updateTasks(String routine, List<Task> tasks);\n\n void login(String userEmail);\n\n void saveHistory(String routine, Task task, String date, String time);\n\n void getHistory();\n\n}", "public interface UsersPresenter {\n void getUsers();\n void onUserClicked(User user);\n\n}", "public interface IMyNewFirendView {\n\n public void onMyNewFirendGetFriendApplyListSuccess(List<ContactsFriend> datas);\n public void onMyNewFirendGetFriendApplyListFaile(String msg);\n\n public void onMyNewFirendConfirmApplySuccess(int confirm);\n public void onMyNewFirendConfirmApplyFaile(String msg, int confirm);\n\n}", "public interface UserDetailViewImpl extends IBaseViewImpl {\n void onUserDetailSuccess(UserDetailResponseBean userDetailResponseBean);\n void onUserDetailFailed(String msg);\n}", "public void actionOffered();", "public interface UIMember extends UIUser {\r\n\t\r\n\t/**\r\n\t * @return\r\n\t * \t\tThe user-name of the member\r\n\t */\r\n\tpublic String getUsername();\r\n\r\n\t/**\r\n\t * @return\r\n\t * \t\tThe last name of the member\r\n\t */\r\n\tpublic String getLastName();\r\n\t\r\n\t/**\r\n\t * @return\r\n\t * \t\tThe first name of the member\r\n\t */\r\n\tpublic String getFirstName();\r\n\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t * \t\tThe e-mail address of the member\r\n\t */\r\n\tpublic String getEmail();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t * \t\tThe number of messages posted by the member\r\n\t */\r\n\tpublic int getPostsNumber();\r\n\t\r\n\tpublic boolean askChangePassword();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t * \t\tA string representation of the member\r\n\t */\r\n\tpublic String toString();\r\n\r\n}", "public interface IGetDataView extends IBaseView {\n void getDataSuccess(Cursor cursor);\n void getDataFail();\n}", "public interface IDevicesModel {\n /**\n * action = addDevice\n userid = 12\n username = yuan\n devicename = demo\n deviceaddre = 00:00:00:00\n addtime = 152355660000\n * @param iDevicesListener\n */\n void addDevice(String userid,String username,String devicename,String deviceaddre,Long addtime,\n IDevicesListener iDevicesListener);\n\n void updateDevice(String deviceid,String userid,String username,String devicename,\n String deviceaddre,Long addtime,IDevicesListener iDevicesListener);\n\n void deleteDevice(String deviceid,String userid,String username,IDeleteDeviceListener iDeleteDeviceListener);\n}", "public interface IServiceHistoryView extends IBaseView {\n public void getServiceHistoryData(ServiceHistoryDO serviceHistoryDO);\n\n public void showAlert(String message);\n\n\n}", "interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }", "public interface AfterResearcherProfileCreationAction {\n\n /**\n * Perform some actions on the given researcher profile and returns the updated\n * profile.\n *\n * @param context the DSpace context\n * @param researcherProfile the created researcher profile\n * @param owner the EPerson that is owner of the given profile\n * @throws SQLException if a SQL error occurs\n */\n void perform(Context context, ResearcherProfile researcherProfile, EPerson owner) throws SQLException;\n}", "public interface OnConnectionOptionSelected {\r\n public void onDownloadSelected();\r\n public void onUploadSelected();\r\n}", "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "public interface Action {\n String execute(GameController gameController);\n}", "@Override\n public void act() {\n }", "public interface DentistViewProfileView {\n\n /**\n * This method is called when the dentist presses the button 'UPDATE' , so it redirects him to the activity of update!\n */\n void updateAccount();\n}", "public interface IAction\n{\n /**\n * Name for Action entity.\n */\n public static final String ENTITY_NAME = \"Action\";\n\n /**\n * FieldId for uid.\n */\n public static final Number UID = new Integer(0); // long\n\n /**\n * FieldId for Name.\n */\n public static final Number NAME = new Integer(1); // String 30\n\n /**\n * FieldId for description.\n */\n public static final Number DESCRIPTION = new Integer(2); // string 50\n\n /**\n * FieldId for MsgUid.\n */\n public static final Number MSG_UID = new Integer(3); // bigint\n\n /**\n * FieldId for Version. A Double.\n */\n public static final Number VERSION = new Integer(4); //double\n\n /**\n * FieldId for CanDelete. A Boolean.\n */\n public static final Number CAN_DELETE = new Integer(5); //boolean\n\n\n}", "public interface Iuser extends Remote{\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tpublic String getUsername();\r\n\r\n\t\t\r\n\t\tpublic String getPassword();\r\n\r\n\r\n\t\tpublic void setPassword(String string);\r\n\t\t\r\n\t\tpublic void setUsername(String string);\r\n\t\t\r\n\t\tpublic void getItem(IItem item);\r\n\t\t\r\n\t\tpublic void purchaseItems();\r\n\t\t\r\n\t public int getItemCounter();\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public interface CIDScreenIfc extends DeviceActionGroupIfc\n{\n /** revision number supplied by CVS **/\n public static final String revisionNumber = \"$Revision: /rgbustores_13.4x_generic_branch/1 $\";\n\n /**\n * Set the CIDScreenManager for a given screen\n * \n * @param cidScreenManager to set\n */\n public void setCIDScreenManager(CIDScreenManager cidScreenManager);\n\n /**\n * @deprecated 7.0, use the CIDAction constructor\n * to create an action instead\n * \n * @param action Action Name\n * @param parms varies depending ona ction\n * @return Newly created action\n */\n public CIDAction createAction(String action, Vector parms);\n\n /**\n * Refresh the display using the underlying model\n */\n public void refresh();\n\n /**\n * Reset the model this screen uses\n */\n public void reset();\n\n /**\n * Clear the screen (make it blank). Part\n * of clearing the screen includes resetting\n * the model.\n * \n * @throws DeviceException\n */\n public void clear() throws DeviceException;\n\n /**\n * Hide the screen (Make it blank) the model\n * does not reset\n * \n * @throws DeviceException\n */\n public void hide() throws DeviceException;\n\n /**\n * Make the screen visible, this is essentially\n * the same as a refresh\n * \n * @throws DeviceException\n */\n public void show() throws DeviceException;\n\n /**\n * For every CIDScreenIfc implementation, custom actions may\n * exist. For each of those actions, the CIDScreenIfc implementation\n * must know how to handle them to update the display. When the display\n * needs to be updated, the controller will call this method.\n * \n * @param action\n */\n public void processAction(CIDAction action);\n\n /** @deprecated 7.0, use isVisible() \n * @return boolean, true if visible false if not **/\n public boolean getVisible();\n \n /**\n * Tell whether or not the given screen is \n * currently visible on the device.\n * @return True if visible, false if not.\n */\n public boolean isVisible();\n \n /**\n * Set the visiblity of the screen\n * \n * @param val ture or false\n */\n public void setVisible(boolean val);\n\n}", "public interface ILoginView extends IUI {\n void closeAct();\n void isGetCodeSuccess();\n}", "public interface ActionHandler {\n ModelApiResponse handleActionChoice(ActionChoice choice);\n List<AvailableActions> getActionsCurrentlyAvailable();\n}", "public interface ICommand {\r\n public List<String> getRights();\r\n public String execute() throws ServletException, IOException;\r\n}", "public interface RouterDemoCommand {\n // Ui command begin\n String goDemoHomeActivity = \"goDemoHomeActivity\";\n // Ui command end\n\n // Data command begin\n // Data command end\n\n // Op command begin\n // Op command end\n}", "public interface User_data extends Logic{\n UserPO signUp(UserPO userInfo);\n UserPO login(UserPO userInfo);\n UserPO modify(UserPO userInfo);\n}", "public interface Action {\n\n /**\n * Set local database connection\n */\n public void setDatabase(Connection _db);\n\n /**\n * Execute business logic\n */\n public boolean execute(HttpServletRequest _req, HttpServletResponse _res)\n throws ServletException, IOException;\n\n /**\n * Return the page name (and path) to display the view\n */\n public String getView();\n\n /**\n * Return a JavaBean containing the model (data)\n */\n public Object getModel();\n\n}", "protected abstract void action(Object obj);", "public interface ActionCommand {\n String execute(HttpServletRequest request);\n\n}", "public interface SCDialogCallback {\n\tpublic void onAction1();\n\tpublic void onAction2();\n\tpublic void onAction3();\n\tpublic void onAction4();\n}", "public interface ListaInteractor {\n void searchPersonas(ListaInteractorImp.onLoadSucess onLoadSucess);\n void deleteContacto(Contacto contacto, ListaInteractorImp.onDeleteSucess onDeleteSucess);\n}", "public interface Userable {\n\n}", "public interface IViewMainProfile {\n void onPreExecute();\n\n void onExecuteSuccess(SinhVien sinhVien);\n\n void onExecuteFailure(String fail);\n\n void onCancelExecuteSuccess(String success);\n\n void onCancelExecuteFailure(String fail);\n}", "public interface UserInterface {\n void update();\n}", "public interface OnUserInfoChange {\r\n void change();\r\n}", "public interface RemotInterfaceOperations \n{\n String createDRecord (String managerId, String firstName, String lastName, String address, String phone, String specialization, String location);\n String createNRecord (String managerId, String firstName, String lastName, String designation, String status, String statusDate);\n String getRecordCount (String managerId, int recordType);\n String editRecord (String managerId, String recordID, String fieldName, String newValue);\n String transferRecord (String managerID, String recordID, String remoteClinicServerName);\n}", "public interface IUserView {\n\n\n public void resultDataCallBack(String name);\n}", "public interface MovieActionInterface {\n void onFavoriteToggle(Long movieId, boolean isFavorite);\n}", "public interface Actions {\n void initScreen();\n void submitReview(String accessToken,\n String productID,\n String rating,\n String orderDID,\n String comment);\n }", "public interface MainView {\n void tampilkandata(User user);\n}", "public interface ActionCallBack {\n void acceptOrder(int position);\n void cancelOrder(int position);\n void readyToDeliver(int position);\n void showDetails(int position);\n\n\n\n}", "public interface HasContextActions extends Page {\n\n List<Action> getContextActions();\n\n interface ContextActionListener {\n void onUpdate();\n }\n}", "public interface RegistView extends MvpView{\n public void afterRegist(UserResult userResult);\n}", "public interface SingleTaskOrderController {\n\n /**\n * This method is used to place a SingleTaskOrder.\n *\n * @param user The user who wants to place the order\n * @param order The order the caller wants to place.\n */\n public void placeSingleTaskOrder(User user, SingleTaskOrder order);\n\n}", "public interface ITeamManageUI extends IUI {\n\n void onQueryTeamsSuccess(List<DataTeam> dataTeams);\n\n void onQueryTeamsFail(String errorMsg);\n}", "public interface C0260a {\n boolean onClick();\n }", "public interface IMoiveListView extends IWanBaseView{\n\n void onLoading();\n\n void onLoadSucess(MoiveListResponse moiveListResponse);\n\n void onLoadFail(String msg);\n}", "public interface IMainView extends MvpView {\n void setMyLocation();\n void setRefresh();\n void scanLock();\n void getNearSeller();\n void feedback();\n void sellerDetail(Long uid);\n void buyBoxFun();\n}", "public interface IPersonController {\n\n /**\n * Vytvoří nového uživatele.\n *\n * @return boolean\n *\n * @param person\n */\n boolean addPerson(Person person);\n\n /**\n * Deaktivuje uživatele (na jeho účet se nepůjde přihlásit).\n *\n * @return boolean\n *\n * @param person\n */\n boolean deactivatePerson(Person person);\n\n /**\n * Vrátí všechny uživatele\n *\n * @return boolean\n */\n List getAllUsers();\n\n /**\n * Vrátí přihlášeného uživatele.\n *\n * @return\n */\n Person getLoggedPerson();\n\n /**\n * Vrátí uživatele podle ID.\n *\n * @return\n *\n * @param id\n */\n Person getPerson(int id);\n\n /**\n * Zkusí přihlásit uživatele s danými přihlašovacími údaji.\n *\n * @return boolean\n *\n * @param username\n * @param password\n */\n boolean loginPerson(String username, String password);\n\n /**\n * Odhlásí aktuálního uživatele.\n */\n void logout();\n\n /**\n * Odešle GUI pokyn k obnovení.\n */\n void refresh();\n\n}" ]
[ "0.7196487", "0.69977385", "0.6991073", "0.6904559", "0.6875954", "0.6856732", "0.6856732", "0.6856732", "0.68494785", "0.6840679", "0.68147343", "0.6720909", "0.66732913", "0.66626227", "0.66249055", "0.6578292", "0.65725607", "0.6531191", "0.65094864", "0.6504299", "0.64412737", "0.6435019", "0.6415853", "0.63927686", "0.6386217", "0.63853395", "0.6370327", "0.63568413", "0.6356603", "0.6350483", "0.6336552", "0.6335206", "0.6318519", "0.63065", "0.6303251", "0.6300157", "0.6292639", "0.6288666", "0.62845814", "0.6276429", "0.6268087", "0.62599474", "0.62543213", "0.62492096", "0.6241325", "0.6238404", "0.62383777", "0.62377095", "0.62377095", "0.62377095", "0.62377095", "0.6230977", "0.6230243", "0.6222306", "0.622076", "0.6220237", "0.6204278", "0.6182723", "0.61817086", "0.6180245", "0.6179456", "0.61690545", "0.6165314", "0.6156494", "0.61432594", "0.6123128", "0.61198556", "0.6114299", "0.6112123", "0.6109908", "0.6109077", "0.6108205", "0.6104862", "0.6097346", "0.609484", "0.6092064", "0.6091483", "0.60912055", "0.6080262", "0.6079252", "0.6073744", "0.60713565", "0.6070426", "0.60675764", "0.60561", "0.6055889", "0.6055247", "0.60470086", "0.6046479", "0.6045392", "0.60358506", "0.6034626", "0.60247517", "0.6013771", "0.600899", "0.59960395", "0.5993033", "0.59911907", "0.5989184", "0.5989158", "0.5988707" ]
0.0
-1
Do something in response to button
public void refresh() { ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { // fetch data DownloadXmlTask task = new DownloadXmlTask(); task.execute("http://api.androidhive.info/pizza/?format=xml"); } else { // display error Log.v("Network", "Error: Network is not available"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void buttonClicked();", "void okButtonClicked();", "public abstract void executeBagButton();", "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "@Override\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\tcon.setResult(btnName);\n\t\t\t}", "protected abstract void pressedOKButton( );", "public void actionButton(String text);", "public void buttonShowComplete(ActionEvent actionEvent) {\n }", "String handleButtonPress(Button button);", "@Override\n\t public void onClick(View v) {\n\t \t SendReqToPebble();\n\t }", "@Override\r\n\tpublic void actionPerformed(GuiButton button) {\r\n switch (button.id) {\r\n case 0:\r\n GuiYesNo confirmGui = new GuiYesNo(this, \"Delete Waypoints\", \"Are you sure you want to delete the selected waypoints?\", \"Yes\", \"No\", 0);\r\n confirmGui.setButtonDelay(5);\r\n this.mc.displayGuiScreen(confirmGui);\r\n break;\r\n }\r\n\t}", "public abstract void executeRunButton();", "public void clickYes ();", "public void submit_intsatpos(View button) {\n }", "void buttonPressed(ButtonType type);", "protected void actionPerformed(GuiButton button) throws IOException {\n/* 60 */ if (button.enabled)\n/* */ {\n/* 62 */ if (button.id == 1) {\n/* */ \n/* 64 */ this.lastScreen.confirmClicked(false, 0);\n/* */ }\n/* 66 */ else if (button.id == 0) {\n/* */ \n/* 68 */ this.serverData.serverIP = this.ipEdit.getText();\n/* 69 */ this.lastScreen.confirmClicked(true, 0);\n/* */ } \n/* */ }\n/* */ }", "public void proceedOnPopUp() {\n Controllers.button.click(proceedToCheckOutPopUp);\n }", "public void btn_Reshow_Server(ActionEvent e) throws Exception\n {\n }", "@Override\n\t\tpublic void buttonStatusChange() {\n\t\t\t\n\t\t}", "public abstract void buttonPressed();", "@Override\r\n public void onResponse(String response) {\n button.setText(\"Response is: \" + response);\r\n Log.i(NAME, response);\r\n }", "public abstract boolean onButtonClick(Player player, int button);", "public void clickButton()\n {\n fieldChangeNotify( 0 );\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()){\n case R.id.button_main_yes:\n new EndpointsAsyncTask().execute();\n break;\n case R.id.button_main_no:\n finish();\n break;\n default:\n break;\n }\n\n }", "public void testing() {\n System.out.println(\"button pressed!\");\n }", "protected abstract boolean onOkClicked();", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"button1\"){\r\n JOptionPane.showMessageDialog(null,\"Button1 hit\");\r\n }else {\r\n JOptionPane.showMessageDialog(null,\"Button2 hit\");\r\n }\r\n\r\n }", "public abstract void executeActionButton();", "void buttonGo_actionPerformed(ActionEvent e) {\n\n\n }", "@Override\n public void onClick() {\n System.out.println(\"Button has been JUST clicked\");\n }", "@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}", "@Override\n\tpublic void callButton(TrafficSignal TS) {\n\t\t\n\t}", "void enablButtonListener();", "private void showButtonDemo(){\n Button submitButton = new Button(\"Submit\");\n\n Button cancelButton = new Button(\"Cancel\");\n\n submitButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n Question2Query ans = new Question2Query();\n String val= \"Sorry, we are unable to answer\";\n try {\n val = ans.ask(text.getText());\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n statusLabel.setText(\"\\n\"+val);\n }\n });\n\n cancelButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n statusLabel.setText(\"Cancel Button clicked.\");\n }\n });\n\n //controlPanel.add(okButton);\n controlPanel.add(submitButton);\n controlPanel.add(cancelButton);\n mainFrame.setVisible(true);\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\tnextStep = OK;\r\n\t\t\t\tmsg.what = nextStep;\r\n\t\t\t\tmHandler.sendMessage(msg);\r\n\t\t\t\tisPause =true;\r\n\t\t\t}", "public void onButtonAPressed();", "public void buttonChangeStatus(ActionEvent actionEvent) {\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString rs=\"<button>Clik here this was POST request</button>\";\n\t\tresp.getWriter().write(rs);\n\t}", "public void onClick(ClickEvent event) {\r\n System.out.println(\"Submit Button geklickt\");\r\n handleEvent();\r\n }", "public void buttonClick(ClickEvent event) {\n\t\t\t\tif (!isProcessing) {\n\t\t\t\t\tisProcessing = saveOperacion(oItem, operacionConfirmForm);\n\t\t\t\t}\n\t\t\t}", "public void buttonPress(ActionEvent event) {\r\n Button clickedButton = (Button) event.getSource();\r\n String selectedButton = clickedButton.getId();\r\n System.out.print(selectedButton);\r\n \r\n // If the user correctly guesses the winning button\r\n if (correctButtonName.equals(selectedButton)) {\r\n \r\n //Displays a popup alerting the user that they won the game.\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"You Win!\");\r\n alert.setHeaderText(\"Congratulations, you found the treasure!\");\r\n alert.setContentText(\"Would you like to play again?\");\r\n ButtonType okButton = new ButtonType(\"Play again\");\r\n ButtonType noThanksButton = new ButtonType(\"No Thanks!\");\r\n alert.getButtonTypes().setAll(okButton, noThanksButton);\r\n Optional<ButtonType> result = alert.showAndWait();\r\n \r\n //If the user selects \"Play again\" a new button will be randomly selected\r\n if (result.get() == okButton ){\r\n //Chooses a random button from the list of buttons\r\n correctButtonName = buttonList[(int)(Math.random() * buttonList.length)];\r\n }\r\n //If the user does not select \"Play again\", the application will be closed\r\n else {System.exit(0);}\r\n \r\n }\r\n \r\n //If the user chooses any button except for the winning button\r\n else if (!selectedButton.equals(correctButtonName)) {\r\n \r\n //Displays a popup alerting the user that they did not find the treasure.\r\n Alert alert2 = new Alert(Alert.AlertType.INFORMATION);\r\n alert2.setTitle(\"No treasure!\");\r\n alert2.setHeaderText(\"There was no treasure found on that island\");\r\n alert2.setContentText(\"Would you like to continue searching for treasure?\");\r\n ButtonType ayeCaptain = new ButtonType (\"Continue Searching\");\r\n ButtonType noCaptain = new ButtonType (\"Quit\");\r\n alert2.getButtonTypes().setAll(ayeCaptain,noCaptain);\r\n Optional<ButtonType> result2 = alert2.showAndWait();\r\n \r\n if (result2.get() == ayeCaptain){\r\n //The search for treasure continues!\r\n }\r\n else{ \r\n System.exit(0);\r\n }\r\n }\r\n }", "public void onButtonWasPushed(int slot) {\n onCommands[slot].execute();\n unDoCommand = onCommands[slot];\n }", "public void actionPerformed(ActionEvent e) \r\n\t{\r\n\t\t//Checks which button is pressed and calls the relevant method\r\n\t\tif (e.getSource() == nextQuestionButton)\r\n\t\t{\r\n\t\t\tfetchNewQuestion();\r\n\t\t}\r\n\t\telse if (e.getSource() == submitAnswerButton)\r\n\t\t{\r\n\t\t\tcheckAnswer();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tButtonPress();\n\t}", "public void actionPerformed(ActionEvent arg0) {\n myButtonActionPerformed(arg0);\n }", "public void buttonClick(ClickEvent event) {\n fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));\n \n // close popup window\n close();\n }", "private void buttonCallback(String s) {\n // Print the name of the button for debugging purposes\n System.out.println(s);\n if(buttonNames.contains(s)) {\n // Make sure the button clicked on was actually visible\n if(buttonVisibilities.get(buttonNames.indexOf(s))) {\n // Switch through the possible button presses\n switch(s) {\n case \"Fo\":\n // Send a message to the server saying \"I want to fold\"\n GameLauncher.manager.mainPlayer.setFoldedSS(true);\n break;\n case \"Ch\":\n // Send a message to the server saying \"I want to call\"\n // This IS NOT a mistake. The server interprets calling and\n // checking as the same action, as they both fundamentally\n // do the same thing, but are just called something different\n // depending on the scenario.\n GameLauncher.manager.mainPlayer.setCallSS();\n break;\n case \"Ca\":\n // Send a message to the server saying \"I want to call\"\n GameLauncher.manager.mainPlayer.setCallSS();\n break;\n case \"Ra\":\n // Create a new JFrame to make a prompt out of\n JFrame frame = new JFrame(\"Enter new bet\");\n\n // prompt the user to enter their name\n while(true) {\n try {\n // Show an input dialog\n String betStr = JOptionPane.showInputDialog(frame, \"Enter your new bet here (must be above current bet)\");\n // Attempt to parse input\n int bet = Integer.parseInt(betStr);\n // Send a message to the server saying \"I want to bet ___ much\"\n GameLauncher.manager.mainPlayer.setBetSS(bet);\n break;\n } catch (Exception e) {\n // Print that there was invalid input, then ignore it and move on\n System.out.println(\"Bad Input!\");\n break;\n }\n }\n break;\n case \"St\":\n // Handl game start request by sending the server a message saying \"I want to start ___ server\"\n String res=HTTPUtils.sendGet(GameLauncher.SERVER_URL+\"/startServer?uuid=\"+game.serverUuid);\n // If the response contains an error message, then say there's not enough players.\n // It is assumed that it is a lack of players error, because that is the only error the\n // server will send back from this command.\n if(res.contains(\"error\")) {\n JOptionPane.showMessageDialog(new JFrame(), \"Not enough players!\", \"\", JOptionPane.WARNING_MESSAGE);\n }\n break;\n }\n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttext.setText(ok.getText());\n\t\t\t}", "abstract void botonEnviar_actionPerformed(ActionEvent e);", "void viewButton_actionPerformed(ActionEvent e) {\n doView();\n }", "public void onYesButtonClicked() {\n changeAfterClientPick();\n }", "abstract void botonRecibir_actionPerformed(ActionEvent e);", "public void OnOkClick()\r\n {\r\n\r\n }", "@Override\n public void buttonExecute(String menuId, PageParam pageParam,\n String buttonId) throws KkmyException {\n\n }", "@Override\n\tpublic void setButtonAction() {\n\t}", "private void determineButtonPress(boolean answer){\n boolean expectedAnswer = currentQuestion.isAnswer();\n String result;\n if (answer == expectedAnswer){\n result=\"Correct\";\n score++;\n txtScore.setText(\"Score: \" + score);\n } else {\n result=\"False\";\n }\n //call this function to display the result to the player\n answerResultAlert(result);\n\n }", "public void Click_Done()\r\n\t{\r\n\t\tExplicitWait(Specialdone);\r\n\t\tif (Specialdone.isDisplayed()) \r\n\t\t{\r\n\t\t\tJavascriptexecutor(Specialdone);\r\n\t\t\tExplicitWait(Checkavailability);\r\n\t\t\t//System.out.println(\"Clicked on Special Rate plan done button \");\r\n\t\t\tlogger.info(\"Clicked on Special Rate plan done button\");\r\n\t\t\ttest.log(Status.INFO, \"Clicked on Special Rate plan done button\");\r\n\r\n\t\t} else {\r\n\t\t\t//System.out.println(\"Special Rate plan done button not found\");\r\n\t\t\tlogger.error(\"Special Rate plan done button not found\");\r\n\t\t\ttest.log(Status.FAIL, \"Special Rate plan done button not found\");\r\n\r\n\t\t}\r\n\t}", "public void onClicked();", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[0])){\n\t\t\tperformButton(0);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[1])){\n\t\t\tperformButton(1);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[2])){\n\t\t\tperformButton(2);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[3])){\n\t\t\tperformButton(3);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[4])){\n\t\t\tperformButton(4);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[5])){\n\t\t\tperformButton(5);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[6])){\n\t\t\tperformButton(6);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[7])){\n\t\t\tperformButton(7);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[8])){\n\t\t\tperformButton(8);\n\t\t}\n\t}", "public abstract void executeFightButton();", "@FXML\n public void handleEventButton() {\n try {\n this.executeCommand(\"list e\");\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid command: list e\");\n resultDisplay.setFeedbackToUser(e.getMessage());\n }\n }", "public void ipcallButtonPressed() {\n\t\tdialButtonPressed(true) ;\n\t}", "private void btnLogin(ActionEvent e) {\n }", "void userPressConnectButton();", "@Override\n public void run() {\n nextButtonAction(); // invoking next button //\n }", "private void devBtnActionPerformed(ActionEvent evt) {\n }", "abstract void botonAyuda_actionPerformed(ActionEvent e);", "public void sButton() {\n\n\n\n }", "public void actionPerformed(ActionEvent e) {\n // Ask the event which button was the source that generated it\n if (e.getActionCommand().equals(\"Press Me\"))\n System.out.println(\"That felt good!\");\n else\n System.out.println(\"Ouch! Stop that!\");\n }", "public void actionPerformed (ActionEvent e)\n\t\t\t\t{\n\t\t\t\talertOK();\n\t\t\t\t}", "@FXML\r\n private void handleButtonAction(ActionEvent event) {\n }", "void configureButtonListener();", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource().equals(button)) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Woohoo!\");\n\t\t\tif (rand == 0) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"APEL\");\n\t\t\t}\n\t\t\tif (rand == 1) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"APUSH\");\n\t\t\t}\n\t\t\tif (rand == 2) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"AP Physics\");\n\t\t\t}\n\t\t\tif (rand == 3) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"AP Bio\");\n\t\t\t}\n\t\t\tif (rand == 4) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"AP Calc\");\n\t\t\t}\n\t\t\trand = new Random().nextInt(5);\n\t\t}\n\t}", "protected void actionPerformed(GuiButton par1GuiButton)\n {\n if (par1GuiButton.id == 0)\n {\n this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 5)\n {\n this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 1)\n {\n this.mc.displayGuiScreen(new GuiSelectWorld(this));\n }\n\n if (par1GuiButton.id == 2)\n {\n this.mc.displayGuiScreen(new GuiMultiplayer(this));\n }\n\n if (par1GuiButton.id == 3)\n {\n this.mc.displayGuiScreen(new GuiTexturePacks(this));\n }\n\n if (par1GuiButton.id == 4)\n {\n this.mc.shutdown();\n }\n }", "@Override\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\tGameController.setToButtonPanel();\n\t\t\t}", "public void clickButton(View v) {\n\n // Get the text we want to send.\n EditText et = (EditText) findViewById(R.id.editText);\n String msg = et.getText().toString();\n\n // Then, we start the call.\n PostMessageSpec myCallSpec = new PostMessageSpec();\n\n\n myCallSpec.url = SERVER_URL_PREFIX + \"post_msg.json\";\n myCallSpec.context = ChatActivity.this;\n // Let's add the parameters.\n HashMap<String,String> m = new HashMap<String,String>();\n m.put(\"app_id\", MY_APP_ID);\n m.put(\"msg\", msg);\n myCallSpec.setParams(m);\n\n startSpinner();\n\n // Actual server call.\n if (uploader != null) {\n // There was already an upload in progress.\n uploader.cancel(true);\n }\n uploader = new ServerCall();\n //startSpinner();\n uploader.execute(myCallSpec);\n }", "@Override\n public void onClick(View view) {\n if(buttonHandler != null)\n {\n //we send out to our button handler\n buttonHandler.handleEvolve(wid);\n }\n Toast.makeText(getContext(), \"Evolve please!\", Toast.LENGTH_SHORT).show();\n\n }", "public void button_clicked(View v) {\n mCallback.onButtonClicked(v);\n }", "public void clickOnSuccessOkBtn() throws Exception {\r\n\t\r\n\t\t\tclickOnButton(btnOKSuccess);\r\n\t\t\tlog(\"clicked on OK button and object is:-\" + btnOKSuccess.toString());\r\n\t\t\tThread.sleep(1000);\r\n\t}", "@Override\n public void onClick(View v) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n doClickOnButtonOk();\n }\n });\n }", "@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int button) {\n\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int button) {\n\t\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n JButton button = (JButton) e.getSource();\n if (button.getText().toString().equals(\"OK\")) {\n this.dispose();\n }\n\n else {\n ip = null;\n this.dispose();\n }\n }", "void onClick();", "public void trigger() {\n button.release(true);\n }", "public void buttonClick() {\n if (soundToggle == true) {\n buttonClick.start();\n } // if\n }", "public void onClick(DialogInterface dialog, int whichButton) {\n callbackContext.success(edittext.getText().toString());\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() == submit) {\n int score = answerCheck();\n try {\n Submit submitButton = new Submit(userid, user.getText(), totalScore.getText(), score);\n setVisible(false);\n } catch (SQLException ex) {\n Logger.getLogger(Play.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "abstract void botonDemo_actionPerformed(ActionEvent e);", "void onOkButtonPressed();", "void btnGenReport_actionPerformed(ActionEvent e) {\n JButtonQueryButtonAction(e);\r\n }", "public void settingBtnClick() {\n\t}", "@Override\n\tpublic void pressed(PushButton button) {\n\t\tvm.getConfigurationPanel().getButton(index);\n\t\t\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tboolean yes = true;\n\t\t\t\t// update the question text\n\t\t\t\tupdateQuestion(yes);\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\tSystem.out.println(\"Sent\");\n\t\t\t\t\t}", "void actionButton ( ) throws IOException {\n String textOfField = this.gui.wdgInputText.getText();\n this.gui.widgOutput.append(\"Button1 \" + (++this.ctKeyStroke1) + \" time, text=\" + textOfField + \"\\n\");\n }", "public void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==btnConfirmOrNext){\n\t\t\tif(btnConfirmOrNext.getText().equals(\"Confirm\")){\n\t\t\t\ttakeInUserInput();\n\t\t\t\tdisableAllButtons(); // festival speaking\n\t\t\t} else if (btnConfirmOrNext.getText().equals(\"Next Question\")||btnConfirmOrNext.getText().equals(\"Done\")){\n\t\t\t\tdisableAllButtons(); // festival speaking\n\t\t\t\t// ask question when it is supposed to\n\t\t\t\tif(spellList.status == QuizState.Asking){\n\t\t\t\t\tbtnConfirmOrNext.setText(\"Confirm\");\n\t\t\t\t\tquestionAsker=spellList.getQuestionAsker();\n\t\t\t\t\tquestionAsker.execute();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(e.getSource()==btnStop){\n\t\t\t// quiz only stoppable after a question is done asking (i.e. Answering state) or when is question is done answered\n\t\t\tif(spellList.status==QuizState.Answering||btnConfirmOrNext.getText().equals(\"Next Question\")){\n\t\t\t\t// record stats even though stopped\n\t\t\t\tspellList.recordStatisticsFromLevel();\n\t\t\t\t// go back to main panel\n\t\t\t\tmainFrame.changeCardPanel(\"Main\");\n\t\t\t}\n\t\t} else if(e.getSource()==btnListenAgain){\n\t\t\t// this button only works when the voice generator is not generating any voice and when a question is not being asked\n\t\t\tif((!(spellList.status==QuizState.Asking)||(btnConfirmOrNext.getText().equals(\"Next Question\")))&&respellGen.isDone()){\n\t\t\t\t// respell word\n\t\t\t\trespellGen = new VoiceGenerator(theVoice,theVoiceStretch,theVoicePitch,theVoiceRange);\n\t\t\t\trespellGen.setTextForSwingWorker(\"\", spellList.getCurrentWord());\n\t\t\t\trespellGen.execute();\n\t\t\t\t// rerequest focus on user input\n\t\t\t\tuserInput.requestFocus();\n\t\t\t}\n\t\t}\n\t}", "void mainButtonPressed();", "public void onButtonBPressed();", "public void buttonShowIncomplete(ActionEvent actionEvent) {\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif(arg0.getSource() == button1){\n\t\tSystem.out.println(\"Why did the chicken cross the road.\");\n\t\t}\n\t\tif(arg0.getSource() == button2){\n\t\t\tSystem.out.println(\"`because he was to dumb to realize the grosrey store was the other way.\");\n\t\t\t}\n\t}" ]
[ "0.7249539", "0.7046709", "0.70039433", "0.69802755", "0.695", "0.6894674", "0.6863211", "0.68525434", "0.68110895", "0.67752886", "0.6759465", "0.67581564", "0.6724986", "0.67210263", "0.66999584", "0.6679764", "0.6672251", "0.66687185", "0.6659886", "0.6655422", "0.6649388", "0.664284", "0.66225594", "0.6608869", "0.659449", "0.65774727", "0.65695184", "0.6562668", "0.6547798", "0.6541002", "0.6529291", "0.6491345", "0.64859706", "0.64772046", "0.64644367", "0.6464335", "0.64618057", "0.64503926", "0.6449306", "0.6448188", "0.64241076", "0.6399771", "0.639692", "0.63814634", "0.6376635", "0.63760096", "0.6370708", "0.63448983", "0.6339323", "0.63321525", "0.6325486", "0.63196427", "0.6311421", "0.63054836", "0.6304712", "0.6303109", "0.6302203", "0.6298", "0.62936825", "0.6292633", "0.62914217", "0.6287488", "0.62839526", "0.62808615", "0.62790984", "0.62730235", "0.627269", "0.62701994", "0.6266047", "0.6265227", "0.62606734", "0.6253756", "0.6248734", "0.6248563", "0.624828", "0.6245219", "0.62283844", "0.6226202", "0.622341", "0.6220742", "0.62200737", "0.6212976", "0.62111217", "0.6210279", "0.62074196", "0.62019783", "0.619878", "0.6197042", "0.61821705", "0.61800575", "0.6177184", "0.61770594", "0.61754465", "0.6175106", "0.6174337", "0.61726403", "0.6172446", "0.61723536", "0.6170434", "0.61667836", "0.61646837" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Parses the contents of an entry. If it encounters a title, summary, or link tag, hands them off to their respective "read" methods for processing. Otherwise, skips the tag.
private Entry readEntry(XmlPullParser parser) throws XmlPullParserException, IOException { parser.require(XmlPullParser.START_TAG, ns, "entry"); String title = null; String summary = null; String link = null; while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } String name = parser.getName(); if (name.equals("title")) { title = readTitle(parser); } else if (name.equals("summary")) { summary = readSummary(parser); } else if (name.equals("link")) { link = readLink(parser); } else { skip(parser); } } return new Entry(title, summary, link); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readEntry(XmlPullParser parser) throws XmlPullParserException, IOException {\n\n while (parser.next() != XmlPullParser.END_TAG) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n continue;\n }\n String name = parser.getName();\n\n switch (name) {\n case \"profile\":\n readProfile(parser);\n break;\n case \"examresult\":\n readExamResult(parser);\n break;\n case \"feesrecord\":\n readFee(parser);\n break;\n case \"attendancerecord\":\n readAttendance(parser);\n break;\n case \"noticesrecord\":\n readNoticeRecord(parser);\n break;\n case \"teachersrecord\":\n readTeacherRecord(parser);\n break;\n default:\n skip(parser);\n break;\n }\n\n }\n complete_flag = true;\n }", "private void readFeed(XmlPullParser parser) throws XmlPullParserException, IOException {\n\n String name;\n\n while (parser.next() != XmlPullParser.END_TAG) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n\n if (complete_flag) {\n break;\n }\n continue;\n }\n name = parser.getName();\n // Starts by looking for the entry tag\n if (name.equals(\"student\")) {\n readEntry(parser);\n } else {\n skip(parser);\n }\n }\n\n }", "@Override\n\t\tpublic void visitTag(Tag tag) {\n\t\t\tsuper.visitTag(tag);\n\t\t\tif ( engine.isPageContent(tag) ) {\n\t\t\t\tString tcontent = extractText(tag, 0);\n\t\t\t\tif ( tcontent == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( content == null || content.length() < tcontent.length() ) {\n\t\t\t\t\tcontent = tcontent; \n\t\t\t\t}\n\t\t\t} else if ( engine.isPageTitle(tag) ) {\n\t\t\t\tString ttitle = extractText(tag, 0);\n\t\t\t\tif ( ttitle == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( title == null || title.length() < ttitle.length() ) {\n\t\t\t\t\ttitle = ttitle;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public DataRecord nextRecordIn () \n throws IOException, FileNotFoundException {\n HTMLTag tag;\n StringBuffer text = new StringBuffer(\"\");\n String href = \"\";\n dataRec = new DataRecord();\n do {\n tag = readTag();\n if (tag == null) {\n // don't do anything\n } // end if tag is null\n else { // tag not null\n text.append (tag.getPrecedingText());\n if (tag.getName().equals(\"a\")) {\n if (tag.isEnding()) {\n // capture anchor when we fall out of the do loop\n } // end if ending tag\n else {\n href = tag.getAttribute(\"href\").getValue();\n text.setLength(0);\n } // end beginning a tag \n } // end a tag\n else // not an a (anchor) tag\n if ((! headingsAsCategories)\n && tag.isListItemEnd()\n && text.length() > 0) {\n int catIndex = tag.getListLevel() + headingLevelsUsed;\n if ((tag.getListLevel() > 0) \n && ((catIndex) <= MAX_CATEGORY_LEVEL)) {\n category [catIndex] = text.toString();\n for (int i = catIndex + 1; i <= MAX_CATEGORY_LEVEL; i++) {\n category [i] = \"\";\n }\n }\n }\n else // not an a (anchor) tag and not a list category\n if ((headingsAsCategories || headingsAndLists)\n && tag.isHeadingTag()\n && tag.isEnding()\n && text.length() > 0) {\n if (tag.getHeadingLevel() > 0) {\n int h = tag.getHeadingLevel();\n int l = 0;\n if (headings [h] > 0) {\n l = headings [h];\n } else {\n headingLevelsUsed++;\n headings [h] = headingLevelsUsed;\n l = headingLevelsUsed;\n }\n if (l <= MAX_CATEGORY_LEVEL) {\n category [l] = text.toString();\n }\n }\n }\n if ((! headingsAsCategories)\n && tag.isListItemStart()) {\n text.setLength(0);\n }\n else\n if ((headingsAsCategories || headingsAndLists)\n && tag.isHeadingTag()\n && (! tag.isEnding())) {\n text.setLength(0);\n }\n } // end tag not null\n } while (tag != null\n && (!(tag.isEnding() \n && tag.getName().equals(\"a\")\n && href != null)));\n if (tag == null || href == null) {\n return null;\n }\n else {\n // populate the data record\n int dtLevelsUsed = 0;\n if (tag.isDefTermActive()) {\n dtLevelsUsed = 1;\n } \n int listLevelsUsed = tag.getListLevel();\n if (listLevelsUsed < 0) {\n listLevelsUsed = 0;\n }\n else\n if (listLevelsUsed > 0) {\n listLevelsUsed--;\n }\n for (int i = 1; i <= MAX_CATEGORY_LEVEL; i++) {\n if ((! headingsAsCategories)\n && i <= (listLevelsUsed + headingLevelsUsed + dtLevelsUsed)) {\n storeField (CATEGORY_FIELD_NAME [i], category[i]);\n }\n else\n if (headingsAsCategories\n && i < tag.getHeadingLevel()) {\n storeField (CATEGORY_FIELD_NAME [i], category[i]);\n }\n else {\n storeField (CATEGORY_FIELD_NAME [i], \"\");\n }\n }\n storeField (ANCHOR, text.toString());\n text.setLength(0);\n if (href.startsWith (\"mailto:\")) {\n storeField (EMAIL, href.substring(7));\n storeField (URL, \"\");\n }\n else {\n storeField (EMAIL, \"\");\n storeField (URL, href);\n }\n recordNumber++;\n return dataRec;\n }\n }", "public void readContent(BinaryDataReader dataReader) throws IOException\n\t{\n\t\t// parse tag data\n\t\tswitch (this.type)\n\t\t{\n\t\tcase BYTE:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase SHORT:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase LONG:\n\t\t\tthis.content = Integer.valueOf(value);\n\t\t\tbreak;\n\t\tcase ASCII:\n\t\t\tthis.content = readAscii(dataReader);\n\t\t\tbreak;\n\t\tcase RATIONAL:\n\t\t\t// convert tag value to long offset for reading large buffer\n\t\t\tthis.content = readRational(dataReader);\n\t\t\tbreak;\n\t\t\t\n\t\tcase UNKNOWN:\n\t\t\tSystem.err.println(\"Could not interpret tag with code: \"\n\t\t\t\t\t+ this.code + \" (\" + this.name + \")\");\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "public Collection<String> parse(Reader page)\r\n\t{\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//create an input source to parse from the stream\r\n\t\t\tInputSource pageInputSource = new InputSource(page);\r\n\t\t\t\r\n\t\t\t// parse page\r\n\t\t\tp.parse(pageInputSource);\r\n\t\t\t\r\n\t\t\treturn linkContextHandler.removeLinkStrings();\r\n\t\t} catch (IOException e)\r\n\t\t{\r\n\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"input error, couldn't parse page: \" + e.toString());\r\n\t\t} catch (SAXException e)\r\n\t\t{\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"SAX exception, tag soup couldn't parse page: \"\r\n\t\t\t\t\t\t\t+ e.toString());\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "JournalEntry read() throws IOException, InvalidJournalEntryException;", "protected abstract void parseEntries(final Document doc,\n final ContentCleaner contentCleaner,\n final Resource.Builder resource);", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "@Override\n public List<MetadataWrapper> extractContent(InputStream stream, String filename, String mimeType, List<String> tags, String from, String to, boolean recursive) {\n\n Logger.getLogger(\"DefaultFileConverter\").log(Level.INFO, filename + \": \" + mimeType + \" :recursive = \" + recursive);\n try (InputStream fileStream = stream) {\n\n List<MetadataWrapper> contents =new ArrayList<>();\n\n\n //parse Document\n AutoDetectParser parser = new AutoDetectParser();\n Metadata metadata = new Metadata();\n BodyContentHandler handler = new BodyContentHandler();\n TikaInputStream tikaInputStream = TikaInputStream.get(fileStream);\n parser.parse(tikaInputStream, handler, metadata);\n\n contents.add(new FileMetadataWrapper(filename, mimeType, handler.toString(), tags, from, to));\n\n if(recursive) {\n //parse embedded contents\n List<MetadataWrapper> extracted = extractEmbeddedContent(tikaInputStream, filename, from, to);\n contents.addAll(extracted);\n }\n\n Logger.getLogger(\"DefaultFileConverter\").log(Level.INFO, filename + \": \" + \"contents: \" + contents);\n return contents;\n\n } catch (IOException | SAXException | TikaException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "private Entry getMediaContent(Entry entry, String level, String contClassification) {\n\n\t\tArrayList<Entry> tempEntries = new ArrayList<Entry>();\n\t\tArrayList<Medium> tempMedia = new ArrayList<Medium>();\n\n\t\tArrayList<Medium> media = entry.getMedia();\n\t\tentry.setMedia(null);\n\n\t\tif (media != null && media.size() > 0) {\n\n\t\t\tfor (Medium medium : media) {\n\n\t\t\t\tchar tempLastChar = medium.getGuid().charAt(medium.getGuid().length() - 1);\n\n\t\t\t\tif (level.equalsIgnoreCase(AppConstant.CONT_lEVEL_C)\n\t\t\t\t\t\t&& contClassification.equalsIgnoreCase(AppConstant.CONT_CLASSIFICATION_C)) {\n\t\t\t\t\tif (tempLastChar == 'C') {\n\t\t\t\t\t\ttempMedia.add(medium);\n\t\t\t\t\t}\n\n\t\t\t\t} else if (level.equalsIgnoreCase(AppConstant.CONT_lEVEL_U)\n\t\t\t\t\t\t&& contClassification.equalsIgnoreCase(AppConstant.CONT_CLASSIFICATION_C)) {\n\t\t\t\t\tif (tempLastChar != 'C') {\n\t\t\t\t\t\ttempMedia.add(medium);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tentry.setMedia(tempMedia);\n\t\t\ttempMedia = new ArrayList<Medium>();\n\t\t}\n\t\t//tempEntries.add(entry);\n\t\treturn entry;\n\t}", "public void fillFromEntry(BlogEntry entry) {\n\t\tif(entry.getId()==null) {\n\t\t\tthis.id = \"\";\n\t\t} else {\n\t\t\tthis.id = entry.getId().toString();\n\t\t}\n\t\tthis.title = entry.getTitle();\n\t\tthis.text = entry.getText();\n\t\t\n\t}", "public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)\n\t\tthrows IOException,SAXException,TikaException {\n\n\t\t// Get metadata\n\t\tthis.mdata = metadata;\n\n\t\t// Read in all text\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line = reader.readLine();\n\t\tString text = \"\";\n\t\twhile (line != null) {\n\t\t\ttext += line;\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\n\t\ttry {\n\t\t\t// Get NER results from each NER toolkit.\n\t\t\tthis.openNLPEntities = this.openNLPParse(text);\t\n\t\t\tthis.coreNLPEntities = this.coreNLPParse(text);\t\n\t\t\tthis.nltkEntities = this.nltkParse(text);\n\t\t\tthis.gQMeasurements = this.gQParse(text);\n\n\t\t\t// Combine results and add to metadata.\n\t\t\tMap<String, Map<String,Integer>> combo = combineResults();\n\t\t\tString json = mapToJSON(combo);\n\t\t\tString openNLPJSON = mapToJSON(this.openNLPEntities);\n\t\t\tString coreNLPJSON = mapToJSON(this.coreNLPEntities);\n\t\t\tString nltkJSON = mapToJSON(this.nltkEntities);\n\t\t\tpushToMetadata(\"openNLP entities\", openNLPJSON);\n\t\t\tpushToMetadata(\"coreNLP entities\", coreNLPJSON);\n\t\t\tpushToMetadata(\"nltk entities\", nltkJSON);\n\t\t\tpushToMetadata(\"maxJointAgreement\",json);\n\t\t\tpushToMetadata(\"quantities\", this.gQMeasurements);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected InvMetadata readMetadata( InvCatalog catalog, InvDatasetImpl dataset, Element mdataElement) {\n Namespace namespace;\r\n List inlineElements = mdataElement.getChildren();\r\n if (inlineElements.size() > 0) // look at the namespace of the children, if they exist\r\n namespace = ((Element) inlineElements.get( 0)).getNamespace();\r\n else\r\n namespace = mdataElement.getNamespace(); // will be thredds\r\n\r\n String mtype = mdataElement.getAttributeValue(\"metadataType\");\r\n String href = mdataElement.getAttributeValue(\"href\", xlinkNS);\r\n String title = mdataElement.getAttributeValue(\"title\", xlinkNS);\r\n String inheritedS = mdataElement.getAttributeValue(\"inherited\");\r\n boolean inherited = (inheritedS != null) && inheritedS.equalsIgnoreCase(\"true\");\r\n\r\n boolean isThreddsNamespace = ((mtype == null) || mtype.equalsIgnoreCase(\"THREDDS\")) &&\r\n namespace.getURI().equals(XMLEntityResolver.CATALOG_NAMESPACE_10);\r\n\r\n // see if theres a converter for it.\r\n MetadataConverterIF metaConverter = factory.getMetadataConverter( namespace.getURI());\r\n if (metaConverter == null) metaConverter = factory.getMetadataConverter( mtype);\r\n if (metaConverter != null) {\r\n if (debugMetadataRead) System.out.println(\"found factory for metadata type = \"+mtype+\" namespace = \"+\r\n namespace+\"=\"+metaConverter.getClass().getName());\r\n\r\n // see if theres any inline content\r\n Object contentObj = null;\r\n if (inlineElements.size() > 0) {\r\n contentObj = metaConverter.readMetadataContent( dataset, mdataElement);\r\n return new InvMetadata( dataset, mtype, namespace.getURI(), namespace.getPrefix(),\r\n inherited, false, metaConverter, contentObj);\r\n\r\n } else { // otherwise it must be an Xlink; defer reading\r\n return new InvMetadata(dataset, href, title, mtype, namespace.getURI(),\r\n namespace.getPrefix(), inherited, false, metaConverter);\r\n }\r\n }\r\n\r\n // the case where its not ThreddsMetadata, but theres no converter\r\n if (!isThreddsNamespace) {\r\n if (inlineElements.size() > 0) {\r\n // just hold onto the jdom elements as the \"content\" LOOK should be DOM?\r\n return new InvMetadata( dataset, mtype, namespace.getURI(), namespace.getPrefix(),\r\n inherited, false, this, mdataElement);\r\n\r\n } else { // otherwise it must be an Xlink, never read\r\n return new InvMetadata(dataset, href, title, mtype, namespace.getURI(),\r\n namespace.getPrefix(), inherited, false, null);\r\n }\r\n\r\n }\r\n\r\n // the case where its ThreddsMetadata\r\n if (inlineElements.size() > 0) {\r\n ThreddsMetadata tmg = new ThreddsMetadata(false);\r\n readThreddsMetadata( catalog, dataset, mdataElement, tmg);\r\n return new InvMetadata( dataset, mtype, namespace.getURI(), namespace.getPrefix(),\r\n inherited, true, this, tmg);\r\n\r\n } else { // otherwise it must be an Xlink; defer reading\r\n return new InvMetadata(dataset, href, title, mtype, namespace.getURI(),\r\n namespace.getPrefix(), inherited, true, this);\r\n }\r\n\r\n }", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "public ParsedPage parse(String src);", "private Object read() throws XMLParseException {\n\t\tswitch (_tokenizer.next()) {\n\t\tdefault: break;\n\t\tcase ERROR: throw new XMLParseException(_tokenizer.getCurrentText());\n\t\tcase TEXT: return _tokenizer.getCurrentText();\n\t\tcase OPEN:\n\t\t\tElement result = new Element(_tokenizer.getCurrentName());\n\t\t\twhile (_tokenizer.next() == XMLTokenType.ATTR) {\n\t\t\t\tif (result.setAttr(_tokenizer.getCurrentName(), _tokenizer.getCurrentText()) != null) {\n\t\t\t\t\tthrow new XMLParseException(\"duplicate attribute: \" + _tokenizer.getCurrentName());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_tokenizer.current() == XMLTokenType.ECLOSE) {\n\t\t\t\t// System.out.println(\"ended /> for \" + result.getName());\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tif (_tokenizer.current() != XMLTokenType.CLOSE) {\n\t\t\t\tthrow new XMLParseException(_tokenizer.getCurrentText());\n\t\t\t}\n\t\t\t_pending.push(result.getName());\n\t\t\twhile (_tokenizer.next() != XMLTokenType.ETAG) {\n\t\t\t\t/*if (_tokenizer.current() == XMLTokenType.END) {\n\t\t\t\t\tthrow new XMLParseException(\"Unexpected end of file\");\n\t\t\t\t}*/\n\t\t\t\tif (_tokenizer.current() == XMLTokenType.END) {\n\t\t\t\t\tif (isHTML) {\n\t\t\t\t\t\t_pending.pop();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new XMLParseException(\"Missing end tag for <\" + result.getName() + \">\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_tokenizer.saveToken();\n\t\t\t\tresult.addContent(read());\n\t\t\t}\n\t\t\t_pending.pop();\n\t\t\tif (!_tokenizer.getCurrentName().equals(result.getName())) {\n\t\t\t\tif (isHTML) {\n\t\t\t\t\t// System.out.println(\"HTML backup for \" + result.getName());\n\t\t\t\t\tfor (String p : _pending) {\n\t\t\t\t\t\tif (_tokenizer.getCurrentName().equals(p)) {\n\t\t\t\t\t\t\t_tokenizer.saveToken();\n\t\t\t\t\t\t\t//System.out.println(\"implicitly ended by </\" + p + \">\");\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new XMLParseException(\"<\" + result.getName() + \"> ended with </\" + _tokenizer.getCurrentName() + \">\");\n\t\t\t}\n\t\t\treturn result;\n\t\tcase END: throw new XMLParseException(\"no XML element\");\n\t\t}\n\t\t// NB: if execution reaches here, we did something wrong.\n\t\tthrow new XMLParseException(\"internal error: what kind of token is this? \" + _tokenizer);\n\t}", "private void processTag(String p_content)\n {\n StringBuffer tagName = new StringBuffer();\n Hashtable attributes = new Hashtable();\n boolean bEndTag;\n\n int i = eatWhitespaces(p_content, 0);\n\n bEndTag = i < p_content.length() && p_content.charAt(i) == '/';\n\n //read the tag name...\n while (i < p_content.length() &&\n !Character.isWhitespace(p_content.charAt(i)))\n {\n tagName.append(p_content.charAt(i));\n\n i++;\n }\n\n i = eatWhitespaces(p_content, i);\n\n //read the attributes...\n StringBuffer attributeName = new StringBuffer();\n StringBuffer attributeValue = new StringBuffer();\n\n while (i < p_content.length())\n {\n try\n {\n i = eatWhitespaces(p_content, i);\n\n //read the name...\n while (!Character.isWhitespace(p_content.charAt(i)) &&\n p_content.charAt(i) != '=')\n {\n attributeName.append(p_content.charAt(i));\n i++;\n }\n\n i = eatWhitespaces(p_content, i);\n if (p_content.charAt(i) == '=')\n {\n while (p_content.charAt(i) != '\"')\n {\n i++;\n }\n i++;\n while (p_content.charAt(i) != '\"')\n {\n attributeValue.append(p_content.charAt(i));\n i++;\n }\n i++;\n }\n\n attributes.put(attributeName.toString(),\n attributeValue.toString());\n\n attributeName.setLength(0);\n attributeValue.setLength(0);\n }\n catch (IndexOutOfBoundsException e)\n {\n // tough luck the TMX wasn't as well written as we thought...\n // CvdL: TODO: throw an exception!!\n }\n }\n\n if (bEndTag)\n {\n m_handler.processEndTag(tagName.substring(1),\n \"<\" + p_content + \">\");\n }\n else\n {\n m_handler.processTag(tagName.toString(), attributes,\n \"<\" + p_content + \">\");\n }\n }", "java.lang.String getContents();", "java.lang.String getContents();", "private String readContents(final URL url) throws IOException {\n \t\tfinal BufferedReader in =\n \t\t\tnew BufferedReader(new InputStreamReader(url.openStream()));\n \t\tfinal StringBuilder sb = new StringBuilder();\n \t\twhile (true) {\n \t\t\tfinal String line = in.readLine();\n \t\t\tif (line == null) break; // eof\n \t\t\tsb.append(line);\n \t\t}\n \t\tin.close();\n \t\treturn sb.toString();\n \t}", "public void processDocument(String url) throws PageReadException {\n // TODO: reset the results.\n impossible = false;\n givenUrl = url;\n nextPageLink = null;\n if (!notFirstPage) {\n xmlImages = new ArrayList<String>();\n title = null;\n }\n\n String content = pageReader.readPage(url);\n\n document = Jsoup.parse(content);\n\n if (document.getElementsByTag(\"body\").size() == 0) {\n LOG.error(\"no body to parse \" + url);\n impossible = true;\n throw new PageReadException(\"no body to parse\");\n }\n\n init(); // this needs another name, it does all the work.\n if (readAllPages && nextPageLink != null) {\n try {\n String textSoFar = articleText;\n notFirstPage = true;\n processDocument(nextPageLink);\n if (articleText != null) {\n articleText = textSoFar + articleText;\n }\n } finally {\n notFirstPage = false;\n System.out.println(articleText);\n }\n }\n\n }", "public Object readMetadataContentFromURL( InvDataset dataset, java.net.URI uri) throws java.io.IOException {\r\n Element elem = readContentFromURL(uri);\r\n Object contentObject = readMetadataContent(dataset, elem);\r\n if (debugMetadataRead) System.out.println(\" convert to \" + contentObject.getClass().getName());\r\n return contentObject;\r\n }", "public HTMLTag readTag ()\n\t\t\tthrows IOException, FileNotFoundException {\n\t\t\t\n\t\t// start building new tag\n\t\ttag = new HTMLTag ();\n\t\t\t\t\n\t\t// get any text preceding the tag itself\n\t\thtmlChar.setFieldType (HTMLContext.TEXT);\n\t\tgetNextField();\n\t\ttag.setPrecedingText (context.field.toString());\n\t\tif (htmlChar.character == '<') {\n\t\t\tgetNextCharacter();\n\t\t}\n\t\t\n\t\t// see if this is an ending tag\n\t\tif (htmlChar.character == '/') {\n\t\t\ttag.setEnding();\n\t\t\tgetNextCharacter();\n\t\t}\n\t\t\n\t\t// get the name of the tag\n\t\thtmlChar.setFieldType (HTMLContext.TAG_NAME);\n\t\tgetNextField();\n\t\ttag.setName (context.field.toString());\n\t\t\n\t\t// check to see if the tag is a comment\n\t\tif (tag.getName().equals (\"!--\")) {\n attribute = new HTMLAttribute (\"!==\");\n htmlChar.setFieldType (HTMLContext.COMMENT);\n getNextField();\n for (int i = 0; i < 2; i++) {\n if (context.field.length() > 0\n && context.field.charAt (context.field.length() - 1) == '-') {\n context.field.setLength (context.field.length() - 1);\n }\n }\n attribute.setValue (context.field.toString());\n\t\t\ttag.setAttribute (attribute);\n\t\t}\n else {\n\t\t\n // Collect and store all the attributes\n while (! htmlChar.endsTag) {\n htmlChar.setFieldType (HTMLContext.ATTRIBUTE_NAME);\n getNextCharacter();\n getNextField();\n if (context.field.length() > 0) {\n attribute = new HTMLAttribute (context.field.toString());\n if (htmlChar.character == '=') {\n getNextCharacter();\n htmlChar.setFieldType (HTMLContext.ATTRIBUTE_VALUE);\n getNextField();\n attribute.setValue (context.field.toString());\n }\n tag.setAttribute (attribute);\n }\n }\n }\n\n // evaluate block properties of tag\n if ((! tag.isEnding())\n && (tag.isBlockTag())) {\n context.lastOpenBlock = tag.getName();\n }\n else\n if (tag.isEnding()\n && tag.getName().equals (context.lastOpenBlock)) {\n context.lastOpenBlock = \"\";\n }\n \n // evaluate list properties of tag\n int listTagType = 0;\n if (tag.getName().equals (\"ol\")\n || tag.getName().equals (\"ul\")\n || tag.getName().equals (\"dl\")) {\n listTagType = 1;\n }\n else\n if (tag.getName().equals (\"li\")\n || tag.getName().equals (\"dt\")\n || tag.getName().equals (\"dd\")) {\n listTagType = 2;\n tag.setListItemStart (true);\n }\n \n tag.setListLevel (context.listLevel);\n tag.setListItemTag (context.listItemTag);\n if (context.listItemTag.length() > 0) {\n if (listTagType > 0) {\n context.listItemTag = \"\";\n tag.setListItemEnd (true);\n }\n }\n \n if (listTagType == 1) {\n context.defTermActive = false;\n if (tag.isEnding()) {\n if (context.listLevel > 0) {\n context.listLevel--;\n }\n }\n else {\n context.listLevel++;\n }\n }\n \n tag.setDefTermActive (context.defTermActive);\n \n if (listTagType == 2) {\n context.listItemTag = tag.getName();\n if (tag.getName().equals(\"dt\")) {\n context.defTermActive = true;\n }\n }\n \n // evaluate heading properties of tag\n if (tag.isHeadingTag()) {\n context.headingLevel = tag.getHeadingLevel();\n } else {\n tag.setHeadingLevel (context.headingLevel);\n }\n \n // Check for preformatting\n if (tag.getName().equals (\"pre\")) {\n context.preformatted = (! tag.isEnding());\n }\n \n // return results\n\t\tif (htmlChar.character == '>') {\t\t\t\n getNextCharacter();\n return tag;\n }\n else \n if (tag.getPrecedingText().length() > 0) {\n return tag;\n\t\t} \n else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Set<Anchor> parse(Reader reader, String url) {\n\n Set<Anchor> elements = new HashSet<>();\n String urtContent = null;\n try {\n urtContent = readFully(reader);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (urtContent == null){\n return elements;\n }\n\n mTag = pTag.matcher(urtContent);\n\n while (mTag.find()) {\n\n String href = mTag.group(1); // get the values of href\n String linkElem = mTag.group(2); // get the text of link Html Element\n\n mLink = pLink.matcher(href);\n\n while (mLink.find()) {\n\n String link = mLink.group(1);\n Anchor anchor = new Anchor();\n anchor.setUrl(link);\n anchor.setText(linkElem);\n\n elements.add(anchor);\n\n }\n }\n return elements;\n }", "protected synchronized T _parse(String contents, boolean updateCache) throws Exception {\n String processedContents = _process(contents);\n if (updateCache) {\n _contents = processedContents;\n }\n\n T model = _parse(processedContents);\n\n if (updateCache) {\n //System.out.println(\"WodParserCacheEntry._parse: set model (String) = \" + model);\n _setModel(model);\n _documentChanged = false;\n _validated = false;\n getCache()._setValidated(false);\n }\n\n return model;\n }", "public void process(Page page) {\n\t\t\t\tgetContent(page);\n\t\t\t}", "@Override void init(Element element) {\n String name = element.getTagName();\n if (name.equals(\"published\")) {\n this.published = element.getTextContent().trim();\n }\n else if (name.equals(\"content\")) {\n this.content = parseContent(element);\n }\n else {\n super.init(element);\n }\n }", "public void testContentsParsing() throws Throwable {\n long start = System.currentTimeMillis();\n PluginTokenizer tokenizer = new PluginTokenizer();\n\n System.out.println(\"\\nStart extracting contents in \\\"\" + _path + \"\\\"\");\n \n tokenizer.setSource(new InputStreamSource(_reader));\n tokenizer.setParseFlags(Tokenizer.F_NO_CASE | Tokenizer.F_TOKEN_POS_ONLY);\n tokenizer.setWhitespaceHandler(this);\n tokenizer.setSequenceHandler(this);\n\n while (tokenizer.hasMoreToken()) {\n tokenizer.nextToken();\n System.out.println(tokenizer.current());\n assertTrue(\"Method current() returned null.\", tokenizer.current() != null);\n }\n \n long diff = System.currentTimeMillis() - start;\n System.out.println(\"Finished after \" + diff + \" milliseconds\");\n }", "@Override\n protected DataCiteJson transformElement(final Element entry) throws TransformerException\n {\n final String version = HtmlUtils.getAttribute(entry, EnaConstants.VERSION);\n final String accession = HtmlUtils.getAttribute(entry, EnaConstants.ACCESSION);\n final String sequenceLength = HtmlUtils.getAttribute(entry, EnaConstants.SEQUENCE_LENGTH);\n\n final DataCiteJson document = new DataCiteJson(accession);\n document.setVersion(version);\n document.setPublisher(EnaConstants.PUBLISHER);\n document.addFormats(EnaConstants.FORMATS);\n document.setResourceType(EnaConstants.RESOURCE_TYPE);\n document.addResearchDisciplines(EnaConstants.DISCIPLINES);\n\n document.setPublicationYear(getPublicationYear(entry));\n document.addSizes(getSizes(sequenceLength));\n document.addTitles(getTitles(accession, version));\n document.addResearchData(getResearchData(accession));\n\n document.addDates(getDates(entry));\n document.addDates(HtmlUtils.getObjects(entry, EnaConstants.SUBMISSION_REF_SELECTION, this::parseSubmissionRef));\n\n document.addWebLinks(getWebLinks(accession, sequenceLength));\n document.addWebLinks(HtmlUtils.getObjects(entry, EnaConstants.TAXON, this::parseTaxonLink));\n\n document.addDescriptions(HtmlUtils.getObjects(entry, EnaConstants.DESCRIPTION, this::parseDescription));\n document.addDescriptions(HtmlUtils.getObjects(entry, EnaConstants.ENTRY_COMMENT, this::parseComment));\n\n document.addSubjects(HtmlUtils.getObjects(entry, EnaConstants.KEYWORD, this::parseKeyword));\n document.addSubjects(HtmlUtils.getObjects(entry, EnaConstants.TAXON, this::parseCommonTaxonName));\n document.addSubjects(HtmlUtils.getObjects(entry, EnaConstants.TAXON, this::parseScientificTaxonName));\n document.addSubjects(getSubjects(entry));\n\n document.addRelatedIdentifiers(HtmlUtils.getObjects(entry, EnaConstants.PUBMED_REF_SELECTION, this::parseMedPubRef));\n document.addRelatedIdentifiers(HtmlUtils.getObjects(entry, EnaConstants.DOI_REF_SELECTION, this::parseDoiRef));\n\n return document;\n }", "private void parse() throws XMLStreamException {\n while (reader.hasNext()) {\n if (reader.next() == START_ELEMENT) {\n handleElement();\n }\n }\n }", "public String extractText(Reader reader) {\n String text = \"\";\n try { \n text = ArticleExtractor.INSTANCE.getText(reader); \n } catch (BoilerpipeProcessingException ex) {\n Logger.getLogger(TextExtractor.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return text;\n }", "public Contents getContents(\n )\n {return contents;}", "private Document parseFile() throws IOException {\n\tString contents = instream_to_contents();\n\tDocument doc = Jsoup.parse(contents);\n\treturn doc;\n }", "public String getContents() { return contents; }", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "public void PopulateRSSData()\n {\n try\n {\n URL Feed = ParseRSSFromFeed();\n ParseRSS(Feed);\n }\n catch(java.net.MalformedURLException exp)\n {\n String message = exp.getMessage();\n System.out.println(message);\n }\n catch(com.rometools.rome.io.FeedException fexp)\n {\n String message = fexp.getMessage();\n System.out.println(message);\n }\n catch(java.io.IOException ioexp)\n {\n String message = ioexp.getMessage();\n System.out.println(message);\n }\n }", "public Object parseItem(int rssType, Document doc, int index) throws Exception;", "public void doReads(Reader reader) throws IOException;", "public BlogEntry convert(@NonNull final Entry entry) {\n final BlogEntry blogEntry = new BlogEntry();\n blogEntry.setAuthor(entry.getUser().getUsername());\n blogEntry.setId(entry.getId());\n blogEntry.setPrivateEntry(!entry.getSecurity().getName().equalsIgnoreCase(\"public\"));\n blogEntry.setSubject(entry.getSubject());\n blogEntry.setBody(entry.getBody());\n blogEntry.setDate(entry.getDate());\n\n final HashMap<String, Object> tags = new HashMap<>();\n for (final com.justjournal.model.EntryTag tag : entry.getTags()) {\n final String tagName = tag.getTag().getName();\n if (!tags.containsKey(tagName)) tags.put(tagName, null);\n }\n\n final List<Tag> targetList = new ArrayList<>();\n for (final String t : tags.keySet()) {\n final Tag tag = new Tag();\n tag.setName(t);\n targetList.add(tag);\n }\n blogEntry.setTags(targetList);\n\n return blogEntry;\n }", "@Override\r\n\tpublic void process(ResultItems resultItems, Task task) {\n\t\tfinal String url = resultItems.getRequest().getUrl();\r\n\t\tSystem.out.println(\"****************--Entry Pipeline Process--*****************\");\r\n\t\tSystem.out.println(\"Get page: \" + url);\r\n\r\n\t\t/*\r\n\t\t * if(url.matches(\r\n\t\t * \"http://blog\\\\.sina\\\\.com\\\\.cn/s/articlelist_.*\\\\.html\")){//文章列表\r\n\t\t * System.out.println(\"No Op in Article List\"); // }else\r\n\t\t * if(url.matches(\"http://www\\\\.asianews\\\\.it/news-en/.*\")){\r\n\t\t */\r\n\t\t// 具体文章内容\r\n\t\tString time = null, title = null, content = null, abstracts = null, convertUrl = null,query=\"\";\r\n\r\n\t\tfor (Map.Entry<String, Object> entry : resultItems.getAll().entrySet()) {\r\n\t\t\t// System.out.println(entry.getKey()+\":\\n\"+entry.getValue());\r\n\r\n\t\t\tif (AsianViewDetailItem.TIME.equals(entry.getKey())) {\r\n\t\t\t\ttime = (String) entry.getValue();\r\n\t\t\t} else if (AsianViewDetailItem.TITLE.equals(entry.getKey())) {\r\n\t\t\t\ttitle = (String) entry.getValue();\r\n\t\t\t} else if (AsianViewDetailItem.ABSTRACT.equals(entry.getKey())) {\r\n\t\t\t\tabstracts = (String) entry.getValue();\r\n\t\t\t} else if (AsianViewDetailItem.CONTENT.equals(entry.getKey())) {\r\n\t\t\t\tcontent = (String) entry.getValue();\r\n\t\t\t} else if (AsianViewDetailItem.URL.equals(entry.getKey())) {\r\n\t\t\t\tassert url.equals(entry.getValue());\r\n\t\t\t} else if (AsianViewDetailItem.CONVERT_URL.equals(entry.getKey())) {\r\n\t\t\t\tconvertUrl = (String) entry.getValue();\r\n\t\t\t}else if(AsianViewDetailItem.QUERY.equals(entry.getKey())){\r\n//\t\t\t\tquery=\"//query_\"+(String) entry.getValue();\r\n\t\t\t\tquery=(entry.getValue()!=null)?\"//query_\"+entry.getValue():\"\";\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// System.out.println(\"Time:\\n\"+CorpusFormatter.timeFormat(time));\r\n\t\t//\r\n\t\t// System.out.println(\"Title:\\n\"+title);\r\n\t\t//\r\n\t\t// System.out.println(\"Abstract:\\n\"+abstracts);\r\n\t\t//\r\n\t\t// System.out.println(\"Content:\\n\"+content);\r\n\t\t//\r\n\t\t// System.out.println(\"Url:\\n\"+url);\r\n\r\n\t\tString id = String.format(\"%s-%s\", time, ++counter);\r\n\r\n\t\tfinal String fileName = String.format(\".//\" + FileUtils.docName + \"%s//%s.txt\",query, id);\r\n\t\tSystem.out.println(\"File name :\" + fileName);\r\n\t\t// FileUtils.writeContent(fileName, time, title, content);\r\n\t\tFileUtils.writeCorpus(fileName,\r\n\t\t\t\tconvertUrl != null\r\n\t\t\t\t\t\t? CorpusFormatter.format(id, time, url, \"T\", \"P\", title, abstracts,\r\n\t\t\t\t\t\t\t\tcontent, \"\", \"\", convertUrl)\r\n\t\t\t\t\t\t: CorpusFormatter.format(id, time, url, \"T\", \"P\", title, abstracts,\r\n\t\t\t\t\t\t\t\tcontent, \"\", \"\"));\r\n\r\n\t\t// }else{\r\n\t\t// System.out.println(\"Can't match Url\");\r\n\t\t// }\r\n\t\tSystem.out.println(\"****************--Exit Pipeline Process--*****************\");\r\n\r\n\t}", "private boolean parseHTML(Webpage webpage) {\n Document doc;\n try {\n doc = Jsoup.parse(webpage.getHTML());\n } catch (Throwable t) {\n if(this.DEBUG)\n System.out.println(\"-> ERROR: Jsoup failed to parse the HTML file from \" + webpage.getWARCname() + \", skipping it.\");\n return true;\n }\n\n Elements elements = doc.getAllElements();\n\n //Extract number of HTML elements\n webpage.setNumHTMLelem(elements.size());\n\n //Extract DOCTYPE\n webpage.setDoctype(getDocumentType(doc));\n\n //Go through every HTML element\n for (Element element : elements) {\n //Add comments' information for all child elements\n webpage = addComments(webpage, element);\n\n //Add textual content to the pile, so we can get its total size later\n if (element.ownText() != null && !element.ownText().equals(\"\"))\n webpage.addTextContent(element.ownText());\n\n //Get HTML tag name\n String tag = Utils.removeLineBreaks(element.tagName().toLowerCase());\n\n //Add tag occurrence to the total of this page\n if (webpage.hasElement(tag))\n webpage.incrementElement(tag);\n else\n webpage.addElement(tag);\n\n //Process attributes for this element\n if (element.attributes().size() > 0) {\n webpage = processElementAttributes(webpage, element, tag);\n }\n\n //Process hyperlinks\n if (tag.equals(\"a\") || tag.equals(\"area\"))\n webpage = processHyperlinks(webpage, element);\n\n //Process images\n if (tag.equals(\"img\"))\n webpage = processImages(webpage, element);\n }\n\n return false;\n }", "public void testBlogEntryHasTagsAndMediaIsHtml() throws Exception {\n Category category = new Category(\"/java\", \"Java\");\n category.setBlog(blog);\n category.setTags(\"java\");\n blogEntry.addCategory(category);\n blogEntry.setExcerpt(\"Excerpt - here is some text\");\n blogEntry.setBody(\"Body - here is some text\");\n blogEntry.setTags(\"junit, automated unit testing\");\n context.setMedia(ContentDecoratorContext.HTML_PAGE);\n decorator.decorate(context, blogEntry);\n\n StringBuffer tags = new StringBuffer();\n tags.append(\"<div class=\\\"tags\\\"><span>Technorati Tags : </span>\");\n tags.append(\"<a href=\\\"http://technorati.com/tag/automatedunittesting\\\" target=\\\"_blank\\\" rel=\\\"tag\\\">automatedunittesting</a>, \");\n tags.append(\"<a href=\\\"http://technorati.com/tag/java\\\" target=\\\"_blank\\\" rel=\\\"tag\\\">java</a>, \");\n tags.append(\"<a href=\\\"http://technorati.com/tag/junit\\\" target=\\\"_blank\\\" rel=\\\"tag\\\">junit</a>\");\n tags.append(\"</div>\");\n\n assertEquals(\"Excerpt - here is some text\" + tags, blogEntry.getExcerpt());\n assertEquals(\"Body - here is some text\" + tags, blogEntry.getBody());\n }", "private String parseContent(final Object object) {\n if (object instanceof String) {\n return (String) object;\n } else if (object instanceof Element) {\n final Element element = (Element) object;\n return element.getTextContent();\n }\n return null;\n }", "public abstract void parse() throws IOException;", "public abstract T parseFSMeta(T river, Map<String, Object> content);", "public Map<String,WikiArticle> parse() throws Exception {\n \n DocumentBuilder dB = DocumentBuilderFactory.newInstance().newDocumentBuilder();\n \n Document doc = dB.parse(xmlFile);\n \n \n NodeList allPages = doc.getElementsByTagName(\"page\");\n \n for (int i = 0; i < allPages.getLength(); i++) {\n\n WikiArticle e = new WikiArticle();\n \n Node page = allPages.item(i);\n \n NodeList pageAttribs = page.getChildNodes();\n \n for (int j = 0; j < pageAttribs.getLength(); j++) {\n \n Node pageAttr = pageAttribs.item(j);\n String attrName = pageAttr.getNodeName();\n String attrValue = pageAttr.getTextContent();\n \n if (attrName.equals(\"id\")) {\n \n e.setId(attrValue);\n }\n \n if (attrName.equals(\"title\")) {\n \n e.setTitle(attrValue);\n }\n \n if (attrName.equals(\"revision\")) {\n \n NodeList revAttribs = pageAttr.getChildNodes();\n \n for (int k = 0; k < revAttribs.getLength(); k++) {\n \n Node revAttr = revAttribs.item(k);\n String revAttrName = revAttr.getNodeName();\n String revAttrVal = revAttr.getTextContent();\n \n if (revAttrName.equals(\"text\")) {\n \n e.setText(revAttrVal);\n } \n }\n }\n }\n \n if (!e.isEmpty()) {\n \n String eTitle = e.parseTitle();\n e.parseLinks();\n \n //TODO: Test\n //e.parseProps();\n \n this.entries.put(eTitle, e);\n }\n }\n \n return entries;\n \n }", "public List<LinkDetails> scrapeRSSPageForLinks(String rssUrl) {\n\t\tString description = \"\";\n\t\tString title = \"\";\n\t\tString link = \"\";\n\t\tString pubdate = \"\";\n\t\tURL url;\n\t\tInputStream in;\n\n\t\tList<LinkDetails> rssProcessedData = new ArrayList<LinkDetails>();\n\n\t\ttry {\n\t\t\turl = new URL(rssUrl);\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\ttry {\n\t\t\tin = url.openStream();\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\t// create XML input factory\n\t\tXMLInputFactory inputFactory = XMLInputFactory.newInstance();\n\n\t\t// read the XML document\n\t\ttry {\n\n\t\t\tXMLEventReader eventReader = inputFactory.createXMLEventReader(in);\n\n\t\t\tboolean isFeedHeader = true;\n\t\t\twhile (eventReader.hasNext()) {\n\t\t\t\tXMLEvent event = eventReader.nextEvent();\n\t\t\t\tif (event.isStartElement()) {\n\t\t\t\t\tString localPart = event.asStartElement().getName().getLocalPart();\n\n\t\t\t\t\t// System.out.println(localPart);\n\n\t\t\t\t\tswitch (localPart) {\n\n\t\t\t\t\tcase \"item\":\n\t\t\t\t\t\t// if (isFeedHeader) {\n\t\t\t\t\t\t// isFeedHeader = false;\n\t\t\t\t\t\t// System.out.println(\" title: \"+title+ \" description: \"+ description + \" link:\n\t\t\t\t\t\t// \"+link+\" pubDate: \"+pubdate);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\ttitle = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"title: \"+title);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"description\":\n\t\t\t\t\t\tdescription = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"description: \"+description);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\tlink = getCharacterData(event, eventReader);\n\t\t\t\t\t\tSystem.out.println(\"link: \" + link);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pubDate\":\n\t\t\t\t\t\tpubdate = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"pubDate: \"+pubdate);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t} else if (event.isEndElement()) {\n\t\t\t\t\tif (event.asEndElement().getName().getLocalPart() == (\"item\")) {\n\n\t\t\t\t\t\tLinkDetails linkDetails = new LinkDetails(link, title, description, pubdate);\n\t\t\t\t\t\trssProcessedData.add(linkDetails);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (XMLStreamException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\treturn rssProcessedData;\n\t}", "ReleaseFile parse( InputStream is ) throws IOException;", "void visit(Entry entry);", "public final void entryRuleReadElement() throws RecognitionException {\n try {\n // InternalBrowser.g:679:1: ( ruleReadElement EOF )\n // InternalBrowser.g:680:1: ruleReadElement EOF\n {\n before(grammarAccess.getReadElementRule()); \n pushFollow(FOLLOW_1);\n ruleReadElement();\n\n state._fsp--;\n\n after(grammarAccess.getReadElementRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "@Override\n\tpublic void parse() throws IOException {\n\t}", "public void testBlogEntryHasTagsAndMediaIsNewsfeed() throws Exception {\n Category category = new Category(\"/java\", \"Java\");\n category.setBlog(blog);\n category.setTags(\"java\");\n blogEntry.addCategory(category);\n blogEntry.setExcerpt(\"Excerpt - here is some text\");\n blogEntry.setBody(\"Body - here is some text\");\n blogEntry.setTags(\"junit, automated unit testing\");\n context.setMedia(ContentDecoratorContext.NEWS_FEED);\n decorator.decorate(context, blogEntry);\n\n StringBuffer tags = new StringBuffer();\n// tags.append(\"<!--<div class=\\\"tags\\\">Tags : \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/automated+unit+testing\\\" rel=\\\"tag\\\">automated unit testing</a>, \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/junit\\\" rel=\\\"tag\\\">junit</a>, \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/java\\\" rel=\\\"tag\\\">java</a>\");\n// tags.append(\"</div>-->\");\n\n assertEquals(\"Excerpt - here is some text\" + tags, blogEntry.getExcerpt());\n assertEquals(\"Body - here is some text\" + tags, blogEntry.getBody());\n }", "public abstract List<EXIFContent> parse();", "private void getArticles() throws Exception {\n\t\t\tHttpClient httpClient = new DefaultHttpClient();\n\n\t\t\tStringBuilder uriBuilder = new StringBuilder(BASE_URL);\n\t\t\turiBuilder.append(mURL);\n\n\t\t\tHttpGet request = new HttpGet(uriBuilder.toString());\n\t\t\tHttpResponse response = httpClient.execute(request);\n\n\t\t\tint status = response.getStatusLine().getStatusCode();\n\n\t\t\tif (status != HttpStatus.SC_OK) {\n\n\t\t\t\t// Log whatever the server returns in the response body.\n\t\t\t\tByteArrayOutputStream ostream = new ByteArrayOutputStream();\n\n\t\t\t\tresponse.getEntity().writeTo(ostream);\n\t\t\t\tmHandler.sendEmptyMessage(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tInputStream content = response.getEntity().getContent();\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(content));\n\t\t\tStringBuilder result = new StringBuilder();\n\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tresult.append(line);\n\t\t\t}\n\n\t\t\t// Clean up and close connection.\n\t\t\tcontent.close();\n\n\t\t\tString html = result.toString();\n\t\t\t//This is our regex to match each article\n\t\t\t//This website's html is not xml compatible so regex is next best thing\n\t\t\tPattern p = Pattern.compile(\"<td class=\\\"title\\\"><a href=\\\"(.*?)\\\".*?>(.*?)<\\\\/a>(<span class=\\\"comhead\\\">(.*?)<\\\\/span>)?.*?<\\\\/td><\\\\/tr><tr><td colspan=2><\\\\/td><td class=\\\"subtext\\\">.*? by <a href=\\\"user\\\\?.*?\\\">(.*?)<\\\\/a>.*?<a href=\\\"item\\\\?id=(.*?)\\\">\");\n\t\t\tMatcher m = p.matcher(html);\n\t\t\tList<Article> articles = new ArrayList<Article>();\n\t\t\twhile(m.find()) {\n\t\t\t\tString url = m.group(1);\n\t\t\t\tString title = m.group(2);\n\t\t\t\tString domain = m.group(4);\n\t\t\t\tString author = m.group(5);\n\t\t\t\tString discussionID = m.group(6);\n\t\t\t\tArticle eachArticle = new Article(title, domain, url, author, discussionID);\n\t\t\t\tarticles.add(eachArticle); \n\t\t\t}\n\n\t\t\tMessage msg = mHandler.obtainMessage();\n\t\t\tBundle bundle = new Bundle();\n\t\t\tbundle.putParcelableArrayList(\"articles\", (ArrayList<? extends Parcelable>) articles);\n\t\t\tmsg.setData(bundle);\n\t\t\tmHandler.sendMessage(msg);\n\t\t}", "String getContents();", "public void fillEntry(BlogEntry entry) {\n\t\tif(this.id.isEmpty()) {\n\t\t\tentry.setId(null);\n\t\t} else {\n\t\t\tentry.setId(Long.valueOf(this.id));\n\t\t}\n\t\t\n\t\tentry.setLastModifiedAt(new Date());\n\t\tentry.setTitle(this.title);\n\t\tentry.setText(this.text);\n\t}", "private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n\t String result = \"\";\n\t if (parser.next() == XmlPullParser.TEXT) {\n\t result = parser.getText();\n\t parser.nextTag();\n\t }\n\t return result;\n\t }", "private String readSummary(XmlPullParser parser) throws IOException, XmlPullParserException {\n\t parser.require(XmlPullParser.START_TAG, ns, \"summary\");\n\t String summary = readText(parser);\n\t parser.require(XmlPullParser.END_TAG, ns, \"summary\");\n\t return summary;\n\t }", "protected String parse(InputStream is, Metadata metadata) throws IOException, SAXException, TikaException \n\t{\n\t\tParseContext context = new ParseContext();\n\t\tParser parser = new AutoDetectParser();\n\t\tcontext.set(Parser.class, parser);\n\t\tContentHandler handler = new BodyContentHandler(-1);\n\t\tparser.parse(is, handler, metadata, context);\n\t\treturn handler.toString();\n\t}", "private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "private void parseTag(Node node, ContentValues values, String table, String id) {\n\n String name = \"\";\n String value = node.getTextContent();\n\n if (value == null) {\n value = \"\";\n }\n\n NamedNodeMap attributes = node.getAttributes();\n\n switch (node.getNodeName()) {\n\n /*\n * Parents\n */\n case \"context\":\n if (table.equals(Tasks.TABLE_NAME)) {\n name = Tasks.COLUMN_CONTEXT;\n Node attr = attributes.getNamedItem(\"idref\");\n if (attr != null) {\n value = attr.getTextContent();\n }\n break;\n }\n // else, fall through to adding a parent ID\n\n case \"folder\":\n case \"task\":\n name = DatabaseContract.Entries.COLUMN_PARENT_ID;\n Node attr = attributes.getNamedItem(\"idref\");\n if (attr != null) {\n value = attr.getTextContent();\n }\n break;\n\n /*\n * Base\n */\n case \"added\":\n name = Base.COLUMN_DATE_ADDED;\n break;\n\n case \"modified\":\n name = Base.COLUMN_DATE_MODIFIED;\n break;\n\n /*\n * Entry\n */\n case \"name\":\n name = DatabaseContract.Entries.COLUMN_NAME;\n\n if (table.equals(Attachments.TABLE_NAME)) {\n\n // Save file path as well\n\n File file = new File(androidContext.getFilesDir(), \"data/\" + id + \"/\" + value);\n if (file.exists()) {\n values.put(Attachments.COLUMN_PATH, file.getPath());\n }\n }\n\n break;\n\n case \"rank\":\n name = DatabaseContract.Entries.COLUMN_RANK;\n break;\n\n /*\n * Attachment\n */\n case \"preview-image\":\n name = Attachments.COLUMN_PNG_PREVIEW;\n break;\n\n /*\n * Context\n */\n case \"location\":\n\n Node locationNameAttr = attributes.getNamedItem(\"name\");\n Node altitudeAttr = attributes.getNamedItem(\"altitude\");\n Node latitudeAttr = attributes.getNamedItem(\"latitude\");\n Node longitudeAttr = attributes.getNamedItem(\"longitude\");\n Node radiusAttr = attributes.getNamedItem(\"radius\");\n\n String locationName = \"\", altitude = \"\", latitude = \"\", longitude = \"\", radius = \"\";\n\n if (locationNameAttr != null) {\n locationName = locationNameAttr.getTextContent();\n }\n\n if (altitudeAttr != null) {\n altitude = altitudeAttr.getTextContent();\n }\n\n if (latitudeAttr != null) {\n latitude = latitudeAttr.getTextContent();\n }\n\n if (longitudeAttr != null) {\n longitude = longitudeAttr.getTextContent();\n }\n\n if (radiusAttr != null) {\n radius = radiusAttr.getTextContent();\n }\n\n values.put(Contexts.COLUMN_LOCATION_NAME, locationName);\n values.put(Contexts.COLUMN_ALTITUDE, altitude);\n values.put(Contexts.COLUMN_LATITUDE, latitude);\n values.put(Contexts.COLUMN_LONGITUDE, longitude);\n values.put(Contexts.COLUMN_RADIUS, radius);\n break;\n\n case \"prohibits-next-action\":\n name = Contexts.COLUMN_ON_HOLD;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n /*\n * Perspectives/Settings\n */\n case \"plist\":\n if (table.equals(Perspectives.TABLE_NAME)) {\n\n // Parse as perspective\n\n name = Perspectives.COLUMN_VALUE;\n\n try {\n byte[] tagBytes = stringOf(node).getBytes();\n\n NSDictionary plist =\n (NSDictionary) PropertyListParser.parse(tagBytes);\n NSDictionary viewState = (NSDictionary) plist.get(\"viewState\");\n NSDictionary viewModeState = (NSDictionary) viewState.get(\"viewModeState\");\n String viewMode =\n ((NSString) viewState.get(\"viewMode\")).getContent();\n NSDictionary data = (NSDictionary) viewModeState.get(viewMode);\n\n String perspectiveName = ((NSString) plist.get(\"name\")).getContent();\n String icon =\n ((NSString) plist.get(\"iconNameInBundle\")).getContent();\n String group = ((NSString) data.get(\"collation\")).getContent();\n String sort = ((NSString) data.get(\"sort\")).getContent();\n\n // These three fields could be null, so check for that\n\n NSString filterDurationData = ((NSString) data.get(\"actionDurationFilter\"));\n NSString filterFlaggedData = ((NSString) data.get(\"actionFlaggedFilter\"));\n NSString filterStatusData =\n ((NSString) data.get(\"actionCompletionFilter\"));\n\n if (filterDurationData != null) {\n String filterDuration = filterDurationData.getContent();\n values.put(Perspectives.COLUMN_FILTER_DURATION, filterDuration);\n }\n\n if (filterFlaggedData != null) {\n String filterFlagged = filterFlaggedData.getContent();\n values.put(Perspectives.COLUMN_FILTER_FLAGGED, filterFlagged);\n }\n\n if (filterStatusData != null) {\n String filterStatus = filterStatusData.getContent();\n values.put(Perspectives.COLUMN_FILTER_STATUS, filterStatus);\n }\n\n values.put(Perspectives.COLUMN_NAME, perspectiveName);\n values.put(Perspectives.COLUMN_ICON, icon);\n values.put(Perspectives.COLUMN_VIEW_MODE, viewMode);\n values.put(Perspectives.COLUMN_GROUP, group);\n values.put(Perspectives.COLUMN_SORT, sort);\n } catch (IOException | ParseException | SAXException | ParserConfigurationException e) {\n Log.e(TAG, \"Error parsing perspective\", e);\n } catch (PropertyListFormatException e) {\n Log.e(TAG, \"Plist is malformed\", e);\n }\n } else if (table.equals(Settings.TABLE_NAME)) {\n\n // Parse as setting\n // Note that all the other settings pretty much read in fine as strings\n\n name = Settings.COLUMN_VALUE;\n\n try {\n byte[] tagBytes = stringOf(node).getBytes();\n\n switch (id) {\n case \"cPIrzdPU37-\": // No idea\n case \"PerspectiveOrder_v2\": // Perspective order\n\n NSObject[] array = ((NSArray) PropertyListParser.parse(tagBytes)).getArray();\n value = \"\";\n\n for (int i = 0; i < array.length; i++) {\n\n // Get the value of the string from the NSObject\n value += ((NSString) array[i]).getContent();\n\n // Add a comma delimeter, unless this is the last in the array\n if (i < array.length - 1) {\n value += \",\";\n }\n }\n\n break;\n case \"DueSoonInterval\":\n\n // Convert the number of seconds into a Duration object\n // which we can use to get a proper ISO duration\n\n value = Duration.ofSeconds(Long.valueOf(value)).toString();\n }\n } catch (IOException | ParseException | SAXException | ParserConfigurationException e) {\n Log.e(TAG, \"Error parsing setting\", e);\n } catch (PropertyListFormatException e) {\n Log.e(TAG, \"Plist is malformed\", e);\n }\n }\n\n break;\n\n /*\n * Tasks\n */\n case \"order\":\n\n // The task type is a tricky one, because it can be either 'sequential',\n // 'parallel' or 'single action', but 'single action' is only applicable\n // to projects and comes from a different tag (see \"singleton\" below).\n // As the \"singleton\" tag will always come first, we can test to see if\n // we've already added the 'type' column, and only proceed if we haven't.\n\n if (!values.containsKey(Tasks.COLUMN_TYPE)) {\n name = Tasks.COLUMN_TYPE;\n }\n break;\n\n case \"completed-by-children\":\n name = Tasks.COLUMN_COMPLETE_WITH_CHILDREN;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n case \"start\":\n name = Tasks.COLUMN_DATE_DEFER;\n break;\n\n case \"due\":\n name = Tasks.COLUMN_DATE_DUE;\n break;\n\n case \"completed\":\n name = Tasks.COLUMN_DATE_COMPLETED;\n break;\n\n case \"estimated-minutes\":\n name = Tasks.COLUMN_ESTIMATED_TIME;\n if (!value.isEmpty()) {\n value = Duration.ofMinutes(Long.valueOf(value)).toString();\n }\n break;\n\n case \"flagged\":\n name = Tasks.COLUMN_FLAGGED;\n value = value.equals(\"true\") ? \"1\" : \"0\";\n break;\n\n case \"inbox\":\n name = Tasks.COLUMN_INBOX;\n value = value.equals(\"false\") ? \"0\" : \"1\";\n break;\n\n case \"note\":\n if (table.equals(Tasks.TABLE_NAME) && node.hasChildNodes()) {\n name = Tasks.COLUMN_NOTE_XML;\n value = stringOf(node);\n }\n break;\n\n case \"repetition-rule\":\n name = Tasks.COLUMN_REPETITION_RULE;\n break;\n\n case \"repetition-method\":\n name = Tasks.COLUMN_REPETITION_METHOD;\n break;\n\n /*\n * Projects\n */\n case \"project\":\n if (node.hasChildNodes()) {\n name = Tasks.COLUMN_PROJECT;\n value = \"1\";\n }\n\n // GO DEEPER\n\n NodeList children = node.getChildNodes();\n\n for (int i = 0; i < children.getLength(); i++) {\n\n Node child = children.item(i);\n\n parseTag(child, values, table, id);\n }\n\n break;\n\n case \"singleton\":\n if (value.equals(\"true\")) {\n name = Tasks.COLUMN_TYPE;\n value = \"single action\";\n }\n break;\n\n case \"last-review\":\n name = Tasks.COLUMN_PROJECT_LAST_REVIEW;\n break;\n\n case \"next-review\":\n name = Tasks.COLUMN_PROJECT_NEXT_REVIEW;\n break;\n\n case \"review-interval\":\n name = Tasks.COLUMN_PROJECT_REPEAT_REVIEW;\n break;\n\n case \"status\":\n name = Tasks.COLUMN_PROJECT_STATUS;\n break;\n }\n\n if (!name.isEmpty() && !value.isEmpty()) {\n values.put(name, value);\n }\n }", "void read(XmlPullParser xmlPullParser) throws IOException, XmlPullParserException;", "private void handleIntent(Intent intent) {\n if(intent == null){\n Toast.makeText(this, \"intent is null handleIntent \", Toast.LENGTH_SHORT).show();\n return;\n }\n String action = intent.getAction();\n\n if(nfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)){\n String type = intent.getType();\n if(MIME_TEXT_PLAIN.equals(type)){\n Tag tag = intent.getParcelableExtra(EXTRA_TAG);\n\n nfcReaderTask = new NfcReaderTask();\n nfcReaderTask.SetResponseListener(this);\n nfcReaderTask.execute(tag);\n }\n }\n }", "public void extract(List<? extends SuSiFile.Entry> in);", "public static void main(final String[] args) throws IOException, TikaException, SAXException {\n\t File file = new File(args[0]);\n\n Tika tika = new Tika();\n \n //detecting the file type using detect method\n String filetype = tika.detect(file);\n //System.out.println(filetype);\n \n //Parser method parameters\n //Parser parser = new AutoDetectParser();\n //Parser parser = new DcXMLParser();\n Parser parser = new Eml211Parser();\n \n BodyContentHandler handler = new BodyContentHandler();\n Metadata metadata = new Metadata();\n FileInputStream inputstream = new FileInputStream(file);\n ParseContext context = new ParseContext();\n \n parser.parse(inputstream, handler, metadata, context);\n \n //System.out.println(handler.toString());\n \n System.out.println(\"Extracting Metadata of the document: \");\n //getting the list of all meta data elements \n String[] metadataNames = metadata.names();\n \n for(String name : metadataNames) {\t\t \n System.out.println(name + \": \"+ metadata.get(name));\n } \n }", "Map<String, String> Read_File(XmlPullParser xmlPullParser, List<Tags_To_Read> tags, String account_Name) throws NullPointerException, XML_Reader_Exception;", "public void testExtractFromGoodContent() throws Exception {\n String url = \"http://web2.msue.msu.edu/Bulletins/Bulletin/PDF/Historical/finished_pubs/e49/index.html\";\n MockCachedUrl cu = new MockCachedUrl(url, msueau);\n cu.setContent(goodContent);\n cu.setContentSize(goodContent.length());\n cu.setProperty(CachedUrl.PROPERTY_CONTENT_TYPE, \"text/html\");\n FileMetadataExtractor me = \n new MichiganStateUniversityExtensionHtmlMetadataExtractorFactory.MichiganStateUniversityExtensionHtmlMetadataExtractor();\n FileMetadataListExtractor mle = new FileMetadataListExtractor(me);\n List<ArticleMetadata> mdlist = mle.extract(MetadataTarget.Any, cu);\n assertNotEmpty(mdlist);\n ArticleMetadata md = mdlist.get(0);\n assertNotNull(md);\n assertEquals(Arrays.asList(goodAuthors), md.getList(MetadataField.FIELD_AUTHOR));\n assertEquals(goodArticleTitle, md.get(MetadataField.FIELD_ARTICLE_TITLE));\n assertEquals(goodJournalTitle, md.get(MetadataField.FIELD_JOURNAL_TITLE));\n assertEquals(goodDate, md.get(MetadataField.FIELD_DATE));\n assertEquals(goodPdfUrl, md.get(MetadataField.FIELD_ACCESS_URL));\n md = mdlist.get(4);\n assertEquals(goodRenamedArticleTitle, md.get(MetadataField.FIELD_ARTICLE_TITLE));\n }", "private void extractRemainingMetadata(ArticleMetadata thisAM,\n CachedUrl mdCu) {\n\n // Which top node is appropriate for this specific dtd\n String top_node = null;\n String dtdString = thisAM.getRaw(ElsevierDTD5XmlSchemaHelper.dataset_dtd_metadata);\n Matcher mat = DTD_PATTERN.matcher(dtdString);\n if (mat.matches() && JOURNAL_ARTICLE.equals(mat.group(1))) {\n top_node = JASchemaMap.get(mat.group(3));\n }\n //String top_node = SchemaMap.get(dtdString);\n if (top_node == null) {\n log.siteWarning(\"Unknown type of Elsevier DTD provided for article\" + dtdString);\n return; // we can't extract article level metadata (author & title)\n }\n try {\n List<ArticleMetadata> amList = \n new XPathXmlMetadataParser(null, \n top_node,\n ElsevierDTD5XmlSchemaHelper.articleLevelMDMap,\n false).extractMetadata(MetadataTarget.Any(), mdCu);\n /*\n * There should only be ONE top_node per main.xml; don't verify\n * but just access first one.\n */\n if (amList.size() > 0) {\n log.debug3(\"found article level metadata...\");\n ArticleMetadata oneAM = amList.get(0);\n String rawVal = oneAM.getRaw(ElsevierDTD5XmlSchemaHelper.common_title);\n if (rawVal != null) {\n thisAM.putRaw(ElsevierDTD5XmlSchemaHelper.common_title, rawVal);\n } else {\n // a simple-article might use document heading, like \"Book Review\" as title\n rawVal = oneAM.getRaw(ElsevierDTD5XmlSchemaHelper.common_dochead);\n if (rawVal != null) {\n // store it in the title anyway, it only exists if title doesn't\n thisAM.putRaw(ElsevierDTD5XmlSchemaHelper.common_title, rawVal);\n }\n }\n rawVal = oneAM.getRaw(ElsevierDTD5XmlSchemaHelper.common_author_group);\n if ( rawVal != null) {\n thisAM.putRaw(ElsevierDTD5XmlSchemaHelper.common_author_group, rawVal);\n }\n } else {\n log.debug3(\"no md extracted from \" + mdCu.getUrl());\n }\n } catch (XPathExpressionException e) {\n log.debug3(\"Xpath expression exception:\",e); // this is a note to the PLUGIN writer!\n } catch (IOException e) {\n // We going to keep going and just not extract from this file\n log.siteWarning(\"IO exception loading article level XML file\", e);\n } catch (SAXException e) {\n // We going to keep going and just not extract from this file\n log.siteWarning(\"SAX exception loading article level XML file\", e);\n } \n }", "private Object onParse(final String content) throws IOException{\n if(null == this.mBean)\n return null;\n\n try{\n return JSON.parseObject(content, this.mBean);\n }catch(Exception e){\n throw new IOException(e.getMessage());\n }\n }", "public void unmarshall(Element text)\n throws UnmarshallException\n {\n if( ! isInstanceOf(text, localName, Namespaces.NS_ATOM))\n {\n throw new UnmarshallException( \"Not a \" + getQualifiedName() + \" element\" );\n }\n try\n\t {\n // get the attributes\n int attributeCount = text.getAttributeCount();\n Attribute attribute = null; \n for( int i = 0; i < attributeCount; i++ )\n {\n attribute = text.getAttribute(i);\n if( \"type\".equals(attribute.getQualifiedName()))\n {\n String value = attribute.getValue();\n if( ContentType.TEXT.toString().equals(value) )\n {\n type = ContentType.TEXT;\n }\n else if( ContentType.HTML.toString().equals(value) )\n {\n type = ContentType.HTML;\n }\n else if( ContentType.XHTML.toString().equals(value) )\n {\n type = ContentType.XHTML;\n }\n else\n {\n InfoLogger.getLogger().writeError(\"Unable to parse extract type in \" + getQualifiedName() );\n // FIXME - check error handling here\n }\n }\n }\n \n\t\t // retrieve all of the sub-elements\n\t\t int length = text.getChildCount();\n if( length > 0 )\n {\n content = unmarshallString(text);\n }\n // FIXME - the above only handles plain text content. \n\t }\n\t catch( Exception ex )\n\t {\n\t\t InfoLogger.getLogger().writeError(\"Unable to parse an element in \" + getQualifiedName() + \": \" + ex.getMessage());\n\t throw new UnmarshallException(\"Unable to parse an element in \" + getQualifiedName(), ex);\n\t }\n }", "private boolean extractArticleFromUrl(URL url) {\n\n\t\tif (!mDBh.urlExistsInWebsite(url)) {\n\t\t\tString content = null;\n\n\t\t\t//REMEMBER TO: when switching content format text <-> HTML, change the textType in SIMMO Document\n\n\t\t\t//Extract the content as plain text\n//\t\t\ttry {\n//\t\t\t\tfinal InputSource is = HTMLFetcher.fetch(url).toInputSource();\n//\t\t\t\tfinal BoilerpipeSAXInput in;\n//\t\t\t\tin = new BoilerpipeSAXInput(is);\n//\t\t\t\tfinal TextDocument doc = in.getTextDocument();\n//\t\t\t\tcontent = ArticleExtractor.INSTANCE.getText(doc);\n//\t\t\t} catch (SAXException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() SAXException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t} catch (BoilerpipeProcessingException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() BoilerpipeProcessingException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t} catch (IOException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() IOException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t}\n\n\t\t\t//extract the content as HTML\n\t\t\tfinal BoilerpipeExtractor extractor = CommonExtractors.DEFAULT_EXTRACTOR;\n\t\t\tfinal HTMLHighlighter hh = HTMLHighlighter.newExtractingInstance();\n\t\t\ttry {\n\t\t\t\tcontent = hh.process(url, extractor);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() IOException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t} catch (BoilerpipeProcessingException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() BoilerpipeProcessingException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t} catch (SAXException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() SAXException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\t//checking if website already exist\n\n\t\t\t//Storing content in Simmo\n\t\t\t//Create a Simmo Webpage\n\t\t\tWebpage wp = new Webpage();\n\t\t\twp.setUrl(url.toString());\n\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\twp.setCreationDate(cal.getTime());\n\n\t\t\t//Create a Simmo Text\n\t\t\tText txt = new Text();\n\t\t\ttxt.setContent(content);\n\t\t\ttxt.setTextType(Text.TEXT_TYPE.HTML);\n//\t\t\ttxt.setTextType(Text.TEXT_TYPE.TXT);\n\n\t\t\t//Add Text to Webpage\n\t\t\twp.addItem(txt);\n\n\t\t\t//Store Webpage to db\n\t\t\tDAOManager manager = new DAOManager(MongoDBHandler.getTrgDBName());\n\t\t\tmanager.saveWebpage(wp);\n\n\n\t\t\t//Politeness policy of one second.\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000); //1000 milliseconds is one second.\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t//Thread.currentThread().interrupt();\n\t\t\t\tSystem.out.println(\"Could not make the thread sleep\");\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\tSystem.out.println(\"Already exist in database: \" + url.toString());\n\t\treturn false;\n\t}", "private String readFile(String fileName) {\n//Initialize\nString line = null;\nString allContent = \"\";\nBufferedReader fileReader = null;\n \nwhile (true) {\ntry {\nfileReader = new BufferedReader (new FileReader (fileName));\n \n//Replace tags with indicated content\nwhile((line = fileReader.readLine()) != null) {\nline = replaceTags(line);\nallContent += line;\n}\n} catch (Exception e) {\nSystem.err.println(\"Read error: \"+e);\nbreak;\n//Close BufferedReader if initialized\n}//end catch\nbreak;\n}//end while loop\n \nfileReadSuccessful = true;\nreturn allContent;\n}", "public void parse(InputStream in) throws XmlPullParserException, IOException {\n try {\n XmlPullParser parser = Xml.newPullParser();\n\n parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);\n parser.setInput(in, null);\n readFeed(parser);\n\n } finally {\n in.close();\n }\n }", "@Override\n\tprotected void doParse(String path, boolean isImport) throws IOException, OBOParseException {\n\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\tDefaultHandler handler = new OBOContentHandler();\n\t\ttry {\n\n\t\t\t// Parse the input\n\t\t\tSAXParser saxParser = factory.newSAXParser();\n\t\t\tsaxParser.parse(path, handler);\n\n\t\t} catch (Throwable t) {\n\t\t\tt.printStackTrace();\n\t\t}\n\t}", "private static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "@Override\n\tpublic String getElementAt(int index) {\n\t\tif (index < contents.length)\n\t\t\treturn contents[index++];\n\t\telse\n\t\t\treturn null;\n\t}", "private static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\r\n String result = \"\";\r\n if (parser.next() == XmlPullParser.TEXT) {\r\n result = parser.getText();\r\n parser.nextTag();\r\n }\r\n return result;\r\n }", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "private void readItems() {\n }", "private void read(String key, boolean dumpContent, boolean dumpHeaders,\n boolean dumpLinks, boolean dumpText) throws ClassNotFoundException, IOException, Exception {\n DataStore<String, WebPage> datastore = StorageUtils.createStore(getConf(),\n String.class, WebPage.class);\n\n Query<String, WebPage> query = datastore.newQuery();\n String reversedUrl = key;\n query.setKey(reversedUrl);\n\n Result<String, WebPage> result = datastore.execute(query);\n boolean found = false;\n // should happen only once\n while (result.next()) {\n try {\n WebPage page = result.get();\n String skey = result.getKey();\n // we should not get to this point but nevermind\n if (page == null || skey == null)\n break;\n found = true;\n String url = page.getUrl();\n System.out.println(getPageRepresentation(url, page, dumpContent,\n dumpHeaders, dumpLinks, dumpText));\n }catch (Exception e) {\n e.printStackTrace();\n }\n }\n if (!found)\n System.out.println(key + \" not found\");\n result.close();\n datastore.close();\n }", "public static TagEntrySummary fromEntries(List<TagEntry> entries) {\n\t\tTagEntrySummary summary = new TagEntrySummary();\n\t\tfor (TagEntry tag : entries) {\n\t\t\tsummary.countTags++;\n\t\t\tif (tag.getMatchingTagEntry() != null && tag.getScore() > 0) { // only count it if it has points\n\t\t\t\tsummary.countMatchingTags++;\n\t\t\t\tif (tag.isPioneer()) {\n\t\t\t\t\tsummary.countPioneerTags++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString t = tag.getDictionary();\n\t\t\tif (t != null) {\n\t\t\t\tsummary.countDictionaryMatches++;\n\n\t\t\t\tif (t.equals(\"events\")){\n\t\t\t\t\tsummary.countEventMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"fictional-location\")){\n\t\t\t\t\tsummary.countFicLocMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"real-location\")){\n\t\t\t\t\tsummary.countRealLocMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"fictional-person\")){\n\t\t\t\t\tsummary.countFicPerMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"real-person\")){\n\t\t\t\t\tsummary.countRealPerMatches++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (t == null && tag.getMatchingTagEntry() == null) {\n\t\t\t\tsummary.countEmptyTags++;\n\t\t\t}\n\t\t}\n\t\treturn summary;\n\t}", "@Override\n\tpublic void visit(Page page) {\n\t\t\n\t\ttry{\n\t\t\tfin=\"\";\n\t\t\tif(flag == 0){\n\t\t\t\tfw = new FileWriter(wrtFile);\n\t\t\t\tfw1 = new FileWriter(wrtFile1);\n\t\t\t\tvisit_url = new HashSet<String>();\n\t\t\t\tall_txt = new HashSet<String>();\n\t\t\t\teng_sen = new ArrayList<String>();\n\t\t\t}\n\t\t\tflag++;\n\t\t\tsynchronized (this) {\n\t\t\t\tif(page.getParseData() instanceof HtmlParseData){\n\t\t\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\t\t\tString html = htmlParseData.getHtml();\n\t\t\t\t\tString url = page.getWebURL().getURL().toLowerCase();\n\t\t\t\t\t//System.out.println(\"VISIT: \"+ url);\n\t\t\t\t\t//System.out.println(\"HTML: \"+ html);\n\t\t\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\t\t\tdoc.removeClass(\"twitter-tweet\");\n\t\t\t\t\tElements links = doc.select(\"div\");\n\t\t\t\t\tIterator<Element> it = links.iterator();\n\t\t\t\t\t\n\t\t\t\t\tString text=\"\";\n\t\t\t\t\tElement link;\n\t\t\t\t\tElements children;\n\t\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\t\tlink = it.next();\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"desc\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"caption\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(text != \"\"){\n\t\t\t\t\t\tif(!visit_url.contains(url) && !all_txt.contains(text)){\n\t\t\t\t\t\t\tfin = text+\"\\n\";\n\t\t\t\t\t\t\tfin1 = url+\"\\n\";\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t\t//System.out.println(\"URL: \"+ url);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile), fin.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile1), fin1.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tall_txt.add(text);\n\t\t\t\t\t\t\tvisit_url.add(url);\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}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n protected void readChildren(XMLStreamReader in) throws XMLStreamException {\n while (in.nextTag() != XMLStreamConstants.END_ELEMENT) {\n readChild(in);\n }\n }", "public void read() {\n new PostService(this.mContext).readLike(this.postId, this.next, this);\n }", "default boolean visitContent() {\n\t\treturn true;\n\t}", "private void readArticle(HttpServletRequest request, HttpServletResponse response, ArticleService artService) {\n\t\t\n\t}", "@Override\n\tpublic int describe(Reader contents, IContentDescription description) throws IOException {\n\t\treturn 0;\n\t}", "public final EObject ruleEntryEvent() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2125:28: ( ( () otherlv_1= 'entry' ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:1: ( () otherlv_1= 'entry' )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:1: ( () otherlv_1= 'entry' )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:2: () otherlv_1= 'entry'\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:2: ()\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2127:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getEntryEventAccess().getEntryEventAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,39,FOLLOW_39_in_ruleEntryEvent4737); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getEntryEventAccess().getEntryKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "@Test\n public void testNonEmptyExcerpt_read() throws IOException {\n {\n InputStream s = excerpt(makeDigits(), 7, 2);\n checkRead(s, '7');\n checkRead(s, '8');\n checkRead(s, EOF);\n }\n\n // an excerpt that extends past the underlying stream.\n {\n InputStream s = excerpt(makeDigits(), 8, 3);\n checkRead(s, '8');\n checkRead(s, '9');\n checkRead(s, EOF);\n checkRead(s, EOF);\n }\n }", "@Override\n public void endElement(String aUri, String aLocalName, String aName)\n throws SAXException\n {\n if (!inTextElement && TAG_TITLE.equals(aName)) {\n DocumentMetaData meta = DocumentMetaData.get(getJCas());\n // Read only the first title and hope it is the main title\n if (!titleSet) {\n meta.setDocumentTitle(getBuffer().toString().trim());\n titleSet = true;\n }\n meta.setDocumentId(documentId);\n getBuffer().setLength(0);\n captureText = false;\n }\n else if (TAG_TEXT.equals(aName)) {\n captureText = false;\n inTextElement = false;\n }\n else if (inTextElement && (TAG_SUNIT.equals(aName) ||\n (utterancesAsSentences && TAG_U.equals(aName)))) {\n if (readSentence) {\n Sentence s = new Sentence(getJCas(), sentenceStart, getBuffer().length());\n if (elementsToTrim.contains(aName)) {\n TrimUtils.trim(getBuffer(), s);\n }\n s.addToIndexes();\n }\n sentenceStart = -1;\n }\n else if (inTextElement && TAG_PARAGRAPH.equals(aName)) {\n if (readParagraph) {\n Paragraph para = new Paragraph(getJCas(), paragraphStart, getBuffer().length());\n if (elementsToTrim.contains(aName)) {\n TrimUtils.trim(getBuffer(), para);\n }\n para.addToIndexes();\n }\n paragraphStart = -1;\n }\n else if (readNamedEntity && inTextElement && TAG_RS.equals(aName)) {\n NamedEntity ne = namedEntities.pop();\n ne.setEnd(getBuffer().length());\n if (elementsToTrim.contains(aName)) {\n TrimUtils.trim(getBuffer(), ne);\n }\n ne.addToIndexes();\n }\n else if (readConstituent && inTextElement && TAG_PHRASE.equals(aName)) {\n ConstituentWrapper wrapper = constituents.pop();\n wrapper.constituent.setBegin(wrapper.children.get(0).getBegin());\n wrapper.constituent\n .setEnd(wrapper.children.get(wrapper.children.size() - 1).getEnd());\n if (!constituents.isEmpty()) {\n ConstituentWrapper parent = constituents.peek();\n wrapper.constituent.setParent(parent.constituent);\n parent.children.add(wrapper.constituent);\n }\n wrapper.constituent.setChildren(FSCollectionFactory.createFSArray(getJCas(),\n wrapper.children));\n wrapper.constituent.addToIndexes();\n \n // Close off the ROOT\n if (constituents.peek().constituent instanceof ROOT) {\n ConstituentWrapper rootWrapper = constituents.pop();\n rootWrapper.constituent.setBegin(wrapper.children.get(0).getBegin());\n rootWrapper.constituent\n .setEnd(wrapper.children.get(wrapper.children.size() - 1).getEnd());\n rootWrapper.constituent.setChildren(FSCollectionFactory.createFSArray(\n getJCas(), rootWrapper.children));\n rootWrapper.constituent.addToIndexes();\n }\n }\n else if (inTextElement\n && (TAG_WORD.equals(aName) || TAG_CHARACTER.equals(aName) || TAG_MULTIWORD\n .equals(aName))) {\n if (isNotBlank(getBuffer().substring(tokenStart, getBuffer().length()))) {\n Token token = new Token(getJCas(), tokenStart, getBuffer().length());\n \n if (elementsToTrim.contains(aName)) {\n TrimUtils.trim(getBuffer(), token);\n }\n \n if (posTag != null && readPOS) {\n Type posTagType = posMappingProvider.getTagType(posTag);\n POS pos = (POS) getJCas().getCas().createAnnotation(posTagType,\n token.getBegin(), token.getEnd());\n pos.setPosValue(posTag);\n POSUtils.assignCoarseValue(pos);\n pos.addToIndexes();\n token.setPos(pos);\n }\n\n if (lemma != null && readLemma) {\n Lemma l = new Lemma(getJCas(), token.getBegin(), token.getEnd());\n l.setValue(lemma);\n l.addToIndexes();\n token.setLemma(l);\n }\n\n // FIXME: if readToken is disabled, the JCas wrapper should not be generated\n // at all!\n if (readToken) {\n if (!constituents.isEmpty()) {\n ConstituentWrapper parent = constituents.peek();\n token.setParent(parent.constituent);\n parent.children.add(token);\n }\n \n token.addToIndexes();\n }\n }\n\n tokenStart = -1;\n }\n }", "public void parse() {\n }", "private void processContents(char[] input,\n int contentOffset,\n int contentSize,\n int contentLineNr)\n throws XMLParseException {\n int[] lineNr = new int[1];\n lineNr[0] = contentLineNr;\n\n if (!this.skipLeadingWhitespace) {\n String str = new String(input, contentOffset, contentSize);\n this.contents = this.decodeString(str, lineNr[0]);\n return;\n }\n\n StringBuffer result = new StringBuffer(contentSize);\n int end = contentSize + contentOffset;\n\n for (int i = contentOffset; i < end; i++) {\n char ch = input[i];\n\n // The end of the contents is always a < character, so there's\n // no danger for bounds violation\n while ((ch == '\\r') || (ch == '\\n')) {\n lineNr[0]++;\n result.append(ch);\n\n i++;\n ch = input[i];\n\n if (ch != '\\n') {\n result.append(ch);\n }\n\n do {\n i++;\n ch = input[i];\n } while ((ch == ' ') || (ch == '\\t'));\n }\n\n if (i < end) {\n result.append(ch);\n }\n }\n\n this.contents = this.decodeString(result.toString(), lineNr[0]);\n }" ]
[ "0.6167862", "0.57353157", "0.5678094", "0.5540308", "0.53899413", "0.530331", "0.52670544", "0.5260317", "0.524297", "0.5127693", "0.5030613", "0.5029715", "0.49812347", "0.49630463", "0.49595594", "0.4959523", "0.49524784", "0.49250296", "0.48774752", "0.48654342", "0.48654342", "0.486248", "0.4859292", "0.48253417", "0.48247203", "0.47860712", "0.47860235", "0.47551402", "0.47506785", "0.4723793", "0.4709681", "0.4708779", "0.46972537", "0.46946964", "0.46937746", "0.4686764", "0.46833012", "0.46827853", "0.46774492", "0.46634996", "0.46598655", "0.46566433", "0.46469212", "0.4638626", "0.46319488", "0.46271843", "0.4627164", "0.46230283", "0.4606555", "0.46015146", "0.4579818", "0.45729938", "0.4571529", "0.45666364", "0.4558643", "0.45555747", "0.45473996", "0.4545131", "0.45441416", "0.45324048", "0.45202234", "0.45195368", "0.45195368", "0.4517937", "0.45152944", "0.450387", "0.4500841", "0.44971952", "0.4495191", "0.4491064", "0.44876397", "0.44717064", "0.4469527", "0.44683132", "0.44629267", "0.44600332", "0.44583717", "0.44575837", "0.44407746", "0.4440469", "0.4439399", "0.4439399", "0.4439399", "0.4439399", "0.4439399", "0.4439399", "0.4436689", "0.44364855", "0.44326302", "0.44267574", "0.4426047", "0.44243714", "0.44181505", "0.44086286", "0.4405556", "0.4401598", "0.4399701", "0.43968144", "0.43959907", "0.43952355" ]
0.68942046
0
Processes title tags in the feed.
private String readTitle(XmlPullParser parser) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, ns, "title"); String title = readText(parser); parser.require(XmlPullParser.END_TAG, ns, "title"); return title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void prepareTitle()\n {\n DuelTitle title = new DuelTitle();\n addObject(title, 539, 186);\n }", "private void parseTitleField() {\n\t\tif (track.length() == 0) {\n\t\t\tString titleLC = title.toLowerCase();\n\t\t\tfor (Entry<String, String> entry : trackPrefixes.entrySet()) {\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tString value = entry.getValue();\n\t\t\t\tif (titleLC.startsWith(key)) {\n\t\t\t\t\ttrack = value;\n\t\t\t\t\ttitle = title.substring(key.length());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void getTitle(String title) {\n\t\t\r\n\t}", "private String readTitle(XmlPullParser parser) throws IOException,\n XmlPullParserException {\n parser.require(XmlPullParser.START_TAG, null, \"title\");\n String title = readText(parser);\n parser.require(XmlPullParser.END_TAG, null, \"title\");\n return title;\n }", "final String parseForTitle(String rawInput,String input, DataInputStream dis)\r\n {\r\n int i,j,k,l; \r\n\tint titleLength=0; // Keep track of title length as only first 25 characters are displayed.\r\n\tint start=0;\r\n\tString temp;\r\n\tStringBuffer title=new StringBuffer(\"\");\r\n\tboolean foundTag=false;\r\n\r\n\ttry\r\n\t{\r\n\t // Search for <TITLE> tag. Can the TITLE tag have spaces? e.g < TITLE > (assume not!)\r\n\t i=input.indexOf(\"<TITLE\");\r\n\t if(i!=-1)\r\n\t {\r\n\t // Allow for <HTML><HEAD><TITLE>Title</TITLE></HEAD>\r\n\t\tj=input.indexOf(\">\",i);\r\n\t\tif(j!=-1)\r\n\t\t{\r\n\t\t while(titleLength<=25 && foundTag==false)\r\n\t\t {\r\n\t\t start=j+1;\r\n\t\t\tfor(k=start;k<rawInput.length();k++)\r\n\t\t\t{\r\n\t\t\t if(foundTag==false && rawInput.charAt(k)!='<')\r\n\t\t\t {\r\n\t\t\t titleLength++;\r\n\t\t\t\ttitle.append(rawInput.charAt(k));\r\n\t\t\t }\r\n\t\t\t else foundTag=true;\r\n\t\t\t}\r\n\t\t\t// Continue reading from doc if </title> not found.\r\n\t\t\tif(foundTag==false)\r\n\t\t\t{\r\n\t\t\t rawInput=dis.readLine();\r\n\t\t\t j=-1;\r\n\t\t\t}\r\n\t\t }\r\n\t\t // Remove leading and trailing spaces.\r\n\t\t temp=title.toString();\r\n\t\t return(temp.trim());\r\n\t\t}\r\n\t }\r\n\t}\r\n\tcatch(IOException e){}\r\n\treturn (null); // No title found.\r\n }", "@Override\n\tpublic void setTitle(java.lang.String title) {\n\t\t_news_Blogs.setTitle(title);\n\t}", "protected void addTag(String title) {\n\t\tReaderDataBase.insertDataBase(this, title, mFilenameString,\n\t\t\t\tBookPageFactory.sPercent);\n\t}", "public void xsetTitle(com.a9.spec.opensearch.x11.QueryType.Title title)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.a9.spec.opensearch.x11.QueryType.Title target = null;\n target = (com.a9.spec.opensearch.x11.QueryType.Title)get_store().find_attribute_user(TITLE$2);\n if (target == null)\n {\n target = (com.a9.spec.opensearch.x11.QueryType.Title)get_store().add_attribute_user(TITLE$2);\n }\n target.set(title);\n }\n }", "@Override\r\n\tpublic void getTitle() {\n\t\t\r\n\t}", "private void setTitleMap(String title){\n if(title!=null && titleView.getVisibility() != View.GONE) {\n if (title.length() <= 50)\n titleView.setText(title);\n else\n titleView.setText(title.substring(0, 50));\n }\n }", "@Override\r\n\t\tpublic void setTitle(String title)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "public String findTitle(Text value) throws CharacterCodingException{\n\t\tint start = value.find(\"<title>\");\n\t\tint end = value.find(\"</title>\", start);\n\t\tstart+=7;\n\t\tString title = Text.decode(value.getBytes(), start, end-start);\n\t\t//if(title.contains(\":\") || title.contains(\"#\") || title.contains(\"/\") )\n\t\t\t//return null;\n\t\t//else\n\t\t\treturn title.replace(\" \", \"_\");\n\t}", "private String cleanTitle(String title) {\r\n return title.replace(\"<![CDATA[\", \"\").replace(\"]]>\", \"\");\r\n }", "@Element \n public void setTitle(String title) {\n this.title = title;\n }", "@Override\n\tpublic void setTitle(String title) {\n\t\t\n\t}", "protected String computeTitle() {\r\n\t\treturn getRawTitle();\r\n\t}", "private String getTitle(String title, String url) {\n if (TextUtils.isEmpty(title) || TextUtils.getTrimmedLength(title) == 0) {\n title = UrlUtils.stripUrl(url);\n }\n return title;\n }", "public void setTitle(java.lang.Object title) {\n this.title = title;\n }", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "protected String getChapterTitleBlock( String title )\n {\n return \"<title>\" + title + \"</title>\";\n }", "protected void setTitle(String title) {\n this.title = title;\n }", "protected String getBookTitleBlock( String title )\n {\n return \"<bookinfo><title>\" + title + \"</title>\";\n }", "@Override\n public void onTitleChange(String title) {\n poll.setTitle(title);\n }", "public void setTitle(java.lang.String title)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TITLE$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TITLE$2);\n }\n target.setStringValue(title);\n }\n }", "public String normalizeHeader(@XPath(value = \"/cartoon/@title\") String title) {\n\t\tlog.info(\"Cartoon Title:{}\", title);\n\t\tfinal String normalized = title.replaceAll(\"\\\\s+\", \"\").toLowerCase() + \".xml\";\n\t\tlog.info(\"Normalized Title:{}\", normalized);\n\t\treturn normalized;\n\t}", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\r\n _title = title;\r\n }", "public void setTitle(String title){\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) { this.title = title; }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "public void setTitle(java.lang.String title) {\n this.title = title;\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "@Override\r\n public String getTitle() {\n return title;\r\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title) {\r\n this.title = title;\r\n }", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title)\n {\n this.title = title;\n }", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String title){\n this.title = title;\n }", "public void setTitle(java.lang.String title)\n {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n this.title = title;\n }", "@Override\r\n\tpublic void setTitle(String title) {\n\t\tthis.title = title;\r\n\t}", "public void setTitle(String postTitle) {\n\t\tthis.postTitle = postTitle;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title; \n\t}", "protected void SetTitle(String newTitle){ title = newTitle; }", "public Title()\r\n {\r\n startTag=\"TITLE\";\r\n endTag=\"/TITLE\"; \r\n }", "public void setTitle(String title) {\r\n\tthis.title = title;\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "public void setTitle(String title) {\r\n this.title = title == null ? null : title.trim();\r\n }", "@Override\n public void setTitle(String title) {\n this.title = title;\n }", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n\t\tthis.title = title;\n\t}", "public void setTitle( String title ) {\n\t\t_title = title;\n\t}", "@Override\r\n public String getTitle() {\r\n return title;\r\n }", "public void setTitle(String title)\n\t{\n\t\tthis.title = title;\n\t}", "public void setTitle(String title) {\n this.title = title == null ? null : title.trim();\n }", "public void setTitle(String title) {\n this.title = title == null ? null : title.trim();\n }", "public void setTitle(String title) {\n this.title = title == null ? null : title.trim();\n }", "public void setTitle(String title) {\n this.title = title == null ? null : title.trim();\n }" ]
[ "0.6638129", "0.6634174", "0.6613111", "0.62713784", "0.6144391", "0.6121105", "0.61152434", "0.6106296", "0.6101524", "0.60855347", "0.6059316", "0.6057525", "0.60470605", "0.6028447", "0.60239196", "0.60237765", "0.6018703", "0.59755975", "0.59752244", "0.59752244", "0.59752244", "0.59752244", "0.59752244", "0.5968526", "0.59642106", "0.5950536", "0.5935103", "0.59266376", "0.5914008", "0.59074503", "0.58953565", "0.5890291", "0.58880264", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.5875126", "0.58748734", "0.58748734", "0.58748734", "0.5873336", "0.5873336", "0.58712894", "0.5865484", "0.5865484", "0.5864481", "0.5864481", "0.5864481", "0.5864438", "0.5864438", "0.5864438", "0.5864438", "0.5864438", "0.5863652", "0.5860659", "0.5856958", "0.5856958", "0.5856958", "0.5856958", "0.58552915", "0.5854308", "0.5842869", "0.5842172", "0.58373845", "0.5833493", "0.58322966", "0.58322966", "0.58322966", "0.58322966", "0.583202", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.58161926", "0.5808988", "0.5808247", "0.5795641", "0.57918686", "0.57918686", "0.57918686", "0.57918686" ]
0.6404788
3
Processes link tags in the feed.
private String readLink(XmlPullParser parser) throws IOException, XmlPullParserException { String link = ""; parser.require(XmlPullParser.START_TAG, ns, "link"); String tag = parser.getName(); String relType = parser.getAttributeValue(null, "rel"); if (tag.equals("link")) { if (relType.equals("alternate")){ link = parser.getAttributeValue(null, "href"); parser.nextTag(); } } parser.require(XmlPullParser.END_TAG, ns, "link"); return link; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<LinkDetails> scrapeRSSPageForLinks(String rssUrl) {\n\t\tString description = \"\";\n\t\tString title = \"\";\n\t\tString link = \"\";\n\t\tString pubdate = \"\";\n\t\tURL url;\n\t\tInputStream in;\n\n\t\tList<LinkDetails> rssProcessedData = new ArrayList<LinkDetails>();\n\n\t\ttry {\n\t\t\turl = new URL(rssUrl);\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\ttry {\n\t\t\tin = url.openStream();\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\t// create XML input factory\n\t\tXMLInputFactory inputFactory = XMLInputFactory.newInstance();\n\n\t\t// read the XML document\n\t\ttry {\n\n\t\t\tXMLEventReader eventReader = inputFactory.createXMLEventReader(in);\n\n\t\t\tboolean isFeedHeader = true;\n\t\t\twhile (eventReader.hasNext()) {\n\t\t\t\tXMLEvent event = eventReader.nextEvent();\n\t\t\t\tif (event.isStartElement()) {\n\t\t\t\t\tString localPart = event.asStartElement().getName().getLocalPart();\n\n\t\t\t\t\t// System.out.println(localPart);\n\n\t\t\t\t\tswitch (localPart) {\n\n\t\t\t\t\tcase \"item\":\n\t\t\t\t\t\t// if (isFeedHeader) {\n\t\t\t\t\t\t// isFeedHeader = false;\n\t\t\t\t\t\t// System.out.println(\" title: \"+title+ \" description: \"+ description + \" link:\n\t\t\t\t\t\t// \"+link+\" pubDate: \"+pubdate);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\ttitle = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"title: \"+title);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"description\":\n\t\t\t\t\t\tdescription = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"description: \"+description);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\tlink = getCharacterData(event, eventReader);\n\t\t\t\t\t\tSystem.out.println(\"link: \" + link);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pubDate\":\n\t\t\t\t\t\tpubdate = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"pubDate: \"+pubdate);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t} else if (event.isEndElement()) {\n\t\t\t\t\tif (event.asEndElement().getName().getLocalPart() == (\"item\")) {\n\n\t\t\t\t\t\tLinkDetails linkDetails = new LinkDetails(link, title, description, pubdate);\n\t\t\t\t\t\trssProcessedData.add(linkDetails);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (XMLStreamException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\treturn rssProcessedData;\n\t}", "public void handleLink(Node from, Node to) {\n\t\t\r\n\t}", "public void addlink(TparselinksEntity newlink);", "public void clearLinkRemovalTags() {\n\tfor (Link l : allLinks)\n\t l.clearRemovalTag();\n }", "public void connect(Integer tagId, Integer linkId);", "public void setLinks(List<ALink> link) {\n this.link = link;\n }", "public void connect(Set<String> tags, Integer linkId);", "public void setLink(Unmarshaller linkTo)\r\n {\r\n _link = linkTo;\r\n }", "public void setLink(String link) {\n this.link = link;\n }", "public void setLink(String link) {\n this.link = link;\n }", "public void setLink(String link) {\n this.link = link;\n }", "public void setLink(String link)\n {\n this.link = link;\n }", "public void setLink(String link) {\r\n this.link = link;\r\n }", "public void setLink(String link) {\r\n this.link = link;\r\n }", "private void linkRemoved(Link link) {\n\n\t}", "public void processLink(String source, String qualifier, String target) throws BeaconException;", "public void setLink(java.lang.String link)\n {\n this.link = link;\n }", "public Content getLink(LinkInfo linkInfo) {\n if (linkInfo.type != null) {\n SimpleTypeVisitor14<Content, LinkInfo> linkVisitor = new SimpleTypeVisitor14<>() {\n\n final Content link = newContent();\n\n // handles primitives, no types and error types\n @Override\n protected Content defaultAction(TypeMirror type, LinkInfo linkInfo) {\n link.add(utils.getTypeName(type, false));\n return link;\n }\n\n int currentDepth = 0;\n @Override\n public Content visitArray(ArrayType type, LinkInfo linkInfo) {\n // keep track of the dimension depth and replace the last dimension\n // specifier with varargs, when the stack is fully unwound.\n currentDepth++;\n linkInfo.type = type.getComponentType();\n visit(linkInfo.type, linkInfo);\n currentDepth--;\n if (utils.isAnnotated(type)) {\n linkInfo.type = type;\n link.add(\" \");\n link.add(getTypeAnnotationLinks(linkInfo));\n }\n // use vararg if required\n if (linkInfo.isVarArg && currentDepth == 0) {\n link.add(\"...\");\n } else {\n link.add(\"[]\");\n }\n return link;\n }\n\n @Override\n public Content visitWildcard(WildcardType type, LinkInfo linkInfo) {\n link.add(getTypeAnnotationLinks(linkInfo));\n link.add(\"?\");\n TypeMirror extendsBound = type.getExtendsBound();\n if (extendsBound != null) {\n link.add(\" extends \");\n setBoundsLinkInfo(linkInfo, extendsBound);\n link.add(getLink(linkInfo));\n }\n TypeMirror superBound = type.getSuperBound();\n if (superBound != null) {\n link.add(\" super \");\n setBoundsLinkInfo(linkInfo, superBound);\n link.add(getLink(linkInfo));\n }\n return link;\n }\n\n @Override\n public Content visitTypeVariable(TypeVariable type, LinkInfo linkInfo) {\n link.add(getTypeAnnotationLinks(linkInfo));\n TypeVariable typevariable = (utils.isArrayType(type))\n ? (TypeVariable) utils.getComponentType(type)\n : type;\n Element owner = typevariable.asElement().getEnclosingElement();\n if (!linkInfo.excludeTypeParameterLinks && utils.isTypeElement(owner)) {\n linkInfo.typeElement = (TypeElement) owner;\n Content label = newContent();\n label.add(utils.getTypeName(type, false));\n linkInfo.label = label;\n linkInfo.skipPreview = true;\n link.add(getClassLink(linkInfo));\n } else {\n // No need to link method type parameters.\n link.add(utils.getTypeName(typevariable, false));\n }\n\n if (!linkInfo.excludeTypeBounds) {\n linkInfo.excludeTypeBounds = true;\n TypeParameterElement tpe = ((TypeParameterElement) typevariable.asElement());\n boolean more = false;\n List<? extends TypeMirror> bounds = utils.getBounds(tpe);\n for (TypeMirror bound : bounds) {\n // we get everything as extends java.lang.Object we suppress\n // all of them except those that have multiple extends\n if (bounds.size() == 1 &&\n bound.equals(utils.getObjectType()) &&\n !utils.isAnnotated(bound)) {\n continue;\n }\n link.add(more ? \" & \" : \" extends \");\n setBoundsLinkInfo(linkInfo, bound);\n link.add(getLink(linkInfo));\n more = true;\n }\n }\n return link;\n }\n\n @Override\n public Content visitDeclared(DeclaredType type, LinkInfo linkInfo) {\n TypeMirror enc = type.getEnclosingType();\n if (enc instanceof DeclaredType dt && utils.isGenericType(dt)) {\n // If an enclosing type has type parameters render them as separate links as\n // otherwise this information is lost. On the other hand, plain enclosing types\n // are not linked separately as they are easy to reach from the nested type.\n setEnclosingTypeLinkInfo(linkInfo, dt);\n visitDeclared(dt, linkInfo);\n link.add(\".\");\n setEnclosingTypeLinkInfo(linkInfo, type);\n }\n link.add(getTypeAnnotationLinks(linkInfo));\n linkInfo.typeElement = utils.asTypeElement(type);\n link.add(getClassLink(linkInfo));\n if (linkInfo.includeTypeParameterLinks()) {\n link.add(getTypeParameterLinks(linkInfo));\n }\n return link;\n }\n };\n return linkVisitor.visit(linkInfo.type, linkInfo);\n } else if (linkInfo.typeElement != null) {\n Content link = newContent();\n link.add(getClassLink(linkInfo));\n if (linkInfo.includeTypeParameterLinks()) {\n link.add(getTypeParameterLinks(linkInfo));\n }\n return link;\n } else {\n return null;\n }\n }", "@Override\n protected void onComponentTag(final ComponentTag _tag)\n {\n super.onComponentTag(_tag);\n _tag.setName(\"a\");\n _tag.put(\"href\", \"#\");\n onComponentTagInternal(_tag);\n }", "Set<Link> extractLinks(CrawlDoc doc, ParseState parseState)\n throws IOException;", "protected abstract Content getClassLink(LinkInfo linkInfo);", "void processTag(XMLNode tag) throws Exception {\n if(tag.type()== XMLNode.Type.TAG){\n state.traceTagBegin(tag.getTag()==null?\"process\":tag.getTag(),null);\n tagstk[tagstkptr++] = tag.getTag();\n \n dataloader.beginTag(tagstk, tagstkptr, tag.getTag(), tag.getAttribs());\n if(tag.getTags()!= null) for(XMLNode nextTag : tag.getTags()){\n processTag(nextTag);\n }\n ((LoadDatamapData)dataloader).endTag(tagstk, tagstkptr, tag, tag.getBody(), tag.getAttribs());\n \n tag.clearRef();\n \n tagstkptr--;\n tagstk[tagstkptr]= null;\n state.traceTagEnd();\n }\n }", "public interface LinkParser {\n\n /**\n * Parse text content in format defined in RFC RFC6690 into array of links {@link Link}.\n *\n * @param bytes content to parse as array of bytes.\n */\n Link[] parseCoreLinkFormat(byte[] bytes) throws LinkParseException;\n}", "@Test\n\tpublic void TestTwoLinksAreHandledOkay() {\n\t\tJabberMessage msg = new JabberMessage();\n\t\tmsg.setMessage(\"Hello There! http://reddit.com http://google.com\");\n\t\tmsg.setId(1);\n\t\tmsg.setUsername(\"Test\");\n\t\tmsg.setTimestamp(\"NOW!\");\n\t\tLink link = null;\n\t\ttry {\n\t\t\tlink = lh.convertMessageToLink(msg);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Couldnt convert message to link\");\n\t\t}\n\t\tif (link.getUrl().equals(\"http://reddit.com\") || link.getUrl().equals(\"http://google.com\")) {\n\t\t\t// pass\n\t\t}\n\t\telse {\n\t\t\tfail(\"Can't handle two URL's\");\n\t\t}\n\t}", "@Override\n\tpublic ParseState handle(final String namespace, final String tag, final String qName, final Attributes atts, final ParseState current) throws SAXException, NdexException {\n\t\tString href = atts.getValue(ReadDataManager.XLINK, \"href\");\n\n\t\tif (href == null) {\n\t\t\t// Create the edge:\n\t//\t\tid = getId(atts);\n\t\t\tString label = getLabel(atts);\n\t\t\tString sourceId = atts.getValue(\"source\");\n\t\t\tString targetId = atts.getValue(\"target\");\n\t\t\tString interaction = null;\n\t\t\t\n\t\t\t// check if we can parse the predicate from from label\n\t\t\t\n\t\t\tMatcher m = predictatePattern.matcher(label);\n\t\t\t\n\t\t\tif ( m.find()) \n\t\t\t\tinteraction = m.group(1);\n\n\t//Long edgeId = \n\t\t\tmanager.addEdge(sourceId, interaction, targetId);\n\n\t\t\tmanager.getCurrentXGMMLEdge().getProps().add(new NdexPropertyValuePair(LABEL,label));\n\t\t\t//TODO: add the rest of atts as properties to the edge.\n\t\t\t\n\n\t\t} else {\n\t\t\t// The edge might not have been created yet!\n\t\t\t// Save the reference so it can be added to the network after the\n\t\t\t// whole graph is parsed.\n\t\t\tthrow new NdexException(\"not yet handling XLINK in XGMML\");\n\t\t}\n\n\t\treturn current;\n\t}", "private void pullLinks(String htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage);\n Elements links = doc.select(\"a[href]\");\n\n for (Element link : links) {\n\n String possibleUrl = link.attr(\"abs:href\");\n\n if (!possibleUrl.equals(\"\")) {\n// Log.v(\"pullLinks\", \" will try to make URL from\" + possibleUrl);\n //if the link attr isn't empty, make a URL\n URL theUrl = NetworkUtils.makeURL(possibleUrl);\n\n if (RegexUtils.urlDomainNameMatch(firstLinkAsString, theUrl.toString())) {\n //if the string version of url is within the same domain as original query\n if (!visitedLinks.contains(theUrl.toString())) {\n// Log.v(\"DLAsyncTask.pullLinks\", \" thinks that \" + theUrl.toString() + \" wasn't visited, add into collected...\");\n collectedLinks.add(theUrl.toString());\n }\n }\n }\n\n }\n }", "public abstract Content getTypeAnnotationLinks(LinkInfo linkInfo);", "static CharSequence linkifyUrls(FormattedTweetText tweetText,\n final LinkClickListener listener, boolean stripLastPhotoEntity, final int linkColor) {\n if (tweetText == null) return null;\n\n if (TextUtils.isEmpty(tweetText.text)) {\n return tweetText.text;\n }\n\n final SpannableStringBuilder spannable\n = new SpannableStringBuilder(tweetText.text);\n\n final List<FormattedUrlEntity> urls = tweetText.urlEntities;\n\n final List<FormattedMediaEntity> media\n = tweetText.mediaEntities;\n final FormattedMediaEntity lastPhoto;\n if (stripLastPhotoEntity) {\n lastPhoto = getLastPhotoEntity(tweetText);\n } else {\n lastPhoto = null;\n }\n\n /*\n * We combine and sort the entities here so that we can correctly calculate the offsets\n * into the text.\n */\n final List<FormattedUrlEntity> combined = mergeAndSortEntities(urls, media);\n\n addUrlEntities(spannable, combined, lastPhoto, listener, linkColor);\n return spannable;\n }", "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // Match! Remove that bastard.\n entities.urls.remove(entities.urls.size() - 1);\n }\n }\n\n // Replace minified URLs\n for(Entities.UrlEntity entity : entities.urls){\n // Find the starting index for this URL\n entity.indexStart = text.indexOf(entity.minifiedUrl);\n // Replace text\n text = text.replace(entity.minifiedUrl, entity.displayUrl);\n // Find the last index for this URL\n entity.indexEnd = entity.indexStart + entity.displayUrl.length();\n }\n }", "@Test\n\tpublic void testGetLinksMultipleLinks() {\n\t\tList<String> results = helper.getLinks(\n\t\t\t\t\"drop tables; <A HREF=\\\"test.com\\\"> <a href=\\\"nexttest.org\\\". junk junk\", null);\n\t\tassertEquals(2, results.size());\n\t\tassertEquals(\"test.com\", results.get(0));\n\t\tassertEquals(\"nexttest.org\", results.get(1));\n\t}", "public void setLinkid(Integer linkid) {\n this.linkid = linkid;\n }", "private void writeLink() throws SAXException, IOException {\n if (state.uri != null && state.uri.trim().length() > 0) {\n xhtml.startElement(\"a\", \"href\", state.uri);\n xhtml.characters(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"a\");\n } else {\n try {\n //if it isn't a uri, output this anyhow\n writeString(state.hrefAnchorBuilder.toString());\n } catch (IOException e) {\n handleCatchableIOE(e);\n }\n }\n state.hrefAnchorBuilder.setLength(0);\n state.inLink = false;\n state.uri = null;\n\n }", "private void goThroughLinks() throws IOException {\n for (URL link :links) {\n pagesVisited++;\n Node node;\n if (link.toString().contains(\"?id=1\") && !books.contains(link)) {\n node = populateNode(link);\n depth = 2;\n books.add(node);\n } else if (link.toString().contains(\"?id=2\") && !movies.contains(link)) {\n node = populateNode(link);\n depth = 2;\n movies.add(node);\n } else if (link.toString().contains(\"?id=3\") && !music.contains(link)) {\n node = populateNode(link);\n depth = 2;\n music.add(node);\n }\n }\n }", "private Set<String> extracLinks(String url, LinkFilter filter) {\n\n\t\tSet<String> links = new HashSet<String>();\n\t\ttry {\n\t\t\tParser parser = new Parser(url);\n\t\t\tparser.setEncoding(\"UTF-8\");\n\t\t\t// linkFilter filter <a> tag\n\t\t\tNodeClassFilter linkFilter = new NodeClassFilter(LinkTag.class);\n\t\t\t// get all filtered links\n\t\t\tNodeList list = parser.extractAllNodesThatMatch(linkFilter);\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tNode tag = list.elementAt(i);\n\t\t\t\tif (tag instanceof LinkTag)// <a> tag\n\t\t\t\t{\n\t\t\t\t\tLinkTag link = (LinkTag) tag;\n\t\t\t\t\tString linkUrl = link.getLink();// url\n\t\t\t\t\tif (filter.accept(linkUrl)) {\n\t\t\t\t\t\t// change bbsdoc to bbstdoc\n\t\t\t\t\t\tString stlink = linkUrl.replace(\"bbsdoc\", \"bbstdoc\");\n\t\t\t\t\t\tlinks.add(stlink);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn links;\n\t}", "public void setLink(Link link) {\n \t\t_link = link;\n \t}", "List<ProductLink> links();", "public void setLinks(List<Link> links)\n {\n this.links = links;\n }", "public boolean addAll(Link<T> link);", "public Set<Anchor> parse(Reader reader, String url) {\n\n Set<Anchor> elements = new HashSet<>();\n String urtContent = null;\n try {\n urtContent = readFully(reader);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (urtContent == null){\n return elements;\n }\n\n mTag = pTag.matcher(urtContent);\n\n while (mTag.find()) {\n\n String href = mTag.group(1); // get the values of href\n String linkElem = mTag.group(2); // get the text of link Html Element\n\n mLink = pLink.matcher(href);\n\n while (mLink.find()) {\n\n String link = mLink.group(1);\n Anchor anchor = new Anchor();\n anchor.setUrl(link);\n anchor.setText(linkElem);\n\n elements.add(anchor);\n\n }\n }\n return elements;\n }", "public void onClickAddLink(View v) {\n linkDefined = true;\n switch ((int) linkType.getSelectedItemId()) {\n case 0:\n linkTypeValue = \"link\";\n break;\n case 1:\n linkTypeValue = \"media\";\n break;\n default:\n break;\n }\n linkStringList += links.getText() + \"|\" + linkTypeValue + \";\";\n links.setText(\"\");\n }", "public void setLinkName(String link) {\n this.linkName = link;\n }", "void storeLinks();", "public void setLinkName(String linkName);", "private static void addUrlEntities(final SpannableStringBuilder spannable,\n final List<FormattedUrlEntity> entities,\n final FormattedMediaEntity lastPhoto,\n final LinkClickListener listener, final int linkColor) {\n if (entities == null || entities.isEmpty()) return;\n\n int offset = 0;\n int len;\n int start;\n int end;\n for (final FormattedUrlEntity url : entities) {\n start = url.start - offset;\n end = url.end - offset;\n if (start >= 0 && end <= spannable.length()) {\n // replace the last photo url with empty string, we can use the start indices as\n // as simple check, since none of this will work anyways if we have overlapping\n // entities\n if (lastPhoto != null && lastPhoto.start == url.start) {\n spannable.replace(start, end, \"\");\n len = end - start;\n end -= len;\n offset += len;\n } else if (!TextUtils.isEmpty(url.displayUrl)) {\n spannable.replace(start, end, url.displayUrl);\n len = end - (start + url.displayUrl.length());\n end -= len;\n offset += len;\n\n final CharacterStyle span = new ClickableSpan() {\n @Override\n public void onClick(View widget) {\n if (listener == null) return;\n listener.onUrlClicked(url.url);\n }\n\n @Override\n public void updateDrawState(TextPaint ds) {\n ds.setColor(linkColor);\n ds.setUnderlineText(false); // Links should not be underlined\n }\n };\n spannable.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n }\n }\n }\n }", "private void montaListaDeItensDeLinks(org.jsoup.nodes.Document doc, JSONArray description) {\n Elements links = doc.select(\"div\").select(\"ul\").select(\"li\").select(\"a\");\n JSONArray listalinks = new JSONArray();\n for (Element link : links) {\n\n listalinks.put(link.attr(\"abs:href\"));\n }\n\n // Após a lista de links montada ela é incluída dentro de um nó links do json de\n // saída\n JSONObject ljson = new JSONObject();\n ljson.put(\"type\", \"links\");\n ljson.put(\"content\", listalinks);\n\n // O novo item (ljson) está pronto e é incluindo como um item da lista\n // description\n description.put(ljson);\n }", "@Override\n\tpublic int addLink(Link link) {\n\t\treturn 0;\n\t}", "public static void processFeed(FeedContext fc) {\n\n String feedUrl = fc.getFeedUrl();\n mLog.info(\"Processing Atom feed at URL: \" + feedUrl);\n\n try {\n AbderaAtomParser atomParser = new AbderaAtomParser(new URL(feedUrl));\n atomParser.persistFeed(fc);\n\n mLog.info(\"Finished processing Atom feed at URL \" + feedUrl);\n }\n catch (MalformedURLException url_e) {\n mLog.error(\"MalformedURL found for \" + fc.getFeedUrl());\n }\n catch (ArrayIndexOutOfBoundsException a) {\n // this happens if the feed is empty (typically an activity stream),\n // need a better way to track this though\n \tmLog.warn(\"Feed at URL [\" + feedUrl + \"] is probably empty, but this \" +\n \t\t\t\"exception should have been prevented.\");\n }\n catch (Exception e) {\n mLog.error(\"Error processing feed at [\" + fc.getFeedUrl() + \"]: \" + e.getMessage());\n }\n catch (Throwable t) {\n mLog.error(\"Error processing feed at [\" + fc.getFeedUrl() + \"]: \" + t.getMessage());\n }\n }", "public static void main(String[] args) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n Pattern pattern = Pattern.compile(\"<a\\\\s+(href=[^>]+)>([^<]+)<\\\\/a>\");\n\n StringBuilder sb = new StringBuilder();\n String currentLine = reader.readLine();\n\n while (!\"END\".equals(currentLine)) {\n sb.append(currentLine).append(System.getProperty(\"line.separator\"));\n currentLine = reader.readLine();\n }\n\n Matcher matcher = pattern.matcher(sb);\n\n while (matcher.find()) {\n // group 1 = <a da stane => [URL\n // group 3 = > da stane => ]\n // group 5 = </a> da stane => [/URL]\n\n int startIndex = matcher.start();\n int endIndex = matcher.end();\n\n String replacedTag = \"[URL \" + matcher.group(1) + \"]\" + matcher.group(2) + \"[/URL]\";\n sb.replace(startIndex, endIndex, replacedTag);\n matcher = pattern.matcher(sb);\n\n }\n\n\n\n\n System.out.println(sb);\n\n\n }", "void queueInternalLinks(Elements paragraphs) {\n // FILL THIS IN!\n\t\tfor(Element paragraph: paragraphs)\n\t\t{\n\t\t\tIterable<Node> iterator = new WikiNodeIterable(paragraph);\n\t\t\tfor(Node node: iterator)\n\t\t\t{\n\t\t\t\tif(node instanceof Element)\n\t\t\t\t{\n\t\t\t\t\tString link = node.attr(\"href\");\n\t\t\t\t\tif(link.startsWith(\"/wiki/\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tqueue.add(\"https://en.wikipedia.org\" + ((Element)node).attr(\"href\"));\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public abstract String linkText();", "@Override\n public void visit(Page page) {\n\t visitObject.visitUrls(page);\n\t String url = page.getWebURL().getURL();\n\t System.out.println(\"URL: \" + url);\n\t if (page.getParseData() instanceof HtmlParseData) {\n\t\t HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t String text = htmlParseData.getText();\n\t\t String html = htmlParseData.getHtml();\n\t\t Set<WebURL> links = htmlParseData.getOutgoingUrls();\n\t\t System.out.println(\"Text length: \" + text.length());\n\t\t System.out.println(\"Html length: \" + html.length());\n\t\t System.out.println(\"Number of outgoing links: \" + links.size());\n\t\t }\n }", "public void updateContent(final Link link) {\n AvatarUtils.createAvatar(Avatar.create(link.getAuthor().getAvatar(), \"\"), this.avatar, this.avatarSize, (AppConfig) this.appConfigProvider.get(), this.requestManager);\n String description2 = link.getDescription();\n if (TextUtils.isEmpty(description2)) {\n this.description.setVisibility(8);\n } else {\n this.description.setVisibility(0);\n this.description.setText(description2);\n }\n String title2 = link.getTitle();\n this.title.setText(title2);\n this.titleBarText.setText(title2);\n setAuthorSpannable(link.getAuthor().getFirstName());\n this.updated.setText(this.timeFormatter.getUpdated(link.getUpdatedAt()));\n LinearLayout createLayoutFromBlocks = ViewHolderGenerator.createLayoutFromBlocks(this.articleHolder, link.getBlocks(), this);\n LinearLayout linearLayout = this.linkContainer;\n linearLayout.addView(BlockUtils.getBlockView(linearLayout, createLayoutFromBlocks, this));\n this.titleSize = this.title.getMeasuredHeight();\n this.scrollView.setListener(new Listener() {\n public void onBottomReached() {\n }\n\n public void onScrollChanged(int i2) {\n IntercomArticleActivity intercomArticleActivity = IntercomArticleActivity.this;\n if (intercomArticleActivity.titleBarEnabled) {\n int i3 = i2 - intercomArticleActivity.titleSize;\n intercomArticleActivity.titleBar.setAlpha(((float) i3) / 100.0f);\n IntercomArticleActivity intercomArticleActivity2 = IntercomArticleActivity.this;\n intercomArticleActivity2.titleBarText.setAlpha(((float) (i3 - intercomArticleActivity2.titleBar.getHeight())) / 100.0f);\n }\n }\n });\n this.scrollView.setAlpha(0.0f);\n this.scrollView.animate().alpha(1.0f).setDuration(300).start();\n if (!ReactionReply.isNull(link.getReactionReply())) {\n ReactionReply reactionReply = link.getReactionReply();\n int dimensionPixelSize = getResources().getDimensionPixelSize(R.dimen.intercom_link_reaction_height);\n ContentAwareScrollView contentAwareScrollView = this.scrollView;\n contentAwareScrollView.setPadding(contentAwareScrollView.getPaddingLeft(), this.scrollView.getPaddingTop(), this.scrollView.getPaddingRight(), dimensionPixelSize);\n this.reactionComposer.preloadReactionImages(reactionReply, this.requestManager);\n this.reactionComposer.setUpReactions(reactionReply, false, new ReactionListener() {\n public void onReactionSelected(Reaction reaction) {\n Injector.get().getApi().reactToLink(link.getId(), reaction.getIndex(), false);\n IntercomArticleActivity intercomArticleActivity = IntercomArticleActivity.this;\n intercomArticleActivity.metricTracker.sentReaction(intercomArticleActivity.conversationId, intercomArticleActivity.partId, reaction.getIndex(), ReactionLocation.LINK);\n ((TextView) IntercomArticleActivity.this.findViewById(R.id.reaction_text)).setText(R.string.intercom_article_response);\n }\n }, this.requestManager);\n this.composerLayout.setVisibility(0);\n View view = this.composerLayout;\n view.setY(view.getY() + ((float) dimensionPixelSize));\n this.composerLayout.animate().setInterpolator(new OvershootInterpolator(1.0f)).translationY(0.0f).setDuration(300).setListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animator) {\n IntercomArticleActivity.this.linkView.setClipChildren(false);\n }\n }).start();\n if (reactionReply.getReactionIndex() != null) {\n ((TextView) findViewById(R.id.reaction_text)).setText(R.string.intercom_article_response);\n }\n }\n this.scrollView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {\n public void onGlobalLayout() {\n ViewUtils.removeGlobalLayoutListener(IntercomArticleActivity.this.scrollView, this);\n if (((float) IntercomArticleActivity.this.scrollView.getChildAt(0).getMeasuredHeight()) > ((float) IntercomArticleActivity.this.linkView.getMeasuredHeight()) * 1.5f) {\n IntercomArticleActivity.this.titleBarEnabled = true;\n }\n }\n });\n }", "public void setLink(String link) {\n this.link = link == null ? null : link.trim();\n }", "private Long getTweetPollSocialNetworkLinksbyTag(final String tagName,\n final Integer initResults, final Integer maxResults,\n final TypeSearchResult filter) {\n Long linksbyItem = 0L;\n Long totalLinksByTweetPoll = 0L;\n final List<TweetPoll> tp = this.getTweetPollsByHashTag(tagName,\n initResults, maxResults, filter);\n for (TweetPoll tweetPoll : tp) {\n // Get total value by links\n linksbyItem = getTweetPollDao().getSocialLinksByType(tweetPoll,\n null, null, TypeSearchResult.TWEETPOLL);\n totalLinksByTweetPoll = totalLinksByTweetPoll + linksbyItem;\n }\n return totalLinksByTweetPoll;\n }", "private void readIconLinks(XmlPullParser xpp)\n throws XmlPullParserException, IOException\n {\n int eventType = xpp.next();\n while (eventType != XmlPullParser.END_DOCUMENT)\n {\n if (eventType == XmlPullParser.START_TAG)\n {\n // Read a tag\n // <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/bkn.jpg</icon-link>\n if (xpp.getName().equalsIgnoreCase(ICON_LINK))\n {\n this.forecast.addIconLink(xpp.nextText());\n }\n }\n else if (eventType == XmlPullParser.END_TAG)\n {\n // exit when we get to \"</conditions_icon>\"\n if (xpp.getName().equalsIgnoreCase(CONDITIONS_ICON))\n break;\n }\n eventType = xpp.next();\n }\n }", "public void setLinkItem(String string) {\r\n this.linkItem = string;\r\n }", "public interface LinkClickHandler { void onLinkClicked(GURL url); }", "void onLinkClicked(@Nullable ContentId itemId);", "private Link link() {\n\r\n\t\tLink link = null;\r\n\r\n\t\tToken tok = lex.getToken();\r\n\r\n\t\t// Expect '<link' (we know it is OK)\r\n\t\tif (tok.getToken() != TokensId.OPENLINK) {\r\n\t\t\tsyntaxError(String.format(\"Expected '<link', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect 'href'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.HREF) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected 'href' in link declaration, found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '='\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.EQ) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '=' after attribute 'href', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'href', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect href\r\n\t\tText href = href();\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'href', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect 'rel'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.REL) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected 'rel' in link declaration, found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '='\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.EQ) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '=' after attribute 'rel', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'rel', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect rel\r\n\t\tText rel = rel();\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'rel', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect 'type'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.TYPE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected 'type' in link declaration, found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '='\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.EQ) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '=' after attribute 'type', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'type', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect type\r\n\t\tText type = type();\r\n\r\n\t\t// Expect '\"'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.QUOTE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '\\\"' surrounding the value of 'type', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\t// Expect '>'\r\n\t\ttok = lex.getToken();\r\n\t\tif (tok.getToken() != TokensId.TAGCLOSE) {\r\n\t\t\tsyntaxError(String.format(\r\n\t\t\t\t\t\"Expected '>' closing the tag 'link', found '%s'\",\r\n\t\t\t\t\ttok.getLexeme()), tok.getLine());\r\n\t\t}\r\n\r\n\t\tif (href != null && rel != null && type != null)\r\n\t\t\tlink = new Link(href, rel, type);\r\n\r\n\t\tif (syntaxError)\r\n\t\t\treturn null;\r\n\r\n\t\treturn link;\r\n\t}", "@Test\n public void hrefPatternTest() {\n Pattern aTeg = Pattern.compile(\"(?i)<a([^>]+)>(.+?)</a>\");\n Pattern href = Pattern.compile(\"\\\\s*(?i)href\\\\s*=\\\\s*(\\\\\\\"([^\\\"]+\\\\\\\")|'[^']+'|([^'\\\">\\\\s]+))\");\n String[] validLinkTegs = {\"<li><a href=\\\"/toolbar-creator\\\">Create a Custom Toolbar</a></li>\",\n \"<a href=\\\"http://stlpublicradio.org/programs/slota/archivedetail.php?date='2012-02-29'\\\" title=\\\"\\\" class=\\\"menu_icon menu-17197 \\\" >Грузовые перевозки</a></li>\",\n \"<li><a href='http://www.tipsntracks.com/date/2012/03' title='March 2012'>March 2012</a></li>\"};\n String[] invalidLinkTags = {\"<a href=\\\"\\\"style=\\\"\\\"><img width=\\\"148\\\" height=\\\"32\\\" src=\\\"/images/buttons/btn-www-survey.gif\\\" /></a>\"};\n String[] validLinks = new String[validLinkTegs.length];\n String[] invalidLinks = new String[invalidLinkTags.length];\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = aTeg.matcher(validLinkTegs[i]);\n Assert.assertTrue(matcher.find());\n validLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = aTeg.matcher(invalidLinkTags[i]);\n Assert.assertTrue(matcher.find());\n invalidLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = href.matcher(validLinks[i]);\n Assert.assertTrue(matcher.find());\n String s = matcher.group(1);\n System.out.println(s.substring(1, s.length() - 1));\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = href.matcher(invalidLinks[i]);\n Assert.assertFalse(matcher.find());\n }\n }", "protected abstract Content getTypeParameterLinks(LinkInfo linkInfo);", "protected void reduce(Text mainUrl, Iterable<Text> links, Context context) throws IOException, InterruptedException {\n\n LinkedList<String> linksIn = new LinkedList<>();\n LinkedList<String> linksOut = new LinkedList<>();\n\n for (Text link : links) {\n char who = link.toString().trim().charAt(0);\n String content = link.toString().trim().substring(1);\n if (who == '>') {\n linksOut.add(content);\n } else if (who == '<') {\n linksIn.add(content);\n }\n }\n\n // Собираем статистику\n context.getCounter(\"TOPS\", \"ALL\").increment(1);\n if (linksOut.size() == 0) {\n context.getCounter(\"TOPS\", \"HANGING\").increment(1);\n }\n\n context.write(mainUrl, new Text(\"###\\t\" + String.join(\"\\t\", linksOut) + \"\\t###\\t\" + String.join(\"\\t\", linksIn)));\n }", "public Link add(Link link);", "private void htmlGlobalTagStatistics() throws MalformedURLException {\n\t\tfinal List<String> anchorLinks = new ArrayList<>();\n\t\tfinal List<String> imgLinks = new ArrayList<>();\n\t\tfinal List<String> anchorImgLinks = new ArrayList<>();\n\t\tfinal List<Integer> countNbImgGif = new ArrayList<>();\n\t\tfinal List<Integer> countNbScriptOutside = new ArrayList<>();\n\t\thtmlParsed.traverse(new NodeVisitor(){\n\t\t\tString attributeValue = \"\";\n\t\t\tpublic void head(Node node, int depth){\n\t\t\t\tif (node instanceof Element){\n\t\t\t\t\tElement tag = (Element) node;\n\t\t\t\t\tif(tag.tagName().equals(\"a\")){\n\t\t\t\t\t\tattributeValue = tag.attr(\"href\");\n\t\t\t\t\t\tif(attributeValue.length() > 0) {\n\t\t\t\t\t\t\tanchorLinks.add(attributeValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(tag.tagName().equals(\"img\")){\n\t\t\t\t\t\tattributeValue = tag.attr(\"src\");\n\t\t\t\t\t\tif(attributeValue.length() > 0){\n\t\t\t\t\t\t\timgLinks.add(attributeValue);\n\t\t\t\t\t\t\tif(attributeValue.endsWith(\".gif\")){\n\t\t\t\t\t\t\t\tcountNbImgGif.add(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tag.parent().tagName().equals(\"a\")) {\n\t\t\t\t\t\t\t\tanchorImgLinks.add(attributeValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(tag.tagName().equals(\"script\")){\n\t\t\t\t\t\tattributeValue = tag.attr(\"src\");\n\t\t\t\t\t\tif(attributeValue.length() > 0)\n\t\t\t\t\t\t\tcountNbScriptOutside.add(1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t public void tail(Node node, int depth) {\n\t\t }\n\t\t});\t\n\t\t\n\t\tint nbYearImgLink = anchorImgLinks.stream()\n\t\t\t\t.mapToInt(ClassificationGeneralFunctions::countNbOfYears)\n\t\t\t\t.sum();\n\t\t\t\t\n\t\tint nbYearAnchorLink = 0;\n\t\tint nbLinkSameDomain = 0;\n\t\tint nbLinkOutside = 0;\n\t\tint nbHrefJavascript = 0;\n\t\tString domain = new URL(url).getHost().toLowerCase();\n\t\tfor(String link: anchorLinks){\n\t\t\tlink = link.toLowerCase();\n\t\t\tnbYearAnchorLink += ClassificationGeneralFunctions.countNbOfYears(link);\n\t\t\tif(link.startsWith(\"http\")){\n\t\t\t\tif(link.contains(domain)) {\n\t\t\t\t\tnbLinkSameDomain += 1;\n\t\t\t\t}else {\n\t\t\t\t\tnbLinkOutside += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(link.startsWith(\"javascript\")){\n\t\t\t\t\tnbHrefJavascript += 1;\n\t\t\t\t}else {\n\t\t\t\t\tnbLinkSameDomain += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\thtmlStatistics.put(\"img\", (double) imgLinks.size());\n\t\thtmlStatistics.put(\"img_gif\",(double) countNbImgGif.size());\n\t\thtmlStatistics.put(\"script_outside\", (double) countNbScriptOutside.size());\n\t\thtmlStatistics.put(\"anchor_with_image\", (double) anchorImgLinks.size());\n\t\thtmlStatistics.put(\"year_link_img\", (double) nbYearImgLink);\n\t\thtmlStatistics.put(\"year_link_anchor\", (double) nbYearAnchorLink);\n\t\thtmlStatistics.put(\"links_same_domains\", (double) nbLinkSameDomain);\n\t\thtmlStatistics.put(\"links_to_outside\", (double) nbLinkOutside);\n\t\thtmlStatistics.put(\"href_javascript\", (double) nbHrefJavascript);\n\t}", "public Link getLink() {\r\n return link;\r\n }", "boolean insertLink(Link link);", "public void setLink(@Nullable final String link) {\n mLink = link;\n }", "private void handleAllStartTags(Tag tagReturnedFromParse, MutableAttributeSet attributeSetReturnedFromParse, int pos) {\n\tif (StepsToFollow == null) {\n\t initializeStepsToFollow();\n\t}\n\tStepsToFollow.processNextStep();\n\ttry {\n\t if (StepsToFollow.tagToFind == null) {\n\t\tthis.strImageDate = StepsToFollow.getStrImageDate();\n\t\tthis.strImageUrl = StepsToFollow.getStrImageUrl();\n//\t\tthis.ldImageDate = StepsToFollow.getLdImageDate();\n\t\tthis.setStrImageWebPageUrlForPreviousDay(StepsToFollow.getStrPrevWebPageUrl());\n\t } else {\n\t\tif (StepsToFollow.tagToFind.equals(tagReturnedFromParse)) {\n\t\t if (MyTestStepToCheck != StepsToFollow.intNextStepToCheck) {\n\t\t\tString strTagToFind = StepsToFollow.tagToFind.toString();\n\t\t\tMyTestResults += strTagToFind + \"|\";\n\t\t\tMyTestStepToCheck = StepsToFollow.intNextStepToCheck;\n\t\t }\n\t\t MyResults = objProcessStartTags.processThisTag(tagReturnedFromParse, attributeSetReturnedFromParse, StepsToFollow.tagToFind, StepsToFollow.attributeToFind, StepsToFollow.strValueToFind, StepsToFollow.intLengthOfValueToFind, StepsToFollow.attributeToGetValueFrom);\n\t\t StepsToFollow.checkReturnValues(MyResults);\n\t\t}\n\t }\n\t} catch (Exception e) {\n\t // TODO Auto-generated catch block\n\t // e.printStackTrace();\n\t String myMsg = \"Error:\";\n\t myMsg += NL + \"ArcamaxWebPageHtmlParser\";\n//\t myMsg += NL + \"imageName: \" + this.strImageName;\n\t myMsg += NL + \"Tag returned: \" + tagReturnedFromParse;\n\t myMsg += NL + \"Tag to find: \" + StepsToFollow.tagToFind;\n\t myMsg += NL + \"Next step to check: \" + StepsToFollow.intNextStepToCheck;\n\t System.out.println(myMsg);\n\t}\n\n }", "@Override\r\n public void onInserted(ParserItemLink link) {\r\n tableAdd(link);\r\n selectedLink = link;\r\n tableSelect(link);\r\n }", "private String linkString()\n {\n Iterator<DSAGraphNode<E>> iter = links.iterator();\n String outputString = \"\";\n DSAGraphNode<E> node = null;\n while (iter.hasNext())\n {\n node = iter.next();\n outputString = (outputString + node.getLabel() + \", \");\n }\n return outputString;\n }", "SaldoLink(@NonNull Context context, @Nullable String rawValue) {\n\n if (rawValue == null) {\n Timber.d(\"rawValue was null, cannot parse saldo links.\");\n return;\n }\n\n String[] rawLinks = rawValue.split(Utils.PIPE_SEPARATOR);\n\n boolean allLinksArePresent = rawLinks.length == 3 &&\n Utils.hasLength(rawLinks[0]) &&\n Utils.hasLength(rawLinks[1]) &&\n Utils.hasLength(rawLinks[2]);\n\n if (allLinksArePresent) {\n\n wordLink = context.getString(R.string.link_word_format,\n rawLinks[0], context.getString(R.string.link_word));\n\n associationsLink = context.getString(R.string.link_associations_format,\n rawLinks[1], context.getString(R.string.link_associations));\n\n inflectionsLink = context.getString(R.string.link_inflections_format,\n rawLinks[2], context.getString(R.string.link_inflections)\n );\n }\n }", "private void handleQueryCommand(SlackMessageSender messageSender, String[] args) throws Exception {\n if (args != null && args.length > 0 && args[0].charAt(0) != '-') {\n args = new String[]{\"-tag\", args[0]};\n }\n\n LinkEntityCommand linkEntityCommand = parseLinkEntityCommand(args);\n if (logger.isDebugEnabled()) {\n logger.debug(\"## [Link query command] \" + linkEntityCommand);\n }\n\n String tagName = CollectionUtils.isEmpty(linkEntityCommand.getTagValues())\n ? null : linkEntityCommand.getTagValues().get(0);\n\n List<LinkEntity> links = linkService.queryByTagName(tagName);\n\n final int entityStringLength = 50;\n final String delimiter = \" \";\n StringBuilder message = new StringBuilder(entityStringLength * links.size());\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n for (LinkEntity linkEntity : links) {\n message.append(\"[Id.title] : \")\n .append(linkEntity.getId()).append(\".\").append(linkEntity.getTitle()).append(delimiter)\n .append(\"[Description] : \").append(linkEntity.getDescription()).append(delimiter)\n .append(\"[Link] : \").append(linkEntity.getHref()).append(delimiter)\n .append(\"[Reg time] : \").append(linkEntity.getRegisterDateTime().format(formatter)).append(delimiter);\n\n message.append(\"[Tags] : \");\n for (TagEntity tagEntity : linkEntity.getTags()) {\n message.append(\"#\").append(tagEntity.getName()).append(\" \");\n }\n message.append(\"\\n\\n\");\n }\n /*for (LinkEntity linkEntity : links) {\n message.append(\"[\").append(linkEntity.getId()).append(\". \")\n .append(linkEntity.getTitle()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getDescription()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getHref()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getRegisterDateTime().format(formatter)).append(\"]\").append(delimiter);\n\n message.append(\"[ \");\n for (TagEntity tagEntity : linkEntity.getTags()) {\n message.append(\"#\").append(tagEntity.getName()).append(\" \");\n }\n message.append(\"]\\n\\n\");\n }*/\n\n messageSender.send(message.toString());\n }", "public List<String> linkTexts()\n\t{\n\t\t\n\t\tList<String> links=new ArrayList<String>();\n\t\tlinks.add(linkString);\n\t\tlinks.add(\"Facebook.com\");\n\t\tlinks.add(\"google.com;\");\n\t\tlinks.add(\"gmail.com\");\n\t\tlinks.add(\"shine.com\");\n\t\tlinks.add(\"nukari.com\");\n\t\t\n\t\t// Like the above we have to add number of link text are passed to achieve the DataDriven approach through BBD \n\t\t\t\n\t\treturn links;\n\t\t\n\t}", "private Long getPollsSocialNetworkLinksByTag(final String tagName,\n final Integer initResults, final Integer maxResults,\n final TypeSearchResult filter) {\n Long linksbyItem = 0L;\n Long totalLinksByPoll = 0L;\n \n final List<Poll> polls = this.getPollsByHashTag(tagName, initResults,\n maxResults, filter);\n for (Poll poll : polls) {\n linksbyItem = getTweetPollDao().getSocialLinksByType(null, null,\n poll, TypeSearchResult.POLL);\n totalLinksByPoll = totalLinksByPoll + linksbyItem;\n }\n return totalLinksByPoll;\n }", "@Override // io.reactivex.rxjava3.functions.Consumer\n public void accept(DeepLink deepLink) {\n DeepLink deepLink2 = deepLink;\n RatingPublishCheckPresenter.Router router = this.a.b;\n if (router != null) {\n Intrinsics.checkNotNullExpressionValue(deepLink2, \"it\");\n router.followDeepLink(deepLink2);\n }\n }", "public String getLink() {\r\n return link;\r\n }", "public void link(Post p) {\n _next = p;\n }", "@objid (\"cd72633c-53d3-4556-b5de-b52113e3a225\")\n void setLink(Link value);", "boolean removeLink(Link link);", "private void deepLinkingFlow() {\n\n if (getActivity().getIntent().hasExtra(\"deeplink\")) {\n destination = getActivity().getIntent().getParcelableExtra(\"deeplink\");\n hotelSearchPresenter.checkDeepLinking(destination, getActivity().getSupportFragmentManager().beginTransaction());\n }\n\n }", "List<? extends Link> getLinks();", "public static void AddUrls (List<String> links) {\n\t for(String LoopedLinks:links) { \n\t\n\t\t//if page isn't part of domain, ignore\n\t\t if (LoopedLinks.startsWith(variables.domain)) {\n\t\n\t\t\t //if page doesn't have an octothorpe\n\t\t\t if (!LoopedLinks.contains(\"#\")) {\n\t\t\t\t \n\t\t\t\t //if page doesn't ends with one of the file extensions to not use\n\t\t\t\t String extension = getExtension(LoopedLinks);//gets file extension from URL\n\t\t\t\t if(!variables.list.stream().anyMatch(extension::contains)) {\n\n\t\t\t\t\t //if link isn't already part of master list, add it.\n\t\t\t\t\t if(!variables.master.contains(LoopedLinks)) {\n\t\t\t\t\t\t Reporter.log(\"Adding to master list \"+LoopedLinks, variables.verboseReport);\n\t\t\t\t\t\t variables.master.add(LoopedLinks);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t}", "CharNode getLink();", "final void checkLink(String link)\r\n {\r\n URL doc; // URL link\r\n\tDataInputStream dis=null;\r\n\tint i;\r\n\tboolean qualifiedLink=false;\r\n\tif(link.startsWith(\"#\")) // Skip the link if it's just an offset in this document\r\n\t return;\r\n if((i=link.indexOf(\"#\"))!=-1)\r\n\t{\r\n\t String substr=link.substring(0,i);\r\n\t link=substr;\r\n\t}\r\n\tif(app.checkAlreadyFound(link))\r\n\t return;\r\n // Ignore not - HTML links and start page\r\n\tif( (link.startsWith(\"mailto:\")) || (link.startsWith(\"wais:\")) ||\r\n\t (link.startsWith(\"gopher:\")) || (link.startsWith(\"newsrc:\")) ||\r\n\t\t(link.startsWith(\"ftp:\")) || (link.startsWith(\"nntp:\")) ||\r\n\t\t(link.startsWith(\"telnet:\")) || (link.startsWith(\"news:\")) ||\r\n\t\t(link.equalsIgnoreCase(app.indexName)) || link.equalsIgnoreCase(\"index.html\") ||\r\n\t\t(link.equalsIgnoreCase(\"index.htm\")))\r\n return;\r\n // Check that it is not out side link. (Eg, www.RGP-Javaline.com)\r\n\tif(link.indexOf(\"http:\")!=-1)\r\n\t{\r\n\t String pageName;\r\n\t if(app.server==null)\r\n\t pageName=\"http://www.\"+hostName;\r\n else pageName=app.server;\r\n\t // Allow for local host being displayed as an IP Address rather than host name.\r\n if(proxyDetected && app.IPAddress!=null)\r\n\t pageName=\"http://\"+app.IPAddress;\r\n // This is a fully qualified link. Eg, \" http://www.allsoft-india.com/index.htm\"\r\n\t qualifiedLink=true;\r\n\t // If the link doesn't contain the local host name or IPAddress then\r\n\t // it's an external link. So, ignore it.\r\n\t if(link.indexOf(pageName)==-1)\r\n\t return;\r\n\t}\r\n\t// Check that it's a HTML Page.\r\n\tif( link.indexOf(\".htm\")==-1 && link.indexOf(\".HTM\")==-1 &&\r\n\t link.indexOf(\".txt\")==-1 && link.indexOf(\".TXT\")==-1 &&\r\n\t\tlink.indexOf(\".phtml\")==-1 && link.indexOf(\".PHTML\")==-1 )\r\n return ;\r\n app.incrementPages(link); // valid link - add it to the array of visited links. \r\n\t// Follow link and read it's contents.\r\n\ttry\r\n\t{\r\n\t if(app.server==null)\r\n\t doc=new URL(\"http://www.\"+hostName+\"/\"+link);\r\n else\r\n\t {\r\n\t if(link.startsWith(\"/\"))\r\n\t\t{\r\n \t\t // Remove the \"/\" from the link as the server name has a terminating \"/\" \r\n String temp=link.substring(1,link.length());\r\n\t\t link=temp;\r\n\t\t}\r\n\t\tdoc=new URL(app.server+link);\r\n\t }\r\n \t // Link may be absolute, Eg, www.allsoft-india.com/contus.html\r\n\t if(qualifiedLink)\r\n\t doc=new URL(link);\r\n // If a proxy server/firewall has been detected then use the IPAddress (if supplied)\r\n\t // of the originating server rather than the host name.\r\n\t if(proxyDetected && app.IPAddress!=null)\r\n\t doc=new URL(\"http://\"+app.IPAddress+\"/\"+link);\r\n dis=new DataInputStream(doc.openStream());\r\n\t searchPage(dis,link);\r\n\t}\r\n catch(IOException e){}\r\n }", "public abstract Link getLink(LinkContext context) throws AccessException;", "@Test\n\tpublic void testGetLinksUpperCaseLink() {\n\t\tList<String> results = helper.getLinks(\"drop tables; <A HREF=\\\"test.com\\\"> junk junk\", null);\n\t\tassertEquals(1, results.size());\n\t\tassertEquals(\"test.com\", results.get(0));\n\t}", "public String getLink() {\n return link;\n }", "public void setLinks(List<Link> links) {\n\t\tthis.links = links;\n\t}", "public abstract boolean containsLink(Integer linkId);", "private static void processFeed(String url, String file, SimpleWriter out) \n {\n \tXMLTree rss = new XMLTree1(url);\n \t\n \t// make sure the rss tree is a valid rss tree\n if(!ensureValidRSSTree(rss, out))\n {\n \tout.println(\"This is not a valid RSS Tree.\");\n \treturn;\n }\n \n // print entire document to file\n outputHeader(rss.child(0), out);\n outputFooter(out);\n \n }", "public static String cleanLink(String link) {\n\t\treturn MarkupParser.cleanLink(link);\n\t}", "@Override\n\tpublic boolean isUsedInLinks() {\n\t\treturn false;\n\t}", "public void addLink(AtomLink link) {\n if(!links.contains(link)) {\n \tthis.links.add(link);\n }\n }", "public void onLinkEdit()\n {\n getLinkWizard().start(LinkWizardStep.LINK_REFERENCE_PARSER.toString(), linkConfigFactory.createLinkConfig());\n }", "public List<TparselinksEntity> getAllLinks();", "protected void _initLinks() {\n\tpeopleLink = null;\n\tchangeLogDetailsesLink = null;\n}", "private void addLinks(org.chromium.components.paint_preview.common.proto.PaintPreview.LinkDataProto value) {\n value.getClass();\n ensureLinksIsMutable();\n links_.add(value);\n }", "public void setLink(Kyykka link) {\n this.link = link;\n }", "private void clearLinks() {\n links_ = emptyProtobufList();\n }", "private void cleanCollectedLinks() {\n for (Iterator itr = visitedLinks.iterator(); itr.hasNext(); ) {\n String thisURL = (String) itr.next();\n if (urlInLinkedList(NetworkUtils.makeURL(thisURL), collectedLinks)) {\n collectedLinks.remove(thisURL.toString());\n// Log.v(\"DLasync.cleanCollected\", \" from CollectedLinks, just cleaned: \" + thisURL);\n// Log.v(\".cleanCollected\", \" collected set is now:\" + collectedLinks.toString());\n }\n }\n\n }" ]
[ "0.60620683", "0.584682", "0.5748492", "0.5684595", "0.56539875", "0.5625383", "0.5594585", "0.5557412", "0.55255425", "0.55255425", "0.55255425", "0.5518538", "0.55121374", "0.5496201", "0.54662794", "0.54656416", "0.5439604", "0.54082054", "0.5406095", "0.5388527", "0.5375491", "0.5348433", "0.5332387", "0.5332218", "0.5317367", "0.52921766", "0.5289247", "0.52771467", "0.5244107", "0.5205675", "0.51967835", "0.51708984", "0.51574516", "0.51409805", "0.5140925", "0.5140007", "0.51344", "0.51307034", "0.51264805", "0.50950694", "0.50930536", "0.50556356", "0.50472575", "0.50334346", "0.5030415", "0.5012871", "0.5011025", "0.500162", "0.49921104", "0.49918658", "0.4989943", "0.49607447", "0.49511248", "0.4947221", "0.49394217", "0.4936637", "0.49021778", "0.4900191", "0.48991448", "0.48937243", "0.48796612", "0.4871461", "0.4870763", "0.4866865", "0.48604116", "0.4858772", "0.4855339", "0.48548406", "0.4851924", "0.48342153", "0.48339874", "0.4826014", "0.48150587", "0.4807084", "0.48053515", "0.4802187", "0.4792144", "0.47882158", "0.47843257", "0.47833797", "0.47829267", "0.4770839", "0.4757124", "0.47516954", "0.47473714", "0.47458157", "0.47420204", "0.47416228", "0.4738182", "0.47351357", "0.473332", "0.47302258", "0.47297436", "0.47243178", "0.47234377", "0.47221452", "0.47159067", "0.47102258", "0.47068658", "0.4706716" ]
0.56169575
6
Processes summary tags in the feed.
private String readSummary(XmlPullParser parser) throws IOException, XmlPullParserException { parser.require(XmlPullParser.START_TAG, ns, "summary"); String summary = readText(parser); parser.require(XmlPullParser.END_TAG, ns, "summary"); return summary; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addAnalysisSummary()\r\n throws XMLStreamException\r\n {\r\n SimpleStartElement start;\r\n SimpleEndElement end;\r\n\r\n addNewline();\r\n\r\n start = new SimpleStartElement(\"analysis_summary\");\r\n start.addAttribute(\"analysis\", mimicXpress ? \"xpress\" : \"q3\");\r\n start.addAttribute(\"time\", now);\r\n// start.addAttribute(\"xmlns\",\"\");\r\n add(start);\r\n\r\n addNewline();\r\n\r\n String tagName = mimicXpress ? \"xpressratio_summary\" : \"q3ratio_summary\";\r\n start = new SimpleStartElement(tagName);\r\n start.addAttribute(\"version\", mimicXpress ? \"0.0\" : Q3.VERSION);\r\n start.addAttribute(\"author\", Q3.AUTHOR);\r\n\r\n // ???? Must ensure format of multiples is compatible with TPP\r\n StringBuilder residues = new StringBuilder();\r\n StringBuilder specs = new StringBuilder();\r\n boolean first = true;\r\n for (IsotopicLabel label : labels.values())\r\n {\r\n residues.append(label.getResidue());\r\n if (first)\r\n first = false;\r\n else\r\n specs.append(' ');\r\n specs.append(label.getResidue());\r\n specs.append(',');\r\n specs.append(String.format(\"%f\", label.getMassDiff()));\r\n }\r\n\r\n start.addAttribute(\"labeled_residues\", residues.toString());\r\n start.addAttribute(\"massdiff\", specs.toString());\r\n\r\n start.addAttribute(\"massTol\", mimicXpress ? \"0.75\" : \".1\");\r\n\r\n if (mimicXpress)\r\n {\r\n start.addAttribute(\"same_scan_range\", \"Y\");\r\n start.addAttribute(\"xpress_light\", \"0\");\r\n }\r\n\r\n add(start);\r\n\r\n end = new SimpleEndElement(tagName);\r\n add(end);\r\n\r\n addNewline();\r\n\r\n end = new SimpleEndElement(\"analysis_summary\");\r\n add(end);\r\n }", "public void setSummary(String summary) {\n this.summary = summary;\n }", "public void setSummary(String summary) {\n this.summary = summary;\n }", "protected abstract List<Sentence> prepareSummary(Article article);", "public void setSummary(String summary) {\n\t\tthis.summary = summary;\n\t}", "void countTagStatistics(){\t\n\t\thtmlParsed.traverse(new NodeVisitor() {\n\t\t\tdouble count = 0.;\n\t\t\tString tagName = \"\";\n\t\t public void head(Node node, int depth) {\n\t\t \tif (node instanceof Element) {\n\t\t \t\ttagName = ((Element) node).tagName();\n\t\t \t\tif(countTags.containsKey(tagName)){\n\t\t \t\t\tcount = countTags.get(tagName) + 1.;\n\t\t \t\t\tcountTags.put(tagName, count);\n\t\t \t\t}\n\t\t \t\telse if(tagName.matches(\"^[a-zA-Z:]+\"))\n\t\t \t\t\t\tcountTags.put(tagName, 1.);\n\t\t \t}\n\t\t }\n\t\t public void tail(Node node, int depth) {\n\t\t }\n\t\t});\t\n\t\t\t\n\t}", "public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }", "public void setSummary(String summary) {\r\n this.summary = summary == null ? null : summary.trim();\r\n }", "public void setSummary(String summary) {\n this.summary = summary == null ? null : summary.trim();\n }", "public String getSummary(org.jsoup.nodes.Document doc) {\r\n Element summaryEl = doc.getElementsByTag(\"summary\").first();\r\n return summaryEl != null ? StringUtil.normaliseWhitespace(summaryEl.text()).trim() : \"\";\r\n }", "void setSummary(java.lang.String summary);", "protected abstract void processSummary(\n PartitionData partitionData,\n PARTITION_SUMMARY summary,\n Reducer<PartitionDataWritable, AdapterWithObjectWritable, KEYOUT, VALUEOUT>.Context context)\n throws IOException, InterruptedException;", "public static TagEntrySummary fromEntries(List<TagEntry> entries) {\n\t\tTagEntrySummary summary = new TagEntrySummary();\n\t\tfor (TagEntry tag : entries) {\n\t\t\tsummary.countTags++;\n\t\t\tif (tag.getMatchingTagEntry() != null && tag.getScore() > 0) { // only count it if it has points\n\t\t\t\tsummary.countMatchingTags++;\n\t\t\t\tif (tag.isPioneer()) {\n\t\t\t\t\tsummary.countPioneerTags++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString t = tag.getDictionary();\n\t\t\tif (t != null) {\n\t\t\t\tsummary.countDictionaryMatches++;\n\n\t\t\t\tif (t.equals(\"events\")){\n\t\t\t\t\tsummary.countEventMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"fictional-location\")){\n\t\t\t\t\tsummary.countFicLocMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"real-location\")){\n\t\t\t\t\tsummary.countRealLocMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"fictional-person\")){\n\t\t\t\t\tsummary.countFicPerMatches++;\n\t\t\t\t}\n\n\t\t\t\tif (t.equals(\"real-person\")){\n\t\t\t\t\tsummary.countRealPerMatches++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (t == null && tag.getMatchingTagEntry() == null) {\n\t\t\t\tsummary.countEmptyTags++;\n\t\t\t}\n\t\t}\n\t\treturn summary;\n\t}", "java.lang.String getSummary();", "public java.lang.String getSummary(){\r\n return this.summary;\r\n }", "@JsonProperty(\"summary\")\n public void setSummary(String summary) {\n this.summary = summary;\n }", "public final void mSUMMARY() throws RecognitionException {\r\n try {\r\n int _type = SUMMARY;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // Satmc.g:21:9: ( 'SUMMARY' )\r\n // Satmc.g:21:11: 'SUMMARY'\r\n {\r\n match(\"SUMMARY\"); \r\n\r\n\r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n }", "IParser setSummaryMode(boolean theSummaryMode);", "public String getSummary() {\r\n return summary;\r\n }", "public void setSummary(java.lang.String summary)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SUMMARY$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SUMMARY$18);\n }\n target.setStringValue(summary);\n }\n }", "private void readRunSearchSummary(XMLStreamReader reader) throws XMLStreamException, DataProviderException {\n String value = reader.getAttributeValue(null,\"search_engine\");\n if(value != null) {\n this.searchProgram = PepXmlUtils.parseProgram(value);\n }\n value = reader.getAttributeValue(null,\"precursor_mass_type\");\n if(value != null) {\n Param param = new ParamBean(\"precursor_mass_type\", value);\n searchParams.add(param);\n }\n \n value = reader.getAttributeValue(null,\"fragment_mass_type\");\n if(value != null) {\n Param param = new ParamBean(\"fragment_mass_type\", value);\n searchParams.add(param);\n }\n \n // read other interesting elements within the search_summary element\n while(reader.hasNext()) {\n \n int evtType = reader.next();\n \n if (evtType == XMLStreamReader.END_ELEMENT && reader.getLocalName().equalsIgnoreCase(\"search_summary\")) {\n return;\n }\n \n else if(evtType == XMLStreamReader.START_ELEMENT) {\n if(reader.getLocalName().equalsIgnoreCase(\"search_database\")) {\n this.searchDatabase = new SearchDatabase();\n searchDatabase.setServerPath(reader.getAttributeValue(null, \"local_path\"));\n }\n else if(reader.getLocalName().equalsIgnoreCase(\"enzymatic_search_constraint\")) {\n readMaxNumInternalCleavages(reader);\n readMinEnzymaticTermini(reader);\n }\n else if (reader.getLocalName().equalsIgnoreCase(\"aminoacid_modification\")) {\n readResidueModification(reader);\n }\n else if (reader.getLocalName().equalsIgnoreCase(\"terminal_modification\")) {\n readTerminalModification(reader);\n }\n else if (reader.getLocalName().equalsIgnoreCase(\"parameter\")) {\n readParameters(reader);\n }\n }\n }\n }", "public void setSummary(boolean summary) {\n\n this.summary = summary;\n }", "public String getSummary();", "public abstract CharSequence getSummary();", "public void setSummary(java.lang.Boolean summary) {\n this.summary = summary;\n }", "public String getSummary() {\n return summary;\n }", "public void xsetSummary(org.apache.xmlbeans.XmlString summary)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(SUMMARY$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(SUMMARY$18);\n }\n target.set(summary);\n }\n }", "public String getSummary()\r\n {\r\n // String variables to hold summary\r\n String summary = this.myEntry;\r\n\r\n //Each word is seperated by a space so the method should count 9 spaces or less\r\n int spaceCount = 0;\r\n // Variable to store the current index of the word\r\n // while ten words havent been found or blog post is finished\r\n int subscript = 0;\r\n // While loop\r\n while(spaceCount <= 9 && subscript < this.myEntry.length())\r\n {\r\n String nextChar = this.myEntry.substring(subscript, subscript + 1);\r\n // Check if space\r\n if (nextChar.equals(\" \"))\r\n {\r\n if (spaceCount <= 9)\r\n spaceCount++;\r\n else\r\n break;\r\n }\r\n summary = summary + nextChar;\r\n subscript++;\r\n }\r\n return summary;\r\n }", "public void buildSummary(XMLNode node, Content packageContentTree) {\n Content summaryContentTree = packageWriter.getSummaryHeader();\n buildChildren(node, summaryContentTree);\n packageContentTree.addContent(summaryContentTree);\n }", "private void handleAllStartTags(Tag tagReturnedFromParse, MutableAttributeSet attributeSetReturnedFromParse, int pos) {\n\tif (StepsToFollow == null) {\n\t initializeStepsToFollow();\n\t}\n\tStepsToFollow.processNextStep();\n\ttry {\n\t if (StepsToFollow.tagToFind == null) {\n\t\tthis.strImageDate = StepsToFollow.getStrImageDate();\n\t\tthis.strImageUrl = StepsToFollow.getStrImageUrl();\n//\t\tthis.ldImageDate = StepsToFollow.getLdImageDate();\n\t\tthis.setStrImageWebPageUrlForPreviousDay(StepsToFollow.getStrPrevWebPageUrl());\n\t } else {\n\t\tif (StepsToFollow.tagToFind.equals(tagReturnedFromParse)) {\n\t\t if (MyTestStepToCheck != StepsToFollow.intNextStepToCheck) {\n\t\t\tString strTagToFind = StepsToFollow.tagToFind.toString();\n\t\t\tMyTestResults += strTagToFind + \"|\";\n\t\t\tMyTestStepToCheck = StepsToFollow.intNextStepToCheck;\n\t\t }\n\t\t MyResults = objProcessStartTags.processThisTag(tagReturnedFromParse, attributeSetReturnedFromParse, StepsToFollow.tagToFind, StepsToFollow.attributeToFind, StepsToFollow.strValueToFind, StepsToFollow.intLengthOfValueToFind, StepsToFollow.attributeToGetValueFrom);\n\t\t StepsToFollow.checkReturnValues(MyResults);\n\t\t}\n\t }\n\t} catch (Exception e) {\n\t // TODO Auto-generated catch block\n\t // e.printStackTrace();\n\t String myMsg = \"Error:\";\n\t myMsg += NL + \"ArcamaxWebPageHtmlParser\";\n//\t myMsg += NL + \"imageName: \" + this.strImageName;\n\t myMsg += NL + \"Tag returned: \" + tagReturnedFromParse;\n\t myMsg += NL + \"Tag to find: \" + StepsToFollow.tagToFind;\n\t myMsg += NL + \"Next step to check: \" + StepsToFollow.intNextStepToCheck;\n\t System.out.println(myMsg);\n\t}\n\n }", "void xsetSummary(org.apache.xmlbeans.XmlString summary);", "public String printSummary(){\n String ans=\"\";\n for(Sentence sentence : contentSummary){\n //tv_output.setText(sentence.value);\n ans+=sentence.value + \".\";\n }\n return ans;\n }", "public String getSummary() {\n\t\treturn summary;\n\t}", "public String getSummary() {\n\t\treturn summary;\n\t}", "public void summarizeData() {\n\t\t//take json object and populate a POJO\n\t\t\n//\t\tfor(javaObject : x) {\n\t\t\n\t\t\t//new JobSummaryObject\n\t\t\t//\n\t}", "public ExtractedSummarySentence() {}", "org.apache.xmlbeans.XmlString xgetSummary();", "void processTag(XMLNode tag) throws Exception {\n if(tag.type()== XMLNode.Type.TAG){\n state.traceTagBegin(tag.getTag()==null?\"process\":tag.getTag(),null);\n tagstk[tagstkptr++] = tag.getTag();\n \n dataloader.beginTag(tagstk, tagstkptr, tag.getTag(), tag.getAttribs());\n if(tag.getTags()!= null) for(XMLNode nextTag : tag.getTags()){\n processTag(nextTag);\n }\n ((LoadDatamapData)dataloader).endTag(tagstk, tagstkptr, tag, tag.getBody(), tag.getAttribs());\n \n tag.clearRef();\n \n tagstkptr--;\n tagstk[tagstkptr]= null;\n state.traceTagEnd();\n }\n }", "private void readFeed(XmlPullParser parser) throws XmlPullParserException, IOException {\n\n String name;\n\n while (parser.next() != XmlPullParser.END_TAG) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n\n if (complete_flag) {\n break;\n }\n continue;\n }\n name = parser.getName();\n // Starts by looking for the entry tag\n if (name.equals(\"student\")) {\n readEntry(parser);\n } else {\n skip(parser);\n }\n }\n\n }", "private void advanceObjectSummary()\n {\n while (objectSummaryIterator.hasNext() || result.isTruncated() || prefixesIterator.hasNext()) {\n while (objectSummaryIterator.hasNext()) {\n currentObjectSummary = objectSummaryIterator.next();\n // skips directories and empty objects\n if (!isDirectoryPlaceholder(currentObjectSummary) && currentObjectSummary.getSize() > 0) {\n return;\n }\n }\n\n // Exhausted \"objectSummaryIterator\" without finding a non-placeholder.\n if (result.isTruncated()) {\n fetchNextBatch();\n } else if (prefixesIterator.hasNext()) {\n prepareNextRequest();\n fetchNextBatch();\n }\n }\n\n // Truly nothing left to read.\n currentObjectSummary = null;\n }", "public native final String summary() /*-{\n\t\treturn this[\"summary\"];\n\t}-*/;", "public final void mT__131() throws RecognitionException {\n try {\n int _type = T__131;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:129:8: ( 'summary' )\n // InternalMyDsl.g:129:10: 'summary'\n {\n match(\"summary\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void updateAllSummaries() {\r\n for (WjrClassItem classItem : classItems.values()) {\r\n classItem.updateSummary(this);\r\n }\r\n root.updateSummary(this);\r\n }", "public void unsetSummary()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(SUMMARY$18);\n }\n }", "public void PopulateRSSData()\n {\n try\n {\n URL Feed = ParseRSSFromFeed();\n ParseRSS(Feed);\n }\n catch(java.net.MalformedURLException exp)\n {\n String message = exp.getMessage();\n System.out.println(message);\n }\n catch(com.rometools.rome.io.FeedException fexp)\n {\n String message = fexp.getMessage();\n System.out.println(message);\n }\n catch(java.io.IOException ioexp)\n {\n String message = ioexp.getMessage();\n System.out.println(message);\n }\n }", "Boolean getIsSummary();", "void processIntent(Intent intent) {\n Parcelable[] rawMsgs = intent.getParcelableArrayExtra(\n NfcAdapter.EXTRA_NDEF_MESSAGES);\n NdefMessage msg = (NdefMessage) rawMsgs[0];\n String s = new String(msg.getRecords()[0].getPayload());\n nfcTagCode = s.substring(3);\n\n textView.setText(nfcTagCode); // Sets the textview as the Text read from NFC TAG\n }", "private void tagInHeadStatistics(){\n\t\tfinal List<Integer> countNbLinkHead = new ArrayList<>();\n\t\tfinal List<Integer> countNbCssHead = new ArrayList<>();\n\t\tfinal List<Integer> countNbScriptHead = new ArrayList<>();\n\t\tfinal List<Integer> countNbCssLinkHead = new ArrayList<>();\n\t\tElement head = htmlParsed.select(\"head\").first();\n\t\thead.traverse(new NodeVisitor(){\n\t\t\tString attributeValue = \"\"; \n\t\t\tpublic void head(Node node, int depth){\n\t\t\t\tif (node instanceof Element){\n\t\t\t\t\tElement tag = (Element) node;\n\t\t\t\t\tif(tag.tagName().equals(\"script\"))\n\t\t\t\t\t\tcountNbScriptHead.add(1);\n\t\t\t\t\telse if(tag.tagName().equals(\"style\"))\n\t\t\t\t\t\tcountNbCssHead.add(1);\n\t\t\t\t\telse if(tag.tagName().equals(\"link\")){\n\t\t\t\t\t\tcountNbLinkHead.add(1);\n\t\t\t\t\t\tattributeValue = tag.attr(\"rel\");\n\t\t\t\t\t\tif(attributeValue.equals(\"stylesheet\"))\n\t\t\t\t\t\t\tcountNbCssLinkHead.add(1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void tail(Node node, int depth) {\n\t\t }\n\t\t});\n\t\thtmlStatistics.put(\"link_head\",(double) countNbLinkHead.size());\n\t\thtmlStatistics.put(\"css_code_head\", (double) countNbCssHead.size());\n\t\thtmlStatistics.put(\"script_tag_head\", (double) countNbScriptHead.size());\n\t\thtmlStatistics.put(\"link_css_head\", (double) countNbCssLinkHead.size());\n\t}", "public Item2Vector<Summary> getSummaries() { return summaries; }", "@Override\n @IcalProperty(pindex = PropertyInfoIndex.SUMMARY,\n jname = \"summary\",\n adderName = \"summary\",\n analyzed = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true)\n public void setSummaries(final Set<BwString> val) {\n summaries = val;\n }", "public void sortByPatternSummary() {\n\n\t\t// get the Correct and incorrect words count displayed in respective\n\t\t// column\n\t\tList<WebElement> correctCount = LocatorWebElements(CORRECT_ANSWERS);\n\t\tList<WebElement> incorrectCount = LocatorWebElements(INCORRECT_ANSWERS);\n\n\t\tint correct = correctCount.size();\n\t\tint incorrect = incorrectCount.size();\n\t\tint total_question = correct + incorrect;\n\t\tSystem.out.println(total_question);\n\n\t\tString correctAnswersCount = Integer.toString(correctCount.size());\n\t\tString incorrectAnswersCount = Integer.toString(incorrectCount.size());\n\n\t\tString summaryCorrectCount = driver.findElement(SUMMARY_HEADER_CORRECT_COUNT).getText();\n\t\tSystem.out.println(\"Correct count dispalyed in summary Page:\" + summaryCorrectCount);\n\n\t\tString summaryquestionscount = driver.findElement(SUMMARY_HEADER_QUES_COUNT).getText();\n\t\tSystem.out.println(\"Number of questions displayed in the summary header:\" + summaryquestionscount);\n\n\t\t// compare the correct answers count with the correct count displayed in\n\t\t// the\n\t\t// summary header\n\t\tif ((summaryCorrectCount.equals(correctAnswersCount))\n\t\t\t\t&& (summaryquestionscount.contains(Integer.toString(total_question)))) {\n\t\t\tSystem.out.println(\"Correct count is matched with the Correct count dispalyed in the Summary header\");\n\t\t\tsafeClick(SUMMARY_CONTINUE_BTN);\n\t\t} else {\n\n\t\t\tSystem.out.println(\"count not matching\");\n\t\t}\n\n\t}", "protected void updateSummaries() { }", "protected void updateSummaries() { }", "public Boolean getIsSummary() { \n\t\treturn getIsSummaryElement().getValue();\n\t}", "private static void buildSummaryNode(Document document, NodeList childList, Node newHead) {\n Element sumNode = document.createElement(\"item\");\n Element sumID = document.createElement(\"id\");\n Element sumParent = document.createElement(\"parent\");\n Element innerItem = document.createElement(\"item\");\n sumParent.appendChild(innerItem);\n sumNode.appendChild(sumID);\n sumNode.appendChild(sumParent);\n for (int i = 0; i < childList.getLength(); i++) {\n Node current = childList.item(i);\n if (current.getNodeName().equals(\"id\"))\n sumID.setTextContent(current.getTextContent());\n else if (current.getNodeName().equals(\"parent\"))\n innerItem.setTextContent(current.getTextContent());\n }\n newHead.appendChild(sumNode);\n }", "@JsonProperty(\"summary\")\n public String getSummary() {\n return summary;\n }", "@Override\n\tpublic String getSummary() {\n\t\treturn null;\n\t}", "public void readPullTrafficSummary() {\n\t\ttry {\n\t\t\tMessage message = new TrafficSummary (node.ipAddr,node.portNum, node.getSendTracker(), node.getSendSummation(),node.getReceiveTracker(),node.getReceiveSummation(),node.getRelayTracker());\n\t\t\tSocket socketReturn = node.getConnections().getSocketWithName(node.getRegistryName());\n\t\t\tnew TCPSender (socketReturn, message);\n\t\t} catch (IOException e) { e.printStackTrace();}\n\t\tnode.resetTrafficStats();\t\t//reset node statistics after sent for ease of testing multiple runs\n\t}", "@Override\n\tpublic void wrapSummary(Customer model, HttpServletRequest request) {\n\t\t\n\t}", "public boolean isSummary() {\n\n return this.summary;\n }", "@Override\r\n\tpublic void parseEndElement(String tagName, Object content,\r\n\t\t\tString namespaceUri, String qualifiedName, SaxResultParser parser)\r\n\t\t\tthrows SAXException {\n\t\tif (tagName.equalsIgnoreCase(\"status\")) {\r\n\t\t\tstatus = (String)content;\r\n\t\t} else if (tagName.equalsIgnoreCase(\"http_attribution\")) {\r\n\t\t\thttp_attrs.add((String)content);\r\n\t\t} else if (tagName.equalsIgnoreCase(\"result\")) {\r\n\t\t\titems.add((GooglePlaceItem)content);\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n\tpublic String getSummary() {\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"rawtypes\")\n\tpublic void buildMemberSummary(List elements) throws Exception {\n\t\tCustomMemberSummaryBuilder.getInstance(writer, configuration, targetContractMap).build(elements);\n\n\t\twriter.completeMemberSummaryBuild();\n\t}", "public void setSummary(String summary){\n\t String text = this.text;\n\t String s = \"\";\n // The ontology file format is described here:\n // https://trac.nbic.nl/data-mining/wiki/ErasmusMC%20ontology%20file%20format\n //final String ontologyPath = \"C:/Users/Nasko/Desktop/School/Project/semweb-peregrine.txt\"; // EDIT HERE\n\t final String ontologyPath = System.getProperty(\"user.home\") + \"/peregrine/\" + vocab + \"-peregrine.txt\";\n final Ontology ontology = new SingleFileOntologyImpl(ontologyPath);\n\n //final String propertiesDirectory = \"C:/Users/Nasko/Desktop/School/Project/lvg2006lite/data/config/\"; // EDIT HERE\n final String propertiesDirectory = System.getProperty(\"user.home\") + \"/peregrine/lvg2006lite/data/config/\";\n final Peregrine peregrine = createPeregrine(ontology, propertiesDirectory + \"lvg.properties\");\n //final String text = \"This is a simple sentence with labels like earley, bielefeld, task model ontology, etc. \" +\n // \"and immunoglobulin production, elsevier, Christian Morbidoni, Austria, Swingly, many terms like r2rml.\";\n final List<IndexingResult> indexingResults = peregrine.indexAndDisambiguate(text, Language.EN);\n\n //System.out.println(\"Number of indexing results found: \" + indexingResults.size() + \".\");\n this.summary = \"\";\n for (final IndexingResult indexingResult : indexingResults) {\n final Serializable conceptId = indexingResult.getTermId().getConceptId();\n //System.out.println();\n //System.out.println(\"- Found concept with id: \" + conceptId + \", matched text: \\\"\"\n // + text.substring(indexingResult.getStartPos(), indexingResult.getEndPos() + 1) + \"\\\".\");\n String matchedText = text.substring(indexingResult.getStartPos(), indexingResult.getEndPos() + 1);\n \n /* \n * Get the Term context - but lock it within a sentance.\n */\n String termContext = \"\";\n int cStart;\n int cEnd;\n //Get Start position of \"context\" text\n if(indexingResult.getStartPos()-15 <= indexingResult.getSentenceStartPos()) cStart = indexingResult.getSentenceStartPos();\n else {\n \t int cS = indexingResult.getStartPos()-15;\n \t cStart = indexingResult.getStartPos() - (15-text.substring(cS, indexingResult.getStartPos() + 1).indexOf(\" \")) + 1;\n }\n \n //Get End position of \"context\" text\n if(indexingResult.getEndPos()+15 >= indexingResult.getSentenceEndPos()) cEnd = indexingResult.getSentenceEndPos();\n else {\n \t int cE = indexingResult.getEndPos()+15;\n \t cEnd = indexingResult.getEndPos() + text.substring(indexingResult.getEndPos(), cE).lastIndexOf(\" \") + 1; \n }\n \n termContext = text.substring(cStart, cEnd).trim();\n /*String[] toTrim = text.substring(cStart, cEnd + 1).split(\" \");\n String[] trimmed = Arrays.copyOfRange(toTrim, 1, toTrim.length-1);\n termContext = StringUtils.join(trimmed, \" \");*/\n \n s = \"- Found concept with id: \" + conceptId + \", matched text: \\\"\"\n + matchedText + \"\\\".\";\n final Concept concept = ontology.getConcept(conceptId);\n final String preferredLabelText = LabelTypeComparator.getPreferredLabel(concept.getLabels()).getText();\n //System.out.println(\" Preferred concept label is: \\\"\" + preferredLabelText + \"\\\".\");\n s += \" Preferred concept label is: \\\"\" + preferredLabelText + \"\\\".\";\n this.summary += s + Math.random()*10;\n TaggedTerm t = new TaggedTerm();\n t.setMatchedText(matchedText);\n t.setPrefLabel(preferredLabelText);\n \n \n //Set the label\n String definition = \"\";\n String hierarchy = \"\";\n \n for(Label d : concept.getLabels()){\n \t if(d.getText().contains(\"|DEFINITION|\")){\n \t\t definition = d.getText().replace(\"|DEFINITION|\", \"\");\n \t\t break;\n \t }\n }\n \n for(Label d : concept.getLabels()){\n \t if(d.getText().contains(\"|HIERARCHY|\")){\n \t\t if(!hierarchy.equals(\"\")) hierarchy += \";;\" + d.getText().replace(\"TM |HIERARCHY|\", \"\");\n \t\t else hierarchy += d.getText().replace(\"TM |HIERARCHY|\", \"\");\n \t\t break;\n \t }\n }\n \n \n \n \n \n t.setDefinition(definition);\n t.setHierarchy(hierarchy);\n t.setTermContext(termContext);\n this.taggedTerms.add(t);\n definition = \"\";\n hierarchy = \"\";\n }\n }", "public void buildClassSummary(XMLNode node, Content summaryContentTree) {\n String classTableSummary =\n configuration.getText(\"doclet.Member_Table_Summary\",\n configuration.getText(\"doclet.Class_Summary\"),\n configuration.getText(\"doclet.classes\"));\n String[] classTableHeader = new String[] {\n configuration.getText(\"doclet.Class\"),\n configuration.getText(\"doclet.Description\")\n };\n ClassDoc[] classes =\n packageDoc.isIncluded()\n ? packageDoc.ordinaryClasses()\n : configuration.classDocCatalog.ordinaryClasses(\n Util.getPackageName(packageDoc));\n classes = Util.filterOutPrivateClasses(classes, configuration.javafx);\n if (classes.length > 0) {\n packageWriter.addClassesSummary(\n classes,\n configuration.getText(\"doclet.Class_Summary\"),\n classTableSummary, classTableHeader, summaryContentTree);\n }\n }", "public java.lang.String getSummary()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SUMMARY$18);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public boolean is_set_summary() {\n return this.summary != null;\n }", "public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) {\n String annotationtypeTableSummary =\n configuration.getText(\"doclet.Member_Table_Summary\",\n configuration.getText(\"doclet.Annotation_Types_Summary\"),\n configuration.getText(\"doclet.annotationtypes\"));\n String[] annotationtypeTableHeader = new String[] {\n configuration.getText(\"doclet.AnnotationType\"),\n configuration.getText(\"doclet.Description\")\n };\n ClassDoc[] annotationTypes =\n packageDoc.isIncluded()\n ? packageDoc.annotationTypes()\n : configuration.classDocCatalog.annotationTypes(\n Util.getPackageName(packageDoc));\n annotationTypes = Util.filterOutPrivateClasses(annotationTypes, configuration.javafx);\n if (annotationTypes.length > 0) {\n packageWriter.addClassesSummary(\n annotationTypes,\n configuration.getText(\"doclet.Annotation_Types_Summary\"),\n annotationtypeTableSummary, annotationtypeTableHeader,\n summaryContentTree);\n }\n }", "private void cleanupRawTags(ArrayList p_tags)\n {\n // Find the paired tags that belong together.\n // !!! DO NOT RELY ON PAIRING STATUS. Some prop changes start\n // after <seg> but close after </seg> and even after </tu>!!!\n assignPairingStatus(p_tags);\n\n // Basic cleanup: remove surrounding <p> and inner <o:p>\n removeParagraphTags(p_tags);\n\n // Remove revision markers when they were ON accidentally\n // before translating documents or during an alignment task\n // (WinAlign).\n removePropRevisionMarkers(p_tags);\n\n // Cleanup INS/DEL revisions similarly.\n removeDelRevisions(p_tags);\n applyInsRevisions(p_tags);\n\n // WinAligned files can contain endnotes (and footnotes, but I\n // think in Word-HTML they're both endnotes).\n removeEndNotes(p_tags);\n\n // Remove empty spans that are created from superfluous\n // original formatting in Word (<span color=blue></span>)\n removeEmptyFormatting(p_tags);\n\n // Leave the rest to the Word-HTML Extractor.\n }", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t\tStringTokenizer st = new StringTokenizer(outcome, \" \");\r\n\t\t//Initializing modified summary\r\n\t\tmodifiedSummary = new String();\r\n\t\t\r\n\t\twhile(st.hasMoreTokens()){\r\n\t\t\t\r\n\t\t\tString temp = st.nextToken();\r\n\t\t\t//String buffer is thread safe as concatenation is synced\r\n\t\t\tStringBuffer moded = new StringBuffer();\r\n\t\t\tmoded.append(temp.substring(0,1).toUpperCase());\r\n\t\t\tmoded.append(temp.substring(1));\r\n\t\t\t\r\n\t\t\tif(st.hasMoreTokens())\r\n\t\t\t\tmodifiedSummary = modifiedSummary + moded + \" \" ;\r\n\t\t\telse\r\n\t\t\t\tmodifiedSummary = modifiedSummary + moded;\r\n\t\t}\r\n\t\t\r\n\t}", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/lib/Analysis/ProfileSummaryInfo.cpp\", line = 57,\n FQN=\"llvm::ProfileSummaryInfo::computeSummary\", NM=\"_ZN4llvm18ProfileSummaryInfo14computeSummaryEv\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.analysis/llvmToClangType ${LLVM_SRC}/llvm/lib/Analysis/ProfileSummaryInfo.cpp -nm=_ZN4llvm18ProfileSummaryInfo14computeSummaryEv\")\n //</editor-fold>\n private void computeSummary() {\n if (Summary.$bool()) {\n return;\n }\n Metadata /*P*/ SummaryMD = M.getProfileSummary();\n if (!(SummaryMD != null)) {\n return;\n }\n Summary.reset(ProfileSummary.getFromMD(SummaryMD));\n }", "private void processTags() {\r\n tagNames.stream().map(name -> {\r\n tags.get(name).checkMembers();\r\n return name;\r\n }).forEach(name -> {\r\n if (!tags.get(name).hasMembers()) {\r\n menu.remove(tags.get(name).getMenu());\r\n tags.remove(name);\r\n tagNames.remove(name);\r\n } else {\r\n menu.add(tags.get(name).getMenu());\r\n }\r\n });\r\n }", "protected void handleEnd(HtmlDocument.EndTag tag) {\n TagWrapper lastSeen;\n HTML.Element element = tag.getElement();\n while ((lastSeen = mSeenTags.poll()) != null && lastSeen.tag.getElement() != null &&\n !lastSeen.tag.getElement().equals(element)) { }\n\n // Misformatted html, just ignore this tag\n if (lastSeen == null) {\n return;\n }\n\n Object marker = null;\n if (HTML4.B_ELEMENT.equals(element)) {\n // BOLD\n marker = new StyleSpan(Typeface.BOLD);\n } else if (HTML4.I_ELEMENT.equals(element)) {\n // ITALIC\n marker = new StyleSpan(Typeface.ITALIC);\n } else if (HTML4.U_ELEMENT.equals(element)) {\n // UNDERLINE\n marker = new UnderlineSpan();\n } else if (HTML4.A_ELEMENT.equals(element)) {\n // A HREF\n HtmlDocument.TagAttribute attr = lastSeen.tag.getAttribute(HTML4.HREF_ATTRIBUTE);\n // Ignore this tag if it doesn't have a link\n if (attr == null) {\n return;\n }\n marker = new URLSpan(attr.getValue());\n } else if (HTML4.BLOCKQUOTE_ELEMENT.equals(element)) {\n // BLOCKQUOTE\n marker = new QuoteSpan();\n } else if (HTML4.FONT_ELEMENT.equals(element)) {\n // FONT SIZE/COLOR/FACE, since this can insert more than one span\n // we special case it and return\n handleFont(lastSeen);\n }\n\n final int start = lastSeen.startIndex;\n final int end = mBuilder.length();\n if (marker != null && start != end) {\n mBuilder.setSpan(marker, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n }\n }", "protected void readFullTagValue(ExifTag tag) throws IOException {\n short type = tag.getDataType();\n if (type == ExifTag.TYPE_ASCII || type == ExifTag.TYPE_UNDEFINED ||\n type == ExifTag.TYPE_UNSIGNED_BYTE) {\n int size = tag.getComponentCount();\n if (mCorrespondingEvent.size() > 0) {\n if (mCorrespondingEvent.firstEntry().getKey() < mTiffStream.getReadByteCount()\n + size) {\n Object event = mCorrespondingEvent.firstEntry().getValue();\n if (event instanceof ImageEvent) {\n // Tag value overlaps thumbnail, ignore thumbnail.\n Timber.w(\"Thumbnail overlaps value for tag: \\n\" + tag.toString());\n Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();\n Timber.w(\"Invalid thumbnail offset: \" + entry.getKey());\n } else {\n // Tag value overlaps another tag, shorten count\n if (event instanceof IfdEvent) {\n Timber.w(\"Ifd \" + ((IfdEvent) event).ifd\n + \" overlaps value for tag: \\n\" + tag.toString());\n } else if (event instanceof ExifTagEvent) {\n Timber.w(\"Tag value for tag: \\n\"\n + ((ExifTagEvent) event).tag.toString()\n + \" overlaps value for tag: \\n\" + tag.toString());\n }\n size = mCorrespondingEvent.firstEntry().getKey()\n - mTiffStream.getReadByteCount();\n Timber.w(\"Invalid size of tag: \\n\" + tag.toString()\n + \" setting count to: \" + size);\n tag.forceSetComponentCount(size);\n }\n }\n }\n }\n switch (tag.getDataType()) {\n case ExifTag.TYPE_UNSIGNED_BYTE:\n case ExifTag.TYPE_UNDEFINED: {\n byte buf[] = new byte[tag.getComponentCount()];\n read(buf);\n tag.setValue(buf);\n }\n break;\n case ExifTag.TYPE_ASCII:\n tag.setValue(readString(tag.getComponentCount()));\n break;\n case ExifTag.TYPE_UNSIGNED_LONG: {\n long value[] = new long[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedRational();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_UNSIGNED_SHORT: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readUnsignedShort();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_LONG: {\n int value[] = new int[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readLong();\n }\n tag.setValue(value);\n }\n break;\n case ExifTag.TYPE_RATIONAL: {\n Rational value[] = new Rational[tag.getComponentCount()];\n for (int i = 0, n = value.length; i < n; i++) {\n value[i] = readRational();\n }\n tag.setValue(value);\n }\n break;\n }\n if (LOGV) {\n Timber.v(\"\\n\" + tag.toString());\n }\n }", "public static void clearSummaryCache() {\n summary_cache.clear();\n ConcreteTypeNode.FACTORY.clear();\n ConcreteTypeNode.FACTORY2.clear();\n ConcreteObjectNode.FACTORY.clear();\n UnknownTypeNode.FACTORY.clear();\n ReturnValueNode.FACTORY.clear();\n ThrownExceptionNode.FACTORY.clear();\n FieldNode.FACTORY.clear();\n GlobalNode.FACTORY.clear();\n GlobalNode.GLOBAL = GlobalNode.get((jq_Method) null);\n }", "@Override\n public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {\n // <document>\n if (localName.equals(\"document\")) {\n curArticle = new ArticleSmallOpinion();\n curTagiot = new ArrayList<Tagit>();\n\n // add values\n if (atts.getValue(\"doc_id\") != null) curArticle.setDoc_id(atts.getValue(\"doc_id\"));\n if (atts.getValue(\"title\") != null) curArticle.setTitle(atts.getValue(\"title\"));\n if (atts.getValue(\"sub_title\") != null) curArticle.setSubTitle(atts.getValue(\"sub_title\"));\n if (atts.getValue(\"f7\") != null) curArticle.setF7(atts.getValue(\"f7\"));\n String author = atts.getValue(\"author_icon\");\n author = extractImageUrl(author);\n if (atts.getValue(\"author_icon\") != null) curArticle.setAuthorImgURL(author);\n if (atts.getValue(\"Created_On\") != null) curArticle.setCreatedOn(atts.getValue(\"Created_On\"));\n\n }\n // <f2>\n else if (localName.equals(\"f2\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF2(atts.getValue(\"src\"));\n\n // currently not holding image photographer via \"title=\"\n }\n // <f3>\n if (localName.equals(\"f3\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF3(atts.getValue(\"src\"));\n // currently not holding image photographer via \"title=\"\n }\n // <f4>\n else if (localName.equals(\"f4\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF4(atts.getValue(\"src\"));\n // currently not holding image photographer via \"title=\"\n }\n // <tagit>\n else if (localName.equals(\"tagit\")) {\n Tagit tagit = new Tagit(atts.getValue(\"id\"), atts.getValue(\"simplified\"), \"\");\n curTagiot.add(tagit);\n }\n\n }", "private static final void displayAttractionSummary()\r\n {\r\n System.out.println(\"Display Attraction Summary Feature Selected!\");\r\n System.out.println(\"--------------------------------------\");\r\n \r\n // step through array of attractions with for loop\r\n for(int i = 0; i < attractionCount; i++)\r\n {\r\n attractionList[i].printDetails();\r\n System.out.println();\r\n }\r\n }", "@Override\n\tpublic String getSummary(Locale locale) {\n\t\treturn \"Title: \" + _dataset.getTitle();\n\t}", "void applySummary(Operation operation, Method method);", "public void testBlogEntryHasTagsAndMediaIsNewsfeed() throws Exception {\n Category category = new Category(\"/java\", \"Java\");\n category.setBlog(blog);\n category.setTags(\"java\");\n blogEntry.addCategory(category);\n blogEntry.setExcerpt(\"Excerpt - here is some text\");\n blogEntry.setBody(\"Body - here is some text\");\n blogEntry.setTags(\"junit, automated unit testing\");\n context.setMedia(ContentDecoratorContext.NEWS_FEED);\n decorator.decorate(context, blogEntry);\n\n StringBuffer tags = new StringBuffer();\n// tags.append(\"<!--<div class=\\\"tags\\\">Tags : \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/automated+unit+testing\\\" rel=\\\"tag\\\">automated unit testing</a>, \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/junit\\\" rel=\\\"tag\\\">junit</a>, \");\n// tags.append(\"<a href=\\\"http://technorati.com/tag/java\\\" rel=\\\"tag\\\">java</a>\");\n// tags.append(\"</div>-->\");\n\n assertEquals(\"Excerpt - here is some text\" + tags, blogEntry.getExcerpt());\n assertEquals(\"Body - here is some text\" + tags, blogEntry.getBody());\n }", "private void updateSummary() {\n Bitmap cardBack;\n\n int selectedBackground = prefs.getSavedCardBackground();\n int selectedBackgroundColor = prefs.getSavedCardBackgroundColor();\n\n cardBack = bitmaps.getCardBack(selectedBackground, selectedBackgroundColor);\n\n image.setImageBitmap(cardBack);\n setSummary(String.format(Locale.getDefault(), \"%s %s\",\n context.getString(R.string.settings_background), selectedBackground + 1));\n }", "public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)\n\t\tthrows IOException,SAXException,TikaException {\n\n\t\t// Get metadata\n\t\tthis.mdata = metadata;\n\n\t\t// Read in all text\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line = reader.readLine();\n\t\tString text = \"\";\n\t\twhile (line != null) {\n\t\t\ttext += line;\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\n\t\ttry {\n\t\t\t// Get NER results from each NER toolkit.\n\t\t\tthis.openNLPEntities = this.openNLPParse(text);\t\n\t\t\tthis.coreNLPEntities = this.coreNLPParse(text);\t\n\t\t\tthis.nltkEntities = this.nltkParse(text);\n\t\t\tthis.gQMeasurements = this.gQParse(text);\n\n\t\t\t// Combine results and add to metadata.\n\t\t\tMap<String, Map<String,Integer>> combo = combineResults();\n\t\t\tString json = mapToJSON(combo);\n\t\t\tString openNLPJSON = mapToJSON(this.openNLPEntities);\n\t\t\tString coreNLPJSON = mapToJSON(this.coreNLPEntities);\n\t\t\tString nltkJSON = mapToJSON(this.nltkEntities);\n\t\t\tpushToMetadata(\"openNLP entities\", openNLPJSON);\n\t\t\tpushToMetadata(\"coreNLP entities\", coreNLPJSON);\n\t\t\tpushToMetadata(\"nltk entities\", nltkJSON);\n\t\t\tpushToMetadata(\"maxJointAgreement\",json);\n\t\t\tpushToMetadata(\"quantities\", this.gQMeasurements);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface SummaryService {\n\n\tlong getOrphanCount(List<Exoplanet> exoplanets);\n\n\tString findPlanetWithHottestStar(List<Exoplanet> exoplanets);\n\n\tList<TimelineEntry> createTimeline(List<Exoplanet> exoplanets);\n}", "@Transactional\n\tpublic List<SnmpEventsProcess> findWhereSummaryEquals(String summary) throws SnmpEventsProcessDaoException\n\t{\n\t\ttry {\n\t\t\treturn jdbcTemplate.query(\"SELECT MARK, MANUFACTURE, RESULTLIST, WARNMESSAGE, SUMMARY FROM \" + getTableName() + \" WHERE SUMMARY = ? ORDER BY SUMMARY\", this,summary);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SnmpEventsProcessDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public void sentenceCompletionSummary() {\n\n\n\t\twaitForSecs(20, \"Waiting for thePage to load\");\n\t\twaitForPageToLoad();\n\t\tAssert.assertTrue(isElementPresent(SUMMARY_HEADER, LONGWAIT),\n\t\t\t\t\"Sentence Completion activity summary page is not being dispalyed \");\n\n\t\tList<WebElement> correctAnswersCount = LocatorWebElements(CORRECT_ANSWERS);\n\t\tList<WebElement> incorrectAnswersCount = LocatorWebElements(INCORRECT_ANSWERS);\n\n\t\tSystem.out.println(\"Correct answers:\" + correctAnswersCount.size());\n\t\tSystem.out.println(\"InCorrect answers:\" + incorrectAnswersCount.size());\n\t\tsafeClick(SUMMARY_CONTINUE);\n\t\twaitForPageToLoad();\n\t\t//waitForSecs(8, \"wait untill audio cross mark is completed\");\n\t\t//closeInstIcon();\n\t\t\n\t\t//waitUntilElementDisappears(SPELLING_AUTOAUDIO);\n\t\t\n\t}", "public Object parseImage(int rssType, Document doc) throws Exception;", "public native final Calendar summary(String val) /*-{\n\t\tthis[\"summary\"] = val;\n\t\treturn this;\n\t}-*/;", "public final void fullInterest( final Collection <String> tags ) {\n Log.d( TAG, \"Sending full interest update with \" + tags.size() + \" item(s).\" );\n\n this.interestList.clear();\n this.interestList.addAll(tags);\n\n final D2DAddInterestNotificationEvent event = new D2DAddInterestNotificationEvent( false );\n event.interestList.addAll( tags );\n this.sendEvent( event );\n }", "private void SummaryProfile() {\n //format the date & number\n DateFormat df = DateFormat.getDateInstance( DateFormat.LONG, Locale.ENGLISH );\n NumberFormat nf = NumberFormat.getCurrencyInstance( new Locale(\"id\",\"id\"));\n \n GregorianCalendar gregorian = new GregorianCalendar( );\n \n String[] displayMonths = new DateFormatSymbols().getMonths();\n \n //month and year variable ( month start from 0, so 0 is january, 11 is december )\n int gregorianmonth = gregorian.get(Calendar.MONTH);\n int gregorianyear = gregorian.get(Calendar.YEAR);\n \n \n //the title of the summary\n //ok, we must use temporary variable because of missmatch with db standard date\n int displaygregorianmonth = gregorianmonth;\n int displaygregorianyear = gregorianyear;\n \n //december watchout\n //if the current month is january ( 0 ) then we must display summary for \n //dec ( 11 ) last year ( current year - 1 )\n if(displaygregorianmonth==0) {\n displaygregorianmonth = 11;\n displaygregorianyear = gregorianyear - 1;\n }\n //if the current month is not january, then just minus it with one, current year is \n //same\n else {\n displaygregorianmonth -= 1;\n }\n DateLB.setText(\"Summary of the Company in \" + \n displayMonths[displaygregorianmonth] + \" \" + displaygregorianyear );\n \n //the summary report ( month start from 1 so no need minus anymore )\n SummarySaleLB.setText( \"Total Value of Sale Transaction : \" +\n nf.format( reportdb.TotalSaleValue( gregorianmonth,\n gregorianyear ) ) );\n SummaryPurchaseLB.setText( \"Total Value of Purchase Transaction : \" +\n nf.format( reportdb.TotalPurchaseValue( gregorianmonth,\n gregorianyear ) ) );\n SummarySalesmanCommisionLB.setText( \"Total Value of Salesman Commision Transaction : \" +\n nf.format( reportdb.TotalSalesmanCommisionValue( gregorianmonth,\n gregorianyear ) ) );\n SummarySalaryPaymentLB.setText( \"Total Value of Salary Payment Transaction : \" + \n nf.format( reportdb.TotalSalaryPaymentValue( gregorianmonth,\n gregorianyear ) ) );\n SummaryChargesLB.setText( \"Total Value of Outcome Payment Transaction : \" +\n nf.format( reportdb.TotalOutcomeValue( gregorianmonth,\n gregorianyear ) ) );\n \n }", "public static void processFeed(FeedContext fc) {\n\n String feedUrl = fc.getFeedUrl();\n mLog.info(\"Processing Atom feed at URL: \" + feedUrl);\n\n try {\n AbderaAtomParser atomParser = new AbderaAtomParser(new URL(feedUrl));\n atomParser.persistFeed(fc);\n\n mLog.info(\"Finished processing Atom feed at URL \" + feedUrl);\n }\n catch (MalformedURLException url_e) {\n mLog.error(\"MalformedURL found for \" + fc.getFeedUrl());\n }\n catch (ArrayIndexOutOfBoundsException a) {\n // this happens if the feed is empty (typically an activity stream),\n // need a better way to track this though\n \tmLog.warn(\"Feed at URL [\" + feedUrl + \"] is probably empty, but this \" +\n \t\t\t\"exception should have been prevented.\");\n }\n catch (Exception e) {\n mLog.error(\"Error processing feed at [\" + fc.getFeedUrl() + \"]: \" + e.getMessage());\n }\n catch (Throwable t) {\n mLog.error(\"Error processing feed at [\" + fc.getFeedUrl() + \"]: \" + t.getMessage());\n }\n }", "protected void handleStart(HtmlDocument.Tag tag) {\n if (!tag.isSelfTerminating()) {\n // Add to the stack of tags needing closing tag\n mSeenTags.push(new TagWrapper(tag, mBuilder.length()));\n }\n }", "public void testUpdateSummary() throws Exception {\r\n System.out.println(\"updateSummary\");\r\n LocalDate date = null;\r\n Summarizer instance = null;\r\n instance.updateSummary(date);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "Observable<SummaryResponse> fetchSummary();", "protected Collection<ArticleMetadata> modifyAMList(SourceXmlSchemaHelper helper,\n CachedUrl datasetCu, List<ArticleMetadata> allAMs) {\n\n Matcher mat = TOP_METADATA_PATTERN.matcher(datasetCu.getUrl());\n Pattern ARTICLE_METADATA_PATTERN = null;\n if (mat.matches()) {\n // must create this here because it is specific to this tar set\n String pattern_string = \"^\" + mat.group(1) + mat.group(2) + \"[A-Z]\\\\.tar!/\" + mat.group(2) + \"/.*/main\\\\.xml$\";\n log.debug3(\"Iterate and find the pattern: \" + pattern_string);\n ARTICLE_METADATA_PATTERN = Pattern.compile(pattern_string, Pattern.CASE_INSENSITIVE);\n\n // Limit the scope of the iteration to only those TAR archives that share this tar number\n List<String> rootList = createRootList(datasetCu, mat);\n // Now create the map of files to the tarfile they're in\n ArchivalUnit au = datasetCu.getArchivalUnit();\n SubTreeArticleIteratorBuilder articlebuilder = new SubTreeArticleIteratorBuilder(au);\n SubTreeArticleIterator.Spec artSpec = articlebuilder.newSpec();\n // Limit it just to this group of tar files\n artSpec.setRoots(rootList); \n artSpec.setPattern(ARTICLE_METADATA_PATTERN); // look for url-ending \"main.xml\" files\n artSpec.setExcludeSubTreePattern(NESTED_ARCHIVE_PATTERN); //but do not descend in to any underlying archives\n artSpec.setVisitArchiveMembers(true);\n articlebuilder.setSpec(artSpec);\n articlebuilder.addAspect(MAIN_XML_PATTERN,\n XML_REPLACEMENT,\n ArticleFiles.ROLE_ARTICLE_METADATA);\n\n for (SubTreeArticleIterator art_iterator = articlebuilder.getSubTreeArticleIterator();\n art_iterator.hasNext(); ) {\n // because we haven't set any roles, the AF will be what the iterator matched\n String article_xml_url = art_iterator.next().getFullTextCu().getUrl();\n log.debug3(\"tar map iterator found: \" + article_xml_url);\n int tarspot = StringUtil.indexOfIgnoreCase(article_xml_url, \".tar!/\");\n int dividespot = StringUtil.indexOfIgnoreCase(article_xml_url, \"/\", tarspot+6);\n TarContentsMap.put(article_xml_url.substring(dividespot + 1), article_xml_url);\n log.debug3(\"TarContentsMap add key: \" + article_xml_url.substring(dividespot + 1));\n }\n } else {\n log.warning(\"ElsevierDTD5: Unable to create article-level map for \" + datasetCu.getUrl() + \" - metadata will not include article titles or useful access.urls\");\n }\n return allAMs;\n }", "private void processTag(String p_content)\n {\n StringBuffer tagName = new StringBuffer();\n Hashtable attributes = new Hashtable();\n boolean bEndTag;\n\n int i = eatWhitespaces(p_content, 0);\n\n bEndTag = i < p_content.length() && p_content.charAt(i) == '/';\n\n //read the tag name...\n while (i < p_content.length() &&\n !Character.isWhitespace(p_content.charAt(i)))\n {\n tagName.append(p_content.charAt(i));\n\n i++;\n }\n\n i = eatWhitespaces(p_content, i);\n\n //read the attributes...\n StringBuffer attributeName = new StringBuffer();\n StringBuffer attributeValue = new StringBuffer();\n\n while (i < p_content.length())\n {\n try\n {\n i = eatWhitespaces(p_content, i);\n\n //read the name...\n while (!Character.isWhitespace(p_content.charAt(i)) &&\n p_content.charAt(i) != '=')\n {\n attributeName.append(p_content.charAt(i));\n i++;\n }\n\n i = eatWhitespaces(p_content, i);\n if (p_content.charAt(i) == '=')\n {\n while (p_content.charAt(i) != '\"')\n {\n i++;\n }\n i++;\n while (p_content.charAt(i) != '\"')\n {\n attributeValue.append(p_content.charAt(i));\n i++;\n }\n i++;\n }\n\n attributes.put(attributeName.toString(),\n attributeValue.toString());\n\n attributeName.setLength(0);\n attributeValue.setLength(0);\n }\n catch (IndexOutOfBoundsException e)\n {\n // tough luck the TMX wasn't as well written as we thought...\n // CvdL: TODO: throw an exception!!\n }\n }\n\n if (bEndTag)\n {\n m_handler.processEndTag(tagName.substring(1),\n \"<\" + p_content + \">\");\n }\n else\n {\n m_handler.processTag(tagName.toString(), attributes,\n \"<\" + p_content + \">\");\n }\n }", "int processRunSummary(String line) {\n try {\n if (!lineMatchesPattern(line, COMPLETE_PATTERN)) {\n throw new RuntimeException(\"Failed to parse summary line: \" + line);\n }\n int passed = Integer.parseInt(mCurrentMatcher.group(2));\n int failed = Integer.parseInt(mCurrentMatcher.group(3));\n int ignored = Integer.parseInt(mCurrentMatcher.group(4));\n return passed + failed + ignored;\n } catch (NumberFormatException e) {\n // this should never happen, since regular expression matches on digits\n throw new RuntimeException(\"Failed to parse number in \" + line);\n }\n }", "void printResultSummary(ResultsSummary s, Consumer<String> messageWriter) {\n if ( s.getFeaturesPending() > 0) {\n messageWriter.accept(format(\"%nFeatures (total:%d) (passed:%d) (pending:%d) (failed:%d)\",\n s.getTotalFeatures(),\n s.getFeaturesPassed(),\n s.getFeaturesPending(),\n s.getFeaturesFailed()));\n } else {\n messageWriter.accept(format(\"%nFeatures (total:%d) (passed:%d) (failed:%d)\",\n s.getTotalFeatures(),\n s.getFeaturesPassed(),\n s.getFeaturesFailed()));\n }\n\n //only show the pending count if there were pending steps, makes the summary more legible\n if ( s.getScenariosPending() > 0 ) {\n //print scenarios summary\n messageWriter.accept(format(\"Scenarios (total:%d) (passed:%d) (pending:%d) (failed:%d)\",\n s.getTotalScenarios(),\n s.getScenariosPassed(),\n s.getScenariosPending(),\n s.getScenariosFailed()));\n } else {\n //print scenarios summary\n messageWriter.accept(format(\"Scenarios (total:%d) (passed:%d) (failed:%d)\",\n s.getTotalScenarios(),\n s.getScenariosPassed(),\n s.getScenariosFailed()));\n }\n\n //print steps summary\n messageWriter.accept(format(\"Steps (total:%d) (passed:%d) (failed:%d) (undefined:%d) (pending:%d) (skipped:%d)\",\n s.getStepsPassed() + s.getStepsFailed() + s.getStepsUndefined() + s.getStepsPending() + s.getStepsSkipped(),\n s.getStepsPassed(),\n s.getStepsFailed(),\n s.getStepsUndefined(),\n s.getStepsPending(),\n s.getStepsSkipped()));\n }", "SummaryStatusEnum getSummaryStatus();", "public static Card summaryCard(String summary) {\n Card card = baseCard();\n card.setSummary(summary);\n return card;\n }", "@SuppressWarnings(\"unused\")\n public void setClassificationSummaryImpl(ClassificationSummaryImpl classificationSummary) {\n this.classificationSummary = classificationSummary;\n }" ]
[ "0.5930794", "0.58696306", "0.5819763", "0.5800748", "0.57307583", "0.5702281", "0.5676239", "0.5554919", "0.5530308", "0.5515013", "0.5457885", "0.53779876", "0.5319724", "0.5275997", "0.517959", "0.5131853", "0.5097585", "0.5080695", "0.50624204", "0.5056656", "0.50502497", "0.5027237", "0.5018801", "0.4995476", "0.4978771", "0.49660155", "0.49419296", "0.4933836", "0.491619", "0.49140906", "0.49078846", "0.4894648", "0.48914307", "0.48914307", "0.48591426", "0.4851906", "0.4839361", "0.4826991", "0.4818718", "0.4779339", "0.4764091", "0.47617197", "0.47582093", "0.4725162", "0.4720084", "0.4720064", "0.47192547", "0.47128707", "0.47117382", "0.46966934", "0.4688577", "0.4684843", "0.4684843", "0.46515763", "0.464723", "0.46212068", "0.46150607", "0.4611279", "0.46091178", "0.45979008", "0.45928922", "0.4575476", "0.45715308", "0.456475", "0.4558557", "0.4557422", "0.45411897", "0.45399445", "0.45316216", "0.4502856", "0.45007768", "0.44938412", "0.44818795", "0.4475925", "0.44705275", "0.4465968", "0.44651523", "0.44619095", "0.44590944", "0.44545382", "0.44527465", "0.44474187", "0.4442595", "0.44411105", "0.4395791", "0.43936294", "0.4392169", "0.43874174", "0.43770206", "0.43709162", "0.43687367", "0.43682614", "0.43625486", "0.43596137", "0.43534452", "0.43474936", "0.43462935", "0.43448782", "0.43448222", "0.43356544" ]
0.6147796
0
For the tags title and summary, extracts their text values.
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException { String result = ""; if (parser.next() == XmlPullParser.TEXT) { result = parser.getText(); parser.nextTag(); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getText(final String title) {\n\t\treturn getText(title, null);\n\t}", "public abstract CharSequence getSummary();", "static String text(final DocTree tag) {\n for (final DocTree node : ((UnknownBlockTagTree) tag).getContent()) {\n if (node.getKind() == DocTree.Kind.TEXT) {\n return ((TextTree) node).getBody().trim();\n }\n }\n return \"\";\n }", "public String getSummary(org.jsoup.nodes.Document doc) {\r\n Element summaryEl = doc.getElementsByTag(\"summary\").first();\r\n return summaryEl != null ? StringUtil.normaliseWhitespace(summaryEl.text()).trim() : \"\";\r\n }", "private String readSummary(XmlPullParser parser) throws IOException, XmlPullParserException {\n\t parser.require(XmlPullParser.START_TAG, ns, \"summary\");\n\t String summary = readText(parser);\n\t parser.require(XmlPullParser.END_TAG, ns, \"summary\");\n\t return summary;\n\t }", "java.lang.String getTagValue();", "public String printSummary(){\n String ans=\"\";\n for(Sentence sentence : contentSummary){\n //tv_output.setText(sentence.value);\n ans+=sentence.value + \".\";\n }\n return ans;\n }", "java.lang.String getSummary();", "@Override\n\t\tpublic void visitTag(Tag tag) {\n\t\t\tsuper.visitTag(tag);\n\t\t\tif ( engine.isPageContent(tag) ) {\n\t\t\t\tString tcontent = extractText(tag, 0);\n\t\t\t\tif ( tcontent == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( content == null || content.length() < tcontent.length() ) {\n\t\t\t\t\tcontent = tcontent; \n\t\t\t\t}\n\t\t\t} else if ( engine.isPageTitle(tag) ) {\n\t\t\t\tString ttitle = extractText(tag, 0);\n\t\t\t\tif ( ttitle == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( title == null || title.length() < ttitle.length() ) {\n\t\t\t\t\ttitle = ttitle;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private String getTextValue(String def, Element doc, String tag) {\n String value = def;\n NodeList nl;\n nl = doc.getElementsByTagName(tag);\n if (nl.getLength() > 0 && nl.item(0).hasChildNodes()) {\n value = nl.item(0).getFirstChild().getNodeValue();\n }\n return value;\n }", "@Override\n\tpublic String getSummary(Locale locale) {\n\t\treturn \"Title: \" + _dataset.getTitle();\n\t}", "private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "private static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\n String result = \"\";\n if (parser.next() == XmlPullParser.TEXT) {\n result = parser.getText();\n parser.nextTag();\n }\n return result;\n }", "public java.lang.String getSummary(){\r\n return this.summary;\r\n }", "private static String readText(XmlPullParser parser) throws IOException, XmlPullParserException {\r\n String result = \"\";\r\n if (parser.next() == XmlPullParser.TEXT) {\r\n result = parser.getText();\r\n parser.nextTag();\r\n }\r\n return result;\r\n }", "public static void VerifyTitleText_ContentTitle(String xPath, String headerTag){\n\t\tString actualTitleTextContentTitle = null;\n\t\tfor(int i=1; i<=3; i++){\n\t\ttry{\n\t\t\tactualTitleTextContentTitle=Driver.findElement(By.xpath(xPath + i + \"]/\" + headerTag + \"[1]\")).getText();\n\t\t\tAssert.assertEquals(actualTitleTextContentTitle, dataSourceProvider.getProperty(\"Article\" + i + \"Title\"));\n\t\t\tlog.info(\"The Actual AboutUs Title Text is - \"+actualTitleTextContentTitle);\n\t\t\tlog.info(\"The Expected AboutUs Title Text is - \"+dataSourceProvider.getProperty(\"Article\" + i + \"Title\"));\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs Title Text are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs Title Text is - \"+actualTitleTextContentTitle);\n\t\t\tlog.error(\"The Expected AboutUs Title Text is - \"+dataSourceProvider.getProperty(\"Article\" + i + \"Title\"));\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs TitleText ContentTitle are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Override article ContentTitle element On TitleText Container\");\n\t\t}\t\t\n\t }\n\t}", "private String readTitle(XmlPullParser parser) throws IOException, XmlPullParserException {\n\t parser.require(XmlPullParser.START_TAG, ns, \"title\");\n\t String title = readText(parser);\n\t parser.require(XmlPullParser.END_TAG, ns, \"title\");\n\t return title;\n\t }", "private String readTitle(XmlPullParser parser) throws IOException,\n XmlPullParserException {\n parser.require(XmlPullParser.START_TAG, null, \"title\");\n String title = readText(parser);\n parser.require(XmlPullParser.END_TAG, null, \"title\");\n return title;\n }", "public String getSummary();", "private String getTextValue(Element ele, String tagName) {\r\n\t\tString textVal = null;\r\n\t\tNodeList nl = ele.getElementsByTagName(tagName);\r\n\t\tif(nl != null && nl.getLength() > 0) {\r\n\t\t\tElement sl = (Element)nl.item(0);\r\n\t\t\ttextVal = sl.getFirstChild().getNodeValue();\r\n\t\t}\r\n\r\n\t\treturn textVal;\r\n\t}", "public final List<String> getText() {\n ArrayList<String> al = new ArrayList<String>();\n for (Iterator<Element> i = texts.iterator(); i.hasNext();) {\n al.add(i.next().getTextContent());\n }\n return al;\n }", "private Pair<Integer, String> htmlInTag(String text, String tag, int pos) {\n // Get the text inside the column\n String open = \"<\" + tag, closing = \"</\" + tag + \">\";\n int start = indexOfLowUpper(text, open, pos);\n if (start == -1) { return null; }\n start = text.indexOf(\">\", start);\n if (start == -1) { return null; }\n int end = indexOfLowUpper(text, closing, start);\n if (end == -1) { return null; }\n text = text.substring(++start, end);\n end += closing.length();\n return new Pair<>(end, text);\n }", "public String searchResult(){\n return getText(first_product_title);\n }", "public String getSubtitle();", "public String getAllertText(){\n return driver.findElement(statusAllert).getText();\n }", "String getValueText();", "public String getFromTag();", "public String[] getOverviewMetaKeywords(String title, String docTitle) {\n if( configuration.keywords ) {\n String windowOverview = configuration.getText(title);\n String[] metakeywords = { windowOverview };\n if (docTitle.length() > 0 ) {\n metakeywords[0] += \", \" + docTitle;\n }\n return metakeywords;\n } else {\n return new String[] {};\n }\n }", "public String getTitle() {\n return \"Tags Export\";\n }", "public List<String> Description() {\n XPathFactory xpath = XPathFactory.instance();\n XPathExpression<Element> expr = xpath.compile(\"//item/description\", Filters.element());\n List<Element> news = expr.evaluate(this.data);\n List<String> description = new ArrayList<String>();\n news.forEach(post -> description.add(post.getValue().trim()));\n return description;\n }", "public String[] getSummaries() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] summaries = new String[resultsArray.length];\n\t\tfor (int i = 0; i < summaries.length; i++) {\n\t\t\tsummaries[i] = resultsArray[i].getSummary();\n\t\t}\n\t\treturn summaries;\n\t}", "public P getText() {\n return this.slp.getProduction(text);\n }", "public String getPageText();", "public String getSummary()\r\n {\r\n // String variables to hold summary\r\n String summary = this.myEntry;\r\n\r\n //Each word is seperated by a space so the method should count 9 spaces or less\r\n int spaceCount = 0;\r\n // Variable to store the current index of the word\r\n // while ten words havent been found or blog post is finished\r\n int subscript = 0;\r\n // While loop\r\n while(spaceCount <= 9 && subscript < this.myEntry.length())\r\n {\r\n String nextChar = this.myEntry.substring(subscript, subscript + 1);\r\n // Check if space\r\n if (nextChar.equals(\" \"))\r\n {\r\n if (spaceCount <= 9)\r\n spaceCount++;\r\n else\r\n break;\r\n }\r\n summary = summary + nextChar;\r\n subscript++;\r\n }\r\n return summary;\r\n }", "public String toString() {\n StringBuilder sb = new StringBuilder();\n return sb.append(summary).append(\" is \").append(getValueDescription()).toString();\n }", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "@Override\n public String getText() {\n try {\n return doc.select(\".post-content\").get(0).text().replaceAll(\"\\n\", \" \").\n // removing references\n replaceAll(\"\\\\[[\\\\w\\\\s\\\\.\\\\-\\\\,;\\\\?\\\\!\\\\:]+\\\\]\", \"\");\n } catch (NullPointerException e) {\n return null;\n }\n }", "public String getTitle(){\n return titlesText;\n }", "public RichText getDescr();", "public String getTextContent() {\n\t\treturn ((TextTypeImpl)_text).getStringValue();\n\t}", "public String getInfoText();", "public String getTextInNextElement(String tag) throws ParseException {\n return getTextInNextElement(html, tag, position);\n }", "public String getSummary(SearchResultFields pResult) \n {\n String summary = (String) (pResult.getFields().get(\"content\"));\n return summary;\n }", "public String tagAsString();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "org.apache.xmlbeans.XmlString xgetSummary();", "private String[] extractXmlElementValues(String xmlTagName, String text, boolean includeStartEndTags) {\n ArrayList<String> foundElements = new ArrayList<String>();\n int currentPos = 0;\n\n while ( currentPos >= 0 ) {\n String startTag = \"<\" + xmlTagName + \">\";\n String endTag = \"</\" + xmlTagName + \">\";\n\n String rootStartTag = \"\";\n String rootEndTag = \"\";\n\n String resultText = \"\";\n int startValuePos = text.indexOf(startTag,currentPos);\n if ( startValuePos < 0 ) {\n startTag = \"<\" + xmlTagName + \" \";\n startValuePos = text.indexOf(startTag,currentPos);\n }\n if ( startValuePos >= 0 ) {\n int rootStartTagPos = startValuePos;\n currentPos = -1;\n //iPos += 3;\n startValuePos = text.indexOf(\">\", startValuePos);\n if ( startValuePos >= 0 ) {\n startValuePos = startValuePos + 1;\n int endValuePos = text.indexOf(endTag, startValuePos);\n if ( endValuePos >= 0 && endValuePos > startValuePos ) {\n resultText = text.substring(startValuePos, endValuePos);\n if ( includeStartEndTags ) {\n rootStartTag = text.substring(rootStartTagPos, startValuePos);\n rootEndTag = text.substring(endValuePos, endValuePos+endTag.length()+1);\n// System.out.println(\"\");\n// System.out.println(\"START TAG : ]\" + rootStartTag + \"[\");\n// System.out.println(\"END TAG : ]\" + rootEndTag + \"[\");\n foundElements.add(rootStartTag + resultText + rootEndTag);\n } else {\n foundElements.add(resultText);\n }\n currentPos = endValuePos;\n }\n }\n } else {\n // Procedure for namespace defined tags\n startTag = \":\" + xmlTagName;\n startValuePos = text.indexOf(startTag,currentPos);\n if ( startValuePos < 0 ) {\n startTag = \":\" + xmlTagName + \" \";\n startValuePos = text.indexOf(startTag,currentPos);\n }\n currentPos = -1;\n if ( startValuePos >= 0 ) {\n int rootStartTagPos = startValuePos;\n int startBracket = text.lastIndexOf(\"<\", startValuePos );\n if ( startBracket >= 0 && startBracket < startValuePos ) {\n String nsName = text.substring(startBracket+1,startValuePos);\n endTag = \"</\" + nsName + \":\" + xmlTagName + \">\";\n startValuePos = text.indexOf(\">\", startValuePos);\n if ( startValuePos >= 0 ) {\n startValuePos = startValuePos + 1;\n int endValuePos = text.indexOf(endTag, startValuePos);\n if ( endValuePos >= 0 && endValuePos > startValuePos ) {\n resultText = text.substring(startValuePos, endValuePos);\n if ( includeStartEndTags ) {\n rootStartTag = \"<\" + nsName + text.substring(rootStartTagPos, startValuePos);\n rootEndTag = text.substring(endValuePos, endValuePos+endTag.length()+1);\n// System.out.println(\"\");\n// System.out.println(\"NAMESPACE START TAG : ]\" + rootStartTag + \"[\");\n// System.out.println(\"NAMESPACE END TAG : ]\" + rootEndTag + \"[\");\n foundElements.add(rootStartTag + resultText + rootEndTag);\n } else {\n foundElements.add(resultText);\n }\n currentPos = endValuePos + endTag.length();\n }\n }\n }\n }\n }\n }\n return foundElements.toArray(new String[foundElements.size()]);\n }", "@Test(priority = 2, dependsOnMethods = {\n\t\t\t\"navigatetosyndicationstatus\" }, description = \"To Verify Title and Title Text\")\n\tpublic void VerifyTitleTxt() throws Exception {\n\t\tdata = new TPSEE_Syndication_Status_Page(CurrentState.getDriver());\n\t\tdata.VerifyTitlenText();\n\t\taddEvidence(CurrentState.getDriver(), \"To Verify Title and Title Text\", \"yes\");\n\t}", "public Object getValue() {\n return tags.toString();\n }", "public String getSummary() {\r\n return summary;\r\n }", "private static List<String> getText(Node n, String filter) throws ParserException\n\t{\n\t\tList<String> strArray = new ArrayList<String>();\n\t\tString parentTag = \"\";\n\t\tTagNode parent = (TagNode) n.getParent();\n\t\tif (parent != null)\n\t\t{\n\t\t\tparentTag = parent.getTagName();\n\t\t}\n\t\tif (n instanceof TextNode)\n\t\t{ // text\n\t\t\tTextNode tn = (TextNode) n;\n\t\t\tSystem.out.println(parentTag + \":\" + tn.getText().trim());\n\t\t\tSystem.out.println(((TagNode) n).getTagName());\n\t\t\tif (filter.equals(\"\") || filter.equalsIgnoreCase(parentTag))\n\t\t\t{\n\t\t\t\tString text = tn.getText().trim();\n\t\t\t\ttext = text.replace(\"&nbsp;\", \" \"); // remove non-breaking spaces\n\t\t\t\tif (text.length() > 0 && !text.matches(\"\\\\s+\"))\n\t\t\t\t{\n\t\t\t\t\tstrArray.add(text);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{ // a tag or remark\n\t\t\tNodeList nl = n.getChildren();\n\t\t\tif (null != nl)\n\t\t\t{\n\t\t\t\tfor (NodeIterator ni = nl.elements(); ni.hasMoreNodes();)\n\t\t\t\t{\n\t\t\t\t\tstrArray.addAll(getText(ni.nextNode(), filter));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn strArray;\n\t}", "public static void VerifyDescText_ContentDesc(String xPath, String headerTag){\n\t\t\tString actualDescTextContentDesc = null;\n\t\t\tfor(int i=1; i<=3; i++){\n\t\t\ttry{\n\t\t\t\tactualDescTextContentDesc=Driver.findElement(By.xpath(xPath + i + headerTag)).getText();\n\t\t\t\tAssert.assertEquals(actualDescTextContentDesc, dataSourceProvider.getProperty(\"Article\" + i + \"Desc\"));\n\t\t\t\tlog.info(\"The Actual AboutUs Desc Text is - \"+actualDescTextContentDesc);\n\t\t\t\tlog.info(\"The Expected AboutUs Desc Text is - \"+dataSourceProvider.getProperty(\"Article\" + i + \"Desc\"));\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs Desc Text are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs Desc Text is - \"+actualDescTextContentDesc);\n\t\t\t\tlog.error(\"The Expected AboutUs Desc Text is - \"+dataSourceProvider.getProperty(\"Article\" + i + \"Desc\"));\n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs DescText ContentDesc are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Override article ContentDesc element On DescText Container\");\n\t\t\t}\t\t\n\t\t }\n\t\t}", "public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }", "private String collectHeading(Document doc) {\n String heading = doc.select(\"[class^=header1 style]\").first().text();\r\n\r\n return heading;\r\n }", "private String[] extractPure(String data) throws Exception {\n\t\tString[] result1 = this.extractBetween(data.toString(), \"<title>\", \"</title>\", true, true);\n\t\t\n\t\t// remove search title bar\n\t\tresult1[1] = this.replaceBetween(result1[1], \"<div class=\\\"lotusTitleBar2\\\">\", \"<div class=\\\"lotusMain\\\">\", \"\");\n\t\t\n\t\t// remove left column\n\t\tresult1[1] = this.replaceBetween(result1[1], \"<div class=\\\"lotusColLeft\\\"\", \"<div class=\\\"lotusContent\\\"\", \"\");\n\t\t\n\t\t// remove body\n\t\tString[] result2 = this.extractBetween(result1[1], \"<div class=\\\"lotusContent\\\" role=\\\"main\\\">\", \"</table></div></div>\", true, true);\n\t\tresult2[1] = result2[1].substring(8);\n\t\t\n\t\t// return\n\t\treturn new String[]{result1[0], result2[0], result2[1]};\n\t\t\n\t}", "public String getTextValue (Node node);", "protected abstract String getTopElementDesc();", "public String getText() {\n if (_lastTag == null)\n return null;\n return _lastTag.getChildText();\n }", "public String findTitle(Text value) throws CharacterCodingException{\n\t\tint start = value.find(\"<title>\");\n\t\tint end = value.find(\"</title>\", start);\n\t\tstart+=7;\n\t\tString title = Text.decode(value.getBytes(), start, end-start);\n\t\t//if(title.contains(\":\") || title.contains(\"#\") || title.contains(\"/\") )\n\t\t\t//return null;\n\t\t//else\n\t\t\treturn title.replace(\" \", \"_\");\n\t}", "java.lang.String getTag();", "java.lang.String getTag();", "public java.lang.String getTitle();", "public static String[] gatherTokenStrings (Document doc, Span span) {\n\t\tAnnotation[] tokens = gatherTokens(doc, span);\n\t\tint length = tokens.length;\n\t\tString[] stgs = new String[length];\n\t\tfor (int i=0; i<length; i++)\n\t\t\tstgs[i] = doc.text(tokens[i]).trim();\n\t\treturn stgs;\n\t}", "java.lang.String getHotelText();", "@Override\r\n\t\t\tpublic String getText() {\n\t\t\t\treturn text;\r\n\t\t\t}", "public native final String summary() /*-{\n\t\treturn this[\"summary\"];\n\t}-*/;", "protected Text getText() {\n \t\treturn text;\n \t}", "public Object[] getData() {\n\t\treturn new Object[] { this.textoHtml };\n\t}", "IDisplayString getTitle();", "public XSSFRichTextString getTitleText() {\n\t\tif(! chart.isSetTitle()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// TODO Do properly\n\t\tCTTitle title = chart.getTitle();\n\n\t\tStringBuffer text = new StringBuffer();\n\t\tXmlObject[] t = title\n\t\t\t.selectPath(\"declare namespace a='\"+XSSFDrawing.NAMESPACE_A+\"' .//a:t\");\n\t\tfor (int m = 0; m < t.length; m++) {\n\t\t\tNodeList kids = t[m].getDomNode().getChildNodes();\n\t\t\tfinal int count = kids.getLength();\n\t\t\tfor (int n = 0; n < count; n++) {\n\t\t\t\tNode kid = kids.item(n);\n\t\t\t\tif (kid instanceof Text) {\n\t\t\t\t\ttext.append(kid.getNodeValue());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new XSSFRichTextString(text.toString());\n\t}", "public String text();", "public java.lang.String getSummary()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SUMMARY$18);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "void antsInfo(String text);", "public String getSummary() {\n return summary;\n }", "public String getText() {\n return (getFieldValue(fields[0]) + \".\" + getFieldValue(fields[1]) + \".\" + getFieldValue(fields[2]) + \".\" + getFieldValue(fields[3]));\n }", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "protected String getValueTitle() {\r\n\t\treturn \"Value\";\r\n\t}", "public String getText(){\r\n\t\treturn text;\r\n\t}", "protected abstract List<Sentence> prepareSummary(Article article);", "Text getValue() throws IOException;", "String getTitle();", "String getTitle();" ]
[ "0.5925334", "0.5782488", "0.5735099", "0.56942797", "0.5686872", "0.56126153", "0.55194855", "0.5505085", "0.5455561", "0.53412116", "0.5316387", "0.53059715", "0.53059715", "0.5290075", "0.5273801", "0.52681524", "0.5233378", "0.52155966", "0.52048576", "0.51870954", "0.515977", "0.5152116", "0.5141314", "0.51382124", "0.51346797", "0.51169246", "0.51123244", "0.5104376", "0.5097951", "0.5092375", "0.5068808", "0.50575465", "0.50529546", "0.5037057", "0.50365365", "0.50353", "0.50268674", "0.50268674", "0.50268674", "0.50268674", "0.50268674", "0.5020594", "0.5008533", "0.5007417", "0.50036407", "0.49984577", "0.49959353", "0.49731016", "0.49678332", "0.4967586", "0.4967586", "0.4967586", "0.4967586", "0.4967586", "0.4967586", "0.4967586", "0.4967586", "0.4949232", "0.49476779", "0.494651", "0.49297187", "0.49236354", "0.49034467", "0.49011505", "0.48981202", "0.48943967", "0.48823053", "0.4881176", "0.4876102", "0.4872031", "0.48605397", "0.48591694", "0.48591694", "0.4857323", "0.48539925", "0.48473668", "0.48450714", "0.48450232", "0.48447973", "0.4839096", "0.48242658", "0.48106912", "0.48093984", "0.48032105", "0.4798734", "0.47937635", "0.4790831", "0.47905415", "0.47905415", "0.47905415", "0.47905415", "0.47905415", "0.47905415", "0.47905415", "0.4788615", "0.47858366", "0.4779455", "0.47793737", "0.4775975", "0.4775975" ]
0.5275051
14
Uses AsyncTask to download the XML feed from stackoverflow.com.
public void loadPage() { if((sPref.equals(ANY)) && (wifiConnected || mobileConnected)) { new DownloadXmlTask().execute(URL); } else if ((sPref.equals(WIFI)) && (wifiConnected)) { new DownloadXmlTask().execute(URL); } else { // show error } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadXML(){\n new DownloadXmlTask().execute(URL);\n }", "@Override\n\t\t\tpublic void doAsyncTaskInBackground(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\tif(customAsyncTask.tag == DOWNLOAD_APARTMENTS_XML_TAG)\n\t\t\t\t{\n\t\t\t\t\tXMLRequest req = new XMLRequest(Config.APARTMENTS_URL);\n\t\t\t\t\tXMLRequest reqAgents = new XMLRequest(Config.AGENTS_URL);\n\t\t\t\t\t\n\t\t\t \ttry \n\t\t\t \t{\n\t\t\t\t\t\tList<ListEntry> entryList = req.obtainXMLList();\n\t\t\t\t\t\tcustomAsyncTask.entryList = entryList;\n\t\t\t\t\t\tcustomAsyncTask.listTag = LIST_TAG;\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<ListEntry> entryList2 = reqAgents.obtainXMLList();\n\t\t\t\t\t\tcustomAsyncTask.entryListExtra = entryList2;\n\t\t\t\t\t\tcustomAsyncTask.listTag = LIST_TAG;\n\t\t\t\t\t} \n\t\t\t \tcatch (ParserConfigurationException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (SAXException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (IOException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n protected String doInBackground(String... url) {\n\n // Increment progress up to half of total background processing\n while(progress_status < 50){\n\n progress_status += 2;\n\n // send progress to UI thread\n publishProgress(progress_status);\n\n // sleep to show progress bar\n SystemClock.sleep(SLEEP_DURATION);\n }\n\n String s = null;\n try {\n\n // Download directions with url\n s = downloadUrl(url[0]);\n }\n catch (IOException e) {\n Log.d(\"Background Task\",e.toString());\n }\n\n // Return a string with xml data\n return s;\n }", "public FeedManager loadFeed() throws IOException, XmlPullParserException {\n\t\tInputStream stream = null;\n\t\tSolsticeXmlParser solsticeXmlParser = new SolsticeXmlParser();\n\n\t\ttry {\n\t\t\tstream = downloadUrl(URL);\n\t\t\treturn solsticeXmlParser.parse(stream);\n\t\t} finally {\n\t\t\tif (stream != null) {\n\t\t\t\tstream.close();\n\t\t\t}\n\t\t}\n\t}", "protected void onPostExecute(String feed) {\n }", "protected void onPostExecute(String feed) {\n }", "@Override\n\t\tprotected List<NewsBean> doInBackground(Void... params) {\n\t\t\tsynchronized (this) {\t\t\t\n\t\t\t\treturn new ParseXMLUtil().parseNewsXml(ls,url);\n\t\t\t}\t\t\t\n\t\t}", "private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {\n\t InputStream stream = null;\n\t // Instantiate the parser\n\t StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser();\n\t List<Entry> entries = null;\n\t String title = null;\n\t String url = null;\n\t String summary = null;\n\t Calendar rightNow = Calendar.getInstance(); \n\t DateFormat formatter = new SimpleDateFormat(\"MMM dd h:mmaa\");\n\t \n\t // Checks whether the user set the preference to include summary text\n\t SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t boolean pref = sharedPrefs.getBoolean(\"summaryPref\", false);\n\t \n\t StringBuilder htmlString = new StringBuilder();\n\t htmlString.append(\"<h3>\" + \"title: \" + \"</h3>\");\n\t htmlString.append(\"<em>\" + \" \" + formatter.format(rightNow.getTime()) + \"</em>\");\n\t \n\t try {\n\t stream = downloadUrl(urlString); \n\t entries = stackOverflowXmlParser.parse(stream);\n\t // Makes sure that the InputStream is closed after the app is\n\t // finished using it.\n\t } finally {\n\t if (stream != null) {\n\t stream.close();\n\t } \n\t }\n\t \n\t // StackOverflowXmlParser returns a List (called \"entries\") of Entry objects.\n\t // Each Entry object represents a single post in the XML feed.\n\t // This section processes the entries list to combine each entry with HTML markup.\n\t // Each entry is displayed in the UI as a link that optionally includes\n\t // a text summary.\n\t for (Entry entry : entries) { \n\t htmlString.append(\"<p><a href='\");\n\t htmlString.append(entry.link);\n\t htmlString.append(\"'>\" + entry.title + \"</a></p>\");\n\t // If the user set the preference to include summary text,\n\t // adds it to the display.\n\t if (pref) {\n\t htmlString.append(entry.summary);\n\t }\n\t }\n\t return htmlString.toString();\n\t}", "private void getSportsNews() {\n new SportsAsyncTask(this,MainActivity.this).execute(url);\n }", "protected void onPostExecute(String feed) {\n\t\t}", "@Override\n\t\t\tpublic void doAsyncTaskInBackground(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\tif(customAsyncTask.tag == DOWNLOAD_SLIDER_XML_TAG)\n\t\t\t\t{\n\t\t\t \ttry \n\t\t\t \t{\n\t\t\t \t\tBoolean isServerSourceData = false;\n\t\t\t \t\tXMLRequest req = null;\n\t\t\t \t\tif(Config.IS_DATA_FROM_SERVER)\n\t\t\t \t\t{\n\t\t\t \t\t\tif(Utilities.hasConnection(Tab3Fragment.this.getActivity()))\n\t \t\t\t\t{\n\t\t\t \t\t\t\treq = new XMLRequest(Config.URL_PATH + Config.SLIDER_URL);\n\t\t\t\t \t\t\tisServerSourceData = true;\n\t \t\t\t\t}\n\t\t\t \t\t\telse\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\treq = new XMLRequest(Config.ASSETS_FOLDER_PATH + Config.SLIDER_URL);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\treq = new XMLRequest(Config.ASSETS_FOLDER_PATH + Config.SLIDER_URL);\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t \t\t\tList<ListEntry> entryList = isServerSourceData ?\n\t\t\t\t\t\t\t\treq.obtainXMLList() : \n\t\t\t\t\t\t\t\t\treq.obtainXMLListFromLocal(customAsyncTask.activity);\n\t\t\t\t\t\t\t\t\n \t\t\t\tcustomAsyncTask.entryList = entryList;\n \t\t\t\tcustomAsyncTask.listTag = LIST_TAG;\n\t\t\t\t\t} \n\t\t\t \tcatch (ParserConfigurationException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (SAXException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (IOException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(customAsyncTask.activity,\n\t\t\t\t\t\t\t\t\"Network Connection Error.\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\tprotected List<NewsBean> doInBackground(Void... params) {\n\t\t\tsynchronized (this) {\n\t\t\t\treturn new ParseXMLUtil().parseNewsXml(ls, url);\n\t\t\t}\n\t\t}", "private void refreshXML() {\n\t\t// Build a new thread to handle the request, since fetching files from\n\t\t// a remove server shouldn't block screen drawing.\n\t\tToast.makeText(\n\t\t\t\tthis,\n\t\t\t\tgetString(R.string.xml_requested_from) + \": \"\n\t\t\t\t\t\t+ PreferencesManager.getXmlUri(this), Toast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t// We use a separate runnable class instead of an anonymous inner class\n\t\t// so that when the async request is completed, it can signal the viewer\n\t\t// to toast.\n\t\tFetchThread ft = new FetchThread(this);\n\t\tft.start();\n\t}", "@Override\r\n\t\t\tprotected String doInBackground(String... url) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdata = downloadUrl(url[0]);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tLog.d(\"Background Task\", e.toString());\r\n\t\t\t\t}\r\n\t\t\t\treturn data;\r\n\t\t\t}", "@Override\r\n\t protected String doInBackground(String... url) {\r\n\t \r\n\t // For storing data from web service\r\n\t String data = \"\";\r\n\t \r\n\t try{\r\n\t // Fetching the data from web service\r\n\t data = downloadUrl(url[0]);\r\n\t }catch(Exception e){\r\n\t Log.d(\"Background Task\",e.toString());\r\n\t }\r\n\t return data;\r\n\t }", "@Override\n\t\tprotected String doInBackground(String... url) {\n\n\t\t\t// For storing data from web service\n\t\t\tString data = \"\";\n\n\t\t\ttry {\n\t\t\t\t// Fetching the data from web service\n\t\t\t\tdata = downloadUrl(url[0]);\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Background Task\", e.toString());\n\t\t\t}\n\t\t\treturn data;\n\t\t}", "@Override\r\n\t\tprotected String doInBackground(String... params) {\n\t\t\t\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tresponse=hclient.execute(p);\r\n\t\t\t\t\r\n\t\t\t\tin=response.getEntity().getContent();\r\n\t\t\t\t\r\n\t\t\t\tStringBuilder stringBuilder=new StringBuilder();\r\n\t\t\t\t\r\n\t\t\t\tint b;\r\n\t\t\t\twhile(( b = in.read() )!= -1){\r\n\t\t \tstringBuilder.append((char)b);\r\n\t\t \t\r\n\t\t }\r\n\t\t\t\t\r\n\t\t\t\t\tLog.d(\"AsynClass\", \"Stringbuilder done\");\r\n\t\t\t\t\tbuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n\t\t\t\t\tdoc = builder.parse(new InputSource(new StringReader(stringBuilder.toString())));\r\n\t\t\t\t\tNodeList result=doc.getElementsByTagName(\"item\");\r\n\t\t\t\t\tNode node;\t\r\n\t\t\t\t\tfor(int i=0;i<result.getLength();i++){\r\n\t\t\t\t\t\tnode=result.item(i);\r\n\t\t\t\t\t\t getElementValue(node,i);\r\n\t\t\t\t\t\tLog.d(\"AsyncClass\", \"Got Value\"+i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfailureFlag=1;\r\n\t\t\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\tfailureFlag=0;\r\n\t\t\t\terror=e.getMessage();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}", "@Override\n protected Void doInBackground(Void... arg0) {\n helper = new LiveFeedParser(999);\n helper.get();\n viewEntries = helper.getViewEntries();\n return null;\n }", "@Override\n\t\tprotected String doInBackground(String... url)\n\t\t{\n\n\t\t\t// For storing data from web service\n\t\t\tString data = \"\";\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Fetching the data from web service\n\t\t\t\tdata = MainActivity.this.downloadUrl(url[0]);\n\t\t\t} catch (Exception e)\n\t\t\t{\n\t\t\t\tLog.d(\"Background Task\", e.toString());\n\t\t\t}\n\t\t\treturn data;\n\t\t}", "private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {\n InputStream stream = null;\n StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser();\n List<Entry> entries = null;\n String title = null;\n String url = null;\n String summary = null;\n Calendar rightNow = Calendar.getInstance();\n DateFormat formatter = new SimpleDateFormat(\"MMM dd h:mmaa\");\n int count = 1;\n\n // Checks whether the user set the preference to include summary text\n SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n boolean pref = sharedPrefs.getBoolean(\"summaryPref\", false);\n\n StringBuilder htmlString = new StringBuilder();\n htmlString.append(\"<h3>\" + getResources().getString(R.string.page_title) + \"</h3>\");\n htmlString.append(\"<em>\" + getResources().getString(R.string.updated) + \" \" +\n formatter.format(rightNow.getTime()) + \"</em>\");\n\n try {\n stream = downloadUrl(urlString);\n entries = stackOverflowXmlParser.parse(stream);\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n\n // StackOverflowXmlParser returns a List (called \"entries\") of Entry objects.\n // Each Entry object represents a single post in the XML feed.\n // This section processes the entries list to combine each entry with HTML markup.\n // Each entry is displayed in the UI as a link that optionally includes\n // a text summary.\n for (Entry entry : entries) {\n \t\n \tString photo = \"\";\n \tString video = \"video\";\n htmlString.append(\"<p><a href='\");\n photo = \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=\"+entry.link+\"&sensor=true&key=AIzaSyBeNRBzRlJQy0-L8OlYFTnMcJ9LRb6h_-s\";\n \n \n htmlString.append(photo);\n htmlString.append(\"'>\" + entry.title + \"</a></p>\");\n if(count == 1 ||count == 3 ||count == 6 ||count == 8 ||count == 9) {\n \tvideo =\"http://192.168.0.16:8010/cloud/my_videos/\"+Integer.toString(count);\n \thtmlString.append(\"<a href='\"+video+\"'> - Video</a>\");\n }\n count++;\n \n // If the user set the preference to include summary text,\n // adds it to the display.\n if (pref) {\n htmlString.append(entry.summary);\n }\n }\n// URL url2 = new URL(\"http://192.168.0.16:8000/cloud/images/\");\n// HttpURLConnection conn2 = (HttpURLConnection) url2.openConnection();\n//\t\t\n// //conn2.setDoOutput(true);\n// conn2.setConnectTimeout(10000 /* milliseconds */);\n// conn2.setRequestMethod(\"GET\");\n// conn2.setDoInput(true);\n// conn2.connect();\n// //OutputStream out1 = new BufferedOutputStream(conn2.getOutputStream());\n// \n// \n// InputStream in = new BufferedInputStream(conn2.getInputStream());\n// BufferedReader br = new BufferedReader(new InputStreamReader(in));\n// String test = br.readLine();\n// String output=\"\";\n// while(test != null) {\n// \toutput = output +test;\n// \ttest = br.readLine();\n// }\n// output=\"<html><body><video width=\\\"320\\\" height=\\\"240\\\" controls><source src=\\\"movie.mp4\\\" type=\\\"video/mp4\\\"><source src=\\\"movie.ogg\\\" type=\\\"video/ogg\\\">Your browser does not support the video tag.</video></body></html>\";\n \n return htmlString.toString();\n }", "@Override\r\n protected String doInBackground(String... url) {\r\n\r\n // For storing data from web service\r\n String data = \"\";\r\n\r\n try{\r\n // Fetching the data from web service\r\n data = downloadUrl(url[0]);\r\n }catch(Exception e){\r\n Log.d(\"Background Task\",e.toString());\r\n }\r\n return data;\r\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try{\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try{\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try{\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try{\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n try {\n data = downloadUrl(url[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n try {\n data = downloadUrl(url[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n\t\t protected Void doInBackground(Void... params) {\n\t\t \tUnidataSuperActivity.setDone(false);\n\t\t \t\n\t\t \t/* Gets the URL address of the data wanted\n\t\t \t * URL comes from the Super, which is set by the MainActivity\n\t\t \t */\n\t\t URL textUrl;\n\t\t String address = UnidataSuperActivity.getURL();\n\t\t \n\t\t /* Converts the URL into a temporary XML file, which then is converted into a String\n\t\t * Uses the Commons IO library for FileUtils\n\t\t */\n\t\t try {\n\t\t textUrl = new URL(address);\n\t\t System.out.println(textUrl);\n\t\t File testFile2 = File.createTempFile(\"temp2\", \".dat\");\n\t\t testFile2.deleteOnExit();\n\t\t FileUtils.copyURLToFile(textUrl, testFile2);\n\t\t textResult = FileUtils.readFileToString(testFile2);\n\t\t \n\t\t } catch (MalformedURLException e) {\n\t\t e.printStackTrace();\n\t\t textResult = e.toString(); \n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t textResult = e.toString(); \n\t\t }\n\t\t \n\t\t /* sets the XML String in the super class so it can be parsed in the main thread\n\t\t * and then lets the main thread know it has finished\n\t\t */\n\t\t UnidataSuperActivity.setXML(textResult);\n\t\t UnidataSuperActivity.setDone(true);\n\n\t\t return null;\n\t\t \n\t\t }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n\n try{\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n\n return data;\n }", "@Override\n protected Boolean doInBackground(String... strings) {\n try {\n if (strings.length < 2) return false;\n home_url = strings[0];\n data_path = strings[1];\n if (!DownloadFile(home_url, \"/home_file.htm\")) return false;\n //apro il file della home e cerco il link che contiene \"circolari\" nel proprio title\n XmlPullParser parser = Xml.newPullParser();\n parser.setInput(new FileInputStream(new File(data_path + \"/home_file.htm\")), null);\n parser.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, false);\n parser.defineEntityReplacementText(\"ntilde\", \"\\u00F1\");\n parser.defineEntityReplacementText(\"nbsp\", \" \");\n parser.defineEntityReplacementText(\"raquo\", \" \");\n parser.nextTag();\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String title = parser.getAttributeValue(ns, \"title\");\n if (name.equals(\"a\") && title != null && title.toLowerCase().contains(\"circolari\")) {\n circ_url = parser.getAttributeValue(ns, \"href\");\n break;\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n\n }\n }\n }\n //ricerca pagina con orari\n parser.setInput(new FileInputStream(new File(data_path + \"/home_file.htm\")), null);\n parser.nextTag();\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String href = parser.getAttributeValue(ns, \"href\");\n String text;\n if (name.equals(\"a\")) {\n while (parser.getEventType() != XmlPullParser.END_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n if (parser.getEventType() == XmlPullParser.TEXT) {\n text = parser.getText();\n if (text.toLowerCase().contains(\"orario scolastico\")) orari_url = href;\n }\n }\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n if (!DownloadFile(orari_url, \"/orari_file.htm\")) return null;\n //ricerca link degli orari\n parser.setInput(new FileInputStream(new File(data_path + \"/orari_file.htm\")), null);\n parser.nextTag();\n int i = 0;\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String href = parser.getAttributeValue(ns, \"href\");\n String text;\n if (name.equals(\"a\")) {\n while (parser.getEventType() != XmlPullParser.END_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n if (parser.getEventType() == XmlPullParser.TEXT) {\n text = parser.getText();\n if (text.toLowerCase().contains(\"per classi (\")) orari_classi = href;\n else if (text.toLowerCase().contains(\"per docenti (\"))\n orari_docenti = href;\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n } catch (FileNotFoundException e) {\n return false;\n } catch (XmlPullParserException e) {\n return false;\n } catch (IOException e) {\n return false;\n }\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"pref_url_circolari\", circ_url);\n editor.putString(\"pref_url_orario_classi\", orari_classi);\n editor.putString(\"pref_url_orario_docenti\", orari_docenti);\n editor.apply();\n //risultati salvati nelle shared Preferences\n return true;\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n // Close the progress bar\n pb.setVisibility(View.GONE);\n\n // Start background processing for xml parsing\n XMLTask xmlTask = new XMLTask();\n xmlTask.execute(result);\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n\n\n return \"Unable to retrieve data. We are working on it..\";\n }\n }", "@Override\n protected String doInBackground(String... url) {\n try{\n Log.d(\"URL:\",url[0]);\n data = downloadUrl(url[0]);\n }catch(Exception e){\n Log.d(\"Background Task\",e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.d(\"Background Task data\", data.toString());\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.d(\"Background Task data\", data.toString());\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.d(\"Background Task data\", data.toString());\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.d(\"Background Task data\", data.toString());\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\r\n protected String doInBackground(String... url) {\n String data = \"\";\r\n\r\n try {\r\n // Fetching the data from web service\r\n data = downloadUrl(url[0]);\r\n Log.d(\"Background Task data\", data.toString());\r\n } catch (Exception e) {\r\n Log.d(\"Background Task\", e.toString());\r\n }\r\n return data;\r\n }", "@Override\n protected String doInBackground(String... urls) {\n String response = \"\";\n HttpURLConnection urlConnection = null;\n for (String url : urls) {\n try {\n URL urlObject = new URL(url);\n urlConnection = (HttpURLConnection) urlObject.openConnection();\n\n InputStream content = urlConnection.getInputStream();\n\n BufferedReader buffer = new BufferedReader(new InputStreamReader(content));\n String s = \"\";\n while ((s = buffer.readLine()) != null) {\n response += s;\n }\n\n } catch (Exception e) {\n response = \"Unable to download the list of posts, Reason: \"\n + e.getMessage();\n }\n finally {\n if (urlConnection != null)\n urlConnection.disconnect();\n }\n }\n return response;\n\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.e(\"place json\", data);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "public void refresh()\n\t{\n\t\t\tConnectivityManager connMgr = (ConnectivityManager)\n\t\t getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n\t\t if (networkInfo != null && networkInfo.isConnected()) {\n\t\t // fetch data\n\t\t \tDownloadXmlTask task = new DownloadXmlTask();\n\t\t task.execute(\"http://api.androidhive.info/pizza/?format=xml\");\n\t\t \t\n\t\t\t\t\n\t\t } else {\n\t\t // display error\n\t\t \tLog.v(\"Network\", \"Error: Network is not available\");\n\t\t\t \n\t\t }\n\t}", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n// Log.e(\"Background Task data\", data.toString());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return data;\n }", "@Override\n\t\tprotected Boolean doInBackground(Void... params) {\n\t\t\tlinklist = parseRSS();\n\t\t\treturn updateDatabase(linklist);\n\t\t}", "@Override\n protected String doInBackground(String... args) {\n // rss link url\n String query_url = args[0];\n\n // weather object of rss.\n woeid = parser.getRSSFeedWeather2(query_url);\n\n // updating UI from Background Thread\n runOnUiThread(new Runnable() {\n public void run() {\n /**\n * Updating parsed data into text view.\n * */\n Intent intent = new Intent(MainActivity.this, Summit.class);\n String description = woeid.getWoeid();\n intent.putExtra(EXTRA_MESSAGE, description);\n // Log.d(\"Long\", description);\n startActivity(intent);\n }\n });\n return null;\n }", "@Override\n protected JSONObject doInBackground(String... url) {\n JSONObject data = null;\n\n try {\n // Fetching the data from web service\n data = new NetworkManager().makeHttpGetConnectionWithJsonOutput(url[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "private void downloadContent(){\n try {\n URL yahoo = new URL( \"http://api.letsleapahead.com/LeapAheadMultiFreindzy/index.php?action=getLang&langCode=EN&langId=1&appId=6\");\n BufferedReader in = new BufferedReader(\n new InputStreamReader(yahoo.openStream()));\n String inputLine;\n while ((inputLine = in.readLine()) != null)\n Log.e(\"TAG\" , inputLine);\n in.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }", "@Override\r\n protected void onPostExecute(String file_url) {\r\n System.out.println(\"Downloaded\");\r\n }", "@Override\n\t\tprotected List<List<HashMap<String, String>>> doInBackground(String... params) {\n\t\t\treturn downloadUrl(params[0]);\n\t\t}", "@Override\r\n\t\tprotected String doInBackground(String... arg0) {\n\t\t\t xmlInput = (EditText) findViewById(R.id.xmlInput);\r\n\t\t response = new xmlRequest().XMLUrlHttpRequest(xmlInput.getText().toString());\r\n\r\n\t\t\tString parsedData = \"\";\r\n\t \r\n\t try {\r\n\t \r\n\t Log.w(\"AndroidParseXMLActivity\", \"Start\");\r\n\t SAXParserFactory spf = SAXParserFactory.newInstance();\r\n\t SAXParser sp = spf.newSAXParser();\r\n\t XMLReader xr = sp.getXMLReader();\r\n\t \r\n\t Bookhandler XMLHandler = new Bookhandler();\r\n\t xr.setContentHandler(XMLHandler);\r\n\t InputSource inStream = new InputSource();\r\n\t \r\n\t inStream.setCharacterStream(new StringReader(response));\r\n\t \r\n\t xr.parse(inStream);\r\n\t Log.w(\"response\",response);\r\n\t int i=0;\r\n\t ArrayList<BookData> BooksList = XMLHandler.getBooksList();\r\n\t for(;i<BooksList.size();i++){\r\n\t BookData book = BooksList.get(i);\r\n\t parsedData = parsedData + \"Book \"+(i+1) +\"Detail----->\\n\";\r\n\t parsedData = parsedData + \"Book Number: \" + book.getBookNumber() + \"\\n\";\r\n\t parsedData = parsedData + \"Description: \" + book.getDescription() + \"\\n\";\r\n\t parsedData = parsedData + \"Price: \" + book.getPrice() + \"\\n\";\r\n\t parsedData = parsedData + \"Rating: \"+ book.getRating() + \"\\n\";\r\n\t \r\n\t }\r\n\t Log.w(\"i==\",String.valueOf(i));\r\n\t Log.w(\"Data\",parsedData);\r\n\r\n\t Log.w(\"ParsingXml and populating\", \"Done\");\r\n\t }\r\n\t catch (Exception e) {\r\n\t Log.w(\"AndroidParseXMLActivity\",e );\r\n\t }\r\n\t \r\n\t return parsedData;\r\n\t\t\r\n\t\t}", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = loadUrl(url[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... params) {\n bitmap = DownloadImageBitmap(url);\n return null;\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... params) {\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(params[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "@Override\n protected String doInBackground(String... is) {\n\n // Progress for second task\n while(progress_status < 100){\n\n progress_status += 2;\n publishProgress(progress_status);\n SystemClock.sleep(SLEEP_DURATION);\n }\n\n // Make sure string is not empty\n if (is[0] != null) {\n\n try {\n // return a displayable string\n return parseXML(is[0]);\n\n } catch (Exception e) {\n Log.e(\"XMLExample\", e.getMessage());\n }\n }\n\n // Return null if something went wring\n return null;\n }", "private void requestData(String uri) {\n MyTask myTask = new MyTask();\n\n // Work parralial\n myTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, uri);\n }", "@Override\n protected String doInBackground(String... params) {\n try {\n String NewsData;\n //define the url we have to connect with\n URL url = new URL(params[0]);\n //make connect with url and send request\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n //waiting for 7000ms for response\n urlConnection.setConnectTimeout(7000);//set timeout to 5 seconds\n\n try {\n //getting the response data\n InputStream in = new BufferedInputStream(urlConnection.getInputStream());\n //convert the stream to string\n Operations operations = new Operations(getApplicationContext());\n NewsData = operations.ConvertInputToStringNoChange(in);\n //send to display data\n publishProgress(NewsData);\n } finally {\n //end connection\n urlConnection.disconnect();\n }\n\n } catch (Exception ex) {\n }\n return null;\n }", "@Override\n public List<News> loadInBackground() {\n if (mUrl == null) {\n return null;\n }\n // Perform the network request, parse the response, and extract a list of articles.\n List<News> news = QueryUtils.fetchNewsData(mUrl);\n return news;\n }", "@Override\n protected Bitmap doInBackground(String... urls) {\n log(\"BEGIN doInBackground\");\n\n String url = urls[0];\n Bitmap bitmap = null;\n\n try {\n InputStream in = new URL(url).openStream();\n bitmap = BitmapFactory.decodeStream(in);\n Log.i(\"DownloadImageTask\", \"Image downloaded with success.\");\n } catch (Exception e) {\n Log.e(\"Error\", e.getMessage());\n e.printStackTrace();\n }\n\n log(\"END doInBackground\");\n\n return bitmap;\n }", "public void download() {\n // Attempt to perform the download\n Log.d(TAG, \"download\");\n try {\n // Open a connection to the PHP server.\n // Get the response code\n // Open an input stream as well as a buffered input reader\n try {\n // if (responseCode == HttpURLConnection.HTTP_OK) {\n // Attempt to parse the data from the server\n\n /* Add the crumb objects, but only add the coordinates, the rating,\n * the name, and the number of visits to the local database structure.\n */\n\n // Perhaps add a post method to add the crumbs to the hashmap\n\n // Post: Notify the UI thread that the markers are ready to be loaded.\n\n } catch (Exception e) {\n\n } finally {\n // Close the input streams\n }\n } catch(Exception e) {\n\n }\n }", "private void fetch(String serverUrl) {\n if(isOnline()) {\n currentStationStatus = \"Loading Stream...\";\n notifyUser(MyFlag.PAUSE, currentStationName, currentStationStatus);\n } else {\n currentStationStatus = \"No Internet Connection\";\n notifyUser(MyFlag.PAUSE, currentStationName, currentStationStatus);\n return;\n }\n //Log.i(LOG_TAG, \"Make Asynctask to fetch meta data\");\n new FetchMetaDataTask().execute(serverUrl);\n }", "private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}", "public InputStream doInBackground(User obj) throws MalformedURLException, IOException{\n\n InputStream input = new URL(\"http://api.nal.usda.gov/ndb/reports/?ndbno=\"+obj.foodID+\"&format=xml&food_api_key=\"+obj.food_api_key).openStream();\n\n return input;\n\n }", "protected void onPostExecute(Void... feed) {\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n try {\n // Gui request len\n data = downloadUrl(url[0]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return data;\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n Log.d(TAG, \"TAG - MainActivity - onCreate()\");\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n unbinder = ButterKnife.bind(this);\n\n DownloadTask downloadTask = new DownloadTask(getResources());\n String result;\n\n try {\n result = downloadTask.execute(\"https://www.ft-hd-kirchheim.de/\").get();\n Log.d(\"Result\", result); //TODO Nicht in einem Log anzeigen, sondern in der Activity (z.B. in einer Liste) beim drücken von Button\n } catch (ExecutionException | InterruptedException e) {\n e.printStackTrace();\n }\n\n setListener();\n }", "protected String doInBackground(Object... urls) {\n try {\n String st = downloadUrl((String) urls[0]);\n return st;\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "public void downloadSliderData()\n\t{\n\t\tCustomAsyncTask asyncTask = new CustomAsyncTask(this.getActivity());\n asyncTask.setAsyncTaskListener(new OnAsyncTaskListener() \n {\n\t\t\t@Override\n\t\t\tpublic void onAsyncTaskProgressUpdate(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onAsyncTaskPreExecute(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onAsyncTaskPostExecute(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tRuntimeApplication runtimeApp =new RuntimeApplication(); //(RuntimeApplication)\n\t\t\t\t\t\t//Tab3Fragment.this.getActivity().getApplication();\n\t\t\t\t\n\t\t runtimeApp.globalEntryListSlider = customAsyncTask.entryList;\n\t\t\t\tcreateSlider(customAsyncTask.entryList);\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void doAsyncTaskInBackground(CustomAsyncTask customAsyncTask) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif(customAsyncTask.tag == DOWNLOAD_SLIDER_XML_TAG)\n\t\t\t\t{\n\t\t\t \ttry \n\t\t\t \t{\n\t\t\t \t\tBoolean isServerSourceData = false;\n\t\t\t \t\tXMLRequest req = null;\n\t\t\t \t\tif(Config.IS_DATA_FROM_SERVER)\n\t\t\t \t\t{\n\t\t\t \t\t\tif(Utilities.hasConnection(Tab3Fragment.this.getActivity()))\n\t \t\t\t\t{\n\t\t\t \t\t\t\treq = new XMLRequest(Config.URL_PATH + Config.SLIDER_URL);\n\t\t\t\t \t\t\tisServerSourceData = true;\n\t \t\t\t\t}\n\t\t\t \t\t\telse\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\treq = new XMLRequest(Config.ASSETS_FOLDER_PATH + Config.SLIDER_URL);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\treq = new XMLRequest(Config.ASSETS_FOLDER_PATH + Config.SLIDER_URL);\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t \t\t\tList<ListEntry> entryList = isServerSourceData ?\n\t\t\t\t\t\t\t\treq.obtainXMLList() : \n\t\t\t\t\t\t\t\t\treq.obtainXMLListFromLocal(customAsyncTask.activity);\n\t\t\t\t\t\t\t\t\n \t\t\t\tcustomAsyncTask.entryList = entryList;\n \t\t\t\tcustomAsyncTask.listTag = LIST_TAG;\n\t\t\t\t\t} \n\t\t\t \tcatch (ParserConfigurationException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (SAXException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\t\t\t \tcatch (IOException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(customAsyncTask.activity,\n\t\t\t\t\t\t\t\t\"Network Connection Error.\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n asyncTask.tag = DOWNLOAD_SLIDER_XML_TAG;\n asyncTask.startAsyncTask();\n\t}", "@Override\n protected List<Flower> doInBackground(String... params) {\n // InputStream in = null;\n String content = HttpManager.getData(params[0]);\n flowerList = JSONParser.parserFeed(content);\n return flowerList;\n }", "@Override\n protected Integer doInBackground(String... urlString) {\n try {\n \tCargarDatos();\n \n } catch (Exception exception) {\n\n }\n return null ;\n }", "@Override\n protected Boolean doInBackground(String... params) {\n Boolean prepared;\n //progress.show();\n try {\n String str;\n HttpClient myClient = new DefaultHttpClient();\n HttpGet get = new HttpGet(params[0]);\n HttpResponse myResponse = myClient.execute(get);\n BufferedReader br = new BufferedReader(new InputStreamReader(myResponse.getEntity().getContent()));\n while ((str = br.readLine()) != null) {\n serverResponse = str;\n Log.d(\"Address Activity: \", str);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n prepared = true;\n return prepared;\n }", "private void downloadList() {\n new AsyncTask<URL, Integer, List<MyMap>>() {\n @Override protected List<MyMap> doInBackground(URL... params) {\n List<MyMap> myMaps = new ArrayList<>();\n ArrayList<String> mapUrlList = downloadMapUrlList(Variable.getVariable().getMapUrlList());\n int i = 0;\n for (String mapUrl : mapUrlList) {\n try {\n publishProgress(0, 0);\n URL url = new URL(mapUrl);\n publishProgress(80, 0);\n // Read all the text returned by the server\n BufferedReader l = new BufferedReader(new InputStreamReader(url.openStream()));\n int lines = 0;\n while (l.readLine() != null) lines++;\n l.close();\n BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));\n publishProgress(100, 0);\n String str;\n while ((str = in.readLine()) != null) {\n int index = str.indexOf(\"href=\\\"\");\n if (index >= 0) {\n index += 6;\n int lastIndex = str.indexOf(\".ghz\", index);\n if (lastIndex >= 0) {\n int sindex = str.indexOf(\"right\\\">\", str.length() - 52);\n int slindex = str.indexOf(\"M\", sindex);\n String mapName = str.substring(index, lastIndex);\n String size = \"\";\n if (sindex >= 0 && slindex >= 0) {\n size = str.substring(sindex + 7, slindex + 1);\n }\n MyMap mm = new MyMap(mapName, size, mapUrl);\n myMaps.add(mm);\n }\n }\n i++;\n publishProgress(100, (int) (((float) i / lines) * 100));\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n Collections.sort(myMaps);\n // printMapsList(myMaps);\n return myMaps;\n }\n\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n listDownloadPB.setProgress(values[1]);\n listDownloadPB.setSecondaryProgress(values[0]);\n }\n\n @Override protected void onPostExecute(List<MyMap> myMaps) {\n super.onPostExecute(myMaps);\n listReady(myMaps);\n listDownloadPB.setVisibility(View.GONE);\n listDownloadTV.setVisibility(View.GONE);\n }\n }.execute();\n }", "@Override\n protected void onPostExecute(String file_url) {\n mContext.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n MyApplication.getContext().stopProgress(mContext);\n MyApplication.getContext().showCustomProgress(mContext, R.drawable.complete, Constants.DOWNLOAD_COMPLETE);\n MyApplication.getContext().scheduleDismiss();\n mAdapter.notifyDataSetChanged();\n }\n });\n\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return ayudanteConeccionMySql.downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "protected String doInBackground(String... urls) {\n String value;\n value = this.downloadEmails(urls[0], urls[1], urls[2], urls[3], urls[4]);\n return value;\n }", "void mo54428b(DownloadTask downloadTask);", "private void downloadInBackground(){\n\t\tdownloadResourceInBackground(imageUrl1, R.id.dl_image_1, R.id.dl_progressbar_1);\n\t\tdownloadResourceInBackground(imageUrl2, R.id.dl_image_2, R.id.dl_progressbar_2);\n\t\tdownloadResourceInBackground(imageUrl3, R.id.dl_image_3, R.id.dl_progressbar_3);\n\t\tdownloadResourceInBackground(imageUrl4, R.id.dl_image_4, R.id.dl_progressbar_4);\n\t\tdownloadResourceInBackground(imageUrl5, R.id.dl_image_5, R.id.dl_progressbar_5);\n\t}", "private URL getFeedUrl() throws MalformedURLException{\n String feedUrl = \"http://\" + host + \":\" + port + \"/xmlfeed\";\n URL url = new URL(feedUrl);\n return url;\n }", "@Override\n protected Boolean doInBackground( String... params) {\n XMLParserTienda parser = new XMLParserTienda(strURL, null);\n ArrayTiendas = parser.parse();\n return true;\n }", "@Override\n\t\tprotected Document doInBackground(Void... URL) {\n\t\t\ttry {\n\t\t\t\tpostContent = Jsoup.connect(postURL).get();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\tLog.e(\"Pratyaksha_ERROR\", \"Error fetching post\");\n\t\t\t}\n\t\t\treturn postContent;\n\t\t}", "public void fetchDataStock(){\n// stocks.add(new Stock(1,\"bitcoin\",new Double(7000),new Double(7500),new Double(5),null));\n\n stockFetcher = new StockAsyncTask ();\n stockFetcher.execute();\n\n\n // TODO:\n\n refresh(5000);\n\n\n }", "@Override\n protected void onHandleIntent(Intent workIntent) {\n // Gets a URL to read from the incoming Intent's \"data\" value\n String urlString = workIntent.getDataString();\n\n // URL to download from\n URL url;\n\n //block that tries to connect to xml data, and throws an IOException if one occurs\n try {\n // Convert the incoming data string to a URL.\n url = new URL(urlString);\n\n /**\n * Tries to open a connection to the URL. If an IO error occurs, this throws an\n * IOException\n */\n URLConnection urlConnection = url.openConnection();\n\n // If the connection is an HTTP connection, continue\n if (urlConnection instanceof HttpURLConnection) {\n // Broadcasts an Intent indicating that processing has started.\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_STARTED);\n\n // Casts the connection to a HTTP connection\n HttpURLConnection httpURLConnection = (HttpURLConnection) urlConnection;\n\n // Reports that the service is about to connect to the RSS feed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_CONNECTING);\n\n // Get response code from site\n int responseCode = httpURLConnection.getResponseCode();\n\n // Continue if response is OK\n if (responseCode == HttpURLConnection.HTTP_OK) {\n // Get content length (in bytes) to calculate progress from\n int contentLength = httpURLConnection.getContentLength();\n\n InputStream inputStream = urlConnection.getInputStream();\n\n // Save to file\n //FileOutputStream outputStream = new FileOutputStream(Constants.XML_SAVE_FILE_PATH);\n // Save to internal storage instead\n File file = new File(getFilesDir(), Constants.XML_SAVE_FILE_NAME);\n FileOutputStream outputStream = new FileOutputStream(file);\n\n // keep track of how much is downloaded\n int totalBytesRead = 0;\n int progressDone = 0;\n // Report downloading state\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_DOWNLOADING);\n\n int bytesRead = -1;\n byte[] buffer = new byte[BUFFER_SIZE];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n totalBytesRead += bytesRead;\n progressDone = totalBytesRead/contentLength * 100;\n // TODO: broadcast progress\n }\n\n outputStream.close();\n inputStream.close();\n httpURLConnection.disconnect();\n // Report download complete\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_DOWNLOAD_COMPLETE);\n }\n\n }\n else {\n // Report that action failed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_FAILED);\n return;\n }\n\n // TODO: make sure tvheadend is running\n // Open sockect connection to xmltv.sock\n String socketName = getFilesDir() + \"/xmltv.sock\";\n Log.d(\"socketConnection\", \"Connecting to \" + socketName);\n LocalSocketAddress socketAddress = new LocalSocketAddress(socketName,\n LocalSocketAddress.Namespace.FILESYSTEM);\n LocalSocket socket = new LocalSocket();\n socket.connect(socketAddress);\n if (socket.isConnected()) {\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_SOCKET_CONNECTED);\n\n // open xml file\n File file = new File(getFilesDir(), Constants.XML_SAVE_FILE_NAME);\n FileInputStream inputStream = new FileInputStream(file);\n\n // get socket output stream\n OutputStream outputStream = socket.getOutputStream();\n\n // write xml data to xmltv socket\n int bytesRead = -1;\n byte[] buffer = new byte[BUFFER_SIZE];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n outputStream.close();;\n inputStream.close();\n socket.close();\n }\n else {\n // Report that action failed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_FAILED);\n return;\n }\n // Done successfully\n // set last update time - THIS could be DANGEROUS since shared prefs is not thread safe!\n Date now = new Date();\n EpgStoredSettings settings = new EpgStoredSettings(getApplicationContext());\n settings.setLastUpdateTime(now);\n // notify status fragment\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_COMPLETE);\n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n // Report that action failed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_FAILED);\n\n }\n catch (IOException e) {\n e.printStackTrace();\n // Report that action failed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_FAILED);\n }\n catch (SecurityException e)\n {\n e.printStackTrace();\n // Report that action failed\n mBroadcaster.broadcastIntentWithState(Constants.STATE_ACTION_FAILED);\n }\n }", "public DownloadAsyncTask(OnDownloadAsyncTask onDownloadAsyncTask) {\n this.onDownloadAsyncTask = onDownloadAsyncTask;\n }", "@Override\n protected String doInBackground(String... urls) {\n OkHttpClient client = new OkHttpClient();\n Request request =\n new Request.Builder()\n .url(urls[0])\n .build();\n Response response = null;\n try {\n response = client.newCall(request).execute();\n if (response.isSuccessful()) {\n return response.body().string();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"Download failed\";\n }", "@Override\n protected Boolean doInBackground(URL... urls)\n {\n PackageManager pkgMgr = getApplicationContext().getPackageManager();\n List<PackageInfo> pkgInfoList = pkgMgr.getInstalledPackages(0);\n List<PackageInfo> installedApks = new ArrayList<>();\n\n for(int i=0;i< pkgInfoList.size();i++)\n {\n PackageInfo pkg = pkgInfoList.get(i);\n if((pkg.applicationInfo.flags & pkg.applicationInfo.FLAG_SYSTEM) <= 0)\n { //user installed apks\n installedApks.add(pkg);\n }\n }\n\n for(int j=0;j<installedApks.size();j++)\n {\n if(installedApks.get(j).packageName.equals(agGamePkgName))\n {\n break;\n }\n }\n\n if( j == installedApks.size())\n {\n //AG game apk is not installed, download from internet\n try{\n downloadMgr = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n DownloadManager.Request downloadReq = new DownloadManager.Request(Uri.parse(agGameSite));\n downloadReq.setDestinationInExternalPublicDir(\"AG Game\",\"AGGame.apk\");\n downloadReq.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n downloadID = downloadMgr.enqueue(downloadReq);\n }catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }\n return true;\n }", "public AtomFeed(String feedURL) throws ParserConfigurationException, IOException\r\n\t{\r\n\t\tthis.feedURL = feedURL;\r\n\t\txml = null;\r\n\t\tdocumentbuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n\t\tif (!refresh()) throw new IOException();\r\n\t}", "protected void onPostExecute(String file_url) {\n }", "protected void onPostExecute(String file_url) {\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\r\n\t\tcontext=this;\r\n\t\tb=getIntent().getExtras();\r\n\t\tname=b.getString(\"TITLE\");\r\n\t\t\r\n\t\ttitleList=new ArrayList<String>();\r\n\t\tdesList=new ArrayList<String>();\r\n\t\turlList=new ArrayList<String>();\r\n\t\timageList=new ArrayList<String>();\r\n\t\trb=new RssDatabase(this);\r\n\t\trb.open();\r\n\t\trss=rb.getUrlByName(name);\r\n\t\trb.close();\r\n\t\tToast.makeText(this,rss, 2).show();\r\n\t\tp=new HttpPost(rss);\r\n\t\thclient=new DefaultHttpClient();\r\n\t\tnew AsyncClass().execute();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\t\tsetURL();\n\t\tMainActivity.ansyncTask=true;\n\t}", "public static void getFeed(String url) {\n if (rssReader != null) {\n rssReader.loadFeeds(url);\n }\n }", "public void onRefresh() {\n\n //detect if there's a connection issue or not: if there's a connection problem stop refreshing and show message\n if (cM.getActiveNetworkInfo() == null) {\n Toast toast = Toast.makeText(getBaseContext(), R.string.no_internet, Toast.LENGTH_SHORT);\n toast.show();\n swiperefresh.setRefreshing(false);\n\n } else {\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n DOMParser tmpDOMParser = new DOMParser();\n fFeed = tmpDOMParser.parseXml(feedURL);\n ListActivity.this.runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n if (fFeed != null && fFeed.getItemCount() > 0) {\n adapter.notifyDataSetChanged();\n swiperefresh.setRefreshing(false);\n }\n }\n });\n }\n });\n thread.start();\n }\n }", "void mo54418a(DownloadTask downloadTask);" ]
[ "0.6870247", "0.6714287", "0.6494753", "0.629877", "0.6276138", "0.6276138", "0.61485136", "0.614733", "0.61217356", "0.6118014", "0.61040926", "0.60669607", "0.6056425", "0.6050626", "0.60435814", "0.6018634", "0.60135263", "0.6005614", "0.5997848", "0.59917074", "0.5978249", "0.5977195", "0.5977195", "0.5977195", "0.5977195", "0.59767646", "0.59767646", "0.5968722", "0.5957264", "0.59304345", "0.5914791", "0.5888977", "0.5873457", "0.58565074", "0.58565074", "0.58565074", "0.5852121", "0.5850775", "0.58349156", "0.58118236", "0.5808792", "0.5807688", "0.57820106", "0.5772226", "0.5748389", "0.5741325", "0.5717361", "0.5698035", "0.56906664", "0.5668365", "0.56477296", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5633199", "0.5625633", "0.5604447", "0.55976474", "0.55692625", "0.55602026", "0.5553053", "0.554121", "0.5540484", "0.55297464", "0.5528397", "0.55247515", "0.55173916", "0.55115867", "0.54937804", "0.5491145", "0.54780966", "0.54551804", "0.54545516", "0.5424408", "0.5413618", "0.5404133", "0.5401032", "0.5395294", "0.5389114", "0.5371425", "0.5370144", "0.5361103", "0.5355083", "0.53514457", "0.5350497", "0.5347564", "0.5332401", "0.53253764", "0.5324657", "0.5324657", "0.53116065", "0.53088695", "0.5305508", "0.5281961", "0.52795154" ]
0.0
-1
Uploads XML from stackoverflow.com, parses it, and combines it with HTML markup. Returns HTML string.
private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException { InputStream stream = null; // Instantiate the parser StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser(); List<Entry> entries = null; String title = null; String url = null; String summary = null; Calendar rightNow = Calendar.getInstance(); DateFormat formatter = new SimpleDateFormat("MMM dd h:mmaa"); // Checks whether the user set the preference to include summary text SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); boolean pref = sharedPrefs.getBoolean("summaryPref", false); StringBuilder htmlString = new StringBuilder(); htmlString.append("<h3>" + "title: " + "</h3>"); htmlString.append("<em>" + " " + formatter.format(rightNow.getTime()) + "</em>"); try { stream = downloadUrl(urlString); entries = stackOverflowXmlParser.parse(stream); // Makes sure that the InputStream is closed after the app is // finished using it. } finally { if (stream != null) { stream.close(); } } // StackOverflowXmlParser returns a List (called "entries") of Entry objects. // Each Entry object represents a single post in the XML feed. // This section processes the entries list to combine each entry with HTML markup. // Each entry is displayed in the UI as a link that optionally includes // a text summary. for (Entry entry : entries) { htmlString.append("<p><a href='"); htmlString.append(entry.link); htmlString.append("'>" + entry.title + "</a></p>"); // If the user set the preference to include summary text, // adds it to the display. if (pref) { htmlString.append(entry.summary); } } return htmlString.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@POST\n\t@Path(\"upload\")\n\t@Produces(MediaType.TEXT_HTML)\n\t//@Consumes(\"mutipart/form-data\")\n\tpublic String uploadDocument(@Context HttpServletRequest request) {\n\t\tString endHTML = \"\";\n\t\ttry{\n\t\t\tLoggingFilter logFilter = new LoggingFilter();\n\t\t\tif(ServletFileUpload.isMultipartContent(request)){\n\t\t\t\tFileItemFactory factory = new DiskFileItemFactory();\n\t\t\t\tServletFileUpload upload = new ServletFileUpload(factory);\n\t\t\t\tList<FileItem> items=null;\n\t\t\t\ttry{\n\t\t\t\t\titems = upload.parseRequest(request);\n\t\t\t\t}catch (FileUploadException e){\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tif(items!=null){\n\t\t\t\t\tIterator<FileItem> iter = items.iterator();\n\t\t\t\t\twhile(iter.hasNext()){\n\t\t\t\t\t\tFileItem item = iter.next();\n\t\t\t\t\t\tif(!item.isFormField() && item.getSize() >0){\n\t\t\t\t\t\t\t//System.out.println(\"The file name is: \" + item.getName());\n\t\t\t\t\t\t\tUtilities util = new Utilities();\n\t\t\t\t\t\t\tDocument doc = util.translateInputStreamIntoXMLDoc(item.getInputStream());\n\t\t\t\t\t\t\tendHTML = util.transformSchemeToDoc(doc);\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\tResponse.ok().build();\n\t\t\t\n\t\t} catch(Exception e){\n\t\t\tSystem.out.println(\"Error caught\");\n\t\t\t//throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);\n\t\t\tUtilities util = new Utilities();\n\t\t\tendHTML = util.getErrorPage();\n\t\t\tSystem.out.println(endHTML);\n\t\t} finally{\n\t\t\treturn endHTML;\n\t\t}\n\t\t\n\t}", "public String parserXHtml(String html) {\r\n\t\torg.jsoup.nodes.Document document = Jsoup.parseBodyFragment(html);\r\n\t\tdocument.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml);\r\n\t\tdocument.outputSettings().charset(\"UTF-8\");\r\n\t\treturn document.toString();\r\n\t}", "private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException {\n InputStream stream = null;\n StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser();\n List<Entry> entries = null;\n String title = null;\n String url = null;\n String summary = null;\n Calendar rightNow = Calendar.getInstance();\n DateFormat formatter = new SimpleDateFormat(\"MMM dd h:mmaa\");\n int count = 1;\n\n // Checks whether the user set the preference to include summary text\n SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n boolean pref = sharedPrefs.getBoolean(\"summaryPref\", false);\n\n StringBuilder htmlString = new StringBuilder();\n htmlString.append(\"<h3>\" + getResources().getString(R.string.page_title) + \"</h3>\");\n htmlString.append(\"<em>\" + getResources().getString(R.string.updated) + \" \" +\n formatter.format(rightNow.getTime()) + \"</em>\");\n\n try {\n stream = downloadUrl(urlString);\n entries = stackOverflowXmlParser.parse(stream);\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n\n // StackOverflowXmlParser returns a List (called \"entries\") of Entry objects.\n // Each Entry object represents a single post in the XML feed.\n // This section processes the entries list to combine each entry with HTML markup.\n // Each entry is displayed in the UI as a link that optionally includes\n // a text summary.\n for (Entry entry : entries) {\n \t\n \tString photo = \"\";\n \tString video = \"video\";\n htmlString.append(\"<p><a href='\");\n photo = \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=\"+entry.link+\"&sensor=true&key=AIzaSyBeNRBzRlJQy0-L8OlYFTnMcJ9LRb6h_-s\";\n \n \n htmlString.append(photo);\n htmlString.append(\"'>\" + entry.title + \"</a></p>\");\n if(count == 1 ||count == 3 ||count == 6 ||count == 8 ||count == 9) {\n \tvideo =\"http://192.168.0.16:8010/cloud/my_videos/\"+Integer.toString(count);\n \thtmlString.append(\"<a href='\"+video+\"'> - Video</a>\");\n }\n count++;\n \n // If the user set the preference to include summary text,\n // adds it to the display.\n if (pref) {\n htmlString.append(entry.summary);\n }\n }\n// URL url2 = new URL(\"http://192.168.0.16:8000/cloud/images/\");\n// HttpURLConnection conn2 = (HttpURLConnection) url2.openConnection();\n//\t\t\n// //conn2.setDoOutput(true);\n// conn2.setConnectTimeout(10000 /* milliseconds */);\n// conn2.setRequestMethod(\"GET\");\n// conn2.setDoInput(true);\n// conn2.connect();\n// //OutputStream out1 = new BufferedOutputStream(conn2.getOutputStream());\n// \n// \n// InputStream in = new BufferedInputStream(conn2.getInputStream());\n// BufferedReader br = new BufferedReader(new InputStreamReader(in));\n// String test = br.readLine();\n// String output=\"\";\n// while(test != null) {\n// \toutput = output +test;\n// \ttest = br.readLine();\n// }\n// output=\"<html><body><video width=\\\"320\\\" height=\\\"240\\\" controls><source src=\\\"movie.mp4\\\" type=\\\"video/mp4\\\"><source src=\\\"movie.ogg\\\" type=\\\"video/ogg\\\">Your browser does not support the video tag.</video></body></html>\";\n \n return htmlString.toString();\n }", "private void createPostXML() {\n Call<PostModel> call = jsonPlaceHolderAPI.createPostXML(23, \"New Title\", \"New Text\");\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getUserId() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "public static WebXml parseWebXml(InputStream theInput,\n EntityResolver theEntityResolver)\n throws SAXException, ParserConfigurationException, IOException\n {\n DocumentBuilder builder = createDocumentBuilder();\n if (theEntityResolver != null)\n {\n builder.setEntityResolver(theEntityResolver);\n }\n else\n {\n builder.setEntityResolver(new WebXmlEntityResolver());\n }\n return new WebXml(builder.parse(theInput));\n }", "public void run() {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tsb.append(\"<files>\");\n\t\t\t\tsb.append(\"<file>\");\n\t\t\t\tsb.append(\"<username>\");\n\t\t\t\tsb.append(e1);\n\t\t\t\tsb.append(\"</username>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<password>\");\n\t\t\t\tsb.append(e2);\n\t\t\t\tsb.append(\"</password>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<email>\");\n\t\t\t\tsb.append(e4);\n\t\t\t\tsb.append(\"</email>\");\n\t\t\t\tsb.append(\"<name>\");\n\t\t\t\tsb.append(e5);\n\t\t\t\tsb.append(\"</name>\");\n\t\t\t\t\n\t\t\t\tsb.append(\"<sex>\");\n\t\t\t\tsb.append(i);\n\t\t\t\tsb.append(\"</sex>\");\n\t\t\t\tsb.append(\"<phone>\");\n\t\t\t\tsb.append(e6);\n\t\t\t\tsb.append(\"</phone>\");\n\t\t\t\tsb.append(\"<headname>\");\n\t\t\t\tsb.append(url);\n\t\t\t\tsb.append(\"</headname>\");\n\t\t\t\tsb.append(\"<head>\");\n\t\t\t\tByteArrayOutputStream bo = new ByteArrayOutputStream();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tFileInputStream f = new FileInputStream(\"/sdcard/\"+url);\n\t\t\t\tbyte []image = new byte [1024];\n\t\t\t\tint len = 0;\n\t\t\t\twhile ((len=f.read(image))!=-1){\n\t\t\t\t\tbo.write(image, 0, len);\n\t\t\t\t}\n\t\t\t\tbyte re[] = bo.toByteArray();\n\t\t\t\tString encond = Base64.encodeToString(re, Base64.DEFAULT);\n\t\t\t\n\t\t\t\tbo.close();\n\t\t\t\tf.close();\n\t\t\t\tsb.append(encond);\t\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\t\t\n\t\t\t\tsb.append(\"</head>\");\n\t\t\t\tsb.append(\"<job>\");\n\t\t\t\tsb.append(e8);\n\t\t\t\tsb.append(\"</job>\");\n\t\t\t\tsb.append(\"<address>\");\n\t\t\t\tsb.append(e9);\n\t\t\t\tsb.append(\"</address>\");\n\t\t\t\tsb.append(\"<circle>\");\n\t\t\t\tsb.append(e10);\n\t\t\t\tsb.append(\"</circle>\");\n\t\t\t\tsb.append(\"<guanzhu>\");\n\t\t\t\tsb.append(n1+\"\"+n2+\"\"+n3);\n\t\t\t\tsb.append(\"</guanzhu>\");\n\t\t\t\tsb.append(\"</file>\");\n\t\t\t\tsb.append(\"</files>\");\n\t\t\t\tbyte content[] = sb.toString().getBytes();\n\t\t\t\ttry {\n\t\t\t\t\tURL u = new URL(\"http://10.0.2.2:8080/Lvyou/LYRegisterServlet\");\n\t\t\t\t\tHttpURLConnection huc = (HttpURLConnection) u.openConnection();\n\t\t\t\t\thuc.setDoInput(true);\n\t\t\t\t\thuc.setDoOutput(true);\n\t\t\t\t\thuc.setRequestMethod(\"POST\");\n\t\t\t\t\thuc.setRequestProperty(\"Content-Type\", \"mutipart/form-data\");\n\t\t\t\t\thuc.setRequestProperty(\"Content-Length\", content.length+\"\");\n\t\t\t\t\thuc.getOutputStream().write(content);\n\t\t\t\t\tString str = \"\";\n\t\t\t\t\tif(huc.getResponseCode()==HttpURLConnection.HTTP_OK){\n\t\t\t\t\t\tInputStream in =huc.getInputStream();\n\t\t\t\t\n\t\t\t\t\t\tLYRegisterBean rb = new LYRegisterBean();\n\t\t\t\t\t\tString reg=rb.register(in);\n\t\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\t\tmsg.obj=reg;\n\t\t\t\t\t\thb.sendMessage(msg);\n\n\n\t\t\t\t\t}}\n\t\t\t\t\t catch (IOException 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\t \n\t\t\t\tpd.cancel();\n\t\t\t}", "public String sendPostXML(String xml) throws IOException {\n http.setRequestMethod(\"POST\");\n http.setDoOutput(true);\n http.setDoInput(true);\n http.setUseCaches(false);\n\n byte[] out = xml.getBytes(StandardCharsets.UTF_8);\n int length = out.length;\n\n http.setFixedLengthStreamingMode(length);\n http.setRequestProperty(\"content-type\", \"text/xml; charset=UTF-8\");\n\n OutputStreamWriter writer = new OutputStreamWriter( http.getOutputStream());\n writer.write(xml);\n writer.flush();\n\n StringBuilder s = new StringBuilder();\n BufferedReader reader = new BufferedReader(new InputStreamReader(http.getInputStream()));\n for (String line; (line = reader.readLine()) != null;) {\n s.append(line);\n }\n\n writer.close();\n reader.close();\n http.disconnect();\n\n return s.toString();\n }", "public String getRequestInXML() throws Exception;", "private Document parseFile() throws IOException {\n\tString contents = instream_to_contents();\n\tDocument doc = Jsoup.parse(contents);\n\treturn doc;\n }", "public String getHTML() throws Exception {\n\t\t// create object to store html source text as it is being collected\n\t\tStringBuilder html = new StringBuilder();\n\t\t// open connection to given url\n\t\tURL url = new File(urlString).toURI().toURL();\n\t\t// create BufferedReader to buffer the given url's HTML source\n\t\tBufferedReader htmlbr =\n\t\t\t\tnew BufferedReader(new InputStreamReader(url.openStream()));\n\t\tString line;\n\t\t// read each line of HTML code and store in StringBuilder\n\t\twhile ((line = htmlbr.readLine()) != null) {\n\t\t\thtml.append(line);\n\t\t}\n\t\thtmlbr.close();\n\t\t// convert StringBuilder into a String \n\t\tString stringHtml = html.toString();\n\t\t\n\t\t// preprocess the string to replace all special chars\n\t\tstringHtml.replaceAll(\"&#39\", \"'\");\n\t\tstringHtml.replaceAll(\"&#8208\", \"-\");\n\t\tstringHtml.replaceAll(\"&#38\", \"&\");\n\t\t\n\t\treturn stringHtml;\n\t}", "protected String parseAndSaveHtml() {\n\t\t// the line of the html code\n\t\tString inputLine;\n\n\t\t// creates the folder's name from the domain name\n\t\tString folderName = nameFolder();\n\t\tFile folderNameFile = new File(path + folderName);\n\n\t\t// checks if there is already a folder with the same name\n\t\tif (!existsFolder(folderNameFile)) {\n\t\t\tmakeFolder(folderNameFile);\n\t\t}\n\n\t\t// creates the file with a random unique name\n\t\tString fileName = generateFileName(folderName);\n\t\tFile file = new File(path + folderName + \"\\\\\" + fileName + \".txt\");\n\n\t\ttry {\n\t\t\t// streams which help to read from the url\n\t\t\tInputStreamReader is = new InputStreamReader(url.openStream(), \"UTF-8\");\n\t\t\tBufferedReader br = new BufferedReader(is);\n\t\t\tbr.mark(0);\n\n\t\t\t// streams which help to write from the url\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\tOutputStreamWriter osw = new OutputStreamWriter(fos, \"UTF-8\");\n\t\t\tBufferedWriter bw = new BufferedWriter(osw);\n\n\t\t\t// reads line by line the html code\n\t\t\twhile ((inputLine = br.readLine()) != null) {\n\t\t\t\tbw.write(inputLine);\n\t\t\t\tbw.newLine();\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tbw.close(); //closes the writer stream\n\n\t\t\treturn path + folderName + \"\\\\\" + fileName + \".txt\";\n\t\t} catch (IOException e) {\n\t\t\tfile.delete();\n\t\t\treturn null;\n\t\t}\n\n\t}", "public void xmlInputStream() {\n inputStream = context.getResources().openRawResource(R.raw.flowers_xml);\n //stringInputStream = convertInputStreamToString(inputStream);\n //System.out.println(\"------------ InputStream ------------\\n\" + stringInputStream);\n //------------------------------------------------------------------------------------------\n }", "public void parseXML(String XML);", "public void openXml() throws ParserConfigurationException, TransformerConfigurationException, SAXException {\n\n SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();\n transformer = saxTransformerFactory.newTransformerHandler();\n\n // pretty XML output\n Transformer serializer = transformer.getTransformer();\n serializer.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"4\");\n serializer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n transformer.setResult(result);\n transformer.startDocument();\n transformer.startElement(null, null, \"inserts\", null);\n }", "@Override\npublic\tvoid parseInput() {\n InputStream is = new ByteArrayInputStream(this.body.toString().getBytes());\n\t\t\n\t\t\n\t\ttry {\n\t\t\tthis.domIn = new XMLInputConversion(is);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.rootXML = this.domIn.extractDOMContent();\n\t}", "public abstract XMLDocument parse(URL url);", "private static String getHTMLFile(String googleScholarURL) throws Exception {\r\n HTMLExtractor googleScholarParser = new HTMLExtractor();\r\n String rawHTMLString = googleScholarParser.getHTML(googleScholarURL);\r\n return rawHTMLString;\r\n }", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "protected InputStream getContentXML(String viewId) throws Exception {\n if (log.isDebugEnabled()) {\n log.debug(\"requested viewId: \" + viewId);\n }\n StringBuilder sb = new StringBuilder(\"<?xml version=\\\"1.0\\\"?>\");\n sb.append(\"<root>\");\n sb.append(\"<child>\");\n sb.append(\"Hello World!\");\n sb.append(\"</child>\");\n sb.append(\"</root>\");\n return new ByteArrayInputStream(sb.toString().getBytes(\"utf-8\"));\n }", "static String prettyXml(String xml) {\n\t\tDocument doc = null;\n\t\tOutputFormat format = new OutputFormat(\" \", true);\n\t\tformat.setTrimText(true);\n\t\tStringWriter sw = new StringWriter();\n\t\ttry {\n\t\t\txml = SchemEditUtils.expandAmpersands(xml);\n\t\t\tdoc = Dom4jUtils.getXmlDocument(xml);\n\t\t\tXMLWriter prettyWriter = new XMLWriter(sw, format);\n\t\t\tprettyWriter.write(doc);\n\t\t} catch (Throwable e) {\n\t\t\tprtln(\"prettyXml error: \" + e.getMessage());\n\t\t\treturn \"\";\n\t\t}\n\t\treturn sw.toString();\n\t}", "private String parseXML(String is) throws\n XmlPullParserException, IOException, URISyntaxException {\n\n // xml classes used to read xml file\n XmlPullParserFactory factory = XmlPullParserFactory.newInstance();\n factory.setNamespaceAware(true);\n XmlPullParser parser = factory.newPullParser();\n\n // Set xml string to input\n parser.setInput(new StringReader(is));\n\n // Start and end tags and end document\n int eventType = parser.getEventType();\n\n // current tag\n String currentTag;\n\n // current value of tag/element\n String currentElement;\n\n int counter = 0;\n StringBuilder sb = new StringBuilder();\n\n // parse the entire xml file until done\n while (eventType != XmlPullParser.END_DOCUMENT) {\n // look for start tags\n if (eventType == XmlPullParser.START_TAG) {\n // get the name of the start tag\n currentTag = parser.getName();\n\n if (currentTag.equals(\"step\")) {\n sb.append(\"Step \" + ++counter + \":\\n\");\n sb.append(\"-----------------------------------------\\n\");\n }\n // Driving directions\n else if (currentTag.equals(\"html_instructions\")) {\n currentElement = parser.nextText();\n\n // Replace html bold tags\n currentElement = currentElement.replace(\"<b>\", \"\");\n currentElement = currentElement.replace(\"</b>\", \"\");\n\n // Get rid of div tags\n String s;\n while (currentElement.contains(\"<\")) {\n if (currentElement.indexOf(\">\") == currentElement.lastIndexOf(\">\")){\n s = \"\";\n } else {\n s = \" \";\n }\n currentElement = currentElement.replace(currentElement.substring(currentElement.indexOf(\"<\"),\n currentElement.indexOf(\">\") + 1), s);\n }\n\n // Append html parsed string to directions string\n currentElement += \".\\n\\n\";\n sb.append(currentElement);\n }\n }\n\n // If the end of the string is reached\n else if (eventType == XmlPullParser.END_TAG) {\n currentTag = parser.getName();\n\n if (currentTag.equals(\"DirectionsResponse\")) {\n\n // return displayable string\n sb.append(\"------------------------------------\\n\\n\");\n return sb.toString();\n }\n }\n\n // get next tag\n eventType = parser.next();\n }\n\n // return null if something went wrong\n return null;\n }", "public String extractHtml(HttpURLConnection connection) {\n if (connection == null) return \"\";\n Scanner scanner = null;\n try {\n scanner = new Scanner(connection.getInputStream());\n } catch (IOException e) {\n return \"\";\n }\n scanner.useDelimiter(\"\\\\Z\");\n try {\n return scanner.next();\n } catch (Exception e) {\n return \"\";\n }\n }", "@Override\n\t\tprotected Document doInBackground(Void... URL) {\n\t\t\ttry {\n\t\t\t\tpostContent = Jsoup.connect(postURL).get();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\tLog.e(\"Pratyaksha_ERROR\", \"Error fetching post\");\n\t\t\t}\n\t\t\treturn postContent;\n\t\t}", "static public void czytaj(String host){\n try {\n czytaj(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(\"http://\"+host+\"/xml.php\"));\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n }\n }", "private static void processFeed(String url, String file, SimpleWriter out) \n {\n \tXMLTree rss = new XMLTree1(url);\n \t\n \t// make sure the rss tree is a valid rss tree\n if(!ensureValidRSSTree(rss, out))\n {\n \tout.println(\"This is not a valid RSS Tree.\");\n \treturn;\n }\n \n // print entire document to file\n outputHeader(rss.child(0), out);\n outputFooter(out);\n \n }", "public static WebXml parseWebXmlFromFile(File theFile,\n EntityResolver theEntityResolver)\n throws SAXException, ParserConfigurationException, IOException\n {\n InputStream in = null;\n try\n {\n in = new FileInputStream(theFile);\n return parseWebXml(in, theEntityResolver);\n }\n finally\n {\n if (in != null)\n {\n try\n {\n in.close();\n }\n catch (IOException ioe)\n {\n // we'll pass on the original IO error, so ignore this one\n }\n }\n }\n }", "@Test\n\tpublic void testHTMLAsXML(){\n \tFile xml = new File(testData,\"html/htmlsidekick.html\");\n \t\n \tBuffer b = TestUtils.openFile(xml.getPath());\n\t\t\n \t// wait for end of parsing\n \tdoInBetween(new Runnable(){\n \t\t\tpublic void run(){\n \t\t\t\taction(\"sidekick.parser.xml-switch\",1);\n \t\t}}, \n \t\tmessageOfClassCondition(sidekick.SideKickUpdate.class),\n \t\t10000);\n\t\t\n \taction(\"sidekick-tree\");\n \tPause.pause(2000);\n\n \tHyperlinkSource src = HTMLHyperlinkSource.create();\n\t\tfinal Hyperlink h = src.getHyperlink(TestUtils.view().getBuffer(), 3319);\n\t\tassertNotNull(h);\n\t\tassertTrue(h instanceof jEditOpenFileHyperlink);\n\t\tassertEquals(67, h.getStartLine());\n\t\tassertEquals(67, h.getEndLine());\n\t\tGuiActionRunner.execute(new GuiTask() {\n\t\t\t\n\t\t\t@Override\n\t\t\tprotected void executeInEDT() throws Throwable {\n\t\t\t\th.click(TestUtils.view());\n\t\t\t}\n\t\t});\n\t\t\n\t\tassertEquals(\"jeditresource:/SideKick.jar!/index.html\",TestUtils.view().getBuffer().getPath());\n\t\t\n\t\tTestUtils.close(TestUtils.view(), TestUtils.view().getBuffer());\n\t\tTestUtils.close(TestUtils.view(), b);\n\t}", "public SimplePostTool(URL solrUrl) {\n this.solrUrl = solrUrl;\n warn(\"Make sure your XML documents are encoded in \" + POST_ENCODING\n + \", other encodings are not currently supported\");\n }", "@GET\n\t@Produces( { MediaType.TEXT_XML })\n\tpublic UserXML getHTML() {\n\t\tUserXML user = new UserXML();\n\t\tuser.setName(\"Sagar Prasad\");\n\t\tuser.setDescription(\"Some Description\");\n\t\treturn user;\n\t}", "private static Document parseXML(InputStream stream) throws Exception {\n DocumentBuilderFactory objDocumentBuilderFactory = null;\n DocumentBuilder objDocumentBuilder = null;\n Document doc = null;\n try {\n objDocumentBuilderFactory = DocumentBuilderFactory.newInstance();\n objDocumentBuilder = objDocumentBuilderFactory.newDocumentBuilder();\n doc = objDocumentBuilder.parse(stream);\n } catch (Exception ex) {\n throw ex;\n }\n return doc;\n }", "public void marshallContent(String xmlString)\n\tthrows WatchYouException {\n\t\tSAXBuilder builder = new SAXBuilder();\n\t\tDocument doc = null;\n\t\ttry {\n\t\t\tdoc = builder.build(new StringReader(xmlString));\n\t\t}\n\t\tcatch (JDOMException jdome) {\n\t\t\tthrow new WatchYouException(\"JDOMException in YouTubeRecord.marshallContent:\"+jdome.getMessage());\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tthrow new WatchYouException(\"IOException in YouTubeRecord.marshallContent:\"+ioe.getMessage());\n\t\t}\n\n\t\tElement rootEl = doc.getRootElement(); // the root element is <ut_response status=____>\n\t\tElement videoEl = rootEl.getChild(\"video_details\");\n\t\tauthor = videoEl.getChildTextTrim(\"author\");\n\t\ttitle = videoEl.getChildTextTrim(\"title\");\n\t\ttags = videoEl.getChildTextTrim(\"tags\");\n\t\tdescription = videoEl.getChildTextTrim(\"description\");\n\t\trecordingDate = videoEl.getChildTextTrim(\"recording_date\");\n\t\trecordingLocation = videoEl.getChildTextTrim(\"recording_location\");\n\t\trecordingCountry = videoEl.getChildTextTrim(\"recording_country\");\n\t\tthis.ratingAvg = parseDouble(videoEl.getChildTextTrim(\"rating_avg\"),0.0d);\n\t\tthis.ratingCount = parseInt(videoEl.getChildTextTrim(\"rating_count\"),0);\n\t\tthis.updateTime = parseLong(videoEl.getChildTextTrim(\"update_time\"),0l);\n\t\tthis.viewCount = parseInt(videoEl.getChildTextTrim(\"view_count\"),0);\n\t\tthis.uploadTime = parseLong(videoEl.getChildTextTrim(\"upload_time\"),0l);\n\t\tthis.lengthSeconds = parseInt(videoEl.getChildTextTrim(\"length_seconds\"),0);\n\t\t// pick off the image thumbnail URL, but pre-validate it even though it's stored as a string\n\t\tthis.thumbnailURL = parseURLToString(videoEl.getChildTextTrim(\"thumbnail_url\"),null);\n\t\t// fetch the channel list if any\n\t\tthis.channelList = new Vector<String>();\n\t\tElement channelEl = videoEl.getChild(\"channel_list\");\n\t\tif (channelEl != null) {\n\t\t\tIterator it = channelEl.getChildren().iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tElement el = (Element) it.next();\n\t\t\t\tthis.channelList.add(el.getText());\n\t\t\t}\n\t\t} \n\t}", "boolean streamXML(String path,\n ContentHandler contentHandler,\n LexicalHandler lexicalHandler)\n throws SAXException, ProcessingException;", "XmlStringTester(File in) throws Exception {\n\t\txml = Files.readFile(in).toString();\n\t\txml = SchemEditUtils.expandAmpersands(xml);\n\t\tdoc = Dom4jUtils.getXmlDocument(xml);\n\t\tstringWriter = getStringWriter();\n\t}", "@Override\n public String getContentType() {\n return \"text/xml; charset=UTF-8\";\n }", "private void unpackGeneralXmlMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo, StatusListener statusListener)\n throws DocumentFormatException {\n boolean docHasContentButNoValidURL = hasContentButNoValidUrl(doc);\n\n XmlDocumentHandler xmlDocHandler = null;\n try {\n\n // Create a new Xml document handler\n xmlDocHandler =\n new XmlDocumentHandler(doc, this.markupElementsMap,\n this.element2StringMap);\n\n // Register a status listener with it\n xmlDocHandler.addStatusListener(statusListener);\n\n // set repositioning object\n xmlDocHandler.setRepositioningInfo(repInfo);\n\n // set the object with ampersand coding positions\n xmlDocHandler.setAmpCodingInfo(ampCodingInfo);\n\n // create the parser\n SAXDocumentParser newxmlParser = new SAXDocumentParser();\n\n // Set up the factory to create the appropriate type of parser\n // Fast Infoset doesn't support validating which is good as we would want\n // it off any way, but we do want it to be namesapace aware\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespaces\", true);\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespace-prefixes\",\n true);\n newxmlParser.setContentHandler(xmlDocHandler);\n newxmlParser.setErrorHandler(xmlDocHandler);\n newxmlParser.setDTDHandler(xmlDocHandler);\n newxmlParser.setEntityResolver(xmlDocHandler);\n\n // Parse the XML Document with the appropriate encoding\n Reader docReader = null;\n try {\n InputSource is;\n if(docHasContentButNoValidURL) {\n // no URL, so parse from string\n is = new InputSource(new StringReader(doc.getContent().toString()));\n } else if(doc instanceof TextualDocument) {\n // textual document - load with user specified encoding\n String docEncoding = ((TextualDocument)doc).getEncoding();\n // don't strip BOM on XML.\n docReader =\n new InputStreamReader(doc.getSourceUrl().openStream(),\n docEncoding);\n is = new InputSource(docReader);\n // must set system ID to allow relative URLs (e.g. to a DTD) to\n // work\n is.setSystemId(doc.getSourceUrl().toString());\n } else {\n // let the parser decide the encoding\n is = new InputSource(doc.getSourceUrl().toString());\n }\n newxmlParser.parse(is);\n } finally {\n // make sure the open streams are closed\n if(docReader != null) docReader.close();\n }\n\n ((DocumentImpl)doc).setNextAnnotationId(xmlDocHandler\n .getCustomObjectsId());\n } catch(SAXException e) {\n doc.getFeatures().put(\"parsingError\", Boolean.TRUE);\n\n Boolean bThrow =\n (Boolean)doc.getFeatures().get(\n GateConstants.THROWEX_FORMAT_PROPERTY_NAME);\n\n if(bThrow != null && bThrow.booleanValue()) {\n throw new DocumentFormatException(e);\n } else {\n Out.println(\"Warning: Document remains unparsed. \\n\"\n + \"\\n Stack Dump: \");\n e.printStackTrace(Out.getPrintWriter());\n }\n\n } catch(IOException e) {\n throw new DocumentFormatException(\"I/O exception for \"\n + doc.getSourceUrl(), e);\n } finally {\n if(xmlDocHandler != null)\n xmlDocHandler.removeStatusListener(statusListener);\n }\n }", "public java.lang.String getXml();", "public void test1() {\n\t\tString fileToUpload = \"test.xml\";\n\t\tContext context = SessionService.getInstance().getContext();\n\t\tAssetManager assetManager = context.getAssets();\n\t\tInputStream inputStream = null;\n\t\ttry {\n\t\t\tinputStream = assetManager.open(fileToUpload, AssetManager.ACCESS_BUFFER);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// upload xml document for testing, the server adds IDs for every element\n\t\tboolean success;\n\t\tif (inputStream == null) {\n\t\t\tsuccess = false;\n\t\t} else {\n\t\t\tsuccess = collabEditingService.uploadDocument(fileToUpload, inputStream);\n\t\t}\n\t\tif (!success) {\n\t\t\tLog.w(TAG, \"Document already exists on the server or connection failure during upload\");\n\t\t}\n\n\t\t// download the decorated document file again\n\t\tString fileForEditing = \"test.xml\";\n\t\tsuccess = collabEditingService.loadDocumentFromServer(fileForEditing);\n\t\tif (success) collabEditingService.showDocument(); // debug\n\t\t\n\t\t// insert text under parent node 200 and before node 300 \n\t\tLog.i(TAG, System.currentTimeMillis() + \": \" + \"Inserting\");\n\t\tcollabEditingService.insertText(\"200\", \"300\", NodePosition.INSERT_BEFORE, \" Woohoo \", 0);\n\t\t// c1.insertText(\"200\", null, 1, \" Woohoo \", 0); // inserts text right under the parent node\n\t\t\n\t\t// insert a new Element node before Node 500\n\t\tElement newNode = collabEditingService.createElement(\"Foo\");\n\t\tnewNode.setAttribute(\"myAttrib\", \"69\");\n\t\tcollabEditingService.insertNode(\"200\", newNode, \"300\", NodePosition.INSERT_AFTER);\n\t\t\n\t\tLog.i(TAG, collabEditingService.getDocumentString());\n\t\tcollabEditingService.showStateVector();\n\t}", "@Override\n\tpublic void parseXML(Element root) throws Exception {\n\t\t\n\t}", "public ParseXML() throws XmlPullParserException, IOException\n {\n\t input =\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><Balls version=1.0><ball><name>900 Global Hook! Black </name><brand>900 Global</brand><release_date>05/15/2012</release_date><radius_of_gyration>2.551</radius_of_gyration><differential>0.046</differential><mass_biass_diff>n/a</mass_biass_diff><lane_condition>Medium</lane_condition><finish>Polished</finish><coverstock>Reactive Resin</coverstock><coverstock_name>S43 Pearl Reactive</coverstock_name><factory_finish>n/a</factory_finish><core_type>Symmetric</core_type><core_name>n/a</core_name></ball><ball><name>900 Global Hook! Hybrid</name><brand>900 Global</brand><release_date>05/15/2012</release_date><radius_of_gyration>2.551</radius_of_gyration><differential>0.046</differential><mass_biass_diff>n/a</mass_biass_diff><lane_condition>Medium</lane_condition><finish>Polished</finish><coverstock>Hybrid Reactive</coverstock><coverstock_name>S43 Hybrid Reactive</coverstock_name><factory_finish>n/a</factory_finish><core_type>Symmetric</core_type><core_name>Symmetric (10# has a pancake core)</core_name></ball>\"; \n\t parse();\n }", "public String parseImgUrl(String xmlString) {\n\n String imageUrl = \"\";\n\n try {\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder;\n Document doc = null;\n try {\n builder = factory.newDocumentBuilder();\n doc = builder.parse(new InputSource(new StringReader(xmlString)));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n NodeList nList = null;\n if (doc != null) {\n doc.getDocumentElement().normalize();\n nList = doc.getElementsByTagName(\"image\");\n }\n\n\n\n System.out.println(\"----------------------------\");\n\n if (nList != null) {\n for (int temp = 0; temp < nList.getLength(); temp++) {\n\n Node nNode = nList.item(temp);\n\n if (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\n Element eElement = (Element) nNode;\n\n imageUrl = eElement.getElementsByTagName(\"url\").item(0).getTextContent();\n System.out.println(\"Image URL: \" + imageUrl);\n\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return imageUrl;\n }", "public void parse()\n throws ClassNotFoundException, IllegalAccessException,\n\t InstantiationException, IOException, SAXException,\n\t ParserConfigurationException\n {\n\tSAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();\n\txmlReader = saxParser.getXMLReader();\n\txmlReader.setContentHandler(this);\n\txmlReader.setEntityResolver(this);\n\txmlReader.setErrorHandler(this);\n\txmlReader.setDTDHandler(this);\n\txmlReader.parse(xmlSource);\n\t}", "org.apache.xmlbeans.XmlString xgetContent();", "public void parse(InputStream inputStream) {\n try {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n Document doc = db.parse(inputStream);\n System.out.println(doc.getElementsByTagName(\"label\").item(0).getTextContent());\n System.out.println(doc.getElementsByTagName(\"username\").item(0).getTextContent());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Test\n\tpublic void testLocalLinkHTMLAsXML(){\n \tFile xml = new File(testData,\"html/htmlsidekick.html\");\n \t\n \tBuffer b = TestUtils.openFile(xml.getPath());\n\t\t\n \t// wait for end of parsing\n \tdoInBetween(new Runnable(){\n \t\t\tpublic void run(){\n \t\t\t\taction(\"sidekick.parser.xml-switch\",1);\n \t\t}}, \n \t\tmessageOfClassCondition(sidekick.SideKickUpdate.class),\n \t\t10000);\n\t\t\n \taction(\"sidekick-tree\");\n \tPause.pause(2000);\n\n \tHyperlinkSource src = new HTMLHyperlinkSource();\n\t\tfinal Hyperlink h = src.getHyperlink(TestUtils.view().getBuffer(), 893);\n\t\tassertNotNull(h);\n\t\tassertTrue(h instanceof jEditOpenFileAndGotoHyperlink);\n\t\tassertEquals(29, h.getStartLine());\n\t\tassertEquals(29, h.getEndLine());\n\t\tGuiActionRunner.execute(new GuiTask() {\n\t\t\t\n\t\t\t@Override\n\t\t\tprotected void executeInEDT() throws Throwable {\n\t\t\t\th.click(TestUtils.view());\n\t\t\t}\n\t\t});\n\t\t\n\t\t// moved same file, but below\n\t\tassertEquals(b.getPath(),TestUtils.view().getBuffer().getPath());\n\t\tassertEquals(114, TestUtils.view().getTextArea().getCaretLine());\n\t\t\n\t\tTestUtils.close(TestUtils.view(), b);\n\t}", "public String transform(String input) throws Exception {\n StringWriter outWriter = new StringWriter();\n StringReader reader = new StringReader(input);\n Result result = new StreamResult(outWriter);\n myTransformer.transform(\n new javax.xml.transform.stream.StreamSource(reader), result);\n return outWriter.toString();\n }", "static String prettyXml(File in) {\n\t\tString xml = \"\";\n\t\ttry {\n\t\t\txml = Files.readFile(in).toString();\n\t\t\treturn prettyXml(xml);\n\t\t} catch (Exception e) {\n\t\t\tprtln(\"prettyXml error: \" + e.getMessage());\n\t\t\treturn xml;\n\t\t}\n\t}", "public String convertHtmlToTmx(String p_url) throws Exception\n {\n final String baseName = getBaseName(p_url);\n final String extension = getExtension(p_url);\n\n info(\"Converting HTML file to TMX: `\" + p_url + \"'\");\n\n createHeader();\n startOutputFile(baseName);\n\n parseFile(p_url);\n\n closeOutputFile();\n\n info(\"Processed \" + m_entryCount + \" TUs into file `\" + m_filename\n + \"', \" + m_errorCount + \" errors, \" + m_ignoreCount\n + \" ignored TUs.\");\n\n return m_filename;\n }", "@Override\n protected Boolean doInBackground(String... strings) {\n try {\n if (strings.length < 2) return false;\n home_url = strings[0];\n data_path = strings[1];\n if (!DownloadFile(home_url, \"/home_file.htm\")) return false;\n //apro il file della home e cerco il link che contiene \"circolari\" nel proprio title\n XmlPullParser parser = Xml.newPullParser();\n parser.setInput(new FileInputStream(new File(data_path + \"/home_file.htm\")), null);\n parser.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, false);\n parser.defineEntityReplacementText(\"ntilde\", \"\\u00F1\");\n parser.defineEntityReplacementText(\"nbsp\", \" \");\n parser.defineEntityReplacementText(\"raquo\", \" \");\n parser.nextTag();\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String title = parser.getAttributeValue(ns, \"title\");\n if (name.equals(\"a\") && title != null && title.toLowerCase().contains(\"circolari\")) {\n circ_url = parser.getAttributeValue(ns, \"href\");\n break;\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n\n }\n }\n }\n //ricerca pagina con orari\n parser.setInput(new FileInputStream(new File(data_path + \"/home_file.htm\")), null);\n parser.nextTag();\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String href = parser.getAttributeValue(ns, \"href\");\n String text;\n if (name.equals(\"a\")) {\n while (parser.getEventType() != XmlPullParser.END_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n if (parser.getEventType() == XmlPullParser.TEXT) {\n text = parser.getText();\n if (text.toLowerCase().contains(\"orario scolastico\")) orari_url = href;\n }\n }\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n if (!DownloadFile(orari_url, \"/orari_file.htm\")) return null;\n //ricerca link degli orari\n parser.setInput(new FileInputStream(new File(data_path + \"/orari_file.htm\")), null);\n parser.nextTag();\n int i = 0;\n while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n continue;\n }\n String name = parser.getName();\n String href = parser.getAttributeValue(ns, \"href\");\n String text;\n if (name.equals(\"a\")) {\n while (parser.getEventType() != XmlPullParser.END_TAG) {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n if (parser.getEventType() == XmlPullParser.TEXT) {\n text = parser.getText();\n if (text.toLowerCase().contains(\"per classi (\")) orari_classi = href;\n else if (text.toLowerCase().contains(\"per docenti (\"))\n orari_docenti = href;\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n } else {\n try {\n parser.next();\n } catch (XmlPullParserException e) {\n }\n }\n }\n } catch (FileNotFoundException e) {\n return false;\n } catch (XmlPullParserException e) {\n return false;\n } catch (IOException e) {\n return false;\n }\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"pref_url_circolari\", circ_url);\n editor.putString(\"pref_url_orario_classi\", orari_classi);\n editor.putString(\"pref_url_orario_docenti\", orari_docenti);\n editor.apply();\n //risultati salvati nelle shared Preferences\n return true;\n }", "@POST\r\n\t@Path(\"/publishxml\")\r\n\t@Consumes(MediaType.APPLICATION_XML)\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic Response consumeXML( Employee employee ) {\r\n\r\n\t\temployeeValidation(employee);\r\n\t\treturn Response.status(200).entity(employee).build();\r\n\t}", "public XmlPullParser getLocalXML(String filename) throws IOException {\r\n\t\ttry {\r\n\t\t\tin = mContext.getAssets().open(filename);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tXmlPullParser parser = Xml.newPullParser();\r\n\t\t\tparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);\r\n\t\t\tparser.setInput(in, null);\r\n\t\t\tparser.nextTag();\r\n\t\t\treturn parser;\r\n\t\t} catch (XmlPullParserException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "private static String getTextFromHtml(File f) throws Exception {\n\t\tInputStream is = null;\n\t\ttry {\n\t\t\tis = new FileInputStream(f);\n\t\t\tContentHandler contenthandler = new BodyContentHandler();\n\t\t\tMetadata metadata = new Metadata();\n\t\t\tParser parser = new AutoDetectParser();\n\t\t\tparser.parse(is, contenthandler, metadata, new ParseContext());\n\t\t\treturn contenthandler.toString();\n\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tif (is != null)\n\t\t\t\tis.close();\n\t\t}\n\t}", "public String getXml( HttpServletRequest request )\n {\n StringBuffer strXml = new StringBuffer( );\n\n XmlUtil.beginElement( strXml, TAG_JASPER_PORTLET );\n XmlUtil.addElementHtml( strXml, TAG_JASPER_PORTLET_CONTENT, _strJasperFeedId );\n XmlUtil.endElement( strXml, TAG_JASPER_PORTLET );\n\n return addPortletTags( strXml );\n }", "public void ProcessXMLResult(String XML)\n\t\t{\n\t \tUnlinkAsync();\n\t \tif(SignonProgress!=null)\n \t\t{\n \t\t\tSignonProgress.dismiss();\n \t\t\tSignonProgress=null; // So we dont try to dismiss twice if we sign on, sign off then change orientation during next signon ?\n \t\t}\n\t \t\n\t \tSAXParserFactory spf = SAXParserFactory.newInstance();\n\t \ttry\n\t \t{\n\t \t\tSAXParser sp = spf.newSAXParser();\n\n\t \t\t/* Get the XMLReader of the SAXParser we created. */\n\t \t\tXMLReader xr = sp.getXMLReader();\n\t \t\t/* Create a new ContentHandler and apply it to the XML-Reader*/\n\t \t\tFreewayCoffeeXMLHandler myExampleHandler = new FreewayCoffeeXMLHandler(appState);\n\t \t\txr.setContentHandler(myExampleHandler);\n\n\t \t\t/* Parse the xml-data from our URL. */\n\t \t\t//String test = \"<register_response result=\\\"signupOK\\\"></register_response>\";\n\t \t\tInputSource is = new InputSource(new StringReader(XML));\n\t\t\t\t//is.setEncoding(\"UTF-8\");\n\t\t\t\t\n\t \t\txr.parse(is);\n\t \t\t/* Parsing has finished. */\n\t \t\t\n\t \t\t\n\t \t\tif(myExampleHandler.NetworkError==true)\n\t \t\t{\n\t \t\t\t\n\t \t\t\tDisplayNetworkError();\n\t\t \t\treturn;\n\t \t\t}\n\t \t\t\n\t \t\tif(myExampleHandler.IsSchemaError())\n\t \t\t{\n\t \t\t\tDisplaySchemaError(myExampleHandler.CompatReleaseRequired);\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tif(myExampleHandler.signonResponse.equals(\"signon_ok\"))\n\t \t {\t\n\t \t\t\t/*\n\t \t\t\tToast Err = Toast.makeText(appState.getApplicationContext(),\n\t \t\t\t\t\tgetString(R.string.fc_logged_in_ok),\n\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t \t\t\tErr.show();\n\t \t\t\t*/\n\t \t\t\t// Save the users login state to the database (in case they switched user)\n\t \t\t\t// Since we were having some issues here, only save them if they have some data ... sadly cannot do for auto login\n\t \t\t\tif(EmailAddress.length()>0)\n\t \t\t\t{\n\t \t\t\t\tappState.SetLoginEmail(EmailAddress);\n\t \t\t\t}\n\t \t\t\tif(Password.length()>0)\n\t \t\t\t{\n\t \t\t\t\tappState.SetPassword(Password);\n\t \t\t\t}\n\t \t\t\t// Cant fix this one (Login Automatically)\n\t \t\t\tappState.SetLoginAutomatically(LoginAutomatically);\n\t \t\t\tappState.ClearAllDownloadedData(); // This is our chance to make sure a complete refresh is done\n\t \t\t\tappState.ClearCurrentDrinksOrder(); // Also done in ClearAllDownloadedData\n\t \t\t\t// Start the ItemsList activity\n\t \t\t\tIntent intent = new Intent();\n\t \t\t\tintent.setClassName(this, FreewayCoffeeItemListView.class.getName());\n\t \t\t\tstartActivity(intent);\n\t \t }\n\t \t\telse\n\t \t\t{\n\t \t\t\tshowDialog(LOGIN_FAIL_DIALOG);\n\t \t\t\t/*\n\t \t\t\tToast Err = Toast.makeText(appState.getApplicationContext(),\n\t \t\t\t\t\t\t\t\t\t\tgetString(R.string.fc_login_not_successful),\t \t\t\t\t\t\t\t\n\t \t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t \t\t\tErr.show();\n\t \t\t\t*/\n\t \t\t\t\n\t \t\t}\n\t \t}\n\t \tcatch(SAXException e)\n\t \t{\n\n\t \t\tDisplayNetworkError();\n\t \t\treturn;\n\t \t}\n\t \tcatch (ParserConfigurationException pe)\n\t \t{\n\t \t\tDisplayNetworkError();\n\t \t\treturn;\n\t \t}\n\t \tcatch (IOException io)\n\t \t{\n\t \t\tDisplayNetworkError();\n\t \t\treturn;\n\t \t}\n\t\t}", "DocumentFragment getXML(String path)\n throws ProcessingException ;", "public interface XMLParser {\n\n String parse();\n}", "private String postMT(String xml) throws PrepException{\n\n StringBuilder responseXml = new StringBuilder();\n try{\n URL mtUrl = new URL(this.url);\n HttpURLConnection httpconn = (HttpURLConnection)mtUrl.openConnection();\n httpconn.setDoInput(true);\n httpconn.setDoOutput(true);\n\n OutputStreamWriter out = new OutputStreamWriter(httpconn.getOutputStream());\n out.write(xml);\n out.close();\n\n int responseCode = httpconn.getResponseCode();\n if(responseCode != 200){\n throw new PrepException(\"Error with HTTP connection in MTPrep.postMT(); HTTP response code: \"+responseCode);\n }\n //out.close();\n\n BufferedReader in = new BufferedReader( new InputStreamReader(httpconn.getInputStream()));\n\n String line;\n while (( line = in.readLine()) != null){\n responseXml.append(line);\n }\n in.close();\n\n }\n catch(MalformedURLException malex ){\n throw new PrepException(\"URL Error in MTPrep.postMT(): \"+malex.getMessage());\n }\n catch(IOException ioe){\n throw new PrepException(\"IO Error in MTPrep.postMT(): \"+ioe.getMessage());\n }\n return responseXml.toString();\n }", "@VisibleForTesting\n\tDocument parseLocalFile(String url) throws IOException {\n\t\treturn Jsoup.parse(new File(url), \"UTF-8\", \"\");\n\t}", "public void parse(XmlDocument document, InputStream in) throws Exception {\n\t\tURL url = document.getURL();\n\t\tparse(document, url, null, null, in, null);\n\t}", "public String formatXml(String str) throws UnsupportedEncodingException, IOException, DocumentException {\n\t\tSAXReader reader = new SAXReader();\r\n\t\t// System.out.println(reader);\r\n\t\t// 注释:创建一个串的字符输入流\r\n\t\tStringReader in = new StringReader(str);\r\n\t\tDocument doc = reader.read(in);\r\n\t\t// System.out.println(doc.getRootElement());\r\n\t\t// 注释:创建输出格式\r\n\t\tOutputFormat formater = OutputFormat.createPrettyPrint();\r\n\t\t// 注释:设置xml的输出编码\r\n\t\tformater.setEncoding(\"utf-8\");\r\n\t\t// 注释:创建输出(目标)\r\n\t\tStringWriter out = new StringWriter();\r\n\t\t// 注释:创建输出流\r\n\t\tXMLWriter writer = new XMLWriter(out, formater);\r\n\t\t// 注释:输出格式化的串到目标中,执行后。格式化后的串保存在out中。\r\n\t\twriter.write(doc);\r\n\r\n\t\tString destXML = out.toString();\r\n\t\twriter.close();\r\n\t\tout.close();\r\n\t\tin.close();\r\n\t\t// 注释:返回我们格式化后的结果\r\n\t\treturn destXML;\r\n\t}", "private void refreshXML() {\n\t\t// Build a new thread to handle the request, since fetching files from\n\t\t// a remove server shouldn't block screen drawing.\n\t\tToast.makeText(\n\t\t\t\tthis,\n\t\t\t\tgetString(R.string.xml_requested_from) + \": \"\n\t\t\t\t\t\t+ PreferencesManager.getXmlUri(this), Toast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t// We use a separate runnable class instead of an anonymous inner class\n\t\t// so that when the async request is completed, it can signal the viewer\n\t\t// to toast.\n\t\tFetchThread ft = new FetchThread(this);\n\t\tft.start();\n\t}", "private void getHtmlCode() {\n\t try {\n\t Document doc = Jsoup.connect(\"http://www.example.com/\").get();\n\t Element content = doc.select(\"a\").first();\n//\t return content.text();\n\t textView.setText(content.text());\n\t } catch (IOException e) {\n\t // Never e.printStackTrace(), it cuts off after some lines and you'll\n\t // lose information that's very useful for debugging. Always use proper\n\t // logging, like Android's Log class, check out\n\t // http://developer.android.com/tools/debugging/debugging-log.html\n\t Log.e(TAG, \"Failed to load HTML code\", e);\n\t // Also tell the user that something went wrong (keep it simple,\n\t // no stacktraces):\n\t Toast.makeText(this, \"Failed to load HTML code\",\n\t Toast.LENGTH_SHORT).show();\n\t }\n\t }", "private String getText(URL url){\n\tString parsedHtml=null;\n\ttry{\n\t\tHttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n\t\tString line = null;\n\t\tStringBuilder tmp = new StringBuilder();\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));\n\t\twhile ((line = in.readLine()) != null) {\n\t\t tmp.append(line);\n\t\t}\n\t\t \n\t\tDocument doc = Jsoup.parse(tmp.toString());\n\t\tparsedHtml = doc.title() + doc.body().text();\n\t\t\n\t}\n\tcatch(IOException e){\n\t\tSystem.out.println(\"Page not reached for: \"+url );\n\t}\n\tfinally{\n\t\treturn parsedHtml;\n\t}\n\t\n}", "public static String ParseText(String xml)\n {\n \ttry {\n \t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n \t\tDocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n \t\tDocument doc = dBuilder.parse(\n \t\t\t\tnew InputSource(new ByteArrayInputStream(xml.getBytes(\"utf-8\"))));\n \t\t\t\t\n \t\tdoc.getDocumentElement().normalize();\n\n// \t\tSystem.out.println(\"Root element :\" + doc.getDocumentElement().getNodeName());\n \t\t\t\t\n \t\tNodeList nList = doc.getElementsByTagName(\"page\");\n \t\t\t\t\n \t\tfor (int temp = 0; temp < nList.getLength(); temp++) {\n \t\t\tNode nNode = nList.item(temp);\n \t\t\t\t\t\n// \t\t\tSystem.out.println(\"\\nCurrent Element :\" + nNode.getNodeName());\n \t\t\t\t\t\n \t\t\tif (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\n \t\t\t\tElement eElement = (Element) nNode;\n \t\t\t\t\n \t\t\tString idx = eElement.getAttribute(\"_idx\");\n \t\t\tif (Integer.parseInt(idx) == -1)\n \t\t\t\tcontinue;\n \t\t\t\n \t\t\treturn eElement.getTextContent();\n \t\t\t}\n \t\t}\n\t } catch (Exception e) {\n\t \te.printStackTrace();\n\t }\n \treturn \"[@31]No article found!\";\n }", "@Test\n public void parserHtml() throws JSONException, IOException {\n }", "@SuppressWarnings(\"deprecation\")\n private String uploadFile() {\n //Most of the same stuff in the other AsyncTask except we are sending a file\n String responseString = null;\n\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(Config.FILE_UPLOAD_URL);\n\n try {\n AndroidMultipartEntity entity = new AndroidMultipartEntity(\n new AndroidMultipartEntity.ProgressListener() {\n\n @Override\n public void transferred(long num) {\n publishProgress((int) ((num / (float) totalSize) * 100));\n }\n });\n\n //Recreates the source file to be sent\n File sourceFile = new File(fileUri.getPath());\n\n // Adding file data to http body\n entity.addPart(\"image\", new FileBody(sourceFile));\n entity.addPart(\"email\", new StringBody(email));\n\n totalSize = entity.getContentLength();\n httppost.setEntity(entity);\n\n // Making server call\n HttpResponse response = httpclient.execute(httppost);\n HttpEntity r_entity = response.getEntity();\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == 200) {\n // Server response\n responseString = EntityUtils.toString(r_entity);\n } else {\n responseString = \"Error occurred! Http Status Code: \"\n + statusCode;\n }\n\n } catch (ClientProtocolException e) {\n responseString = e.toString();\n } catch (IOException e) {\n responseString = e.toString();\n }\n\n return responseString;\n\n }", "@POST\r\n\t@Path(\"/publishmultixml\")\r\n\t@Consumes(MediaType.APPLICATION_XML)\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic Response consumeXML( Employees employees ) {\r\n\t\tWriteSpreadsheet writeSpreadsheet = new WriteSpreadsheet();\r\n\t\twriteSpreadsheet.writeSpreadsheetInitialize();\r\n\t\tWriteText writeText = new WriteText();\r\n\t\twriteText.writeTextInitialize();\r\n\t\tscrubPayloadAndThenWriteToCSVTXT(employees,writeSpreadsheet,writeText);\r\n\r\n\treturn Response.status(200).entity(employees).build();\r\n\t}", "private static Document parseXmlFile(String in) {\n try {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n InputSource is = new InputSource(new StringReader(in));\n return db.parse(is);\n } catch (ParserConfigurationException e) {\n throw new RuntimeException(e);\n } catch (SAXException e) {\n throw new RuntimeException(e);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public static void parseXML(String filename) {\n SAXBuilder builder = new SAXBuilder();\n \n //reading XML document\n Document xml = null;\n try {\n xml = builder.build(new File(filename));\n } catch (JDOMException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n //getting root element from XML document\n Element root = xml.getRootElement();\n if (root != null)\n {\n\t Element queryNode = root.getChild(\"query\");\n\t if (queryNode != null)\n\t {\n\t\t Element rcNode = queryNode.getChild(\"recentchanges\");\n\t\t \n\t\t List<Element> rcList = rcNode.getChildren();\n\t\t \n\t\t \n\t\t \n\t\t //Iterating over all childs in XML\n\t\t Iterator<Element> itr = rcList.iterator();\n\t\t while(itr.hasNext()){\n\t\t \tElement rc = itr.next();\n\t\t \tString user = rc.getAttributeValue(\"user\");\n\t\t \tString userId = rc.getAttributeValue(\"userid\");\n\t\t \tString pageId = rc.getAttributeValue(\"pageid\");\n\t\t \tString title = rc.getAttributeValue(\"title\");\n\t\t \tString timestamp = rc.getAttributeValue(\"timestamp\");\n\t\t \tString comments = rc.getAttributeValue(\"comment\");\n\t\t \tString type = rc.getAttributeValue(\"type\");\n\t\t \tString oldRevId = rc.getAttributeValue(\"old_revid\");\n\t\t \tString newRevId = rc.getAttributeValue(\"revid\");\n\t\t \tString recentChangeId = rc.getAttributeValue(\"rcid\");\n\t\t \t\n\t\t// \t //reading attribute from Element using JDOM\n\t\t// System.out.println(\"User: \" + user + \" | User_ID: \" + userId + \" | Page_ID: \" + pageId + \n\t\t// \t\t\" | Title: \" + title + \" | Timestamp: \" + timestamp + \" | Recent_Change_ID: \" + recentChangeId + \" | Old_Rev_ID: \" + oldRevId + \n\t\t// \t\t\" | New_Rev_ID: \" + newRevId + \" | Type: \" + type); \n\t\t \t\n\t\t \ttry {\n\t\t\t\t\t\tcluster.writeWikiResults(user, userId, timestamp, pageId, title, recentChangeId, oldRevId, newRevId, type);\n\t\t\t\t\t\t System.out.println(count++);\n\t\t\t\t\t} catch (ParseException 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} 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 }\n\t }\n } \n }", "@GET\n @Produces(MediaType.TEXT_XML)\n public String sayXMLHello() {\n return \"<?xml version=\\\"1.0\\\"?>\" + \"<hello> Hello Jersey\" + \"</hello>\";\n }", "public FeedManager loadFeed() throws IOException, XmlPullParserException {\n\t\tInputStream stream = null;\n\t\tSolsticeXmlParser solsticeXmlParser = new SolsticeXmlParser();\n\n\t\ttry {\n\t\t\tstream = downloadUrl(URL);\n\t\t\treturn solsticeXmlParser.parse(stream);\n\t\t} finally {\n\t\t\tif (stream != null) {\n\t\t\t\tstream.close();\n\t\t\t}\n\t\t}\n\t}", "public AtomFeed(String feedURL) throws ParserConfigurationException, IOException\r\n\t{\r\n\t\tthis.feedURL = feedURL;\r\n\t\txml = null;\r\n\t\tdocumentbuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n\t\tif (!refresh()) throw new IOException();\r\n\t}", "public void handle(Element xmlRequest, HttpServletRequest req, HttpServletResponse res) throws IOException;", "private URL getFeedUrl() throws MalformedURLException{\n String feedUrl = \"http://\" + host + \":\" + port + \"/xmlfeed\";\n URL url = new URL(feedUrl);\n return url;\n }", "public abstract String toXML();", "public abstract String toXML();", "public abstract String toXML();", "public URL ParseRSSFromFeed() throws java.net.MalformedURLException\n {\n URL feedUrl = new URL(Src_URL);\n return feedUrl;\n }", "@Override\n public void visit(Page page) {\n String url = page.getWebURL().getURL();\n System.out.println(\"URL: \" + url);\n\n try {\n if (page.getParseData() instanceof HtmlParseData) {\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\n final Document document = Jsoup.parse(htmlParseData.getHtml());\n\n Transformer transformer = TransformerFactory.newInstance()\n .newTransformer(new StreamSource(getClass().getResourceAsStream(xslPath)));\n\n Writer write = new StringWriter();\n transformer.transform(new DOMSource(new W3CDom().fromJsoup(document)), new StreamResult(write));\n\n String xml = write.toString();\n\n // XML 1.1\n // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]\n String xml11pattern = \"[^\"\n + \"\\u0001-\\uD7FF\"\n + \"\\uE000-\\uFFFD\"\n + \"\\ud800\\udc00-\\udbff\\udfff\"\n + \"]+\";\n\n // remove invalid character in xml\n xml = xml.replaceAll(xml11pattern, \"\");\n\n JAXBContext jc = JAXBContext.newInstance(ProxyListDTO.class);\n\n Unmarshaller unmarshaller = jc.createUnmarshaller();\n ProxyListDTO data = (ProxyListDTO) unmarshaller.unmarshal(new StringReader(xml));\n data.getProxies().forEach(p -> p.setSource(source));\n\n\n result.addAll(data.getProxies());\n }\n } catch (Exception e) {\n logger.error(\"fail to visit \" + url, e);\n }\n }", "private void uploadTrickHtml(String htmlName, String htmlContent) throws IOException {\n Path webWolfFilePath = Paths.get(webwolfFileDir);\n if (webWolfFilePath.resolve(Paths.get(this.getUser(), htmlName)).toFile().exists()) {\n Files.delete(webWolfFilePath.resolve(Paths.get(this.getUser(), htmlName)));\n }\n\n //upload trick html\n RestAssured.given()\n .when()\n .relaxedHTTPSValidation()\n .cookie(\"WEBWOLFSESSION\", getWebWolfCookie())\n .multiPart(\"file\", htmlName, htmlContent.getBytes())\n .post(webWolfUrl(\"/WebWolf/fileupload\"))\n .then()\n .extract().response().getBody().asString();\n }", "public void loadXML(){\n new DownloadXmlTask().execute(URL);\n }", "public static void main(String[] args) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n\t\tFileReader fin = null;\n\t\tFileWriter fout = null;\n\t\tXMLString x;\n\t\tScanner f;\n\t\tString fname, fpath, tpath, wd = \"\", tag, content;\n\t\tint ch, k = 0, n = 0 ;\n\t\tchar c;\n\t\tSystem.out.println(\"Enter the File Name (without .xml)\");\n\t\tfname = sc.next();\n\t\tfpath = \"C:\\\\Users\\\\HP\\\\Desktop\\\\adobe interview projects\\\\XML JSON Parser (1)\\\\src\\\\miniProject\\\\\" + fname + \".xml\";\n\t\tSystem.out.println(fpath);\n\t\ttpath = \"C:\\\\Users\\\\HP\\\\Desktop\\\\adobe interview projects\\\\XML JSON Parser (1)\\\\src\\\\miniProject\\\\\" + fname + \".txt\";\n\t\tSystem.out.println(tpath);\n\t\tSystem.out.print(\"Parsing \" + fname + \".xml\");\n\t\twhile(n!=5) {\n\t\t\tSystem.out.print(\" .\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tn++;\n\t\t}\n\t\tSystem.out.println();\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(fname +\".xml PARSED SUCCESSFULLY !\");\n\t\ttry {\n\t\t\tThread.sleep(500);\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(fname + \".txt FILE CREATED SUCCESSFULLY\");\n\t\tSystem.out.println();\n\t\ttry {\n\t\t\tfin = new FileReader(fpath);\n\t\t\tfout = new FileWriter(tpath);\n\t\t\tf = new Scanner(fin);\n\t\t\tf.useDelimiter(\"\\n\");\n\t\t\twhile(f.hasNext()) {\n\t\t\t\twd = f.next();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tx = new XMLString();\n\t\t\t\ttag = x.XMLtoTag(wd);\n\t\t\t\t\n\t\t\t\tfor(int i=0; i<wd.length()-1; i++) {\n\t\t\t\t\tc = wd.charAt(i+1);\n\t\t\t\t\tif(wd.charAt(i) == '>') {\n\t\t\t\t\t\tif( !(Character.isLetter(c)) && !(Character.isDigit(c)) && !(x.isSpecialCharacter(c)) ) {\n\t\t\t\t\t\t\tk = 0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tk = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tag != \"\") {\n\t\t\t\t\tif(k == 1) {\n\t\t\t\t\t\tSystem.out.print(tag + \" : \");\n\t\t\t\t\t\tfout.write(tag + \" : \");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.print(tag);\n\t\t\t\t\t\tfout.write(tag);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontent = x.XMLtoString(wd);\n\t\t\t\tSystem.out.println(content);\n\t\t\t\t\n\t\t\t\tfout.write(content);\n\t\t\t\t//Can use either for getting a newline\n\t\t\t\t//fout.write(\"\\r\\n\");\n\t\t\t\tfout.write(System.lineSeparator());\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(fname + \".xml File Not Found\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif(fin != null) {\n\t\t\t\t\tfin.close();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif(fout !=null) {\n\t\t\t\t\tfout.close();\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to Close File\" + e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public static void parseXML(String strXmlContent) {\n\t\tSAXParserFactory spf = SAXParserFactory.newInstance();\r\n\t\ttry {\r\n\t\t\tSAXParser saxParser = spf.newSAXParser();\r\n\t\t\tsaxParser.parse(new ByteArrayInputStream(strXmlContent.getBytes()),\r\n\t\t\t\t\tnew SAXXMLReader());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public static Element openXML(javax.servlet.ServletInputStream in) {\r\n Document doc = null;\r\n try {\r\n SAXBuilder builder = new SAXBuilder();\r\n doc = builder.build(in);\r\n }\r\n catch (Exception e) {\r\n System.out.println(\"XMLFile Open Failure->\" + e.getMessage());\r\n }\r\n if (doc == null) {\r\n return null;\r\n }\r\n return doc.getRootElement();\r\n }", "@Override\n\tpublic String generateHtmlFromXsl(Document doc, File fileForXsl) throws ParserConfigurationException, SAXException,\n\t\t\tIOException, TransformerFactoryConfigurationError, TransformerException {\n\t\tStreamSource streamSource = new StreamSource(fileForXsl);\n\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer(streamSource);\n\t\tStringWriter writer = new StringWriter();\n\t\ttransformer.transform(new DOMSource(doc), new StreamResult(writer));\n\n\t\treturn writer.getBuffer().toString();\n\t}", "public static void main(String[] args) {\n try {\n String url = \"file:///C:/enwiktionary-latest-pages-articles.xml.bz2.xml.bz2.xml\";\n// String url = \"file:///D:/enWikt_Samp.xml\n File file = new File(new URI(url));\n System.out.println(file.toURI());\n\n\n// fileLoader(file);\n staxReader(file);\n// vtdReader(file); vtd is where kittens go to die.\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void importElement(XmlPullParser xpp, Epml epml) {\n\t\tlineNumber = xpp.getLineNumber();\n\t\t/*\n\t\t * Import all attributes of this element.\n\t\t */\n\t\timportAttributes(xpp, epml);\n\t\t/*\n\t\t * Create afresh stack to keep track of start tags to match.\n\t\t */\n\t\tArrayList<String> stack = new ArrayList<String>();\n\t\t/*\n\t\t * Add the current tag to this stack, as we still have to find the\n\t\t * matching end tag.\n\t\t */\n\t\tstack.add(tag);\n\t\t/*\n\t\t * As long as the stack is not empty, we're still working on this\n\t\t * object.\n\t\t */\n\t\twhile (!stack.isEmpty()) {\n\t\t\ttry {\n\t\t\t\t/*\n\t\t\t\t * Get next event.\n\t\t\t\t */\n\t\t\t\tint eventType = xpp.next();\n\t\t\t\tif (eventType == XmlPullParser.END_DOCUMENT) {\n\t\t\t\t\t/*\n\t\t\t\t\t * End of document. Should not happen.\n\t\t\t\t\t */\n\t\t\t\t\tepml.log(tag, xpp.getLineNumber(), \"Found end of document\");\n\t\t\t\t\treturn;\n\t\t\t\t} else if (eventType == XmlPullParser.START_TAG) {\n\t\t\t\t\t//System.out.println(xpp.getLineNumber() + \" <\" + xpp.getName() + \">\");\n\t\t\t\t\t/*\n\t\t\t\t\t * Start tag. Push it on the stack.\n\t\t\t\t\t */\n\t\t\t\t\tstack.add(xpp.getName());\n\t\t\t\t\t/*\n\t\t\t\t\t * If this tag is the second on the stack, then it is a\n\t\t\t\t\t * direct child.\n\t\t\t\t\t */\n\t\t\t\t\tif (stack.size() == 2) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * For a direct child, check whether the tag is known.\n\t\t\t\t\t\t * If so, take proper action. Note that this needs not\n\t\t\t\t\t\t * to be done for other offspring.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (importElements(xpp, epml)) {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Known start tag. The end tag has been matched and\n\t\t\t\t\t\t\t * can be popped from the stack.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ((eventType == XmlPullParser.END_TAG)) {\n\t\t\t\t\t//System.out.println(xpp.getLineNumber() + \" </\" + xpp.getName() + \">\");\n\t\t\t\t\t/*\n\t\t\t\t\t * End tag. Should be identical to top of the stack.\n\t\t\t\t\t */\n\t\t\t\t\tif (xpp.getName().equals(stack.get(stack.size() - 1))) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Yes it is. Pop the stack.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * No it is not. XML violation.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tepml.log(tag, xpp.getLineNumber(), \"Found \" + xpp.getName() + \", expected \"\n\t\t\t\t\t\t\t\t+ stack.get(stack.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t} else if (eventType == XmlPullParser.TEXT) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Plain text. Import it.\n\t\t\t\t\t */\n\t\t\t\t\timportText(xpp.getText(), epml);\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tepml.log(tag, xpp.getLineNumber(), ex.getMessage());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * The element has been imported. Now is a good time to check its\n\t\t * validity.\n\t\t */\n\t\tcheckValidity(epml);\n\t}", "@Test\n\t@Override\n\tpublic void testSaveURLXml() throws Exception {\n\t}", "public static void main(String[] args) throws MalformedURLException, IOException{\n TagStripper ts = new TagStripper();\n\n // open an url connection to the specified adress\n URL url = new URL(\"http://sv.wikipedia.org/wiki/Henrik_VIII_av_England\");\n InputStreamReader input = new InputStreamReader(url.openConnection().getInputStream());\n\n // use the tag stripper to strip most of the tags\n String result = ts.stripHTML(input);\n\n //print the result\n System.out.println(result);\n }", "@Override\r\n\t\tprotected String doInBackground(String... arg0) {\n\t\t\t xmlInput = (EditText) findViewById(R.id.xmlInput);\r\n\t\t response = new xmlRequest().XMLUrlHttpRequest(xmlInput.getText().toString());\r\n\r\n\t\t\tString parsedData = \"\";\r\n\t \r\n\t try {\r\n\t \r\n\t Log.w(\"AndroidParseXMLActivity\", \"Start\");\r\n\t SAXParserFactory spf = SAXParserFactory.newInstance();\r\n\t SAXParser sp = spf.newSAXParser();\r\n\t XMLReader xr = sp.getXMLReader();\r\n\t \r\n\t Bookhandler XMLHandler = new Bookhandler();\r\n\t xr.setContentHandler(XMLHandler);\r\n\t InputSource inStream = new InputSource();\r\n\t \r\n\t inStream.setCharacterStream(new StringReader(response));\r\n\t \r\n\t xr.parse(inStream);\r\n\t Log.w(\"response\",response);\r\n\t int i=0;\r\n\t ArrayList<BookData> BooksList = XMLHandler.getBooksList();\r\n\t for(;i<BooksList.size();i++){\r\n\t BookData book = BooksList.get(i);\r\n\t parsedData = parsedData + \"Book \"+(i+1) +\"Detail----->\\n\";\r\n\t parsedData = parsedData + \"Book Number: \" + book.getBookNumber() + \"\\n\";\r\n\t parsedData = parsedData + \"Description: \" + book.getDescription() + \"\\n\";\r\n\t parsedData = parsedData + \"Price: \" + book.getPrice() + \"\\n\";\r\n\t parsedData = parsedData + \"Rating: \"+ book.getRating() + \"\\n\";\r\n\t \r\n\t }\r\n\t Log.w(\"i==\",String.valueOf(i));\r\n\t Log.w(\"Data\",parsedData);\r\n\r\n\t Log.w(\"ParsingXml and populating\", \"Done\");\r\n\t }\r\n\t catch (Exception e) {\r\n\t Log.w(\"AndroidParseXMLActivity\",e );\r\n\t }\r\n\t \r\n\t return parsedData;\r\n\t\t\r\n\t\t}", "@org.junit.Test\n public static final void testSgmlShortTags() {\n junit.framework.TestCase.assertEquals(\"<p></p>\", eu.stamp_project.reneri.instrumentation.StateObserver.observe(\"org.owasp.html.HtmlSanitizerTest|testSgmlShortTags()|0\", org.owasp.html.HtmlSanitizerTest.sanitize(\"<p/b/\")));// Short-tag discarded.\n\n junit.framework.TestCase.assertEquals(\"<p></p>\", eu.stamp_project.reneri.instrumentation.StateObserver.observe(\"org.owasp.html.HtmlSanitizerTest|testSgmlShortTags()|1\", org.owasp.html.HtmlSanitizerTest.sanitize(\"<p<b>\")));// Discard <b attribute\n\n // This behavior for short tags is not ideal, but it is safe.\n junit.framework.TestCase.assertEquals(\"<p href=\\\"/\\\">first part of the text&lt;/&gt; second part</p>\", eu.stamp_project.reneri.instrumentation.StateObserver.observe(\"org.owasp.html.HtmlSanitizerTest|testSgmlShortTags()|2\", org.owasp.html.HtmlSanitizerTest.sanitize(\"<p<a href=\\\"/\\\">first part of the text</> second part\")));\n }", "public static void main(String args[]) {\n\t\t GetXMLEncoding t = new GetXMLEncoding();\n\t\t String xml = t.getContent(\"http://news.163.com/special/00011K6L/rss_newstop.xml\");\n//\t System.out.println(xml);\n//\t System.out.println();\n\t if(t.checkXml(xml))\n\t System.out.println(t.getXmlencoding());\n\t }", "@Override\n public String getXmlDocument( HttpServletRequest request )\n {\n return XmlUtil.getXmlHeader( ) + getXml( request );\n }", "public synchronized Node parse(String url) throws IOException,SAXException\n {\n if(log.isDebugEnabled())\n log.debug(\"parse: \"+url);\n return parse(new InputSource(url));\n }", "private int parseXML(String xml) {\n int total = 0;\n try {\n int i = 0;\n String tagName = \"\";\n boolean onreh = false;\n boolean onEnd = false;\n boolean isItemTag1 = false;\n\n // Initialize XmlPullParser\n XmlPullParserFactory factory = XmlPullParserFactory.newInstance();\n XmlPullParser parser = factory.newPullParser();\n parser.setInput(new StringReader(xml));\n\n int eventType = parser.getEventType();\n while (eventType != XmlPullParser.END_DOCUMENT) {\n if (eventType == XmlPullParser.START_TAG) {\n tagName = parser.getName();\n if (tagName.equals(\"data\")) {\n shortWeathers.add(new ShortWeather());\n onEnd = false;\n isItemTag1 = true;\n }\n } else if (eventType == XmlPullParser.TEXT && isItemTag1) {\n if (tagName.equals(\"reh\") && !onreh) {\n shortWeathers.get(i).setReh(parser.getText());\n total += Integer.parseInt(parser.getText());\n onreh = true;\n }\n } else if (eventType == XmlPullParser.END_TAG) {\n if (tagName.equals(\"s06\") && onEnd == false) {\n i++;\n isItemTag1 = false;\n onreh = false;\n onEnd = true;\n }\n }\n eventType = parser.next();\n }\n } catch (Exception e) {\n e.getStackTrace();\n }\n return total / shortWeathers.size();\n }", "private List<String> usingXml(String urladd) {\n List<String> retLst = new ArrayList<String>();\n try {\n\n URL url = new URL(urladd);\n URLConnection urlConnection = url.openConnection();\n HttpURLConnection connection = null;\n connection = (HttpURLConnection) urlConnection;\n\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(connection.getInputStream());\n\n doc.getDocumentElement().normalize();\n\n NodeList nList = doc.getElementsByTagName(\"surfaceForm\");\n\n boolean flg = true;\n for (int temp = 0; temp < nList.getLength(); temp++) {\n\n Node nNode = nList.item(temp);\n\n if (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\n Element eElement = (Element) nNode;\n String text = eElement.getAttribute(\"name\");\n String offset = eElement.getAttribute(\"offset\");\n\n String startEnd = Integer.parseInt(offset) + \",\" + (text.length() + Integer.parseInt(offset));\n retLst.add(startEnd);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return retLst;\n }", "public interface XMLizable {\n\n /**\n * Write this element as an XML DOM element.\n */\n Element toXML();\n\n /**\n * Read this element as the content of the given element.\n */\n void readXML(Element elem) throws XMLSyntaxError;\n}", "public static <T> String xmlToHTML(String xslFile, T obj, Class<T> type) {\r\n\t\ttry {\r\n\t\t\tTransformerFactory tf = TransformerFactory.newInstance();\r\n\t\t\tTransformer transformer = tf.newTransformer(new StreamSource(\r\n\t\t\t\t\tWebPath + xslFile));\r\n\r\n\t\t\t// Source\r\n\t\t\tJAXBContext jc = JAXBContext.newInstance(type);\r\n\t\t\tJAXBSource source;\r\n\r\n\t\t\tsource = new JAXBSource(jc, obj);\r\n\r\n\t\t\t// Result\r\n\t\t\tStringWriter writer = new StringWriter();\r\n\r\n\t\t\t// Transform\r\n\t\t\ttransformer.transform(source, new StreamResult(writer));\r\n\r\n\t\t\treturn writer.toString();\r\n\t\t} catch (TransformerException e) {\r\n\t\t\treturn \"\";\r\n\t\t} catch (JAXBException e) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "@Override\n\tpublic void importXML(String nodePath, ByteArrayInputStream bis,\n\t\t\tint typeImport) throws Exception {\n\n\t}", "public String harmonizeXml(String xmlDoc) {\n\t\treturn xmlDoc.replace(\"\\r\", \"\").replace(\"\\n\", \"\").replace(\"\\t\", \"\").replaceAll(\"> *<\", \"><\").replaceAll(\"^ *\", \"\");\n\t}", "public static XmlResult getXml(final String url)\r\n {\r\n XmlResult xml = new XmlResult();\r\n\r\n HttpSimpleResponse response = getHttpFetcher().fetch(url);\r\n\r\n xml.setHttpResponse(response);\r\n\r\n return xml;\r\n }" ]
[ "0.5426539", "0.5319674", "0.5275859", "0.490507", "0.4834079", "0.47842756", "0.47373772", "0.47315222", "0.4716053", "0.4700308", "0.46936274", "0.46531427", "0.46525866", "0.46469975", "0.4639817", "0.46376887", "0.4624997", "0.46182844", "0.46134734", "0.46004874", "0.45922786", "0.45691866", "0.4544244", "0.45356998", "0.45061877", "0.45022148", "0.44977632", "0.44952723", "0.4486069", "0.44671634", "0.44654608", "0.44653654", "0.44643202", "0.4459722", "0.44576848", "0.44155937", "0.4402161", "0.4386743", "0.43827534", "0.43757874", "0.43671954", "0.4363775", "0.43621293", "0.43499944", "0.43467957", "0.43428788", "0.43424964", "0.4333863", "0.43276376", "0.43256864", "0.43166357", "0.43163204", "0.43023938", "0.42915893", "0.42891794", "0.42743194", "0.42718345", "0.42627037", "0.42594522", "0.42559016", "0.42557403", "0.42544654", "0.42475885", "0.4242144", "0.42363873", "0.42329258", "0.42022288", "0.4201474", "0.4201309", "0.4192294", "0.4183313", "0.41802698", "0.41788012", "0.41776323", "0.41776323", "0.41776323", "0.4165621", "0.41628027", "0.41581872", "0.41488642", "0.41307724", "0.41289556", "0.41274348", "0.41220826", "0.41218516", "0.41023567", "0.40986896", "0.4098609", "0.4096263", "0.40927714", "0.40924472", "0.4084829", "0.40761647", "0.40674996", "0.40581352", "0.40578762", "0.40577707", "0.40565103", "0.40528435", "0.40506873" ]
0.59920716
0
Given a string representation of a URL, sets up a connection and gets an input stream.
private InputStream downloadUrl(String urlString) throws IOException { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /* milliseconds */); conn.setConnectTimeout(15000 /* milliseconds */); conn.setRequestMethod("GET"); conn.setDoInput(true); // Starts the query conn.connect(); return conn.getInputStream(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public InputStream readStreamFromString(String url) throws IOException {\n\t\tInputStream in;\n\t\tif (url.matches(\"https?://.*\")) {\n\t\t\tURL u = new URL(url);\n\t\t\tURLConnection urlConnection = u.openConnection();\n\t\t\tin = urlConnection.getInputStream();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tin = findStreamInClasspathOrFileSystem(url);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\ttry {\n\t\t\t\t\t// Maybe this happens to be some other format of URL?\n\t\t\t\t\tURL u = new URL(url);\n\t\t\t\t\tURLConnection uc = u.openConnection();\n\t\t\t\t\tin = uc.getInputStream();\n\t\t\t\t} catch (IOException e2) {\n\t\t\t\t\t// Don't make the original exception a cause, since it is\n\t\t\t\t\t// almost certainly bogus\n\t\t\t\t\tthrow new IOException(\"Unable to resolve \\\"\" + url + \"\\\" as either \" + \"class path, filename or URL\"); // ,\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// e2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// buffer this stream\n\t\tin = new BufferedInputStream(in);\n\n\t\t// gzip it if necessary\n\t\tif (url.endsWith(\".gz\"))\n\t\t\tin = new GZIPInputStream(in);\n\t\treturn in;\n\t}", "URL getStreamURL() throws IOException;", "private static InputStream getHttpConnection(String urlString)\n throws IOException {\n InputStream stream = null;\n URL url = new URL(urlString);\n URLConnection connection = url.openConnection();\n\n try {\n HttpURLConnection httpConnection = (HttpURLConnection) connection;\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.connect();\n\n if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n stream = httpConnection.getInputStream();\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return stream;\n }", "public FileStoreInputStream(String string)\n\t\tthrows MalformedURLException\n\t\t{\n\t\tthis(\n\t\t\tnew URL(\n\t\t\t\tstring\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public abstract InputStream openStream(String str);", "public InputStream getStream(URL url) throws IOException {\n return engine.getStream(url);\n }", "private InputStream openHttpConnection(String urlStr) {\n InputStream in = null;\n int resCode = -1;\n\n try {\n URL url = new URL(urlStr);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n\n if (!(urlConn instanceof HttpURLConnection)) {\n throw new IOException(\"URL is not an Http URL\");\n }\n HttpURLConnection httpConn = urlConn;\n httpConn.setAllowUserInteraction(false);\n httpConn.setInstanceFollowRedirects(true);\n httpConn.setRequestMethod(\"GET\");\n httpConn.connect();\n resCode = httpConn.getResponseCode();\n\n if (resCode == HttpURLConnection.HTTP_OK) {\n in = httpConn.getInputStream();\n }\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return in;\n }", "protected InputStream _optimizedStreamFromURL(URL url)\n/* */ throws IOException\n/* */ {\n/* 1529 */ if (\"file\".equals(url.getProtocol()))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1536 */ String host = url.getHost();\n/* 1537 */ if ((host == null) || (host.length() == 0))\n/* */ {\n/* 1539 */ String path = url.getPath();\n/* 1540 */ if (path.indexOf('%') < 0) {\n/* 1541 */ return new FileInputStream(url.getPath());\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1547 */ return url.openStream();\n/* */ }", "private InputStream downloadStream(String urlString) throws IOException {\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\tconn.setReadTimeout(10000 /* milliseconds */);\n\t\tconn.setConnectTimeout(15000 /* milliseconds */);\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.setDoInput(true);\n\t\t// Starts the query\n\t\tconn.connect();\n\t\tInputStream stream = conn.getInputStream();\n\t\treturn stream;\n\t}", "private InputStream getHttpConnection(String urlString) throws IOException\n \t {\n \t InputStream stream = null;\n \t URL url = new URL(urlString);\n \n \t URLConnection connection = url.openConnection();\n \n \t try \n \t {\n \t HttpURLConnection httpConnection = (HttpURLConnection) connection;\n \t httpConnection.setRequestMethod(\"GET\");\n \t httpConnection.connect();\n \t stream = httpConnection.getInputStream();\n \n \t if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_OK)\n \t {\n \t stream = httpConnection.getInputStream();\n \t }\n \t } \n \t catch (Exception ex)\n \t {\n \t ex.printStackTrace();\n \t }\n \t return stream;\n \t }", "private InputStream downloadUrl(String urlString) throws IOException {\n // BEGIN_INCLUDE(get_inputstream)\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(100000 /* milliseconds */);\n conn.setConnectTimeout(150000 /* milliseconds */);\n// conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Start the query\n conn.connect();\n InputStream stream = conn.getInputStream();\n bitmap = BitmapFactory.decodeStream(stream);\n return stream;\n\n\n // END_INCLUDE(get_inputstream)\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\tconn.setReadTimeout(10000 /* milliseconds */);\n\t\tconn.setConnectTimeout(15000 /* milliseconds */);\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.setDoInput(true);\n\t\t// Starts the query\n\t\tconn.connect();\n\t\tInputStream stream = conn.getInputStream();\n\n\t\treturn stream;\n\t}", "public static InputStream getStream(Context context, String urlStr) throws IOException {\n InputStream stream = null;\n\n if (urlStr.startsWith(\"assets://\")) {\n stream = context.getAssets().open(urlStr.replaceFirst(\"assets://\", \"\"));\n } else {\n URL url = new URL(urlStr);\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n connection.setConnectTimeout(15000);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n stream = connection.getInputStream();\n }\n }\n\n return stream;\n }", "public InputStream openHttp2Stream(URL url) throws IOException {\r\n return openHttpEntity(url).getContent();\r\n }", "public MsxReader ( URL url ) {\r\n\t\tsuper();\r\n\r\n\t\taddURL(url);\r\n\t}", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n return conn.getInputStream();\n }", "public static InputStream getHttpConnection(String urlString) {\n InputStream stream = null;\n try {\n URL url = new URL(urlString);\n HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.connect();\n if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n stream = httpConnection.getInputStream();\n }\n } catch (UnknownHostException e1) {\n Log.d(\"MyDebugMsg\", \"UnknownHostexception in getHttpConnection()\");\n e1.printStackTrace();\n } catch (Exception ex) {\n Log.d(\"MyDebugMsg\", \"Exception in getHttpConnection()\");\n ex.printStackTrace();\n }\n return stream;\n }", "protected InputStream getURLInputStream() throws Exception\n\t {\n\n\t URL url = new URL(file, fFilename);\n\t InputStream fin = url.openStream();\n\t BufferedInputStream bin = new BufferedInputStream(fin);\n\t return bin;\n\t }", "public static InputStream toInputStream(final String input) {\n return toInputStream(input, Charset.defaultCharset());\n }", "private static BufferedReader newReader(URL url) throws IOException {\n return newReader(url.openConnection().getInputStream());\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(100000 /* milliseconds */);\n conn.setConnectTimeout(150000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n return conn.getInputStream();\n\n }", "public UrlInfo(String urlString) throws IOException {\n URL url = new URL(urlString);\n this.urlConnection = url.openConnection();\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n \tSystem.out.println(\"Inside downloadURL\");\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n \n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n InputStream stream = conn.getInputStream();\n return stream;\n }", "protected abstract InputStream getStream(String resource);", "private InputStream getHttpConnection(String urlString)\n throws IOException {\n InputStream stream = null;\n URL url = new URL(urlString);\n URLConnection connection = url.openConnection();\n\n try {\n HttpURLConnection httpConnection = (HttpURLConnection) connection;\n httpConnection.setDoInput(true);\n httpConnection.setRequestMethod(\"POST\");\n httpConnection.setDoOutput(true);\n httpConnection.setRequestProperty(\"Content-Type\", \"image/jpeg\");\n OutputStream outputStream = httpConnection.getOutputStream();\n outputStream.write(byteArray);\n outputStream.close();\n httpConnection.connect();\n\n if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n stream = httpConnection.getInputStream();\n }\n } catch (Exception ex) {\n didTaskFail = true;\n ex.printStackTrace();\n }\n return stream;\n }", "private void loadFromURL(String url) throws IOException {\n URL destination = new URL(url);\r\n URLConnection conn = destination.openConnection();\r\n Reader r = new InputStreamReader(conn.getInputStream());\r\n load(r);\r\n }", "public java.io.Reader getReader (URL url) throws java.io.IOException;", "public static String urlReader(String url) {\n\t\ttry {\n\t\t\tURL urlResource = new URL(url);\n\t\t\tURLConnection con = urlResource.openConnection();\n\t\t\tInputStream in = con.getInputStream();\n\t\t\tString encoding = con.getContentEncoding();\n\t\t\tencoding = encoding == null ? \"UTF-8\" : encoding;\n\t\t\treturn IOUtils.toString(in, encoding);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n //conn.setReadTimeout(10000 /* milliseconds */);\n // conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n conn.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 ( compatible ) \");\n conn.setRequestProperty(\"Accept\", \"*/*\");\n // Starts the query\n conn.connect();\n\n return conn.getInputStream();\n }", "public FileStoreInputStream(URL url)\n\t\t{\n\t\tif (null == url)\n\t\t\t{\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Null url\"\n\t\t\t\t);\n\t\t\t}\n\t\tthis.url = url ;\n\t\t}", "public static void openURL() {\n\t\tURL newURL;\n\t\ttry {\n\t\t\tnewURL = new URL(newLink);\n\t\t\tinput = new Scanner(new InputStreamReader(newURL.openStream()));\n\t\t}\n\t\tcatch (MalformedURLException ex) {\n\t\t\tSystem.out.println(\"Invalid URL\");\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(\"I/O Errors: no such file\");\t\t\t\n\t\t}\n\t}", "public static InputStream getHttpConnection(String urlString) throws IOException {\n\n InputStream stream = null;\n URL url = new URL(urlString);\n URLConnection connection = url.openConnection();\n\n try {\n HttpURLConnection httpConnection = (HttpURLConnection) connection;\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.connect();\n\n if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n stream = httpConnection.getInputStream();\n }\n }\n catch (Exception ex) {\n ex.printStackTrace();\n System.out.println(\"downloadImage\" + ex.toString());\n }\n return stream;\n }", "public static InputStream inputStreamFromString(String location) throws IOException {\n switch (getStringLocationType(location)) {\n case LOCATION_URL:\n return new URL(location).openStream();\n\n case LOCATION_FILE:\n default:\n return new FileInputStream(location);\n }\n }", "InputStream openStream() throws IOException;", "public void open(String url) {\n try {\n s = new Socket(url, 21);\n\n reader = new BufferedReader(new InputStreamReader(s.getInputStream()));\n writer = new PrintWriter(s.getOutputStream());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static String readUrl(String urlString) throws Exception {\r\n\t BufferedReader reader = null;\r\n\t try {\r\n\t URL url = new URL(urlString);\r\n\t reader = new BufferedReader(new InputStreamReader(url.openStream()));\r\n\t StringBuffer buffer = new StringBuffer();\r\n\t int read;\r\n\t char[] chars = new char[1024];\r\n\t while ((read = reader.read(chars)) != -1)\r\n\t buffer.append(chars, 0, read); \r\n\r\n\t return buffer.toString();\r\n\t } finally {\r\n\t if (reader != null)\r\n\t reader.close();\r\n\t }\r\n\t}", "public static InputStream convertStringToInputStream(String string) {\n InputStream is = null;\n try {\n is = new ByteArrayInputStream(string.getBytes(\"UTF-8\"));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return is;\n }", "public InputStream mo21856f(String str) {\n if (str == null || str.length() == 0) {\n return null;\n }\n if (str.indexOf(\":\") != -1) {\n try {\n HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setDoInput(true);\n httpURLConnection.connect();\n return httpURLConnection.getInputStream();\n } catch (FileNotFoundException | MalformedURLException unused) {\n } catch (IOException e) {\n mo21818a((Throwable) e);\n return null;\n }\n }\n try {\n InputStream open = this.f24530b.mo22068i().open(str);\n if (open != null) {\n return open;\n }\n } catch (IOException unused2) {\n }\n File file = new File(str);\n if (file.exists()) {\n try {\n return new FileInputStream(file);\n } catch (FileNotFoundException unused3) {\n }\n }\n File file2 = new File(mo21862h(str));\n if (file2.exists()) {\n try {\n return new FileInputStream(file2);\n } catch (FileNotFoundException unused4) {\n }\n }\n return this.f24530b.mo22061b(str);\n }", "public Reader openHttp2Reader(URL url) throws IOException {\r\n return new InputStreamReader(openHttpEntity(url).getContent());\r\n }", "public HttpRequest(URL url) throws IOException {\r\n this(url.openConnection());\r\n }", "@Override\n\tpublic URLConnection openConnection(URL url) throws IOException {\n\t\tif (url.getPath() == null || url.getPath().trim().length() == 0) {\n\t\t\tthrow new MalformedURLException(\"Path can not be null or empty. Syntax: \" + SYNTAX);\n\t\t}\n\t\treturn new MyURLConnection(url);\n\t}", "public static InputStream getInputStream(String pageURL) throws IOException{\n InputStream is = null;\n URL url = new URL(pageURL);\n URLConnection conn = url.openConnection();\n conn.setUseCaches(false);\n conn.addRequestProperty(\"User-agent\", Common.USER_AGENT);\n is = conn.getInputStream();\n return is;\n }", "public HttpRequest(String urlString) throws IOException {\r\n this(new URL(urlString));\r\n }", "InputStream getInputStream() throws IOException;", "InputStream getInputStream() throws IOException;", "InputStream getInputStream() throws IOException;", "@Override\n public URLConnection openConnection(URL url) throws IOException {\n return openConnection(url, null);\n }", "public InputSource makeInputSource(String path) throws IOException {\n return new InputSource(makeUrl(path).toString());\n}", "public void read(final URL url) throws IOException, DataFormatException {\r\n\r\n final URLConnection connection = url.openConnection();\r\n final int fileSize = connection.getContentLength();\r\n\r\n if (fileSize < 0) {\r\n throw new FileNotFoundException(url.getFile());\r\n }\r\n\r\n final String mimeType = connection.getContentType();\r\n decoder = SoundRegistry.getSoundProvider(mimeType);\r\n\r\n if (decoder == null) {\r\n throw new DataFormatException(\"Unsupported format\");\r\n }\r\n\r\n decoder.read(url.openStream());\r\n }", "private static InputStream retrieveStream(String url) {\r\n\t\tDefaultHttpClient client = new DefaultHttpClient();\r\n\t\tHttpGet getRequest = new HttpGet(url);\r\n\t\t\r\n\t\ttry{\r\n\t\t\tHttpResponse getResponse = client.execute(getRequest);\r\n\t\t\tfinal int statusCode = getResponse.getStatusLine().getStatusCode();\r\n\t\t\tSystem.out.println(statusCode);\r\n\t\t\t\r\n\t\t\tif(statusCode != HttpStatus.SC_OK){\r\n\t\t\t\t//Log.w(getClass().getSimpleName(),\r\n\t\t\t\t\t\t//\"Error \" + statusCode + \" for URL \" + url);\r\n\t\t\t\tSystem.out.println(statusCode);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tHttpEntity getResponseEntity = getResponse.getEntity();\r\n\t\t\treturn getResponseEntity.getContent();\r\n\t\t}\r\n\t\t\r\n\t\tcatch(IOException e){\r\n\t\t\tgetRequest.abort();\r\n\t\t\t//Log.w(getClass().getSimpleName(),\"Error for URL \" + url, e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Parser(URL url) {\n \t\t\ttry {\n \t\t\t\tload(url.openStream());\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public static InputStream connect(InputStream in, OutputStream out) {\n return new FilterInputStream(in) {\n public void close() {\n IO.close(out, in);\n }\n };\n }", "private String loadFromNetwork(String urlString) throws IOException {\n InputStream stream = null;\n String str =\"\";\n\n try {\n stream = downloadUrl(urlString);\n str = readIt(stream, 450000);\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n return str;\n }", "public Tass4Reader ( URL url ) {\r\n\t\tsuper();\r\n\r\n\t\taddURL(url);\r\n\t}", "public static InputStream StringToStream(String text) {\n try {\n InputStream is = new ByteArrayInputStream(text.getBytes(\"UTF-8\"));\n return is;\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return null;\n }", "public UrlInfo(URL url) throws IOException {\n this.urlConnection = url.openConnection();\n }", "Stream<In> getInputStream();", "public abstract InputStream getInputStream();", "public abstract InputStream getInputStream();", "public java.io.InputStream getStream(String content) {\r\n\t\ttry {\r\n\t\t\tjava.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream(content.getBytes());\r\n\t\t\treturn bais;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(ex.getMessage());\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public StreamReader(InputStream input) throws IOException {\r\n\t\tthis.setInput(input);\r\n\t}", "Object create(URL url) throws IOException, SAXException, ParserConfigurationException;", "public InputStream mo7256h(String str, Object obj) {\n throw new UnsupportedOperationException(String.format(\"UIL doesn't support scheme(protocol) by default [%s]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))\", new Object[]{str}));\n }", "public static String readUrl(String url, ErrorHandlerInterface errorHandler) {\n URL url2;\n StringBuilder result = new StringBuilder();\n try {\n url2 = new URL(url);\n BufferedReader in = new BufferedReader(new InputStreamReader(url2.openStream(), \"utf-8\"), 1024);\n\n String inputLine;\n\n while ((inputLine = in.readLine()) != null) {\n result.append(inputLine).append(\"\\n\");\n }\n in.close();\n } catch (UnknownHostException ignored) {\n // this can happen when there is no internet connection\n } catch (ConnectException ignored) {\n // this can happen when there is no internet connection\n } catch (IOException ignored) {\n // this can also happen when there is no internet connection\n // (if the isp provides an error page?)\n // errorHandler.handle(e);\n }\n return result.toString();\n }", "public static byte[] getURL(String string_url) {\n ByteArrayOutputStream bais = new ByteArrayOutputStream();\n InputStream is = null;\n try {\n URL url = new URL(string_url);\n is = url.openStream();\n byte[] byteChunk = new byte[4096];\n int n;\n \n while ( (n = is.read(byteChunk)) > 0 ) {\n bais.write(byteChunk, 0, n);\n }\n \n is.close();\n }\n catch (IOException e) {\n }\n \n return bais.toByteArray();\n }", "public static void connection(URL theUrl)\n\t{\n\t\ttry\n\t\t{\n\t\t\tInputStream is = theUrl.openStream();\n\t\t\tInputStreamReader isr = new InputStreamReader(is);\n\t\t\tBufferedReader br = new BufferedReader(isr);\n\t\t\tString theLine;\n\t\t\twhile((theLine = br.readLine()) != null)\n\t\t\t{\n\t\t\t\tSystem.out.println(theLine);\n\t\t\t}\n\t\t}\n\t\tcatch(IOException ex)\n\t\t{\n\t\t\tSystem.err.println(ex);\n\t\t}\t\n\t}", "public InputStream openStream(String str) {\n try {\n return new FileInputStream(str);\n } catch (FileNotFoundException e) {\n throw new RuntimeException(e);\n }\n }", "@NotNull InputStream openInputStream() throws IOException;", "public JsonParser createParser(URL url)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 782 */ IOContext ctxt = _createContext(url, true);\n/* 783 */ InputStream in = _optimizedStreamFromURL(url);\n/* 784 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public JarConnection(URL url) throws URISyntaxException {\n super(url);\n this.path = Paths.get(url.toURI().getSchemeSpecificPart());\n this.option = StandardOpenOption.READ;\n }", "public static String readUrl(String urlString) throws Exception {\n\t\tBufferedReader reader = null;\n\t\ttry {\n\t\t\tURL url = new URL(urlString);\n\t\t\treader = new BufferedReader(new InputStreamReader(url.openStream()));\n\t\t\tStringBuffer buffer = new StringBuffer();\n\t\t\tint read;\n\t\t\tchar[] chars = new char[1024];\n\t\t\twhile ((read = reader.read(chars)) != -1)\n\t\t\t\tbuffer.append(chars, 0, read);\n\n\t\t\treturn buffer.toString();\n\t\t} finally {\n\t\t\tif (reader != null)\n\t\t\t\treader.close();\n\t\t}\n\t}", "static String getResponseFromHttpUrl(URL url) throws IOException {\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n try {\n InputStream in = urlConnection.getInputStream();\n\n Scanner scanner = new Scanner(in);\n scanner.useDelimiter(\"\\\\A\");\n\n boolean hasInput = scanner.hasNext();\n String response = null;\n if (hasInput) {\n response = scanner.next();\n }\n scanner.close();\n return response;\n } finally {\n urlConnection.disconnect();\n }\n }", "private static URL stringToUrl(String stringUrl) throws MalformedURLException{\r\n\t\treturn new URL(stringUrl);\r\n\t}", "public static void readFromUrl(URL url) {\n try {\n BufferedReader in = new BufferedReader(\n new InputStreamReader(\n url.openStream()));\n\n String inputLine;\n\n while ((inputLine = in.readLine()) != null) {\n System.out.println(inputLine);\n }\n\n in.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public static String readUrlToString(String url){\n \tString out = \"\";\n \tBufferedReader in = null;\n \t\n \ttry { \n URL theUrl = new URL(url); \n in = new BufferedReader(new InputStreamReader(theUrl.openStream())); \n String inputLine; \n \n while ((inputLine = in.readLine()) != null) { \n out = out + inputLine; \n }\n } catch (Exception e) { \n e.printStackTrace();\n \n }finally{\n \ttry {\n\t\t\t\tin.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n return out;\n\t}", "private InputStream findStreamInClasspathOrFileSystem(String url) throws IOException {\n\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(url);\n\t\t// if not found in the CLASSPATH, load from the file system\n\t\tif (is == null)\n\t\t\tis = new FileInputStream(url);\n\t\treturn is;\n\t}", "public InputStream getInputStream();", "public InputStream getInputStream();", "public static InputStream openStream(String url){\n\t\ttry {\n\t\t\tFile f = new File(context.getCacheDir(), hashURL(url));\n\t\t\tInputStream stream= new BufferedInputStream(new FileInputStream(f));\n\t\t\tLog.i(\"FILEBANK\",\"Cache hit on \"+hashURL(url));\n\t\t\treturn stream;\n\t\t} catch (FileNotFoundException ex){\n\t\t\tsaveFile(url);\n\t\t\treturn openStream(url);\n\t\t}\n\t}", "URL toURL() throws IOException;", "public String requestContent(String urlStr) {\n String result = null;\n HttpURLConnection urlConnection;\n try {\n URL url = new URL(urlStr);\n urlConnection = (HttpURLConnection) url.openConnection();\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n try {\n InputStream in = new BufferedInputStream(urlConnection.getInputStream());\n result = convertStreamToString(in);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n urlConnection.disconnect();\n }\n return result;\n }", "public HttpsConnection openConnection(final String url) throws BooruEngineConnectionException {\n try {\n return openConnection(new URL(url));\n } catch (MalformedURLException e) {\n throw new BooruEngineConnectionException(e);\n }\n }", "public void setIn(InputStream in);", "public DefaultDocumentSource(String urlstring) throws IOException\n {\n super(null, urlstring);\n URL url = DataURLHandler.createURL(null, urlstring);\n con = createConnection(url);\n is = null;\n }", "InputStream convert(InputStream inputStream, String specificationName) throws IOException;", "public static InputStream toInputStream(final CharSequence input) {\n return toInputStream(input, Charset.defaultCharset());\n }", "protected URLConnection createConnection(URL url) throws IOException\n {\n URLConnection con = url.openConnection();\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n return con;\n }", "public InputStream getInputStream() throws IOException {\n \t\treturn liveHelpURL.openStream();\r\n \t}", "private void openInputStream() throws IOException {\n InputStreamReader isReader = new InputStreamReader(this.sock.getInputStream());\n reader = new BufferedReader(isReader);\n }", "private InputStream getInputStream (SvnClient client, SVNUrl url, String revision, String pegRevision) throws SVNClientException {\n InputStream in = null;\n try {\n in = client.getContent(url, SvnUtils.toSvnRevision(revision), SvnUtils.toSvnRevision(pegRevision));\n } catch (SVNClientException e) {\n if (SvnClientExceptionHandler.isFileNotFoundInRevision(e.getMessage()) ||\n SvnClientExceptionHandler.isPathNotFound(e.getMessage())) {\n in = new ByteArrayInputStream(new byte[]{});\n } else {\n throw e;\n }\n }\n return in;\n }", "@Override\n public URLConnection openConnection(URL url, Proxy proxy) throws IOException {\n if (url == null) {\n throw new IllegalArgumentException(\"url == null\");\n }\n String host = url.getHost();\n if (host == null || host.isEmpty() || host.equalsIgnoreCase(\"localhost\")) {\n return new FtpURLConnection(url);\n }\n // If a hostname is specified try to get the resource using FTP\n URL ftpURL = new URL(\"ftp\", host, url.getFile());\n return (proxy == null) ? ftpURL.openConnection() : ftpURL.openConnection(proxy);\n }", "static InputStream openStreamFromURL(String path) {\n\t\tClassLoader cl = PropertiesUtil.class.getClassLoader();\n\t\tURL url = cl.getResource(path);\n\t\tif (url != null) {\n\t\t\ttry {\n\t\t\t\tInputStream stream = url.openStream();\n\t\t\t\treturn stream;\n\t\t\t} catch (IOException ioex) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "static String loadStream(InputStream in) throws IOException {\n int ptr = 0;\n in = new BufferedInputStream(in);\n StringBuffer buffer = new StringBuffer();\n while( (ptr = in.read()) != -1 ) {\n buffer.append((char)ptr);\n }\n return buffer.toString();\n }", "public HttpClientUrlConnection(String urlString, HttpClient client)\n throws IOException {\n this(LockssUrlConnection.METHOD_GET, urlString, client, null);\n }", "public XGMMLReader(InputStream is) {\n \t\tthis.networkStream = is;\n \t\tinitialize();\n \t}", "TclInputStream(InputStream inInput) {\n input = inInput;\n }", "public InputStream getInputStream() throws IOException;", "public InputStream getInputStream() throws IOException;", "void init() throws IOException {\n\t\tif (this.type==FILE){\n\t\t\tstream.init(new FileInputStream(name));\n\t\t}\n\t\telse{\n\t\t\tURL url = new URL(name);\n\t\t\tstream.init((url.openStream()));\n\t\t}\n\t}", "@Test\n public void test1 () throws Exception{\n URI uri = new URI(\"http://www.baidu.com\");\n\n URL url = uri.toURL();\n\n InputStream input = url.openStream();\n OutputStream output = new ByteArrayOutputStream();\n\n int i = 0;\n byte[] bytes = new byte[1024];\n int length = -1;\n while( (length = input.read(bytes)) != -1){\n output.write(bytes, 0, length);\n }\n\n System.out.println(new String(bytes));\n }" ]
[ "0.7012477", "0.6643289", "0.65813196", "0.6479694", "0.64379483", "0.63879025", "0.6372153", "0.6313515", "0.6284357", "0.6244694", "0.61918", "0.6189053", "0.614528", "0.6107976", "0.60896665", "0.6068601", "0.60523623", "0.6024036", "0.6019764", "0.6004966", "0.6001689", "0.5936061", "0.58670175", "0.5860289", "0.5854918", "0.5827806", "0.58202404", "0.5756592", "0.57485867", "0.5743311", "0.57080734", "0.56808203", "0.5643552", "0.5560065", "0.5554604", "0.5543805", "0.5531312", "0.5505429", "0.5483693", "0.5478715", "0.54761785", "0.5471304", "0.54631454", "0.5460512", "0.5460512", "0.5460512", "0.54598445", "0.5437689", "0.5419755", "0.54110366", "0.5398807", "0.5393206", "0.5374194", "0.53468925", "0.53101116", "0.5293026", "0.5291096", "0.52603614", "0.52603614", "0.52453893", "0.524447", "0.5207358", "0.52007467", "0.52005637", "0.5197994", "0.51943856", "0.51924384", "0.51709795", "0.5169679", "0.5158916", "0.51419353", "0.51111406", "0.51086664", "0.51066375", "0.50985336", "0.50857157", "0.5083433", "0.5083433", "0.5072468", "0.50708914", "0.5069614", "0.50677925", "0.5062947", "0.50512636", "0.504638", "0.50432014", "0.50355196", "0.5034559", "0.5028858", "0.50164807", "0.500333", "0.5003164", "0.49974653", "0.49650496", "0.49606943", "0.49534214", "0.49530837", "0.49530837", "0.49514565", "0.49438676" ]
0.60212994
18
Constructors Create a detached TBasicSalaryTypeRecord
public TBasicSalaryTypeRecord() { super(jooq.model.tables.TBasicSalaryType.T_BASIC_SALARY_TYPE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TBasicSalaryTypeRecord(org.jooq.types.ULong id, java.lang.Long tenantId, java.lang.String salaryName, java.lang.Byte isParticipateOvertime, java.lang.Byte isParticipateAttendance, java.lang.String salaryDescription, java.sql.Timestamp createTime, java.sql.Timestamp updateTime) {\n\t\tsuper(jooq.model.tables.TBasicSalaryType.T_BASIC_SALARY_TYPE);\n\n\t\tsetValue(0, id);\n\t\tsetValue(1, tenantId);\n\t\tsetValue(2, salaryName);\n\t\tsetValue(3, isParticipateOvertime);\n\t\tsetValue(4, isParticipateAttendance);\n\t\tsetValue(5, salaryDescription);\n\t\tsetValue(6, createTime);\n\t\tsetValue(7, updateTime);\n\t}", "public GO_RecordType() {\n }", "public TBasicSalary() {\n\t\tthis(\"t_basic_salary\", null);\n\t}", "public StudentRecord() {}", "public SalesRecord() {\n super(Sales.SALES);\n }", "public GenericTcalRecord() {\n this(-1);\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "RecordType createRecordType();", "public EmployeeRecord(String newLastName, String newFirstName, char newType)\n {\n if ((Character.toLowerCase(newType) != 'h' && Character.toLowerCase(newType) != 'p' && Character.toLowerCase(newType) != 's') || !newLastName.matches(\"[a-zA-Z]+\") || !newFirstName.matches(\"[a-zA-Z]+\")) return;\n else \n {\n this.lastName = newLastName;\n this.firstName = newFirstName;\n this.type = newType;\n this.grossPay = this.taxAmt = this.netPay = 0.00;\n }\n }", "BriefRecordType createBriefRecordType();", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "public EmployeeRecord(){}", "public PersonRecord() {}", "public MealRecord() {\n\t\tsuper(Meal.MEAL);\n\t}", "SummaryRecordType createSummaryRecordType();", "private ProfitPerTariffType ()\n {\n super();\n }", "public ARecord() {\n super(A.A);\n }", "public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}", "public SalesRecords() {\n super();\n }", "public TradeRecordStruct() {\n }", "RecordPropertyType createRecordPropertyType();", "public static Record newInstance(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\treturn new RecordImpl(tableParent, lRecord, rt);\n\t}", "public T1Record() {\n super(pan.auditdb.tables.T1.T1);\n }", "public EmployerRecord() {\n super(Employer.EMPLOYER);\n }", "public PurchaseType()\r\n {\r\n }", "@Override\n\tpublic java.lang.Class<jooq.model.tables.records.TBasicSalaryRecord> getRecordType() {\n\t\treturn jooq.model.tables.records.TBasicSalaryRecord.class;\n\t}", "public DoctorRecord() {\n super(Doctor.DOCTOR);\n }", "DataHRecordData() {}", "public GenericTcalRecord(long utcTime) {\n super(utcTime);\n }", "public DataRecord() {\n super(DataTable.DATA);\n }", "public ObjectRecord() {\n\t\tsuper(org.jooq.test.hsqldb.generatedclasses.tables.Object.OBJECT);\n\t}", "private RecordImpl(Table tableParent, long lRecord, URI uriTemporaryLobFolder) throws IOException\n\t{\n\t\t_tableParent\t\t\t= tableParent;\n\t\t_lRecord\t\t\t\t= lRecord;\n\t\t_uriTemporaryLobFolder\t= uriTemporaryLobFolder;\n\t\tsetRecordType(_of.createRecordType());\n\t}", "public Person(String name, String surname, String phoneNumber, Boolean loyaltyCard, Double salary) {\n setName(name);\n setSurname(surname);\n setPhoneNumber(phoneNumber);\n\n addPersonTypes(PersonType.CLIENT);\n addPersonTypes(PersonType.WORKER);\n\n setLoyaltyCard(loyaltyCard);\n setSalary(salary);\n }", "public Item_Record() {\n super(Item_.ITEM_);\n }", "public TBasicSalary(java.lang.String alias) {\n\t\tthis(alias, jooq.model.tables.TBasicSalary.T_BASIC_SALARY);\n\t}", "RecordType newRecordType(String recordTypeId, QName name) throws TypeException;", "public MsgSubsidiaryType() {\r\n\t\tsuper();\r\n\t\t// _INDIVIDUALList = new ArrayList();\r\n\t\t_DEALERList = new ArrayList();\r\n\t}", "public TOfferGoodsRecord() {\n super(TOfferGoods.T_OFFER_GOODS);\n }", "public TesttabRecord() {\n\t\tsuper(org.jooq.h2.generated.tables.Testtab.TESTTAB);\n\t}", "Rental createRental();", "protected BlankRecord(Cell c)\r\n/* 25: */ {\r\n/* 26: 72 */ super(Type.BLANK, c);\r\n/* 27: */ }", "public ItemRecord() {\n super(Item.ITEM);\n }", "public DictProvinceRecord() {\n super(DictProvince.DICT_PROVINCE);\n }", "protected BlankRecord(int c, int r)\r\n/* 15: */ {\r\n/* 16: 48 */ super(Type.BLANK, c, r);\r\n/* 17: */ }", "public DoctorRecord(Integer id, Integer age, Integer workTime, Byte sex, String name, String url, Byte duty, String hospitalCode, String certificateCode, String professionalCode, Date registerTime, String registerHospital, String mobile, Integer titleId, BigDecimal consultationPrice, String treatDisease, Byte status, Integer userId, Byte isDelete, Timestamp createTime, Timestamp updateTime, Timestamp onDutyTime, Byte isOnDuty, Byte canConsultation, Integer avgAnswerTime, Integer consultationNumber, BigDecimal avgCommentStar, Integer attentionNumber, String userToken, Timestamp authTime, BigDecimal consultationTotalMoney, Byte isFetch, String signature) {\n super(Doctor.DOCTOR);\n\n set(0, id);\n set(1, age);\n set(2, workTime);\n set(3, sex);\n set(4, name);\n set(5, url);\n set(6, duty);\n set(7, hospitalCode);\n set(8, certificateCode);\n set(9, professionalCode);\n set(10, registerTime);\n set(11, registerHospital);\n set(12, mobile);\n set(13, titleId);\n set(14, consultationPrice);\n set(15, treatDisease);\n set(16, status);\n set(17, userId);\n set(18, isDelete);\n set(19, createTime);\n set(20, updateTime);\n set(21, onDutyTime);\n set(22, isOnDuty);\n set(23, canConsultation);\n set(24, avgAnswerTime);\n set(25, consultationNumber);\n set(26, avgCommentStar);\n set(27, attentionNumber);\n set(28, userToken);\n set(29, authTime);\n set(30, consultationTotalMoney);\n set(31, isFetch);\n set(32, signature);\n }", "public SalesRecords(Long id, Long opportunityId, Long salesmanId, Integer departmentId, Boolean status, Double money, Date createDate) {\n this.id = id;\n this.opportunityId = opportunityId;\n this.salesmanId = salesmanId;\n this.departmentId = departmentId;\n this.status = status;\n this.money = money;\n this.createDate = createDate;\n }", "private RecordImpl(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\t_tableParent\t= tableParent;\n\t\t_lRecord\t\t= lRecord;\n\t\tif (rt.getAny().size() > 0)\n\t\t{\n\t\t\tElement el = (Element) rt.getAny().get(0);\n\t\t\tif (el.getOwnerDocument() != getDocument())\n\t\t\t{\n\t\t\t\t_doc = el.getOwnerDocument();\n\t\t\t}\n\t\t}\n\t\tsetRecordType(rt);\n\t}", "public FundingDetails() {\n super();\n }", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "public PaymentRecordKey() {\n super();\n }", "public TblrefTemplateRecord() {\n super(TblrefTemplate.TBLREF_TEMPLATE);\n }", "RecordInfo clone();", "public OfcRecordRecord() {\n\t\tsuper(org.openforis.collect.persistence.jooq.tables.OfcRecord.OFC_RECORD);\n\t}", "public Type() {\n super();\n }", "public ReocType() \r\n {\r\n super();\r\n }", "TransactionSummaryType createTransactionSummaryType();", "public JStudentInfoRecord() {\n super(JStudentInfo.STUDENT_INFO);\n }", "public UsertestRecord() {\n super(Usertest.USERTEST);\n }", "public VehicleType(Hashtable hash) {\r\n super(hash);\r\n }", "public HLCPaymentDetails() { }", "public CommAreaRecord() {\n\t}", "public CheckpointRecord(BasicLogRecord rec) {\r\n\t\tint txCount = (Integer) rec.nextVal(INTEGER).asJavaVal();\r\n\t\tthis.lsn = rec.getLSN();\r\n\t\tthis.txNums = new ArrayList<Long>();\r\n\t\tfor (int i = 0; i < txCount; i++) {\r\n\t\t\ttxNums.add((Long) rec.nextVal(BIGINT).asJavaVal());\r\n\t\t}\r\n\t}", "protected BlankRecord(int c, int r, BlankRecord br)\r\n/* 30: */ {\r\n/* 31: 84 */ super(Type.BLANK, c, r, br);\r\n/* 32: */ }", "public TextObjectBaseRecord(short id, short size, byte [] data)\n {\n super(id, size, data);\n \n }", "public AvroPerson() {}", "public CharacterPartyRecord() {\n super(CharacterParty.CHARACTER_PARTY);\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "public UserRecord() {\n super(User.USER);\n }", "RecordType newRecordType(QName name) throws TypeException;", "RentalObject createRentalObject();", "public Rental() {\n\t\tthis(\"rental\", null);\n\t}", "GetRecordByIdType createGetRecordByIdType();", "public InsulinType(){\n super();\n }", "public RoomType (Long uniqueId) {\n\t\tsuper(uniqueId);\n\t}", "protected TypedTableObject(String name, String type, IValueAccessor accessor) {\n super(name, accessor);\n this.type = type;\n }", "DataType createDataType();", "protected BlankRecord(int c, int r, CellFormat st)\r\n/* 20: */ {\r\n/* 21: 61 */ super(Type.BLANK, c, r, st);\r\n/* 22: */ }", "BType createBType();", "private static void LessonInheritance() {\n Employee employee1 = new Employee();\n\n //Set Id , firstName and lastName of Employee from Person Class and BaseBO\n employee1.setId(13);\n employee1.setFirstName(\"Jordan(e)\");\n employee1.setLastName(\"Walker(e)\");\n\n //Print info out\n System.out.println(\"Id#\" + employee1.getId() + \" \" + employee1.getFirstName() + \" \" + employee1.getLastName());\n\n //create a Person object and inherit from BaseBO class Id\n Person person3 = new Person();\n person3.setId(7);\n person3.setFirstName(\"Jordan(p)\");\n person3.setLastName(\"Walker(p)\");\n\n System.out.println(\"Id#\" + person3.getId() + \" \" + person3.getFirstName() + \" \" + person3.getLastName());\n }", "public AccountTypeEntity() { }", "public TextObjectBaseRecord(short id, short size, byte [] data, int offset)\n {\n super(id, size, data, offset);\n \n }", "public BirthInfo() {}", "Type(int lnum) {\n\t\tsuper(lnum);\n\t}", "public ActHiDetailRecord() {\n super(ActHiDetail.ACT_HI_DETAIL);\n }", "public AuthorRecord() {\n super(Author.AUTHOR);\n }", "public OCBase(OCInteger lenType)\r\n {\r\n this.lenType = lenType;\r\n }", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "public TblresumeExperienceRecord() {\n super(TblresumeExperience.TBLRESUME_EXPERIENCE);\n }", "public PayrollRecord(String employee, double pay) {\n employeeName = employee;\n currentPay = pay;\n }", "public static Record newInstance(Table tableParent, long lRecord, URI uriTemporaryLobFolder) throws IOException\n\t{\n\t\treturn new RecordImpl(tableParent, lRecord, uriTemporaryLobFolder);\n\t}", "public SongRecord(){\n\t}", "public ProAddAttrRecord() {\n super(ProAddAttr.PRO_ADD_ATTR);\n }", "public TypeMtLexemeFreeformRecord() {\n super(TypeMtLexemeFreeform.TYPE_MT_LEXEME_FREEFORM);\n }", "public PolicyDetailsRecord(Integer policyId, String insuranceType, String productName, String policyDetails, Integer personDetailsId, Integer policyTypeId, String pNumber) {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\n\t\tsetValue(0, policyId);\n\t\tsetValue(1, insuranceType);\n\t\tsetValue(2, productName);\n\t\tsetValue(3, policyDetails);\n\t\tsetValue(4, personDetailsId);\n\t\tsetValue(5, policyTypeId);\n\t\tsetValue(6, pNumber);\n\t}", "public FlexData(Type type) {\n entryCollectionList = null;\n entryCollectionMap = null;\n this.type = type;\t\t\n standardDateFormat = \"yyyy-MM-dd\"; // DB2-Datum\n\t}", "public TOfferGoodsRecord(Integer id, Byte typeId, String title, String simpleTitle, String tags, BigDecimal oldRent, String url, Long productId, Integer oid, Timestamp cdate, Timestamp mdate) {\n super(TOfferGoods.T_OFFER_GOODS);\n\n set(0, id);\n set(1, typeId);\n set(2, title);\n set(3, simpleTitle);\n set(4, tags);\n set(5, oldRent);\n set(6, url);\n set(7, productId);\n set(8, oid);\n set(9, cdate);\n set(10, mdate);\n }", "public IndexRecord()\n {\n }", "public FlatRecord newFlatRecord(Catalog catalog)\r\n {\r\n FlatRecord newObj = (FlatRecord)SAP_FlatRecord.newObj((com.informatica.adapter.sdkadapter.patternblocks.catalog.semantic.auto.SAP_Catalog)catalog);\r\n SEMTableRecordExtensions newExtnObj = newSEMTableRecordExtensions(catalog);\r\n newObj.setExtensions(newExtnObj);\r\n return newObj;\r\n }" ]
[ "0.673312", "0.63215166", "0.63166094", "0.6081016", "0.6066183", "0.6063454", "0.60595834", "0.59625196", "0.5956871", "0.5933795", "0.593364", "0.5917855", "0.5901814", "0.5844708", "0.5787002", "0.5722594", "0.5710979", "0.5645587", "0.5601838", "0.55913407", "0.5535147", "0.55309004", "0.5525262", "0.54728323", "0.54718715", "0.54639673", "0.5438105", "0.54106927", "0.54083145", "0.53970456", "0.53874457", "0.5367556", "0.5319388", "0.53163016", "0.5269251", "0.52633584", "0.5260147", "0.5260004", "0.52598256", "0.5256016", "0.52544695", "0.52479154", "0.52478135", "0.5246888", "0.5244591", "0.5243775", "0.5235992", "0.52309644", "0.52271295", "0.52179253", "0.52136886", "0.51991946", "0.5195846", "0.5194563", "0.5185065", "0.51849216", "0.51709366", "0.5166834", "0.5166742", "0.51624906", "0.5154731", "0.5148415", "0.5146041", "0.51228213", "0.5113628", "0.51043254", "0.5103717", "0.5103717", "0.5103717", "0.5103717", "0.51026785", "0.50954205", "0.5084757", "0.5080925", "0.50778186", "0.5070392", "0.5060268", "0.5059264", "0.50520176", "0.5050558", "0.5050342", "0.50495464", "0.5037334", "0.50358534", "0.5031754", "0.5024841", "0.50219387", "0.50136924", "0.4992479", "0.49830407", "0.49829784", "0.4982102", "0.4974677", "0.4966187", "0.4965602", "0.49584344", "0.49541453", "0.4950956", "0.4948705", "0.49453217" ]
0.7718715
0
Create a detached, initialised TBasicSalaryTypeRecord
public TBasicSalaryTypeRecord(org.jooq.types.ULong id, java.lang.Long tenantId, java.lang.String salaryName, java.lang.Byte isParticipateOvertime, java.lang.Byte isParticipateAttendance, java.lang.String salaryDescription, java.sql.Timestamp createTime, java.sql.Timestamp updateTime) { super(jooq.model.tables.TBasicSalaryType.T_BASIC_SALARY_TYPE); setValue(0, id); setValue(1, tenantId); setValue(2, salaryName); setValue(3, isParticipateOvertime); setValue(4, isParticipateAttendance); setValue(5, salaryDescription); setValue(6, createTime); setValue(7, updateTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TBasicSalaryTypeRecord() {\n\t\tsuper(jooq.model.tables.TBasicSalaryType.T_BASIC_SALARY_TYPE);\n\t}", "RecordType createRecordType();", "BriefRecordType createBriefRecordType();", "public GO_RecordType() {\n }", "SummaryRecordType createSummaryRecordType();", "RecordPropertyType createRecordPropertyType();", "public TBasicSalary() {\n\t\tthis(\"t_basic_salary\", null);\n\t}", "@Override\n\tpublic java.lang.Class<jooq.model.tables.records.TBasicSalaryRecord> getRecordType() {\n\t\treturn jooq.model.tables.records.TBasicSalaryRecord.class;\n\t}", "public EmployeeRecord(String newLastName, String newFirstName, char newType)\n {\n if ((Character.toLowerCase(newType) != 'h' && Character.toLowerCase(newType) != 'p' && Character.toLowerCase(newType) != 's') || !newLastName.matches(\"[a-zA-Z]+\") || !newFirstName.matches(\"[a-zA-Z]+\")) return;\n else \n {\n this.lastName = newLastName;\n this.firstName = newFirstName;\n this.type = newType;\n this.grossPay = this.taxAmt = this.netPay = 0.00;\n }\n }", "public MealRecord() {\n\t\tsuper(Meal.MEAL);\n\t}", "TransactionSummaryType createTransactionSummaryType();", "public SalesRecord() {\n super(Sales.SALES);\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "public StudentRecord() {}", "public GenericTcalRecord() {\n this(-1);\n }", "DataType createDataType();", "private ProfitPerTariffType ()\n {\n super();\n }", "public PersonRecord() {}", "ShipmentTypeAttr createShipmentTypeAttr();", "RecordType newRecordType(String recordTypeId, QName name) throws TypeException;", "Rental createRental();", "public static Record newInstance(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\treturn new RecordImpl(tableParent, lRecord, rt);\n\t}", "BType createBType();", "public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}", "private static void dummyDataCreation(){\n Session session = TestCacheUserType.sessionFactory.openSession();\n //once transient object attached to hibernate, it became persistent object state\n Transaction tx = session.beginTransaction();\n\n List<String> listUserType = new ArrayList<String>();\n listUserType.add(\"ADMIN\");\n listUserType.add(\"SUPER ADMIN\");\n listUserType.add(\"USER\");\n listUserType.add(\"INTERNAL USER\");\n listUserType.add(\"CLIENT\");\n listUserType.add(\"WEB SERVICE USER\");\n\n for (String userTypeStr: listUserType) {\n\n //transient object state\n UserType userType = new UserType();\n userType.setUserTypeName(userTypeStr);\n userType.setCreatedDate(new Date());\n userType.setModifiedDateTime(new Date());\n userType.setCreatedDateNormal(new Date());\n userType.setCreatedTime(new Date());\n userType.setModifiedDateWithoutTime(new Date());\n userType.setDeleted(true);\n userType.setActive('Y');\n\n session.save(userType);\n }\n\n tx.commit();\n\n System.out.println(\"UserType added successfully.....!!\");\n session.close();\n }", "public TradeRecordStruct() {\n }", "public EmployeeRecord(){}", "private RecordImpl(Table tableParent, long lRecord, URI uriTemporaryLobFolder) throws IOException\n\t{\n\t\t_tableParent\t\t\t= tableParent;\n\t\t_lRecord\t\t\t\t= lRecord;\n\t\t_uriTemporaryLobFolder\t= uriTemporaryLobFolder;\n\t\tsetRecordType(_of.createRecordType());\n\t}", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "public void load() throws Throwable\n {\n // addCompositeTypes();\n\n Db typeRecordTable = new Db(null, 0);\n typeRecordTable.set_error_stream(System.err);\n typeRecordTable.set_errpfx(\"Catalog Retrieval Error\");\n typeRecordTable.open(CatalogManager.getCurrentDirectory()+\n File.separator+\n CompositeTypeRecord.databaseFileName, \n null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n \n Db typeFieldRecordTable = new Db(null, 0);\n typeFieldRecordTable.set_error_stream(System.err);\n typeFieldRecordTable.set_errpfx(\"Catalog Retrieval Error\");\n typeFieldRecordTable.open(CatalogManager.getCurrentDirectory()+\n File.separator+\n TypeFieldRecord.databaseFileName, \n null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n \n // Acquire an iterator for the table.\n Dbc outerIterator;\n outerIterator = typeRecordTable.cursor(null, 0);\n \n Dbc innerIterator;\n innerIterator = typeFieldRecordTable.cursor(null, 0);\n \n IntegerDbt outerKey = new IntegerDbt();\n CompositeTypeRecord typeRecord = new CompositeTypeRecord();\n \n while (outerIterator.get(outerKey, typeRecord, Db.DB_NEXT) == 0) {\n typeRecord.parse();\n if (Constants.VERBOSE) System.out.println(typeRecord);\n\t // if(!typeRecord.getIsInferred()) {\n\t\tCompositeType t = new CompositeType(typeRecord.getTypeName(), \n\t\t\t\t\t\t typeRecord.getIsInferred());\n\t\t\n\t\tIntegerArrayDbt innerKey = new IntegerArrayDbt(new int[] {outerKey.getInteger(), 0});\n\t\tTypeFieldRecord typeFieldRecord = new TypeFieldRecord();\n\t\t\n\t\tif (innerIterator.get(innerKey, typeFieldRecord, Db.DB_SET_RANGE) == 0) {\n\t\t int[] indices = innerKey.getIntegerArray();\n\t\t if (indices[0] == outerKey.getInteger()) {\n\t\t\ttypeFieldRecord.parse();\n\t\t\tif (Constants.VERBOSE) System.out.println(typeFieldRecord);\n\t\t\tt.addAttribute(typeFieldRecord.getFieldName(), \n\t\t\t\t findPrimitiveType(typeFieldRecord.getFieldType()),\n\t\t\t\t typeFieldRecord.getSize());\n\t\t\t\n\t\t\twhile (innerIterator.get(innerKey, typeFieldRecord, Db.DB_NEXT) == 0) {\n\t\t\t indices = innerKey.getIntegerArray();\n\t\t\t if (indices[0] != outerKey.getInteger()) break;\n\t\t\t typeFieldRecord.parse();\n\t\t\t if (Constants.VERBOSE) System.out.println(typeFieldRecord);\n\t\t\t t.addAttribute(typeFieldRecord.getFieldName(), \n\t\t\t\t\t findPrimitiveType(typeFieldRecord.getFieldType()),\n\t\t\t\t\t typeFieldRecord.getSize());\n\t\t\t}\n\t\t }\n\t\t}\n\t\taddCompositeType(t);\n\t\t//}\n }\n\n innerIterator.close();\n outerIterator.close();\n typeRecordTable.close(0);\n typeFieldRecordTable.close(0);\n }", "public PurchaseType()\r\n {\r\n }", "DataHRecordData() {}", "RecordType newRecordType(QName name) throws TypeException;", "public MsgSubsidiaryType() {\r\n\t\tsuper();\r\n\t\t// _INDIVIDUALList = new ArrayList();\r\n\t\t_DEALERList = new ArrayList();\r\n\t}", "public FlatRecord newFlatRecord(Catalog catalog)\r\n {\r\n FlatRecord newObj = (FlatRecord)SAP_FlatRecord.newObj((com.informatica.adapter.sdkadapter.patternblocks.catalog.semantic.auto.SAP_Catalog)catalog);\r\n SEMTableRecordExtensions newExtnObj = newSEMTableRecordExtensions(catalog);\r\n newObj.setExtensions(newExtnObj);\r\n return newObj;\r\n }", "private RecordImpl(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\t_tableParent\t= tableParent;\n\t\t_lRecord\t\t= lRecord;\n\t\tif (rt.getAny().size() > 0)\n\t\t{\n\t\t\tElement el = (Element) rt.getAny().get(0);\n\t\t\tif (el.getOwnerDocument() != getDocument())\n\t\t\t{\n\t\t\t\t_doc = el.getOwnerDocument();\n\t\t\t}\n\t\t}\n\t\tsetRecordType(rt);\n\t}", "public TypeMtLexemeFreeformRecord() {\n super(TypeMtLexemeFreeform.TYPE_MT_LEXEME_FREEFORM);\n }", "GetRecordByIdType createGetRecordByIdType();", "public ARecord() {\n super(A.A);\n }", "public T1Record() {\n super(pan.auditdb.tables.T1.T1);\n }", "public ObjectRecord() {\n\t\tsuper(org.jooq.test.hsqldb.generatedclasses.tables.Object.OBJECT);\n\t}", "TransactionType createTransactionType();", "public TesttabRecord() {\n\t\tsuper(org.jooq.h2.generated.tables.Testtab.TESTTAB);\n\t}", "DatatypesType createDatatypesType();", "public FlexData(Type type) {\n entryCollectionList = null;\n entryCollectionMap = null;\n this.type = type;\t\t\n standardDateFormat = \"yyyy-MM-dd\"; // DB2-Datum\n\t}", "MappedDatatype createMappedDatatype();", "StructureType createStructureType();", "public EmployerRecord() {\n super(Employer.EMPLOYER);\n }", "public TBasicSalary(java.lang.String alias) {\n\t\tthis(alias, jooq.model.tables.TBasicSalary.T_BASIC_SALARY);\n\t}", "void createRuntimeRecord(ScriptRuntimeDTO record) throws PersistenceException;", "public TOfferGoodsRecord() {\n super(TOfferGoods.T_OFFER_GOODS);\n }", "public TblrefTemplateRecord() {\n super(TblrefTemplate.TBLREF_TEMPLATE);\n }", "DatatypeType createDatatypeType();", "public abstract ExternalRecord createExternalRecord()\r\n\t\t\tthrows Exception;", "private LDBRecord createRecord(DataHSpecification spec,Hashtable fieldValues)\n\t\tthrows LRException\n\t{\n\t\tclearStatus();\n\t\tif (fieldValues==null) fieldValues=new Hashtable();\n\t\t// Create a new empty record\n\t\tLDBRecord record=new LDBRecord(background.getClient(),spec.getTableName());\n\t\t// Get the fields of the specification\n\t\t// and fill the record from the values passed in.\n\t\t// If a field is not identified create one with a default value.\n\t\tHashtable fields=spec.getFields();\n\t\tEnumeration en=fields.keys();\n\t\twhile (en.hasMoreElements())\n\t\t{\n\t\t\t// Get the field name from the spec\n\t\t\tString name=(String)en.nextElement();\n\t\t\t// Get the field spec for that name\n\t\t\tLDBFieldSpec fieldSpec=(LDBFieldSpec)fields.get(name);\n\t\t\t// See if we have a value for this field.\n\t\t\t// Remember that the keys of fieldValues are LVValues.\n\t\t\tObject value=(LVValue)fieldValues.get(name);\n\t\t\tif (value!=null)\n\t\t\t{\n\t\t\t\tString obj=((LVValue)value).getStringValue();\n\t\t\t\tswitch (fieldSpec.getType())\n\t\t\t\t{\n\t\t\t\tcase LDBFieldSpec.BYTE:\n\t\t\t\t\tvalue=new Byte((byte)LUUtil.getInt(obj));\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.INT:\n\t\t\t\t\tvalue=new Integer(LUUtil.getInt(obj));\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.LONG:\n\t\t\t\t\tvalue=new Long(LUUtil.getLong(obj));\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.CHAR:\n\t\t\t\t\tvalue=obj;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.BINARY:\n\t\t\t\t\tvalue=obj;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No value given so use a sensible default\n\t\t\t\t// depending on the type of the field.\n\t\t\t\tswitch (fieldSpec.getType())\n\t\t\t\t{\n\t\t\t\tcase LDBFieldSpec.BYTE:\n\t\t\t\t\tvalue=new Byte((byte)0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.INT:\n\t\t\t\t\tvalue=new Integer(0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.LONG:\n\t\t\t\t\tvalue=new Long(0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.CHAR:\n\t\t\t\t\tvalue=\"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase LDBFieldSpec.BINARY:\n\t\t\t\t\tvalue=\"\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Add the new field to the record\n\t\t\ttry\n\t\t\t{\n\t\t\t\trecord.addField(fieldSpec,value);\n\t\t\t}\n\t\t\tcatch (LDBException e) { setStatus(e); }\n\t\t}\n\t\treturn record;\n\t}", "RentalObject createRentalObject();", "DCMIRecordType createDCMIRecordType();", "private TradeForDataGen initializeData(String type,String t,String securityName,String securityType, int quantity, double price, String traderName, String brokerName) {\n\t\tTradeForDataGen tempTrade = new TradeForDataGen();\n\t\tTimestamp timestamp = Timestamp.valueOf(t);\n\t\ttempTrade.setType(type);\n\t\ttempTrade.setTimestamp(timestamp);\n\t\ttempTrade.setQuantity(quantity);\n\t\ttempTrade.setBrokerName(brokerName);\n\t\ttempTrade.setPrice(price);\n\t\ttempTrade.setSecurityName(securityName);\n\t\ttempTrade.setTraderName(traderName);\n\t\ttempTrade.setSecurityType(securityType);\n\t\treturn tempTrade;\n\t}", "public com.vodafone.global.er.decoupling.binding.request.PurchaseAttributesType createPurchaseAttributesType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.PurchaseAttributesTypeImpl();\n }", "public SampletypeBean createSampletypeBean()\n {\n return new SampletypeBean();\n }", "RecordTypeRule createRecordTypeRule();", "public com.vodafone.global.er.decoupling.binding.request.DrmObjectFullType createDrmObjectFullType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.DrmObjectFullTypeImpl();\n }", "@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}", "public static Employee createEmployee(int id, String name, double salary, String type) {\n if (type.equals(\"permanent\")) {\n return new PermanentEmployee(id, name, salary);\n } else if (type.equals(\"temporary\")) {\n return new TemporaryEmployee(id, name, salary);\n } else {\n throw new IllegalArgumentException(\"Invalid type for employee\");\n }\n }", "public Item_Record() {\n super(Item_.ITEM_);\n }", "DescribeRecordType createDescribeRecordType();", "public SalesRecords() {\n super();\n }", "FieldsType createFieldsType();", "public ExtTICustomerDetailsPersister() {\n\t\tsetKeyMembers(new MemberDescriptor[] {\n new MemberDescriptor(\"key\", \"EXTICUST.KEY29\", getBinderFactory().getBinderForType(\"Long\")),\n\t\t});\n\t\t\t\n\t\tsetMembers(new MemberDescriptor[] {\n new MemberDescriptor(\"typeFlag\", \"EXTICUST.TYPEFLAG\", getBinderFactory().getBinderForType(\"Integer\")),\n new MemberDescriptor(\"versionStamp\", \"EXTICUST.TSTAMP\", getBinderFactory().getBinderForType(\"Integer\")),\n new MemberDescriptor(\"Initialised\", \"EXTICUST.INITED\", getBinderFactory().getBinderForType(\"Integer\")),\n new MemberDescriptor(\"TICustomerDetails.Key\", \"EXTICUST.TICUST\", getBinderFactory().getBinderForType(\"Long\"), TICustomerDetails.class),\n\t\t});\n\n\t\tsetForeignKeyMappings(new ForeignKeyMappingDescriptor[] {\n\t\t\tnew ForeignKeyMappingDescriptor(\"TICustomerDetails\", TICustomerDetails.class),\n\t\t});\n\t}", "GetRecordsType createGetRecordsType();", "BTable createBTable();", "public ProAddAttrRecord() {\n super(ProAddAttr.PRO_ADD_ATTR);\n }", "public DataRecord() {\n super(DataTable.DATA);\n }", "public com.vodafone.global.er.decoupling.binding.request.TransactionFullType createTransactionFullType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.TransactionFullTypeImpl();\n }", "public OfcRecordRecord() {\n\t\tsuper(org.openforis.collect.persistence.jooq.tables.OfcRecord.OFC_RECORD);\n\t}", "EDataType createEDataType();", "@Override\n protected Type createNewTypeWithoutReflection(int field) {\n return null;\n }", "private static void LessonInheritance() {\n Employee employee1 = new Employee();\n\n //Set Id , firstName and lastName of Employee from Person Class and BaseBO\n employee1.setId(13);\n employee1.setFirstName(\"Jordan(e)\");\n employee1.setLastName(\"Walker(e)\");\n\n //Print info out\n System.out.println(\"Id#\" + employee1.getId() + \" \" + employee1.getFirstName() + \" \" + employee1.getLastName());\n\n //create a Person object and inherit from BaseBO class Id\n Person person3 = new Person();\n person3.setId(7);\n person3.setFirstName(\"Jordan(p)\");\n person3.setLastName(\"Walker(p)\");\n\n System.out.println(\"Id#\" + person3.getId() + \" \" + person3.getFirstName() + \" \" + person3.getLastName());\n }", "public static Record newInstance(Table tableParent, long lRecord, URI uriTemporaryLobFolder) throws IOException\n\t{\n\t\treturn new RecordImpl(tableParent, lRecord, uriTemporaryLobFolder);\n\t}", "public com.vodafone.global.er.decoupling.binding.request.DrmTypeFullType createDrmTypeFullType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.DrmTypeFullTypeImpl();\n }", "UserDefinedType createUserDefinedType();", "public void create(Singer newRecord);", "public Long createRecord(Record object);", "public PaymentRecordKey() {\n super();\n }", "public ItemRecord() {\n super(Item.ITEM);\n }", "private <T extends BaseRecord> T createRecord(\n String data, Stat stat, Class<T> clazz) throws IOException {\n T record = newRecord(data, clazz, false);\n record.setDateCreated(stat.getCtime());\n record.setDateModified(stat.getMtime());\n return record;\n }", "public JStudentInfoRecord() {\n super(JStudentInfo.STUDENT_INFO);\n }", "public ActHiDetailRecord() {\n super(ActHiDetail.ACT_HI_DETAIL);\n }", "public SampletypeBean decodeRow(ResultSet rs) throws SQLException\n {\n SampletypeBean pObject = createSampletypeBean();\n pObject.setSampletypeid(Manager.getInteger(rs, 1));\n pObject.setName(rs.getString(2));\n pObject.setCompanyid(Manager.getInteger(rs, 3));\n\n pObject.isNew(false);\n pObject.resetIsModified();\n\n return pObject;\n }", "QuoteTypeAttr createQuoteTypeAttr();", "private void init() {\n FieldWrapper id = new FieldWrapper();\n id.fieldDescription = new HashMap<String, Object>();\n id.fieldDescription.put(\"fullName\", \"Id\");\n id.fieldDescription.put(\"type\", \"Text\");\n\n FieldWrapper name = new FieldWrapper();\n name.fieldDescription = new HashMap<String, Object>();\n name.fieldDescription.put(\"fullName\", \"Name\");\n\n FieldWrapper createdBy = new FieldWrapper();\n createdBy.fieldDescription = new HashMap<String, Object>();\n createdBy.fieldDescription.put(\"fullName\", \"CreatedBy\");\n createdBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper lastModifiedBy = new FieldWrapper();\n lastModifiedBy.fieldDescription = new HashMap<String, Object>();\n lastModifiedBy.fieldDescription.put(\"fullName\", \"LastModifiedBy\");\n lastModifiedBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper owner = new FieldWrapper();\n owner.fieldDescription = new HashMap<String, Object>();\n owner.fieldDescription.put(\"fullName\", \"Owner\");\n owner.fieldDescription.put(\"type\", \"Lookup\");\n\n fieldDescribe = new HashMap<String, FieldWrapper>();\n\n fieldDescribe.put((String) id.fieldDescription.get(\"fullName\"), id);\n fieldDescribe.put((String) name.fieldDescription.get(\"fullName\"), name);\n fieldDescribe.put((String) createdBy.fieldDescription.get(\"fullName\"), createdBy);\n fieldDescribe.put((String) lastModifiedBy.fieldDescription.get(\"fullName\"), lastModifiedBy);\n fieldDescribe.put((String) owner.fieldDescription.get(\"fullName\"), owner);\n }", "public Type() {\n super();\n }", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "protected BlankRecord(Cell c)\r\n/* 25: */ {\r\n/* 26: 72 */ super(Type.BLANK, c);\r\n/* 27: */ }", "public Person(String name, String surname, String phoneNumber, Boolean loyaltyCard, Double salary) {\n setName(name);\n setSurname(surname);\n setPhoneNumber(phoneNumber);\n\n addPersonTypes(PersonType.CLIENT);\n addPersonTypes(PersonType.WORKER);\n\n setLoyaltyCard(loyaltyCard);\n setSalary(salary);\n }", "RecordInfo clone();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "public Record() {\n data = new int[DatabaseManager.fieldNames.length];\n }", "public void save() throws Throwable\n {\n String typeFilename = \n CatalogManager.getCurrentDirectory()+\n File.separator+\n CompositeTypeRecord.databaseFileName;\n\n String fieldFilename =\n CatalogManager.getCurrentDirectory()+\n File.separator+\n TypeFieldRecord.databaseFileName;\n\n new File(typeFilename).delete();\n new File(fieldFilename).delete();\n\n Db typeRecordTable = new Db(null, 0);\n typeRecordTable.set_error_stream(System.err);\n typeRecordTable.set_errpfx(\"Catalog Save Error\");\n typeRecordTable.open(typeFilename, null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n\n Db typeFieldRecordTable = new Db(null, 0);\n typeFieldRecordTable.set_error_stream(System.err);\n typeFieldRecordTable.set_errpfx(\"Catalog Save Error\");\n typeFieldRecordTable.open(fieldFilename, null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n\n CompositeType[] compositeTypes = getAllCompositeTypes();\n\n if (compositeTypes != null) {\n for (int i = 0; i < compositeTypes.length; i++) {\n CompositeType type = compositeTypes[i];\n IntegerDbt key = new IntegerDbt(type.getId());\n CompositeTypeRecord typeRecord = new CompositeTypeRecord(type.getId(), \n type.getName(), \n type.getNumberOfAttributes(),\n\t\t\t\t\t\t\t\t\t type.getIsInferred());\n if (typeRecordTable.put(null, key, typeRecord, 0) == Db.DB_KEYEXIST) \n System.out.println(\"The key already exists.\");\n int offset = 0;\n \n for (int j = 0; j < type.getNumberOfAttributes(); j++) {\n Type t = type.getAttributeType(j);\n if (t.isPrimitive()) {\n int size = type.getAttributeLength(j);\n IntegerArrayDbt innerKey = new IntegerArrayDbt(new int[] {type.getId(), j});\n \n int fieldType = 0;\n\n PrimitiveType primitiveType = (PrimitiveType) t;\n fieldType = primitiveType.getTypeId();\n\n TypeFieldRecord typeFieldRecord = new TypeFieldRecord(type.getId(), \n j, \n type.getAttributeName(j), \n fieldType,\n offset,\n size);\n offset += size;\n if (typeFieldRecordTable.put(null, innerKey, typeFieldRecord, 0) == Db.DB_KEYEXIST) \n System.out.println(\"The key already exists.\");\n }\n }\n }\n if (Constants.VERBOSE) System.out.println(\"\" + compositeTypes.length + \n\t\t\t\t\t\t \" types are recorded.\");\n } \n typeRecordTable.close(0);\n typeFieldRecordTable.close(0);\n }", "public DbRecord()\n {\n m_UserName = \"\";\n // Generate user's unique identifier\n m_Key = new byte[16];\n java.util.UUID guid = java.util.UUID.randomUUID();\n long itemHigh = guid.getMostSignificantBits();\n long itemLow = guid.getLeastSignificantBits();\n for( int i = 7; i >= 0; i-- )\n {\n m_Key[i] = (byte)(itemHigh & 0xFF);\n itemHigh >>>= 8;\n m_Key[8+i] = (byte)(itemLow & 0xFF);\n itemLow >>>= 8;\n }\n m_Template = null;\n }" ]
[ "0.75518185", "0.616906", "0.612633", "0.59795845", "0.59569216", "0.58264154", "0.57756937", "0.5754077", "0.5580386", "0.5529916", "0.54698044", "0.54579496", "0.54396814", "0.53819275", "0.5365728", "0.53113186", "0.53020483", "0.52919877", "0.529154", "0.52842015", "0.5267399", "0.52521825", "0.523577", "0.5221356", "0.5215534", "0.5212611", "0.5202079", "0.5200721", "0.51994956", "0.5192664", "0.51917994", "0.51654917", "0.5157798", "0.51458246", "0.51359445", "0.51188284", "0.5110899", "0.50903153", "0.5078384", "0.50561196", "0.5052746", "0.50470823", "0.5042479", "0.50394624", "0.5021137", "0.49976018", "0.4994405", "0.4990691", "0.49727693", "0.49567702", "0.49503693", "0.49501607", "0.4945565", "0.4937807", "0.4927191", "0.49119994", "0.49115628", "0.49079442", "0.4896137", "0.4894627", "0.4884976", "0.48792163", "0.4878976", "0.48758456", "0.4868121", "0.48637435", "0.48617366", "0.4854611", "0.48522943", "0.48457414", "0.48403627", "0.48398045", "0.4815858", "0.4815251", "0.4811426", "0.48099455", "0.48068532", "0.48067185", "0.48009554", "0.47980264", "0.47954792", "0.47942293", "0.47920674", "0.4784607", "0.47695684", "0.4765593", "0.47648922", "0.47636497", "0.47614783", "0.47610608", "0.47599706", "0.47556287", "0.4749253", "0.47478506", "0.4745034", "0.47341758", "0.47315115", "0.4729996", "0.4727581", "0.4719231" ]
0.6652895
1
Reduces the number of points GFA smears to allow it to be represented on three 65character lines of text. The point reduction goes through two phases: Phase I It first tries to remove allowable points, one at a time, based on the impact their individual removal would have on the size of the polygon. Specifically, remove points that increase the size of the polygon the least, while not increasing the overall size of the polygon SMEAR_INCREASE_PCT and not allowing any new points to be SMEAR_INCR_DST distance from the original polygon points. The parameters SMEAR_INCREASE_PCT and SMEAR_INCR_DST are set in prefs.tbl. SMEAR_INCREASE_PCT refers to the area percentage increase when a single point is removed from the polygon. Point reduction continues until the polygon can be represented on three 65character lines of text, or no more points can be removed under the above criteria. Phase II If the polygon still cannot be formatted on three 65character lines, logically divide it into two or more sections: 1. FA Area Boundary Clip: First, try to divide the polygon along the FA Area boundary. If this can be accomplished, check the overall size of each part. Any part less than 3K sq nm will remain with the larger portion; any part greater than 3K sq nm will become another AIRMET. Note that the areal clipping behaves the same as the regional clipping and we should make intact the boundary between two FA areas, which means if a polygon is clipped into two sections in two areas, they must share the exact same points along the boundary. 2. Simple Bisection: Check the results from the FA Area Boundary Bisection. Any section that cannot be formatted in three 65character lines of text must be divided. Choose as a dividing segment the two closest opposite points in the polygon array which also does not intersect any part of the polygon. Determine the midpoint of this segment and snap to the closest snap point. Bisect the polygon using this threepoint segment into two new AIRMET polygons. Again, check to make sure these two polygons can be formatted. If not, redivide again except without a midpoint. Two bisections should be sufficient to format correctly. If not, the user must break it up manually (training issue). Note: new smears may be created and added in this routine.
public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) { ArrayList<Gfa> smearList = new ArrayList<Gfa>(); // Do area clipping and bisection for each smear. for ( Gfa gg : glist ) { smearList.addAll( reducePoints( gg, snapshots ) );; } // Replace the smear list with the new list. glist.clear(); glist.addAll( smearList ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Gfa> reducePoints( Gfa smear, ArrayList<Gfa> snapshots ) {\n\t\t\t\t\n\t\tArrayList<Gfa> glist = new ArrayList<Gfa>();\n \n\t\t/*\n\t\t * Step 1 - reduce points on the whole smear polygon. Note that freezing level \n\t\t * contours are point reduced in af_fzlvl2fmt().\n\t\t */ \t\t\n\t\tGfa tSmear = regularPointReduction( smear );\n\t\t\n\t\t/*\n\t\t * Create a smear with the reduced points and return if the smear can be \n\t\t * formatted into 3-line text now.\n\t\t */\n\t\tif ( canBeFormatted( tSmear ) ) {\n\t\t smear.setPointsOnly( tSmear.getPoints() );\n\t\t smear.setReduceFlags( tSmear.getReduceFlags() );\n\t\t glist.add( smear );\n\t\t return glist;\n\t\t}\n \t\t\t\t\t\n\t\t/*\n\t\t * Step 2 - Do area clipping to split up the ORIGINAL smear \n\t\t * \t\t\talong area boundary, if needed.\n\t\t */\n\t\tArrayList<Gfa> listOfAreaClip = new ArrayList<Gfa>();\n\t\tlistOfAreaClip.addAll( faAreaClip( smear, snapshots ) );\n\t\t\n\t\t// Step 3 - Do first round of bisection, if necessary. \t\t\n\t\tArrayList<Gfa> listOfFirstBisect = new ArrayList<Gfa>();\t\t\n\t\tfor ( Gfa gg : listOfAreaClip ) {\t\t \t\t\t\n\t\t\t\n\t\t\t//First do point reduction on each of the clipped smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\n \t\tgg.setPointsOnly( tmpSmear.getPoints() );\n \t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n if ( canBeFormatted( tmpSmear ) ) {\n glist.add( gg ); \t\n }\n else {\n listOfFirstBisect.addAll( bisect( gg, true ) );\n }\n\t\t}\n\t\t\n\t\t//See if any middle point are generated in bisection.\n\t\tCoordinate midPt = null;\n\t\tif ( listOfFirstBisect.size() > 0 ) {\n\t\t midPt = (Coordinate)listOfFirstBisect.get(0).getAttribute( BISECT_MIDDLE_POINT );\n\t\t}\n\t\t\n\t\t// Step 4 - Do second round of bisection, if necessary. \n\t\tfor ( Gfa gg : listOfFirstBisect ) {\t\t \n\t\t\t\n\t\t\t//First do point reduction on each of the bisected smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\t\t\t\t\t\t\n\t\t\tgg.setPointsOnly( tmpSmear.getPoints() );\n\t\t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n\t\t\tif ( canBeFormatted( tmpSmear ) ) {\n\t\t\t\tglist.add( gg ); \n\t\t\t}\n\t\t\telse { \n\t\t\t\t//Another round of bisect, done.\n\t\t\t\tglist.addAll( bisect( gg, false) );\n\t\t\t}\n\t\t}\t\t\n\n\t\t\n\t\t//\n\t\t// If bisection happens, check if the middle point generated in the first round\n\t\t// has been used for the second round. If not, remove the middle point from \n\t\t// all smears.\n\t\t//\n\t\tboolean removeMidPt = false;\n\t\tif ( midPt != null ) {\n\t\t\tint ii = 0;\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tii++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ii < 3 ) {\n\t\t\t\tremoveMidPt = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( removeMidPt ) {\n\t\t\t\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tCoordinate removePt = null;\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tremovePt = cc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( removePt != null ) gg.getPoints().remove( removePt ) ;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn glist;\n\n\t}", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private Gfa regularPointReduction( Gfa smearIn ) {\n\t\t\n\t\tArrayList<Coordinate> xyList = new ArrayList<Coordinate>( smearIn.getPoints() );\n\t List<Integer> reduceFlg = new ArrayList<Integer>(); \n\t List<Integer> orig = new ArrayList<Integer>();\n\t\t\n\t boolean[] reduceF = smearIn.getReduceFlags();\n\t\t\t \t \n\t for ( int ii = 0; ii < reduceF.length; ii++ ) {\n\t\t\t\n\t\t\tif ( reduceF[ ii ] ) {\n\t\t\t\treduceFlg.add( 1 );\n\t\t\t}\n\t\t\telse {\n\t\t\t\treduceFlg.add( 0 );\n\t\t\t}\n\t\t\t\n\t\t\torig.add( 1 );\n\t\t}\n\n\t /*\n\t for ( int ii = 0; ii < smearIn.getPoints().size(); ii++ ) {\n\t\t\tSystem.out.println( \"Point \" + ii + \" (\" + smearIn.getPoints().get( ii ).x + \",\" +\n\t\t\t\t\tsmearIn.getPoints().get( ii ).y + \") is \" + reduceFlg.get(ii) );\n\t\t}\n\t\t*/\t\t\t\n\t\tdouble incrPct = SMEAR_INCR_PCT;\n\t\tdouble incrPctOrig = REDUCEPTS_INCR_PCT_ORIG;\n\t\tdouble incrDst = SMEAR_INCR_DST;\n\t\t\n\t String prefix = getPrefixString( smearIn );\n\n\t int ier = ReduceGfaPoints.reduceByPctDist( xyList, reduceFlg, orig, \n\t\t\t\t incrPct, incrPctOrig, incrDst, prefix );\n \n\t\tboolean[] reduceFl = new boolean[ xyList.size() ];\n\t\tfor (int ii = 0; ii < xyList.size(); ii++ ) {\n\t\t\tif ( reduceFlg.get( ii ) == 1 )\n\t\t\t\treduceFl[ ii ] = true;\n\t\t\telse\n\t\t\t\treduceFl[ ii ] = false;\n\t\t}\n\t\t\n\t\tGfa newSmear = smearIn.copy();\n\t newSmear.setPointsOnly( xyList );\n\t newSmear.setReduceFlags( reduceFl );\n\t\t\n\t\treturn newSmear;\n\n\t}", "private ArrayList<Gfa> faAreaClip( Gfa smear, ArrayList<Gfa> snapshots ) {\n \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t\t//If smear can be formatted, return.\n\t\tif ( canBeFormatted( smear ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\n\t\t/*\n\t\t * If the smear resides only in one FA area or two areas belong to different \n\t\t * FA regions, no need to clip. \n\t\t */\n\t\tString faAreas = smear.getGfaArea();\n\t\tif ( !faAreas.contains( \"-\" ) ||\n\t\t\t !isSameFaRegion( faAreas ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t\t\n\n\t\t// Retrieve extended FA area bounds\n\t\tHashMap<String, Geometry> xareaBnds = GfaClip.getInstance().getFaAreaXBoundsInGrid();\n\n\t\t\n\t\t/*\n\t\t * Find the intersection points with the extended FA area bounds and snap them. \n\t\t */\n\t\tPolygon smearPoly = GfaClip.getInstance().gfaToPolygon( smear );\n\t\tPolygon smearPolyInGrid = GfaClip.getInstance().gfaToPolygonInGrid( smear );\n\t\tHashMap<Coordinate, Coordinate> areaInterPts = getAreaIntersectionPt( smearPoly );\n\n\t\t/*\n\t\t * Do area clipping. The strategy is the same as regional clipping.\n\t\t * \n\t\t * 1. clip the smear polygon against each FA region (WEST, CENTRAL, EAST)\n\t\t * 2. create a list of parts bigger than/equal to 3K for each region\n\t\t * 3. hold the parts smaller than 3K for all regions in another list. \n\t\t */\n\t\tHashMap<String, ArrayList<Geometry> > clipWithAreas = new HashMap<String, ArrayList<Geometry> >(); \n\n\t\tArrayList<Geometry> smallPoly = new ArrayList<Geometry>(); \n\n\t\tfor ( String areaName : xareaBnds.keySet() ) {\n\n\t\t\tif ( !faAreas.contains( areaName ) ) continue;\n\n\t\t\tclipWithAreas.put( areaName, new ArrayList<Geometry>() );\n\n\t\t\t//Do area clipping as described above.\n\t\t\tGeometry areaBnd = xareaBnds.get( areaName );\t\t\t\t \n\t\t\tif ( areaBnd.intersects( smearPolyInGrid ) ) {\n\n\t\t\t\tGeometry areaPoly = areaBnd.intersection( smearPolyInGrid );\t\n\n\t\t\t\tif ( areaPoly != null ) {\t\t\t\t\t \t\t\t\t\t\t\t\n\t\t\t\t\tfor ( int kk = 0; kk < areaPoly.getNumGeometries(); kk++ ) {\t\t\t\t\t \t \n\t\t\t\t\t\tGeometry bigPoly = areaPoly.getGeometryN( kk );\t\t\t\t\t \t \n\n\t\t\t\t\t\tif ( GfaClip.getInstance().isBiggerInGrid( bigPoly ) ) {\t\t\t\t\t \t\n\t\t\t\t\t\t\tclipWithAreas.get( areaName ).add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tsmallPoly.add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\t \n\n\t\t}\t\t\t\t\t\t\t\t\n\n\t\t/*\n\t\t * Create smears from VALID parts and add into the return list\n\t\t * \n\t\t * 1. Union the parts in each FA region with the list of small parts -\n\t\t * If a small part touches one of the bigs (only one, I believe), it\n\t\t * will be united into that big and thus be included into a new\n\t\t * smear. So no part gets lost and all will be included eventually.\n\t\t * 2. When a small part is united into a big one (if they intersect), \n\t\t * the common points are still retained in the result, we need to \n\t\t * remove those extra point. The common points are resulted from the\n\t\t * previous clipping with the area boundaries.\n\t\t * 3. check the resulting union for VALID geometries and create new\n\t\t * smears for each of them.\t \t\t\t\n\t\t */\n\t\tfor ( String areaName : clipWithAreas.keySet() ) {\n\n\t\t\tArrayList<Geometry> bigs = clipWithAreas.get( areaName );\n\n\t\t\tArrayList<Geometry> toBeUnioned = new ArrayList<Geometry>();\n\t\t\ttoBeUnioned.addAll( bigs );\n\t\t\ttoBeUnioned.addAll( smallPoly );\n\t\t\tGeometry result = GfaClip.getInstance().quickUnion( toBeUnioned ); \t\t\t\n\n\t\t\tArrayList<Coordinate> commPts = GfaClip.getInstance().getCommonPoints( bigs, smallPoly );\n\n\t\t\tif ( result != null ) {\t\t \n\n\t\t\t\tfor ( int kk = 0; kk < result.getNumGeometries(); kk++ ) {\n\n\t\t\t\t\tGeometry one = result.getGeometryN( kk );\n\n\t\t\t\t\t//Remove residue points by clipping followed by subsequent union.\n\t\t\t\t\tGeometry onePart = GfaClip.getInstance().removeCommonPoints( one, commPts );\n\n\t\t\t\t\t//Clean up some improper cases\n\t\t\t\t\tCoordinate[] gPts = PgenUtil.gridToLatlon( onePart.getCoordinates() );\n\t\t\t\t\tArrayList<Coordinate> points = new ArrayList<Coordinate>();\n\t\t\t\t\tfor ( Coordinate c : gPts ) {\n\t\t\t\t\t\tpoints.add( c );\n\t\t\t\t\t}\n\t\t\t\t\tpoints.remove( points.size() - 1 );\n\n\t\t\t\t\t//Geometry cleanPts = GfaClip.getInstance().cleanupPoints( onePart );\n\t\t\t\t\t\n\t\t\t\t\tGeometry cleanPts = GfaClip.getInstance().cleanupPoints( \n\t\t\t\t\t\t\t GfaClip.getInstance().pointsToGeometry( points ) );\n\n\t\t\t\t\tif ( GfaClip.getInstance().isAddableAsSmear( cleanPts, snapshots, smear ) ) {\n\n\t\t\t\t\t\t//Replace intersection points with their pre-snapped pair.\n\t\t\t\t\t\tGeometry rplPts = GfaClip.getInstance().replacePts( cleanPts, areaInterPts );\n\n\t\t\t\t\t\t//Create a new GFA smear.\n\t\t\t\t\t\tcleanPts = GfaClip.getInstance().cleanupPoints( rplPts );\n\t\t\t\t\t\t\n\t\t\t\t\t\tGfa newElm = GfaClip.getInstance().geometryToGfa( smear, cleanPts );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tnewElm.setGfaArea( areaName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewSmears.add( newElm );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( Gfa gg : newSmears ) {\n\t\t boolean[] reduFlg = new boolean[ gg.getPoints().size() ];\n\t\t\tint ii = 0;\n\t\t for ( Coordinate newPt : gg.getPoints() ) {\n\t\t \treduFlg[ ii ] = false;\n\t\t \t\n\t\t \tfor ( int jj = 0; jj < smear.getPoints().size(); jj++ ) {\n\t\t \t\tif ( GfaSnap.getInstance().isSamePoint( newPt, \n\t\t \t\t\t\t smear.getPoints().get( jj ), GfaSnap.MAP_PRECISION ) ) {\n\t\t \t\t\treduFlg[ ii ] = smear.getReduceFlags()[ jj ];\n\t\t \t\t\tbreak;\t\t \t\t\t\n\t\t \t\t}\n\t\t \t}\n\t\t \tii++;\n\t\t }\n\t\t\t\n\t\t\tgg.setReduceFlags( reduFlg ); \n\t\t}\n\t\t\t\t\t\t\t\t\n\t\treturn newSmears;\n\t\n }", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "private ArrayList<Vertex> truncateHeadAtConflictArea(ArrayList<Vertex> vertices) {\n \t\tPoint2D.Double polygon[] = new Point2D.Double[conflictArea.size()];\r\n \t\tfor (int i = conflictArea.size(); --i >= 0; )\r\n \t\t\tpolygon[i] = conflictArea.get(i).getPoint();\r\n \t\tArrayList<Vertex> result = new ArrayList<Vertex>();\r\n \t\tresult.add(vertices.get(0));\r\n \t\tPoint2D.Double prevPoint = null;\r\n \t\tfor (Vertex v : vertices) {\r\n \t\t\tPoint2D.Double p = v.getPoint();\r\n \t\t\tif (null != prevPoint) {\r\n \t\t\t\tLine2D.Double line = new Line2D.Double(prevPoint, p);\r\n \t\t\t\tdouble closest = Double.MAX_VALUE;\r\n \t\t\t\tPoint2D.Double replacementPoint = null;\r\n \t\t\t\tArrayList<Point2D.Double> intersections = Planar.lineIntersectsPolygon(line, polygon);\r\n \t\t\t\t// find intersections with the polygon\r\n \t\t\t\tfor (Point2D.Double intersection : intersections) {\r\n \t\t\t\t\t// if statement added \r\n \t\t\t\t\tif (intersection != null) {\r\n \t\t\t\t\t\tdouble distance = intersection.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = intersection;\r\n \t\t\t\t\t\t\tclosest = distance;\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// find very near misses with the polygon\r\n \t\t\t\tfor (Point2D.Double pp : polygon) {\r\n \t\t\t\t\tif (Planar.distanceLineSegmentToPoint(line, pp) < veryClose) {\r\n \t\t\t\t\t\tdouble distance = pp.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = pp;\r\n \t\t\t\t\t\t\tclosest = distance;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (null != replacementPoint) {\r\n \t\t\t\t\tresult.clear();\r\n \t\t\t\t\tresult.add(new Vertex(replacementPoint, z));\r\n \t\t\t\t}\r\n \t\t\t\tresult.add(v);\r\n \t\t\t}\r\n \t\t\tprevPoint = p;\r\n \t\t}\t\t\r\n \t\treturn result;\r\n \t}", "private void clipFeatureUsing(final SimpleFeature featureToClip,\n final CoordinateReferenceSystem featureToClipCrs,\n final Geometry clippingGeometryOnMap,\n final CoordinateReferenceSystem mapCrs) \n throws SOProcessException {\n\n try {\n Geometry featureGeometryToClip = (Geometry) featureToClip.getDefaultGeometry();\n\n // iterate in the feature's geometries to clip and applies the delete, split or difference operation\n // using the clipping geometry\n int resultGeomSize = featureGeometryToClip.getNumGeometries();\n List<Geometry> resultClipGeom = new ArrayList<Geometry>(resultGeomSize);\n \n for( int i = 0; i < featureGeometryToClip.getNumGeometries(); i++ ) {\n \n Geometry simpleGeomToClip = featureGeometryToClip.getGeometryN(i);\n\n Geometry featureGeometryOnMapCrs = GeoToolsUtils.reproject(simpleGeomToClip,\n featureToClipCrs, \n mapCrs);\n // Analyses the geometry's positon\n if (clippingGeometryOnMap.contains(featureGeometryOnMapCrs)) {\n \n continue; // it will be deleted from target (if \"to clip layer\" is equal to target layer) \n // or does not add this geometry to result\n\n } else if (splits(clippingGeometryOnMap, featureGeometryOnMapCrs)) {\n\n Geometry splitGeom = computeGeometrySplit(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(splitGeom);\n\n } else if (clippingGeometryOnMap.intersects(featureGeometryOnMapCrs)) {\n\n Geometry diffGeom = computeGeometryDifference(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(diffGeom);\n }\n }\n //postcondition: {resultClipGeom is a Collection with Geometries modified with difference, deleted and splited geom (new geom) }\n GeometryFactory factory = featureGeometryToClip.getFactory();\n \n GeometryCollection resultCollection = factory.createGeometryCollection(resultClipGeom.toArray(new Geometry[]{}));\n\n updateTargetWith(featureToClip, resultCollection);\n \n } catch (Exception e) {\n LOGGER.severe(e.getMessage());\n throw new SOProcessException(Messages.ClipProcess_failed_executing_reproject);\n }\n\n }", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "static long[] q3PolyMul(int maxDistanceLeft, ThreadVariables t){\n\n //precomputation is as simple as running distTo cutoff 1 with bases less than the multiplcity, and it is equivalent by wilf inversion\n\n long[] all = allWaysCache(123);\n long[] currentContains = new long[maxDistanceLeft + 1];\n System.arraycopy(all,0,currentContains,0,maxDistanceLeft + 1);\n Polynomial[] shifts = generateShiftsPolyMethod(maxDistanceLeft, t);\n //Polynomial[] correctShifts = generateShiftsHardcoded(maxDistanceLeft, t);\n //Polynomial[] shifts = correctShifts;\n for (int i = 1; i < 8; i++){\n //System.out.println(correctShifts[i]);\n System.out.println(shifts[i]);\n }\n //I think indexes could be designed so 7-index is index in other array due to symmetry of complements\n\n\n subtract(currentContains, shifts[1].productWith(allWaysCache(23), maxDistanceLeft));\n subtract(currentContains, shifts[2].productWith(allWaysCache(13), maxDistanceLeft));\n subtract(currentContains, shifts[3].productWith(allWaysCache(12), maxDistanceLeft));\n //System.out.print(\"Poly: Values after first removal: \");\n //printArray(currentContains);\n\n //it might be possible to modify these to avoid doing the last exclusion\n\n add(currentContains, shifts[4].trivialProductWith(3, maxDistanceLeft));\n add(currentContains, shifts[5].trivialProductWith(2, maxDistanceLeft));\n add(currentContains, shifts[6].trivialProductWith(1, maxDistanceLeft));\n //System.out.print(\"Poly: Values after second removal: \");\n //printArray(currentContains);\n subtract(currentContains, shifts[7].getFullArray(maxDistanceLeft));\n //System.out.println(shifts[7]);\n //System.out.print(\"Poly: final values: \");\n //printArray(currentContains);\n return currentContains;\n }", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "public void calculateCG() {\n\n\t\t//-------------------------------------------------------------\n\t\t// Lateral faces xCG calculation (LFR = Local Reference Frame):\n\t\tList<Double[]> xCGLateralFacesLFRList = new ArrayList<Double[]>();\n\t\t\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) {\n\t\t\t\n\t\t\tDouble[] xCGLateralFacesLFR = new Double[4];\n\t\t\t\n\t\t\txCGLateralFacesLFR[0] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[1] = this._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtSecondarySpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[2] = this._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtSecondarySpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i+1).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFR[3] = this._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1).times(2))\n\t\t\t\t\t\t\t\t\t\t\t.divide(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis._thicknessAtMainSpar.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._thicknessAtMainSpar.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsLength.get(i).divide(3))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue();\n\t\t\t\n\t\t\txCGLateralFacesLFRList.add(xCGLateralFacesLFR);\n\t\t}\n\t\t\n\t\t//-------------------------------------------------------------\n\t\t// Calculation of the Xcg coordinates of each prismoid in wing LRF.\n\t\t\n\t\tList<Amount<Length>> xCGPrismoidsList = new ArrayList<Amount<Length>>();\n\t\t\n\t\tfor(int i=0; i<xCGLateralFacesLFRList.size(); i++) {\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceSpanwiseY = new double[2];\n\t\t\t\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseX = new double[2];\n\t\t\tdouble[] xCGSegmentOppositeFaceChordwiseY = new double[2];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceSpanwiseX[0] = this._fuelTankStations.get(i).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseX[1] = this._fuelTankStations.get(i+1).doubleValue(SI.METER);\n\t\t\txCGSegmentOppositeFaceSpanwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[0];\n\t\t\txCGSegmentOppositeFaceSpanwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._fuelTankStations.get(i+1).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.plus(this._wingChordsAtFuelTankStations.get(i+1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.times(_theWing.getMainSparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER) + xCGLateralFacesLFRList.get(i)[2];\n\n\t\t\txCGSegmentOppositeFaceChordwiseX[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[3]; \n\t\t\txCGSegmentOppositeFaceChordwiseX[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t + xCGLateralFacesLFRList.get(i)[1];\n\t\t\t\n\t\t\txCGSegmentOppositeFaceChordwiseY[0] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[3])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\txCGSegmentOppositeFaceChordwiseY[1] = this._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getXLEAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t).doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ((this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getSecondarySparDimensionlessPosition())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- (this._theWing.getChordAtYActual(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis._theWing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getYBreakPoints().get(i)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue(SI.METER)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ xCGLateralFacesLFRList.get(i)[1])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t* _theWing.getMainSparDimensionlessPosition()));\n\n\t\t\t// check if the chordwise X array is monotonic increasing\n\t\t\tif(xCGSegmentOppositeFaceChordwiseX[1] - xCGSegmentOppositeFaceChordwiseX[0] < 0.0001)\n\t\t\t\txCGSegmentOppositeFaceChordwiseX[0] -= 0.0001; \n\t\t\t\n\t\t\t// now that the segments coordinates are calculated, we have to intersect these latter.\n\t\t\txCGPrismoidsList.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tMyMathUtils.getInterpolatedValue1DLinear(\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseX,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceSpanwiseY,\n\t\t\t\t\t\t\t\t\txCGSegmentOppositeFaceChordwiseX[0]),\n\t\t\t\t\t\t\tSI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n xCG list = \" + xCGPrismoidsList);\n\t\t\n\t\t_xCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\t_xCGLRF = _xCGLRF.plus(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsVolumes.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t*xCGPrismoidsList.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t, SI.METER\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t_xCGLRF = _xCGLRF.divide(this._fuelVolume.divide(2).getEstimatedValue());\n\t\t_xCG = _xCGLRF.plus(_theWing.getXApexConstructionAxes());\n\t\t\n\t\t_yCGLRF = Amount.valueOf(0.0, SI.METER);\n\t\t_yCG = Amount.valueOf(0.0, SI.METER);\n\t\t\n\t\t_zCGLRF = _theWing.getTheBalanceManager().getCG().getZLRF();\n\t\t_zCG = _theWing.getTheBalanceManager().getCG().getZBRF();\n\t\t\n\t\t_cG = new CenterOfGravity();\n\t\t_cG.setX0(_theWing.getXApexConstructionAxes().to(SI.METER));\n\t\t_cG.setY0(_theWing.getYApexConstructionAxes().to(SI.METER));\n\t\t_cG.setZ0(_theWing.getZApexConstructionAxes().to(SI.METER));\n\t\t_cG.setXLRF(_xCGLRF.to(SI.METER));\n\t\t_cG.setYLRF(_yCGLRF.to(SI.METER));\n\t\t_cG.setZLRF(_zCGLRF.to(SI.METER));\n\t\t\n\t\t_cG.calculateCGinBRF(ComponentEnum.FUEL_TANK);\n\t\t\n\t}", "private final Geometry computeGeometryDifference( \n Geometry featureGeometryOnMap, \n Geometry clippingGeometryOnMap,\n CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n\n // assert: clipping does not contains featrue's geometry but intersect\n FeatureStore<SimpleFeatureType, SimpleFeature> store = getTargetStore();\n \n final SimpleFeatureType featureType = store.getSchema();\n final CoordinateReferenceSystem targetLayerCrs = featureType.getDefaultGeometry()\n .getCRS();\n Geometry resultGeometry = null;\n try {\n \n if (!featureGeometryOnMap.contains(clippingGeometryOnMap)) {\n\n // clipping does not contain the feature and features does not contain clipping area\n // then constructs the following difference: feature'geometry - clipping area\n\n Geometry diffGeometry = featureGeometryOnMap.difference(clippingGeometryOnMap);\n\n Geometry adjustedGeom = GeoToolsUtils.reproject(diffGeometry, mapCrs, targetLayerCrs);\n \n resultGeometry = adjustedGeom;\n } else {\n // Note: if the condition is false, feature's geometry could contain clipping\n // then feature with hole is required. This process does not produce hole geometry.\n resultGeometry = featureGeometryOnMap;\n }\n return resultGeometry;\n\n } catch (OperationNotFoundException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_executing_reproject,\n mapCrs.getName(), targetLayerCrs.getName());\n \n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n\n } catch (TransformException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_transforming,\n mapCrs.getName(), targetLayerCrs.getName());\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n\n }", "private primitives.Color AdaptiveDiffusedAndGlossyRec(Point3D centerP, double WidthAndHeight, double minCubeSize, Point3D pIntersection,Vector Vright,Vector Vup , Vector normal, int direction, int level , double k, double ktr, List<Point3D> prePoints) throws Exception {\r\n List<Point3D> nextCenterPList = new LinkedList<Point3D>();\r\n List<Point3D> cornersList = new LinkedList<Point3D>();\r\n List<primitives.Color> colorList = new LinkedList<primitives.Color>();\r\n Point3D tempCorner;\r\n GeoPoint gp;\r\n Ray tempRay;\r\n for (int i = -1; i <= 1; i += 2)\r\n for (int j = -1; j <= 1; j += 2) {\r\n tempCorner = centerP.add(Vright.scale(i * WidthAndHeight / 2)).add(Vup.scale(j * WidthAndHeight / 2));\r\n cornersList.add(tempCorner);\r\n if (prePoints == null || !isInList(prePoints, tempCorner)) {\r\n tempRay = new Ray(pIntersection, tempCorner.subtract(pIntersection), normal);\r\n if ((normal.dotProduct(tempRay.getDir()) < 0 && direction == 1) || (normal.dotProduct(tempRay.getDir()) > 0 && direction == -1)) {\r\n nextCenterPList.add(centerP.add(Vright.scale(i * WidthAndHeight / 4)).add(Vup.scale(j * WidthAndHeight / 4)));\r\n gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n colorList.add(scene.background);\r\n else {\r\n colorList.add(calcColor(gp, tempRay, level - 1, k));\r\n } \r\n }\r\n \r\n }\r\n }\r\n\r\n if (nextCenterPList == null || nextCenterPList.size() == 0) {\r\n return primitives.Color.BLACK;\r\n }\r\n\r\n\r\n if (WidthAndHeight < minCubeSize * 2) {\r\n primitives.Color sumColor = primitives.Color.BLACK;\r\n for (primitives.Color color : colorList) {\r\n sumColor = sumColor.add(color);\r\n }\r\n return sumColor.reduce(colorList.size());\r\n }\r\n\r\n\r\n boolean isAllEquals = true;\r\n primitives.Color tempColor = colorList.get(0);\r\n for (primitives.Color color : colorList) {\r\n if (!tempColor.isAlmostEquals(color))\r\n isAllEquals = false;\r\n }\r\n if (isAllEquals && colorList.size() > 1)\r\n return tempColor;\r\n\r\n\r\n tempColor = primitives.Color.BLACK;\r\n for (Point3D center : nextCenterPList) {\r\n tempColor = tempColor.add(AdaptiveDiffusedAndGlossyRec(center, WidthAndHeight / 2, minCubeSize, pIntersection, Vright, Vup, normal, direction, level, k, ktr, cornersList));\r\n }\r\n return tempColor.reduce(nextCenterPList.size());\r\n }", "private int getTrimmedLine() { // formerly \"visibilityCheck()\"\n\n cc1 = g3d.clipCode3(x1t, y1t, z1t);\n cc2 = g3d.clipCode3(x2t, y2t, z2t);\n if ((cc1 | cc2) == 0)\n return VISIBILITY_UNCLIPPED;\n\n int xLast = g3d.xLast;\n int yLast = g3d.yLast;\n int slab = g3d.slab;\n int depth = g3d.depth;\n do {\n if ((cc1 & cc2) != 0)\n return VISIBILITY_OFFSCREEN;\n\n float dx = x2t - x1t;\n float dy = y2t - y1t;\n float dz = z2t - z1t;\n if (cc1 != 0) { //cohen-sutherland line clipping\n if ((cc1 & GData.xLT) != 0) {\n y1t += (-x1t * dy) / dx;\n z1t += (-x1t * dz) / dx;\n x1t = 0;\n } else if ((cc1 & GData.xGT) != 0) {\n y1t += ((xLast - x1t) * dy) / dx;\n z1t += ((xLast - x1t) * dz) / dx;\n x1t = xLast;\n } else if ((cc1 & GData.yLT) != 0) {\n x1t += (-y1t * dx) / dy;\n z1t += (-y1t * dz) / dy;\n y1t = 0;\n } else if ((cc1 & GData.yGT) != 0) {\n x1t += ((yLast - y1t) * dx) / dy;\n z1t += ((yLast - y1t) * dz) / dy;\n y1t = yLast;\n } else if ((cc1 & GData.zLT) != 0) {\n x1t += ((slab - z1t) * dx) / dz;\n y1t += ((slab - z1t) * dy) / dz;\n z1t = slab;\n } else // must be zGT\n {\n x1t += ((depth - z1t) * dx) / dz;\n y1t += ((depth - z1t) * dy) / dz;\n z1t = depth;\n }\n\n cc1 = g3d.clipCode3(x1t, y1t, z1t);\n } else {\n if ((cc2 & GData.xLT) != 0) {\n y2t += (-x2t * dy) / dx;\n z2t += (-x2t * dz) / dx;\n x2t = 0;\n } else if ((cc2 & GData.xGT) != 0) {\n y2t += ((xLast - x2t) * dy) / dx;\n z2t += ((xLast - x2t) * dz) / dx;\n x2t = xLast;\n } else if ((cc2 & GData.yLT) != 0) {\n x2t += (-y2t * dx) / dy;\n z2t += (-y2t * dz) / dy;\n y2t = 0;\n } else if ((cc2 & GData.yGT) != 0) {\n x2t += ((yLast - y2t) * dx) / dy;\n z2t += ((yLast - y2t) * dz) / dy;\n y2t = yLast;\n } else if ((cc2 & GData.zLT) != 0) {\n x2t += ((slab - z2t) * dx) / dz;\n y2t += ((slab - z2t) * dy) / dz;\n z2t = slab;\n } else // must be zGT\n {\n x2t += ((depth - z2t) * dx) / dz;\n y2t += ((depth - z2t) * dy) / dz;\n z2t = depth;\n }\n cc2 = g3d.clipCode3(x2t, y2t, z2t);\n }\n } while ((cc1 | cc2) != 0);\n //System.out.println(\"trimmed line \" + x1t + \" \" + y1t + \" \" + z1t + \" \" + x2t + \" \" + y2t + \" \" + z2t + \" \" + cc1 + \"/\" + cc2);\n return VISIBILITY_CLIPPED;\n }", "void analyze(CaveGen g) {\n caveGenCount += 1; \n\n // count the number of purple flowers\n int num = 0;\n for (Teki t: g.placedTekis) {\n if (t.tekiName.equalsIgnoreCase(\"blackpom\"))\n num += 1;\n }\n if (num > 5) num = 5;\n numPurpleFlowers[num] += 1;\n\n // report about missing treasures\n // print the seed everytime we see a missing treasure\n int minTreasure = 0, actualTreasure = 0;\n for (Item t: g.spawnItem) { minTreasure += t.min; }\n for (Teki t: g.spawnTekiConsolidated) { if (t.itemInside != null) minTreasure += t.min; }\n actualTreasure += g.placedItems.size();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n actualTreasure += 1;\n }\n int expectedMissingTreasures = 0;\n if (\"CH29 1\".equals(g.specialCaveInfoName + \" \" + g.sublevel))\n expectedMissingTreasures = 1; // This level is always missing a treasure\n boolean missingUnexpectedTreasure = actualTreasure + expectedMissingTreasures < minTreasure;\n if (missingUnexpectedTreasure) {\n println(\"Missing treasure: \" + g.specialCaveInfoName + \" \" + g.sublevel + \" \" + Drawer.seedToString(g.initialSeed));\n missingTreasureCount += 1;\n }\n\n // Good layout finder (story mode)\n if (CaveGen.findGoodLayouts && !CaveGen.challengeMode && !missingUnexpectedTreasure) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n ArrayList<Teki> placedTekisWithItems = new ArrayList<Teki>();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n placedTekisWithItems.add(t);\n }\n\n String ignoreItems = \"g_futa_kyodo,flower_blue,tape_blue,kinoko_doku,flower_red,futa_a_silver,cookie_m_l,chocolate\";\n String findTekis = \"\"; //\"whitepom,blackpom\";\n\n // Compute the waypoints on the shortest paths\n ArrayList<WayPoint> wpOnShortPath = new ArrayList<WayPoint>();\n for (Item t: g.placedItems) { // Treasures\n if (ignoreItems.contains(t.itemName.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: placedTekisWithItems) { // Treasures inside enemies\n if (ignoreItems.contains(t.itemInside.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: g.placedTekis) { // Other tekis\n if (findTekis.contains(t.tekiName.toLowerCase())) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n }\n /*if (g.placedHole != null) {\n WayPoint wp = g.closestWayPoint(g.placedHole);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n if (g.placedGeyser != null) {\n WayPoint wp = g.closestWayPoint(g.placedGeyser);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }*/\n\n // add up distance penalty for score\n int score = 0;\n for (WayPoint wp: wpOnShortPath) {\n score += wp.distToStart - wp.backWp.distToStart;\n } \n // add up enemy penalties for score\n for (Teki t: g.placedTekis) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (wpOnShortPath.contains(wp)) {\n score += Parser.tekiDifficulty.get(t.tekiName.toLowerCase());\n }\n }\n // add up gate penalties for score\n for (Gate t: g.placedGates) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (g.placedHole != null && g.placedHole.mapUnit.type == 0 && g.placedHole.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n score += t.life / 3; // covers hole\n // if (g.placedGeyser != null && g.placedGeyser.mapUnit.type == 0 && g.placedGeyser.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n // score += t.life / 3; // covers geyser\n if (wpOnShortPath.contains(wp))\n score += t.life / 3; // covers path back to ship\n }\n\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n\n }\n\n // good layout finder (challenge mode)\n if (CaveGen.findGoodLayouts && CaveGen.challengeMode) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n // compute the number of pokos availible\n int pokosAvailible = 0;\n for (Teki t: g.placedTekis) {\n String name = t.tekiName.toLowerCase();\n if (plantNames.contains(\",\" + name + \",\")) continue;\n if (hazardNames.contains(\",\" + name + \",\")) continue;\n if (name.equalsIgnoreCase(\"egg\"))\n pokosAvailible += 10; // mitites\n else if (!noCarcassNames.contains(\",\" + name + \",\") && !name.contains(\"pom\"))\n pokosAvailible += Parser.pokos.get(t.tekiName.toLowerCase());\n if (t.itemInside != null)\n pokosAvailible += Parser.pokos.get(t.itemInside.toLowerCase());\n }\n for (Item t: g.placedItems)\n pokosAvailible += Parser.pokos.get(t.itemName.toLowerCase());\n\n // compute the number of pikmin*seconds required to complete the level\n float pikminSeconds = 0;\n for (Teki t: g.placedTekis) {\n if (plantNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n if (hazardNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n pikminSeconds += workFunction(g, t.tekiName, t.spawnPoint);\n if (t.itemInside != null)\n pikminSeconds += workFunction(g, t.itemInside, t.spawnPoint);\n }\n for (Item t: g.placedItems) {\n pikminSeconds += workFunction(g, t.itemName, t.spawnPoint);\n }\n pikminSeconds += workFunction(g, \"hole\", g.placedHole);\n pikminSeconds += workFunction(g, \"geyser\", g.placedGeyser);\n // gates??\n // hazards??\n \n int score = -pokosAvailible * 1000 + (int)(pikminSeconds/2);\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n }\n }", "private void condenseSteam() {\n if (getPressure()> Constants.ATMOSPHERIC_PRESSURE) {\n double boilingPoint = Water.getBoilingTemperature(getPressure());\n if (boilingPoint > steam.getTemperature()) { // remove steam such that it equalizes to the boiling point\n double newSteamPressure = Math.max(Water.getBoilingPressure(steam.getTemperature()), Constants.ATMOSPHERIC_PRESSURE);\n \n\n int newQuantity = steam.getParticlesAtState(newSteamPressure, getCompressibleVolume());\n int deltaQuantity = steam.getParticleNr() - newQuantity;\n if (deltaQuantity < 0) {\n System.out.println(\"BAD\");\n }\n steam.remove(deltaQuantity);\n getWater().add(new Water(steam.getTemperature(), deltaQuantity));\n }\n } \n }", "public static void m20200a(Path path, float f, float f2, float f3) {\n String str = \"applyTrimPathIfNeeded\";\n C8505b.m19651a(str);\n f22229a.setPath(path, false);\n float length = f22229a.getLength();\n if (f == 1.0f && f2 == 0.0f) {\n C8505b.m19652b(str);\n } else if (length < 1.0f || ((double) Math.abs((f2 - f) - 1.0f)) < 0.01d) {\n C8505b.m19652b(str);\n } else {\n float f4 = f * length;\n float f5 = f2 * length;\n float f6 = f3 * length;\n float min = Math.min(f4, f5) + f6;\n float max = Math.max(f4, f5) + f6;\n if (min >= length && max >= length) {\n min = (float) C8657g.m20182a(min, length);\n max = (float) C8657g.m20182a(max, length);\n }\n if (min < 0.0f) {\n min = (float) C8657g.m20182a(min, length);\n }\n if (max < 0.0f) {\n max = (float) C8657g.m20182a(max, length);\n }\n int i = (min > max ? 1 : (min == max ? 0 : -1));\n if (i == 0) {\n path.reset();\n C8505b.m19652b(str);\n return;\n }\n if (i >= 0) {\n min -= length;\n }\n f22230b.reset();\n f22229a.getSegment(min, max, f22230b, true);\n if (max > length) {\n f22231c.reset();\n f22229a.getSegment(0.0f, max % length, f22231c, true);\n f22230b.addPath(f22231c);\n } else if (min < 0.0f) {\n f22231c.reset();\n f22229a.getSegment(min + length, length, f22231c, true);\n f22230b.addPath(f22231c);\n }\n path.set(f22230b);\n C8505b.m19652b(str);\n }\n }", "public void pruneRules_cbaLike() {\n LOGGER.info(\"STARTED Postpruning\");\n //HashMap<ExtendRule,Integer> ruleErrors = new HashMap();\n //HashMap<ExtendRule,AttributeValue> ruleDefClass = new HashMap();\n ArrayList<ExtendRule> rulesToRemove = new ArrayList(); \n int totalErrorsWithoutDefault = 0; \n AttributeValue defClassForLowestTotalErrorsRule = getDefaultRuleClass();\n int lowestTotalErrors = getDefaultRuleError(defClassForLowestTotalErrorsRule);;\n ExtendRule lowestTotalErrorsRule = null;\n // DETERMINE TOTAL ERROR AND DEFAULT CLASS ASSOCIATED WITH EACH RULE \n // REMOVE RULES MATCHING ZERO TRANSACTIONS AND OF ZERO LENGTH\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n\n ExtendRule rule = it.next();\n rule.updateQuality();\n rule.setQualityInRuleList(rule.getRuleQuality());\n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.log(Level.FINE, \"Processing rule {0}\", rule.toString());\n }\n\n if (rule.getAntecedentLength() == 0) {\n LOGGER.fine(\"Rule of length 0, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed\n } \n else if (rule.getRuleQuality().getA() == 0)\n {\n LOGGER.fine(\"Rule classifying 0 instances correctly, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed \n }\n else\n {\n rule.removeTransactionsCoveredByAntecedent(true); \n totalErrorsWithoutDefault = totalErrorsWithoutDefault + rule.getRuleQuality().getB();\n // since transactions matching the current rule have been removed, the default class and error can change\n AttributeValue newDefClass = getDefaultRuleClass();\n int newDefError = getDefaultRuleError(newDefClass);\n int totalErrorWithDefault = newDefError + totalErrorsWithoutDefault;\n if (totalErrorWithDefault < lowestTotalErrors)\n {\n lowestTotalErrors = totalErrorWithDefault;\n lowestTotalErrorsRule = rule;\n defClassForLowestTotalErrorsRule= newDefClass;\n } \n //ruleErrors.put(rule,totalErrorWithDefault );\n //ruleDefClass.put(rule, newDefClass); \n }\n \n }\n boolean removeTail;\n // now we know the errors associated with each rule not marked for removal, we can perform pruning\n if (lowestTotalErrorsRule == null)\n {\n // no rule improves error over a classifier composed of only default rule\n // remove all rules\n removeTail = true;\n }\n else \n {\n removeTail = false;\n }\n \n data.getDataTable().unhideAllTransactions();\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n ExtendRule rule = it.next();\n if (rulesToRemove.contains(rule) || removeTail)\n {\n it.remove();\n continue;\n }\n if (rule.equals(lowestTotalErrorsRule))\n {\n removeTail = true;\n }\n rule.updateQuality(); \n }\n \n \n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.fine(\"Creating new default rule within narrow rule procedure\");\n }\n \n \n extendedRules.add(createNewDefaultRule(defClassForLowestTotalErrorsRule));\n \n \n LOGGER.info(\"FINISHED Postpruning\");\n }", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "private void clipChangedFeatureUsing(SimpleFeature featureToClip, \n CoordinateReferenceSystem featureToClipCrs, \n Geometry clippingGeometryOnMap, \n CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n String fid = featureToClip.getID();\n FeatureTransaction tx = this.transactionTrack.get(fid);\n \n assert tx != null;\n \n switch( tx.getType() ) {\n case DELETE :\n // does not process\n break;\n case SPLIT :\n // precesses the fragments\n List<String> fidList = tx.getListInsertedFeatures();\n\n FeatureCollection<SimpleFeatureType, SimpleFeature> fragmentCollection = findFeatures(this.targetStore, fidList);\n \n FeatureIterator<SimpleFeature> fragmentIterator = null;\n try{\n fragmentIterator = fragmentCollection.features();\n \n while( fragmentIterator.hasNext() ) {\n\n SimpleFeature fragment = fragmentIterator.next();\n\n clipFeatureUsing( fragment, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n }\n } finally {\n if (fragmentIterator != null)\n fragmentCollection.close(fragmentIterator);\n }\n \n break;\n case UPDATE :\n // the feature require more changes\n \n // retrieves the changed feature and applies it the clip \n fid = tx.getUpdatedFeature();\n \n SimpleFeature updatedFeature = findFeature(this.targetStore, fid);\n \n clipFeatureUsing( updatedFeature, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n break;\n\n default:\n assert false; // impossible case\n }\n \n \n }", "public static void PaladinPruning(GatorDot2C myGator, ADAI2Dot myADAI) {\n\t\tHashMap<String, GatorDot2C.vertex> GatorBoxes = myGator.Boxes;\n\t\tHashSet<String> GatorActivity = new HashSet<String>();\n\t\tfor (Map.Entry<String, GatorDot2C.vertex> entry: GatorBoxes.entrySet()){\n\t\t\tString currentActivity = entry.getValue().act;\n\t\t\tif (!GatorActivity.contains(currentActivity)) {\n\t\t\t\tGatorActivity.add(currentActivity);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"=============\");\n\t\t\n\t\tLinkedList<ADAI2Dot.PathTree> PaladinPaths = myADAI.graphPaths;\n\t\tSystem.out.println(PaladinPaths.size());\n\t\t\n\t\tIterator<ADAI2Dot.PathTree> iter = PaladinPaths.iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tADAI2Dot.PathTree currentPath = iter.next();\n\t\t\tString srcAct = currentPath.src;\n\t\t\tString tgtAct = currentPath.tgt;\n\t\t\tif (!GatorActivity.contains(srcAct) || !GatorActivity.contains(tgtAct)) {\n\t\t\t\titer.remove();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"After Cleaning\");\n\t\tSystem.out.println(PaladinPaths.size());\n\t\tSystem.out.println(\"=============\");\n\t\t\n\t\t// Find edges only between different activities\n\t\tint number = 0;\n\t\titer = PaladinPaths.iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tADAI2Dot.PathTree currentPath = iter.next();\n\t\t\tString srcAct = currentPath.src;\n\t\t\tString tgtAct = currentPath.tgt;\n\t\t\tif (!srcAct.equals(tgtAct)) {\n\t\t\t\tnumber ++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"current connected edges \" + number);\n\t\tSystem.out.println(\"=============\");\n\t\t\n\t\tHashMap<String, Integer> PaladinActivity = myADAI.Activities;\n\t\tIterator<Map.Entry<String, Integer>> iter2 = PaladinActivity.entrySet().iterator();\n\t\twhile (iter2.hasNext()){\n\t\t\tMap.Entry<String, Integer> entry = iter2.next();\n\t\t\tif (!GatorActivity.contains(entry.getKey())) {\n\t\t\t\titer2.remove();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void processPoints() {\n\t\t// We don't want multiple of the same normals, so we calculate them on the fly\n\t\tArrayList<Vector2f> normals = new ArrayList<Vector2f>();\n\t\tVector2f edge = new Vector2f();\n\n\t\tif (points.length < 3) {\n\t\t\tthrow new IllegalStateException(\"There must be more than two points in a polygon... Shame on you!\");\n\t\t}\n\t\t\n\t\t// Calculate the center\n\t\tcenter = new Vector2f();\n\t\tfor (Vector2f p : points) {\n\t\t\tcenter.add(p);\t\t\n\t\t}\n\t\tcenter.scale(1.0f / (float) points.length);\n\t\t\n\t\t// Subtract the center from each point so it's centerd\n\t\tfor (Vector2f p : points) {\n\t\t\tp.sub(center);\n\t\t}\n\t\t\n\t\t// Calculate the direction to loop through them\n\t\tVector2f edgeA = points[points.length - 1].clone().sub(points[0]);\n\t\tVector2f edgeB = points[1].clone().sub(points[0]);\n\t\t\n\t\tboolean rightHand = edgeA.x * edgeB.y - edgeB.x * edgeA.y < 0;\n\t\t\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tVector2f.sub(points[(i + 1) % points.length], points[i], edge);\n\t\t\t\n\t\t\t// Check if the current point is further away then the current\n\t\t\tfloat length = points[i].length();\n\t\t\tbroadPhaseLength = Math.max(length, broadPhaseLength);\n\t\t\t\n\t\t\t// Calculated of 90 degree rotation matrix\n\t\t\t\n\t\t\tVector2f normal;\n\t\t\tif (rightHand) {\n\t\t\t\tnormal = new Vector2f( edge.y,-edge.x);\n\t\t\t} else {\n\t\t\t\tnormal = new Vector2f(-edge.y, edge.x);\n\t\t\t}\n\t\t\tnormal.normalise();\n\t\t\tint j = 0;\n\t\t\tfor (; j < normals.size(); j++) {\n\t\t\t\tif (Math.abs(normals.get(j).dot(normal)) == 1.0f) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (j == normals.size()) {\n\t\t\t\tnormals.add(normal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.normals = new Vector2f[normals.size()];\n\t\tnormals.toArray(this.normals);\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate static void combineSmallAnnotations(MeshCas cas) {\n\t\tSet<Annotation> toRemove = new HashSet<Annotation>();\n\t\tfor (Iterator<Annotation> it = cas.getAnnotations().iterator(); it.hasNext();) {\n\t\t\tAnnotation a = it.next();\n\t\t\tif (a instanceof PrimitiveAnnotation) {\n\t\t\t\tPrimitiveAnnotation pa = (PrimitiveAnnotation) a;\n\n\t\t\t\t// zero area, remove\n\t\t\t\tif (pa.getArea() == 0) {\n\t\t\t\t\ttoRemove.add(a);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tSet<PrimitiveAnnotation> neighborAnnotations = pa.getNeighborAnnotations(cas,\n\t\t\t\t\t\tPrimitiveAnnotation.class);\n\n\t\t\t\t// check for cone or sphere annotation which has less than 5 triangles\n\t\t\t\tif (neighborAnnotations.size() > 0 && (a instanceof ConeAnnotation || a instanceof SphereAnnotation)\n\t\t\t\t\t\t&& ((PrimitiveAnnotation) a).getMesh().getTriangles().size() < 5) {\n\t\t\t\t\ttoRemove.add(a);\n\n\t\t\t\t\tPrimitiveAnnotation a1 = neighborAnnotations.iterator().next();\n\n\t\t\t\t\tsynchronized (a1.getMesh().getTriangles()) {\n\t\t\t\t\t\ta1.getMesh().getTriangles().addAll(pa.getMesh().getTriangles());\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// merge small annotations here\n\t\t\t\tfor (PrimitiveAnnotation a1 : neighborAnnotations) {\n\n\t\t\t\t\tboolean merge = false;\n\t\t\t\t\tif (pa instanceof ConeAnnotation\n\t\t\t\t\t\t\t&& a1 instanceof ConeAnnotation\n\t\t\t\t\t\t\t&& ((ConeAnnotation) pa).isConcave() != ((ConeAnnotation) a1).isConcave()) {\n\t\t\t\t\t\t// merge pa into a1 if area of pa is significantly smaller than a1, because\n\t\t\t\t\t\t// neighboring cones, one convex and one concave with different size are\n\t\t\t\t\t\t// very unlikely.\n\t\t\t\t\t\tif (pa.getArea() < a1.getArea() * 0.30f)\n\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!merge && pa instanceof PlaneAnnotation && a1 instanceof ConeAnnotation) {\n\t\t\t\t\t\tif (pa.getArea() < a1.getArea() * 0.05f) {\n\t\t\t\t\t\t\t// Found a very small plane annotation neighboring a cone annotation. Check if\n\t\t\t\t\t\t\t// plane annotation should be part of cone annotation by checking if plane\n\t\t\t\t\t\t\t// normal is perpendicular to the generating axis.\n\t\t\t\t\t\t\t// Primitives are not fitted yet, therefore we need to compare triangles on\n\t\t\t\t\t\t\t// the edge for approximately the same normal vector\n\t\t\t\t\t\t\tHashMultimap<Triangle, Triangle> edgeTriangles = HashMultimap.create(a1.getMesh().getTriangles().size(), 2);\n\t\t\t\t\t\t\tSet<Vertex> edgeVertices = new HashSet<Vertex>();\n\t\t\t\t\t\t\tpa.getNeighborEdge(cas, a1, edgeVertices, edgeTriangles);\n\n\t\t\t\t\t\t\t// check for a triangle pair where the angle between triangle normals is\n\t\t\t\t\t\t\t// bigger or equal to 180 degree with a tolerance of twice the plane combine degree.\n\t\t\t\t\t\t\tfor (Triangle t : edgeTriangles.keySet()) {\n\t\t\t\t\t\t\t\tSet<Triangle> partnerSet = edgeTriangles.get(t);\n\t\t\t\t\t\t\t\tfor (Triangle partner : partnerSet) {\n\t\t\t\t\t\t\t\t\tfloat angle = (float)(Math.toDegrees(t.getNormalVector().angle(partner.getNormalVector())));\n\t\t\t\t\t\t\t\t\tif (angle <= (2 * PLANE_COMBINE_DEGREE) || angle >= 180f - (2 * PLANE_COMBINE_DEGREE)) {\n\t\t\t\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (pa.getArea() >= a1.getArea() * 0.05f && pa.getArea() < a1.getArea() * 0.30f) {\n\t\t\t\t\t\t\t// found a small plane annotation neighboring cone annotation. Check if\n\t\t\t\t\t\t\t// plane annotation should be part of cone annotation by checking if plane\n\t\t\t\t\t\t\t// normal is perpendicular to the generating axis.\n\t\t\t\t\t\t\t// Primitives are not fitted yet, therefore we need to compare triangles on\n\t\t\t\t\t\t\t// the edge for approximately the same normal vector\n\t\t\t\t\t\t\tHashMultimap<Triangle, Triangle> edgeTriangles = HashMultimap.create(a1.getMesh().getTriangles().size(), 2);\n\t\t\t\t\t\t\tSet<Vertex> edgeVertices = new HashSet<Vertex>();\n\t\t\t\t\t\t\tpa.getNeighborEdge(cas, a1, edgeVertices, edgeTriangles);\n\n\t\t\t\t\t\t\t// check for a triangle pair where the angle between triangle normals is\n\t\t\t\t\t\t\t// bigger or equal to 180 degree with a tolerance of twice the plane combine degree.\n\t\t\t\t\t\t\tfor (Triangle t : edgeTriangles.keySet()) {\n\t\t\t\t\t\t\t\tSet<Triangle> partnerSet = edgeTriangles.get(t);\n\t\t\t\t\t\t\t\tfor (Triangle partner : partnerSet) {\n\t\t\t\t\t\t\t\t\tfloat angle = (float)(Math.toDegrees(t.getNormalVector().angle(partner.getNormalVector())));\n\t\t\t\t\t\t\t\t\tif (angle <= PLANE_TOLERANCE || angle >= 180f - PLANE_TOLERANCE) {\n\t\t\t\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!merge && pa instanceof PlaneAnnotation && (a1 instanceof SphereAnnotation || a1 instanceof ConeAnnotation)\n\t\t\t\t\t\t\t&& pa.getArea() < a1.getArea() * 0.02f) {\n\t\t\t\t\t\t// found very small plane (covering less than 2 percent of neighboring sphere or cone annotation)\n\t\t\t\t\t\t// so merge it into the big annotation as these results are just unwanted artifacts after the region growing\n\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!merge && pa instanceof ConeAnnotation && a1 instanceof SphereAnnotation \n\t\t\t\t\t\t\t&& ((ConeAnnotation)pa).isConcave() == ((SphereAnnotation)a1).isConcave()\n\t\t\t\t\t\t\t&& pa.getArea() < a1.getArea() * 0.05f) {\n\t\t\t\t\t\t// found a small cone annotation next to a sphere annotation of the same convexity, so merge them together and \n\t\t\t\t\t\t// this would be reverted at the sphere checking time if the fit error is too big\n\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (merge) {\n\t\t\t\t\t\ttoRemove.add(a);\n\t\t\t\t\t\tsynchronized (a1.getMesh().getTriangles()) {\n\t\t\t\t\t\t\ta1.getMesh().getTriangles().addAll(pa.getMesh().getTriangles());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsynchronized (cas.getAnnotations()) {\n\t\t\tcas.getAnnotations().removeAll(toRemove);\n\t\t}\n\t}", "private void fillTriangle(BufferedImage img, Polygon p, double illumination, double[][] zBuffer) {\n\t\t\tif (illumination<0)\r\n\t\t\t\tillumination = 0;\r\n\t\t\tif (illumination>1)\r\n\t\t\t\tillumination = 1;\r\n\r\n\t\t\tfloat tone = (float)illumination;\r\n\r\n\t\t\tint color = new Color(0,0,tone).getRGB();\r\n\r\n\t\t\tif (p.getFirst().getY()==p.getSecond().getY() && p.getSecond().getY()==p.getThird().getY())\r\n\t\t\t\treturn;\r\n\t\t\tPoint[] points = new Point[3];\r\n\t\t\tpoints[0] = new Point(p.getFirst());\r\n\t\t\tpoints[1] = new Point(p.getSecond());\r\n\t\t\tpoints[2] = new Point(p.getThird());\r\n\r\n\t\t\tArrays.sort(points,(e1,e2)->e1.y-e2.y);\r\n\t\t\t//System.out.println(Arrays.toString(points));\r\n\r\n\t\t\tint totalHeight = points[2].y-points[0].y;\r\n\t\t\tfor (int i = 0;i<totalHeight;i++) {\r\n\t\t\t\tint firstHalfHeight = points[1].y-points[0].y;\r\n\t\t\t\tboolean secondHalf = i>firstHalfHeight || firstHalfHeight==0;\r\n\t\t\t\tint segmentHeight = secondHalf?points[2].y-points[1].y:points[1].y-points[0].y;\r\n\r\n\t\t\t\tdouble alpha = (double)i/totalHeight;\r\n\t\t\t\tdouble beta = (double)(i-(secondHalf ? points[1].y-points[0].y : 0))/segmentHeight;\r\n\t\t\t\tPoint3D a = points[0].add(points[2].subtract(points[0]).multiply(alpha));\r\n\t\t\t\tPoint3D b = secondHalf ?\r\n\t\t\t\t\tpoints[1].add(points[2].subtract(points[1]).multiply(beta)) :\r\n\t\t\t\t\tpoints[0].add(points[1].subtract(points[0]).multiply(beta));\r\n\t\t\t\tif (a.getX()>b.getX()) {\r\n\t\t\t\t\tPoint3D temp = a;\r\n\t\t\t\t\ta = b;\r\n\t\t\t\t\tb = temp;\r\n\t\t\t\t}\r\n\t\t\t\tPoint aInt = new Point(a);\r\n\t\t\t\tPoint bInt = new Point(b);\r\n\t\t\t\tfor (int j = aInt.x; j<bInt.x;j++) {\r\n\t\t\t\t\tif (j<0 || j>=img.getWidth() || points[0].y+i<0 || points[0].y+i>=img.getHeight())\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tdouble phi = aInt.x==bInt.x ? 1 : (double)(j-aInt.x) / (double)(bInt.x-aInt.x);\r\n\t\t\t\t\tPoint P = new Point(a.add(b.subtract(a).multiply(phi)));\r\n\r\n\t\t\t\t\tif (P.z<minZ)\r\n\t\t\t\t\t\tminZ = P.z;\r\n\t\t\t\t\tif (P.z>maxZ)\r\n\t\t\t\t\t\tmaxZ = P.z;\r\n\r\n\t\t\t\t\tif (zBuffer[P.x][P.y]<P.z) {\r\n\t\t\t\t\t\timg.setRGB(P.x,P.y,color);\r\n\t\t\t\t\t\tzBuffer[P.x][P.y] = P.z;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "private int reduceSubsetChanges(Mode[] mode_type, int[] mode_length, int index_point) {\n\n int totalLength = 0;\n int i, length;\n Mode current, last, next;\n\n for (i = 0; i < index_point; i++) {\n current = mode_type[i];\n length = mode_length[i];\n if (i != 0) {\n last = mode_type[i - 1];\n } else {\n last = Mode.NULL;\n }\n if (i != index_point - 1) {\n next = mode_type[i + 1];\n } else {\n next = Mode.NULL;\n }\n\n /* ISO 15417 Annex E Note 2 */\n /* Calculate difference between logical length and actual length in this block */\n int extraLength = 0;\n for (int j = 0; j < length - extraLength; j++) {\n if (length(inputData[totalLength + j], current) == 2) {\n extraLength++;\n }\n }\n\n if (i == 0) { /* first block */\n if ((index_point == 1) && ((length == 2) && (current == Mode.ABORC))) { /* Rule 1a */\n mode_type[i] = Mode.LATCHC;\n current = Mode.LATCHC;\n }\n if (current == Mode.ABORC) {\n if (length >= 4) { /* Rule 1b */\n mode_type[i] = Mode.LATCHC;\n current = Mode.LATCHC;\n } else {\n mode_type[i] = Mode.AORB;\n current = Mode.AORB;\n }\n }\n if (current == Mode.SHIFTA) { /* Rule 1c */\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.AORB) && (next == Mode.SHIFTA)) { /* Rule 1c */\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if (current == Mode.AORB) { /* Rule 1d */\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n } else {\n if ((current == Mode.ABORC) && (length >= 4)) { /* Rule 3 */\n mode_type[i] = Mode.LATCHC;\n current = Mode.LATCHC;\n }\n if (current == Mode.ABORC) {\n mode_type[i] = Mode.AORB;\n current = Mode.AORB;\n }\n if ((current == Mode.AORB) && (last == Mode.LATCHA)) {\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.AORB) && (last == Mode.LATCHB)) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if ((current == Mode.AORB) && (next == Mode.SHIFTA)) {\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.AORB) && (next == Mode.SHIFTB)) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if (current == Mode.AORB) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if ((current == Mode.SHIFTA) && (length > 1)) { /* Rule 4 */\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.SHIFTB) && (length > 1)) { /* Rule 5 */\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if ((current == Mode.SHIFTA) && (last == Mode.LATCHA)) {\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.SHIFTB) && (last == Mode.LATCHB)) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if ((current == Mode.SHIFTA) && (next == Mode.AORB)) {\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.SHIFTB) && (next == Mode.AORB)) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n if ((current == Mode.SHIFTA) && (last == Mode.LATCHC)) {\n mode_type[i] = Mode.LATCHA;\n current = Mode.LATCHA;\n }\n if ((current == Mode.SHIFTB) && (last == Mode.LATCHC)) {\n mode_type[i] = Mode.LATCHB;\n current = Mode.LATCHB;\n }\n } /* Rule 2 is implemented elsewhere, Rule 6 is implied */\n\n /* ISO 15417 Annex E Note 2 */\n /* Convert logical length back to actual length for this block, now that we've decided on a subset */\n mode_length[i] -= extraLength;\n totalLength += mode_length[i];\n }\n\n return combineSubsetBlocks(mode_type, mode_length, index_point);\n }", "public static void QuasiThresholdEditingMinimization (Graph<Integer,String> g, int currentSize, EditSet S){\n\t\t\r\n\t\tboolean existsP4orC4 = false;\r\n\t\tif (currentSize >= minSoFarQTEdit) return; \r\n\t\t\r\n\t\t\r\n\t\tIterator<Integer> a = g.getVertices().iterator();\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\t\twhile(a.hasNext()){\r\n\t\t\tInteger A = a.next();\r\n\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\tb = g.getNeighbors(A).iterator();\r\n\t\t\twhile(b.hasNext()){\r\n\t\t\t\tInteger B = b.next();\r\n\t\t\t\tc = g.getNeighbors(B).iterator();\r\n\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\tif (g.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\td = g.getNeighbors(C).iterator();\r\n\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\tif (g.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\texistsP4orC4 = true;\r\n\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\tif (g.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t// add a diagonal chord or delete any two edges\r\n\r\n\t\t\t\t\t\t\tif (S.isIn(A, C)==-1) {\r\n\t\t\t\t\t\t\t\tg.addEdge(\"e\"+A+\",\"+C, A,C);\r\n\t\t\t\t\t\t\t\tS.add(A,C);\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,1+currentSize,S);\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, C));\r\n\t\t\t\t\t\t\t\tS.remove(A,C);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (S.isIn(B,D) == -1) {\r\n\t\t\t\t\t\t\t\tg.addEdge(\"e\"+B+\",\"+D, B,D);\r\n\t\t\t\t\t\t\t\tS.add(B,D);\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,1+currentSize,S);\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B,D));\r\n\t\t\t\t\t\t\t\tS.remove(B,D);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (S.isIn(A,B) == -1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\t\t\t\t\t\t\t\tS.add(A,B);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (S.isIn(B,C) == -1) {\r\n\t\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\t\t\tS.add(B,C);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,2+currentSize,S);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t\t\tS.remove(B,C);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (S.isIn(C,D) == -1) {\r\n\t\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\t\t\tS.add(C,D);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,2+currentSize,S);\r\n\r\n\t\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\t\tS.remove(C,D);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tif (S.isIn(D, A) == -1) {\r\n\t\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(D, A));\r\n\t\t\t\t\t\t\t\t\tS.add(D,A);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,2+currentSize,S);\r\n\r\n\t\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+D+\"-\"+A, D,A);\r\n\t\t\t\t\t\t\t\t\tS.remove(D,A);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B,A,B);\r\n\t\t\t\t\t\t\t\tS.remove(A, B);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// all cases with AB deleted are done.\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (S.isIn(D,A) == -1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(D,A));\r\n\t\t\t\t\t\t\t\tS.add(D,A);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (S.isIn(B,C) == -1) {\r\n\t\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\t\t\tS.add(B,C);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+2,S);\r\n\r\n\t\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t\t\tS.remove(B,C);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (S.isIn(C,D) == -1) {\r\n\t\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\t\t\tS.add(C,D);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+2,S);\r\n\r\n\t\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D,C,D);\r\n\t\t\t\t\t\t\t\t\tS.remove(C,D);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+D, A,D);\r\n\t\t\t\t\t\t\t\tS.remove(D,A);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// all cases with AB deleted or AD deleted are done\r\n\t\t\t\t\t\t\t// only need to try BC and CD together deleted.\r\n\r\n\t\t\t\t\t\t\tif (S.isIn(B,C)== -1 && S.isIn(C, D)== -1) {\r\n\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\t\tS.add(B,C);\r\n\t\t\t\t\t\t\t\tS.add(C,D);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+2,S);\r\n\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\tS.remove(B,C);\r\n\t\t\t\t\t\t\t\tS.remove(C,D);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // end of C4-handling cases\r\n\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t// either add ac or bd or else delete one edge\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//int branchCase = randomInt(1,5);\t\r\n\t\t\t\t\t\t//if (branchCase <= 2) {\r\n\t\t\t\t\t\t\tif (S.isIn(A, C) == -1) {\r\n\t\t\t\t\t\t\t\tg.addEdge(\"e\"+A+\",\"+C, A, C);\r\n\t\t\t\t\t\t\t\tS.add(A,C);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+1,S);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, C));\r\n\t\t\t\t\t\t\t\tS.remove(A,C);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (S.isIn(B,D) == -1) {\r\n\t\t\t\t\t\t\t\tg.addEdge(\"e\"+B+\",\"+D, B, D);\r\n\t\t\t\t\t\t\t\tS.add(B,D);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+1,S);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, D));\r\n\t\t\t\t\t\t\t\tS.remove(B,D);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//else if (branchCase == 3) {\r\n\t\t\t\t\t\t\tif (S.isIn(A,B)== -1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\t\t\t\t\t\t\t\tS.add(A, B);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+1,S);\r\n\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B, A,B);\r\n\t\t\t\t\t\t\t\tS.remove(A,B);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//else if (branchCase == 4) {\r\n\t\t\t\t\t\t\tif (S.isIn(B,C) == -1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\t\tS.add(B, C);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+1,S);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t\tS.remove(B,C);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//else if (branchCase == 5) {\r\n\t\t\t\t\t\t\tif (S.isIn(C,D) == -1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\t\tS.add(C,D);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tQuasiThresholdEditingMinimization(g,currentSize+1,S);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\tS.remove(C,D);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // end of P4-handling\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (existsP4orC4 == true) return;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext()\r\n\t\t} // end a.hasNext()\r\n\r\n\t\t// if we reached here, no P4 was found\r\n\t\tif (existsP4orC4 == false) {\r\n\t\t\t// arrived at a quasi-threshold graph since no P4 or C4 was found\r\n\t\t\tSystem.out.print(\"\\n currentSize = \"+currentSize+\" and minSoFar = \"+minSoFarQTEdit+\"\\n\");\r\n\t\t\tSystem.out.print(\"Modified(Edited) graph has \"+g.getEdgeCount()+\" edges and is:\\n\");\r\n\t\t\tminSoFarQTEdit = currentSize;\r\n\t\t\tSystem.out.print(\"\"+g+\"\\n\");\r\n\t\t\tSystem.out.print(\"Edit set is \" + S + \"\\n\");\r\n\t\t\tNewTools.printToFile(currentSize,g,S,\"QTEditLesMis.txt\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// ...\r\n\t\tSystem.out.print(\"Critical Error. No P_4 or C_4 found in a non-quasi-threshold graph.\\n\");\r\n\t\treturn;\r\n\t}", "public static Set<Set<Polyomino>> tilings(ArrayList<Polyomino> polyominos_list,Polyomino P, boolean use_all_once, boolean rotations, boolean reflections) {\r\n\t\t\r\n\t\tHashMap<Integer, Square> hmap_P = new HashMap<Integer, Square>();\r\n\t\tSet<Integer> X= new HashSet<Integer>();\r\n\t\tSet<Set<Integer>> C= new HashSet<Set<Integer>>();\t\r\n\t\tSet<Set<Polyomino>> tilings = new HashSet<Set<Polyomino>>();\r\n\t\t\r\n\t\tif (use_all_once) {//quick check to see if there is a tiling of P using each tile exactly once: ( sum of area(tile) ) == area(P)\r\n\t\t\tint total_area=0;\r\n\t\t\tfor (Polyomino q: polyominos_list) total_area+=q.area;\r\n\t\t\tif (!(total_area==P.area)) return tilings;\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t//index squares of P\r\n\t\tfor (int i=0; i<P.vertices.size();i++) {\r\n\t\t\thmap_P.put(i+1,P.vertices.get(i));\r\n\t\t\tX.add(i+1);\r\n\t\t}\r\n\t\tif (use_all_once) {//we add extra elements to the ground set to ensure each polyomino is used exactly once\r\n\t\t\tfor (int j=0;j<polyominos_list.size();j++) {\r\n\t\t\t\tX.add(P.vertices.size()+j+1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t//we now define C\r\n\t\t//if A= set of (fixed/one-sided/free) polyominos of area n\r\n\t\t//C= union over Q in A of union of S subset of X corresponding to indices of squares of P covered by some translate of Q\r\n\t\t//to generate C, we iterate over the polyominos Q in A and we see, for each possible translation of Q,\r\n\t\t//if Q fits in P, in which case we record the indices of the squares of P it covers\r\n\t\t\r\n\t\tfor (int k=0; k<polyominos_list.size();k++) {\r\n\t\t\tPolyomino tile=polyominos_list.get(k);\r\n\t\t\t\r\n\t\t\tArrayList<Polyomino> orientations_of_tile=new ArrayList<Polyomino>();\r\n\t\t\tif (rotations && reflections) orientations_of_tile=tile.distinct_symmetries();\r\n\t\t\telse if (rotations) orientations_of_tile=tile.rotations();\r\n\t\t\telse if (reflections) orientations_of_tile=tile.reflections();\r\n\t\t\telse orientations_of_tile.add(tile);//if no rotations, the only possible orientation is the tile as it was given\r\n\t\t\r\n\t\t\tfor (Polyomino Q: orientations_of_tile) {\r\n\t\t\t\t//for each VALID translation of Q, we calculate the indices of squares of P which Q occupies, and add this to C\r\n\t\t\t\t//we choose some square of Q, which we will \"nail\" to the squares of P and see if Q fits in in P in that position\r\n\t\t\t\tSquare nail = Q.vertices.get(0);\r\n\t\t\t\tfor (Square s: P.vertices) {\r\n\t\t\t\t Set<Integer> indices_Q_translated= new HashSet<Integer>();\r\n\t\t\t\t boolean Q_fits_inP=true;\r\n\t\t\t\t\tfor (Square q: Q.vertices) {//lets check if this translation of Q fits in P\r\n\t\t\t\t\t\tSquare translated_q=new Square (q.x+s\r\n\t\t\t\t\t\t\t\t.x-nail.x,q.y+s.y-nail.y);\r\n\t\t\t\t\t\tif (!P.contains(translated_q)) {//check if square translated_q fits is in P\r\n\t\t\t\t\t\t\tQ_fits_inP=false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thmap_P.forEach((key, value) -> {//get index of square translated_q\r\n\t\t\t\t\t\t if (value.equals(translated_q)) {\r\n\t\t\t\t\t\t \tindices_Q_translated.add(key);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (Q_fits_inP) {\r\n\t\t\t\t\t\t//we add an element which corresponds to putting a one in a dummy column in the exact cover matrix\r\n\t\t\t\t\t\tif (use_all_once) indices_Q_translated.add(k+P.vertices.size()+1); \r\n\t\t\t\t\t\tC.add(indices_Q_translated);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Initialization step complete, with complexity at least |polyominos_list|*4*area(P)*area(Q)*area(P)\r\n\t\t\r\n\t\tif(!(C.size()==0)) {\r\n\t\t\t\r\n\t\t\tint[][] M=Exact_cover.sets_to_matrix(X,C);\r\n\t\t\r\n\t\t\t//we add n columns (initialized to all zeros) to M where n=polyominos_list.size().\r\n\t\t\t//Each row of M corresponds to some translation of a polyomino Pk in polyominos_list-{P1,...,Pn}\r\n\t\t\t//in a such a row we place a 1 in the column k\r\n\t\t\t//any exact cover of M must then use each Pk exactly once \r\n\r\n\t\t\tDancingLinks dl = new DancingLinks(M);\r\n\t\t\tSet<Set<data_object>> exact_covers_data_objects=dl.exactCover(dl.master_header);\r\n\t\t\t\r\n\t\t\tfor (Set<data_object> cover_data_objects: exact_covers_data_objects) {\r\n\t\t\t\t\r\n\t\t\t\tSet<Set<Integer>> cover_sets=new HashSet<Set<Integer>>();\r\n\t\t\t\tfor (data_object t: cover_data_objects) cover_sets.add(dl.set_of_row.get(t.row_id));\r\n\t\t\t\t\r\n\t\t\t\tSet<Polyomino> T = new HashSet<Polyomino>();//a tiling, i.e a set of polyominos\r\n\t\t\t\t\r\n\t\t\t\tfor (Set<Integer> indices: cover_sets) {\r\n\t\t\t\t\tArrayList<Square> vertices= new ArrayList<Square>();\r\n\t\t\t\t\t//convert indices to corresponding squares of P, \r\n\t\t\t\t\t//and add the corresponding Polyomino R to T\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int index: indices) {\r\n\t\t\t\t\t\tif (index<P.vertices.size()+1) {//if not a dummy index (in the case of use_all_once polyominos)\r\n\t\t\t\t\t\t\tvertices.add(hmap_P.get(index));\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\tT.add(new Polyomino(vertices,\"R\"));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ttilings.add(T);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn tilings;\r\n\t}", "private void updateGuiPolygon() {\n \t\tif ( this.poly != null ) {\n \t\t\tthis.poly.remove();\n \t\t}\n \n \t\t// A polygon is at minimum a triangle.\n \t\tif ( !this.satisfiesPolygon() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tPolygonOptions options = new PolygonOptions();\n \t\toptions\n \t\t\t.geodesic( POLYGON_GEODESIC )\n \t\t\t.strokeWidth( 2 )\n \t\t\t.fillColor( this.getFillColor() )\n \t\t\t.strokeColor( this.getResources().getColor( POLYGON_STROKE_COLOR ) );\n \n \t\tfor ( Marker marker : this.markers ) {\n \t\t\toptions.add( marker.getPosition() );\n \t\t}\n \n \t\tthis.poly = this.googleMap.addPolygon( options );\n \t}", "private void fixSubcutaneousFatVOIs() {\r\n VOI theVOI = subcutaneousVOI;\r\n \r\n if (theVOI.getName() != \"Subcutaneous area\") {\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): SubcutaneousVOI is not properly set\");\r\n return;\r\n }\r\n \r\n // make a 2D image to hold one slice and curve from the VOI\r\n int[] extents = new int[2];\r\n extents[0] = xDim;\r\n extents[1] = yDim;\r\n ModelImage sliceImage = new ModelImage(ModelStorageBase.UBYTE, extents, \"tmpSliceImage\");\r\n\r\n // There should be one curve on each slice and\r\n // each curve should have the same number of points since each was resampled\r\n int numPoints = ((VOIContour)theVOI.getCurves().get(0)).size();\r\n int[] xVals;\r\n int[] yVals;\r\n int[] zVals;\r\n try {\r\n xVals = new int [numPoints];\r\n yVals = new int [numPoints];\r\n zVals = new int [numPoints];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): Can NOT allocate the subcutaneous fat VOI arrays\");\r\n return;\r\n } \r\n\r\n int numCurves;\r\n VOIContour curve;\r\n for (int sliceIdx = 0; sliceIdx < zDim; sliceIdx++) {\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Extracting VOI for slice: \" +sliceIdx +\" \", ViewJFrameMessage.DEBUG);\r\n long time = System.currentTimeMillis();\r\n\r\n // make a new VOI\r\n VOI sliceVOI = new VOI((short)0, \"SliceVOI\");\r\n \r\n // copy and remove a curve from the 3D image into the 2D image\r\n curve = ((VOIContour)theVOI.getCurves().remove(0));\r\n sliceVOI.importCurve(curve);\r\n sliceImage.registerVOI(sliceVOI);\r\n \r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n \r\n // make a binary image out of the subcutaneousVOI on the 2D VOI\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Making a binary image from the VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n ModelImage binImage = sliceImage.generateBinaryImage(); \r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Smoothing Image with \"+sliceVOI.getNumPoints()+\"points: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n new AlgorithmBSmooth(binImage, sliceVOI, sliceVOI.getNumPoints()/3, true);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // close the binaryImage with a huge structuring element to fill in all the major gaps\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Morphology to the image: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n closeImage(binImage, 61.0f);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // convert the binary image into a VOI\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Extracting the new VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n AlgorithmVOIExtraction VOIExtractionAlgo = new AlgorithmVOIExtraction(binImage);\r\n VOIExtractionAlgo.setRunningInSeparateThread(false);\r\n VOIExtractionAlgo.run();\r\n VOIExtractionAlgo.setCompleted(true);\r\n\r\n\r\n // make sure we got one VOI with one curve\r\n VOIVector vois = binImage.getVOIs();\r\n if(vois.size() != 1) {\r\n System.err.println(\"fixSubcutaneousFatVOIs() Error, did not get 1 VOI for the subcutaneous fat VOI\");\r\n return;\r\n }\r\n \r\n // binImage has one VOI, lets get it\r\n VOI theFixedVOI = vois.get(0);\r\n \r\n // Keep only the largest VOI as the subcutaneous fat\r\n numCurves = theFixedVOI.getCurves().size();\r\n \r\n int maxIdx = 0;\r\n int maxNumPoints = ((VOIContour)theFixedVOI.getCurves().get(maxIdx)).size();\r\n for (int idx = 1; idx < numCurves; idx++) {\r\n if (((VOIContour)theFixedVOI.getCurves().get(idx)).size() > maxNumPoints) {\r\n maxIdx = idx;\r\n }\r\n } // end for (int idx = 0; ...)\r\n for (int idx = numCurves-1; idx >= 0; idx--) {\r\n if (idx != maxIdx) {\r\n theFixedVOI.getCurves().remove(idx);\r\n }\r\n } // end for (int idx = 0; ...)\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n\r\n ViewUserInterface.getReference().getMessageFrame().append(\" Copying the new VOI: \", ViewJFrameMessage.DEBUG);\r\n time = System.currentTimeMillis();\r\n // copy a curve from the 2D image into the 3D image\r\n // new arrays need to be made for each slice because the array size\r\n // is used when importing the curve to the VOI. The extracted VOI\r\n // cannot be determined, unless we resample the subcutaneous VOI\r\n \r\n // resample the subcutaneous fat VOI so it has the same number of\r\n // sampes as the abdomen VOI. Furthermore, the samples will be on a\r\n // throught the center of mass of the abdomen and the abdomen VOI samples\r\n resampleCurve(theFixedVOI, sliceIdx);\r\n curve = ((VOIContour)theFixedVOI.getCurves().get(0));\r\n/*\r\n int[] newXVals;\r\n int[] newYVals;\r\n int[] newZVals;\r\n numPoints = curve.size(); try {\r\n newXVals = new int [numPoints];\r\n newYVals = new int [numPoints];\r\n newZVals = new int [numPoints];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"fixSubcutaneousFatVOIs(): Can NOT allocate the subcutaneous fat VOI arrays\");\r\n return;\r\n } \r\n \r\n curve.exportArrays(newXVals, newYVals, newZVals);\r\n theVOI.importCurve(newXVals, newYVals, newZVals, sliceIdx);\r\n*/\r\n curve.exportArrays(xVals, yVals, zVals);\r\n theVOI.importCurve(xVals, yVals, zVals);\r\n ViewUserInterface.getReference().getMessageFrame().append(+((System.currentTimeMillis() - time)) / 1000.0f +\" sec\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // need to remove the curve because registering a VOI makes a copy of it\r\n sliceVOI.removeCurves();\r\n sliceImage.unregisterAllVOIs();\r\n\r\n } // end for (int sliceIdx = 0; ...)\r\n\r\n //ShowImage(sliceImage, \"sliceImage\");\r\n\r\n }", "public HashMap<Character, float[][]> safeold_calcSquigglePeaks(float ppmTol, String seq, float[] mods, String ionTypes, int maxCharge) {\n\t\tHashMap<Character, float[][]> squigglePeaks = new HashMap<>();\n\n\t\tArrayList<Character> nIonTypes = new ArrayList<>();\n\t\tArrayList<Character> cIonTypes = new ArrayList<>();\n\n\t\tfor (int i = 0; i < ionTypes.length(); i++) {\n\t\t\tchar curIonType = ionTypes.charAt(i);\n\t\t\tif (curIonType == 'a' || curIonType == 'b' || curIonType == 'c')\n\t\t\t\tnIonTypes.add(curIonType);\n\t\t\telse if (curIonType == 'x' || curIonType == 'y' || curIonType == 'z')\n\t\t\t\tcIonTypes.add(curIonType);\n\t\t}\n\n\t\tArrayList<Peak> ps = new ArrayList<>();\n\n\t\t//float iB = 0.0f, iY = 0.0f;\n\t\t//int nB = 0, nY = 0;\n\t\t//int maxCharge = (charge==2)?1:2;\n\t\tfloat [] aaMasses = AAMasses.monoisotopic_masses;\n\t\tfloat [] fragTypeShifts = AAMasses.ionTypeShifts;\n //float[][] tempPeaks;\n\t\tint cLen = seq.length();\n\n\n\t\t//todo see if removing known frags helps .... it helps ish??\n\t\tArrayList<Float> knownFrags = new ArrayList<>();\n\t\t/* float nTermMass;\n\t\tfor (Character iType : nIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tnTermMass = fragTypeShifts[iType - 'a'];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) { //loop through charge states\n\t\t\t\tfloat cmass = AAMasses.monoisotopic_nterm_mass + nTermMass;\n\t\t\t\tfor (int i = 0; i < cLen - 1; i++) { //loop through positions on the peptide\n\t\t\t\t\tcmass += (aaMasses[seq.charAt(i) - 'A'] + mods[i]) / ccharge;\n\t\t\t\t\tknownFrags.add(cmass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfloat cTermMass;\n\t\tfor (Character iType : cIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tcTermMass = fragTypeShifts[iType - 'x' + 3];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) {\n\t\t\t\tfloat cmass = (cTermMass + ccharge * AAMasses.monoisotopic_nterm_mass) / ccharge;\n\t\t\t\tfor (int i = 0; i < cLen - 1; i++) {\n\t\t\t\t\tcmass += (aaMasses[seq.charAt(cLen - 1 - i) - 'A'] + mods[cLen - 1 - i]) / ccharge;\n\t\t\t\t\tknownFrags.add(cmass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t */\n\t\tfloat nTermMass;\n\t\tfor (Character iType : nIonTypes) {\n\t\t ps = new ArrayList<>();\n\t\t\tnTermMass = fragTypeShifts[iType - 'a'];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) { //loop through charge states\n\t\t\t float cmass = AAMasses.monoisotopic_nterm_mass + nTermMass;\n\t\t\t\tfor (int i = 0; i < cLen - 1; i++) { //loop through positions on the peptide\n\t\t\t\t\tcmass += (aaMasses[seq.charAt(i) - 'A'] + mods[i]) / ccharge;\n\t\t\t\t\tfor (int j = 0; j < peakMZ.length; j++) {//loop through peaks in spectrum\n\t\t\t\t\t\t//This block will remove known fragments\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tboolean badFlag = false;\n\t\t\t\t\t\tfor (int k = 0; k < knownFrags.size(); k++) {\n\t\t\t\t\t\t\tif (Math.abs(peakMZ[j] - knownFrags.get(k)) < 0.001) {\n\t\t\t\t\t\t\t\tbadFlag = true;\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 (!badFlag)\n\t\t\t\t\t\t */\n\t\t\t\t\t\t\tps.add(new Peak(peakMZ[j] - cmass, peakInt[j]));\n\t\t\t\t\t\t//ps.add(new Peak(peakMZ[j] - cmass, peakInt[j] / (i + 1)));\n\t\t\t\t\t}\n }\n\t\t\t}\n\t\t\tsquigglePeaks.put(iType, peaksToArray(ps));\n\t\t}\n\n\t\tfloat cTermMass;\n\t\tfor (Character iType : cIonTypes) {\n ps = new ArrayList<>();\n\t\t\tcTermMass = fragTypeShifts[iType - 'x' + 3];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) {\n float cmass = (cTermMass + ccharge * AAMasses.monoisotopic_nterm_mass) / ccharge;\n for (int i = 0; i < cLen - 1; i++) {\n cmass += (aaMasses[seq.charAt(cLen - 1 - i) - 'A'] + mods[cLen - 1 - i]) / ccharge;\n for (int j = 0; j < peakMZ.length; j++) {//loop through peaks in spectrum\n \t//This block will remove known fragments\n /*\n\t\t\t\t\t\tboolean badFlag = false;\n\t\t\t\t\t\tfor (int k = 0; k < knownFrags.size(); k++) {\n\t\t\t\t\t\t\tif (Math.abs(peakMZ[j] - knownFrags.get(k)) < 0.001) {\n\t\t\t\t\t\t\t\tbadFlag = true;\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 (!badFlag)\n\n */\n\t\t\t\t\t\t\tps.add(new Peak(peakMZ[j] - cmass, peakInt[j]));\n\t\t\t\t\t\t//ps.add(new Peak(peakMZ[j] - cmass, peakInt[j] / (i + 1)));\n\t\t\t\t\t}\n }\n }\n squigglePeaks.put(iType, peaksToArray(ps));\n\t\t}\n\t\treturn squigglePeaks;\n\t}", "private void detectParkingSlot()\r\n\t{\t\t\r\n\t\tPoint PosS = new Point(0,0);\r\n\t\tPoint PosE = new Point(0,0);\r\n\t\t\r\n\t\tdouble sum_F = 0;\r\n\t\tdouble sum_B = 0;\r\n\t\t\r\n\t\tdouble distance_F = 0;\r\n\t\tdouble distance_B = 0;\r\n\t\t\r\n\t\tint SlotID = Pk_counter;\r\n\t\tINavigation.ParkingSlot.ParkingSlotStatus SlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\r\n\t\tshort axe = getHeadingAxe();\r\n\t\t\r\n\t\tfor (int i = 1; i <= 4; i++)\r\n\t\t{\r\n\t\t\tPk_DIST_FS[i] = Pk_DIST_FS[i-1];\r\n\t\t\tsum_F = Pk_DIST_FS[i] + sum_F;\r\n\t\t\t\r\n\t\t\tPk_DIST_BS[i] = Pk_DIST_BS[i-1];\r\n\t\t\tsum_B = Pk_DIST_BS[i] + sum_B;\r\n\t\t}\r\n\t\t\r\n\t\tPk_DIST_FS[0] = frontSensorDistance;\r\n\t\t//distance_F = (sum_F + Pk_DIST_FS[0])/5;\r\n\t\tdistance_F = frontSensorDistance;\r\n\t\t\r\n\t\tPk_DIST_BS[0] = backSideSensorDistance;\r\n\t\t//distance_B = (sum_B + Pk_DIST_BS[0])/5;\r\n\t\tdistance_B = backSideSensorDistance;\r\n\t\t\r\n\t\t//LCD.drawString(\"Dist_F: \" + (distance_F), 0, 6);\r\n\t\t//LCD.drawString(\"Dist_B: \" + (distance_B), 0, 7);\r\n\t\t\r\n\t\t// Saving the begin point of the PS\r\n\t\tif ((distance_F <= TRSH_SG) && (Pk_burstFS == 0))\r\n\t\t{\r\n\t\t\tPk_PosF1.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstFS = 1;\r\n\t\t\tPk_burstFE = 0;\r\n\t\t\t//Sound.beep();\r\n\t\t}\r\n\t\t\r\n\t\tif ((distance_B <= TRSH_SG) && (Pk_burstRS == 0))\r\n\t\t{\r\n\t\t\tPk_PosR1.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstRS = 1;\r\n\t\t\tPk_burstRE = 0;\r\n\t\t\t//Sound.twoBeeps();\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// Saving the end point of the PS\r\n\t\tif ((distance_F >= TRSH_SG) && (Pk_burstFE == 0))\r\n\t\t{\r\n\t\t\tPk_PosF2.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstFS = 0;\r\n\t\t\tPk_burstFE = 1;\r\n\t\t\t//Sound.beep();\r\n\t\t}\r\n\t\t\r\n\t\tif ((distance_B >= TRSH_SG) && (Pk_burstRE == 0))\r\n\t\t{\r\n\t\t\tPk_PosR2.setLocation(this.pose.getX(), this.pose.getY());\r\n\t\t\tPk_burstRS = 0;\r\n\t\t\t//burstRE = 1;\r\n\t\t\t//Sound.twoBeeps();\r\n\t\t}\r\n\t\t\r\n\t\tif (Po_RoundF == 0)\t\t\t// Saving new parking slots\r\n\t\t{\t\r\n\t\t\tif ((Pk_burstRS == 0) && (Pk_burstRE == 0) && (Pk_counter < 10))\r\n\t\t\t{\r\n\t\t\t\tPosS.setLocation(((Pk_PosF1.getX() + Pk_PosR1.getX())/2), ((Pk_PosF1.getY() + Pk_PosR1.getY())/2));\r\n\t\t\t\tPosE.setLocation(((Pk_PosF2.getX() + Pk_PosR2.getX())/2), ((Pk_PosF2.getY() + Pk_PosR2.getY())/2));\r\n\t\t\t\t\r\n\t\t\t\t// Evaluation of the slot\r\n\t\t\t\tif (axe == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((PosE.getX() - PosS.getX()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\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\tif ((PosE.getY() - PosS.getY()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_slotList[Pk_counter] = new INavigation.ParkingSlot(SlotID, PosE, PosS, SlotStatus, 0);\r\n\t\t\t\tPk_counter ++;\r\n\t\t\t\t\r\n\t\t\t\tPk_burstRE = 1;\r\n\t\t\t\t\r\n\t\t\t\tSound.beepSequence();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\t\t\t\t\t// Updating the old slots\r\n\t\t{\r\n\t\t\tif ((Pk_burstRS == 0) && (Pk_burstRE == 0) && (Pk_update <= Pk_counter))\r\n\t\t\t{\r\n\t\t\t\tPosS.setLocation(((Pk_PosF1.getX() + Pk_PosR1.getX())/2), ((Pk_PosF1.getY() + Pk_PosR1.getY())/2));\r\n\t\t\t\tPosE.setLocation(((Pk_PosF2.getX() + Pk_PosR2.getX())/2), ((Pk_PosF2.getY() + Pk_PosR2.getY())/2));\r\n\t\t\t\t\r\n\t\t\t\t// Evaluation of the slot\r\n\t\t\t\tif (axe == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((PosE.getX() - PosS.getX()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\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\tif ((PosE.getY() - PosS.getY()) > LGNT_ROBOT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSlotStatus = ParkingSlotStatus.SUITABLE_FOR_PARKING;\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\tSlotStatus = ParkingSlotStatus.NOT_SUITABLE_FOR_PARKING;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_slotList[Pk_update] = new INavigation.ParkingSlot(SlotID, PosE, PosS, SlotStatus, 0);\r\n\t\t\t\t\r\n\t\t\t\tif (Pk_update < Pk_counter)\r\n\t\t\t\t{\r\n\t\t\t\t\tPk_update ++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tPk_update = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPk_burstRE = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn; // data are saved in the shared variable\r\n\t}", "private GeometryCollection computeGeometrySplit( \n final Geometry featureGeometryOnMapCrs,\n final Geometry clippingGeometryOnMapCrs,\n final CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n try {\n // does the difference \n Geometry geoDiff = featureGeometryOnMapCrs.difference(clippingGeometryOnMapCrs);\n assert geoDiff instanceof GeometryCollection;\n \n GeometryCollection geoCollection = (GeometryCollection) geoDiff;\n\n return geoCollection;\n \n } catch (Exception e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "public void mo472g() throws RemoteException {\r\n int i = 0;\r\n if (this.f1761e != null && this.f1762f != null && this.f1763g != null && this.f1767k) {\r\n try {\r\n this.f1772p = false;\r\n MapProjection c = this.f1769m.mo395c();\r\n FPoint fPoint;\r\n if (m2832l()) {\r\n DPoint m = m2833m();\r\n int abs = (int) ((Math.abs(this.f1775s - this.f1774r) * 180.0d) / 3.141592653589793d);\r\n double d = (this.f1775s - this.f1774r) / ((double) abs);\r\n FPoint[] fPointArr = new FPoint[(abs + 1)];\r\n this.f1770n = new float[(fPointArr.length * 3)];\r\n for (int i2 = 0; i2 <= abs; i2++) {\r\n MapProjection mapProjection;\r\n if (i2 == abs) {\r\n fPoint = new FPoint();\r\n this.f1769m.mo352a(this.f1763g.latitude, this.f1763g.longitude, fPoint);\r\n fPointArr[i2] = fPoint;\r\n } else {\r\n mapProjection = c;\r\n fPointArr[i2] = m2831a(mapProjection, (((double) i2) * d) + this.f1774r, m.f3635x, m.f3636y);\r\n }\r\n mapProjection = c;\r\n fPointArr[i2] = m2831a(mapProjection, (((double) i2) * d) + this.f1774r, m.f3635x, m.f3636y);\r\n this.f1770n[i2 * 3] = fPointArr[i2].f3637x;\r\n this.f1770n[(i2 * 3) + 1] = fPointArr[i2].f3638y;\r\n this.f1770n[(i2 * 3) + 2] = 0.0f;\r\n }\r\n this.f1771o = fPointArr.length;\r\n return;\r\n }\r\n FPoint[] fPointArr2 = new FPoint[3];\r\n this.f1770n = new float[(fPointArr2.length * 3)];\r\n fPoint = new FPoint();\r\n this.f1769m.mo352a(this.f1761e.latitude, this.f1761e.longitude, fPoint);\r\n fPointArr2[0] = fPoint;\r\n fPoint = new FPoint();\r\n this.f1769m.mo352a(this.f1762f.latitude, this.f1762f.longitude, fPoint);\r\n fPointArr2[1] = fPoint;\r\n fPoint = new FPoint();\r\n this.f1769m.mo352a(this.f1763g.latitude, this.f1763g.longitude, fPoint);\r\n fPointArr2[2] = fPoint;\r\n while (i < 3) {\r\n this.f1770n[i * 3] = fPointArr2[i].f3637x;\r\n this.f1770n[(i * 3) + 1] = fPointArr2[i].f3638y;\r\n this.f1770n[(i * 3) + 2] = 0.0f;\r\n i++;\r\n }\r\n this.f1771o = fPointArr2.length;\r\n } catch (Throwable th) {\r\n az.m3143a(th, \"ArcDelegateImp\", \"calMapFPoint\");\r\n th.printStackTrace();\r\n }\r\n }\r\n }", "public void processData() {\n\t\t SamReader sfr = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(this.inputFile);\n\t\t \n\t\t\t\n\t\t\t//Set up file writer\n\t\t SAMFileWriterFactory sfwf = new SAMFileWriterFactory();\n\t\t sfwf.setCreateIndex(true);\n\t\t SAMFileWriter sfw = sfwf.makeSAMOrBAMWriter(sfr.getFileHeader(), false, this.outputFile);\n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t//counters\n\t\t\tint totalReads = 0;\n\t\t\tint trimmedReads = 0;\n\t\t\tint droppedReads = 0;\n\t\t\tint dropTrimReads = 0;\n\t\t\tint dropMmReads = 0;\n\t\t\t\n\t\t\t//Containers\n\t\t\tHashSet<String> notFound = new HashSet<String>();\n\t\t\tHashMap<String, SAMRecord> mateList = new HashMap<String,SAMRecord>();\n\t\t\tHashSet<String> removedList = new HashSet<String>();\n\t\t\tHashMap<String,SAMRecord> editedList = new HashMap<String,SAMRecord>();\n\t\t\t\n\t\t\tfor (SAMRecord sr: sfr) {\n\t\t\t\t//Messaging\n\t\t\t\tif (totalReads % 1000000 == 0 && totalReads != 0) {\n\t\t\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Currently storing mates for %d reads.\",totalReads,trimmedReads,droppedReads,mateList.size()));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ttotalReads += 1;\n\t\t\t\t\n\t\t\t\tString keyToCheck = sr.getReadName() + \":\" + String.valueOf(sr.getIntegerAttribute(\"HI\"));\n\t\t\t\n\t\t\t\t//Make sure chromsome is available\n\t\t\t\tString chrom = sr.getReferenceName();\n\t\t\t\tif (!this.refHash.containsKey(chrom)) {\n\t\t\t\t\tif (!notFound.contains(chrom)) {\n\t\t\t\t\t\tnotFound.add(chrom);\n\t\t\t\t\t\tMisc.printErrAndExit(String.format(\"Chromosome %s not found in reference file, skipping trimming step\", chrom));\n\t\t\t\t\t}\n\t\t\t\t} else if (!sr.getReadUnmappedFlag()) {\n\t\t\t\t\tString refSeq = null;\n\t\t\t\t\tString obsSeq = null;\n\t\t\t\t\tList<CigarElement> cigar = null;\n\t\t\t\t\t\n\t\t\t\t\t//Get necessary sequence information depending on orientation\n\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\trefSeq = this.revComp(this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd()));\n\t\t\t\t\t\tobsSeq = this.revComp(sr.getReadString());\n\t\t\t\t\t\tcigar = this.reverseCigar(sr.getCigar().getCigarElements());\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefSeq = this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd());\n\t\t\t\t\t\tobsSeq = sr.getReadString();\n\t\t\t\t\t\tcigar = sr.getCigar().getCigarElements();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get alignments\n\t\t\t\t\tString[] alns = this.createAlignmentStrings(cigar, refSeq, obsSeq, totalReads);\n\t\t\t\t\t\n\t\t\t\t\t//Identify Trim Point\n\t\t\t\t\tint idx = this.identifyTrimPoint(alns,sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\n\t\t\t\t\t//Check error rate\n\t\t\t\t\tboolean mmPassed = false;\n\t\t\t\t\tif (mmMode) {\n\t\t\t\t\t\tmmPassed = this.isPoorQuality(alns, sr.getReadNegativeStrandFlag(), idx);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Create new cigar string\n\t\t\t\t\tif (idx < minLength || mmPassed) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsr.setAlignmentStart(0);\n\t\t\t\t\t\tsr.setReadUnmappedFlag(true);\n\t\t\t\t\t\tsr.setProperPairFlag(false);\n\t\t\t\t\t\tsr.setReferenceIndex(-1);\n\t\t\t\t\t\tsr.setMappingQuality(0);\n\t\t\t\t\t\tsr.setNotPrimaryAlignmentFlag(false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMateUnmapped(mateList.get(keyToCheck)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tremovedList.add(keyToCheck);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t\tdroppedReads += 1;\n\t\t\t\t\t\tif (idx < minLength) {\n\t\t\t\t\t\t\tdropTrimReads += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdropMmReads += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (idx+1 != alns[0].length()) {\n\t\t\t\t\t\ttrimmedReads++;\n\t\t\t\t\t\tCigar oldCig = sr.getCigar();\n\t\t\t\t\t\tCigar newCig = this.createNewCigar(alns, cigar, idx, sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\tsr.setCigar(newCig);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\t\tint newStart = this.determineStart(oldCig, newCig, sr.getAlignmentStart());\n\t\t\t\t\t\t\tsr.setAlignmentStart(newStart);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.verbose) {\n\t\t\t\t\t\t\tthis.printAlignments(sr, oldCig, alns, idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMatePos(mateList.get(keyToCheck),sr.getAlignmentStart()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\teditedList.put(keyToCheck,sr);\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\n\t\t\t\t//System.out.println(sr.getReadName());\n\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t//String rn = sr.getReadName();\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tif (editedList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMatePos(sr,editedList.get(keyToCheck).getAlignmentStart());\n\t\t\t\t\t\t\teditedList.remove(keyToCheck);\n\t\t\t\t\t\t} else if (removedList.contains(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMateUnmapped(sr);\n\t\t\t\t\t\t\tremovedList.remove(keyToCheck);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\t\tsfw.addAlignment(mateList.get(keyToCheck));\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmateList.put(keyToCheck, sr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Of the unmapped, %d were too short and %d had too many mismatches. Currently storing mates for %d reads.\",\n\t\t\t\t\ttotalReads,trimmedReads,droppedReads,dropTrimReads, dropMmReads, mateList.size()));\n\t\t\tSystem.out.println(String.format(\"Reads left in hash: %d. Writing to disk.\",mateList.size()));\n\t\t\tfor (SAMRecord sr2: mateList.values()) {\n\t\t\t\tsfw.addAlignment(sr2);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsfw.close();\n\t\t\ttry {\n\t\t\t\tsfr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t}", "public static List<List> calculateCost(List<List> papa_list){\n /*\n algo for evaluation:\n if contains 2 \n yes - check if also contains 1\n yes - drop it, continue\n no - count # of 2's, add points twice, continue\n no - check if contains 1\n yes - count # of 1's, subtract points, continue\n no - line of 0's - drop it\n */\n\n int points = 0;\n int count =0;\n for(int i=0;i<papa_list.size();i++){\n points = 0;\n List<Integer> temp = papa_list.get(i);\n if(temp.contains(2)){\n if(temp.contains(1)){\n temp.add(points);\n }\n else{\n count =0; \n for(int num : temp){\n if(num==2){\n count++;\n }\n }\n points+=count;\n //playing offensive game: you get more points for attacking (playing to win) rather than defensing (cancelling out opponent's move) \n //temp.add(2*points);\n temp.add(points);\n }\n }\n else if(temp.contains(1)){\n count =0; \n for(int num : temp){\n if(num==1){\n count--;\n }\n }\n points+=count;\n temp.add(points);\n }\n else{\n temp.add(points);\n }\n }\n return papa_list; \n }", "void pointScaleFree() {\n\t\t// offsetP = PVector.sub(P, beginOffsetP); // get the offset (because\n\t\t// mouse isnt' exatly at the pressed point, there a little offset)\n\t\toffset = PVector.sub(P, beginOffset); // calculate the offset made by\n\t\t\t\t\t\t\t\t\t\t\t\t// mouseDrag -- subtract\n\t\t\t\t\t\t\t\t\t\t\t\t// beginOffset from P\n\t\toffsetP = PVector.add(beginOffsetP, offset); // reposition point A based\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the offset made\n\n\t\tleftOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\t\trightOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\n\t\tfloat scaleFactorRight, scaleFactorLeft;\n\t\tscaleFactorRight = rightOppositeLine.X.dist(offsetP) / rightOppositeLine.beginX.dist(beginOffsetP);\n\t\tscaleFactorLeft = leftOppositeLine.X.dist(offsetP) / leftOppositeLine.beginX.dist(beginOffsetP);\n\n\t\t// needs exaplainin drawing\n\t\tPVector tmpR = new PVector();\n\t\tPVector tmpL = new PVector();\n\n\t\tif (rightOppositeLine.isOnThisSideOfLine == rightOppositeLine.checkLineSide(offsetP)) {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t}\n\t\t}\n\n\t\t// needs exaplainin drawing\n\n\t\ttmpL.mult(scaleFactorRight);\n\t\ttmpL.add(leftOppositeLine.end);\n\n\t\ttmpR.mult(scaleFactorLeft);\n\t\ttmpR.add(rightOppositeLine.end);\n\n\t\t// set left neigbor point\n\t\tpoint[neighbor(selectedPoint)[0]].position.set(tmpL);\n\n\t\t// set right neighbor point\n\t\tpoint[neighbor(selectedPoint)[1]].position.set(tmpR);\n\t\tpoint[selectedPoint].position.set(offsetP);\n\t\tselectedLine = -1; // disable line focus\n\t\tupdateGlobalLines();\n\t}", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private final void clipFeatureCollectionUsingClippingFeature( \n final FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollectionToClip,\n final CoordinateReferenceSystem featureToClipCrs, \n final SimpleFeature clippingFeature,\n final CoordinateReferenceSystem clippingCrs, \n final CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n FeatureIterator<SimpleFeature> iter = null;\n try {\n Geometry clippingFeatureGeometry = (Geometry) clippingFeature.getDefaultGeometry();\n\n // iterate for each clipping feature'geometry (general case is collection, particular case only one geometry)\n for(int i=0; i < clippingFeatureGeometry.getNumGeometries(); i++){\n\n Geometry clippingGeometry = clippingFeatureGeometry.getGeometryN(i);\n \n Geometry clippingGeometryOnMap = GeoToolsUtils.reproject(clippingGeometry, \n clippingCrs,\n mapCrs);\n\n // iterates in the collection to clip and does the geometry clip using the clipping geometry \n iter = featureCollectionToClip.features();\n while( iter.hasNext() ) {\n\n checkCancelation();\n\n SimpleFeature featureToClip = iter.next();\n\n // The feature selected to clip could have been changed in previous iteration\n // then is necessary check the \"transaction trak\"\n String fid = featureToClip.getID();\n if( this.transactionTrack.containsKey(fid) ){\n\n // the feature was changed before and requires more changes (clipping)\n clipChangedFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n\n } else {\n // first time that this feature will be precessed\n clipFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n }\n \n getMonitor().worked(1);\n }\n }\n\n } catch (Exception e) {\n\n final String emsg = e.getMessage();\n LOGGER.severe(emsg);\n throw new SOProcessException(emsg);\n\n } finally {\n if (iter != null) {\n featureCollectionToClip.close(iter);\n }\n\n }\n\n }", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "private void movePoint(ArrayList<Point2D.Double> polygon)\n\t{\t\n\t\tfor(int i = 0; i < polygon.size(); ++i)\n\t\t{\n\t\t\tint a = i + 1;\n\t\t\t\n\t\t\t//makes sure we dont try and compare an index that is not there\n\t\t\tif(a > polygon.size() - 1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(pastLine(polygon.get(i), polygon.get(a), currentPoint, moveVec))\n\t\t\t{\t\n\t\t\t\t//counts the number of hits\n\t\t\t\t++hitCount;\n\t\t\t\t//create the norm vector of the wall\n\t\t\t\tPoint2D.Double normalVec = calcNormVec(polygon.get(i).getX(), polygon.get(a).getX(), \n\t\t\t\t\t\tpolygon.get(i).getY(), polygon.get(a).getY());\n\t\t\t\t//gets the unit vec\n\t\t\t\tnormalVec = calcUnitVec(normalVec);\n\t\t\t\t//get the reflection vec\n\t\t\t\tPoint2D.Double reflectionVec = calcReflection(normalVec, moveVec);\n\t\t\t\t//set the old moving vec to the new refelction vec\n\t\t\t\tmoveVec = reflectionVec;\n\t\t\t\t//only allow shape 4 to randomly change the speed after collision\n\t\t\t\tif(shape4)\n\t\t\t\t{\n\t\t\t\t\trandNum = r.nextInt(200 + 1 - 1) + 1;\n\t\t\t\t\trandNum = randNum / 100;\n\t\t\t\t\t//set the movement vecs components\n\t\t\t\t\tmoveVec.setLocation(moveVec.getX() * randNum, moveVec.getY() * randNum);\n\t\t\t\t}\n\t\t\t\t//change the color randomly on a bounce\n\t\t\t\tchangeShapeColor(r.nextInt(255-0) + 0,r.nextInt(255-0), r.nextInt(255-0));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//set the current location of the point;\n\t\tcurrentPoint.setLocation(currentPoint.getX() + moveVec.getX(), currentPoint.getY() + moveVec.getY());\n\t}", "public static void filterGRASSOutput(String line) throws GrassExecutionException {\r\n\r\n boolean skip = false;\r\n\r\n //just process output if we are running grass form a sextante algorithm\r\n if (m_Alg == null) {\r\n return;\r\n }\r\n\r\n //Speedhack: if this is a progress info line, we can skip 99% of the remaining checks!\r\n if (!line.contains(\"GRASS_INFO_PERCENT\")) {\r\n //All other lines need to be processed more elaborately\r\n if ((line.length() < 2)) {\r\n if ((lastWasEmpty == true) || (lastWasInfoEnd == true)) {\r\n skip = true;\r\n }\r\n lastWasEmpty = true;\r\n }\r\n else {\r\n lastWasEmpty = false;\r\n }\r\n\r\n if (insideRegPrimitives == true) {\r\n skip = true;\r\n }\r\n\r\n //substitute lengthy temporary map names\r\n if (line.contains(GrassUtils.TEMP_PREFIX) || line.contains(\"_\")) {\r\n for (int i = 0; i < m_Alg.getMapNames().size(); i++) {\r\n line = line.replace(m_Alg.getMapNames().get(i), \"<\" + m_Alg.getFileNames().get(i) + \">\");\r\n }\r\n //Use a regular expression for those internal map names that cannot be fully resolved\r\n line = line.replaceAll(\"([_][a-z0-9]{8}[_][a-z0-9]{4}[_][a-z0-9]{4}[_][a-z0-9]{4}[_][a-z0-9]{12})\", \"[TMP]\");\r\n }\r\n\r\n //remove the startup script lines\r\n if (line.startsWith(\"set\") || line.startsWith(\"if\") || line.startsWith(\"FOR\")) {\r\n skip = true;\r\n }\r\n //There are some lines that we can always skip (chatter from the\r\n //GRASS batch job script, etc.)\r\n if (line.contains(\"Welcome to GRASS\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Closing monitors ...\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Cleaning up temporary files ...\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"(defined in GRASS_BATCH_JOB variable) was executed.\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"d.mon: not found\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Goodbye from GRASS GIS\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Starting GRASS ...\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Executing '\") && line.contains(\"' ...\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Executing '\") && line.contains(\"' ...\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"r.out.gdal complete.\")) {\r\n skip = true;\r\n }\r\n\r\n //Some data import/export chit-chat about temporary files we may want to shorten...\r\n if (line.contains(\"Building topology for vector map <\")) {\r\n line = \"Building topology for vector map...\";\r\n skip = true;\r\n }\r\n if (line.contains(\"Registering primitives...\")) {\r\n insideRegPrimitives = true;\r\n }\r\n if (line.contains(\" primitives registered\")) {\r\n insideRegPrimitives = false;\r\n skip = false;\r\n }\r\n\r\n //Format GRASS INFO type messages\r\n if (line.contains(\"GRASS_INFO_MESSAGE\")) {\r\n if (!line.contains(\":\")) {\r\n skip = true;\r\n }\r\n else {\r\n if (line.length() >= (line.indexOf(\":\") + 3)) {\r\n line = line.substring(line.indexOf(\":\") + 2);\r\n }\r\n else {\r\n line = \" \";\r\n }\r\n }\r\n }\r\n //If we get an error, we cancel the running module\r\n if (line.contains(\"GRASS_INFO_ERROR\") || line.startsWith(\"ERROR:\")) {\r\n if (!line.contains(\":\")) {\r\n skip = true;\r\n }\r\n else {\r\n if (line.length() >= (line.indexOf(\":\") + 3)) {\r\n line = \"ERROR: \" + line.substring(line.indexOf(\":\") + 2);\r\n }\r\n else {\r\n line = \" \";\r\n }\r\n }\r\n JOptionPane.showMessageDialog(null, line, Sextante.getText(\"grass_error_title\"), JOptionPane.ERROR_MESSAGE);\r\n GrassAlgorithmProvider.addMessage(line);\r\n m_bProcCanceled = true;//simulate a cancellation\r\n Sextante.addErrorToLog(\"SEXTANTE GRASS interface: \" + line);\r\n throw new GrassExecutionException();\r\n }\r\n if (line.contains(\"GRASS_INFO_WARNING\")) {\r\n if (!line.contains(\":\")) {\r\n skip = true;\r\n }\r\n else {\r\n if (line.length() >= (line.indexOf(\":\") + 3)) {\r\n line = \"WARNING: \" + line.substring(line.indexOf(\":\") + 2);\r\n }\r\n else {\r\n line = \" \";\r\n }\r\n }\r\n }\r\n\r\n //After the GRASS_INFO_END tag, there is an annoying newline which we\r\n //want to skip...\r\n if (line.contains(\"GRASS_INFO_END\")) {\r\n lastWasInfoEnd = true;\r\n }\r\n else {\r\n lastWasInfoEnd = false;\r\n }\r\n\r\n //Some warning and error messages that can safely be skipped...\r\n if (line.contains(\"<PROJ_INFO> file not found\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"<PROJ_UNITS> file not found\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"ERROR 6: SetColorTable() only supported\")) {\r\n skip = true;\r\n }\r\n if (line.contains(\"Unable to set projection\")) {\r\n skip = true;\r\n }\r\n }\r\n\r\n //Output whatever is left after filtering.\r\n if (!skip) {\r\n {//Progress monitor output\r\n if (line.contains(\"GRASS_INFO_PERCENT\")) {\r\n //if (Sextante.isUnix() || Sextante.isMacOSX()) {\r\n m_Alg.updateProgress(Integer.valueOf(line.substring(line.indexOf(\":\") + 2)), 100);\r\n //}\r\n }\r\n }\r\n\r\n {//Log output\r\n //For the log, we may need to skip a few more lines.\r\n if (line.contains(\"GRASS_INFO_PERCENT\")) {\r\n if (line.contains(\": 100\")) {\r\n line = \"(100%)\";\r\n }\r\n else {\r\n skip = true;\r\n }\r\n }\r\n if (line.contains(\"GRASS_INFO_END\")) {\r\n skip = true;\r\n }\r\n if (!skip) {\r\n GrassAlgorithmProvider.addMessage(line);\r\n }\r\n }\r\n }\r\n else {\r\n lastWasEmpty = true;\r\n }\r\n }", "private boolean isDisqualified(Application a) {\n\t if( Float.parseFloat(a.getStudent().getGpa()) < 3.0f) {\n\t a.setScore(Application.SCORE_DISQUALIFIED);\n\t a.setDisqualReason(\"Reported GPA too low\");\n\t return true;\n\t }\n /*\n //Eliminate students who are unable to serve all year\n\t //EDIT getServeAllYear() when appropriate field is added to application\n\t if(a.getApprenticeshipInfo().getServeAllYear().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n a.setDisqualReason(\"Students must be able to serve in DLA all year\");\n return true\t\t\n }\n\t \n\t //Eliminate students who do not meet project requirements\n\t //EDIT getMeetRequirements() when field is added to application\n\t if(a.getApprenticeshipInfo().getMeetRequirements().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students must meet project requirements\");\n\t\treturn true;\n\t }\n\t \n\t //Eliminate students in DLA in the past year\n\t //EDIT getGraduateStudent() when field is added to student application\n\t if(a.getApprenticeshipInfo().getGraduateStudent().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Graduate students are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t //PLACEHOLDER\n\t //Eliminate MS/BS students in MS year\n\t //MS/BS students would be eliminated as graduate students above\n\t //However, if separation is required, it can be done here\n\t \n\t //PLACEHOLDER\n\t //Eliminate students not in College of Engineering\n\t //Currently, these students shouldn't be able to apply as their\n\t //majors would not show up under the student application\n\t //majors list\n\t //If this functionality is changed in the future, the following\n\t //can be used to eliminate them, modify getEngineering() when added\n\t //if(a.getStudent.getEngineering.equals(\"No\")){\n // a.setScore(Application.SCORE_DISQUALIFIED);\n\t // a.setDisqualReason(\"Students not in College of Engineering and Applied Science are ineligible\");\n\t //return true;\n\t //}\n\t \n\t //Eliminate graduate students\n\t if(a.getApprenticeshipInfo().getServed().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students who served in the DLA in the past year are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t */\n\t return false;\n\t}", "public HashMap<Character, float[][]> calcSquigglePeaks(float ppmTol, String seq, float[] mods, String ionTypes, String filterIonTypes, int maxCharge) {\n\t\tHashMap<Character, float[][]> squigglePeaks = new HashMap<>();\n\n\t\tArrayList<Character> nIonTypes = new ArrayList<>();\n\t\tArrayList<Character> cIonTypes = new ArrayList<>();\n\n\t\tthis.averageFragMass = new double[ionTypes.length()];\n\t\tint iTypeIndx = 0;\n\n\t\tfor (int i = 0; i < ionTypes.length(); i++) {\n\t\t\tchar curIonType = ionTypes.charAt(i);\n\t\t\tif (curIonType == 'a' || curIonType == 'b' || curIonType == 'c')\n\t\t\t\tnIonTypes.add(curIonType);\n\t\t\telse if (curIonType == 'x' || curIonType == 'y' || curIonType == 'z')\n\t\t\t\tcIonTypes.add(curIonType);\n\t\t}\n\n\t\tArrayList<Peak> ps = new ArrayList<>();\n\n\t\t//float iB = 0.0f, iY = 0.0f;\n\t\t//int nB = 0, nY = 0;\n\t\t//int maxCharge = (charge==2)?1:2;\n\t\tfloat [] aaMasses = AAMasses.monoisotopic_masses;\n\t\tfloat [] fragTypeShifts = AAMasses.ionTypeShifts;\n\t\t//float[][] tempPeaks;\n\t\tint cLen = seq.length();\n\n\t\t//int normFac;\n\t\t//if (PTMShepherd.getParam(\"squiggle_norm\").equals(\"1\"))\n\t\t//\tnormFac = 1;\n\t\t//else\n\t\t//normFac = cLen;\n\t\t//normFac = 1;\n\n\t\tArrayList<Float> knownFrags = calculatePeptideFragments(seq, mods, filterIonTypes, maxCharge, 0.0f);\n\t\t/*\n\t\tfor (Character iType : nIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tnTermMass = fragTypeShifts[iType - 'a'];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) { //loop through charge states\n\t\t\t\tfloat cmass = AAMasses.monoisotopic_nterm_mass + nTermMass; //todo is this appropriate for multiple charge states??\n\t\t\t\tfor (int i = 0; i < cLen - 1; i++) { //loop through positions on the peptide\n\t\t\t\t\tcmass += (aaMasses[seq.charAt(i) - 'A'] + mods[i]) / ccharge;\n\t\t\t\t\tknownFrags.add(cmass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (Character iType : cIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tcTermMass = fragTypeShifts[iType - 'x' + 3];\n\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) {\n\t\t\t\tfloat cmass = (cTermMass + ccharge * AAMasses.monoisotopic_nterm_mass) / ccharge;\n\t\t\t\tfor (int i = 0; i < cLen - 1; i++) {\n\t\t\t\t\tcmass += (aaMasses[seq.charAt(cLen - 1 - i) - 'A'] + mods[cLen - 1 - i]) / ccharge;\n\t\t\t\t\tknownFrags.add(cmass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t*/\n\n\t\tfloat nTermMass;\n\t\tfor (Character iType : nIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tnTermMass = fragTypeShifts[iType - 'a'];\n\t\t\tfor (int j = 0; j < peakMZ.length; j++) {\n\t\t\t\tboolean skipFlag = false;\n\t\t\t\tdouble trueTol = ppmTol * peakMZ[j] / 1000000;\n\t\t\t\tfor (Float ion : knownFrags) {\n\t\t\t\t\tif (Math.abs(peakMZ[j] - ion) < trueTol) {\n\t\t\t\t\t\tskipFlag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if (skipFlag)\n\t\t\t\t//\tcontinue;\n\t\t\t\tArrayList<Peak> cPeaksNaked = new ArrayList<>();\n\t\t\t\t//ArrayList<Peak> cPeaksDmass = new ArrayList<>();\n\t\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) { //loop through charge states\n\t\t\t\t\tfloat cmass = AAMasses.monoisotopic_nterm_mass + nTermMass;\n\t\t\t\t\tfor (int i = 0; i < cLen - 1; i++) { //loop through positions on the peptide\n\t\t\t\t\t\tcmass += (aaMasses[seq.charAt(i) - 'A'] + mods[i]) / ccharge;\n\t\t\t\t\t\tif (skipFlag)\n\t\t\t\t\t\t\tcPeaksNaked.add(new Peak(peakMZ[j] - cmass, 0, (float)trueTol));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcPeaksNaked.add(new Peak(peakMZ[j] - cmass, peakInt[j], (float)trueTol));\n\t\t\t\t\t\t\tthis.averageFragMass[iTypeIndx] += peakMZ[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//cPeaksDmass.add(new Peak(peakMZ[j] - (cmass + dmass), peakInt[j]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//System.out.println(iType+\"\\t\"+ps.size()+\"\\t\"+cPeaksNaked.size());\n\n\t\t\t\t//Collections.sort(cPeaksNaked);\n\t\t\t\t//Collections.sort(cPeaksDmass);\n\t\t\t\tfor(int i = 0; i < cPeaksNaked.size(); i++) {\n\t\t\t\t\tps.add(cPeaksNaked.get(i));\n\t\t\t\t\t//cPeaksDmass.get(i).lossToRemainder(dmass);\n\t\t\t\t\t//ps.add(cPeaksDmass.get(i));\n\t\t\t\t}\n\t\t\t\t//for (Peak p : cPeaks)\n\t\t\t\t//\tSystem.out.println(p.MZ + \"\\t\" + p.Int);\n\t\t\t}\n\t\t\tsquigglePeaks.put(iType, peaksWTolToArray(ps));\n\t\t\tiTypeIndx++;\n\t\t}\n\n\t\tfloat cTermMass;\n\t\tfor (Character iType : cIonTypes) {\n\t\t\tps = new ArrayList<>();\n\t\t\tcTermMass = fragTypeShifts[iType - 'x' + 3];\n\t\t\tfor (int j = 0; j < peakMZ.length; j++) {\n\t\t\t\tboolean skipFlag = false;\n\t\t\t\tfloat trueTol = ppmTol * peakMZ[j] / 1000000;\n\t\t\t\tfor (Float ion : knownFrags) {\n\t\t\t\t\tif (Math.abs(peakMZ[j] - ion) < trueTol) {\n\t\t\t\t\t\tskipFlag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if (skipFlag)\n\t\t\t\t//\tcontinue;\n\t\t\t\tArrayList<Peak> cPeaksNaked = new ArrayList<>();\n\t\t\t\tfor (int ccharge = 1; ccharge <= maxCharge; ccharge++) {\n\t\t\t\t\tfloat cmass = (cTermMass + ccharge * AAMasses.monoisotopic_nterm_mass) / ccharge;\n\t\t\t\t\tfor (int i = 0; i < cLen - 1; i++) {\n\t\t\t\t\t\tcmass += (aaMasses[seq.charAt(cLen - 1 - i) - 'A'] + mods[cLen - 1 - i]) / ccharge;\n\t\t\t\t\t\tif (skipFlag)\n\t\t\t\t\t\t\tcPeaksNaked.add(new Peak(peakMZ[j] - cmass, 0, trueTol));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcPeaksNaked.add(new Peak(peakMZ[j] - cmass, peakInt[j], trueTol));\n\t\t\t\t\t\t\tthis.averageFragMass[iTypeIndx] += peakMZ[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor(int i = 0; i < cPeaksNaked.size(); i++)\n\t\t\t\t\tps.add(cPeaksNaked.get(i));\n\t\t\t}\n\t\t\tsquigglePeaks.put(iType, peaksWTolToArray(ps));\n\t\t\tiTypeIndx++;\n\t\t}\n\t\treturn squigglePeaks;\n\t}", "private void m7635b() {\n if (!this.f6418o) {\n this.f6417n = false;\n this.f6405b.clearAnimation();\n this.f6406c.removeAnnotations();\n List arrayList = new ArrayList();\n for (GridDTO polygons : this.f6414k) {\n arrayList.add(new PolygonOptions().addAll(polygons.getPolygons()).fillColor(Color.parseColor(\"#00bcd4\")).strokeColor(-16728876).alpha(0.5f));\n }\n this.f6406c.addPolygons(arrayList);\n this.f6417n = false;\n }\n }", "private Area shrinkArea(Area area, int amount) {\n\t\tint i = amount;\n\t\ttmpArea4 = (Area) area.clone();\n\t\tdo {\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, 1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, 1);\n\t\t} while (i-- >= 0 && !tmpArea4.isEmpty());\n\t\tif (!tmpArea4.isEmpty()\n\t\t\t\t&& tmpArea4.getBounds().width > INTERACT_SIZE_MIN\n\t\t\t\t&& tmpArea4.getBounds().height > INTERACT_SIZE_MIN)\n\t\t\tarea = tmpArea4;\n\t\tarea.intersect(gameArea);\n\t\treturn area;\n\t}", "public void smallerRocks() {\n\t\t// make the asteroid smaller\n\t\t// by dividing the width by SIZE_INC\n\t\twidth = width / SIZE_INC;\n\n\t\t// set the end points with new location being the first line's start\n\t\tmakeEndPoints(width, outLine[0].getStart().getX(), outLine[0]\n\t\t\t\t.getStart().getY());\n\n\t\t// and make it a little faster\n\t\txSpeed = INC * xSpeed;\n\t\tySpeed = INC * ySpeed;\n\n\t}", "void optimiseSetPointProfile()\n\t{\n\t\tif (this.owner.storageHeater != null)\n\t\t{\n\t\t\toptimiseStorageHeater(this.owner.storageHeater);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"WattboxController:: optimise set point called for agent \" + this.owner.getAgentName());\n\t\t}\n\n\t\t// Initialise optimisation\n\t\tdouble[] localSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tdouble[] deltaT = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(this.priorDayExternalTempProfile));\n\t\tdouble[] localDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\tdouble leastCost = this.evaluateCost(localDemandProfile);\n\t\tdouble newCost = leastCost;\n\t\tdouble maxRecoveryPerTick = 0.5d\n\t\t\t\t* Consts.DOMESTIC_COP_DEGRADATION_FOR_TEMP_INCREASE\n\t\t\t\t* ((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * ArrayUtils.max(deltaT)); // i.e.\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// can't\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// recover\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// more\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// than\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// 50%\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// of\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// heat\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// loss\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// at\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// 90%\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// COP.\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// TODO:\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// Need\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// to\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// code\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// this\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// better\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// later\n\n\t\tfor (int i = 0; i < localSetPointArray.length; i++)\n\t\t{\n\t\t\t// Start each evaluation from the basepoint of the original (user\n\t\t\t// specified) set point profile\n\t\t\tlocalSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tdouble totalTempLoss = 0;\n\t\t\tdouble[] otherPrices = Arrays.copyOf(this.dayPredictedCostSignal, this.dayPredictedCostSignal.length);\n\n\t\t\tfor (int j = 0; (j < Consts.HEAT_PUMP_MAX_SWITCHOFF && (i + j < this.ticksPerDay)); j++)\n\t\t\t{\n\t\t\t\tdouble tempLoss = (((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * Math\n\t\t\t\t\t\t.max(0, (localSetPointArray[i + j] - this.priorDayExternalTempProfile[i + j]))) / this.owner\n\t\t\t\t\t\t.getBuildingThermalMass());\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Temp loss in tick \" + (i + j) + \" = \" + tempLoss);\n\t\t\t\t}\n\t\t\t\ttotalTempLoss += tempLoss;\n\n\t\t\t\tfor (int k = i + j; k < localSetPointArray.length; k++)\n\t\t\t\t{\n\t\t\t\t\tlocalSetPointArray[k] = this.setPointProfile[k] - totalTempLoss;\n\t\t\t\t\t// availableHeatRecoveryTicks++;\n\t\t\t\t}\n\t\t\t\tdouble availableHeatRecoveryTicks = localSetPointArray.length - j;\n\n\t\t\t\t// Sort out where to regain the temperature (if possible)\n\t\t\t\tint n = (int) Math.ceil((totalTempLoss * this.owner.getBuildingThermalMass()) / maxRecoveryPerTick);\n\t\t\t\t// Take this slot out of the potential cheap slots to recover\n\t\t\t\t// temp in.\n\t\t\t\totherPrices[i + j] = Double.POSITIVE_INFINITY;\n\n\t\t\t\tif (n < availableHeatRecoveryTicks && n > 0)\n\t\t\t\t{\n\t\t\t\t\t// We know it's possible to recover the temperature lost\n\t\t\t\t\t// in switch off period under the constraints set.\n\t\t\t\t\tdouble tempToRecover = (totalTempLoss / n);\n\n\t\t\t\t\t// Find the cheapest timeslots in which to recover the\n\t\t\t\t\t// temperature\n\t\t\t\t\t// If this selection results in a tie, the slot is chosen\n\t\t\t\t\t// randomly\n\t\t\t\t\tint[] recoveryIndices = ArrayUtils.findNSmallestIndices(otherPrices, n);\n\n\t\t\t\t\t// Add on temperature in each temperature recovery slot and\n\t\t\t\t\t// all subsequent slots - thus building an optimised\n\t\t\t\t\t// profile.\n\t\t\t\t\tfor (int l : recoveryIndices)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int m = l; m < this.ticksPerDay; m++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalSetPointArray[m] += tempToRecover;\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Adding \" + tempToRecover + \" at index \" + m + \" to counter temp loss at tick \"\n\t\t\t\t\t\t\t\t\t+ (i + j + 1));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Evaluating switchoff for tick zero, set point array = \"\n\t\t\t\t\t\t\t\t\t+ Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"In here, adding temp \" + tempToRecover + \" from index \" + l);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"With result \" + Arrays.toString(localSetPointArray));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdouble[] tempDifference = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(localSetPointArray));\n\n\t\t\t\t\tif (ArrayUtils.max(ArrayUtils.add(ArrayUtils.absoluteValues(tempDifference), ArrayUtils\n\t\t\t\t\t\t\t.negate(Consts.MAX_PERMITTED_TEMP_DROPS))) > Consts.FLOATING_POINT_TOLERANCE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if the temperature drop, or rise, is too great, this\n\t\t\t\t\t\t// profile is unfeasible and we return null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// calculate energy implications and cost for this\n\t\t\t\t\t\t// candidate setPointProfile\n\t\t\t\t\t\tlocalDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(localSetPointArray);\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Calculated demand for set point array turning off at tick \" + i + \" for \"\n\t\t\t\t\t\t\t\t\t+ (j + 1) + \" ticks \" + Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Demand = \" + Arrays.toString(localDemandProfile));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (localDemandProfile != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// in here if the set point profile is achievable\n\t\t\t\t\t\t\tnewCost = this.evaluateCost(localDemandProfile);\n\n\t\t\t\t\t\t\t// Decide whether to swap the new profile with the\n\t\t\t\t\t\t\t// current best one\n\t\t\t\t\t\t\t// based on cost.\n\t\t\t\t\t\t\t// Many strategies are available - here we give two\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\t// Either the new cost must be better by an amount\n\t\t\t\t\t\t\t// greater than some decision threshold\n\t\t\t\t\t\t\t// held in Consts.COST_DECISION_THRESHOLD\n\t\t\t\t\t\t\t// OR (currently used) the cost must simply be\n\t\t\t\t\t\t\t// better, with a tie in cost\n\t\t\t\t\t\t\t// being decided by a \"coin toss\".\n\n\t\t\t\t\t\t\t// if((newCost - leastCost) < (0 -\n\t\t\t\t\t\t\t// Consts.COST_DECISION_THRESHOLD))\n\t\t\t\t\t\t\tif (newCost < leastCost || (newCost == leastCost && RandomHelper.nextIntFromTo(0, 1) == 1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tleastCost = newCost;\n\t\t\t\t\t\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(localSetPointArray, localSetPointArray.length);\n\t\t\t\t\t\t\t\tthis.heatPumpDemandProfile = ArrayUtils\n\t\t\t\t\t\t\t\t\t\t.multiply(localDemandProfile, (1 / Consts.DOMESTIC_HEAT_PUMP_SPACE_COP));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Impossible to recover heat within heat pump\n\t\t\t\t\t\t\t// limits - discard this attempt.\n\t\t\t\t\t\t\tif (this.owner.getAgentID() == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.err.println(\"WattboxController: Can't recover heat with \" + availableHeatRecoveryTicks\n\t\t\t\t\t\t\t\t\t\t+ \" ticks, need \" + 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\t\t\t}\n\t\t}\n\n\t\tthis.expectedNextDaySpaceHeatCost = leastCost;\n\t}", "private void rebuildPolygon() {\n //recalculate new center\n float borderNeeded = mPolygonShapeSpec.hasBorder() ? mPolygonShapeSpec.getBorderWidth() : 0;\n float shadowNeeded = mPolygonShapeSpec.hasShadow() ? mPolygonShapeSpec.getShadowRadius() : 0;\n mPolygonShapeSpec.setCenterX(mPolygonShapeSpec.getDiameter() / 2 + (float) (getPaddingLeft() +\n getPaddingRight()) / 2 + borderNeeded + shadowNeeded);\n mPolygonShapeSpec.setCenterY(mPolygonShapeSpec.getDiameter() / 2 + (float) (getPaddingTop() +\n getPaddingBottom()) / 2 + borderNeeded + shadowNeeded);\n\n if (mPolygonShapeSpec.getNumVertex() < 3)\n return;\n\n mPath = mPolygonShape.getPolygonPath(mPolygonShapeSpec);\n }", "private LineString pickBestGrowthPossibility3(final LineString stem, List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation rise (above the lowest coord) divided by length of line\n\t\t// e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average\n\t\t//Z above the lowest coord will be 7.6m. that value will be divided by the line length\n\t\tfinal AvgElevationSectionFitness avgElevationFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//is end of extension moving away\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//is start of extension moving away\n\t\t\t\t\tboolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1));\n\t\t\t\t\tboolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1));\n\t\t\t\t\tif (a1 != a2) {\n\t\t\t\t\t\treturn a1 ? -1 : 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\t\ttry {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdouble fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength();\n\t\t\t\t\t\t\t\tdouble fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (fit1<0) {\n\t\t\t\t\t\t\t\t\tfit1 = 1/fit1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (fit2<0) {\n\t\t\t\t\t\t\t\t\tfit2 = 1/fit2;\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\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\t\n\t\treturn lookAheads.get(0);\n\t}", "public void spriteClipping(int var1, int var2, int var3, int var4, int var5) {\n try {\n int var6 = this.field_736[var5];\n int var7 = this.field_737[var5];\n int var8 = 0;\n int var9 = 0;\n int var10 = (var6 << 16) / var3;\n int var11 = (var7 << 16) / var4;\n int var12;\n int var13;\n if(this.field_742[var5]) {\n var12 = this.spriteWidthFull[var5];\n var13 = this.field_741[var5];\n var10 = (var12 << 16) / var3;\n var11 = (var13 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var12 - 1) / var12;\n var2 += (this.field_739[var5] * var4 + var13 - 1) / var13;\n if(this.field_738[var5] * var3 % var12 != 0) {\n var8 = (var12 - this.field_738[var5] * var3 % var12 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var13 != 0) {\n var9 = (var13 - this.field_739[var5] * var4 % var13 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var8 >> 16)) / var12;\n var4 = var4 * (this.field_737[var5] - (var9 >> 16)) / var13;\n }\n\n var12 = var1 + var2 * this.field_723;\n var13 = this.field_723 - var3;\n int var14;\n if(var2 < this.field_743) {\n var14 = this.field_743 - var2;\n var4 -= var14;\n var2 = 0;\n var12 += var14 * this.field_723;\n var9 += var11 * var14;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var14 = this.field_745 - var1;\n var3 -= var14;\n var1 = 0;\n var12 += var14;\n var8 += var10 * var14;\n var13 += var14;\n }\n\n if(var1 + var3 >= this.field_746) {\n var14 = var1 + var3 - this.field_746 + 1;\n var3 -= var14;\n var13 += var14;\n }\n\n byte var16 = 1;\n if(this.interlace) {\n var16 = 2;\n var13 += this.field_723;\n var11 += var11;\n if((var2 & 1) != 0) {\n var12 += this.field_723;\n --var4;\n }\n }\n\n this.method_249(this.pixels, this.spritePixels[var5], 0, var8, var9, var12, var13, var3, var4, var10, var11, var6, var16);\n } catch (Exception var15) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "public int removeProtein(double grams) {\n return this.protein -= grams;\n }", "private List<Integer> getInitialCorners_ShortStrawOversegment()\n\t\t\tthrows InvalidParametersException {\n\n\t\t// Store the original stroke\n\t\tStroke resampledStroke = new Stroke(m_stroke);\n\n\t\t// Initial processing (filtering, resampling) on the stroke\n\t\tresampledStroke = cleanStroke(resampledStroke);\n\n\t\tdouble resampledSpacing = determineResampleSpacing(m_stroke.getPoints());\n\n\t\t// The stroke is too short to resample\n\t\tif (resampledStroke.getPathLength() < S_SHORT_STROKE_THRESHOLD\n\t\t\t\t|| resampledStroke.getNumPoints() < IShortStrawThresholds.S_MIN_PTS_THRESHOLD\n\t\t\t\t|| resampledSpacing < IShortStrawThresholds.S_SMALL_RESAMPLE_SPACING_THRESHOLD) {\n\t\t\t// Do nothing...\n\t\t}\n\n\t\t// Resample the stroke\n\t\telse {\n\t\t\tList<Point> points = resamplePoints(resampledStroke,\n\t\t\t\t\tresampledSpacing);\n\t\t\tresampledStroke = new Stroke(points);\n\t\t}\n\n\t\tfinal double MEDIAN_PERCENTAGE = 1.0;\n\n\t\t// Initialize necessary variables\n\t\tdouble[] straws = new double[resampledStroke.getNumPoints()];\n\t\tdouble[] sortedStraws = new double[resampledStroke.getNumPoints()\n\t\t\t\t- (IShortStrawThresholds.S_WINDOW * 2)];\n\n\t\t// Calculate the straws\n\t\tfor (int i = IShortStrawThresholds.S_WINDOW; i < resampledStroke\n\t\t\t\t.getNumPoints() - IShortStrawThresholds.S_WINDOW; i++) {\n\n\t\t\tstraws[i] = resampledStroke.getPoint(\n\t\t\t\t\ti - IShortStrawThresholds.S_WINDOW).distance(\n\t\t\t\t\tresampledStroke\n\t\t\t\t\t\t\t.getPoint(i + IShortStrawThresholds.S_WINDOW));\n\n\t\t\t// For finding the median\n\t\t\tsortedStraws[i - IShortStrawThresholds.S_WINDOW] = straws[i];\n\t\t}\n\n\t\t// Initialize the corner array, with the start point\n\t\tList<Integer> corners = new ArrayList<Integer>();\n\t\tcorners.add(0);\n\n\t\t// Calculate our local minimum thresholds\n\t\tArrays.sort(sortedStraws);\n\t\tdouble medianDist = sortedStraws[sortedStraws.length / 2];\n\t\tdouble threshold = MEDIAN_PERCENTAGE * medianDist;\n\n\t\t// Find the shortest straws\n\t\tfor (int i = IShortStrawThresholds.S_WINDOW; i < straws.length\n\t\t\t\t- IShortStrawThresholds.S_WINDOW; i++) {\n\n\t\t\t// If we are below the median threshold\n\t\t\tif (straws[i] < threshold) {\n\n\t\t\t\tdouble localMinimum = Double.POSITIVE_INFINITY;\n\t\t\t\tint localMinimumIndex = i;\n\n\t\t\t\t// Find only the local minimum\n\t\t\t\t/*\n\t\t\t\t * while (i < straws.length - IShortStrawThresholds.S_WINDOW &&\n\t\t\t\t * straws[i] < threshold) { if (straws[i] < localMinimum) {\n\t\t\t\t * localMinimum = straws[i]; localMinimumIndex = i; }\n\t\t\t\t * \n\t\t\t\t * i++; }\n\t\t\t\t */\n\n\t\t\t\t// Add the index of the local minimum to our list\n\t\t\t\tcorners.add(new Integer(localMinimumIndex));\n\t\t\t}\n\t\t}\n\n\t\t// Add the end point\n\t\tcorners.add(resampledStroke.getNumPoints() - 1);\n\n\t\t// Map the resampled corners to original points\n\t\tList<Integer> allCorners = getOriginalStrokeCorners(corners,\n\t\t\t\tresampledStroke, m_stroke);\n\n\t\treturn allCorners;\n\t}", "private void epilog() {\r\n\r\n code.highlight(14);\r\n /**\r\n * sorts the points in \"ResultList\" by the x coordinates\r\n */\r\n Collections.sort(ResultList, new PointCompare());\r\n\r\n /**\r\n * show the resulting line from ResultList\r\n */\r\n int n_points = ResultList.size();\r\n int n_points_counter = 0;\r\n Node[] bucketPolyline = new Node[2];\r\n while (n_points != 1) {\r\n Point point_curr = ResultList.get(n_points_counter); // get the n'th point\r\n Point point_next = ResultList.get(n_points_counter + 1); // get the n+1'th\r\n // point\r\n\r\n bucketPolyline[0] = new Coordinates(point_curr.x, point_curr.y\r\n + (max_Y - min_Y) + 20);\r\n bucketPolyline[1] = new Coordinates(point_next.x, point_next.y\r\n + (max_Y - min_Y) + 20);\r\n lang.newPolyline(bucketPolyline, \"r_pl\" + (n_points_counter + 1), null,\r\n rPolyline);\r\n n_points_counter++;\r\n n_points--;\r\n }\r\n\r\n lang.nextStep();\r\n\r\n int i = ResultList.size();\r\n int j = points.size();\r\n TextProperties textProps = new TextProperties();\r\n Result = lang.newText(new Coordinates(min_X, 410), \"Result\", \"epsilon\",\r\n null, textProps);\r\n Result.setText(\"Result: the initial line has been reduced from \" + j\r\n + \" to \" + (j - (j - i)) + \" points.\", null, null);\r\n Text rec_calls_t = lang.newText(new Coordinates(min_X, 425), \"rec_calls\",\r\n \"rec_calls\", null, textProps);\r\n rec_calls_t\r\n .setText(\r\n \"There were \"\r\n + (rec_calls - 1)\r\n + \" recursive calls of rdp_func performed to process the initial line!\",\r\n null, null);\r\n\r\n System.out.println(points);\r\n code.unhighlight(14);\r\n\r\n lang.nextStep();\r\n\r\n }", "public static Coordinate[] makeArea(Coordinate[] polyLine, double width) {\n Coordinate vertices[];\n int numPoints = polyLine.length;\n // If there aren't at least two points, return an empty list\n if (numPoints < 2) {\n return new Coordinate[0];\n }\n // We've got at least two points, start initializing\n int numNewPoints = numPoints * 2;\n vertices = new Coordinate[numNewPoints];\n\n Coordinate p1, p2, intersectPoint;\n Coordinate[] perpLine1, perpLine2;\n Coordinate[] prevLine1, prevLine2, parallelLine1, parallelLine2;\n prevLine1 = new Coordinate[2];\n prevLine2 = new Coordinate[2];\n parallelLine1 = new Coordinate[2];\n parallelLine2 = new Coordinate[2];\n\n double meterWidth = width;\n\n // Define line p1p2\n p1 = polyLine[0];\n p2 = polyLine[1];\n // Get a line perpendicular to p1p2 through the first point of input\n // 'polyline'\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n // Keep these two endpoints as part of the final polygon\n vertices[0] = perpLine1[0];\n vertices[numNewPoints - 1] = perpLine1[1];\n\n // Get a line perpendicular to p1p2 through the second point of\n // 'polyline'\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Using these new endpoints, determine the 2 parallel lines that\n // straddle p1p2\n // Since the linePerpendicularThruP1 method always rotates in a\n // clockwise\n // direction, perpLine2 endpoints will be rotated 180 degrees wrt\n // perpLine1 endpoints\n prevLine1[0] = perpLine1[0];\n prevLine1[1] = perpLine2[1];\n prevLine2[0] = perpLine1[1];\n prevLine2[1] = perpLine2[0];\n\n for (int i = 2; i < numPoints; i++) {\n // Define p1p2\n p1 = polyLine[i - 1];\n p2 = polyLine[i];\n // Calculate 2 end lines perpendicular to p1p2 that are 'kmWidth'\n // long\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Calculate 2 lines parallel to p1p2 that are 'kmWidth' apart\n parallelLine1[0] = perpLine1[0];\n parallelLine1[1] = perpLine2[1];\n parallelLine2[0] = perpLine1[1];\n parallelLine2[1] = perpLine2[0];\n\n // Compute the intersections\n intersectPoint = intersection(parallelLine1, prevLine1);\n vertices[i - 1] = intersectPoint;\n intersectPoint = intersection(parallelLine2, prevLine2);\n vertices[numNewPoints - i] = intersectPoint;\n\n // Now stash the current lines as the previous lines for future\n // calcs.\n prevLine1[0] = parallelLine1[0];\n prevLine1[1] = parallelLine1[1];\n prevLine2[0] = parallelLine2[0];\n prevLine2[1] = parallelLine2[1];\n }\n // Now tack on the last perpendicular line\n vertices[numNewPoints / 2 - 1] = perpLine2[1];\n vertices[numNewPoints / 2] = perpLine2[0];\n return vertices;\n }", "public void lowerAmountOfPlattforms(){\n if(plattformsPerChunk > 2 ){\n plattformsPerChunk--;\n\t}\n }", "public static void main(String[] args) {\n // write your code here\n initialize();\n\n\n Sort(profile.getProfile());\n Integer[][][] mas = new Integer[11][11][1];\n\n R.add(Q.pollFirst());\n\n for (Integer[] e : Q) {\n if (DiskCover(e, R, Rant)) {\n R.add(e);\n // Rtmp.add(Q.pollFirst());\n }\n }\n\n FindMaxAngle(R, 0);\n\n Rg = R;\n //Rtmp-R add Q\n list_r.add(R);\n int j = 0;\n boolean flag = false;\n while (!Q.isEmpty()) {\n\n\n list_r.add(FindMaxPolygonCover(Rg));\n\n }\n\n MakePolygon(list_r);\n\n boolean work = true;\n\n do {\n R.clear();\n Gr.getEdge().clear();\n // algorithmConnectivity.setMarketVertexFirst();\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n\n AlgorithmConnectivity algorithmConnectivity = new AlgorithmConnectivity();\n algorithmConnectivity.initializated(Gr.getVertex().size());\n algorithmConnectivity.setMarketVertexFirst();\n algorithmConnectivity.setMarketVertexSecond(i);\n while (algorithmConnectivity.findSecond() != 100) {\n //int a= iterator.next();\n int index = algorithmConnectivity.findSecond();\n algorithmConnectivity.setMarketVertexThird(index);\n algorithmConnectivity = MakeConnection(index, algorithmConnectivity);\n }\n R.add(algorithmConnectivity.getMarket());\n }\n if (!checkConnectionGraf(R)) {\n //MakeConnection(Gr);\n ArrayList<Integer[]> result = new ArrayList<Integer[]>();\n ArrayList<Integer> ver = new ArrayList<Integer>();\n ArrayList<ArrayList<Integer>> v = new ArrayList<ArrayList<Integer>>();\n for (Integer[] p : R) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n ver.clear();\n for (int i = 0; i < p.length; i++) {\n if (p[i] != 1) {\n ver.add(Gr.getVertex().get(i));\n }\n }\n if (ver.size() != 1) {\n // result.add(AddNewRoute(ver));\n // v.add(ver);\n result.addAll(AddNewRoute(ver));\n }\n }\n int minumum = 1000;\n Integer[] place = new Integer[3];\n for (int i = 0; i < result.size(); i++) {\n Integer[] ma = result.get(i);\n if (ma[2] == null) {\n System.out.print(\"\");\n }\n if ((minumum > ma[2]) && (ma[2]) != 0) {\n minumum = ma[2];\n place = ma;\n }\n }\n if (minumum == 1000) {\n for (Integer[] p : R) {\n ver.clear();\n for (int i = 0; i < p.length - 1; i++) {\n if (p[i] == 1) {\n ver.add(Gr.getVertex().get(i));\n }\n }\n result.addAll(AddNewRoute(ver));\n // result.add(AddNewRoute(ver));\n for (int i = 0; i < result.size(); i++) {\n Integer[] ma = result.get(i);\n if (ma[2] == null) {\n System.out.print(\"\");\n }\n if ((minumum > ma[2]) && (ma[2]) != 0) {\n minumum = ma[2];\n place = ma;\n }\n }\n AddNewVertex(place);\n }\n } else {\n AddNewVertex(place);\n }\n } else {\n work = false;\n }\n\n } while (work);\n\n MobileProfile prof = new MobileProfile();\n prof.initialization(Gr.getVertex().size());\n int sum = 0;\n int[][][] massive = profile.getProfile();\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n // sum=sum+massive;\n }\n\n\n zcd = new ZCD();\n\n zcd.setGraphR(Gr);\n\n Iterator<Edges> it = Gr.getEdgeses().iterator();\n boolean fla = false;\n while (it.hasNext()) {\n Edges d = it.next();\n LinkedList<Integer[]> graph_edges = g.getSort_index();\n\n for (int i = 0; i < graph_edges.size(); i++) {\n Integer[] mass = graph_edges.get(i);\n if (checkLine(g.getCoordinate().get(mass[0]), g.getCoordinate().get(mass[1]), Gr.getCoordinate().get(d.getX()), Gr.getCoordinate().get(d.getY()))) {\n if (!fla) {\n Integer[] wr = new Integer[3];\n wr[0] = d.getX();\n wr[1] = d.getY();\n wr[2] = mass[2];\n fla = true;\n zcd.addWrEdges(wr);\n }\n }\n }\n if (!fla) {\n\n Integer[] wr = new Integer[3];\n wr[0] = d.getX();\n wr[1] = d.getY();\n wr[2] = 2;\n\n zcd.addWrEdges(wr);\n\n }\n fla = false;\n }\n\n Edges e = null;\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n int sumwr = 0;\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n for (int k = 0; k < zcd.getWrEdges().size(); k++) {\n\n e = iterator.next();\n if (e.checkEdge(i)) {\n Integer[] m = zcd.getWrEdges().get(k);\n sumwr = sumwr + m[2];\n\n }\n\n }\n wr.add(sumwr);\n\n }\n\n int max = 0;\n int count = 0;\n for (int i = 0; i < wr.size(); i++) {\n if (max < wr.get(i)) {\n max = wr.get(i);\n count = i;\n }\n }\n Integer[] a = new Integer[2];\n a[0] = count;\n a[1] = max;\n zcd.setRoot_vertex(a);\n\n\n int number_vertex = 5;\n //ZTC ztc = new ZTC();\n neig = new int[Gr.getVertex().size()][Gr.getVertex().size()];\n for (int i = 0; i < Gr.getVertex().size(); i++) {\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n while (iterator.hasNext()) {\n e = iterator.next();\n if (e.checkEdge(i)) {\n\n neig[i][e.getY()] = 1;\n }\n }\n }\n ztc.setNeigboor(neig);\n ztc.addTVertex(a[0]);\n Integer[] zero = new Integer[3];\n zero[0] = a[0];\n zero[1] = 0;\n zero[2] = 0;\n verLmtest.add(zero);\n vertex_be = new boolean[Gr.getVertex().size()];\n int root_number = 5;\n while (ztc.getTvertex().size() != Gr.getVertex().size()) {\n\n LinkedList<Edges> q = new LinkedList<Edges>();\n\n\n count_tree++;\n\n\n LinkedList<Integer> vertext_t = new LinkedList<Integer>(ztc.getTvertex());\n while (vertext_t.size() != 0) {\n // for(int i=0; i<count_tree;i++){\n\n number_vertex = vertext_t.pollFirst();\n weight_edges.clear();\n if (!vertex_be[number_vertex]) {\n vertex_be[number_vertex] = true;\n } else {\n continue;\n }\n\n // if(i<vertext_t.size())\n\n\n HashSet<Edges> item = Gr.getEdgeses();\n Iterator<Edges> iterator = item.iterator();\n // while (iterator.hasNext()) {\n for (int k = 0; k < item.size(); k++) {\n e = iterator.next();\n\n if (e.checkEdge(number_vertex)) {\n\n weight_edges.add(zcd.getWrEdges().get(k));\n q.add(e);\n }\n\n if (q.size() > 1)\n q = sort(weight_edges, q);\n\n\n while (!q.isEmpty()) {\n e = q.pollFirst();\n Integer[] lm = new Integer[3];\n\n\n lm[0] = e.getY();\n lm[1] = 1;\n lm[2] = 0;\n boolean add_flag = true;\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getY() == mess[0]) {\n add_flag = false;\n }\n }\n if (add_flag) {\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getX() == mess[0]) {\n mess[2] = mess[2] + 1;\n /* if (e.getX() == root_number) {\n mess[1] = 1;\n } else {\n mess[1] = mess[1] + 1;\n lm[1]=mess[1];\n\n }*/\n verLmtest.set(i, mess);\n break;\n }\n\n }\n for (int i = 0; i < verLmtest.size(); i++) {\n Integer[] mess = verLmtest.get(i);\n if (e.getX() == mess[0]) {\n lm[1] = mess[1] + 1;\n }\n\n }\n\n verLmtest.add(lm);\n } else {\n continue;\n }\n // }\n if (ztc.getTvertex().size() == 1) {\n edgesesTestHash.add(e);\n int x = e.getX();\n int y = e.getY();\n Edges e1 = new Edges(y, x);\n edgesesTestHash.add(e1);\n\n ztc.addEdges(e);\n ztc.addEdges(e1);\n\n ztc.addTVertex(lm[0]);\n // q.removeFirst();\n\n\n } else {\n // edgesTest.add(e);\n int x = e.getX();\n int y = e.getY();\n Edges e1 = new Edges(y, x);\n // disable.add(e);\n // disable.add(e1);\n\n edgesesTestHash.add(e1);\n edgesesTestHash.add(e);\n\n int[][] ad = getNeighboor();\n\n\n if (checkLegal(e, ad)) {\n ztc.addEdges(e);\n ztc.addEdges(e1);\n\n ztc.addTVertex(lm[0]);\n\n // if(q.size()!=0)\n // q.removeFirst();\n } else {\n // q.removeFirst();\n\n Iterator<Edges> edgesIterator = edgesesTestHash.iterator();\n while (edgesIterator.hasNext()) {\n Edges eo = edgesIterator.next();\n if ((eo.getY() == e.getY()) && (eo.getX() == e.getX())) {\n edgesIterator.remove();\n }\n if ((eo.getY() == e1.getY()) && (eo.getX() == e1.getX())) {\n edgesIterator.remove();\n }\n }\n\n verLmtest.removeLast();\n }\n\n\n }\n\n\n }\n\n\n }\n }\n }\n\n ztc.setEdgesesTree(edgesesTestHash);\n ztc.setGr(Gr);\n ConvertDataToJs convertDataToJs=new ConvertDataToJs();\n try {\n convertDataToJs.save(ztc);\n } catch (FileNotFoundException e1) {\n e1.printStackTrace();\n }\n\n System.out.print(\"\");\n\n }", "private int deshapeNormalize(char[] dest, int start, int length) {\n int lacount = 0;\n int yehHamzaComposeEnabled = 0;\n int seenComposeEnabled = 0;\n\n yehHamzaComposeEnabled = ((options&YEHHAMZA_MASK) == YEHHAMZA_TWOCELL_NEAR) ? 1 : 0;\n seenComposeEnabled = ((options&SEEN_MASK) == SEEN_TWOCELL_NEAR)? 1 : 0;\n\n for (int i = start, e = i + length; i < e; ++i) {\n char ch = dest[i];\n\n if( (yehHamzaComposeEnabled == 1) && ((ch == HAMZA06_CHAR) || (ch == HAMZAFE_CHAR))\n && (i < (length - 1)) && isAlefMaksouraChar(dest[i+1] )) {\n dest[i] = SPACE_CHAR;\n dest[i+1] = YEH_HAMZA_CHAR;\n } else if ( (seenComposeEnabled == 1) && (isTailChar(ch)) && (i< (length - 1))\n && (isSeenTailFamilyChar(dest[i+1])==1) ) {\n dest[i] = SPACE_CHAR;\n }\n else if (ch >= '\\uFE70' && ch <= '\\uFEFC') {\n if (isLamAlefChar(ch)) {\n ++lacount;\n }\n dest[i] = (char)convertFEto06[ch - '\\uFE70'];\n }\n }\n return lacount;\n }", "private void m13727b(C3637a c3637a) throws ParserException {\n DrmInitData drmInitData;\n C3637a c3637a2 = c3637a;\n int i = 0;\n boolean z = true;\n C2289a.m8314b(this.f11087f == null, \"Unexpected moov box.\");\n if (r0.f11089h != null) {\n drmInitData = r0.f11089h;\n } else {\n drmInitData = m13706a(c3637a2.aR);\n }\n C3637a e = c3637a2.m13753e(C2087a.f5826M);\n SparseArray sparseArray = new SparseArray();\n int size = e.aR.size();\n long j = -9223372036854775807L;\n for (int i2 = 0; i2 < size; i2++) {\n C3638b c3638b = (C3638b) e.aR.get(i2);\n if (c3638b.aP == C2087a.f5864y) {\n Pair b = m13723b(c3638b.aQ);\n sparseArray.put(((Integer) b.first).intValue(), b.second);\n } else if (c3638b.aP == C2087a.f5827N) {\n j = m13731c(c3638b.aQ);\n }\n }\n SparseArray sparseArray2 = new SparseArray();\n int size2 = c3637a2.aS.size();\n int i3 = 0;\n while (i3 < size2) {\n int i4;\n int i5;\n e = (C3637a) c3637a2.aS.get(i3);\n if (e.aP == C2087a.f5817D) {\n i4 = i3;\n i5 = size2;\n Track a = C2092b.m7483a(e, c3637a2.m13752d(C2087a.f5816C), j, drmInitData, (r0.f11086e & 16) != 0, false);\n if (a != null) {\n sparseArray2.put(a.f5803a, a);\n }\n } else {\n i4 = i3;\n i5 = size2;\n }\n i3 = i4 + 1;\n size2 = i5;\n }\n int size3 = sparseArray2.size();\n if (r0.f11090i.size() == 0) {\n while (i < size3) {\n Track track = (Track) sparseArray2.valueAt(i);\n C2085b c2085b = new C2085b(r0.f11082H.track(i, track.f5804b));\n c2085b.m7466a(track, (C2093c) sparseArray.get(track.f5803a));\n r0.f11090i.put(track.f5803a, c2085b);\n r0.f11075A = Math.max(r0.f11075A, track.f5807e);\n i++;\n }\n m13724b();\n r0.f11082H.endTracks();\n return;\n }\n if (r0.f11090i.size() != size3) {\n z = false;\n }\n C2289a.m8313b(z);\n while (i < size3) {\n track = (Track) sparseArray2.valueAt(i);\n ((C2085b) r0.f11090i.get(track.f5803a)).m7466a(track, (C2093c) sparseArray.get(track.f5803a));\n i++;\n }\n }", "public SimpleFeatureCollection simplify(SimpleFeatureCollection bus_links) {\r\n\t\t\r\n\t\t//lists hold simplified and split slope segments\r\n\t\tList<SimpleFeature> simpleSlopes = new ArrayList<SimpleFeature>();\r\n\t List<SimpleFeature> segmentsSlopes = new ArrayList<SimpleFeature>();\r\n\t\t\r\n\t\t//list to hold the assigned rids of the segments\r\n\t \tList<Integer> assigned = new ArrayList<Integer>();\r\n\t \t\r\n\t\t//collections to lists\r\n\t\tList<SimpleFeature> intersections = FeatureOperations.featureCollectionToList(this.intersections);\r\n\t\tList<SimpleFeature> slopeLinks = FeatureOperations.featureCollectionToList(this.getSlopeLinks());\r\n\t\tList<SimpleFeature> slopeLiftLinks = FeatureOperations.featureCollectionToList(this.getLinks());\r\n\t\tList<SimpleFeature> busLinks = (bus_links != null) ? FeatureOperations.featureCollectionToList(bus_links) : null;\r\n\t\t\r\n\t\t//INTERSECTIONS USING KDTREE\r\n\t\t//create spatial index to contain all intersections\r\n\t\tfinal KdTree pointIndex = new KdTree();\r\n\t\tfor (SimpleFeature intersection: intersections) {\r\n\t\t\tpointIndex.insert(((Geometry)intersection.getDefaultGeometry()).getCoordinate(), intersection);\r\n\t\t}\r\n\t\tif (pointIndex.isEmpty()) {\r\n\t\t\tLogger.getLogger(SlopeLinkMatching.class.getName()).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t\tLogger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t}\r\n\t\t\r\n\t\t//SLOPE LINKS, SLOPE LIFT LINKS AND BUS LINKS USING STRTREE\r\n\t\tfinal SpatialIndex lineIndex = new STRtree();\r\n\t\t//insert all slope links\r\n\t\tfor (SimpleFeature link: slopeLinks) {\r\n\t\t\tEnvelope linkEnvelope = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope, link);\r\n\t\t}\r\n\t\t//insert all slopeLift links\r\n\t\tfor (SimpleFeature link: slopeLiftLinks) {\r\n\t\t\tEnvelope linkEnvelope2 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope2, link);\r\n\t\t}\r\n\t\t//insert all bus links\r\n\t\tif (busLinks!=null) {\r\n\t\t\tfor (SimpleFeature link: busLinks) {\r\n\t\t\t\tEnvelope linkEnvelope3 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\t\tlineIndex.insert(linkEnvelope3, link);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//KEEP INTERSECTING LINKS FOR EACH SLOPE\r\n\t\tfor (SimpleFeature slope_original: this.getFeatures_in()) {\r\n\t\t\t\r\n//if (!slope_original.getAttribute(\"DE_GR_L_1\").equals(\"Sportgastein\")) continue;\r\n\r\n\t\t\t//fetch slope geometry as LengthIndexedLine\r\n\t\t\tGeometry slopeGeom = (Geometry) slope_original.getDefaultGeometry();\r\n\t\t\tLengthIndexedLine lengthLine = new LengthIndexedLine(slopeGeom);\r\n\t\t\t\r\n\t\t\t//get envelope and expand by 5.00 meters\r\n\t\t\tEnvelope search = new Envelope(slopeGeom.getEnvelopeInternal()); \r\n\t\t\tsearch.expandBy(5.00);\r\n\r\n\t\t\t//Vertex ordered Map as index on lengthLine and corresponding coordinate\r\n\t\t\tMap<Double, Coordinate> newVertices = new TreeMap<Double, Coordinate>();\r\n\t\t\t//insert start and end-point\r\n\t\t\tnewVertices.put(lengthLine.getStartIndex(), lengthLine.extractPoint(lengthLine.getStartIndex()));\r\n\t\t\tnewVertices.put(lengthLine.getEndIndex(), lengthLine.extractPoint(lengthLine.getEndIndex()));\r\n\r\n\t\t\t/*------------------------ INTERSECTIONS ------------------------*/\r\n\t\t\t//fetch intersections in the slope envelope\r\n\t\t\tList<?> neighbourIntersections = pointIndex.query(search);\r\n\t\t\t\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following intersections: \");\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through intersections and keep only those on line (using distance threshold)\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\t//get geometry and coordinate\r\n\t\t\t\tGeometry geom = (Geometry) ((SimpleFeature)((KdNode )inters).getData()).getDefaultGeometry();\r\n\t\t\t\tCoordinate coord = geom.getCoordinate();\r\n\t\t\t\t//check if intersection is on line (using distance with threshold 1cm)\r\n\t\t\t\tif (slopeGeom.distance(geom) < 0.001) {\r\n\t\t\t\t\tdouble index = lengthLine.indexOf(coord);\r\n\t\t\t\t\t//add it if not already contained\r\n\t\t\t\t\tif(!newVertices.containsKey(index) && !newVertices.containsValue(coord)) {\r\n\t\t\t\t\t\tnewVertices.put(index, coord);\r\n\t\t\t\t\t}\r\n//\t\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" \r\n//\t\t\t\t\t+ ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\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/*------------------------ LINKS ------------------------*/\r\n\t\t\t//fetch links in the envelope\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<SimpleFeature> neighbourLinks = lineIndex.query(search);\r\n\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following links: \");\r\n\t\t\tfor (SimpleFeature link: neighbourLinks) {\r\n\t\t\t\tSystem.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through links and keep only those on line (using distance threshold)\r\n\t\t\tfor (SimpleFeature link : neighbourLinks) {\t\t\t\t\r\n\t\t\t\tGeometry linkGeom = (Geometry) link.getDefaultGeometry();\r\n\t\t\t\t//filter out links not intersecting with slope\r\n\t\t\t\tif(slopeGeom.distance(linkGeom) < 0.05) {\r\n\t\t\t\t\tCoordinate[] linkCoords = linkGeom.getCoordinates();\r\n\t\t\t\t\t//check which link end-point is on line (using distance with threshold 5cm) and add if not already contained\r\n\t\t\t\t\tfor (Coordinate linkCoord: linkCoords) {\r\n\t\t\t\t\t\tif (slopeGeom.distance(FeatureMatching.geomOps.coordinateToPointGeometry(linkCoord)) < 0.05 && !newVertices.containsValue(linkCoord)) {\r\n\t\t\t\t\t\t\tnewVertices.put(lengthLine.indexOf(linkCoord), linkCoord);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t//System.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*-------------------------------------------------------*/\r\n\t\t\t\r\n\t\t\t//new coordinate list from kept indices, for the creation of the simplified feature\r\n\t\t\tList<Coordinate> simplifiedCoords = new ArrayList<Coordinate>();\r\n\t\t\tfor (Entry<Double, Coordinate> entry: newVertices.entrySet()){\r\n\t\t\t\tif (!simplifiedCoords.contains(entry.getValue()))\r\n\t\t\t\tsimplifiedCoords.add(entry.getValue());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//use the simplified coordinates to split original bus geometry to its bus segments at topologic nodes\r\n\t\t\t//geometry must be preserved\r\n\t\t\t//semantic attributes must be preserved\r\n\t\t\t// r_id attribute must be added\r\n\t\t\tArrayList<SimpleFeature> splitSegments = FeatureMatching.featOps.splitFeatureAtCoordinates(slope_original, simplifiedCoords);\r\n\t\t\t\r\n\t\t\t//create new feature and add to feature collection\r\n\t\t\tSimpleFeatureType simplifiedType = FeatureOperations.makeLineStringFeatureType(this.getFeatures_in()[0].getFeatureType().getCoordinateReferenceSystem(), \"merged_pivots\");\r\n\t\t\tSimpleFeature simplifiedSlope = FeatureMatching.featOps.getFeatureFromCoordinates(simplifiedType, simplifiedCoords.toArray(new Coordinate[0]));\r\n\t\t \tString deName = slope_original.getAttribute(\"DE_GR_L_0\").toString() + \" \" + slope_original.getAttribute(\"DE_GR_L_1\").toString();\r\n\t\t \t//split feature at remaining vertices to line segments (for each vertex pair)\r\n\t\t \tArrayList<SimpleFeature> simpleSegments = FeatureMatching.featOps.splitFeatureAtVertices(simplifiedSlope);\r\n\t\t \t//rids building\r\n\t\t \tint segmentNumber = 1;\r\n//if(splitSegments.size() != simpleSegments.size()) {\t\t \t\r\n//System.out.println(slope_original.getAttribute(\"XML_GID\").toString() + \": \" +splitSegments.size() + \" / \" + simpleSegments.size());\t\r\n//System.exit(0);\r\n//}\t\t\t\r\n\t\t \tfor (SimpleFeature simpleSegment: simpleSegments) {\r\n\t\t \t\tGeometry segment_geom = (Geometry) simpleSegment.getDefaultGeometry();\r\n\t\t \t\tCoordinate[] segment_coords = segment_geom.getCoordinates(); \r\n\t\t \t\t//indexedLineGeom to getLength\r\n\t\t \t\tdouble length = lengthLine.extractLine(lengthLine.indexOf(segment_coords[0]), lengthLine.indexOf(segment_coords[1])).getLength();\r\n\t\t \t\t//in case segment has zero length ignore it and proceed to the next\r\n\t\t \t\tif (length == 0.0) continue;\t//{System.err.println(length);}\r\n\t\t \t\tdouble cost_1, cost_2, cost_3, r_cost_1, r_cost_2, r_cost_3;\r\n if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 1) {\r\n r_cost_1 = length; r_cost_2 = 10 * length; r_cost_3 = 15 * length;\r\n cost_1 = length; cost_2 = 10 * length; cost_3 = 15 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 2) {\r\n r_cost_1 = 5 * length; r_cost_2 = length; r_cost_3 = 5 * length;\r\n cost_1 = 5 * length; cost_2 = length; cost_3 = 5 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 3) {\r\n r_cost_1 = 15 * length; r_cost_2 = 10 * length; r_cost_3 = length;\r\n cost_1 = 15 * length; cost_2 = 10 * length; cost_3 = length;\r\n } else {\r\n r_cost_1 = length; r_cost_2 = length; r_cost_3 = length;\r\n cost_1 = length; cost_2 = length; cost_3 = length;\r\n }\r\n \r\n\t\t \t\t//build unique r_id\r\n int slopeNumber = Integer.parseInt(slope_original.getAttribute(\"XML_GID\").toString());\r\n\t\t \t\tint rid = Integer.parseInt(\"1\"+ digitRectifier(slopeNumber, 5) + digitRectifier(segmentNumber, 3));\r\n\t\t \t\twhile (assigned.contains(rid)) {\r\n\t\t \t\t\trid++;\r\n\t\t \t\t\tsegmentNumber++;\r\n\t\t \t\t}\r\n\t\t \t\tassigned.add(rid);\r\n\t\t \t\tsegmentNumber++;\r\n\t\t \t\t//pass computed r_id to the corresponded split segment\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"r_id\", rid);\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n \r\n\t\t\t \tMap <String, Object> attrs = new LinkedHashMap<String, Object>();\r\n\t\t\t \tattrs.put(\"XML_TYPE\", \"slopes\");\r\n\t\t\t \tattrs.put(\"de_name\", deName);\r\n\t\t\t \tattrs.put(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n\t\t\t \tattrs.put(\"source\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"target\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"duration\", Double.parseDouble(\"0\")); //duration 0 for slopes\r\n\t\t\t \tattrs.put(\"length\", length); \r\n\t\t\t \tattrs.put(\"r_length\", length); \r\n attrs.put(\"r_rev_c\", (double) -1);\r\n attrs.put(\"rev_c\", (double) -1);\r\n\t\t\t \tattrs.put(\"cost_1\", cost_1);\r\n\t\t\t \tattrs.put(\"cost_2\", cost_2);\r\n\t\t\t \tattrs.put(\"cost_3\", cost_3);\r\n\t\t\t \tattrs.put(\"r_cost_1\", r_cost_1);\r\n\t\t\t \tattrs.put(\"r_cost_2\", r_cost_2);\r\n\t\t\t \tattrs.put(\"r_cost_3\", r_cost_3);\r\n\t\t\t \tattrs.put(\"open\", (int) 0);\r\n\t\t\t \tattrs.put(\"start_z\", segment_coords[0].z/10);\r\n\t\t\t \tattrs.put(\"end_z\", segment_coords[segment_coords.length-1].z/10);\r\n\t\t\t\tattrs.put(\"r_id\", rid);\r\n\t\t\t\t//add attributes\r\n\t\t\t\tfor (Map.Entry<String, Object> attribute : attrs.entrySet()){\r\n\t\t\t\t\tsimpleSegment = FeatureOperations.addAttribute(simpleSegment, attribute.getKey(), attribute.getValue());\r\n\t\t\t\t\tsimpleSegment.setAttribute(attribute.getKey(), attribute.getValue());\r\n\t\t\t\t}\r\n\t\t\t\tsimpleSlopes.add(simpleSegment);\r\n\t\t \t}\r\n\t\t \tsegmentsSlopes.addAll(splitSegments);\r\n\r\n\t\t\t//CONTROL METHOD PRINTS OUT SLOPE WITH NO CONNECTIONS\r\n/*\t\t\tif (neighbourLinks.size() == 0 && neighbourIntersections.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links and no intersections\");\r\n\t\t\t} else if (neighbourLinks.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links\");\r\n\t\t\t}*/\r\n\t\t\t//TODO:METHOD END PRINT RESULT TO FILE\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//create segments_buses shapeFile\r\n\t\tSimpleFeatureCollection newSlopeSegments = new ListFeatureCollection(segmentsSlopes.get(0).getFeatureType(), segmentsSlopes);\r\n\t\tFileOperations.createShapeFile(newSlopeSegments, StartConfiguration.getInstance().getFolder_out() + \"segments_slopes.shp\");\t\r\n\t\t//return feature collection\r\n\t\tSimpleFeatureCollection simplifiedSlopes = new ListFeatureCollection(simpleSlopes.get(0).getFeatureType(), simpleSlopes);\r\n\t\t\r\n\t\t\r\n\t\treturn simplifiedSlopes;\r\n\t}", "void fucusLocks() {\n\t\t// check if mouse is inside the polygon\n\t\tif (checkPointInsidePolygon(point, P)) {\n\t\t\tstate = State.DRAG_AREA;\n\t\t} else\n\t\t\tstate = State.ROTATE;\n\n\t\t// check if mouse is close to the line\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tif (line[i].pointCloseToLine() && !mouseLockedToLine) {\n\t\t\t\tselectedLine = i;\n\t\t\t\tswitch (lineMode) {\n\t\t\t\tcase 0:\n\t\t\t\t\tstate = State.SCALE_PROPORTIONALLY_LINE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tstate = State.DRAG_FREE_LINE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check if mouse is close to the point\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tif (point[i].isFocusedOnThePoint())\n\t\t\t\tswitch (pointMode) {\n\t\t\t\tcase 0:\n\t\t\t\t\tstate = State.SCALE_FREE_POINT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tstate = State.DRAG_FREE_POINT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tstate = State.SCALE_PORPORTIONALLY_POINT;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t}", "public void removeLines() {\n int compLines = 0;\n int cont2 = 0;\n\n for(cont2=20; cont2>0; cont2--) {\n while(completeLines[compLines] == cont2) {\n cont2--; compLines++;\n }\n this.copyLine(cont2, cont2+compLines);\n }\n\n lines += compLines;\n score += 10*(level+1)*compLines;\n level = lines/20;\n if(level>9) level=9;\n\n for(cont2=1; cont2<compLines+1; cont2++) copyLine(0,cont2);\n for(cont2=0; cont2<5; cont2++) completeLines[cont2] = -1;\n }", "private void decorateMountainsFloat(int xStart, int xLength, int floor, boolean enemyAddedBefore, ArrayList finalListElements, ArrayList states)\r\n\t {\n\t if (floor < 1)\r\n\t \treturn;\r\n\r\n\t // boolean coins = random.nextInt(3) == 0;\r\n\t boolean rocks = true;\r\n\r\n\t //add an enemy line above the box\r\n\t Random r = new Random();\r\n\t boolean enemyAdded=addEnemyLine(xStart + 1, xLength - 1, floor - 1);\r\n\r\n\t int s = 1;\r\n\t int e = 1;\r\n\r\n\t if(enemyAdded==false && enemyAddedBefore==false)\r\n\t {\r\n\t if (floor - 2 > 0){\r\n\t if ((xLength - e) - (xStart + s) > 0){\r\n\t for(int x = xStart + s; x < xLength- e; x++){\r\n\t \tboolean flag=true;\r\n\t \tfor(int i=0;i<states.size();i++)\r\n\t \t{\r\n\t \t\tElements element=(Elements)finalListElements.get(i);\r\n\t \t\t\tBlockNode state=(BlockNode)states.get(i);\r\n\t \t\t\t\r\n\t \t\t\tint xElement = (int)(initialStraight+state.getX());\r\n\t \t int floorC= (int)state.getY()+1;\r\n\t \t int widthElement=element.getWidth();\r\n\t \t int heigthElement=element.getHeigth()+2;\r\n\t \t \r\n\t \t int widthElementNext=1;\r\n\t \t int heigthElementNext=0;\r\n\t \t \r\n\t \t if(x+(widthElementNext-1)>=xElement && x<xElement+widthElement && (floor-1)-heigthElementNext<=floorC && (floor-1)>= floorC-heigthElement )\r\n\t \t {\r\n\t \t \tflag=false;\r\n\t \t \tbreak;\r\n\t \t }\r\n\t \t \t \t \t\t \t \r\n\t \t } \r\n\t \tif(flag==true)\r\n\t \t{\r\n\t \t\tsetBlock(x, floor - 1, COIN);\r\n\t \t}\r\n\t \r\n\t //COINS++;\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t s = random.nextInt(4);\r\n\t e = random.nextInt(4);\r\n\t \r\n\t //this fills the set of blocks and the hidden objects inside them\r\n\t /*\r\n\t if (floor - 4 > 0)\r\n\t {\r\n\t if ((xLength - 1 - e) - (xStart + 1 + s) > 2)\r\n\t {\r\n\t for (int x = xStart + 1 + s; x < xLength - 1 - e; x++)\r\n\t {\r\n\t if (rocks)\r\n\t {\r\n\t if (x != xStart + 1 && x != xLength - 2 && random.nextInt(3) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_POWERUP);\r\n\t //BLOCKS_POWER++;\r\n\t }\r\n\t else\r\n\t {\t//the fills a block with a hidden coin\r\n\t setBlock(x, floor - 4, BLOCK_COIN);\r\n\t //BLOCKS_COINS++;\r\n\t }\r\n\t }\r\n\t else if (random.nextInt(4) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (2 + 1 * 16));\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (1 + 1 * 16));\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_EMPTY);\r\n\t //BLOCKS_EMPTY++;\r\n\t }\r\n\t }\r\n\t }\r\n\t //additionElementToList(\"Block\", 1,(xLength - 1 - e)-(xStart + 1 + s));\r\n\t }\r\n\t \r\n\t }*/\r\n\t }", "double find_cg_xpos () { // vertical ref point is fuse level (at ref_point_xpos)\n double lift = foil_lift();\n double drag = total_drag();\n\n double driving_force = drag; // drag equals driving force - steady equilibrium condition\n\n // driving_arm for rider tranferring the force to the board is subtle:\n // When the riders transfers the driving force from hands/harness into\n // the board, the derived vertical driving arm is at the board deck\n // height. the rider applies the weight there also at certain\n // location. when drive is not through rider's body, then the arm is\n // that plus DRIVING_FORCE_HEIGHT\n double pitch_rad = Math.toRadians(craft_pitch);\n // driving_arm is pitch-corrected vertical distance from the origin. To\n // recap, the origin is chosen, arbitrarily, to be at the top of mast LE.\n double rider_eff_cg_pos_arm = (Math.cos(pitch_rad)*(strut.span + BOARD_THICKNESS) + \n -dash.cg_pos * // remember that the 'fore' direction is negative and this 'extends the arm'\n Math.sin(pitch_rad) );\n double driving_arm = \n craft_type != EFOIL \n ? rider_eff_cg_pos_arm\n : (Math.cos(pitch_rad)*DRIVING_FORCE_HEIGHT);\n double rider_air_resistance_arm = rider_eff_cg_pos_arm + RIDER_CG_HEIGHT;\n\n // strut_drag_arm\n double strut_drag_arm = // TODO angle correction\n (1- alt_val/100) * strut.span * // this is the length of water immersed section fo the strut.\n 0.5; // drag center is at the center of the immersed section\n\n // the moments caused by the drag of the wings and the fuse (but not the\n // strut) can be for now ignored thanks to the ref point chosen; more\n // accurate calc shoud include (a) craft AoA and (b) Z offsetts to calc\n // that. double wing_drag_moment = 0, stab_drag_moment = 0,\n // fuse_drag_moment = 0;\n \n // board weight arm is board weight location length minus mast LE to transom\n // TODO angle correction \n double board_arm = // tangential arm at 90 degrees to gravity\n BOARD_CG_K * BOARD_LENGTH - MAST_LE_TO_TRANSOM;\n\n double rig_arm = WS_MASTBASE_MAST_LE/2; // approx // TODO angle correction\n\n // drive_moment: for kite or sail it is always CCW (we look from the\n // left side). for EFOIL driving_arm is a negative value, so effectively\n // drive_moment becomes CW-rotating, and as the result would cause more\n // pronounced displacementof the driver body forward as the speed\n // increses, augmented by the wind drag on the body.\n double drive_moment = \n in.opts.ignore_drive_moment ? 0 : driving_force * driving_arm;\n double rider_air_resistance_moment = rider_air_resistance_arm * rider.drag;\n double board_drag_moment = (rider_eff_cg_pos_arm - BOARD_THICKNESS/2) // aprrox\n * board.drag;\n\n double strut_drag_moment = in.opts.ignore_drag_moments ? 0 : strut.drag * strut_drag_arm;\n double board_vert_moment = BOARD_WEIGHT * board_arm;\n double rig_moment = RIG_WEIGHT * rig_arm;\n double foils_Cm_moments = // all same sign because all rotate 'in plane'\n convert_moments_to_AC_offset \n ? 0\n : (wing.moment +\n stab.moment + \n fuse.moment);\n\n // Suppose rider_moment is +CW, it is with the arm towards the transom from mast bottom LE.\n // rider_moment + CW_moments = CCW_moments ==>\n // rider_arm = (CCW_moments - CW_moments) / load\n // where load is not rider's weigth but the load value (from the load slider)\n //\n // \n double load = FoilBoard.this.load; \n\n // non-flying motion\n boolean non_flying = load > lift;\n\n if (non_flying) { \n // load = lift; // Ok idea but not ideal\n // here is better idea: when non_flying, the board provides the remaining lift\n double board_lift_arm = // tangential arm at 90 degrees to gravity\n BOARD_HYDRO_LIFT_LOC * BOARD_LENGTH - MAST_LE_TO_TRANSOM;\n \n board_vert_moment = (BOARD_WEIGHT - (load - lift)) * board_lift_arm;\n }\n\n // this was named mast_le_xpos when ref point was mast le, which is strut.xpos.\n double ref_point_xpos = strut.xpos; \n \n double CW_moments = // +CW ClockWise rotation \n (in.opts.ignore_aux_weight_moments ? 0 : board.drag * (strut.span + BOARD_THICKNESS/2)) +\n rider.drag * (strut.span + BOARD_THICKNESS + RIDER_CG_HEIGHT) + // aprox center of body aero drag\n strut_drag_moment + \n foils_Cm_moments + // any positive Cm pitches nose up therefore CW in this 'view'\n wing.lift * - (wing.xpos + wing.chord_xoffs \n + wing.compute_lift_pos()\n - ref_point_xpos) + // TODO angle correction\n fuse.lift * - (/*fuse.xpos is 0*/ + fuse.compute_lift_pos() - ref_point_xpos); // TODO angle correction\n\n double CCW_moments = // CCW means CounterClockWise rotation, it is -CW\n drive_moment +\n stab.lift * (stab.xpos + stab.chord_xoffs + stab.compute_lift_pos() - ref_point_xpos) + // TODO angle correction\n (in.opts.ignore_aux_weight_moments \n || non_flying // this help to keep the rider over the board and not behind when drive is very light\n ? 0 \n : board_vert_moment + rig_moment);\n\n // if we decide to include prorated rider-mast calcs here \n // load = load*(1-load_distribution_to_mast_loc)\n //\n // what is rider_arm?? this is the horisontal offset in space from the\n // reference point, which is where mast LE meets fuse, where the rider\n // shoudl apply teh gravity weight. this (a) does not translate to\n // where mast LE meets the board because soem masts are not\n // perpendicular (b) even for perpendicular mast/board, this is different at board level unless AoA is zero. \n double rider_arm = (CCW_moments - CW_moments) / load;\n\n // March 2021: warning: I forgot what it is and how non_flying affects this.\n // note that as of now, it is not used in simulation... \n dash.cg_pos_of_rider_at_drive_height = ((CCW_moments + driving_force*DRIVING_FORCE_HEIGHT) // adjust for drive height\n - CW_moments) / load;\n\n return rider_arm;\n \n }", "private void runCalculation(final BlockType[] nextBlocks, final TransformationResult[] pr, LinkedList<TransformationResult[]> prList) {\n final BlockType type = this.blocks[0];\n int i, h, max;\n BlockRotation rt;\n // pieces on top\n final int[] testPiecesHeight = BoardUtils.calcPiecesHeight(this.piecesHeight, pr);\n // System.out.println(\"pieces on top: \" +\n // Arrays.toString(testPiecesHeight));\n // calculate fit\n final int prevLength = pr.length;\n LinkedList<Point> cleverPoints = null;\n for (int idx = 0; idx < type.rotations.length; idx++) {\n rt = type.rotations[idx];\n cleverPoints = null;\n for (int x = -rt.freeLeft; x <= QQTetris.PiecesWidth - rt.freeLeft - rt.width; x++) {\n max = -1;\n for (i = 0; i < rt.width; i++) {\n h = testPiecesHeight[x + i + rt.freeLeft] + rt.piecesBottoms[i] + 1;\n if (h > max) {\n max = h;\n }\n }\n int y = QQTetris.PiecesHeight - max;\n // QQDebug.printBlock(rt.form);\n // System.out.println(rt + \", x: \" + x + \", y: \" + y);\n // System.out.println(Arrays.toString(testPiecesHeight));\n if (QQTetris.cleverMode) {\n\t\t if (y >= QQTetris.BlockDrawSize) {\n\t\t final boolean[] boardCopy = TransformationTask.boardCopyLocal.get();\n\t\t System.arraycopy(this.board, 0, boardCopy, 0, this.board.length);\n\t\t BoardUtils.mergeResults(boardCopy, pr);\n cleverPoints = MoveCalculator.findCleverMove(boardCopy, rt, x, y);\n if (cleverPoints != null) {\n y = cleverPoints.get(0).y;\n }\n }\n }\n final boolean correctPlacement = prevLength > 0 || cleverPoints != null\n || rt.faultChecker.check(this.board, x, y);\n if (y >= 0 && correctPlacement) {\n\t \tif (!calc.isCancelled()) {\n\t\t // create jobs for each combination\n\t\t final TransformationResult tr = new TransformationResult(type, idx, x, y, -1, cleverPoints);\n\t\t final TransformationResult[] newResults = new TransformationResult[prevLength + 1];\n\t\t System.arraycopy(pr, 0, newResults, 0, prevLength);\n\t\t newResults[newResults.length - 1] = tr;\n\t\t prList.add(newResults);\n\t\t \n\t\t // System.out.println(\"pre result: \" + tr);\n\t\t if (prList.size() >= QQCalculatorAsync.BATCH_SIZE) {\n\t\t final TransformationTask task = new TransformationTask(calc, this.predictedResults, this.board,\n\t\t this.piecesHeight, nextBlocks, new ArrayList<TransformationResult[]>(prList), this.executorLock, this.executor,\n\t\t this.strategy, this.strategyAttrs, this.taskCounter);\n\t\t // send jobs\n\t\t this.taskCounter.incrementAndGet();\n\t\t this.executor.execute(task);\n\t\t prList.clear();\n\t\t }\n\t } else {\n return;\n\t }\n }\n }\n }\n }", "public static void main(String[] args) throws Exception {\r\n\r\n\t //All results in Phase K-1.\r\n\t List<ItemSet> itemSetsPrevPass = new ArrayList<>();\r\n\t \r\n\t //Results in Phase K.\r\n\t List<ItemSet> candidateItemSets = null;\r\n\t int passNum=3;\r\n\t //Index Structure in Phase K.\r\n\t Trie trie = null;\r\n\t \r\n\t\tString lastPassOutputFile = \"E:\\\\复旦小学的资料\\\\part-r-00000\";\t\r\n \r\n try {\r\n File fp = new File(lastPassOutputFile);\r\n BufferedReader p = new BufferedReader(new FileReader(fp));\r\n String currLine;\r\n while ((currLine = p.readLine()) != null) {\r\n currLine = currLine.replace(\"[\", \"\");\r\n currLine = currLine.replace(\"]\", \"\");\r\n String[] words = currLine.split(\"[\\\\s\\\\t]+\");\r\n if (words.length < 2) {\r\n continue;\r\n }\r\n\r\n String finalWord = words[words.length - 1];\r\n int support = Integer.parseInt(finalWord);\r\n ItemSet itemSet = new ItemSet(support);\r\n //Make {itemSetsPrevPass}\r\n for (int k = 0; k < words.length - 1; k++) {\r\n String csvItemIds = words[k];\r\n String[] itemIds = csvItemIds.split(\",\");\r\n for (String itemId : itemIds) {\r\n itemSet.add(Integer.parseInt(itemId));\r\n }\r\n }\r\n if(itemSet.size() ==(passNum-1))\r\n \titemSetsPrevPass.add(itemSet);\r\n }\r\n }\r\n catch (Exception e) {\r\n \tSystem.out.println(e);\r\n }\r\n\r\n \r\n System.out.println(\"OK1!\");\r\n //See annotation in file: utils/Funcs.java\r\n candidateItemSets = Funcs.getCandidateItemSets(itemSetsPrevPass, (passNum - 1));\r\n// File fout = new File(\"E:\\\\复旦小学的资料\\\\tri.txt\");\r\n// PrintWriter output = new PrintWriter(fout);\r\n// for(ItemSet s:candidateItemSets) {\r\n// \toutput.println(s);\r\n// }\r\n// output.close();\r\n System.out.println(\"OK2!\");\r\n \r\n trie = new Trie(passNum);\r\n\r\n int candidateItemSetsSize = candidateItemSets.size();\r\n for (int i = 0; i < candidateItemSetsSize; i++) {\r\n ItemSet itemSet = candidateItemSets.get(i);\r\n //System.out.println(itemSet);\r\n trie.add(itemSet);\r\n }\r\n \r\n \r\n File fp = new File(\"C:\\\\Users\\\\DELL6\\\\Desktop\\\\mul\");\r\n BufferedReader p = new BufferedReader(new FileReader(fp));\r\n String currLine;\r\n ArrayList<ItemSet> empt = new ArrayList<ItemSet>();\r\n while((currLine = p.readLine()) != null) {\r\n\t Transaction txn = Funcs.getTransaction(2, currLine);\r\n\t Collections.sort(txn);\r\n\t ArrayList<ItemSet> matchedItemSet = new ArrayList<>();\r\n\t trie.findItemSets(matchedItemSet, txn);\r\n\t if(!matchedItemSet.equals(empt)) {\r\n\t \tfor(ItemSet itemSet : matchedItemSet) \r\n\t\t \tSystem.out.println(itemSet);\r\n\t\t }\r\n\t }\r\n }", "public static void main(String[] args) \n\t{\n\t\ttry \n\t\t{\n\t\t\tString inputFileString = \"SSI_Input.csv\"; // args[0]; // // path to the input file\n\t\t\tdouble maximumDistance = 0.17; //Double.parseDouble(args[1]);// // this is the maximum distance of the study area in degrees\n\t\t\t\n\t\t\tFileReader inputFileReader = new FileReader(inputFileString);\n\t\t\tCSVParser csvParser = new CSVParser(inputFileReader, CSVFormat.DEFAULT.EXCEL);\n\t\t\tHashtable<String, Vector<String>> nameCoordinateTable = new Hashtable<>();\n\t\t\t\n\t\t\tfor(CSVRecord csvRecord : csvParser)\n\t\t\t{\n\t\t\t\tString name = csvRecord.get(0);\n\t\t\t\tString[] coords = csvRecord.get(1).split(\"\\\\|\");\n\t\t\t\tVector<String> coordVector = new Vector<>();\n\t\t\t\tfor(int i=0;i<coords.length;i++)\n\t\t\t\t\tcoordVector.add(coords[i]);\n\t\t\t\t\n\t\t\t\tnameCoordinateTable.put(name, coordVector);\n\t\t\t}\n\t\t\tcsvParser.close();\n\t\t\t\n\t\t\t\n\t\t\t// Build a priority queue which will be used to sort place names based on their SSI entropy\n\t\t\tPriorityQueue<NameEntropy> namePriorityQueue = new PriorityQueue<NameEntropy>(new Comparator<NameEntropy>() {\n\t\t\t\tpublic int compare(NameEntropy o1, NameEntropy o2) {\n\t\t\t\t\tif(o1.entropy_sqrt < o2.entropy_sqrt)\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\telse if (o1.entropy_sqrt > o2.entropy_sqrt) \n\t\t\t\t\t\treturn 1;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tEnumeration<String> namesEnumeration = nameCoordinateTable.keys();\n\t\t\twhile(namesEnumeration.hasMoreElements())\n\t\t\t{\n\t\t\t\tString thisCandidateName = namesEnumeration.nextElement();\n\t\t\t\tVector<String> coordinateVector = nameCoordinateTable.get(thisCandidateName);\n\t\t\t\t\n\t\t\t\tif(coordinateVector.size() < 3) continue; // if this name is associated with fewer than 3 points, then remove it\n\t\t\t\t\n\t\t\t\tdouble[][] locationArray = new double[coordinateVector.size()][2];\n\t\t\t\tfor(int i=0;i<coordinateVector.size();i++)\n\t\t\t\t{\n\t\t\t\t\tString thisCoordPair = coordinateVector.get(i);\n\t\t\t\t\tString[] coordInfo = thisCoordPair.split(\" \");\n\t\t\t\t\tdouble thisLng = Double.valueOf(coordInfo[0]);\n\t\t\t\t double thisLat = Double.valueOf(coordInfo[1]);\n\t\t\t\t locationArray[i][0] = thisLng;\n\t\t\t\t locationArray[i][1] = thisLat;\n\t\t\t\t}\n\t\t\n\t\t\t\t// Key step: computing the entropy value using scale-structure identification\n\t\t\t\tHashtable<String, Double> resultHashtable = ScaleStructure.compute(locationArray, maximumDistance, 100000);\n\t\t\t\t\n\t\t\t\tNameEntropy nameEntropy = new NameEntropy(thisCandidateName, resultHashtable.get(\"entropy\"));\n\t\t\t\tnameEntropy.entropy_sqrt = resultHashtable.get(\"entropy_sqrt\");\n\t\t\t\tnameEntropy.entropy_log = resultHashtable.get(\"entropy_log\");\n\t\t\t\tnameEntropy.entropy_count = resultHashtable.get(\"entropy_count\");\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tnamePriorityQueue.add(nameEntropy);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tOut outputFile = new Out(\"SSI_Output.csv\");\n\t\t\toutputFile.println(\"name,entropy_sqrt,entropy,entropy_log,entropy_count\");\n\t\t\twhile(!namePriorityQueue.isEmpty())\n\t\t\t{\n\t\t\t\tNameEntropy thisNameEntropy = namePriorityQueue.poll();\n\t\t\t\t\n\t\t\t\toutputFile.println(\"\\\"\"+thisNameEntropy.name+\"\\\",\"+thisNameEntropy.entropy_sqrt+\",\"+thisNameEntropy.entropy+\",\"+thisNameEntropy.entropy_log+\",\"+thisNameEntropy.entropy_count);\n\t\t\t}\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static RegionRepeatsBean maxSharedUnigramDensity(String cipher,\n\t\t\tint cipherWidth, int height, int width, boolean minimize) {\n\t\t/** upper left corner range:\n\t\t * \t\trow: [0, cipherHeight-1-height+1]\n\t\t * \t\tcol: [0, cipherWidth-1-width+1]\n\t\t */\n\t\t\n\t\tint cipherHeight = cipher.length()/cipherWidth;\n\t\tint rowBound = cipherHeight-1-height+1;\n\t\tint colBound = cipherWidth-1-width+1;\n\t\t\n\t\tRegionRepeatsBean result = new RegionRepeatsBean();\n\t\tresult.z340 = Ciphers.Z340.equals(cipher);\n\t\t\n\t\tfor (int pos1=0; pos1<cipher.length(); pos1++) {\n\t\t\tint r1 = pos1/cipherWidth;\n\t\t\tint c1 = pos1%cipherWidth;\n\t\t\tif (r1>rowBound || c1>colBound) continue;\n\t\t\tRectangle rect1 = new Rectangle(r1, c1, height, width); \n\t\t\tfor (int pos2=pos1+1; pos2<cipher.length(); pos2++) {\n\t\t\t\tint r2 = pos2/cipherWidth;\n\t\t\t\tint c2 = pos2%cipherWidth;\n\t\t\t\tif (r2>rowBound || c2>colBound) continue;\n\t\t\t\tRectangle rect2 = new Rectangle(r2, c2, height, width); \n\t\t\t\t// check for overlap, using all 4 points of R2\n\t\t\t\tif (rect1.overlap(rect2)) {\n//\t\t\t\t\tSystem.out.println(\"overlap \" + rect1 + \", \" + rect2 + \", \" + rect1.extract(cipher, cipherWidth) +\", \" + rect2.extract(cipher, cipherWidth));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"valid \" + rect1 + \", \" + rect2 + \", \" + rect1.extract(cipher, cipherWidth) +\", \" + rect2.extract(cipher, cipherWidth));\n//\t\t\t\tSystem.out.println(\"render(); \" + rect1.render() + \" \" + rect2.render());\n\t\t\t\tString s1 = rect1.extract(cipher, cipherWidth); \n\t\t\t\tString s2 = rect2.extract(cipher, cipherWidth);\n\t\t\t\tdouble density = shared(s1, s2);\n\t\t\t\tdensity /= s1.length();\n\t\t\t\tboolean better = false;\n\t\t\t\tif (result.density == null) better = true;\n\t\t\t\telse if (minimize && density < result.density) better = true;\n\t\t\t\telse if (density > result.density) better = true;\n\t\t\t\tif (better) {\n\t\t\t\t\tresult.rect1 = rect1;\n\t\t\t\t\tresult.rect2 = rect2;\n\t\t\t\t\tresult.density = density;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n//\t\tfor (int r1=0; r1<=rowBound; r1++) {\n//\t\t\tfor (int c1=0; c1<=colBound; c1++) {\n//\t\t\t\tRectangle rect1 = new Rectangle(r1, c1, height, width); \n//\t\t\t\tfor (int r2=0; r2<=rowBound; r2++) {\n//\t\t\t\t\tfor (int c2=0; c2<=colBound; c2++) {\n//\t\t\t\t\t\tRectangle rect2 = new Rectangle(r2, c2, height, width); \n//\t\t\t\t\t\t// check for overlap, using all 4 points of R2\n//\t\t\t\t\t\tif (rect1.overlap(rect2)) {\n////\t\t\t\t\t\t\tSystem.out.println(\"overlap \" + rect1 + \", \" + rect2 + \", \" + rect1.extract(cipher, cipherWidth) +\", \" + rect2.extract(cipher, cipherWidth));\n//\t\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tSystem.out.println(\"valid \" + rect1 + \", \" + rect2 + \", \" + rect1.extract(cipher, cipherWidth) +\", \" + rect2.extract(cipher, cipherWidth));\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\treturn result;\n\t}", "void scris(ProblemData a, HomeworkWriter fout) {\r\n\r\n Procese[] prc = super.vectorproc(a);\r\n int[] v = this.vtinit(a);\r\n int cmmdc = this.getGCD(v);\r\n for (int i = 0; i < v.length; i++) {\r\n v[i] = v[i] / cmmdc;\r\n }\r\n int[] w = v.clone();\r\n\r\n int j = 0;\r\n Cache obj;\r\n switch (a.getCacheType()) {\r\n case \"NoCache\":\r\n obj = new NoCache();\r\n break;\r\n case \"LruCache\":\r\n obj = new LruCache();\r\n break;\r\n case \"LfuCache\":\r\n obj = new LfuCache();\r\n break;\r\n default:\r\n throw new IllegalArgumentException(\"Invalid cache\");\r\n }\r\n\r\n ProcessStructure[] cache = new ProcessStructure[a.getCacheCapacity()];\r\n for (int l = 0; l < a.getCacheCapacity(); l++) {\r\n cache[l] = new ProcessStructure();\r\n }\r\n int[] vector = new int[a.getCacheCapacity()];\r\n\r\n for (int i = 0; i < a.getNumbersToBeProcessed().length; i++) {\r\n while (true) {\r\n if ( v[j] > 0 ) {\r\n v[j]--;\r\n obj.cache(a, fout, cache, prc, vector, i, j);\r\n break;\r\n }\r\n if ( v[j] == 0 )\r\n j++;\r\n if ( j >= v.length ) {\r\n v = w.clone();\r\n j = j % v.length;\r\n }\r\n }\r\n\r\n }\r\n\r\n }", "public List<ContactPartAllocation> optimizeAllocation(List<ContactPartAllocation> contactPartAllocations) {\n // filter for not allocated and tile parts and sort them\n List<ContactPartAllocation> notAllocatedAndTitleParts = contactPartAllocations.stream().filter(part ->\n ContactParts.NOT_ALLOCATED.equals(part.getContactStringPart()) ||\n ContactParts.TITLE.equals(part.getContactStringPart())\n ).sorted(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()))\n .collect(Collectors.toList());\n\n // if there are none or only one not allocated of title part sort allocated parts and return them unchanged\n if (notAllocatedAndTitleParts.size() < 2) {\n contactPartAllocations.sort(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()));\n return contactPartAllocations;\n }\n\n // create possible concat titles\n String possibleTitleSpace = getCompletePossibleTitle(notAllocatedAndTitleParts, \" \");\n String possibleTitleDash = getCompletePossibleTitle(notAllocatedAndTitleParts, \"-\");\n\n for (int i = notAllocatedAndTitleParts.size() - 1; i > 0; i--) {\n // check if concat string is a valid title\n if (this.stringInFileCheckerService.stringIsInFile(possibleTitleSpace, TITLES_PATH) ||\n this.stringInFileCheckerService.stringIsInFile(possibleTitleDash, TITLES_PATH)) {\n contactPartAllocations.add(new ContactPartAllocation(new Tuple<>(notAllocatedAndTitleParts.get(0).getContactPart().getFirstObject(), possibleTitleSpace), ContactParts.TITLE));\n contactPartAllocations.removeAll(notAllocatedAndTitleParts.subList(0, i + 1));\n break;\n }\n\n // cut title string for new approach\n possibleTitleSpace = possibleTitleSpace.substring(0, possibleTitleSpace.length() - (notAllocatedAndTitleParts.get(i).getContactPart().getSecondObject().length() + 1));\n possibleTitleDash = possibleTitleDash.substring(0, possibleTitleDash.length() - (notAllocatedAndTitleParts.get(i).getContactPart().getSecondObject().length() + 1));\n }\n contactPartAllocations.sort(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()));\n return contactPartAllocations;\n }", "public void updateGrade() throws SimulationStopException{\r\n /*if(realtime){\r\n double[] pos1 = gps.getPos();\r\n \r\n double []pos2 = gps.getPos();\r\n double product = (6378100)*Math.PI/18000;\r\n grade = (pos1[2]-pos2[2])/\r\n Math.sqrt(Math.pow((pos1[1]-pos2[1])*product,2) +\r\n Math.pow((pos1[0]-pos2[0])*product,2));\r\n }*/\r\n if(time.isRunning()){\r\n\r\n try {\r\n \t//calculate grade\r\n \tif(index!=0){\r\n grade = ((roadData[altIndex][index] - roadData[altIndex][index-1])/\r\n (roadData[distIndex][index] - roadData[distIndex][index-1]));\r\n \t}\r\n \r\n // calculate orientation (used for wind and turns)\r\n /* Understandable version...\r\n * product = 60/0.5399555*1000\r\n *\r\n * distLat = (tempLat - lat)*product;\r\n * distLon = (tempLon - lon)*product*Math.cos((tempLat + lat)/2*Math.PI/180);\r\n * carAngle = atan(distLon/distLat) + PI/2\r\n * */\r\n \r\n carAngle = Math.atan((roadData[lonIndex][index]-roadData[lonIndex][index+1])\r\n \t\t*Math.cos((roadData[latIndex][index]+roadData[latIndex][index+1])/2*Math.PI/180)/\r\n (roadData[latIndex][index]-roadData[latIndex][index+1])) + Math.PI/2;\r\n while(carAngle>Math.PI*2){\r\n \tcarAngle-=Math.PI*2;\r\n }\r\n\r\n index++;\r\n segsLeft--;\r\n // if we hit a control point, stop for ctrlTimeLength seconds of time\r\n if(roadData[distIndex][index]>ctrlPts[ctrlIndex]&&ctrlIndex<=ctrlPts.length){\r\n time.ctrlPointHit(ctrlTimeLength);\r\n System.out.println(\"Control Point: \" + roadData[distIndex][index]);\r\n ctrlIndex++;\r\n }\r\n }\r\n catch (IndexOutOfBoundsException e) {\r\n throw new SimulationStopException(\"Simulation stopped at control point \"+ctrlIndex);\r\n // Is this message right!?\r\n }\r\n }\r\n }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public Shape createStrokedShape(Shape shape) {\n/* 140 */ GeneralPath result = new GeneralPath();\n/* 141 */ PathIterator it = new FlatteningPathIterator(shape.getPathIterator(null), 1.0D);\n/* 142 */ float[] points = new float[6];\n/* 143 */ float moveX = 0.0F, moveY = 0.0F;\n/* 144 */ float lastX = 0.0F, lastY = 0.0F;\n/* 145 */ float thisX = 0.0F, thisY = 0.0F;\n/* 146 */ int type = 0;\n/* 147 */ float next = 0.0F;\n/* 148 */ int phase = 0;\n/* 149 */ while (!it.isDone()) {\n/* 150 */ float dx, dy, distance; type = it.currentSegment(points);\n/* 151 */ switch (type) {\n/* */ case 0:\n/* 153 */ moveX = lastX = points[0];\n/* 154 */ moveY = lastY = points[1];\n/* 155 */ result.moveTo(moveX, moveY);\n/* 156 */ next = OutlineZigzagEffect.this.wavelength / 2.0F;\n/* */ break;\n/* */ \n/* */ case 4:\n/* 160 */ points[0] = moveX;\n/* 161 */ points[1] = moveY;\n/* */ \n/* */ \n/* */ case 1:\n/* 165 */ thisX = points[0];\n/* 166 */ thisY = points[1];\n/* 167 */ dx = thisX - lastX;\n/* 168 */ dy = thisY - lastY;\n/* 169 */ distance = (float)Math.sqrt((dx * dx + dy * dy));\n/* 170 */ if (distance >= next) {\n/* 171 */ float r = 1.0F / distance;\n/* 172 */ while (distance >= next) {\n/* 173 */ float x = lastX + next * dx * r;\n/* 174 */ float y = lastY + next * dy * r;\n/* 175 */ if ((phase & 0x1) == 0) {\n/* 176 */ result.lineTo(x + OutlineZigzagEffect.this.amplitude * dy * r, y - OutlineZigzagEffect.this.amplitude * dx * r);\n/* */ } else {\n/* 178 */ result.lineTo(x - OutlineZigzagEffect.this.amplitude * dy * r, y + OutlineZigzagEffect.this.amplitude * dx * r);\n/* 179 */ } next += OutlineZigzagEffect.this.wavelength;\n/* 180 */ phase++;\n/* */ } \n/* */ } \n/* 183 */ next -= distance;\n/* 184 */ lastX = thisX;\n/* 185 */ lastY = thisY;\n/* 186 */ if (type == 4) result.closePath(); \n/* */ break;\n/* */ } \n/* 189 */ it.next();\n/* */ } \n/* 191 */ return (new BasicStroke(OutlineZigzagEffect.this.getWidth(), 2, OutlineZigzagEffect.this.getJoin())).createStrokedShape(result);\n/* */ }", "public static int runGame(String[] input, Mode mode)\n {\n PointSet4d activePoints = PointSetFactory.buildSetOfActivePoints(input);\n\n for (int i = 1; i <= 6; i++)\n {\n // Create a clone of the set\n PointSet4d newActivePoints = activePoints.clone();\n\n // Construct a set of all active points and their neighbors\n // to analyze. This makes sure we analyze any neighboring\n // inactive points along with the active points.\n PointSet4d pointsToAnalyze = new PointSet4d();\n for (Point4d activePoint : activePoints.getAll())\n {\n pointsToAnalyze.add(activePoint);\n ArrayList<Point4d> adjacentPoints = mode == Mode.ANALYZE3D\n ? activePoints.getAllAdjacent3d(activePoint)\n : activePoints.getAllAdjacent4d(activePoint);\n pointsToAnalyze.addAll(adjacentPoints);\n }\n\n // Analyze all active and adjacent points\n for (Point4d pointToAnalyze : pointsToAnalyze.getAll())\n {\n // Check if the point is active\n boolean isActive = activePoints.contains(pointToAnalyze);\n\n // Count active neighbors\n ArrayList<Point4d> adjacentPoints = mode == Mode.ANALYZE3D\n ? activePoints.getAllAdjacent3d(pointToAnalyze)\n : activePoints.getAllAdjacent4d(pointToAnalyze);\n int activeNeighborCount = activePoints.getCountInSet(adjacentPoints);\n\n // Apply the rules and update the point in the new set if necessary\n if (isActive && activeNeighborCount != 2 && activeNeighborCount != 3) {\n newActivePoints.remove(pointToAnalyze);\n } else if (isActive == false && activeNeighborCount == 3) {\n newActivePoints.add(pointToAnalyze);\n }\n }\n\n // Update the set of active points\n activePoints = newActivePoints;\n }\n\n return activePoints.size();\n }", "double find_min_takeoff_v_old_algorithm_aux (double min_lift, double max_drag, double speed, double speed_step, double pitch_init, double pitch_step) {\n double pitch = pitch_init;\n double pitch_limit = aoa_max*0.7;\n {\n trace(\"speed_step: \" + speed_step + \" pitch_step: \" + pitch_step);\n for (; speed < v_max; speed += speed_step) {\n velocity = speed;\n // if the startimg pitch guess when at this point was too high, \n // drag will be too big at this point; then reduce pitch\n while (pitch > aoa_min/2) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() >= max_drag)\n pitch = Math.max(pitch_init, craft_pitch - Math.abs(craft_pitch/4));\n else \n break; // while (pitch > aoa_min/2)\n } \n \n trace(\"for() speed: \" + speed + \" pitch: \" + pitch);\n for (;pitch < pitch_limit; pitch += pitch_step) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() >= max_drag) {\n // stop increasing pitch, won't work. need more speed\n trace(\"too much drag. speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift());\n pitch = Math.max(pitch_init, craft_pitch - Math.abs(craft_pitch/4));\n break; // for (pitch...)\n }\n if (foil_lift() >= min_lift) {\n if (speed_step > 0.25) {\n trace(\"request reiterate. speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift() + \" speed_step: \" + speed_step);\n return Math.max(0, velocity - speed_step); // request to reiterate\n } else {\n // done!\n make_min_takeoff_speed_info(min_lift, max_drag, velocity); \n System.out.println(\"\\nDone!\\n----------------\\n\" + min_takeoff_speed_info);\n return -1;\n }\n } \n }\n // need to start from lowest pitch?\n if (pitch >= pitch_limit) pitch = pitch_init;\n }\n }\n return -2; // can not find solution\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 }", "public void removeLineaGastoFamilias(long pk, long[] lineaGastoFamiliaPKs)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "private int expandCompositChar(char[] dest,\n int start,\n int length,\n int lacount,\n int shapingMode) throws ArabicShapingException {\n\n int lenOptionsLamAlef = options & LAMALEF_MASK;\n int lenOptionsSeen = options & SEEN_MASK;\n int lenOptionsYehHamza = options & YEHHAMZA_MASK;\n boolean spaceNotFound = false;\n\n if (!isLogical && !spacesRelativeToTextBeginEnd) {\n switch (lenOptionsLamAlef) {\n case LAMALEF_BEGIN: lenOptionsLamAlef = LAMALEF_END; break;\n case LAMALEF_END: lenOptionsLamAlef = LAMALEF_BEGIN; break;\n default: break;\n }\n }\n\n if(shapingMode == 1){\n if(lenOptionsLamAlef == LAMALEF_AUTO){\n if(isLogical){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n }\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n }\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else{\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n }\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n }\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }\n }else if(lenOptionsLamAlef == LAMALEF_END){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_BEGIN){\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_RESIZE){\n for (int r = start + length, w = r + lacount; --r >= start;) {\n char ch = dest[r];\n if (isNormalizedLamAlefChar(ch)) {\n dest[--w] = '\\u0644';\n dest[--w] = convertNormalizedLamAlef[ch - '\\u065C'];\n } else {\n dest[--w] = ch;\n }\n }\n length += lacount;\n }\n }else{\n if(lenOptionsSeen == SEEN_TWOCELL_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,1,0);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No space for Seen tail expansion\");\n }\n }\n if(lenOptionsYehHamza == YEHHAMZA_TWOCELL_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,1,0,0);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No space for YehHamza expansion\");\n }\n }\n }\n return length;\n }", "static MaxSeparation findMaxSeparation(PolygonShape poly1, XForm xf1,\n \t\t\t\t\t\t\t\t\t PolygonShape poly2, XForm xf2) {\n MaxSeparation separation = new MaxSeparation();\n\n int count1 = poly1.m_vertexCount;\n \n // Vector pointing from the centroid of poly1 to the centroid of poly2.\n \tVec2 d = XForm.mul(xf2, poly2.m_centroid).subLocal(XForm.mul(xf1, poly1.m_centroid));\n \tVec2 dLocal1 = Mat22.mulT(xf1.R, d);\n\n \t// Find edge normal on poly1 that has the largest projection onto d.\n int edge = 0;\n float maxDot = -Float.MAX_VALUE;\n for (int i = 0; i < count1; ++i) {\n float dot = Vec2.dot(poly1.m_normals[i], dLocal1);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n\n // Get the separation for the edge normal.\n float s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f){\n separation.bestSeparation = s;\n return separation;\n }\n\n // Check the separation for the previous edge normal.\n int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;\n float sPrev = edgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n if (sPrev > 0.0f) {\n separation.bestSeparation = sPrev;\n return separation;\n }\n\n int nextEdge = edge + 1 < count1 ? edge + 1 : 0;\n float sNext = edgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n if (sNext > 0.0f){\n separation.bestSeparation = sNext;\n return separation;\n }\n\n // Find the best edge and the search direction.\n int bestEdge;\n float bestSeparation;\n int increment;\n if (sPrev > s && sPrev > sNext) {\n increment = -1;\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s){\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n } else {\n separation.bestFaceIndex = edge;\n separation.bestSeparation = s;\n return separation;\n }\n\n // Perform a local search for the best edge normal.\n while (true) {\n if (increment == -1)\n edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else\n edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;\n\n s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f) {\n separation.bestSeparation = s;\n return separation;\n }\n\n if (s > bestSeparation){\n bestEdge = edge;\n bestSeparation = s;\n } else {\n break;\n }\n }\n\n separation.bestFaceIndex = bestEdge;\n separation.bestSeparation = bestSeparation;\n\n return separation;\n }", "private Vector combinationAlgorithm(Stroke theStroke){\n\t\tCurvatureBasedDetection cbd = new CurvatureBasedDetection();\n\t\tSpeedBasedDetection sbd = new SpeedBasedDetection();\n\t\tCommonSegmentPts = new Vector();\n\t\tCurvPts = cbd.getCurvatureData();\n\t\tdouble SpeedPts[][] = sbd.getSpeedData();\n\t\tCurvPtCount = cbd.getIndex();\n\t\tint SpeedPtCount = sbd.getIndex();\n\t\tint index ;\n\t\tCurvVector = new Vector();\n\t\t//copy the speed and curvature data in two vectors\n\t\tfor (index = 0; index < CurvPtCount ; index++){\n\t\t\tDouble obj = CurvPts[index][0];\n\t\t\tCurvVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Curvature Indices\");\n\t\tprintValues(CurvVector);\n\t\t\n\t\tSpeedVector = new Vector();\n\t\tfor (index = 0; index < SpeedPtCount ; index++){\n\t\t\tDouble obj = SpeedPts[index][0];\n\t\t\tSpeedVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\tSystem.out.println(\"Speed Indices\");\n\t\tprintValues(SpeedVector);\n\t\tSort sort = new Sort();\n\t\tint ElementIndex;\n\t\t// find common points (intersection of speed and curvature) and put it in CommonSegmentPts vector\n\t\t\n\t\tboolean flag = false;\n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\t\n\t\t\tElementIndex = sort.linearSearch(CurvVector, (Integer)SpeedVector.elementAt(index));\n\t\t\t\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tCommonSegmentPts.add((Integer)(CurvVector.elementAt(ElementIndex)));\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index --); // point is removed from vectors\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\tSystem.out.println(\"Common Points\");\n\t\tprintValues(CommonSegmentPts);\n\t\tint ElemAtIndex;\n\t\t// Find the curvature based segment points in the Tolerance Distance of speed based segment points \n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\tElementIndex = FindNearbyPts(CurvVector, (Integer)SpeedVector.elementAt(index), theStroke);\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tElemAtIndex = ((Integer)CurvVector.elementAt(ElementIndex) + (Integer)SpeedVector.elementAt(index))/2;\n\t\t\t\tCommonSegmentPts.add(ElemAtIndex);\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index--);\n\t\t\t}\n\t\t}\n\t\t//printValues(CommonSegmentPts);\n\t\tremoveNearbyPixels(theStroke);\n\t\t//setNewScalingFactor(theStroke);\n\t\tCollections.sort(CommonSegmentPts);\n\t\tprintValues(CommonSegmentPts);\n\t\tdouble PrevIterError;\n\t\tdouble NewIterError;\n\t\tVector IterationPts = new Vector(); \n\t\t//System.out.println(\"Error \" + (PrevIterError = calculateError(CommonSegmentPts, theStroke)));\n\t\t// create a vector that stores segment points of each iteration\n\t\tIterWiseSegPts = new Vector();\n\t\t// for hybrid\n\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\tdouble PrevError = calculateError(IterationPts, theStroke);\n\t\tif(PrevError > 10000.0){\t// if stroke consists of curves\n\t\t\terrorTolerance = 90.0;\n\t\t}\n\t\tIterationPts.add((double ) PrevError);\n\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\tdouble NewError = -1;\n/*\t\tint vectorIndex = 0;\n\t\t\n\t\twhile(CurvVector.size()!=0 || SpeedVector.size()!=0){\n\t*/\t\t\n\t\t\t// code for accepting seg points uptil pts reduce the error by 100\n\t\t/*\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tCommonSegmentPts.add(CurvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(CurvIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(CurvVector.size()!=0){\n\t\t\t\t\t\tCurvVector.remove(0);\n\t\t\t\t\t}\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tCommonSegmentPts.add(SpeedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tSystem.out.println(\"New Error = \" + NewIterError);\n\t\t\t//CommonSegmentPts.add((Double)NewIterError);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0 ){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(SpeedIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(SpeedVector.size()!=0){\n\t\t\t\t\t\tSpeedVector.remove(0);\n\t\t\t\t\t}\t\t\n\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\t\t// my approach\n\t/*\t\t\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\t\t\tCurvVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tCurvVector = clearVector(CurvVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\t\t\tSpeedVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tIterationPts = clearVector(IterationPts);\n\t\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\t\tCollections.sort(IterationPts);\n\t\t\tIterError = calculateError(IterationPts, theStroke);\n\t\t\tIterationPts.add((double) IterError);\n\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\t\tremoveNearbyPixels(theStroke);\n\n\t\t}\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t/*\tif(CurvVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\tCurvVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tCurvVector = clearVector(CurvVector);\n\t\t}\n\t}\n\tif(SpeedVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\tSpeedVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t}\n\t}\n\tIterationPts = clearVector(IterationPts);\n\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\tCollections.sort(IterationPts);\n\tIterError = calculateError(IterationPts, theStroke);\n\tIterationPts.add((double) IterError);\n\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\tremoveNearbyPixels(theStroke);\n\n}\nCommonSegmentPts = clearVector(CommonSegmentPts);\nCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t\n\t\t// hybrid fit approach\n\t\tint curvIndex = -1, speedIndex = -1;\n\t\tdouble curvError,speedError;\n\t\tVector curvPts = new Vector();\n\t\tVector speedPts = new Vector();\n\t\tVector changeInError = new Vector();\n\t\twhile((CurvVector.size() != 0) || (SpeedVector.size() != 0) ){\n\t\t\tcurvError = DEFAULT;\n\t\t\tspeedError = DEFAULT;\n\t\t\t\n\t\t\tif(CurvVector.size() != 0){\n\t\t\t\tclearVector(curvPts);\n\t\t\t\tcurvPts = copyVector(curvPts, CommonSegmentPts);\n\t\t\t\tcurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tcurvPts.add((Integer)curvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(curvPts);\n\t\t\t\tcurvError = calculateError(curvPts, theStroke);\n\t\t\t\tcurvPts.add((Double)curvError);\n\t\t\t}\n\t\t\t\n\t\t\tif(SpeedVector.size() != 0){\n\t\t\t\tclearVector(speedPts);\n\t\t\t\tspeedPts = copyVector(speedPts, CommonSegmentPts);\n\t\t\t\tspeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tspeedPts.add((Integer)speedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(speedPts);\n\t\t\t\tspeedError = calculateError(speedPts, theStroke);\n\t\t\t\tspeedPts.add((Double)speedError);\n\t\t\t}\n\t\t\t\n\t\t\tif((speedError <= curvError) || (curvError == DEFAULT)){\n\t\t\t\tNewError = speedError;\n\t\t\t\t//changeInError.add((Double)(NewError - PrevError));\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, speedPts);\n\t\t\t\tCommonSegmentPts.add((Integer)speedIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((curvError < speedError) || (speedError == DEFAULT)){\n\t\t\t\tNewError = curvError;\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, curvPts);\n\t\t\t\tCommonSegmentPts.add((Integer)curvIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tVector TempVect = new Vector();\n\t\tCommonSegmentPts = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() - 1);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\t/*index = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tCommonSegmentPts.add((Integer)TempVect.get(index++));\n\t\t}*/\n\t\t//CommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);\n\t\t\n\t\treturn CommonSegmentPts;\n\t}", "private boolean revisar(GrafoAristaPonderada G) {\n\n // check peso\n double pesoTotal = 0.0;\n for (Arista a : aristas()) {\n pesoTotal += a.peso();\n }\n if (Math.abs(pesoTotal - peso()) > EPSILON_PUNTO_FLOTANTE) {\n System.err.printf(\n \"Peso de la aristas no es igual a peso(): %f vs. %f\\n\",\n pesoTotal, peso());\n return false;\n }\n\n // check that it is acyclic\n UF uf = new UF(G.V());\n for (Arista e : aristas()) {\n int v = e.unVertice(), w = e.otroVertice(v);\n if (uf.estanConectados(v, w)) {\n System.err.println(\"No es un bosque\");\n return false;\n }\n uf.union(v, w);\n }\n\n // check that it is a spanning forest\n for (Arista a : G.aristas()) {\n int v = a.unVertice(), w = a.otroVertice(v);\n if (!uf.estanConectados(v, w)) {\n System.err.println(\"No es un bosque de expansion\");\n return false;\n }\n }\n\n // check that it is a minimal spanning forest (cut optimality conditions)\n for (Arista a : aristas()) {\n\n // all aristas in MST except a\n uf = new UF(G.V());\n for (Arista o : aristas()) {\n int x = o.unVertice(), y = o.otroVertice(x);\n if (o != a) uf.union(x, y);\n }\n\n // check that e is min peso edge in crossing cut\n for (Arista o : G.aristas()) {\n int x = o.unVertice(), y = o.otroVertice(x);\n if (!uf.estanConectados(x, y)) {\n if (o.peso() < a.peso()) {\n System.err.println(\"Arista \" + o + \n \" viola las condiciones de optimalidad\"\n + \"del corte\");\n return false;\n }\n }\n }\n\n }\n\n return true;\n }", "protected void shrink() {\n int cellsToDrop = snakeSize/2;\n this.snakeSize = snakeSize - cellsToDrop;\n // AMD: Reset the tip of the tail to be snake-free\n for (int xCell = 0; xCell < maxX; xCell++) {\n for (int yCell = 0; yCell < maxY; yCell++) {\n if (snakeSquares[xCell][yCell] > snakeSize) {\n snakeSquares[xCell][yCell] = NOT_A_SEGMENT;\n }\n }\n }\n }", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "private void removeInvalidFromPool()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_1st_oldest;//index of the oldest individual\r\n\t\tint idx_2nd_oldest;//index of the 2nd oldest individual\r\n\t\tint idx_to_remove;//index of an chromosome which has to be removed\r\n\t\tint idx_current;//index of currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tint max_num_errors;//maximum numbers of stored errors among checked chromosomes\r\n\t\tdouble error_1st_oldest;//average error of the oldest individual\r\n\t\tdouble error_2nd_oldest;//average error of the 2nd oldest individual\r\n\t\tdouble max_error;//largest error among the oldest individuals\r\n\t\tVector<Integer> idx_oldest;//indices of all chromosomes with a life span larger than a predefined threshold\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\t//if the maturity pool is full and none of the genotypes could be removed above because of module outputs\r\n\t\t//then remove one of the oldest individuals according to the errors\r\n\t\tif(_pool_of_bests.size()==_size_pool_of_bests)\r\n\t\t{\r\n\t\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\t\r\n\t\t\t//find all oldest genotypes\r\n\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t{\r\n\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_oldest.add(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//1) find the worst oldest gentypes with a span above a threshold\r\n\t\t\t//2) do not remove a single genotype without comparison;\r\n\t\t\t// it could have very high performance\r\n\t\t\tif(idx_oldest.size() > 1)\r\n\t\t\t{\r\n\t\t\t\tidx_to_remove = idx_oldest.get(0);\r\n\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\tfor(i=idx_to_remove+1; i<idx_oldest.size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\t\tif(max_error < _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_current;\r\n\t\t\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse//remove the worst of two oldest genotypes if none of genotypes had span above the threshold\r\n\t\t\t{\r\n\t\t\t\t//find the oldest and 2nd oldest individuals\r\n\t\t\t\tidx_1st_oldest = -1;\r\n\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\tidx_1st_oldest = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//find the 2nd oldest individuals\r\n\t\t\t\tidx_2nd_oldest = -1;\r\n\t\t\t\tif(size_mature_pool > 1)//the 2nd oldest individual exists if there are 2 or more individuals\r\n\t\t\t\t{\r\n\t\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i!=idx_1st_oldest)//the oldest individual should be ignored\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\t\t\tidx_2nd_oldest = i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//compare performances of both oldest genotypes using their average errors;\r\n\t\t\t\terror_1st_oldest = _pool_of_bests.get(idx_1st_oldest)._error.getAverageError();\r\n\t\t\t\tif(idx_2nd_oldest!=-1)\r\n\t\t\t\t{\r\n\t\t\t\t\terror_2nd_oldest = _pool_of_bests.get(idx_2nd_oldest)._error.getAverageError();\r\n\r\n\t\t\t\t\tif(error_1st_oldest < error_2nd_oldest)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_2nd_oldest;\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\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse//a single individual must always be replaced\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t}\r\n\t\t\t}//are there genotypes with life span above a threshold?\r\n\t\t\t\r\n\t\t\t_pool_of_bests.remove(idx_to_remove);\r\n\t\t}//is maturity pool full?\r\n\t}", "private void optimizefc() {\n\r\n\t\tfor (int i = 0; i < fc.size(); i++) {\r\n\t\t\tString c = fc.get(i).get(0);\r\n\t\t\tif (!keys.containsAll(cliques.get(c))) {\r\n\t\t\t\tfc.remove(i);\r\n\t\t\t\toptimizefc();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void scaleArea(float scaleFactor) {\n\t\t// for more advanced (more than 4 points), use this algorithm:\n\t\t// http://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tPVector tmp = PVector.sub(point[i].position, anchor);\n\t\t\ttmp.mult(scaleFactor);\n\t\t\tpoint[i].position.set(PVector.add(anchor, tmp));\n\t\t}\n\t}", "public void calibrationPhase() {\n\t\t// iterate over all secret combination\n\t\tfor (Secret secretA : this.dataSet.getSecrets()) {\n\t\t\tfor (Secret secretB : this.dataSet.getSecrets()) {\n\t\t\t\tif(secretA != secretB) {\n\t\t\t\t\tif(this.optimalBox[0] == 0.0 && this.optimalBox[1] == 0.0) {\n\t\t\t\t\t\tif(searchOptimalBox(secretA, secretB)) {\n\t\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.optimalBox = new double[2];\n\t\t\t\t\t\tthis.optimalBox[0] = 0.0;\n\t\t\t\t\t\tthis.optimalBox[1] = 0.0;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\tif(smallestSize != 0) {\n\t\t\t\t\t\t\tplotPool.plot(\"Filtered Measurments: User Input Optimal Box (\" + secretA.getName() + \"-\" + secretB.getName() + \")\", this.optimalBox[0], this.optimalBox[1]);\n\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warning(secretA.getName() + \" < \" + secretB.getName() + \": no significant different result found! You need to measure more times.\");\n\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\t}", "synchronized protected void removePoint(final int index) {\n \t\t// check preconditions:\n \t\tif (index < 0) {\n \t\t\treturn;\n \t\t} else if (n_points - 1 == index) {\n \t\t\t//last point out\n \t\t\tn_points--;\n \t\t} else {\n \t\t\t//one point out (but not the last)\n \t\t\t--n_points;\n \n \t\t\t// shift all points after 'index' one position to the left:\n \t\t\tfor (int i=index; i<n_points; i++) {\n \t\t\t\tp[0][i] = p[0][i+1];\t\t//the +1 doesn't fail ever because the n_points has been adjusted above, but the arrays are still the same size. The case of deleting the last point is taken care above.\n \t\t\t\tp[1][i] = p[1][i+1];\n \t\t\t\tp_layer[i] = p_layer[i+1];\n \t\t\t}\n \t\t}\n \n \t\t// Reset or fix autotracing records\n \t\tif (index < last_autotrace_start && n_points > 0) {\n \t\t\tlast_autotrace_start--;\n \t\t} else last_autotrace_start = -1;\n \n \t\t//update in database\n \t\tupdateInDatabase(\"points\");\n \t}", "private void ProcessTGSymbol(MilStdSymbol symbol, IPointConversion converter, Rectangle2D clipBounds)\n {\n try\n {\n\n //RenderMultipoints.clsRenderer.render(symbol, converter);\n //TGLight tgl = new TGLight();\n \n //sector range fan, make sure there is a minimum distance value.\n if(SymbolUtilities.getBasicSymbolID(symbol.getSymbolID()).equals(\"G*F*AXS---****X\"))\n {\n if(symbol.getModifiers_AM_AN_X(ModifiersTG.AN_AZIMUTH)!=null &&\n symbol.getModifiers_AM_AN_X(ModifiersTG.AM_DISTANCE)!=null)\n {\n int anCount = symbol.getModifiers_AM_AN_X(ModifiersTG.AN_AZIMUTH).size();\n int amCount = symbol.getModifiers_AM_AN_X(ModifiersTG.AM_DISTANCE).size();\n ArrayList<Double> am = null;\n if(amCount < ((anCount/2) + 1))\n {\n am = symbol.getModifiers_AM_AN_X(ModifiersTG.AM_DISTANCE);\n if(am.get(0)!=0.0)\n {\n am.add(0, 0.0);\n }\n }\n }\n }\n\n //call that supports clipping\n \n\n ArrayList<ShapeInfo> shapes = new ArrayList<ShapeInfo>();\n ArrayList<ShapeInfo> modifiers = new ArrayList<ShapeInfo>();\n RenderMultipoints.clsRenderer.render(symbol, converter, shapes, modifiers, clipBounds);\n\n if(RendererSettings.getInstance().getTextBackgroundMethod()\n != RendererSettings.TextBackgroundMethod_NONE)\n {\n modifiers = SymbolDraw.ProcessModifierBackgrounds(modifiers);\n symbol.setModifierShapes(modifiers);\n }\n\n }\n catch(Exception exc)\n {\n String message = \"Failed to build multipoint TG\";\n if(symbol != null)\n message = message + \": \" + symbol.getSymbolID();\n //ErrorLogger.LogException(this.getClass().getName() ,\"ProcessTGSymbol()\",\n // new RendererException(message, exc));\n System.err.println(exc.getMessage());\n }\n catch(Throwable t)\n {\n String message2 = \"Failed to build multipoint TG\";\n if(symbol != null)\n message2 = message2 + \": \" + symbol.getSymbolID();\n //ErrorLogger.LogException(this.getClass().getName() ,\"ProcessTGSymbol()\",\n // new RendererException(message2, t));\n System.err.println(t.getMessage());\n }\n }", "void mapCkpointAndTrim(CorfuRuntime rt, PersistentCorfuTable<?, ?>... tables) throws Exception {\n Token checkpointAddress = Token.UNINITIALIZED;\n Token lastCheckpointAddress = Token.UNINITIALIZED;\n\n for (int i = 0; i < PARAMETERS.NUM_ITERATIONS_VERY_LOW; i++) {\n try {\n MultiCheckpointWriter<PersistentCorfuTable<?, ?>> mcw1 = new MultiCheckpointWriter<>();\n for (PersistentCorfuTable<?, ?> table : tables) {\n mcw1.addMap(table);\n }\n\n checkpointAddress = mcw1.appendCheckpoints(rt, author);\n\n try {\n Thread.sleep(PARAMETERS.TIMEOUT_SHORT.toMillis());\n } catch (InterruptedException ie) {\n //\n }\n // Trim the log\n rt.getAddressSpaceView().prefixTrim(checkpointAddress);\n rt.getAddressSpaceView().gc();\n rt.getAddressSpaceView().invalidateServerCaches();\n rt.getAddressSpaceView().invalidateClientCache();\n lastCheckpointAddress = checkpointAddress;\n lastValidCheckpoint = checkpointAddress;\n } catch (TrimmedException te) {\n // shouldn't happen\n te.printStackTrace();\n throw te;\n } catch (Exception e) {\n // We are the only thread performing trimming, therefore any\n // prior trim must have been by our own action. We assume\n // that we don't go backward, so checking for equality will\n // catch violations of that assumption.\n assertThat(checkpointAddress).isEqualTo(lastCheckpointAddress);\n }\n }\n }", "private static void putCritter(Color f, Color o, int x, int y, CritterShape s) {\r\n \tint dim = Main.shapeSize;\r\n \tint cellSize = Main.cellSize;\r\n \tShape critterShape = null;\r\n \tdouble len = (double)dim/2.0;\r\n \tdouble len2 = (double)dim - 1.0;\r\n \tdouble len3 = (double)cellSize - 1.0;\r\n \t\r\n \tswitch(s) {\r\n \tcase CIRCLE:\r\n \t\tcritterShape = new Circle((dim-1)/2);\r\n \t\tcritterShape.setStroke(o);\r\n \t\tcritterShape.setFill(f);\r\n \t\tbreak;\r\n \t\t\r\n \tcase SQUARE:\r\n \t\tcritterShape = new Rectangle(cellSize-3, cellSize-3);\r\n \t\tcritterShape.setStroke(o);\r\n \t\tcritterShape.setFill(f);\r\n \t\tbreak;\r\n \t\t\r\n \tcase TRIANGLE:\r\n \t\tPolygon p = new Polygon();\r\n \t\tDouble[] dimensions = {len, 1.0, len2, len2, 1.0, len2};\r\n \t\tp.getPoints().addAll(dimensions);\r\n \t\tcritterShape = p;\r\n \t\tcritterShape.setStroke(o);\r\n \t\tcritterShape.setFill(f);\r\n \t\tbreak;\r\n \t\t\r\n \tcase DIAMOND:\r\n \t\tPolygon d = new Polygon();\r\n \t\tDouble[] values = {len, 1.0, len2, len, len, len2, 1.0, len};\r\n \t\td.getPoints().addAll(values);\r\n \t\tcritterShape = d;\r\n \t\tcritterShape.setStroke(o);\r\n \t\tcritterShape.setFill(f);\r\n \t\tbreak;\r\n \t\t\r\n \tcase STAR:\r\n \t\tPolygon st = new Polygon();\r\n \t\r\n \t\tDouble[] v = {(len3)*5.5/24.0, (len3)*12.0/24.0, (len3)*1.0/24.0, (len3)*21.0/24.0, \r\n \t\t\t\t\t(len3)*9.5/24.0, (len3)*17.0/24.0, (len3)*16.0/24.0, (len3)*23.0/24.0, \r\n \t\t\t\t\t(len3)*16.0/24.0, (len3)*16.0/24.0, (len3)*23.0/24.0, (len3)*12.0/24.0, \r\n \t\t\t\t\t(len3)*16.0/24.0,(len3)*8.0/24.0, (len3)*16.0/24.0, (len3)*1.0/24.0, \r\n \t\t\t\t\t(len3)*9.5/24.0, (len3)*7.0/24.0, (len3)*1.0/24.0,(len3)*4.0/24.0 };\r\n \t\t\t\r\n \t\t\r\n \t\tst.getPoints().addAll(v); \r\n \t\tcritterShape = st;\r\n \t\tcritterShape.setStroke(o);\r\n \t\tcritterShape.setFill(f);\r\n \t\tbreak;\r\n \t\r\n \tdefault:\r\n \t\tbreak;\r\n \t}\r\n \t\r\n \t//add the critter to the critter world\r\n \tMain.world.add(critterShape, x, y);\r\n }", "void add(Polygon3 polygon)\n\t\t{\n\t\t\tPolygon3[] shapes2 = new Polygon3[shapes.length+1];\n\t\t\tfor(int i=0; i<shapes.length; i++)\n\t\t\t{\n\t\t\t\tshapes2[i] = shapes[i];\n\t\t\t}\n\t\t\tshapes2[shapes.length] = polygon;\n\t\t\tshapes = new Polygon3[shapes2.length];\n\t\t\tfor(int i=0; i<shapes2.length; i++)\n\t\t\t{\n\t\t\t shapes[i] = shapes2[i];\n\t\t\t}\n\t\t\t\n\t\t}", "public void runAlgorithm(PointList customers, int highwayLength, int velocity) {\n\t\t\n\t\tif (!customers.isEmpty()){\n\t\t\tthis._highwayLength = highwayLength;\n\t\t\tthis._velocity = velocity;\n\t\t\t_maxDist = customers.maxDist();\n\t\t\t\n\t\t\t// for drawing purposes only\n\t\t\tfacilityPoints = new ArrayList<Point>();\n\t\t\tturnpikePoints = new ArrayList<Point>();\n\t\t\tpartitionRadius = new ArrayList<Double>();\n\t\t\t\n\t\t\tset_withTurnpike = new ArrayList<PointList>();\n\t\t\tset_withoutTurnpike = new ArrayList<PointList>();\n\t\t\textremePoints1 = new ArrayList<Point[]>();\n\t\t\textremePoints2 = new ArrayList<Point[]>();\n\t\t\tlist_centersWithoutTurnpike = new ArrayList<PointList>();\n\t\t\tlist_centersWithTurnpike = new ArrayList<PointList>();\n\t\t\t\n\t\t\tgetPartition(customers);\n\t\t\t\n\t\t\tmaxDist1 = new ArrayList<Point>();\n\t\t\tmaxDist2 = new ArrayList<Point>();\n\t\t\tminDist1 = new ArrayList<Point>();\n\t\t\tminDist2 = new ArrayList<Point>();\n\t\t\t\n\t\t\t// compute extreme points\n\t\t\tfor (PointList p : set_withTurnpike){\n\t\t\t\textremePoints1.add(p.getExtremePoints());\n\t\t\t}\n\t\t\tfor (PointList p : set_withoutTurnpike){\n\t\t\t\textremePoints2.add(p.getExtremePoints());\n\t\t\t}\n\t\t\t\n\t\t\t// solve basic problem for all partitions {W,H}\n\t\t\tfor (int i = 0; i < set_withTurnpike.size(); i++){\n\n\t\t\t\t_eps1 = Math.max(0, set_withTurnpike.get(i).delta() + highwayLength/velocity - set_withoutTurnpike.get(i).delta());\n\t\t\t\t_eps2 = Math.max(0, set_withoutTurnpike.get(i).delta() - set_withTurnpike.get(i).delta() - highwayLength/velocity);\n\n\t\t\t\tsolveBP(set_withTurnpike.get(i), set_withoutTurnpike.get(i)); \n\t\t\t\tfacilityPoints.add(_currentFacility);\n\t\t\t\tturnpikePoints.add(_currentTurnpikeStart);\n\t\t\t\tpartitionRadius.add(_currentRadius);\n\t\t\t\t\n\t\t\t\t// for drawing purposes\n\t\t\t\t// fixed length\n\t\t\t\tlist_centersWithoutTurnpike.add(center(set_withTurnpike.get(i), set_withTurnpike.get(i).delta() + _eps2 + _x));\n\t\t\t\tlist_centersWithTurnpike.add(center(set_withoutTurnpike.get(i), set_withoutTurnpike.get(i).delta() + _eps1 + _x));\n\t\t\t\t\n\t\t\t\tif (list_centersWithoutTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0])\n\t\t\t\t\t\t|| list_centersWithTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1])){\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t\t} else {\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]);\n\t\t\t\t}\n\t\t\t\tmaxDist1.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\tmaxDist2.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t}\t\n\t\t\t\n\t\t\tif(customers.getSize() > 1){\n\t\t\t\t// find optimal solution\n\t\t\t\tsolutionIndex = getMinRadiusIndex(); \n\t\t\t\tsolution_facility = facilityPoints.get(solutionIndex);\n\t\t\t\tsolution_turnpikeStart = turnpikePoints.get(solutionIndex);\n//\t\t\t\tsolution_radius = partitionRadius.get(solutionIndex);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void removalOfTemporaryAttSet(Context context, StringList sLFeatAndRuleIds)\r\n \t throws Exception{\r\n\r\n \t \t\tStringBuffer sbTypePattern = new StringBuffer(50);\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_LOGICAL_STRUCTURES);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_CONFIGURATION_FEATURES);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_PRODUCTS);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_RULE);\r\n\r\n \t\t\tStringBuffer sbWhereClause = new StringBuffer(50);\r\n \t\t\tsbWhereClause.append(\"(\");\r\n \t\t\tsbWhereClause.append(\"interface[FTRIntermediateObjectMigration] == \\\"\" + ConfigurationConstants.RANGE_VALUE_TRUE + \"\\\"\");\r\n \t\t\tsbWhereClause.append(\")\");\r\n\r\n \t\t\tStringList objectSelects = new StringList();\r\n \t\t\tobjectSelects.add(SELECT_TYPE);\r\n \t\t\tobjectSelects.add(\"interface\");\r\n objectSelects.add(SELECT_NAME);\r\n objectSelects.add(SELECT_REVISION);\r\n objectSelects.add(SELECT_ID);\r\n\r\n \t \t\tMapList MapListObjects = DomainObject.findObjects(context, // context\r\n \t \t\t\t\t\t\t\t\t\t\t\t\tsbTypePattern.toString(), // typePattern\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\"*\", // vaultPattern\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\tsbWhereClause.toString(), // whereExpression\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\tobjectSelects); // objectSelects\r\n\r\n\r\n \t \t\tStringList sLObjIds = new StringList();\r\n \t \t\tfor(int i=0;i<MapListObjects.size();i++){\r\n \t \t\t\t Map mObj = (Map) MapListObjects.get(i);\r\n \t \t\t\t String strObjId = (String) mObj.get(SELECT_ID);\r\n \t \t\t\t sLObjIds.add(strObjId);\r\n \t \t\t}\r\n\r\n\r\n\r\n \t \t\t//Intersection of 2 lists\r\n \t \t\tsLObjIds.retainAll(sLFeatAndRuleIds);\r\n\r\n\r\n \t \t\t try {\r\n\t\t\t\t\tfor(int i=0;i<sLObjIds.size();i++){\r\n\t\t\t\t\t\t String strObjId = (String) sLObjIds.get(i);\r\n\t\t\t\t\t\t //String strMqlCommand = \"modify bus \" + strObjId + \" remove interface\" + \" \" + INTERFACE_FTRIntermediateObjectMigration;\r\n\t\t\t\t\t\t String strMqlCommand = \"modify $1 $2 remove interface $3\";\r\n\t\t\t\t\t\t MqlUtil.mqlCommand(context,strMqlCommand, \"bus\", strObjId, INTERFACE_FTRIntermediateObjectMigration);\r\n\t\t\t\t\t }\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n \t }", "public Vector performSegmentation(Stroke theStroke)\n\t{\n\t\tsetPixelInfo(theStroke);\n\t\t// this vector stores vectors of segment points detected through various methods\n\t\tVector segVectorList = new Vector();\n\t\tint segScheme=0;\n\t\tswitch (segScheme = Prefs.getSegScheme())\n\t\t{\n\t\t//PRATEEK: Is this the place where ALL the segmentation decisions are made??\n\t\tcase GConstants.SEG_SCHEME_ALL:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_SPEED:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_CURVATURE:\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_TIME:\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_SPEED_CURVATURE:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t}\n/*We now have a list of segment-points to work with*/\n\t\t// get the common segment points\n\t\tSystem.out.println(\"Modified Hybrid fits\");\n\t\tVector selectedSegPos;\n\t/*\n\t\tselectedSegPos = returnRelevantVector(segVectorList);\n\t\t\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}*/\n\t\t/*if(segScheme == 1 || segScheme == 3){\n\t\t\t\n\t\t}\n\t\telse{*/\n\t\tselectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\t\t//selectedSegPos = combinationAlgorithm(theStroke);\n\t\t//}\n//\t\tVector selectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\n\t\t// TODO: DONE: remove this code, This is just to print the common segments points\n\t/*\tSystem.out.println(\"Combination algorithm\");\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n\\n\");\n\t\t*/\n\t\t\n\t\treturn selectedSegPos;\n\t}" ]
[ "0.6460811", "0.6294313", "0.608795", "0.5781836", "0.55112785", "0.5061304", "0.5051333", "0.5047011", "0.49572337", "0.49266958", "0.49207297", "0.49170575", "0.490055", "0.49000615", "0.48473978", "0.47535357", "0.4734641", "0.47311452", "0.47160187", "0.46735644", "0.46729586", "0.46583658", "0.46540153", "0.46529305", "0.46522102", "0.4635611", "0.4629302", "0.46228006", "0.46198982", "0.46146974", "0.4608621", "0.45956275", "0.45831558", "0.45787203", "0.45581514", "0.45494282", "0.45489827", "0.45477045", "0.45447487", "0.4543394", "0.45212516", "0.45020223", "0.44992596", "0.44931424", "0.44851002", "0.4481865", "0.44776097", "0.44669527", "0.44405544", "0.4432199", "0.4422648", "0.44220632", "0.44212443", "0.44193703", "0.4416479", "0.44082263", "0.44046015", "0.43992534", "0.43978623", "0.4384797", "0.43844852", "0.43833238", "0.43796927", "0.4371587", "0.4359478", "0.4348483", "0.43438116", "0.434295", "0.4340237", "0.43290037", "0.43274474", "0.43197507", "0.43148232", "0.43147618", "0.43126854", "0.43069926", "0.43067202", "0.43051633", "0.43048686", "0.43037418", "0.43029112", "0.43011963", "0.4298475", "0.42954412", "0.42898038", "0.4287772", "0.42816147", "0.42807263", "0.42766646", "0.42733446", "0.42702976", "0.42685977", "0.42684668", "0.42632157", "0.4263005", "0.4261074", "0.42603338", "0.42587146", "0.42538932", "0.42533192" ]
0.56828374
4
Reduce points for a single smear.
public ArrayList<Gfa> reducePoints( Gfa smear, ArrayList<Gfa> snapshots ) { ArrayList<Gfa> glist = new ArrayList<Gfa>(); /* * Step 1 - reduce points on the whole smear polygon. Note that freezing level * contours are point reduced in af_fzlvl2fmt(). */ Gfa tSmear = regularPointReduction( smear ); /* * Create a smear with the reduced points and return if the smear can be * formatted into 3-line text now. */ if ( canBeFormatted( tSmear ) ) { smear.setPointsOnly( tSmear.getPoints() ); smear.setReduceFlags( tSmear.getReduceFlags() ); glist.add( smear ); return glist; } /* * Step 2 - Do area clipping to split up the ORIGINAL smear * along area boundary, if needed. */ ArrayList<Gfa> listOfAreaClip = new ArrayList<Gfa>(); listOfAreaClip.addAll( faAreaClip( smear, snapshots ) ); // Step 3 - Do first round of bisection, if necessary. ArrayList<Gfa> listOfFirstBisect = new ArrayList<Gfa>(); for ( Gfa gg : listOfAreaClip ) { //First do point reduction on each of the clipped smears. Gfa tmpSmear = regularPointReduction( gg ); gg.setPointsOnly( tmpSmear.getPoints() ); gg.setReduceFlags( tmpSmear.getReduceFlags() ); if ( canBeFormatted( tmpSmear ) ) { glist.add( gg ); } else { listOfFirstBisect.addAll( bisect( gg, true ) ); } } //See if any middle point are generated in bisection. Coordinate midPt = null; if ( listOfFirstBisect.size() > 0 ) { midPt = (Coordinate)listOfFirstBisect.get(0).getAttribute( BISECT_MIDDLE_POINT ); } // Step 4 - Do second round of bisection, if necessary. for ( Gfa gg : listOfFirstBisect ) { //First do point reduction on each of the bisected smears. Gfa tmpSmear = regularPointReduction( gg ); gg.setPointsOnly( tmpSmear.getPoints() ); gg.setReduceFlags( tmpSmear.getReduceFlags() ); if ( canBeFormatted( tmpSmear ) ) { glist.add( gg ); } else { //Another round of bisect, done. glist.addAll( bisect( gg, false) ); } } // // If bisection happens, check if the middle point generated in the first round // has been used for the second round. If not, remove the middle point from // all smears. // boolean removeMidPt = false; if ( midPt != null ) { int ii = 0; for ( Gfa gg : glist ) { for ( Coordinate cc : gg.getPoints() ) { if ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) { ii++; break; } } } if ( ii < 3 ) { removeMidPt = true; } } if ( removeMidPt ) { for ( Gfa gg : glist ) { Coordinate removePt = null; for ( Coordinate cc : gg.getPoints() ) { if ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) { removePt = cc; break; } } if ( removePt != null ) gg.getPoints().remove( removePt ) ; } } return glist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Gfa regularPointReduction( Gfa smearIn ) {\n\t\t\n\t\tArrayList<Coordinate> xyList = new ArrayList<Coordinate>( smearIn.getPoints() );\n\t List<Integer> reduceFlg = new ArrayList<Integer>(); \n\t List<Integer> orig = new ArrayList<Integer>();\n\t\t\n\t boolean[] reduceF = smearIn.getReduceFlags();\n\t\t\t \t \n\t for ( int ii = 0; ii < reduceF.length; ii++ ) {\n\t\t\t\n\t\t\tif ( reduceF[ ii ] ) {\n\t\t\t\treduceFlg.add( 1 );\n\t\t\t}\n\t\t\telse {\n\t\t\t\treduceFlg.add( 0 );\n\t\t\t}\n\t\t\t\n\t\t\torig.add( 1 );\n\t\t}\n\n\t /*\n\t for ( int ii = 0; ii < smearIn.getPoints().size(); ii++ ) {\n\t\t\tSystem.out.println( \"Point \" + ii + \" (\" + smearIn.getPoints().get( ii ).x + \",\" +\n\t\t\t\t\tsmearIn.getPoints().get( ii ).y + \") is \" + reduceFlg.get(ii) );\n\t\t}\n\t\t*/\t\t\t\n\t\tdouble incrPct = SMEAR_INCR_PCT;\n\t\tdouble incrPctOrig = REDUCEPTS_INCR_PCT_ORIG;\n\t\tdouble incrDst = SMEAR_INCR_DST;\n\t\t\n\t String prefix = getPrefixString( smearIn );\n\n\t int ier = ReduceGfaPoints.reduceByPctDist( xyList, reduceFlg, orig, \n\t\t\t\t incrPct, incrPctOrig, incrDst, prefix );\n \n\t\tboolean[] reduceFl = new boolean[ xyList.size() ];\n\t\tfor (int ii = 0; ii < xyList.size(); ii++ ) {\n\t\t\tif ( reduceFlg.get( ii ) == 1 )\n\t\t\t\treduceFl[ ii ] = true;\n\t\t\telse\n\t\t\t\treduceFl[ ii ] = false;\n\t\t}\n\t\t\n\t\tGfa newSmear = smearIn.copy();\n\t newSmear.setPointsOnly( xyList );\n\t newSmear.setReduceFlags( reduceFl );\n\t\t\n\t\treturn newSmear;\n\n\t}", "public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) {\n\n\t\tArrayList<Gfa> smearList = new ArrayList<Gfa>(); \n\n\t\t// Do area clipping and bisection for each smear.\n\t\tfor ( Gfa gg : glist ) {\n\t\t\tsmearList.addAll( reducePoints( gg, snapshots ) );; \n\t\t}\n\t\t\n\t\t// Replace the smear list with the new list.\n\t\tglist.clear();\n\t\tglist.addAll( smearList );\n\t\t\n\t}", "private void condenseSteam() {\n if (getPressure()> Constants.ATMOSPHERIC_PRESSURE) {\n double boilingPoint = Water.getBoilingTemperature(getPressure());\n if (boilingPoint > steam.getTemperature()) { // remove steam such that it equalizes to the boiling point\n double newSteamPressure = Math.max(Water.getBoilingPressure(steam.getTemperature()), Constants.ATMOSPHERIC_PRESSURE);\n \n\n int newQuantity = steam.getParticlesAtState(newSteamPressure, getCompressibleVolume());\n int deltaQuantity = steam.getParticleNr() - newQuantity;\n if (deltaQuantity < 0) {\n System.out.println(\"BAD\");\n }\n steam.remove(deltaQuantity);\n getWater().add(new Water(steam.getTemperature(), deltaQuantity));\n }\n } \n }", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void reduceStarsBy(final int amount);", "private void reduce(){\n int min;\n //Subtract min value from rows\n for (int i = 0; i < rows; i++) {\n min = source[i][0];\n for (int j = 1; j < cols; j++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int j = 0; j < cols; j++)\n source[i][j] -= min;\n }\n\n //Subtract min value from cols\n for (int j = 0; j < cols; j++) {\n min = source[0][j];\n for (int i = 1; i < rows; i++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int i = 0; i < rows; i++)\n source[i][j] -= min;\n\n }\n }", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private ArrayList<Gfa> faAreaClip( Gfa smear, ArrayList<Gfa> snapshots ) {\n \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t\t//If smear can be formatted, return.\n\t\tif ( canBeFormatted( smear ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\n\t\t/*\n\t\t * If the smear resides only in one FA area or two areas belong to different \n\t\t * FA regions, no need to clip. \n\t\t */\n\t\tString faAreas = smear.getGfaArea();\n\t\tif ( !faAreas.contains( \"-\" ) ||\n\t\t\t !isSameFaRegion( faAreas ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t\t\n\n\t\t// Retrieve extended FA area bounds\n\t\tHashMap<String, Geometry> xareaBnds = GfaClip.getInstance().getFaAreaXBoundsInGrid();\n\n\t\t\n\t\t/*\n\t\t * Find the intersection points with the extended FA area bounds and snap them. \n\t\t */\n\t\tPolygon smearPoly = GfaClip.getInstance().gfaToPolygon( smear );\n\t\tPolygon smearPolyInGrid = GfaClip.getInstance().gfaToPolygonInGrid( smear );\n\t\tHashMap<Coordinate, Coordinate> areaInterPts = getAreaIntersectionPt( smearPoly );\n\n\t\t/*\n\t\t * Do area clipping. The strategy is the same as regional clipping.\n\t\t * \n\t\t * 1. clip the smear polygon against each FA region (WEST, CENTRAL, EAST)\n\t\t * 2. create a list of parts bigger than/equal to 3K for each region\n\t\t * 3. hold the parts smaller than 3K for all regions in another list. \n\t\t */\n\t\tHashMap<String, ArrayList<Geometry> > clipWithAreas = new HashMap<String, ArrayList<Geometry> >(); \n\n\t\tArrayList<Geometry> smallPoly = new ArrayList<Geometry>(); \n\n\t\tfor ( String areaName : xareaBnds.keySet() ) {\n\n\t\t\tif ( !faAreas.contains( areaName ) ) continue;\n\n\t\t\tclipWithAreas.put( areaName, new ArrayList<Geometry>() );\n\n\t\t\t//Do area clipping as described above.\n\t\t\tGeometry areaBnd = xareaBnds.get( areaName );\t\t\t\t \n\t\t\tif ( areaBnd.intersects( smearPolyInGrid ) ) {\n\n\t\t\t\tGeometry areaPoly = areaBnd.intersection( smearPolyInGrid );\t\n\n\t\t\t\tif ( areaPoly != null ) {\t\t\t\t\t \t\t\t\t\t\t\t\n\t\t\t\t\tfor ( int kk = 0; kk < areaPoly.getNumGeometries(); kk++ ) {\t\t\t\t\t \t \n\t\t\t\t\t\tGeometry bigPoly = areaPoly.getGeometryN( kk );\t\t\t\t\t \t \n\n\t\t\t\t\t\tif ( GfaClip.getInstance().isBiggerInGrid( bigPoly ) ) {\t\t\t\t\t \t\n\t\t\t\t\t\t\tclipWithAreas.get( areaName ).add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tsmallPoly.add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\t \n\n\t\t}\t\t\t\t\t\t\t\t\n\n\t\t/*\n\t\t * Create smears from VALID parts and add into the return list\n\t\t * \n\t\t * 1. Union the parts in each FA region with the list of small parts -\n\t\t * If a small part touches one of the bigs (only one, I believe), it\n\t\t * will be united into that big and thus be included into a new\n\t\t * smear. So no part gets lost and all will be included eventually.\n\t\t * 2. When a small part is united into a big one (if they intersect), \n\t\t * the common points are still retained in the result, we need to \n\t\t * remove those extra point. The common points are resulted from the\n\t\t * previous clipping with the area boundaries.\n\t\t * 3. check the resulting union for VALID geometries and create new\n\t\t * smears for each of them.\t \t\t\t\n\t\t */\n\t\tfor ( String areaName : clipWithAreas.keySet() ) {\n\n\t\t\tArrayList<Geometry> bigs = clipWithAreas.get( areaName );\n\n\t\t\tArrayList<Geometry> toBeUnioned = new ArrayList<Geometry>();\n\t\t\ttoBeUnioned.addAll( bigs );\n\t\t\ttoBeUnioned.addAll( smallPoly );\n\t\t\tGeometry result = GfaClip.getInstance().quickUnion( toBeUnioned ); \t\t\t\n\n\t\t\tArrayList<Coordinate> commPts = GfaClip.getInstance().getCommonPoints( bigs, smallPoly );\n\n\t\t\tif ( result != null ) {\t\t \n\n\t\t\t\tfor ( int kk = 0; kk < result.getNumGeometries(); kk++ ) {\n\n\t\t\t\t\tGeometry one = result.getGeometryN( kk );\n\n\t\t\t\t\t//Remove residue points by clipping followed by subsequent union.\n\t\t\t\t\tGeometry onePart = GfaClip.getInstance().removeCommonPoints( one, commPts );\n\n\t\t\t\t\t//Clean up some improper cases\n\t\t\t\t\tCoordinate[] gPts = PgenUtil.gridToLatlon( onePart.getCoordinates() );\n\t\t\t\t\tArrayList<Coordinate> points = new ArrayList<Coordinate>();\n\t\t\t\t\tfor ( Coordinate c : gPts ) {\n\t\t\t\t\t\tpoints.add( c );\n\t\t\t\t\t}\n\t\t\t\t\tpoints.remove( points.size() - 1 );\n\n\t\t\t\t\t//Geometry cleanPts = GfaClip.getInstance().cleanupPoints( onePart );\n\t\t\t\t\t\n\t\t\t\t\tGeometry cleanPts = GfaClip.getInstance().cleanupPoints( \n\t\t\t\t\t\t\t GfaClip.getInstance().pointsToGeometry( points ) );\n\n\t\t\t\t\tif ( GfaClip.getInstance().isAddableAsSmear( cleanPts, snapshots, smear ) ) {\n\n\t\t\t\t\t\t//Replace intersection points with their pre-snapped pair.\n\t\t\t\t\t\tGeometry rplPts = GfaClip.getInstance().replacePts( cleanPts, areaInterPts );\n\n\t\t\t\t\t\t//Create a new GFA smear.\n\t\t\t\t\t\tcleanPts = GfaClip.getInstance().cleanupPoints( rplPts );\n\t\t\t\t\t\t\n\t\t\t\t\t\tGfa newElm = GfaClip.getInstance().geometryToGfa( smear, cleanPts );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tnewElm.setGfaArea( areaName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewSmears.add( newElm );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( Gfa gg : newSmears ) {\n\t\t boolean[] reduFlg = new boolean[ gg.getPoints().size() ];\n\t\t\tint ii = 0;\n\t\t for ( Coordinate newPt : gg.getPoints() ) {\n\t\t \treduFlg[ ii ] = false;\n\t\t \t\n\t\t \tfor ( int jj = 0; jj < smear.getPoints().size(); jj++ ) {\n\t\t \t\tif ( GfaSnap.getInstance().isSamePoint( newPt, \n\t\t \t\t\t\t smear.getPoints().get( jj ), GfaSnap.MAP_PRECISION ) ) {\n\t\t \t\t\treduFlg[ ii ] = smear.getReduceFlags()[ jj ];\n\t\t \t\t\tbreak;\t\t \t\t\t\n\t\t \t\t}\n\t\t \t}\n\t\t \tii++;\n\t\t }\n\t\t\t\n\t\t\tgg.setReduceFlags( reduFlg ); \n\t\t}\n\t\t\t\t\t\t\t\t\n\t\treturn newSmears;\n\t\n }", "public void reduceStarsBy(final int amount) {\n stars = Math.max(0, stars - amount);\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "private void reduce(int amount){\n while(colours.size() > amount){\n rgb curColour = colours.get(colours.size() - 1);\n double closest = -1;\n int id = -1;\n boolean notChanged = true;\n\n for(int i = 0; i < colours.size() - 1; i++){\n double dist = getDist(colours.get(i), curColour);\n if(dist < 0){\n colours.get(i).anotherFew(curColour.getAmount());\n notChanged = false;\n break;\n }else if(closest == -1 || dist < closest){\n closest = dist;\n id = i;\n }\n }\n if(notChanged){\n colours.get(id).anotherFew(curColour.getAmount());\n }\n colours.remove(colours.size() - 1);\n reinsert(id);\n }\n }", "abstract protected boolean clearSquareHitMine(Location m);", "private void removeOldestPoint() {\n PathPoint p = points.get(points.size() - length - 1);\n // if points has 5 points (0-4), length=3, then remove points(5-3-1)=points(1) leaving 2-4 which is correct\n float t = p.t - firstTimestamp;\n st -= t;\n sx -= p.x;\n sy -= p.y;\n stt -= t * t;\n sxt -= p.x * t;\n syt -= p.y * t;\n }", "protected abstract boolean reduce();", "public Polyline shrink(double percentage)\n {\n \tPoint centroid = this.getVisualCenter(1);\n \t\n \tPolyline output = new Polyline(this._isClosed, this._points, this._isFilled);\n \t\n \tint len = output._points.size();\n \tfor(int i = 0; i < len; i++)\n \t{\n \t\tPoint pt = output._points.get(i);\n \t\tpt = pt.multScalar(1 - percentage).add(centroid.multScalar(percentage));\n \t\toutput._points.set(i, pt);\n \t}\n\n \treturn output;\n }", "public void smelt() {\n if (this.canSmelt()) {\n ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.items[0]);\n if (this.items[1] == null) {\n this.items[1] = itemstack.copy();\n } else if (this.items[1].getItem() == itemstack.getItem()) {\n this.items[1].stackSize += itemstack.stackSize; // Forge BugFix:\n // Results may\n // have multiple\n // items\n }\n\n --this.items[0].stackSize;\n\n if (this.items[0].stackSize <= 0) {\n this.items[0] = null;\n }\n // TODO: Enable after update\n //energy.extractEnergy(1600, false);\n }\n }", "protected void optimize() {\n int[][] cutMemo = new int[dimX + 1][dimY + 1];\n Tuple[][] tupleMemo = new Tuple[dimX + 1][dimY + 1];\n Memo memo = new Memo(cutMemo,tupleMemo);\n\n //array is filled with -1 because -1 is used as a flag in the memo\n fillMemo(0, dimX, 0, dimY, cutMemo);\n\n //Calculates optimal value of cloth\n ArrayList<FittedPattern> answer = computeOptimal(dimX, dimY, pattern, memo, new ArrayList<>(), 0);\n coordinates = answer;\n finalValue = memo.getFittedPatternMemo()[dimX][dimY].getOptimalValue();\n\n }", "void optimiseSetPointProfile()\n\t{\n\t\tif (this.owner.storageHeater != null)\n\t\t{\n\t\t\toptimiseStorageHeater(this.owner.storageHeater);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"WattboxController:: optimise set point called for agent \" + this.owner.getAgentName());\n\t\t}\n\n\t\t// Initialise optimisation\n\t\tdouble[] localSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tdouble[] deltaT = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(this.priorDayExternalTempProfile));\n\t\tdouble[] localDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\tdouble leastCost = this.evaluateCost(localDemandProfile);\n\t\tdouble newCost = leastCost;\n\t\tdouble maxRecoveryPerTick = 0.5d\n\t\t\t\t* Consts.DOMESTIC_COP_DEGRADATION_FOR_TEMP_INCREASE\n\t\t\t\t* ((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * ArrayUtils.max(deltaT)); // i.e.\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// can't\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// recover\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// more\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// than\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// 50%\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// of\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// heat\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// loss\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// at\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// 90%\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// COP.\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// TODO:\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// Need\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// to\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// code\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// this\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// better\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// later\n\n\t\tfor (int i = 0; i < localSetPointArray.length; i++)\n\t\t{\n\t\t\t// Start each evaluation from the basepoint of the original (user\n\t\t\t// specified) set point profile\n\t\t\tlocalSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tdouble totalTempLoss = 0;\n\t\t\tdouble[] otherPrices = Arrays.copyOf(this.dayPredictedCostSignal, this.dayPredictedCostSignal.length);\n\n\t\t\tfor (int j = 0; (j < Consts.HEAT_PUMP_MAX_SWITCHOFF && (i + j < this.ticksPerDay)); j++)\n\t\t\t{\n\t\t\t\tdouble tempLoss = (((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * Math\n\t\t\t\t\t\t.max(0, (localSetPointArray[i + j] - this.priorDayExternalTempProfile[i + j]))) / this.owner\n\t\t\t\t\t\t.getBuildingThermalMass());\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Temp loss in tick \" + (i + j) + \" = \" + tempLoss);\n\t\t\t\t}\n\t\t\t\ttotalTempLoss += tempLoss;\n\n\t\t\t\tfor (int k = i + j; k < localSetPointArray.length; k++)\n\t\t\t\t{\n\t\t\t\t\tlocalSetPointArray[k] = this.setPointProfile[k] - totalTempLoss;\n\t\t\t\t\t// availableHeatRecoveryTicks++;\n\t\t\t\t}\n\t\t\t\tdouble availableHeatRecoveryTicks = localSetPointArray.length - j;\n\n\t\t\t\t// Sort out where to regain the temperature (if possible)\n\t\t\t\tint n = (int) Math.ceil((totalTempLoss * this.owner.getBuildingThermalMass()) / maxRecoveryPerTick);\n\t\t\t\t// Take this slot out of the potential cheap slots to recover\n\t\t\t\t// temp in.\n\t\t\t\totherPrices[i + j] = Double.POSITIVE_INFINITY;\n\n\t\t\t\tif (n < availableHeatRecoveryTicks && n > 0)\n\t\t\t\t{\n\t\t\t\t\t// We know it's possible to recover the temperature lost\n\t\t\t\t\t// in switch off period under the constraints set.\n\t\t\t\t\tdouble tempToRecover = (totalTempLoss / n);\n\n\t\t\t\t\t// Find the cheapest timeslots in which to recover the\n\t\t\t\t\t// temperature\n\t\t\t\t\t// If this selection results in a tie, the slot is chosen\n\t\t\t\t\t// randomly\n\t\t\t\t\tint[] recoveryIndices = ArrayUtils.findNSmallestIndices(otherPrices, n);\n\n\t\t\t\t\t// Add on temperature in each temperature recovery slot and\n\t\t\t\t\t// all subsequent slots - thus building an optimised\n\t\t\t\t\t// profile.\n\t\t\t\t\tfor (int l : recoveryIndices)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int m = l; m < this.ticksPerDay; m++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalSetPointArray[m] += tempToRecover;\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Adding \" + tempToRecover + \" at index \" + m + \" to counter temp loss at tick \"\n\t\t\t\t\t\t\t\t\t+ (i + j + 1));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Evaluating switchoff for tick zero, set point array = \"\n\t\t\t\t\t\t\t\t\t+ Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"In here, adding temp \" + tempToRecover + \" from index \" + l);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"With result \" + Arrays.toString(localSetPointArray));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdouble[] tempDifference = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(localSetPointArray));\n\n\t\t\t\t\tif (ArrayUtils.max(ArrayUtils.add(ArrayUtils.absoluteValues(tempDifference), ArrayUtils\n\t\t\t\t\t\t\t.negate(Consts.MAX_PERMITTED_TEMP_DROPS))) > Consts.FLOATING_POINT_TOLERANCE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if the temperature drop, or rise, is too great, this\n\t\t\t\t\t\t// profile is unfeasible and we return null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// calculate energy implications and cost for this\n\t\t\t\t\t\t// candidate setPointProfile\n\t\t\t\t\t\tlocalDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(localSetPointArray);\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Calculated demand for set point array turning off at tick \" + i + \" for \"\n\t\t\t\t\t\t\t\t\t+ (j + 1) + \" ticks \" + Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Demand = \" + Arrays.toString(localDemandProfile));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (localDemandProfile != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// in here if the set point profile is achievable\n\t\t\t\t\t\t\tnewCost = this.evaluateCost(localDemandProfile);\n\n\t\t\t\t\t\t\t// Decide whether to swap the new profile with the\n\t\t\t\t\t\t\t// current best one\n\t\t\t\t\t\t\t// based on cost.\n\t\t\t\t\t\t\t// Many strategies are available - here we give two\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\t// Either the new cost must be better by an amount\n\t\t\t\t\t\t\t// greater than some decision threshold\n\t\t\t\t\t\t\t// held in Consts.COST_DECISION_THRESHOLD\n\t\t\t\t\t\t\t// OR (currently used) the cost must simply be\n\t\t\t\t\t\t\t// better, with a tie in cost\n\t\t\t\t\t\t\t// being decided by a \"coin toss\".\n\n\t\t\t\t\t\t\t// if((newCost - leastCost) < (0 -\n\t\t\t\t\t\t\t// Consts.COST_DECISION_THRESHOLD))\n\t\t\t\t\t\t\tif (newCost < leastCost || (newCost == leastCost && RandomHelper.nextIntFromTo(0, 1) == 1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tleastCost = newCost;\n\t\t\t\t\t\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(localSetPointArray, localSetPointArray.length);\n\t\t\t\t\t\t\t\tthis.heatPumpDemandProfile = ArrayUtils\n\t\t\t\t\t\t\t\t\t\t.multiply(localDemandProfile, (1 / Consts.DOMESTIC_HEAT_PUMP_SPACE_COP));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Impossible to recover heat within heat pump\n\t\t\t\t\t\t\t// limits - discard this attempt.\n\t\t\t\t\t\t\tif (this.owner.getAgentID() == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.err.println(\"WattboxController: Can't recover heat with \" + availableHeatRecoveryTicks\n\t\t\t\t\t\t\t\t\t\t+ \" ticks, need \" + 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\t\t\t}\n\t\t}\n\n\t\tthis.expectedNextDaySpaceHeatCost = leastCost;\n\t}", "public void RemovePoint(int index) {\n if (index > PointArray.length - 1 || index < 0) {\n return;\n }\n double temp[] = new double[PointArray.length - 2];\n for (int i = 0; i <= PointArray.length - 1; i += 2) {\n if (i / 2 == index) {\n continue;\n }\n temp[i] = PointArray[i];\n temp[i + 1] = PointArray[i + 1];\n }\n }", "void losePoints() {\n if (currentPoints >= POINTSGIVEN) {\n currentPoints -= POINTSGIVEN;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }\n }", "public void reduce(Text key, \n Iterator<Text> values, \n OutputCollector<Text, Text> output, \n Reporter reporter) throws IOException {\n\n\n List<Text> saved_values = new ArrayList<Text>();\n\n float lat_sum = 0.0f;\n float lon_sum = 0.0f;\n int count = 0;\n\n while (values.hasNext()) {\n Text val = values.next();\n saved_values.add(val);\n\n String line = val.toString();\n Observation obs = Observation.makeObs(line);\n if (obs == null) {\n reporter.setStatus(\"bad input line: \" + line);\n continue;\n }\n\n /// debug: log our intermediate values\n //output.collect(key, new FloatWritable(val)); \n\n lon_sum += obs.lon;\n lat_sum += obs.lat;\n count++;\n }\n\n float lon_avg = lon_sum / count;\n float lat_avg = lat_sum / count;\n Coord avg = new Coord(lon_avg, lat_avg);\n\n /// debug: log totals\n //output.collect(new Text(key.toString()+ \"-count\"), new FloatWritable(count * 1.0f));\n \n // ### remove cells with too few observations ###\n int min_observations = 4;\n if (count < min_observations) {\n output.collect(key, new Text(\"too few obs (0 / \" + count + \")\"));\n return;\n }\n\n\n List<Text> outliers = new ArrayList<Text>();\n for (Text val : saved_values) {\n String line = val.toString();\n Observation obs = Observation.makeObs(line);\n if (obs == null) continue;\n double dist = avg.distance_to(obs);\n\n // ### remove outliers\n int max_distance = 1000;\n if (dist > max_distance) {\n outliers.add(val);\n }\n\n // ### remove cells with too little uncertainty ###\n int min_uncertainty = 150;\n if (obs.uncertainty != null && dist + obs.uncertainty >= min_uncertainty) {\n if (!outliers.contains(val))\n outliers.add(val);\n }\n\n }\n\n\n // process removals\n for (Text val : outliers) {\n saved_values.remove(val);\n }\n\n // recalulate actual results\n lat_sum = 0.0f;\n lon_sum = 0.0f;\n count = 0;\n for (Text val : saved_values) {\n String line = val.toString();\n Observation obs = Observation.makeObs(line);\n if (obs == null) continue;\n lon_sum += obs.lon;\n lat_sum += obs.lat;\n count++;\n }\n\n\n // output the results \n //output.collect(key, new Text(\"CELL:\" + avg.lon +\", \"+ avg.lat \n // + \" (\" + (count + outliers.size()) + \")\"));\n output.collect(key, new Text(lon_sum/count +\", \"+ lat_sum/count\n + \" (\" + count + \" / \" + (count + outliers.size()) + \")\"));\n\n }", "public static List<Point> ParetoOptimal(List<Point> listofPts)\n {\n \n if(listofPts.size() == 1 || listofPts.size() == 0)\n return listofPts;\n \n \n \n \n int pos = listofPts.size() /2 ;\n \n /*\n * quickSelect time complexity (n)\n */\n \n Point median = quickSelect(listofPts, pos, 0, listofPts.size() - 1); \n \n \n \n List<Point> points1 = new ArrayList<Point>();\n List<Point> points2 = new ArrayList<Point>();\n List<Point> points3 = new ArrayList<Point>();\n List<Point> points4 = new ArrayList<Point>();\n \n //O(n)\n if(oldMedian == median)\n {\n \t\n for(int x= 0; x < listofPts.size(); x++)\n {\n if(listofPts.get(x).getX() <= median.getX())\n {\n points1.add(listofPts.get(x));\n \n }\n else\n {\n points2.add(listofPts.get(x));\n \n }\n }\n \n \n }\n else\n {\n for(int x= 0; x < listofPts.size(); x++)\n {\n if(listofPts.get(x).getX() < median.getX())\n {\n points1.add(listofPts.get(x));\n \n }\n else\n {\n points2.add(listofPts.get(x));\n \n }\n }\n \n \n }\n //O(n)\n int yRightMax = -100000;\n for(int x= 0; x < points2.size(); x++)\n {\n if(points2.get(x).getY() > yRightMax)\n yRightMax = (int) points2.get(x).getY();\n \n }\n \n \n for(int x= 0; x < points1.size() ; x++)\n {\n if(points1.get(x).getY()> yRightMax)\n { \n points3.add(points1.get(x));\n \n } \n }\n \n for(int x= 0; x < points2.size() ; x++)\n {\n if(points2.get(x).getY() < yRightMax)\n {\n points4.add(points2.get(x));\n \n }\n \n }\n //System.out.println(\"points2: \" + points2);\n /*\n * Below bounded by T(n/c) + T(n/2) where c is ratio by which left side is shortened \n */\n oldMedian = median;\n return addTo \n ( ParetoOptimal(points3), \n ParetoOptimal(points2)) ;\n }", "public void removePoint(int line, int point) {\n\t\tif (this.aggregationMethod == AggregationMethod.ALL) {\n\t\t\tlines.get(line).removePointFromAll(point);\n\t\t} else {\n\t\t\tlines.get(line).removePoint(point);\n\t\t}\n\t}", "protected void shrink() {\n int cellsToDrop = snakeSize/2;\n this.snakeSize = snakeSize - cellsToDrop;\n // AMD: Reset the tip of the tail to be snake-free\n for (int xCell = 0; xCell < maxX; xCell++) {\n for (int yCell = 0; yCell < maxY; yCell++) {\n if (snakeSquares[xCell][yCell] > snakeSize) {\n snakeSquares[xCell][yCell] = NOT_A_SEGMENT;\n }\n }\n }\n }", "public void substract(double skalar) {\r\n for (int i = 0; i < matrix.length; i++) {\r\n for (int j = 0; j < matrix[0].length; j++) {\r\n matrix[i][j] -= skalar;\r\n }\r\n }\r\n }", "public void depreciate(){\r\n float amountN = getAmount();\r\n float reduce = amountN*(rate/100);\r\n amountN = amountN - reduce;\r\n this.amount = amountN;\r\n }", "public static void spreadDust() {\n newMap = new int[R][C];\n\n for (int i = 0; i < R; i++) {\n for (int j = 0; j < C; j++) {\n if (map[i][j] > 0) {\n int cnt = 0;\n for (int d = 0; d < 4; d++) {\n int ny = i + dy[d];\n int nx = j + dx[d];\n\n if (ny < 0 || ny > R - 1 || nx < 0 || nx > C - 1 || map[ny][nx] == -1)\n continue;\n\n newMap[ny][nx] += map[i][j] / 5;\n cnt++;\n }\n newMap[i][j] += map[i][j] - (map[i][j] / 5) * cnt;\n } else if (map[i][j] == -1) {// 공기청정기 위치.\n newMap[i][j] = -1;\n// airCleaner.add(new Point4(j, i));\n }\n }\n }\n\n for (int i = 0; i < R; i++) {\n map[i] = Arrays.copyOf(newMap[i], C);\n }\n\n cleanAir(airCleaner.get(0), airCleaner.get(1));\n\n }", "public void shrinkSnake() {\n\t\tSnakeObj.length--;\n\t\tSnakeArray[xTail][yTail] = 0; \n\t\txTail--;\n\t\tyTail--; \n\t\tthis.repaint(); \n\t}", "void pointScaleFree() {\n\t\t// offsetP = PVector.sub(P, beginOffsetP); // get the offset (because\n\t\t// mouse isnt' exatly at the pressed point, there a little offset)\n\t\toffset = PVector.sub(P, beginOffset); // calculate the offset made by\n\t\t\t\t\t\t\t\t\t\t\t\t// mouseDrag -- subtract\n\t\t\t\t\t\t\t\t\t\t\t\t// beginOffset from P\n\t\toffsetP = PVector.add(beginOffsetP, offset); // reposition point A based\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the offset made\n\n\t\tleftOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\t\trightOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\n\t\tfloat scaleFactorRight, scaleFactorLeft;\n\t\tscaleFactorRight = rightOppositeLine.X.dist(offsetP) / rightOppositeLine.beginX.dist(beginOffsetP);\n\t\tscaleFactorLeft = leftOppositeLine.X.dist(offsetP) / leftOppositeLine.beginX.dist(beginOffsetP);\n\n\t\t// needs exaplainin drawing\n\t\tPVector tmpR = new PVector();\n\t\tPVector tmpL = new PVector();\n\n\t\tif (rightOppositeLine.isOnThisSideOfLine == rightOppositeLine.checkLineSide(offsetP)) {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t}\n\t\t}\n\n\t\t// needs exaplainin drawing\n\n\t\ttmpL.mult(scaleFactorRight);\n\t\ttmpL.add(leftOppositeLine.end);\n\n\t\ttmpR.mult(scaleFactorLeft);\n\t\ttmpR.add(rightOppositeLine.end);\n\n\t\t// set left neigbor point\n\t\tpoint[neighbor(selectedPoint)[0]].position.set(tmpL);\n\n\t\t// set right neighbor point\n\t\tpoint[neighbor(selectedPoint)[1]].position.set(tmpR);\n\t\tpoint[selectedPoint].position.set(offsetP);\n\t\tselectedLine = -1; // disable line focus\n\t\tupdateGlobalLines();\n\t}", "private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }", "public Centroid removeCentroid();", "private static void reduceNoise(Mat image) {\n\n\t\t// create structuring element that will be used to \"dilate\" and \"erode\"\n\t\t// image. the element chosen here is a 3px by 3px rectangle\n\t\tMat erodeElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(1, 1));\n\n\t\t// dilate with larger element so make sure object is nicely visible\n\t\tMat dilateElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(12, 12));\n\n\t\t// Erode will shrink the grouping of pixels\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\n\t\t// // Dilate will expand the grouping of pixels\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\t// Imgproc.dilate(image, image, dilateElement);\n\n\t}", "public Location spread()\n {\n // plant needs to be alive, ready to reproduce (# of turns) \n // square needs to have fewer than 10 plants, BUT a tree can kill \n // a grass plant\n }", "public void calc()\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(oldInfo.calcInfo!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\toldInfo.calcInfo.calc();\n\t\t\t\t\t\t\toldInfo.calcInfo=null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Filter particles\n\t\t\t\t\t\tfor(int id:oldInfo.keySet())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tParticleInfo pInfo=oldInfo.get(id);\n\t\t\t\t\t\t\tif(filter.acceptParticle(id, pInfo))\n\t\t\t\t\t\t\t\tnewInfo.put(id,pInfo);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private static Location permutateLocation(Location location){\n while (isMaterialInBlackList(location))\n location = locationYIncrementer(location, 2);\n return location;\n }", "public void removeMissiles(){\n nunMissiles--;\n }", "public Point getAlteredCoord(Point actualPoint) {\n //If breath rate is out of range, returns an altered coordinate according to the level of out of range and\n //the current game level (Easy, Medium, Hard). If breath is in range, return the same coord.\n Point alteratedPoint = actualPoint;\n\n Random randomNoise = new Random();\n\n //As USER_CURRENT_BREATH_RATE will be changing, we must do a \"snapshot\" at this time to work with proper measures.\n double userCurrentSnap = USER_CURRENT_BREATH_RATE;\n\n //Consider 6-8, MAX_IDEAL_BREATH_RATE (8) will be the max\n double referenceDistance = MAX_BREATH_RATE - MAX_IDEAL_BREATH_RATE;\n double myRateExcess = userCurrentSnap - MAX_IDEAL_BREATH_RATE;\n double relationPreferedActual = myRateExcess / referenceDistance;\n\n //How much far of the ideal is?, according to our limit of 20\n double percentOfExcess = relationPreferedActual * 100;\n\n /*\n EASY:\n Speed: 25%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 30% of the maximum number on coord x or y\n MEDIUM:\n Speed: 45%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 50% of the maximum number on coord x or y\n HARD:\n Speed: 80%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 80% of the maximum number on coord x or y\n */\n\n //Maximum increment of speed in 15% of MAX_SCALED_SPEED\n double mxSpdInc = MAX_SCALED_SPEED * .15;\n\n //NOTE: The formulas obtained were based on x^2\n /*\n *Solving y=ax^2 + b\n *Finding the variables a, and b. X represents the amount of excess and Y represents the speed for that amount\n */\n double a, b;\n double maxSpeed; //Max space in case of 100% of\n double easyNoise = .38, mediumNoise = .58, hardNoise = .75; //Percents\n\n //drive_control works acording to the size of the wheel. And as closer to the circumference as faster that will be.\n int maxX = this.wheel.getBounds().width(); //This represent the max X possible coord on the wheel\n int maxY = this.wheel.getBounds().height();\n\n if (percentOfExcess > 0) {\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n\n //Alter speed. The speed will be changed\n maxSpeed = EASY_BASE_SPEED + mxSpdInc;\n b = EASY_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n\n alteratedPoint = getFinalPoint(maxX, maxY, easyNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n break;\n case MEDIUM:\n maxSpeed = MEDIUM_BASE_SPEED + mxSpdInc;\n b = MEDIUM_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, mediumNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n case HARD:\n maxSpeed = HARD_BASE_SPEED + mxSpdInc;\n b = HARD_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, hardNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n }\n } else {//Else, the user's breath rate must be under 8 so it's ok.\n //In this case, we will ensure that the speed it's acording to the level.\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n this.drive_control.setSpeedScale(this.EASY_BASE_SPEED);\n break;\n case MEDIUM:\n this.drive_control.setSpeedScale(this.MEDIUM_BASE_SPEED);\n break;\n case HARD:\n this.drive_control.setSpeedScale(this.HARD_BASE_SPEED);\n break;\n }\n }\n return alteratedPoint;\n }", "float getConsumeReduction();", "float getCostReduction();", "public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "public void smeltItem()\n {\n if (this.canSmelt())\n {\n ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);\n\n if (this.furnaceItemStacks[2] == null)\n {\n this.furnaceItemStacks[2] = var1.copy();\n }\n else if (this.furnaceItemStacks[2].isItemEqual(var1))\n {\n ++this.furnaceItemStacks[2].stackSize;\n }\n\n --this.furnaceItemStacks[0].stackSize;\n\n if (this.furnaceItemStacks[0].stackSize <= 0)\n {\n this.furnaceItemStacks[0] = null;\n }\n }\n }", "private static int removeStatPoints(int statPoints){\r\n statPoints--;\r\n return statPoints;\r\n }", "public double reducePrice(double reduce){\n double reducedPrice= price - reduce;\n return reducedPrice;\n }", "public void shrinkSquare()\n {\n squareSize--;\n }", "private void optimiseWaterHeatProfileWithSpreading()\n\t{\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"== OptimiseWaterHeatProfile for a \" + this.owner.getAgentID() + \" ==\");\n\t\t}\n\n\t\tdouble[] baseArray = ArrayUtils.multiply(this.hotWaterVolumeDemandProfile, Consts.WATER_SPECIFIC_HEAT_CAPACITY\n\t\t\t\t/ Consts.KWH_TO_JOULE_CONVERSION_FACTOR * (this.owner.waterSetPoint - ArrayUtils.min(Consts.MONTHLY_MAINS_WATER_TEMP))\n\t\t\t\t/ Consts.DOMESTIC_HEAT_PUMP_WATER_COP);\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"hotWaterVolumeDemandProfile: \" + Arrays.toString(this.hotWaterVolumeDemandProfile));\n\t\t}\n\n\t\tthis.waterHeatDemandProfile = Arrays.copyOf(baseArray, baseArray.length);\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"waterHeatDemandProfile: \" + Arrays.toString(this.waterHeatDemandProfile));\n\t\t}\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"spreadWaterDemand(baseArray) : \" + Arrays.toString(this.spreadWaterDemand(baseArray)));\n\t\t}\n\n\t\tdouble[] totalHeatDemand = ArrayUtils.add(this.heatPumpDemandProfile, this.spreadWaterDemand(baseArray));\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"totalHeatDemand: \" + Arrays.toString(totalHeatDemand));\n\t\t}\n\n\t\tdouble currCost = this.evaluateCost(totalHeatDemand);\n\t\tdouble[] tempArray = Arrays.copyOf(baseArray, baseArray.length);\n\n\t\tfor (int i = 0; i < baseArray.length; i++)\n\t\t{\n\t\t\tif (baseArray[i] > 0)\n\t\t\t{\n\t\t\t\tdouble extraHeatRequired = 0;\n\t\t\t\tfor (int j = i - 1; j >= 0; j--)\n\t\t\t\t{\n\t\t\t\t\t//TODO - this needs a better (exponential) model, temp loss per second should be improved.\n\t\t\t\t\textraHeatRequired += (Consts.WATER_TEMP_LOSS_PER_SECOND * ((double) Consts.SECONDS_PER_DAY / this.ticksPerDay))\n\t\t\t\t\t\t\t* this.hotWaterVolumeDemandProfile[i]\n\t\t\t\t\t\t\t* (Consts.WATER_SPECIFIC_HEAT_CAPACITY / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t\t/ Consts.DOMESTIC_HEAT_PUMP_WATER_COP;\n\t\t\t\t\ttempArray[j] += baseArray[i] + extraHeatRequired;\n\t\t\t\t\ttempArray[j + 1] = 0;\n\t\t\t\t\ttotalHeatDemand = ArrayUtils.add(this.heatPumpDemandProfile, this.spreadWaterDemand(tempArray));\n\t\t\t\t\tdouble newCost = this.evaluateCost(totalHeatDemand);\n\t\t\t\t\tif (newCost < currCost)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.waterHeatDemandProfile = ArrayUtils.add(totalHeatDemand, ArrayUtils.negate(this.heatPumpDemandProfile));\n\t\t\t\t\t\tcurrCost = newCost;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void simplify() {\n for (int i = getDegree(); i >= 0; i--) {\n if (Math.abs(coefs[i]) <= Polynomial.TOLERANCE) {\n // remove last element\n coefs = Arrays.copyOf(coefs, coefs.length - 1);\n } else {\n break;\n }\n }\n }", "public void remove_transfered_points(int points) {\n\t\tthis.balance = this.balance - points;\n\t\tif(this.balance < 10000) this.status = \"Bronze\";\n\t\telse if(this.balance >= 10000) this.status = \"Silver\";\n\t\t\n\t}", "@Override\n\tpublic Retorno eliminarEsquina(Double coordX, Double coordY) {\n\t\treturn new Retorno();\n\t}", "synchronized protected void removePoint(final int index) {\n \t\t// check preconditions:\n \t\tif (index < 0) {\n \t\t\treturn;\n \t\t} else if (n_points - 1 == index) {\n \t\t\t//last point out\n \t\t\tn_points--;\n \t\t} else {\n \t\t\t//one point out (but not the last)\n \t\t\t--n_points;\n \n \t\t\t// shift all points after 'index' one position to the left:\n \t\t\tfor (int i=index; i<n_points; i++) {\n \t\t\t\tp[0][i] = p[0][i+1];\t\t//the +1 doesn't fail ever because the n_points has been adjusted above, but the arrays are still the same size. The case of deleting the last point is taken care above.\n \t\t\t\tp[1][i] = p[1][i+1];\n \t\t\t\tp_layer[i] = p_layer[i+1];\n \t\t\t}\n \t\t}\n \n \t\t// Reset or fix autotracing records\n \t\tif (index < last_autotrace_start && n_points > 0) {\n \t\t\tlast_autotrace_start--;\n \t\t} else last_autotrace_start = -1;\n \n \t\t//update in database\n \t\tupdateInDatabase(\"points\");\n \t}", "public int removeProtein(double grams) {\n return this.protein -= grams;\n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "private void undoLastPoint() {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tthis.markers.remove( this.markers.size() - 1 ).remove();\n \t\tthis.commitPolygon();\n \n \t\tif ( this.markers.size() > 1 ) {\n \t\t\tthis.moveCameraToPolygon( true );\n \t\t}\n \n \t\tthis.disableIfDissatisfied();\n \t}", "@NonNull\n @Override\n public PointF transformMeteringPoint(@NonNull PointF point) {\n final PointF referencePoint = new PointF(point.x, point.y);\n Size referenceSize = previewSize;\n\n // 1. Account for cropping.\n // This will enlarge the preview size so that aspect ratio matches.\n referenceSize = applyPreviewCropping(referenceSize, referencePoint);\n\n // 2. Scale to the preview stream coordinates.\n // This will move to the preview stream coordinates by scaling.\n referenceSize = applyPreviewScale(referenceSize, referencePoint);\n\n // 3. Rotate to the stream coordinate system.\n // This leaves us with sensor stream coordinates.\n referenceSize = applyPreviewToSensorRotation(referenceSize, referencePoint);\n\n // 4. Move to the crop region coordinate system.\n // The crop region is the union of all currently active streams.\n referenceSize = applyCropRegionCoordinates(referenceSize, referencePoint);\n\n // 5. Move to the active array coordinate system.\n referenceSize = applyActiveArrayCoordinates(referenceSize, referencePoint);\n LOG.i(\"input:\", point, \"output (before clipping):\", referencePoint);\n\n // 6. Probably not needed, but make sure we clip.\n if (referencePoint.x < 0) referencePoint.x = 0;\n if (referencePoint.y < 0) referencePoint.y = 0;\n if (referencePoint.x > referenceSize.getWidth()) referencePoint.x = referenceSize.getWidth();\n if (referencePoint.y > referenceSize.getHeight()) referencePoint.y = referenceSize.getHeight();\n LOG.i(\"input:\", point, \"output (after clipping):\", referencePoint);\n return referencePoint;\n }", "public void smeltItem() {\n\t\tif (this.canSmelt()) {\n\t\t\tItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(\n\t\t\t\t\tthis.slots[0]);\n\t\t\tif (this.slots[1] == null) {\n\t\t\t\tthis.slots[1] = itemstack.copy();\n\t\t\t} else if (this.slots[1].getItem() == itemstack.getItem()) {\n\t\t\t\tthis.slots[1].stackSize += itemstack.stackSize;\n\t\t\t}\n\n\t\t\t--this.slots[0].stackSize;\n\n\t\t\tif (this.slots[0].stackSize <= 0) {\n\t\t\t\tthis.slots[0] = null;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tprotected void onReduceMp()\r\n\t{\n\t}", "public void spread(double amount) {\r\n userJam.remove(amount);\r\n }", "public boolean canReduce() {\n\t\treturn marker == getRhs().length;\n\t}", "public void decrementPossiblePoints() {\n if (groupScore == 1) {groupScore = 0; return;}\n if (groupScore - (groupScore / 2) >= 0) {\n groupScore -= (groupScore / 2);\n }\n }", "public void smallerRocks() {\n\t\t// make the asteroid smaller\n\t\t// by dividing the width by SIZE_INC\n\t\twidth = width / SIZE_INC;\n\n\t\t// set the end points with new location being the first line's start\n\t\tmakeEndPoints(width, outLine[0].getStart().getX(), outLine[0]\n\t\t\t\t.getStart().getY());\n\n\t\t// and make it a little faster\n\t\txSpeed = INC * xSpeed;\n\t\tySpeed = INC * ySpeed;\n\n\t}", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "public void setRevisedPoints(int thePoints)\r\n {\r\n points = points + thePoints;\r\n }", "void scaleArea(float scaleFactor) {\n\t\t// for more advanced (more than 4 points), use this algorithm:\n\t\t// http://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tPVector tmp = PVector.sub(point[i].position, anchor);\n\t\t\ttmp.mult(scaleFactor);\n\t\t\tpoint[i].position.set(PVector.add(anchor, tmp));\n\t\t}\n\t}", "private void purgeAllOverflowEM_EM() {\n float mass = 0;\n for (GT_MetaTileEntity_Hatch_InputElemental tHatch : eInputHatches) {\n if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {\n tHatch.updateSlots();\n }\n mass += tHatch.overflowMatter;\n tHatch.overflowMatter = 0;\n }\n for (GT_MetaTileEntity_Hatch_OutputElemental tHatch : eOutputHatches) {\n if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {\n tHatch.updateSlots();\n }\n mass += tHatch.overflowMatter;\n tHatch.overflowMatter = 0;\n }\n cleanMassEM_EM(mass);\n }", "@Override\n public void finish(long now) {\n for (int i = 0; i < partCount; i++) {\n shapes[i].setReduced(true);\n }\n scene.setAdjusting(false||isInStartedPlayer());\n super.finish(now);\n }", "public void calculatePoints() {\n /*\n for (int i = 0; i < getRacers().size(); i++) {\n String username = getRacers().get(i).getUsername();\n int total = 0;\n for (int j = 0; j < getRounds().size(); j++) {\n Slot slot = getRounds().get(j).findRacerInRound(username);\n if (slot != null) {\n total = total + slot.getPoints();\n }\n }\n getRacers().get(i).setPoints(total);\n }*/\n }", "public void rechargePrayerPoints() {\r\n prayerPoints = staticLevels[PRAYER];\r\n if (entity instanceof Player) {\r\n PacketRepository.send(SkillLevel.class, new SkillContext((Player) entity, PRAYER));\r\n }\r\n }", "public Point2D removePoint(int i) {\n\t\tPoint2D p = pointList.remove(i);\n\t\tif (p != null) {\n\t\t\tySum -= p.getY();\n\t\t\tminY = Double.NaN;\n\t\t\tmaxY = Double.NaN;\n\t\t}\n\t\treturn p;\n\t}", "public void removeVerticalSeam(int[] a) {\n // Check there are seams to remove\n if (current.width() <= 1)\n throw new IllegalArgumentException(\"Current width <= 1\");\n // Check the seam is of height length and inside bounds\n if (a.length != current.height())\n throw new IllegalArgumentException(\"Seam is not complete\");\n for (int i = 0; i < a.length; i++) {\n if (a[i] < 0 || a[i] >= current.width()) {\n throw new IllegalArgumentException(\"Seam out of bounds\");\n }\n }\n // Check the seam elements have distance of one\n for (int i = 1; i < a.length; i++) {\n if (Math.abs(a[i - 1] - a[i]) > 1)\n throw new IllegalArgumentException(\n \"Too much distance in the seam\");\n }\n\n Picture newPicture = new Picture(current.width() - 1, current.height());\n for (int j = 0; j < current.height(); j++) {\n int removedX = a[j];\n int posX = 0;\n for (int i = 0; i < current.width(); i++) {\n if (i != removedX) {\n newPicture.set(posX, j, current.get(i, j));\n posX++;\n }\n }\n }\n\n current = newPicture;\n }", "public void recenter()\n {\n PointF center = centroid();\n\n for (PointF point : points)\n {\n point.x -= center.x;\n point.y -= center.y;\n }\n }", "public void modifyFitness(Population population) {\n // prepare the calculation\n double[][] data = new double[population.size()][];\n for (int i = 0; i < data.length; i++) {\n data[i] = ((AbstractEAIndividual)population.get(i)).getFitness();\n }\n double min = Double.POSITIVE_INFINITY, fitnessSharing;\n double[] result = new double[data.length];\n AbstractEAIndividual tmpIndy;\n\n for (int x = 0; x < data[0].length; x++) {\n for (int i = 0; i < data.length; i++) data[i][x] = -data[i][x];\n for (int i = 0; i < data.length; i++) {\n if (data[i][x] < min) min = data[i][x];\n }\n\n for (int i = 0; i < data.length; i++) {\n // This will cause the worst individual to have no chance of being selected\n // also note that if all individual achieve equal fitness the sum will be zero\n result[i] = data[i][x] -min + 0.1;\n }\n\n for (int i = 0; i < population.size(); i++) {\n tmpIndy = (AbstractEAIndividual)population.get(i);\n fitnessSharing = 0;\n for (int j = 0; j < population.size(); j++) {\n if (this.m_SharingDistance < this.m_Metric.distance(tmpIndy, (AbstractEAIndividual)population.get(j))) {\n fitnessSharing += 1 - (this.m_Metric.distance(tmpIndy, (AbstractEAIndividual)population.get(j))/this.m_SharingDistance);\n }\n }\n result[i] = result[i]/fitnessSharing;\n }\n\n for (int i = 0; i < population.size(); i++) {\n ((AbstractEAIndividual)population.get(i)).SetFitness(x, result[i]);\n }\n }\n }", "public com.twc.bigdata.views.avro.viewing_info.Builder clearFurthestPoint() {\n furthest_point = null;\n fieldSetFlags()[5] = false;\n return this;\n }", "private Area shrinkArea(Area area, int amount) {\n\t\tint i = amount;\n\t\ttmpArea4 = (Area) area.clone();\n\t\tdo {\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, 1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, 1);\n\t\t} while (i-- >= 0 && !tmpArea4.isEmpty());\n\t\tif (!tmpArea4.isEmpty()\n\t\t\t\t&& tmpArea4.getBounds().width > INTERACT_SIZE_MIN\n\t\t\t\t&& tmpArea4.getBounds().height > INTERACT_SIZE_MIN)\n\t\t\tarea = tmpArea4;\n\t\tarea.intersect(gameArea);\n\t\treturn area;\n\t}", "public PowerUpReduce(int radius, double x, double y) {\n super(radius, Color.ORANGE, x, y);\n }", "private void calcEfficiency() {\n \t\tdouble possiblePoints = 0;\n \t\tfor (int i = 0; i < fermentables.size(); i++) {\n \t\t\tFermentable m = ((Fermentable) fermentables.get(i));\n \t\t\tpossiblePoints += (m.getPppg() - 1) * m.getAmountAs(\"lb\")\n \t\t\t\t\t/ postBoilVol.getValueAs(\"gal\");\n \t\t}\n \t\tefficiency = (estOg - 1) / possiblePoints * 100;\n \t}", "public void removeHorizontalSeam(int[] a) {\n // Check there are seams to remove\n if (current.height() <= 1)\n throw new IllegalArgumentException(\"Current height <= 1\");\n // Check the seam is of height length and inside bounds\n if (a.length != current.width())\n throw new IllegalArgumentException(\"Seam is not complete\");\n for (int i = 0; i < a.length; i++) {\n if (a[i] < 0 || a[i] >= current.height()) {\n throw new IllegalArgumentException(\"Seam out of bounds\");\n }\n }\n // Check the seam elements have distance of one\n for (int i = 1; i < a.length; i++) {\n if (Math.abs(a[i - 1] - a[i]) > 1)\n throw new IllegalArgumentException(\n \"Too much distance in the seam\");\n }\n\n Picture newPicture = new Picture(current.width(), current.height() - 1);\n for (int i = 0; i < current.width(); i++) {\n int removedY = a[i];\n int posY = 0;\n for (int j = 0; j < current.height(); j++) {\n if (j != removedY) {\n newPicture.set(i, posY, current.get(i, j));\n posY++;\n }\n }\n }\n\n current = newPicture;\n }", "void removeNextSeamVert() {\n SeamInfo toRemove = this.curLowest;\n\n toRemove.removeSeamVert();\n\n if (toRemove.containsPixel(this.curPixel)) {\n\n this.curPixel = this.curPixel.right;\n }\n\n this.removedSeams.add(toRemove);\n\n this.draw();\n }", "private void deductGamePoints(List<Integer> prevGamePoints) {\n for (int i = 0; i < numAlive; i++) {\n int playerTrickPoints = trickPoints.get(i);\n if (playerTrickPoints < 0) {\n int prevPoints = prevGamePoints.get(i);\n int newPoints = prevPoints + playerTrickPoints;\n \n if (newPoints < 0) {\n // Cannot have negative points\n gamePoints.set(i, 0);\n } else {\n gamePoints.set(i, newPoints);\n }\n }\n }\n }", "@Override\n\tpublic boolean isReduce() {\n\t\treturn true;\n\t}", "void DropFood(){\r\n if (plateau[this.x][this.y]!='0' && this.charge!='0'){\r\n this.plateau[this.x][this.y]+=this.charge;\r\n this.charge=0;\r\n \r\n } \r\n }", "void removeBall(Coordinates at);", "void removeHasLatitude(Object oldHasLatitude);", "public void imprimir() {\n\t\r\n\tSystem.out.println(\"El circulo tiene un perimetro de \"+ this.perimetro + \" y un area de \"+ this.area);\r\n\t\r\n\t}", "public void moverBalasRival(Array<Bala> balasRival) {\n for (Bala bala : balasRival) {\n switch (bala.getIdPj()) {\n case 1:\n case 4:\n case 7:\n bala.getPosicion().add(new Vector2(0, -1).scl(bala.getVelocidad()));\n Rectangle rect = bala.obtenerRectanguloBala(bala);\n rect.setPosition(bala.getPosicion());\n break;\n\n case 2:\n bala.getPosicion().add(new Vector2(0, -1).scl(bala.getVelocidad()));\n Circle circ = bala.obtenerCirculoBala(bala);\n circ.setPosition(bala.getPosicion().x + bala.getAnchoRelativoAspecto() / 2, bala.getPosicion().y + bala.getAltoRelativoAspecto() / 2);\n break;\n case 3:\n case 5:\n case 6:\n case 8:\n case 9:\n case 10:\n bala.getPosicion().add(new Vector2(0, -1).scl(bala.getVelocidad()));\n Polygon p = bala.obtenerPoligonoBala(bala);\n for (int i = 0; i < p.getVertices().length; i++) {\n if (i % 2 != 0) {\n p.getVertices()[i] -= bala.getVelocidad();\n }\n }\n p.setPosition(bala.getPosicion().x, bala.getPosicion().y);\n break;\n default:\n break;\n }\n }\n }", "private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\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 reduceCount()\n {\n minesLeft--;\n repaint();\n if (minesLeft == 0 && minesFound == numMines)\n {\n endGame(true);\n }\n }", "void removeDecisionSightDistance(int i);", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "@Override\r\n\tpublic void minusFromCost() {\n\t\t\r\n\t}", "public abstract void improveValueFunction(Vector<BeliefState> vBeliefPoints, Vector<BeliefState> vNewBeliefPoints);", "public void reduceBalance(int amount){\n this.money.subtractMoney(amount);\n }", "private synchronized void update() {\n nPoints++;\n int n = points.size();\n if (n < 1) {\n return;\n }\n PathPoint p = points.get(points.size() - 1); // take last point\n if (p.getNEvents() == 0) {\n return;\n }\n if (n > length) {\n removeOldestPoint(); // discard data beyond range length\n }\n n = n > length ? length : n; // n grows to max length\n float t = p.t - firstTimestamp; // t is time since cluster formed, limits absolute t for numerics\n st += t;\n sx += p.x;\n sy += p.y;\n stt += t * t;\n sxt += p.x * t;\n syt += p.y * t;\n// if(n<length) return; // don't estimate velocityPPT until we have all necessary points, results very noisy and send cluster off to infinity very often, would give NaN\n float den = (n * stt - st * st);\n if (den != 0) {\n valid = true;\n xVelocity = (n * sxt - st * sx) / den;\n yVelocity = (n * syt - st * sy) / den;\n } else {\n valid = false;\n }\n }", "public void depolarize(){\n\t\t\tif(sodiumChannel.getGateStatus().equalsIgnoreCase(\"open\")) {\n\t\t\t\tfor(int i = 1; i <= threshold; i++) {\n\t\t\t\t\tcurrentVoltage = currentVoltage + sodiumIon;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public Builder clearRemainPoints() {\n \n remainPoints_ = 0;\n onChanged();\n return this;\n }", "public Builder clearNeedPoints() {\n \n needPoints_ = 0;\n onChanged();\n return this;\n }", "public void Reduce() {\n\t\tint gcd = MathHelper.GreatestCommonDivisor(this.numerator, this.denominator);\n\t\t\n\t\t// avoid divide by 0\n\t\tif (gcd > 0) {\n\t\t\tthis.numerator = this.numerator / gcd;\n\t\t\tthis.denominator = this.denominator / gcd;\n\t\t}\n\t}", "abstract public Point[] getCheminDeplacement(Coup c);", "@Test\r\n\tpublic void calculLostPointsByOneRuleBelowMinTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculLostPointsByOneRule(new ModelValue(2f, 0.5f, 3f), new Integer(1)),\r\n\t\t\t\tnew Float(0));\r\n\t}", "void decreaseStrength() {\n if (this.strokeStrength - 0.25 >= 1) {\n this.strokeStrength -= 0.25;\n }\n this.updateAcc();\n this.updateStick();\n }", "private void shrink() {\n int shrinkSize = array.length>>1;\n array = Arrays.copyOf(array, shrinkSize);\n }" ]
[ "0.7366695", "0.6224911", "0.57745814", "0.5707575", "0.5495555", "0.53279483", "0.52185273", "0.5191471", "0.5140718", "0.5110331", "0.50394654", "0.5002475", "0.49769026", "0.49760085", "0.49668926", "0.4957917", "0.49545497", "0.4952747", "0.4919232", "0.4914396", "0.49052745", "0.4895025", "0.48711345", "0.48698", "0.48305494", "0.48088467", "0.4807551", "0.48054108", "0.47995007", "0.47793522", "0.4779162", "0.47512138", "0.47325578", "0.4720987", "0.47051132", "0.46867293", "0.46835127", "0.46775475", "0.46756718", "0.46707076", "0.46581995", "0.46518102", "0.46409407", "0.46251097", "0.46238312", "0.46138552", "0.46047136", "0.4603785", "0.460229", "0.45957577", "0.459048", "0.4588321", "0.4580884", "0.45754787", "0.4570892", "0.45634225", "0.45623082", "0.45605627", "0.4560021", "0.45565194", "0.45538768", "0.4552884", "0.45527223", "0.45419598", "0.45418078", "0.45417336", "0.45396337", "0.45291397", "0.45083028", "0.45029145", "0.44938877", "0.44926718", "0.44888875", "0.4488756", "0.44820908", "0.44660205", "0.44589016", "0.4452268", "0.4445428", "0.4428164", "0.4423572", "0.44222566", "0.44136325", "0.44032916", "0.44015807", "0.43995565", "0.43944535", "0.43942758", "0.43934676", "0.43911254", "0.4388515", "0.4388288", "0.4387361", "0.43818367", "0.43818203", "0.4381549", "0.4381455", "0.43789405", "0.4378676", "0.43776026" ]
0.6694572
1
Check if a smear can be formatted into 3 65character lines
public static boolean canBeFormatted( Gfa smear ) { boolean formattable = false; if ( !smear.isSnapshot() ) { String prefix = getPrefixString( smear );; formattable = canBeFormatted( smear.getPoints(), prefix ); } return formattable; // return ( smear.getLinePoints().length <= 5 ) ? true : false; //test purpose only }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void WarningForOverThreeLines( Gfa smear ) {\n\t\t\n\t\tif ( !smear.isSnapshot() ) { \n\t\t String prefix = getPrefixString( smear );\n\t\t \n\t\t boolean formattable = \tcanBeFormatted( smear.getPoints(), prefix );\n\t\t \n\t\t if ( !formattable ) {\n\t\t\t String message = \"\";\n\t\t\t if ( prefix.equals( Gfa.FROM ) ) {\n\t\t\t \tmessage = new String( \"This AIRMET will generate more than 3 FROM lines when formatted.\");\n\t\t\t }\n\t\t\t else {\n\t\t\t \tmessage = new String( \"This OUTLOOK will generate more than 3 FROM lines when formatted.\");\t\t\t \t\n\t\t\t }\n\t\t\t \n\t \t\tMessageDialog confirmDlg = new MessageDialog( \n\t \t\tPlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), \n\t \t\t\"Over 3 FROM Lines\", null, message,\n\t \t\tMessageDialog.WARNING, new String[]{\"OK\"}, 0 );\n\t \n\t \tconfirmDlg.open();\n\n\t\t }\t\t \t\t \n\t\t}\t\t\t\t\n\t}", "private boolean m29108b(String str) {\n if (str != null) {\n if (str.endsWith(\"\\n\")) {\n str = str.substring(0, str.length() - 1);\n }\n return 24 == str.length() && !this.f22553a.matcher(str).find();\n }\n }", "public static boolean checkLineLength(String matrice){\r\n String[] lignes = matrice.trim().split(\" {1,}\");\r\n int longeur = lignes[0].length();\r\n int i = 1;\r\n boolean memeLongeur = true;\r\n while(i < lignes.length && memeLongeur){\r\n memeLongeur = (longeur == lignes[i].length());\r\n ++i;\r\n }\r\n\r\n if(! memeLongeur){\r\n System.out.println(\"Matrice invalide, lignes de longueurs differentes !\");\r\n }\r\n\r\n return memeLongeur;\r\n }", "public boolean syntaktischRichtig() \n\t{\n\t\tcounters = new int[37];\n\t\tmaxCount = 0;\n\t\tboolean breakIt = false;\n\t\tfor (char[] zeile : level) \n\t\t{\n\t\t\tfor (char elm : zeile) \n\t\t\t{\n\t\t\t\tint cti = charToInt(elm);\n\t\t\t\tif (cti == -1) \n\t\t\t\t{\n\t\t\t\t\tbreakIt = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else \n\t\t\t\t{\n\t\t\t\t\tcounters[cti]++;\n\t\t\t\t\tif (counters[cti] > 4 && elm != '-') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tmaxCount++;\n\t\t\t}\n\t\t\tif (breakIt){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (maxCount <= 144 && maxCount%2==0) \n\t\t{\n\t\t\tfor (int count : counters) \n\t\t\t{\n\t\t\t\tif (!(count % 2 == 0 || count % 4 == 0)) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean checkWords(String line) {\n\t\tint count = 0;\n\t\tScanner reader = new Scanner(line);\n\t\twhile (reader.hasNext()) {\n\t\t\tcount++;\n\t\t\treader.next();\n\t\t}\n\t\treader.close();\n\t\tif (count >= 4) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private boolean isDisplayable(int c) {\n return 20 <= c && c <= 126 && c != '\"';\n }", "@Test\n public void checkUniqueCharacter() {\n int numberOfChars = compressor.getCodes().size();\n assertTrue(numberOfChars == 86 || numberOfChars == 87, \"You appear to have some very strange end-of-line configuration on your machine!\");\n }", "@Override\n public long resultPart2() throws Exception {\n Scanner sc = inputScanner();\n\n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int a = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int b = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \")); // No +1 means first character is automatically '1'\n \n if(line.length() <= a) continue;\n if(line.charAt(a) == c) {\n if(line.length() <= b || line.charAt(b) != c) valid++;\n }\n else if(line.length() > b && line.charAt(b) == c) valid++;\n }\n\n return valid;\n }", "private boolean weAreTooBrokenToWaitUntilWeAreAbleToCarryThisOut() {\n return (isLineWrappingInvalid() || isShowing() == false);\n }", "boolean hasUnknown13();", "static boolean isWellFormed(String move) {\n if (move.length() != 4) {\n return false;\n } else {\n boolean mPieces = _PIECES.indexOf(move.substring(0, 1)) != -1;\n boolean mCol = _POSITIONS.indexOf(move.substring(1, 2)) != -1;\n boolean mRow = _POSITIONS.indexOf(move.substring(2, 3)) != -1;\n boolean mOrientations = _ORIENTATIONS.indexOf(move.substring(3, 4)) != -1;\n return mPieces && mCol && mRow && mOrientations;\n }\n }", "private boolean isLineInformationRepairNeeded(String text) {\n\t\t\tif (text == null)\n\t\t\t\treturn false;\n\n\t\t\tint length= text.length();\n\t\t\tif (length == 0)\n\t\t\t\treturn false;\n\n\t\t\tint rIndex= text.indexOf('\\r');\n\t\t\tint nIndex= text.indexOf('\\n');\n\t\t\tif (rIndex == -1 && nIndex == -1)\n\t\t\t\treturn false;\n\n\t\t\tif (rIndex > 0 && rIndex < length-1 && nIndex > 1 && rIndex < length-2)\n\t\t\t\treturn false;\n\n\t\t\tString defaultLD= null;\n\t\t\ttry {\n\t\t\t\tdefaultLD= getLineDelimiter(0);\n\t\t\t} catch (BadLocationException x) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (defaultLD == null)\n\t\t\t\treturn false;\n\n\t\t\tdefaultLD= getDefaultLineDelimiter();\n\n\t\t\tif (defaultLD.length() == 1) {\n\t\t\t\tif (rIndex != -1 && !\"\\r\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t\tif (nIndex != -1 && !\"\\n\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t} else if (defaultLD.length() == 2)\n\t\t\t\treturn rIndex == -1 || nIndex - rIndex != 1;\n\n\t\t\treturn false;\n\t\t}", "public void checkLines() {\n int cont2 = 0;\n int cont3, cont4;\n int casillasVacias;\n int vInicial, vFinal;\n\n for(cont3=20; cont3>0; cont3--) {\n vInicial = cont3*12 + 1;\n vFinal = vInicial + 10;\n casillasVacias = 10;\n\n //Bucle para todas las casillas de una fila\n for(cont4=vInicial; cont4<vFinal; cont4++) {\n if(colMatrix[cont4]) casillasVacias--;\n }\n\n if(casillasVacias == 0) {\n completeLines[cont2] = cont3;\n cont2++;\n }\n }\n removeLines();\n }", "private static boolean m4389a(String str) {\n return str != null && str.length() != 0 && Pattern.compile(\"^[0-9A-Fa-f]{13,18}+$\").matcher(str).matches() && str.indexOf(\"000000000\") == -1 && str.indexOf(\"111111111\") == -1 && str.indexOf(\"222222222\") == -1 && str.indexOf(\"333333333\") == -1 && str.indexOf(\"444444444\") == -1 && str.indexOf(\"555555555\") == -1 && str.indexOf(\"666666666\") == -1 && str.indexOf(\"777777777\") == -1 && str.indexOf(\"888888888\") == -1 && str.indexOf(\"999999999\") == -1;\n }", "private void validateLine1304(Errors errors) {\n }", "int getBrokenLines();", "@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 }", "public static boolean goodRuns(String sequence) {\n\t\tString run = sequence.charAt(0) + \"\";\n\t\tint longestRun = 0;\n\t\tfor (int i = 1; i < sequence.length(); i++) {\n\t\t\tif (run.contains(sequence.charAt(i) + \"\")) run += sequence.charAt(i);\n\t\t\telse {\n\t\t\t\tif (longestRun < run.length()) longestRun = run.length();\n\t\t\t\trun = sequence.charAt(i) + \"\";\n\t\t\t}\n\t\t}\n\t\treturn longestRun <= MAX_RUN;\n\t}", "private static boolean dataAppearsToBeText(byte[] bytes)\n {\n \tint nontext = 0;\n \tint text = 0;\n \t// only read the first 1000 bytes, if the data is long...\n \tfor (int i = 0; i < bytes.length && i < 1000; i++)\n \t{\n \t\tbyte b = bytes[i];\n \t\tif ((b < 8 || b > 13) && (b < 32 || b > 126))\n \t\t{\n \t\t\tnontext++;\n \t\t}\n \t\telse\n \t\t{\n \t\t\ttext++;\n \t\t}\n \t}\n \t// if more than 95% of the characters fall in the normal text range, we'll consider it text... \n \treturn (text / ((double) nontext + text) > 0.95);\n }", "@Override\n public long resultPart1() throws Exception {\n Scanner sc = inputScanner();\n \n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int min = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int max = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \") + 1);\n \n int count = 0;\n for(int i=0; i<line.length(); i++) {\n if(line.charAt(i) == c) count++;\n }\n\n if(count >= min && count <= max) valid++;\n }\n\n return valid;\n }", "public boolean formatCheck()\n\t{\n\t\t// The freeList has to be 2 or greater since the first block (index 0)\n\t\t// is the SuperBlock, and the the second block (index 1) contains\n\t\t// information about Inodes.\n\t\tif (totalBlocks != Kernel.NUM_BLOCKS || totalInodes <= 0 || \n\t\t\tfreeList < 2 || freeList >= totalBlocks && \n\t\t\tlastFreeBlock < 2 || lastFreeBlock >= totalBlocks)\n\t\t{\n\t\t\ttotalBlocks = Kernel.NUM_BLOCKS;\n\t\t\tlastFreeBlock = totalBlocks - 1;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private static boolean isTriangular(String line) {\n\t\t\n\t\tStringTokenizer tok = new StringTokenizer(line);\n\t\tint num = tok.countTokens();\n\t\tPreconditions.checkState(num >= 9);\n\t\t\n\t\tif (num < 11)\n\t\t\t// always rectangular\n\t\t\treturn false;\n\t\t// 11 column file can be rectangular with section info or triangular without\n\t\t// if rectangular, 11th column must be a non-numeric string. So if it can be parsed to a double,\n\t\t// then it's the slip column in a triangular file\n\t\tList<String> tokens = Lists.newArrayList();\n\t\twhile (tok.hasMoreTokens())\n\t\t\ttokens.add(tok.nextToken());\n\t\tString tok11 = tokens.get(10);\n\t\ttry {\n\t\t\tDouble.parseDouble(tok11);\n\t\t\t// can be parsed, must be slip rate\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\t// can't be parsed, must be section name\n\t\t\treturn false;\n\t\t}\n\t}", "private static boolean isAlefMaksouraChar(char ch) {\n return ( (ch == 0xFEEF) || ( ch == 0xFEF0) || (ch == 0x0649));\n }", "static boolean isValid (int n) {\n\t\t\tString temp = \"\" + n;\n\t\t\t\n\t\t\tfor(int i = 0; i < (n+\"\").length(); i++) {\n\t\t\t\n\t\t\t\tString c = \"\" + temp.charAt(i);\n\t\t\t\tif(!line.contains(c))\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private static boolean isTashkeelChar(char ch) {\n return ( ch >='\\u064B' && ch <= '\\u0652' );\n }", "boolean isSlimeChunk();", "boolean hasI13();", "private boolean handleWhisper(String line){\n if (line.indexOf(\"whispers: \") == -1)\n return false;\n \n Matcher matcher = WHISPER_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String ratingString = matcher.group(3);\n String gameNumberString = matcher.group(4);\n String message = matcher.group(5);\n\n int rating = (ratingString != null) && !ratingString.equals(\"----\") ? Integer.parseInt(ratingString) : -1;\n int gameNumber = Integer.parseInt(gameNumberString);\n\n if (!processWhisper(username, titles, rating, gameNumber, message))\n processLine(line);\n\n return true;\n }", "public boolean checkInvalid7(String x) {\n if (x.length() > 3) {\n for (int i = 0; i < x.length() - 2; i++) {\n if (consonants.contains(String.valueOf(x.charAt(i)))\n && (consonants.contains(String.valueOf(x.charAt(i + 1))))\n && consonants.contains(String.valueOf(x.charAt(i + 2)))\n && ((x.charAt(i) != 'n') || x.charAt(i + 1) !=\n 'g' || x.charAt(i + 2) != 'h')) {\n return true;\n }\n }\n }\n return false;\n }", "private static int isIsolatedTashkeelChar(char ch){\n if (ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75){\n return (1 - tashkeelMedial [ch - 0xFE70]);\n } else if(ch >= 0xfc5e && ch <= 0xfc63){\n return 1;\n } else{\n return 0;\n }\n }", "protected abstract boolean isMultiLine();", "private boolean checkFile(Object[] fileObject) {\n for (Object lineObject : fileObject) {\n if (lineObject.toString().split(\",\").length != 11 || lineObject.toString().contains(\"%\")) {\n System.out.println(\"Check File Error on line: \" + lineObject.toString());\n return false;\n }\n }\n return true;\n }", "public boolean isWordFullyGuessed()\n {\n for(int i=0; i<showChar.length; i++)\n {\n if(!showChar[i]) return false;\n }\n\n return true;\n }", "private static boolean m66068b(String str) {\n for (int i = 0; i < str.length(); i++) {\n char charAt = str.charAt(i);\n if (charAt <= 31 || charAt >= 127 || \" #%/:?@[\\\\]\".indexOf(charAt) != -1) {\n return true;\n }\n }\n return false;\n }", "private static boolean isLamAlefChar(char ch) {\n return ch >= '\\uFEF5' && ch <= '\\uFEFC';\n }", "boolean hasIndispensableYn();", "boolean hasIndispensableYn();", "private static boolean isMalformed3(int b1, int b2, int b3) {\n return (b1 == (byte) 0xe0 && (b2 & 0xe0) == 0x80) || (b2 & 0xc0) != 0x80 || (b3 & 0xc0) != 0x80;\n }", "private boolean validMessage(String message){\r\n //35 lines of text seems to be the max\r\n //TODO check if its a character limit and not a newline limit in iteration 4\r\n int newLines = 0;\r\n for(int i = 1; i < message.length(); i++)\r\n if(message.substring(i-1, i).equals(\".\")){\r\n newLines++;\r\n }\r\n return newLines <= this.lineBound;\r\n }", "private static boolean validate(String line){\n\t\tString[] lineArray = line.split(\" \");\n\t\t\n\t\tif(lineArray.length != 3) return false; //skip lines in incorrect format\n\t\t\n\t\t//http://stackoverflow.com/questions/25873636/regex-pattern-for-exactly-hhmmss-time-string\n\t\tif(!lineArray[0].matches(\"(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)\")) return false;\n\n\t\tif(!lineArray[2].equals(\"Start\") && !lineArray[2].equals(\"End\")) return false;\n\t\t\n\t\treturn true;\n\t}", "public String toStringDeleteriousBedLine(boolean collapse){\n\t\t//scan for deleterious mutations\n\t\tArrayList<Integer> bad = new ArrayList<Integer>();\n\t\tfor (int i=0; i< effects.length; i++){\n\t\t\tif (effects[i].contains(\"Non-synonymous\") || effects[i].contains(\"splice\")){\n\t\t\t\tif (collapse){\n\t\t\t\t\tString test = geneModel.getChrom()+\"_\"+ alleles[i].getStart()+ \"_\"+ alleles[i].getStop() +new String (numberWhiteSpace.matcher(effects[i]).replaceAll(\"\"));\n\t\t\t\t\tif (printedTranscripts.contains(test) == false) {\n\t\t\t\t\t\tbad.add(new Integer(i));\n\t\t\t\t\t\tprintedTranscripts.add(test);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse bad.add(new Integer(i));\n\t\t\t}\n\t\t}\n\t\tif (bad.size()==0) return null;\n\t\t//get chrom\n\t\tString chrom = geneModel.getChrom()+\"\\t\";\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tint[] badAlleles = Num.arrayListOfIntegerToInts(bad);\n\t\tfor (int i=0; i< badAlleles.length; i++){\n\t\t\t\n\t\t\t//add chrom\n\t\t\tsb.append(chrom);\n\t\t\t//watch out for INDELS\n\t\t\tint start = alleles[badAlleles[i]].getStart();\n\t\t\tint stop = alleles[badAlleles[i]].getStop();\n\t\t\tif (start == stop){\n\t\t\t\tstart--;\n\t\t\t\tstop++;\n\t\t\t}\n\t\t\tsb.append(start);\n\t\t\tsb.append(\"\\t\");\n\t\t\tsb.append(stop);\n\t\t\tsb.append(\"\\t\");\n\t\t\tString simple = geneModel.getNames(\"_\") +\"_|_\"+ alleles[badAlleles[i]].getNotes()+\"_|_\"+effects[badAlleles[i]];\n\t\t\tsimple = simple.trim();\n\t\t\tsimple = whiteSpace.matcher(simple).replaceAll(\"_\");\n\t\t\tsb.append(simple);\t\t\t\n\t\t\tsb.append(\"\\t1000\\t\");\n\t\t\tsb.append(geneModel.getStrand());\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 0, 0, 1847);\n javaCharStream0.adjustBeginLineColumn((-2819), 2281);\n int int0 = javaCharStream0.getBeginLine();\n assertEquals((-2818), int0);\n }", "private boolean setUpForRunScore()\n\t{\n\t\tint maxMarkersLine=0;\n\t\tint maxMarkers=-1;\n\t\tString maxMarkersString=\"\";\n\t\tchar marker='=';\n\t\tint j=0;\n\t\t\t\t\n\t\t// loop through all lines\n\t\tfor (String s:text)\n\t\t{\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\t\n\t\t\t// count the number of markers\n\t\t\tfor( int i=0; i<s.length(); i++ ) \n\t\t\t{\n\t\t\t if( s.charAt(i) == marker ) \n\t\t\t {\n\t\t\t counter++;\n\t\t\t } \n\t\t\t}\n\t\t\t\t\t\n\t\t\tSystem.out.println(counter);\n\t\t\t\t\t\n\t\t\tif (counter>maxMarkers)\n\t\t\t{\n\t\t\t\tmaxMarkers=counter;\n\t\t\t\tmaxMarkersLine=j;\n\t\t\t\tmaxMarkersString=s;\n\t\t\t}\n\t\t\t\n\t\t\tj++;\n\t\t}\n\t\t\n\t\tif (maxMarkers>15)\n\t\t{\n\t\t\t// make sure the maxMarkersString can be split\n\t\t\tString[] split=maxMarkersString.split(\"\\\\s+\");\n\t\t\t\n\t\t\tif (split.length==1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\t// the header names will be just above the \"maxMarkersLine\"\n\t\t\tString headerLine=text.get(maxMarkersLine-1);\n\t\t\t\n\t\t\tresultParser=new RunScoreResultParser();\n\t\t\tRunScoreResultParser rsParser=(RunScoreResultParser)(this.resultParser);\n\t\t\t\n\t\t\trsParser.parseHeader(maxMarkersString, headerLine);\n\t\t\t\n\t\t\toverallExtractor=new RunScoreOverallExtractor(maxMarkersLine);\n\t\t \n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean isStrobogrammatic(String num) {\n char input[] = num.toCharArray();\n int p1 = 0, p2 = num.length() - 1;//pointers\n while(p1 <= p2) {\n if(input[p1] == '6') {\n if(input[p2] != '9') return false;\n } else if (input[p1] == '9') {\n if(input[p2] != '6') return false;\n } else if (input[p1] == '1' || input[p1] == '8'||input[p1] == '0') {\n if (input[p2] != input[p1]) return false;\n } else {\n return false;\n }\n p1++;\n p2--;\n }\n return true;\n }", "private static boolean m52090E(C32065l c32065l) {\n AppMethodBeat.m2504i(95712);\n switch ((char) c32065l.data[c32065l.position]) {\n case 9:\n case 10:\n case 12:\n case 13:\n case ' ':\n c32065l.mo52369eM(1);\n AppMethodBeat.m2505o(95712);\n return true;\n default:\n AppMethodBeat.m2505o(95712);\n return false;\n }\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 }", "void format13(String line, int lineCount) {\n\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\n\n // there can only be one code 13 record per substation\n code13Count++;\n if (code13Count > 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"More than 1 code 13 record in substation\");\n } // if (code13Count > 1)\n\n // get the data off the line\n java.util.StringTokenizer t = new java.util.StringTokenizer(line, \" \");\n String dummy = t.nextToken(); // get 'rid' of the code\n\n if (dataType == SEDIMENT) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 sedphy\n //03 i5 aluminium µgm / gram sedpol2\n //04 f8.3 antimony µgm / gram sedpol2\n //05 f4.1 bismuth µgm / gram sedpol2\n //06 f4.1 molybdenum µgm / gram sedpol2\n //07 f8.3 silver µgm / gram sedpol2\n //08 i4 titanium µgm / gram sedpol2\n //09 f5.2 vanadium µgm / gram sedpol2\n\n if (t.hasMoreTokens()) sedphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, sedphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: sedpol2 = \" + sedpol2);\n\n } else if (dataType == WATER) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 watphy\n //03 i5 aluminium µgm / litre watpol2\n //04 f8.3 antimony µgm / litre watpol2\n //05 f4.1 bismuth µgm / litre watpol2\n //06 f4.1 molybdenum µgm / litre watpol2\n //07 f8.3 silver µgm / litre watpol2\n //08 i4 titanium µgm / litre watpol2\n //08 f5.2 vanadium µgm / litre watpol2\n\n if (t.hasMoreTokens()) watphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, watphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: watpol2 = \" + watpol2);\n\n } // if (dataType == SEDIMENT)\n\n }", "private boolean checkDesignCMT() {\n // check null\n if (jTFChungMinhThu.getText().trim().isEmpty()) {\n JOptionPane.showMessageDialog(rootPane, \"Nhập CMT và nhấn Enter để tìm kiếm\\nHoặc nhấn nút \\\"SHOW INFO\\\" để chọn nhân khẩu.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // check dinh dang so chung minh thu\n try {\n long d = Long.parseLong(jTFChungMinhThu.getText());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT không thể chứa các ký tự chữ cái\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // kiem tra do dai cmt\n if (jTFChungMinhThu.getText().length() != 9 && jTFChungMinhThu.getText().length() != 12) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT có 9 hoặc 12 số\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n return true;\n }", "public boolean isMultiLine() {\n/* 1236 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public abstract boolean passes(String line);", "@Test(timeout=100)\r\n\tpublic void testLongLines() {\r\n\t\tString message = \"Write-readable-software\";\r\n\t\tint length = message.length();\r\n\t\tRandom rand = new Random();\r\n\t\tint count = 100;\r\n\t\tString [] r1 = new String[count];\r\n\t\tfor(int k=0; k<count; k++) r1[k] = message.substring(rand.nextInt(length)+1);\r\n\t\tcount = 200;\r\n\t\tString [] r2 = new String[count];\r\n\t\tmessage = \"abcdefghij\";\r\n\t\tr2[0] = Character.toString(message.charAt(0));\r\n\t\tfor(int k=1; k<count; k++) r2[k] = r2[k-1]+message.charAt(k%10);\r\n\t\twriteArrayToLine(r1);\r\n\t\twriteArrayToLine(r2);\r\n\t\tout.close();\r\n\t\t\r\n\t\tCSVReader csv = new CSVReader(getInstream());\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tString [] next = csv.next();\r\n\t\tassertEquals( r1.length, next.length );\r\n\t\tassertArrayEquals( r1, next );\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tassertArrayEquals( r2, csv.next() );\r\n\r\n\t\tassertFalse( csv.hasNext() );\r\n\t}", "public boolean checkInvalid4(String x) {\n int temp = x.length();\n for (int i = 0; i < x.length(); i++) {\n if (consonants.contains(String.valueOf(x.charAt(i))))\n temp--;\n }\n return temp > 3;\n }", "@Override\n public String checkRule() {\n if (line.matches(\"^\\\\D+$\")) {\n return (\"Complies rule 'Has no numbers' \\n\");\n } else {\n return \"\";\n }\n }", "private boolean valid(InputStream instream)\r\n\t\t\tthrows BaseException\r\n\t{\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(instream));\r\n\t\tString line = new String();\r\n\t\tboolean newspectrum = false;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\tif ((Pattern.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\",\r\n\t\t\t\t\tline)))\r\n\t\t\t\t{\r\n\t\t\t\t\tnewspectrum = false;\r\n\t\t\t\t\twhile (!newspectrum)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ((line = in.readLine()) != null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (line.length() > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t\t\t\tif (!Pattern.matches(\r\n\t\t\t\t\t\t\t\t\t\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\", line))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// If m/z has 9 or more digits(+1 decimal sign),\r\n\t\t\t\t\t\t\t\t// annotate as\r\n\t\t\t\t\t\t\t\t// double precision\r\n\t\t\t\t\t\t\t\telse if (!mz_double_precision && Pattern\r\n\t\t\t\t\t\t\t\t\t.matches(\"^[\\\\d\\\\.]{10,}[ \\\\t]\\\\d+\\\\.?\\\\d*\",\r\n\t\t\t\t\t\t\t\t\t\tline))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tmz_double_precision = true;\r\n\t\t\t\t\t\t\t\t\tlog.info(\"Double precision = true\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tnewspectrum = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tnewspectrum = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.length() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tthrow new BaseException(e);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean qualityIsHigh()\n\t{\n\t\tint counter = 0;\n\t\tfor(int i = 0; i < quality.length(); i++) {\n\t\t\tif(quality.charAt(i) == '!') {\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\treturn counter >= 3;\n\t}", "@Test\n public void shouldReturnValidBoardLayouts()\n {\n String[] layout = DatabaseHelper.getBoardLayout();\n int expectedRs = (layout[0].equals(\"R\")) ? 9 : 8;\n int expectedBs = (layout[0].equals(\"B\")) ? 9 : 8;\n int expectedCs = 7;\n int expectedA = 1;\n boolean validLayout = true;\n\n // Functional method to count instances of char in string take from: https://stackoverflow.com/a/23906674/1585599\n\n if(layout[1].chars().filter(num -> num == 'R').count() != expectedRs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Rs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'B').count() != expectedBs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Bs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'C').count() != expectedCs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Cs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'A').count() != expectedA)\n {\n validLayout = false;\n System.out.println(\"Wrong number of A.\");\n }\n\n assertTrue(validLayout);\n }", "public boolean checkLine(String line) {\n int len = line.length();\n return !(len > 0 && Character.isWhitespace(line.charAt(len-1)));\n }", "public boolean morethanthreeletter(String sCheck) {\n\t\tint total=sCheck.length();\n\t\tint x=0;\n\t\tint begin=0;\n\t\tint end=0;\n\t\tchar ch;\n\t\tString sResult=\"\";\n\t\tint chcount=1;\n\t\twhile(x < total){\n\t\t\tch=sCheck.charAt(x);\n\t\t\tif(ch != ' ' && ch != '.' && ch != ','){\n\t\t\t\tif(x==total-1){\n\t\t\t\t\tend=x;\n\t\t\t\t\tif((end-begin+1) > 3){\n\t\t\t\t\t\tsResult=sCheck.substring(begin,end+1);\n\t\t\t\t\t\tSystem.out.println(sResult);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\tx++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(x==total-1){\n\t\t\t\t\tend=x-1;\n\t\t\t\t\tif((end-begin+1) > 3){\n\t\t\t\t\t\tsResult=sCheck.substring(begin,end+1);\n\t\t\t\t\t\tSystem.out.println(sResult);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\tif(sCheck.charAt(x+1)==' ' || sCheck.charAt(x+1)=='.'\n\t\t\t\t\t\t\t||sCheck.charAt(x+1)==','){\n\t\t\t\t\t\tchcount++;\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tend=x-chcount;\n\t\t\t\t\t\tchcount=1;\n\t\t\t\t\t\tif((end-begin+1) > 3){\n\t\t\t\t\t\t\tsResult=sCheck.substring(begin,end+1);\n\t\t\t\t\t\t\tSystem.out.println(sResult);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbegin=x;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean testTilingpattern(EIfcfillareastyletiles type) throws SdaiException;", "public static boolean goodGC(String sequence) {\n\t\tdouble gcCount = 0;\n\t\tfor (int i = 0; i < sequence.length(); i++)\n\t\t\tif (sequence.charAt(i) == 'g' || sequence.charAt(i) == 'c') gcCount++;\n\t\treturn (gcCount / sequence.length()) >= MIN_GC_FRACTION && (gcCount / sequence.length()) <= MAX_GC_FRACTION;\n\t}", "@EpiTest(testDataFile = \"pretty_printing.tsv\")\n\n public static int minimumMessiness(List<String> words, int lineLength) {\n words = List.of(\"a\", \"b\", \"c\", \"d\");\n lineLength = 5;\n //expected 8\n int minimumMessiness[] = new int[words.size()];\n Arrays.fill(minimumMessiness, Integer.MAX_VALUE);\n\n int numRemainingBlanks = words.get(0).length() - lineLength;\n minimumMessiness[0] = numRemainingBlanks * numRemainingBlanks; //placing word 0 to i+1 word\n\n for (int i = 1; i < words.size(); i++) {\n numRemainingBlanks = lineLength - words.get(i).length();\n minimumMessiness[i] = minimumMessiness[i - 1] + numRemainingBlanks * numRemainingBlanks;\n\n for (int j = i - 1; j >= 0; j--) {\n numRemainingBlanks = numRemainingBlanks - words.get(j).length() - 1;\n if (numRemainingBlanks < 0) {\n break;\n }\n int firstJMessiness = j - 1 < 0 ? 0 : minimumMessiness[j - 1]; //doubt\n int currentLineMessiness = numRemainingBlanks * numRemainingBlanks;\n minimumMessiness[i] = Math.min(minimumMessiness[i], firstJMessiness + currentLineMessiness);\n }\n\n\n }\n return minimumMessiness[words.size() - 1];\n }", "abstract protected boolean isSkippableLine(String line);", "public boolean isPlainText(File src, int k_p) throws IOException {\n\t\tboolean isPlainText = true;\r\n\t\tMap<String, Integer> bifreq = Frequencies.getBigramQuantities(src, Main.alphabet, true); //src\r\n\t\tlong prohibitedBigramClasses = bifreq.entrySet().stream()\r\n\t\t\t.filter(x -> x.getValue() != 0)\r\n\t\t\t.filter(x -> A_prh.contains(x.getKey()))\r\n\t\t\t.count();\r\n\t\tif(prohibitedBigramClasses < 3) {\r\n\t\t\tbifreq.entrySet().stream()\r\n\t\t\t.filter(x -> x.getValue() != 0)\r\n\t\t\t.filter(x -> A_prh.contains(x.getKey()))\r\n\t\t\t.forEach(System.out::println);\r\n\t\t}\r\n\t\tSystem.out.println(\"prohibitedBigramClasses: \" + prohibitedBigramClasses);\r\n\t\tif(prohibitedBigramClasses >= k_p) {\r\n\t\t\tisPlainText = false;\r\n\t\t}\r\n\t\treturn isPlainText;\r\n\t}", "private boolean verifySequence(String seq) {\n for (int i = 0; i < seq.length(); i++) {\n if (seq.charAt(i) != 'A' && seq.charAt(i) != 'T'\n && seq.charAt(i) != 'C' && seq.charAt(i) != 'G') {\n return false;\n }\n }\n return true;\n }", "private void bufferCheck() {\r\n bufferScreen.setText(stringBuffer);\r\n bufferLength++;\r\n if (bufferLength == 4) {\r\n if (isCorrectWord()) {\r\n SCORE++;\r\n bufferScreen.setTextColor(Color.GREEN);\r\n } else bufferScreen.setTextColor(Color.RED);\r\n newWord();\r\n }\r\n }", "@Test\n public void issue4712() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4712.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 2, warnings.size());\n Iterator<FileAnnotation> iterator = warnings.iterator();\n checkWarning(iterator.next(),\n 352,\n \"&apos;s2.mepSector2::lubrications&apos; may be used\",\n \"main/mep.cpp\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n checkWarning(iterator.next(),\n 1477,\n \"&apos;s2.mepSector2::lubrications&apos; was declared here\",\n \"main/mep.cpp\",\n TYPE, \"GCC note\", Priority.LOW);\n }", "public static boolean isTieGame2(char mark) {\n\t\treturn (spacesLeft == 2 && board[1][0] == ' ' && board[1][1] == ' ' // done\n\t\t\t\t&& board[0][0] == 'X' && board[0][2] == 'X' && board[2][1] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[1][0] == ' ' && board[1][1] == ' ' // done\n\t\t\t\t\t\t&& board[2][0] == 'X' && board[0][1] == 'X' && board[2][2] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[1][1] == ' ' && board[1][2] == ' ' // done\n\t\t\t\t\t\t&& board[0][0] == 'X' && board[0][2] == 'X' && board[2][1] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[1][1] == ' ' && board[1][2] == ' ' // done\n\t\t\t\t\t\t&& board[2][0] == 'X' && board[0][1] == 'X' && board[2][2] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[0][1] == ' ' && board[1][1] == ' ' // done\n\t\t\t\t\t\t&& board[0][0] == 'X' && board[2][0] == 'X' && board[1][2] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[0][1] == ' ' && board[1][1] == ' ' // done\n\t\t\t\t\t\t&& board[0][2] == 'X' && board[1][0] == 'X' && board[2][2] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[1][1] == ' ' && board[2][1] == ' ' // done\n\t\t\t\t\t\t&& board[0][0] == 'X' && board[2][0] == 'X' && board[1][2] == 'X')\n\t\t\t\t|| (spacesLeft == 2 && board[1][1] == ' ' && board[2][1] == ' '\n\t\t\t\t\t\t&& board[0][2] == 'X' && board[1][0] == 'X' && board[2][2] == 'X');\n\t}", "public static String checkWinner(String[][] f)\n {\n //look for the first type of winning line, a horizontal line\n\n for (int i = 0; i < 6; i++)\n {\n\n for (int j = 0; j < 7; j += 2)\n {\n\n if ((f[i][j+1] != \" \")\n\n && (f[i][j+3] != \" \")\n \n && (f[i][j+5] != \" \")\n\n && (f[i][j+7] != \" \")\n\n && ((f[i][j+1] == f[i][j+3])\n\n && (f[i][j+3] == f[i][j+5])\n\n && (f[i][j+5] == f[i][j+7])))\n\n //If we found a same-colored pattern, we'll return the color so that we will know who won.\n\n return f[i][j+1]; \n }\n\n }\n\n //Now, let's first loop over each odd-numbered column by incrementing with 2\n\n //and check for consecutive boxes in the same column that are the same color\n\n for (int i=1;i<15;i+=2)\n {\n\n for (int j =0;j<3;j++)\n {\n\n if((f[j][i] != \" \")\n\n && (f[j+1][i] != \" \")\n\n && (f[j+2][i] != \" \")\n\n && (f[j+3][i] != \" \")\n\n && ((f[j][i] == f[j+1][i])\n\n && (f[j+1][i] == f[j+2][i])\n\n && (f[j+2][i] == f[j+3][i])))\n\n return f[j][i]; \n } \n\n }\n\n //For the left-up to right-down diagonal line\n\n //We'll have to loop over the 3 uppermost\n\n //rows and then go from left to right column-wise\n\n for (int i = 0; i < 3; i++)\n {\n\n for (int j = 1; j < 9; j += 2)\n\n {\n\n if((f[i][j] != \" \")\n\n && (f[i+1][j+2] != \" \")\n\n && (f[i+2][j+4] != \" \")\n\n && (f[i+3][j+6] != \" \")\n\n && ((f[i][j] == f[i+1][j+2])\n\n && (f[i+1][j+2] == f[i+2][j+4])\n\n && (f[i+2][j+4] == f[i+3][j+6])))\n\n return f[i][j]; \n } \n\n }\n\n //Similar to the method above, but we're just reversing\n\n for (int i = 0; i < 3; i++)\n\n {\n for (int j = 7; j < 15; j += 2)\n\n {\n\n if((f[i][j] != \" \")\n\n && (f[i+1][j-2] != \" \")\n\n && (f[i+2][j-4] != \" \")\n \n && (f[i+3][j-6] != \" \")\n\n && ((f[i][j] == f[i+1][j-2])\n\n && (f[i+1][j-2] == f[i+2][j-4])\n\n && (f[i+2][j-4] == f[i+3][j-6])))\n\n return f[i][j]; \n } \n\n }\n\n //If after going over the table and we didn't find a winning color\n\n return null;\n }", "public static void incorrect3() {\r\n\r\n System.out.println(\" *---*\");\r\n System.out.println(\" | |\");\r\n System.out.println(\" 0 |\");\r\n System.out.println(\" /| | Incorrect - 3\");\r\n System.out.println(\" |\");\r\n System.out.println(\" |\");\r\n System.out.println(\"==========\");\r\n }", "private static boolean m52091F(C32065l c32065l) {\n AppMethodBeat.m2504i(95713);\n int i = c32065l.position;\n int i2 = c32065l.limit;\n byte[] bArr = c32065l.data;\n if (i + 2 <= i2) {\n int i3 = i + 1;\n if (bArr[i] == (byte) 47) {\n int i4 = i3 + 1;\n if (bArr[i3] == (byte) 42) {\n while (i4 + 1 < i2) {\n i = i4 + 1;\n if (((char) bArr[i4]) == '*' && ((char) bArr[i]) == IOUtils.DIR_SEPARATOR_UNIX) {\n i++;\n i2 = i;\n i4 = i;\n } else {\n i4 = i;\n }\n }\n c32065l.mo52369eM(i2 - c32065l.position);\n AppMethodBeat.m2505o(95713);\n return true;\n }\n }\n }\n AppMethodBeat.m2505o(95713);\n return false;\n }", "private boolean ignoreCardvalidations(ATMSparrowMessage atmSparrowMessage) {\n boolean isLoro = false;\n String message = atmSparrowMessage.getMessageType() + atmSparrowMessage.getTransactionType();\n if (message.equals(\"599\") || message.equals(\"099\") || message.equals(\"899\") || message.equals(\"625\")\n || message.equals(\"626\") || message.equals(\"725\") || message.equals(\"726\")) {\n isLoro = true;\n }\n return isLoro;\n }", "@Test\n public void issue9926() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue9926.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());\n FileAnnotation annotation = warnings.iterator().next();\n checkWarning(annotation, 52, \"large integer implicitly truncated to unsigned type\",\n \"src/test_simple_sgs_message.cxx\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n }", "private boolean isChoseFine(){\n if(freeSpaces.size()!=2 & freeSpaces.size()!=3){ //if the number of chosen spaces is not 3 or 2, that means it can't be good.\n return false;\n }\n else if(freeSpaces.size()==2){ //if there are 2.\n if(freeSpaces.elementAt(0).place.distance(freeSpaces.elementAt(1).place)==1)\n return true;\n else //if the distance between the spaces isn't 1, that means it can't be two suite spaces.\n return false;\n }\n else{ //if there are 3.\n //get the all 3 elements.\n int aX = freeSpaces.elementAt(0).place.x;\n int aY = freeSpaces.elementAt(0).place.y;\n int bX = freeSpaces.elementAt(1).place.x;\n int bY = freeSpaces.elementAt(1).place.y;\n int cX = freeSpaces.elementAt(2).place.x;\n int cY = freeSpaces.elementAt(2).place.y;\n if(aX==bX && bX==cX){ //if they are in the same column.\n int min = Math.min(aY, Math.min(bY, cY));\n int max = Math.max(aY, Math.max(bY, cY));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else if(aY==bY && bY==cY){ //if they are in the same row.\n int min = Math.min(aX, Math.min(bX, cX));\n int max = Math.max(aX, Math.max(bX, cX));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else //if they are in different rows and columns, so it isn't good.\n return false;\n }\n }", "private String showText() {\n\t\tString text = \"\";\n\t\ttry {\n\t\t\tString line1 = \"\";\n\t\t\tString line2 = \"\";\n\t\t\tString line3 = \"\";\n\t\t\tfor (LakeTile lake_tile : removed_laketile) {\n\t\t\t\tint i = removed_laketile.indexOf(lake_tile);\n\t\t\t\tPosition pos = removed_position.get(i);\n\t\t\t\tQueue<Color> color_queue = lake_tile.getColorOfFourSides();\n\t\t\t\tArrayList<Color> color_list = new ArrayList<Color>(color_queue);\n\n\t\t\t\tline1 += String.format(\"%12s\", \"\");\n\t\t\t\tline1 += Color.getColorText(color_list.get(0), \" \");\n\n\t\t\t\tline1 += String.format(\"%4s\", \"\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tline2 += String.format(\"%2s\", lake_tile.getIndex());\n\t\t\t\tline2 += \":\";\n\t\t\t\tline2 += String.format(\"%-7s\",\"(\" + pos.getX() + \",\" + pos.getY() + \")\");\n\t\t\t\tline2 += Color.getColorText(color_list.get(3), \" \");\n\t\t\t\tline2 += \" \";\n\t\t\t\tif (lake_tile.isPlatform()) {\n\t\t\t\t\tline2 += \"O\";\n\t\t\t\t} else {\n\t\t\t\t\tline2 += \"X\";\n\t\t\t\t}\n\t\t\t\tline2 += \" \" + Color.getColorText(color_list.get(1), \" \") + \" \";\n\n\t\t\t\tline3 += String.format(\"%12s\", \"\");\n\t\t\t\tline3 += Color.getColorText(color_list.get(2), \" \");\n\t\t\t\tline3 += String.format(\"%4s\", \"\");\n\n\t\t\t}\n\t\t\ttext += line1 + \"\\n\";\n\t\t\ttext += line2 + \"\\n\";\n\t\t\ttext += line3 + \"\\n\";\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\ttext = \"No Data\";\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\n\t}", "public void validateRpd3s13()\n {\n for (Node br : getElements(ELEM_BR)) {\n Node previousNode = null;\n String regex = \"^\\\\s*(\\\\*|-|[0-9]\\\\.).*\";\n\n for (Node currentNode : new NodeListIterable(br.getParentNode().getChildNodes())) {\n Node nextNode = currentNode.getNextSibling();\n\n if (previousNode != null && nextNode != null) {\n boolean currentNodeMatches = currentNode.getNodeName().equals(ELEM_BR);\n boolean previousNodeMatches =\n previousNode.getNodeType() == Node.TEXT_NODE && previousNode.getTextContent().matches(regex);\n boolean nextNodeMatches =\n nextNode.getNodeType() == Node.TEXT_NODE && nextNode.getTextContent().matches(regex);\n\n assertFalse(Type.ERROR, \"rpd3s13.lists\", previousNodeMatches && currentNodeMatches\n && nextNodeMatches);\n }\n\n previousNode = currentNode;\n }\n }\n }", "private void checkPaintMeasures() {\r\n\t\t\r\n\t\t//Check from change\r\n\t\tint sizeNow = fontSize;\r\n\t\tif(sizeNow == sizeThen)return;\r\n\t\tsizeThen = sizeNow;\r\n\t\t\r\n\t\t//Set units\r\n\t\tmarkWidth = (double) sizeNow / 15;\r\n\t\tsizePaintLength = p.textLength(text, surface, sizeNow, bold, italic);\r\n\t\tif (viewPaintLength != viewPaintLength) viewPaintLength = sizePaintLength;\r\n\t}", "public boolean isDifficult()\n {\n int count = 0;\n for (int i = 1; i < markers.length; i++) {\n if (Math.abs(markers[i] - markers[i-1]) >= 30){\n count++;\n }\n }\n return (count >= 3);\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 91, 91);\n javaCharStream0.BeginToken();\n javaCharStream0.adjustBeginLineColumn((-366), 1);\n int int0 = javaCharStream0.getLine();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals((-366), int0);\n }", "private boolean checkLine(int line) {\n\t\tfor(int col = 0; col < COL_COUNT; col++) {\n\t\t\tif(!isOccupied(col, line)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//remove the line if it is filled.\n\t\tfor(int row = line - 1; row >= 0; row--) {\n\t\t\tfor(int col = 0; col < COL_COUNT; col++) {\n\t\t\t\tsetTile(col, row + 1, getTile(col, row));\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean handleStyle12(String line){\n if (!line.startsWith(\"<12> \"))\n return false;\n\n Style12Struct data = Style12Struct.parseStyle12Line(line);\n\n if (!processStyle12(data))\n processLine(line);\n\n return true;\n }", "private boolean handleKibitz(String line){\n if (line.indexOf(\"kibitzes: \") == -1)\n return false;\n \n Matcher matcher = KIBITZ_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String ratingString = matcher.group(3);\n String gameNumberString = matcher.group(4);\n String message = matcher.group(5);\n\n int rating = (ratingString != null) && !ratingString.equals(\"----\") ?\n Integer.parseInt(ratingString) : -1;\n int gameNumber = Integer.parseInt(gameNumberString);\n\n if (!processKibitz(username, titles, rating, gameNumber, message))\n processLine(line);\n\n return true;\n }", "private boolean checkLines(){\n\n for (int[] line : TwoPlayersActivity.lines) {\n\n if (field.get(line[0]).equals(field.get(line[1])) &&\n field.get(line[0]).equals(field.get(line[2])) &&\n !field.get(line[0]).getValue().equals(Cell.Value.NONE)){\n for (int index: line) {\n imageList.get(index).setBackgroundColor(Color\n .parseColor(TwoPlayersActivity.CELL_WIN_COLOR));\n }\n return true;\n }\n }\n return false;\n }", "private int getShulkerBoxExcess(String line) {\n line = line.replaceAll(\"[^0-9]\",\"\");\n if (line.isEmpty()) {\n line = \"0\";\n }\n return Integer.valueOf(line);\n }", "private boolean doesSquareHaveLessThan2SidesMarked(Line line, Square[][] board) {\n Set<Square> attachedSquaresSet = getSquares(board, line);\n Iterator<Square> squareIterator = attachedSquaresSet.iterator();\n while (squareIterator.hasNext()) {\n if (squareIterator.next().openLines().size() <= 2)\n return false;\n }\n return true;\n }", "private static int isTashkeelOnTatweelChar(char ch){\n if (ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75 && ch != SHADDA_TATWEEL_CHAR)\n {\n return tashkeelMedial [ch - 0xFE70];\n } else if( (ch >= 0xfcf2 && ch <= 0xfcf4) || (ch == SHADDA_TATWEEL_CHAR)) {\n return 2;\n } else {\n return 0;\n }\n }", "public static boolean goodRepeats(String sequence) {\n\t\tString repeat = sequence.substring(0, 2);\n\t\tint longestRepeat = 0;\n\t\tfor (int i = 2; i + 1 < sequence.length(); i+=2) {\n\t\t\tif (repeat.startsWith(sequence.substring(i, i + 2))) repeat += sequence.substring(i, i + 2);\n\t\t\telse {\n\t\t\t\tif (repeat.length() / 2 > longestRepeat) longestRepeat = repeat.length() / 2;\n\t\t\t\trepeat = sequence.substring(i, i + 2);\n\t\t\t}\n\t\t}\n\t\trepeat = sequence.substring(1, 3);\n\t\tfor (int i = 1; i + 1 < sequence.length(); i+=2) {\n\t\t\tif (repeat.startsWith(sequence.substring(i, i + 2))) repeat += sequence.substring(i, i + 2);\n\t\t\telse {\n\t\t\t\tif (repeat.length() / 2 > longestRepeat) longestRepeat = repeat.length() / 2;\n\t\t\t\trepeat = sequence.substring(i, i + 2);\n\t\t\t}\n\t\t}\n\t\treturn longestRepeat <= MAX_REPEATS;\n\t}", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Q|ni.,qQXS\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 10, 10, 754);\n javaCharStream0.adjustBeginLineColumn(754, 59);\n int int0 = javaCharStream0.getBeginLine();\n assertEquals(59, javaCharStream0.getBeginColumn());\n assertEquals(755, int0);\n }", "public static boolean isValidBedGraphLine(String line){\n\t\tString[] bdg= line.split(\"\\t\");\n\t\tif(bdg.length < 4){\n\t\t\treturn false;\n\t\t}\n\t\ttry{\n\t\t\tInteger.parseInt(bdg[1]);\n\t\t\tInteger.parseInt(bdg[2]);\n\t\t} catch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static void testBadChars() throws IOException {\n\t// say what output is expected\n\tSystem.err.println(\"\\nTEST BAD CHARS: BAD CHARS ON LINES 1-5\");\n\n\t// open input file\n\tFileReader inFile = null;\n\ttry {\n\t inFile = new FileReader(\"inBadChars\");\n\t} catch (FileNotFoundException ex) {\n\t System.err.println(\"File inBadChars not found.\");\n\t System.exit(-1);\n\t}\n\n\t// create and call the scanner\n\tYylex scanner = new Yylex(inFile);\n\tSymbol token = scanner.next_token();\n\tif (token.sym != sym.EOF) {\n\t System.err.println(\"ERROR TESTING BAD CHARS: not at EOF\");\n\t}\n }", "public static boolean safePrimer(String primer) throws ClientProtocolException, IOException {\n\t\tString primerMatch = PhagesDB.locallyBLAST(primer);\n\t\tScanner primerFinder = new Scanner(primerMatch);\n\t\tprimerFinder.useDelimiter(\"\\n\");\n\t\tdo {\n\t\t\tString nextLine = primerFinder.next();\n\t\t\tif (nextLine.startsWith(\">\") && nextLine.contains(\"Mycobacterium\")) {\n\t\t\t\tboolean blackListed = false;\n\t\t\t\tfor (String phage : OUT_BLACK_LIST)\n\t\t\t\t\tblackListed = blackListed || nextLine.contains(phage);\n\t\t\t\tnextLine = primerFinder.next();\n\t\t\t\tif (nextLine.indexOf(\"Cluster\") > 0 && !blackListed) {\n\t\t\t\t\tString cluster;\n\t\t\t\t\tif (nextLine.endsWith(\"Cluster\")) \n\t\t\t\t\t\tcluster = primerFinder.next().replace(\" \", \"\");\n\t\t\t\t\telse \n\t\t\t\t\t\tcluster = nextLine.substring(nextLine.indexOf(\"Cluster\") + 8);\n\t\t\t\t\tif (!cluster.equals(CLUSTER) && ((CLUSTER.startsWith(cluster) && !cluster.matches(\".*\\\\d+.*\")) || (cluster.startsWith(CLUSTER) && !CLUSTER.matches(\".*\\\\d+.*\"))))\n\t\t\t\t\t\tcluster = CLUSTER;\n\t\t\t\t\tcluster= cluster.replaceAll(\"\\\\s+\",\"\");\n\t\t\t\t\tString matchString = primerFinder.next();\n\t\t\t\t\twhile (!matchString.contains(\"Identities\"))\n\t\t\t\t\t\tmatchString = primerFinder.next();\n\t\t\t\t\tint matchLength = Integer.parseInt(matchString.substring(matchString.indexOf(\"=\") + 2, matchString.indexOf(\"/\")));\n\t\t\t\t\tif ((double) (matchLength / primer.length()) > MAX_FALSE_FRACTION && !CLUSTER.equals(cluster)) {\n\t\t\t\t\t\tprimerFinder.close();\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} while(primerFinder.hasNext());\n\t\tprimerFinder.close();\n\t\treturn true;\n\t}", "int main()\n{\n\n string line;\n\n while (getline(cin, line))\n {\n if (line == \"\")\n {\n cout << 0 << endl;\n continue;\n }\n\n int num = roman2num(line);\n string n_line = num2roman(num);\n\n if (line != n_line || num >= 4000)\n {\n cout << \"This is not a valid number\" << endl;\n }\n else\n {\n cout << num << endl;\n }\n }\n\n return 0;\n}", "public boolean textCheck(String content){\n String [] text = content.split(\"\\r\\n|\\r|\\n\");\n if (text.length<4)\n return false;\n for (int i=0;i<text.length;i++){\n if (!text[i].contains(\":\")){\n Log.d(TAG, \"textCheck: Entry does not contain ':'\");\n return false;\n }\n }\n for (int i = 0;i<text.length;i++){\n String [] one = text[i].split(\":\");\n if (one.length > 2){\n Log.d(TAG, \"textCheck: Entry contains more than one ':'\");\n return false;\n }\n if (one[0].toLowerCase().trim().equals(one[1].toLowerCase().trim())){\n Log.d(TAG, \"textCheck: Word and Definition are identical \"+one[0]);\n return false;\n }\n for (int j = i+1;j<text.length;j++){\n String [] two = text[j].split(\":\");\n if (one[0].toLowerCase().trim().equals(two[0].toLowerCase().trim())){\n Log.d(TAG, \"textCheck: Repeated word \"+one[0]);\n return false;\n }\n if (one[1].toLowerCase().trim().equals(two[1].toLowerCase().trim())){\n Log.d(TAG, \"textCheck: Repeated definition \"+one[1]);\n return false;\n }\n if (one[0].toLowerCase().trim().equals(two[1].toLowerCase().trim())){\n Log.d(TAG, \"textCheck: Word or Definition already used in another entry \" + one[0].toLowerCase().trim());\n return false;\n }\n if (one[1].toLowerCase().trim().equals(two[0].toLowerCase().trim())){\n Log.d(TAG, \"textCheck: Word or Definition already used in another entry \" + one[1].toLowerCase().trim());\n return false;\n }\n }\n }\n return true;\n }", "public static boolean goodEnd(String sequence) {\n\t\tint endGCCount = 0;\n\t\tfor (int i = sequence.length() - 5; i < sequence.length(); i++)\n\t\t\tif (sequence.charAt(i) == 'g' || sequence.charAt(i) == 'c') endGCCount++;\n\t\treturn endGCCount <= MAX_GC_END;\n\t}", "protected boolean checkFormat() {\n\t\t// Read the card contents and check that all is ok.\n\t byte[] memory = utils.readMemory();\n\t if (memory == null)\n\t return false;\n\t \n\t // Check the application tag.\n\t for (int i = 1; i < 4; i++)\n\t if (memory[4 * 4 + i] != applicationTag[i])\n\t return false;\n\t \n\t // Check zeros. Ignore page 36 and up because of the safe mode.\n\t for (int i = 5 * 4; i < 36 * 4; i++)\n\t if (memory[i] != 0)\n\t return false;\n\t \n\t // Check that the memory pages 4..39 are not locked.\n\t // Lock 0: Check lock status for pages 4-7\n\t if (memory[2 * 4 + 2] != 0) \n\t return false;\n\t // Lock 1: \n\t if (memory[2 * 4 + 3] != 0)\n\t return false;\n\t // Lock 2:\n\t if (memory[40 * 4] != 0)\n\t \t\treturn false;\n\t // Lock 1:\n\t if (memory[40 * 4 + 1] != 0)\n\t \t\treturn false;\n\t \n\t return true;\n\t}", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1225, 754, 1225);\n javaCharStream0.backup(1);\n javaCharStream0.adjustBeginLineColumn(1, (-1));\n int int0 = javaCharStream0.getColumn();\n assertEquals(1223, javaCharStream0.bufpos);\n assertEquals((-1), int0);\n }", "public static boolean isTieGame3() {\n\t\treturn (spacesLeft == 3 && board[1][0] == ' ' && board[1][1] == ' '\n\t\t\t\t&& board[1][2] == ' ' && board[0][0] == 'X'\n\t\t\t\t&& board[0][2] == 'X' && board[2][1] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[1][0] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[1][2] == ' ' && board[2][0] == 'X'\n\t\t\t\t\t\t&& board[0][1] == 'X' && board[2][2] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[0][1] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[2][1] == ' ' && board[0][0] == 'X'\n\t\t\t\t\t\t&& board[2][0] == 'X' && board[1][2] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[0][1] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[2][1] == ' ' && board[0][2] == 'X'\n\t\t\t\t\t\t&& board[1][0] == 'X' && board[2][2] == 'X');\n\n\t}", "private static boolean isLineBased(final ByteBuf[] delimiters) {\n if (delimiters.length != 2) {\n return false;\n }\n ByteBuf a = delimiters[0];\n ByteBuf b = delimiters[1];\n if (a.capacity() < b.capacity()) {\n a = delimiters[1];\n b = delimiters[0];\n }\n return a.capacity() == 2 && b.capacity() == 1\n && a.getByte(0) == '\\r' && a.getByte(1) == '\\n'\n && b.getByte(0) == '\\n';\n }", "private boolean es_una_instruccion_valida(String line) {\n \n \tif( line.matches(this.pattern_enlace) ) {\n \t\treturn true;\n \t} else if( line.matches(this.pattern_remover_enlace) ){\n \t\treturn true;\n \t} else if( line.matches(this.pattern_pregunta) ) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "@Test(timeout = 4000)\n public void test013() throws Throwable {\n StringReader stringReader0 = new StringReader(\"d{IHR}D';Z<m5\\\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.BeginToken();\n javaCharStream0.UpdateLineColumn('d');\n assertEquals(1, javaCharStream0.getBeginLine());\n }" ]
[ "0.59478384", "0.5932211", "0.5864419", "0.58194", "0.57693166", "0.57503814", "0.57238257", "0.5668652", "0.56655705", "0.5630078", "0.5585119", "0.557496", "0.5517565", "0.5431859", "0.53915435", "0.5380142", "0.53643245", "0.5340542", "0.5323474", "0.53211814", "0.5309948", "0.5300557", "0.52779764", "0.5270005", "0.52615535", "0.5251092", "0.5245059", "0.52310276", "0.5213427", "0.52087724", "0.520781", "0.5206279", "0.5201489", "0.519987", "0.5197781", "0.5188099", "0.5188099", "0.51876587", "0.51790094", "0.5178891", "0.51649916", "0.51464075", "0.513482", "0.511064", "0.5084161", "0.5083175", "0.5064142", "0.50592214", "0.50523037", "0.50356925", "0.5033333", "0.5014397", "0.50086033", "0.500577", "0.5003884", "0.50020814", "0.4998288", "0.49941447", "0.49923202", "0.49888963", "0.49883026", "0.497798", "0.4976909", "0.4973683", "0.4967001", "0.49655938", "0.49590918", "0.4950567", "0.4950448", "0.49502653", "0.49483696", "0.49433875", "0.49424773", "0.4938593", "0.49383992", "0.4936943", "0.4936551", "0.49364161", "0.49362016", "0.49325824", "0.49318194", "0.49306548", "0.49297217", "0.4927958", "0.49267524", "0.49213448", "0.49196285", "0.49169564", "0.49150538", "0.4908419", "0.4907477", "0.49024248", "0.49007657", "0.48915794", "0.48874485", "0.48818967", "0.4876924", "0.487469", "0.48708394", "0.4868362" ]
0.60422546
0
/ Return the proper prefix string based on type of the smear.
private static String getPrefixString( Gfa smear ) { String prefix = ""; if ( !smear.isSnapshot() ) { if ( smear.isOutlook() ) { prefix = Gfa.BOUNDED_BY; } else { prefix = Gfa.FROM; } } return prefix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String getPrefix();", "public String getStrainPrefix(Db db)\n\t{\n\t\tString prefix = dbHelper.getDbValue(\"exec spMet_getStrainPrefix '\" \n\t\t\t\t+ getStrainType() + \"'\", db);\n\t\tString suffix = dbHelper.getDbValue(\"exec spMet_getIDSuffix\", db);\n\t\tif(WtUtils.isNullOrBlank(suffix))\n\t\t\tsuffix = \"\";\n\t\telse\n\t\t\tsuffix = suffix + \"-\";\n\t\treturn prefix + \"-\" + suffix;\n\t}", "String getPrefix();", "String getPrefix();", "String getPrefix();", "String getPrefix();", "@Override\n\tpublic String getPrefix() {\n\t\treturn getClass().getSimpleName()+\":\"+prefix;\n\t}", "public String getPrefixString() {\n/* 105 */ return this.prefix;\n/* */ }", "public String getPrefix();", "public String getPrefix();", "public String getPrefix() {\n return getAsString(\"prefix\");\n }", "protected String getStrainBackupBoxPrefix(Db db)\n\t{\n\t\tString sql = \"exec spMet_getStrainCollectionBackupBoxPrefix '\" + getStrainType() + \" Strain'\";\n\t\tString prefix = db.getHelper().getDbValue(sql, db);\n\t\treturn prefix;\n\t}", "public String getPrefix()\n\t{\n\t\t//local constants\n\n\t\t//local variables\n\n\t\t/*******************************************************************************/\n\n\t\t//Return the prefix of the name.\n\t\treturn prefix;\n\n\t}", "public String getPrefix() {\n\t\treturn this.getNr().substring(0, Anacom.prefixLength);\n\t}", "protected String getStrainBoxPrefix(Db db)\n\t{\n\t\tString sql = \"exec spMet_getStrainCollectionBoxPrefix '\" + getStrainType() + \" Strain'\";\n\t\tString prefix = dbHelper.getDbValue(sql, db);\n\t\treturn prefix;\n\t}", "public static String getPrefix() {\n return getConfiguration().getPath(\"General.Prefix\").getString();\n }", "public String getPrefix() {\n return this.getNr().substring(AnacomData.PREFIX_POS, AnacomData.PREFIX_LENGTH);\n }", "public String getPrefix(Player player) {\n \t\treturn getValue(player, \"prefix\");\n \t}", "public String getPrefix() {\n \t\t\treturn prefix;\n \t\t}", "public String getPrefixCode() { return sharedPreferences.getString(PREFIX_CODE, \"\"); }", "private String derivePrefixFromAnnotation(Class<?> clazz) {\n if (clazz.isAnnotationPresent(TypeDefinition.class)) {\n TypeDefinition td = clazz.getAnnotation(TypeDefinition.class);\n if (td != null && !TypeDefinition.UNDEFINED_PREFIX.equals(td.prefix())) {\n return td.prefix();\n }\n }\n return null;\n }", "public java.lang.String getPrefix() {\r\n return prefix;\r\n }", "public String getPrefix()\n {\n return this.prefix;\n }", "public java.lang.String getPrefix () {\n\t\treturn prefix;\n\t}", "public String getPrefix() {\n return prefix;\n }", "public String getPrefix()\n\t{\n\t\treturn prefix;\n\t}", "public static String getPrefixString() {\n\n\t\tString prefix = \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\"\n\t\t\t\t+ \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\"\n\t\t\t\t+ \"PREFIX dbpedia: <http://dbpedia.org/property/>\"\n\t\t\t\t+ \"PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\"\n\t\t\t\t+ \"PREFIX oddlinker: <http://data.linkedmdb.org/resource/oddlinker/>\"\n\t\t\t\t+ \"PREFIX db: <http://data.linkedmdb.org/resource/>\"\n\t\t\t\t+ \"PREFIX movie: <http://data.linkedmdb.org/resource/movie/>\"\n\t\t\t\t+ \"PREFIX map: <file:/C:/d2r-server-0.4/mapping.n3#>\"\n\t\t\t\t+ \"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\"\n\t\t\t\t+ \"PREFIX d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#>\"\n\t\t\t\t+ \"PREFIX owl: <http://www.w3.org/2002/07/owl#>\"\n\t\t\t\t+ \"PREFIX dc: <http://purl.org/dc/terms/>\"\n\t\t\t\t+ \"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\"\n\t\t\t\t+ \"PREFIX fn: <java:facet.>\";\n\n\t\treturn prefix;\n\t}", "public String getPrefix() {\n return this.prefix;\n }", "public java.lang.String getPrefix() {\n return prefix;\n }", "public String prefix() {\n return this.prefix;\n }", "public String getPrefix() {\n return Prefix;\n }", "private String getPrefixesString() {\n\t\t//TODO: Include dynamic way of including this\n\t\treturn \"@prefix core: <http://vivoweb.org/ontology/core#> .\";\n\t}", "public String getPrefix() {\n\t\treturn prefix;\n\t}", "public String getPrefix() {\n return m_prefix;\n }", "public final String getPrefix() {\n return properties.get(PREFIX_PROPERTY);\n }", "java.util.Optional<String> getPrefix();", "private String getPrefixForObject(Context context, DSpaceObject dso)\n {\n String prefix = getConfigProperty(context,\n CFG_PREFIX, dso);\n return prefix;\n }", "SimpleString getPrefix(SimpleString address);", "public abstract String getIdPrefix();", "@Override\r\n\t\tpublic String getPrefix()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public String prefix()\n\t {\n\t \t// create an empty string builder // \n\t \tStringBuilder sb = new StringBuilder();\n\t \t\n\t \t// fill the string builder//\n\t \tprefix(root, sb);\n\t \t\n\t \treturn sb.toString().trim();\n\t }", "public String getIdentificationPrefix();", "public String getPrefix() {\n return getPrefix(portletID.getPortletApplicationName(), portletID.getPortletName());\n }", "@Updatable\n public String getPrefix() {\n return prefix;\n }", "public String getPrefix() {\n return ChatColor.translateAlternateColorCodes('&', Objects.requireNonNull(this.getConfig().getString(\"config.messages.prefix\")));\n }", "public boolean isPrefix() { return prefix; }", "public String getPrefix(String player, String world) {\n \t\treturn getValue(player, world, \"prefix\");\n \t}", "public String getFamilyPrefix() {\n return familyPrefix;\n }", "private static java.lang.String generatePrefix(java.lang.String namespace) {\n if(namespace.equals(\"http://ws.platform.blackboard/xsd\")){\n return \"ns1\";\n }\n return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();\n }", "String getFNamePrefix(String scName) {\r\n\r\n if (machineFunctions.size() > 1) {\r\n return CALToJavaNames.cleanSCName(scName) + \"_\";\r\n }\r\n return \"\";\r\n }", "private String shortPrefix(String name) {\r\n StringBuilder b = new StringBuilder();\r\n String[] splits = name.split(\"_\");\r\n for (int i = 0; i < splits.length; ++i) {\r\n if (splits[i].length() > 0) {\r\n b.append(splits[i].charAt(0));\r\n }\r\n }\r\n if (b.length() < 3) {\r\n b.append(Integer.toString(name.length() % 10));\r\n }\r\n return b.toString().toLowerCase();\r\n }", "public String getPrefix(int index) {\n return libsbmlJNI.XMLNamespaces_getPrefix__SWIG_0(swigCPtr, this, index);\n }", "protected abstract String getPropertyPrefix();", "public String getPrefixKey() {\n return \"qa.journal.item.\" + key;\n }", "private static String removePrefix(String aType)\n {\n return aType.replace(\"_(\" + AnnotationState.AGREE.name() + \")\", \"\")\n .replace(\"_(\" + AnnotationState.USE.name() + \")\", \"\")\n .replace(\"_(\" + AnnotationState.DISAGREE.name() + \")\", \"\")\n .replace(\"_(\" + AnnotationState.DO_NOT_USE.name() + \")\", \"\")\n .replace(\"_(\" + AnnotationState.NOT_SUPPORTED.name() + \")\", \"\");\n }", "private static java.lang.String generatePrefix(java.lang.String namespace) {\r\n if(namespace.equals(\"http://www.huawei.com.cn/schema/common/v2_1\")){\r\n return \"ns1\";\r\n }\r\n return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();\r\n }", "EPREFIX_TYPE getName();", "public YANG_Prefix getPrefix() {\n\t\treturn prefix;\n\t}", "public String getXMLSchemaPrefix()\n {\n return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT);\n }", "private static java.lang.String generatePrefix(java.lang.String namespace) {\n if(namespace.equals(\"http://dto.thirdsdk.api.pms.cms.hikvision.com/xsd\")){\n return \"ns1\";\n }\n return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();\n }", "private String readPrefixPart()\n // { return readWordSub(false, false) ; }\n {\n return readSegment(false);\n }", "public String getPropertyPrefix();", "public final String getPrefix() {\n/* 70 */ return \"jpegImage\";\n/* */ }", "public String getPrefix(String uri) {\n\t\treturn uriToPrefixMap.get(uri);\n\t}", "protected String getTypedUrlPrefix(String urlPrefix, String idType) {\r\n if (idType.equals(Types.PROJECT.getTypeName()) || idType.equals(Types.PROJECT.name())) {\r\n return urlPrefix + urlProjectTypePrefix;\r\n } else if (idType.equals(Types.PERSON.getTypeName()) || idType.equals(Types.PERSON.name())) {\r\n return urlPrefix + urlPersonTypePrefix;\r\n } else if (idType.equals(Types.DATA_SET.getTypeName()) || idType.equals(Types.DATA_SET.name())) {\r\n return urlPrefix + urlDataSetTypePrefix;\r\n } else if (idType.equals(Types.DATA_FILE.getTypeName()) || idType.equals(Types.DATA_FILE.name())) {\r\n return urlPrefix + urlDataFileTypePrefix;\r\n } else if (idType.equals(Types.COLLECTION.getTypeName()) || idType.equals(Types.COLLECTION.name())){\r\n return urlPrefix + urlCollectionTypePrefix;\r\n } else if (idType.equals(Types.METADATA_FILE.getTypeName()) || idType.equals(Types.METADATA_FILE.name())){\r\n return urlPrefix + urlMetadataFileTypePrefix;\r\n } else {\r\n return super.getTypedUrlPrefix(urlPrefix, idType);\r\n }\r\n }", "public String getOutputPrefix();", "String getConvention(String type) {\n\t\tfor (int i = scopeStack.size() - 1; i >= 0; i--) {\n\t\t\tScope scope = scopeStack.elementAt(i);\n\t\t\tString prefix = scope.getConvention(type);\n\t\t\tif (prefix != null) return prefix;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public String getAlternativeOrderNumberPrefix();", "public String getNamePrefix() {\n if ( group==null )\n return super.getNamePrefix();\n else\n return group.getNamePrefix();\n }", "String createMessageWithPrefix();", "void setPrefix(String prefix);", "GetPrefix internalContent();", "private String getResourceIdPrefix(String resourceId) {\n if (resourceId == null) {\n return null;\n }\n if (resourceId.indexOf(\"%3A\") != -1) {\n return resourceId.substring(0, resourceId.indexOf(\"%3A\"));\n } else if (resourceId.indexOf(\":\") != -1) {\n return resourceId.substring(0, resourceId.indexOf(\":\"));\n } else {\n return null;\n }\n }", "public static String getGetterPrefix(final ClassifierFacade type)\r\n {\r\n return type != null && type.isBooleanType() && type.isPrimitive() ? \"is\" : \"get\";\r\n }", "public String getIdPrefix() {\n \t\treturn idPrefix;\n \t}", "private String getTypeVariableNamePrefix(String string)\r\n {\r\n string = string.trim();\r\n for (String typeVariableName : typeVariableNames)\r\n {\r\n if (string.equals(typeVariableName))\r\n {\r\n return typeVariableName;\r\n }\r\n if (string.startsWith(typeVariableName+\" \"))\r\n {\r\n return typeVariableName;\r\n }\r\n }\r\n return null;\r\n }", "@Test\n\tpublic void testGuardPrefixRenaming() throws Exception {\n\t\ttestMachinePrefixRenaming(IGuard.ELEMENT_TYPE);\n\t}", "private String getPrefix() {\n\n\t\tISOTopParamsPresenter firstPresenter = (ISOTopParamsPresenter) getTopPresenter();\n\t\tfinal String opName = firstPresenter.getOperationName();\n\n\t\treturn opName;\n\t}", "public String getApplicationNamePrefix()\n {\n return applicationNamePrefix;\n }", "public String prefix() {\n return string.substring(0, string.length() - 1);\n }", "public static String getFormalFamilyNameFromType(FamilyType type) {\n switch (type) {\n case ARTIX7:\n return \"Artix7\";\n case ARTIX7L:\n return \"Artix7 Lower Power\";\n case ASPARTAN2E:\n return \"Automotive Spartan2E\";\n case ASPARTAN3:\n return \"Automotive Spartan3\";\n case ASPARTAN3A:\n return \"Automotive Spartan3A\";\n case ASPARTAN3ADSP:\n return \"Automotive Spartan-3A DSP\";\n case ASPARTAN3E:\n return \"Automotive Spartan3E\";\n case ASPARTAN6:\n return \"Automotive Spartan6\";\n case KINTEX7:\n return \"Kintex7\";\n case KINTEX7L:\n return \"Kintex7 Lower Power\";\n case QSPARTAN6:\n return \"Defense-Grade Spartan-6Q\";\n case QSPARTAN6L:\n return \"Defense-Grade Spartan-6Q Lower Power\";\n case QVIRTEX4:\n return \"Defense-Grade Virtex-4Q\";\n case QVIRTEX5:\n return \"Defense-Grade Virtex-5Q\";\n case QVIRTEX6:\n return \"Defense-Grade Virtex-6Q\";\n case QVIRTEX:\n return \"QPro Virtex Hi-Rel\";\n case QRVIRTEX:\n return \"QPro Virtex Rad-Hard\";\n case QVIRTEX2:\n return \"QPro Virtex2 Military\";\n case QRVIRTEX2:\n return \"QPro Virtex2 Rad Tolerant\";\n case QVIRTEX2P:\n return \"QPro Virtex2P Hi-Rel\";\n case QVIRTEXE:\n return \"QPro VirtexE Military\";\n case QRVIRTEX4:\n return \"Space-Grade Virtex-4QV\";\n case SPARTAN2:\n return \"Spartan2\";\n case SPARTAN2E:\n return \"Spartan2E\";\n case SPARTAN3:\n return \"Spartan3\";\n case SPARTAN3A:\n return \"Spartan3A and Spartan3AN\";\n case SPARTAN3ADSP:\n return \"Spartan-3A DSP\";\n case SPARTAN3E:\n return \"Spartan3E\";\n case SPARTAN6:\n return \"Spartan6\";\n case SPARTAN6L:\n return \"Spartan6 Lower Power\";\n case VIRTEX:\n return \"Virtex\";\n case VIRTEX2:\n return \"Virtex2\";\n case VIRTEX2P:\n return \"Virtex2P\";\n case VIRTEX4:\n return \"Virtex4\";\n case VIRTEX5:\n return \"Virtex5\";\n case VIRTEX6:\n return \"Virtex6\";\n case VIRTEX6L:\n return \"Virtex6 Lower Power\";\n case VIRTEX7:\n return \"Virtex7\";\n case VIRTEX7L:\n return \"Virtex7 Lower Power\";\n case VIRTEXE:\n return \"VirtexE\";\n default:\n return null;\n }\n }", "public boolean isPrefix() {\n return prefix;\n }", "Optional<String> prefixByPhoneNumber(String phoneNumber);", "public String getNameFromType(Type type) {\n\t\tif (type == Type.PURCHASE)\n\t\t\treturn \"PURCHASE\";\n\t\telse\n\t\t\treturn \"RENTAL\";\n\t}", "public String getTapeBarcodePrefix() {\n return tapeBarcodePrefix;\n }", "public void setPrefix(java.lang.String prefix) {\r\n this.prefix = prefix;\r\n }", "public void setIdentificationPrefix(String prefix);", "public void prefix( String base ) {\r\n\t\tthis.prefix = base;\r\n\t\ts.prefix( base );\r\n\t}", "public static String getUniqueName(final String prefix) {\r\n\r\n return prefix + System.currentTimeMillis();\r\n }", "public interface ReplacerType {\n\n String getPrefix();\n\n String getName();\n}", "private String commonPrefix(String leftPrefix, String rightPrefix) {\n if (leftPrefix == null || rightPrefix == null) {\n return \"\";\n }\n\n int end = Math.min(leftPrefix.length(), rightPrefix.length());\n\n for (int i = 0; i < end; i++) {\n if (leftPrefix.charAt(i) != rightPrefix.charAt(i)) {\n return leftPrefix.substring(0, i);\n }\n }\n\n // a concise way to avoid ternary expression\n return leftPrefix.substring(0, end);\n }", "@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}", "private String getPrefixDuringSave(String namespace) {\r\n EPackage ePackage = extendedMetaData.getPackage(namespace);\r\n if (ePackage == null) {\r\n ePackage = extendedMetaData.demandPackage(namespace);\r\n // This will internally create a nice prefix\r\n }\r\n String prefix = ePackage.getNsPrefix();\r\n // I'm not sure if the following code is needed, but I keep it to avoid inconsistencies\r\n if (!packages.containsKey(ePackage)) {\r\n packages.put(ePackage, prefix);\r\n }\r\n prefixesToURIs.put(prefix, namespace);\r\n return prefix;\r\n }", "public void setPrefix(java.lang.String prefix) {\n this.prefix = prefix;\n }", "private String getPrefix(RegularMethodInvocation call, Stack<Variable> variables) throws LookupException {\n NormalMethod method = call.getElement();\n\n // Add a prefix if this is not a constructor\n Type type = method.nearestAncestor(Type.class);\n return method.isTrue(neio.CONSTRUCTOR) ? null : getPrefix(type, variables);\n }", "Rule StPrefixScopeAndId() {\n return Sequence(\n \"smalltalk.prefix\",\n Identifier(),\n actions.pushStPrefixNamespaceNode());\n }" ]
[ "0.7186854", "0.7045212", "0.6930993", "0.6930993", "0.6930993", "0.6930993", "0.69060814", "0.67595434", "0.6739559", "0.6739559", "0.6704556", "0.6635648", "0.65954226", "0.6555723", "0.6521035", "0.64759934", "0.6379263", "0.63506514", "0.6335811", "0.6254203", "0.62531203", "0.6252298", "0.62482977", "0.62433094", "0.6238341", "0.62375903", "0.623611", "0.62248105", "0.6211561", "0.6209808", "0.61962795", "0.61889887", "0.61702996", "0.61419135", "0.6126463", "0.6105725", "0.609509", "0.60765636", "0.6075189", "0.60519856", "0.6015593", "0.59937024", "0.596568", "0.5895411", "0.5884351", "0.58470887", "0.58386153", "0.5830853", "0.5812027", "0.5800116", "0.57664806", "0.57664716", "0.57453585", "0.5742881", "0.57254505", "0.5715332", "0.5713711", "0.56815326", "0.56767714", "0.5674642", "0.5664551", "0.5663024", "0.5652364", "0.5629211", "0.56254506", "0.56211835", "0.56081426", "0.56017137", "0.5598795", "0.55967134", "0.559656", "0.5555225", "0.5551083", "0.5538356", "0.5502354", "0.54993635", "0.5482111", "0.5464971", "0.5460347", "0.5452966", "0.54396755", "0.543954", "0.54391026", "0.5429916", "0.54297346", "0.5398254", "0.5395451", "0.53878725", "0.53612566", "0.5360204", "0.5347976", "0.5339353", "0.5339353", "0.5339353", "0.5339353", "0.5339353", "0.53374135", "0.53350437", "0.53326863", "0.5329164" ]
0.7675362
0
/ Check if a list of points can be formatted into 3 65character lines Note: the points are assumed to be in map coordinate.
private static boolean canBeFormatted( ArrayList<Coordinate> pts, String prefix ) { return ReduceGfaPointsUtil.canFormatted( pts, prefix ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkLines(List<Point> as) {\n\t\treturn this.trk.containsAll(as);\n\t}", "public Boolean checkCapture(ArrayList<Point> points){\n int length = points.size();\n\n for (int i = 1; i < length; i++) {\n Point lineA = points.get(i);\n\n for (int j = i + 1; j < length; j++) {\n Point lineB = points.get(j);\n\n //Check if one of the lines goes through the monster by using its size\n boolean left = lineline(lineA.x,lineA.y,lineB.x,lineB.y,mX,mY,mX,mY+monsterHeight);\n boolean right = lineline(lineA.x,lineA.y,lineB.x,lineB.y,mX + monsterWidth,mY, mX+monsterWidth,mY+monsterHeight);\n boolean top = lineline(lineA.x,lineA.y,lineB.x,lineB.y, mX,mY, mX+monsterWidth,mY);\n boolean bottom = lineline(lineA.x,lineA.y,lineB.x,lineB.y, mX,mY+monsterHeight, mX+monsterWidth,mY+monsterHeight);\n\n //If any are true then its captured\n if(left || right || top || bottom){\n return true;\n }\n }\n }\n return false;\n }", "public Boolean CanRender(String symbolCode, \n ArrayList<Point2D.Double> coords,\n int symStd)\n {\n String message = null;\n String basicSymbolID = symbolCode;\n basicSymbolID = SymbolUtilities.getBasicSymbolIDStrict(basicSymbolID);\n //ErrorLogger.LogMessage(\"TEST\");\n try\n {\n // message = \"Cannot draw: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n if(SymbolUtilities.isTacticalGraphic(basicSymbolID))\n {\n if(_SymbolDefTable == null)\n _SymbolDefTable = SymbolDefTable.getInstance();\n\n SymbolDef sd = _SymbolDefTable.getSymbolDef(basicSymbolID,symStd);\n if(sd != null)\n {\n int pointCount = 0;\n if(coords != null)\n {\n pointCount = coords.size();\n }\n\n int dc = sd.getDrawCategory();\n if (dc == SymbolDef.DRAW_CATEGORY_POINT)//make sure we can find the character in the font.\n {\n int index = -1;\n index = SinglePointLookup.getInstance().getCharCodeFromSymbol(symbolCode,symStd);\n if(index > 0)\n return true;\n else\n message = \"Bad font lookup for: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n else if(dc > 0 && dc < 99)\n {\n if(sd.getMinPoints() == sd.getMaxPoints())\n { //complex graphic like ambush\n\n if(pointCount == sd.getMinPoints())\n return true;\n else\n message = \"Specific point count not met for: \" + symbolCode + \" (\" + basicSymbolID + \") - Had: \" + String.valueOf(pointCount) + \" Needed: \" + String.valueOf(sd.getMinPoints());\n }\n else if(pointCount >= sd.getMinPoints())\n {\n return true;\n }\n else if(sd.getDrawCategory() == SymbolDef.DRAW_CATEGORY_POLYGON\n && pointCount == 2 && sd.getMinPoints() == 3 && sd.getMaxPoints() > 100)\n {//areas with 2 points are allowable.\n return true;\n }\n else if(pointCount < sd.getMinPoints())\n {\n message = symbolCode + \" had less than the required number of points. Had: \" + String.valueOf(coords.size()) + \" Needed: \" + String.valueOf(sd.getMinPoints());\n }\n }\n else\n {\n message = \"Cannot draw: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n\n }\n else\n {\n message = \"Cannot draw symbolID: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n }\n else\n {\n //UnitDef ud = UnitDefTable.getInstance().getUnitDef(basicSymbolID,symStd);\n UnitFontLookupInfo ufli = UnitFontLookup.getInstance().getLookupInfo(basicSymbolID,symStd);\n if(ufli != null)\n {\n return true;\n }\n else\n {\n message = \"JavaRenderer.CanRender() - Cannot draw symbolID: \" + symbolCode + \" (\" + basicSymbolID + \")\";\n }\n }\n\n if(message != null && !message.equals(\"\"))\n {\n ErrorLogger.LogMessage(this.getClass().getName(), \"CanRender()\", message,Level.FINE);\n //System.err.println(message);\n //System.out.println(\"\");\n //System.out.println(\"INFO: CanRender - \" + message);\n //Exception foo = new Exception(\"Stack?\");\n //foo.printStackTrace();\n }\n }\n catch(Exception exc)\n {\n System.err.println(String.valueOf(message));\n System.err.println(exc.getMessage());\n }\n return false;\n }", "private boolean pointsCheck(String point){\n\t\tboolean isNumber = true;\t\n\t\tfor (int i = 0; i < point.length(); i++) {\n\t if(point.charAt(i) < 48 || point.charAt(i) > 57) {\n\t isNumber = false;\n\t break;\n\t }\n\t }\n\t\t\t\t\n\t\tif(!isNumber){\n\t\t\tSystem.out.println(\"Input file format not correct: not numerical val second column in the text file\");\n\t\t\tSystem.exit(0);\n\t\t\t\n\t\t}\n\t\t//check if points exist in the database\n\t\tint pointsInLine = Integer.parseInt(point);\n\t\tif(findPointIndex(pointsInLine)!= -1){\n\t\t\treturn true;\n\t\t}\n\t\tSystem.out.println(\"Error: question's point val not existed in the database\");\n\t\tSystem.exit(0);\n\t\treturn false;\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void testCalculateConvexHullFromWktPoints01() throws ParseException{\n\t\tList<String> pointWktList = new ArrayList<String>();\n\t\tpointWktList.add(\"POINT(123.0 1.0)\");\n\t\tpointWktList.add(\"POINT(103.0 -7.0)\");\n\t\tpointWktList.add(\"POINT(203.0 -22.0)\");\n\t\tpointWktList.add(\"POINT(303.0 440.0)\");\n\t\tpointWktList.add(\"POINT(101.0 -4.0)\");\n\t\tString result = ConvexHullUtil.calculateConvexHullFromWktPoints(pointWktList);\n\t\tassertThat(result, is(\"POLYGON ((203 -22, 103 -7, 101 -4, 303 440, 203 -22))\"));\n\t}", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "@Test\n\tpublic void testCalculateConvexHullFromWktPoints02() throws ParseException{\n\t\tList<String> pointWktList = new ArrayList<String>();\n\t\tpointWktList.add(\"POINT(123.0 1.0)\");\n\t\tpointWktList.add(\"POINT(103.0 -7.0)\");\n\t\tpointWktList.add(\"POINT(203.0 -22.0)\");\n\t\tpointWktList.add(\"POINT(303.0 440.0)\");\n\t\tpointWktList.add(\"POINT(101.0 -4.0)\");\n\t\tpointWktList.add(\"Some Nonsense\");\n\t\ttry{\n\t\t\tConvexHullUtil.calculateConvexHullFromWktPoints(pointWktList);\n\t\t\tfail();\n\t\t}catch(ParseException pex){\n\t\t\t// success\n\t\t}\n\t}", "public boolean isValid(){\n\t\treturn points.size() >= 2;\n\t}", "@Test\n\tpublic void testContains() {\n\t\tLine l1 = new Line(0, 0, 1, 0);\n\t\tLine l2 = new Line(0, 0, 0, 1);\n\t\tLine l3 = new Line(0, 0, 1, 1);\n\t\tLine l4 = new Line(2.65, 0.3, 2.65, 0.9);\n\n\t\tassertTrue(\"l1 does not contain point (0.5, 0)\",\n\t\t\t\tl1.contains(new Coord(0.5, 0)));\n\t\tassertTrue(\"l2 does not contain point (0, 0.5)\",\n\t\t\t\tl2.contains(new Coord(0, 0.5)));\n\t\tassertTrue(\"l3 does not contain point (0.5, 0.5)\",\n\t\t\t\tl3.contains(new Coord(0.5, 0.5)));\n\n\t\tassertTrue(\n\t\t\t\t\"l4 does not contain (2.6499999999999995, 0.46083784792155075)\",\n\t\t\t\tl4.contains(new Coord(2.6499999999999995, 0.46083784792155075)));\n\n\t\t// Check endpoints for l1\n\t\tassertTrue(\"l1 does not contain point (0, 0)\",\n\t\t\t\tl1.contains(new Coord(0, 0)));\n\t\tassertTrue(\"l1 does not contain point (1, 0)\",\n\t\t\t\tl1.contains(new Coord(1, 0)));\n\t}", "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testCalculateConvexHullFromWktGeometryList03() throws ParseException{\n\t\tList<String> pointWktList = new ArrayList<String>();\n\t\tpointWktList.add(\"POINT(123.0 1.0)\");\n\t\tString result = ConvexHullUtil.calculateConvexHullFromWktGeometryList(pointWktList, false);\n\t\tassertThat(result, is(\"POINT (123 1)\"));\n\t\tShape shape = JtsSpatialContext.GEO.readShape(result);\n\t\tassertNotNull(shape);\n\t}", "boolean hasXYPairs();", "void pointCheck(LatLng point, boolean valid);", "private boolean isInList(List<Point3D> pointsList, Point3D point) {\r\n for (Point3D tempPoint : pointsList) {\r\n if(point.isAlmostEquals(tempPoint))\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n\tpublic void testCalculateConvexHullFromWktGeometryList01() throws ParseException{\n\t\tList<String> wktPolyList = new ArrayList<String>();\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,139.0 -40.0,200.5 -20.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,136.0 -40.0,200.5 -24.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,132.0 -40.0,200.5 -27.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POINT(136.001 -30.0)\");\n\t\tString result = ConvexHullUtil.calculateConvexHullFromWktGeometryList(wktPolyList, false);\n\t\tassertThat(result, is(\"POLYGON ((132 -40, 136.001 -30, 200.5 -20, 200.5 -27, 138.001 -40, 139 -40, 132 -40))\"));\n\t}", "public static boolean checkLineLength(String matrice){\r\n String[] lignes = matrice.trim().split(\" {1,}\");\r\n int longeur = lignes[0].length();\r\n int i = 1;\r\n boolean memeLongeur = true;\r\n while(i < lignes.length && memeLongeur){\r\n memeLongeur = (longeur == lignes[i].length());\r\n ++i;\r\n }\r\n\r\n if(! memeLongeur){\r\n System.out.println(\"Matrice invalide, lignes de longueurs differentes !\");\r\n }\r\n\r\n return memeLongeur;\r\n }", "public boolean pointOnShape(int u, int v){\n //doing this properly would be nasty because we would have to find out the size of the font\n // and the size of the string when displayed in the font currently used by the canvas\n // Instead, this uses an approximation, based on the default font of the canvas\n return (u>=x && u<=x+(str.length()*10) && v>=y-13 && v<=y+3);\n }", "protected static boolean areAllCollinear(List<Point2D.Float> points) {\n\n\t\tif (points.size() < 2) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfinal Point2D.Float a = points.get(0);\n\t\tfinal Point2D.Float b = points.get(1);\n\n\t\tfor (int i = 2; i < points.size(); i++) {\n\n\t\t\tPoint2D.Float c = points.get(i);\n\n\t\t\tif (getTurn(a, b, c) != Turn.COLLINEAR) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public String part1(List<String> input) {\n ArrayList<Integer> hit = new ArrayList<>();\n int listLen = input.size();\n\n //how long is the string\n int strLen = input.get(0).length();\n\n //Char init\n char location;\n // checking each column... ...\n for (int i = 0; i < 1; i++) {\n hit.add(0);\n // actual checking. vertical and y is horizontal\n for (int x = 0; x < listLen; x++) {\n int y = 0;\n if (x != 0) {\n y = x * 3;\n }\n\n //loop back if coordinates are out of bounds\n if (y >= strLen) {\n y = y % strLen;\n }\n\n location = input.get(x).charAt(y);\n if (location == '#') {\n hit.set(i,hit.get(i) + 1);\n }\n\n }\n }\n\n return \"\" + hit.get(0);\n }", "private boolean lineline(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4){\n float uA = ((x4-x3)*(y1-y3) - (y4-y3)*(x1-x3)) / ((y4-y3)*(x2-x1) - (x4-x3)*(y2-y1));\n float uB = ((x2-x1)*(y1-y3) - (y2-y1)*(x1-x3)) / ((y4-y3)*(x2-x1) - (x4-x3)*(y2-y1));\n\n return uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1;\n }", "boolean hasCoordInfo();", "boolean isPointEnclosed(Point p);", "private boolean checkLines(){\n\n for (int[] line : TwoPlayersActivity.lines) {\n\n if (field.get(line[0]).equals(field.get(line[1])) &&\n field.get(line[0]).equals(field.get(line[2])) &&\n !field.get(line[0]).getValue().equals(Cell.Value.NONE)){\n for (int index: line) {\n imageList.get(index).setBackgroundColor(Color\n .parseColor(TwoPlayersActivity.CELL_WIN_COLOR));\n }\n return true;\n }\n }\n return false;\n }", "boolean judgeValid()\r\n\t{\r\n\t\tif(loc.i>=0 && loc.i<80 && loc.j>=0 && loc.j<80 && des.i>=0 && des.i<80 && des.j>=0 && des.j<80)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\r\n\t}", "private boolean buildLayout(GameDescription gameDescription, ArrayList<DataPoint> points, int width, int height){\n\t\tCharacter solidCharacter = getSolidCharacter(gameDescription);\n\t\t\n\t\tif(solidCharacter != null){\n\t\t\t//Add the upper and lower solid object\n\t\t\tfor(int x=0; x<width; x++){\n\t\t\t\tpoints.add(new DataPoint(x, 0, solidCharacter));\n\t\t\t\tpoints.add(new DataPoint(x, height - 1, solidCharacter));\n\t\t\t}\n\t\t\t\n\t\t\t//Add the left and right solid object\n\t\t\tfor(int y=0; y<height; y++){\n\t\t\t\tpoints.add(new DataPoint(0, y, solidCharacter));\n\t\t\t\tpoints.add(new DataPoint(width - 1, y, solidCharacter));\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean writePoints(String points, File f) {\r\n\t\ttry {\r\n\t\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(\r\n\t\t\t\t\tnew FileWriter(f)));\r\n\t\t\tpw.println();\r\n\t\t\tpw.close();\r\n\t\t\treturn true;\r\n\t\t} catch(Exception ex) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testCalculateConvexHullFromWktGeometryList02() throws ParseException{\n\t\tList<String> wktPolyList = new ArrayList<String>();\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,139.0 -40.0,200.5 -20.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,136.0 -40.0,200.5 -24.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POLYGON((138.001 -40.0,132.0 -40.0,200.5 -27.0,138.001 -40.0))\");\n\t\twktPolyList.add(\"POINT(136.001 -30.0)\");\n\t\twktPolyList.add(\"BOOBAR\");\n\t\ttry{\n\t\t\tConvexHullUtil.calculateConvexHullFromWktGeometryList(wktPolyList, false);\n\t\t\tfail();\n\t\t}catch(ParseException pex){\n\t\t\t// success\n\t\t}\n\t}", "boolean intersectsProper(tLine l1)\n {\n if(l1.state == penStates.PENUP | this.state == penStates.PENUP)\n return false;\n\n //collinear doesn't count\n if (this.collinear(l1.p0) | this.collinear(l1.p1) | l1.collinear(this.p0) | l1.collinear(this.p1))\n return false;\n\n if(this.left(l1.p0) | this.left(l1.p1))\n {\n if (this.left(l1.p0) && this.left(l1.p1))\n return false;\n if (l1.left(this.p0) | l1.left(this.p1))\n {\n if (l1.left(this.p0) && l1.left(this.p1))\n return false;\n else\n return true;\n }\n }\n return false;\n }", "private boolean valid(InputStream instream)\r\n\t\t\tthrows BaseException\r\n\t{\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(instream));\r\n\t\tString line = new String();\r\n\t\tboolean newspectrum = false;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\tif ((Pattern.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\",\r\n\t\t\t\t\tline)))\r\n\t\t\t\t{\r\n\t\t\t\t\tnewspectrum = false;\r\n\t\t\t\t\twhile (!newspectrum)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ((line = in.readLine()) != null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (line.length() > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t\t\t\tif (!Pattern.matches(\r\n\t\t\t\t\t\t\t\t\t\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\", line))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// If m/z has 9 or more digits(+1 decimal sign),\r\n\t\t\t\t\t\t\t\t// annotate as\r\n\t\t\t\t\t\t\t\t// double precision\r\n\t\t\t\t\t\t\t\telse if (!mz_double_precision && Pattern\r\n\t\t\t\t\t\t\t\t\t.matches(\"^[\\\\d\\\\.]{10,}[ \\\\t]\\\\d+\\\\.?\\\\d*\",\r\n\t\t\t\t\t\t\t\t\t\tline))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tmz_double_precision = true;\r\n\t\t\t\t\t\t\t\t\tlog.info(\"Double precision = true\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tnewspectrum = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tnewspectrum = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.length() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tthrow new BaseException(e);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean isTriangular(String line) {\n\t\t\n\t\tStringTokenizer tok = new StringTokenizer(line);\n\t\tint num = tok.countTokens();\n\t\tPreconditions.checkState(num >= 9);\n\t\t\n\t\tif (num < 11)\n\t\t\t// always rectangular\n\t\t\treturn false;\n\t\t// 11 column file can be rectangular with section info or triangular without\n\t\t// if rectangular, 11th column must be a non-numeric string. So if it can be parsed to a double,\n\t\t// then it's the slip column in a triangular file\n\t\tList<String> tokens = Lists.newArrayList();\n\t\twhile (tok.hasMoreTokens())\n\t\t\ttokens.add(tok.nextToken());\n\t\tString tok11 = tokens.get(10);\n\t\ttry {\n\t\t\tDouble.parseDouble(tok11);\n\t\t\t// can be parsed, must be slip rate\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\t// can't be parsed, must be section name\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isDifficult()\n {\n int count = 0;\n for (int i = 1; i < markers.length; i++) {\n if (Math.abs(markers[i] - markers[i-1]) >= 30){\n count++;\n }\n }\n return (count >= 3);\n }", "boolean hasCoordinates();", "boolean hasCoordinates();", "boolean hasCoordinates();", "private void computeLinePoints (Point2D point1, Point2D point2, List<Point2D> points, int width) {\n\n int x1 = point1.getX();\n int y1 = point1.getY();\n int x2 = point2.getX();\n int y2 = point2.getY();\n\n int deltaX = Math.abs(x2 - x1);\n int deltaY = Math.abs(y2 - y1);\n\n int sx = x1 < x2 ? 1 : -1;\n int sy = y1 < y2 ? 1 : -1;\n\n int error = deltaX - deltaY;\n int error2 = 0, x3 = 0, y3 = 0;\n\n float ed = (deltaX + deltaY == 0) ? 1 : (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n\n for (width = (width + 1) / 2; ; ) {\n points.add(new GridPoint(x1, y1));\n error2 = error;\n x3 = x1;\n if (2 * error2 >= -deltaX) {\n for (error2 += deltaY, y3 = y1;\n error2 < ed * width && (y2 != y3 || deltaX > deltaY);\n error2 += deltaX) {\n points.add(new GridPoint(x1, y3 += sy));\n }\n if (x1 == x2) { break; }\n error2 = error;\n error -= deltaY;\n x1 += sx;\n }\n if (2 * error2 <= deltaY) {\n for (error2 = deltaX - error2; error2 < ed * width &&\n (x2 != x3 || deltaX < deltaY);\n error2 += deltaY) {\n points.add(new GridPoint(x3 += sx, y1));\n }\n if (y1 == y2) { break; }\n error += deltaX;\n y1 += sy;\n\n }\n\n }\n }", "private boolean arePointsRepeated(Point[] points) {\n for (int i = 0; i < points.length; i++) {\r\n for (int j = i + 1; j < points.length; j++) {\r\n if (points[i].compareTo(points[j]) == 0)\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "@Override\n public boolean contains(Line l) {\n int maxLineX = Math.max(l.p1.x, l.p2.x);\n int minLineX = Math.min(l.p1.x, l.p2.x);\n int maxLineY = Math.max(l.p1.y, l.p2.y);\n int minLineY = Math.min(l.p1.y, l.p2.y);\n\n double[] lineEq = calculateLineEquation(l.p1, l.p2);\n double leftIntersectionX = xIntersection(lineEq, topLeftCorner.y);\n // the line intersects the left side of the square within bounds\n if (topLeftCorner.x <= leftIntersectionX && leftIntersectionX <= bottomRightCorner.x\n && minLineX <= leftIntersectionX && leftIntersectionX <= maxLineX) {\n return true;\n }\n\n double rightIntersectionX = xIntersection(lineEq, bottomRightCorner.y);\n // the line intersects the right side of the square within bounds\n if (topLeftCorner.x <= rightIntersectionX && rightIntersectionX <= bottomRightCorner.x\n && minLineX <= rightIntersectionX && rightIntersectionX <= maxLineX) {\n return true;\n }\n\n double topIntersectionY = yIntersection(lineEq, topLeftCorner.x);\n // the line intersects the top side of the square within bounds\n if (topLeftCorner.y <= topIntersectionY && topIntersectionY <= bottomRightCorner.y\n && minLineY <= topIntersectionY && topIntersectionY <= maxLineY) {\n return true;\n }\n\n double bottomIntersectionY = yIntersection(lineEq, bottomRightCorner.x);\n // the line intersects the bottom side of the square within bounds\n if (topLeftCorner.y <= bottomIntersectionY && bottomIntersectionY <= bottomRightCorner.y\n && minLineY <= bottomIntersectionY && bottomIntersectionY <= maxLineY) {\n return true;\n }\n\n return false;\n\n }", "@Test\n\tpublic void testDoesNotContain() {\n\t\tLine l1 = new Line(0, 0, 1, 0);\n\t\tLine l2 = new Line(0, 0, 0, 1);\n\t\tLine l3 = new Line(0, 0, 1, 1);\n\n\t\tassertFalse(\"l1 does contain point (1.5, 0)\",\n\t\t\t\tl1.contains(new Coord(1.5, 0)));\n\t\tassertFalse(\"l2 do contain point (0, 1.5)\",\n\t\t\t\tl2.contains(new Coord(0, 1.5)));\n\t\tassertFalse(\"l3 does not contain point (1.5, 0.5)\",\n\t\t\t\tl3.contains(new Coord(1.5, 0.5)));\n\n\t}", "private boolean isHorizantalLines2Points(Point p1, Point p2) {\n\n if (abs(p1.y - p2.y ) < 70 && p1.x != p2.x) {\n return true;\n }\n return false;\n }", "public static boolean sameLine(Point[] points){\n List<Double> list = new ArrayList<>();\n double k=0,count=0;\n Map map = new HashMap();\n for(int i=0;i<points.length-1;i++){\n k = (points[i].getY()-points[i+1].getY())/(points[i].getX()-points[i+1].getX());\n if(map.get(k)==null){\n map.put(k,1);\n }\n else{\n map.put(k,(int)map.get(k)+1);\n }\n }\n return map.size()==1;\n }", "private void m10274d(List<C2411a> list) {\n int i;\n StringBuilder stringBuilder = new StringBuilder();\n int size = list.size();\n C2411a c2411a;\n double f;\n if (size <= 200) {\n for (C2411a c2411a2 : list) {\n double e = c2411a2.m12229e();\n f = c2411a2.m12230f();\n if (e <= 90.0d && e >= -90.0d && f <= 180.0d && f >= -180.0d) {\n this.f8990r.add(Double.valueOf(c2411a2.m12231g()));\n stringBuilder.append(e).append(\",\").append(f).append('|');\n }\n }\n } else {\n int i2 = size / 200;\n for (int i3 = 0; i3 < 200; i3++) {\n i = i3 * i2;\n double f2;\n if (i >= size) {\n c2411a2 = (C2411a) list.get(size - 1);\n f = c2411a2.m12229e();\n f2 = c2411a2.m12230f();\n if (f <= 90.0d && f >= -90.0d && f2 <= 180.0d && f2 >= -180.0d) {\n this.f8990r.add(Double.valueOf(c2411a2.m12231g()));\n stringBuilder.append(f).append(\",\").append(f2).append('|');\n }\n } else {\n c2411a2 = (C2411a) list.get(i);\n f = c2411a2.m12229e();\n f2 = c2411a2.m12230f();\n if (f <= 90.0d && f >= -90.0d && f2 <= 180.0d && f2 >= -180.0d) {\n this.f8990r.add(Double.valueOf(c2411a2.m12231g()));\n stringBuilder.append(f).append(\",\").append(f2).append('|');\n }\n }\n }\n }\n if (stringBuilder.length() <= 0) {\n ArrayList arrayList = new ArrayList();\n for (i = 0; i < this.f8993u; i++) {\n arrayList.add(Double.valueOf(0.0d));\n }\n this.f8973a.mo3315b(arrayList);\n return;\n }\n m10265b(stringBuilder.substring(0, stringBuilder.length() - 1));\n }", "private boolean inPolygonLineCount(Double[] p, double x, double y) {\n\t\t\t\tint crosscount = 0;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < p.length ; i++) {\n\t\t\t\t\tdouble pix = p[i].x;\n\t\t\t\t\tdouble piy = p[i].y;\n\t\t\t\t\tdouble pi1x = p[(i+1) % p.length].x;\n\t\t\t\t\tdouble pi1y = p[(i+1) % p.length].y;\n\t\t\t\t\tdouble vx = pi1x - pix;\n\t\t\t\t\tdouble vy = pi1y - piy;\n\t\t\t\t\tdouble xint = pix + ((y-piy) / vy) * vx;\n\t\t\t\t\tif (pix > x || pi1x > x) {\n\t\t\t\t\t\tif (piy < y && y <= pi1y && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t} else if (pi1y < y && y <= piy && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn crosscount%2 == 1;\n\t\t\t}", "private boolean m2832l() {\r\n if (Math.abs(((this.f1761e.latitude - this.f1762f.latitude) * (this.f1762f.longitude - this.f1763g.longitude)) - ((this.f1761e.longitude - this.f1762f.longitude) * (this.f1762f.latitude - this.f1763g.latitude))) < 1.0E-6d) {\r\n return false;\r\n }\r\n return true;\r\n }", "public void checkMarkers(int num) {\n\t\t\n\t}", "@Test\n\tpublic void testConvexHullJTSApi(){\n\t\tCoordinate [] ca3 = {\n\t\t\t\tnew Coordinate(1.0, 2.5),\n\t\t\t\tnew Coordinate(2.0, 2.5)\n\t\t};\n\t\tConvexHull objectUnderTest = new ConvexHull(ca3, geometryFactory);\n\t\tGeometry result = objectUnderTest.getConvexHull();\n\t\tassertThat(result.toText(), is(\"LINESTRING (1 2.5, 2 2.5)\"));\n\t}", "private void printSuppliedPoints(Point[] points) {\r\n String pointsSupplied = \"{\";\r\n for (int i = 0; i < points.length; ++i) {\r\n if (points[i] == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n pointsSupplied = pointsSupplied + \"new Point\" + points[i] + \",\";\r\n }\r\n pointsSupplied = pointsSupplied + \"};\";\r\n System.out.println(pointsSupplied);\r\n }", "private boolean isDisplayable(int c) {\n return 20 <= c && c <= 126 && c != '\"';\n }", "private boolean isValidPosition(Point pos){\r\n return (0 <= pos.getFirst() && pos.getFirst() < 8 && \r\n 0 <= pos.getSecond() && pos.getSecond() < 8);\r\n }", "public static boolean has3Points(int[] coords) {\n\n int pointsGoal = 3;\n int n = coords.length;\n if (n < pointsGoal)\n return false;\n\n // simple shift forward by by check 3 at a time loop.\n // for coords = [1, 2, 3, 4, 5, 6, 7, 8] , n 8\n // loop 1: check (1,2,3)\n // loop 2: check (2,3,4)\n // loop 3: check (3,4,5)\n // loop 4: check (4,5,6)\n // loop 5: check (5,6,7)\n // loop 6: check (6,7,8) n - 3 == 6\n for (int i = 0; i < n - pointsGoal; i++) {\n if (same3Gradients(coords, i)) {\n return true;\n }\n }\n\n return false;\n }", "private String checkSegments(ArrayList<DataSegment> list, int start, int end) {\n if (list.isEmpty()) return \"38020\";\n if (list.get(0).getSegmentStart()!=start) return \"38021\";\n if (list.get(list.size()-1).getSegmentEnd()!=end) return \"38022\";\n int lastend=start-1; \n for (int i=0;i<list.size();i++) {\n DataSegment segment=list.get(i);\n if (segment.getSegmentStart()!=lastend+1) return \"38023[\"+(i+1)+\"/\"+(list.size())+\"]\";\n lastend=segment.getSegmentEnd();\n if (lastend>end) return \"38024[\"+(i+1)+\"/\"+(list.size())+\"]\";\n }\n return null;\n }", "public static boolean canBeFormatted( Gfa smear ) {\n\t\t\n\t\tboolean formattable = false;\n\t\tif ( !smear.isSnapshot() ) { \n\t\t String prefix = getPrefixString( smear );;\n\t\t formattable = \tcanBeFormatted( smear.getPoints(), prefix );\n\t\t}\n\t\t\n\t return formattable;\n\t \n//\t\treturn ( smear.getLinePoints().length <= 5 ) ? true : false; //test purpose only\n\t\t\n\t}", "public boolean validStopCheck(){\n return points.validPolygon();\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 }", "public boolean formatCheck()\n\t{\n\t\t// The freeList has to be 2 or greater since the first block (index 0)\n\t\t// is the SuperBlock, and the the second block (index 1) contains\n\t\t// information about Inodes.\n\t\tif (totalBlocks != Kernel.NUM_BLOCKS || totalInodes <= 0 || \n\t\t\tfreeList < 2 || freeList >= totalBlocks && \n\t\t\tlastFreeBlock < 2 || lastFreeBlock >= totalBlocks)\n\t\t{\n\t\t\ttotalBlocks = Kernel.NUM_BLOCKS;\n\t\t\tlastFreeBlock = totalBlocks - 1;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean canDisplay(int codePoint) {\n\tif (!Character.isValidCodePoint(codePoint)) {\n\t throw new IllegalArgumentException(\"invalid code point: \" + Integer.toHexString(codePoint));\n\t}\n\treturn getFont2D().canDisplay(codePoint);\n }", "public void checkLines() {\n int cont2 = 0;\n int cont3, cont4;\n int casillasVacias;\n int vInicial, vFinal;\n\n for(cont3=20; cont3>0; cont3--) {\n vInicial = cont3*12 + 1;\n vFinal = vInicial + 10;\n casillasVacias = 10;\n\n //Bucle para todas las casillas de una fila\n for(cont4=vInicial; cont4<vFinal; cont4++) {\n if(colMatrix[cont4]) casillasVacias--;\n }\n\n if(casillasVacias == 0) {\n completeLines[cont2] = cont3;\n cont2++;\n }\n }\n removeLines();\n }", "public static ArrayList<double[]> isBorder()\n {\n ArrayList<double[]> borders = new ArrayList<double[]>() ;\n // for all points\n for(int i=0; i<POINTS.length; i++)\n {\n // for all neighbouring points\n for(int k=i+1; k<POINTS.length; k++)\n {\n // System.out.println(\"Checking pair: \" + Arrays.toString(POINTS[i]) + \" \" + Arrays.toString(POINTS[k]));\n ArrayList<Double> sides = new ArrayList<Double>();\n // checking tmp vals\n for(int n=0; n<POINTS.length; n++) // O(n^3)\n {\n double[] test = POINTS[n];\n // find which side of line the test is on\n double d = side(POINTS[i], POINTS[k], POINTS[n]);\n // append to sides\n\n sides.add(d);\n //System\n }\n // check if sides for this pairing is same\n if (neg(sides) || pos(sides))\n {\n\n borders.add(POINTS[i]);\n borders.add(POINTS[k]);\n }\n }\n }\n /**double[] tmp = POINTS[i];\n double d = side(p1, p2, tmp);\n sides.add(d);\n //System.out.println(\"Printing sides array for pairing \" + p1[0] + \",\" + p1[1] + \" and \" + p2[0] + \",\" + p2[1] );\n if (neg(sides) || pos(sides))\n {\n System.out.println(\"p1 and p2 are borders\");\n borders.add(p1); borders.add(p2);\n }\n }\n for (int i=0; i<borders.size(); i++){\n System.out.println(Arrays.toString(borders.get(i)));\n }\n /**\n System.out.println(\"is all neg: \");\n System.out.println(neg(sides));\n System.out.println(\"is all pos: \");\n System.out.println(pos(sides));*/\n// return false;\n return borders;\n }", "public static boolean isBoomerang(int[][] points){\n if (points[0] == points[1] || points[0] == points[2] || points[1] == points[2]) return false;\n if ((points[0][0] - points[1][0])*(points[0][1] - points[2][1]) != (points[0][0] - points[2][0])*(points[0][1] - points[1][1])) return true;\n return false;\n }", "private boolean isLineInformationRepairNeeded(String text) {\n\t\t\tif (text == null)\n\t\t\t\treturn false;\n\n\t\t\tint length= text.length();\n\t\t\tif (length == 0)\n\t\t\t\treturn false;\n\n\t\t\tint rIndex= text.indexOf('\\r');\n\t\t\tint nIndex= text.indexOf('\\n');\n\t\t\tif (rIndex == -1 && nIndex == -1)\n\t\t\t\treturn false;\n\n\t\t\tif (rIndex > 0 && rIndex < length-1 && nIndex > 1 && rIndex < length-2)\n\t\t\t\treturn false;\n\n\t\t\tString defaultLD= null;\n\t\t\ttry {\n\t\t\t\tdefaultLD= getLineDelimiter(0);\n\t\t\t} catch (BadLocationException x) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (defaultLD == null)\n\t\t\t\treturn false;\n\n\t\t\tdefaultLD= getDefaultLineDelimiter();\n\n\t\t\tif (defaultLD.length() == 1) {\n\t\t\t\tif (rIndex != -1 && !\"\\r\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t\tif (nIndex != -1 && !\"\\n\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t} else if (defaultLD.length() == 2)\n\t\t\t\treturn rIndex == -1 || nIndex - rIndex != 1;\n\n\t\t\treturn false;\n\t\t}", "private boolean checkCachedRegions(ArrayList<int[]> list) {\n int lastend=Integer.MIN_VALUE;\n for (int[] loc:list) {\n if (loc[0]>loc[1]) return false; // this will probably not happen\n if (loc[0]<=lastend) return false; // next segment prior to end of last (or overlapping even 1 pos)\n lastend=loc[1];\n }\n return true;\n }", "@Test\n\tpublic void testGetOffsetsAgainstGeographiclibData() {\n\t\tfor(Point p: s_testPoints) {\n\t\t\tAssert.assertEquals(p.m, Geoid.getOffset(p.l), 0.015);\n\t\t}\n\t}", "public static String parseSlices(List<Slice> list) {\n Comparator<Cell> cellComparator = (Cell c1, Cell c2) -> {\n if (c1.x != c2.x) {\n return Integer.compare(c1.x, c2.x);\n } else\n return Integer.compare(c1.y, c2.y);\n };\n StringBuilder sb = new StringBuilder();\n Formatter textFormatter = new Formatter(sb);\n textFormatter.format(\"%d%n\", list.size());\n Cell min, max;\n for (Slice slice : list) {\n min = slice.cells.stream().min(cellComparator).get();\n max = slice.cells.stream().max(cellComparator).get();\n textFormatter.format(\"%d %d %d %d%n\", min.y, min.x, max.y, max.x);\n }\n textFormatter.close();\n return sb.toString().trim();\n }", "protected boolean isValidPDSFormat(String[] listing) {\n String[] aLine;\n for (int i=1; i<listing.length; i++) {\n aLine = splitMVSLine(listing[i]);\n if (aLine.length != 9) { // 9 because there are two fields for changed...\n log4j.error(BaseMessages.getString(PKG, \"MVSFileParser.ERROR.Invalid.PDS.Line\", listing[i])); //$NON-NLS-1$\n return false;\n }\n if (dateFormatString != null) {\n if (!checkDateFormat(aLine[3])) {\n return false;\n }\n } else {\n guessDateFormat(aLine[2]);\n }\n }\n return true;\n }", "private Boolean isValidMatrix(List<List<Double>> matrix) {\n\t\tInteger nrows = matrix.size();\n\n\t\tList<Integer> rowLengths = matrix.stream().map(List::size).toList();\n\t\tfloat ncols = (float) rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (ncols == nrows) && (nrows == 3);\n\t}", "private boolean isChoseFine(){\n if(freeSpaces.size()!=2 & freeSpaces.size()!=3){ //if the number of chosen spaces is not 3 or 2, that means it can't be good.\n return false;\n }\n else if(freeSpaces.size()==2){ //if there are 2.\n if(freeSpaces.elementAt(0).place.distance(freeSpaces.elementAt(1).place)==1)\n return true;\n else //if the distance between the spaces isn't 1, that means it can't be two suite spaces.\n return false;\n }\n else{ //if there are 3.\n //get the all 3 elements.\n int aX = freeSpaces.elementAt(0).place.x;\n int aY = freeSpaces.elementAt(0).place.y;\n int bX = freeSpaces.elementAt(1).place.x;\n int bY = freeSpaces.elementAt(1).place.y;\n int cX = freeSpaces.elementAt(2).place.x;\n int cY = freeSpaces.elementAt(2).place.y;\n if(aX==bX && bX==cX){ //if they are in the same column.\n int min = Math.min(aY, Math.min(bY, cY));\n int max = Math.max(aY, Math.max(bY, cY));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else if(aY==bY && bY==cY){ //if they are in the same row.\n int min = Math.min(aX, Math.min(bX, cX));\n int max = Math.max(aX, Math.max(bX, cX));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else //if they are in different rows and columns, so it isn't good.\n return false;\n }\n }", "public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\n\r\n for (int i=px-3;i<=px+3;i++){\r\n for(int j=py-3;j<=py+3;j++){\r\n if((i>=0) && (i<9) && (j>=0) && (j<9) && ((i!=px)||(j!=py))){\r\n if ((i==px)||(j==py)){\r\n pointList.add(pointCount, new Point(i,j));\r\n pointCount+=1;\r\n } \r\n }\r\n }\r\n }\r\n return pointList;\r\n }", "public static String getPostgisLineString(List<IPoint> points) {\n\t\tStringBuffer b = new StringBuffer();\r\n\t\tb.append(\"ST_GeometryFromText('LINESTRING(\"); //$NON-NLS-1$\r\n\r\n\t\t// the first polygon as outer one\r\n//\t\tb.append(\"(\"); //$NON-NLS-1$\r\n\t\tfor (Iterator<IPoint> iterator = points.iterator(); iterator\r\n\t\t\t\t.hasNext();) {\r\n\t\t\tIPoint point = iterator.next();\r\n\t\t\tb.append(point.getX());\r\n\t\t\tb.append(' ');\r\n\t\t\tb.append(point.getY());\r\n\t\t\tb.append(',');\r\n\t\t}\r\n\t\tIPoint point = points.get(0);\r\n\t\tb.append(point.getX());\r\n\t\tb.append(' ');\r\n\t\tb.append(point.getY());\r\n\t\t\r\n//\t\tb.append(\")\"); //$NON-NLS-1$\r\n\t\tb.append(\")',4326)\"); //$NON-NLS-1$\r\n\t\treturn b.toString();\r\n\t}", "public static boolean isLatLon() {\r\n String mapSetFolder;\r\n\r\n\r\n mapSetFolder = new String(getGrassMapsetFolder().substring(0, getGrassMapsetFolder().lastIndexOf(File.separator))\r\n + File.separator + \"PERMANENT/PROJ_UNITS\");\r\n\r\n try {\r\n final FileInputStream fstream = new FileInputStream(mapSetFolder);\r\n final DataInputStream in = new DataInputStream(fstream);\r\n final BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line;\r\n while ((line = br.readLine()) != null) {\r\n if (line.contains(\"degree\")) {\r\n in.close();\r\n return (true);\r\n }\r\n }\r\n in.close();\r\n }\r\n catch (final Exception e) {\r\n Sextante.addWarningToLog(\"GRASS Interface: could not determine coordinate system. Assuming X/Y(/Z) cartesian.\\n\");\r\n }\r\n return (false);\r\n }", "private boolean isVerticalLines2points(Point p1, Point p2) {\n if (abs(p1.x - p2.x ) < 70 && p1.y != p2.y ) {\n\n return true;\n }\n return false;\n }", "public static String buildPolygon(String controlPoints, String id, \n String name, String description, String lineColor, String fillColor, KmlOptions.AltitudeMode altitudeMode, \n SymbolModifiers attributes) {\n \n StringBuilder output = new StringBuilder(); \n String pointArrayStringList = \"\";\n \n try {\n \n // Get the points of the icons. For the polyarc we need only\n // one point, the pivot point, then the rest of the points for the \n // polygon. \n String[] latlons = controlPoints.split(\" \");\n if (latlons.length >= 2) {\n\n // Build the polyarc\n pointArrayStringList = XsltCoordinateWrapper.getPolygonKml(\n latlons, id, name, description, lineColor, fillColor, altitudeMode,\n attributes.X_ALTITUDE_DEPTH.get(0), \n attributes.X_ALTITUDE_DEPTH.get(1));\n } else {\n // throw illegal number of points exception\n throw new InvalidNumberOfPointsException();\n } \n } catch (Exception e) {\n pointArrayStringList = \"\"; \n }\n\n return pointArrayStringList;\n\n }", "static boolean esLista(String linea)\r\n\t\t\tthrows IllegalArgumentException\r\n\t{ \r\n\t// Verifica si la primera linea del archivo comienza con \" \" para saber si es una matriz\r\n\t// de adyacencia o una lista de adyacencia.\r\n if(linea.startsWith(\" \")){\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n\t}", "public boolean goodCoordinatesForm(String coord) {\n\t\tString[] parts = coord.split(\"-\");\r\n\t\ttry{\r\n\t\t\t //Where exception may happen\r\n\t\tchar letter1 = parts[0].charAt(0);\r\n\t\t\r\n\t\tif(( parts[0] != coord && isNumeric(parts[1])) && parts[0].equals(parts[0].toUpperCase()) && Character.isLetter(letter1) && parts[0].length() ==1 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse { \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t}\r\n\r\n\t\tcatch(java.lang.ArrayIndexOutOfBoundsException e){\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\tcatch (java.lang.StringIndexOutOfBoundsException s) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void highlightTransportLine(AnchorPane anchor_pane_map, ArrayList<Street> streets_list, ArrayList<Line> all_streets_lines)\r\n {\r\n Line line1 = null;\r\n for (Street s : streets_list) {\r\n if (this.getStreetsMap().get(0).equals(s)) // highlight first street of line\r\n {\r\n int begin_stop_x = this.getStopsMap().get(0).getCoordinate().getX();\r\n int begin_stop_y = this.getStopsMap().get(0).getCoordinate().getY();\r\n\r\n Coordinate begin_street_1 = s.getCoordinates().get(0);\r\n Coordinate begin_street_2 = s.getCoordinates().get(2);\r\n\r\n Coordinate second_street_1 = this.getStreetsMap().get(1).getCoordinates().get(0);\r\n Coordinate second_street_2 = this.getStreetsMap().get(1).getCoordinates().get(2);\r\n\r\n if ((begin_street_1.getX() == second_street_1.getX() && begin_street_1.getY() == second_street_1.getY()) || (begin_street_1.getX() == second_street_2.getX() && begin_street_1.getY() == second_street_2.getY())) {\r\n line1 = new Line(begin_stop_x, begin_stop_y, begin_street_1.getX(), begin_street_1.getY());\r\n line1.setStroke(this.getTransportLineColor());\r\n line1.setStrokeWidth(5);\r\n anchor_pane_map.getChildren().addAll(line1);\r\n } else if ((begin_street_2.getX() == second_street_1.getX() && begin_street_2.getY() == second_street_1.getY()) || (begin_street_2.getX() == second_street_2.getX() && begin_street_2.getY() == second_street_2.getY())) {\r\n line1 = new Line(begin_stop_x, begin_stop_y, begin_street_2.getX(), begin_street_2.getY());\r\n line1.setStroke(this.getTransportLineColor());\r\n line1.setStrokeWidth(5);\r\n anchor_pane_map.getChildren().addAll(line1);\r\n }\r\n } else if (this.getStreetsMap().get(this.getStreetsMap().size() - 1).equals(s)) // end street of line\r\n {\r\n int end_stop_x = this.getStopsMap().get(this.getStopsMap().size() - 1).getCoordinate().getX();\r\n int end_stop_y = this.getStopsMap().get(this.getStopsMap().size() - 1).getCoordinate().getY();\r\n\r\n Coordinate end_street_1 = s.getCoordinates().get(0);\r\n Coordinate end_street_2 = s.getCoordinates().get(2);\r\n\r\n Coordinate nexttolast_street_1 = this.getStreetsMap().get(this.getStreetsMap().size() - 2).getCoordinates().get(0);\r\n Coordinate nexttolast_street_2 = this.getStreetsMap().get(this.getStreetsMap().size() - 2).getCoordinates().get(2);\r\n\r\n if ((end_street_1.getX() == nexttolast_street_1.getX() && end_street_1.getY() == nexttolast_street_1.getY()) || (end_street_1.getX() == nexttolast_street_2.getX() && end_street_1.getY() == nexttolast_street_2.getY())) {\r\n line1 = new Line(end_stop_x, end_stop_y, end_street_1.getX(), end_street_1.getY());\r\n line1.setStroke(this.getTransportLineColor());\r\n line1.setStrokeWidth(5);\r\n anchor_pane_map.getChildren().addAll(line1);\r\n } else if ((end_street_2.getX() == nexttolast_street_1.getX() && end_street_2.getY() == nexttolast_street_1.getY()) || (end_street_2.getX() == nexttolast_street_2.getX() && end_street_2.getY() == nexttolast_street_2.getY())) {\r\n line1 = new Line(end_stop_x, end_stop_y, end_street_2.getX(), end_street_2.getY());\r\n line1.setStroke(this.getTransportLineColor());\r\n line1.setStrokeWidth(5);\r\n anchor_pane_map.getChildren().addAll(line1);\r\n }\r\n } else if (this.getStreetsMap().contains(s)) { // highlight whole street from line\r\n s.highlightStreet(anchor_pane_map, all_streets_lines, this.getTransportLineColor());\r\n }\r\n }\r\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public boolean isPointInLine(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "private static boolean m52091F(C32065l c32065l) {\n AppMethodBeat.m2504i(95713);\n int i = c32065l.position;\n int i2 = c32065l.limit;\n byte[] bArr = c32065l.data;\n if (i + 2 <= i2) {\n int i3 = i + 1;\n if (bArr[i] == (byte) 47) {\n int i4 = i3 + 1;\n if (bArr[i3] == (byte) 42) {\n while (i4 + 1 < i2) {\n i = i4 + 1;\n if (((char) bArr[i4]) == '*' && ((char) bArr[i]) == IOUtils.DIR_SEPARATOR_UNIX) {\n i++;\n i2 = i;\n i4 = i;\n } else {\n i4 = i;\n }\n }\n c32065l.mo52369eM(i2 - c32065l.position);\n AppMethodBeat.m2505o(95713);\n return true;\n }\n }\n }\n AppMethodBeat.m2505o(95713);\n return false;\n }", "public static String getPostgisMultiLineString(List<IPoint> points) {\n\t\tStringBuffer b = new StringBuffer();\r\n\t\tb.append(\"ST_GeometryFromText('MULTILINESTRING((\"); //$NON-NLS-1$\r\n\r\n\t\t// the first polygon as outer one\r\n//\t\tb.append(\"(\"); //$NON-NLS-1$\r\n\t\tfor (Iterator<IPoint> iterator = points.iterator(); iterator\r\n\t\t\t\t.hasNext();) {\r\n\t\t\tIPoint point = iterator.next();\r\n\t\t\tb.append(point.getX());\r\n\t\t\tb.append(' ');\r\n\t\t\tb.append(point.getY());\r\n\t\t\tb.append(',');\r\n\t\t}\r\n\t\tIPoint point = points.get(0);\r\n\t\tb.append(point.getX());\r\n\t\tb.append(' ');\r\n\t\tb.append(point.getY());\r\n\t\t\r\n//\t\tb.append(\")\"); //$NON-NLS-1$\r\n\t\tb.append(\"))',4326)\"); //$NON-NLS-1$\r\n\t\treturn b.toString();\r\n\t}", "private boolean checkFile(Object[] fileObject) {\n for (Object lineObject : fileObject) {\n if (lineObject.toString().split(\",\").length != 11 || lineObject.toString().contains(\"%\")) {\n System.out.println(\"Check File Error on line: \" + lineObject.toString());\n return false;\n }\n }\n return true;\n }", "private static int detectarVertices(String linea)\r\n\t\t\tthrows IllegalArgumentException\r\n\t{\r\n linea = linea.substring(3); // Elimina los espacios innecesarios\r\n String[] lista = linea.split(\" \");\r\n \r\n return lista.length;\r\n\t}", "boolean hasIndispensableYn();", "boolean hasIndispensableYn();", "private static boolean m4389a(String str) {\n return str != null && str.length() != 0 && Pattern.compile(\"^[0-9A-Fa-f]{13,18}+$\").matcher(str).matches() && str.indexOf(\"000000000\") == -1 && str.indexOf(\"111111111\") == -1 && str.indexOf(\"222222222\") == -1 && str.indexOf(\"333333333\") == -1 && str.indexOf(\"444444444\") == -1 && str.indexOf(\"555555555\") == -1 && str.indexOf(\"666666666\") == -1 && str.indexOf(\"777777777\") == -1 && str.indexOf(\"888888888\") == -1 && str.indexOf(\"999999999\") == -1;\n }", "public void drawPolyLineOnMap(List<LatLng> list) {\n PolylineOptions polyOptions = new PolylineOptions();\n polyOptions.color(Color.RED);\n polyOptions.width(5);\n polyOptions.addAll(list);\n\n mMap.clear();\n mMap.addPolyline(polyOptions);\n\n LatLngBounds.Builder builder = new LatLngBounds.Builder();\n for (LatLng latLng : list) {\n builder.include(latLng);\n }\n\n //final LatLngBounds bounds = builder.build();\n\n //BOUND_PADDING is an int to specify padding of bound.. try 100.\n //CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, BOUND_PADDING);\n //mMap.animateCamera(cu);\n }", "public static void main (String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st;\n StringBuilder sb = new StringBuilder();\n\n int n=Integer.parseInt(br.readLine());\n st=new StringTokenizer(br.readLine());\n int x0=Integer.parseInt(st.nextToken()),\n y0=Integer.parseInt(st.nextToken());\n ArrayList<Map.Entry<Integer,Character>> ulist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> dlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> llist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> rlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> ullist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> urlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> drlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> dllist=new ArrayList<>();\n Comparator asct=new Comparator<Map.Entry<Integer, Character>>() {\n @Override\n public int compare(Map.Entry<Integer, Character> e1, Map.Entry<Integer, Character> e2) {\n return e1.getKey() - e2.getKey();\n }\n };\n Comparator dsct=new Comparator<Map.Entry<Integer, Character>>() {\n @Override\n public int compare(Map.Entry<Integer, Character> e1, Map.Entry<Integer, Character> e2) {\n return e2.getKey() - e1.getKey();\n }\n };\n for (int i=0;i<n;i++){\n st=new StringTokenizer(br.readLine());\n char c=st.nextToken().charAt(0);\n int xi=Integer.parseInt(st.nextToken());\n int yi=Integer.parseInt(st.nextToken());\n if (xi==x0){\n if (yi>y0) ulist.add(new AbstractMap.SimpleEntry<>(yi,c));\n else dlist.add(new AbstractMap.SimpleEntry<>(yi,c));\n } else if (yi==y0){\n if (xi>x0) rlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else llist.add(new AbstractMap.SimpleEntry<>(xi,c));\n } else if (Math.abs(xi-x0)==Math.abs(yi-y0)){\n if (xi<x0){\n if (yi<y0) dllist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else ullist.add(new AbstractMap.SimpleEntry<>(xi,c));\n } else {\n if (yi<y0) drlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else urlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n }\n }\n }\n Collections.sort(ulist,asct);\n Collections.sort(dlist,dsct);\n Collections.sort(rlist,asct);\n Collections.sort(llist,dsct);\n Collections.sort(dllist,dsct);\n Collections.sort(ullist,dsct);\n Collections.sort(urlist,asct);\n Collections.sort(drlist,asct);\n //boolean uf,df,lf,rf,ulf,urf,drf,dlf;\n //uf=df=lf=rf=ulf=urf=drf=dlf=false;\n boolean check=false;\n for (int i=0;i<ulist.size();i++){\n char c=ulist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<dlist.size();i++){\n char c=dlist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<llist.size();i++){\n char c=llist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<rlist.size();i++){\n char c=rlist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<dllist.size();i++){\n char c=dllist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<ullist.size();i++){\n char c=ullist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<drlist.size();i++){\n char c=drlist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<urlist.size();i++){\n char c=urlist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n if (check) System.out.println(\"YES\");\n else System.out.println(\"NO\");\n }", "private static boolean m52090E(C32065l c32065l) {\n AppMethodBeat.m2504i(95712);\n switch ((char) c32065l.data[c32065l.position]) {\n case 9:\n case 10:\n case 12:\n case 13:\n case ' ':\n c32065l.mo52369eM(1);\n AppMethodBeat.m2505o(95712);\n return true;\n default:\n AppMethodBeat.m2505o(95712);\n return false;\n }\n }", "public static void main(String[] args) {\n\t\tStdDraw.setXscale(0, 32768);\n\t\tStdDraw.setYscale(0, 32768);\n\t\tStdDraw.show(0);\n\t\tStdDraw.setPenRadius(0.005); // make the points a bit larger\n\n\t\t// read in the input\n\t\tString filename = args[0];\n\t\tIn in = new In(filename);\n\t\tint N = in.readInt();\n\t\tPoint[] pList = new Point[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint x = in.readInt();\n\t\t\tint y = in.readInt();\n\t\t\tPoint p = new Point(x, y);\n\t\t\tp.draw();\n\t\t\tpList[i] = p;\n\t\t}\n\n\t\tArrays.sort(pList);\n\t\t// create an auxiliary array for sorting points by slope\n\t\tPoint[] aux = new Point[N];\n\t\tfor (int i = 0; i < N - 3; i++) {\n\n\t\t\tfor (int j = i; j < N; j++) {\n\t\t\t\taux[j] = pList[j];\n\t\t\t}\n\n\t\t\t// sort points other than i by slope\n\t\t\tArrays.sort(aux, i + 1, N, aux[i].SLOPE_ORDER);\n\t\t\tint countSameSlope = 1;\n\t\t\tString result = aux[i] + \" -> \";\n\t\t\tfor (int k = i + 1; k < N - 1; k++) {\n\n\t\t\t\tif (Double.compare(aux[i].slopeTo(aux[k]),\n\t\t\t\t\t\taux[i].slopeTo(aux[k + 1])) == 0) {\n\t\t\t\t\tresult += aux[k] + \" -> \";\n\t\t\t\t\tcountSameSlope++;\n\t\t\t\t} else if (countSameSlope >= 3) {\n\t\t\t\t\tresult += aux[k];\n\t\t\t\t\tStdOut.println(result);\n\t\t\t\t\taux[i].drawTo(aux[k]);\n\t\t\t\t\tresult = aux[i] + \" -> \";\n\t\t\t\t\tcountSameSlope = 1;\n\t\t\t\t} else {\n\t\t\t\t\tresult = aux[i] + \" -> \";\n\t\t\t\t\tcountSameSlope = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// handle the case in which the last 3 or more points are collinear\n\t\t\t// with point i\n\t\t\tif (countSameSlope >= 3) {\n\t\t\t\tresult += aux[N - 1];\n\t\t\t\tStdOut.println(result);\n\t\t\t\taux[i].drawTo(aux[N - 1]);\n\t\t\t}\n\n\t\t}\n\n\t\t// display to screen all at once\n\t\tStdDraw.show(0);\n\t}", "@Test\n public void test() {\n char[][] map = new char[][] {\n new char[]{ '1', '1', '1', '1', '0' },\n new char[]{ '1', '1', '0', '1', '0' },\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '0', '0', '0', '0', '0' },\n };\n assertThat(numIslands(map), equalTo(1));\n\n //11000\n //11000\n //00100\n //00011\n char[][] map2 = new char[][] {\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '0', '0', '1', '0', '0' },\n new char[]{ '0', '0', '0', '1', '1' },\n };\n assertThat(numIslands(map2), equalTo(3));\n }", "private boolean isValidPos(List<Integer> sol) {\n int row = sol.size() - 1;\n int col = sol.get(row);\n \n for (int i = 0; i < row; i++) {\n // we are sure that there will be no conflict in the same row\n // check vertical line, and diagonal line\n if (col == sol.get(i) || Math.abs(col - sol.get(i)) == row - i) {\n return false;\n }\n }\n return true;\n }", "@Override\r\n\tpublic boolean checkQuizAnswer(String points) {\n\t\tint score = Integer.parseInt(points);\r\n\t\tif(score >80) \r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\t\treturn false;\r\n\t}", "private void checkPointLon(){\n double glon = Double.parseDouble(point_lon);\n if(glon > 180.0){\n double glon360 = glon % 360.0;\n //west\n if(glon360 > 180.0){\n point_lon = Double.toString(glon360-360.0);\n //System.out.println(point_lon);\n //east\n }else{\n point_lon = Double.toString(glon360);\n //System.out.println(point_lon);\n }\n }\n if(glon < -180.0){\n double glon360 = glon % 360.0;\n //east\n if(glon360 < -180.0){\n point_lon = Double.toString(glon360+360.0);\n //west\n }else{\n point_lon = Double.toString(glon360);\n }\n }\n }", "boolean testCoords(Tester t) {\n return t.checkExpect(this.p3.xCoord(), 50) && t.checkExpect(this.p4.yCoord(), 600);\n }", "public boolean isValid (int x, int y)\n {\n\tif ((x < 1 || x > 3) || (y < 1 || y > 3))\n\t return false;\n\telse if (x == 1 && y == 1 && a != ' ')\n\t return false;\n\telse if (x == 2 && y == 1 && b != ' ')\n\t return false;\n\telse if (x == 3 && y == 1 && c != ' ')\n\t return false;\n\telse if (x == 1 && y == 2 && d != ' ')\n\t return false;\n\telse if (x == 2 && y == 2 && e != ' ')\n\t return false;\n\telse if (x == 3 && y == 2 && f != ' ')\n\t return false;\n\telse if (x == 1 && y == 3 && g != ' ')\n\t return false;\n\telse if (x == 2 && y == 3 && h != ' ')\n\t return false;\n\telse if (x == 3 && y == 3 && i != ' ')\n\t return false;\n\telse\n\t return true;\n }", "@Test\n\tpublic void threePieceWhiteCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(29,80);\n\t\td.set(9,79);\n\t\td.set(33,82);\n\t\td.set(12,94);\n\t\td.set(32,114);\n\t\td.set(32,70);\n\t\td.set(12,92);\n\t\td.set(10,83);\n\t\td.set(12,81);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(81);\n\t\tassertTrue(3==test_arr.get(0).getX() && 6==test_arr.get(0).getY()\n\t\t\t&& 4==test_arr.get(1).getX() && 7==test_arr.get(1).getY()\n\t\t\t&& 2==test_arr.get(2).getX() && 7==test_arr.get(2).getY());\n\t}", "public abstract boolean passes(String line);", "boolean inputValid(String s) {\n\n if (s.length() == 0) {\n return false;\n }\n\n //check whether there are wrong commas\n for (int ii = 1; ii < s.length() - 1; ii++) {\n if (s.charAt(ii) == ',') {\n if(!s.contains(\"log\")) {\n resS = \"There are wrong commas\";\n return false;\n }\n }\n }\n\n //check whether there are multiple points\n if(s.charAt(0)=='.' || s.charAt(s.length()-1)=='.') return false;\n for (int ii = 1; ii < s.length() - 1; ii++) {\n if (s.charAt(ii) == '.') {\n if (!Character.isDigit(s.charAt(ii - 1))) {\n resS=\"These are wrong points.\";\n return false;\n } else if (!Character.isDigit(s.charAt(ii + 1))) {\n resS=\"These are wrong points.\";\n return false;\n } else {\n for (int jj = ii + 2; jj < s.length(); jj++) {\n if (s.charAt(jj) == '.') {\n String ss = s.substring(ii + 2, jj);\n if (!(ss.contains(\"+\") || ss.contains(\"-\") || ss.contains(\"*\") || ss.contains(\"/\") || ss.contains(\"%\")\n || ss.contains(\"^\") || ss.contains(\")\"))) {\n resS=\"These are wrong points.\";\n return false;\n }\n }\n }\n }\n }\n }\n ArrayList<Token> operation = tokenize(s);\n return isNumberOrOpe(operation) && isOpePosRight(operation) && isValidparentheses(operation) && isValidTan(operation) && isLogWrong(operation);\n }", "public static boolean isValidBedGraphLine(String line){\n\t\tString[] bdg= line.split(\"\\t\");\n\t\tif(bdg.length < 4){\n\t\t\treturn false;\n\t\t}\n\t\ttry{\n\t\t\tInteger.parseInt(bdg[1]);\n\t\t\tInteger.parseInt(bdg[2]);\n\t\t} catch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean areThreeOrMorePossible(final Field[] line) {\n\t\t// Empty means interested generally\n\t\treturn this.areThreeOrMorePossible(line, Symbol.EMPTY);\n\t}", "boolean hasLatLng();", "static boolean LinesParallel(PT a, PT b, PT c, PT d) {\r\n\t\treturn Math.abs(cross(b.subtract(a), c.subtract(d))) < EPS;\r\n\t}", "private boolean check(int[] bestPoint) {\n\t\tif (bestPoint[0] > Mirror.spec || bestPoint[1] > Mirror.spec || bestPoint[0] < width - Mirror.spec\n\t\t\t\t|| bestPoint[1] < width - Mirror.spec) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}" ]
[ "0.59068346", "0.5874666", "0.5874264", "0.58077246", "0.5805947", "0.57047427", "0.5688051", "0.5651252", "0.56454355", "0.5586125", "0.55731535", "0.5326418", "0.5309816", "0.5305079", "0.5252677", "0.5197324", "0.5168891", "0.5166453", "0.5159631", "0.5129536", "0.5127706", "0.51237816", "0.5122004", "0.51167077", "0.5092088", "0.50811774", "0.5075355", "0.5068315", "0.50498056", "0.50349593", "0.502736", "0.502736", "0.502736", "0.50199693", "0.49949348", "0.4992742", "0.4986191", "0.4981778", "0.49763575", "0.4975594", "0.49745992", "0.49678293", "0.4966552", "0.4951913", "0.4948104", "0.4943696", "0.49325827", "0.49204051", "0.4915052", "0.48958358", "0.48948547", "0.4891778", "0.4888145", "0.48747358", "0.48661333", "0.48531973", "0.48453796", "0.484484", "0.48412573", "0.4838028", "0.48346508", "0.483079", "0.48271596", "0.4824251", "0.4819491", "0.48183826", "0.4815249", "0.4809498", "0.48020595", "0.48019096", "0.4801155", "0.479841", "0.4794279", "0.4792657", "0.4791725", "0.47880766", "0.47871986", "0.47867823", "0.47860938", "0.478539", "0.478539", "0.47829142", "0.4778835", "0.47784522", "0.47769478", "0.4772377", "0.4769527", "0.476614", "0.47656527", "0.47493532", "0.47375837", "0.4736975", "0.47359183", "0.47257444", "0.47191033", "0.4710276", "0.4705572", "0.4698873", "0.46961027", "0.4693837" ]
0.72095865
0
Clips the smear polygon against its FA area AND adjacent area if the points on the polygon cannot be represented on three 65character lines of text. Each clipped part with an area > 3K square nautical miles will produce a new smear. The input is assumed to be in MAP coordinate. Note: 1. If a smear has ONLY one FA area, no clipping will be done, and the original smear is returned. 2. If a smear belongs two FA areas (a few little kinks less than 3K along the boundary could add up to an area > 3K), but these two FA areas do not belong to the same FA region, do not do area clipping.
private ArrayList<Gfa> faAreaClip( Gfa smear, ArrayList<Gfa> snapshots ) { ArrayList<Gfa> newSmears = new ArrayList<Gfa>(); //If smear can be formatted, return. if ( canBeFormatted( smear ) ) { newSmears.add( smear ); return newSmears; } /* * If the smear resides only in one FA area or two areas belong to different * FA regions, no need to clip. */ String faAreas = smear.getGfaArea(); if ( !faAreas.contains( "-" ) || !isSameFaRegion( faAreas ) ) { newSmears.add( smear ); return newSmears; } // Retrieve extended FA area bounds HashMap<String, Geometry> xareaBnds = GfaClip.getInstance().getFaAreaXBoundsInGrid(); /* * Find the intersection points with the extended FA area bounds and snap them. */ Polygon smearPoly = GfaClip.getInstance().gfaToPolygon( smear ); Polygon smearPolyInGrid = GfaClip.getInstance().gfaToPolygonInGrid( smear ); HashMap<Coordinate, Coordinate> areaInterPts = getAreaIntersectionPt( smearPoly ); /* * Do area clipping. The strategy is the same as regional clipping. * * 1. clip the smear polygon against each FA region (WEST, CENTRAL, EAST) * 2. create a list of parts bigger than/equal to 3K for each region * 3. hold the parts smaller than 3K for all regions in another list. */ HashMap<String, ArrayList<Geometry> > clipWithAreas = new HashMap<String, ArrayList<Geometry> >(); ArrayList<Geometry> smallPoly = new ArrayList<Geometry>(); for ( String areaName : xareaBnds.keySet() ) { if ( !faAreas.contains( areaName ) ) continue; clipWithAreas.put( areaName, new ArrayList<Geometry>() ); //Do area clipping as described above. Geometry areaBnd = xareaBnds.get( areaName ); if ( areaBnd.intersects( smearPolyInGrid ) ) { Geometry areaPoly = areaBnd.intersection( smearPolyInGrid ); if ( areaPoly != null ) { for ( int kk = 0; kk < areaPoly.getNumGeometries(); kk++ ) { Geometry bigPoly = areaPoly.getGeometryN( kk ); if ( GfaClip.getInstance().isBiggerInGrid( bigPoly ) ) { clipWithAreas.get( areaName ).add( bigPoly ); } else { smallPoly.add( bigPoly ); } } } } } /* * Create smears from VALID parts and add into the return list * * 1. Union the parts in each FA region with the list of small parts - * If a small part touches one of the bigs (only one, I believe), it * will be united into that big and thus be included into a new * smear. So no part gets lost and all will be included eventually. * 2. When a small part is united into a big one (if they intersect), * the common points are still retained in the result, we need to * remove those extra point. The common points are resulted from the * previous clipping with the area boundaries. * 3. check the resulting union for VALID geometries and create new * smears for each of them. */ for ( String areaName : clipWithAreas.keySet() ) { ArrayList<Geometry> bigs = clipWithAreas.get( areaName ); ArrayList<Geometry> toBeUnioned = new ArrayList<Geometry>(); toBeUnioned.addAll( bigs ); toBeUnioned.addAll( smallPoly ); Geometry result = GfaClip.getInstance().quickUnion( toBeUnioned ); ArrayList<Coordinate> commPts = GfaClip.getInstance().getCommonPoints( bigs, smallPoly ); if ( result != null ) { for ( int kk = 0; kk < result.getNumGeometries(); kk++ ) { Geometry one = result.getGeometryN( kk ); //Remove residue points by clipping followed by subsequent union. Geometry onePart = GfaClip.getInstance().removeCommonPoints( one, commPts ); //Clean up some improper cases Coordinate[] gPts = PgenUtil.gridToLatlon( onePart.getCoordinates() ); ArrayList<Coordinate> points = new ArrayList<Coordinate>(); for ( Coordinate c : gPts ) { points.add( c ); } points.remove( points.size() - 1 ); //Geometry cleanPts = GfaClip.getInstance().cleanupPoints( onePart ); Geometry cleanPts = GfaClip.getInstance().cleanupPoints( GfaClip.getInstance().pointsToGeometry( points ) ); if ( GfaClip.getInstance().isAddableAsSmear( cleanPts, snapshots, smear ) ) { //Replace intersection points with their pre-snapped pair. Geometry rplPts = GfaClip.getInstance().replacePts( cleanPts, areaInterPts ); //Create a new GFA smear. cleanPts = GfaClip.getInstance().cleanupPoints( rplPts ); Gfa newElm = GfaClip.getInstance().geometryToGfa( smear, cleanPts ); newElm.setGfaArea( areaName ); newSmears.add( newElm ); } } } } for ( Gfa gg : newSmears ) { boolean[] reduFlg = new boolean[ gg.getPoints().size() ]; int ii = 0; for ( Coordinate newPt : gg.getPoints() ) { reduFlg[ ii ] = false; for ( int jj = 0; jj < smear.getPoints().size(); jj++ ) { if ( GfaSnap.getInstance().isSamePoint( newPt, smear.getPoints().get( jj ), GfaSnap.MAP_PRECISION ) ) { reduFlg[ ii ] = smear.getReduceFlags()[ jj ]; break; } } ii++; } gg.setReduceFlags( reduFlg ); } return newSmears; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clipFeatureUsing(final SimpleFeature featureToClip,\n final CoordinateReferenceSystem featureToClipCrs,\n final Geometry clippingGeometryOnMap,\n final CoordinateReferenceSystem mapCrs) \n throws SOProcessException {\n\n try {\n Geometry featureGeometryToClip = (Geometry) featureToClip.getDefaultGeometry();\n\n // iterate in the feature's geometries to clip and applies the delete, split or difference operation\n // using the clipping geometry\n int resultGeomSize = featureGeometryToClip.getNumGeometries();\n List<Geometry> resultClipGeom = new ArrayList<Geometry>(resultGeomSize);\n \n for( int i = 0; i < featureGeometryToClip.getNumGeometries(); i++ ) {\n \n Geometry simpleGeomToClip = featureGeometryToClip.getGeometryN(i);\n\n Geometry featureGeometryOnMapCrs = GeoToolsUtils.reproject(simpleGeomToClip,\n featureToClipCrs, \n mapCrs);\n // Analyses the geometry's positon\n if (clippingGeometryOnMap.contains(featureGeometryOnMapCrs)) {\n \n continue; // it will be deleted from target (if \"to clip layer\" is equal to target layer) \n // or does not add this geometry to result\n\n } else if (splits(clippingGeometryOnMap, featureGeometryOnMapCrs)) {\n\n Geometry splitGeom = computeGeometrySplit(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(splitGeom);\n\n } else if (clippingGeometryOnMap.intersects(featureGeometryOnMapCrs)) {\n\n Geometry diffGeom = computeGeometryDifference(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(diffGeom);\n }\n }\n //postcondition: {resultClipGeom is a Collection with Geometries modified with difference, deleted and splited geom (new geom) }\n GeometryFactory factory = featureGeometryToClip.getFactory();\n \n GeometryCollection resultCollection = factory.createGeometryCollection(resultClipGeom.toArray(new Geometry[]{}));\n\n updateTargetWith(featureToClip, resultCollection);\n \n } catch (Exception e) {\n LOGGER.severe(e.getMessage());\n throw new SOProcessException(Messages.ClipProcess_failed_executing_reproject);\n }\n\n }", "private Area shrinkArea(Area area, int amount) {\n\t\tint i = amount;\n\t\ttmpArea4 = (Area) area.clone();\n\t\tdo {\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, 1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, 1, -1);\n\t\t\ttmpArea4 = shrinkArea(tmpArea4, i, -1, 1);\n\t\t} while (i-- >= 0 && !tmpArea4.isEmpty());\n\t\tif (!tmpArea4.isEmpty()\n\t\t\t\t&& tmpArea4.getBounds().width > INTERACT_SIZE_MIN\n\t\t\t\t&& tmpArea4.getBounds().height > INTERACT_SIZE_MIN)\n\t\t\tarea = tmpArea4;\n\t\tarea.intersect(gameArea);\n\t\treturn area;\n\t}", "private void clipChangedFeatureUsing(SimpleFeature featureToClip, \n CoordinateReferenceSystem featureToClipCrs, \n Geometry clippingGeometryOnMap, \n CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n String fid = featureToClip.getID();\n FeatureTransaction tx = this.transactionTrack.get(fid);\n \n assert tx != null;\n \n switch( tx.getType() ) {\n case DELETE :\n // does not process\n break;\n case SPLIT :\n // precesses the fragments\n List<String> fidList = tx.getListInsertedFeatures();\n\n FeatureCollection<SimpleFeatureType, SimpleFeature> fragmentCollection = findFeatures(this.targetStore, fidList);\n \n FeatureIterator<SimpleFeature> fragmentIterator = null;\n try{\n fragmentIterator = fragmentCollection.features();\n \n while( fragmentIterator.hasNext() ) {\n\n SimpleFeature fragment = fragmentIterator.next();\n\n clipFeatureUsing( fragment, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n }\n } finally {\n if (fragmentIterator != null)\n fragmentCollection.close(fragmentIterator);\n }\n \n break;\n case UPDATE :\n // the feature require more changes\n \n // retrieves the changed feature and applies it the clip \n fid = tx.getUpdatedFeature();\n \n SimpleFeature updatedFeature = findFeature(this.targetStore, fid);\n \n clipFeatureUsing( updatedFeature, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n break;\n\n default:\n assert false; // impossible case\n }\n \n \n }", "private final Geometry computeGeometryDifference( \n Geometry featureGeometryOnMap, \n Geometry clippingGeometryOnMap,\n CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n\n // assert: clipping does not contains featrue's geometry but intersect\n FeatureStore<SimpleFeatureType, SimpleFeature> store = getTargetStore();\n \n final SimpleFeatureType featureType = store.getSchema();\n final CoordinateReferenceSystem targetLayerCrs = featureType.getDefaultGeometry()\n .getCRS();\n Geometry resultGeometry = null;\n try {\n \n if (!featureGeometryOnMap.contains(clippingGeometryOnMap)) {\n\n // clipping does not contain the feature and features does not contain clipping area\n // then constructs the following difference: feature'geometry - clipping area\n\n Geometry diffGeometry = featureGeometryOnMap.difference(clippingGeometryOnMap);\n\n Geometry adjustedGeom = GeoToolsUtils.reproject(diffGeometry, mapCrs, targetLayerCrs);\n \n resultGeometry = adjustedGeom;\n } else {\n // Note: if the condition is false, feature's geometry could contain clipping\n // then feature with hole is required. This process does not produce hole geometry.\n resultGeometry = featureGeometryOnMap;\n }\n return resultGeometry;\n\n } catch (OperationNotFoundException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_executing_reproject,\n mapCrs.getName(), targetLayerCrs.getName());\n \n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n\n } catch (TransformException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_transforming,\n mapCrs.getName(), targetLayerCrs.getName());\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n\n }", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "public ArrayList<Gfa> reducePoints( Gfa smear, ArrayList<Gfa> snapshots ) {\n\t\t\t\t\n\t\tArrayList<Gfa> glist = new ArrayList<Gfa>();\n \n\t\t/*\n\t\t * Step 1 - reduce points on the whole smear polygon. Note that freezing level \n\t\t * contours are point reduced in af_fzlvl2fmt().\n\t\t */ \t\t\n\t\tGfa tSmear = regularPointReduction( smear );\n\t\t\n\t\t/*\n\t\t * Create a smear with the reduced points and return if the smear can be \n\t\t * formatted into 3-line text now.\n\t\t */\n\t\tif ( canBeFormatted( tSmear ) ) {\n\t\t smear.setPointsOnly( tSmear.getPoints() );\n\t\t smear.setReduceFlags( tSmear.getReduceFlags() );\n\t\t glist.add( smear );\n\t\t return glist;\n\t\t}\n \t\t\t\t\t\n\t\t/*\n\t\t * Step 2 - Do area clipping to split up the ORIGINAL smear \n\t\t * \t\t\talong area boundary, if needed.\n\t\t */\n\t\tArrayList<Gfa> listOfAreaClip = new ArrayList<Gfa>();\n\t\tlistOfAreaClip.addAll( faAreaClip( smear, snapshots ) );\n\t\t\n\t\t// Step 3 - Do first round of bisection, if necessary. \t\t\n\t\tArrayList<Gfa> listOfFirstBisect = new ArrayList<Gfa>();\t\t\n\t\tfor ( Gfa gg : listOfAreaClip ) {\t\t \t\t\t\n\t\t\t\n\t\t\t//First do point reduction on each of the clipped smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\n \t\tgg.setPointsOnly( tmpSmear.getPoints() );\n \t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n if ( canBeFormatted( tmpSmear ) ) {\n glist.add( gg ); \t\n }\n else {\n listOfFirstBisect.addAll( bisect( gg, true ) );\n }\n\t\t}\n\t\t\n\t\t//See if any middle point are generated in bisection.\n\t\tCoordinate midPt = null;\n\t\tif ( listOfFirstBisect.size() > 0 ) {\n\t\t midPt = (Coordinate)listOfFirstBisect.get(0).getAttribute( BISECT_MIDDLE_POINT );\n\t\t}\n\t\t\n\t\t// Step 4 - Do second round of bisection, if necessary. \n\t\tfor ( Gfa gg : listOfFirstBisect ) {\t\t \n\t\t\t\n\t\t\t//First do point reduction on each of the bisected smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\t\t\t\t\t\t\n\t\t\tgg.setPointsOnly( tmpSmear.getPoints() );\n\t\t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n\t\t\tif ( canBeFormatted( tmpSmear ) ) {\n\t\t\t\tglist.add( gg ); \n\t\t\t}\n\t\t\telse { \n\t\t\t\t//Another round of bisect, done.\n\t\t\t\tglist.addAll( bisect( gg, false) );\n\t\t\t}\n\t\t}\t\t\n\n\t\t\n\t\t//\n\t\t// If bisection happens, check if the middle point generated in the first round\n\t\t// has been used for the second round. If not, remove the middle point from \n\t\t// all smears.\n\t\t//\n\t\tboolean removeMidPt = false;\n\t\tif ( midPt != null ) {\n\t\t\tint ii = 0;\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tii++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ii < 3 ) {\n\t\t\t\tremoveMidPt = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( removeMidPt ) {\n\t\t\t\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tCoordinate removePt = null;\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tremovePt = cc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( removePt != null ) gg.getPoints().remove( removePt ) ;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn glist;\n\n\t}", "private final void clipFeatureCollectionUsingClippingFeature( \n final FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollectionToClip,\n final CoordinateReferenceSystem featureToClipCrs, \n final SimpleFeature clippingFeature,\n final CoordinateReferenceSystem clippingCrs, \n final CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n FeatureIterator<SimpleFeature> iter = null;\n try {\n Geometry clippingFeatureGeometry = (Geometry) clippingFeature.getDefaultGeometry();\n\n // iterate for each clipping feature'geometry (general case is collection, particular case only one geometry)\n for(int i=0; i < clippingFeatureGeometry.getNumGeometries(); i++){\n\n Geometry clippingGeometry = clippingFeatureGeometry.getGeometryN(i);\n \n Geometry clippingGeometryOnMap = GeoToolsUtils.reproject(clippingGeometry, \n clippingCrs,\n mapCrs);\n\n // iterates in the collection to clip and does the geometry clip using the clipping geometry \n iter = featureCollectionToClip.features();\n while( iter.hasNext() ) {\n\n checkCancelation();\n\n SimpleFeature featureToClip = iter.next();\n\n // The feature selected to clip could have been changed in previous iteration\n // then is necessary check the \"transaction trak\"\n String fid = featureToClip.getID();\n if( this.transactionTrack.containsKey(fid) ){\n\n // the feature was changed before and requires more changes (clipping)\n clipChangedFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n\n } else {\n // first time that this feature will be precessed\n clipFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n }\n \n getMonitor().worked(1);\n }\n }\n\n } catch (Exception e) {\n\n final String emsg = e.getMessage();\n LOGGER.severe(emsg);\n throw new SOProcessException(emsg);\n\n } finally {\n if (iter != null) {\n featureCollectionToClip.close(iter);\n }\n\n }\n\n }", "protected abstract void clip();", "public abstract boolean canClip();", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "private boolean canBlackSaveItselfRightAhead(Pedina pedina) {\n boolean condizione1 = false;\n boolean condizione2 = false;\n boolean fine1 = false;\n boolean fine2 = false;\n boolean fine3 = false;\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 1 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 1 == arrayPedineBianche.get(i).getY()) {\n condizione1 = true;\n }\n }\n \n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() - 1))\n condizione2 = true;\n \n \n if (condizione1 && condizione2) {\n if(pedina.getX() - 1 < 0 || pedina.getY() - 1 < 0)\n return false;\n else {\n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n fine1 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine1 = true;\n }\n }\n }\n \n if(!fine1){\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n fine1 = true;\n }\n \n if(pedina instanceof Damone) {\n if(pedina.getX() - 1 < 0 || pedina.getY() + 1 > 7)\n fine2 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 2 == arrayPedineBianche.get(i).getY()) {\n fine2 = true;\n }\n }\n }\n \n if(!fine2) {\n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() + 1)) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() + 1);\n return true;\n } else\n fine2 = true;\n }\n \n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine3 = true;\n }\n }\n \n if(!fine3) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n return false;\n \n } else\n return false; \n } \n } else\n return false; \n }", "private boolean canBlackSaveItselfRightBehind(Pedina pedina) {\n boolean condizione1 = false;\n boolean condizione2 = false;\n boolean fine1 = false;\n boolean fine2 = false;\n boolean fine3 = false;\n\n for (Pedina pedinaBianca : arrayPedineBianche) {\n if (pedina.getX() - 1 == pedinaBianca.getX()\n && pedina.getY() + 1 == pedinaBianca.getY()\n && (pedinaBianca instanceof Damone))\n condizione1 = true;\n }\n \n if(pedina.getX() + 1 <= 7 && pedina.getY() - 1 >= 0 && \n controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1))\n condizione2 = true;\n \n \n if (condizione1 && condizione2) {\n \n if(pedina.getX() + 1 > 7 || pedina.getY() + 1 > 7)\n fine1 = true;\n else { \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 2 == arrayPedineBianche.get(i).getY()) {\n fine1 = true;\n }\n }\n }\n \n if(!fine1) {\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() + 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() + 1);\n return true;\n } else\n fine1 = true;\n } \n \n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n fine2 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine2 = true;\n }\n }\n }\n \n if(!fine2) {\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n fine2 = true;\n }\n \n \n if(pedina instanceof Damone){\n if(pedina.getX() - 1 < 0 || pedina.getY() - 1 < 0)\n fine3 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine3 = true;\n }\n }\n }\n \n if(!fine3) {\n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n return false;\n } else\n return false;\n \n } else\n return false;\n \n } else \n return false;\n\n }", "private Gfa regularPointReduction( Gfa smearIn ) {\n\t\t\n\t\tArrayList<Coordinate> xyList = new ArrayList<Coordinate>( smearIn.getPoints() );\n\t List<Integer> reduceFlg = new ArrayList<Integer>(); \n\t List<Integer> orig = new ArrayList<Integer>();\n\t\t\n\t boolean[] reduceF = smearIn.getReduceFlags();\n\t\t\t \t \n\t for ( int ii = 0; ii < reduceF.length; ii++ ) {\n\t\t\t\n\t\t\tif ( reduceF[ ii ] ) {\n\t\t\t\treduceFlg.add( 1 );\n\t\t\t}\n\t\t\telse {\n\t\t\t\treduceFlg.add( 0 );\n\t\t\t}\n\t\t\t\n\t\t\torig.add( 1 );\n\t\t}\n\n\t /*\n\t for ( int ii = 0; ii < smearIn.getPoints().size(); ii++ ) {\n\t\t\tSystem.out.println( \"Point \" + ii + \" (\" + smearIn.getPoints().get( ii ).x + \",\" +\n\t\t\t\t\tsmearIn.getPoints().get( ii ).y + \") is \" + reduceFlg.get(ii) );\n\t\t}\n\t\t*/\t\t\t\n\t\tdouble incrPct = SMEAR_INCR_PCT;\n\t\tdouble incrPctOrig = REDUCEPTS_INCR_PCT_ORIG;\n\t\tdouble incrDst = SMEAR_INCR_DST;\n\t\t\n\t String prefix = getPrefixString( smearIn );\n\n\t int ier = ReduceGfaPoints.reduceByPctDist( xyList, reduceFlg, orig, \n\t\t\t\t incrPct, incrPctOrig, incrDst, prefix );\n \n\t\tboolean[] reduceFl = new boolean[ xyList.size() ];\n\t\tfor (int ii = 0; ii < xyList.size(); ii++ ) {\n\t\t\tif ( reduceFlg.get( ii ) == 1 )\n\t\t\t\treduceFl[ ii ] = true;\n\t\t\telse\n\t\t\t\treduceFl[ ii ] = false;\n\t\t}\n\t\t\n\t\tGfa newSmear = smearIn.copy();\n\t newSmear.setPointsOnly( xyList );\n\t newSmear.setReduceFlags( reduceFl );\n\t\t\n\t\treturn newSmear;\n\n\t}", "private int getTrimmedLine() { // formerly \"visibilityCheck()\"\n\n cc1 = g3d.clipCode3(x1t, y1t, z1t);\n cc2 = g3d.clipCode3(x2t, y2t, z2t);\n if ((cc1 | cc2) == 0)\n return VISIBILITY_UNCLIPPED;\n\n int xLast = g3d.xLast;\n int yLast = g3d.yLast;\n int slab = g3d.slab;\n int depth = g3d.depth;\n do {\n if ((cc1 & cc2) != 0)\n return VISIBILITY_OFFSCREEN;\n\n float dx = x2t - x1t;\n float dy = y2t - y1t;\n float dz = z2t - z1t;\n if (cc1 != 0) { //cohen-sutherland line clipping\n if ((cc1 & GData.xLT) != 0) {\n y1t += (-x1t * dy) / dx;\n z1t += (-x1t * dz) / dx;\n x1t = 0;\n } else if ((cc1 & GData.xGT) != 0) {\n y1t += ((xLast - x1t) * dy) / dx;\n z1t += ((xLast - x1t) * dz) / dx;\n x1t = xLast;\n } else if ((cc1 & GData.yLT) != 0) {\n x1t += (-y1t * dx) / dy;\n z1t += (-y1t * dz) / dy;\n y1t = 0;\n } else if ((cc1 & GData.yGT) != 0) {\n x1t += ((yLast - y1t) * dx) / dy;\n z1t += ((yLast - y1t) * dz) / dy;\n y1t = yLast;\n } else if ((cc1 & GData.zLT) != 0) {\n x1t += ((slab - z1t) * dx) / dz;\n y1t += ((slab - z1t) * dy) / dz;\n z1t = slab;\n } else // must be zGT\n {\n x1t += ((depth - z1t) * dx) / dz;\n y1t += ((depth - z1t) * dy) / dz;\n z1t = depth;\n }\n\n cc1 = g3d.clipCode3(x1t, y1t, z1t);\n } else {\n if ((cc2 & GData.xLT) != 0) {\n y2t += (-x2t * dy) / dx;\n z2t += (-x2t * dz) / dx;\n x2t = 0;\n } else if ((cc2 & GData.xGT) != 0) {\n y2t += ((xLast - x2t) * dy) / dx;\n z2t += ((xLast - x2t) * dz) / dx;\n x2t = xLast;\n } else if ((cc2 & GData.yLT) != 0) {\n x2t += (-y2t * dx) / dy;\n z2t += (-y2t * dz) / dy;\n y2t = 0;\n } else if ((cc2 & GData.yGT) != 0) {\n x2t += ((yLast - y2t) * dx) / dy;\n z2t += ((yLast - y2t) * dz) / dy;\n y2t = yLast;\n } else if ((cc2 & GData.zLT) != 0) {\n x2t += ((slab - z2t) * dx) / dz;\n y2t += ((slab - z2t) * dy) / dz;\n z2t = slab;\n } else // must be zGT\n {\n x2t += ((depth - z2t) * dx) / dz;\n y2t += ((depth - z2t) * dy) / dz;\n z2t = depth;\n }\n cc2 = g3d.clipCode3(x2t, y2t, z2t);\n }\n } while ((cc1 | cc2) != 0);\n //System.out.println(\"trimmed line \" + x1t + \" \" + y1t + \" \" + z1t + \" \" + x2t + \" \" + y2t + \" \" + z2t + \" \" + cc1 + \"/\" + cc2);\n return VISIBILITY_CLIPPED;\n }", "private static void clipPoly(CsgPolyStream targetStream, CsgPolyStream clippingStream, int polyAddress)\n {\n IntArrayList stack = STACK.get();\n assert stack.isEmpty();\n int nodeAddress = 0;\n \n clipPolyInner(stack, targetStream, clippingStream, polyAddress, 0);\n \n while(!stack.isEmpty())\n {\n nodeAddress = stack.popInt();\n polyAddress = stack.popInt();\n clipPolyInner(stack, targetStream, clippingStream, polyAddress, nodeAddress);\n }\n \n }", "private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }", "public abstract void setClip(Shape clip);", "public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) {\n\n\t\tArrayList<Gfa> smearList = new ArrayList<Gfa>(); \n\n\t\t// Do area clipping and bisection for each smear.\n\t\tfor ( Gfa gg : glist ) {\n\t\t\tsmearList.addAll( reducePoints( gg, snapshots ) );; \n\t\t}\n\t\t\n\t\t// Replace the smear list with the new list.\n\t\tglist.clear();\n\t\tglist.addAll( smearList );\n\t\t\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate static void combineSmallAnnotations(MeshCas cas) {\n\t\tSet<Annotation> toRemove = new HashSet<Annotation>();\n\t\tfor (Iterator<Annotation> it = cas.getAnnotations().iterator(); it.hasNext();) {\n\t\t\tAnnotation a = it.next();\n\t\t\tif (a instanceof PrimitiveAnnotation) {\n\t\t\t\tPrimitiveAnnotation pa = (PrimitiveAnnotation) a;\n\n\t\t\t\t// zero area, remove\n\t\t\t\tif (pa.getArea() == 0) {\n\t\t\t\t\ttoRemove.add(a);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tSet<PrimitiveAnnotation> neighborAnnotations = pa.getNeighborAnnotations(cas,\n\t\t\t\t\t\tPrimitiveAnnotation.class);\n\n\t\t\t\t// check for cone or sphere annotation which has less than 5 triangles\n\t\t\t\tif (neighborAnnotations.size() > 0 && (a instanceof ConeAnnotation || a instanceof SphereAnnotation)\n\t\t\t\t\t\t&& ((PrimitiveAnnotation) a).getMesh().getTriangles().size() < 5) {\n\t\t\t\t\ttoRemove.add(a);\n\n\t\t\t\t\tPrimitiveAnnotation a1 = neighborAnnotations.iterator().next();\n\n\t\t\t\t\tsynchronized (a1.getMesh().getTriangles()) {\n\t\t\t\t\t\ta1.getMesh().getTriangles().addAll(pa.getMesh().getTriangles());\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// merge small annotations here\n\t\t\t\tfor (PrimitiveAnnotation a1 : neighborAnnotations) {\n\n\t\t\t\t\tboolean merge = false;\n\t\t\t\t\tif (pa instanceof ConeAnnotation\n\t\t\t\t\t\t\t&& a1 instanceof ConeAnnotation\n\t\t\t\t\t\t\t&& ((ConeAnnotation) pa).isConcave() != ((ConeAnnotation) a1).isConcave()) {\n\t\t\t\t\t\t// merge pa into a1 if area of pa is significantly smaller than a1, because\n\t\t\t\t\t\t// neighboring cones, one convex and one concave with different size are\n\t\t\t\t\t\t// very unlikely.\n\t\t\t\t\t\tif (pa.getArea() < a1.getArea() * 0.30f)\n\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!merge && pa instanceof PlaneAnnotation && a1 instanceof ConeAnnotation) {\n\t\t\t\t\t\tif (pa.getArea() < a1.getArea() * 0.05f) {\n\t\t\t\t\t\t\t// Found a very small plane annotation neighboring a cone annotation. Check if\n\t\t\t\t\t\t\t// plane annotation should be part of cone annotation by checking if plane\n\t\t\t\t\t\t\t// normal is perpendicular to the generating axis.\n\t\t\t\t\t\t\t// Primitives are not fitted yet, therefore we need to compare triangles on\n\t\t\t\t\t\t\t// the edge for approximately the same normal vector\n\t\t\t\t\t\t\tHashMultimap<Triangle, Triangle> edgeTriangles = HashMultimap.create(a1.getMesh().getTriangles().size(), 2);\n\t\t\t\t\t\t\tSet<Vertex> edgeVertices = new HashSet<Vertex>();\n\t\t\t\t\t\t\tpa.getNeighborEdge(cas, a1, edgeVertices, edgeTriangles);\n\n\t\t\t\t\t\t\t// check for a triangle pair where the angle between triangle normals is\n\t\t\t\t\t\t\t// bigger or equal to 180 degree with a tolerance of twice the plane combine degree.\n\t\t\t\t\t\t\tfor (Triangle t : edgeTriangles.keySet()) {\n\t\t\t\t\t\t\t\tSet<Triangle> partnerSet = edgeTriangles.get(t);\n\t\t\t\t\t\t\t\tfor (Triangle partner : partnerSet) {\n\t\t\t\t\t\t\t\t\tfloat angle = (float)(Math.toDegrees(t.getNormalVector().angle(partner.getNormalVector())));\n\t\t\t\t\t\t\t\t\tif (angle <= (2 * PLANE_COMBINE_DEGREE) || angle >= 180f - (2 * PLANE_COMBINE_DEGREE)) {\n\t\t\t\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (pa.getArea() >= a1.getArea() * 0.05f && pa.getArea() < a1.getArea() * 0.30f) {\n\t\t\t\t\t\t\t// found a small plane annotation neighboring cone annotation. Check if\n\t\t\t\t\t\t\t// plane annotation should be part of cone annotation by checking if plane\n\t\t\t\t\t\t\t// normal is perpendicular to the generating axis.\n\t\t\t\t\t\t\t// Primitives are not fitted yet, therefore we need to compare triangles on\n\t\t\t\t\t\t\t// the edge for approximately the same normal vector\n\t\t\t\t\t\t\tHashMultimap<Triangle, Triangle> edgeTriangles = HashMultimap.create(a1.getMesh().getTriangles().size(), 2);\n\t\t\t\t\t\t\tSet<Vertex> edgeVertices = new HashSet<Vertex>();\n\t\t\t\t\t\t\tpa.getNeighborEdge(cas, a1, edgeVertices, edgeTriangles);\n\n\t\t\t\t\t\t\t// check for a triangle pair where the angle between triangle normals is\n\t\t\t\t\t\t\t// bigger or equal to 180 degree with a tolerance of twice the plane combine degree.\n\t\t\t\t\t\t\tfor (Triangle t : edgeTriangles.keySet()) {\n\t\t\t\t\t\t\t\tSet<Triangle> partnerSet = edgeTriangles.get(t);\n\t\t\t\t\t\t\t\tfor (Triangle partner : partnerSet) {\n\t\t\t\t\t\t\t\t\tfloat angle = (float)(Math.toDegrees(t.getNormalVector().angle(partner.getNormalVector())));\n\t\t\t\t\t\t\t\t\tif (angle <= PLANE_TOLERANCE || angle >= 180f - PLANE_TOLERANCE) {\n\t\t\t\t\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!merge && pa instanceof PlaneAnnotation && (a1 instanceof SphereAnnotation || a1 instanceof ConeAnnotation)\n\t\t\t\t\t\t\t&& pa.getArea() < a1.getArea() * 0.02f) {\n\t\t\t\t\t\t// found very small plane (covering less than 2 percent of neighboring sphere or cone annotation)\n\t\t\t\t\t\t// so merge it into the big annotation as these results are just unwanted artifacts after the region growing\n\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!merge && pa instanceof ConeAnnotation && a1 instanceof SphereAnnotation \n\t\t\t\t\t\t\t&& ((ConeAnnotation)pa).isConcave() == ((SphereAnnotation)a1).isConcave()\n\t\t\t\t\t\t\t&& pa.getArea() < a1.getArea() * 0.05f) {\n\t\t\t\t\t\t// found a small cone annotation next to a sphere annotation of the same convexity, so merge them together and \n\t\t\t\t\t\t// this would be reverted at the sphere checking time if the fit error is too big\n\t\t\t\t\t\tmerge = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (merge) {\n\t\t\t\t\t\ttoRemove.add(a);\n\t\t\t\t\t\tsynchronized (a1.getMesh().getTriangles()) {\n\t\t\t\t\t\t\ta1.getMesh().getTriangles().addAll(pa.getMesh().getTriangles());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsynchronized (cas.getAnnotations()) {\n\t\t\tcas.getAnnotations().removeAll(toRemove);\n\t\t}\n\t}", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "public msg_safety_allowed_area(MAVLinkPacket mavLinkPacket) {\n this.sysid = mavLinkPacket.sysid;\n this.compid = mavLinkPacket.compid;\n this.msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;\n unpack(mavLinkPacket.payload);\n }", "public void destroyArea(Entity[][] map, int x, int y){\r\n map[y][x] = null;\r\n //check if the area to destroy is within the map\r\n if ((x > 0) && (y > 0)){\r\n checkIfOtherType(map, y-1, x-1);\r\n map[y-1][x-1] = null;\r\n map[y-1][x-1] = new ExplodedArea(3, x-1, y-1);\r\n }\r\n if ((x + 1 < map.length) && (y + 1< map.length)){\r\n checkIfOtherType(map, y+1, x+1);\r\n map[y+1][x+1] = null;\r\n map[y+1][x+1] = new ExplodedArea(3, x+1, y+1);\r\n }\r\n if ((y > 0)){\r\n checkIfOtherType(map, y-1, x);\r\n map[y-1][x] = null;\r\n map[y-1][x] = new ExplodedArea(3, x, y-1);\r\n }\r\n if ((x +1 < map.length) && (y > 0)){\r\n checkIfOtherType(map, y-1, x+1);\r\n map[y-1][x+1] = null;\r\n map[y-1][x+1] = new ExplodedArea(3, x+1, y-1);\r\n }\r\n if ( x < map.length -1){\r\n checkIfOtherType(map, y, x+1);\r\n map[y][x+1] = null;\r\n map[y][x+1] = new ExplodedArea(3, x+1, y);\r\n }\r\n if(x > 0){\r\n checkIfOtherType(map, y, x-1);\r\n map[y][x-1] = null;\r\n map[y][x-1] = new ExplodedArea(3, x-1, y);\r\n }\r\n if (y < map.length-1){\r\n checkIfOtherType(map, y+1, x);\r\n map[y+1][x] = null;\r\n map[y+1][x] = new ExplodedArea(3, x, y+1);\r\n }\r\n if((x > 0) && (y < map.length -1)){\r\n checkIfOtherType(map, y+1, x-1);\r\n map[y+1][x-1] = null;\r\n map[y+1][x-1] = new ExplodedArea(3, x-1, y+1);\r\n }\r\n }", "public void cropMoleculeRecognition(){\n mOpenCameraView.disableView();\n\n Mat transformMat = Imgproc.getPerspectiveTransform(mCaptureAreaAdjusted,new MatOfPoint2f(new Point(0,0),new Point(0,400),new Point(400,400), new Point(400,0)));\n Mat croppedImage = new Mat();\n Imgproc.warpPerspective(mGray, croppedImage, transformMat, new Size(400, 400));\n\n /* cleanup the AR marker */\n int cropout = 240;\n\n croppedImage.submat(0,cropout,0,cropout).setTo(new Scalar(0));\n Core.MinMaxLocResult mmr;\n\n for(int i = 0; i<cropout; i++){\n mmr = Core.minMaxLoc(croppedImage.row(i).colRange(cropout,400));\n Core.add(croppedImage.row(i).colRange(0,cropout),new Scalar(mmr.maxVal/2),croppedImage.row(i).colRange(0,cropout));\n\n mmr = Core.minMaxLoc(croppedImage.col(i).rowRange(cropout, 400));\n Core.add(croppedImage.col(i).rowRange(0, cropout),new Scalar(mmr.maxVal/2),croppedImage.col(i).rowRange(0, cropout));\n }\n\n /*for now, just save the cropedImage*/\n /* in the live version, will need to sort out the ar marker on the top left */\n Imgcodecs.imwrite(getFilesDir().toString().concat(\"/croppedImg.png\"),croppedImage);\n Intent intent = new Intent(this,viewCapture.class);\n intent.putExtra(\"flagCaptureImage\",true);\n startActivity(intent);\n }", "private GeometryCollection computeGeometrySplit( \n final Geometry featureGeometryOnMapCrs,\n final Geometry clippingGeometryOnMapCrs,\n final CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n try {\n // does the difference \n Geometry geoDiff = featureGeometryOnMapCrs.difference(clippingGeometryOnMapCrs);\n assert geoDiff instanceof GeometryCollection;\n \n GeometryCollection geoCollection = (GeometryCollection) geoDiff;\n\n return geoCollection;\n \n } catch (Exception e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "private IRegion computeClippingRegion(PaintEvent event) {\n \t\tif (event == null) {\n \t\t\t// trigger a repaint of the entire viewport\n \t\t\tint vOffset= getInclusiveTopIndexStartOffset();\n \t\t\tif (vOffset == -1)\n \t\t\t\treturn null;\n \t\t\t\n \t\t\t// http://bugs.eclipse.org/bugs/show_bug.cgi?id=17147\n \t\t\tint vLength= getExclusiveBottomIndexEndOffset() - vOffset;\n \t\t\t\n \t\t\treturn new Region(vOffset, vLength);\n \t\t}\n \t\t\n \t\tint widgetOffset;\n \t\ttry {\n \t\t\tint widgetClippingStartOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y));\n \t\t\tint firstWidgetLine= fTextWidget.getLineAtOffset(widgetClippingStartOffset);\n \t\t\twidgetOffset= fTextWidget.getOffsetAtLine(firstWidgetLine);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// should not happen\n \t\t\twidgetOffset= 0;\n \t\t}\n \t\t\n \t\tint widgetEndOffset;\n \t\ttry {\n \t\t\tint widgetClippingEndOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y + event.height));\n \t\t\tint lastWidgetLine= fTextWidget.getLineAtOffset(widgetClippingEndOffset);\n \t\t\twidgetEndOffset= fTextWidget.getOffsetAtLine(lastWidgetLine + 1);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// happens if the editor is not \"full\", eg. the last line of the document is visible in the editor\n \t\t\t// in that case, simply use the last character\n \t\t\twidgetEndOffset= fTextWidget.getCharCount();\n \t\t}\n \t\t\n \t\tIRegion clippingRegion= getModelRange(widgetOffset, widgetEndOffset - widgetOffset);\n \t\t\n \t\treturn clippingRegion;\n \t}", "public native int kbAreaGetClosetArea(vector position, int areaType, int areaType1, float minDistance);", "public abstract void clipRect(int x, int y, int width, int height);", "private void moveCameraToPolygon( boolean animate ) {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tfinal LatLngBounds.Builder builder = LatLngBounds.builder();\n \t\tfor ( GPSLatLng pos : this.area.getPolygon().getPoints() ) {\n \t\t\tbuilder.include( this.convertLatLng( pos ) );\n \t\t}\n \n \t\tthis.moveCameraToPolygon( builder, animate );\n \t}", "public Shape getClipShape() { return null; }", "private void disableIfDissatisfied() {\n \t\tif ( !this.satisfiesPolygon() ) {\n \t\t\tthis.area.setEnabled( false );\n \t\t}\n \t}", "public void clipTo(CsgPolyStream clippingStream)\n {\n assert isComplete;\n clip(this, clippingStream);\n }", "@Override\n\tpublic boolean collidesWithPolygon(Polygon polygon) {\n\t\treturn false;\n\t}", "private void drawShapes() {\n\n // get a polygon shape object\n SKPolygon polygon = new SKPolygon();\n // set the polygon's nodes\n List<SKCoordinate> nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7765));\n nodes.add(new SKCoordinate(-122.4141, 37.7765));\n nodes.add(new SKCoordinate(-122.4342, 37.7620));\n polygon.setNodes(nodes);\n // set the outline size\n polygon.setOutlineSize(3);\n // set colors used to render the polygon\n polygon.setOutlineColor(new float[]{1f, 0f, 0f, 1f});\n polygon.setColor(new float[]{1f, 0f, 0f, 0.2f});\n // render the polygon on the map\n mapView.addPolygon(polygon);\n\n // get a circle mask shape object\n SKCircle circleMask = new SKCircle();\n // set the shape's mask scale\n circleMask.setMaskedObjectScale(1.3f);\n // set the colors\n circleMask.setColor(new float[]{1f, 1f, 0.5f, 0.67f});\n circleMask.setOutlineColor(new float[]{0f, 0f, 0f, 1f});\n circleMask.setOutlineSize(3);\n // set circle center and radius\n circleMask.setCircleCenter(new SKCoordinate(-122.4200, 37.7665));\n circleMask.setRadius(300);\n // set outline properties\n circleMask.setOutlineDottedPixelsSkip(6);\n circleMask.setOutlineDottedPixelsSolid(10);\n // set the number of points for rendering the circle\n circleMask.setNumberOfPoints(150);\n // render the circle mask\n mapView.addCircle(circleMask);\n\n\n // get a polyline object\n SKPolyline polyline = new SKPolyline();\n // set the nodes on the polyline\n nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7898));\n nodes.add(new SKCoordinate(-122.4141, 37.7898));\n nodes.add(new SKCoordinate(-122.4342, 37.7753));\n polyline.setNodes(nodes);\n // set polyline color\n polyline.setColor(new float[]{0f, 0f, 1f, 1f});\n // set properties for the outline\n polyline.setOutlineColor(new float[]{0f, 0f, 1f, 1f});\n polyline.setOutlineSize(4);\n polyline.setOutlineDottedPixelsSolid(3);\n polyline.setOutlineDottedPixelsSkip(3);\n mapView.addPolyline(polyline);\n }", "public static Coordinate[] makeArea(Coordinate[] polyLine, double width) {\n Coordinate vertices[];\n int numPoints = polyLine.length;\n // If there aren't at least two points, return an empty list\n if (numPoints < 2) {\n return new Coordinate[0];\n }\n // We've got at least two points, start initializing\n int numNewPoints = numPoints * 2;\n vertices = new Coordinate[numNewPoints];\n\n Coordinate p1, p2, intersectPoint;\n Coordinate[] perpLine1, perpLine2;\n Coordinate[] prevLine1, prevLine2, parallelLine1, parallelLine2;\n prevLine1 = new Coordinate[2];\n prevLine2 = new Coordinate[2];\n parallelLine1 = new Coordinate[2];\n parallelLine2 = new Coordinate[2];\n\n double meterWidth = width;\n\n // Define line p1p2\n p1 = polyLine[0];\n p2 = polyLine[1];\n // Get a line perpendicular to p1p2 through the first point of input\n // 'polyline'\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n // Keep these two endpoints as part of the final polygon\n vertices[0] = perpLine1[0];\n vertices[numNewPoints - 1] = perpLine1[1];\n\n // Get a line perpendicular to p1p2 through the second point of\n // 'polyline'\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Using these new endpoints, determine the 2 parallel lines that\n // straddle p1p2\n // Since the linePerpendicularThruP1 method always rotates in a\n // clockwise\n // direction, perpLine2 endpoints will be rotated 180 degrees wrt\n // perpLine1 endpoints\n prevLine1[0] = perpLine1[0];\n prevLine1[1] = perpLine2[1];\n prevLine2[0] = perpLine1[1];\n prevLine2[1] = perpLine2[0];\n\n for (int i = 2; i < numPoints; i++) {\n // Define p1p2\n p1 = polyLine[i - 1];\n p2 = polyLine[i];\n // Calculate 2 end lines perpendicular to p1p2 that are 'kmWidth'\n // long\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Calculate 2 lines parallel to p1p2 that are 'kmWidth' apart\n parallelLine1[0] = perpLine1[0];\n parallelLine1[1] = perpLine2[1];\n parallelLine2[0] = perpLine1[1];\n parallelLine2[1] = perpLine2[0];\n\n // Compute the intersections\n intersectPoint = intersection(parallelLine1, prevLine1);\n vertices[i - 1] = intersectPoint;\n intersectPoint = intersection(parallelLine2, prevLine2);\n vertices[numNewPoints - i] = intersectPoint;\n\n // Now stash the current lines as the previous lines for future\n // calcs.\n prevLine1[0] = parallelLine1[0];\n prevLine1[1] = parallelLine1[1];\n prevLine2[0] = parallelLine2[0];\n prevLine2[1] = parallelLine2[1];\n }\n // Now tack on the last perpendicular line\n vertices[numNewPoints / 2 - 1] = perpLine2[1];\n vertices[numNewPoints / 2] = perpLine2[0];\n return vertices;\n }", "public void setRectangleClip(int x, int y, float width, float height);", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "protected void shrink() {\n int cellsToDrop = snakeSize/2;\n this.snakeSize = snakeSize - cellsToDrop;\n // AMD: Reset the tip of the tail to be snake-free\n for (int xCell = 0; xCell < maxX; xCell++) {\n for (int yCell = 0; yCell < maxY; yCell++) {\n if (snakeSquares[xCell][yCell] > snakeSize) {\n snakeSquares[xCell][yCell] = NOT_A_SEGMENT;\n }\n }\n }\n }", "public void spriteClipping(int var1, int var2, int var3, int var4, int var5) {\n try {\n int var6 = this.field_736[var5];\n int var7 = this.field_737[var5];\n int var8 = 0;\n int var9 = 0;\n int var10 = (var6 << 16) / var3;\n int var11 = (var7 << 16) / var4;\n int var12;\n int var13;\n if(this.field_742[var5]) {\n var12 = this.spriteWidthFull[var5];\n var13 = this.field_741[var5];\n var10 = (var12 << 16) / var3;\n var11 = (var13 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var12 - 1) / var12;\n var2 += (this.field_739[var5] * var4 + var13 - 1) / var13;\n if(this.field_738[var5] * var3 % var12 != 0) {\n var8 = (var12 - this.field_738[var5] * var3 % var12 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var13 != 0) {\n var9 = (var13 - this.field_739[var5] * var4 % var13 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var8 >> 16)) / var12;\n var4 = var4 * (this.field_737[var5] - (var9 >> 16)) / var13;\n }\n\n var12 = var1 + var2 * this.field_723;\n var13 = this.field_723 - var3;\n int var14;\n if(var2 < this.field_743) {\n var14 = this.field_743 - var2;\n var4 -= var14;\n var2 = 0;\n var12 += var14 * this.field_723;\n var9 += var11 * var14;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var14 = this.field_745 - var1;\n var3 -= var14;\n var1 = 0;\n var12 += var14;\n var8 += var10 * var14;\n var13 += var14;\n }\n\n if(var1 + var3 >= this.field_746) {\n var14 = var1 + var3 - this.field_746 + 1;\n var3 -= var14;\n var13 += var14;\n }\n\n byte var16 = 1;\n if(this.interlace) {\n var16 = 2;\n var13 += this.field_723;\n var11 += var11;\n if((var2 & 1) != 0) {\n var12 += this.field_723;\n --var4;\n }\n }\n\n this.method_249(this.pixels, this.spritePixels[var5], 0, var8, var9, var12, var13, var3, var4, var10, var11, var6, var16);\n } catch (Exception var15) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public boolean copyArea(SunGraphics2D paramSunGraphics2D, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6) {\n/* 297 */ CompositeType compositeType = paramSunGraphics2D.imageComp;\n/* 298 */ if (paramSunGraphics2D.transformState < 3 && paramSunGraphics2D.clipState != 2 && (CompositeType.SrcOverNoEa\n/* */ \n/* 300 */ .equals(compositeType) || CompositeType.SrcNoEa\n/* 301 */ .equals(compositeType))) {\n/* */ \n/* 303 */ paramInt1 += paramSunGraphics2D.transX;\n/* 304 */ paramInt2 += paramSunGraphics2D.transY;\n/* 305 */ int i = paramInt1 + paramInt5;\n/* 306 */ int j = paramInt2 + paramInt6;\n/* 307 */ int k = i + paramInt3;\n/* 308 */ int m = j + paramInt4;\n/* 309 */ Region region = paramSunGraphics2D.getCompClip();\n/* 310 */ if (i < region.getLoX()) i = region.getLoX(); \n/* 311 */ if (j < region.getLoY()) j = region.getLoY(); \n/* 312 */ if (k > region.getHiX()) k = region.getHiX(); \n/* 313 */ if (m > region.getHiY()) m = region.getHiY(); \n/* 314 */ if (i < k && j < m) {\n/* 315 */ gdiPipe.devCopyArea(this, i - paramInt5, j - paramInt6, paramInt5, paramInt6, k - i, m - j);\n/* */ }\n/* */ \n/* */ \n/* 319 */ return true;\n/* */ } \n/* 321 */ return false;\n/* */ }", "public Shape createStrokedShape(Shape shape) {\n/* 140 */ GeneralPath result = new GeneralPath();\n/* 141 */ PathIterator it = new FlatteningPathIterator(shape.getPathIterator(null), 1.0D);\n/* 142 */ float[] points = new float[6];\n/* 143 */ float moveX = 0.0F, moveY = 0.0F;\n/* 144 */ float lastX = 0.0F, lastY = 0.0F;\n/* 145 */ float thisX = 0.0F, thisY = 0.0F;\n/* 146 */ int type = 0;\n/* 147 */ float next = 0.0F;\n/* 148 */ int phase = 0;\n/* 149 */ while (!it.isDone()) {\n/* 150 */ float dx, dy, distance; type = it.currentSegment(points);\n/* 151 */ switch (type) {\n/* */ case 0:\n/* 153 */ moveX = lastX = points[0];\n/* 154 */ moveY = lastY = points[1];\n/* 155 */ result.moveTo(moveX, moveY);\n/* 156 */ next = OutlineZigzagEffect.this.wavelength / 2.0F;\n/* */ break;\n/* */ \n/* */ case 4:\n/* 160 */ points[0] = moveX;\n/* 161 */ points[1] = moveY;\n/* */ \n/* */ \n/* */ case 1:\n/* 165 */ thisX = points[0];\n/* 166 */ thisY = points[1];\n/* 167 */ dx = thisX - lastX;\n/* 168 */ dy = thisY - lastY;\n/* 169 */ distance = (float)Math.sqrt((dx * dx + dy * dy));\n/* 170 */ if (distance >= next) {\n/* 171 */ float r = 1.0F / distance;\n/* 172 */ while (distance >= next) {\n/* 173 */ float x = lastX + next * dx * r;\n/* 174 */ float y = lastY + next * dy * r;\n/* 175 */ if ((phase & 0x1) == 0) {\n/* 176 */ result.lineTo(x + OutlineZigzagEffect.this.amplitude * dy * r, y - OutlineZigzagEffect.this.amplitude * dx * r);\n/* */ } else {\n/* 178 */ result.lineTo(x - OutlineZigzagEffect.this.amplitude * dy * r, y + OutlineZigzagEffect.this.amplitude * dx * r);\n/* 179 */ } next += OutlineZigzagEffect.this.wavelength;\n/* 180 */ phase++;\n/* */ } \n/* */ } \n/* 183 */ next -= distance;\n/* 184 */ lastX = thisX;\n/* 185 */ lastY = thisY;\n/* 186 */ if (type == 4) result.closePath(); \n/* */ break;\n/* */ } \n/* 189 */ it.next();\n/* */ } \n/* 191 */ return (new BasicStroke(OutlineZigzagEffect.this.getWidth(), 2, OutlineZigzagEffect.this.getJoin())).createStrokedShape(result);\n/* */ }", "public abstract void setClip(int x, int y, int width, int height);", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "public void clipRect(int sx, int sy, int i, int j) {\n\t\t\n\t}", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "public CollisionArea_SingleCirc getOptimalCollisionArea();", "public static void m20200a(Path path, float f, float f2, float f3) {\n String str = \"applyTrimPathIfNeeded\";\n C8505b.m19651a(str);\n f22229a.setPath(path, false);\n float length = f22229a.getLength();\n if (f == 1.0f && f2 == 0.0f) {\n C8505b.m19652b(str);\n } else if (length < 1.0f || ((double) Math.abs((f2 - f) - 1.0f)) < 0.01d) {\n C8505b.m19652b(str);\n } else {\n float f4 = f * length;\n float f5 = f2 * length;\n float f6 = f3 * length;\n float min = Math.min(f4, f5) + f6;\n float max = Math.max(f4, f5) + f6;\n if (min >= length && max >= length) {\n min = (float) C8657g.m20182a(min, length);\n max = (float) C8657g.m20182a(max, length);\n }\n if (min < 0.0f) {\n min = (float) C8657g.m20182a(min, length);\n }\n if (max < 0.0f) {\n max = (float) C8657g.m20182a(max, length);\n }\n int i = (min > max ? 1 : (min == max ? 0 : -1));\n if (i == 0) {\n path.reset();\n C8505b.m19652b(str);\n return;\n }\n if (i >= 0) {\n min -= length;\n }\n f22230b.reset();\n f22229a.getSegment(min, max, f22230b, true);\n if (max > length) {\n f22231c.reset();\n f22229a.getSegment(0.0f, max % length, f22231c, true);\n f22230b.addPath(f22231c);\n } else if (min < 0.0f) {\n f22231c.reset();\n f22229a.getSegment(min + length, length, f22231c, true);\n f22230b.addPath(f22231c);\n }\n path.set(f22230b);\n C8505b.m19652b(str);\n }\n }", "public msg_safety_allowed_area() {\n msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;\n }", "public static Paint newSurroundingAreaOverlayPaint() {\n\n final Paint paint = new Paint();\n paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));\n paint.setAntiAlias(true);\n\n return paint;\n }", "private int expandCompositChar(char[] dest,\n int start,\n int length,\n int lacount,\n int shapingMode) throws ArabicShapingException {\n\n int lenOptionsLamAlef = options & LAMALEF_MASK;\n int lenOptionsSeen = options & SEEN_MASK;\n int lenOptionsYehHamza = options & YEHHAMZA_MASK;\n boolean spaceNotFound = false;\n\n if (!isLogical && !spacesRelativeToTextBeginEnd) {\n switch (lenOptionsLamAlef) {\n case LAMALEF_BEGIN: lenOptionsLamAlef = LAMALEF_END; break;\n case LAMALEF_END: lenOptionsLamAlef = LAMALEF_BEGIN; break;\n default: break;\n }\n }\n\n if(shapingMode == 1){\n if(lenOptionsLamAlef == LAMALEF_AUTO){\n if(isLogical){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n }\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n }\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else{\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n }\n if(spaceNotFound){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n }\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }\n }else if(lenOptionsLamAlef == LAMALEF_END){\n spaceNotFound = expandCompositCharAtEnd(dest, start, length, lacount);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_BEGIN){\n spaceNotFound = expandCompositCharAtBegin(dest, start, length, lacount);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,0,1);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No spacefor lamalef\");\n }\n }else if(lenOptionsLamAlef == LAMALEF_RESIZE){\n for (int r = start + length, w = r + lacount; --r >= start;) {\n char ch = dest[r];\n if (isNormalizedLamAlefChar(ch)) {\n dest[--w] = '\\u0644';\n dest[--w] = convertNormalizedLamAlef[ch - '\\u065C'];\n } else {\n dest[--w] = ch;\n }\n }\n length += lacount;\n }\n }else{\n if(lenOptionsSeen == SEEN_TWOCELL_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,0,1,0);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No space for Seen tail expansion\");\n }\n }\n if(lenOptionsYehHamza == YEHHAMZA_TWOCELL_NEAR){\n spaceNotFound = expandCompositCharAtNear(dest, start, length,1,0,0);\n if(spaceNotFound){\n throw new ArabicShapingException(\"No space for YehHamza expansion\");\n }\n }\n }\n return length;\n }", "private void m212a(Canvas canvas) {\n float f = (-this.f407h) - this.f411l;\n float f2 = this.f407h + ((float) this.f402b) + (this.f412m / 2.0f);\n float f3 = f2 * 2.0f;\n boolean z = this.f406g.width() - f3 > 0.0f;\n boolean z2 = this.f406g.height() - f3 > 0.0f;\n int save = canvas.save();\n canvas.translate(this.f406g.left + f2, this.f406g.top + f2);\n canvas.drawPath(this.f408i, this.f404e);\n if (z) {\n canvas.drawRect(0.0f, f, this.f406g.width() - f3, -this.f407h, this.f405f);\n }\n canvas.restoreToCount(save);\n int save2 = canvas.save();\n canvas.translate(this.f406g.right - f2, this.f406g.bottom - f2);\n canvas.rotate(180.0f);\n canvas.drawPath(this.f408i, this.f404e);\n if (z) {\n canvas.drawRect(0.0f, f, this.f406g.width() - f3, (-this.f407h) + this.f411l, this.f405f);\n }\n canvas.restoreToCount(save2);\n int save3 = canvas.save();\n canvas.translate(this.f406g.left + f2, this.f406g.bottom - f2);\n canvas.rotate(270.0f);\n canvas.drawPath(this.f408i, this.f404e);\n if (z2) {\n canvas.drawRect(0.0f, f, this.f406g.height() - f3, -this.f407h, this.f405f);\n }\n canvas.restoreToCount(save3);\n int save4 = canvas.save();\n canvas.translate(this.f406g.right - f2, this.f406g.top + f2);\n canvas.rotate(90.0f);\n canvas.drawPath(this.f408i, this.f404e);\n if (z2) {\n canvas.drawRect(0.0f, f, this.f406g.height() - f3, -this.f407h, this.f405f);\n }\n canvas.restoreToCount(save4);\n }", "static int clipDestination(\n S2Point a,\n S2Point b,\n S2Point nScaled,\n S2Point aTangent,\n S2Point bTangent,\n double uvScale,\n R2Vector uv) {\n // assert(intersectsFace(nScaled));\n\n // Optimization: if B is within the safe region of the face, use it.\n final double kMaxSafeUVCoord = 1 - FACE_CLIP_ERROR_UV_COORD;\n if (b.z > 0) {\n uv.set(b.x / b.z, b.y / b.z);\n if (Math.max(Math.abs(uv.x), Math.abs(uv.y)) <= kMaxSafeUVCoord) {\n return 0;\n }\n }\n\n // Otherwise find the point B' where the line AB exits the face.\n getExitPoint(nScaled, getExitAxis(nScaled), uv);\n uv.x *= uvScale;\n uv.y *= uvScale;\n S2Point p = new S2Point(uv.x, uv.y, 1);\n\n // Determine if the exit point B' is contained within the segment. We do this\n // by computing the dot products with two inward-facing tangent vectors at A\n // and B. If either dot product is negative, we say that B' is on the \"wrong\n // side\" of that point. As the point B' moves around the great circle AB past\n // the segment endpoint B, it is initially on the wrong side of B only; as it\n // moves further it is on the wrong side of both endpoints; and then it is on\n // the wrong side of A only. If the exit point B' is on the wrong side of\n // either endpoint, we can't use it; instead the segment is clipped at the\n // original endpoint B.\n //\n // We reject the segment if the sum of the scores of the two endpoints is 3\n // or more. Here is what that rule encodes:\n // - If B' is on the wrong side of A, then the other clipped endpoint A'\n // must be in the interior of AB (otherwise AB' would go the wrong way\n // around the circle). There is a similar rule for A'.\n // - If B' is on the wrong side of either endpoint (and therefore we must\n // use the original endpoint B instead), then it must be possible to\n // project B onto this face (i.e., its w-coordinate must be positive).\n // This rule is only necessary to handle certain zero-length edges (A=B).\n int score = 0;\n if (S2Point.sub(p, a).dotProd(aTangent) < 0) {\n score = 2; // B' is on wrong side of A.\n } else if (S2Point.sub(p, b).dotProd(bTangent) < 0) {\n score = 1; // B' is on wrong side of B.\n }\n if (score > 0) { // B' is not in the interior of AB.\n if (b.z <= 0) {\n score = 3; // B cannot be projected onto this face.\n } else {\n uv.set(b.x / b.z, b.y / b.z);\n }\n }\n return score;\n }", "@java.lang.Override\n public int getClippingAreaIndex() {\n return clippingAreaIndex_;\n }", "private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}", "private static void shift(RescueMap rm, int n1, int n2, int n3, int[] c){\n\t\t//get the normal to the first road\n\t\tlong n1y = rm.getX(n2) - rm.getX(n1);\n\t\tlong n1x = rm.getY(n1) - rm.getY(n2);\n\t\t//get normal to the second road\n\t\tlong n2y = rm.getX(n3) - rm.getX(n2);\n\t\tlong n2x = rm.getY(n2) - rm.getY(n3);\n\t\t//get length of each normal\n\t\tdouble len1 = Math.sqrt(n1y*n1y+n1x*n1x);\n\t\tdouble len2 = Math.sqrt(n2y*n2y+n2x*n2x);\n\n\t\tint d = 3000;//Math.max(rm.getRoad(n1,n2),rm.getRoad(n2,n3))*2000 +500;\n\n\t\tint x1 = rm.getX(n1) - (int)(n1x*d*1.0/len1);\n\t\tint x2 = rm.getX(n2) - (int)(n1x*d*1.0/len1);\n\t\tint y1 = rm.getY(n1) - (int)(n1y*d*1.0/len1);\n\t\tint y2 = rm.getY(n2) - (int)(n1y*d*1.0/len1);\n\t\tint x3 = rm.getX(n2) - (int)(n2x*d*1.0/len2);\n\t\tint x4 = rm.getX(n3) - (int)(n2x*d*1.0/len2);\n\t\tint y3 = rm.getY(n2) - (int)(n2y*d*1.0/len2);\n\t\tint y4 = rm.getY(n3) - (int)(n2y*d*1.0/len2);\n\n\t\tint[] intersect = intersection(x1,y1,x2,y2,x3,y3,x4,y4);\n\t\tif(intersect == null){\n\t\t\tc[0] -= (n1x/len1)*d;\n\t\t\tc[1] -= (n1y/len1)*d;\n\t\t}\n\t\telse{\n\t\t\tc[0] = intersect[0];\n\t\t\tc[1] = intersect[1];\n\t\t}\n\t}", "public Builder setClippingAreaIndex(int value) {\n \n clippingAreaIndex_ = value;\n onChanged();\n return this;\n }", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "protected boolean canSampleArea() { return true; }", "public void revealArea(int row, int col) {\r\n if(this.isExplode(row, col) == true){\r\n System.out.println(\"BOOOOM!\\nYOU LOSE!\");\r\n EndBox.end(\"Lose\", \"BOOOOM! YOU LOSE!!!\");\r\n System.exit(0);\r\n }\r\n this.detectBombs(row, col);\r\n for(int i = 0; i<100; i++){//Searches for 0 over and over again to make sure no more 0's are unchecked.\r\n for (int r = 0; r<map.length; r++) {\r\n for (int c = 0; c<map[0].length; c++) {\r\n if(map[r][c].getVisual().equals(zero)){\r\n this.detectBombs(r - 1, c);\r\n this.detectBombs(r + 1, c);\r\n this.detectBombs(r, c + 1);\r\n this.detectBombs(r, c - 1);\r\n this.detectBombs(r - 1, c + 1);\r\n this.detectBombs(r - 1, c - 1);\r\n this.detectBombs(r + 1, c - 1);\r\n this.detectBombs(r + 1, c + 1);\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n }", "abstract protected boolean clearSquareHitMine(Location m);", "public void setClip(Shape clip)\r\n\t{\r\n\t\tg.setClip(clip);\r\n\t}", "public Shape getAreaColision();", "public void calArea()\n {\n //Start of the formula\n for(int i = 0; i < sides-1; i++)\n {\n area += (poly[i].getX()*poly[i+1].getY())-(poly[i].getY()*poly[i+1].getX());\n }\n\n //half the total calculation\n area = area/2;\n\n //if area is negative times by -1\n if(area <= 0)\n {\n area = area*-1;\n }\n }", "public /* synthetic */ void mo10812a(Style style) {\n String str = \"zenly-tile-overlay\";\n Layer a = style.mo33751a(str);\n String str2 = this.f10815A;\n String str3 = \"zenly-tile-overlay-source\";\n if (str2 != null && a == null) {\n style.mo33757a((Source) new RasterSource(str3, new C11593a(\"tileset\", str2), 256));\n style.mo33753a((Layer) new RasterLayer(str, str3));\n } else if (this.f10815A == null && a != null) {\n try {\n style.mo33763c(str3);\n style.mo33761b(str);\n } catch (Exception e) {\n C12143a.m32032b(e, \"refreshSkiSlopes: disableSkiSlope failed\", new Object[0]);\n }\n }\n }", "private static long shrinkOffset(long IStar, int offset) {\n\t\tlong conMask = ((1l<<offset) -1);\n\t\treturn (IStar&conMask)|((~(conMask)&IStar)>>>1);\n\t}", "public static void WarningForOverThreeLines( Gfa smear ) {\n\t\t\n\t\tif ( !smear.isSnapshot() ) { \n\t\t String prefix = getPrefixString( smear );\n\t\t \n\t\t boolean formattable = \tcanBeFormatted( smear.getPoints(), prefix );\n\t\t \n\t\t if ( !formattable ) {\n\t\t\t String message = \"\";\n\t\t\t if ( prefix.equals( Gfa.FROM ) ) {\n\t\t\t \tmessage = new String( \"This AIRMET will generate more than 3 FROM lines when formatted.\");\n\t\t\t }\n\t\t\t else {\n\t\t\t \tmessage = new String( \"This OUTLOOK will generate more than 3 FROM lines when formatted.\");\t\t\t \t\n\t\t\t }\n\t\t\t \n\t \t\tMessageDialog confirmDlg = new MessageDialog( \n\t \t\tPlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), \n\t \t\t\"Over 3 FROM Lines\", null, message,\n\t \t\tMessageDialog.WARNING, new String[]{\"OK\"}, 0 );\n\t \n\t \tconfirmDlg.open();\n\n\t\t }\t\t \t\t \n\t\t}\t\t\t\t\n\t}", "@Override\n public void onPolygonClick(Polygon polygon) {\n // Flip the values of the red, green, and blue components of the polygon's color.\n int color = polygon.getStrokeColor() ^ 0x00ffffff;\n polygon.setStrokeColor(color);\n color = polygon.getFillColor() ^ 0x00ffffff;\n polygon.setFillColor(color);\n\n Toast.makeText(this, \"Area type \" + polygon.getTag().toString(), Toast.LENGTH_SHORT).show();\n }", "public boolean isClipPreserved()\n/* */ {\n/* 171 */ return this.clipPreserved;\n/* */ }", "private void m7635b() {\n if (!this.f6418o) {\n this.f6417n = false;\n this.f6405b.clearAnimation();\n this.f6406c.removeAnnotations();\n List arrayList = new ArrayList();\n for (GridDTO polygons : this.f6414k) {\n arrayList.add(new PolygonOptions().addAll(polygons.getPolygons()).fillColor(Color.parseColor(\"#00bcd4\")).strokeColor(-16728876).alpha(0.5f));\n }\n this.f6406c.addPolygons(arrayList);\n this.f6417n = false;\n }\n }", "@Override\n public void clip() {\n graphicsEnvironmentImpl.clip(canvas);\n }", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "@Override\n public final void run( IProgressMonitor monitor ) throws SOProcessException {\n\n\n // initalization\n init(monitor); \n\n final String msg = MessageFormat.format(Messages.ClipProcess_clipping_with, \n layerToClip.getName(),\n clippingLayer.getName());\n getMonitor().subTask(msg);\n getMonitor().worked(1);\n int count = computeCount();\n getMonitor().beginTask(msg, count);\n\n // gets the crs of layers and map\n final CoordinateReferenceSystem clippingCrs = LayerUtil.getCrs(clippingLayer);\n final CoordinateReferenceSystem mapCrs = MapUtil.getCRS(clippingLayer.getMap());\n final CoordinateReferenceSystem featureToClipCrs = LayerUtil.getCrs(layerToClip);\n\n FeatureCollection<SimpleFeatureType, SimpleFeature> featuresToClip = this.featuresToClip;\n // save the name of geometry attribute\n\n FeatureCollection<SimpleFeatureType, SimpleFeature> clipping = this.clippingFeatures;\n FeatureIterator<SimpleFeature> iter = null;\n try {\n iter = clipping.features();\n while( iter.hasNext() ) {\n\n checkCancelation();\n\n SimpleFeature clippingFeature = iter.next();\n\n clipFeatureCollectionUsingClippingFeature(\n featuresToClip, featureToClipCrs,\n clippingFeature, clippingCrs, mapCrs);\n\n getMonitor().worked(1);\n }\n\n } catch (InterruptedException e) {\n\n final String cancelMsg = Messages.ClipProcess_clip_was_canceled;\n throw new SOProcessException(cancelMsg);\n \n } finally {\n\n if (iter != null) {\n clipping.close(iter);\n }\n endProcess((Map) this.map, this.targetLayer);\n \n final String endMsg = Messages.ClipProcess_successful;\n monitor.subTask(endMsg);\n monitor.done();\n }\n }", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static boolean clipEdge(\n R2Vector a, R2Vector b, R2Rect clip, R2Vector aClipped, R2Vector bClipped) {\n // Compute the bounding rectangle of AB, clip it, and then extract the new\n // endpoints from the clipped bound.\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (clipEdgeBound(a, b, clip, bound)) {\n int iEnd = a.x > b.x ? 1 : 0;\n int jEnd = a.y > b.y ? 1 : 0;\n aClipped.set(bound.getVertex(iEnd, jEnd));\n bClipped.set(bound.getVertex(1 - iEnd, 1 - jEnd));\n return true;\n }\n return false;\n }", "interface Clipping {\n /**\n * Sets the clip's bounding rectangle into the provided argument and\n * returns it for convenince.\n * \n * @param rect\n * the rect\n * @return the given rect\n * @since 3.1\n */\n Rectangle getBoundingBox(Rectangle rect);\n\n Clipping getCopy();\n\n void intersect(int left, int top, int right, int bottom);\n\n void scale(float horizontal, float vertical);\n\n void setOn(GC gc, int translateX, int translateY);\n\n void translate(float dx, float dy);\n }", "public void apply(Graphics2D g, Shape clipShape, int width, int height) {\n Rectangle tmp = clipShape.getBounds();\n width = (int) tmp.getMaxX();\n height = (int) tmp.getMaxY();\n tmp.setRect(0, 0, width + getEffectWidth() * 2 + 1,\n height + getEffectWidth() * 2 + 1);\n\n // Apply the border glow effect\n if (isShapeMasked()) {\n BufferedImage clipImage = getClipImage(tmp);\n Graphics2D g2 = clipImage.createGraphics();\n try {\n /* clear the buffer */\n g2.setPaint(Color.BLACK);\n g2.setComposite(AlphaComposite.Clear);\n g2.fillRect(0, 0, clipImage.getWidth(), clipImage.getHeight());\n\n g2.translate(getEffectWidth() - getOffset().getX(),\n getEffectWidth() - getOffset().getY());\n paintBorderGlow(g2, clipShape, width, height);\n\n /* clip out the parts we don't want */\n g2.setComposite(AlphaComposite.Clear);\n g2.setColor(Color.WHITE);\n if (isRenderInsideShape()) {\n /* clip the outside */\n Area area = new Area(tmp);\n area.subtract(new Area(clipShape));\n g2.fill(area);\n } else {\n /* clip the inside */\n g2.fill(clipShape);\n }\n } finally {\n /* draw the final image */\n g2.dispose();\n }\n g.drawImage(clipImage, -getEffectWidth() + (int) getOffset().getX(), -getEffectWidth() + (int) getOffset().getY(), null);\n } else {\n paintBorderGlow(g, clipShape, width, height);\n }\n }", "public void mo2186a(Canvas canvas, RectF rectF, float f, Paint paint) {\n Canvas canvas2 = canvas;\n RectF rectF2 = rectF;\n float f2 = 2.0f * f;\n float width = (rectF.width() - f2) - 1.0f;\n float height = (rectF.height() - f2) - 1.0f;\n if (f >= 1.0f) {\n float f3 = f + 0.5f;\n float f4 = -f3;\n C0315c.this.f1366a.set(f4, f4, f3, f3);\n int save = canvas.save();\n canvas2.translate(rectF2.left + f3, rectF2.top + f3);\n Paint paint2 = paint;\n canvas.drawArc(C0315c.this.f1366a, 180.0f, 90.0f, true, paint2);\n canvas2.translate(width, 0.0f);\n canvas2.rotate(90.0f);\n canvas.drawArc(C0315c.this.f1366a, 180.0f, 90.0f, true, paint2);\n canvas2.translate(height, 0.0f);\n canvas2.rotate(90.0f);\n canvas.drawArc(C0315c.this.f1366a, 180.0f, 90.0f, true, paint2);\n canvas2.translate(width, 0.0f);\n canvas2.rotate(90.0f);\n canvas.drawArc(C0315c.this.f1366a, 180.0f, 90.0f, true, paint2);\n canvas2.restoreToCount(save);\n float f5 = (rectF2.left + f3) - 1.0f;\n float f6 = rectF2.top;\n canvas.drawRect(f5, f6, (rectF2.right - f3) + 1.0f, f6 + f3, paint2);\n float f7 = (rectF2.left + f3) - 1.0f;\n float f8 = rectF2.bottom;\n canvas.drawRect(f7, f8 - f3, (rectF2.right - f3) + 1.0f, f8, paint2);\n }\n canvas.drawRect(rectF2.left, rectF2.top + f, rectF2.right, rectF2.bottom - f, paint);\n }", "private void applyLavaDamageToWallsAndFences() {\n/* 1257 */ if (isLava()) {\n/* */ \n/* 1259 */ if (this.walls != null) {\n/* */ \n/* 1261 */ Wall[] lTempWalls = getWalls();\n/* 1262 */ for (int x = 0; x < lTempWalls.length; x++)\n/* */ {\n/* 1264 */ lTempWalls[x].setDamage(lTempWalls[x].getDamage() + 1.0F);\n/* */ }\n/* */ } \n/* 1267 */ if (this.fences != null)\n/* */ {\n/* 1269 */ for (Fence f : getFences()) {\n/* 1270 */ f.setDamage(f.getDamage() + 1.0F);\n/* */ }\n/* */ }\n/* */ } \n/* */ }", "private ArrayList processBuilding(int[][] building, int minArea, Random rand){\n\t\tint a = RescueMapToolkit.area(building);\n\t\t//System.out.println(minArea+\", \"+a);\n\t\tif(a < 1000) //kill these ones...\n\t\t\treturn new ArrayList(0);\n\t\tif(a < minArea){ //primary base case\n\t\t\tArrayList l = new ArrayList(1);\n\t\t\tl.add(building);\n\t\t\treturn l;\n\t\t}\n\t\tint lower = (int)(rand.nextDouble()*minArea);\n\t\tlower = lower*4;\n\t\tif(a < lower){ //probabilistic base case\n\t\t\tArrayList l = new ArrayList(1);\n\t\t\tl.add(building);\n\t\t\treturn l;\n\t\t}\n\t\t//find the max and min points\n\t\tint minX = building[0][0];\n\t\tint minY = building[0][1];\n\t\tint maxX = building[0][0];\n\t\tint maxY = building[0][1];\n\t\tfor(int i = 1; i < building.length; i++){\n\t\t\tif(minX > building[i][0]) minX = building[i][0];\n\t\t\tif(maxX < building[i][0]) maxX = building[i][0];\n\t\t\tif(minY > building[i][1]) minY = building[i][1];\n\t\t\tif(maxY < building[i][1]) maxY = building[i][1];\n\t\t}\n\t\tint midX = (minX+maxX)/2;\n\t\tint midY = (minY+maxY)/2;\n\t\t//split the building in half\n\t\tint[][][] split;\n\t\tif(maxX-minX > maxY-minY)\n\t\t\tsplit = RescueMapToolkit.split(building,midX,minY,midX,maxY);\n\t\telse\n\t\t\tsplit = RescueMapToolkit.split(building,minX,midY,maxX,midY);\n\n\t\tif(split == null || RescueMapToolkit.area(split[0]) == 0 || RescueMapToolkit.area(split[1]) == 0)\n\t\t\treturn new ArrayList(0);\n\n\t\t//and recurse\n\t\tArrayList a1 = processBuilding(split[0],minArea,rand);\n\t\tArrayList a2 = processBuilding(split[1],minArea,rand);\n\t\tArrayList toRet = new ArrayList(a1.size()+a2.size());\n\t\tfor(int i = 0; i < a1.size(); i++)\n\t\t\ttoRet.add(a1.get(i));\n\t\tfor(int i = 0; i < a2.size(); i++)\n\t\t\ttoRet.add(a2.get(i));\n\t\treturn toRet;\n\t}", "public static boolean collide(CustomAABB us, CustomBlockBox block, Vector3f pos, Vector3f inertia, float width, float height, boolean onGround){\n boolean xWithin = !(us.getLeft() > block.getRight() || us.getRight() < block.getLeft());\n boolean yWithin = !(us.getBottom() > block.getTop() || us.getTop() < block.getBottom());\n boolean zWithin = !(us.getFront() > block.getBack() || us.getBack() < block.getFront());\n\n //double check to stop clipping if not enough space\n if (xWithin && zWithin && yWithin &&\n !detectBlock(new Vector3f(block.getLeft(), block.getBottom()+1,block.getFront())) &&\n !detectBlock(new Vector3f(block.getLeft(), block.getBottom()+2,block.getFront()))) {\n\n //floor detection\n if (block.getTop() > us.getBottom() && inertia.y < 0 && us.getBottom() - block.getTop() > -0.15f) {\n //this is the collision debug sphere for terrain\n float oldPos = pos.y;\n pos.y = block.getTop();\n //don't move up if too high\n if (pos.y - oldPos > 1) {\n pos.y = (int)oldPos;\n }\n inertia.y = 0;\n onGround = true;\n }\n }\n\n //stop getting shot across the map\n if (xWithin && zWithin && yWithin &&\n !detectBlock(new Vector3f(block.getLeft(), block.getBottom()-1,block.getFront())) &&\n !detectBlock(new Vector3f(block.getLeft(), block.getBottom()-2,block.getFront()))) {\n //head detection\n if (block.getBottom() < us.getTop() && inertia.y >= 0 && us.getTop() - block.getBottom() < 0.15f) {\n pos.y = block.getBottom() - height;\n inertia.y = 0;\n }\n }\n\n float averageX = Math.abs(((block.getLeft() + block.getRight())/2f) - pos.x);\n float averageY = Math.abs(((block.getBottom() + block.getTop())/2f) - pos.y);\n float averageZ = Math.abs(((block.getFront() + block.getBack())/2f) - pos.z);\n if (averageX > averageZ) {\n if (!detectBlock(new Vector3f(block.getLeft()+1, block.getBottom(),block.getFront()))) {\n us = new CustomAABB(pos.x, pos.y + 0.1501f, pos.z, width, height - 0.3001f);\n xWithin = !(us.getLeft() > block.getRight() || us.getRight() < block.getLeft());\n yWithin = !(us.getBottom() > block.getTop() || us.getTop() < block.getBottom());\n zWithin = !(us.getFront() > block.getBack() || us.getBack() < block.getFront());\n\n //x- detection\n if (xWithin && zWithin && yWithin) {\n if (block.getRight() > us.getLeft() && inertia.x < 0) {\n pos.x = block.getRight() + width + 0.00001f;\n inertia.x = 0;\n }\n }\n }\n if (!detectBlock(new Vector3f(block.getLeft()-1, block.getBottom(),block.getFront()))) {\n us = new CustomAABB(pos.x, pos.y + 0.1501f, pos.z, width, height - 0.3001f);\n xWithin = !(us.getLeft() > block.getRight() || us.getRight() < block.getLeft());\n yWithin = !(us.getBottom() > block.getTop() || us.getTop() < block.getBottom());\n zWithin = !(us.getFront() > block.getBack() || us.getBack() < block.getFront());\n\n //x+ detection\n if (xWithin && zWithin && yWithin) {\n if (block.getLeft() < us.getRight() && inertia.x > 0) {\n pos.x = block.getLeft() - width - 0.00001f;\n inertia.x = 0;\n }\n }\n }\n } else {\n if (!detectBlock(new Vector3f(block.getLeft(), block.getBottom(),block.getFront()+1))) {\n us = new CustomAABB(pos.x, pos.y + 0.1501f, pos.z, width, height - 0.3001f);\n xWithin = !(us.getLeft() > block.getRight() || us.getRight() < block.getLeft());\n yWithin = !(us.getBottom() > block.getTop() || us.getTop() < block.getBottom());\n zWithin = !(us.getFront() > block.getBack() || us.getBack() < block.getFront());\n\n //z- detection\n if (xWithin && zWithin && yWithin) {\n if (block.getBack() > us.getFront() && inertia.z < 0) {\n pos.z = block.getBack() + width + 0.00001f;\n inertia.z = 0;\n }\n }\n }\n if (!detectBlock(new Vector3f(block.getLeft(), block.getBottom(),block.getFront()-1))) {\n us = new CustomAABB(pos.x, pos.y + 0.1501f, pos.z, width, height - 0.3001f);\n xWithin = !(us.getLeft() > block.getRight() || us.getRight() < block.getLeft());\n yWithin = !(us.getBottom() > block.getTop() || us.getTop() < block.getBottom());\n zWithin = !(us.getFront() > block.getBack() || us.getBack() < block.getFront());\n\n //z+ detection\n if (xWithin && zWithin && yWithin) {\n if (block.getFront() < us.getBack() && inertia.z > 0) {\n pos.z = block.getFront() - width - 0.00001f;\n inertia.z = 0;\n }\n }\n }\n }\n return onGround;\n }", "private ArrayList<Integer> pruneIllegals(ArrayList<Integer> cm,\n ArrayList<Integer> config) {\n //Remove out of bound spots\n for (int i = 0; i < cm.size(); i++) {\n if(cm.get(i) < 0) {\n cm.remove(i);\n i--;\n } else if (cm.get(i) >= config.size()) {\n cm.remove(i);\n i--;\n }\n }\n //Remove points that have no person there\n boolean occupied;\n for (int i = 0; i < cm.size(); i++) {\n if (config.get(cm.get(i)) == '.') {\n cm.remove(i);\n i--;\n }\n }\n\n return cm;\n }", "private boolean createStraightProtectingMoves(Chessboard chessboard, boolean colour) {\n\t\tint startRow = position / 8;\n\t\tint startCol = position % 8;\n\t\t\n\t\tboolean rightBlocked = false, downBlocked = false, leftBlocked = false, upBlocked = false;\n\t\tint maxMovement = Math.max(Math.max(startRow, startCol), Math.max(7-startRow, 7-startCol));\n\t\t\n\t\t// check route\n\t\tfor (int i = 1; i <= maxMovement; i++) {\n\t\t\t// check right\n\t\t\tif (!rightBlocked && startCol + i < 8) {\n\t\t\t\tint end = startRow * 8 + (startCol + i);\n\t\t\t\tPiece piece = chessboard.getSquareContents(end);\n\t\t\t\tif (chessboard.getSquareContents(end) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Rook || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\trightBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check down\n\t\t\tif (!downBlocked && startRow + i < 8) {\n\t\t\t\tint end = (startRow + i) * 8 + startCol;\n\t\t\t\tPiece piece = chessboard.getSquareContents(end);\n\t\t\t\tif (chessboard.getSquareContents(end) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Rook || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdownBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check left\n\t\t\tif (!leftBlocked && startCol - i >= 0) {\n\t\t\t\tint end = (startRow * 8) + startCol - i;\n\t\t\t\tPiece piece = chessboard.getSquareContents(end);\n\t\t\t\tif (chessboard.getSquareContents(end) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Rook || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tleftBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check up\n\t\t\tif (!upBlocked && startRow - i >= 0) {\n\t\t\t\tint end = (startRow - i) * 8 + startCol;\n\t\t\t\tPiece piece = chessboard.getSquareContents(end);\n\t\t\t\tif (chessboard.getSquareContents(end) == null) {\n\t\t\t\t\t// the route is clear, continue\n\t\t\t\t} else if ((piece instanceof Rook || piece instanceof Queen) && piece.amIWhite() == colour) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tupBlocked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (rightBlocked && downBlocked && leftBlocked && upBlocked) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private void restoreSubAreaspreviousState(ApplicationInfo readPerst)\n\t\t\tthrows RowsExceededException, WriteException, BiffException,\n\t\t\tIOException {\n\t\tString[][] localSubAreasData = readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t.getProcessingInputs().getSubAreasDataObj()\n\t\t\t\t.getPartialAreaDSForNCA();\n\t\tfor (int i = 0; i < localSubAreasData.length; i++) {\n\t\t\tfor (int j = readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t.getSortVariablesListVector().size() + 1; j < localSubAreasData[i].length; j++) {\n\t\t\t\tNcaSubAreasDispGui.createNcaSubAreasDispGuiInst().tableForPartialArea\n\t\t\t\t\t\t.setValueAt(localSubAreasData[i][j], i, j);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "private static boolean isCorner(int[][] area, int x, int y, boolean countEdges) {\r\n\t\t// Find the coordinates of the spaces adjacent to this one\r\n\t\tint[][] around = { { x - 1, y },// Left 1\r\n\t\t\t\t{ x + 1, y },// Right 1\r\n\t\t\t\t{ x, y - 1 },// Down 1\r\n\t\t\t\t{ x, y + 1 } };// Up 1\r\n\t\tint walls = 0; // Create a variable to store how many walls are next to\r\n\t\t\t\t\t // the current space\r\n\t\tfor (int[] coords : around) {// test each adjacent space\r\n\t\t\tif ((coords[1] < 0) || (coords[0] >= area.length)\r\n\t\t\t\t\t|| (coords[0] < 0) || (coords[1] >= area[x].length)) {\r\n\t\t\t\t// If this square is out of the map then it counts as a wall\r\n\t\t\t\tif (countEdges) {\r\n\t\t\t\t\twalls++;\r\n\t\t\t\t}\r\n\t\t\t} else if (area[coords[0]][coords[1]] >= 1) {\r\n\t\t\t\t// The space has a wall next to it\r\n\t\t\t\twalls++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (walls == 2 || walls == 3) { // if the block is surrounded by 2 or 3\r\n\t\t\t\t\t\t\t\t\t\t// walls, it's a corner \r\n\t\t\t\r\n\t\t\t//Check to see if this wall is just a corridor\r\n\t\t\tif( (isCorridor(area, around[0][0],around[0][1], around[1][0], around[1][1])) && \r\n\t\t\t\t\t(!isCorridor(area, around[2][0],around[2][1], around[3][0], around[3][1]))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif( (!isCorridor(area, around[0][0],around[0][1], around[1][0], around[1][1])) && \r\n\t\t\t\t\t(isCorridor(area, around[2][0],around[2][1], around[3][0], around[3][1]))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private ArrayList<Vertex> truncateHeadAtConflictArea(ArrayList<Vertex> vertices) {\n \t\tPoint2D.Double polygon[] = new Point2D.Double[conflictArea.size()];\r\n \t\tfor (int i = conflictArea.size(); --i >= 0; )\r\n \t\t\tpolygon[i] = conflictArea.get(i).getPoint();\r\n \t\tArrayList<Vertex> result = new ArrayList<Vertex>();\r\n \t\tresult.add(vertices.get(0));\r\n \t\tPoint2D.Double prevPoint = null;\r\n \t\tfor (Vertex v : vertices) {\r\n \t\t\tPoint2D.Double p = v.getPoint();\r\n \t\t\tif (null != prevPoint) {\r\n \t\t\t\tLine2D.Double line = new Line2D.Double(prevPoint, p);\r\n \t\t\t\tdouble closest = Double.MAX_VALUE;\r\n \t\t\t\tPoint2D.Double replacementPoint = null;\r\n \t\t\t\tArrayList<Point2D.Double> intersections = Planar.lineIntersectsPolygon(line, polygon);\r\n \t\t\t\t// find intersections with the polygon\r\n \t\t\t\tfor (Point2D.Double intersection : intersections) {\r\n \t\t\t\t\t// if statement added \r\n \t\t\t\t\tif (intersection != null) {\r\n \t\t\t\t\t\tdouble distance = intersection.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = intersection;\r\n \t\t\t\t\t\t\tclosest = distance;\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// find very near misses with the polygon\r\n \t\t\t\tfor (Point2D.Double pp : polygon) {\r\n \t\t\t\t\tif (Planar.distanceLineSegmentToPoint(line, pp) < veryClose) {\r\n \t\t\t\t\t\tdouble distance = pp.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = pp;\r\n \t\t\t\t\t\t\tclosest = distance;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (null != replacementPoint) {\r\n \t\t\t\t\tresult.clear();\r\n \t\t\t\t\tresult.add(new Vertex(replacementPoint, z));\r\n \t\t\t\t}\r\n \t\t\t\tresult.add(v);\r\n \t\t\t}\r\n \t\t\tprevPoint = p;\r\n \t\t}\t\t\r\n \t\treturn result;\r\n \t}", "public void setClipPolygon(PolygonSimple polygon) {\n\t\tclipPolygon = polygon;\n\t\tif (diagram != null)\n\t\t\tdiagram.setClipPoly(polygon);\n\t}", "public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}", "public Stream<Area> extractBounds() {\n if (getPolygonsAsJson() != null && !getPolygonsAsJson().trim().equalsIgnoreCase(\"[]\")) {\n ObjectMapper mapper = new ObjectMapper();\n try {\n @SuppressWarnings(\"unchecked\")\n ArrayList<LinkedHashMap<String, Double>> bounds = (ArrayList<LinkedHashMap<String, Double>>) mapper.readValue(getPolygonsAsJson(), ArrayList.class);\n return bounds.stream().map(entry -> new Area(entry.get(LEFT), entry.get(TOP), entry.get(RIGHT), entry.get(BOTTOM)));\n } catch (IOException e) {\n throw new EmbryonicException(\"Error parsing json for InterestOfAreas\", e);\n }\n }\n return Stream.empty();\n }", "public Shape getClip()\r\n\t{\r\n\t\treturn _g2.getClip();\r\n\t}", "private ResizeContext getHoverArea(Point p) {\n ResizeContext toRet = null;\n ResizeType resizeType = null;\n Point resizePoint = null;\n for (Rectangle rectangle : originalAreas) {\n if (isMatch(new Point(rectangle.x, rectangle.y), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x, rectangle.y); \n } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y); \n } else if (isMatch(new Point(rectangle.x, rectangle.y + rectangle.height), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x, rectangle.y + rectangle.height); \n } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height);\n } \n // TODO The side resizing is not yet supported.\n// else if (isMatch(new Point(rectangle.x + rectangle.width / 2, rectangle.y), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width / 2, rectangle.y); \n// } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height / 2), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height / 2); \n// } else if (isMatch(new Point(rectangle.x, rectangle.y + rectangle.height / 2), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x, rectangle.y + rectangle.height / 2); \n// } else if (isMatch(new Point(rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height); \n// }\n\n if (resizeType != null) {\n toRet = new ResizeContext(resizeType, resizePoint, rectangle);\n break;\n }\n }\n\n return toRet;\n }", "private void addZoneHolesToMap(ArrayList<Zone> activeZones) {\n final float delta = 0.0001f;\n LatLng[] wholeWorld = new LatLng[9];\n wholeWorld[0] = new LatLng(90 - delta, -180 + delta);\n wholeWorld[1] = new LatLng(0, -180 + delta);\n wholeWorld[2] = new LatLng(-90 + delta, -180 + delta);\n wholeWorld[3] = new LatLng(-90 + delta, 0);\n wholeWorld[4] = new LatLng(-90 + delta, 180 - delta);\n wholeWorld[5] = new LatLng(0, 180 - delta);\n wholeWorld[6] = new LatLng(90 - delta, 180 - delta);\n wholeWorld[7] = new LatLng(90 - delta, 0);\n wholeWorld[8] = new LatLng(90 - delta, -180 + delta);\n\n PolygonOptions polyOpts = new PolygonOptions().clickable(true).add(wholeWorld);\n\n for (Zone z : activeZones) {\n LatLng[] coords = z.getCoords();\n ArrayList<LatLng> coordsIterable = new ArrayList<LatLng>();\n for (int c = 0; c < coords.length; c++) {\n coordsIterable.add(coords[c]);\n }\n polyOpts.addHole(coordsIterable);\n }\n\n // Store a data object with the polygon, used here to indicate an arbitrary type.\n Polygon polygon1 = mMap.addPolygon(polyOpts);\n polygon1.setTag(\"A\");\n polygon1.setStrokeWidth(6); // px width of stroke\n polygon1.setStrokeColor(0xffff8800); // Opaque orange\n polygon1.setFillColor(0x88222222); // Transparent dark grey defined as ARGB\n }", "private void shrink(int hole) {\n int i = hole + 1;\n while (s[i] != null) {\n s[i-1] = s[i];\n s[i] = null;\n i++;\n if (i >= s.length) break;\n }\n }", "public\t\tvoid\t\tinvalidateArea(MiBounds area)\n\t\t{\n\t\tsuper.invalidateArea(area);\n\t\t}", "public String canonical(ArrayList<Integer> shape) {\n String ans = \"\";\n int lift = grid.length + grid[0].length;\n int[] out = new int[shape.size()];\n int[] xs = new int[shape.size()];\n int[] ys = new int[shape.size()];\n\n for (int c = 0; c < 8; ++c) {\n int t = 0;\n for (int z: shape) {\n int x = z / grid[0].length;\n int y = z % grid[0].length;\n //x y, x -y, -x y, -x -y\n //y x, y -x, -y x, -y -x\n xs[t] = c<=1 ? x : c<=3 ? -x : c<=5 ? y : -y;\n ys[t++] = c<=3 ? (c%2==0 ? y : -y) : (c%2==0 ? x : -x);\n }\n\n int mx = xs[0], my = ys[0];\n for (int x: xs) mx = Math.min(mx, x);\n for (int y: ys) my = Math.min(my, y);\n\n for (int j = 0; j < shape.size(); ++j) {\n out[j] = (xs[j] - mx) * lift + (ys[j] - my);\n }\n Arrays.sort(out);\n String candidate = Arrays.toString(out);\n if (ans.compareTo(candidate) < 0) ans = candidate;\n }\n return ans;\n }", "private void resetPolygonsFlags() {\n for ( Polygon p : polygons ) {\n p.setOverlap(false);\n }\n }", "@java.lang.Override\n public int getClippingAreaIndex() {\n return clippingAreaIndex_;\n }", "public static void spreadDust() {\n newMap = new int[R][C];\n\n for (int i = 0; i < R; i++) {\n for (int j = 0; j < C; j++) {\n if (map[i][j] > 0) {\n int cnt = 0;\n for (int d = 0; d < 4; d++) {\n int ny = i + dy[d];\n int nx = j + dx[d];\n\n if (ny < 0 || ny > R - 1 || nx < 0 || nx > C - 1 || map[ny][nx] == -1)\n continue;\n\n newMap[ny][nx] += map[i][j] / 5;\n cnt++;\n }\n newMap[i][j] += map[i][j] - (map[i][j] / 5) * cnt;\n } else if (map[i][j] == -1) {// 공기청정기 위치.\n newMap[i][j] = -1;\n// airCleaner.add(new Point4(j, i));\n }\n }\n }\n\n for (int i = 0; i < R; i++) {\n map[i] = Arrays.copyOf(newMap[i], C);\n }\n\n cleanAir(airCleaner.get(0), airCleaner.get(1));\n\n }", "private boolean canBlackMoveLeft(Pedina pedina) {\n if(!controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1))\n return false;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY())\n seVadoSinistraVengoMangiato = true;\n }\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() == arrayPedineBianche.get(i).getY()\n && pedina.getY() - 2 >= 0\n && controllaSeCasellaLibera(pedina.getX(), pedina.getY() - 2))\n seVadoSinistraVengoMangiato = true;\n }\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()\n && pedina.getX() + 2 <= 7\n && arrayPedineBianche.get(i) instanceof Damone\n && controllaSeCasellaLibera(pedina.getX() + 2, pedina.getY())) \n seVadoSinistraVengoMangiato = true;\n }\n \n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n return false;\n else {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n }\n }\n }" ]
[ "0.56575", "0.5639717", "0.56116974", "0.560309", "0.5498465", "0.5370901", "0.5334972", "0.51565856", "0.49066314", "0.48686796", "0.48495907", "0.48449793", "0.4769435", "0.47544613", "0.47225726", "0.4712773", "0.46497062", "0.45725563", "0.45442495", "0.4516171", "0.4509499", "0.4507845", "0.44563594", "0.44543144", "0.445256", "0.44499007", "0.4421175", "0.43875664", "0.43864152", "0.43376896", "0.431419", "0.4304211", "0.42906424", "0.42808202", "0.42725515", "0.42648476", "0.42546463", "0.42515707", "0.42500833", "0.42483285", "0.42383507", "0.42357185", "0.42347866", "0.42284617", "0.42145792", "0.42134687", "0.4210829", "0.4210232", "0.420614", "0.42056078", "0.41964436", "0.4194556", "0.41612604", "0.41592523", "0.4155729", "0.41521674", "0.41481522", "0.41441151", "0.41342145", "0.41291842", "0.41276923", "0.4121533", "0.4121108", "0.41011173", "0.40953103", "0.4090194", "0.40895024", "0.40797952", "0.40789458", "0.40738955", "0.4065552", "0.40595818", "0.40577915", "0.40542272", "0.40466633", "0.403974", "0.40393752", "0.40392098", "0.403758", "0.40333375", "0.4032224", "0.40313753", "0.402676", "0.4020096", "0.4019691", "0.4016535", "0.40157214", "0.4015708", "0.40134978", "0.40116054", "0.40092167", "0.4006471", "0.40025356", "0.39990124", "0.39978898", "0.39897186", "0.39891824", "0.3987279", "0.3984235", "0.39824462" ]
0.6881947
0
This routine clips a GFA polygon against common bounds of the extended FA area bounds and finds the intersection points of the polygon with the bound. Then the intersection points are snapped individually to points outside of the polygon. Both the intersection points and their snapped matches are returned in map coordinate.
private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly ) { HashMap<Coordinate, Coordinate> interPtsPair = new HashMap<Coordinate, Coordinate>(); ArrayList<Coordinate> interPts = new ArrayList<Coordinate>(); ArrayList<Coordinate> pts; ArrayList<Integer> interIndex = new ArrayList<Integer>(); ArrayList<Integer> indx = new ArrayList<Integer>(); //Reorder in clockwise - first point is repeated at the end. ArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>(); for ( Coordinate c : gfaPoly.getCoordinates() ) { gfaPoints.add( c ); } ArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null ); //Get all intersection point with FA region common border. HashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds(); for ( Geometry bnd : areaCommBnds.values() ) { pts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), bnd.getCoordinates(), indx ); if ( pts.size() > 0 ) { interPts.addAll( pts ); interIndex.addAll( indx ); } } if ( interPts.size() <= 0 ) { return interPtsPair; } /* * Find the area common bound points inside the polygon to ensure * the new snap points will not cluster with these points. */ ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>(); for ( Geometry g : areaCommBnds.values() ) { for ( Coordinate c : g.getCoordinates() ) { Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } ); if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) { checkPoints.add( c ); } } } /* * Now insert each common intersection point into the el polygon * and snap it outside of the el polygon. * * Note: the point cannot be any point of the el polygon or any * snap point that has been used. * * If an intersection point is not within the clustering distance of * the point before it (Pb) or point after it (Pa), simply insert it into * the polygon and snap it. Otherwise, do the following: * * 1. Pick the closer one of Pb and Pa as Pn. * 2. Check if Pn is within the clustering distance of the common boundary * points inside the FROM line. * 3. If so, snap Pn to the closest point not within the clustering distance * and match the intersection point and Pn to the new point. * 4. If not, match the intersection point with Pn. */ ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>(); usedPoints.addAll( cwGfaPts ); ArrayList<Coordinate> ePts = new ArrayList<Coordinate>(); for ( int ii = 0; ii < interPts.size(); ii++ ) { Coordinate interP = interPts.get( ii ); Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) ); Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 ); double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore ); double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter ); int addOne = -1; int qmatch = -1; double qdist; if ( qdist1 < qdist2 ) { qmatch = interIndex.get( ii ); qdist = qdist1; } else { qmatch = interIndex.get( ii ) + 1; qdist = qdist2; } if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) { Coordinate ptMatch = cwGfaPts.get( qmatch ); for ( Coordinate c : checkPoints ) { if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) { addOne = qmatch; break; } } if ( addOne < 0 ) { interPtsPair.put( new Coordinate( interP ), new Coordinate( ptMatch ) ); continue; //Done - ptMatch is a snapped point. } } // Snap int kk, kk2; if ( addOne >= 0 ) { kk = addOne; kk2 = kk; ePts.clear(); ePts.addAll( cwGfaPts ); } else { ePts.clear(); ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) ); kk = interIndex.get( ii ) + 1; kk2 = kk; } ePts.remove( ePts.size() - 1 ); Coordinate[] snapped = new Coordinate[1]; //snap.... int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, ePts, true, true, 3.0F, snapped ); if ( status != 0 ) { if ( addOne >= 0 ) { snapped[ 0 ] = new Coordinate( ePts.get( kk ) ); } else { snapped[ 0 ] = new Coordinate( interP ); } } interPtsPair.put( new Coordinate( interP ), new Coordinate( snapped[ 0 ] ) ); if ( addOne >= 0 ) { interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), new Coordinate( snapped[ 0 ] ) ); } usedPoints.add( snapped[ 0 ] ); } return interPtsPair; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Multimap<String, String> intersects(Polygon bounds);", "private ArrayList<Gfa> faAreaClip( Gfa smear, ArrayList<Gfa> snapshots ) {\n \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t\t//If smear can be formatted, return.\n\t\tif ( canBeFormatted( smear ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\n\t\t/*\n\t\t * If the smear resides only in one FA area or two areas belong to different \n\t\t * FA regions, no need to clip. \n\t\t */\n\t\tString faAreas = smear.getGfaArea();\n\t\tif ( !faAreas.contains( \"-\" ) ||\n\t\t\t !isSameFaRegion( faAreas ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t\t\n\n\t\t// Retrieve extended FA area bounds\n\t\tHashMap<String, Geometry> xareaBnds = GfaClip.getInstance().getFaAreaXBoundsInGrid();\n\n\t\t\n\t\t/*\n\t\t * Find the intersection points with the extended FA area bounds and snap them. \n\t\t */\n\t\tPolygon smearPoly = GfaClip.getInstance().gfaToPolygon( smear );\n\t\tPolygon smearPolyInGrid = GfaClip.getInstance().gfaToPolygonInGrid( smear );\n\t\tHashMap<Coordinate, Coordinate> areaInterPts = getAreaIntersectionPt( smearPoly );\n\n\t\t/*\n\t\t * Do area clipping. The strategy is the same as regional clipping.\n\t\t * \n\t\t * 1. clip the smear polygon against each FA region (WEST, CENTRAL, EAST)\n\t\t * 2. create a list of parts bigger than/equal to 3K for each region\n\t\t * 3. hold the parts smaller than 3K for all regions in another list. \n\t\t */\n\t\tHashMap<String, ArrayList<Geometry> > clipWithAreas = new HashMap<String, ArrayList<Geometry> >(); \n\n\t\tArrayList<Geometry> smallPoly = new ArrayList<Geometry>(); \n\n\t\tfor ( String areaName : xareaBnds.keySet() ) {\n\n\t\t\tif ( !faAreas.contains( areaName ) ) continue;\n\n\t\t\tclipWithAreas.put( areaName, new ArrayList<Geometry>() );\n\n\t\t\t//Do area clipping as described above.\n\t\t\tGeometry areaBnd = xareaBnds.get( areaName );\t\t\t\t \n\t\t\tif ( areaBnd.intersects( smearPolyInGrid ) ) {\n\n\t\t\t\tGeometry areaPoly = areaBnd.intersection( smearPolyInGrid );\t\n\n\t\t\t\tif ( areaPoly != null ) {\t\t\t\t\t \t\t\t\t\t\t\t\n\t\t\t\t\tfor ( int kk = 0; kk < areaPoly.getNumGeometries(); kk++ ) {\t\t\t\t\t \t \n\t\t\t\t\t\tGeometry bigPoly = areaPoly.getGeometryN( kk );\t\t\t\t\t \t \n\n\t\t\t\t\t\tif ( GfaClip.getInstance().isBiggerInGrid( bigPoly ) ) {\t\t\t\t\t \t\n\t\t\t\t\t\t\tclipWithAreas.get( areaName ).add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tsmallPoly.add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\t \n\n\t\t}\t\t\t\t\t\t\t\t\n\n\t\t/*\n\t\t * Create smears from VALID parts and add into the return list\n\t\t * \n\t\t * 1. Union the parts in each FA region with the list of small parts -\n\t\t * If a small part touches one of the bigs (only one, I believe), it\n\t\t * will be united into that big and thus be included into a new\n\t\t * smear. So no part gets lost and all will be included eventually.\n\t\t * 2. When a small part is united into a big one (if they intersect), \n\t\t * the common points are still retained in the result, we need to \n\t\t * remove those extra point. The common points are resulted from the\n\t\t * previous clipping with the area boundaries.\n\t\t * 3. check the resulting union for VALID geometries and create new\n\t\t * smears for each of them.\t \t\t\t\n\t\t */\n\t\tfor ( String areaName : clipWithAreas.keySet() ) {\n\n\t\t\tArrayList<Geometry> bigs = clipWithAreas.get( areaName );\n\n\t\t\tArrayList<Geometry> toBeUnioned = new ArrayList<Geometry>();\n\t\t\ttoBeUnioned.addAll( bigs );\n\t\t\ttoBeUnioned.addAll( smallPoly );\n\t\t\tGeometry result = GfaClip.getInstance().quickUnion( toBeUnioned ); \t\t\t\n\n\t\t\tArrayList<Coordinate> commPts = GfaClip.getInstance().getCommonPoints( bigs, smallPoly );\n\n\t\t\tif ( result != null ) {\t\t \n\n\t\t\t\tfor ( int kk = 0; kk < result.getNumGeometries(); kk++ ) {\n\n\t\t\t\t\tGeometry one = result.getGeometryN( kk );\n\n\t\t\t\t\t//Remove residue points by clipping followed by subsequent union.\n\t\t\t\t\tGeometry onePart = GfaClip.getInstance().removeCommonPoints( one, commPts );\n\n\t\t\t\t\t//Clean up some improper cases\n\t\t\t\t\tCoordinate[] gPts = PgenUtil.gridToLatlon( onePart.getCoordinates() );\n\t\t\t\t\tArrayList<Coordinate> points = new ArrayList<Coordinate>();\n\t\t\t\t\tfor ( Coordinate c : gPts ) {\n\t\t\t\t\t\tpoints.add( c );\n\t\t\t\t\t}\n\t\t\t\t\tpoints.remove( points.size() - 1 );\n\n\t\t\t\t\t//Geometry cleanPts = GfaClip.getInstance().cleanupPoints( onePart );\n\t\t\t\t\t\n\t\t\t\t\tGeometry cleanPts = GfaClip.getInstance().cleanupPoints( \n\t\t\t\t\t\t\t GfaClip.getInstance().pointsToGeometry( points ) );\n\n\t\t\t\t\tif ( GfaClip.getInstance().isAddableAsSmear( cleanPts, snapshots, smear ) ) {\n\n\t\t\t\t\t\t//Replace intersection points with their pre-snapped pair.\n\t\t\t\t\t\tGeometry rplPts = GfaClip.getInstance().replacePts( cleanPts, areaInterPts );\n\n\t\t\t\t\t\t//Create a new GFA smear.\n\t\t\t\t\t\tcleanPts = GfaClip.getInstance().cleanupPoints( rplPts );\n\t\t\t\t\t\t\n\t\t\t\t\t\tGfa newElm = GfaClip.getInstance().geometryToGfa( smear, cleanPts );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tnewElm.setGfaArea( areaName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewSmears.add( newElm );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( Gfa gg : newSmears ) {\n\t\t boolean[] reduFlg = new boolean[ gg.getPoints().size() ];\n\t\t\tint ii = 0;\n\t\t for ( Coordinate newPt : gg.getPoints() ) {\n\t\t \treduFlg[ ii ] = false;\n\t\t \t\n\t\t \tfor ( int jj = 0; jj < smear.getPoints().size(); jj++ ) {\n\t\t \t\tif ( GfaSnap.getInstance().isSamePoint( newPt, \n\t\t \t\t\t\t smear.getPoints().get( jj ), GfaSnap.MAP_PRECISION ) ) {\n\t\t \t\t\treduFlg[ ii ] = smear.getReduceFlags()[ jj ];\n\t\t \t\t\tbreak;\t\t \t\t\t\n\t\t \t\t}\n\t\t \t}\n\t\t \tii++;\n\t\t }\n\t\t\t\n\t\t\tgg.setReduceFlags( reduFlg ); \n\t\t}\n\t\t\t\t\t\t\t\t\n\t\treturn newSmears;\n\t\n }", "public void drawArea(Graphics2D g, int width, int height, double minX,\n double minY, double maxX, double maxY) {\n upperX = maxX;\n lowerX = minX;\n\n upperY = maxY;\n lowerY = minY;\n //debug, drawLine bounds\n// g.drawLine(XOffSet, YOffSet, width, YOffSet);\n// g.drawLine(XOffSet, height, width, height); //X\n//\n// g.drawLine(XOffSet, YOffSet, XOffSet, height);\n// g.drawLine(width, YOffSet, width, height); //Y\n\n double Xscale = GetXScale(width);\n double Yscale = GetYScale(height);\n int centerX = getCenterX(width);\n int centerY = getCenterY(height);\n\n //drawGrid(g, width, height, minX, minY, maxX, maxY);\n\n //create a polygon for every area between two zeros\n g.setColor(LineColor);\n //ArrayList<Polygon> p = new ArrayList<>();\n Polygon p = new Polygon();\n //p.add(new Polygon());\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n Opacity));\n //p.get(0).addPoint(XOffSet, getCenterY(height));\n p.addPoint(XOffSet, getCenterY(height));\n for (int i = 0; i <= PointArray.length - 2; i += 2) {\n double x = ((PointArray[i] * Xscale) + centerX);\n double y = ((centerY) - (PointArray[i + 1]) * Yscale);\n if (x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {\n continue;\n }\n if (y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY) {\n y = height - YOffSet;\n }\n //p.get(p.size() - 1).addPoint((int) x, (int) y);\n p.addPoint((int) x, (int) y);\n }\n //p.get(p.size() - 1).addPoint(width, getCenterY(height));\n p.addPoint(width, getCenterY(height));\n //for (int i = 0; i <= p.size() - 1; i++) {\n g.fill(p);//.get(i));\n //}\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1));\n drawLine(g, width, height, minX, minY, maxX, maxY);\n }", "private final Geometry computeGeometryDifference( \n Geometry featureGeometryOnMap, \n Geometry clippingGeometryOnMap,\n CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n\n // assert: clipping does not contains featrue's geometry but intersect\n FeatureStore<SimpleFeatureType, SimpleFeature> store = getTargetStore();\n \n final SimpleFeatureType featureType = store.getSchema();\n final CoordinateReferenceSystem targetLayerCrs = featureType.getDefaultGeometry()\n .getCRS();\n Geometry resultGeometry = null;\n try {\n \n if (!featureGeometryOnMap.contains(clippingGeometryOnMap)) {\n\n // clipping does not contain the feature and features does not contain clipping area\n // then constructs the following difference: feature'geometry - clipping area\n\n Geometry diffGeometry = featureGeometryOnMap.difference(clippingGeometryOnMap);\n\n Geometry adjustedGeom = GeoToolsUtils.reproject(diffGeometry, mapCrs, targetLayerCrs);\n \n resultGeometry = adjustedGeom;\n } else {\n // Note: if the condition is false, feature's geometry could contain clipping\n // then feature with hole is required. This process does not produce hole geometry.\n resultGeometry = featureGeometryOnMap;\n }\n return resultGeometry;\n\n } catch (OperationNotFoundException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_executing_reproject,\n mapCrs.getName(), targetLayerCrs.getName());\n \n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n\n } catch (TransformException e) {\n\n final String msg = MessageFormat.format(Messages.ClipProcess_failed_transforming,\n mapCrs.getName(), targetLayerCrs.getName());\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n\n }", "static R2Rect getClippedEdgeBound(R2Vector a, R2Vector b, R2Rect clip) {\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (clipEdgeBound(a, b, clip, bound)) {\n return bound;\n }\n return R2Rect.empty();\n }", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "private GeometryCollection computeGeometrySplit( \n final Geometry featureGeometryOnMapCrs,\n final Geometry clippingGeometryOnMapCrs,\n final CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n try {\n // does the difference \n Geometry geoDiff = featureGeometryOnMapCrs.difference(clippingGeometryOnMapCrs);\n assert geoDiff instanceof GeometryCollection;\n \n GeometryCollection geoCollection = (GeometryCollection) geoDiff;\n\n return geoCollection;\n \n } catch (Exception e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "private void clipFeatureUsing(final SimpleFeature featureToClip,\n final CoordinateReferenceSystem featureToClipCrs,\n final Geometry clippingGeometryOnMap,\n final CoordinateReferenceSystem mapCrs) \n throws SOProcessException {\n\n try {\n Geometry featureGeometryToClip = (Geometry) featureToClip.getDefaultGeometry();\n\n // iterate in the feature's geometries to clip and applies the delete, split or difference operation\n // using the clipping geometry\n int resultGeomSize = featureGeometryToClip.getNumGeometries();\n List<Geometry> resultClipGeom = new ArrayList<Geometry>(resultGeomSize);\n \n for( int i = 0; i < featureGeometryToClip.getNumGeometries(); i++ ) {\n \n Geometry simpleGeomToClip = featureGeometryToClip.getGeometryN(i);\n\n Geometry featureGeometryOnMapCrs = GeoToolsUtils.reproject(simpleGeomToClip,\n featureToClipCrs, \n mapCrs);\n // Analyses the geometry's positon\n if (clippingGeometryOnMap.contains(featureGeometryOnMapCrs)) {\n \n continue; // it will be deleted from target (if \"to clip layer\" is equal to target layer) \n // or does not add this geometry to result\n\n } else if (splits(clippingGeometryOnMap, featureGeometryOnMapCrs)) {\n\n Geometry splitGeom = computeGeometrySplit(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(splitGeom);\n\n } else if (clippingGeometryOnMap.intersects(featureGeometryOnMapCrs)) {\n\n Geometry diffGeom = computeGeometryDifference(featureGeometryOnMapCrs,\n clippingGeometryOnMap, mapCrs);\n \n resultClipGeom.add(diffGeom);\n }\n }\n //postcondition: {resultClipGeom is a Collection with Geometries modified with difference, deleted and splited geom (new geom) }\n GeometryFactory factory = featureGeometryToClip.getFactory();\n \n GeometryCollection resultCollection = factory.createGeometryCollection(resultClipGeom.toArray(new Geometry[]{}));\n\n updateTargetWith(featureToClip, resultCollection);\n \n } catch (Exception e) {\n LOGGER.severe(e.getMessage());\n throw new SOProcessException(Messages.ClipProcess_failed_executing_reproject);\n }\n\n }", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "private int[] calculateCoverage(Route rt, Point edge){\n\n \tint[] latLonMinMax = new int[4];\n \t\n // figure out the bounding box of the route\n latLonMinMax[0] = rt.getStart().getLatitude();\n latLonMinMax[1] = latLonMinMax[0];\n latLonMinMax[2] = rt.getStart().getLongitude();\n latLonMinMax[3] = latLonMinMax[2];\n \n for(GeoSegment gs : rt.getGeoSegments()){\n \tint temp = gs.getP2().getLatitude();\n \tlatLonMinMax[0] = latLonMinMax[0] > temp ? temp : latLonMinMax[0];\n \tlatLonMinMax[1] = latLonMinMax[1] < temp ? temp : latLonMinMax[1];\n \t\n \ttemp = gs.getP2().getLongitude();\n \tlatLonMinMax[2] = latLonMinMax[2] > temp ? temp : latLonMinMax[2];\n \tlatLonMinMax[3] = latLonMinMax[3] < temp ? temp : latLonMinMax[3];\n }\n \n \n // now use aspect ratio of the window to get bounds of the display\n int diffLat = latLonMinMax[1] - latLonMinMax[0];\n int diffLon = latLonMinMax[3] - latLonMinMax[2];\n \n // the longest aspect will be a larger ratio\n double horzAsp = diffLon / edge.getX();\n double vertAsp = diffLat / edge.getY();\n \n double expandLat = 0.0;\n double expandLon = 0.0;\n if(horzAsp > vertAsp){\n \tdouble factor = horzAsp/vertAsp;\n \t// calculate the expansion of the short dimension\n \texpandLat = ((diffLat * factor - diffLat) / 2.0);\n \texpandLat += ((diffLat * factor) / 20.0); // 20.0 for 5%\n \t// long dimension\n \texpandLon = diffLon / 20.0;\n }else{\n\t double factor = vertAsp/horzAsp;\n\t \t// calculate the expansion of the short dimension\n\t \texpandLon = ((diffLon * factor - diffLon) / 2);\n \texpandLon += ((diffLon * factor) / 20.0);\n \t// long dimension\n \texpandLat = diffLat / 20.0;\n }\n \n latLonMinMax[0] -= ( ((int)expandLat) != 0 ? ((int)expandLat) : 2);\n latLonMinMax[1] += ( ((int)expandLat) != 0 ? ((int)expandLat) : 2);\n latLonMinMax[2] -= ( ((int)expandLon) != 0 ? ((int)expandLon) : 2);\n latLonMinMax[3] += ( ((int)expandLon) != 0 ? ((int)expandLon) : 2);\n \n \treturn latLonMinMax;\n }", "Multimap<String, String> intersects(RectangleLatLng bounds);", "private boolean segIntPoly( Coordinate[] segIn, Coordinate[] polyIn ) {\n\t\t\n\t\tboolean qualify = true;\n\t\t\n\t\t//Convert to grid coordinate.\n\t\tCoordinate[] seg = PgenUtil.latlonToGrid( segIn );\n\t\tCoordinate[] poly = PgenUtil.latlonToGrid( polyIn );\n\t\t\n\t\t//Get mid-point and form geometries.\t\t\n\t\tCoordinate[] midp = new Coordinate[1];\t\t\n\t\tmidp[0] = new Coordinate( (seg[0].x + seg[1].x) / 2.0, (seg[0].y + seg[1].y) / 2.0 );\n\t\tGeometry point = GfaClip.getInstance().pointsToGeometry( midp );\n\t\tGeometry polygon = GfaClip.getInstance().pointsToGeometry( poly );\t\t\n\n\t\t//Disqualify if the segment lies outside of the polygon\n\t\tif ( !point.within( polygon ) ) {\n\t\t\tqualify = false;\n\t\t}\n\t\telse {\n\t\t\tGeometry segment = GfaClip.getInstance().pointsToGeometry( seg );\t \t\n\n\t\t\tif ( segment.intersects( polygon ) ) {\n\t\t\t\tCoordinate[] ipts = segment.intersection( polygon ).getCoordinates();\n\t\t\t\t/*\n\t\t\t\t * Disqualify if the segment intersects other segments of the polygon - \n\t\t\t\t * except the segments that share either the starting or ending \n\t\t\t\t * point with the segment on check.\n\t\t\t\t */\n\t\t\t\tif ( ipts.length != 2 ) {\n\t\t\t\t\tqualify = false;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\n\t\t\n\t\treturn qualify;\n\t}", "public static FPoint2[] findSnapErrors(Grid grid, SnapArrangement ar) {\n\n DArray a = new DArray();\n do {\n extractSnapPoints(ar);\n\n // construct a list of segment sections between snap points\n DArray fragList = new DArray();\n FRect fragBounds = null;\n\n Graph g = ar.getGraph();\n for (int jj = 0; jj < ar.nNodes(); jj++) {\n int id1 = jj + ar.idBase();\n for (int kk = 0; kk < g.nCount(id1); kk++) {\n int id2 = g.neighbor(id1, kk);\n if (id2 < id1)\n continue;\n\n // Segment seg = segs[i];\n // for (int j = 0; j < seg.nSnapPoints() - 1; j++) {\n Endpoints ep = new Endpoints(grid, ar.hotPixel(id1), ar.hotPixel(id2));\n if (fragBounds == null)\n fragBounds = new FRect(ep.v0, ep.v1);\n fragBounds.add(ep.v0);\n fragBounds.add(ep.v1);\n fragList.add(ep);\n }\n }\n\n if (fragList.isEmpty())\n break;\n\n // to speed up this process, divide bounds into a grid of bucket/pixels.\n // Each bucket contains the fragments whose minimum bounding rectangles\n // intersect the bucket's pixel. \n // Thus we need only compare fragments against others from the same bucket.\n\n int nBuckets = Math.max(1, ar.nNodes() / 60);\n DArray[] buckets = new DArray[nBuckets * nBuckets];\n {\n double bWidth = fragBounds.width / nBuckets, bHeight = fragBounds.height\n / nBuckets;\n for (int i = 0; i < buckets.length; i++)\n buckets[i] = new DArray();\n for (int i = 0; i < fragList.size(); i++) {\n Endpoints e = (Endpoints) fragList.get(i);\n // add endpoint to every bucket it may intersect\n int y0 = (int) ((Math.min(e.v0.y, e.v1.y) - fragBounds.y) / bHeight);\n int y1 = MyMath.clamp(\n (int) ((Math.max(e.v0.y, e.v1.y) - fragBounds.y) / bHeight), 0,\n nBuckets - 1);\n int x0 = (int) ((Math.min(e.v0.x, e.v1.x) - fragBounds.x) / bWidth);\n int x1 = MyMath.clamp(\n (int) ((Math.max(e.v0.x, e.v1.x) - fragBounds.x) / bWidth), 0,\n nBuckets - 1);\n\n for (int y = y0; y <= y1; y++) {\n for (int x = x0; x <= x1; x++) {\n buckets[y * nBuckets + x].add(e);\n }\n }\n }\n }\n\n final double NEARZERO = .00001;\n\n for (int k = 0; k < buckets.length; k++) {\n DArray b = buckets[k];\n for (int i = 0; i < b.size(); i++) {\n Endpoints ei = (Endpoints) b.get(i);\n\n for (int j = i + 1; j < b.size(); j++) {\n Endpoints ej = (Endpoints) b.get(j);\n\n FPoint2 pt = MyMath.lineSegmentIntersection(ei.v0, ei.v1, ej.v0,\n ej.v1, null);\n if (pt == null)\n continue;\n String err = null;\n\n // make sure the intersection occurs at an endpoint of each\n double di = Math.min(pt.distance(ei.v0), pt.distance(ei.v1));\n double dj = Math.min(pt.distance(ej.v0), pt.distance(ej.v1));\n\n // in triangle grid, fragment endpoint can lie on other fragment.\n // To eliminate this possibility, intersection point must be\n // distinct from all four endpoints.\n\n if (Math.min(di, dj) > NEARZERO) {\n err = \"\";\n }\n if (err != null) {\n a.add(pt);\n // a.add(err);\n }\n }\n }\n }\n } while (false);\n return (FPoint2[]) a.toArray(FPoint2.class);\n }", "public ArrayList<ArrayList<String>> extractCoordsFromWfsXml(String xml_og) {\r\n\t\tSystem.out.println(\"ParserXmlJson.extractBoundingBoxFromWfsXml: \"+ xml_og);\r\n\t\tPointPolygon point = new PointPolygon();\r\n\t\tArrayList<String> list_objectid = new ArrayList<String>();\r\n\t\tArrayList<String> list_coords = new ArrayList<String>();\r\n\t\tArrayList<ArrayList<String>> list_coords_objectid = new ArrayList<ArrayList<String>>();\r\n\t\t\r\n\t\t\r\n\t\tDocumentBuilder dbuilder = null;\r\n\t\ttry {\t\t\t\r\n\t\t\tXPath xPath = XPathFactory.newInstance().newXPath();\r\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\tdbFactory.setNamespaceAware(true);\r\n\t DocumentBuilder builder = dbFactory.newDocumentBuilder();\r\n\t Document doc = builder.parse(new InputSource(new StringReader(xml_og)));\r\n\t \t \r\n\t \txPath.setNamespaceContext(new NamespaceContext() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic Iterator getPrefixes(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t @Override\r\n\t\t\t public String getNamespaceURI(String args) {\r\n\t\t\t if(LoadOnStartAppConfiguration.arbeitsbereichXmlTagPolygon.equals(args)){\r\n\t\t\t \treturn LoadOnStartAppConfiguration.arbeitsbereichXmlTagPolygon;\r\n\t\t\t }else if(\"gml\".equals(args)){\r\n\t\t\t \treturn \"http://www.opengis.net/gml/3.2\"; \t\r\n\t\t\t }else{\r\n\t\t\t \treturn null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t});\t\t\r\n//\t \tString path_offering = \"/wfs:FeatureCollection/wfs:member/geofence_sbg:geofence_sbg_bbox/@gml:id\";\r\n//\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n//\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getNodeValue());\r\n\t\t\t\t/*\r\n\t\t\t\tString path_offering = \"/soap:Envelope/soap:Body/sos:Capabilities/@version\";\r\n\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getTextContent());\r\n\t\t\t\t\r\n\t\t\t\tString path_procedures = \"//om:OM_Observation[@name='GetObservation']/ows:Parameter[@name='procedure']/ows:AllowedValues/ows:Value\"; */\r\n//\t\t\t\tString pathToLoading = \"//om:OM_Observation[om:observedProperty[@xlink:href='http://ispace.researchstudio.at/ont/swe/property/Loading']]/om:result\";\r\n\t\t\t\t\r\n\t\t\t\t//jetzt werden hier aber alle X Y Koordinaten,die sich in InsertObservation.xml wiederholen, ausgelesen werden\r\n\t \tString pathToObjectid = \"//geofence_sbg:objectid\";\r\n\t \tNodeList nodes_Objectid = (NodeList)xPath.compile(pathToObjectid).evaluate(doc, XPathConstants.NODESET);\r\n\t \t\r\n\t\t\t\tString pathToCoordinates =\"//gml:LinearRing/gml:posList\";\r\n\t\t\t\tNodeList nodes_position = (NodeList)xPath.compile(pathToCoordinates).evaluate(doc, XPathConstants.NODESET);\r\n\t\t\t\t//book[title/@lang = 'it'] [@uom='abc']\r\n\t\t\t\t//myNodeList.item(0).setNodeValue(\"Hi mom!\");\r\n\t\t\t\tString xy= \"\";\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"vor for loop ParserXmlJson.extractPointFromIO:\"+ nodes_position.getLength());\t\r\n\t\t\t\tfor(int n = 0; n<nodes_position.getLength(); n++){\r\n\t\t\t\t\tSystem.out.println(\"ParserXmlJson.extractPointFromIO: \"+nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBox.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tlist_coords.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\tSystem.out.println(\"ParserXmlJson.extractPointFromIO objectid: \"+nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\tlist_objectid.add(nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//node_procedures.item(n).setTextContent(\"4444\");\r\n\t\t\t\t\t//System.out.println(\"ParserXmlJson.parseInsertObservation:parser EDITED:\"+node_procedures.item(n).getTextContent());\r\n\t\t\t\t}\t\t\t\r\n\t\t\t//\tSystem.out.println(TextFiles.xmlDocument2StringWithPrettyPrint(doc, 2));\r\n\t\t\t\ttry{\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tSystem.out.println(\"Error: maybe no coordinates!\");\r\n\t\t\t\t\te.printStackTrace();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\t\t\t\r\n\t\tlist_coords_objectid.add(list_coords);\r\n\t\tlist_coords_objectid.add(list_objectid);\r\n\t\treturn list_coords_objectid;//point.list_ofStrConsistingOf5CoordinatesForBoundingBox;\t\t\t\t\r\n\t}", "List<GeoPoint> findGeoIntersections(Ray ray);", "RectangleLatLng getBounds();", "private static void fillWithFlagAboveSubLitPart(\n GRect cbbox,\n MyFlagManager flagManager,\n int[] xMinArr,\n int[] xMaxArr,\n int j,\n int segmentXMin,\n int segmentXMax,\n byte segmentFlag) {\n \n final int subJ = j + 1;\n final int subXMinLit = xMinArr[subJ];\n final int subXMaxLit = xMaxArr[subJ];\n if (DEBUG) {\n Dbg.log(\"subXMinLit = \" + subXMinLit);\n Dbg.log(\"subXMaxLit = \" + subXMaxLit);\n }\n if (subXMinLit <= subXMaxLit) {\n final int cmnXMin = Math.max(segmentXMin, subXMinLit + 1);\n final int cmnXMax = Math.min(segmentXMax, subXMaxLit - 1);\n if (DEBUG) {\n Dbg.log(\"cmnXMin = \" + cmnXMin);\n Dbg.log(\"cmnXMax = \" + cmnXMax);\n }\n if (cmnXMin <= cmnXMax) {\n final int tmpI = cmnXMin - cbbox.x();\n final int indexFrom = tmpI + j * cbbox.xSpan();\n final int indexTo = indexFrom + (cmnXMax - cmnXMin);\n if (DEBUG) {\n Dbg.log(\"indexFrom = \" + indexFrom);\n Dbg.log(\"indexTo = \" + indexTo);\n }\n fillWithFlag(\n flagManager,\n indexFrom,\n indexTo,\n segmentFlag);\n }\n }\n }", "private final void clipFeatureCollectionUsingClippingFeature( \n final FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollectionToClip,\n final CoordinateReferenceSystem featureToClipCrs, \n final SimpleFeature clippingFeature,\n final CoordinateReferenceSystem clippingCrs, \n final CoordinateReferenceSystem mapCrs ) throws SOProcessException {\n\n FeatureIterator<SimpleFeature> iter = null;\n try {\n Geometry clippingFeatureGeometry = (Geometry) clippingFeature.getDefaultGeometry();\n\n // iterate for each clipping feature'geometry (general case is collection, particular case only one geometry)\n for(int i=0; i < clippingFeatureGeometry.getNumGeometries(); i++){\n\n Geometry clippingGeometry = clippingFeatureGeometry.getGeometryN(i);\n \n Geometry clippingGeometryOnMap = GeoToolsUtils.reproject(clippingGeometry, \n clippingCrs,\n mapCrs);\n\n // iterates in the collection to clip and does the geometry clip using the clipping geometry \n iter = featureCollectionToClip.features();\n while( iter.hasNext() ) {\n\n checkCancelation();\n\n SimpleFeature featureToClip = iter.next();\n\n // The feature selected to clip could have been changed in previous iteration\n // then is necessary check the \"transaction trak\"\n String fid = featureToClip.getID();\n if( this.transactionTrack.containsKey(fid) ){\n\n // the feature was changed before and requires more changes (clipping)\n clipChangedFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n\n } else {\n // first time that this feature will be precessed\n clipFeatureUsing( featureToClip, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n }\n \n getMonitor().worked(1);\n }\n }\n\n } catch (Exception e) {\n\n final String emsg = e.getMessage();\n LOGGER.severe(emsg);\n throw new SOProcessException(emsg);\n\n } finally {\n if (iter != null) {\n featureCollectionToClip.close(iter);\n }\n\n }\n\n }", "protected abstract NativeSQLStatement createNativeWithinStatement(Geometry testPolygon);", "public ArrayList<ArrayList<String>> extractCoordsFromWfsXml(String xml_og, String url_geofenceWfs, String serviceIdentifier) {\r\n\t\t\r\n\t\t//logger.debug(xml_og);\r\n\t\tnameSpaceUri = getArbeitsbereichXmlTagFromWfs(url_geofenceWfs); //z.B. focus\r\n\t\tPointPolygon point = new PointPolygon();\r\n\t\tArrayList<String> list_objectid = new ArrayList<String>();\r\n\t\tArrayList<String> list_coords = new ArrayList<String>();\r\n\t\tArrayList<ArrayList<String>> list_coords_objectid = new ArrayList<ArrayList<String>>();\r\n\t\t\r\n\t\t\r\n\t\tDocumentBuilder dbuilder = null;\r\n\t\ttry {\t\t\t\r\n\t\t\tXPath xPath = XPathFactory.newInstance().newXPath();\r\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\tdbFactory.setNamespaceAware(true);\r\n\t DocumentBuilder builder = dbFactory.newDocumentBuilder();\r\n\t Document doc = builder.parse(new InputSource(new StringReader(xml_og)));\r\n\t \t \r\n\t \txPath.setNamespaceContext(new NamespaceContext() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic Iterator getPrefixes(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String getPrefix(String namespaceURI) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t @Override\r\n\t\t\t public String getNamespaceURI(String args) {\r\n\t\t\t if(nameSpaceUri.equals(args)){\r\n\t\t\t \treturn nameSpaceUri;\r\n\t\t\t }else if(\"gml\".equals(args)){\r\n\t\t\t \treturn \"http://www.opengis.net/gml/3.2\"; \t\r\n\t\t\t }else{\r\n\t\t\t \treturn null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t});\t\t\r\n//\t \tString path_offering = \"/wfs:FeatureCollection/wfs:member/geofence_sbg:geofence_sbg_bbox/@gml:id\";\r\n//\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n//\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getNodeValue());\r\n\t\t\t\t/*\r\n\t\t\t\tString path_offering = \"/soap:Envelope/soap:Body/sos:Capabilities/@version\";\r\n\t\t\t\tNode node_offering = (Node)xPath.compile(path_offering).evaluate(doc, XPathConstants.NODE);\r\n\t\t\t\tSystem.out.println(\"offering: \"+node_offering.getTextContent());\r\n\t\t\t\t\r\n\t\t\t\tString path_procedures = \"//om:OM_Observation[@name='GetObservation']/ows:Parameter[@name='procedure']/ows:AllowedValues/ows:Value\"; */\r\n//\t\t\t\tString pathToLoading = \"//om:OM_Observation[om:observedProperty[@xlink:href='http://ispace.researchstudio.at/ont/swe/property/Loading']]/om:result\";\r\n\t\t\t\t\r\n\r\n\t \tString pathToObjectid = \"//\"+nameSpaceUri +\":objectid\";\r\n\t \tNodeList nodes_Objectid = (NodeList)xPath.compile(pathToObjectid).evaluate(doc, XPathConstants.NODESET);\r\n\t \t\r\n\t\t\t\tString pathToCoordinates =\"//gml:LinearRing/gml:posList\";\r\n\t\t\t\tNodeList nodes_position = (NodeList)xPath.compile(pathToCoordinates).evaluate(doc, XPathConstants.NODESET);\r\n\t\t\t\t//book[title/@lang = 'it'] [@uom='abc']\r\n\t\t\t\t//myNodeList.item(0).setNodeValue(\"Hi test!\");\r\n\t\t\t\tString xy= \"\";\r\n\t\t\t\t\r\n\t\t\t//\tlogger.debug(\"vor for loop ParserXmlJson.extractPointFromIO:\"+ nodes_position.getLength());\t\r\n\t\t\t\tfor(int n = 0; n<nodes_position.getLength(); n++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(serviceIdentifier.equals(\"within\")){\r\n\t\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBox.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tpoint.list_ofStrConsistingOf5CoordinatesForBoundingBoxWithin.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlist_coords.add(nodes_position.item(n).getTextContent());\r\n\t\t\t\t\t\r\n\t\t\t\t\tlist_objectid.add(nodes_Objectid.item(n).getTextContent());\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//node_procedures.item(n).setTextContent(\"4444\");\r\n\t\t\t\t\t//System.out.println(\"ParserXmlJson.parseInsertObservation:parser EDITED:\"+node_procedures.item(n).getTextContent());\r\n\t\t\t\t}\t\t\t\r\n\t\t\t//\tSystem.out.println(TextFiles.xmlDocument2StringWithPrettyPrint(doc, 2));\r\n\t\t\t\ttry{\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tSystem.out.println(\"Error: maybe no coordinates!\");\r\n\t\t\t\t\te.printStackTrace();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\t\t\t\r\n\t\tlist_coords_objectid.add(list_coords);\r\n\t\tlist_coords_objectid.add(list_objectid);\r\n\t\treturn list_coords_objectid;//point.list_ofStrConsistingOf5CoordinatesForBoundingBox;\t\t\t\t\r\n\t}", "@Override\n final boolean intersect(Bounds bounds, Point4d pickPos) {\n\treturn bounds.intersect(this.bounds, pickPos);\n }", "public Stream<Area> extractBounds() {\n if (getPolygonsAsJson() != null && !getPolygonsAsJson().trim().equalsIgnoreCase(\"[]\")) {\n ObjectMapper mapper = new ObjectMapper();\n try {\n @SuppressWarnings(\"unchecked\")\n ArrayList<LinkedHashMap<String, Double>> bounds = (ArrayList<LinkedHashMap<String, Double>>) mapper.readValue(getPolygonsAsJson(), ArrayList.class);\n return bounds.stream().map(entry -> new Area(entry.get(LEFT), entry.get(TOP), entry.get(RIGHT), entry.get(BOTTOM)));\n } catch (IOException e) {\n throw new EmbryonicException(\"Error parsing json for InterestOfAreas\", e);\n }\n }\n return Stream.empty();\n }", "static boolean clipEdgeBound(R2Vector a, R2Vector b, R2Rect clip, R2Rect bound) {\n // \"slopeNegative\" indicates which diagonal of the bounding box is spanned by AB: it\n // is false if AB has positive slope, and true if AB has negative slope. This is\n // used to determine which interval endpoints need to be updated each time\n // the edge is clipped.\n boolean slopeNegative = (a.x > b.x) != (a.y > b.y);\n return clipBoundAxis(a.x, b.x, bound.x(), a.y, b.y, bound.y(), slopeNegative, clip.x())\n && clipBoundAxis(a.y, b.y, bound.y(), a.x, b.x, bound.x(), slopeNegative, clip.y());\n }", "public static void collidePoly(Manifold manif, \n \t\tPolygonShape polyA, XForm xfA,\n PolygonShape polyB, XForm xfB) {\n\n //testbed.PTest.debugCount++;\n manif.pointCount = 0; // Fixed a problem with contacts\n MaxSeparation sepA = findMaxSeparation(polyA, xfA, polyB, xfB);\n if (sepA.bestSeparation > 0.0f) {\n return;\n }\n\n MaxSeparation sepB = findMaxSeparation(polyB, xfB, polyA, xfA);\n if (sepB.bestSeparation > 0.0f) {\n return;\n }\n\n PolygonShape poly1; // reference poly\n PolygonShape poly2; // incident poly\n XForm xf1 = new XForm();\n XForm xf2 = new XForm();\n int edge1; // reference edge\n byte flip;\n float k_relativeTol = 0.98f;\n float k_absoluteTol = 0.001f;\n\n // TODO_ERIN use \"radius\" of poly for absolute tolerance.\n if (sepB.bestSeparation > k_relativeTol * sepA.bestSeparation\n + k_absoluteTol) {\n poly1 = polyB;\n poly2 = polyA;\n xf1.set(xfB);\n \t\txf2.set(xfA);\n edge1 = sepB.bestFaceIndex;\n flip = 1;\n }\n else {\n poly1 = polyA;\n poly2 = polyB;\n xf1.set(xfA);\n \t\txf2.set(xfB);\n edge1 = sepA.bestFaceIndex;\n flip = 0;\n }\n\n ClipVertex incidentEdge[] = new ClipVertex[2];\n findIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n\n int count1 = poly1.m_vertexCount;\n Vec2[] vert1s = poly1.m_vertices;\n\n Vec2 v11 = vert1s[edge1];\n Vec2 v12 = edge1 + 1 < count1 ? vert1s[edge1 + 1] : vert1s[0];\n\n Vec2 sideNormal = Mat22.mul(xf1.R, v12.sub(v11));\n sideNormal.normalize();\n Vec2 frontNormal = Vec2.cross(sideNormal, 1.0f);\n\n v11 = XForm.mul(xf1, v11);\n \tv12 = XForm.mul(xf1, v12);\n\n float frontOffset = Vec2.dot(frontNormal, v11);\n float sideOffset1 = -Vec2.dot(sideNormal, v11);\n float sideOffset2 = Vec2.dot(sideNormal, v12);\n\n // Clip incident edge against extruded edge1 side edges.\n ClipVertex clipPoints1[] = new ClipVertex[2];\n ClipVertex clipPoints2[] = new ClipVertex[2];\n int np;\n\n // Clip to box side 1\n np = clipSegmentToLine(clipPoints1, incidentEdge, sideNormal.negate(), sideOffset1);\n\n if (np < 2) {\n return;\n }\n\n // Clip to negative box side 1\n np = clipSegmentToLine(clipPoints2, clipPoints1, sideNormal,\n sideOffset2);\n\n if (np < 2) {\n return;\n }\n\n // Now clipPoints2 contains the clipped points.\n manif.normal = (flip != 0) ? frontNormal.negate() : frontNormal.clone();\n\n int pointCount = 0;\n for (int i = 0; i < Settings.maxManifoldPoints; ++i) {\n float separation = Vec2.dot(frontNormal, clipPoints2[i].v)\n - frontOffset;\n\n if (separation <= 0.0f) {\n ManifoldPoint cp = manif.points[pointCount];\n cp.separation = separation;\n cp.localPoint1 = XForm.mulT(xfA, clipPoints2[i].v);\n \t\t\tcp.localPoint2 = XForm.mulT(xfB, clipPoints2[i].v);\n cp.id = new ContactID(clipPoints2[i].id);\n cp.id.features.flip = flip;\n ++pointCount;\n }\n }\n\n manif.pointCount = pointCount;\n\n return;\n }", "protected abstract NativeSQLStatement createNativeIntersectionStatement(Geometry geom);", "public IRectangleBound getClipBound();", "private void clipChangedFeatureUsing(SimpleFeature featureToClip, \n CoordinateReferenceSystem featureToClipCrs, \n Geometry clippingGeometryOnMap, \n CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n String fid = featureToClip.getID();\n FeatureTransaction tx = this.transactionTrack.get(fid);\n \n assert tx != null;\n \n switch( tx.getType() ) {\n case DELETE :\n // does not process\n break;\n case SPLIT :\n // precesses the fragments\n List<String> fidList = tx.getListInsertedFeatures();\n\n FeatureCollection<SimpleFeatureType, SimpleFeature> fragmentCollection = findFeatures(this.targetStore, fidList);\n \n FeatureIterator<SimpleFeature> fragmentIterator = null;\n try{\n fragmentIterator = fragmentCollection.features();\n \n while( fragmentIterator.hasNext() ) {\n\n SimpleFeature fragment = fragmentIterator.next();\n\n clipFeatureUsing( fragment, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n }\n } finally {\n if (fragmentIterator != null)\n fragmentCollection.close(fragmentIterator);\n }\n \n break;\n case UPDATE :\n // the feature require more changes\n \n // retrieves the changed feature and applies it the clip \n fid = tx.getUpdatedFeature();\n \n SimpleFeature updatedFeature = findFeature(this.targetStore, fid);\n \n clipFeatureUsing( updatedFeature, featureToClipCrs, clippingGeometryOnMap, mapCrs);\n \n break;\n\n default:\n assert false; // impossible case\n }\n \n \n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "void selectFeatures(MapMouseEvent ev) {\n\n System.out.println(\"Mouse click at: \" + ev.getWorldPos()); //mostramos las coordenadas por consola\n \n /*\n * construimos un rectangulo de 5x5 pixeles centrado en la posicion donde se hizo click \n */\n \n Point screenPos = ev.getPoint();\n Rectangle screenRect = new Rectangle(screenPos.x - 2, screenPos.y - 2, 5, 5); \n \n /*\n * Transformamos el rectangulo de pantalla en una caja de coordenadas en el sistema de referencia de nuestro mapa\n */\n AffineTransform screenToWorld = mapFrame.getMapPane().getScreenToWorldTransform();\n Rectangle2D worldRect = screenToWorld.createTransformedShape(screenRect).getBounds2D();\n ReferencedEnvelope bbox =\n new ReferencedEnvelope(\n worldRect, mapFrame.getMapContent().getCoordinateReferenceSystem());\n\n /*\n * Creamos un filtro para seleccionar las caraceristicas que intersecten con nuestra caja\n */\n Filter filter = ff.intersects(ff.property(geometryAttributeName), ff.literal(bbox));\n\n /*\n * Usamos el filtro para identificar la caracteristica seleccionada\n */\n try {\n SimpleFeatureCollection selectedFeatures = featureSource.getFeatures(filter);\n\n Set<FeatureId> IDs = new HashSet<>();\n try (SimpleFeatureIterator iter = selectedFeatures.features()) {\n while (iter.hasNext()) {\n SimpleFeature feature = iter.next();\n IDs.add(feature.getIdentifier());\n\n System.out.println(\" \" + feature.getIdentifier());\n }\n }\n\n if (IDs.isEmpty()) {\n System.out.println(\" no feature selected\");\n }\n\n displaySelectedFeatures(IDs); //mostramos lo seleccionado\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n}", "private static HashMap<Integer, ArrayList<String>> checkAndMergeIntersectedPoints(HashMap<Integer, ArrayList<String>> boundedRegionPointsMap) {\n\n\t\t// Iterate over regions one by one, to validate with rest of the regions iteratively.\n\t for(Integer key1 : boundedRegionPointsMap.keySet()) {\n\t ArrayList<String> list1 = boundedRegionPointsMap.get(key1);\n\n\t for (Integer key2 : boundedRegionPointsMap.keySet()) {\n\t \t// Only need to check for keys (region counters) incrementally\n\t if (key1 < key2) {\n\t ArrayList<String> list2 = boundedRegionPointsMap.get(key2);\n\t for(String point : list2) {\n\t \t// If there is an intersecting point in two regions, merge them.\n\t if (list1.contains(point)) {\n\t list1.addAll(list2);\n\t // Just to make sure there won't be any duplicate points introduced after the merge.\n\t Set<String> uniquePoints = new HashSet<String>(list1);\n\t boundedRegionPointsMap.put(key1, new ArrayList<String>(uniquePoints));\n\t break;\n\t }\n\t }\n\t }\n\t }\n\n\t }\n\t return boundedRegionPointsMap;\n\t}", "protected abstract NativeSQLStatement createNativeIntersectsStatement(Geometry geom);", "@Override\r\n\tpublic List<GeoPoint> findGeoIntersections(Ray ray, double maxDistance) {\n\t\treturn null;\r\n\t}", "static boolean clipEdge(\n R2Vector a, R2Vector b, R2Rect clip, R2Vector aClipped, R2Vector bClipped) {\n // Compute the bounding rectangle of AB, clip it, and then extract the new\n // endpoints from the clipped bound.\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (clipEdgeBound(a, b, clip, bound)) {\n int iEnd = a.x > b.x ? 1 : 0;\n int jEnd = a.y > b.y ? 1 : 0;\n aClipped.set(bound.getVertex(iEnd, jEnd));\n bClipped.set(bound.getVertex(1 - iEnd, 1 - jEnd));\n return true;\n }\n return false;\n }", "public CFWRect intersectsLine( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//1.rejust rect\r\n\t\t//correct: (m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\r\n\t\tif(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange all\r\n\t\t\tCFWPoint poiTmp = m_poiLT;\r\n\t\t\tm_poiLT = m_poiRB;\r\n\t\t\tm_poiRB = poiTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\t{\r\n\t\t\t//exchange X\r\n\t\t\tfloat fXTmp = m_poiLT.m_fX;\r\n\t\t\tm_poiLT.m_fX = m_poiRB.m_fX;\r\n\t\t\tm_poiRB.m_fX = fXTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange Y\r\n\t\t\tfloat fYTmp = m_poiLT.m_fY;\r\n\t\t\tm_poiLT.m_fY = m_poiRB.m_fY;\r\n\t\t\tm_poiRB.m_fY = fYTmp;\r\n\t\t}\r\n\t\t//2.intersect test\r\n\t\tCFWPoint poiOutOfRect = new CFWPoint();\r\n\t\tboolean bPoiInsideRect = false;\r\n\t\tCFWRect rectRet = new CFWRect();\r\n\t\tif(!checkPoiInside( poiBegI, poiEndI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse if(!checkPoiInside( poiEndI, poiBegI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\tif(isInsideArea( 9, poiBegI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\t}\r\n\t\t\t\trectRet.m_poiLT = poiBegI;\r\n\t\t\t\tpoiOutOfRect = poiEndI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiBegI))\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\trectRet.m_poiLT = poiEndI;\r\n\t\t\t\tpoiOutOfRect = poiBegI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//3.intersect\r\n\t\t//if the line is vertical to X/Y, return the line segment\r\n\t\tif(poiEndI.m_fX == poiBegI.m_fX)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = poiEndI.m_fX;\r\n\t\t\t\t//less than the m_poiLT'Y, use the m_poiLT'Y\r\n\t\t\t\trectRet.m_poiLT.m_fY = Math.max( Math.min(poiBegI.m_fY, poiEndI.m_fY), m_poiLT.m_fY);\r\n\t\t\t\t//larger than m_poiRB's Y, use the m_poiRB's Y\r\n\t\t\t\trectRet.m_poiRB.m_fY = Math.min( Math.max(poiBegI.m_fY, poiEndI.m_fY), m_poiRB.m_fY);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fY < m_poiLT.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\telse if(poiOutOfRect.m_fY > m_poiRB.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiRB.m_fY;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fX = poiEndI.m_fX;\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(poiEndI.m_fY == poiBegI.m_fY)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = Math.max( Math.min( poiBegI.m_fX, poiEndI.m_fX), m_poiLT.m_fX);\r\n\t\t\t\trectRet.m_poiLT.m_fY = poiEndI.m_fY;\r\n\t\t\t\trectRet.m_poiRB.m_fX = Math.min( Math.max( poiBegI.m_fX, poiEndI.m_fX), m_poiRB.m_fX);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fX < m_poiLT.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\telse if(poiOutOfRect.m_fX > m_poiRB.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiRB.m_fX;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fY = poiEndI.m_fY;\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\t//build line function\r\n\t\t\tdouble dK = (poiEndI.m_fY - poiBegI.m_fY)/(poiEndI.m_fX - poiBegI.m_fX);\r\n\t\t\tdouble dB = poiBegI.m_fY - dK*poiBegI.m_fX;\r\n\t\t\t//find intersect points\r\n\t\t\tCFWPoint poiIntersA = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tCFWPoint poiIntersB = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tfloat fXTmpA = (float)((m_poiLT.m_fY - dB)/dK);\r\n\t\t\tfloat fXTmpB = (float)((m_poiRB.m_fY - dB)/dK);\r\n\t\t\tfloat fYTmpA = (float)(dK*m_poiLT.m_fX + dB);\r\n\t\t\tfloat fYTmpB = (float)(dK*m_poiRB.m_fX + dB);\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpA, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpB, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpA, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpB, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(bPoiInsideRect)\t{\r\n\t\t\t\tCFWVector vecBE = new CFWVector(poiOutOfRect.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBA = new CFWVector(poiIntersA.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBB = new CFWVector(poiIntersB.sub(rectRet.m_poiLT));\r\n\t\t\t\tif(vecBE.isSameDir_VerticalIn(vecBA))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersA;\r\n\t\t\t\t}\r\n\t\t\t\telse if(vecBE.isSameDir_VerticalIn(vecBB))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\trectRet.m_poiLT = poiIntersA;\r\n\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//last check : intersected line segment whether inside rectangle\r\n\t\tif(!isInsideArea( 9, rectRet.m_poiLT) || !isInsideArea( 9, rectRet.m_poiRB))\t{\r\n\t\t\tSystem.out.println(\"generated line segment isn't inside rectangle!\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn(rectRet);\r\n\t}", "private IRegion computeClippingRegion(PaintEvent event) {\n \t\tif (event == null) {\n \t\t\t// trigger a repaint of the entire viewport\n \t\t\tint vOffset= getInclusiveTopIndexStartOffset();\n \t\t\tif (vOffset == -1)\n \t\t\t\treturn null;\n \t\t\t\n \t\t\t// http://bugs.eclipse.org/bugs/show_bug.cgi?id=17147\n \t\t\tint vLength= getExclusiveBottomIndexEndOffset() - vOffset;\n \t\t\t\n \t\t\treturn new Region(vOffset, vLength);\n \t\t}\n \t\t\n \t\tint widgetOffset;\n \t\ttry {\n \t\t\tint widgetClippingStartOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y));\n \t\t\tint firstWidgetLine= fTextWidget.getLineAtOffset(widgetClippingStartOffset);\n \t\t\twidgetOffset= fTextWidget.getOffsetAtLine(firstWidgetLine);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// should not happen\n \t\t\twidgetOffset= 0;\n \t\t}\n \t\t\n \t\tint widgetEndOffset;\n \t\ttry {\n \t\t\tint widgetClippingEndOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y + event.height));\n \t\t\tint lastWidgetLine= fTextWidget.getLineAtOffset(widgetClippingEndOffset);\n \t\t\twidgetEndOffset= fTextWidget.getOffsetAtLine(lastWidgetLine + 1);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// happens if the editor is not \"full\", eg. the last line of the document is visible in the editor\n \t\t\t// in that case, simply use the last character\n \t\t\twidgetEndOffset= fTextWidget.getCharCount();\n \t\t}\n \t\t\n \t\tIRegion clippingRegion= getModelRange(widgetOffset, widgetEndOffset - widgetOffset);\n \t\t\n \t\treturn clippingRegion;\n \t}", "Multimap<String, String> intersects(Circle bounds);", "public List<ga_Triangle2D> tesselatePolygon(ga_Polygon poly);", "boolean isIncludeBounds();", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "protected boolean checkPoiInside( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//[begin point in area 1] unintersect: 1,2,3,7,8\r\n\t\t//[begin point in area 2] unintersect: 1,2,3\r\n\t\t//[begin point in area 3] unintersect: 1,2,3,4,5\r\n\t\t//[begin point in area 4] unintersect: 3,4,5\r\n\t\t//[begin point in area 5] unintersect: 3,4,5,6,7\r\n\t\t//[begin point in area 6] unintersect: 5,6,7\r\n\t\t//[begin point in area 7] unintersect: 5,6,7,8,1\r\n\t\t//[begin point in area 8] unintersect: 7,8,1\r\n\t\t//[begin point in area 9] unintersect: 9\r\n\t\tif(isInsideArea( 1, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 2, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 3, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 4, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 5, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 6, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 7, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 8, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@SuppressWarnings(\"rawtypes\")\n\tpublic static void Relaxation(Object o, Iterable<Point2i> ring) {\n\t\tContext context = (Context) ContextUtils.getContext(o);\n\t\tGrid grid = (Grid) context.getProjection(\"grid-space\");\n\t\tContinuousSpace space = (ContinuousSpace) context.getProjection(\"continuous-space\");\n\n\t\t// Loop on ring boxes\n\t\tfor(Point2i p: ring) {\n\n\t\t\tfor (Object a1: grid.getObjectsAt(p.getX(), p.getY())) {\n\t\t\t\tfor (Object a2: grid.getObjectsAt(p.getX(), p.getY())) {\n\t\t\t\t\tif(!(a1 instanceof VEColi) || !(a2 instanceof VEColi) || a1.equals(a2)) continue;\n\t\t\t\t\tif( Agent.collided( (VEColi) a1, (VEColi) a2, 0.1) ) {\n\n\t\t\t\t\t\t//Teniendo en cuenta que la bacteria a1 es el centro de coordenadas tiene los puntos A1, B1, C1, D1\n\t\t\t\t\t\tdouble xA1 = - (( (VEColi) a1).getLength())/2; \n\t\t\t\t\t\tdouble yA1 = (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xB1 = - (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yB1 = - (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xC1 = (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yC1 = - (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xD1 = (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yD1 = (( (VEColi) a1).getWidth())/2;\n\n\n\t\t\t\t\t\t//Angulo entre bacteria a1 y bacteria a2\n\t\t\t\t\t\tdouble alpha1 = Math.toRadians(Angle.convheading(((VEColi) a1).getHeading())); //angulo de a1 en radianes\n\t\t\t\t\t\tdouble alpha2 = Math.toRadians(Angle.convheading(((VEColi) a2).getHeading())); //angulo de a2 en radianes\n\t\t\t\t\t\tdouble alpha = alpha1 - alpha2;\n\t\t\t\t\t\t\n\t\t\t\t\t\tNdPoint a1Location = space.getLocation(a1); //Posicion de la celula a1.\n\t\t\t\t\t\tdouble xa1 = a1Location.getX();\n\t\t\t\t\t\tdouble ya1 = a1Location.getY();\n\t\t\t\t\t\tNdPoint a2Location = space.getLocation(a2); //Posicion de la celula a2.\n\t\t\t\t\t\tdouble xa2 = a2Location.getX();\n\t\t\t\t\t\tdouble ya2 = a2Location.getY();\n\n\t\t\t\t\t\t//double xG2 = Math.cos(alpha) * (xa2 - xa1) + Math.sin(alpha) * (ya2 - ya1);\n\t\t\t\t\t\t//Dado que el centro de G1 con el cambio de coordenadas esta en (0,0).\n\t\t\t\t\t\tdouble xG2 = Math.cos(alpha) * xa2 + Math.sin(alpha) * ya2;\n\t\t\t\t\t\tdouble yG2 = -Math.sin(alpha) * xa2 + Math.cos(alpha) * ya2;\n\n\t\t\t\t\t\t// Puntos de la Bacteria a2 A2,B2,C2,D2 teniendo en cuenta que el origen de coordenadas esta en el centro de la Bacteria1.\n\t\t\t\t\t\tdouble xA2 = xG2 - ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yA2 = yG2 - ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xB2 = xG2 - ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yB2 = yG2 - ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xC2 = xG2 + ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yC2 = yG2 + ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xD2 = xG2 + ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yD2 = yG2 + ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\t//Voy a ver donde se encuentra la bacteria 2 con respecto a la bacteria 1 para poder hacer el cambio.\n\t\t\t\t\t\tboolean cambio = false;\n\t\t\t\t\t\tint caso = 0;\n\t\t\t\t\t\tif( xG2 > 0 && yG2 > 0 && alpha > 0 ){\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 1;\n\t\t\t\t\t\t}else if( xG2 > 0 && yG2 > 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 2. Simetria respecto al EJE X. \n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 2; //Me encuentro en el caso2.\n\t\t\t\t\t\t} else if(xG2 < 0 && yG2 > 0 && alpha > 0) {\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 3;\n\t\t\t\t\t\t}else if( xG2 < 0 && yG2 > 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 4. Simetria respecto al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 4; //Me encuentro en el caso4.\n\t\t\t\t\t\t} else if( xG2 < 0 && yG2 < 0 && alpha > 0 ) {\n\t\t\t\t\t\t\t//Caso 5. Simetria respecto al EJE X y al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 5;\n\t\t\t\t\t\t} else if( xG2 < 0 && yG2 < 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 6. Simetria respecto al EJE X.\n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 6; //Me encuentro en el caso5.\n\n\t\t\t\t\t\t} else if( xG2 > 0 && yG2 < 0 && alpha > 0 ){\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 7;\n\t\t\t\t\t\t} else if( xG2 > 0 && yG2 < 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 8. Simetria respecto al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 8; //Me encuentro en el caso8.\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tPoint2D.Double A1 = new Point2D.Double(xA1, yA1);\n\t\t\t\t\t\tPoint2D.Double B1 = new Point2D.Double(xB1, yB1);\n\t\t\t\t\t\tPoint2D.Double C1 = new Point2D.Double(xC1, yC1);\n\t\t\t\t\t\tPoint2D.Double D1 = new Point2D.Double(xD1, yD1);\n\t\t\t\t\t\tPoint2D.Double A2 = new Point2D.Double(xA2, yA2);\n\t\t\t\t\t\tPoint2D.Double B2 = new Point2D.Double(xB2, yB2);\n\t\t\t\t\t\tPoint2D.Double C2 = new Point2D.Double(xC2, yC2);\n\t\t\t\t\t\tPoint2D.Double D2 = new Point2D.Double(xD2, yD2);\n\n\n\t\t\t\t\t\tPoint2D.Double P = interseccion(A1,D1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double Q = interseccion(A1,D1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double R = interseccion(C1,D1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double S = interseccion(C1,D1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double T = interseccion(A1,B1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double U = interseccion(A1,B1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double V = interseccion(A1,D1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double W = interseccion(A1,B1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double X = interseccion(B1,C1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double Y = interseccion(B1,C1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double Z = interseccion(C1,D1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double N = interseccion(B1,C1,A2,D2);\n\n\n\t\t\t\t\t\tdouble solapamiento = 0.01 ;\n\t\t\t\t\t\tPoint2D.Double baricentro = new Point2D.Double(0,0);\n\n\t\t\t\t\t\tif( yA2>yA1 && yB1<yB2 && yB2<yA1) {\n\t\t\t\t\t\t\tif( P.getX() < xA1) {\n\t\t\t\t\t\t\t\tif(xB2 < xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 1 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de UA1Q\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(U,A1,Q);\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(U,A1,Q);\n\t\t\t\t\t\t\t\t} else if(xB2 > xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 2 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de TA1B2 + A1QB2\n\t\t\t\t\t\t\t\t\tdouble areaTA1B2 = calculateArea(T,A1,B2);\n\t\t\t\t\t\t\t\t\tdouble areaA1QB2 = calculateArea(A1,Q,B2);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTA1B2 + areaA1QB2;\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,A1,B2);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A1,Q,B2);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if(P.getX() > xA1) {\n\t\t\t\t\t\t\t\tif(xB2 > xD1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 3 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de PD1S\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(P,D1,S);\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(P,D1,S);\n\t\t\t\t\t\t\t\t} else if(xB2 < xD1) {\n\t\t\t\t\t\t\t\t\tif( Q.getX() < xD1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 4 ***\n\t\t\t\t\t\t\t\t\t\t//Calculo el area de PB2Q\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(P,B2,Q);\n\t\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\t\tbaricentro = getBar(P,B2,Q);\n\t\t\t\t\t\t\t\t\t} else if( Q.getX() > xD1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 5 ***\n\t\t\t\t\t\t\t\t\t\t//Calculo el area de PB2D1 y B2RD1\n\t\t\t\t\t\t\t\t\t\tdouble areaPB2D1 = solapamiento + calculateArea(P,B2,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaB2RD1 = solapamiento + calculateArea(B2,R,D1);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = areaPB2D1 + areaB2RD1;\n\t\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(P,B2,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B2,R,D1);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yB1<yA2 && yA2 < yA1 && yB1<yB2 && yB2<yA1 ){\n\t\t\t\t\t\t\tif(xC1 > xB2) {\n\t\t\t\t\t\t\t\tif(xA2<xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 6 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de TWV + TVB2 + VB2Q\n\t\t\t\t\t\t\t\t\tdouble areaTWV = calculateArea(T,W,V);\n\t\t\t\t\t\t\t\t\tdouble areaTVB2 = calculateArea(T,V,B2);\n\t\t\t\t\t\t\t\t\tdouble areaVB2Q = calculateArea(V,B2,Q);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTWV + areaTVB2 + areaVB2Q;\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,W,V);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(T,V,B2);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,B2,Q);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t} else if(xA2>xA1) {\n\t\t\t\t\t\t\t\t\tif(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 7 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de A2VB2 + VB2Q\n\t\t\t\t\t\t\t\t\t\tdouble areaA2VB2 = calculateArea(A2,V,B2);\n\t\t\t\t\t\t\t\t\t\tdouble areaVB2Q = calculateArea(V,B2,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2VB2 + areaVB2Q;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,V,B2);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,B2,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t\t} else if(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 8 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de VA2B2 + B2VD1 + D1RB2\n\t\t\t\t\t\t\t\t\t\tdouble areaVA2B2 = calculateArea(V,A2,B2);\n\t\t\t\t\t\t\t\t\t\tdouble areaB2VD1 = calculateArea(B2,V,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaD1RB2 = calculateArea(D1,R,B2);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVA2B2 + areaB2VD1 + areaD1RB2;\n\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,A2,B2);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B2,V,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(D1,R,B2);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\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} else if(xC1 < xB2) {\n\t\t\t\t\t\t\t\tif( V.getX() < xD1 ) {\n\t\t\t\t\t\t\t\t\t//*** Caso 9 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de A2VD1 + A2SD1\n\t\t\t\t\t\t\t\t\tdouble areaA2VD1 = calculateArea(A2,V,D1);\n\t\t\t\t\t\t\t\t\tdouble areaA2SD1 = calculateArea(A2,S,D1);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2VD1 + areaA2SD1;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,V,D1);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A2,S,D1);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t} else if( V.getX() > xD1 ) {\n\t\t\t\t\t\t\t\t\t//*** Caso 10 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de ZA2S\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(Z,A2,S);\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(Z,A2,S);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yB1<yA2 && yA2<yA1 && yB2<yB1) {\n\t\t\t\t\t\t\tif(xA2 > xA1) {\n\t\t\t\t\t\t\t\tif(Y.getX()<xC1) {\n\t\t\t\t\t\t\t\t\tif(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 11 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de XA2V + XVQ + XYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaXA2V = calculateArea(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVQ = calculateArea(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaXYQ = calculateArea(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2V + areaXVQ + areaXYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 12 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de A2XV + XVY + VD1Y + YD1R\n\t\t\t\t\t\t\t\t\t\tdouble areaA2XV = calculateArea(A2,X,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVY = calculateArea(X,V,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaVD1Y = calculateArea(V,D1,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaYD1R = calculateArea(Y,D1,R);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2XV + areaXVY + areaVD1Y + areaYD1R;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,X,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,D1,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar4 = getBar(Y,D1,R);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()+bar4.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()+bar4.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(Y.getX()>xC1) {\n\t\t\t\t\t\t\t\t\tif(X.getX() < xC1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 13***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de VA2X + VXD1 + D1XC1\n\t\t\t\t\t\t\t\t\t\tdouble areaVA2X = calculateArea(V,A2,X);\n\t\t\t\t\t\t\t\t\t\tdouble areaVXD1 = calculateArea(V,X,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaD1XC1 = calculateArea(D1,X,C1);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVA2X + areaVXD1 + areaD1XC1;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,A2,X);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,X,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(D1,X,C1);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(X.getX() > xC1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 10 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de ZA2S\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(Z,A2,S);\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tbaricentro = getBar(Z,A2,S);\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} else if(xA2 < xA1) {\n\t\t\t\t\t\t\t\tif(X.getX() < xB1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 14 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de VWB1 + B1VY + VYQ\n\t\t\t\t\t\t\t\t\tdouble areaVWB1 = calculateArea(V,W,B1);\n\t\t\t\t\t\t\t\t\tdouble areaB1VY = calculateArea(B1,V,Y);\n\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(V,Y,Q);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVWB1 + areaB1VY + areaVYQ;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,W,B1);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B1,V,Y);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,Y,Q);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\n\t\t\t\t\t\t\t\t} else if (X.getX() > xB1) {\n\t\t\t\t\t\t\t\t\tif(V.getX() < xA1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 15 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de TA1Q + TQX + QXY\n\t\t\t\t\t\t\t\t\t\tdouble areaTA1Q = calculateArea(T,A1,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaTQX = calculateArea(T,Q,X);\n\t\t\t\t\t\t\t\t\t\tdouble areaQXY = calculateArea(Q,X,Y);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTA1Q + areaTQX + areaQXY;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,A1,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(T,Q,X);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(Q,X,Y);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if( V.getX() > xA1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 16 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de XA2V + XVQ + XYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaXA2V = calculateArea(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVQ = calculateArea(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaXYQ = calculateArea(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2V + areaXVQ + areaXYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yA2<yB1 && yB2<yB1) {\n\t\t\t\t\t\t\tif(Y.getX() > xC1) {\n\t\t\t\t\t\t\t\t//*** Caso 17 ***\n\t\t\t\t\t\t\t\t//Calcular el area de NC1V + VC1D1\n\t\t\t\t\t\t\t\tdouble areaNC1V = calculateArea(N,C1,V);\n\t\t\t\t\t\t\t\tdouble areaVC1D1 = calculateArea(V,C1,D1);\n\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNC1V + areaVC1D1; \n\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,C1,V);\n\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,C1,D1);\n\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\n\t\t\t\t\t\t\t} else if(Y.getX() < xC1) {\n\t\t\t\t\t\t\t\tif(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 18 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de NVR + NRY + VD1R\n\t\t\t\t\t\t\t\t\tdouble areaNVR = calculateArea(N,V,R);\n\t\t\t\t\t\t\t\t\tdouble areaNRY = calculateArea(N,R,Y);\n\t\t\t\t\t\t\t\t\tdouble areaVD1R = calculateArea(V,D1,R);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNVR + areaNRY + areaVD1R;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,V,R);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(N,R,Y);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,D1,R);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t} else if(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\tif(xA2 < xB1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 19 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de NVY + VYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaNVY = calculateArea(N,V,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(V,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNVY + areaVYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro \n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,V,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(xA2 > xB1) {\n\t\t\t\t\t\t\t\t\t\tif(V.getX() > xA1) {\n\t\t\t\t\t\t\t\t\t\t\t//*** Caso 20 ***\n\t\t\t\t\t\t\t\t\t\t\t//Calcular WB1Y + WVY + VYQ\n\t\t\t\t\t\t\t\t\t\t\tdouble areaWB1Y = calculateArea(W,B1,Y);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaWVY = calculateArea(W,V,Y);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(Y,V,Q);\n\t\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaWB1Y + areaWVY + areaVYQ;\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(W,B1,Y);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(W,V,Y);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(Y,V,Q);\n\t\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t\t} else if(V.getX() < xA1) {\n\t\t\t\t\t\t\t\t\t\t\t//*** Caso 21 ***\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el area de A1YB1 + A1YQ\n\t\t\t\t\t\t\t\t\t\t\tdouble areaA1YB1 = calculateArea(A1,Y,B1);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaA1YQ = calculateArea(A1,Y,Q);\n\t\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA1YB1 + areaA1YQ;\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A1,Y,B1);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A1,Y,Q);\n\t\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if(yA2 < yA1 && yB2 < yB1 && Y.getX() > xC1 && V.getX() > xD1) {\n\t\t\t\t\t\t\t//*** Caso 22 ***\n\t\t\t\t\t\t\t//Calcular el area de XA2Z + XC1Z\n\t\t\t\t\t\t\tdouble areaXA2Z = calculateArea(X,A2,Z);\n\t\t\t\t\t\t\tdouble areaXC1Z = calculateArea(X,C1,Z);\n\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2Z + areaXC1Z;\n\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,Z);\n\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,C1,Z);\n\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tdouble m1 = ((VEColi) a1).getMass();\n\t\t\t\t\t\tdouble m2 = ((VEColi) a2).getMass();\n\t\t\t\t\t\tdouble ba1 = ((VEColi) a1).getLength();\n\t\t\t\t\t\tdouble ha1 = ((VEColi) a1).getWidth();\n\t\t\t\t\t\tdouble lambdaG = 0.01;\n\t\t\t\t\t\tdouble lambdaD = 0.005; //0.025\n\t\t\t\t\t\tdouble k1 = (m2/m1)*lambdaD;\n\t\t\t\t\t\tdouble k2 = ( m2/m1 ) * (1/ (Math.pow(ba1, 2) + Math.pow(ha1, 2)))*lambdaG;\n\n\t\t\t\t\t\tdouble D = k1 * Math.sqrt(solapamiento);\n\t\t\t\t\t\tdouble G = k2 * solapamiento;\n\n\t\t\t\t\t\tdouble newHeading = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**Estudio los casos en los que he hecho un movimiento simetrico anteriormente\n\t\t\t\t\t\tpara ver como será el giro del angulo con el nuevo posicionamiento.**/\n\t\t\t\t\t\tif(cambio) {\n\t\t\t\t\t\t\tif(caso == 2) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if(caso == 4) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\n\t\t\t\t\t\t\t} else if(caso == 5) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t} else if(caso == 6) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0)\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t} else if(caso == 8) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0)\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(caso == 1) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\n\t\t\t\t\t\t\t} else if(caso == 3){\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() < 0 )\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t} else if(caso == 7) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() < 0 )\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t/*Movimiento lo consideramos descomponiendolo en dos partes\n\t\t\t\t\t\t * \t1.Un desplazamiento de la bacteria en la direccion que une el centro de gravedad de las dos bacterias.\n\t\t\t\t\t\t * \t2.Un giro que se determina segun la geometria del sistema.\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\t//Giro la bacteria.\n\t\t\t\t\t\t((VEColi) a1).setHeading( ((VEColi) a1).getHeading() + newHeading );\n\t\t\t\t\t\t//Lo movemos en la direccion del vector que va del centro de la bacteria 2 a la bacteria 1.\n\t\t\t\t\t\t//Desplazo la bacteria.\n\t\t\t\t\t\t\n\t\t\t\t\t\tdouble t = Math.sqrt(Math.pow(xG2, 2) + Math.pow(yG2,2));\n\t\t\t\t\t\tif(t != 0) {\n\t\t\t\t\t\t\txG2 = xG2 /t;\n\t\t\t\t\t\t\tyG2 = yG2 /t;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tspace.moveTo(((VEColi) a1), space.getLocation(((VEColi) a1)).getX() + xG2*D, space.getLocation(((VEColi) a1)).getY() + yG2*D,0); \n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public S2LatLngRect getBound() {\n // To save time, we ignore numerical errors in the computed S2LatLngs while\n // accumulating the bounds and then account for them here.\n //\n // S2LatLng(S2Point) has a maximum error of 0.955 * S2.DBL_EPSILON in latitude.\n // In the worst case, we might have rounded \"inwards\" when computing the\n // bound and \"outwards\" when computing the latitude of a contained point P,\n // therefore we expand the latitude bounds by 2 * S2.DBL_EPSILON in each\n // direction. (A more complex analysis shows that 1.5 * S2.DBL_EPSILON is\n // enough, but the expansion amount should be a multiple of S2.DBL_EPSILON in\n // order to avoid rounding errors during the expansion itself.)\n //\n // S2LatLng(S2Point) has a maximum error of S2.DBL_EPSILON in longitude, which\n // is simply the maximum rounding error for results in the range [-Pi, Pi].\n // This is true because the Gnu implementation of atan2() comes from the IBM\n // Accurate Mathematical Library, which implements correct rounding for this\n // intrinsic (i.e., it returns the infinite precision result rounded to the\n // nearest representable value, with ties rounded to even values). This\n // implies that we don't need to expand the longitude bounds at all, since\n // we only guarantee that the bound contains the *rounded* latitudes of\n // contained points. The *true* latitudes of contained points may lie up to\n // S2.DBL_EPSILON outside of the returned bound.\n\n S2LatLng expansion = S2LatLng.fromRadians(2 * S2.DBL_EPSILON, 0);\n return builder.build().expanded(expansion).polarClosure();\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 List<PointDetails> getIntersectingPoints(Rectangle2D rect) {\n\t\tboolean useParallelStreaming = numPoints() > 10000;\n\t\treturn Utils.parallelize(getPointDetails().stream(), useParallelStreaming)\n\t\t\t\t.filter(p->rect.contains(p.location))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "List<Long> getBestSolIntersection();", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "@Override\n\tpublic boolean collidesWithPolygon(Polygon polygon) {\n\t\treturn false;\n\t}", "static boolean intersectsRect(R2Vector a, R2Vector b, R2Rect rect) {\n // First check whether the bound of AB intersects \"rect\".\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (!rect.intersects(bound)) {\n return false;\n }\n\n // Otherwise AB intersects \"rect\" if and only if all four vertices of \"rect\"\n // do not lie on the same side of the extended line AB. We test this by\n // finding the two vertices of \"rect\" with minimum and maximum projections\n // onto the normal of AB, and computing their dot products with the edge\n // normal.\n R2Vector n = R2Vector.sub(b, a).ortho();\n int i = (n.x >= 0) ? 1 : 0;\n int j = (n.y >= 0) ? 1 : 0;\n double max = n.dotProd(R2Vector.sub(rect.getVertex(i, j), a));\n double min = n.dotProd(R2Vector.sub(rect.getVertex(1 - i, 1 - j), a));\n return (max >= 0) && (min <= 0);\n }", "@Override\r\n\tpublic List<GeoPoint> findIntersections(Ray ray,double maxDistance) {\n\t List<GeoPoint> intersections = null;\r\n\r\n\t for (Intersectable geo : _geometriesList) {\r\n\t List<GeoPoint> tempIntersections = geo.findIntersections(ray,maxDistance);\r\n\t if (tempIntersections != null) {\r\n\t if (intersections == null)\r\n\t intersections = new ArrayList<GeoPoint>();\r\n\t intersections.addAll(tempIntersections);\r\n\t }\r\n\t }\r\n\t \r\n\r\n\t return intersections;\r\n\r\n\t}", "@Override\n public Intersection getIntersectionNorth(){\n if(!mapLoaded){\n return null;\n }\n return extremIntersection[0];\n }", "public static Point4d intersecta(Rayo rayo, Figura figura) {\n\t\tPoint4d interseccion = null;\n\t\t//si la figura es una esfera\n\t\tif (figura instanceof Esfera) {\n\t\t\tEsfera esfera = (Esfera) figura;\n\t\t\t/*\n\t\t\t * ecuacion de la esfera:\n\t\t\t * (p-centroEsfera)^2=radioEsfera^2 y sacar los terminos a,b,c de\n\t\t\t * la ecuacion cuadrática.\n\t\t\t */\n\t\t\t// A = d . d\n\t\t\tdouble A = rayo.getDireccion().dot(rayo.getDireccion());\n\t\t\tPoint4d p = rayo.getPunto();\n\t\t\tVector4d a = new Vector4d();\n\t\t\t// ( a - c )\n\t\t\ta.sub(p, esfera.getCentro());\n\t\t\t// B = d . ( a - c )\n\t\t\tdouble B = rayo.getDireccion().dot(a);\n\t\t\t// ( a - c ) . ( a - c ) \n\t\t\tdouble C = a.dot(a);\n\t\t\t// ( a - c ) . ( a - c ) - r ^2\n\t\t\tC -= esfera.getRadio() * esfera.getRadio();\n\t\t\t// d = B ^ 2 - A * C\n\t\t\tdouble D = Math.pow(B, 2) - A * C;\n\t\t\tif (D < 0) {\n\t\t\t\t// no hay interseccion\n\t\t\t}\n\t\t\telse if (D == 0) {\n\t\t\t\t// hay una interseccion\n\t\t\t\t// lambda = -2B / 2A\n\t\t\t\tdouble lambda = -2 * B / (double) (2 * A);\n\t\t\t\tinterseccion = new Point4d();\n\t\t\t\tinterseccion.x += rayo.getPunto().x + lambda\n\t\t\t\t\t\t* rayo.getDireccion().x;\n\t\t\t\tinterseccion.y += rayo.getPunto().y + lambda\n\t\t\t\t\t\t* rayo.getDireccion().y;\n\t\t\t\tinterseccion.z += rayo.getPunto().z + lambda\n\t\t\t\t\t\t* rayo.getDireccion().z;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// hay dos intersecciones\n\t\t\t\t// -2B\t+- (( 4B^2-4AC)^1/2)/2A\n\t\t\t\tdouble lambda1 = (-2 * B + Math.sqrt(4 * Math.pow(B, 2) - 4 * A\n\t\t\t\t\t\t* C))\n\t\t\t\t\t\t/ (double) (2 * A);\n\t\t\t\tdouble lambda2 = (-2 * B - Math.sqrt(4 * Math.pow(B, 2) - 4 * A\n\t\t\t\t\t\t* C))\n\t\t\t\t\t\t/ (double) (2 * A);\n\t\t\t\tif (lambda1 < 0 && lambda2 < 0) {\n\t\t\t\t\t//intersecciones entre pantalla y ojo\n\t\t\t\t}\n\t\t\t\telse if (lambda1 > 0 && lambda2 < 0) {\n\t\t\t\t\t//rayo(lambda1) visible, pero rayo(lambda2) no\n\t\t\t\t\tinterseccion = new Point4d();\n\t\t\t\t\tinterseccion.x += rayo.getPunto().x + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().x;\n\t\t\t\t\tinterseccion.y += rayo.getPunto().y + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().y;\n\t\t\t\t\tinterseccion.z += rayo.getPunto().z + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().z;\n\t\t\t\t\tinterseccion=rayo.evaluar(lambda1);\n\n\t\t\t\t}\n\t\t\t\telse if (lambda1 > lambda2 && lambda2 > 0) {\n\t\t\t\t\t//se ven las dos intersecciones, y lambda 2 esta mas cerca\n\t\t\t\t\tinterseccion = new Point4d();\n\t\t\t\t\tinterseccion.x += rayo.getPunto().x + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().x;\n\t\t\t\t\tinterseccion.y += rayo.getPunto().y + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().y;\n\t\t\t\t\tinterseccion.z += rayo.getPunto().z + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().z;\n\t\t\t\t}\n\t\t\t\telse if (lambda1 < 0 && lambda2 > 0) {\n\t\t\t\t\t//rayo(lambda2) visible, pero rayo(lambda1) no\n\t\t\t\t\tinterseccion = new Point4d();\n\t\t\t\t\tinterseccion.x += rayo.getPunto().x + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().x;\n\t\t\t\t\tinterseccion.y += rayo.getPunto().y + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().y;\n\t\t\t\t\tinterseccion.z += rayo.getPunto().z + lambda2\n\t\t\t\t\t\t\t* rayo.getDireccion().z;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//se ven las dos intersecciones, y lambda 1 esta mas cerca\n\t\t\t\t\tinterseccion = new Point4d();\n\t\t\t\t\tinterseccion.x += rayo.getPunto().x + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().x;\n\t\t\t\t\tinterseccion.y += rayo.getPunto().y + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().y;\n\t\t\t\t\tinterseccion.z += rayo.getPunto().z + lambda1\n\t\t\t\t\t\t\t* rayo.getDireccion().z;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (figura instanceof Plano) {\n\t\t\tPlano plano = (Plano) figura;\n\n\t\t\t// intersecta con el plano\n\t\t\t// calculamos el punto de la interseccion\n\t\t\t// numerador(n * a + D)\n\t\t\t// (p1 -a)n\n\t\t\tdouble numerador = Operaciones.sub(plano.getPunto(),\n\t\t\t\t\trayo.getPunto()).dot(plano.getNormal(null));\n\t\t\tdouble landa = 0.0;\n\t\t\tif (numerador != 0.0) {\n\t\t\t\t// denominador (d * n)\n\t\t\t\t// d*n\n\t\t\t\tdouble denominador = rayo.getDireccion().dot(\n\t\t\t\t\t\tplano.getNormal(null));\n\t\t\t\tlanda = numerador / denominador;\n\t\t\t}\n\t\t\t// evaluamos t en la ecuacion del rayo\n\t\t\tdouble casos = rayo.getDireccion().dot(plano.getNormal(null));\n\t\t\tif (casos < 0.0) {\n\t\t\t\tif (landa >= 0.0) {\n\t\t\t\t\tinterseccion = rayo.evaluar(landa);\n\t\t\t\t}\n\t\t\t\t// else no se ve\n\t\t\t}\n\t\t\t// else no intersecta\n\t\t}\n\t\telse if (figura instanceof Triangulo) {\n\t\t\tTriangulo triangulo = (Triangulo) figura;\n\t\t\tVector4d N = triangulo.getNormal(null);\n\t\t\t// intersecta con el plano en el que esta el triangulo\n\t\t\t// calculamos el punto de interseccion de ese plano\n\t\t\t// numerador=(p1-a)* n\n\t\t\tVector4d vectorTriangulo = Operaciones.sub(triangulo.getPunto1(),\n\t\t\t\t\trayo.getPunto());\n\t\t\tdouble numerador = vectorTriangulo.dot(N);\n\t\t\tdouble landa = 0.0;\n\t\t\tif (numerador != 0.0) {\n\t\t\t\t// denominador=(d * n)\n\t\t\t\tdouble denominador = rayo.getDireccion().dot(N);\n\t\t\t\tlanda = numerador / denominador;\n\t\t\t}\n\t\t\t// comprobar si rayo(landa) se encuentra dentro\n\t\t\t// de los parametros del triangulo\n\t\t\tPoint4d p = rayo.evaluar(landa);\n\t\t\t// comprobamos que tienen el mismo signo\n\t\t\t// S1=((p2-p1)x(p-p1)) * n\n\t\t\tdouble S1 = Operaciones.crossProduct(\n\t\t\t\t\tOperaciones.sub(triangulo.getPunto2(),\n\t\t\t\t\t\t\ttriangulo.getPunto1()),\n\t\t\t\t\t\t\tOperaciones.sub(p, triangulo.getPunto1())).dot(N);\n\n\t\t\t// S2=((p3-p2)x(p-p2))* n\n\t\t\tdouble S2 = Operaciones.crossProduct(\n\t\t\t\t\tOperaciones.sub(triangulo.getPunto3(),\n\t\t\t\t\t\t\ttriangulo.getPunto2()),\n\t\t\t\t\t\t\tOperaciones.sub(p, triangulo.getPunto2())).dot(N);\n\t\t\t// S1=((p1-p3)x(p-p3)) * n\n\t\t\tdouble S3 = Operaciones.crossProduct(\n\t\t\t\t\tOperaciones.sub(triangulo.getPunto1(),\n\t\t\t\t\t\t\ttriangulo.getPunto3()),\n\t\t\t\t\t\t\tOperaciones.sub(p, triangulo.getPunto3())).dot(N);\n\n\t\t\t// else no intersecta con el triangulo\n\t\t\tdouble casos = rayo.getDireccion().dot(N);\n\t\t\tif (casos < 0.0) {\n\t\t\t\tif (landa >= 0.0) {\n\t\t\t\t\tif ((S1 >= 0 && S2 >= 0 && S3 >= 0)\n\t\t\t\t\t\t\t|| (S1 <= 0 && S2 <= 0 && S3 <= 0)) {\n\t\t\t\t\t\t// esta dentro del triangulo\n\t\t\t\t\t\t// System.out.println(landa);\n\t\t\t\t\t\tinterseccion = rayo.evaluar(landa);\n\t\t\t\t\t}\n\t\t\t\t\t// else no da en el triangulo\n\t\t\t\t}\n\t\t\t\t// else no se ve\n\t\t\t}\n\t\t\t// else no intersecta\n\t\t}\n\n\t\treturn interseccion;\n\t}", "private static double[][] makeRegularPoly(double centerLat, double centerLon, double radiusMeters, int gons) {\n\n double[][] result = new double[2][];\n result[0] = new double[gons+1];\n result[1] = new double[gons+1];\n for(int i=0;i<gons;i++) {\n double angle = i*(360.0/gons);\n double x = Math.cos(Math.toRadians(angle));\n double y = Math.sin(Math.toRadians(angle));\n double factor = 2.0;\n double step = 1.0;\n int last = 0;\n\n //System.out.println(\"angle \" + angle + \" slope=\" + slope);\n // Iterate out along one spoke until we hone in on the point that's nearly exactly radiusMeters from the center:\n while (true) {\n double lat = centerLat + y * factor;\n GeoUtils.checkLatitude(lat);\n double lon = centerLon + x * factor;\n GeoUtils.checkLongitude(lon);\n double distanceMeters = SloppyMath.haversinMeters(centerLat, centerLon, lat, lon);\n\n //System.out.println(\" iter lat=\" + lat + \" lon=\" + lon + \" distance=\" + distanceMeters + \" vs \" + radiusMeters);\n if (Math.abs(distanceMeters - radiusMeters) < 0.1) {\n // Within 10 cm: close enough!\n result[0][i] = lat;\n result[1][i] = lon;\n break;\n }\n\n if (distanceMeters > radiusMeters) {\n // too big\n //System.out.println(\" smaller\");\n factor -= step;\n if (last == 1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = -1;\n } else if (distanceMeters < radiusMeters) {\n // too small\n //System.out.println(\" bigger\");\n factor += step;\n if (last == -1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = 1;\n }\n }\n }\n\n // close poly\n result[0][gons] = result[0][0];\n result[1][gons] = result[1][0];\n\n return result;\n }", "@Override\n public List<GeoPoint> findGeoIntersections(Ray ray , double maxDistance) {\n Point3D P0 = ray.getP0();\n Vector v = ray.getDir();\n\n if (P0.equals(_center)) {\n return List.of(new GeoPoint(this,_center.add(v.scale(_radius))));\n }\n\n Vector U = _center.subtract(P0);\n\n double tm = alignZero(v.dotProduct(U));\n double d = alignZero(Math.sqrt(U.lengthSquared() - tm * tm));\n\n // no intersections : the ray direction is above the sphere\n if (d >= _radius) {\n return null;\n }\n\n double th = alignZero(Math.sqrt(_radius * _radius - d * d));\n double t1 = alignZero(tm - th);\n double t2 = alignZero(tm + th);\n boolean validT1=alignZero(t1 - maxDistance ) <=0;\n boolean validT2=alignZero( t2 - maxDistance )<=0;\n if (t1>0 && t2>0 && validT1 && validT2) {\n Point3D P1 =ray.getPoint(t1);\n Point3D P2 =ray.getPoint(t2);\n return List.of(new GeoPoint(this,P1),new GeoPoint(this, P2));\n }\n if (t1>0 && validT1){\n Point3D P1 =ray.getPoint(t1);\n return List.of(new GeoPoint(this,P1));\n }\n if (t2>0 && validT2) {\n Point3D P2 =ray.getPoint(t2);\n return List.of(new GeoPoint(this,P2));\n }\n return null;\n }", "@Test\n public void findClosestGeoPointTest() {\n Ray ray = new Ray(new Point3D(0, 0, 10), new Vector(1, 10, -100));\n Geometry geo = new Sphere(new Point3D(1,1,1),2);\n\n List<Intersectable.GeoPoint> list = new LinkedList<Intersectable.GeoPoint>();\n list.add(new GeoPoint(geo,new Point3D(1, 1, -100)));\n list.add(new GeoPoint(geo,new Point3D(-1, 1, -99)));\n list.add(new GeoPoint(geo,new Point3D(0, 2, -10)));\n list.add(new GeoPoint(geo,new Point3D(0.5, 0, -100)));\n\n\n\n assertEquals(list.get(2), ray.findClosestGeoPoint(list));\n\n // =============== Boundary Values Tests ==================\n //TC01: the list is empty\n List<GeoPoint> list2 = null;\n assertNull(\"try again\",ray.findClosestGeoPoint(list2));\n\n //TC11: the closest point is the first in the list\n List<GeoPoint> list3 = new LinkedList<GeoPoint>();\n list3.add(new GeoPoint(geo,new Point3D(0, 2, -10)));\n list3.add(new GeoPoint(geo,new Point3D(-1, 1, -99)));\n list3.add(new GeoPoint(geo,new Point3D(1, 1, -100)));\n list3.add(new GeoPoint(geo,new Point3D(0.5, 0, -100)));\n\n assertEquals(list3.get(0), ray.findClosestGeoPoint(list3));\n\n //TC12: the closest point is the last in the list\n List<GeoPoint> list4 = new LinkedList<GeoPoint>();\n list4.add(new GeoPoint(geo,new Point3D(1, 1, -100)));\n list4.add(new GeoPoint(geo,new Point3D(0.5, 0, -100)));\n list4.add(new GeoPoint(geo,new Point3D(-1, 1, -99)));\n list4.add(new GeoPoint(geo,new Point3D(0, 2, -10)));\n\n assertEquals(list4.get(3), ray.findClosestGeoPoint(list4));\n }", "public abstract List getAllOverlapAppt(String provider, Date startTime,\r\n\t\t\tDate endTime);", "@Test\n public void testOverboundsInside() {\n Coordinate a, b, c, d;\n a = new Coordinate2D(2, 2, 0);\n b = new Coordinate2D(3, 3, 0);\n c = new Coordinate2D(2, 0, 0);\n d = new Coordinate2D(4, 2, 0);\n\n int actual, expected;\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(a);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(b);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(c);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(d);\n assertEquals(expected, actual);\n }", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "public ReferencedEnvelope getBounds(){\n if(bounds==null){\n // Create Null envelope\n this.bounds = new ReferencedEnvelope(getCRS());\n // First try to find the BBOX definition in the gisNode directly\n try{\n if(gisNode.hasProperty(INeoConstants.PROPERTY_BBOX_NAME)){\n double[] bbox = (double[])gisNode.getProperty(INeoConstants.PROPERTY_BBOX_NAME);\n this.bounds = new ReferencedEnvelope(bbox[0],bbox[1],bbox[2],bbox[3],crs);\n }else{\n System.err.println(\"No BBox defined in the GeoNeo object\");\n }\n }catch(Exception bbox_e){\n System.err.println(\"Failed to interpret BBOX: \"+bbox_e.getMessage());\n bbox_e.printStackTrace(System.err);\n }\n // Secondly, if bounds is still empty, try find all feature geometries and calculate bounds\n try{\n if(this.bounds.isNull()){\n // Try to create envelope from any data referenced by the gisNode\n for(GeoNode node:getGeoNodes()){\n //TODO: support high dimensions\n this.bounds.expandToInclude(node.getCoords()[0], node.getCoords()[1]);\n }\n }\n }catch(Exception bbox_e){\n System.err.println(\"Failed to interpret BBOX: \"+bbox_e.getMessage());\n bbox_e.printStackTrace(System.err);\n }\n }\n return bounds;\n }", "public double[] getHitGeoCoord();", "public final BoundingBox getBounds() {\n\t\tif (bounds==null) {\n\t\t\tint srsID =( (Geometry)this.get(0).getDefaultGeometry()).getSRID();\n\t\t\tBoundingBox re = new BoundingBoxImpl(\"\"+srsID);\n\t\t\tfor (SimpleFeature f : this) {\n\t\t\t\tre.include(f.getBounds());\n\t\t\t}\n\t\t\tbounds = re;\n\t\t}\n\t\treturn bounds;\n\t}", "public boolean intersects(GraphicalFigure fig) {\n\n\t\t// Get the distance between the 2 figures on the x axis\n\t\tint xDist = pos.xCoord() - fig.getOffset().xCoord();\n\n\t\t// Get the distance on the y axis\n\t\tint yDist = pos.yCoord() - fig.getOffset().xCoord();\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check to see if the figure is on the right and overlaps\n\t\tif (xDist >= 0 && xDist < fig.getWidth()) {\n\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = pos.xCoord(); i < pos.xCoord() + fig.getWidth() - xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check if the figure is on the left and overlaps\n\t\telse if (xDist >= 0 && xDist < width) {\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = fig.getOffset().xCoord(); i < fig.getOffset().xCoord() + width + xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no intersection found, return false\n\t\treturn false;\n\t}", "@Test\n public void intersectsWithAutoCarPolygon() {\n // creating the needed movement vector\n radar.loop();\n radar.loop();\n List<WorldObject> list = radar.getRelevantObjectsForAEB();\n assertTrue(list.stream().anyMatch(t -> t.getId().equals(\"roadsign_speed_40_1\")));\n radar.loop();\n list = radar.getRelevantObjectsForAEB();\n assertEquals(0, list.size());\n }", "public static SimpleFeatureCollection intersection(SimpleFeatureCollection A,\n\t\t\t\tGeometry geometryB, double overlapThreshold) throws Exception {\n\t\t\t\n\t\t\t\n\t\t\tif (A == null || A.size() == 0) return null;\n\t\t\t\n\t\t\t//TODO: test geometryB type, must be polygon\n\t\t\tif(overlapThreshold>1.0) overlapThreshold = 1.0;\n\t\t\t\n\t\t\t\n\t\t\tDefaultFeatureCollection outputFC = new DefaultFeatureCollection();\n\t\t\t \n\t\t\t//LOGGER.info(\"A geometry number: {}\", A.size());\n\n\t\t\tSimpleFeatureIterator AFeatures = A.features();\n\t\t\twhile (AFeatures.hasNext()){\n\t\t\t\tSimpleFeature featureA = AFeatures.next();\n\t\t\t\tGeometry geometryA = (Geometry) featureA.getDefaultGeometry();\n\t\t\t\tif(geometryA.intersects(geometryB))\n\t\t\t\t{\t\n\t\t\t\t\t//if don't need to test the intersection area/length, add id directly\n\t\t\t\t\tif(overlapThreshold<0){\n\t \t\toutputFC.add(featureA);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\tGeometry intersection = geometryA.intersection(geometryB);\n\t\t\t\t\t\tif(geometryA.getArea()>0){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(intersection.getArea()/geometryA.getArea() > overlapThreshold){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\toutputFC.add(featureA);\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\tAFeatures.close();\n\n\t\t\treturn outputFC;\n\t\t}", "public MPolygon computeVertex_latLong(FOV f) {\r\n\r\n\t\tMPolygon mpolygon = new MPolygon();\r\n\r\n\t\tdouble radian1 = MPolygon.toRadian(450 - (f.getDirection() - f.gethAngle() / 2));\r\n\t\tdouble radian2 = MPolygon.toRadian(450 - (f.getDirection() - f.gethAngle() / 4));\r\n\t\tdouble radian3 = MPolygon.toRadian(450 - (f.getDirection() + f.gethAngle() / 4));\r\n\t\tdouble radian4 = MPolygon.toRadian(450 - (f.getDirection() + f.gethAngle() / 2));\r\n\t\tdouble radianD = MPolygon.toRadian(450 - f.getDirection());\r\n\t\tMPoint p1 = new MPoint();\r\n\r\n\t\tp1.x = f.getLatitude() + Math.cos(radian1) * (f.getVeiwDist() * 0.00001);\r\n\t\tp1.y = f.getLongitude() + Math.sin(radian1) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p2 = new MPoint();\r\n\t\tp2.x = f.getLatitude() + Math.cos(radian2) * (f.getVeiwDist() * 0.00001);\r\n\t\tp2.y = f.getLongitude() + Math.sin(radian2) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p3 = new MPoint();\r\n\t\tp3.x = f.getLatitude() + Math.cos(radian3) * (f.getVeiwDist() * 0.00001);\r\n\t\tp3.y = f.getLongitude() + Math.sin(radian3) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p4 = new MPoint();\r\n\t\tp4.x = f.getLatitude() + Math.cos(radian4) * (f.getVeiwDist() * 0.00001);\r\n\t\tp4.y = f.getLongitude() + Math.sin(radian4) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint D = new MPoint();\r\n\t\tD.x = f.getLatitude() + Math.cos(radianD) * (f.getVeiwDist() * 0.00001);\r\n\t\tD.y = f.getLongitude() + Math.sin(radianD) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint location = new MPoint();\r\n\t\tlocation.x = f.latitude;\r\n\t\tlocation.y = f.longitude;\r\n\t\tmpolygon.setP1(p1);\r\n\t\tmpolygon.setP2(p2);\r\n\t\tmpolygon.setP3(p2);\r\n\t\tmpolygon.setP4(p4);\r\n\t\tmpolygon.setD(D);\r\n\t\tmpolygon.setLocation(location);\r\n\r\n\t\treturn mpolygon;\r\n\r\n\t}", "BaseBounds computeBounds(BaseBounds bounds, BaseTransform tx,\n double upad, double dpad,\n double x, double y,\n double w, double h)\n {\n // if the w or h is < 0 then bounds is empty\n if (w < 0.0f || h < 0.0f) return bounds.makeEmpty();\n\n double x0 = x;\n double y0 = y;\n double x1 = w;\n double y1 = h;\n double _dpad = dpad;\n if (tx.isTranslateOrIdentity()) {\n x1 += x0;\n y1 += y0;\n if (tx.getType() == BaseTransform.TYPE_TRANSLATION) {\n final double dx = tx.getMxt();\n final double dy = tx.getMyt();\n x0 += dx;\n y0 += dy;\n x1 += dx;\n y1 += dy;\n }\n _dpad += upad;\n } else {\n x0 -= upad;\n y0 -= upad;\n x1 += upad*2;\n y1 += upad*2;\n // Each corner is transformed by an equation similar to:\n // x' = x * mxx + y * mxy + mxt\n // y' = x * myx + y * myy + myt\n // Since all of the corners are translated by mxt,myt we\n // can ignore them when doing the min/max calculations\n // and add them in once when we are done. We then have\n // to do min/max operations on 4 points defined as:\n // x' = x * mxx + y * mxy\n // y' = x * myx + y * myy\n // Furthermore, the four corners that we will be transforming\n // are not four independent coordinates, they are in a\n // rectangular formation. To that end, if we translated\n // the transform to x,y and scaled it by width,height then\n // we could compute the min/max of the unit rectangle 0,0,1x1.\n // The transform would then be adjusted as follows:\n // First, the translation to x,y only affects the mxt,myt\n // components of the transform which we can hold off on adding\n // until we are done with the min/max. The adjusted translation\n // components would be:\n // mxt' = x * mxx + y * mxy + mxt\n // myt' = x * myx + y * myy + myt\n // Second, the scale affects the components as follows:\n // mxx' = mxx * width\n // mxy' = mxy * height\n // myx' = myx * width\n // myy' = myy * height\n // The min/max of that rectangle then degenerates to:\n // x00' = 0 * mxx' + 0 * mxy' = 0\n // y00' = 0 * myx' + 0 * myy' = 0\n // x01' = 0 * mxx' + 1 * mxy' = mxy'\n // y01' = 0 * myx' + 1 * myy' = myy'\n // x10' = 1 * mxx' + 0 * mxy' = mxx'\n // y10' = 1 * myx' + 0 * myy' = myx'\n // x11' = 1 * mxx' + 1 * mxy' = mxx' + mxy'\n // y11' = 1 * myx' + 1 * myy' = myx' + myy'\n double mxx = tx.getMxx();\n double mxy = tx.getMxy();\n double myx = tx.getMyx();\n double myy = tx.getMyy();\n // Computed translated translation components\n final double mxt = (x0 * mxx + y0 * mxy + tx.getMxt());\n final double myt = (x0 * myx + y0 * myy + tx.getMyt());\n // Scale non-translation components by w/h\n mxx *= x1;\n mxy *= y1;\n myx *= x1;\n myy *= y1;\n x0 = (Math.min(Math.min(0,mxx),Math.min(mxy,mxx+mxy)))+mxt;\n y0 = (Math.min(Math.min(0,myx),Math.min(myy,myx+myy)))+myt;\n x1 = (Math.max(Math.max(0,mxx),Math.max(mxy,mxx+mxy)))+mxt;\n y1 = (Math.max(Math.max(0,myx),Math.max(myy,myx+myy)))+myt;\n }\n x0 -= _dpad;\n y0 -= _dpad;\n x1 += _dpad;\n y1 += _dpad;\n\n bounds = bounds.deriveWithNewBounds((float)x0, (float)y0, 0.0f,\n (float)x1, (float)y1, 0.0f);\n return bounds;\n }", "private static final boolean overlapFast(final double[][] candidate, final double[] candidateBB,\n\t\t\tfinal PackedPoly placedPoly) {\n\n\t\t// 1. test bounding boxes\n\t\tif (!MathUtil.intersect_boundBoxes(candidateBB, placedPoly.bb)) {\n\t\t\treturn false;\n\t\t}\n\t\t// 2. test the centroid against candidate poly\n\t\t/*\n\t\t * NOTE this isn't completely robust (a robust method would test every point of\n\t\t * placed poly against candidate) but will catch almost all occurrences (so is\n\t\t * worth the speed-up overall).\n\t\t */\n\t\tif (MathUtil.inside(placedPoly.centroid, candidate)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// 3. test edge intersections\n\t\tfor (int i = 0; i < candidate.length; i++) {\n\t\t\tfor (int j = 0; j < placedPoly.inpts.length; j++) {\n\t\t\t\tif (MathUtil.intersectionFast(candidate[i], candidate[(i + 1) % candidate.length], placedPoly.inpts[j],\n\t\t\t\t\t\tplacedPoly.inpts[(j + 1) % placedPoly.inpts.length])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "@Override\n\tpublic boolean intersectsRectangle(final int ax1, final int ax2, final int ay1, final int ay2)\n\t{\n\t\tif (isInsideZone(ax1, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax1, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Check if any point from this rectangle is inside the other one\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Horizontal lines may intersect vertical lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Vertical lines may intersect horizontal lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static double wallSmoothing(Rectangle2D.Double field, double bfWidth,\n double bfHeight, Point2D.Double startLocation, double startAngleRadians,\n int orientation, double wallStick) {\n\n/*\n double angle = startAngle;\n _lastWallSmoothAway = false;\n while (!field.contains(x + Math.sin(Math.toRadians(angle))*WALL_STICK,\n y+Math.cos(Math.toRadians(angle))*WALL_STICK)) {\n angle += orientation*smoothNormal*7.0;\n if (smoothNormal == -1) { _lastWallSmoothAway = true; }\n }\n\n return angle;\n*/\n // Trying to do almost exactly the equivalent of the above in more\n // code but less CPU time. The above needs a low increment to work\n // perfectly smoothly, which results in very slow execution.\n //\n // NOTE: The two algorithms can give slightly different results,\n // but that is mainly because the iterative one never tests a\n // very specific angle in a corner that would turn up \"in bounds\";\n // if it increased the angle var by (1/INFINITY), they'd be the\n // same (as far as I can tell.)\n\n double angle = startAngleRadians;\n double wallDistanceX = Math.min(startLocation.x - 18,\n bfWidth - startLocation.x - 18);\n double wallDistanceY = Math.min(startLocation.y - 18,\n bfHeight - startLocation.y - 18);\n\n if (wallDistanceX > wallStick && wallDistanceY > wallStick) {\n return startAngleRadians;\n }\n\n double testX = startLocation.x + (Math.sin(angle) * wallStick);\n double testY = startLocation.y + (Math.cos(angle) * wallStick);\n double testDistanceX = Math.min(testX - 18, bfWidth - testX - 18);\n double testDistanceY = Math.min(testY - 18, bfHeight - testY - 18);\n\n double adjacent = 0;\n int g = 0;\n\n while (!field.contains(testX, testY) && g++ < 25) {\n if (angle < 0) {\n angle += (2 * Math.PI);\n }\n if (testDistanceY < 0 && testDistanceY < testDistanceX) {\n // wall smooth North or South wall\n angle = ((int) ((angle + (Math.PI / 2)) / Math.PI)) * Math.PI;\n adjacent = Math.abs(wallDistanceY);\n } else if (testDistanceX < 0 && testDistanceX <= testDistanceY) {\n // wall smooth East or West wall\n angle = (((int) (angle / Math.PI)) * Math.PI) + (Math.PI / 2);\n adjacent = Math.abs(wallDistanceX);\n }\n\n angle += orientation *\n (Math.abs(Math.acos(adjacent / wallStick)) + 0.0005);\n\n testX = startLocation.x + (Math.sin(angle) * wallStick);\n testY = startLocation.y + (Math.cos(angle) * wallStick);\n testDistanceX = Math.min(testX - 18, bfWidth - testX - 18);\n testDistanceY = Math.min(testY - 18, bfHeight - testY - 18);\n }\n\n return angle;\n }", "public final LatLngBounds m23862a() {\n C5462v.m23771a(Double.isNaN(this.f20488c) ^ 1, (Object) \"no included points\");\n return new LatLngBounds(new LatLng(this.f20486a, this.f20488c), new LatLng(this.f20487b, this.f20489d));\n }", "private static SimpleFeatureCollection featuresInRegion(\n\t\t\tSimpleFeatureSource featureSource, Geometry roi) throws IOException {\n\t\tFilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();\n\t\tFeatureType schema = featureSource.getSchema();\n\n\t\tString geometryPropertyName = schema.getGeometryDescriptor()\n\t\t\t\t.getLocalName();\n\n\t\tFilter filter = ff.intersects(ff.property(geometryPropertyName),\n\t\t\t\tff.literal(roi));\n\n\t\t// collection of filtered features\n\t\treturn featureSource.getFeatures(filter);\n\t}", "boolean intersects( Geometry gmo );", "private boolean polysegIntPoly( Coordinate[] seg, Coordinate[] poly ) {\n\t\t\n\t\tboolean qualify = true;\n\t\t\n\t\t//Disqualify if the segment's two end points are adjacent on the polygon.\n\t\tList<Coordinate> polyList = Arrays.asList( poly );\n\t\tint index1 = polyList.indexOf( seg[0] );\n\t\tint index2 = polyList.indexOf( seg[1] );\n\t\tint igap = Math.abs(index2 - index1 );\n\t\t\n\t\tif ( igap == 1 || igap == ( (poly.length) - 1 ) ) {\n\t\t\tqualify = false;\n\t\t}\n\t\telse {\t\t\t\t\t\t\t\n\t\t\tqualify = segIntPoly( seg, poly );\n\t\t}\n\t\t\n\t\treturn qualify;\n\t}", "ArrayList<Integer> adjustCoords(int x1, int y1, int x2, int y2) {\n ArrayList<Integer> adjusted_coords = new ArrayList<>();\n while ((x2-x1)*(y2-y1) < desired_rect_area) {\n x1 -= paint.getStrokeWidth()/2 + 2;\n y1 -= paint.getStrokeWidth()/2 + 2;\n x2 += paint.getStrokeWidth()/2 + 2;\n y2 += paint.getStrokeWidth()/2 + 2;\n }\n adjusted_coords.add(x1);\n adjusted_coords.add(y1);\n adjusted_coords.add(x2);\n adjusted_coords.add(y2);\n return adjusted_coords;\n }", "private Filter setEnevelopeFilter(GeneralEnvelope envelopeSubset,\n StructuredGridCoverage2DReader reader) throws IOException {\n Filter envelopeFilter = null;\n if (envelopeSubset != null) {\n Polygon polygon = JTS.toGeometry(new ReferencedEnvelope(envelopeSubset));\n GeometryDescriptor geom = reader.getGranules(coverageName, true).getSchema().getGeometryDescriptor();\n PropertyName geometryProperty = FF.property(geom.getLocalName());\n Geometry nativeCRSPolygon;\n try {\n nativeCRSPolygon = JTS.transform(polygon, CRS.findMathTransform(DefaultGeographicCRS.WGS84,\n reader.getCoordinateReferenceSystem()));\n Literal polygonLiteral = FF.literal(nativeCRSPolygon);\n // TODO: Check that geom operation. Should I do intersection or containment check?\n envelopeFilter = FF.intersects(geometryProperty, polygonLiteral);\n// envelopeFilter = FF.within(geometryProperty, polygonLiteral);\n } catch (Exception e) {\n throw new IOException(e);\n }\n }\n return envelopeFilter;\n }", "private ArrayList<Vertex> truncateHeadAtConflictArea(ArrayList<Vertex> vertices) {\n \t\tPoint2D.Double polygon[] = new Point2D.Double[conflictArea.size()];\r\n \t\tfor (int i = conflictArea.size(); --i >= 0; )\r\n \t\t\tpolygon[i] = conflictArea.get(i).getPoint();\r\n \t\tArrayList<Vertex> result = new ArrayList<Vertex>();\r\n \t\tresult.add(vertices.get(0));\r\n \t\tPoint2D.Double prevPoint = null;\r\n \t\tfor (Vertex v : vertices) {\r\n \t\t\tPoint2D.Double p = v.getPoint();\r\n \t\t\tif (null != prevPoint) {\r\n \t\t\t\tLine2D.Double line = new Line2D.Double(prevPoint, p);\r\n \t\t\t\tdouble closest = Double.MAX_VALUE;\r\n \t\t\t\tPoint2D.Double replacementPoint = null;\r\n \t\t\t\tArrayList<Point2D.Double> intersections = Planar.lineIntersectsPolygon(line, polygon);\r\n \t\t\t\t// find intersections with the polygon\r\n \t\t\t\tfor (Point2D.Double intersection : intersections) {\r\n \t\t\t\t\t// if statement added \r\n \t\t\t\t\tif (intersection != null) {\r\n \t\t\t\t\t\tdouble distance = intersection.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = intersection;\r\n \t\t\t\t\t\t\tclosest = distance;\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// find very near misses with the polygon\r\n \t\t\t\tfor (Point2D.Double pp : polygon) {\r\n \t\t\t\t\tif (Planar.distanceLineSegmentToPoint(line, pp) < veryClose) {\r\n \t\t\t\t\t\tdouble distance = pp.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = pp;\r\n \t\t\t\t\t\t\tclosest = distance;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (null != replacementPoint) {\r\n \t\t\t\t\tresult.clear();\r\n \t\t\t\t\tresult.add(new Vertex(replacementPoint, z));\r\n \t\t\t\t}\r\n \t\t\t\tresult.add(v);\r\n \t\t\t}\r\n \t\t\tprevPoint = p;\r\n \t\t}\t\t\r\n \t\treturn result;\r\n \t}", "public Polygon simplify(float tolerance)\n {\n DouglasPeuckerReducer reducer =\n new DouglasPeuckerReducer(this, tolerance);\n return reducer.simplified();\n }", "private Vector detectCommonSegPt(Vector segVL, Stroke theStroke)\n\t{\n\t\t\n\t\tint len = theStroke.getM_ptList().size();\n\t\tint[] stk_Arr = new int[len];\n\t\tint methodCnt = segVL.size(); //number of methods used to detect seg-points. \n\n\t\t// check if accepable value is set to a reasonable vaule\n\t\tif((Prefs.getAcceptableVotes() >= 1) && (Prefs.getAcceptableVotes() <= methodCnt))\n\t\t{\n\t\t\t// set the method count to acceptable votes.\n\t\t\tmethodCnt = Prefs.getAcceptableVotes();\n\t\t}\n\t\t\n\t\t// TODO: is there a better way to do it? \n\t\t// init the array to all 0\n\t\tfor(int i=0; i<len; i++) stk_Arr[i]=0;\n\t\t\n\t\tint commonWindow = COMMON_SEG_WINDOW;\n\t\tdouble commonDistance = COMMON_SEG_DISTANCE+2;\n\t\t/* commonDistance size of anchor_point, which are end-points of segments.\n\t\t * We want to filter-out seg-points too close together and create 'large'\n\t\t * seg-points to replace them.\n\t\t */\n\t\tVector commonSegPts = new Vector();\n\t\tIterator iter = segVL.iterator();\n\t\t\n\t\t// repeat for each segmentation algorithm\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tVector element = (Vector) iter.next();\n\t\t\tIterator iterator = element.iterator();\n\t\t\tint lastUsedPos=-1;\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tInteger obj = (Integer) iterator.next(); //get the seg point index\n\t\t\t\tint index = obj.intValue();\n\t\t\t\tPixelInfo indexPt = (PixelInfo)theStroke.getM_ptList().get(index);\n\t\t\t\t\n\t\t\t\tint start = index - commonWindow;\n\t\t\t\tint end = index + commonWindow;\n\t\t\t\t// check if i is within the array bounds, if yes, increment the array,\n\t\t\t\t// make sure that one segmentation scheme increments one point only once\n\t\t\t\tstart = (start>lastUsedPos)? start:lastUsedPos+1;\n\t\t\t\tend = (end<len)? end:len-1;\n\t\t\t\tfor(int i=start; i<=end; i++)\n\t\t\t\t{\n\t\t\t\t\tPixelInfo pt = (PixelInfo)theStroke.getM_ptList().get(i);\n\t\t\t\t\tif(indexPt.distance(pt) <= commonDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tstk_Arr[i]++;\n\t\t\t\t\t\tlastUsedPos = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// find the points with more than methodCnt value\n\t\tint i = 0;\n\t\twhile(i<len)\n\t\t{\n\t\t\t// store the index as the segment point, if condition is met\n\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t{\n\t\t\t\t// find out the streak of continuous pixels\n\t\t\t\tint beginIdx = i;\n\t\t\t\tint endIdx = i;\n\t\t\t\ti++;\n\t\t\t\twhile(i<len)\n\t\t\t\t{\n\t\t\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t\t\t{\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\tendIdx = i-1;\n\t\t\t\t\n\t\t\t\t// find one point from that streak\n\t\t\t\tint segPt = 0;\n\t\t\t\t// check if the segment is very short\n\t\t\t\tif((beginIdx==0)&&(endIdx==(len-1)))\n\t\t\t\t{\n\t\t\t\t\tif(beginIdx==endIdx) commonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\telse\n\t\t\t\t\t{\t// segment is not just one point\n\t\t\t\t\t\tcommonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\t\tcommonSegPts.add(new Integer(endIdx));\n\t\t\t\t\t}\n\t\t\t\t\treturn commonSegPts;\n\t\t\t\t}\n\t\t\t\telse if(beginIdx==0) segPt = 0;\n\t\t\t\telse if(endIdx==(len-1)) segPt = endIdx;\n\t\t\t\telse segPt = (int)Math.floor((beginIdx+endIdx)/2);\n\t\t\t\t\n\t\t\t\t// add segPt to the list of detected segments.\n\t\t\t\tcommonSegPts.add(new Integer(segPt));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn commonSegPts;\n\t}", "private Intersection[] getExtremIntersection(){\n if(!mapLoaded){\n return null;\n }\n Intersection northernmost = intersectionList.get(0);\n Intersection southernmost = intersectionList.get(0);\n Intersection easternmost = intersectionList.get(0);\n Intersection westernmost = intersectionList.get(0);\n\n for(int i=0 ; i<intersectionList.size() ; i++){\n Intersection testedIntersection = intersectionList.get(i);\n //north\n if(northernmost.getLatitude() < testedIntersection.getLatitude()) {\n northernmost = testedIntersection;\n }\n //south\n if(southernmost.getLatitude() > testedIntersection.getLatitude()) {\n southernmost = testedIntersection;\n }\n //east\n if(easternmost.getLongitude() < testedIntersection.getLongitude()) {\n easternmost = testedIntersection;\n }\n //west\n if(westernmost.getLongitude() > testedIntersection.getLongitude()) {\n westernmost = testedIntersection;\n }\n }\n Intersection[] extremum = {northernmost , southernmost , easternmost , westernmost};\n return extremum;\n }", "private void solveIntersectionPoints() {\n\t\tRadialGauge gauge = getMetricsPath().getBody().getGauge();\n\n\t\t// define first circle which is gauge outline circle\n\t\tx0 = gauge.getCenterDevice().getX();\n\t\ty0 = gauge.getCenterDevice().getY();\n\t\tr0 = gauge.getRadius();\n\t\tarc0 = new Arc2D.Double(x0 - r0, y0 - r0, 2 * r0, 2 * r0, 0, 360, Arc2D.OPEN);\n\n\t\t// define the second circle with given parameters\n\t\tx1 = x0 + polarRadius * Math.cos(Math.toRadians(polarDegree));\n\t\ty1 = y0 - polarRadius * Math.sin(Math.toRadians(polarDegree));\n\t\tr1 = radius;\n\n\t\tarc1 = new Arc2D.Double(x1 - r1, y1 - r1, 2 * r1, 2 * r1, 0, 360, Arc2D.OPEN);\n\n\t\tif (polarDegree != 0 && polarDegree != 180) {\n\t\t\t// Ax²+Bx+B = 0\n\t\t\tdouble N = (r1 * r1 - r0 * r0 - x1 * x1 + x0 * x0 - y1 * y1 + y0 * y0) / (2 * (y0 - y1));\n\t\t\tdouble A = Math.pow((x0 - x1) / (y0 - y1), 2) + 1;\n\t\t\tdouble B = 2 * y0 * (x0 - x1) / (y0 - y1) - 2 * N * (x0 - x1) / (y0 - y1) - 2 * x0;\n\t\t\tdouble C = x0 * x0 + y0 * y0 + N * N - r0 * r0 - 2 * y0 * N;\n\t\t\tdouble delta = Math.sqrt(B * B - 4 * A * C);\n\n\t\t\tif (delta < 0) {\n\t\t\t\t//System.out.println(\"no solution\");\n\t\t\t} else if (delta >= 0) {\n\n\t\t\t\t// p1\n\t\t\t\tdouble p1x = (-B - delta) / (2 * A);\n\t\t\t\tdouble p1y = N - p1x * (x0 - x1) / (y0 - y1);\n\t\t\t\tintersectionPointStart = new Point2D.Double(p1x, p1y);\n\n\t\t\t\t// p2\n\t\t\t\tdouble p2x = (-B + delta) / (2 * A);\n\t\t\t\tdouble p2y = N - p2x * (x0 - x1) / (y0 - y1);\n\t\t\t\tintersectionPointEnd = new Point2D.Double(p2x, p2y);\n\n\t\t\t\ttheta1Radian1 = getPolarAngle(x1, y1, p1x, p1y);\n\t\t\t\ttheta1Radian2 = getPolarAngle(x1, y1, p2x, p2y);\n\n\t\t\t}\n\t\t} else if (polarDegree == 0 || polarDegree == 180) {\n\t\t\t// polar degree = 0|180 -> y0=y1\n\t\t\t// Ay²+By + C = 0;\n\t\t\tdouble x = (r1 * r1 - r0 * r0 - x1 * x1 + x0 * x0) / (2 * (x0 - x1));\n\t\t\tdouble A = 1;\n\t\t\tdouble B = -2 * y1;\n\t\t\tdouble C = x1 * x1 + x * x - 2 * x1 * x + y1 * y1 - r1 * r1;\n\t\t\tdouble delta = Math.sqrt(B * B - 4 * A * C);\n\n\t\t\tif (delta < 0) {\n\t\t\t\t//System.out.println(\"no solution\");\n\t\t\t} else if (delta >= 0) {\n\n\t\t\t\t// p1\n\t\t\t\tdouble p1x = x;\n\t\t\t\tdouble p1y = (-B - delta) / 2 * A;\n\t\t\t\tintersectionPointStart = new Point2D.Double(p1x, p1y);\n\n\t\t\t\t// p2\n\t\t\t\tdouble p2x = x;\n\t\t\t\tdouble p2y = (-B + delta) / 2 * A;\n\t\t\t\tintersectionPointEnd = new Point2D.Double(p2x, p2y);\n\n\t\t\t\ttheta1Radian1 = getPolarAngle(x1, y1, p1x, p1y);\n\t\t\t\ttheta1Radian2 = getPolarAngle(x1, y1, p2x, p2y);\n\n\t\t\t}\n\t\t}\n\t}", "private float[] getBounds(TileCoolantPipe tile) {\n float[] bounds = new float[6];\n boolean[] connected = tile.getConnectedSides();\n float hDiameter = cableDiameter / 2.0F;\n for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {\n float width = 0.5F;\n if (!connected[dir.ordinal()]) {//(sides & dir.flag) != dir.flag) {\n width = hDiameter;\n }\n if (dir.ordinal() % 2 == 0) {\n width *= -1;\n }\n bounds[dir.ordinal()] = 0.5F + width;\n }\n return bounds;\n }", "@JsMethod\n public native Cartographic findIntersectionWithLatitude(double intersectionLatitude);", "public abstract Polygon4D project();", "public Filter doIntersection(Filter f);", "IPoint intersect(Figures figures)\n { float epsilon=IPoint.epsilon;\n Vec3D e1 = figures.getP2().minus(figures.getP1());\n Vec3D e2 = figures.getP3().minus(figures.getP1());\n Vec3D p = dir.cross(e2);\n float a = e1.dot(p);\n if ((a>-epsilon) && (a<epsilon)) return new IPoint(null,null,-1);\n float f = 1/a;\n Vec3D s = start.minus(figures.getP1());\n float u = f*s.dot(p);\n if ((u<0.0) || (u>1.0)) return new IPoint(null,null,-1);\n Vec3D q = s.cross(e1);\n float v = f*dir.dot(q);\n if ((v<0.0) || (u+v>1.0)) return new IPoint(null,null,-1);\n float dist=f*e2.dot(q);\n if (dist<epsilon) return new IPoint(null,null,-1);\n Vec3D ip=figures.getP1().mult(1-u-v).add(figures.getP2().mult(u)).add(figures.getP3().mult(v));\n return new IPoint(figures,ip,dist);\n }", "public void paintComponent(Graphics g)\n {\n super.paintComponent(g);\n Graphics2D g2 = (Graphics2D)g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);\n if (icon != null) icon.paintIcon(this, g, 0, 0);\n\n // draw a grey grid over the bitmap background\n for(int y = 0; y < bitmapHeight; y++) {\n g2.setColor(Color.GRAY);\n // g2.draw(new Line2D.Float(0, (y+1)*pixelScale, canvasWidth, (y+1)*pixelScale));\n }\n for(int x = 0; x < bitmapWidth; x++) {\n g2.setColor(Color.GRAY);\n // g2.draw(new Line2D.Float((x+1)*pixelScale, 0, (x+1)*pixelScale, canvasHeight));\n }\n\n // draw the polygon\n g2.setColor(Color.BLUE);\n Point2D.Float prev = null;\n float r = 4;\n for (Point2D.Float gp : points) {\n Point2D.Float p = screenPosition(gp);\n g2.fill(new Ellipse2D.Float(p.x - r, p.y - r, 2*r, 2*r));\n if (prev != null) {\n g2.draw(new Line2D.Float(prev, p));\n }\n prev = p;\n }\n }", "public void checkForCollisions()\r\n\t{\r\n\t\t//collision detection\r\n\t\tfor(PolygonD obj : objects)\r\n\t\t{\r\n\t\t\t//find points in character that intersected with the scene\r\n\t\t\tfor(PointD p : aSquare.getBoundary().getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(obj.contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = obj.getVerts().get(obj.getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : obj.getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tVector offset = new Vector(p, closestPoint);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//find points in scene that intersected with the character\r\n\t\t\tfor(PointD p : obj.getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(aSquare.getBoundary().contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = aSquare.getBoundary().getVerts().get(aSquare.getBoundary().getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : aSquare.getBoundary().getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get the angle of object by 'feeling' it\r\n\t\t\t\t\tint numVerts = obj.verts.size();\r\n\t\t\t\t\tint objI = obj.verts.indexOf(p);\r\n\t\t\t\t\tint lastI = (objI - 1) % numVerts;\r\n\t\t\t\t\tif(lastI == -1)\r\n\t\t\t\t\t\tlastI = numVerts - 1;\r\n\t\t\t\t\tint nextI = (objI + 1) % numVerts;\r\n\t\t\t\t\t\r\n\t\t\t\t\tint angle = (int)Math.round((new Vector(obj.verts.get(objI), obj.verts.get(lastI))).angleBetween(new Vector(obj.verts.get(objI), obj.verts.get(nextI))));\r\n\t\t\t\t\t\r\n\t\t\t\t\taSquare.sendMsg(new Msg(aSquare, \"Felt Vertex: \" + angle + \"deg\"));//null means status message\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//reverse direction to make aSquare move out of wall\r\n\t\t\t\t\tVector offset = new Vector(closestPoint, p);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\taSquare.getCenter();\r\n\t}", "private void updateBoundingBox(GM_Object geo) {\r\n double minx_ = 0; double miny_ = 0;\r\n double maxx_ = 0; double maxy_ = 0;\r\n \r\n if ( geo instanceof GM_Point ) {\r\n minx_ = ((GM_Point)geo).getX();\r\n miny_ = ((GM_Point)geo).getY();\r\n maxx_ = ((GM_Point)geo).getX();\r\n maxy_ = ((GM_Point)geo).getY();\r\n } else {\r\n GM_Envelope tmp = geo.getEnvelope();\r\n minx_ = tmp.getMin().getX();\r\n miny_ = tmp.getMin().getY();\r\n maxx_ = tmp.getMax().getX();\r\n maxy_ = tmp.getMax().getY();\r\n }\r\n \r\n if ( minx_ < minx ) minx = minx_;\r\n if ( maxx_ > maxx ) maxx = maxx_;\r\n if ( miny_ < miny ) miny = miny_;\r\n if ( maxy_ > maxy ) maxy = maxy_;\r\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "public int getMouseSeismicLine2dIntersect(double[][] mouseLine, double[] intersectionXYZF)\n {\n double mouseLineLenSq;\n double[] lineVector;\n double[] pointVector0, pointVector1;\n double x0, y0, x1, y1;\n\n if(nCols < 1)\n {\n intersectionXYZF[3] = StsParameters.largeDouble;\n return -1;\n }\n try\n {\n mouseLineLenSq = StsMath.distanceSq(mouseLine[0], mouseLine[1], 2);\n lineVector = StsMath.subtract(mouseLine[1], mouseLine[0]);\n pointVector1 = StsMath.vector2(mouseLine[0][0], mouseLine[0][1], cdpX[0], cdpY[0]);\n y1 = computePointCoordinatesY(pointVector1, lineVector, mouseLineLenSq);\n int nPointNearest = 0;\n double fLineNearest = StsParameters.largeDouble;\n for(int n = 1; n < nCols; n++)\n {\n pointVector0 = pointVector1;\n pointVector1 = StsMath.vector2(mouseLine[0][0], mouseLine[0][1], cdpX[n], cdpY[n]);\n y0 = y1;\n y1 = computePointCoordinatesY(pointVector1, lineVector, mouseLineLenSq);\n\n if(y1 * y0 < 0.0)\n {\n x0 = computePointCoordinatesX(pointVector0, lineVector, mouseLineLenSq);\n x1 = computePointCoordinatesX(pointVector1, lineVector, mouseLineLenSq);\n\n double fPoint = -y0 / (y1 - y0);\n double fLine = x0 + fPoint * (x1 - x0);\n double z = mouseLine[0][2] + fLine * (mouseLine[1][2] - mouseLine[0][2]);\n if(fLine < fLineNearest && StsMath.betweenInclusive(z, zMin, zMax))\n {\n fLineNearest = fLine;\n\n if(fPoint <= 0.5)\n nPointNearest = n - 1;\n else\n nPointNearest = n;\n }\n }\n }\n if(!StsMath.interpolate(mouseLine[0], mouseLine[1], fLineNearest, 3, intersectionXYZF))\n return -1;\n intersectionXYZF[3] = fLineNearest;\n return nPointNearest;\n }\n catch(Exception e)\n {\n return -1;\n }\n }", "protected abstract NativeSQLStatement createNativeOverlapsStatement(Geometry geom);", "MatOfPoint findBoundingPolygon(Mat _source, boolean detectGlare, boolean recursiveCall) {\n Mat source = recursiveCall ? _source : _source.clone();\n\n if (detectGlare && ! recursiveCall) {\n // @todo Do not use this flag blindly, do some own detection?\n // @todo Improve hit-ratio of the glare-detection. Sketchy at best right now.\n // Detect glare recursively by using stricter thresholds. This call\n // won't result in another recursion level.\n final MatOfPoint glarePolygon = findBoundingPolygon(source, false, true);\n\n // By drawing the glare's bounding box on the image clone, the following\n // steps require less strict thresholds.\n final Rect glareBoundingBox = boundingRect(glarePolygon);\n final Scalar boundingRectColor = new Scalar(255, 255, 255);\n Imgproc.rectangle(source, glareBoundingBox.br(), glareBoundingBox.tl(), boundingRectColor);\n\n // @todo Do this based on where the glare is located?\n // @todo Changes here affect hit-rate, do something smarter.\n // Left heavy => re-align\n int xMin = (int) (glareBoundingBox.tl().x - 100);\n if (xMin < 0) {\n xMin = 0;\n }\n\n int xMax = (int) (glareBoundingBox.br().x + 100);\n if (xMax > source.width()) {\n xMax = source.width();\n }\n\n int yMin = (int) (glareBoundingBox.tl().y - 120);\n if (yMin < 0) {\n yMin = 0;\n }\n\n int yMax = (int) (glareBoundingBox.br().y + 100);\n if (yMax > source.height()) {\n yMax = source.height();\n }\n\n // Create a mask which masks out only the parts in the glare bounding box.\n Mat mask = new Mat(source.rows(), source.cols(), CV_8U);\n for (int x = xMin; x < xMax; x++) {\n for (int y = yMin; y < yMax; y++) {\n mask.put(y, x, 255, 255, 255);\n }\n }\n\n // \"Stretch\" the content in the bounding box in a content-aware way.\n // Think of it as a content aware/smart removal.\n inpaint(source, mask, source, 5, Photo.INPAINT_TELEA);\n\n // @todo Remove\n// List<MatOfPoint> contours = new ArrayList<>();\n// contours.add(glarePolygon);\n// Imgproc.drawContours(source, contours, 0, new Scalar(255, 0, 0), 2, 8, new Mat(), 0, new Point());\n }\n\n // Convert to black and white\n Mat blackWhite = new Mat();\n cvtColor(source, blackWhite, COLOR_BGR2GRAY);\n\n // Apply threshold\n Mat threshOut = new Mat();\n int thresh = findThresholdValue(source);\n if (! detectGlare && recursiveCall) {\n // We're detecting glares; which requires a far stricter threshold.\n thresh *= 2;\n }\n logger.info(\"Finding contours with threshold value {}\", thresh);\n\n\n threshold(blackWhite, threshOut, thresh, 255, THRESH_BINARY);\n List<MatOfPoint> contours = new ArrayList<>();\n Imgproc.findContours(threshOut, contours, new Mat(), Imgproc.RETR_LIST, Imgproc.CHAIN_APPROX_SIMPLE);\n\n // Find contour with biggest area\n MatOfPoint maxContour = null;\n double maxArea = 0;\n for (MatOfPoint contour : contours) {\n double area = Imgproc.contourArea(contour);\n\n if (area > maxArea) {\n maxArea = area;\n maxContour = contour;\n }\n }\n\n if (maxContour == null) {\n // No contour found (one colored image?). Hence, the original image is already bounded.\n Size size = source.size();\n return new MatOfPoint(\n new Point(0, 0),\n new Point(size.width, 0),\n new Point(size.width, size.height),\n new Point(0, size.height)\n );\n }\n\n if (detectGlare) {\n // Simplify the found contour, which eventually removes\n // extreme points caused by glare.\n MatOfPoint2f contour2f = new MatOfPoint2f(maxContour.toArray());\n approxPolyDP(contour2f, contour2f, 150, true);\n return new MatOfPoint(contour2f.toArray());\n }\n\n return maxContour;\n }", "@Override\n public Intersection getIntersectionWest(){\n if(!mapLoaded){\n return null;\n }\n return extremIntersection[3];\n }", "BaseBounds computeShapeBounds(BaseBounds bounds, BaseTransform tx,\n com.sun.javafx.geom.Shape s)\n {\n if (impl_mode == NGShape.Mode.EMPTY) {\n return bounds.makeEmpty();\n }\n\n float[] bbox = {\n Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY,\n Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY,\n };\n boolean includeShape = (impl_mode != NGShape.Mode.STROKE);\n boolean includeStroke = (impl_mode != NGShape.Mode.FILL);\n if (includeStroke && (getStrokeType() == StrokeType.INSIDE)) {\n includeShape = true;\n includeStroke = false;\n }\n\n if (includeStroke) {\n final StrokeType type = getStrokeType();\n double sw = Utils.clampMin(getStrokeWidth(), MIN_STROKE_WIDTH);\n StrokeLineCap cap = getStrokeLineCap();\n StrokeLineJoin join = convertLineJoin(getStrokeLineJoin());\n float miterlimit =\n (float) Utils.clampMin(getStrokeMiterLimit(), MIN_STROKE_MITER_LIMIT);\n // Note that we ignore dashing for computing bounds and testing\n // point containment, both to save time in bounds calculations\n // and so that animated dashing does not keep perturbing the bounds...\n Toolkit.getToolkit().accumulateStrokeBounds(\n s,\n bbox, type, sw,\n cap, join, miterlimit, tx);\n // Account for \"minimum pen size\" by expanding by 0.5 device\n // pixels all around...\n bbox[0] -= 0.5;\n bbox[1] -= 0.5;\n bbox[2] += 0.5;\n bbox[3] += 0.5;\n } else if (includeShape) {\n com.sun.javafx.geom.Shape.accumulate(bbox, s, tx);\n }\n\n if (bbox[2] < bbox[0] || bbox[3] < bbox[1]) {\n // They are probably +/-INFINITY which would yield NaN if subtracted\n // Let's just return a \"safe\" empty bbox..\n return bounds.makeEmpty();\n }\n bounds = bounds.deriveWithNewBounds(bbox[0], bbox[1], 0.0f,\n bbox[2], bbox[3], 0.0f);\n return bounds;\n }", "public static void main(String[] args) {\n OverlappingRectangle overlappingRectangle = new OverlappingRectangle();\n int field = overlappingRectangle.overlap(2,1,5,5,3,2,5,7);\n System.out.println(field);\n\n int field1 = overlappingRectangle.overlap(-1, -1, 10, 10, -1, 0, 3, 9);\n System.out.println(field1);\n\n int field2 = overlappingRectangle.overlap(-12, -4, -1, -2, 0, 0, 100, 3000);\n System.out.println(field2);\n }", "private float[] genBounds(TECarpentersBlock TE, int quad)\n \t{\n \t\tfloat xMin = 0.0F;\n \t\tfloat zMin = 0.0F;\n \t\tfloat xMax = 1.0F;\n \t\tfloat zMax = 1.0F;\t\t\n \t\t\n \t\tswitch (quad)\n \t\t{\n \t\tcase Collapsible.QUAD_XZNN:\n \t\t\txMax = 0.5F;\n \t\t\tzMax = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZNP:\n \t\t\txMax = 0.5F;\n \t\t\tzMin = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPN:\n \t\t\txMin = 0.5F;\n \t\t\tzMax = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPP:\n \t\t\txMin = 0.5F;\n \t\t\tzMin = 0.5F;\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\tfloat maxHeight = getMaxHeight(TE);\n \t\tfloat height = Collapsible.getQuadHeight(TE, quad) / 16.0F;\n \t\t\n \t\t/* Make quads stagger no more than 0.5F so player can always walk across them. */\n \t\tif ((maxHeight - height) > 0.5F)\n \t\t\theight = maxHeight - 0.5F;\n \t\t\n \t\treturn new float[] { xMin, 0.0F, zMin, xMax, height, zMax };\t\t\n \t}", "public int area(String[] rectangles){\n TreeMap<Integer, Events> events = new TreeMap<>();\n\n int tag = 0;\n for(String r : rectangles){\n tag++;\n Scanner sc = new Scanner(r);\n int x1 = sc.nextInt();\n int y1 = sc.nextInt();\n int x2 = sc.nextInt();\n int y2 = sc.nextInt();\n if(!events.containsKey(x1))\n events.put(x1, new Events());\n if(!events.containsKey(x2))\n events.put(x1, new Events());\n\n events.get(x1).in.add(new YRange(y1, y2, tag));\n events.get(x2).out.add(new YRange(y1, y2, tag));\n }\n\n // Active set of tags for each unique y\n // we need to identify where each each rectangle starts & end\n // positve tag - start \n // negative tag - end\n // We need all of them sorted\n TreeSet<Pair> active = new TreeSet<Pair>(new Comparator<Pair>(){\n @Override\n public int compare(Pair a, Pair b){\n if(a.y == b.y)\n return Integer.compare(a.tag, b.tag);\n return Integer.compare(a.y, b.y);\n }\n });\n\n int area = 0;\n for(Map.Entry<Integer, Events> entry : events.entrySet()){\n int x = entry.getKey();\n Integer next_x = events.higherKey(x);\n // processed last unique x\n if(next_x == null) break;\n Events e = entry.getValue();\n\n // Construct the current active set\n for(YRange y : e.in){\n active.add(new Pair(y.y1, y.tag));\n active.add(new Pair(y.y2, -y.tag));\n }\n\n for(YRange y : e.out){\n active.remove(new Pair(y.y1, y.tag));\n active.remove(new Pair(y.y2, -y.tag));\n }\n // Compute union of y segments\n Integer lasty = null;\n int ySum = 0;\n int cnt = 0;\n for(Pair p : active){\n int y = p.y;\n if(cnt == 0){\n lasty = y;\n }\n // closing\n if(p.tag < 0) cnt--;\n else cnt++;\n\n if(cnt == 0){\n ySum += y - lasty;\n // reset lasty\n lasty = null;\n }\n }\n area += (next_x - x)*ySum;\n }\n return area;\n }", "boolean contains(Polygon p);", "static boolean clipBoundAxis(\n double a0,\n double b0,\n R1Interval bound0,\n double a1,\n double b1,\n R1Interval bound1,\n boolean slopeNegative,\n R1Interval clip0) {\n if (bound0.lo() < clip0.lo()) {\n if (bound0.hi() < clip0.lo()) {\n return false;\n }\n bound0.setLo(clip0.lo());\n if (!updateEndpoint(bound1, slopeNegative, interpolateDouble(clip0.lo(), a0, b0, a1, b1))) {\n return false;\n }\n }\n if (bound0.hi() > clip0.hi()) {\n if (bound0.lo() > clip0.hi()) {\n return false;\n }\n bound0.setHi(clip0.hi());\n if (!updateEndpoint(bound1, !slopeNegative, interpolateDouble(clip0.hi(), a0, b0, a1, b1))) {\n return false;\n }\n }\n return true;\n }", "public List<Float> getBoundingsOfCell() {\n\n\t\tfloat minXPoint = Float.POSITIVE_INFINITY;\n\t\tfloat maxXPoint = Float.NEGATIVE_INFINITY;\n\t\tfloat minYPoint = Float.POSITIVE_INFINITY;\n\t\tfloat maxYPoint = Float.NEGATIVE_INFINITY;\n\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\tArc2_Sweep arc = (Arc2_Sweep) e.reference;\n\n\t\t\t// Looking for most left located point of cell\n\t\t\tif (minXPoint > arc.minX().x) {\n\t\t\t\tminXPoint = arc.minX().x;\n\t\t\t}\n\t\t\t// Looking for most right located point of cell\n\t\t\tif (maxXPoint < arc.maxX().x) {\n\t\t\t\tmaxXPoint = arc.maxX().x;\n\t\t\t}\n\t\t\t// Looking for highest located point of cell\n\t\t\tif (minYPoint > arc.minY().y) {\n\t\t\t\tminYPoint = arc.minY().y;\n\t\t\t}\n\t\t\t// Looking for lowest located point of cell\n\t\t\tif (maxYPoint < arc.maxY().y) {\n\t\t\t\tmaxYPoint = arc.maxY().y;\n\t\t\t}\n\n\t\t}\n\n\t\tList<Float> boundings = new ArrayList<Float>();\n\t\tboundings.add(minXPoint);\n\t\tboundings.add(maxXPoint);\n\t\tboundings.add(minYPoint);\n\t\tboundings.add(maxYPoint);\n\t\treturn boundings;\n\n\t}" ]
[ "0.564751", "0.54341054", "0.5319103", "0.53171796", "0.5269798", "0.52396166", "0.5202843", "0.51784354", "0.50899756", "0.5080441", "0.5061744", "0.50237477", "0.49819311", "0.49712667", "0.4971201", "0.49322867", "0.49269176", "0.49240467", "0.49160406", "0.4856931", "0.48443195", "0.4823539", "0.47974306", "0.47740448", "0.47615483", "0.46750605", "0.4673561", "0.46532145", "0.4647231", "0.4646337", "0.4642468", "0.4608647", "0.46048436", "0.46019235", "0.45681742", "0.4563209", "0.4553128", "0.45519704", "0.45489064", "0.45265445", "0.45210683", "0.45098343", "0.45091596", "0.4494046", "0.44932655", "0.44699663", "0.44659266", "0.4465468", "0.44643155", "0.4460117", "0.44575694", "0.44554842", "0.44536266", "0.44391018", "0.4437586", "0.44349286", "0.44332284", "0.44222263", "0.4421557", "0.4415473", "0.44144356", "0.44078678", "0.44041985", "0.43989164", "0.43958157", "0.43889743", "0.43805707", "0.4370664", "0.43689507", "0.4364899", "0.4346368", "0.43456742", "0.4341434", "0.43381125", "0.43377143", "0.43370634", "0.4331883", "0.43311352", "0.4325472", "0.43245667", "0.43235773", "0.4322428", "0.4316956", "0.4308398", "0.43034855", "0.4291467", "0.4291306", "0.42908806", "0.4287784", "0.42861643", "0.4283728", "0.4281648", "0.42706943", "0.42667875", "0.42646366", "0.42633513", "0.42586198", "0.42574868", "0.42554814", "0.42497602" ]
0.740618
0
Divides the smear polygon into two polygons if it cannot be represented on 3 lines of 65character text. Two rounds of bisection may be needed. For the first round bisection, we divide the splitting segment into two segments at the middle ( the middle point is snapped to the closest VOR point) and check if these two segments intersect the original polygon. If not, the snapped middle point will be added to the bisected polygons. For the second round and on, no middle points are inserted. The smears from each successful splitting are added to the return list.
private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) { ArrayList<Gfa> newSmears = new ArrayList<Gfa>(); //First check if the polygon can be represented on 3 lines of text. boolean cbf = canBeFormatted( smear ); //Return if it can be formatted already. if ( cbf ) { newSmears.add( smear ); return newSmears; } /* * Find the all potential splitting segments - from the one with the * shortest length among those segments that do not intersect the polygon. */ Coordinate[] smearPts = smear.getLinePoints(); TreeSet<BisectDistInfo> segments = findAllSegments( smearPts ); /* * Compute the size of the original polygon. */ double polyArea = PgenUtil.getSphPolyArea( smearPts ); /* * Now loop over all the possible splitting segments, from shortest * to longest, to find the shortest segment which divides the original * polygon in an acceptable proportion. */ double prefPct = 100.0 - GFA_AF_BISECT_PCT; double prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT ); double prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT ); ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>(); double tarea; double pct; BisectDistInfo bisectSeg = null; for ( BisectDistInfo bd : segments ) { //Generate the polygon starting from indx1 and ending at indx2. tmpPoly.clear(); for ( int ii = bd.start; ii <= bd.end; ii++ ) { tmpPoly.add( new Coordinate( smearPts[ ii ] ) ); } //Compute and compare it's size to the original polygon as a percentage tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) ); pct = 100.0F * ( tarea / polyArea ); //If the percentage is within the limits, we've found our splitting segment. if ( pct >= prefPctMin && pct <= prefPctMax ) { bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end ); break; } } /* * Find the correct number of points for new polygons. For first round * division, the middle point on the splitting segment is calculated * and snapped to be used later. The splitting segment is thus divided * into two segments at the middle point. If either one of them intersects * with the original polygon, the middle point will not be added. */ if ( bisectSeg == null ) { newSmears.add( smear ); } else { //First figure out if we need and could add a middle point. Coordinate midPt = null; if ( addMidPt ) { midPt = new Coordinate(); midPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0; midPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0; Coordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt ); if ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) { Coordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt }; Coordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt }; if ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) { midPt.x = snappedMidPt.x; midPt.y = snappedMidPt.y; } else { addMidPt = false; } } } /* * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point. */ Gfa first = smear.copy(); ArrayList<Coordinate> coor1 = new ArrayList<Coordinate>(); ArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>(); for ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) { coor1.add( new Coordinate( smearPts[ ii ] ) ); reduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) ); } if ( addMidPt ) { Coordinate mpt1 = new Coordinate( midPt ); coor1.add( mpt1 ); first.addAttribute( BISECT_MIDDLE_POINT, mpt1 ); reduFlg1.add( new Boolean( false ) ); } first.setPointsOnly( coor1 ); first.setGfaTextCoordinate( first.getCentroid() ); boolean[] redu1 = new boolean[ reduFlg1.size() ]; int kk = 0; for ( Boolean bb : reduFlg1 ) { if ( bb ) { redu1[ kk ] = true; } else { redu1[ kk ] = false; } kk++; } first.setReduceFlags( redu1 ); /* * Second polygon - from 0 to bisectSeg.start, then middle point, continue * from bisectSeg.end to the end. */ Gfa second = smear.copy(); ArrayList<Coordinate> coor2 = new ArrayList<Coordinate>(); ArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>(); for ( int ii = 0; ii <= bisectSeg.start; ii++ ) { coor2.add( new Coordinate( smearPts[ ii ] ) ); reduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) ); } if ( addMidPt ) { Coordinate mpt2 = new Coordinate( midPt ); coor2.add( mpt2 ); second.addAttribute( BISECT_MIDDLE_POINT, mpt2 ); reduFlg2.add( new Boolean( false ) ); } for ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) { coor2.add( new Coordinate( smearPts[ ii ] ) ); reduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) ); } second.setPointsOnly( coor2 ); second.setGfaTextCoordinate( second.getCentroid() ); boolean[] redu2 = new boolean[ reduFlg2.size() ]; int kj = 0; for ( Boolean bb : reduFlg2 ) { if ( bb ) { redu2[ kj ] = true; } else { redu2[ kj ] = false; } kj++; } second.setReduceFlags( redu2 ); //Add new smears to the list. newSmears.add( first ); newSmears.add( second ); } return newSmears; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Gfa> reducePoints( Gfa smear, ArrayList<Gfa> snapshots ) {\n\t\t\t\t\n\t\tArrayList<Gfa> glist = new ArrayList<Gfa>();\n \n\t\t/*\n\t\t * Step 1 - reduce points on the whole smear polygon. Note that freezing level \n\t\t * contours are point reduced in af_fzlvl2fmt().\n\t\t */ \t\t\n\t\tGfa tSmear = regularPointReduction( smear );\n\t\t\n\t\t/*\n\t\t * Create a smear with the reduced points and return if the smear can be \n\t\t * formatted into 3-line text now.\n\t\t */\n\t\tif ( canBeFormatted( tSmear ) ) {\n\t\t smear.setPointsOnly( tSmear.getPoints() );\n\t\t smear.setReduceFlags( tSmear.getReduceFlags() );\n\t\t glist.add( smear );\n\t\t return glist;\n\t\t}\n \t\t\t\t\t\n\t\t/*\n\t\t * Step 2 - Do area clipping to split up the ORIGINAL smear \n\t\t * \t\t\talong area boundary, if needed.\n\t\t */\n\t\tArrayList<Gfa> listOfAreaClip = new ArrayList<Gfa>();\n\t\tlistOfAreaClip.addAll( faAreaClip( smear, snapshots ) );\n\t\t\n\t\t// Step 3 - Do first round of bisection, if necessary. \t\t\n\t\tArrayList<Gfa> listOfFirstBisect = new ArrayList<Gfa>();\t\t\n\t\tfor ( Gfa gg : listOfAreaClip ) {\t\t \t\t\t\n\t\t\t\n\t\t\t//First do point reduction on each of the clipped smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\n \t\tgg.setPointsOnly( tmpSmear.getPoints() );\n \t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n if ( canBeFormatted( tmpSmear ) ) {\n glist.add( gg ); \t\n }\n else {\n listOfFirstBisect.addAll( bisect( gg, true ) );\n }\n\t\t}\n\t\t\n\t\t//See if any middle point are generated in bisection.\n\t\tCoordinate midPt = null;\n\t\tif ( listOfFirstBisect.size() > 0 ) {\n\t\t midPt = (Coordinate)listOfFirstBisect.get(0).getAttribute( BISECT_MIDDLE_POINT );\n\t\t}\n\t\t\n\t\t// Step 4 - Do second round of bisection, if necessary. \n\t\tfor ( Gfa gg : listOfFirstBisect ) {\t\t \n\t\t\t\n\t\t\t//First do point reduction on each of the bisected smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\t\t\t\t\t\t\n\t\t\tgg.setPointsOnly( tmpSmear.getPoints() );\n\t\t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n\t\t\tif ( canBeFormatted( tmpSmear ) ) {\n\t\t\t\tglist.add( gg ); \n\t\t\t}\n\t\t\telse { \n\t\t\t\t//Another round of bisect, done.\n\t\t\t\tglist.addAll( bisect( gg, false) );\n\t\t\t}\n\t\t}\t\t\n\n\t\t\n\t\t//\n\t\t// If bisection happens, check if the middle point generated in the first round\n\t\t// has been used for the second round. If not, remove the middle point from \n\t\t// all smears.\n\t\t//\n\t\tboolean removeMidPt = false;\n\t\tif ( midPt != null ) {\n\t\t\tint ii = 0;\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tii++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ii < 3 ) {\n\t\t\t\tremoveMidPt = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( removeMidPt ) {\n\t\t\t\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tCoordinate removePt = null;\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tremovePt = cc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( removePt != null ) gg.getPoints().remove( removePt ) ;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn glist;\n\n\t}", "public ArrayList<TessSeg> splitAtIsect(TessSeg s1)\r\n {\r\n if (!isLineHit(s1))\r\n {\r\n return null;\r\n }\r\n \r\n //Check for point-line hits\r\n double t00 = -1, t01 = -1, t10 = -1, t11 = -1;\r\n boolean pointMidlineHit = false;\r\n \r\n if (isPointOnLine(s1.c0))\r\n {\r\n double t = pointOnLineT(s1.c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t00 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (isPointOnLine(s1.c1))\r\n {\r\n double t = pointOnLineT(s1.c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t01 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c0))\r\n {\r\n double t = s1.pointOnLineT(c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t10 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c1))\r\n {\r\n double t = s1.pointOnLineT(c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t11 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n\r\n if (pointMidlineHit)\r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n if (t00 > 0 && t01 > 0)\r\n {\r\n if (t00 < t01)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n }\r\n else if (t00 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n else if (t01 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(this);\r\n }\r\n \r\n if (t10 > 0 && t11 > 0)\r\n {\r\n if (t10 < t11)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n }\r\n else if (t10 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n else if (t11 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(s1);\r\n }\r\n \r\n return list;\r\n }\r\n \r\n if (c0.equals(s1.c0) \r\n || c0.equals(s1.c1)\r\n || c1.equals(s1.c0)\r\n || c1.equals(s1.c1))\r\n {\r\n //No point-midline hits. If we only meet at verts,\r\n // do not split.\r\n return null;\r\n }\r\n \r\n// if (!isParallelTo(s1))\r\n {\r\n //Midpoint crossing for both segments.\r\n // Solve system of linear eqns\r\n double s0x0 = c0.x;\r\n double s0y0 = c0.y;\r\n double s0x1 = c1.x;\r\n double s0y1 = c1.y;\r\n double s1x0 = s1.c0.x;\r\n double s1y0 = s1.c0.y;\r\n double s1x1 = s1.c1.x;\r\n double s1y1 = s1.c1.y;\r\n\r\n double[] t = Math2DUtil.lineIsectFractions(\r\n s0x0, s0y0, s0x1 - s0x0, s0y1 - s0y0,\r\n s1x0, s1y0, s1x1 - s1x0, s1y1 - s1y0,\r\n null);\r\n\r\n if (t == null || t[0] < 0 || t[0] > 1 || t[1] < 0 || t[1] > 1)\r\n {\r\n Logger.getLogger(TessSeg.class.getName()).log(Level.WARNING, \r\n \"Line segments do not overlap\");\r\n }\r\n// assert (t[0] > 0 && t[0] < 1 && t[1] > 0 && t[1] < 1)\r\n// : \"Line segments do not overlap\";\r\n \r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n \r\n Coord c = new Coord(\r\n (int)Math2DUtil.lerp(s1x0, s1x1, t[1]),\r\n (int)Math2DUtil.lerp(s1y0, s1y1, t[1]));\r\n\r\n list.add(new TessSeg(c0, c));\r\n list.add(new TessSeg(c, c1));\r\n list.add(new TessSeg(s1.c0, c));\r\n list.add(new TessSeg(c, s1.c1));\r\n \r\n return list;\r\n }\r\n }\r\n \r\n// return null;\r\n }", "private PVector separate(ArrayList<Boid> boids)\n\t{\n\t\tfloat desiredseparation = 50.0f;\n\t\tPVector steer = new PVector(0, 0, 0);\n\t\tint count = 0;\n\n\t\t// too close ?\n\t\tfor (Boid other : boids)\n\t\t{\n\t\t\tfloat d = PVector.dist(getLocation(), other.getLocation());\n\t\t\tif ((d > 0) && (d < desiredseparation))\n\t\t\t{\n\t\t\t\tPVector diff = PVector.sub(getLocation(), other.getLocation());\n\t\t\t\tdiff.normalize();\n\t\t\t\tdiff.div(d);\n\t\t\t\tsteer.add(diff);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\tif (count > 0)\n\t\t{\n\t\t\tsteer.div(count);\n\t\t}\n\n\t\tif (steer.mag() > 0)\n\t\t{\n\t\t\tsteer.setMag(maxspeed);\n\t\t\tsteer.sub(velocity);\n\t\t\tsteer.limit(maxforce);\n\t\t}\n\n\t\treturn steer;\n\t}", "public PVector separate (ArrayList<Boid> boids) {\n float desiredseparation = 25.0f;\n PVector steer = new PVector(0, 0, 0);\n int count = 0;\n // For every boid in the system, check if it's too close\n for (Boid other : boids) {\n float d = PVector.dist(position, other.position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredseparation)) {\n // Calculate vector pointing away from neighbor\n PVector diff = PVector.sub(position, other.position);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n }\n // Average -- divide by how many\n if (count > 0) {\n steer.div((float)count);\n }\n\n // As long as the vector is greater than 0\n if (steer.mag() > 0) {\n\n steer.normalize();\n steer.mult(maxspeed);\n steer.sub(velocity);\n steer.limit(maxforce);\n }\n return steer;\n }", "protected abstract void splitBAMs();", "@Override\n public ArrayList<int[]> Split()\n {\n double hypervolume_best = -Double.MAX_VALUE;\n int hypervolume_best_i = 0;\n int hypervolume_best_j = 0;\n double hypervolume = 0d;\n\n for( int i = 0; i < Capacity_max + 1; i++)\n {\n for( int j = i + 1; j < Capacity_max + 1; j++)\n {\n hypervolume = 0d;\n double[] point1 = PointMatrix[ Items.get(i)[0] ][ Items.get(i)[1] ];\n double[] point2 = PointMatrix[ Items.get(j)[0] ][ Items.get(j)[1] ];\n\n for(int a = 0; a < Dimensions; a++)\n {\n if( point1[a] > point2[a] )\n hypervolume += Math.log10(point1[a] - point2[a]);\n if( point1[a] < point2[a] )\n hypervolume += Math.log10(point2[a] - point1[a]);\n }\n\n if( hypervolume_best < hypervolume)\n {\n hypervolume_best_i = i;\n hypervolume_best_j = j;\n hypervolume_best = hypervolume;\n }\n }\n }\n\n // Ready the split\n ArrayList<int[]> items_split = new ArrayList<>();\n items_split.addAll(Items);\n\n int point1_x = items_split.get(hypervolume_best_i)[0];\n int point1_y = items_split.get(hypervolume_best_i)[1];\n int point2_x = items_split.get(hypervolume_best_j)[0];\n int point2_y = items_split.get(hypervolume_best_j)[1];\n double[] point1 = PointMatrix[ point1_x ][ point1_y ];\n double[] point2 = PointMatrix[ point2_x ][ point2_y ];\n\n if(hypervolume_best_i > hypervolume_best_j)\n {\n items_split.remove(hypervolume_best_i);\n items_split.remove(hypervolume_best_j);\n }\n else\n {\n items_split.remove(hypervolume_best_j);\n items_split.remove(hypervolume_best_i);\n }\n\n // Create new box with point1\n BoundingBoxLeaf box1 = new BoundingBoxLeaf( PointMatrix, ParentBox, Tree, Depth, point1_x, point1_y );\n\n box1.SetBoxToFit(point1);\n box1.SetCoordsToFit( point1_x, point1_y);\n \n // Reset this box, and add point2\n BoundingBoxLeaf box2 = this;\n \n box2.SetBoxToFit(point2);\n box2.SetCoordsToFit( point2_x, point2_y);\n\n box2.Items.clear();\n box2.Items.add( new int[]{ point2_x, point2_y } );\n\n // Notify parent of split\n ParentBox.InsertBox_internal(box1);\n \n // Add items to the new boxes, up to min capacity\n int[] item_best;\n \n // box1\n while( box1.IsBelowMinCapacity() && !items_split.isEmpty() )\n {\n hypervolume_best = Double.MAX_VALUE;\n item_best = null;\n int index_best = -1;\n \n for(int i = 0; i < items_split.size(); i++ )\n {\n int[] item = items_split.get(i);\n double[] point = PointMatrix[ item[0] ][ item[1] ];\n \n hypervolume = box1.GetHyperVolume( point );\n \n if(hypervolume_best > hypervolume)\n {\n hypervolume_best = hypervolume;\n item_best = item; \n index_best = i;\n }\n \n }\n \n if(item_best != null)\n {\n box1.Items.add( new int[]{ item_best[0], item_best[1] } );\n box1.ExpandBoxToFit( PointMatrix[ item_best[0] ][ item_best[1] ] );\n box1.ExpandCoordsToFit( item_best[0], item_best[1]);\n \n items_split.remove(index_best);\n }\n }\n \n // box2\n while( box2.IsBelowMinCapacity() && !items_split.isEmpty() )\n {\n hypervolume_best = Double.MAX_VALUE;\n item_best = null;\n int index_best = -1;\n \n for(int i = 0; i < items_split.size(); i++ )\n {\n int[] item = items_split.get(i);\n double[] point = PointMatrix[ item[0] ][ item[1] ];\n hypervolume = box1.GetHyperVolume( point );\n \n if(hypervolume_best > hypervolume)\n {\n hypervolume_best = hypervolume;\n item_best = item; \n index_best = i;\n }\n \n }\n \n if(item_best != null)\n {\n box2.Items.add( new int[]{ item_best[0], item_best[1] } );\n box2.ExpandBoxToFit( PointMatrix[ item_best[0] ][ item_best[1] ] );\n box2.ExpandCoordsToFit( item_best[0], item_best[1]);\n \n items_split.remove(index_best);\n }\n }\n \n // return remaining to be reinserted into the tree\n return items_split; \n }", "private ArrayList<Point> calculateMidPoints() {\n ArrayList<Point> midPoints = new ArrayList<>();\n boolean isFirst = true; // Holds weather or not both points have been found yet.\n\n // Iterate over every point in the left and right lanes.\n for (int idx = 0; idx < leftLine.getLanePoints().size(); idx++) {\n Point leftPoint = leftLine.getLanePoints().get(idx); // The left point at the element idx.\n Point rightPoint = rightLine.getLanePoints().get(idx); // The right point at the element idx.\n int yValue = getCameraHeight() - (START_SEARCH + idx); // The y value of the left and right points.\n\n // If neither line is found, add a point at cameraWidth / 2, yValue\n if (leftPoint.isEmpty() && rightPoint.isEmpty()) {\n if (USE_NO_LANE_DETECTION) {\n midPoints.add(new Point(getCameraWidth() / 2, yValue));\n }\n // If Ony the right Point is found, add a point at the x rightPoint - road width / 2.\n } else if (leftPoint.isEmpty()) {\n midPoints.add(new Point(rightPoint.getX() - (calculateRoadWidth(yValue) / 2), yValue));\n // If Only the left Point is found, add a point at the x leftPoint + road width / 2.\n } else if (rightPoint.isEmpty()) {\n midPoints.add(new Point(leftPoint.getX() + (calculateRoadWidth(yValue) / 2), yValue));\n // If both lines are found, average the two lines.\n } else {\n midPoints.add(new Point((int) Math.round((leftPoint.getX() + rightPoint.getX()) / 2.0), yValue));\n // Set x1 and y1 to be the first Points to have lines on both sides.\n if (isFirst) {\n calcSlopePoint1.setX(Math.abs(leftPoint.getX() - rightPoint.getX()));\n calcSlopePoint1.setY(yValue);\n isFirst = false;\n // set x2 and y2 to be the last points to have lines on both sides.\n } else {\n calcSlopePoint2.setX(Math.abs(leftPoint.getX() - rightPoint.getX()));\n calcSlopePoint2.setY(yValue);\n }\n }\n }\n\n if (isReliable(calcSlopePoint1, calcSlopePoint2)) {\n slope = calculateRoadSlope(calcSlopePoint1, calcSlopePoint2);\n }\n return midPoints;\n }", "private TreeSet<BisectDistInfo> findSegmentsBySlack( int index, int slack, Coordinate[] polyIn ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\n\t\t//Convert to grid coordinate.\n\t\tCoordinate[] poly = PgenUtil.latlonToGrid( polyIn );\n\t\t\t\t\n\t /*\n\t * Find the index of ending points to form a splitting segment - \n\t * from \"index + np/2 - slack\" to \"index + np/2 + slack\"\n\t */ \n\t int npts = poly.length;\n\t int mid = npts / 2;\n\t int nseg = 2 * slack + 1;\n\t \n\t ArrayList<Integer> pointsToCheck = new ArrayList<Integer>();\n\t for ( int ii = 0; ii < nseg; ii++ ) {\n\t \tpointsToCheck.add( ( ii - slack + index + mid + npts ) % npts );\n\t }\n\t\t\n\t /*\n\t * Find out segments that does not intersect other segments of the\n\t * polygon and has a length greater than the clustering distance.\n\t */\t \n\t Coordinate[] seg = new Coordinate[2];\n\t seg[0] = poly[ index ];\n\t \t\n\t boolean qualify;\n for ( Integer jj : pointsToCheck ) {\n\t\t \n \t//Sanity check\n \tif( jj >= poly.length ) continue;\n \t\n \tseg[1] = poly[jj]; \n\t\t \n\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\tif ( qualify ) {\n\t\t\t\tdouble dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\tif ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\tdistInfo.add( new BisectDistInfo( dist, index, jj ) );\n\t\t\t\t}\n\t\t\t}\t\t\t\n }\n\t\t\n\t\treturn distInfo;\n\t\t\n\t}", "private ArrayList<Gfa> faAreaClip( Gfa smear, ArrayList<Gfa> snapshots ) {\n \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t\t//If smear can be formatted, return.\n\t\tif ( canBeFormatted( smear ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\n\t\t/*\n\t\t * If the smear resides only in one FA area or two areas belong to different \n\t\t * FA regions, no need to clip. \n\t\t */\n\t\tString faAreas = smear.getGfaArea();\n\t\tif ( !faAreas.contains( \"-\" ) ||\n\t\t\t !isSameFaRegion( faAreas ) ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t\t\n\n\t\t// Retrieve extended FA area bounds\n\t\tHashMap<String, Geometry> xareaBnds = GfaClip.getInstance().getFaAreaXBoundsInGrid();\n\n\t\t\n\t\t/*\n\t\t * Find the intersection points with the extended FA area bounds and snap them. \n\t\t */\n\t\tPolygon smearPoly = GfaClip.getInstance().gfaToPolygon( smear );\n\t\tPolygon smearPolyInGrid = GfaClip.getInstance().gfaToPolygonInGrid( smear );\n\t\tHashMap<Coordinate, Coordinate> areaInterPts = getAreaIntersectionPt( smearPoly );\n\n\t\t/*\n\t\t * Do area clipping. The strategy is the same as regional clipping.\n\t\t * \n\t\t * 1. clip the smear polygon against each FA region (WEST, CENTRAL, EAST)\n\t\t * 2. create a list of parts bigger than/equal to 3K for each region\n\t\t * 3. hold the parts smaller than 3K for all regions in another list. \n\t\t */\n\t\tHashMap<String, ArrayList<Geometry> > clipWithAreas = new HashMap<String, ArrayList<Geometry> >(); \n\n\t\tArrayList<Geometry> smallPoly = new ArrayList<Geometry>(); \n\n\t\tfor ( String areaName : xareaBnds.keySet() ) {\n\n\t\t\tif ( !faAreas.contains( areaName ) ) continue;\n\n\t\t\tclipWithAreas.put( areaName, new ArrayList<Geometry>() );\n\n\t\t\t//Do area clipping as described above.\n\t\t\tGeometry areaBnd = xareaBnds.get( areaName );\t\t\t\t \n\t\t\tif ( areaBnd.intersects( smearPolyInGrid ) ) {\n\n\t\t\t\tGeometry areaPoly = areaBnd.intersection( smearPolyInGrid );\t\n\n\t\t\t\tif ( areaPoly != null ) {\t\t\t\t\t \t\t\t\t\t\t\t\n\t\t\t\t\tfor ( int kk = 0; kk < areaPoly.getNumGeometries(); kk++ ) {\t\t\t\t\t \t \n\t\t\t\t\t\tGeometry bigPoly = areaPoly.getGeometryN( kk );\t\t\t\t\t \t \n\n\t\t\t\t\t\tif ( GfaClip.getInstance().isBiggerInGrid( bigPoly ) ) {\t\t\t\t\t \t\n\t\t\t\t\t\t\tclipWithAreas.get( areaName ).add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tsmallPoly.add( bigPoly ); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\t \n\n\t\t}\t\t\t\t\t\t\t\t\n\n\t\t/*\n\t\t * Create smears from VALID parts and add into the return list\n\t\t * \n\t\t * 1. Union the parts in each FA region with the list of small parts -\n\t\t * If a small part touches one of the bigs (only one, I believe), it\n\t\t * will be united into that big and thus be included into a new\n\t\t * smear. So no part gets lost and all will be included eventually.\n\t\t * 2. When a small part is united into a big one (if they intersect), \n\t\t * the common points are still retained in the result, we need to \n\t\t * remove those extra point. The common points are resulted from the\n\t\t * previous clipping with the area boundaries.\n\t\t * 3. check the resulting union for VALID geometries and create new\n\t\t * smears for each of them.\t \t\t\t\n\t\t */\n\t\tfor ( String areaName : clipWithAreas.keySet() ) {\n\n\t\t\tArrayList<Geometry> bigs = clipWithAreas.get( areaName );\n\n\t\t\tArrayList<Geometry> toBeUnioned = new ArrayList<Geometry>();\n\t\t\ttoBeUnioned.addAll( bigs );\n\t\t\ttoBeUnioned.addAll( smallPoly );\n\t\t\tGeometry result = GfaClip.getInstance().quickUnion( toBeUnioned ); \t\t\t\n\n\t\t\tArrayList<Coordinate> commPts = GfaClip.getInstance().getCommonPoints( bigs, smallPoly );\n\n\t\t\tif ( result != null ) {\t\t \n\n\t\t\t\tfor ( int kk = 0; kk < result.getNumGeometries(); kk++ ) {\n\n\t\t\t\t\tGeometry one = result.getGeometryN( kk );\n\n\t\t\t\t\t//Remove residue points by clipping followed by subsequent union.\n\t\t\t\t\tGeometry onePart = GfaClip.getInstance().removeCommonPoints( one, commPts );\n\n\t\t\t\t\t//Clean up some improper cases\n\t\t\t\t\tCoordinate[] gPts = PgenUtil.gridToLatlon( onePart.getCoordinates() );\n\t\t\t\t\tArrayList<Coordinate> points = new ArrayList<Coordinate>();\n\t\t\t\t\tfor ( Coordinate c : gPts ) {\n\t\t\t\t\t\tpoints.add( c );\n\t\t\t\t\t}\n\t\t\t\t\tpoints.remove( points.size() - 1 );\n\n\t\t\t\t\t//Geometry cleanPts = GfaClip.getInstance().cleanupPoints( onePart );\n\t\t\t\t\t\n\t\t\t\t\tGeometry cleanPts = GfaClip.getInstance().cleanupPoints( \n\t\t\t\t\t\t\t GfaClip.getInstance().pointsToGeometry( points ) );\n\n\t\t\t\t\tif ( GfaClip.getInstance().isAddableAsSmear( cleanPts, snapshots, smear ) ) {\n\n\t\t\t\t\t\t//Replace intersection points with their pre-snapped pair.\n\t\t\t\t\t\tGeometry rplPts = GfaClip.getInstance().replacePts( cleanPts, areaInterPts );\n\n\t\t\t\t\t\t//Create a new GFA smear.\n\t\t\t\t\t\tcleanPts = GfaClip.getInstance().cleanupPoints( rplPts );\n\t\t\t\t\t\t\n\t\t\t\t\t\tGfa newElm = GfaClip.getInstance().geometryToGfa( smear, cleanPts );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tnewElm.setGfaArea( areaName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewSmears.add( newElm );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( Gfa gg : newSmears ) {\n\t\t boolean[] reduFlg = new boolean[ gg.getPoints().size() ];\n\t\t\tint ii = 0;\n\t\t for ( Coordinate newPt : gg.getPoints() ) {\n\t\t \treduFlg[ ii ] = false;\n\t\t \t\n\t\t \tfor ( int jj = 0; jj < smear.getPoints().size(); jj++ ) {\n\t\t \t\tif ( GfaSnap.getInstance().isSamePoint( newPt, \n\t\t \t\t\t\t smear.getPoints().get( jj ), GfaSnap.MAP_PRECISION ) ) {\n\t\t \t\t\treduFlg[ ii ] = smear.getReduceFlags()[ jj ];\n\t\t \t\t\tbreak;\t\t \t\t\t\n\t\t \t\t}\n\t\t \t}\n\t\t \tii++;\n\t\t }\n\t\t\t\n\t\t\tgg.setReduceFlags( reduFlg ); \n\t\t}\n\t\t\t\t\t\t\t\t\n\t\treturn newSmears;\n\t\n }", "private Vector detectCommonSegPt(Vector segVL, Stroke theStroke)\n\t{\n\t\t\n\t\tint len = theStroke.getM_ptList().size();\n\t\tint[] stk_Arr = new int[len];\n\t\tint methodCnt = segVL.size(); //number of methods used to detect seg-points. \n\n\t\t// check if accepable value is set to a reasonable vaule\n\t\tif((Prefs.getAcceptableVotes() >= 1) && (Prefs.getAcceptableVotes() <= methodCnt))\n\t\t{\n\t\t\t// set the method count to acceptable votes.\n\t\t\tmethodCnt = Prefs.getAcceptableVotes();\n\t\t}\n\t\t\n\t\t// TODO: is there a better way to do it? \n\t\t// init the array to all 0\n\t\tfor(int i=0; i<len; i++) stk_Arr[i]=0;\n\t\t\n\t\tint commonWindow = COMMON_SEG_WINDOW;\n\t\tdouble commonDistance = COMMON_SEG_DISTANCE+2;\n\t\t/* commonDistance size of anchor_point, which are end-points of segments.\n\t\t * We want to filter-out seg-points too close together and create 'large'\n\t\t * seg-points to replace them.\n\t\t */\n\t\tVector commonSegPts = new Vector();\n\t\tIterator iter = segVL.iterator();\n\t\t\n\t\t// repeat for each segmentation algorithm\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tVector element = (Vector) iter.next();\n\t\t\tIterator iterator = element.iterator();\n\t\t\tint lastUsedPos=-1;\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tInteger obj = (Integer) iterator.next(); //get the seg point index\n\t\t\t\tint index = obj.intValue();\n\t\t\t\tPixelInfo indexPt = (PixelInfo)theStroke.getM_ptList().get(index);\n\t\t\t\t\n\t\t\t\tint start = index - commonWindow;\n\t\t\t\tint end = index + commonWindow;\n\t\t\t\t// check if i is within the array bounds, if yes, increment the array,\n\t\t\t\t// make sure that one segmentation scheme increments one point only once\n\t\t\t\tstart = (start>lastUsedPos)? start:lastUsedPos+1;\n\t\t\t\tend = (end<len)? end:len-1;\n\t\t\t\tfor(int i=start; i<=end; i++)\n\t\t\t\t{\n\t\t\t\t\tPixelInfo pt = (PixelInfo)theStroke.getM_ptList().get(i);\n\t\t\t\t\tif(indexPt.distance(pt) <= commonDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tstk_Arr[i]++;\n\t\t\t\t\t\tlastUsedPos = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// find the points with more than methodCnt value\n\t\tint i = 0;\n\t\twhile(i<len)\n\t\t{\n\t\t\t// store the index as the segment point, if condition is met\n\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t{\n\t\t\t\t// find out the streak of continuous pixels\n\t\t\t\tint beginIdx = i;\n\t\t\t\tint endIdx = i;\n\t\t\t\ti++;\n\t\t\t\twhile(i<len)\n\t\t\t\t{\n\t\t\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t\t\t{\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\tendIdx = i-1;\n\t\t\t\t\n\t\t\t\t// find one point from that streak\n\t\t\t\tint segPt = 0;\n\t\t\t\t// check if the segment is very short\n\t\t\t\tif((beginIdx==0)&&(endIdx==(len-1)))\n\t\t\t\t{\n\t\t\t\t\tif(beginIdx==endIdx) commonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\telse\n\t\t\t\t\t{\t// segment is not just one point\n\t\t\t\t\t\tcommonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\t\tcommonSegPts.add(new Integer(endIdx));\n\t\t\t\t\t}\n\t\t\t\t\treturn commonSegPts;\n\t\t\t\t}\n\t\t\t\telse if(beginIdx==0) segPt = 0;\n\t\t\t\telse if(endIdx==(len-1)) segPt = endIdx;\n\t\t\t\telse segPt = (int)Math.floor((beginIdx+endIdx)/2);\n\t\t\t\t\n\t\t\t\t// add segPt to the list of detected segments.\n\t\t\t\tcommonSegPts.add(new Integer(segPt));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn commonSegPts;\n\t}", "static MaxSeparation findMaxSeparation(PolygonShape poly1, XForm xf1,\n \t\t\t\t\t\t\t\t\t PolygonShape poly2, XForm xf2) {\n MaxSeparation separation = new MaxSeparation();\n\n int count1 = poly1.m_vertexCount;\n \n // Vector pointing from the centroid of poly1 to the centroid of poly2.\n \tVec2 d = XForm.mul(xf2, poly2.m_centroid).subLocal(XForm.mul(xf1, poly1.m_centroid));\n \tVec2 dLocal1 = Mat22.mulT(xf1.R, d);\n\n \t// Find edge normal on poly1 that has the largest projection onto d.\n int edge = 0;\n float maxDot = -Float.MAX_VALUE;\n for (int i = 0; i < count1; ++i) {\n float dot = Vec2.dot(poly1.m_normals[i], dLocal1);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n\n // Get the separation for the edge normal.\n float s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f){\n separation.bestSeparation = s;\n return separation;\n }\n\n // Check the separation for the previous edge normal.\n int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;\n float sPrev = edgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n if (sPrev > 0.0f) {\n separation.bestSeparation = sPrev;\n return separation;\n }\n\n int nextEdge = edge + 1 < count1 ? edge + 1 : 0;\n float sNext = edgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n if (sNext > 0.0f){\n separation.bestSeparation = sNext;\n return separation;\n }\n\n // Find the best edge and the search direction.\n int bestEdge;\n float bestSeparation;\n int increment;\n if (sPrev > s && sPrev > sNext) {\n increment = -1;\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s){\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n } else {\n separation.bestFaceIndex = edge;\n separation.bestSeparation = s;\n return separation;\n }\n\n // Perform a local search for the best edge normal.\n while (true) {\n if (increment == -1)\n edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else\n edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;\n\n s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f) {\n separation.bestSeparation = s;\n return separation;\n }\n\n if (s > bestSeparation){\n bestEdge = edge;\n bestSeparation = s;\n } else {\n break;\n }\n }\n\n separation.bestFaceIndex = bestEdge;\n separation.bestSeparation = bestSeparation;\n\n return separation;\n }", "private void splitIntoRoots() {\n\t\tArrayList<ArrayList<Coord>> circ = findCircles();\n\t\tcombinePastRoots(circ);\n\t}", "public PVector separate (ArrayList<Boid> vehicles) {\n float desiredseparation = r*15;\n PVector steer = new PVector(0,0);\n int count = 0;\n // For every boid in the system, check if it's too close\n for (Boid other : vehicles) {\n float d = PVector.dist(location, other.location);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredseparation)) {\n // Calculate vector pointing away from neighbor\n PVector diff = PVector.sub(location, other.location);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n }\n // Average -- divide by how many\n if (count > 0) {\n steer.div((float)count);\n // Our desired vector is the average scaled to maximum speed\n steer.normalize();\n steer.mult(maxspeed);\n // Implement Reynolds: Steering = Desired - Velocity\n steer.sub(velocity);\n steer.limit(maxforce);\n }\n return steer;\n }", "private ArrayList<Vertex> truncateHeadAtConflictArea(ArrayList<Vertex> vertices) {\n \t\tPoint2D.Double polygon[] = new Point2D.Double[conflictArea.size()];\r\n \t\tfor (int i = conflictArea.size(); --i >= 0; )\r\n \t\t\tpolygon[i] = conflictArea.get(i).getPoint();\r\n \t\tArrayList<Vertex> result = new ArrayList<Vertex>();\r\n \t\tresult.add(vertices.get(0));\r\n \t\tPoint2D.Double prevPoint = null;\r\n \t\tfor (Vertex v : vertices) {\r\n \t\t\tPoint2D.Double p = v.getPoint();\r\n \t\t\tif (null != prevPoint) {\r\n \t\t\t\tLine2D.Double line = new Line2D.Double(prevPoint, p);\r\n \t\t\t\tdouble closest = Double.MAX_VALUE;\r\n \t\t\t\tPoint2D.Double replacementPoint = null;\r\n \t\t\t\tArrayList<Point2D.Double> intersections = Planar.lineIntersectsPolygon(line, polygon);\r\n \t\t\t\t// find intersections with the polygon\r\n \t\t\t\tfor (Point2D.Double intersection : intersections) {\r\n \t\t\t\t\t// if statement added \r\n \t\t\t\t\tif (intersection != null) {\r\n \t\t\t\t\t\tdouble distance = intersection.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = intersection;\r\n \t\t\t\t\t\t\tclosest = distance;\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// find very near misses with the polygon\r\n \t\t\t\tfor (Point2D.Double pp : polygon) {\r\n \t\t\t\t\tif (Planar.distanceLineSegmentToPoint(line, pp) < veryClose) {\r\n \t\t\t\t\t\tdouble distance = pp.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = pp;\r\n \t\t\t\t\t\t\tclosest = distance;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (null != replacementPoint) {\r\n \t\t\t\t\tresult.clear();\r\n \t\t\t\t\tresult.add(new Vertex(replacementPoint, z));\r\n \t\t\t\t}\r\n \t\t\t\tresult.add(v);\r\n \t\t\t}\r\n \t\t\tprevPoint = p;\r\n \t\t}\t\t\r\n \t\treturn result;\r\n \t}", "Vector selectBestSegPtsSet(Vector IterWiseSegPts){\n\t\tVector Vect = new Vector();\t\t\t// to return final set of segment pts\n\t\tVector TempVect = new Vector(); // to store temporary iteration results\n\t\tint index = -1;\n\t\t// if it consists of only common pts\n\t\tif(IterWiseSegPts.size() == 1) {\n\t\t\tindex = 0;\n\t\t}\n\t\t\n\t\t//if it consists of only two segment pt sets \n\t\telse if(IterWiseSegPts.size() == 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tif((PrevError - NewError) > 100.0){ //selecting the second set if error reduction is > 100.0\n\t\t\t\tindex = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t}\n\t\telse if(IterWiseSegPts.size() > 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tdouble ChangeInPrevError = PrevError - NewError;\n\t\t\tdouble ChangeInNewError;\n\t\t\tPrevError = NewError;\n\t\t\tif(ChangeInPrevError < 15.0){ //selecting the first set if change in error is < 30.0\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint Iterator = 2;\n\t\t\t\tint Iterations = IterWiseSegPts.size();\n\t\t\t\twhile(Iterator < Iterations){\n\t\t\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, Iterator);\n\t\t\t\t\tNewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\t\tChangeInNewError = PrevError - NewError;\n\t\t\t\t\t// if new iteration's error is less (or more) than prev itertion within 30.0 \n\t\t\t\t\t// or if previous change in segment pts Error > 3 times new change in segment pts error\n\t\t\t\t\tif( (ChangeInNewError < 30.0) && (NewError < 1000.0)){// (ChangeInPrevError > (3 * ChangeInNewError))\n\t\t\t\t\t\tindex = Iterator - 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tChangeInPrevError = ChangeInNewError;\n\t\t\t\t\tPrevError = NewError;\n\t\t\t\t\tIterator++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t//}\n\t\tTempVect = clearVector(TempVect);\n\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, index);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\tindex = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tVect.add((Integer)TempVect.get(index++));\n\t\t}\n\t\treturn Vect;\n\t}", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "public boolean rayCrossesSegment(LatLng point, LatLng a, LatLng b) {\n double px = point.longitude,\n py = point.latitude,\n ax = a.longitude,\n ay = a.latitude,\n bx = b.longitude,\n by = b.latitude;\n if (ay > by) {\n ax = b.longitude;\n ay = b.latitude;\n bx = a.longitude;\n by = a.latitude;\n }\n // alter longitude to cater for 180 degree crossings\n if (px < 0 || ax < 0 || bx < 0) {\n px += 360;\n ax += 360;\n bx += 360;\n }\n // if the point has the same latitude as a or b, increase slightly py\n if (py == ay || py == by) py += 0.00000001;\n\n\n // if the point is above, below or to the right of the segment, it returns false\n if ((py > by || py < ay) || (px > Math.max(ax, bx))) {\n return false;\n }\n // if the point is not above, below or to the right and is to the left, return true\n else if (px < Math.min(ax, bx)) {\n return true;\n }\n // if the two above conditions are not met, you have to compare the slope of segment [a,b] (the red one here) and segment [a,p] (the blue one here) to see if your point is to the left of segment [a,b] or not\n else {\n double red = (ax != bx) ? ((by - ay) / (bx - ax)) : Double.POSITIVE_INFINITY;\n double blue = (ax != px) ? ((py - ay) / (px - ax)) : Double.POSITIVE_INFINITY;\n return (blue >= red);\n }\n\n }", "private static List<String> simpleTokenize (String text) {\r\n\r\n // Do the no-brainers first\r\n String splitPunctText = splitEdgePunct(text);\r\n\r\n int textLength = splitPunctText.length();\r\n \r\n // BTO: the logic here got quite convoluted via the Scala porting detour\r\n // It would be good to switch back to a nice simple procedural style like in the Python version\r\n // ... Scala is such a pain. Never again.\r\n\r\n // Find the matches for subsequences that should be protected,\r\n // e.g. URLs, 1.0, U.N.K.L.E., 12:53\r\n Matcher matches = Protected.matcher(splitPunctText);\r\n //Storing as List[List[String]] to make zip easier later on \r\n List<List<String>> bads = new ArrayList<List<String>>();\t//linked list?\r\n List<Pair<Integer,Integer>> badSpans = new ArrayList<Pair<Integer,Integer>>();\r\n while(matches.find()){\r\n // The spans of the \"bads\" should not be split.\r\n if (matches.start() != matches.end()){ //unnecessary?\r\n List<String> bad = new ArrayList<String>(1);\r\n bad.add(splitPunctText.substring(matches.start(),matches.end()));\r\n bads.add(bad);\r\n badSpans.add(new Pair<Integer, Integer>(matches.start(),matches.end()));\r\n }\r\n }\r\n\r\n // Create a list of indices to create the \"goods\", which can be\r\n // split. We are taking \"bad\" spans like \r\n // List((2,5), (8,10)) \r\n // to create \r\n /// List(0, 2, 5, 8, 10, 12)\r\n // where, e.g., \"12\" here would be the textLength\r\n // has an even length and no indices are the same\r\n List<Integer> indices = new ArrayList<Integer>(2+2*badSpans.size());\r\n indices.add(0);\r\n for(Pair<Integer,Integer> p:badSpans){\r\n indices.add(p.first);\r\n indices.add(p.second);\r\n }\r\n indices.add(textLength);\r\n\r\n // Group the indices and map them to their respective portion of the string\r\n List<List<String>> splitGoods = new ArrayList<List<String>>(indices.size()/2);\r\n for (int i=0; i<indices.size(); i+=2) {\r\n String goodstr = splitPunctText.substring(indices.get(i),indices.get(i+1));\r\n List<String> splitstr = Arrays.asList(goodstr.trim().split(\" \"));\r\n splitGoods.add(splitstr);\r\n }\r\n\r\n // Reinterpolate the 'good' and 'bad' Lists, ensuring that\r\n // additonal tokens from last good item get included\r\n List<String> zippedStr= new ArrayList<String>();\r\n int i;\r\n for(i=0; i < bads.size(); i++) {\r\n zippedStr = addAllnonempty(zippedStr,splitGoods.get(i), true);\r\n zippedStr = addAllnonempty(zippedStr,bads.get(i), false);\r\n }\r\n zippedStr = addAllnonempty(zippedStr,splitGoods.get(i), true);\r\n \r\n // BTO: our POS tagger wants \"ur\" and \"you're\" to both be one token.\r\n // Uncomment to get \"you 're\"\r\n /*ArrayList<String> splitStr = new ArrayList<String>(zippedStr.size());\r\n for(String tok:zippedStr)\r\n \tsplitStr.addAll(splitToken(tok));\r\n zippedStr=splitStr;*/\r\n \r\n return zippedStr;\r\n }", "private TreeSet<BisectDistInfo> findAllSegments( Coordinate[] poly ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\t\t\t\t\n\t Coordinate[] seg = new Coordinate[2];\n\t boolean qualify;\n\t \n\t\tfor ( int ii = 0; ii < (poly.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (poly.length); jj ++ ) {\n\t\t seg[0] = poly[ii];\n\t\t seg[1] = poly[jj]; \n\t\t \n\t\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\t if ( qualify ) {\n\t\t\t\t double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\t if ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\t distInfo.add( new BisectDistInfo( dist, ii, jj ) );\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\t\t\t\n }\n\n\t\treturn distInfo;\n\t\t\n\t}", "private List<IAtomContainer> splitMolecule(IAtomContainer atomContainer, IBond bond) throws CDKException, Exception\n {\n \t\n \t//if this bond is in a ring we have to split another bond in this ring where at least one \n //bond is in between. Otherwise we wont have two fragments. Else normal split.\n \n List<IAtomContainer> ret = new ArrayList<IAtomContainer>(); \n \n //get bond energy for splitting this bond\n double currentBondEnergy = getBondEnergy(bond);\n \n \n //bond is in a ring....so we have to split up another bond to break it\n IRingSet rings = allRings.getRings(bond);\n if (rings.getAtomContainerCount() != 0 )\n { \n \t//only traverse one ring!!!!\n \tfor (int i = 0; i < 1; i++) {\n \t\t//get bonds that are connected to the atom....they should not be removed....disabled\n \t\t//List<IBond> atomBondsExclude = rings.get(i).getConnectedBondsList(atom);\n \t\n \t\t\n \t\tfor (IBond bondInRing : rings.getAtomContainer(i).bonds()) {\n \t\t\t//if the bonds are the same...this wont split up the ring\n \t\t\tif(bondInRing == bond)\n \t\t\t\tcontinue;\n \t\t\t\n\n \t\t\t//check for already tried bonds\n \t\t\tBondPair check = new BondPair(bond, bondInRing);\n \t\t\tif (knownBonds.contains(check))\n \t\t\t\tcontinue;\n \t\t\tknownBonds.add(new BondPair(bond,bondInRing));\n \t\t\t \t\t\t\n\t\t\t\n \t\t\tList<IAtomContainer> set = new ArrayList<IAtomContainer>();\n \t\t\tList<List<IBond>> bondListList = new ArrayList<List<IBond>>();\n \tList<Double> fragWeightList = new ArrayList<Double>();\n\n \tfor (IAtom currentAtom : bond.atoms()) {\n \t\tthis.startTraverse = System.currentTimeMillis();\n \t\t//List with bonds in Ring\n \t\t\tList<IBond> partRing = new ArrayList<IBond>();\n \t\t\t//reset the weight because it is computed inside the traverse\n \t\t\tthis.currentFragWeight = 0.0;\n \t\t\t//initialize new atom list\n \t atomList = new ArrayList<IAtom>();\n \t \n \t //clone current atom because a single electron is being added...homolytic cleavage\n \t\tpartRing = traverse(atomContainer, currentAtom, partRing, bond, bondInRing);\n \t\t\n \t\tbondListList.add(partRing);\n \t\tfragWeightList.add(this.currentFragWeight);\n \t\tthis.endTraverse = System.currentTimeMillis() - this.startTraverse;\n this.sumTraverse += this.endTraverse;\n \n this.startAtom = System.currentTimeMillis();\n \n IAtomContainer temp = makeAtomContainer(currentAtom, partRing);\n //set the properties again!\n Map<Object, Object> properties = atomContainer.getProperties();\n temp.setProperties(properties);\n \n \n //*********************************************************\n //BOND ENERGY CALCULATION\n //calculate bond energy\n double currentBondEnergyRing = getBondEnergy(bondInRing);\n \n //*********************************************************\n \n //now set property\n temp = setBondEnergy(temp, (currentBondEnergyRing + currentBondEnergy));\n \n if(lonePairGeneration)\n {\n \t//create the single electron (radical site)\n \tfor (IAtom bondAtom : bond.atoms()) {\n \t\ttemp.addSingleElectron(temp.getAtomNumber(bondAtom));\n \t}\n \tfor (IAtom bondAtom : bondInRing.atoms()) {\n \t\ttemp.addSingleElectron(temp.getAtomNumber(bondAtom));\n \t}\n \t//temp.addSingleElectron(temp.getAtomNumber(currentAtom));\n \t//AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(temp);\n }\n \n set.add(temp);\n \n this.endAtom = System.currentTimeMillis() - this.startAtom;\n this.sumAtom += this.endAtom;\n \n \t}\n \t\t\t\n \t//now maybe add the fragments to the list\n for (int j = 0; j < set.size(); j++) \n {\t \t \n\t //Render.Draw(set.getAtomContainer(j), \"\");\n\t \t if (set.get(j).getAtomCount() > 0 && set.get(j).getBondCount() > 0 && \n\t \t \t\tset.get(j).getAtomCount() != atomContainer.getAtomCount())\n\t \t {\n\t \t \tthis.startMass = System.currentTimeMillis(); \n\t \t\t\n\t \t \t//now check the current mass\n\t \t \tdouble fragMass = getFragmentMass(set.get(j), fragWeightList.get(j));\n\t \t\t//check the weight of the current fragment\n\t \t \tif(!isHeavyEnough(fragMass))\n\t \t\t\tcontinue;\n\t \t\tthis.endMass = System.currentTimeMillis() - this.startMass;\n\t this.sumMass += this.endMass;\n\t \n\t \t \tthis.startIsomorph = System.currentTimeMillis(); \n\t \t //returns true if isomorph\n\t \t \t//set the current sum formula\n\t \t \tIMolecularFormula fragmentFormula = MolecularFormulaManipulator.getMolecularFormula(set.get(j));\n\t \t \tString currentSumFormula = MolecularFormulaManipulator.getString(fragmentFormula);\n\t \t \tif(isIdentical(set.get(j), currentSumFormula))\n\t \t \tcontinue;\n\t \t this.endIsomorph = System.currentTimeMillis() - this.startIsomorph;\n\t this.sumIsomorph += this.endIsomorph;\n\t \n\t if(this.neutralLossAdd)\n\t {\n\t\t //now add neutral losses to it\n\t\t List<IAtomContainer> fragsNL = AddNeutralLosses(set.get(j), fragmentFormula, false);\n\t\t //for now add all fragments to the list TODO\n\t\t ret.addAll(fragsNL);\n\t }\n\t //add the fragment to the return list\n\t \t ret.add(set.get(j));\n\t \t } \n }\n \t\t} \t\t\n\t\t\t}\n }\n else\n {\n \tList<IAtomContainer> set = new ArrayList<IAtomContainer>();\n \tList<List<IBond>> bondListList = new ArrayList<List<IBond>>();\n \tList<Double> fragWeightList = new ArrayList<Double>();\n\n \t//get the atoms from the splitting bond --> create 2 fragments\n \tfor (IAtom currentAtom : bond.atoms()) {\n \t\tList<IBond> part = new ArrayList<IBond>();\n \t\tthis.startTraverse = System.currentTimeMillis();\n \t\t//reset the weight because it is computed inside the traverse\n \t\t\tthis.currentFragWeight = 0.0;\n \t\t\t//initialize new atom list\n \t atomList = new ArrayList<IAtom>();\n \t\tpart = traverse(atomContainer, currentAtom, part, bond);\n \t\tbondListList.add(part); \t\t\n \t\tthis.endTraverse = System.currentTimeMillis() - this.startTraverse;\n this.sumTraverse += this.endTraverse;\n \n \t\t//create Atomcontainer out of bondList\n \t\tthis.startAtom = System.currentTimeMillis(); \n \t\t\n \t\tIAtomContainer temp = makeAtomContainer(currentAtom, part);\n \t\t//set the properties again!\n Map<Object, Object> properties = atomContainer.getProperties();\n temp.setProperties(properties);\n //now calculate the correct weight subtrating the possible neutral loss mass\n \n fragWeightList.add(this.currentFragWeight);\n \n \n \t\t//now set property: BondEnergy!\n temp = setBondEnergy(temp, currentBondEnergy);\n \n if(lonePairGeneration)\n {\n \t//create the single electron (radical site)\n \tfor (IAtom bondAtom : bond.atoms()) {\n \t\ttemp.addSingleElectron(temp.getAtomNumber(bondAtom));\n \t}\n \t//AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(temp);\n }\n set.add(temp);\n \n \t\tthis.endAtom = System.currentTimeMillis() - this.startAtom;\n this.sumAtom += this.endAtom;\n \t}\n \n \n \n //at most 2 new molecules\n for (int i = 0; i < set.size(); i++) \n {\n\t \n\t if (set.get(i).getAtomCount() > 0 && set.get(i).getBondCount() > 0 &&\n\t \t\tset.get(i).getAtomCount() != atomContainer.getAtomCount())\n\t {\n\t \tthis.startMass = System.currentTimeMillis();\n\t \t\n\t \t//now check the current mass\n\t \tdouble fragMass = getFragmentMass(set.get(i), fragWeightList.get(i));\n \t\t//check the weight of the current fragment\n\t \tif(!isHeavyEnough(fragMass))\n \t\t\tcontinue;\n \t\tthis.endMass = System.currentTimeMillis() - this.startMass;\n this.sumMass += this.endMass; \n \n\t \tthis.startIsomorph = System.currentTimeMillis(); \n\t\t //set the current sum formula\n\t \tIMolecularFormula fragmentFormula = MolecularFormulaManipulator.getMolecularFormula(set.get(i));\n\t \tString currentSumFormula = MolecularFormulaManipulator.getString(fragmentFormula);\n\t \t//returns true if isomorph (fast isomorph check)\n\t \tif(isIdentical(set.get(i), currentSumFormula))\n\t\t \tcontinue;\n\t\t this.endIsomorph = System.currentTimeMillis() - this.startIsomorph;\n\t this.sumIsomorph += this.endIsomorph;\n\t \n\t if(this.neutralLossAdd)\n {\n\t\t //now add neutral losses to it\n\t List<IAtomContainer> fragsNL = AddNeutralLosses(set.get(i), fragmentFormula, false);\n\t //for now add all fragments to the list TODO\n\t ret.addAll(fragsNL);\n }\n\t \n\t ret.add(set.get(i));\n\t }\n }\n \n }\n\n return ret;\n }", "public PVector separate (ArrayList<Boid> fish) {\n float desiredseparation = 25.0f;\n PVector steer = new PVector(0, 0, 0);\n int count = 0;\n // For every shark in the system, check if it's too close\n for (Boid other : fish) {\n float d = PVector.dist(position, other.position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredseparation)) {\n // Calculate vector pointing away from neighbor\n PVector diff = PVector.sub(position, other.position);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n }\n // Average -- divide by how many\n if (count > 0) {\n steer.div((float)count);\n }\n\n // As long as the vector is greater than 0\n if (steer.mag() > 0) {\n\n steer.normalize();\n steer.mult(maxspeed);\n steer.sub(velocity);\n steer.limit(maxforce);\n }\n return steer;\n }", "private boolean recognizeGesture(MotionEvent event, int policyFlags) {\n if (mStrokeBuffer.size() < 2) {\n return mListener.onGestureCancelled(event, policyFlags);\n }\n\n // Look at mStrokeBuffer and extract 2 line segments, delimited by near-perpendicular\n // direction change.\n // Method: for each sampled motion event, check the angle of the most recent motion vector\n // versus the preceding motion vector, and segment the line if the angle is about\n // 90 degrees.\n\n ArrayList<PointF> path = new ArrayList<>();\n PointF lastDelimiter = new PointF(mStrokeBuffer.get(0).x, mStrokeBuffer.get(0).y);\n path.add(lastDelimiter);\n\n float dX = 0; // Sum of unit vectors from last delimiter to each following point\n float dY = 0;\n int count = 0; // Number of points since last delimiter\n float length = 0; // Vector length from delimiter to most recent point\n\n PointF next = new PointF();\n for (int i = 1; i < mStrokeBuffer.size(); ++i) {\n next = new PointF(mStrokeBuffer.get(i).x, mStrokeBuffer.get(i).y);\n if (count > 0) {\n // Average of unit vectors from delimiter to following points\n float currentDX = dX / count;\n float currentDY = dY / count;\n\n // newDelimiter is a possible new delimiter, based on a vector with length from\n // the last delimiter to the previous point, but in the direction of the average\n // unit vector from delimiter to previous points.\n // Using the averaged vector has the effect of \"squaring off the curve\",\n // creating a sharper angle between the last motion and the preceding motion from\n // the delimiter. In turn, this sharper angle achieves the splitting threshold\n // even in a gentle curve.\n PointF newDelimiter = new PointF(length * currentDX + lastDelimiter.x,\n length * currentDY + lastDelimiter.y);\n\n // Unit vector from newDelimiter to the most recent point\n float nextDX = next.x - newDelimiter.x;\n float nextDY = next.y - newDelimiter.y;\n float nextLength = (float) Math.sqrt(nextDX * nextDX + nextDY * nextDY);\n nextDX = nextDX / nextLength;\n nextDY = nextDY / nextLength;\n\n // Compare the initial motion direction to the most recent motion direction,\n // and segment the line if direction has changed by about 90 degrees.\n float dot = currentDX * nextDX + currentDY * nextDY;\n if (dot < ANGLE_THRESHOLD) {\n path.add(newDelimiter);\n lastDelimiter = newDelimiter;\n dX = 0;\n dY = 0;\n count = 0;\n }\n }\n\n // Vector from last delimiter to most recent point\n float currentDX = next.x - lastDelimiter.x;\n float currentDY = next.y - lastDelimiter.y;\n length = (float) Math.sqrt(currentDX * currentDX + currentDY * currentDY);\n\n // Increment sum of unit vectors from delimiter to each following point\n count = count + 1;\n dX = dX + currentDX / length;\n dY = dY + currentDY / length;\n }\n\n path.add(next);\n Slog.i(LOG_TAG, \"path=\" + path.toString());\n\n // Classify line segments, and call Listener callbacks.\n return recognizeGesturePath(event, policyFlags, path);\n }", "public List<Segmentation> getSegmentationsForCVTesting(double threshold)\n\t\t\tthrows InvalidParametersException {\n\n\t\t// Check that we have a stroke\n\t\tif (m_stroke == null) {\n\t\t\tthrow new InvalidParametersException();\n\t\t}\n\n\t\tList<Integer> allCorners = getInitialCorners();\n\t\tList<Integer> subset = new ArrayList<Integer>();\n\n\t\t// Find the best subset of corners using the given feature subset\n\t\t// selection algorithm\n\t\tsubset = sbfsForCVTesting(allCorners, m_stroke, m_objFunction,\n\t\t\t\tthreshold);\n\n\t\tList<Segmentation> combinedSegmentations = segmentStroke(m_stroke,\n\t\t\t\tsubset, S_SEGMENTER_NAME, 0.80);\n\n\t\treturn combinedSegmentations;\n\t}", "private Point[] getBresenhamLine(Point p0, Point p1, int lineWidth) {\n int x0 = p0.X;\n int y0 = p0.Y;\n int x1 = p1.X;\n int y1 = p1.Y;\n\n // Calculate the distance between the 2 points for x and y\n int dx = Math.abs(x1 - x0);\n int dy = Math.abs(y1 - y0);\n\n // Define a direction to move\n int sx = x0 < x1 ? 1 : -1;\n int sy = y0 < y1 ? 1 : -1;\n\n // \n int err = dx - dy;\n\n List<Point> points = new ArrayList();\n\n while (true) {\n // Add the current point to the list\n points.add(new Point(x0, y0));\n for (int i = 0; i < lineWidth / 2; i++) {\n points.add(new Point(x0 + sx * i, y0));\n points.add(new Point(x0 - sx * i, y0));\n\n points.add(new Point(x0, y0 + sy * i));\n points.add(new Point(x0, y0 - sy * i));\n\n points.add(new Point(x0 + sx * i, y0 + sy * i));\n points.add(new Point(x0 - sx * i, y0 + sy * i));\n points.add(new Point(x0 + sx * i, y0 - sy * i));\n points.add(new Point(x0 - sx * i, y0 - sy * i));\n }\n\n // If the current point equals to the end position, break the loop\n if (x0 == x1 && y0 == y1) {\n break;\n }\n\n int e2 = 2 * err;\n if (e2 > -dy) {\n err = err - dy;\n x0 = x0 + sx;\n }\n if (e2 < dx) {\n err = err + dx;\n y0 = y0 + sy;\n }\n }\n\n Set<Point> uniquePoints = new HashSet<>(points);\n\n return uniquePoints.toArray(new Point[uniquePoints.size()]);\n }", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "private Vector combinationAlgorithm(Stroke theStroke){\n\t\tCurvatureBasedDetection cbd = new CurvatureBasedDetection();\n\t\tSpeedBasedDetection sbd = new SpeedBasedDetection();\n\t\tCommonSegmentPts = new Vector();\n\t\tCurvPts = cbd.getCurvatureData();\n\t\tdouble SpeedPts[][] = sbd.getSpeedData();\n\t\tCurvPtCount = cbd.getIndex();\n\t\tint SpeedPtCount = sbd.getIndex();\n\t\tint index ;\n\t\tCurvVector = new Vector();\n\t\t//copy the speed and curvature data in two vectors\n\t\tfor (index = 0; index < CurvPtCount ; index++){\n\t\t\tDouble obj = CurvPts[index][0];\n\t\t\tCurvVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Curvature Indices\");\n\t\tprintValues(CurvVector);\n\t\t\n\t\tSpeedVector = new Vector();\n\t\tfor (index = 0; index < SpeedPtCount ; index++){\n\t\t\tDouble obj = SpeedPts[index][0];\n\t\t\tSpeedVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\tSystem.out.println(\"Speed Indices\");\n\t\tprintValues(SpeedVector);\n\t\tSort sort = new Sort();\n\t\tint ElementIndex;\n\t\t// find common points (intersection of speed and curvature) and put it in CommonSegmentPts vector\n\t\t\n\t\tboolean flag = false;\n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\t\n\t\t\tElementIndex = sort.linearSearch(CurvVector, (Integer)SpeedVector.elementAt(index));\n\t\t\t\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tCommonSegmentPts.add((Integer)(CurvVector.elementAt(ElementIndex)));\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index --); // point is removed from vectors\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\tSystem.out.println(\"Common Points\");\n\t\tprintValues(CommonSegmentPts);\n\t\tint ElemAtIndex;\n\t\t// Find the curvature based segment points in the Tolerance Distance of speed based segment points \n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\tElementIndex = FindNearbyPts(CurvVector, (Integer)SpeedVector.elementAt(index), theStroke);\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tElemAtIndex = ((Integer)CurvVector.elementAt(ElementIndex) + (Integer)SpeedVector.elementAt(index))/2;\n\t\t\t\tCommonSegmentPts.add(ElemAtIndex);\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index--);\n\t\t\t}\n\t\t}\n\t\t//printValues(CommonSegmentPts);\n\t\tremoveNearbyPixels(theStroke);\n\t\t//setNewScalingFactor(theStroke);\n\t\tCollections.sort(CommonSegmentPts);\n\t\tprintValues(CommonSegmentPts);\n\t\tdouble PrevIterError;\n\t\tdouble NewIterError;\n\t\tVector IterationPts = new Vector(); \n\t\t//System.out.println(\"Error \" + (PrevIterError = calculateError(CommonSegmentPts, theStroke)));\n\t\t// create a vector that stores segment points of each iteration\n\t\tIterWiseSegPts = new Vector();\n\t\t// for hybrid\n\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\tdouble PrevError = calculateError(IterationPts, theStroke);\n\t\tif(PrevError > 10000.0){\t// if stroke consists of curves\n\t\t\terrorTolerance = 90.0;\n\t\t}\n\t\tIterationPts.add((double ) PrevError);\n\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\tdouble NewError = -1;\n/*\t\tint vectorIndex = 0;\n\t\t\n\t\twhile(CurvVector.size()!=0 || SpeedVector.size()!=0){\n\t*/\t\t\n\t\t\t// code for accepting seg points uptil pts reduce the error by 100\n\t\t/*\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tCommonSegmentPts.add(CurvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(CurvIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(CurvVector.size()!=0){\n\t\t\t\t\t\tCurvVector.remove(0);\n\t\t\t\t\t}\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tCommonSegmentPts.add(SpeedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tSystem.out.println(\"New Error = \" + NewIterError);\n\t\t\t//CommonSegmentPts.add((Double)NewIterError);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0 ){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(SpeedIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(SpeedVector.size()!=0){\n\t\t\t\t\t\tSpeedVector.remove(0);\n\t\t\t\t\t}\t\t\n\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\t\t// my approach\n\t/*\t\t\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\t\t\tCurvVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tCurvVector = clearVector(CurvVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\t\t\tSpeedVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tIterationPts = clearVector(IterationPts);\n\t\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\t\tCollections.sort(IterationPts);\n\t\t\tIterError = calculateError(IterationPts, theStroke);\n\t\t\tIterationPts.add((double) IterError);\n\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\t\tremoveNearbyPixels(theStroke);\n\n\t\t}\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t/*\tif(CurvVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\tCurvVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tCurvVector = clearVector(CurvVector);\n\t\t}\n\t}\n\tif(SpeedVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\tSpeedVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t}\n\t}\n\tIterationPts = clearVector(IterationPts);\n\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\tCollections.sort(IterationPts);\n\tIterError = calculateError(IterationPts, theStroke);\n\tIterationPts.add((double) IterError);\n\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\tremoveNearbyPixels(theStroke);\n\n}\nCommonSegmentPts = clearVector(CommonSegmentPts);\nCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t\n\t\t// hybrid fit approach\n\t\tint curvIndex = -1, speedIndex = -1;\n\t\tdouble curvError,speedError;\n\t\tVector curvPts = new Vector();\n\t\tVector speedPts = new Vector();\n\t\tVector changeInError = new Vector();\n\t\twhile((CurvVector.size() != 0) || (SpeedVector.size() != 0) ){\n\t\t\tcurvError = DEFAULT;\n\t\t\tspeedError = DEFAULT;\n\t\t\t\n\t\t\tif(CurvVector.size() != 0){\n\t\t\t\tclearVector(curvPts);\n\t\t\t\tcurvPts = copyVector(curvPts, CommonSegmentPts);\n\t\t\t\tcurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tcurvPts.add((Integer)curvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(curvPts);\n\t\t\t\tcurvError = calculateError(curvPts, theStroke);\n\t\t\t\tcurvPts.add((Double)curvError);\n\t\t\t}\n\t\t\t\n\t\t\tif(SpeedVector.size() != 0){\n\t\t\t\tclearVector(speedPts);\n\t\t\t\tspeedPts = copyVector(speedPts, CommonSegmentPts);\n\t\t\t\tspeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tspeedPts.add((Integer)speedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(speedPts);\n\t\t\t\tspeedError = calculateError(speedPts, theStroke);\n\t\t\t\tspeedPts.add((Double)speedError);\n\t\t\t}\n\t\t\t\n\t\t\tif((speedError <= curvError) || (curvError == DEFAULT)){\n\t\t\t\tNewError = speedError;\n\t\t\t\t//changeInError.add((Double)(NewError - PrevError));\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, speedPts);\n\t\t\t\tCommonSegmentPts.add((Integer)speedIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((curvError < speedError) || (speedError == DEFAULT)){\n\t\t\t\tNewError = curvError;\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, curvPts);\n\t\t\t\tCommonSegmentPts.add((Integer)curvIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tVector TempVect = new Vector();\n\t\tCommonSegmentPts = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() - 1);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\t/*index = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tCommonSegmentPts.add((Integer)TempVect.get(index++));\n\t\t}*/\n\t\t//CommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);\n\t\t\n\t\treturn CommonSegmentPts;\n\t}", "private GeometryCollection computeGeometrySplit( \n final Geometry featureGeometryOnMapCrs,\n final Geometry clippingGeometryOnMapCrs,\n final CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n try {\n // does the difference \n Geometry geoDiff = featureGeometryOnMapCrs.difference(clippingGeometryOnMapCrs);\n assert geoDiff instanceof GeometryCollection;\n \n GeometryCollection geoCollection = (GeometryCollection) geoDiff;\n\n return geoCollection;\n \n } catch (Exception e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "private static double divideAndConquer(ArrayList<Point> X, ArrayList<Point> Y) {\n\n\t\t//Assigns size of array\n\t\tint size = X.size();\n\n\t\t//If less than 3 points, efficiency is better by brute force\n\t\tif (size <= 3) {\n\t\t\treturn BruteForceClosestPairs(X);\n\t\t}\n\t\t\n\t\t//Ceiling of array size / 2\n\t\tint ceil = (int) Math.ceil(size / 2);\n\t\t//Floor of array size / 2\n\t\tint floor = (int) Math.floor(size / 2);\n\t\t\n\t\t//Array list for x & y values left of midpoint\n\t\tArrayList<Point> xL = new ArrayList<Point>();\t\n\t\tArrayList<Point> yL = new ArrayList<Point>();\n\t\t\n\t\t//for [0 ... ceiling of array / 2]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = 0; i < ceil; i++) {\n\t\t\t\n\t\t\txL.add(X.get(i));\n\t\t\tyL.add(Y.get(i));\n\t\t}\n\t\t\n\t\t// Array list for x & y values right of midpoint\n\t\tArrayList<Point> xR = new ArrayList<Point>();\n\t\tArrayList<Point> yR = new ArrayList<Point>();\n\t\t\n\t\t//for [floor of array / 2 ... size of array]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = floor; i < size - 1; i++) {\n\n\t\t xR.add(X.get(i));\n\t\t\tyR.add(Y.get(i));\n\t\t}\n\t\t\n\t\t//Recursively find the shortest distance\n\t\tdouble distanceL = divideAndConquer(xL, yL);\n\t\tdouble distanceR = divideAndConquer(xR, xL);\n\t\t//Smaller of both distances\n\t\tdouble distance = Math.min(distanceL, distanceR);\n\t\t//Mid-line\n\t\tdouble mid = X.get(ceil - 1).getX();\n\n\t\tArrayList<Point> S = new ArrayList<Point>();\n\n\t\t//copy all the points of Y for which |x - m| < d into S[0..num - 1]\n\t\tfor (int i = 0; i < Y.size() - 1; i++) {\n\n\t\t\tif (Math.abs(X.get(i).getX() - mid) < distance) {\n\t\t\t\tS.add(Y.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Square minimum distance\n\t\tdouble dminsq = distance * distance;\n\t\t//Counter\n\t\tint k = 0;\n\t\tint num = S.size();\n\n\t\tfor (int i = 0; i < num - 2; i++) {\n\t\t\t\n\t\t\tk = i + 1;\n\t\t\t\n\t\t\twhile (k <= num - 1 && (Math.pow((S.get(k).getY() - S.get(i).getY()), 2) < dminsq)) {\n\n\t\t\t\t//Find distance between points and find the minimum compared to dminsq\n\t\t\t\tdminsq = Math.min(Math.pow(S.get(k).getX() - S.get(i).getX(), 2) \n\t\t\t\t\t\t\t\t+ Math.pow(S.get(k).getY() - S.get(i).getY(), 2), dminsq);\n\n\t\t\t\tk = k + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.sqrt(dminsq);\n\t}", "private List<List<Segment>> getCleanSegments() {\n List<List<Segment>> clean = new ArrayList<>();\n List<Segment> segments = null;\n Segment previousSegment = null;\n for (Segment segment : getCleanableSegments()) {\n if (segments == null) {\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the previous segment is not an instance of the same version as this segment then reset the segments list.\n // Similarly, if the previous segment doesn't directly end with the index prior to the first index in this segment then\n // reset the segments list. We can only combine segments that are direct neighbors of one another.\n else if (previousSegment != null && (previousSegment.descriptor().version() != segment.descriptor().version() || previousSegment.lastIndex() != segment.firstIndex() - 1)) {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the total count of entries in all segments is less then the total slots in any individual segment, combine the segments.\n else if (segments.stream().mapToLong(Segment::count).sum() + segment.count() < segments.stream().mapToLong(Segment::length).max().getAsLong()) {\n segments.add(segment);\n }\n // If there's not enough room to combine segments, reset the segments list.\n else {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n previousSegment = segment;\n }\n\n // Ensure all cleanable segments have been added to the clean segments list.\n if (segments != null) {\n clean.add(segments);\n }\n return clean;\n }", "public Position.PositionList buildSegment() {\n List<Position> positions = new ArrayList<>(3);\n\n // determine the middle point of the descending segment\n Position middlePos;\n if (startPoint.getElevation() > endPoint.getElevation()) {\n middlePos = new Position(\n Position.interpolateGreatCircle(1 - PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), startPoint.getElevation());\n } else {\n middlePos = new Position(\n Position.interpolateGreatCircle(PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), endPoint.getElevation());\n }\n\n // add the last points\n positions.add(middlePos);\n positions.add(endPoint);\n\n return new Position.PositionList(positions);\n }", "@Override\n public Spliterator<SampleDescriptor> trySplit() {\n Spliterator<SampleDescriptor> retVal;\n // If there is only one sample left we don't split.\n int remaining = this.samples.size() - this.pos;\n if (remaining <= 1)\n retVal = null;\n else {\n // Compute the size for the entire list. This will be our running total of the size of the\n // remaining samples.\n long total = this.length();\n // Set up the new list.\n List<SampleDescriptor> newList = new ArrayList<SampleDescriptor>(remaining - 1);\n long newTotal = 0;\n // Loop until the old list is almost empty or it is smaller or equal to the new list, moving samples\n // from the end of the old list to the beginning of the new list.\n for (int tail = this.samples.size() - 1; tail > this.pos && newTotal < total; tail--) {\n // Move the last element in the old list to the new list.\n SampleDescriptor popped = this.samples.remove(tail);\n newList.add(popped);\n // Adjust the lengths.\n long len = popped.estimatedSize();\n total -= len;\n newTotal += len;\n }\n // Create a spliterator from the new list.\n retVal = new Splitter(newList);\n }\n return retVal;\n }", "private final boolean splits( final Geometry clippingGeometry, final Geometry featureGeometry ) {\n\n assert ! (featureGeometry instanceof GeometryCollection);\n \n if(featureGeometry instanceof Point){\n return false; // cannot split a point\n }\n \n // If the result of difference is a multygeometry then the geometry is splitted.\n Geometry geoDiff = featureGeometry.difference(clippingGeometry);\n\n boolean isGeometryCollection = geoDiff instanceof GeometryCollection;\n boolean intersects = featureGeometry.intersects(clippingGeometry);\n\n return isGeometryCollection && intersects;\n }", "public boolean isLineSplitBy(TessSeg s1)\r\n {\r\n if (!isLineHit(s1))\r\n {\r\n return false;\r\n }\r\n \r\n if (isPointOnLine(s1.c0)\r\n && !c0.equals(s1.c0) && !c1.equals(s1.c0))\r\n {\r\n return true;\r\n }\r\n \r\n if (isPointOnLine(s1.c1)\r\n && !c0.equals(s1.c1) && !c1.equals(s1.c1))\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "private ArrayList<DataSegment> splitSegment(DataSegment segment, ArrayList<int[]> overlapping) {\n int start=segment.getSegmentStart();\n int end=segment.getSegmentEnd();\n ArrayList<DataSegment> newlist=new ArrayList<DataSegment>();\n for (int[] sub:overlapping) {\n DataSegment subsegment=segment.getEmptySubSegmentGenomicPositions(sub[0], sub[1]);\n if (subsegment!=null) newlist.add(subsegment); else return null;\n// engine.logMessage(\"Segment (\"+segment.getLocationAsString()+\") overlaps with [\"+sub[0]+\",\"+sub[1]+\"]. Creating new subsegment => \"+subsegment.toString());\n Collections.sort(newlist); \n }\n // now fill in missing bits\n fillInMissingSegments(newlist, start, end, segment.getDatatrackName(), segment.getOrganism(), segment.getGenomeBuild(), segment.getChromosome());\n // one last check...\n String error=checkSegments(newlist, start, end);\n if (error!=null) engine.logMessage(\"SYSTEM WARNING: Detected problems while processing cached data (error code:\"+error+\".2)\"); \n return newlist;\n }", "public void createLots(double lotWidth, double lotHeight, double deviance)\n\t{\n\t\tdouble LOT_WIDTH = lotWidth;\n\t\tdouble LOT_DEPTH = lotHeight;\n\n\t\tdouble LOT_DEVIANCE = deviance;\n\t\tif (deviance < 0 || deviance > 1) {\n\t\t\tthrow new IllegalArgumentException(\"deviance must be between 0.0 and 1.0.\");\n\t\t}\n\n\t\tSubRegion region; /* Current region. */\n\t\t/*\n\t\t * Elements to be subdivided.\n\t\t */\n\t\tList<SubRegion> regionQueue = new ArrayList<SubRegion>();\n\t\t/*\n\t\t * Newly added regions by splitRegion.\n\t\t */\n\t\tList<SubRegion> newRegions = new ArrayList<SubRegion>();\n\t\t/*\n\t\t * Regions that need no further subdivision .\n\t\t */\n\t\tList<SubRegion> outputRegions = new ArrayList<SubRegion>();\n\n\t\tSubRegion.Edge longestEdge; /* Longest edge of current region. */\n\t\tLineSegment edgeLine = new LineSegment();\n\t\tdouble splitSize;\n\t\tPoint sp1, sp2; /* Split line. */\n\n\t\t/* A valid region must have at least 3 vertices. */\n\t\tif (constraints.numberOfVertices() < 3) {\n\t\t\tthrow new IllegalArgumentException(\"Number of vertices in constraints must be >= 3.\");\n\t\t}\n\n\t\t/*\n\t\t * Convert areaConstraints of this block to polygonGraph that is used in\n\t\t * subdivision algorithm.\n\t\t */\n\t\tregion = new SubRegion(constraints);\n\n\t\tSubRegion.Edge blockFirst = region.getFirstEdge();\n\t\tSubRegion.Edge current = blockFirst;\n\t\tdo /* All edges of Block has road access */\n\t\t{\n\t\t\tcurrent.hasRoadAccess = true;\n\t\t\tcurrent = current.next;\n\t\t} while (current != blockFirst);\n\n\t\t/* Add the region to queue for splitting */\n\t\tregionQueue.add(region);\n\n\t\t/* While there are some more regions to subdivide. */\n\t\twhile (!regionQueue.isEmpty())\n\t\t{\n\t\t\t/* Get first region. */\n\t\t\tregion = regionQueue.get(regionQueue.size() - 1);\n\n\t\t\t/* Calc the longest road edge and split size. */\n\t\t\tlongestEdge = region.getLongestEdgeWithRoadAccess();\n\t\t\tif (longestEdge != null)\n\t\t\t{\n\t\t\t\tedgeLine.set(new Point(longestEdge.beginning), new Point(longestEdge.next.beginning));\n\t\t\t\tlogger.debug(\"Longest Road edge: \" + edgeLine.length());\n\t\t\t\tif (edgeLine.length() <= LOT_WIDTH) /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t * No road edge requires\n\t\t\t\t\t\t\t\t\t\t\t\t\t * further splitting.\n\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t{\n\t\t\t\t\t/* Calc the longest non-road edge and split size. */\n\t\t\t\t\tlongestEdge = region.getLongestEdgeWithoutRoadAccess();\n\t\t\t\t\tif (longestEdge != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tedgeLine.set(longestEdge.beginning, longestEdge.next.beginning);\n\t\t\t\t\t\tlogger.debug(\"Longest NONRoad edge: \" + edgeLine.length());\n\t\t\t\t\t\tif (edgeLine.length() <= LOT_DEPTH) /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * No non-road edge\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * requires further\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * splitting.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlogger.debug(\"Region is small enough, moving to output.\");\n\t\t\t\t\t\t\tlogger.debug(\" area = \" + region.toPolygon().area());\n\t\t\t\t\t\t\tlogger.debug(region.toString());\n\t\t\t\t\t\t\t/* Region is complete. */\n\t\t\t\t\t\t\toutputRegions.add(region);\n\t\t\t\t\t\t\tregionQueue.remove(regionQueue.get(regionQueue.size() - 1));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsplitSize = LOT_DEPTH;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t/* All edges are small enough */\n\t\t\t\t\t\toutputRegions.add(region);\n\t\t\t\t\t\tregionQueue.remove(regionQueue.get(regionQueue.size() - 1));\n\t\t\t\t\t\tcontinue;\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\tsplitSize = LOT_WIDTH;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if lot is small enough, add completed region\n\t\t\t\tlogger.debug(\"THIS REGION HAS NO Edge with RoadAccess.\");\n\t\t\t\tlogger.debug(\" \" + region.toPolygon().toString());\n\t\t\t\toutputRegions.add(region);\n\t\t\t\tregionQueue.remove(regionQueue.get(regionQueue.size() - 1));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// calculate the split points\n\t\t\tsp1 = calcSplitPoint(edgeLine, splitSize, LOT_DEVIANCE);\n\t\t\tsp2 = new Point(sp1);\n\t\t\tsp2.add(edgeLine.normal());// *longestEdge.length();\n\t\t\t// split and process the new regions\n\t\t\tnewRegions = splitRegion(region, sp1, sp2); // BUG: <-- not working?\n\t\t\tregionQueue.remove(regionQueue.get(regionQueue.size() - 1));\n\t\t\tfor (SubRegion newRegion : newRegions)\n\t\t\t{\n\t\t\t\tlogger.debug(\"New region:\");\n\t\t\t\tlogger.debug(newRegion.toString());\n\t\t\t\tif (newRegion.hasRoadAccess())\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\" Adding to processing queue: \" + newRegion.toPolygon().toString());\n\t\t\t\t\tregionQueue.add(newRegion); // add to processing queue\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\" Discarded.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tPolygon newRegionPolygon;\n\t\tlogger.debug(\"Block::createLots() numberOfRegions \" + outputRegions.size());\n\t\tfor (SubRegion newRegion : outputRegions)\n\t\t{\n\t\t\tnewRegionPolygon = newRegion.toPolygon();\n\t\t\tif (newRegionPolygon.isNonSelfIntersecting())\n\t\t\t{\n\t\t\t\tlots.add(new Lot(this, newRegionPolygon));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new IllegalStateException(\"Self-intersecting polygon encountered: \" + newRegionPolygon.toString());\n\t\t\t}\n\t\t}\n\t}", "private final List<PLineSegment> getLineSegmentsForSplitLine(SplitLine splitLine) {\n int lineIndex = splitLine.getLineIndex();\n List<PLineSegment> segments = getLineSegments(lineIndex);\n int index = 0;\n ArrayList<PLineSegment> result = new ArrayList<PLineSegment>();\n int start = splitLine.getOffset();\n int end = start + splitLine.getLength();\n \n for (int i = 0; index < end && i < segments.size(); ++i) {\n PLineSegment segment = segments.get(i);\n if (start >= index + segment.getModelTextLength()) {\n index += segment.getModelTextLength();\n continue;\n }\n if (start > index) {\n int skip = start - index;\n segment = segment.subSegment(skip);\n index += skip;\n }\n if (end < index + segment.getModelTextLength()) {\n segment = segment.subSegment(0, end - index);\n }\n result.add(segment);\n index += segment.getModelTextLength();\n }\n return result;\n }", "private List<Integer> getInitialCorners_ShortStrawOversegment()\n\t\t\tthrows InvalidParametersException {\n\n\t\t// Store the original stroke\n\t\tStroke resampledStroke = new Stroke(m_stroke);\n\n\t\t// Initial processing (filtering, resampling) on the stroke\n\t\tresampledStroke = cleanStroke(resampledStroke);\n\n\t\tdouble resampledSpacing = determineResampleSpacing(m_stroke.getPoints());\n\n\t\t// The stroke is too short to resample\n\t\tif (resampledStroke.getPathLength() < S_SHORT_STROKE_THRESHOLD\n\t\t\t\t|| resampledStroke.getNumPoints() < IShortStrawThresholds.S_MIN_PTS_THRESHOLD\n\t\t\t\t|| resampledSpacing < IShortStrawThresholds.S_SMALL_RESAMPLE_SPACING_THRESHOLD) {\n\t\t\t// Do nothing...\n\t\t}\n\n\t\t// Resample the stroke\n\t\telse {\n\t\t\tList<Point> points = resamplePoints(resampledStroke,\n\t\t\t\t\tresampledSpacing);\n\t\t\tresampledStroke = new Stroke(points);\n\t\t}\n\n\t\tfinal double MEDIAN_PERCENTAGE = 1.0;\n\n\t\t// Initialize necessary variables\n\t\tdouble[] straws = new double[resampledStroke.getNumPoints()];\n\t\tdouble[] sortedStraws = new double[resampledStroke.getNumPoints()\n\t\t\t\t- (IShortStrawThresholds.S_WINDOW * 2)];\n\n\t\t// Calculate the straws\n\t\tfor (int i = IShortStrawThresholds.S_WINDOW; i < resampledStroke\n\t\t\t\t.getNumPoints() - IShortStrawThresholds.S_WINDOW; i++) {\n\n\t\t\tstraws[i] = resampledStroke.getPoint(\n\t\t\t\t\ti - IShortStrawThresholds.S_WINDOW).distance(\n\t\t\t\t\tresampledStroke\n\t\t\t\t\t\t\t.getPoint(i + IShortStrawThresholds.S_WINDOW));\n\n\t\t\t// For finding the median\n\t\t\tsortedStraws[i - IShortStrawThresholds.S_WINDOW] = straws[i];\n\t\t}\n\n\t\t// Initialize the corner array, with the start point\n\t\tList<Integer> corners = new ArrayList<Integer>();\n\t\tcorners.add(0);\n\n\t\t// Calculate our local minimum thresholds\n\t\tArrays.sort(sortedStraws);\n\t\tdouble medianDist = sortedStraws[sortedStraws.length / 2];\n\t\tdouble threshold = MEDIAN_PERCENTAGE * medianDist;\n\n\t\t// Find the shortest straws\n\t\tfor (int i = IShortStrawThresholds.S_WINDOW; i < straws.length\n\t\t\t\t- IShortStrawThresholds.S_WINDOW; i++) {\n\n\t\t\t// If we are below the median threshold\n\t\t\tif (straws[i] < threshold) {\n\n\t\t\t\tdouble localMinimum = Double.POSITIVE_INFINITY;\n\t\t\t\tint localMinimumIndex = i;\n\n\t\t\t\t// Find only the local minimum\n\t\t\t\t/*\n\t\t\t\t * while (i < straws.length - IShortStrawThresholds.S_WINDOW &&\n\t\t\t\t * straws[i] < threshold) { if (straws[i] < localMinimum) {\n\t\t\t\t * localMinimum = straws[i]; localMinimumIndex = i; }\n\t\t\t\t * \n\t\t\t\t * i++; }\n\t\t\t\t */\n\n\t\t\t\t// Add the index of the local minimum to our list\n\t\t\t\tcorners.add(new Integer(localMinimumIndex));\n\t\t\t}\n\t\t}\n\n\t\t// Add the end point\n\t\tcorners.add(resampledStroke.getNumPoints() - 1);\n\n\t\t// Map the resampled corners to original points\n\t\tList<Integer> allCorners = getOriginalStrokeCorners(corners,\n\t\t\t\tresampledStroke, m_stroke);\n\n\t\treturn allCorners;\n\t}", "@Test\n public void testSegmentSelection() {\n assertMetrics(\"segments:2 absoluteProximity:0.1 proximity:1 segmentStarts:19,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a b c x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n // Same as above but best matching segment have too low exactness\n assertMetrics(\"segments:2 absoluteProximity:0.0903 proximity:0.9033 segmentStarts:1,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a:0.2 b:0.3 c:0.4 x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n assertMetrics(\"segments:1 absoluteProximity:0.0778 proximity:0.778\",\"a b c d e f\",\"x x a b b b c f e d a b c d x e x x x x x f d e f a b c a a b b c c d d e e f f\");\n\n // Prefer one segment with ok proximity over two segments with great proximity\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x x x x x x x x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n }", "private void processPoints() {\n\t\t// We don't want multiple of the same normals, so we calculate them on the fly\n\t\tArrayList<Vector2f> normals = new ArrayList<Vector2f>();\n\t\tVector2f edge = new Vector2f();\n\n\t\tif (points.length < 3) {\n\t\t\tthrow new IllegalStateException(\"There must be more than two points in a polygon... Shame on you!\");\n\t\t}\n\t\t\n\t\t// Calculate the center\n\t\tcenter = new Vector2f();\n\t\tfor (Vector2f p : points) {\n\t\t\tcenter.add(p);\t\t\n\t\t}\n\t\tcenter.scale(1.0f / (float) points.length);\n\t\t\n\t\t// Subtract the center from each point so it's centerd\n\t\tfor (Vector2f p : points) {\n\t\t\tp.sub(center);\n\t\t}\n\t\t\n\t\t// Calculate the direction to loop through them\n\t\tVector2f edgeA = points[points.length - 1].clone().sub(points[0]);\n\t\tVector2f edgeB = points[1].clone().sub(points[0]);\n\t\t\n\t\tboolean rightHand = edgeA.x * edgeB.y - edgeB.x * edgeA.y < 0;\n\t\t\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tVector2f.sub(points[(i + 1) % points.length], points[i], edge);\n\t\t\t\n\t\t\t// Check if the current point is further away then the current\n\t\t\tfloat length = points[i].length();\n\t\t\tbroadPhaseLength = Math.max(length, broadPhaseLength);\n\t\t\t\n\t\t\t// Calculated of 90 degree rotation matrix\n\t\t\t\n\t\t\tVector2f normal;\n\t\t\tif (rightHand) {\n\t\t\t\tnormal = new Vector2f( edge.y,-edge.x);\n\t\t\t} else {\n\t\t\t\tnormal = new Vector2f(-edge.y, edge.x);\n\t\t\t}\n\t\t\tnormal.normalise();\n\t\t\tint j = 0;\n\t\t\tfor (; j < normals.size(); j++) {\n\t\t\t\tif (Math.abs(normals.get(j).dot(normal)) == 1.0f) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (j == normals.size()) {\n\t\t\t\tnormals.add(normal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.normals = new Vector2f[normals.size()];\n\t\tnormals.toArray(this.normals);\n\t}", "public Vector performSegmentation(Stroke theStroke)\n\t{\n\t\tsetPixelInfo(theStroke);\n\t\t// this vector stores vectors of segment points detected through various methods\n\t\tVector segVectorList = new Vector();\n\t\tint segScheme=0;\n\t\tswitch (segScheme = Prefs.getSegScheme())\n\t\t{\n\t\t//PRATEEK: Is this the place where ALL the segmentation decisions are made??\n\t\tcase GConstants.SEG_SCHEME_ALL:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_SPEED:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tcase GConstants.SEG_SCHEME_CURVATURE:\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_TIME:\n\t\t\tsegVectorList.add(getTimeSeg(theStroke));\n\t\t\tbreak;\n\n\t\tcase GConstants.SEG_SCHEME_SPEED_CURVATURE:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\tsegVectorList.add(getSpeedSeg(theStroke));\n\t\t\tsegVectorList.add(getCurvatureSeg(theStroke));\n\t\t\tbreak;\n\t\t}\n/*We now have a list of segment-points to work with*/\n\t\t// get the common segment points\n\t\tSystem.out.println(\"Modified Hybrid fits\");\n\t\tVector selectedSegPos;\n\t/*\n\t\tselectedSegPos = returnRelevantVector(segVectorList);\n\t\t\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}*/\n\t\t/*if(segScheme == 1 || segScheme == 3){\n\t\t\t\n\t\t}\n\t\telse{*/\n\t\tselectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\t\t//selectedSegPos = combinationAlgorithm(theStroke);\n\t\t//}\n//\t\tVector selectedSegPos = detectCommonSegPt(segVectorList, theStroke);\n\n\t\t// TODO: DONE: remove this code, This is just to print the common segments points\n\t/*\tSystem.out.println(\"Combination algorithm\");\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tCollections.sort(selectedSegPos);\n\t\tIterator iter = selectedSegPos.iterator();\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\t Integer index = (Integer) iter.next();\n\t\t\t PixelInfo pixel = (PixelInfo)ptList.get(index.intValue());\n\t\t\t System.out.println(\"Index: \"+index+\", \"+pixel);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n\\n\");\n\t\t*/\n\t\t\n\t\treturn selectedSegPos;\n\t}", "public void checkForCollisions()\r\n\t{\r\n\t\t//collision detection\r\n\t\tfor(PolygonD obj : objects)\r\n\t\t{\r\n\t\t\t//find points in character that intersected with the scene\r\n\t\t\tfor(PointD p : aSquare.getBoundary().getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(obj.contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = obj.getVerts().get(obj.getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : obj.getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tVector offset = new Vector(p, closestPoint);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//find points in scene that intersected with the character\r\n\t\t\tfor(PointD p : obj.getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(aSquare.getBoundary().contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = aSquare.getBoundary().getVerts().get(aSquare.getBoundary().getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : aSquare.getBoundary().getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get the angle of object by 'feeling' it\r\n\t\t\t\t\tint numVerts = obj.verts.size();\r\n\t\t\t\t\tint objI = obj.verts.indexOf(p);\r\n\t\t\t\t\tint lastI = (objI - 1) % numVerts;\r\n\t\t\t\t\tif(lastI == -1)\r\n\t\t\t\t\t\tlastI = numVerts - 1;\r\n\t\t\t\t\tint nextI = (objI + 1) % numVerts;\r\n\t\t\t\t\t\r\n\t\t\t\t\tint angle = (int)Math.round((new Vector(obj.verts.get(objI), obj.verts.get(lastI))).angleBetween(new Vector(obj.verts.get(objI), obj.verts.get(nextI))));\r\n\t\t\t\t\t\r\n\t\t\t\t\taSquare.sendMsg(new Msg(aSquare, \"Felt Vertex: \" + angle + \"deg\"));//null means status message\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//reverse direction to make aSquare move out of wall\r\n\t\t\t\t\tVector offset = new Vector(closestPoint, p);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\taSquare.getCenter();\r\n\t}", "double[] getSplitRatios();", "@Test\n public void testSplittingSoillayer4() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"3\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.1\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"7\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.2\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.26\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.3\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.124\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.248\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"27\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"39\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil top layer case 2 is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "public SimpleFeatureCollection simplify(SimpleFeatureCollection bus_links) {\r\n\t\t\r\n\t\t//lists hold simplified and split slope segments\r\n\t\tList<SimpleFeature> simpleSlopes = new ArrayList<SimpleFeature>();\r\n\t List<SimpleFeature> segmentsSlopes = new ArrayList<SimpleFeature>();\r\n\t\t\r\n\t\t//list to hold the assigned rids of the segments\r\n\t \tList<Integer> assigned = new ArrayList<Integer>();\r\n\t \t\r\n\t\t//collections to lists\r\n\t\tList<SimpleFeature> intersections = FeatureOperations.featureCollectionToList(this.intersections);\r\n\t\tList<SimpleFeature> slopeLinks = FeatureOperations.featureCollectionToList(this.getSlopeLinks());\r\n\t\tList<SimpleFeature> slopeLiftLinks = FeatureOperations.featureCollectionToList(this.getLinks());\r\n\t\tList<SimpleFeature> busLinks = (bus_links != null) ? FeatureOperations.featureCollectionToList(bus_links) : null;\r\n\t\t\r\n\t\t//INTERSECTIONS USING KDTREE\r\n\t\t//create spatial index to contain all intersections\r\n\t\tfinal KdTree pointIndex = new KdTree();\r\n\t\tfor (SimpleFeature intersection: intersections) {\r\n\t\t\tpointIndex.insert(((Geometry)intersection.getDefaultGeometry()).getCoordinate(), intersection);\r\n\t\t}\r\n\t\tif (pointIndex.isEmpty()) {\r\n\t\t\tLogger.getLogger(SlopeLinkMatching.class.getName()).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t\tLogger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t}\r\n\t\t\r\n\t\t//SLOPE LINKS, SLOPE LIFT LINKS AND BUS LINKS USING STRTREE\r\n\t\tfinal SpatialIndex lineIndex = new STRtree();\r\n\t\t//insert all slope links\r\n\t\tfor (SimpleFeature link: slopeLinks) {\r\n\t\t\tEnvelope linkEnvelope = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope, link);\r\n\t\t}\r\n\t\t//insert all slopeLift links\r\n\t\tfor (SimpleFeature link: slopeLiftLinks) {\r\n\t\t\tEnvelope linkEnvelope2 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope2, link);\r\n\t\t}\r\n\t\t//insert all bus links\r\n\t\tif (busLinks!=null) {\r\n\t\t\tfor (SimpleFeature link: busLinks) {\r\n\t\t\t\tEnvelope linkEnvelope3 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\t\tlineIndex.insert(linkEnvelope3, link);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//KEEP INTERSECTING LINKS FOR EACH SLOPE\r\n\t\tfor (SimpleFeature slope_original: this.getFeatures_in()) {\r\n\t\t\t\r\n//if (!slope_original.getAttribute(\"DE_GR_L_1\").equals(\"Sportgastein\")) continue;\r\n\r\n\t\t\t//fetch slope geometry as LengthIndexedLine\r\n\t\t\tGeometry slopeGeom = (Geometry) slope_original.getDefaultGeometry();\r\n\t\t\tLengthIndexedLine lengthLine = new LengthIndexedLine(slopeGeom);\r\n\t\t\t\r\n\t\t\t//get envelope and expand by 5.00 meters\r\n\t\t\tEnvelope search = new Envelope(slopeGeom.getEnvelopeInternal()); \r\n\t\t\tsearch.expandBy(5.00);\r\n\r\n\t\t\t//Vertex ordered Map as index on lengthLine and corresponding coordinate\r\n\t\t\tMap<Double, Coordinate> newVertices = new TreeMap<Double, Coordinate>();\r\n\t\t\t//insert start and end-point\r\n\t\t\tnewVertices.put(lengthLine.getStartIndex(), lengthLine.extractPoint(lengthLine.getStartIndex()));\r\n\t\t\tnewVertices.put(lengthLine.getEndIndex(), lengthLine.extractPoint(lengthLine.getEndIndex()));\r\n\r\n\t\t\t/*------------------------ INTERSECTIONS ------------------------*/\r\n\t\t\t//fetch intersections in the slope envelope\r\n\t\t\tList<?> neighbourIntersections = pointIndex.query(search);\r\n\t\t\t\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following intersections: \");\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through intersections and keep only those on line (using distance threshold)\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\t//get geometry and coordinate\r\n\t\t\t\tGeometry geom = (Geometry) ((SimpleFeature)((KdNode )inters).getData()).getDefaultGeometry();\r\n\t\t\t\tCoordinate coord = geom.getCoordinate();\r\n\t\t\t\t//check if intersection is on line (using distance with threshold 1cm)\r\n\t\t\t\tif (slopeGeom.distance(geom) < 0.001) {\r\n\t\t\t\t\tdouble index = lengthLine.indexOf(coord);\r\n\t\t\t\t\t//add it if not already contained\r\n\t\t\t\t\tif(!newVertices.containsKey(index) && !newVertices.containsValue(coord)) {\r\n\t\t\t\t\t\tnewVertices.put(index, coord);\r\n\t\t\t\t\t}\r\n//\t\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" \r\n//\t\t\t\t\t+ ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\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/*------------------------ LINKS ------------------------*/\r\n\t\t\t//fetch links in the envelope\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<SimpleFeature> neighbourLinks = lineIndex.query(search);\r\n\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following links: \");\r\n\t\t\tfor (SimpleFeature link: neighbourLinks) {\r\n\t\t\t\tSystem.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through links and keep only those on line (using distance threshold)\r\n\t\t\tfor (SimpleFeature link : neighbourLinks) {\t\t\t\t\r\n\t\t\t\tGeometry linkGeom = (Geometry) link.getDefaultGeometry();\r\n\t\t\t\t//filter out links not intersecting with slope\r\n\t\t\t\tif(slopeGeom.distance(linkGeom) < 0.05) {\r\n\t\t\t\t\tCoordinate[] linkCoords = linkGeom.getCoordinates();\r\n\t\t\t\t\t//check which link end-point is on line (using distance with threshold 5cm) and add if not already contained\r\n\t\t\t\t\tfor (Coordinate linkCoord: linkCoords) {\r\n\t\t\t\t\t\tif (slopeGeom.distance(FeatureMatching.geomOps.coordinateToPointGeometry(linkCoord)) < 0.05 && !newVertices.containsValue(linkCoord)) {\r\n\t\t\t\t\t\t\tnewVertices.put(lengthLine.indexOf(linkCoord), linkCoord);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t//System.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*-------------------------------------------------------*/\r\n\t\t\t\r\n\t\t\t//new coordinate list from kept indices, for the creation of the simplified feature\r\n\t\t\tList<Coordinate> simplifiedCoords = new ArrayList<Coordinate>();\r\n\t\t\tfor (Entry<Double, Coordinate> entry: newVertices.entrySet()){\r\n\t\t\t\tif (!simplifiedCoords.contains(entry.getValue()))\r\n\t\t\t\tsimplifiedCoords.add(entry.getValue());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//use the simplified coordinates to split original bus geometry to its bus segments at topologic nodes\r\n\t\t\t//geometry must be preserved\r\n\t\t\t//semantic attributes must be preserved\r\n\t\t\t// r_id attribute must be added\r\n\t\t\tArrayList<SimpleFeature> splitSegments = FeatureMatching.featOps.splitFeatureAtCoordinates(slope_original, simplifiedCoords);\r\n\t\t\t\r\n\t\t\t//create new feature and add to feature collection\r\n\t\t\tSimpleFeatureType simplifiedType = FeatureOperations.makeLineStringFeatureType(this.getFeatures_in()[0].getFeatureType().getCoordinateReferenceSystem(), \"merged_pivots\");\r\n\t\t\tSimpleFeature simplifiedSlope = FeatureMatching.featOps.getFeatureFromCoordinates(simplifiedType, simplifiedCoords.toArray(new Coordinate[0]));\r\n\t\t \tString deName = slope_original.getAttribute(\"DE_GR_L_0\").toString() + \" \" + slope_original.getAttribute(\"DE_GR_L_1\").toString();\r\n\t\t \t//split feature at remaining vertices to line segments (for each vertex pair)\r\n\t\t \tArrayList<SimpleFeature> simpleSegments = FeatureMatching.featOps.splitFeatureAtVertices(simplifiedSlope);\r\n\t\t \t//rids building\r\n\t\t \tint segmentNumber = 1;\r\n//if(splitSegments.size() != simpleSegments.size()) {\t\t \t\r\n//System.out.println(slope_original.getAttribute(\"XML_GID\").toString() + \": \" +splitSegments.size() + \" / \" + simpleSegments.size());\t\r\n//System.exit(0);\r\n//}\t\t\t\r\n\t\t \tfor (SimpleFeature simpleSegment: simpleSegments) {\r\n\t\t \t\tGeometry segment_geom = (Geometry) simpleSegment.getDefaultGeometry();\r\n\t\t \t\tCoordinate[] segment_coords = segment_geom.getCoordinates(); \r\n\t\t \t\t//indexedLineGeom to getLength\r\n\t\t \t\tdouble length = lengthLine.extractLine(lengthLine.indexOf(segment_coords[0]), lengthLine.indexOf(segment_coords[1])).getLength();\r\n\t\t \t\t//in case segment has zero length ignore it and proceed to the next\r\n\t\t \t\tif (length == 0.0) continue;\t//{System.err.println(length);}\r\n\t\t \t\tdouble cost_1, cost_2, cost_3, r_cost_1, r_cost_2, r_cost_3;\r\n if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 1) {\r\n r_cost_1 = length; r_cost_2 = 10 * length; r_cost_3 = 15 * length;\r\n cost_1 = length; cost_2 = 10 * length; cost_3 = 15 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 2) {\r\n r_cost_1 = 5 * length; r_cost_2 = length; r_cost_3 = 5 * length;\r\n cost_1 = 5 * length; cost_2 = length; cost_3 = 5 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 3) {\r\n r_cost_1 = 15 * length; r_cost_2 = 10 * length; r_cost_3 = length;\r\n cost_1 = 15 * length; cost_2 = 10 * length; cost_3 = length;\r\n } else {\r\n r_cost_1 = length; r_cost_2 = length; r_cost_3 = length;\r\n cost_1 = length; cost_2 = length; cost_3 = length;\r\n }\r\n \r\n\t\t \t\t//build unique r_id\r\n int slopeNumber = Integer.parseInt(slope_original.getAttribute(\"XML_GID\").toString());\r\n\t\t \t\tint rid = Integer.parseInt(\"1\"+ digitRectifier(slopeNumber, 5) + digitRectifier(segmentNumber, 3));\r\n\t\t \t\twhile (assigned.contains(rid)) {\r\n\t\t \t\t\trid++;\r\n\t\t \t\t\tsegmentNumber++;\r\n\t\t \t\t}\r\n\t\t \t\tassigned.add(rid);\r\n\t\t \t\tsegmentNumber++;\r\n\t\t \t\t//pass computed r_id to the corresponded split segment\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"r_id\", rid);\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n \r\n\t\t\t \tMap <String, Object> attrs = new LinkedHashMap<String, Object>();\r\n\t\t\t \tattrs.put(\"XML_TYPE\", \"slopes\");\r\n\t\t\t \tattrs.put(\"de_name\", deName);\r\n\t\t\t \tattrs.put(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n\t\t\t \tattrs.put(\"source\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"target\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"duration\", Double.parseDouble(\"0\")); //duration 0 for slopes\r\n\t\t\t \tattrs.put(\"length\", length); \r\n\t\t\t \tattrs.put(\"r_length\", length); \r\n attrs.put(\"r_rev_c\", (double) -1);\r\n attrs.put(\"rev_c\", (double) -1);\r\n\t\t\t \tattrs.put(\"cost_1\", cost_1);\r\n\t\t\t \tattrs.put(\"cost_2\", cost_2);\r\n\t\t\t \tattrs.put(\"cost_3\", cost_3);\r\n\t\t\t \tattrs.put(\"r_cost_1\", r_cost_1);\r\n\t\t\t \tattrs.put(\"r_cost_2\", r_cost_2);\r\n\t\t\t \tattrs.put(\"r_cost_3\", r_cost_3);\r\n\t\t\t \tattrs.put(\"open\", (int) 0);\r\n\t\t\t \tattrs.put(\"start_z\", segment_coords[0].z/10);\r\n\t\t\t \tattrs.put(\"end_z\", segment_coords[segment_coords.length-1].z/10);\r\n\t\t\t\tattrs.put(\"r_id\", rid);\r\n\t\t\t\t//add attributes\r\n\t\t\t\tfor (Map.Entry<String, Object> attribute : attrs.entrySet()){\r\n\t\t\t\t\tsimpleSegment = FeatureOperations.addAttribute(simpleSegment, attribute.getKey(), attribute.getValue());\r\n\t\t\t\t\tsimpleSegment.setAttribute(attribute.getKey(), attribute.getValue());\r\n\t\t\t\t}\r\n\t\t\t\tsimpleSlopes.add(simpleSegment);\r\n\t\t \t}\r\n\t\t \tsegmentsSlopes.addAll(splitSegments);\r\n\r\n\t\t\t//CONTROL METHOD PRINTS OUT SLOPE WITH NO CONNECTIONS\r\n/*\t\t\tif (neighbourLinks.size() == 0 && neighbourIntersections.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links and no intersections\");\r\n\t\t\t} else if (neighbourLinks.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links\");\r\n\t\t\t}*/\r\n\t\t\t//TODO:METHOD END PRINT RESULT TO FILE\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//create segments_buses shapeFile\r\n\t\tSimpleFeatureCollection newSlopeSegments = new ListFeatureCollection(segmentsSlopes.get(0).getFeatureType(), segmentsSlopes);\r\n\t\tFileOperations.createShapeFile(newSlopeSegments, StartConfiguration.getInstance().getFolder_out() + \"segments_slopes.shp\");\t\r\n\t\t//return feature collection\r\n\t\tSimpleFeatureCollection simplifiedSlopes = new ListFeatureCollection(simpleSlopes.get(0).getFeatureType(), simpleSlopes);\r\n\t\t\r\n\t\t\r\n\t\treturn simplifiedSlopes;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate List<Integer> sbfs(List<Integer> corners, Stroke stroke,\n\t\t\tIObjectiveFunction objFunction) {\n\n\t\tif (corners.size() <= 2)\n\t\t\treturn corners;\n\n\t\tdouble currError = Double.MAX_VALUE;\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>(corners);\n\t\tList<List<Integer>> cornerSubsetList = new ArrayList<List<Integer>>(\n\t\t\t\tcornerSubset.size());\n\t\tList<Double> errorList = new ArrayList<Double>(cornerSubset.size());\n\n\t\tList<List<Integer>> forwardOnSubset = new ArrayList<List<Integer>>();\n\n\t\tint n = -1;\n\n\t\twhile (cornerSubset.size() > 2) {\n\n\t\t\t// Go backward\n\t\t\tList<Object> backResults = prevBestSubset(cornerSubset, stroke,\n\t\t\t\t\tobjFunction);\n\t\t\tList<Integer> backSubset = (List<Integer>) backResults.get(0);\n\t\t\tdouble backError = (Double) backResults.get(1);\n\n\t\t\t// Go forward (if possible)\n\t\t\tint forwardCorner = -1;\n\t\t\tdouble forwardError = Double.MAX_VALUE;\n\t\t\tif (cornerSubset.size() < corners.size() - 1) {\n\t\t\t\tList<Object> forwardResults = nextBestCorner(cornerSubset,\n\t\t\t\t\t\tcorners, stroke, objFunction);\n\t\t\t\tforwardCorner = (Integer) forwardResults.get(0);\n\t\t\t\tforwardError = (Double) forwardResults.get(1);\n\t\t\t}\n\n\t\t\t// Go forward if the error is better, otherwise continue backward\n\t\t\tif (forwardCorner != -1 && forwardError < errorList.get(n - 1)\n\t\t\t\t\t&& !alreadySeenSubset(cornerSubset, forwardOnSubset)) {\n\n\t\t\t\tforwardOnSubset.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\tcornerSubset.add(forwardCorner);\n\t\t\t\tCollections.sort(cornerSubset);\n\n\t\t\t\tcurrError = forwardError;\n\t\t\t\tn--;\n\t\t\t} else {\n\t\t\t\tcornerSubset = backSubset;\n\t\t\t\tcurrError = backError;\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\t// Update the list of best subsets for n corners\n\t\t\tif (cornerSubsetList.size() <= n) {\n\t\t\t\tcornerSubsetList.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.add(currError);\n\t\t\t} else {\n\t\t\t\tcornerSubsetList.set(n, new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.set(n, currError);\n\t\t\t}\n\t\t}\n\n\t\tList<Integer> bestSubset = null;\n\n\t\tdouble d1Errors[] = new double[errorList.size()];\n\t\tfor (int i = 1; i < errorList.size(); i++) {\n\t\t\tdouble deltaError = errorList.get(i) / errorList.get(i - 1);\n\t\t\td1Errors[i] = deltaError;\n\t\t}\n\n\t\tfor (int i = 2; i < d1Errors.length; i++) {\n\t\t\tif (d1Errors[i] > S_THRESHOLD) {\n\t\t\t\tbestSubset = cornerSubsetList.get(i - 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (bestSubset == null)\n\t\t\tbestSubset = cornerSubsetList.get(0);\n\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "public static String BeforeSplitStrategyHints(Player Gamer, Player Dealer){\n\t\tString ReturnString = \"\";\n\t\tif(Gamer.Hand[0].getValue() == 1 && Gamer.Hand[1].getValue() == 1){\n\t\t\t// Pair of Aces\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getValue() == 2 && Gamer.Hand[1].getValue() == 2) \n\t\t\t|| (Gamer.Hand[0].getValue() == 3 && Gamer.Hand[1].getValue() == 3)){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 4 && Gamer.Hand[1].getValue() == 4){\n\t\t\tif(Dealer.Score >= 5 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 5 && Gamer.Hand[1].getValue() == 5){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 6 && Gamer.Hand[1].getValue() == 6){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 7 && Gamer.Hand[1].getValue() == 7){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t ReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 8 && Gamer.Hand[1].getValue() == 8){\n\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 9 && Gamer.Hand[1].getValue() == 9){\n\t\t\tif((Dealer.Score >= 2 && Dealer.Score <= 6) || (Dealer.Score >= 8 && Dealer.Score <= 9)){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 10 && Gamer.Hand[1].getValue() == 10){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\treturn ReturnString;\n\t}", "void splitCurvesAtIntersections(ArrayList<Curve> working_loop1, ArrayList<Curve> working_loop2, double tol)\n {\n for (int i = 0; i < working_loop1.size(); i++)\n {\n Curve c1 = working_loop1.get(i);\n for (int j = 0; j < working_loop2.size(); j++)\n {\n Curve c2 = working_loop2.get(j);\n\n boolean any_splits;\n\n do\n {\n any_splits = false;\n\n ArrayList<OrderedPair<Double, Double>> ret = BRepUtil.curveCurveIntersect(c1, c2);\n\n if (ret == null)\n break;\n\n // we only count up in case the earlier entries fall close to existing splits and\n // are ignored, otherwise if the first intersection causes a split\n // we exit this loop immediately and look at the first pair from the newly inserted curve(s)\n // instead\n for (int k = 0; k < ret.size() && !any_splits; k++)\n {\n OrderedPair<Double, Double> split_points = ret.get(k);\n\n double start_dist = c1.paramCoordinateDist(c1.StartParam, split_points.First);\n double end_dist = c1.paramCoordinateDist(c1.EndParam, split_points.First);\n\n // if we are far enough from existing splits\n if (start_dist > tol && end_dist > tol)\n {\n any_splits = true;\n\n Curve c1split1 = c1.cloneWithChangedParams(c1.StartParam, split_points.First);\n Curve c1split2 = c1.cloneWithChangedParams(split_points.First, c1.EndParam);\n\n working_loop1.set(i, c1split1);\n working_loop1.add(i + 1, c1split2);\n\n // once we've split once any second split could be in either new curve\n // and also any further comparisons of the original c1 now need to be done separately on the two\n // fragments\n //\n // so all-in-all simplest seems to be to pretend the two earlier fragments were where we were\n // all along and re-start this (c1, c2) pair using them\n //\n // this will lead to a little repetition, as c1split2 will be checked against working_list2 items\n // at indices < j, but hardly seems worth worrying about for small-ish curve numbers with few splits\n c1 = c1split1;\n }\n\n start_dist = c2.paramCoordinateDist(c2.StartParam, split_points.Second);\n end_dist = c2.paramCoordinateDist(c2.EndParam, split_points.Second);\n\n // if we are far enough from existing splits\n if (start_dist > tol && end_dist > tol)\n {\n any_splits = true;\n\n Curve c2split1 = c2.cloneWithChangedParams(c2.StartParam, split_points.Second);\n Curve c2split2 = c2.cloneWithChangedParams(split_points.Second, c2.EndParam);\n\n working_loop2.set(j, c2split1);\n working_loop2.add(j + 1, c2split2);\n\n // see comment in previous if-block\n c2 = c2split1;\n }\n }\n } while (any_splits);\n }\n }\n }", "@Test\n public void testSplittingSoillayer2() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"icbl\", \"10\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.15\");\n AcePathfinderUtil.insertValue(data, \"icbl\", \"40\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.16\");\n AcePathfinderUtil.insertValue(data, \"icbl\", \"80\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.21\");\n AcePathfinderUtil.insertValue(data, \"icbl\", \"110\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.23\");\n AcePathfinderUtil.insertValue(data, \"icbl\", \"180\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.31\");\n AcePathfinderUtil.insertValue(data, \"icbl\", \"250\");\n AcePathfinderUtil.insertValue(data, \"ich2o\", \"1.31\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.15\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.155\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"28\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"40\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"60\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.21\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"80\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.21\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"110\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.23\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"133\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"156\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"180\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"215\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"icbl\", \"250\");\n AcePathfinderUtil.insertValue(expectedData, \"ich2o\", \"1.31\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"initial_conditions\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, true);\n \n assertEquals(\"getRootDistribution: IC layer case is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "public final AstValidator.split_clause_return split_clause() throws RecognitionException {\n AstValidator.split_clause_return retval = new AstValidator.split_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree SPLIT403=null;\n AstValidator.rel_return rel404 =null;\n\n AstValidator.split_branch_return split_branch405 =null;\n\n AstValidator.split_otherwise_return split_otherwise406 =null;\n\n\n CommonTree SPLIT403_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:14: ( ^( SPLIT rel ( split_branch )+ ( split_otherwise )? ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:16: ^( SPLIT rel ( split_branch )+ ( split_otherwise )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n SPLIT403=(CommonTree)match(input,SPLIT,FOLLOW_SPLIT_in_split_clause3322); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n SPLIT403_tree = (CommonTree)adaptor.dupNode(SPLIT403);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(SPLIT403_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_rel_in_split_clause3324);\n rel404=rel();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, rel404.getTree());\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: ( split_branch )+\n int cnt113=0;\n loop113:\n do {\n int alt113=2;\n int LA113_0 = input.LA(1);\n\n if ( (LA113_0==SPLIT_BRANCH) ) {\n alt113=1;\n }\n\n\n switch (alt113) {\n \tcase 1 :\n \t // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: split_branch\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_split_branch_in_split_clause3326);\n \t split_branch405=split_branch();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_1, split_branch405.getTree());\n\n\n \t if ( state.backtracking==0 ) {\n \t }\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt113 >= 1 ) break loop113;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(113, input);\n throw eee;\n }\n cnt113++;\n } while (true);\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: ( split_otherwise )?\n int alt114=2;\n int LA114_0 = input.LA(1);\n\n if ( (LA114_0==OTHERWISE) ) {\n alt114=1;\n }\n switch (alt114) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: split_otherwise\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_split_otherwise_in_split_clause3329);\n split_otherwise406=split_otherwise();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, split_otherwise406.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\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 }", "private void splitArrayB() {\r\n //find upper bound. anything below goes within.\r\n //calculate highest A, loop through b til above that, then iterate b index til at end of b\r\n int a_count = 0;\r\n int b_count = 0;\r\n int highA = A[splitA[a_count]];\r\n boolean first = true;\r\n for(int i = 0; i < B.length; i++){\r\n if(highA >= B[i]){\r\n first = false;\r\n }\r\n else if(highA < B[i]){\r\n if(first == false){\r\n splitB[b_count] = i - 1;\r\n b_count++;\r\n highA = A[splitA[a_count]];\r\n a_count++;\r\n }\r\n else{\r\n while(a_count != splitA.length){\r\n if(highA < B[i]){\r\n splitB[b_count] = - 1;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n }\r\n else{\r\n splitB[b_count] = i;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(b_count != splitB.length){\r\n splitB[b_count] = splitB.length - 1;\r\n b_count++;\r\n while(b_count < splitB.length){\r\n splitB[b_count] = -1;\r\n b_count++;\r\n }\r\n return;\r\n }\r\n splitB[b_count - 1] = b_count - 1;\r\n }", "@Test\n public void testSplittingSoillayer() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"10\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.15\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"40\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"80\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.21\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"110\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.23\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"180\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"250\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.31\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.15\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.155\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"28\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"40\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"60\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.21\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"80\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.21\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"110\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.23\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"133\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"156\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"180\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"215\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"250\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil layer case is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "@Test\n public void testSplittingSoillayer3() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"3\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.1\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"7\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.2\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.3\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.14\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.28\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"27\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"39\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil top layer case is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "@Override\n\tpublic Spliterator<Node> trySplit() {\n\t\tif(root.getSx()!=null && root.getDx()!=null) {\n\t\t\tNode d = root.getDx();\n\t\t\tNode sin = root.getSx();\n\t\t\tList<Node> newList = new LinkedList<>();\n\t\t\tnewList.add(this.root);\n\t\t\tthis.root = sin;\n\t\t\treturn new BinaryTreeSpliterator(d,newList);\n\t\t}\n\t\telse if (root.getSx()!=null) {\n\t\t\tNode sin = root.getSx();\n\t\t\tthis.list.add(this.root);\n\t\t\tthis.root = sin;\n\t\t\treturn trySplit();\n\t\t} else if (root.getDx()!=null) {\n\t\t\tNode d = root.getDx();\n\t\t\tthis.list.add(this.root);\n\t\t\tthis.root = d;\n\t\t\treturn trySplit();\n\t\t}\n\t\treturn null;\n\t}", "public void rectifyMisRecogChars2ndRnd() {\n if (mnExprRecogType == EXPRRECOGTYPE_VBLANKCUT) {\n LinkedList<StructExprRecog> listBoundingChars = new LinkedList<StructExprRecog>();\n LinkedList<Integer> listBoundingCharIndices = new LinkedList<Integer>();\n LinkedList<StructExprRecog> listVLnChars = new LinkedList<StructExprRecog>();\n LinkedList<Integer> listVLnCharIndices = new LinkedList<Integer>();\n for (int idx = 0; idx < mlistChildren.size(); idx ++) {\n StructExprRecog serThisChild = mlistChildren.get(idx).getPrincipleSER(4);\n // now deal with the brackets, square brackets and braces.\n if (serThisChild.isBoundChar()) {\n if (serThisChild.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE) {\n if (idx > 0 && idx < mlistChildren.size() - 1\n && (mlistChildren.get(idx - 1).isNumericChar() || mlistChildren.get(idx - 1).isLetterChar()) // dot is allowed here because it must be decimal point not times (times has been converted to *)\n && (mlistChildren.get(idx + 1).isNumericChar() || mlistChildren.get(idx + 1).isLetterChar() // dot is allowed here.\n || mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE\n || mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE\n || mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES)) {\n // this must be a 1 if the left and right are both letter or numeric char\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE;\n } else if (idx > 0 && !mlistChildren.get(idx - 1).isChildListType() && !mlistChildren.get(idx - 1).isNumberChar() && !mlistChildren.get(idx - 1).isLetterChar()\n && !mlistChildren.get(idx - 1).isPostUnOptChar() && !mlistChildren.get(idx - 1).isBiOptChar() && !mlistChildren.get(idx - 1).isCloseBoundChar()) {\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // left char is not left char of v-line\n } else if (idx < mlistChildren.size() - 1 && !mlistChildren.get(idx + 1).isChildListType() && !mlistChildren.get(idx + 1).isNumberChar()\n && !mlistChildren.get(idx + 1).isLetterChar() && !mlistChildren.get(idx + 1).isPreUnOptChar() && !mlistChildren.get(idx + 1).isBiOptChar()\n && !mlistChildren.get(idx + 1).isBoundChar()) {\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // left char is not left char of v-line\n } else {\n listVLnChars.add(serThisChild);\n listVLnCharIndices.add(idx);\n }\n } else if (serThisChild.mType != UnitProtoType.Type.TYPE_BRACE\n || (serThisChild.mType == UnitProtoType.Type.TYPE_BRACE && idx == mlistChildren.size() - 1)\n || (serThisChild.mType == UnitProtoType.Type.TYPE_BRACE && idx < mlistChildren.size() - 1\n && mlistChildren.getLast().mnExprRecogType != EXPRRECOGTYPE_MULTIEXPRS)) {\n listBoundingChars.add(serThisChild);\n listBoundingCharIndices.add(idx);\n }\n } else if (serThisChild.isCloseBoundChar()) {\n if (serThisChild.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE) {\n boolean bFoundOpenBounding = false;\n for (int idx1 = listBoundingChars.size() - 1; idx1 >= 0; idx1 --) {\n if ((serThisChild.getBottomPlus1() - listBoundingChars.get(idx1).mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serThisChild.mnHeight\n && (listBoundingChars.get(idx1).getBottomPlus1() - serThisChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serThisChild.mnHeight\n && serThisChild.mnHeight > ConstantsMgr.msdOpenCloseBracketHeightRatio * listBoundingChars.get(idx1).mnHeight // must have similar height as the start character\n && serThisChild.mnHeight < 1/ConstantsMgr.msdOpenCloseBracketHeightRatio * listBoundingChars.get(idx1).mnHeight) {\n for (int idx2 = listBoundingChars.size() - 1; idx2 > idx1; idx2 --) {\n // allow to change all the ( or [ between () or [] pairs coz here ( and [ must not have pair and must be misrecognized.\n //StructExprRecog serB4BndChar = listBoundingCharIndices.get(idx2) > 0?mlistChildren.get(listBoundingCharIndices.get(idx2) - 1):null;\n //StructExprRecog serAfterBndChar = listBoundingCharIndices.get(idx2) < mlistChildren.size() - 1?mlistChildren.get(listBoundingCharIndices.get(idx2) + 1):null;\n if (listBoundingChars.get(idx2).mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET\n && (double)listBoundingChars.get(idx2).mnWidth/(double)listBoundingChars.get(idx2).mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {\n listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_ONE; // change to 1, do not use b4 and after char to adjust because not accurate.\n } else if (listBoundingChars.get(idx2).mType == UnitProtoType.Type.TYPE_ROUND_BRACKET\n && (double)listBoundingChars.get(idx2).mnWidth/(double)listBoundingChars.get(idx2).mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {\n listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_ONE; // change to 1, do not use b4 and after char to adjust because not accurate.\n } else {\n listBoundingChars.get(idx2).mType = UnitProtoType.Type.TYPE_SMALL_T; // all the no-close-bounding chars are changed to small t.\n }\n listBoundingChars.removeLast();\n listBoundingCharIndices.removeLast();\n }\n listBoundingChars.get(idx1).mType = UnitProtoType.Type.TYPE_ROUND_BRACKET;\n serThisChild.mType = UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET;\n listBoundingChars.remove(idx1);\n listBoundingCharIndices.remove(idx1);\n bFoundOpenBounding = true;\n break;\n }\n }\n if (!bFoundOpenBounding) {\n // cannot find open bounding character, change the close bounding character to 1.\n //StructExprRecog serB4BndChar = idx > 0?mlistChildren.get(idx - 1):null;\n //StructExprRecog serAfterBndChar = idx < mlistChildren.size() - 1?mlistChildren.get(idx + 1):null;\n if (serThisChild.mType == UnitProtoType.Type.TYPE_CLOSE_SQUARE_BRACKET\n && (double)serThisChild.mnWidth/(double)serThisChild.mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after char to adjust because not accurate (considering - or [1/2]...)\n } else if (serThisChild.mType == UnitProtoType.Type.TYPE_CLOSE_ROUND_BRACKET\n && (double)serThisChild.mnWidth/(double)serThisChild.mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE;\n }\n }\n }\n } else if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE\n && (serThisChild.mType == UnitProtoType.Type.TYPE_SMALL_O || serThisChild.mType == UnitProtoType.Type.TYPE_BIG_O)) {\n // now deal with all o or Os. do not put this in the first round because the condition to change o or O to 0 is more relax.\n if (mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE\n || mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE\n || mlistChildren.get(idx).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {\n // if it has upper or lower note.\n serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;\n } else if (idx > 0 && (!mlistChildren.get(idx - 1).isLetterChar() || (mlistChildren.get(idx - 1).mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE\n && (mlistChildren.get(idx - 1).mType == UnitProtoType.Type.TYPE_SMALL_O || mlistChildren.get(idx - 1).mType == UnitProtoType.Type.TYPE_BIG_O)))) {\n // if left character is not a letter char or is o or O\n serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;\n } else if (idx < (mlistChildren.size() - 1) && (!mlistChildren.get(idx + 1).isLetterChar() || (mlistChildren.get(idx + 1).mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE\n && (mlistChildren.get(idx + 1).mType == UnitProtoType.Type.TYPE_SMALL_O || mlistChildren.get(idx + 1).mType == UnitProtoType.Type.TYPE_BIG_O)))) {\n // if right character is not a letter char or is o or O\n serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;\n }\n }\n }\n \n if (listVLnChars.size() == 1) {\n listVLnChars.getFirst().mType = UnitProtoType.Type.TYPE_ONE; // all the no-paired vline chars are changed to 1.\n } else {\n while (listVLnChars.size() > 0) {\n int nIdx1st = listVLnCharIndices.getFirst();\n if (mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE\n || mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE\n || mlistChildren.get(nIdx1st).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {\n listVLnChars.getFirst().mType = UnitProtoType.Type.TYPE_ONE; // 1st | cannot have upper note or low note .\n listVLnCharIndices.removeFirst();\n listVLnChars.removeFirst();\n } else {\n break;\n }\n }\n for (int idx = listVLnChars.size() - 1; idx >= 0 ; idx --) {\n StructExprRecog serOneChild = listVLnChars.get(idx);\n int idx1 = listVLnChars.size() - 1;\n for (; idx1 >= 0; idx1 --) {\n if (idx1 == idx) {\n continue;\n }\n StructExprRecog serTheOtherChild = listVLnChars.get(idx1);\n if ((serOneChild.getBottomPlus1() - serTheOtherChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serOneChild.mnHeight\n && (serTheOtherChild.getBottomPlus1() - serOneChild.mnTop) > ConstantsMgr.msdOpenCloseBracketHeightRatio * serOneChild.mnHeight\n && serOneChild.mnHeight > ConstantsMgr.msdOpenCloseBracketHeightRatio * serTheOtherChild.mnHeight // must have similar height as the start character\n && serOneChild.mnHeight < 1/ConstantsMgr.msdOpenCloseBracketHeightRatio * serTheOtherChild.mnHeight) {\n // has corresponding v-line.\n break;\n }\n }\n if (idx1 == -1) {\n // doesn't have corresponding v-line..\n serOneChild.mType = UnitProtoType.Type.TYPE_ONE; // all the no-paired vline chars are changed to 1.\n }\n }\n // recheck the new first VLnChars.\n for (int idx = 0; idx < listVLnChars.size(); idx ++) {\n int nIdxInList = listVLnCharIndices.get(idx);\n if (listVLnChars.get(idx).mType == UnitProtoType.Type.TYPE_ONE) {\n continue;\n } else if (mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTUPPERNOTE\n || mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTLOWERNOTE\n || mlistChildren.get(nIdxInList).mnExprRecogType == EXPRRECOGTYPE_VCUTLUNOTES) {\n listVLnChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // 1st | cannot have upper note or low note .\n } else {\n break;\n }\n }\n }\n \n if (listBoundingChars.size() > 0 && listBoundingChars.getLast() == mlistChildren.getLast()) {\n // change the last unpaired ( or [ to t or 1 if necessary.\n //StructExprRecog serB4BndChar = mlistChildren.size() > 1?mlistChildren.get(mlistChildren.size() - 2):null;\n if (listBoundingChars.getLast().mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET\n && (double)listBoundingChars.getLast().mnWidth/(double)listBoundingChars.getLast().mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {\n listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after chars to adjust [ coz not accurate.\n } else if (listBoundingChars.getLast().mType == UnitProtoType.Type.TYPE_ROUND_BRACKET\n && (double)listBoundingChars.getLast().mnWidth/(double)listBoundingChars.getLast().mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {\n listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_ONE; // change to 1. Do not use b4 after chars to adjust [ coz not accurate.\n } else {\n listBoundingChars.getLast().mType = UnitProtoType.Type.TYPE_SMALL_T; // if the last unpaired ( or [ is the last char, very likely it is a t.\n }\n }\n for (int idx = 0; idx < listBoundingChars.size(); idx ++) {\n //StructExprRecog serB4BndChar = listBoundingCharIndices.get(idx) > 0?mlistChildren.get(listBoundingCharIndices.get(idx) - 1):null;\n //StructExprRecog serAfterBndChar = listBoundingCharIndices.get(idx) < mlistChildren.size() - 1?mlistChildren.get(listBoundingCharIndices.get(idx) + 1):null;\n if (listBoundingChars.get(idx).mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET\n && (double)listBoundingChars.get(idx).mnWidth/(double)listBoundingChars.get(idx).mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {\n listBoundingChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // change to 1. do not use pre or next char height to adjust coz not accurate.\n }else if (listBoundingChars.get(idx).mType == UnitProtoType.Type.TYPE_ROUND_BRACKET\n && (double)listBoundingChars.get(idx).mnWidth/(double)listBoundingChars.get(idx).mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {\n listBoundingChars.get(idx).mType = UnitProtoType.Type.TYPE_ONE; // change to 1. do not use pre or next char height to adjust coz not accurate.\n }\n // do not change other unmatched ( or [ to t or 1 because this makes things worse.\n }\n for (int idx = 0; idx < mlistChildren.size(); idx ++) {\n StructExprRecog serThisChild = mlistChildren.get(idx);\n serThisChild.rectifyMisRecogChars2ndRnd();\n } \n } else if (isChildListType()) {\n for (int idx = 0; idx < mlistChildren.size(); idx ++) {\n StructExprRecog serThisChild = mlistChildren.get(idx);\n if (serThisChild.mnExprRecogType == EXPRRECOGTYPE_ENUMTYPE) {\n if (serThisChild.isBoundChar()) {\n if (serThisChild.mType == UnitProtoType.Type.TYPE_VERTICAL_LINE\n && (idx != 0 || mnExprRecogType != EXPRRECOGTYPE_VCUTUPPERNOTE)) {\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE; // if it is |**(something), it could still be valid for |...|**(something). But shouldn't have foot notes.\n } else if (serThisChild.mType == UnitProtoType.Type.TYPE_SQUARE_BRACKET\n && serThisChild.mnWidth/serThisChild.mnHeight <= ConstantsMgr.msdSquareBracketTo1WOverHThresh) {\n // if it is [ and it is very thing, very likely it is a 1.\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE;\n } else if (serThisChild.mType == UnitProtoType.Type.TYPE_ROUND_BRACKET\n && serThisChild.mnWidth/serThisChild.mnHeight <= ConstantsMgr.msdRoundBracketTo1WOverHThresh) {\n // if it is ( and it is very thing, very likely it is a 1.\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE;\n } else if (serThisChild.mType != UnitProtoType.Type.TYPE_VERTICAL_LINE) { // if child is single char, very likely it is not a ( or [ but a t.\n serThisChild.mType = UnitProtoType.Type.TYPE_SMALL_T;\n }\n } else if (serThisChild.isCloseBoundChar() && (idx != 0\n || (mnExprRecogType != EXPRRECOGTYPE_VCUTUPPERNOTE\n && mnExprRecogType != EXPRRECOGTYPE_VCUTLOWERNOTE\n && mnExprRecogType != EXPRRECOGTYPE_VCUTLUNOTES))) {\n // a close bound char can have upper and/or lower notes. but if the upper note or lower note is close bound char, still need to convert it to 1.\n // here still convert to 1 because upper lower note can be mis-recognized.\n serThisChild.mType = UnitProtoType.Type.TYPE_ONE;\n } else if (serThisChild.mType == UnitProtoType.Type.TYPE_SMALL_O || serThisChild.mType == UnitProtoType.Type.TYPE_BIG_O) {\n // still convert to 0 even if it has lower or upper notes.\n serThisChild.mType = UnitProtoType.Type.TYPE_ZERO;\n }\n } else {\n serThisChild.rectifyMisRecogChars2ndRnd(); \n }\n }\n }\n }", "private void calculateAreas() {\n\n\t\t/*\n\t\t * Each section is a trapezoid, so that the area is given by:\n\t\t * \n\t\t * (thicknessAtMainSpar + thicknessAtSecondarySpar)*distanceBetweenSpars*0.5\n\t\t * \n\t\t */\n\t\tint nSections = this._thicknessAtMainSpar.size();\n\t\tfor(int i=0; i<nSections; i++)\n\t\t\tthis._prismoidsSectionsAreas.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\t(this._thicknessAtMainSpar.get(i).plus(this._thicknessAtSecondarySpar.get(i)))\n\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i)).times(0.5).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.SQUARE_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t}", "public static FPoint2[] findSnapErrors(Grid grid, SnapArrangement ar) {\n\n DArray a = new DArray();\n do {\n extractSnapPoints(ar);\n\n // construct a list of segment sections between snap points\n DArray fragList = new DArray();\n FRect fragBounds = null;\n\n Graph g = ar.getGraph();\n for (int jj = 0; jj < ar.nNodes(); jj++) {\n int id1 = jj + ar.idBase();\n for (int kk = 0; kk < g.nCount(id1); kk++) {\n int id2 = g.neighbor(id1, kk);\n if (id2 < id1)\n continue;\n\n // Segment seg = segs[i];\n // for (int j = 0; j < seg.nSnapPoints() - 1; j++) {\n Endpoints ep = new Endpoints(grid, ar.hotPixel(id1), ar.hotPixel(id2));\n if (fragBounds == null)\n fragBounds = new FRect(ep.v0, ep.v1);\n fragBounds.add(ep.v0);\n fragBounds.add(ep.v1);\n fragList.add(ep);\n }\n }\n\n if (fragList.isEmpty())\n break;\n\n // to speed up this process, divide bounds into a grid of bucket/pixels.\n // Each bucket contains the fragments whose minimum bounding rectangles\n // intersect the bucket's pixel. \n // Thus we need only compare fragments against others from the same bucket.\n\n int nBuckets = Math.max(1, ar.nNodes() / 60);\n DArray[] buckets = new DArray[nBuckets * nBuckets];\n {\n double bWidth = fragBounds.width / nBuckets, bHeight = fragBounds.height\n / nBuckets;\n for (int i = 0; i < buckets.length; i++)\n buckets[i] = new DArray();\n for (int i = 0; i < fragList.size(); i++) {\n Endpoints e = (Endpoints) fragList.get(i);\n // add endpoint to every bucket it may intersect\n int y0 = (int) ((Math.min(e.v0.y, e.v1.y) - fragBounds.y) / bHeight);\n int y1 = MyMath.clamp(\n (int) ((Math.max(e.v0.y, e.v1.y) - fragBounds.y) / bHeight), 0,\n nBuckets - 1);\n int x0 = (int) ((Math.min(e.v0.x, e.v1.x) - fragBounds.x) / bWidth);\n int x1 = MyMath.clamp(\n (int) ((Math.max(e.v0.x, e.v1.x) - fragBounds.x) / bWidth), 0,\n nBuckets - 1);\n\n for (int y = y0; y <= y1; y++) {\n for (int x = x0; x <= x1; x++) {\n buckets[y * nBuckets + x].add(e);\n }\n }\n }\n }\n\n final double NEARZERO = .00001;\n\n for (int k = 0; k < buckets.length; k++) {\n DArray b = buckets[k];\n for (int i = 0; i < b.size(); i++) {\n Endpoints ei = (Endpoints) b.get(i);\n\n for (int j = i + 1; j < b.size(); j++) {\n Endpoints ej = (Endpoints) b.get(j);\n\n FPoint2 pt = MyMath.lineSegmentIntersection(ei.v0, ei.v1, ej.v0,\n ej.v1, null);\n if (pt == null)\n continue;\n String err = null;\n\n // make sure the intersection occurs at an endpoint of each\n double di = Math.min(pt.distance(ei.v0), pt.distance(ei.v1));\n double dj = Math.min(pt.distance(ej.v0), pt.distance(ej.v1));\n\n // in triangle grid, fragment endpoint can lie on other fragment.\n // To eliminate this possibility, intersection point must be\n // distinct from all four endpoints.\n\n if (Math.min(di, dj) > NEARZERO) {\n err = \"\";\n }\n if (err != null) {\n a.add(pt);\n // a.add(err);\n }\n }\n }\n }\n } while (false);\n return (FPoint2[]) a.toArray(FPoint2.class);\n }", "private ArrayList<TTC> generateSegmentsHelper(ArrayList<TTC> reference_list) {\n\n ArrayList<TTC> copy = new ArrayList<> (reference_list);\n int start = 0;\n int end = 0;\n\n while (!copy.get(start).equals(START_STATION)) {\n start += 1;\n }\n while (!copy.get(end).equals(endStation)) {\n end += 1;\n }\n if (start < end) {\n return new ArrayList<>(copy.subList(start, end + 1));\n } else if (start == end) {\n return new ArrayList<>(); // if enter and exit at the same station.\n } else {\n Collections.reverse(copy);\n return new ArrayList<>(copy.subList(end, start + 1));\n }\n }", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "private Map<Boolean, Sort> split2 (final int delim, final int subcl) {\n Interval[] split = getConstraint(subcl).split(delim);//the interval to be split\n if (split.length == 0)\n return Collections.EMPTY_MAP;\n else if (split.length == 2) {\n Map<Boolean, Sort> res = new HashMap<>();\n Interval[] newarrc = this.constraints.clone();//the original constraints is copied\n newarrc[subcl - 1] = split[0];\n res.put(false, setConstraint(newarrc)); //false trands for \"0\"\n newarrc = this.constraints.clone();\n newarrc[subcl - 1] = split[1];\n res.put(true, setConstraint(newarrc)); //true stands for \"1\"\n return res;\n }\n throw new IllegalArgumentException(\"binary splits are assumed!\");\n }", "@Override\n public Map<Boolean, Sort> split2 (int delim) {\n int subcl = 0, offset=0;//index of the non-single-values sub-intv, and marker offset\n if (isSplit()) //the class is partitioned in subclasses\n for (int j =0; j < this.constraints.length; j++) //we seek the non-single-values sub-intv\n if (this.constraints[j].singleValue()) \n offset += this.constraints[j].lb();\n else \n subcl = j;\n \n return split2(delim - offset, subcl + 1);\n }", "private void dist2Pos3Beacons()\n {\n //Betrachtung bei 3 Empfaengern\n double dist12 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[1][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[1][1], 2));\n double dist13 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[2][1], 2));\n double dist23 = Math.sqrt(Math.pow(posReceiver[1][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[1][1] - posReceiver[2][1], 2));\n\n boolean temp12 = Math.abs(radius[0] - radius[1]) > dist12;\n boolean temp23 = Math.abs(radius[1] - radius[2]) > dist23;\n boolean temp13 = Math.abs(radius[0] - radius[2]) > dist13;\n\n //Zwei Kreise innerhalb eines anderen Kreises\n if ((temp12 && temp23) || (temp12 && temp13) || (temp23 && temp13))\n {\n double f0 = (dist12 / radius[0] + dist13 / radius[0]) / 2;\n double f1 = (dist12 / radius[1] + dist23 / radius[1]) / 2;\n double f2 = (dist12 / radius[2] + dist13 / radius[2]) / 2;\n\n radius[0] = radius[0] * f0;\n radius[1] = radius[1] * f1;\n radius[2] = radius[2] * f2;\n }\n //Kreis 2 in Kreis 1\n if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[0] > radius[1]))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[0],radius[1],radius[2]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kreis 1 in Kreis 2\n else if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[1] > radius[0]))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[1],radius[0],radius[2]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 1\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[0] > radius[2]))//Kreis 3 in 1\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[2],radius[0],radius[1]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 1 in Kreis 3\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[2] > radius[0]))//Kreis 1 in 3\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[0],radius[2],radius[1]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 2\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[1] > radius[2]))//Kreis 3 in 2\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[2],radius[1],radius[0]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 2 in Kreis 3\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[2] > radius[1]))//Kreis 2 ind 3\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[1],radius[2],radius[0]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kein Kreis liegt innerhalb eines Anderen\n else\n {\n\n if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double p1[] = new double[2];\t//x\n double p2[] = new double[2];\t//y\n\n double norm12 = norm(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1]);\n // Verbindungspunkte Kreis 1 und 2\n p1[0] = posReceiver[0][0] + (radius[0]/ norm12) * (posReceiver[1][0] - posReceiver[0][0]); //x-P1\n p1[1] = posReceiver[0][1] + (radius[0]/ norm12) * (posReceiver[1][1] - posReceiver[0][1]); //y-P1\n p2[0] = posReceiver[1][0] + (radius[1]/ norm12) * (posReceiver[0][0] - posReceiver[1][0]); //x-P2\n p2[1] = posReceiver[1][1] + (radius[1]/ norm12) * (posReceiver[0][1] - posReceiver[1][1]); //y-P2\n double m12[] = new double[2];\n m12[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m12[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm23 = norm(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1]);\n // Verbindungspunkte Kreis 2 und 3\n p1[0] = posReceiver[1][0] + (radius[1]/ norm23) * (posReceiver[2][0] - posReceiver[1][0]); //x-P1\n p1[1] = posReceiver[1][1] + (radius[1]/ norm23) * (posReceiver[2][1] - posReceiver[1][1]); //y-P1\n p2[0] = posReceiver[2][0] + (radius[2]/ norm23) * (posReceiver[1][0] - posReceiver[2][0]); //x-P2\n p2[1] = posReceiver[2][1] + (radius[2]/ norm23) * (posReceiver[1][1] - posReceiver[2][1]); //y-P2\n double m23[] = new double[2];\n m23[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m23[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm31 = norm(posReceiver[2][0], posReceiver[2][1], posReceiver[0][0], posReceiver[0][1]);\n // Verbindungspunkte Kreis 3 und 1\n p1[0] = posReceiver[2][0] + (radius[2]/ norm31) * (posReceiver[0][0] - posReceiver[2][0]); //x-P1\n p1[1] = posReceiver[2][1] + (radius[2]/ norm31) * (posReceiver[0][1] - posReceiver[2][1]); //y-P1\n p2[0] = posReceiver[0][0] + (radius[0]/ norm31) * (posReceiver[2][0] - posReceiver[0][0]); //x-P2\n p2[1] = posReceiver[0][1] + (radius[0]/ norm31) * (posReceiver[2][1] - posReceiver[0][1]); //y-P2\n double m31[] = new double[2];\n m31[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m31[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n // Norm der drei Punkte berechnen\n double a_p = Math.sqrt((m12[0] * m12[0]) + (m12[1] * m12[1]));\n double b_p = Math.sqrt((m23[0] * m23[0]) + (m23[1] * m23[1]));\n double c_p = Math.sqrt((m31[0] * m31[0]) + (m31[1] * m31[1]));\n\n double denominator = 2 * (((m12[0] * m23[1]) - (m12[1] * m23[0])) + (m23[0] * m31[1] - m23[1] * m31[0]) + (m31[0] * m12[1] - m31[1] * m12[0]));\n xPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*(-m12[1]) + (c_p * c_p - a_p * a_p)* (-m23[1]) + (a_p * a_p - b_p * b_p)*(-m31[1])));\n yPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*m12[0] + (c_p * c_p - a_p * a_p)* m23[0] + (a_p * a_p - b_p * b_p)*m31[0]));\n errRad_func = norm(xPos_func, yPos_func, m12[0], m12[1]);\n\n }\n // Kreis 1 und 3 schneiden sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc2Circle(posRec,rad);\n }\n //Kreis 2 und 3 schneide sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc2Circle(posRec,rad);\n }\n //Kreis 1 und 2 schneiden sich\n else if ((dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc2Circle(posRec,rad);\n }\n else if ((dist12 > (radius[0] + radius[1])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc1Circle(posRec,rad);\n }\n else if ((dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc1Circle(posRec,rad);\n }\n else if ((dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc1Circle(posRec,rad);\n }\n else\n {\n double x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n double pos12[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1], radius[0], radius[1]);\n double pos23[][] = circlepoints2(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1], radius[1], radius[2]);\n double pos13[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[2][0], posReceiver[2][1], radius[0], radius[2]);\n\n if(radius[0] >= norm(pos23[0][0],pos23[0][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[0][0];\n y1 = pos23[0][1];\n }\n else if(radius[0] >= norm(pos23[1][0], pos23[1][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[1][0];\n y1 = pos23[1][1];\n }\n\n if(radius[1] >= norm(pos13[0][0], pos13[0][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[0][0];\n y2 = pos13[0][1];\n }\n else if(radius[1] >= norm(pos13[1][0], pos13[1][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[1][0];\n y2 = pos13[1][1];\n }\n\n if(radius[2] >= norm(pos12[0][0], pos12[0][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[0][0];\n y3 = pos12[0][1];\n }\n else if(radius[2] >= norm(pos12[1][0], pos12[1][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[1][0];\n y3 = pos12[1][1];\n }\n\n double tempD = x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2;\n\n xPos_func = (0.5*(\n -y1*(y2*y2)\n +y1*(y3*y3)\n -y1*(x2*x2)\n +y1*(x3*x3)\n\n +y2*(y1*y1)\n -y2*(y3*y3)\n +y2*(x1*x1)\n -y2*(x3*x3)\n\n -y3*(y1*y1)\n +y3*(y2*y2)\n -y3*(x1*x1)\n +y3*(x2*x2)\n ))/ tempD;\n\n yPos_func = (0.5*(\n +x1*(x2*x2)\n -x1*(x3*x3)\n +x1*(y2*y2)\n -x1*(y3*y3)\n\n -x2*(x1*x1)\n +x2*(x3*x3)\n -x2*(y1*y1)\n +x2*(y3*y3)\n\n +x3*(x1*x1)\n -x3*(x2*x2)\n +x3*(y1*y1)\n -x3*(y2*y2)\n ))/ tempD;\n\n errRad_func = norm(x1, y1, xPos_func, yPos_func);\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate List<Integer> sbfsForCVTraining(List<Integer> corners,\n\t\t\tStroke stroke, IObjectiveFunction objFunction, int knownNumCorners) {\n\n\t\tS_ELBOW_THRESHOLD_LOWER_BOUND = -1.0;\n\t\tS_ELBOW_THRESHOLD_UPPER_BOUND = -1.0;\n\n\t\tdouble currError = Double.MAX_VALUE;\n\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>(corners);\n\t\tList<List<Integer>> cornerSubsetList = new ArrayList<List<Integer>>(\n\t\t\t\tcornerSubset.size());\n\t\tList<Double> errorList = new ArrayList<Double>(cornerSubset.size());\n\n\t\tList<List<Integer>> forwardOnSubset = new ArrayList<List<Integer>>();\n\n\t\tint n = -1;\n\n\t\twhile (cornerSubset.size() > 2) {\n\n\t\t\t// Go backward\n\t\t\tList<Object> backResults = prevBestSubset(cornerSubset, stroke,\n\t\t\t\t\tobjFunction);\n\t\t\tList<Integer> backSubset = (List<Integer>) backResults.get(0);\n\t\t\tdouble backError = (Double) backResults.get(1);\n\n\t\t\t// Go forward (if possible)\n\t\t\tint forwardCorner = -1;\n\t\t\tdouble forwardError = Double.MAX_VALUE;\n\t\t\tif (cornerSubset.size() < corners.size() - 1) {\n\t\t\t\tList<Object> forwardResults = nextBestCorner(cornerSubset,\n\t\t\t\t\t\tcorners, stroke, objFunction);\n\t\t\t\tforwardCorner = (Integer) forwardResults.get(0);\n\t\t\t\tforwardError = (Double) forwardResults.get(1);\n\t\t\t}\n\n\t\t\tif (forwardCorner != -1 && forwardError < errorList.get(n - 1)\n\t\t\t\t\t&& !alreadySeenSubset(cornerSubset, forwardOnSubset)) {\n\n\t\t\t\tforwardOnSubset.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\tcornerSubset.add(forwardCorner);\n\t\t\t\tCollections.sort(cornerSubset);\n\n\t\t\t\tcurrError = forwardError;\n\t\t\t\tn--;\n\t\t\t} else {\n\t\t\t\tcornerSubset = backSubset;\n\t\t\t\tcurrError = backError;\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\tif (cornerSubsetList.size() <= n) {\n\t\t\t\tcornerSubsetList.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.add(currError);\n\t\t\t} else {\n\t\t\t\tcornerSubsetList.set(n, new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.set(n, currError);\n\t\t\t}\n\t\t}\n\n\t\tList<Integer> bestSubset = null;\n\n\t\tdouble d1Errors[] = new double[errorList.size()];\n\t\tfor (int i = 1; i < errorList.size(); i++) {\n\t\t\tdouble deltaError = errorList.get(i) / errorList.get(i - 1);\n\t\t\td1Errors[i] = deltaError;\n\t\t}\n\n\t\tfor (int i = 1; i < cornerSubsetList.size(); i++) {\n\t\t\tif (cornerSubsetList.get(i).size() == knownNumCorners) {\n\t\t\t\tS_ELBOW_THRESHOLD_LOWER_BOUND = d1Errors[i];\n\t\t\t\tS_ELBOW_THRESHOLD_UPPER_BOUND = d1Errors[i + 1];\n\t\t\t\tbestSubset = cornerSubsetList.get(i);\n\t\t\t}\n\t\t}\n\n\t\tif (bestSubset == null) {\n\t\t\tbestSubset = cornerSubsetList.get(0);\n\t\t}\n\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "@Override\n\tpublic List getBoundaryShape(Ball b) {\n\t List shapes = new ArrayList();\n\t double x2 = x+width*GameBoard.PixelsPerL - 1;\n\t double y2 = y+height*GameBoard.PixelsPerL - 1;\n\t \n\t if (b.equals(firingBall)) {\n\t //leave out section of top and corner cirle so ball being fired\n\t //can exit\n\t shapes.add(new LineSegment(x, y, x2-GameBoard.PixelsPerL, y));\n\t } else {\n\t shapes.add(new Circle(x2, y, 0));\n\t shapes.add(new LineSegment(x, y, x2, y));\n\t }\n\n\t shapes.add(new LineSegment(x, y, x, y2));\n\t shapes.add(new LineSegment(x2, y, x2, y2));\n\t shapes.add(new LineSegment(x, y2, x2, y2));\n\t //0-radius circles at corners\n\t \n\t shapes.add(new Circle(x2, y2, 0));\n\t shapes.add(new Circle(x, y2, 0));\n\t shapes.add(new Circle(x, y, 0));\n\t return shapes;\n\t}", "public double calcAvgSeperatedCharHeight(int nLeftThresh, int nTopThresh, int nRightP1Thresh, int nBottomP1Thresh, double dAvgStrokeWidth) {\n ImageChops imgChops = ExprSeperator.extractConnectedPieces(this);\n double dAvgHeight = 0;\n int nNumOfCntedChars = 0;\n for (int idx = 0; idx < imgChops.mlistChops.size(); idx ++) {\n byte[][] barrayThis = imgChops.mlistChops.get(idx).mbarrayImg;\n int nThisLeft = imgChops.mlistChops.get(idx).mnLeft;\n int nThisTop = imgChops.mlistChops.get(idx).mnTop;\n int nThisWidth = imgChops.mlistChops.get(idx).mnWidth;\n int nThisHeight = imgChops.mlistChops.get(idx).mnHeight;\n double dThisCharHeight = nThisHeight;\n if (nThisWidth != 0 && nThisHeight != 0\n && (imgChops.mlistChops.get(idx).mnLeft < mapOriginalXIdx2This(nRightP1Thresh)\n || imgChops.mlistChops.get(idx).getRightPlus1() > mapOriginalXIdx2This(nLeftThresh))\n && (imgChops.mlistChops.get(idx).mnTop < mapOriginalXIdx2This(nBottomP1Thresh)\n || imgChops.mlistChops.get(idx).getBottomPlus1() > mapOriginalXIdx2This(nTopThresh))) {\n double dMaxCutHeight = 0;\n int nLastAllThroughDivIdx = nThisTop - 1;\n int idx2 = nThisTop;\n for (; idx2 < imgChops.mlistChops.get(idx).getBottomPlus1(); idx2 ++) {\n boolean bIsAllThroughLn = true;\n for (int idx1 = nThisLeft; idx1 < imgChops.mlistChops.get(idx).getRightPlus1(); idx1 ++) {\n if (barrayThis[idx1][idx2] == 0) {\n bIsAllThroughLn = false;\n break;\n }\n }\n if (bIsAllThroughLn && (idx2 - nLastAllThroughDivIdx - 1) > dMaxCutHeight) {\n dMaxCutHeight = idx2 - nLastAllThroughDivIdx - 1;\n }\n }\n if ((idx2 - nLastAllThroughDivIdx - 1) > dMaxCutHeight) {\n dMaxCutHeight = idx2 - nLastAllThroughDivIdx - 1;\n }\n dThisCharHeight = dMaxCutHeight;\n }\n if (dThisCharHeight >= ConstantsMgr.msnMinCharHeightInUnit && dThisCharHeight > dAvgStrokeWidth) {\n // a seperated point or a disconnected stroke may significantly drag down dAvgHeight value.\n dAvgHeight += dThisCharHeight;\n nNumOfCntedChars ++;\n }\n }\n if (nNumOfCntedChars != 0) {\n dAvgHeight /= nNumOfCntedChars;\n\n }\n return Math.max(dAvgHeight, Math.max(ConstantsMgr.msnMinCharHeightInUnit, dAvgStrokeWidth));\n }", "private void split(Map<Integer, SortedSet> invariants, Partition partition) {\n int nonEmptyInvariants = invariants.keySet().size();\n if (nonEmptyInvariants > 1) {\n List<Integer> invariantKeys = new ArrayList<Integer>();\n invariantKeys.addAll(invariants.keySet());\n partition.removeCell(currentBlockIndex);\n int k = currentBlockIndex;\n if (splitOrder == SplitOrder.REVERSE) {\n Collections.sort(invariantKeys);\n } else {\n Collections.sort(invariantKeys, Collections.reverseOrder());\n }\n for (int h : invariantKeys) {\n SortedSet setH = invariants.get(h);\n// System.out.println(\"adding block \" + setH + \" at \" + k + \" h=\" + h);\n partition.insertCell(k, setH);\n blocksToRefine.add(setH);\n k++;\n \n }\n // skip over the newly added blocks\n currentBlockIndex += nonEmptyInvariants - 1;\n }\n }", "public static Coordinate[] makeArea(Coordinate[] polyLine, double width) {\n Coordinate vertices[];\n int numPoints = polyLine.length;\n // If there aren't at least two points, return an empty list\n if (numPoints < 2) {\n return new Coordinate[0];\n }\n // We've got at least two points, start initializing\n int numNewPoints = numPoints * 2;\n vertices = new Coordinate[numNewPoints];\n\n Coordinate p1, p2, intersectPoint;\n Coordinate[] perpLine1, perpLine2;\n Coordinate[] prevLine1, prevLine2, parallelLine1, parallelLine2;\n prevLine1 = new Coordinate[2];\n prevLine2 = new Coordinate[2];\n parallelLine1 = new Coordinate[2];\n parallelLine2 = new Coordinate[2];\n\n double meterWidth = width;\n\n // Define line p1p2\n p1 = polyLine[0];\n p2 = polyLine[1];\n // Get a line perpendicular to p1p2 through the first point of input\n // 'polyline'\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n // Keep these two endpoints as part of the final polygon\n vertices[0] = perpLine1[0];\n vertices[numNewPoints - 1] = perpLine1[1];\n\n // Get a line perpendicular to p1p2 through the second point of\n // 'polyline'\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Using these new endpoints, determine the 2 parallel lines that\n // straddle p1p2\n // Since the linePerpendicularThruP1 method always rotates in a\n // clockwise\n // direction, perpLine2 endpoints will be rotated 180 degrees wrt\n // perpLine1 endpoints\n prevLine1[0] = perpLine1[0];\n prevLine1[1] = perpLine2[1];\n prevLine2[0] = perpLine1[1];\n prevLine2[1] = perpLine2[0];\n\n for (int i = 2; i < numPoints; i++) {\n // Define p1p2\n p1 = polyLine[i - 1];\n p2 = polyLine[i];\n // Calculate 2 end lines perpendicular to p1p2 that are 'kmWidth'\n // long\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Calculate 2 lines parallel to p1p2 that are 'kmWidth' apart\n parallelLine1[0] = perpLine1[0];\n parallelLine1[1] = perpLine2[1];\n parallelLine2[0] = perpLine1[1];\n parallelLine2[1] = perpLine2[0];\n\n // Compute the intersections\n intersectPoint = intersection(parallelLine1, prevLine1);\n vertices[i - 1] = intersectPoint;\n intersectPoint = intersection(parallelLine2, prevLine2);\n vertices[numNewPoints - i] = intersectPoint;\n\n // Now stash the current lines as the previous lines for future\n // calcs.\n prevLine1[0] = parallelLine1[0];\n prevLine1[1] = parallelLine1[1];\n prevLine2[0] = parallelLine2[0];\n prevLine2[1] = parallelLine2[1];\n }\n // Now tack on the last perpendicular line\n vertices[numNewPoints / 2 - 1] = perpLine2[1];\n vertices[numNewPoints / 2] = perpLine2[0];\n return vertices;\n }", "public Spliterator<T> trySplit() {\n/* 1309 */ HoldingConsumer<? super T> holdingConsumer = new HoldingConsumer();\n/* 1310 */ long l = this.est;\n/* 1311 */ if (l > 1L && tryAdvance(holdingConsumer)) {\n/* 1312 */ int i = this.batch + 1024;\n/* 1313 */ if (i > l)\n/* 1314 */ i = (int)l; \n/* 1315 */ if (i > 33554432)\n/* 1316 */ i = 33554432; \n/* 1317 */ Object[] arrayOfObject = new Object[i];\n/* 1318 */ byte b = 0; \n/* 1319 */ do { arrayOfObject[b] = holdingConsumer.value; } while (++b < i && tryAdvance(holdingConsumer));\n/* 1320 */ this.batch = b;\n/* 1321 */ if (this.est != Long.MAX_VALUE)\n/* 1322 */ this.est -= b; \n/* 1323 */ return new Spliterators.ArraySpliterator<>(arrayOfObject, 0, b, characteristics());\n/* */ } \n/* 1325 */ return null;\n/* */ }", "private LineSegment[] findSegments() {\n List<LineSegment> segmentList = new ArrayList<>();\n int N = points.length;\n for (int i = 0; i < N; i++) {\n for (int j = i+1; j < N; j++) {\n Double slopePQ = points[i].slopeTo(points[j]);\n for (int k = j+1; k < N; k++) {\n Double slopePR = points[i].slopeTo(points[k]);\n if (slopePQ.equals(slopePR)) {\n for (int l = k + 1; l < N; l++) {\n Double slopePS = points[i].slopeTo(points[l]);\n if (slopePQ.equals(slopePS)) {\n LineSegment lineSegment = new LineSegment(points[i], points[l]);\n segmentList.add(lineSegment);\n }\n }\n }\n }\n }\n }\n return segmentList.toArray(new LineSegment[segmentList.size()]);\n }", "protected List<Candidate> getSlopeCandidates() {\r\n\t\t//method parameter declaration\r\n\t\tString de_name, xml_gid_in = null, xml_gid_out = null;\r\n\t\t\r\n\t\t//metaData logging\r\n\t\tLogger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.INFO, \"Features_in size is: \" + this.getFeatures_in().length);\r\n\t\tSystem.out.println(\"max allowed end-point distance is: \" + this.slopeThreshold);\r\n\t\tSystem.out.println(\"max allowed mid-point distance is: \" + midPointThreshold);\r\n\t\tSystem.out.println(\"max allowed height difference for slope Links is: \" + (StartConfiguration.getInstance().getSlope_heights()[5] + 0.5));\r\n\t\tList<SimpleFeature> slopes_out = new ArrayList<SimpleFeature>(Arrays.asList(this.getFeatures_in()));\r\n\t\tList<Candidate> candidates = new ArrayList<Candidate>();\r\n\t\tCandidate cand = null;\r\n\t\t\t\t\r\n\t\tfor (SimpleFeature slope_in: this.getFeatures_in()) {\r\n\t\t\t//remove first item of the out_feature list, to avoid checking a feature over itself\r\n\t\t\tslopes_out.remove(0);\r\n\t\t\t\r\n//if (!slope_in.getAttribute(\"DE_GR_L_1\").equals(\"Sportgastein\")) continue;\r\n\r\n\t\t\t//fetch geometry, coordinate sequence and create start and end point\r\n\t\t\tGeometry geom_in = (Geometry) slope_in.getDefaultGeometry();\r\n\t\t\tCoordinate [] slope_in_endPoints = GeometryOperations.getOrderedEndPoints(slope_in);\r\n\t\t\t\r\n\t\t\t//iterate over the out set of features\r\n\t\t\tfor (SimpleFeature slope_out: slopes_out) {\t\t\r\n\t\t\t\t//fetch semantic info\r\n\t\t\t\tde_name = slope_in.getAttribute(\"DE_GR_L_0\") + \" - \" + slope_in.getAttribute(\"DE_GR_L_1\");\r\n\t\t\t\txml_gid_in = slope_in.getAttribute(\"XML_GID\").toString();\r\n\t\t\t\txml_gid_out = slope_out.getAttribute(\"XML_GID\").toString();\r\n\t\t\t\t\r\n\t\t\t\tString[] attributes = new String [] {xml_gid_in, xml_gid_out, de_name};\r\n\t\t\t\t\r\n\t\t\t\t//fetch geometry and slope_out end-points\r\n\t\t\t\tCoordinate [] slope_out_endPoints = GeometryOperations.getOrderedEndPoints(slope_out);\r\n\t\t\t\tGeometry geom_out = (Geometry) slope_out.getDefaultGeometry();\r\n\t\t\t\t\r\n\t\t\t\t/* fetch intersection points of two geometries. size null -> means no intersection. size >=1 -> means slope intersect at one or more points */\r\n\t\t\t\tList<Coordinate> intersectionPoints = geomOps.getIntersectionVertices(geom_in, geom_out);\r\n\r\n\t\t\t\t//Remove common upper or lower point, if there is one, from intersection list\r\n\t\t\t\tcleanIntersectionsFromCommonEndPoints(slope_in_endPoints, slope_out_endPoints, intersectionPoints);\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/* 1 - search slope_in upper for connection with slope_out lower or mid-point (distance < 20m) (traverse direction from slope_out to slope_in) */\r\n\t\t\t\tCoordinate midPointNeighbor = getMidPointCandidate(slope_in_endPoints[1], geom_out, midPointThreshold); //fetch midPoint neighbor if one exists, for upper endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_in_endPoints[1], slope_out_endPoints[0], intersectionPoints, midPointNeighbor, attributes, true);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 2 - search slope_in lower for connection with slope_out upper or mid-point (distance < 20m) (traverse direction from slope_in to slope_out) */\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_in_endPoints[0], geom_out, this.midPointThreshold);\t//fetch midPoint neighbor if one exists, for lower endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_in_endPoints[0], slope_out_endPoints[1], intersectionPoints, midPointNeighbor, attributes, false);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 3 - search slope_out upper for connection with slope_in lower or mid-point (distance < 20m) (traverse direction from slope_in to slope_out)*/\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_out_endPoints[1], geom_in, midPointThreshold); //fetch midPoint neighbor if one exists, for upper slope_out endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_out_endPoints[1], slope_in_endPoints[0], intersectionPoints, midPointNeighbor, new String [] { xml_gid_out, xml_gid_in, de_name}, true);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand); }\r\n\t\t\t\t\r\n\t\t\t\t/* 4 - search slope_out lower for connection with slope_in upper or mid-point (distance < 20m) (traverse direction from slope_out to slope_in) */\r\n\t\t\t\tmidPointNeighbor = getMidPointCandidate(slope_out_endPoints[0], geom_in, this.midPointThreshold);\t//fetch midPoint neighbor if one exists, for lower endPoint\r\n\t\t\t\tcand = fetchEndpointCandidate(slope_out_endPoints[0], slope_in_endPoints[1], intersectionPoints, midPointNeighbor, new String [] { xml_gid_out, xml_gid_in, de_name}, false);\r\n\t\t\t\tif (cand!=null) { candidates.add(cand);\t}\r\n\t\t\t\t\r\n\t\t\t\t/* 5 - No candidate links are found and slopes DO NOT INTERSECT, search for mid-point links*/\r\n\t\t\t\tif (candidates.size() == 0 && intersectionPoints == null) {\r\n\t\t\t\t\t//Fetch closest point between two geometries, that is within allowed threshold (10.50)\r\n\t\t\t\t\tif (DistanceOp.isWithinDistance(geom_in, geom_out, midPointThreshold)) {\r\n\t\t\t\t\t\t//fetch nearest points\r\n\t\t\t\t\t\tCoordinate[] nearestPoints = DistanceOp.nearestPoints(geom_in, geom_out);\r\n\t\t\t\t\t\tCoordinate nearestGeom_in = nearestPoints[0];\r\n\t\t\t\t\t\tCoordinate nearestGeom_out = nearestPoints[1];\r\n\t\t\t\t\t\t//fetch interpolated Z ordinate in case it is NaN\r\n\t\t\t\t\t\tnearestGeom_in = GeometryOperations.get3DLinePoint(nearestGeom_in, geom_in);\r\n\t\t\t\t\t\tnearestGeom_out = GeometryOperations.get3DLinePoint(nearestGeom_out, geom_out);\r\n\t\t\t\t\t\t//create and add mid-point candidate. Traverse direction has to be from highest to lowest point\r\n\t\t\t\t\t\tif (nearestGeom_in.z > nearestGeom_out.z) {\r\n\t\t\t\t\t\t\tcand = new Candidate(nearestGeom_in, nearestGeom_out, \"Slope2Slope\", xml_gid_in, xml_gid_out, de_name);\r\n\t\t\t\t\t\t\tcandidates.add(cand);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcand = new Candidate(nearestGeom_out, nearestGeom_in, \"Slope2Slope\", xml_gid_out, xml_gid_in, de_name);\r\n\t\t\t\t\t\t\tcandidates.add(cand);\r\n\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\t\r\n\t\t\t\t//FINALLY add intersection points\r\n\t\t\t\tif (intersectionPoints != null && intersectionPoints.size() > 0) {\r\n\t\t\t\t\t//System.err.println(\"Still \" + intersectionPoints.size() + \" to add\");\r\n\t\t\t\t\tfor (Coordinate intersection: intersectionPoints) {\r\n\t\t\t\t\t\tcand = new Candidate(intersection, intersection, \"Intersection\", xml_gid_in, xml_gid_out, de_name);\r\n\t\t\t\t\t\tcandidates.add(cand);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcand = null; //reset candidate\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t//Clean duplicate candidates in case some exist, candidates with different start and end features are needed for the final slope nodding\r\n\t\tcleanDuplicates(candidates);\r\n\t\t\t\r\n\t\t//********* METHOD END ****************\r\n\t\treturn candidates;\r\n\t}", "@Test\n public void testSplittingSoillayer5() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.26\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.3\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.26\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"27\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"39\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil top layer case 3 is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }", "private ArrayList processBuilding(int[][] building, int minArea, Random rand){\n\t\tint a = RescueMapToolkit.area(building);\n\t\t//System.out.println(minArea+\", \"+a);\n\t\tif(a < 1000) //kill these ones...\n\t\t\treturn new ArrayList(0);\n\t\tif(a < minArea){ //primary base case\n\t\t\tArrayList l = new ArrayList(1);\n\t\t\tl.add(building);\n\t\t\treturn l;\n\t\t}\n\t\tint lower = (int)(rand.nextDouble()*minArea);\n\t\tlower = lower*4;\n\t\tif(a < lower){ //probabilistic base case\n\t\t\tArrayList l = new ArrayList(1);\n\t\t\tl.add(building);\n\t\t\treturn l;\n\t\t}\n\t\t//find the max and min points\n\t\tint minX = building[0][0];\n\t\tint minY = building[0][1];\n\t\tint maxX = building[0][0];\n\t\tint maxY = building[0][1];\n\t\tfor(int i = 1; i < building.length; i++){\n\t\t\tif(minX > building[i][0]) minX = building[i][0];\n\t\t\tif(maxX < building[i][0]) maxX = building[i][0];\n\t\t\tif(minY > building[i][1]) minY = building[i][1];\n\t\t\tif(maxY < building[i][1]) maxY = building[i][1];\n\t\t}\n\t\tint midX = (minX+maxX)/2;\n\t\tint midY = (minY+maxY)/2;\n\t\t//split the building in half\n\t\tint[][][] split;\n\t\tif(maxX-minX > maxY-minY)\n\t\t\tsplit = RescueMapToolkit.split(building,midX,minY,midX,maxY);\n\t\telse\n\t\t\tsplit = RescueMapToolkit.split(building,minX,midY,maxX,midY);\n\n\t\tif(split == null || RescueMapToolkit.area(split[0]) == 0 || RescueMapToolkit.area(split[1]) == 0)\n\t\t\treturn new ArrayList(0);\n\n\t\t//and recurse\n\t\tArrayList a1 = processBuilding(split[0],minArea,rand);\n\t\tArrayList a2 = processBuilding(split[1],minArea,rand);\n\t\tArrayList toRet = new ArrayList(a1.size()+a2.size());\n\t\tfor(int i = 0; i < a1.size(); i++)\n\t\t\ttoRet.add(a1.get(i));\n\t\tfor(int i = 0; i < a2.size(); i++)\n\t\t\ttoRet.add(a2.get(i));\n\t\treturn toRet;\n\t}", "private void splitBankStatementLine(HttpServletResponse response, String strReconciliationId,\n String strBankStatementLineId, String strTransactionId) throws IOException, ServletException {\n JSONObject table = new JSONObject();\n boolean returnError = false;\n FIN_Reconciliation rec = OBDal.getInstance().get(FIN_Reconciliation.class, strReconciliationId);\n FIN_BankStatementLine bsl = OBDal.getInstance().get(FIN_BankStatementLine.class,\n strBankStatementLineId);\n FIN_FinaccTransaction trx = OBDal.getInstance().get(FIN_FinaccTransaction.class,\n strTransactionId);\n try {\n OBContext.setAdminMode(true);\n if (rec != null && \"Y\".equals(rec.getPosted())) {\n // reconciliation posted not possible to split a row\n returnError = true;\n table.put(\"showJSMessage\", \"APRM_SplitBSLReconciliationPosted\");\n }\n if (bsl.getFinancialAccountTransaction() != null\n && bsl.getFinancialAccountTransaction().getReconciliation() != null) {\n returnError = true;\n table.put(\"showJSMessage\", \"APRM_SplitBSLAlreadyMatched\");\n }\n\n // If validation was ok continue with the split\n if (!returnError) {\n BigDecimal bslAmount = bsl.getCramount().subtract(bsl.getDramount());\n BigDecimal trxAmount = trx.getDepositAmount().subtract(trx.getPaymentAmount());\n\n if (bslAmount.compareTo(trxAmount) != 0) {\n // prevent trigger\n FIN_BankStatement bs = bsl.getBankStatement();\n bs.setProcessed(false);\n OBDal.getInstance().save(bs);\n OBDal.getInstance().flush();\n\n // Duplicate bank statement line with pending amount\n FIN_BankStatementLine clonedBSLine = (FIN_BankStatementLine) DalUtil.copy(bsl, true);\n\n BigDecimal credit = bsl.getCramount().subtract(trx.getDepositAmount());\n BigDecimal debit = bsl.getDramount().subtract(trx.getPaymentAmount());\n\n clonedBSLine.setCramount(credit);\n clonedBSLine.setDramount(debit);\n\n if (credit.compareTo(BigDecimal.ZERO) != 0 && debit.compareTo(BigDecimal.ZERO) != 0) {\n BigDecimal total = credit.subtract(debit);\n if (total.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setCramount(BigDecimal.ZERO);\n clonedBSLine.setDramount(total.abs());\n } else {\n clonedBSLine.setCramount(total);\n clonedBSLine.setDramount(BigDecimal.ZERO);\n }\n } else {\n if (credit.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setCramount(BigDecimal.ZERO);\n clonedBSLine.setDramount(credit.abs());\n }\n if (debit.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setDramount(BigDecimal.ZERO);\n clonedBSLine.setCramount(debit.abs());\n }\n\n }\n\n // link bank statement line with the transaction\n bsl.setFinancialAccountTransaction(trx);\n bsl.setCramount(trx.getDepositAmount());\n bsl.setDramount(trx.getPaymentAmount());\n bsl.setMatchingtype(FIN_MatchedTransaction.MANUALMATCH);\n trx.setStatus(\"RPPC\");\n trx.setReconciliation(rec);\n if (trx.getFinPayment() != null) {\n trx.getFinPayment().setStatus(\"RPPC\");\n }\n\n bs.setProcessed(true);\n\n // Save\n OBDal.getInstance().save(bs);\n OBDal.getInstance().save(clonedBSLine);\n OBDal.getInstance().save(bsl);\n OBDal.getInstance().flush();\n }\n }\n response.setContentType(\"text/html; charset=UTF-8\");\n PrintWriter out = response.getWriter();\n out.println(\"data = \" + table.toString());\n out.close();\n } catch (JSONException e) {\n throw new OBException(\"splitBankStatementLine - JSON object error: \" + table.toString(), e);\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public DetectLED findSegments() {\n\t\tchains = new ArrayList<Chain>();\n\t\t// Every single line segment is a candidate to build a chain upon it\n\t\t// So let's seed the starting points for all potential chains\n\t\tfor (int i=0; i < lights.size(); i++) {\n\t\t\tfor (int j=0; j < lights.size(); j++) {\n\t\t\t\tif(i != j && lights.get(i).minus(lights.get(j)).norm() < maxSeg) {\n\t\t\t\t\t// Also seed chains for different number of nodes\n\t\t\t\t\t// maxNodes/2 is an arbitrary pick but should be good enough\n\t\t\t\t\tfor(int n = maxNodes; n > maxNodes/2; n--) {\n\t\t\t\t\t\tchains.add(new Chain(i, j, n));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}", "public LinkedList<Point> segmentsToDraw() {\n LinkedList<Point> segmentCoordinates = new LinkedList<Point>();\n for (int segment = 1; segment <= snakeSize; segment++) {\n //search array for each segment number\n for (int x = 0; x < maxX; x++) {\n for (int y = 0; y < maxY; y++) {\n if (snakeSquares[x][y] == segment) {\n //make a Point for this segment's coordinates and add to list\n Point p = new Point(x * SnakeGame.getSquareSize(), y * SnakeGame.getSquareSize());\n segmentCoordinates.add(p);\n }\n }\n }\n }\n return segmentCoordinates;\n\n }", "public line subDivide(MyTreeNode n, line l){\r\n line t = n.data; //store the line\r\n while (true){ //while we still can\r\n if(n.leftChild == null && n.rightChild == null){\r\n break; //break when there is nowhere left to go\r\n }\r\n //should just check if point is invalid, why did I do this?\r\n else if(n.leftChild == null && Geometry.endTest(n.data, n.rightChild.data).equals(new point(-10,-10))){ //if the left child is null, and the point isn't valid\r\n break;\r\n }\r\n else if(n.rightChild == null && Geometry.endTest(n.data, n.leftChild.data).equals(new point(-10,-10))){ //right child null point isn't valid\r\n break;\r\n }\r\n else if(n.leftChild == null){ //if the left child is null jsut check the right\r\n point temp = Geometry.endTest(n.data, n.rightChild.data);\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n }\r\n else{\r\n t = new line(temp, n.data.end);\r\n }\r\n n = n.rightChild;\r\n }\r\n\r\n else if(n.rightChild == null){ //if the right is null just check the left\r\n point temp = Geometry.endTest(n.data, n.leftChild.data);\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n }\r\n else{\r\n t = new line(temp, n.data.end);\r\n }\r\n n = n.leftChild;\r\n }\r\n //Should update else to allow for both children to be checked w/o the continue...\r\n else{ //otherwise check them both\r\n point temp = Geometry.endTest(n.data, n.leftChild.data); //find the point of intsection between the line and its children\r\n point rtemp = Geometry.endTest(n.data, n.rightChild.data);\r\n if (!(temp.equals(new point (-10, -10)))){ //if not an invalid point, check left child possibilities\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n n = n.leftChild;\r\n continue;\r\n }\r\n else if (!(Geometry.intersect(new line (n.data.end, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.end, temp);\r\n n = n.leftChild;\r\n continue;\r\n }\r\n }\r\n if (!(rtemp.equals(new point (-10, -10)))){//if not an invalid point, check right child\r\n if (!(Geometry.intersect(new line (n.data.start, rtemp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, rtemp);\r\n n = n.rightChild;\r\n continue;\r\n }\r\n else if (!(Geometry.intersect(new line (n.data.end, rtemp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.end, rtemp);\r\n n = n.rightChild;\r\n continue;\r\n }\r\n\r\n break; //so this also should never really be hit, but when it is it is because of (as far as I could tell) rounding errors in the math.\r\n }\r\n else{\r\n System.out.println(\"This line cannot be broken down more, due to issues with the mathematcal rounding\");\r\n return t;\r\n }\r\n }\r\n }\r\n return t;\r\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate List<Integer> sbfsForCVTesting(List<Integer> corners,\n\t\t\tStroke stroke, IObjectiveFunction objFunction, double threshold) {\n\n\t\tdouble currError = Double.MAX_VALUE;\n\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>(corners);\n\t\tList<List<Integer>> cornerSubsetList = new ArrayList<List<Integer>>(\n\t\t\t\tcornerSubset.size());\n\t\tList<Double> errorList = new ArrayList<Double>(cornerSubset.size());\n\n\t\tList<List<Integer>> forwardOnSubset = new ArrayList<List<Integer>>();\n\n\t\tint n = -1;\n\n\t\twhile (cornerSubset.size() > 2) {\n\n\t\t\t// Go backward\n\t\t\tList<Object> backResults = prevBestSubset(cornerSubset, stroke,\n\t\t\t\t\tobjFunction);\n\t\t\tList<Integer> backSubset = (List<Integer>) backResults.get(0);\n\t\t\tdouble backError = (Double) backResults.get(1);\n\n\t\t\t// Go forward (if possible)\n\t\t\tint forwardCorner = -1;\n\t\t\tdouble forwardError = Double.MAX_VALUE;\n\t\t\tif (cornerSubset.size() < corners.size() - 1) {\n\t\t\t\tList<Object> forwardResults = nextBestCorner(cornerSubset,\n\t\t\t\t\t\tcorners, stroke, objFunction);\n\t\t\t\tforwardCorner = (Integer) forwardResults.get(0);\n\t\t\t\tforwardError = (Double) forwardResults.get(1);\n\t\t\t}\n\n\t\t\tif (forwardCorner != -1 && forwardError < errorList.get(n - 1)\n\t\t\t\t\t&& !alreadySeenSubset(cornerSubset, forwardOnSubset)) {\n\n\t\t\t\tforwardOnSubset.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\tcornerSubset.add(forwardCorner);\n\t\t\t\tCollections.sort(cornerSubset);\n\n\t\t\t\tcurrError = forwardError;\n\t\t\t\tn--;\n\t\t\t} else {\n\t\t\t\tcornerSubset = backSubset;\n\t\t\t\tcurrError = backError;\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\tif (cornerSubsetList.size() <= n) {\n\t\t\t\tcornerSubsetList.add(new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.add(currError);\n\t\t\t} else {\n\t\t\t\tcornerSubsetList.set(n, new ArrayList<Integer>(cornerSubset));\n\t\t\t\terrorList.set(n, currError);\n\t\t\t}\n\t\t}\n\n\t\tList<Integer> bestSubset = null;\n\n\t\tdouble d1Errors[] = new double[errorList.size()];\n\t\tfor (int i = 1; i < errorList.size(); i++) {\n\t\t\tdouble deltaError = errorList.get(i) / errorList.get(i - 1);\n\t\t\td1Errors[i] = deltaError;\n\t\t}\n\n\t\tfor (int i = 1; i < d1Errors.length; i++) {\n\t\t\tif (d1Errors[i] > threshold) {\n\t\t\t\tbestSubset = cornerSubsetList.get(i - 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (bestSubset == null) {\n\t\t\tbestSubset = cornerSubsetList.get(0);\n\t\t}\n\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "public void subdivide() {\n\t\tif (!divided) {\n\t\t\tdivided = true;\n\t\t\t\n\t\t\t// Calculate the width and height of the sub nodes\n\t\t\tint width = (int) Math.ceil(boundary.width/2.0) + 1;\n\t\t\tint height = (int) Math.ceil(boundary.height/2.0) + 1;\n\t\t\t\n\t\t\t// Create ArrayList for the nodes and insert them\n\t\t\tnodes = new ArrayList<QuadTreeNode<E>>();\n\t\t\t\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y + height, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y + height, height, width));\n\t\t\t\n\t\t\t// Take all the points and insert them into the best sub node\n\t\t\tfor (Point p : points.keySet()) {\n\t\t\t\tQuadTreeNode<E> q = this.getBestQuad(p);\n\t\t\t\tq.add(p, points.get(p));\n\t\t\t}\n\t\t\t\n\t\t\tpoints = null;\n\t\t}\n\t}", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public Ms2Cluster trimByMatchProb(Map<Ms2Pointer, MsnSpectrum> spectra, int regions, double cut)\n {\n // quit if the master or input are not present!\n if (mMaster==null || !Tools.isSet(spectra)) return null;\n\n // grab the index from our master first\n List<Peak> master = Similarity.index(Spectra.toListOfPeaks(mMaster), regions, 0, 1, 5, 0);\n long bins = (long )(Math.log(2)/Math.log(1d+5E-6)), npks = master.size();\n\n Iterator<Ms2Pointer> itr = mCandidates.iterator();\n while (itr.hasNext())\n {\n MsnSpectrum scan = spectra.get(itr.next());\n if (scan!=null)\n {\n List<Peak> member = Similarity.index(Spectra.toListOfPeaks(scan), regions, 0, 1, 5, 0);\n int overlap = Peaks.overlap_counts(master, member, 0.01, true);\n\n double prob = Stats.hypergeom(overlap, npks, member.size(), bins);\n\n // check the exit condition\n if (-1d*prob<cut) itr.remove();\n // clean up the objects\n member = (List )Tools.dispose(member);\n }\n }\n\n return this;\n }", "public Spliterator<T> trySplit() {\n/* 1771 */ Iterator<? extends T> iterator = this.it = this.collection.iterator();\n/* 1772 */ long l = this.est = this.collection.size();\n/* */ \n/* */ \n/* 1775 */ l = this.est;\n/* 1776 */ if (l > 1L && iterator.hasNext()) {\n/* 1777 */ int i = this.batch + 1024;\n/* 1778 */ if (i > l)\n/* 1779 */ i = (int)l; \n/* 1780 */ if (i > 33554432)\n/* 1781 */ i = 33554432; \n/* 1782 */ Object[] arrayOfObject = new Object[i];\n/* 1783 */ byte b = 0; \n/* 1784 */ do { arrayOfObject[b] = iterator.next(); } while (++b < i && iterator.hasNext());\n/* 1785 */ this.batch = b;\n/* 1786 */ if (this.est != Long.MAX_VALUE)\n/* 1787 */ this.est -= b; \n/* 1788 */ return new Spliterators.ArraySpliterator<>(arrayOfObject, 0, b, this.characteristics);\n/* */ } \n/* 1790 */ return null;\n/* */ }", "private java.util.ArrayList<String> textSplit(String splitted) {\n java.util.ArrayList<String> returned = new java.util.ArrayList<String>();\n String relatedSeparator = this.getLineSeparator(splitted);\n String[] pieces = splitted.split(relatedSeparator + relatedSeparator);\n String rstr = \"\";\n for (int cpiece = 0; cpiece < pieces.length; cpiece++) {\n String cstr = pieces[cpiece];\n if (rstr.length() + cstr.length() > maxLength) {\n if (!rstr.isEmpty()) {\n returned.add(rstr);\n rstr = cstr;\n }\n else {\n returned.add(cstr);\n }\n }\n else {\n if (rstr.equals(\"\")) {\n rstr = cstr;\n }\n else {\n rstr = rstr + lineSeparator + lineSeparator + cstr;\n }\n }\n if (cpiece == pieces.length - 1) {\n returned.add(rstr);\n }\n }\n return returned;\n }", "private void generateHalfCylinder() {\n\t\tint segments = 32;\n\t\tverts = new Vector[segments * 2];\n\t\tfaces = new int[4 * segments - 4][3];\n\t\tdouble heading = 0;\n\t\tdouble headingIncrement = Math.PI / (segments - 1); // The increment in heading between segments of vertices\n\t\tfor (int s = 0; s < segments; s++) {\n\t\t\tdouble x = Math.cos(heading); // x co-ordinate of points on the segment\n\t\t\tdouble z = Math.sin(heading); // z co-ordinate of points on the segment\n\t\t\tverts[s] = new Vector(3);\n\t\t\tverts[s].setElements(new double[] {x, -1, z}); // Vertex on the bottom semi-circle\n\t\t\tverts[s + segments] = new Vector(3);\n\t\t\tverts[s + segments].setElements(new double[] {x, 1, z}); // Vertex on the top semi-circle\n\t\t\theading += headingIncrement;\n\t\t}\n\t\tfor (int i = 0; i < segments - 1; i++) { // Vertical faces approximating the curved surface\n\t\t\tfaces[i * 2] = new int[] {i, i + segments, i + segments + 1}; // Face involving a point on the bottom semi-circle, the point directly above it (top semi-circle and the same segment) and the point directly above and one segment across\n\t\t\tfaces[i * 2 + 1] = new int[] {i, i + segments + 1, i + 1}; // Face involving a point on the bottom semi-circle, the point above and one segment across and the point one segment across on the bottom semi-circle\n\t\t}\n\t\tfor (int i = 0; i < segments - 2; i++) { // Horizontal faces approximating the semi-circles at the top and bottom\n\t\t\tfaces[segments * 2 - 2 + i] = new int[] {0, i + 1, i + 2}; // For the bottom semi-circle, the first vertex connected to the (i + 1)th vertex and the (i + 2)th vertex\n\t\t\tfaces[segments * 2 - 2 + i + segments - 2] = new int[] {segments, segments + i + 2, segments + i + 1}; // The same as above but for the top semi-circle\n\t\t}\n\t\t// Faces representing the vertical square cross-section\n\t\tfaces[4 * segments - 6] = new int[] {0, segments * 2 - 1, segments}; // The first vertex, the last vertex and the one above the first\n\t\tfaces[4 * segments - 5] = new int[] {0, segments - 1, segments * 2 - 1}; // The first vertex, the last vertex on the bottom and the last vertex (on the top)\n\t}", "public void splitTreasure(int treasure) {\n\t\tint i, amtPerChest; \n\t\tint length = treasures.size();\n\t\tamtPerChest = treasure/length;\n\t\tfor(i = 0; i < length; i++) {\n\t\t\ttreasures.get(i).addTreasure(amtPerChest);\n\t\t}\n\t}", "private List<String> extractShares() {\n List<String> result = new ArrayList<String>();\n\n int startPoint = -1;\n\n List<TextPosition> shareItem;\n for (int i = 0; i < infoBlock.size(); i++) {\n // To get index of the text in the information block, if the text does not exist, the index will be -1.\n int index = CommonUtils.collectTextBuffer(infoBlock.get(i)).indexOf(SHARE_KEY);\n if (index != -1 && CommonUtils.collectTextBuffer(infoBlock.get(i)).length() < 15) {\n startPoint = i + 1;\n\n // To locate the PDF object from the text feature to the end of the information block.\n shareItem = infoBlock.get(i).subList(index, index + SHARE_KEY.length());\n\n // To extract information vertically. startPoint now is where the information block next to the\n // one that contains text share.\n if (startPoint != -1) {\n result = filterTextBuffersVerical(shareItem, infoBlock, startPoint, 10);\n/*\t\t\t\t\t\tfor(String item: result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(item);\n\t\t\t\t\t\t}*/\n }\n\n break;\n }\n }\n\n for (int i = 0; i < result.size(); i++) {\n int index = result.get(i).indexOf(\"%\");\n if (index != -1) {\n result.set(i, result.get(i).substring(0, index));\n } else {\n index = result.get(i).indexOf(\"%\");\n if (index != -1) {\n result.set(i, result.get(i).substring(0, index));\n }\n }\n }\n\n return result;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Deprecated\n\tprivate List<Integer> sbs(List<Integer> corners, Stroke stroke,\n\t\t\tIObjectiveFunction objFunction) {\n\n\t\tif (corners.size() <= 2)\n\t\t\treturn corners;\n\n\t\tList<List<Integer>> cornerSubsetList = new ArrayList<List<Integer>>();\n\t\tList<Double> errorList = new ArrayList<Double>();\n\n\t\tList<Integer> cornerSubset = new ArrayList<Integer>(corners);\n\n\t\tfor (int i = 0; i < corners.size(); i++) {\n\n\t\t\tList<Object> results = prevBestSubset(cornerSubset, stroke,\n\t\t\t\t\tobjFunction);\n\n\t\t\tList<Integer> bestSubset = (List<Integer>) results.get(0);\n\t\t\tdouble error = (Double) results.get(1);\n\n\t\t\tcornerSubsetList.add(bestSubset);\n\t\t\terrorList.add(error);\n\n\t\t\tcornerSubset = bestSubset;\n\t\t}\n\n\t\tdouble bestError = errorList.get(0);\n\t\tList<Integer> bestSubset = new ArrayList<Integer>();\n\t\tfor (int i = 1; i < errorList.size(); i++) {\n\t\t\tif (errorList.get(i) > bestError * 1.5) {\n\t\t\t\tbestSubset = cornerSubsetList.get(i - 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tCollections.sort(bestSubset);\n\n\t\treturn bestSubset;\n\t}", "@Test\n public void testSplittingSoillayer6() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"255\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.31\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"75\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"135\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"195\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"255\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.31\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil one layer case is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "public boolean intersectsSegment(Vector a, Vector b, double R){\r\n\t\tif(floor && !obstructed())\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tVector[] p = getCardinalPoints();\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++){\r\n\t\t\tVector c = p[i];\r\n\t\t\tVector d = p[(i+1)%4];\r\n\t\t\tif(Geometry.segmentIntersect(a, b, c, d) || Geometry.plsDist(a, b, p[i]) <= R)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testSplitOnCreatedSegment() throws Exception {\n InternalKnowledgeBase kbase1 = buildKnowledgeBase(\"r1\", \" A(1;) A(2;) B(1;) B(2;) C(1;) C(2;) X(1;) X(2;) E(1;) E(2;)\\n\");\n kbase1.addPackages( buildKnowledgePackage(\"r2\", \" A(1;) A(2;) B(1;) B(2;) C(1;) C(2;) X(1;) X(2;) E(1;) E(2;)\\n\") );\n kbase1.addPackages( buildKnowledgePackage(\"r3\", \" A(1;) A(2;) B(1;) B(2;) C(1;) C(2;) X(1;) X(2;)\\n\") );\n kbase1.addPackages( buildKnowledgePackage(\"r4\", \" A(1;) A(2;) B(1;) B(2;) C(1;) C(2;) \\n\") );\n\n InternalWorkingMemory wm = ((InternalWorkingMemory)kbase1.newKieSession());\n List list = new ArrayList();\n wm.setGlobal(\"list\", list);\n\n wm.insert(new X(1));\n wm.insert(new X(2));\n wm.insert(new X(3));\n wm.flushPropagations();\n\n RuleTerminalNode rtn1 = getRtn( \"org.kie.r1\", kbase1 );\n\n PathMemory pm1 = wm.getNodeMemory(rtn1);\n assertThat(pm1.getLinkedSegmentMask()).isEqualTo(2);\n SegmentMemory[] smems = pm1.getSegmentMemories();\n assertThat(smems.length).isEqualTo(4);\n assertThat(smems[0]).isNull();\n assertThat(smems[2]).isNull();\n assertThat(smems[3]).isNull();\n SegmentMemory sm = smems[1];\n assertThat(sm.getPos()).isEqualTo(1);\n assertThat(sm.getSegmentPosMaskBit()).isEqualTo(2);\n\n\n kbase1.addPackages( buildKnowledgePackage(\"r5\", \" A(1;) A(2;) B(1;) B(2;) C(1;) C(2;) X(1;) X(3;)\\n\") );\n wm.fireAllRules();\n\n assertThat(pm1.getLinkedSegmentMask()).isEqualTo(6);\n smems = pm1.getSegmentMemories();\n assertThat(smems.length).isEqualTo(5);\n assertThat(smems[0]).isNull();\n assertThat(smems[3]).isNull();\n assertThat(smems[4]).isNull();\n sm = smems[1];\n assertThat(sm.getPos()).isEqualTo(1);\n assertThat(sm.getSegmentPosMaskBit()).isEqualTo(2);\n\n sm = smems[2];\n assertThat(sm.getPos()).isEqualTo(2);\n assertThat(sm.getSegmentPosMaskBit()).isEqualTo(4);\n\n RuleTerminalNode rtn5 = getRtn( \"org.kie.r5\", kbase1 );\n PathMemory pm5 = wm.getNodeMemory(rtn5);\n assertThat(pm5.getLinkedSegmentMask()).isEqualTo(6);\n\n smems = pm5.getSegmentMemories();\n assertThat(smems.length).isEqualTo(3);\n assertThat(smems[0]).isNull();\n sm = smems[1];\n assertThat(sm.getPos()).isEqualTo(1);\n assertThat(sm.getSegmentPosMaskBit()).isEqualTo(2);\n\n sm = smems[2];\n assertThat(sm.getPos()).isEqualTo(2);\n assertThat(sm.getSegmentPosMaskBit()).isEqualTo(4);\n }", "private static double[][] makeRegularPoly(double centerLat, double centerLon, double radiusMeters, int gons) {\n\n double[][] result = new double[2][];\n result[0] = new double[gons+1];\n result[1] = new double[gons+1];\n for(int i=0;i<gons;i++) {\n double angle = i*(360.0/gons);\n double x = Math.cos(Math.toRadians(angle));\n double y = Math.sin(Math.toRadians(angle));\n double factor = 2.0;\n double step = 1.0;\n int last = 0;\n\n //System.out.println(\"angle \" + angle + \" slope=\" + slope);\n // Iterate out along one spoke until we hone in on the point that's nearly exactly radiusMeters from the center:\n while (true) {\n double lat = centerLat + y * factor;\n GeoUtils.checkLatitude(lat);\n double lon = centerLon + x * factor;\n GeoUtils.checkLongitude(lon);\n double distanceMeters = SloppyMath.haversinMeters(centerLat, centerLon, lat, lon);\n\n //System.out.println(\" iter lat=\" + lat + \" lon=\" + lon + \" distance=\" + distanceMeters + \" vs \" + radiusMeters);\n if (Math.abs(distanceMeters - radiusMeters) < 0.1) {\n // Within 10 cm: close enough!\n result[0][i] = lat;\n result[1][i] = lon;\n break;\n }\n\n if (distanceMeters > radiusMeters) {\n // too big\n //System.out.println(\" smaller\");\n factor -= step;\n if (last == 1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = -1;\n } else if (distanceMeters < radiusMeters) {\n // too small\n //System.out.println(\" bigger\");\n factor += step;\n if (last == -1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = 1;\n }\n }\n }\n\n // close poly\n result[0][gons] = result[0][0];\n result[1][gons] = result[1][0];\n\n return result;\n }", "@Test\n public void testSplittingSoillayer7() throws IOException, Exception {\n HashMap<String, Object> data = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(data, \"sllb\", \"30\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(data, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(data, \"slbdm\", \"1.3\");\n \n HashMap<String, Object> expectedData = new HashMap<String, Object>();\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"5\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"15\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"30\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.16\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"40\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n AcePathfinderUtil.insertValue(expectedData, \"sllb\", \"50\");\n AcePathfinderUtil.insertValue(expectedData, \"slbdm\", \"1.3\");\n ArrayList<HashMap<String, String>> expectedLayers = MapUtil.getBucket(expectedData, \"soil\").getDataList();\n\n ArrayList<HashMap<String, String>> result = SoilHelper.splittingSoillayer(data, false);\n \n assertEquals(\"getRootDistribution: soil top layer case 4 is incorrect \", expectedLayers, result);\n \n log.info(\"getRootDistribution() output: {}\", result.toString());\n }", "private Iterable<Segment> getCleanableSegments() {\n List<Segment> segments = new ArrayList<>();\n for (Segment segment : manager.segments()) {\n // Only allow compaction of segments that are full.\n if (segment.lastIndex() <= index() && segment.isFull()) {\n\n // Calculate the percentage of entries that have been marked for cleaning in the segment.\n double cleanPercentage = (segment.length() - segment.deleteCount()) / (double) segment.length();\n\n // If the percentage of entries marked for cleaning times the segment version meets the cleaning threshold,\n // add the segment to the segments list for cleaning.\n if (cleanPercentage * segment.descriptor().version() >= CLEAN_THRESHOLD) {\n segments.add(segment);\n }\n }\n }\n return segments;\n }", "public static List<String> catalogue(List<String> splitBlocks) {\r\n\t\tHashMap<String, Token> map = new HashMap<>();\r\n\t\t\r\n\t\tfor (int i = 0; i < splitBlocks.size(); i++) {\r\n\t\t\tList<Token> tokensList = Token.createTokenList(splitBlocks.get(i));\r\n\t\t\tList<Token> newTokenList = new ArrayList<Token>();\r\n\t\t\t\r\n\t\t\tfor (Token t : tokensList) {\r\n\t\t\t\tif(map.containsKey(t.getName())) {\r\n\t\t\t\t\tToken temp = map.get(t.getName());\r\n\t\t\t\t\tt.setFeatures(temp.getFeatures());\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tnewTokenList.add(t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcheckPunctuation(newTokenList);\r\n\t\t\tcheckDictionary(newTokenList);\r\n\t\t\tcheckCapitalization(newTokenList);\r\n\t\t\tcheckInitial(newTokenList);\r\n\t\t\tpartOfSpeech(newTokenList);\r\n\t\t\tcheckNumber(newTokenList);\r\n\t\t\tcheckFirstNames(newTokenList);\r\n\t\t\tcheckLastNames(newTokenList);\r\n\t\t\tcheckCitiesStates(newTokenList);\r\n\t\t\tcheckCountries(newTokenList);\r\n\t\t\tcheckPlaces(newTokenList);\r\n\t\t\tcheckNewLine(newTokenList);\r\n\t\t\t\r\n\t\t\tfor (Token tok : newTokenList) {\r\n\t\t\t\t//Functions only relevant to words/numbers\r\n\t\t\t\tif (tok.getName().matches(\"\\\\w\")) {\r\n\t\t\t\t\tcheckHonorific(tok);\r\n\t\t\t\t\tcheckPrefix(tok);\r\n\t\t\t\t\tcheckSuffix(tok);\r\n\t\t\t\t\tcheckNonPersonalProperName(tok);\r\n\t\t\t\t\tcheckStopList(tok);\t\r\n\t\t\t\t}\r\n\t\t\t\tmap.put(tok.getName(), tok);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tLearningMachine.classifyTokens(tokensList);\r\n\t\t\tToken.placePERTags(tokensList);\r\n\t\t\t\r\n\t\t\tsplitBlocks.set(i, Token.combineTokenList(tokensList));\r\n\t\t}\r\n\t\t\r\n\t\treturn splitBlocks;\r\n\t}" ]
[ "0.61014515", "0.5816763", "0.53973746", "0.5243774", "0.5056536", "0.5027985", "0.50069153", "0.49991378", "0.49552286", "0.49233663", "0.48822978", "0.48746514", "0.48646575", "0.48513052", "0.4840771", "0.47820985", "0.47590965", "0.47525227", "0.47438473", "0.47406614", "0.47025457", "0.4694384", "0.46902338", "0.4683117", "0.46720934", "0.4669435", "0.46579432", "0.46357757", "0.4620261", "0.46180582", "0.46120203", "0.46039528", "0.45915037", "0.4589652", "0.458823", "0.4575971", "0.45702803", "0.45554015", "0.45503995", "0.4517305", "0.4509525", "0.45034754", "0.4499689", "0.44889987", "0.4488153", "0.44771367", "0.4473309", "0.44657603", "0.44537714", "0.44493455", "0.44316038", "0.44309407", "0.44280827", "0.44223773", "0.44170362", "0.4411269", "0.44051588", "0.44041908", "0.4403966", "0.44007468", "0.4394622", "0.43914497", "0.43855706", "0.43844873", "0.43715817", "0.43549204", "0.43543968", "0.43509302", "0.43505156", "0.43501872", "0.43498775", "0.43482888", "0.43406668", "0.43181834", "0.43133703", "0.4313188", "0.43045983", "0.4300783", "0.42994556", "0.42991796", "0.4291507", "0.4289905", "0.42844516", "0.42815092", "0.4263808", "0.42634973", "0.42591578", "0.42519796", "0.42514485", "0.42514026", "0.42414632", "0.42403162", "0.42364514", "0.42278045", "0.4227214", "0.42196593", "0.4208183", "0.42005843", "0.4194404", "0.41925094" ]
0.7538378
0
Finds all segments that does not intersects with other segments of the polygon and has nonclustering length. The input is assumed to be in MAP coordinate. Note: do not repeat the first point of the polygon at the end.
private TreeSet<BisectDistInfo> findAllSegments( Coordinate[] poly ) { TreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>(); Coordinate[] seg = new Coordinate[2]; boolean qualify; for ( int ii = 0; ii < (poly.length - 2); ii++ ) { for ( int jj = ii + 2; jj < (poly.length); jj ++ ) { seg[0] = poly[ii]; seg[1] = poly[jj]; qualify = polysegIntPoly( seg, poly ); if ( qualify ) { double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M; if ( dist > GfaSnap.CLUSTER_DIST ) { distInfo.add( new BisectDistInfo( dist, ii, jj ) ); } } } } return distInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<List<Segment>> getCleanSegments() {\n List<List<Segment>> clean = new ArrayList<>();\n List<Segment> segments = null;\n Segment previousSegment = null;\n for (Segment segment : getCleanableSegments()) {\n if (segments == null) {\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the previous segment is not an instance of the same version as this segment then reset the segments list.\n // Similarly, if the previous segment doesn't directly end with the index prior to the first index in this segment then\n // reset the segments list. We can only combine segments that are direct neighbors of one another.\n else if (previousSegment != null && (previousSegment.descriptor().version() != segment.descriptor().version() || previousSegment.lastIndex() != segment.firstIndex() - 1)) {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the total count of entries in all segments is less then the total slots in any individual segment, combine the segments.\n else if (segments.stream().mapToLong(Segment::count).sum() + segment.count() < segments.stream().mapToLong(Segment::length).max().getAsLong()) {\n segments.add(segment);\n }\n // If there's not enough room to combine segments, reset the segments list.\n else {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n previousSegment = segment;\n }\n\n // Ensure all cleanable segments have been added to the clean segments list.\n if (segments != null) {\n clean.add(segments);\n }\n return clean;\n }", "public Collection<GJPoint2D> singularPoints() {\n\t\tArrayList<GJPoint2D> points = new ArrayList<GJPoint2D>(this.segments.size());\n\t\t\n\t\t// iterate on segments, and add the last control of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tGJPoint2D p = seg.lastControl();\n\t\t\tif (p != null)\n\t\t\t\tpoints.add(p);\n\t\t}\n\t\t\n\t\t// return the set of singular points\n\t\treturn points;\n\t}", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "private Set<NodePair> nonadjacencies(Graph graph) {\n Set<NodePair> nonadjacencies = new HashSet<>();\n for (Graph inputPag : input) {\n for (NodePair pair : allNodePairs(inputPag.getNodes())) {\n if (!inputPag.isAdjacentTo(pair.getFirst(), pair.getSecond())) {\n nonadjacencies.add(new NodePair(graph.getNode(pair.getFirst().getName()), graph.getNode(pair.getSecond().getName())));\n }\n }\n }\n return nonadjacencies;\n }", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "private static List<Query> readPolygonQueries(String fileName) throws IOException {\n CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder()\n .onMalformedInput(CodingErrorAction.REPORT)\n .onUnmappableCharacter(CodingErrorAction.REPORT);\n int BUFFER_SIZE = 1 << 16; // 64K\n InputStream is = Files.newInputStream(Paths.get(fileName));\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, decoder), BUFFER_SIZE);\n List<Query> result = new ArrayList<>();\n while (true) {\n String line = reader.readLine(); \n if (line == null) {\n break;\n }\n if (line.startsWith(\"count=\") == false) {\n throw new AssertionError();\n }\n // Count is the number of polygons the query has:\n int count = Integer.parseInt(line.substring(6, line.indexOf(' ')));\n List<Polygon> polys = new ArrayList<>();\n for(int i=0;i<count;i++) {\n line = reader.readLine(); \n // How many polygons (if this is > 1, the first poly is the real one, and\n // all others are hole-polys that are subtracted):\n if (line.startsWith(\" poly count=\") == false) {\n throw new AssertionError();\n }\n int polyCount = Integer.parseInt(line.substring(13));\n List<Polygon> polyPlusHoles = new ArrayList<>();\n for(int j=0;j<polyCount;j++) {\n line = reader.readLine(); \n if (line.startsWith(\" vertex count=\") == false) {\n System.out.println(\"GOT: \" + line);\n throw new AssertionError();\n }\n \n int vertexCount = Integer.parseInt(line.substring(17));\n double[] lats = new double[vertexCount];\n double[] lons = new double[vertexCount];\n line = reader.readLine(); \n if (line.startsWith(\" lats \") == false) {\n throw new AssertionError();\n }\n String[] parts = line.substring(11).split(\" \");\n if (parts.length != vertexCount) {\n throw new AssertionError();\n }\n for(int k=0;k<vertexCount;k++) {\n lats[k] = Double.parseDouble(parts[k]);\n }\n \n line = reader.readLine(); \n if (line.startsWith(\" lons \") == false) {\n throw new AssertionError();\n }\n parts = line.substring(11).split(\" \");\n if (parts.length != vertexCount) {\n throw new AssertionError();\n }\n for(int k=0;k<vertexCount;k++) {\n lons[k] = Double.parseDouble(parts[k]);\n }\n polyPlusHoles.add(new Polygon(lats, lons));\n }\n Polygon firstPoly = polyPlusHoles.get(0);\n Polygon[] holes = polyPlusHoles.subList(1, polyPlusHoles.size()).toArray(new Polygon[polyPlusHoles.size()-1]);\n polys.add(new Polygon(firstPoly.getPolyLats(), firstPoly.getPolyLons(), holes));\n }\n Query q;\n if (useLatLonPoint) {\n q = LatLonPoint.newPolygonQuery(\"point\", polys.toArray(new Polygon[polys.size()]));\n } else if (useGeoPoint) {\n q = new GeoPointInPolygonQuery(\"point\", polys.toArray(new Polygon[polys.size()]));\n } else {\n throw new AssertionError();\n }\n result.add(q);\n }\n\n return result;\n }", "private static void removeNonIntersections(int PegsCount){\n\t\tint correctColor = 0;\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tcorrectColor = 0;\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tArrayList <Peg> victimTemp = new ArrayList<Peg>(victim);\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\tif(victimTemp.contains(aiGuess.get(i))){\n\t\t\t\t\tvictimTemp.remove(aiGuess.get(i));\n\t\t\t\t\tcorrectColor+=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(correctColor<PegsCount){\n\t\t\t\titr.remove();\n\t\t\t}\n\t\t}\n\t}", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "private List<Polygon2D> getDistrictsInRing(List<Voter> voters, Point2D innerVertex, Point2D outerVertex, int repPerDistrict, int party) {\n \t\tList<Polygon2D> results = new ArrayList<Polygon2D>();\n \t\tdouble step = 0.1;\n \t\tint dist_num = repPerDistrict == 3 ? 20 : 22;\n \t\tPolygon2D outerTri = getTriByVertex(outerVertex);\n \t\tPolygon2D innerTri = getTriByVertex(innerVertex);\n \t\tPoint2D currIn = innerVertex;\n \t\tPoint2D currOut = outerVertex;\n \t\tdouble lenRate = (outerVertex.getY()/2 - 250 * Math.sqrt(3) / 3) / (innerVertex.getY()/2 - 250 * Math.sqrt(3) / 3);\n \t\tint total_population = Run.countInclusion(voters, outerTri) - Run.countInclusion(voters, innerTri);\n \t\tboolean gmable = true;\n \t\tdouble popRate = 0;\n \t\tfor(int i = 0; i < 3; i++) {\n \t\t\tSystem.out.println(\"Edge: \" + Integer.toString(i));\n\t \t\twhile(results.size() < dist_num-1) {\n\t \t\t\tSystem.out.println(gmable);\n\t \t\t\tPolygon2D p;\n\t \t\t\tif(i == 1)\n\t \t\t\t\tp = findDist(currIn, currOut, innerTri.getPoints().get(i), innerTri.getPoints().get((i+1)%3),\n\t \t\t\t\t\touterTri.getPoints().get(i), outerTri.getPoints().get((i+1)%3), step, lenRate, voters, true, repPerDistrict, party, gmable, popRate);\n\t \t\t\telse\n\t \t\t\t\tp = findDist(currIn, currOut, innerTri.getPoints().get(i), innerTri.getPoints().get((i+1)%3),\n\t\t \t\t\t\t\touterTri.getPoints().get(i), outerTri.getPoints().get((i+1)%3), step, lenRate, voters, false, repPerDistrict, party, gmable, popRate);\n\t \t\t\tif(p == null) {\n\t \t\t\t\tif(i == 0) {\n\t \t\t\t\t\tSystem.out.println(\"1111\");\n\t \t\t\t\t\tp = findDistAtCorner(currIn, currOut, innerTri.getPoints().get(1), innerTri.getPoints().get(2),\n\t \t\t\t\t\t\touterTri.getPoints().get(1), outerTri.getPoints().get(2), step, lenRate, voters, true, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\tif(p == null) {\n\t \t\t\t\t\t\tSystem.out.println(\"3333\");\n\t \t\t\t\t\t\tp = findDistAtTwoCorners(currIn, currOut, innerTri.getPoints().get(1), innerTri.getPoints().get(2), innerTri.getPoints().get(0),\n\t \t\t\t\t\t\touterTri.getPoints().get(1), outerTri.getPoints().get(2), outerTri.getPoints().get(0), step, lenRate, voters, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\t\t i++;\n\t \t\t\t\t\t}\n\t \t\t\t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t \t \t\t\t\tresults.add(p);\n\t \t \t\t\t\tif(gmable) {\n\t \t \t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n\t \t \t\t\t\t\tif(!gmable)\n\t \t \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t \t \t\t\t\t}\n\t \t\t\t\t\tcurrIn = p.getPoints().get(p.getPoints().size()-1);\n\t\t \t \t\t\tcurrOut = p.getPoints().get(p.getPoints().size()-2);\n\t\t \t \t\t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t \t\t\t\t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t\telse if(i == 1) {\n\t \t\t\t\t\tSystem.out.println(\"2222\");\n\t \t\t\t\t\tp = findDistAtCorner(currIn, currOut, innerTri.getPoints().get(2), innerTri.getPoints().get(0),\n\t\t \t\t\t\t\t\touterTri.getPoints().get(2), outerTri.getPoints().get(0), step, lenRate, voters, false, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\tSystem.out.println(Run.countInclusion(voters, p));\n\t \t\t\t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t\t \t\t\t\tresults.add(p);\n\t\t \t\t\t\tif(gmable) {\n \t \t\t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n \t \t\t\t\t\t\tif(!gmable)\n\t \t \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t\t \t\t\t\t}\n\t\t\t\t \t\tcurrIn = p.getPoints().get(5);\n\t\t\t\t \t\tcurrOut = p.getPoints().get(4);\n\t\t\t\t \t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t\t\t\t \t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t}\n \t\t\t\tcurrIn = p.getPoints().get(p.getPoints().size()-1);\n\t \t\t\tcurrOut = p.getPoints().get(p.getPoints().size()-2);\n\t \t\t\tSystem.out.println(Run.countInclusion(voters, p));\n\t \t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t \t\t\tresults.add(p);\n\t \t\t\tif(gmable) {\n\t\t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n\t\t\t\t\t\tif(!gmable)\n \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t\t\t\t}\n\t \t\t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t \t\t}\n \t\t}\n \t\t// We do not check population in the last polygon of a ring now. It should be a limitation for gerrymandering\n \t\tPolygon2D p = new Polygon2D();\n \t\tp.append(currIn);\n \t\tp.append(currOut);\n \t\tif(currIn.getX() > 500 && currIn.getY() > innerTri.getPoints().get(1).getY()) {\n \t\t\tp.append(outerTri.getPoints().get(1));\n \t\t\tp.append(outerTri.getPoints().get(2));\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\t\tp.append(innerTri.getPoints().get(0));\n \t\t\tp.append(innerTri.getPoints().get(2));\n \t\t\tp.append(innerTri.getPoints().get(1));\n \t\t}\n \t\telse if(currIn.getY() == innerTri.getPoints().get(1).getY()) {\n \t\t\tp.append(outerTri.getPoints().get(2));\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(2));\n \t\t}\n \t\telse {\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(0));\n \t\t}\n \t\tresults.add(p);\n \t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n \t\treturn results;\n }", "@Override\n\tpublic boolean collidesWithPolygon(Polygon polygon) {\n\t\treturn false;\n\t}", "private LineSegment[] findSegments() {\n List<LineSegment> segmentList = new ArrayList<>();\n int N = points.length;\n for (int i = 0; i < N; i++) {\n for (int j = i+1; j < N; j++) {\n Double slopePQ = points[i].slopeTo(points[j]);\n for (int k = j+1; k < N; k++) {\n Double slopePR = points[i].slopeTo(points[k]);\n if (slopePQ.equals(slopePR)) {\n for (int l = k + 1; l < N; l++) {\n Double slopePS = points[i].slopeTo(points[l]);\n if (slopePQ.equals(slopePS)) {\n LineSegment lineSegment = new LineSegment(points[i], points[l]);\n segmentList.add(lineSegment);\n }\n }\n }\n }\n }\n }\n return segmentList.toArray(new LineSegment[segmentList.size()]);\n }", "public void reinitiallizeDistanceFunctionOutside() {\n\t\tint i, j;\r\n\t\tfor (i = 0; i < _levelSet.length; i++) {\r\n\t\t\tfor (j = 0; j < _levelSet[i].length; j++) {\r\n\t\t\t\tint iPlus = imposeBorder(i + 1, _iSize);\r\n\t\t\t\tint iMinus = imposeBorder(i - 1, _iSize);\r\n\t\t\t\tint jPlus = imposeBorder(j + 1, _iSize);\r\n\t\t\t\tint jMinus = imposeBorder(j - 1, _iSize);\r\n\t\t\t\tif (_levelSet[i][j] > 0) // // the check for points in region\r\n\t\t\t\t\t// // the check for points in border\r\n\t\t\t\t\tif (MatrixMath.anyNeighborIsInside(_levelSet, i, j, iPlus,\r\n\t\t\t\t\t\t\tiMinus, jPlus, jMinus)) {\r\n\t\t\t\t\t\t// points in border are placed in narrowband\r\n\t\t\t\t\t\t_narrowBandOutside.add(new Location(i, j,\r\n\t\t\t\t\t\t\t\t_levelSet[i][j]));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// and location in distance matrix is set to infinite\r\n\t\t\t\t\t\t_levelSet[i][j] = Double.POSITIVE_INFINITY;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// iterate until narrow band is empty\r\n\t\t// OrderByLevelSetValue comparator = new OrderByLevelSetValue();\r\n\t\t// int lixo = 0;\r\n\t\twhile (_narrowBandOutside.size() > 0) {\r\n\t\t\t// if (lixo++ > 5000) {\r\n\t\t\t// System.out.println(\"done \" + lixo);\r\n\t\t\t// break;\r\n\t\t\t// }\r\n\t\t\t// get the minimum value\r\n\t\t\tLocation minVal = _narrowBandOutside.first();\r\n\t\t\t// get the neighbors that are still in _faraway\r\n\t\t\tint iPlus = imposeBorder(minVal.i + 1, _iSize);\r\n\t\t\tint iMinus = imposeBorder(minVal.i - 1, _iSize);\r\n\t\t\tint jPlus = imposeBorder(minVal.j + 1, _iSize);\r\n\t\t\tint jMinus = imposeBorder(minVal.j - 1, _iSize);\r\n\t\t\ttransferNeighborOutside(iPlus, minVal.j);\r\n\t\t\ttransferNeighborOutside(iMinus, minVal.j);\r\n\t\t\ttransferNeighborOutside(minVal.i, jPlus);\r\n\t\t\ttransferNeighborOutside(minVal.i, jMinus);\r\n\t\t\t// remove the value from the narrowband\r\n\t\t\t_narrowBandOutside.remove(minVal);\r\n\t\t}\r\n\t\t// done\r\n\t}", "ArrayList<TTC> generateSegments() {\n if ((START_STATION instanceof Station) && (endStation instanceof Station)) {\n ArrayList<TTC> route = TTC.SUBWAY_LIST.get(NUMBER);\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n } else {\n ArrayList<TTC> route = TTC.BUS_MAP.get((START_STATION).getNUMBER());\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n }\n }", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "public LinkedList<Point> segmentsToDraw() {\n LinkedList<Point> segmentCoordinates = new LinkedList<Point>();\n for (int segment = 1; segment <= snakeSize; segment++) {\n //search array for each segment number\n for (int x = 0; x < maxX; x++) {\n for (int y = 0; y < maxY; y++) {\n if (snakeSquares[x][y] == segment) {\n //make a Point for this segment's coordinates and add to list\n Point p = new Point(x * SnakeGame.getSquareSize(), y * SnakeGame.getSquareSize());\n segmentCoordinates.add(p);\n }\n }\n }\n }\n return segmentCoordinates;\n\n }", "public boolean areDisjoint() {\n return !geometry.almostZero(distance);\n }", "@Override\n public void resetMap(){\n segmentList=new ArrayList<>();\n intersectionList=new ArrayList<>();\n this.setChanged();\n this.notifyObservers();\n }", "public ArrayList<Triangle> getOccluderVertexData();", "private int checkIntersections(ArrayList<Segment> segments){\n\t\tint numberOfIntersections = 0;\n\t\tfor (Segment s: segments){\n\t\t\tSegment firstSegment = s;\n\t\t\tfor (Segment t: segments){\n\t\t\t\tSegment secondSegment = t;\n\t\t\t\tif (!(firstSegment.equals(secondSegment))){\n\t\t\t\t\tif (!this.checkSharedVertex(firstSegment, secondSegment)){\n\t\t\t\t\t\tif(this.isIntersected(firstSegment.w1, firstSegment.w2, secondSegment.w1, secondSegment.w2))\n\t\t\t\t\t\t\tnumberOfIntersections ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn numberOfIntersections;\n\t}", "private boolean containsShortestOddHole(Graph<V, E> g, Set<V> X)\n {\n for (V y1 : g.vertexSet()) {\n if (X.contains(y1))\n continue;\n\n for (V x1 : g.vertexSet()) {\n if (x1 == y1)\n continue;\n GraphPath<V, E> rx1y1 = getPathAvoidingX(g, x1, y1, X);\n for (V x3 : g.vertexSet()) {\n if (x3 == x1 || x3 == y1 || !g.containsEdge(x1, x3))\n continue;\n for (V x2 : g.vertexSet()) {\n if (x2 == x3 || x2 == x1 || x2 == y1 || g.containsEdge(x2, x1)\n || !g.containsEdge(x3, x2))\n continue;\n\n GraphPath<V, E> rx2y1 = getPathAvoidingX(g, x2, y1, X);\n\n double n;\n if (rx1y1 == null || rx2y1 == null)\n continue;\n\n V y2 = null;\n for (V y2Candidate : rx2y1.getVertexList()) {\n if (g.containsEdge(y1, y2Candidate) && y2Candidate != x1\n && y2Candidate != x2 && y2Candidate != x3 && y2Candidate != y1)\n {\n y2 = y2Candidate;\n break;\n }\n }\n if (y2 == null)\n continue;\n\n GraphPath<V, E> rx3y1 = getPathAvoidingX(g, x3, y1, X);\n GraphPath<V, E> rx3y2 = getPathAvoidingX(g, x3, y2, X);\n GraphPath<V, E> rx1y2 = getPathAvoidingX(g, x1, y2, X);\n if (rx3y1 != null && rx3y2 != null && rx1y2 != null\n && rx2y1.getLength() == (n = rx1y1.getLength() + 1)\n && n == rx1y2.getLength() && rx3y1.getLength() >= n\n && rx3y2.getLength() >= n)\n {\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(rx1y1.getEdgeList());\n for (int i = rx2y1.getLength() - 1; i >= 0; i--)\n edgeList.add(rx2y1.getEdgeList().get(i));\n edgeList.add(g.getEdge(x2, x3));\n edgeList.add(g.getEdge(x3, x1));\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, x1, x1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "private void resetPolygonsFlags() {\n for ( Polygon p : polygons ) {\n p.setOverlap(false);\n }\n }", "private Iterable<Segment> getCleanableSegments() {\n List<Segment> segments = new ArrayList<>();\n for (Segment segment : manager.segments()) {\n // Only allow compaction of segments that are full.\n if (segment.lastIndex() <= index() && segment.isFull()) {\n\n // Calculate the percentage of entries that have been marked for cleaning in the segment.\n double cleanPercentage = (segment.length() - segment.deleteCount()) / (double) segment.length();\n\n // If the percentage of entries marked for cleaning times the segment version meets the cleaning threshold,\n // add the segment to the segments list for cleaning.\n if (cleanPercentage * segment.descriptor().version() >= CLEAN_THRESHOLD) {\n segments.add(segment);\n }\n }\n }\n return segments;\n }", "public static Collection<Pair<Segment, Segment>> getIntersectingSegments(final PolyLine left,\n final PolyLine right)\n {\n final Collection<Pair<Segment, Segment>> intersectingSegments = new HashSet<>();\n for (final Segment leftSegment : left.segments())\n {\n for (final Segment rightSegment : right.segments())\n {\n if (leftSegment.intersects(rightSegment))\n {\n intersectingSegments.add(Pair.of(leftSegment, rightSegment));\n }\n }\n }\n return intersectingSegments;\n }", "public LineSegment[] segments(){\n\t\tPoint[] ptArr = new Point[numpoints];\n\t\tfor(int i =0; i < numpoints; i++){\n\t\t\tfor(int j =0; j < numpoints;j++) ptArr[j] = mypoints[j];\n\t\t\tPoint origin = mypoints[i];\t\t\n\t\t\t//Sort the points using mergeSort for doubles\n\t\t\tArrays.sort(ptArr,origin.slopeOrder());\t\n\t\t\tfindAllCollinearPts(ptArr,origin);\n\t\t}\n\t\treturn getSegments();\n\t}", "public Collection<IntPair> findEmptyNeighbors(int x, int y);", "boolean ignoreExistingVertices();", "public static void smoothContour(List<PointIndex_I32> v, int minLength) {\n if(v.size() > 0){\n //if the distance between any two sequential points is < minLength, remove that point\n for (int i = v.size() - 2; i >= 0; i--) {\n if (v.get(i).distance(v.get(i + 1)) < minLength) {\n v.remove(i + 1);\n }\n }\n //test the distance between the last point and the first\n if (v.get(v.size() - 1).distance(v.get(0)) < minLength) {\n v.remove(v.size() - 1);\n }\n }\n }", "private TreeSet<BisectDistInfo> findSegmentsBySlack( int index, int slack, Coordinate[] polyIn ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\n\t\t//Convert to grid coordinate.\n\t\tCoordinate[] poly = PgenUtil.latlonToGrid( polyIn );\n\t\t\t\t\n\t /*\n\t * Find the index of ending points to form a splitting segment - \n\t * from \"index + np/2 - slack\" to \"index + np/2 + slack\"\n\t */ \n\t int npts = poly.length;\n\t int mid = npts / 2;\n\t int nseg = 2 * slack + 1;\n\t \n\t ArrayList<Integer> pointsToCheck = new ArrayList<Integer>();\n\t for ( int ii = 0; ii < nseg; ii++ ) {\n\t \tpointsToCheck.add( ( ii - slack + index + mid + npts ) % npts );\n\t }\n\t\t\n\t /*\n\t * Find out segments that does not intersect other segments of the\n\t * polygon and has a length greater than the clustering distance.\n\t */\t \n\t Coordinate[] seg = new Coordinate[2];\n\t seg[0] = poly[ index ];\n\t \t\n\t boolean qualify;\n for ( Integer jj : pointsToCheck ) {\n\t\t \n \t//Sanity check\n \tif( jj >= poly.length ) continue;\n \t\n \tseg[1] = poly[jj]; \n\t\t \n\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\tif ( qualify ) {\n\t\t\t\tdouble dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\tif ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\tdistInfo.add( new BisectDistInfo( dist, index, jj ) );\n\t\t\t\t}\n\t\t\t}\t\t\t\n }\n\t\t\n\t\treturn distInfo;\n\t\t\n\t}", "public void clearCentroids();", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private List<InternalConstraint> genInternalCtrsForNonOverlapping(NonOverlapping ectr, GeostObject o) {\n List<InternalConstraint> ictrs = new ArrayList<InternalConstraint>();\n List<ShiftedBox> sb = stp.getShape(o.getShapeId().getLB());\n Iterator<Integer> itr;\n itr = ectr.getFrame().getRelForbidRegions().keySet().iterator();\n boolean printit = false;\n while (itr.hasNext()) {\n int i = itr.next();\n if (!(o.getObjectId() == i)) {\n for (int k = 0; k < sb.size(); k++) {\n // We will generate an outbox constraint corresponding to each relative forbidden region we already generated\n // for the shifted boxes of the shape corresponding to the Obj o\n\n // here we go into the relative forbidden regions\n loop:\n for (int l = 0; l < ectr.getFrame().getRelForbidRegions(i).size(); l++) {\n int[] t = new int[cst.getDIM()];\n int[] s = new int[cst.getDIM()];\n for (int j = 0; j < cst.getDIM(); j++) {\n int min = ectr.getFrame().getRelForbidRegions(i).get(l).getMinimumBoundary(j) - sb.get(k).getOffset(j) - sb.get(k).getSize(j);\n int max = ectr.getFrame().getRelForbidRegions(i).get(l).getMaximumBoundary(j) - sb.get(k).getOffset(j);\n\n s[j] = max - min + 1; // length of the jth coordinate\n if (s[j] <= 0) // since the length is negative\n continue loop;\n t[j] = min; // It is the offset. lower left corner.\n\n if (printit) System.out.println(o.getObjectId() + \" \" + j + \" \" + o);\n int supDom = o.getCoord(j).getUB();// + sb.get(k).getOffset(j) + sb.get(k).getSize(j);\n int infDom = o.getCoord(j).getLB();// + sb.get(k).getOffset(j) ;\n int maxObj = o.getCoord(j).getUB() + sb.get(k).getOffset(j) + sb.get(k).getSize(j) - 1;\n if (maxObj > o.getCoord(j).getUB()) maxObj = o.getCoord(j).getUB();\n int minObj = o.getCoord(j).getLB() + sb.get(k).getOffset(j);\n if (minObj < o.getCoord(j).getLB()) minObj = o.getCoord(j).getLB();\n\n if (printit) System.out.println(\"box: \" + t[j] + \" \" + s[j]);\n if (printit) System.out.println(\"dom: \" + minObj + \" \" + maxObj);\n\n\n if ((supDom < t[j]) || (infDom > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip\");\n continue loop;\n }\n if ((maxObj < t[j]) || (minObj > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip2\");\n continue loop;\n }\n\n //clipping\n if (stp.opt.clipping) {\n // t[j] = Math.max(minObj, t[j]);\n // s[j] = Math.min(maxObj, t[j] + s[j]) - t[j] ;\n }\n\n if (printit) System.out.println(\"result box: \" + t[j] + \" \" + s[j]);\n\n\n }\n\n Outbox new_ob = new Outbox(t, s);\n\n\n Pair<Outbox, Boolean> result;\n if (ictrs.size() != 0) {\n Outbox last_ob = (Outbox) ictrs.get(ictrs.size() - 1);\n result = mergeAdjacent(new_ob, last_ob);\n\n new_ob = result.fst;\n\n if (result.snd) ictrs.remove(ictrs.size() - 1);\n\n }\n\n ictrs.add(new_ob);\n }\n }\n }\n }\n return ictrs;\n }", "private ArrayList<Integer> pruneIllegals(ArrayList<Integer> cm,\n ArrayList<Integer> config) {\n //Remove out of bound spots\n for (int i = 0; i < cm.size(); i++) {\n if(cm.get(i) < 0) {\n cm.remove(i);\n i--;\n } else if (cm.get(i) >= config.size()) {\n cm.remove(i);\n i--;\n }\n }\n //Remove points that have no person there\n boolean occupied;\n for (int i = 0; i < cm.size(); i++) {\n if (config.get(cm.get(i)) == '.') {\n cm.remove(i);\n i--;\n }\n }\n\n return cm;\n }", "public void convexHull(int n) {\n // There must be at least 3 points\n if (n < 3) return;\n\n // Initialize Result\n Vector<Marker> hull = new Vector<>();\n\n // Find the leftmost point\n int l = 0;\n for (int i = 1; i < n; i++)\n if (markers.get(i).getPosition().longitude < markers.get(l).getPosition().longitude)\n l = i;\n\n // Start from leftmost point, keep moving\n // counterclockwise until reach the start point\n // again. This loop runs O(h) times where h is\n // number of points in result or output.\n int p = l, q;\n do {\n // Add current point to result\n hull.add(markers.get(p));\n\n // Search for a point 'q' such that\n // orientation(p, x, q) is counterclockwise\n // for all points 'x'. The idea is to keep\n // track of last visited most counterclock-\n // wise point in q. If any point 'i' is more\n // counterclock-wise than q, then update q.\n q = (p + 1) % n;\n\n for (int i = 0; i < n; i++) {\n // If i is more counterclockwise than\n // current q, then update q\n if (orientation(p, i, q)\n == 2)\n q = i;\n }\n\n // Now q is the most counterclockwise with\n // respect to p. Set p as q for next iteration,\n // so that q is added to result 'hull'\n p = q;\n\n } while (p != l); // While we don't come to first\n\n drawer = new ArrayList<>(hull);\n }", "public void eraseLines() {\n for (int i = 0; i < segments.size() - 1; i++) {\n paintLine((Point2D) (segments.elementAt(i)),\n (Point2D) (segments.elementAt(i + 1)));\n }\n }", "public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }", "public void removeInvalidPoints() {\n\t\tfor (Iterator<GPoint> it = points.iterator(); it.hasNext();) {\n\t\t\tif (!it.next().isValid()) {\n\t\t\t\tit.remove();\n\t\t\t}\n\t\t}\n\t}", "public static ArrayList<GeoCoordinates> removeUnnecessaryBranches(ArrayList<GeoCoordinates> originalRoute) {\n\n GeoCoordinates zeroCoord = new GeoCoordinates(0d, 0d);\n\n for (GeoCoordinates coord : originalRoute) {\n if (coord.equals(zeroCoord)) {\n continue;\n }\n int first = originalRoute.indexOf(coord);\n int last = originalRoute.lastIndexOf(coord);\n\n if (first != last) {\n for (int i = first; i < last; i++) {\n originalRoute.set(i, zeroCoord);\n }\n }\n }\n\n ArrayList<GeoCoordinates> resultRoute = new ArrayList<>();\n int numDeleted = 0;\n\n for (GeoCoordinates coord : originalRoute) {\n if (!coord.equals(zeroCoord)) {\n resultRoute.add(coord);\n } else {\n numDeleted++;\n }\n }\n\n log.info(\"Delete unnecessary branches: \" + numDeleted);\n return resultRoute;\n }", "List<Long> getBestSolIntersection();", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2127L, 2127L);\n List<Range> list0 = range0.split(1L);\n List<Range> list1 = range0.complementFrom(list0);\n assertFalse(list1.isEmpty());\n \n range0.getBegin(range_CoordinateSystem0);\n range0.equals(range_CoordinateSystem0);\n long long0 = range0.getBegin(range_CoordinateSystem0);\n assertTrue(range0.isEmpty());\n assertEquals(2127L, long0);\n }", "public int infectNeighbours(Map map);", "private ArrayList<Integer> getOutsideFaceIndicesBeforeAllInfoHasBeenInferred()\n\t{\n\t\t// go through all the simplices and count how often each face is referenced;\n\t\t// inside faces are referenced twice, outside faces once\n\t\t\n\t\t// set up an array that will contain the reference counts for each face\n\t\tint[] faceRefs = new int[faces.size()];\n\t\tfor(int i=0; i<faceRefs.length; i++) faceRefs[i] = 0;\n\t\t\n\t\t// now go through all the simplices...\n\t\tfor(Simplex simplex : simplices)\n\t\t{\n\t\t\t// ... and increase the reference count of all the faces in the simplex\n\t\t\tint[] simplexFaceIndices = simplex.getFaceIndices();\t// should be of length 4\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t{\n\t\t\t\t// increase the reference count of the <i>th face of the simplex\n\t\t\t\tfaceRefs[simplexFaceIndices[i]]++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now collect the indices of all faces that are referenced only once, i.e. the outside faces\n\t\tArrayList<Integer> outsideFaceIndices = new ArrayList<Integer>();\n\t\tfor(int i=0; i<faceRefs.length; i++)\n\t\t\t// is there exactly one reference to the face with index i?\n\t\t\tif(faceRefs[i] == 1)\n\t\t\t\t// yes; add i to the list of outside-face indices\n\t\t\t\toutsideFaceIndices.add(i);\n\t\t\n\t\t// return the list of outside-face indices\n\t\treturn outsideFaceIndices;\n\t}", "private Set<String> findEmptyCluster(Map<double[], Set<String>> restaurantClusters) {\n for (Set<String> cluster : restaurantClusters.values()) {\n if (cluster.isEmpty()) {\n return cluster;\n }\n }\n return null;\n }", "Student findWithoutSectionsBy(int studentNumber);", "public Set<Coordinate> getAllSurroundingCellsAsCoordinates() {\n Set<MapCoordinate> mapCoordinates = getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(1);\n return mapCoordinates\n .stream()\n .map(mapCoordinate -> mapCoordinate.toCoordinate())\n .collect(\n Collectors.toSet()\n );\n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public void reinitiallizeDistanceFunctionInside() {\n\t\tint i, j;\r\n\t\tfor (i = 0; i < _levelSet.length; i++) {\r\n\t\t\tfor (j = 0; j < _levelSet[i].length; j++) {\r\n\t\t\t\tint iPlus = imposeBorder(i + 1, _iSize);\r\n\t\t\t\tint iMinus = imposeBorder(i - 1, _iSize);\r\n\t\t\t\tint jPlus = imposeBorder(j + 1, _iSize);\r\n\t\t\t\tint jMinus = imposeBorder(j - 1, _iSize);\r\n\t\t\t\tif (_levelSet[i][j] <= 0) // // the check for points in region\r\n\t\t\t\t\t// // the check for points in border\r\n\t\t\t\t\tif (MatrixMath.anyNeighborIsOutside(_levelSet, i, j, iPlus,\r\n\t\t\t\t\t\t\tiMinus, jPlus, jMinus)) {\r\n\t\t\t\t\t\t// points in border are placed in narrowband\r\n\t\t\t\t\t\t// _narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t\t_narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// and location in distance matrix is set to infinite\r\n\t\t\t\t\t\t_levelSet[i][j] = Double.NEGATIVE_INFINITY;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// iterate until narrow band is empty\r\n\t\t// OrderByLevelSetValue comparator = new OrderByLevelSetValue();\r\n\t\t// while (_narrowBandInside.size() > 0) {\r\n\t\twhile (_narrowBandInside.size() > 0) {\r\n\t\t\t// get the maximum value\r\n\t\t\t// Location maxVal = _narrowBandInside.last();\r\n\t\t\tLocation maxVal = _narrowBandInside.last();\r\n\t\t\t// System.out.println(\"maxVal \" + maxVal);\r\n\t\t\t// System.out.println(\"_narrowBandInside.contains(maxVal) \"\r\n\t\t\t// + _narrowBandInside.contains(maxVal));\r\n\t\t\t// System.out.println(\"maxVal.compareTo(maxVal) \"\r\n\t\t\t// + maxVal.compareTo(maxVal));\r\n\r\n\t\t\t// get the neighbors that are still in _faraway\r\n\t\t\tint iPlus = imposeBorder(maxVal.i + 1, _iSize);\r\n\t\t\tint iMinus = imposeBorder(maxVal.i - 1, _iSize);\r\n\t\t\tint jPlus = imposeBorder(maxVal.j + 1, _iSize);\r\n\t\t\tint jMinus = imposeBorder(maxVal.j - 1, _iSize);\r\n\t\t\ttransferNeighborInside(iPlus, maxVal.j);\r\n\t\t\ttransferNeighborInside(iMinus, maxVal.j);\r\n\t\t\ttransferNeighborInside(maxVal.i, jPlus);\r\n\t\t\ttransferNeighborInside(maxVal.i, jMinus);\r\n\t\t\t// remove the value from the narrowband\r\n\t\t\t// _narrowBandInside.remove(maxVal);\r\n\t\t\t_narrowBandInside.remove(maxVal);\r\n\t\t}\r\n\t\t// done\r\n\t}", "private void disableIfDissatisfied() {\n \t\tif ( !this.satisfiesPolygon() ) {\n \t\t\tthis.area.setEnabled( false );\n \t\t}\n \t}", "public void removeGraphCycles() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tint[] cycleCount = new int[map.size()];\r\n\t\tforComplexMotion = new boolean[map.size()];\r\n\t\t//count cycles\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(i != j) {\r\n\t\t\t\t\tif(graph[i][j] && graph[j][i]) {\r\n\t\t\t\t\t\tcycleCount[i]++;\r\n\t\t\t\t\t\tcycleCount[j]++;\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//remove fobjects from linear motion planning\r\n\t\tboolean hasCycles = true;\r\n\t\twhile(hasCycles) {\r\n\t\t\tint max = 0;\r\n\t\t\tint maxIndex = -1;\r\n\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\tif(cycleCount[i] > max) {\r\n\t\t\t\t\tmax = cycleCount[i];\r\n\t\t\t\t\tmaxIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(maxIndex == -1) {\r\n\t\t\t\thasCycles = false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcycleCount[maxIndex] = 0;\r\n\t\t\t\tforComplexMotion[maxIndex] = true;\r\n\t\t\t\tfor(int i = 0; i < cycleCount.length; i++) {\r\n\t\t\t\t\tgraph[maxIndex][i] = false;\r\n\t\t\t\t\tgraph[i][maxIndex] = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private Set<Long> removeSomeBlocks(Map<BlockStoreLocation, List<Long>> blockMap) {\n Set<Long> toRemove = new HashSet<>();\n // 1 block goes missing from each location\n for (Map.Entry<BlockStoreLocation, List<Long>> entry : blockMap.entrySet()) {\n List<Long> blocks = entry.getValue();\n if (blocks.isEmpty()) {\n continue;\n }\n toRemove.add(blocks.get(0));\n blocks.remove(0);\n }\n return toRemove;\n }", "void removeContactMeans(int i);", "public int numDistinctIslands(int[][] grid){\n if(grid == null || grid.length == 0)\n return 0;\n Set<String> set = new HashSet<>();\n int row = grid.length, col = grid[0].length;\n for(int i = 0; i < row; i++){\n for(int j = 0; j < col; j++){\n if(grid[i][j] == 1){\n String path = dfs(grid, i, j, row, col, \"S\");\n set.add(path);\n }\n }\n }\n return set.size();\n }", "public List<Triangle2D> tesselatePolygon(Polygon2D poly);", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "public List<Segmentation> getSegmentations()\n\t\t\tthrows InvalidParametersException;", "@JsonProperty(PROP_NOT_FRAGMENT_OFFSETS)\n public SortedSet<SubRange> getNotFragmentOffsets() {\n return _notFragmentOffsets;\n }", "private static double[][] makeRegularPoly(double centerLat, double centerLon, double radiusMeters, int gons) {\n\n double[][] result = new double[2][];\n result[0] = new double[gons+1];\n result[1] = new double[gons+1];\n for(int i=0;i<gons;i++) {\n double angle = i*(360.0/gons);\n double x = Math.cos(Math.toRadians(angle));\n double y = Math.sin(Math.toRadians(angle));\n double factor = 2.0;\n double step = 1.0;\n int last = 0;\n\n //System.out.println(\"angle \" + angle + \" slope=\" + slope);\n // Iterate out along one spoke until we hone in on the point that's nearly exactly radiusMeters from the center:\n while (true) {\n double lat = centerLat + y * factor;\n GeoUtils.checkLatitude(lat);\n double lon = centerLon + x * factor;\n GeoUtils.checkLongitude(lon);\n double distanceMeters = SloppyMath.haversinMeters(centerLat, centerLon, lat, lon);\n\n //System.out.println(\" iter lat=\" + lat + \" lon=\" + lon + \" distance=\" + distanceMeters + \" vs \" + radiusMeters);\n if (Math.abs(distanceMeters - radiusMeters) < 0.1) {\n // Within 10 cm: close enough!\n result[0][i] = lat;\n result[1][i] = lon;\n break;\n }\n\n if (distanceMeters > radiusMeters) {\n // too big\n //System.out.println(\" smaller\");\n factor -= step;\n if (last == 1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = -1;\n } else if (distanceMeters < radiusMeters) {\n // too small\n //System.out.println(\" bigger\");\n factor += step;\n if (last == -1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = 1;\n }\n }\n }\n\n // close poly\n result[0][gons] = result[0][0];\n result[1][gons] = result[1][0];\n\n return result;\n }", "public DetectLED findSegments() {\n\t\tchains = new ArrayList<Chain>();\n\t\t// Every single line segment is a candidate to build a chain upon it\n\t\t// So let's seed the starting points for all potential chains\n\t\tfor (int i=0; i < lights.size(); i++) {\n\t\t\tfor (int j=0; j < lights.size(); j++) {\n\t\t\t\tif(i != j && lights.get(i).minus(lights.get(j)).norm() < maxSeg) {\n\t\t\t\t\t// Also seed chains for different number of nodes\n\t\t\t\t\t// maxNodes/2 is an arbitrary pick but should be good enough\n\t\t\t\t\tfor(int n = maxNodes; n > maxNodes/2; n--) {\n\t\t\t\t\t\tchains.add(new Chain(i, j, n));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}", "boolean hasSegments();", "private GeometryCollection computeGeometrySplit( \n final Geometry featureGeometryOnMapCrs,\n final Geometry clippingGeometryOnMapCrs,\n final CoordinateReferenceSystem mapCrs ) \n throws SOProcessException {\n\n try {\n // does the difference \n Geometry geoDiff = featureGeometryOnMapCrs.difference(clippingGeometryOnMapCrs);\n assert geoDiff instanceof GeometryCollection;\n \n GeometryCollection geoCollection = (GeometryCollection) geoDiff;\n\n return geoCollection;\n \n } catch (Exception e) {\n final String msg = e.getMessage();\n LOGGER.severe(msg);\n throw new SOProcessException(msg);\n }\n }", "static MaxSeparation findMaxSeparation(PolygonShape poly1, XForm xf1,\n \t\t\t\t\t\t\t\t\t PolygonShape poly2, XForm xf2) {\n MaxSeparation separation = new MaxSeparation();\n\n int count1 = poly1.m_vertexCount;\n \n // Vector pointing from the centroid of poly1 to the centroid of poly2.\n \tVec2 d = XForm.mul(xf2, poly2.m_centroid).subLocal(XForm.mul(xf1, poly1.m_centroid));\n \tVec2 dLocal1 = Mat22.mulT(xf1.R, d);\n\n \t// Find edge normal on poly1 that has the largest projection onto d.\n int edge = 0;\n float maxDot = -Float.MAX_VALUE;\n for (int i = 0; i < count1; ++i) {\n float dot = Vec2.dot(poly1.m_normals[i], dLocal1);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n\n // Get the separation for the edge normal.\n float s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f){\n separation.bestSeparation = s;\n return separation;\n }\n\n // Check the separation for the previous edge normal.\n int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;\n float sPrev = edgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n if (sPrev > 0.0f) {\n separation.bestSeparation = sPrev;\n return separation;\n }\n\n int nextEdge = edge + 1 < count1 ? edge + 1 : 0;\n float sNext = edgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n if (sNext > 0.0f){\n separation.bestSeparation = sNext;\n return separation;\n }\n\n // Find the best edge and the search direction.\n int bestEdge;\n float bestSeparation;\n int increment;\n if (sPrev > s && sPrev > sNext) {\n increment = -1;\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s){\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n } else {\n separation.bestFaceIndex = edge;\n separation.bestSeparation = s;\n return separation;\n }\n\n // Perform a local search for the best edge normal.\n while (true) {\n if (increment == -1)\n edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else\n edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;\n\n s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f) {\n separation.bestSeparation = s;\n return separation;\n }\n\n if (s > bestSeparation){\n bestEdge = edge;\n bestSeparation = s;\n } else {\n break;\n }\n }\n\n separation.bestFaceIndex = bestEdge;\n separation.bestSeparation = bestSeparation;\n\n return separation;\n }", "String getMatchingSegments(Integer pointId);", "public boolean validStopCheck(){\n return points.validPolygon();\n }", "public Set<MapCoordinate> getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(MapCoordinate topLeftMapCoordinate, int distance, Set<MapCoordinate> alreadyFound) {\n int currentX = topLeftMapCoordinate.getXAsInt();\n int currentY = topLeftMapCoordinate.getYAsInt();\n\n // first row\n int topLeftYMinusDistance = currentY - distance;\n int topLeftXMinusDistance = currentX - distance;\n\n int totalWidth = (distance + entityData.getWidthInCells() + distance) - 1;\n int totalHeight = (distance + entityData.getHeightInCells() + distance) - 1;\n\n Set<MapCoordinate> result = new HashSet<>(alreadyFound);\n\n // -1, because it is 0 based\n for (int x = 0; x <= totalWidth; x++) {\n result.add(MapCoordinate.create(topLeftXMinusDistance + x, topLeftYMinusDistance));\n }\n\n // then all 'sides' of the structure (left and right)\n // also start one row 'lower' since we do not want to calculate the top left/right twice (as we did it\n // in the above loop already)\n // totalHeight - 2 for same reason, -1 == zero based, -2 to reduce one row\n for (int y = 1; y <= (totalHeight - 1); y++) {\n int calculatedY = topLeftYMinusDistance + y;\n\n // left side\n result.add(MapCoordinate.create(topLeftXMinusDistance, calculatedY));\n\n // right side\n int rightX = topLeftXMinusDistance + totalWidth;\n result.add(MapCoordinate.create(rightX, calculatedY));\n }\n\n // bottom row\n int bottomRowY = topLeftYMinusDistance + totalHeight;\n for (int x = 0; x <= totalWidth; x++) {\n result.add(MapCoordinate.create(topLeftXMinusDistance + x, bottomRowY));\n }\n\n if (distance > 1) {\n return getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(topLeftMapCoordinate, (distance-1), result);\n }\n return result;\n }", "static boolean intersectsOppositeEdges(S2Point n) {\n // The line L intersects opposite edges of the [-1,1]x[-1,1] (u,v) square if\n // and only exactly two of the corner vertices lie on each side of L. This\n // is true exactly when ||Nu| - |Nv|| >= |Nw|. The code below evaluates this\n // expression exactly (see comments above).\n double u = Math.abs(n.x);\n double v = Math.abs(n.y);\n double w = Math.abs(n.z);\n // If w is the smallest, the following line returns an exact result.\n if (Math.abs(u - v) != w) {\n return Math.abs(u - v) >= w;\n }\n // Otherwise u - v = w exactly, or w is not the smallest value. In either\n // case the following line returns the correct result.\n return (u >= v) ? (u - w >= v) : (v - w >= u);\n }", "public final java.util.List<java.util.List<org.xms.g.maps.model.LatLng>> getHoles() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getHoles()\");\n java.util.List<java.util.List<com.huawei.hms.maps.model.LatLng>> hReturn = ((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getHoles();\n return org.xms.g.utils.Utils.mapList(hReturn, e -> org.xms.g.utils.Utils.mapList2X(e, true));\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getHoles()\");\n java.util.List<java.util.List<com.google.android.gms.maps.model.LatLng>> gReturn = ((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getHoles();\n return org.xms.g.utils.Utils.mapList(gReturn, e -> org.xms.g.utils.Utils.mapList2X(e, false));\n }\n }", "public void findIsolatedGenes(){\n\t\tHashMap isolated = new HashMap();\n\t\t//for each chromosome\n\t\tIterator it = genesSelect.keySet().iterator();\n\t\twhile (it.hasNext()){\n\t\t\tString chrom = (String)it.next();\n\t\t\tUCSCGeneLine[] chrGenesAll = (UCSCGeneLine[])genesAll.get(chrom);\n\t\t\tUCSCGeneLine[] chrGenesSelect = (UCSCGeneLine[])genesSelect.get(chrom);\n\t\t\tSystem.out.println(\"\\tTotal \"+chrom+\"\\t\"+ chrGenesSelect.length);\n\t\t\tArrayList isolatedGenes = new ArrayList();\n\t\t\t//for each gene look for intersection after expanding\n\t\t\tfor (int i=0; i< chrGenesSelect.length; i++){\n\t\t\t\t//expand size of gene\n\t\t\t\tint start = chrGenesSelect[i].getTxStart() - extension;\n\t\t\t\tint end = chrGenesSelect[i].getTxEnd() + extension;\n\t\t\t\t//scan all, allow one hit\n\t\t\t\tint hits = 0;\n\t\t\t\tfor (int j =0; j< chrGenesAll.length; j++){\n\t\t\t\t\tif (intersects (chrGenesAll[j], start, end)) {\n\t\t\t\t\t\thits++; \n\t\t\t\t\t\tif (hits >1) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//save?\n\t\t\t\tif (hits < 2){\n\t\t\t\t\tisolatedGenes.add(chrGenesSelect[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert ArrayList to array and replace in hash\n\t\t\tchrGenesSelect = new UCSCGeneLine[isolatedGenes.size()];\n\t\t\tisolatedGenes.toArray(chrGenesSelect);\n\t\t\tSystem.out.println(\"\\tIsolated \"+chrom+\"\\t\"+ chrGenesSelect.length);\n\t\t\tisolated.put(chrom, chrGenesSelect);\n\t\t}\n\t\tgenesSelect = isolated;\n\t\t//clean up\n\t\tgenesAll = null;\n\t\tSystem.gc();\n\t}", "public List<ga_Triangle2D> tesselatePolygon(ga_Polygon poly);", "public List<InternalConstraint> getForbiddenRegions(GeostObject o) {\n List<ExternalConstraint> ectrs = stp.getConstraints();\n for (int i = 0; i < ectrs.size(); i++) {\n ectrs.get(i).setFrame(externalLayer.InitFrameExternalConstraint(ectrs.get(i), oIDs));\n }\n\n //TODO: Holes should be generated here\n\n for (int i = 0; i < o.getRelatedExternalConstraints().size(); i++) {\n List<InternalConstraint> v = externalLayer.genInternalCtrs(o.getRelatedExternalConstraints().get(i), o);\n for (int j = 0; j < v.size(); j++) {\n o.addRelatedInternalConstraint(v.get(j));\n }\n }\n\n return o.getRelatedInternalConstraints();\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), 1146L);\n long long0 = range0.getBegin();\n assertEquals((-2147483648L), long0);\n \n Range range1 = Range.of(1146L);\n range1.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range1.forEach(consumer0);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n List<Range> list0 = range1.complementFrom(linkedList0);\n range0.complementFrom(list0);\n Range range2 = Range.ofLength(1146L);\n Range range3 = range2.intersection(range1);\n assertTrue(range3.isEmpty());\n \n long long1 = range1.getEnd();\n assertEquals(1146L, long1);\n \n boolean boolean0 = range0.intersects(range2);\n assertTrue(boolean0);\n \n range1.equals(range2);\n Range.of(2641L);\n List<Range> list1 = range0.complement(range2);\n assertEquals(1, list1.size());\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "IList<Edge> getWalls(ArrayList<ArrayList<Vertex>> v, ArrayList<Edge> all) {\n IList<Edge> finalEdges = new Empty<Edge>();\n for (Edge e : all) {\n boolean valid = true;\n for (ArrayList<Vertex> l : v) {\n for (Vertex vt : l) {\n for (Edge e2 : vt.outEdges) {\n if (e.equals(e2) || (e.to == e2.from && e.from == e2.to)) {\n valid = false;\n }\n }\n }\n }\n if (valid) {\n finalEdges = finalEdges.add(e);\n }\n }\n return finalEdges;\n }", "public static ArrayList<Set<String>> getConnectedComponentsInDistrict(\n District district,\n HashMap<String, PrecinctNeighborRelation> precinctNeighborRelationMap) {\n // ( precinctGeoId : PrecinctNeighborRelation } pair in precinctNeighborRelationMap\n\n // first, build from -> to_list hash map\n HashMap<String, ArrayList<String>> fromToList = new HashMap<>();\n for(PrecinctNeighborRelation pnr : precinctNeighborRelationMap.values()) {\n ArrayList<NeighborData> ndList = pnr.getNeighborDataList();\n ArrayList<String> toGeoidList = new ArrayList<>();\n for(NeighborData nd : ndList)\n toGeoidList.add(nd.getToGeoId());\n fromToList.put(pnr.getFromGeoId(), toGeoidList);\n }\n\n Set<Precinct> precinctsOfDistrict = district.getPrecincts();\n\n ArrayList<String> pgeoidsOfDistrict = new ArrayList<>();\n ArrayList<Set<String>> connectedComponentList = new ArrayList<>();\n HashMap<String, Set<String>> referenceToItsSet = new HashMap<>();\n\n for(Precinct p : precinctsOfDistrict) {\n Set<String> connectedComponent = new HashSet<>();\n connectedComponent.add(p.getGeoId());\n connectedComponentList.add(connectedComponent);\n referenceToItsSet.put(p.getGeoId(), connectedComponent);\n pgeoidsOfDistrict.add(p.getGeoId());\n }\n\n for(Precinct p : precinctsOfDistrict) {\n ArrayList<String> toGeoidList = fromToList.get(p.getGeoId());\n Set<String> itsSet = referenceToItsSet.get(p.getGeoId());\n for(String neighborGeoid : toGeoidList) {\n // if the neighbor is in same district\n // if itsSet not yet contains the neighbor\n if(pgeoidsOfDistrict.contains(neighborGeoid)\n && !itsSet.contains(neighborGeoid)) {\n // neighbors set will be removed from the memory\n Set<String> neighborsSet = referenceToItsSet.get(neighborGeoid);\n for(String elementFromNeighborSet : neighborsSet) {\n referenceToItsSet.put(elementFromNeighborSet, itsSet);\n itsSet.add(elementFromNeighborSet);\n }\n connectedComponentList.remove(neighborsSet);\n }\n }\n }\n\n // stubbed\n// Set<Precinct> oneset = new HashSet<>();\n// ArrayList<Set<Precinct>> listSizeOne = new ArrayList<>();\n// listSizeOne.add(oneset);\n if(connectedComponentList.size() > 1) {\n //System.out.println(\"District: \" + district.getGeoId() + \" has \" + connectedComponentList.size() + \" components\");\n }\n return connectedComponentList;\n }", "static boolean isInside(Point polygon[], int n, Point p)\n {\n // There must be at least 3 vertices in polygon[]\n if (n < 3)\n {\n return false;\n }\n\n // Create a point for line segment from p to infinite\n Point extreme = new Point(10000, p.getY());\n\n // Count intersections of the above line\n // with sides of polygon\n int count = 0, i = 0;\n do\n {\n int next = (i + 1) % n;\n\n // Check if the line segment from 'p' to\n // 'extreme' intersects with the line\n // segment from 'polygon[i]' to 'polygon[next]'\n if (doIntersect(polygon[i], polygon[next], p, extreme))\n {\n // If the point 'p' is colinear with line\n // segment 'i-next', then check if it lies\n // on segment. If it lies, return true, otherwise false\n if (orientation(polygon[i], p, polygon[next]) == 0)\n {\n return onSegment(polygon[i], p,\n polygon[next]);\n }\n\n count++;\n }\n i = next;\n } while (i != 0);\n\n // Return true if count is odd, false otherwise\n return (count % 2 == 1); // Same as (count%2 == 1)\n }", "public List<Point2D> getConcentricTriangleTips(List <Voter> voters, int repPerDistrict)\n {\n numVoters = voters.size();\n\n int numTriangles;\n if (repPerDistrict == 1)\n numTriangles = 12;\n else if (repPerDistrict == 3)\n numTriangles = 5;\n else\n return null;\n\n List<Point2D> triTips = new ArrayList<Point2D>();\n List<Polygon2D> triangles = new ArrayList<Polygon2D>();\n final double centerX = 500;\n final double centerY = 500*Math.tan(Math.PI/6);\n final double cos30 = Math.cos(Math.PI/6);\n final double sin30 = Math.sin(Math.PI/6);\n\n // Distance between vertices of triangle to center\n // TODO: Use a binary search algorithm instead of step; too slow\n double distFromCenter = 0;\n double step = 0.5;\n\n // Find most inner triangle\n Polygon2D innerTriangle;\n int innerVoterCount;\n double topX, topY, leftX, rightX, botY;\n\n do {\n distFromCenter += step;\n\n topX = centerX;\n topY = centerY + distFromCenter;\n\n leftX = centerX - distFromCenter*cos30;\n rightX = centerX + distFromCenter*cos30;\n\n botY = centerY - distFromCenter*sin30;\n\n innerTriangle = new Polygon2D();\n innerTriangle.append(topX, topY);\n innerTriangle.append(leftX, botY);\n innerTriangle.append(rightX, botY);\n // System.out.println(topY);\n\n innerVoterCount = Run.countInclusion(voters, innerTriangle);\n } while (needsMoreVoters(innerVoterCount));\n System.out.println(\"found inner triangle\");\n System.out.println(innerVoterCount);\n\n triangles.add(innerTriangle);\n triTips.add(new Point2D.Double(topX, topY));\n\n // Draw numTriangles-1 more triangles around it, each with 20/22 districts\n Polygon2D triangle;\n int voterCount;\n\n for (int i = 0; i < numTriangles - 2; i++) {\n do {\n distFromCenter += step;\n\n topX = centerX;\n topY = centerY + distFromCenter;\n\n leftX = centerX - distFromCenter*cos30;\n rightX = centerX + distFromCenter*cos30;\n\n botY = centerY - distFromCenter*sin30;\n\n triangle = new Polygon2D();\n triangle.append(topX, topY);\n triangle.append(leftX, botY);\n triangle.append(rightX, botY);\n\n voterCount = Run.countInclusion(voters, triangle);\n System.out.println(topY);\n } while (needsMoreVoters(voterCount - innerVoterCount, repPerDistrict == 3 ? 20:22));\n System.out.println(\"found an outer triangle\");\n System.out.println(voterCount - innerVoterCount);\n\n innerVoterCount = voterCount;\n triangles.add(triangle);\n triTips.add(new Point2D.Double(topX, topY));\n }\n\n // Last outer triangle; not necessary but keeping the code for completeness\n Polygon2D outerTriangle = new Polygon2D();\n outerTriangle.append(topX, 500*Math.sqrt(3));\n outerTriangle.append(0, 0);\n outerTriangle.append(1000, 0);\n voterCount = Run.countInclusion(voters, outerTriangle);\n\n System.out.println(\"found an outer triangle\");\n System.out.println(voterCount - innerVoterCount);\n\n triangles.add(outerTriangle);\n triTips.add(new Point2D.Double(topX, 500*Math.sqrt(3)));\n\n return triTips;\n }", "public void addExcludeCircle(MapLocation center, float radius) {\n if (first == null) {\n return;\n }\n\n\n\n // If the first point is excluded, rotate until first point is not excluded\n Boundary current = first;\n Boundary prev = null;\n boolean firstIter = true;\n while (current != null) {\n // On first iter, test first point is valid\n if (firstIter) {\n if (current.begin.distanceTo(center) <= radius + bodyRadius) {\n // first point is excluded\n // TODO\n }\n }\n // Now, first point is valid\n\n switch (current.type) {\n case ARC: {\n ArcBoundary currentArc = (ArcBoundary)current;\n // get intersection points\n MapLocation[] intersections = getCircleIntersections(currentArc.begin, strideRadius,\n center, bodyRadius + radius);\n // Select intersection points on the current arc, in order\n MapLocation[] selectedIntersections = selectArcIntersections(currentArc, intersections);\n // Test each segment\n MapLocation segmentBegin = currentArc.begin;\n for (MapLocation segmentEnd : selectedIntersections) {\n MapLocation segmentMiddle = getArcSegmentMiddle(currentArc, segmentBegin, segmentEnd);\n if (segmentMiddle.distanceTo(center) <= radius + bodyRadius) {\n // this segment intersects\n }\n\n segmentBegin = segmentEnd;\n }\n\n }\n break;\n case LINE: {\n\n }\n break;\n }\n\n prev = current;\n current = current.next;\n firstIter = false;\n }\n }", "Set<S> getSegments();", "private boolean inPolygonLineCount(Double[] p, double x, double y) {\n\t\t\t\tint crosscount = 0;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < p.length ; i++) {\n\t\t\t\t\tdouble pix = p[i].x;\n\t\t\t\t\tdouble piy = p[i].y;\n\t\t\t\t\tdouble pi1x = p[(i+1) % p.length].x;\n\t\t\t\t\tdouble pi1y = p[(i+1) % p.length].y;\n\t\t\t\t\tdouble vx = pi1x - pix;\n\t\t\t\t\tdouble vy = pi1y - piy;\n\t\t\t\t\tdouble xint = pix + ((y-piy) / vy) * vx;\n\t\t\t\t\tif (pix > x || pi1x > x) {\n\t\t\t\t\t\tif (piy < y && y <= pi1y && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t} else if (pi1y < y && y <= piy && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn crosscount%2 == 1;\n\t\t\t}", "public Wall[] getExteriorWalls() {\n/* 3497 */ if (this.walls != null) {\n/* */ \n/* 3499 */ Set<Wall> wallsSet = new HashSet<>();\n/* 3500 */ for (Wall w : this.walls) {\n/* */ \n/* 3502 */ if (!w.isIndoor())\n/* 3503 */ wallsSet.add(w); \n/* */ } \n/* 3505 */ return wallsSet.<Wall>toArray(new Wall[wallsSet.size()]);\n/* */ } \n/* */ \n/* 3508 */ return emptyWalls;\n/* */ }", "public Centroid removeCentroid();", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-1521L), (-1521L));\n Range range1 = Range.ofLength(357L);\n List<Range> list0 = range0.complement(range1);\n assertFalse(range0.isEmpty());\n assertTrue(list0.contains(range0));\n assertFalse(range1.isEmpty());\n }", "private ArrayList<DataSegment> splitSegment(DataSegment segment, ArrayList<int[]> overlapping) {\n int start=segment.getSegmentStart();\n int end=segment.getSegmentEnd();\n ArrayList<DataSegment> newlist=new ArrayList<DataSegment>();\n for (int[] sub:overlapping) {\n DataSegment subsegment=segment.getEmptySubSegmentGenomicPositions(sub[0], sub[1]);\n if (subsegment!=null) newlist.add(subsegment); else return null;\n// engine.logMessage(\"Segment (\"+segment.getLocationAsString()+\") overlaps with [\"+sub[0]+\",\"+sub[1]+\"]. Creating new subsegment => \"+subsegment.toString());\n Collections.sort(newlist); \n }\n // now fill in missing bits\n fillInMissingSegments(newlist, start, end, segment.getDatatrackName(), segment.getOrganism(), segment.getGenomeBuild(), segment.getChromosome());\n // one last check...\n String error=checkSegments(newlist, start, end);\n if (error!=null) engine.logMessage(\"SYSTEM WARNING: Detected problems while processing cached data (error code:\"+error+\".2)\"); \n return newlist;\n }", "private void removeNoMoreExistingOriginalEdges() {\n for (MirrorEdge mirrorEdge : directEdgeMap.values()) {\n if (!originalGraph.has(mirrorEdge.original)) {\n for (Edge segment : mirrorEdge.segments) {\n mirrorGraph.forcedRemove(segment);\n reverseEdgeMap.remove(segment);\n }\n for (Node bend : mirrorEdge.bends) {\n mirrorGraph.forcedRemove(bend);\n reverseEdgeMap.remove(bend);\n }\n directEdgeMap.remove(mirrorEdge.original);\n }\n }\n }", "public ArrayList<TessSeg> splitAtIsect(TessSeg s1)\r\n {\r\n if (!isLineHit(s1))\r\n {\r\n return null;\r\n }\r\n \r\n //Check for point-line hits\r\n double t00 = -1, t01 = -1, t10 = -1, t11 = -1;\r\n boolean pointMidlineHit = false;\r\n \r\n if (isPointOnLine(s1.c0))\r\n {\r\n double t = pointOnLineT(s1.c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t00 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (isPointOnLine(s1.c1))\r\n {\r\n double t = pointOnLineT(s1.c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t01 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c0))\r\n {\r\n double t = s1.pointOnLineT(c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t10 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c1))\r\n {\r\n double t = s1.pointOnLineT(c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t11 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n\r\n if (pointMidlineHit)\r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n if (t00 > 0 && t01 > 0)\r\n {\r\n if (t00 < t01)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n }\r\n else if (t00 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n else if (t01 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(this);\r\n }\r\n \r\n if (t10 > 0 && t11 > 0)\r\n {\r\n if (t10 < t11)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n }\r\n else if (t10 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n else if (t11 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(s1);\r\n }\r\n \r\n return list;\r\n }\r\n \r\n if (c0.equals(s1.c0) \r\n || c0.equals(s1.c1)\r\n || c1.equals(s1.c0)\r\n || c1.equals(s1.c1))\r\n {\r\n //No point-midline hits. If we only meet at verts,\r\n // do not split.\r\n return null;\r\n }\r\n \r\n// if (!isParallelTo(s1))\r\n {\r\n //Midpoint crossing for both segments.\r\n // Solve system of linear eqns\r\n double s0x0 = c0.x;\r\n double s0y0 = c0.y;\r\n double s0x1 = c1.x;\r\n double s0y1 = c1.y;\r\n double s1x0 = s1.c0.x;\r\n double s1y0 = s1.c0.y;\r\n double s1x1 = s1.c1.x;\r\n double s1y1 = s1.c1.y;\r\n\r\n double[] t = Math2DUtil.lineIsectFractions(\r\n s0x0, s0y0, s0x1 - s0x0, s0y1 - s0y0,\r\n s1x0, s1y0, s1x1 - s1x0, s1y1 - s1y0,\r\n null);\r\n\r\n if (t == null || t[0] < 0 || t[0] > 1 || t[1] < 0 || t[1] > 1)\r\n {\r\n Logger.getLogger(TessSeg.class.getName()).log(Level.WARNING, \r\n \"Line segments do not overlap\");\r\n }\r\n// assert (t[0] > 0 && t[0] < 1 && t[1] > 0 && t[1] < 1)\r\n// : \"Line segments do not overlap\";\r\n \r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n \r\n Coord c = new Coord(\r\n (int)Math2DUtil.lerp(s1x0, s1x1, t[1]),\r\n (int)Math2DUtil.lerp(s1y0, s1y1, t[1]));\r\n\r\n list.add(new TessSeg(c0, c));\r\n list.add(new TessSeg(c, c1));\r\n list.add(new TessSeg(s1.c0, c));\r\n list.add(new TessSeg(c, s1.c1));\r\n \r\n return list;\r\n }\r\n }\r\n \r\n// return null;\r\n }", "java.util.List<org.landxml.schema.landXML11.NoPassingZoneDocument.NoPassingZone> getNoPassingZoneList();", "public Set<GeographicPoint> getVertices()\n\t{\n\t\t//TODO: Implement this method in WEEK 3\n\t\tSet<GeographicPoint> ans = new HashSet<GeographicPoint> ();\n\t\tfor (GeographicPoint curr : map.keySet()) {\n\t\t\tif (!ans.contains(curr)) {\n\t\t\t\tans.add(curr);\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public static <T> Set<List<T>> findSimpleCycles(Map<T, Set<T>> graph) {\n if (graph == null) {\n return null;\n }\n Set<List<T>> result = new HashSet<>();\n Set<T> vertices = new HashSet<>(graph.keySet());\n while (!graph.isEmpty()) {\n Set<Set<T>> components = findStronglyConnectedComponents(graph);\n Set<T> maxComponent = null;\n for (Set<T> component : components) {\n if (component.size() < 2) {\n if (isSelfCycle(graph, component)) {\n result.add(new ArrayList<>(component));\n }\n vertices.removeAll(component);\n } else if ((maxComponent == null) || (component.size() > maxComponent.size())) {\n maxComponent = component;\n }\n }\n if (maxComponent != null) {\n Map<T, Set<T>> subgraph = project(graph, maxComponent);\n T startVertex = maxComponent.iterator().next();\n result.addAll(findSimpleCycles(subgraph, startVertex));\n vertices.remove(startVertex);\n }\n graph = project(graph, vertices);\n }\n return result;\n }", "public static double noLineDelineation() \n {\n int nTries = 0; //the number of tries (landing both inside and outside the circle)\n int inCircle = 0; //the number of points that landed inside the circle\n \n double x, y; //the x and y coordinates (random) of the point chosen\n \n for (int i = 0; i < ITERATIONS; i++) \n {\n // (2*Math.random()-1) returns a random number from -1 to 1\n \n x = 2 * Math.random() - 1; \n y = 2 * Math.random() - 1;\n \n //if the point lands on the line or in the circle, increment the inCircle count\n if (x * x + y * y <= 1) \n {\n inCircle++;\n }\n \n nTries++;\n }\n \n /*\n * Prints the output if DEBUG is set to true. The output consists of two lines:\n * an estimate of pi to 30 decimal places using the no line delineation method \n * as well as an error percentage from the real value (Math.PI).\n */\n if(DEBUG) \n {\n System.out.printf(\"[no line boolean] pi = %.30f\\n\", 4. * (double) inCircle / (double) nTries);\n System.out.printf(\"[no line boolean] Error = %.30f\\n\", (((4. * (double) inCircle / (double) nTries) - Math.PI)/Math.PI));\n }\n \n //returns the estimated value of pi\n return 4. * (double) inCircle / (double) nTries;\n }", "private ArrayList<TTC> generateSegmentsHelper(ArrayList<TTC> reference_list) {\n\n ArrayList<TTC> copy = new ArrayList<> (reference_list);\n int start = 0;\n int end = 0;\n\n while (!copy.get(start).equals(START_STATION)) {\n start += 1;\n }\n while (!copy.get(end).equals(endStation)) {\n end += 1;\n }\n if (start < end) {\n return new ArrayList<>(copy.subList(start, end + 1));\n } else if (start == end) {\n return new ArrayList<>(); // if enter and exit at the same station.\n } else {\n Collections.reverse(copy);\n return new ArrayList<>(copy.subList(end, start + 1));\n }\n }", "private void managePolygonsCollisions() {\n for ( int m = 0; m < polygons.size(); m++ ) {\n for ( int n = m + 1; n < polygons.size(); n++ ) {\n managePolygonCollision(polygons.get(m), polygons.get(n));\n }\n }\n }", "@Pure\n\tIterable<ST> getGraphSegments();", "Proof notDivides(int n, int m) {\n return introduceNotExists(var(\"z\"), notDivides(n, m, var(\"z\")));\n }", "public PointList getIntersectionsWithArcs(Segment2 segment) {\n\n\t\tPointList intersections = new PointList();\n\n\t\tfor (int j = 0; j < face.edges().size(); j++) {\n\t\t\tDCEL_Edge e = (DCEL_Edge) face.edges().get(j);\n\t\t\tArc2_Sweep arc = (Arc2_Sweep) e.reference;\n\n\t\t\tCircle2 d = new Circle2(new Point2(arc.centre.x, arc.centre.y),\n\t\t\t\t\t(int) arc.radius);\n\n\t\t\tIntersection inter = d.intersection(segment);\n\n\t\t\tfor (int i = 0; i < inter.list.length(); i++) {\n\t\t\t\tPoint2 p = (Point2) inter.list.getValueAt(i);\n\n\t\t\t\t// Check whether point lies also on arc:\n\t\t\t\t// If yes: it is an intersection with an arc and we add it\n\t\t\t\t// to our list\n\t\t\t\tif (arc.liesOn(p)) {\n\t\t\t\t\tintersections.addPoint(new Point(p.x, p.y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn intersections;\n\t}", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), 1146L);\n long long0 = range0.getBegin();\n assertEquals((-2147483648L), long0);\n \n boolean boolean0 = range0.equals(\"number of entries must be <= Integer.MAX_VALUE\");\n assertFalse(boolean0);\n \n Range range1 = Range.of((-2147483648L));\n List<Range> list0 = range1.complement(range0);\n assertEquals(0, list0.size());\n }", "private static HashMap<Integer, ArrayList<String>> checkAndMergeIntersectedPoints(HashMap<Integer, ArrayList<String>> boundedRegionPointsMap) {\n\n\t\t// Iterate over regions one by one, to validate with rest of the regions iteratively.\n\t for(Integer key1 : boundedRegionPointsMap.keySet()) {\n\t ArrayList<String> list1 = boundedRegionPointsMap.get(key1);\n\n\t for (Integer key2 : boundedRegionPointsMap.keySet()) {\n\t \t// Only need to check for keys (region counters) incrementally\n\t if (key1 < key2) {\n\t ArrayList<String> list2 = boundedRegionPointsMap.get(key2);\n\t for(String point : list2) {\n\t \t// If there is an intersecting point in two regions, merge them.\n\t if (list1.contains(point)) {\n\t list1.addAll(list2);\n\t // Just to make sure there won't be any duplicate points introduced after the merge.\n\t Set<String> uniquePoints = new HashSet<String>(list1);\n\t boundedRegionPointsMap.put(key1, new ArrayList<String>(uniquePoints));\n\t break;\n\t }\n\t }\n\t }\n\t }\n\n\t }\n\t return boundedRegionPointsMap;\n\t}", "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 }", "public void clearCentroidVectors();", "public List<Point> query(Rectangle rectangle) {\n if (!boundary.intersects(rectangle)) {\n return Collections.emptyList();\n }\n\n List<Point> found = new ArrayList<>();\n points.stream()\n .filter(rectangle::contains)\n .forEach(found::add);\n\n if (isSubdivided) {\n found.addAll(nw.query(rectangle));\n found.addAll(ne.query(rectangle));\n found.addAll(se.query(rectangle));\n found.addAll(sw.query(rectangle));\n }\n\n return found;\n }", "private IRegion computeClippingRegion(PaintEvent event) {\n \t\tif (event == null) {\n \t\t\t// trigger a repaint of the entire viewport\n \t\t\tint vOffset= getInclusiveTopIndexStartOffset();\n \t\t\tif (vOffset == -1)\n \t\t\t\treturn null;\n \t\t\t\n \t\t\t// http://bugs.eclipse.org/bugs/show_bug.cgi?id=17147\n \t\t\tint vLength= getExclusiveBottomIndexEndOffset() - vOffset;\n \t\t\t\n \t\t\treturn new Region(vOffset, vLength);\n \t\t}\n \t\t\n \t\tint widgetOffset;\n \t\ttry {\n \t\t\tint widgetClippingStartOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y));\n \t\t\tint firstWidgetLine= fTextWidget.getLineAtOffset(widgetClippingStartOffset);\n \t\t\twidgetOffset= fTextWidget.getOffsetAtLine(firstWidgetLine);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// should not happen\n \t\t\twidgetOffset= 0;\n \t\t}\n \t\t\n \t\tint widgetEndOffset;\n \t\ttry {\n \t\t\tint widgetClippingEndOffset= fTextWidget.getOffsetAtLocation(new Point(0, event.y + event.height));\n \t\t\tint lastWidgetLine= fTextWidget.getLineAtOffset(widgetClippingEndOffset);\n \t\t\twidgetEndOffset= fTextWidget.getOffsetAtLine(lastWidgetLine + 1);\n \t\t} catch (IllegalArgumentException x) {\n \t\t\t// happens if the editor is not \"full\", eg. the last line of the document is visible in the editor\n \t\t\t// in that case, simply use the last character\n \t\t\twidgetEndOffset= fTextWidget.getCharCount();\n \t\t}\n \t\t\n \t\tIRegion clippingRegion= getModelRange(widgetOffset, widgetEndOffset - widgetOffset);\n \t\t\n \t\treturn clippingRegion;\n \t}", "public Collection<GJPoint2D> vertices() {\n\t\tArrayList<GJPoint2D> vertices = new ArrayList<GJPoint2D>(this.segments.size());\n\t\t\n\t\t// iterate on segments, and add the control points of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tfor (GJPoint2D p : seg.controlPoints()) {\n\t\t\t\tvertices.add(p);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// return the set of vertices\n\t\treturn vertices;\n\t}" ]
[ "0.5079548", "0.5059811", "0.5053829", "0.49333388", "0.4907339", "0.49069715", "0.48372754", "0.4784549", "0.47803563", "0.4727705", "0.471369", "0.46681747", "0.4635088", "0.46095416", "0.4604388", "0.460233", "0.4596479", "0.45911077", "0.4579577", "0.456014", "0.45518532", "0.45405838", "0.45389128", "0.45369416", "0.45287845", "0.45110536", "0.44928816", "0.44906074", "0.4488157", "0.4481437", "0.4473576", "0.4449419", "0.4435238", "0.44351748", "0.443325", "0.44224185", "0.44124612", "0.44111973", "0.43953884", "0.43935695", "0.4390096", "0.43778852", "0.43682578", "0.43623006", "0.4360408", "0.4353185", "0.43484092", "0.4346721", "0.43458274", "0.43373448", "0.4333887", "0.4328998", "0.4325655", "0.43242508", "0.4323969", "0.4313819", "0.4309262", "0.4306844", "0.43065774", "0.42987975", "0.42885113", "0.42841017", "0.42642206", "0.4263459", "0.42620692", "0.42548856", "0.4241416", "0.42352915", "0.42297488", "0.42091537", "0.42069948", "0.4200565", "0.42000878", "0.4189622", "0.41894403", "0.41862336", "0.41829148", "0.4180766", "0.417979", "0.4175685", "0.41732448", "0.41710183", "0.41706574", "0.41705772", "0.41667488", "0.41565797", "0.41533357", "0.41493508", "0.41485146", "0.41483313", "0.41405475", "0.41323543", "0.41298994", "0.4129198", "0.4123975", "0.41210786", "0.41169128", "0.4115538", "0.40980193", "0.40959156" ]
0.5207549
0
Verifies if a segment, that consists of any two points on a polygon, intersects with any other segments on the polygon other than the 4 segments starting or ending from the the specified segments' two end points.. The input is assumed to be in MAP coordinate. Note: Do not repeat the first point at the end of the polygon.
private boolean polysegIntPoly( Coordinate[] seg, Coordinate[] poly ) { boolean qualify = true; //Disqualify if the segment's two end points are adjacent on the polygon. List<Coordinate> polyList = Arrays.asList( poly ); int index1 = polyList.indexOf( seg[0] ); int index2 = polyList.indexOf( seg[1] ); int igap = Math.abs(index2 - index1 ); if ( igap == 1 || igap == ( (poly.length) - 1 ) ) { qualify = false; } else { qualify = segIntPoly( seg, poly ); } return qualify; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\t\tpublic void testIntersectAtEndPoints2(){\n\t\t\tGenericLineSegmentsIntersect v=new GenericLineSegmentsIntersect();\n\t\t\tint[][] lines={\n\t\t\t\t\t{1,5,5,1},\n\t\t\t\t\t{1,4,5,0},\n\t\t\t\t\t{2,2,6,10}\n\t\t\t};\n\n\t\t\tassertTrue(v.intersects(lines));\n\t\t}", "private int checkIntersections(ArrayList<Segment> segments){\n\t\tint numberOfIntersections = 0;\n\t\tfor (Segment s: segments){\n\t\t\tSegment firstSegment = s;\n\t\t\tfor (Segment t: segments){\n\t\t\t\tSegment secondSegment = t;\n\t\t\t\tif (!(firstSegment.equals(secondSegment))){\n\t\t\t\t\tif (!this.checkSharedVertex(firstSegment, secondSegment)){\n\t\t\t\t\t\tif(this.isIntersected(firstSegment.w1, firstSegment.w2, secondSegment.w1, secondSegment.w2))\n\t\t\t\t\t\t\tnumberOfIntersections ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn numberOfIntersections;\n\t}", "private boolean segIntPoly( Coordinate[] segIn, Coordinate[] polyIn ) {\n\t\t\n\t\tboolean qualify = true;\n\t\t\n\t\t//Convert to grid coordinate.\n\t\tCoordinate[] seg = PgenUtil.latlonToGrid( segIn );\n\t\tCoordinate[] poly = PgenUtil.latlonToGrid( polyIn );\n\t\t\n\t\t//Get mid-point and form geometries.\t\t\n\t\tCoordinate[] midp = new Coordinate[1];\t\t\n\t\tmidp[0] = new Coordinate( (seg[0].x + seg[1].x) / 2.0, (seg[0].y + seg[1].y) / 2.0 );\n\t\tGeometry point = GfaClip.getInstance().pointsToGeometry( midp );\n\t\tGeometry polygon = GfaClip.getInstance().pointsToGeometry( poly );\t\t\n\n\t\t//Disqualify if the segment lies outside of the polygon\n\t\tif ( !point.within( polygon ) ) {\n\t\t\tqualify = false;\n\t\t}\n\t\telse {\n\t\t\tGeometry segment = GfaClip.getInstance().pointsToGeometry( seg );\t \t\n\n\t\t\tif ( segment.intersects( polygon ) ) {\n\t\t\t\tCoordinate[] ipts = segment.intersection( polygon ).getCoordinates();\n\t\t\t\t/*\n\t\t\t\t * Disqualify if the segment intersects other segments of the polygon - \n\t\t\t\t * except the segments that share either the starting or ending \n\t\t\t\t * point with the segment on check.\n\t\t\t\t */\n\t\t\t\tif ( ipts.length != 2 ) {\n\t\t\t\t\tqualify = false;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\n\t\t\n\t\treturn qualify;\n\t}", "public boolean intersects(VectorXZ segmentP1, VectorXZ segmentP2) {\n // TODO: (performance): passing \"vector TO second point\", rather than\n // point2, would avoid having to calc it here - and that information\n // could be reused for all comparisons involving the segment\n return getIntersection(segmentP1, segmentP2) != null;\n }", "public static boolean checkIfLineSegementsIntersects( Point2D a, Point2D b, Point2D c, Point2D d, Point2D r )\n {\n double distAB, theCos, theSin, newX, ABpos;\n\n // Fail if either line is undefined.\n if( a.x == b.x && a.y == b.y || c.x == d.x && c.y == d.y )\n return false;\n\n // Fail if the segments share an end-point.\n if( a.x == c.x && a.y == c.y || b.x == c.x && b.y == c.y || a.x == d.x && a.y == d.y || b.x == d.x && b.y == d.y )\n return false;\n\n // (1) Translate the system so that point A is on the origin.\n double Bx = b.x - a.x;\n double By = b.y - a.y;\n double Cx = c.x - a.x;\n double Cy = c.y - a.y;\n double Dx = d.x - a.x;\n double Dy = d.y - a.y;\n\n // Discover the length of segment A-B.\n distAB = Math.sqrt( Bx * Bx + By * By );\n\n // (2) Rotate the system so that point B is on the positive X axis.\n theCos = Bx / distAB;\n theSin = By / distAB;\n newX = Cx * theCos + Cy * theSin;\n Cy = (int) (Cy * theCos - Cx * theSin);\n Cx = newX;\n newX = Dx * theCos + Dy * theSin;\n Dy = (int) (Dy * theCos - Dx * theSin);\n Dx = newX;\n\n // Fail if segment C-D doesn't cross line A-B.\n if( Cy < 0. && Dy < 0. || Cy >= 0. && Dy >= 0. )\n return false;\n\n // (3) Discover the position of the intersection point along line A-B.\n ABpos = Dx + (Cx - Dx) * Dy / (Dy - Cy);\n\n // Fail if segment C-D crosses line A-B outside of segment A-B.\n if( ABpos < 0. || ABpos > distAB )\n return false;\n\n // (4) Apply the discovered position to line A-B in the original coordinate system.\n if( r != null )\n {\n r.x = (int) (a.x + ABpos * theCos);\n r.y = (int) (a.y + ABpos * theSin);\n }\n\n // Success.\n return true;\n }", "public boolean intersects(Segment2D segment2) {\n if (segment2 == null) {\n throw new IllegalArgumentException(\"can't pass null parameter\");\n }\n\n double det = this.a * segment2.b - this.b * segment2.a;\n if (Math.abs(det) < EPS) {\n if (this.isOnSegment(segment2.point1)) {\n return true;\n }\n if (this.isOnSegment(segment2.point2)) {\n return true;\n }\n if (segment2.isOnSegment(this.point1)) {\n return true;\n }\n if (segment2.isOnSegment(this.point2)) {\n return true;\n }\n return false;\n }\n\n double x = -(segment2.b * this.c - this.b * segment2.c) / det;\n double y = -(-segment2.a * this.c + this.a * segment2.c) / det;\n\n Point2D p = new Point2D.Double(x, y);\n if (!this.isOnSegment(p)) {\n return false;\n }\n if (!segment2.isOnSegment(p)) {\n return false;\n }\n return true;\n }", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "public boolean intersectsSegment(Vector a, Vector b, double R){\r\n\t\tif(floor && !obstructed())\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tVector[] p = getCardinalPoints();\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++){\r\n\t\t\tVector c = p[i];\r\n\t\t\tVector d = p[(i+1)%4];\r\n\t\t\tif(Geometry.segmentIntersect(a, b, c, d) || Geometry.plsDist(a, b, p[i]) <= R)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean intersects(int from1, int to1, int from2, int to2) {\n\t\treturn from1 <= from2 && to1 >= from2 // (.[..)..] or (.[...]..)\n\t\t\t\t|| from1 >= from2 && from1 <= to2; // [.(..]..) or [..(..)..\n\t}", "public boolean intersects(GLineSegment lineSegment) {\n if(this.equals(lineSegment)) return(true);\n else if(this.slope()==lineSegment.slope()) return(false);\n else {\n //complicated stuff here.\n return(false);\n }\n }", "public boolean isPointInSegment(Coordinates point, Coordinates segmExtremityA, Coordinates segmExtremityB);", "private boolean pointOnSegment(Waypoint w1, Waypoint w3, Waypoint w2){\n\t\tdouble w1x = w1.getX();\n\t\tdouble w1y = w1.getY();\n\t\tdouble w2x = w2.getX();\n\t\tdouble w2y = w2.getY();\n\t\tdouble w3x = w3.getX();\n\t\tdouble w3y = w3.getY();\n\t\t\n\t\tif (w3x <= Math.max(w1x, w2x) && w3x >= Math.min(w1x, w2x) && \n\t\t\tw3y <= Math.max(w1y, w2y) && w3y >= Math.min(w1y, w2y))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "boolean intersect(Segment other) {\n\t\tint o1 = orientation(other.from);\n\t\tint o2 = orientation(other.to);\n\t\tint o3 = other.orientation(from);\n\t\tint o4 = other.orientation(to);\n\t\treturn (o1 != o2 && o3 != o4) // <- General case, special case below\n\t\t\t\t|| (o1 == 0 && inBoundingBox(other.from)) || (o2 == 0 && inBoundingBox(other.to))\n\t\t\t\t|| (o3 == 0 && other.inBoundingBox(from)) || (o4 == 0 && other.inBoundingBox(to));\n\t}", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "public static boolean isIntersecting(Coord p1, Coord q1, Coord p2, Coord q2) \n { \n // Find the four orientations needed for general and \n // special cases \n int o1 = orientation(p1, q1, p2); \n int o2 = orientation(p1, q1, q2); \n int o3 = orientation(p2, q2, p1); \n int o4 = orientation(p2, q2, q1); \n \n // General case \n if(o1 != o2 && o3 != o4) \n return true; \n \n // Special Cases \n // p1, q1 and p2 are colinear and p2 lies on segment p1q1 \n if (o1 == 0 && isOnSegment(p1, q1, p2)) return true; \n \n // p1, q1 and q2 are colinear and q2 lies on segment p1q1 \n if (o2 == 0 && isOnSegment(p1, q1, q2)) return true; \n \n // p2, q2 and p1 are colinear and p1 lies on segment p2q2 \n if (o3 == 0 && isOnSegment(p2, q2, p1)) return true; \n \n // p2, q2 and q1 are colinear and q1 lies on segment p2q2 \n if (o4 == 0 && isOnSegment(p2, q2, q1)) return true; \n \n return false; // Doesn't fall in any of the above cases \n }", "public boolean rayCrossesSegment(LatLng point, LatLng a, LatLng b) {\n double px = point.longitude,\n py = point.latitude,\n ax = a.longitude,\n ay = a.latitude,\n bx = b.longitude,\n by = b.latitude;\n if (ay > by) {\n ax = b.longitude;\n ay = b.latitude;\n bx = a.longitude;\n by = a.latitude;\n }\n // alter longitude to cater for 180 degree crossings\n if (px < 0 || ax < 0 || bx < 0) {\n px += 360;\n ax += 360;\n bx += 360;\n }\n // if the point has the same latitude as a or b, increase slightly py\n if (py == ay || py == by) py += 0.00000001;\n\n\n // if the point is above, below or to the right of the segment, it returns false\n if ((py > by || py < ay) || (px > Math.max(ax, bx))) {\n return false;\n }\n // if the point is not above, below or to the right and is to the left, return true\n else if (px < Math.min(ax, bx)) {\n return true;\n }\n // if the two above conditions are not met, you have to compare the slope of segment [a,b] (the red one here) and segment [a,p] (the blue one here) to see if your point is to the left of segment [a,b] or not\n else {\n double red = (ax != bx) ? ((by - ay) / (bx - ax)) : Double.POSITIVE_INFINITY;\n double blue = (ax != px) ? ((py - ay) / (px - ax)) : Double.POSITIVE_INFINITY;\n return (blue >= red);\n }\n\n }", "public static boolean lineSegmentIntersectsRect(float x1, float y1, float x2, float y2, float xmin, float ymin, float xmax, float ymax) {\n\t\tshort code1 = Code(x1, y1, xmin, ymin, xmax, ymax);\n\t\tshort code2 = Code(x2, y2, xmin, ymin, xmax, ymax);\n\n\t\t//both are TOP, or both are BOTTOM , etc.\n\t\tif((code1 & code2) != 0) return false;\n\n\t\t//both are in the middle vertically or horizontally : | shape or - shape\n\t\tif( ((code1 | code2) & (RIGHT | LEFT)) == 0) return true;\n\t\tif( ((code1 | code2) & (TOP | BOTTOM)) == 0) return true;\n\n\t\t//any of them is inside\n\t\tif(code1 == 0 || code2 == 0) return true;\n\n\t\t//calculate intersections and check if they are in the middle\n\t\t//y = y1 + (x - x1) * slope\n\n\t\tfloat x, y;\n\t\ty = y1 + (xmax - x1) * (y2 - y1) /(x2 - x1);\n\t\tif(ymin <= y && y <= ymax) return true;\n\t\ty = y1 + (xmin - x1) * (y2 - y1) /(x2 - x1);\n\t\tif(ymin <= y && y <= ymax) return true;\n\t\tx = x1 + (ymax - y1) * (x2 - x1) / (y2 - y1);\n\t\tif(xmin <= x && x <= ymax) return true;\n\t\tx = x1 + (ymin - y1) * (x2 - x1) / (y2 - y1);\n\t\tif(xmin <= x && x <= ymax) return true;\n\t\treturn false;\n\t}", "Multimap<String, String> intersects(Polygon bounds);", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "static boolean SegmentsIntersect(PT a, PT b, PT c, PT d) {\r\n\t\tif (LinesCollinear(a, b, c, d)) {\r\n\t\t\tif (dist2(a, c) < EPS || dist2(a, d) < EPS || dist2(b, c) < EPS || dist2(b, d) < EPS)\r\n\t\t\t\treturn true;\r\n\t\t\tif (dot(c.subtract(a), c.subtract(b)) > 0 && dot(d.subtract(a), d.subtract(b)) > 0\r\n\t\t\t\t\t&& dot(c.subtract(b), d.subtract(b)) > 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (cross(d.subtract(a), b.subtract(a)) * cross(c.subtract(a), b.subtract(a)) > 0)\r\n\t\t\treturn false;\r\n\t\tif (cross(a.subtract(c), d.subtract(c)) * cross(b.subtract(c), d.subtract(c)) > 0)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "private static boolean isOnSegment(Coord p, Coord q, Coord r) \n {\n if(r.x <= Math.max(p.x, q.x) && r.x >= Math.min(p.x, q.x) && \n r.y <= Math.max(p.y, q.y) && r.y >= Math.min(p.y, q.y)) \n return true; \n return false; \n }", "private Type establishIntersectionType() {\n\r\n\t\tdouble Pq0 = AngleUtil.getTurn(p0, p1, q0);\r\n\t\tdouble Pq1 = AngleUtil.getTurn(p0, p1, q1);\r\n\r\n\t\tdouble Qp0 = AngleUtil.getTurn(q0, q1, p0);\r\n\t\tdouble Qp1 = AngleUtil.getTurn(q0, q1, p1);\r\n\r\n\t\t// check if all turn have none angle. In this case, lines are collinear.\r\n\t\tif (Pq0 == AngleUtil.NONE && Pq1 == AngleUtil.NONE || Qp0 == AngleUtil.NONE && Qp1 == AngleUtil.NONE) {\r\n\t\t\t// at this point, we know that lines are collinear.\r\n\t\t\t// we must check if they overlap for segments intersection\r\n\t\t\tif (q0.getDistance(p0) <= p0.getDistance(p1) && q0.getDistance(p1) <= p0.getDistance(p1)) {\r\n\t\t\t\t// then q0 is in P limits and p0 or p1 is in Q limits\r\n\t\t\t\t// TODO this check is no sufficient\r\n\t\t\t\tinPLimits = true;\r\n\t\t\t\tinQLimits = true;\r\n\t\t\t}\r\n\t\t\treturn Type.COLLINEAR;\r\n\t\t}\r\n\t\t// check if q0 and q1 lie around P AND p0 and p1 lie around Q.\r\n\t\t// in this case, the two segments intersect\r\n\t\telse if (Pq0 * Pq1 <= 0 && Qp0 * Qp1 <= 0) {\r\n\t\t\t// else if(Pq0 <= 0 && Pq1 >= 0 && Qp0 <= 0 && Qp1 >= 0 ||\r\n\t\t\t// Pq0 >= 0 && Pq1 <= 0 && Qp0 >= 0 && Qp1 <= 0){\r\n\r\n\t\t\tinPLimits = true;\r\n\t\t\tinQLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t}\r\n\r\n\t\t// At this point, we know that segments are not crossing\r\n\t\t// check if q0 and q1 lie around P or p0 and p1 lie around Q.\r\n\t\t// in this case, a segment cross a line\r\n\t\telse if (Pq0 * Pq1 <= 0) {\r\n\t\t\tinQLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t} else if (Qp0 * Qp1 <= 0) {\r\n\t\t\tinPLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t}\r\n\r\n\t\t// At this point, we know that each segment lie on one side of the other\r\n\t\t// We now check the slope to know if lines are Type.PARALLEL\r\n\t\tdouble pSlope = p0.getSlope(p1);\r\n\t\tdouble qSlope = q0.getSlope(q1);\r\n\t\tif (PrecisionUtil.areEquals(pSlope, qSlope))\r\n\t\t\t// TODO check the infinity case\r\n\t\t\t// this test works even if the slopes are \"Double.infinity\" due to the verticality of the lines and division\r\n\t\t\t// by 0\r\n\t\t\treturn Type.PARALLEL;\r\n\t\telse\r\n\t\t\treturn Type.INTERSECT;\r\n\t}", "@Override\n\tpublic boolean intersectsRectangle(final int ax1, final int ax2, final int ay1, final int ay2)\n\t{\n\t\tif (isInsideZone(ax1, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax1, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Check if any point from this rectangle is inside the other one\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Horizontal lines may intersect vertical lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Vertical lines may intersect horizontal lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "static boolean doIntersect(Point p1, Point q1,\n Point p2, Point q2)\n {\n // Find the four orientations needed for\n // general and special cases\n int o1 = orientation(p1, q1, p2);\n int o2 = orientation(p1, q1, q2);\n int o3 = orientation(p2, q2, p1);\n int o4 = orientation(p2, q2, q1);\n\n // General case\n if (o1 != o2 && o3 != o4)\n {\n return true;\n }\n\n // Special Cases\n // p1, q1 and p2 are colinear and\n // p2 lies on segment p1q1\n if (o1 == 0 && onSegment(p1, p2, q1))\n {\n return true;\n }\n\n // p1, q1 and p2 are colinear and\n // q2 lies on segment p1q1\n if (o2 == 0 && onSegment(p1, q2, q1))\n {\n return true;\n }\n\n // p2, q2 and p1 are colinear and\n // p1 lies on segment p2q2\n if (o3 == 0 && onSegment(p2, p1, q2))\n {\n return true;\n }\n\n // p2, q2 and q1 are colinear and\n // q1 lies on segment p2q2\n if (o4 == 0 && onSegment(p2, q1, q2))\n {\n return true;\n }\n\n // Doesn't fall in any of the above cases\n return false;\n }", "public static boolean intersectsLinePolygon(int x1, int y1, int x2, int y2, Vector2i[] polygon) {\n\n\t\tint n = polygon.length;\n\t\t\n\t\tint x3 = polygon[n-1].x;\n\t\tint y3 = polygon[n-1].y;\n\n\t\tfor(int i=0; i<n; i+=2) {\n\t\t\tint x4 = polygon[i].x;\n\t\t\tint y4 = polygon[i].y;\n\t\t\t\n\t\t\tint d = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\t\t\tif (d != 0) {\n\t\t\t\tint yd = y1 - y3;\n\t\t\t\tint xd = x1 - x3;\n\t\t\t\tint ua = ((x4 - x3) * yd - (y4 - y3) * xd) / d;\n\t\t\t\tif (ua >= 0 && ua <= 1) {\n\t\t\t\t\tint ub = ((x2 - x1) * yd - (y2 - y1) * xd) / d;\n\t\t\t\t\tif (ub >= 0 && ub <= 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tx3 = x4;\n\t\t\ty3 = x4;\n\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean intersects(S2Point v1) {\n boolean result = true;\n\n if ((v1.x < xmin && lastVertex.x < xmin) || (v1.x > xmax && lastVertex.x > xmax)) {\n result = false;\n } else if ((v1.y < ymin && lastVertex.y < ymin) || (v1.y > ymax && lastVertex.y > ymax)) {\n result = false;\n } else if ((v1.z < zmin && lastVertex.z < zmin) || (v1.z > zmax && lastVertex.z > zmax)) {\n result = false;\n }\n\n lastVertex = v1;\n return result;\n }", "@Test\n\tpublic void testContains() {\n\t\tLine l1 = new Line(0, 0, 1, 0);\n\t\tLine l2 = new Line(0, 0, 0, 1);\n\t\tLine l3 = new Line(0, 0, 1, 1);\n\t\tLine l4 = new Line(2.65, 0.3, 2.65, 0.9);\n\n\t\tassertTrue(\"l1 does not contain point (0.5, 0)\",\n\t\t\t\tl1.contains(new Coord(0.5, 0)));\n\t\tassertTrue(\"l2 does not contain point (0, 0.5)\",\n\t\t\t\tl2.contains(new Coord(0, 0.5)));\n\t\tassertTrue(\"l3 does not contain point (0.5, 0.5)\",\n\t\t\t\tl3.contains(new Coord(0.5, 0.5)));\n\n\t\tassertTrue(\n\t\t\t\t\"l4 does not contain (2.6499999999999995, 0.46083784792155075)\",\n\t\t\t\tl4.contains(new Coord(2.6499999999999995, 0.46083784792155075)));\n\n\t\t// Check endpoints for l1\n\t\tassertTrue(\"l1 does not contain point (0, 0)\",\n\t\t\t\tl1.contains(new Coord(0, 0)));\n\t\tassertTrue(\"l1 does not contain point (1, 0)\",\n\t\t\t\tl1.contains(new Coord(1, 0)));\n\t}", "static boolean isInside(Point polygon[], int n, Point p)\n {\n // There must be at least 3 vertices in polygon[]\n if (n < 3)\n {\n return false;\n }\n\n // Create a point for line segment from p to infinite\n Point extreme = new Point(10000, p.getY());\n\n // Count intersections of the above line\n // with sides of polygon\n int count = 0, i = 0;\n do\n {\n int next = (i + 1) % n;\n\n // Check if the line segment from 'p' to\n // 'extreme' intersects with the line\n // segment from 'polygon[i]' to 'polygon[next]'\n if (doIntersect(polygon[i], polygon[next], p, extreme))\n {\n // If the point 'p' is colinear with line\n // segment 'i-next', then check if it lies\n // on segment. If it lies, return true, otherwise false\n if (orientation(polygon[i], p, polygon[next]) == 0)\n {\n return onSegment(polygon[i], p,\n polygon[next]);\n }\n\n count++;\n }\n i = next;\n } while (i != 0);\n\n // Return true if count is odd, false otherwise\n return (count % 2 == 1); // Same as (count%2 == 1)\n }", "public boolean isOnSegment(Point2D point) {\n double x = point.getX();\n double y = point.getY();\n double val = this.a * x + this.b * y + this.c;\n if (val < 0.0) {\n val = -val;\n }\n if (val > EPS) {\n return false;\n }\n\n if ((x < (this.minx - EPS)) || (x > (this.maxx + EPS))) {\n return false;\n }\n if ((y < (this.miny - EPS)) || (y > (this.maxy + EPS))) {\n return false;\n }\n return true;\n }", "private static boolean intersectAxis(Vector2f[] points0, Vector2f[] points1, Vector2f normal) {\n\t\tfloat proj_dot_00 = getProjectionDot(points0[0], normal);\n\t\tfloat proj_dot_01 = getProjectionDot(points0[1], normal);\n\t\tfloat proj_dot_02 = getProjectionDot(points0[2], normal);\n\t\tfloat proj_dot_03 = getProjectionDot(points0[3], normal);\n\t\tfloat proj_dot_10 = getProjectionDot(points1[0], normal);\n\t\tfloat proj_dot_11 = getProjectionDot(points1[1], normal);\n\t\tfloat proj_dot_12 = getProjectionDot(points1[2], normal);\n\t\tfloat proj_dot_13 = getProjectionDot(points1[3], normal);\n\t\t\n\t\tfloat min_0 = Math.min(Math.min(proj_dot_00, proj_dot_01), Math.min(proj_dot_02, proj_dot_03));\n\t\tfloat max_0 = Math.max(Math.max(proj_dot_00, proj_dot_01), Math.max(proj_dot_02, proj_dot_03));\n\t\tfloat min_1 = Math.min(Math.min(proj_dot_10, proj_dot_11), Math.min(proj_dot_12, proj_dot_13));\n\t\tfloat max_1 = Math.max(Math.max(proj_dot_10, proj_dot_11), Math.max(proj_dot_12, proj_dot_13));\n\t\t\n\t\treturn max_0 >= min_1 && min_0 <= max_1;\n\t}", "Multimap<String, String> intersects(RectangleLatLng bounds);", "boolean hasSegments();", "public boolean isInRect2(Point p) {\n\t\tLine AB = new Line(A1, B1);\n\t\tLine CD = new Line(C1, AB.getU());\n\t\tLine AD = new Line(A1, D1);\n\t\tLine BC = new Line(B1, AD.getU());\n\n\t\t// if(Line.isBetween2Lines2(AB, CD, p))\n\t\t// System.out.println(1);\n\t\t// if(Line.isBetween2Lines2(AD, BC, p))\n\t\t// System.out.println(2);\n\n\t\tif (Line.isBetween2Lines2(AB, CD, p) && Line.isBetween2Lines2(AD, BC, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public E3DVector3F checkSegmentCollision(E3DVector3F startPos, E3DVector3F endPos)\r\n {\r\n if(doesSegmentCrossPlane(startPos, endPos))\r\n {\r\n E3DVector3F intersectionPoint = getPlaneIntersectionPoint(startPos, endPos);\r\n if(isPointInTriangle(intersectionPoint))// || triangle.pointInTriangle(intersectionPoint2))\r\n return intersectionPoint;\r\n }\r\n return null;\r\n }", "boolean _insidePts(PVector[] inPts, PVector[] outPts) {\n \n for(int i = 0; i < inPts.length; i++){\n // direction of angular relationship to any side must match\n // direction of relationship to opposite side\n if(!_ptPoly(inPts[i], outPts)) return false;\n }\n return true;\n }", "protected boolean checkPoiInside( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//[begin point in area 1] unintersect: 1,2,3,7,8\r\n\t\t//[begin point in area 2] unintersect: 1,2,3\r\n\t\t//[begin point in area 3] unintersect: 1,2,3,4,5\r\n\t\t//[begin point in area 4] unintersect: 3,4,5\r\n\t\t//[begin point in area 5] unintersect: 3,4,5,6,7\r\n\t\t//[begin point in area 6] unintersect: 5,6,7\r\n\t\t//[begin point in area 7] unintersect: 5,6,7,8,1\r\n\t\t//[begin point in area 8] unintersect: 7,8,1\r\n\t\t//[begin point in area 9] unintersect: 9\r\n\t\tif(isInsideArea( 1, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 2, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 3, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 4, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 5, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 6, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 7, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 8, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean commonEndPoint (Coordinate endPoint_in, Coordinate endPoint_out) {\r\n\t\tif (endPoint_in.equals3D(endPoint_out)) {\r\n\t\t\treturn true;\r\n\t\t} else return false;\t\r\n\t}", "private boolean overlappingGateways(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\tdouble firstApothem = (s1.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble secondApothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstApothem > secondX - secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean checkIfLinesIntersects( Point2D a, Point2D b, Point2D c, Point2D d, Point2D r )\n {\n double distAB, theCos, theSin, newX, ABpos;\n\n // Fail if either line is undefined.\n if( a.x == b.x && a.y == b.y || c.x == d.x && c.y == d.y )\n return false;\n\n // (1) Translate the system so that point A is on the origin.\n double Bx = b.x - a.x;\n double By = b.y - a.y;\n double Cx = c.x - a.x;\n double Cy = c.y - a.y;\n double Dx = d.x - a.x;\n double Dy = d.y - a.y;\n\n // Discover the length of segment A-B.\n distAB = Math.sqrt( Bx * Bx + By * By );\n\n // (2) Rotate the system so that point B is on the positive X axis.\n theCos = Bx / distAB;\n theSin = By / distAB;\n newX = Cx * theCos + Cy * theSin;\n Cy = (int) (Cy * theCos - Cx * theSin);\n Cx = newX;\n newX = Dx * theCos + Dy * theSin;\n Dy = (int) (Dy * theCos - Dx * theSin);\n Dx = newX;\n\n // Fail if the lines are parallel.\n if( Cy == Dy )\n return false;\n\n // (3) Discover the position of the intersection point along line A-B.\n ABpos = Dx + (Cx - Dx) * Dy / (Dy - Cy);\n\n // (4) Apply the discovered position to line A-B in the original coordinate system.\n if( r != null )\n {\n r.x = (int) (a.x + ABpos * theCos);\n r.y = (int) (a.y + ABpos * theSin);\n }\n\n // Success.\n return true;\n }", "boolean checkIfValidToCreate(int start, int end) {\n return myMarkerTree.processOverlappingWith(start, end, region->{\n int rStart = region.getStartOffset();\n int rEnd = region.getEndOffset();\n if (rStart < start) {\n if (region.isValid() && start < rEnd && rEnd < end) {\n return false;\n }\n }\n else if (rStart == start) {\n if (rEnd == end) {\n return false;\n }\n }\n else {\n if (rStart > end) {\n return true;\n }\n if (region.isValid() && rStart < end && end < rEnd) {\n return false;\n }\n }\n return true;\n });\n }", "public boolean isIntersectLine(Point p1, Point p2) {\n\t\t// Find the four orientations needed for general and special cases\n\t\tint o1 = orientation(firstPoint, secondPoint, p1);\n\t\tint o2 = orientation(firstPoint, secondPoint, p2);\n\t\tint o3 = orientation(p1, p2, firstPoint);\n\t\tint o4 = orientation(p1, p2, secondPoint);\n\n\t\t// General case\n\t\tif (o1 != o2 && o3 != o4) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special Cases\n\t\t// p1, q1 and p2 are collinear and p2 lies on segment p1q1\n\t\tif (o1 == 0 && p1.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p1, q1 and p2 are collinear and q2 lies on segment p1q1\n\t\tif (o2 == 0 && p2.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and p1 are collinear and p1 lies on segment p2q2\n\t\tif (o3 == 0 && firstPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and q1 are collinear and q1 lies on segment p2q2\n\t\tif (o4 == 0 && secondPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Or else\n\t\treturn false;\n\t}", "private void assertSegmentListEqual(final List<SVAnnotateEngine.SVSegment> segmentsA,\n final List<SVAnnotateEngine.SVSegment> segmentsB) {\n final int lengthA = segmentsA.size();\n if (lengthA != segmentsB.size()) {\n Assert.fail(\"Segment lists differ in length\");\n }\n for (int i = 0; i < lengthA; i++) {\n SVAnnotateEngine.SVSegment segmentA = segmentsA.get(i);\n SVAnnotateEngine.SVSegment segmentB = segmentsB.get(i);\n if (!segmentA.equals(segmentB)) {\n Assert.fail(\"Segment items differ\");\n }\n }\n }", "private boolean overlappingEvents(BpmnShape s1, BpmnShape s2) {\n\t\t\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX();\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "boolean hasSegment();", "public CFWRect intersectsLine( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//1.rejust rect\r\n\t\t//correct: (m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\r\n\t\tif(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange all\r\n\t\t\tCFWPoint poiTmp = m_poiLT;\r\n\t\t\tm_poiLT = m_poiRB;\r\n\t\t\tm_poiRB = poiTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\t{\r\n\t\t\t//exchange X\r\n\t\t\tfloat fXTmp = m_poiLT.m_fX;\r\n\t\t\tm_poiLT.m_fX = m_poiRB.m_fX;\r\n\t\t\tm_poiRB.m_fX = fXTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange Y\r\n\t\t\tfloat fYTmp = m_poiLT.m_fY;\r\n\t\t\tm_poiLT.m_fY = m_poiRB.m_fY;\r\n\t\t\tm_poiRB.m_fY = fYTmp;\r\n\t\t}\r\n\t\t//2.intersect test\r\n\t\tCFWPoint poiOutOfRect = new CFWPoint();\r\n\t\tboolean bPoiInsideRect = false;\r\n\t\tCFWRect rectRet = new CFWRect();\r\n\t\tif(!checkPoiInside( poiBegI, poiEndI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse if(!checkPoiInside( poiEndI, poiBegI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\tif(isInsideArea( 9, poiBegI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\t}\r\n\t\t\t\trectRet.m_poiLT = poiBegI;\r\n\t\t\t\tpoiOutOfRect = poiEndI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiBegI))\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\trectRet.m_poiLT = poiEndI;\r\n\t\t\t\tpoiOutOfRect = poiBegI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//3.intersect\r\n\t\t//if the line is vertical to X/Y, return the line segment\r\n\t\tif(poiEndI.m_fX == poiBegI.m_fX)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = poiEndI.m_fX;\r\n\t\t\t\t//less than the m_poiLT'Y, use the m_poiLT'Y\r\n\t\t\t\trectRet.m_poiLT.m_fY = Math.max( Math.min(poiBegI.m_fY, poiEndI.m_fY), m_poiLT.m_fY);\r\n\t\t\t\t//larger than m_poiRB's Y, use the m_poiRB's Y\r\n\t\t\t\trectRet.m_poiRB.m_fY = Math.min( Math.max(poiBegI.m_fY, poiEndI.m_fY), m_poiRB.m_fY);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fY < m_poiLT.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\telse if(poiOutOfRect.m_fY > m_poiRB.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiRB.m_fY;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fX = poiEndI.m_fX;\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(poiEndI.m_fY == poiBegI.m_fY)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = Math.max( Math.min( poiBegI.m_fX, poiEndI.m_fX), m_poiLT.m_fX);\r\n\t\t\t\trectRet.m_poiLT.m_fY = poiEndI.m_fY;\r\n\t\t\t\trectRet.m_poiRB.m_fX = Math.min( Math.max( poiBegI.m_fX, poiEndI.m_fX), m_poiRB.m_fX);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fX < m_poiLT.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\telse if(poiOutOfRect.m_fX > m_poiRB.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiRB.m_fX;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fY = poiEndI.m_fY;\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\t//build line function\r\n\t\t\tdouble dK = (poiEndI.m_fY - poiBegI.m_fY)/(poiEndI.m_fX - poiBegI.m_fX);\r\n\t\t\tdouble dB = poiBegI.m_fY - dK*poiBegI.m_fX;\r\n\t\t\t//find intersect points\r\n\t\t\tCFWPoint poiIntersA = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tCFWPoint poiIntersB = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tfloat fXTmpA = (float)((m_poiLT.m_fY - dB)/dK);\r\n\t\t\tfloat fXTmpB = (float)((m_poiRB.m_fY - dB)/dK);\r\n\t\t\tfloat fYTmpA = (float)(dK*m_poiLT.m_fX + dB);\r\n\t\t\tfloat fYTmpB = (float)(dK*m_poiRB.m_fX + dB);\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpA, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpB, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpA, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpB, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(bPoiInsideRect)\t{\r\n\t\t\t\tCFWVector vecBE = new CFWVector(poiOutOfRect.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBA = new CFWVector(poiIntersA.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBB = new CFWVector(poiIntersB.sub(rectRet.m_poiLT));\r\n\t\t\t\tif(vecBE.isSameDir_VerticalIn(vecBA))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersA;\r\n\t\t\t\t}\r\n\t\t\t\telse if(vecBE.isSameDir_VerticalIn(vecBB))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\trectRet.m_poiLT = poiIntersA;\r\n\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//last check : intersected line segment whether inside rectangle\r\n\t\tif(!isInsideArea( 9, rectRet.m_poiLT) || !isInsideArea( 9, rectRet.m_poiRB))\t{\r\n\t\t\tSystem.out.println(\"generated line segment isn't inside rectangle!\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn(rectRet);\r\n\t}", "Multimap<String, String> intersects(PointLatLng point);", "boolean _ptPoly(PVector pt, PVector[] poly) { \n // count edges crossed by the line connecting the target point to \"the outside\"\n int count = 0;\n \n for(int i = 0; i < poly.length; i++) {\n PVector a = poly[i], b = poly[(i+1)%poly.length]; // edge points\n if(_clockwise(a, pt, out) != _clockwise(b, pt, out) && // a & b on different sides of line\n _clockwise(a, b, pt) != _clockwise(a, b, out)) { // tgt & out on diff sides of edge\n count++;\n }\n }\n \n return count % 2 == 1;\n // a convex poly would be crossed on one edge;\n // concave could be crossed on any odd # of edges\n }", "static boolean onSegment(Point p, Point q, Point r)\n {\n if (\n q.getX() <= Math.max(p.getX(), r.getX()) &&\n q.getX() >= Math.min(p.getX(), r.getX()) &&\n q.getY() <= Math.max(p.getY(), r.getY()) &&\n q.getY() >= Math.min(p.getY(), r.getY()))\n {\n return true;\n }\n return false;\n }", "private boolean overlappingTaskAndEvent(BpmnShape s1, BpmnShape s2) {\n\t\t\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public boolean equals(Object lineSegment) {\n try {\n GLineSegment temp=(GLineSegment) lineSegment;\n return(( (this.point1.equals(temp.getFirstPoint())) &&\n (this.point2.equals(temp.getSecondPoint())) ) ||\n ( (this.point1.equals(temp.getSecondPoint())) &&\n (this.point2.equals(temp.getFirstPoint())) )); \n }\n catch(Exception e) {\n return(false);\n }\n }", "public boolean intersects(S2Point v1) {\n double lng1 = S2LatLng.longitude(v1).radians();\n boolean result = interval.intersects(S1Interval.fromPointPair(lng0, lng1));\n lng0 = lng1;\n return result;\n }", "@Test\n void shouldBeInsideMap()\n {\n assertTrue(map.isInsideMap(new Vector2(0,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,4)));\n\n assertTrue(map.isInsideMap(new Vector2(1,3)));\n }", "public boolean validateOverlap(ObservableList<Appointment> test){\n LocalDateTime A = startLDT;\n LocalDateTime Z = endLDT;\n\n for(Appointment appt : test){\n if(appt.getId() == selectedRow.getId()){\n continue;\n }\n LocalDateTime S = LocalDateTime.parse(appt.getStart(), formatter);\n LocalDateTime E = LocalDateTime.parse(appt.getEnd(), formatter);\n //case 1 - when the start is in the window\n if((A.isAfter(S) || A.isEqual(S)) && A.isBefore(E)){\n return false;\n }\n //case 2 - when the end is in the window\n if(Z.isAfter(S) && (Z.isBefore(E) || Z.isEqual(E))){\n return false;\n }\n //case 3 - when the start and end are outside of the window\n if(((A.isBefore(S) || A.isEqual(S)) && (Z.isAfter(E) || Z.isEqual(E)))){\n return false;\n }\n }\n return true;\n }", "public boolean contains2(Point p) {\n int crossings = 0;\n for (int i = 0; i < N; i++) {\n int j = i + 1;\n boolean cond1 = (a[i].y <= p.y) && (p.y < a[j].y);\n boolean cond2 = (a[j].y <= p.y) && (p.y < a[i].y);\n if (cond1 || cond2) {\n // need to cast to double\n if (p.x < (a[j].x - a[i].x) * (p.y - a[i].y) / (a[j].y - a[i].y) + a[i].x)\n crossings++;\n }\n }\n if (crossings % 2 == 1) return true;\n else return false;\n }", "private static HashMap<Integer, ArrayList<String>> checkAndMergeIntersectedPoints(HashMap<Integer, ArrayList<String>> boundedRegionPointsMap) {\n\n\t\t// Iterate over regions one by one, to validate with rest of the regions iteratively.\n\t for(Integer key1 : boundedRegionPointsMap.keySet()) {\n\t ArrayList<String> list1 = boundedRegionPointsMap.get(key1);\n\n\t for (Integer key2 : boundedRegionPointsMap.keySet()) {\n\t \t// Only need to check for keys (region counters) incrementally\n\t if (key1 < key2) {\n\t ArrayList<String> list2 = boundedRegionPointsMap.get(key2);\n\t for(String point : list2) {\n\t \t// If there is an intersecting point in two regions, merge them.\n\t if (list1.contains(point)) {\n\t list1.addAll(list2);\n\t // Just to make sure there won't be any duplicate points introduced after the merge.\n\t Set<String> uniquePoints = new HashSet<String>(list1);\n\t boundedRegionPointsMap.put(key1, new ArrayList<String>(uniquePoints));\n\t break;\n\t }\n\t }\n\t }\n\t }\n\n\t }\n\t return boundedRegionPointsMap;\n\t}", "private double intersect(double start0, double end0, double start1, double end1)\n {\n double length = Double.min(end0, end1) - Double.max(start0, start1);\n return Double.min(Double.max(0, length), 1.0);\n }", "public boolean isIntersectLineInMiddle(Line line) {\n\t\tdouble a = subFloat(firstPoint.y, secondPoint.y); // a = firstPoint.y - secondPoint.y\n\t\tdouble b = subFloat(secondPoint.x, firstPoint.x); // b = secondPoint.x - firstPoint.x\n\t\tdouble c = subFloat(multiFloat(-a, firstPoint.x), multiFloat(b, firstPoint.y));\n\t\t// c = -a * firstPoint.x - b * firstPoint.y\n\n\t\tdouble aLine = subFloat(line.firstPoint.y, line.secondPoint.y); // aLine = line.firstPoint.y -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.secondPoint.y\n\t\tdouble bLine = subFloat(line.secondPoint.x, line.firstPoint.x); // bLine = line.secondPoint.x -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.firstPoint.x\n\t\tdouble cLine = subFloat(multiFloat(-aLine, line.firstPoint.x), multiFloat(bLine, line.firstPoint.y));\n\t\t// cLine = -aLine * line.firstPoint.x - bLine * line.firstPoint.y\n\n\t\t// 4 points on same line\n\t\t// (a * line.firstPoint.x + b * line.firstPoint.y + c == 0) &&\n\t\t// (a * line.secondPoint.x + b * line.secondPoint.y + c == 0)\n\t\tif ((addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c) == 0)\n\t\t\t\t&& (addFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c) == 0)) {\n\t\t\tif ((firstPoint.distanceFrom(line.firstPoint) >= getLength()\n\t\t\t\t\t&& firstPoint.distanceFrom(line.secondPoint) >= this.getLength())\n\t\t\t\t\t|| (secondPoint.distanceFrom(line.firstPoint) >= this.getLength()\n\t\t\t\t\t\t\t&& secondPoint.distanceFrom(line.secondPoint) >= this.getLength()))\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\n\t\t// ((a * line.firstPoint.x + b * line.firstPoint.y + c) * (a *\n\t\t// line.secondPoint.x + b * line.secondPoint.y + c) < 0) &&\n\t\t// ((aLine * firstPoint.x + bLine * firstPoint.y + cLine) * (aLine *\n\t\t// secondPoint.x + bLine * secondPoint.y + cLine) < 0)\n\t\tif ((multiFloat(addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c),\n\t\t\t\taddFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c)) < 0)\n\t\t\t\t&& (multiFloat(addFloat(multiFloat(aLine, firstPoint.x), multiFloat(bLine, firstPoint.y), cLine),\n\t\t\t\t\t\taddFloat(multiFloat(aLine, secondPoint.x), multiFloat(bLine, secondPoint.y), cLine)) < 0))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "static boolean intersectsOppositeEdges(S2Point n) {\n // The line L intersects opposite edges of the [-1,1]x[-1,1] (u,v) square if\n // and only exactly two of the corner vertices lie on each side of L. This\n // is true exactly when ||Nu| - |Nv|| >= |Nw|. The code below evaluates this\n // expression exactly (see comments above).\n double u = Math.abs(n.x);\n double v = Math.abs(n.y);\n double w = Math.abs(n.z);\n // If w is the smallest, the following line returns an exact result.\n if (Math.abs(u - v) != w) {\n return Math.abs(u - v) >= w;\n }\n // Otherwise u - v = w exactly, or w is not the smallest value. In either\n // case the following line returns the correct result.\n return (u >= v) ? (u - w >= v) : (v - w >= u);\n }", "private static boolean doBoundingBoxesIntersect(Rectangle a, Rectangle b) {\r\n\t return a.getMinX() <= b.getMaxX() \r\n\t && a.getMaxX() >= b.getMinX() \r\n\t && a.getMinY() <= b.getMaxY()\r\n\t && a.getMaxY() >= b.getMinY();\r\n\t}", "private void cleanIntersectionsFromCommonEndPoints (Coordinate[] endPointsA, Coordinate[] endPointsB, List<Coordinate> intersectionPoints) {\r\n\t\tif (intersectionPoints != null && intersectionPoints.size()>0) {\r\n\t\t\tfor (int i = 0; i<endPointsA.length; i++) {\r\n\t\t\t\tif (endPointsA[i].equals2D(endPointsB[i])) {\r\n\t\t\t\t\tif (intersectionPoints.contains(endPointsA[i])) {\r\n\t\t\t\t\t\tintersectionPoints.remove(intersectionPoints.indexOf(endPointsA[i]));\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}", "private boolean isIntersected(Waypoint w1, Waypoint w2, Waypoint w3, Waypoint w4){\n\t\tint o1 = this.orientation(w1, w2, w3);\n\t\tint o2 = this.orientation(w1, w2, w4);\n\t\tint o3 = this.orientation(w3, w4, w1);\n\t\tint o4 = this.orientation(w3, w4, w2);\n\t\tboolean intersected = false;\n\t\t\n\t\tif (o1 != o2 && o3 != o4){\n\t\t\tintersected = true;\n\t\t}\n//\t\tCheck if the two segmenets are colinear and they intersect\n//\t\tif (o1 == 0 && this.pointOnSegment(w1, w2, w3)) {\n//\t\t\tintersected = true;\n//\t\t\treturn intersected;\n//\t\t}\n//\n//\t\t\n//\t\tif (o2 == 0 && this.pointOnSegment(w1, w2, w4)) {\n//\t\t\tintersected = true;\n//\t\t\treturn intersected;\t\t\t\n//\t\t}\n//\t\t\n//\t\tif (o3 == 0 && this.pointOnSegment(w3, w4, w1)) {\n//\t\t\tintersected = true;\n//\t\t\treturn intersected;\t\n//\t\t}\n//\t\t\n//\t\tif (o4 == 0 && this.pointOnSegment(w3, w4, w2)) {\n//\t\t\tintersected = true;\n//\t\t\treturn intersected;\n//\t}\n\t\treturn intersected;\n\t}", "static boolean intersectsRect(R2Vector a, R2Vector b, R2Rect rect) {\n // First check whether the bound of AB intersects \"rect\".\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (!rect.intersects(bound)) {\n return false;\n }\n\n // Otherwise AB intersects \"rect\" if and only if all four vertices of \"rect\"\n // do not lie on the same side of the extended line AB. We test this by\n // finding the two vertices of \"rect\" with minimum and maximum projections\n // onto the normal of AB, and computing their dot products with the edge\n // normal.\n R2Vector n = R2Vector.sub(b, a).ortho();\n int i = (n.x >= 0) ? 1 : 0;\n int j = (n.y >= 0) ? 1 : 0;\n double max = n.dotProd(R2Vector.sub(rect.getVertex(i, j), a));\n double min = n.dotProd(R2Vector.sub(rect.getVertex(1 - i, 1 - j), a));\n return (max >= 0) && (min <= 0);\n }", "private boolean overlapsWith(int offset1, int length1, int offset2, int length2) {\n \t\tint end= offset2 + length2;\n \t\tint thisEnd= offset1 + length1;\n \n \t\tif (length2 > 0) {\n \t\t\tif (length1 > 0)\n \t\t\t\treturn offset1 < end && offset2 < thisEnd;\n \t\t\treturn offset2 <= offset1 && offset1 < end;\n \t\t}\n \n \t\tif (length1 > 0)\n \t\t\treturn offset1 <= offset2 && offset2 < thisEnd;\n \t\treturn offset1 == offset2;\n \t}", "private boolean overlaps(Point2D p0, Point2D p1)\n {\n return Math.abs(p0.getX() - p1.getX()) < 0.001 && Math.abs(p0.getY() - p1.getY()) < 0.001;\n }", "private boolean collides2d(double testMinX, double testMaxX, double testMinY, double testMaxY, double otherMinX, double otherMaxX, double otherMinY, double otherMaxY, double otherExtrudeX, double otherExtrudeY) {\n if (otherExtrudeX == 0)\n return true; //prevent division by 0\n double slope = otherExtrudeY / otherExtrudeX;\n double height;\n double height2;\n Coordinate2D lowerPoint;\n Coordinate2D upperPoint;\n if (otherExtrudeX > 0) { //extruding to the right\n height = -(slope * (otherExtrudeY > 0 ? otherMaxX : otherMinX)) + otherMinY;\n height2 = -(slope * (otherExtrudeY > 0 ? otherMinX : otherMaxX)) + otherMaxY;\n lowerPoint = new Coordinate2D((otherExtrudeY > 0 ? testMaxX : testMinX), testMinY);\n upperPoint = new Coordinate2D((otherExtrudeY > 0 ? testMinX : testMaxX), testMaxY);\n } else { //extruding to the left\n height = -(slope * (otherExtrudeY <= 0 ? otherMaxX : otherMinX)) + otherMinY;\n height2 = -(slope * (otherExtrudeY <= 0 ? otherMinX : otherMaxX)) + otherMaxY;\n lowerPoint = new Coordinate2D((otherExtrudeY <= 0 ? testMaxX : testMinX), testMinY);\n upperPoint = new Coordinate2D((otherExtrudeY <= 0 ? testMinX : testMaxX), testMaxY);\n }\n Line lowerLine = new Line(height, slope);\n Line upperLine = new Line(height2, slope);\n return (lowerPoint.getY() <= upperLine.getYatX(lowerPoint.getX()) && upperPoint.getY() >= lowerLine.getYatX(upperPoint.getX()));\n }", "public static boolean intersectsRectanglePolygon(int rx, int ry, int rWidth, int rHeight, Vector2i[] polygon, List<Vector2i> intersections) {\n\n\t\tint minX = rx;\n\t\tint minY = ry;\n\t\tint maxX = rx + rWidth;\n\t\tint maxY = ry + rHeight;\n\t\t\n\t\tint numPointsInRect = 0;\n\t\tfor(Vector2i v : polygon) {\n\t\t\tif(pointInRectangle(minX, minY, maxX, maxY, v.x, v.y)) { numPointsInRect++; }\n\t\t}\n\t\tif(numPointsInRect > 0) { return true; }\n\t\t\n\t\tint numPointsInPolygon = 0;\n\t\tif(pointInPolygon(polygon, minX, minY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, maxX, minY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, maxX, maxY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, minX, maxY)) { numPointsInPolygon++; }\n\t\tif(numPointsInPolygon > 0) { return true; }\n\n\t\tif(intersections != null) {\n\t\t\tint numIntersections = 0;\n\t\t\tfor(int i=0; i<polygon.length; i++) {\n\t\t\t\tint x1 = polygon[i].x;\n\t\t\t\tint y1 = polygon[i].y;\n\t\t\t\tint x2 = polygon[(i+1) % polygon.length].x;\n\t\t\t\tint y2 = polygon[(i+1) % polygon.length].y;\n\t\t\t\tVector2i v1 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, minY, maxX, minY, v1)) { numIntersections++; intersections.add(v1); }\n\t\t\t\tVector2i v2 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, minY, maxX, maxY, v2)) { numIntersections++; intersections.add(v2); }\n\t\t\t\tVector2i v3 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, maxY, minX, maxY, v3)) { numIntersections++; intersections.add(v3); }\n\t\t\t\tVector2i v4 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, maxY, maxX, minY, v4)) { numIntersections++; intersections.add(v4); }\n\t\t\t}\n\t\t\tif(numIntersections > 0) { return true;}\n\t\t\t\n\t\t} else {\n\t\t\tfor(int i=0; i<polygon.length; i++) {\n\t\t\t\tint x1 = polygon[i].x;\n\t\t\t\tint y1 = polygon[i].y;\n\t\t\t\tint x2 = polygon[(i+1) % polygon.length].x;\n\t\t\t\tint y2 = polygon[(i+1) % polygon.length].y;\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, minY, maxX, minY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, minY, maxX, maxY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, maxY, minX, maxY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, maxY, maxX, minY, null)) { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private boolean isOverlapped(BpmnShape s1, BpmnShape s2){\n\t\t\n\t\ttry{\n\t\t\t//Two tasks\n\t\t\tif (s1.getBpmnElement() instanceof Task && s2.getBpmnElement() instanceof Task)\n\t\t\t\treturn this.overlappingTasks(s1,s2);\n\t\t\t\n\t\t\t//Two Events\n\t\t\tif (s1.getBpmnElement() instanceof Event && s2.getBpmnElement() instanceof Event) {\n\t\t\t\treturn this.overlappingEvents(s1,s2);\n\t\t\t}\n\t\t\t\n\t\t\t//Two Gateways\n\t\t\tif (s1.getBpmnElement() instanceof Gateway && s2.getBpmnElement() instanceof Gateway)\n\t\t\t\treturn this.overlappingGateways(s1,s2);\n\t\t\t\n\t\t\t//One Task and one Event\n\t\t\tif (s1.getBpmnElement() instanceof Task && s2.getBpmnElement() instanceof Event)\n\t\t\t\treturn this.overlappingTaskAndEvent(s1,s2);\n\t\t\t\n\t\t\tif (s1.getBpmnElement() instanceof Event && s2.getBpmnElement() instanceof Task )\n\t\t\t\treturn this.overlappingTaskAndEvent(s2, s1);\n\t\t\t\n\t\t\t//One Task and one Gateway \n\t\t\tif (s1.getBpmnElement() instanceof Task && s2.getBpmnElement() instanceof Gateway)\n\t\t\t\treturn this.overlappingTaskAndGateway(s1,s2);\n\t\t\t\n\t\t\tif (s1.getBpmnElement() instanceof Gateway && s2.getBpmnElement() instanceof Task )\n\t\t\t\treturn this.overlappingTaskAndGateway(s2, s1);\t\t\n\t\t\t\n\t\t\t//One Event and one Gateway\n\t\t\tif (s1.getBpmnElement() instanceof Event && s2.getBpmnElement() instanceof Gateway)\n\t\t\t\treturn this.overlappingEventAndGateway(s1,s2);\n\t\t\t\n\t\t\tif (s1.getBpmnElement() instanceof Gateway && s2.getBpmnElement() instanceof Event)\n\t\t\t\treturn this.overlappingEventAndGateway(s2, s1);\n\t\t}catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\treturn false;\n\t}", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "public static boolean intersectsPolygonPolygon(Vector2i[] polygon1, Vector2i[] polygon2) {\n\t\tint numPointsInPoly1 = 0;\n\t\tfor(Vector2i v1 : polygon1) {\n\t\t\tif(pointInPolygon(polygon1, v1.x, v1.y)) { numPointsInPoly1++; }\n\t\t}\n\t\tif(numPointsInPoly1 > 0) { return true; }\n\t\t\n\t\tint numPointsInPoly2 = 0;\n\t\tfor(Vector2i v2 : polygon2) {\n\t\t\tif(pointInPolygon(polygon2, v2.x, v2.y)) { numPointsInPoly2++; }\n\t\t}\n\t\tif(numPointsInPoly2 > 0) { return true; }\n\t\t\n\t\tfor(int i=0; i<polygon1.length; i++) {\n\t\t\tint x1 = polygon1[i].x;\n\t\t\tint y1 = polygon1[i].y;\n\t\t\tint x2 = polygon1[(i+1) % polygon1.length].x;\n\t\t\tint y2 = polygon1[(i+1) % polygon1.length].y;\n\t\t\tfor(int j=0; j<polygon2.length; j++) {\n\t\t\t\tint x3 = polygon1[j].x;\n\t\t\t\tint y3 = polygon1[j].y;\n\t\t\t\tint x4 = polygon1[(j+1) % polygon2.length].x;\n\t\t\t\tint y4 = polygon1[(j+1) % polygon2.length].y;\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, x3, y3, x4, y4, null)) { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "Multimap<String, String> intersects(Circle bounds);", "boolean intersects( Geometry gmo );", "private static boolean isBetween(double start, double middle, double end) {\n if(start > end) {\n return end <= middle && middle <= start;\n }\n else {\n return start <= middle && middle <= end;\n }\n }", "public static boolean\nraysIntersectInPlane(Point2D tail0Pt, Point2D head0Pt, Point2D tail1Pt, Point2D head1Pt,\n\tPoint2D intersect, double[] uArray)\n{\n\tdouble tmp = ((head1Pt.getY() - tail1Pt.getY())*(head0Pt.getX() - tail0Pt.getX()) - (head1Pt.getX() - tail1Pt.getX())*(head0Pt.getY() - tail0Pt.getY()));\n\tif(tmp == 0.0)\n\t\treturn(false);\n\tdouble tmpv = ((tail1Pt.getX() - tail0Pt.getX())*(head0Pt.getY() - tail0Pt.getY()) - (tail1Pt.getY() - tail0Pt.getY())*(head0Pt.getX() - tail0Pt.getX())) / tmp;\n\ttmp = (head0Pt.getX() - tail0Pt.getX())*(head1Pt.getY() - tail1Pt.getY()) - (head1Pt.getX() - tail1Pt.getX())*(head0Pt.getY() - tail0Pt.getY());\n\tif(tmp == 0.0)\n\t\treturn(false);\n\tdouble tmpu = ((tail1Pt.getX() - tail0Pt.getX())*(head1Pt.getY() - tail1Pt.getY()) + (head1Pt.getX() - tail1Pt.getX())*(tail0Pt.getY() - tail1Pt.getY()))/tmp;\n\n\tintersect.setLocation(\n\t\ttail1Pt.getX() + tmpv*(head1Pt.getX() - tail1Pt.getX()),\n\t\ttail1Pt.getY() + tmpv*(head1Pt.getY() - tail1Pt.getY()));\n\n\t// intersect[ZCoor] = tail1Pt[ZCoor] + tmpv*(head1Pt[ZCoor] - tail1Pt[ZCoor]);\n\n\tuArray[0] = tmpu; // u of first ray\n\tuArray[1] = tmpv; // u of second ray\n\n\treturn (true);\n}", "private boolean overlappingTasks(BpmnShape s1, BpmnShape s2) {\n\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\t//The coordinates refer to the upper-left corner of the task, adding Width and Height \n\t\t//cause the coordinates to reflect the position of the center of the shape\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondX = s2.getBounds().getX() + secondWidth;\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-shape\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t//completely overlapped shapes\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\t//second shape is on top of the first one\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\t//second shape is on the right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\t//second shape is on bottom of the first one\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\t//second shape is on the left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static boolean intersectsRectangleLine(int rx, int ry, int rWidth, int rHeight, int lx1,int ly1, int lx2, int ly2, List<Vector2i> intersections) {\n\t\t\n\t\tint minX = rx;\n\t\tint minY = ry;\n\t\tint maxX = rx + rWidth;\n\t\tint maxY = ry + rHeight;\n\t\t\n\t\t//both points of one side of rectangle\n\t\tif(minX > lx1 && minX > lx2) { return false; }\n\t\tif(minY > ly1 && minY > ly2) { return false; }\n\t\tif(maxX < lx1 && maxX < lx2) { return false; }\n\t\tif(maxY < ly1 && maxY < ly2) { return false; }\n\n\t\t//both points of line inside rectangle\n\t\tif(\tlx1 > minX && lx1 < maxX &&\n\t\t\tlx2 > minX && lx2 < maxX &&\n\t\t\tly1 > minY && ly1 < maxY &&\n\t\t\tly2 > minY && ly2 < maxY\t) { return true; }\n\t\t\n\t\t//check line-line\n\t\tif(intersections != null) {\n\t\t\tint numIntersections = 0;\n\t\t\tVector2i v1 = new Vector2i();\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, minY, maxX, minY, v1)) { numIntersections++; if(intersections!=null) intersections.add(v1); };\n\t\t\tVector2i v2 = new Vector2i();\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, maxX, minY, maxX, maxY, v2)) { numIntersections++; if(intersections!=null) intersections.add(v2); };\n\t\t\tVector2i v3 = new Vector2i();\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, maxY, maxX, maxY, v3)) { numIntersections++; if(intersections!=null) intersections.add(v3); };\n\t\t\tVector2i v4 = new Vector2i();\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, maxY, minX, minY, v4)) { numIntersections++; if(intersections!=null) intersections.add(v4); };\n\t\t\tif(numIntersections > 0) { return true; }\n\t\t} else {\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, minY, maxX, minY, null)) { return true; };\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, maxX, minY, maxX, maxY, null)) { return true; };\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, maxY, maxX, maxY, null)) { return true; };\n\t\t\tif(intersectsLineLine(lx1, ly1, lx2, ly2, minX, maxY, minX, minY, null)) { return true; };\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "private String checkSegments(ArrayList<DataSegment> list, int start, int end) {\n if (list.isEmpty()) return \"38020\";\n if (list.get(0).getSegmentStart()!=start) return \"38021\";\n if (list.get(list.size()-1).getSegmentEnd()!=end) return \"38022\";\n int lastend=start-1; \n for (int i=0;i<list.size();i++) {\n DataSegment segment=list.get(i);\n if (segment.getSegmentStart()!=lastend+1) return \"38023[\"+(i+1)+\"/\"+(list.size())+\"]\";\n lastend=segment.getSegmentEnd();\n if (lastend>end) return \"38024[\"+(i+1)+\"/\"+(list.size())+\"]\";\n }\n return null;\n }", "private static boolean computeBelongingToPolygon(\n final int[] xArr,\n final int[] yArr,\n final int pointCount,\n //\n final int x,\n final int y) {\n\n int hits = 0;\n\n int lastx = xArr[pointCount - 1];\n int lasty = yArr[pointCount - 1];\n int curx;\n int cury;\n\n // Looping on edges.\n for (int i = 0; i < pointCount; lastx = curx, lasty = cury, i++) {\n curx = xArr[i];\n cury = yArr[i];\n\n if (cury == lasty) {\n // Point on same line.\n continue;\n }\n\n int leftx;\n if (curx < lastx) {\n // Going left.\n if (x >= lastx) {\n // But not as far as before.\n continue;\n }\n // New leftmost.\n leftx = curx;\n } else {\n // Going rightish.\n if (x >= curx) {\n continue;\n }\n leftx = lastx;\n }\n\n double test1;\n double test2;\n if (cury < lasty) {\n if ((y < cury) || (y >= lasty)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - curx;\n test2 = y - cury;\n } else {\n if ((y < lasty) || (y >= cury)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - lastx;\n test2 = y - lasty;\n }\n\n /*\n * JDK code uses \"test1 < (test2 / dy * dx)\" here,\n * but we want to avoid the division.\n */\n final int dx = (lastx - curx);\n final int dy = (lasty - cury);\n if (dy < 0) {\n if (test1 * dy > test2 * dx) {\n hits++;\n }\n } else {\n if (test1 * dy < test2 * dx) {\n hits++;\n }\n }\n }\n\n return ((hits & 1) != 0);\n }", "private boolean overlappingEventAndGateway(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX();\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble apothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstWidth > secondX - apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "boolean checkPointInsidePolygon(Point[] points, PVector input) {\n\t\tint i, j;\n\t\tboolean c = false;\n\t\tfor (i = 0, j = points.length - 1; i < points.length; j = i++) {\n\t\t\tif (((points[i].y > input.y) != (points[j].y > input.y))\n\t\t\t\t\t&& (input.x < (points[j].x - points[i].x) * (input.y - points[i].y) / (points[j].y - points[i].y)\n\t\t\t\t\t\t\t+ points[i].x))\n\t\t\t\tc = !c;\n\t\t}\n\t\treturn c;\n\t}", "public boolean onSegment(Line line) {\n\n // Define minimum and maximum for X and Y values.\n double maxX = Math.max(line.start().getX(), line.end().getX());\n double maxY = Math.max(line.start().getY(), line.end().getY());\n double minX = Math.min(line.start().getX(), line.end().getX());\n double minY = Math.min(line.start().getY(), line.end().getY());\n\n // Calculation deviation.\n double d = 0.0000000001;\n\n // Check if this point is in between minimum and maximum and return result.\n return minX - d <= this.x && this.x <= maxX + d && minY - d <= this.y && this.y <= maxY + d;\n\n }", "@Test\n public void testOverboundsInside() {\n Coordinate a, b, c, d;\n a = new Coordinate2D(2, 2, 0);\n b = new Coordinate2D(3, 3, 0);\n c = new Coordinate2D(2, 0, 0);\n d = new Coordinate2D(4, 2, 0);\n\n int actual, expected;\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(a);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(b);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(c);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(d);\n assertEquals(expected, actual);\n }", "private boolean overlaps(int x1, int z1, int x2, int z2, int radius)\r\n {\r\n int var6 = x1 - x2;\r\n int var7 = z1 - z2;\r\n return var6 >= -radius && var6 <= radius ? var7 >= -radius && var7 <= radius : false;\r\n }", "public boolean isPointInLine(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "private boolean overlappingTaskAndGateway(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble apothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstWidth > secondX - apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "boolean between(tPoint p2)\n {\n if (! this.collinear(p2))\n return false;\n \n //check to see if line is vertical\n if (this.p0.x != this.p1.x)\n {\n //if not vertical, check to see if point overlaps in x\n return (((this.p0.x < p2.x) && (p2.x < this.p1.x)) |\n ((this.p0.x > p2.x) && (p2.x > this.p1.x)));\n }\n else\n {\n //if vertical, check to see if point overlaps in y\n return (((this.p0.y < p2.y) && (p2.y < this.p1.y)) |\n ((this.p0.y > p2.y) && (p2.y > this.p1.y)));\n }\n }", "int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2);", "private boolean isOverlapping( int[] t0, int[] t1)\n {\n if ( t0.length == 1)\n {\n return t0[ 0] >= t1[ 0]; \n }\n else\n {\n return t0[ 1] >= t1[ 0]; \n }\n }", "public boolean overlaps(Triangle2D t) {\n\t\treturn true;\n\t}", "@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // There are 6 possible edge orderings at a shared vertex (all\n // of these orderings are circular, i.e. abcd == bcda):\n //\n // (1) a2 b2 b0 a0: A contains B\n // (2) a2 a0 b0 b2: B contains A\n // (3) a2 a0 b2 b0: A and B are disjoint\n // (4) a2 b0 a0 b2: A and B intersect in one wedge\n // (5) a2 b2 a0 b0: A and B intersect in one wedge\n // (6) a2 b0 b2 a0: A and B intersect in two wedges\n //\n // In cases (4-6), the boundaries of A and B cross (i.e. the boundary\n // of A intersects the interior and exterior of B and vice versa).\n // Thus we want to distinguish cases (1), (2-3), and (4-6).\n //\n // Note that the vertices may satisfy more than one of the edge\n // orderings above if two or more vertices are the same. The tests\n // below are written so that we take the most favorable\n // interpretation, i.e. preferring (1) over (2-3) over (4-6). In\n // particular note that if orderedCCW(a,b,c,o) returns true, it may be\n // possible that orderedCCW(c,b,a,o) is also true (if a == b or b == c).\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // The cases with this vertex ordering are 1, 5, and 6,\n // although case 2 is also possible if a2 == b2.\n if (orderedCCW(b2, b0, a0, ab1)) {\n return 1; // Case 1 (A contains B)\n }\n\n // We are in case 5 or 6, or case 2 if a2 == b2.\n return (a2.equalsPoint(b2)) ? 0 : -1; // Case 2 vs. 5,6.\n }\n // We are in case 2, 3, or 4.\n return orderedCCW(a0, b0, a2, ab1) ? 0 : -1; // Case 2,3 vs. 4.\n }", "public boolean hasIntersectionSegment(Line3D line) {\n List<Point3D> list = new ArrayList();\n /*\n for (Face3D face : faces)\n if (face.intersectionSegment(line, list) > 0)\n return true;*/\n return false;\n }", "public boolean isInRect2(Line l1, Line l2, Line l3, Line l4, Point p) {\n\t\tif (Line.isBetween2Lines2(l1, l2, p) && Line.isBetween2Lines2(l3, l4, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public LineSegment ifEndStrokeValid(Point[] mapPoints, Point endPoint) {\n if (isValidStroke) {\n points.clear();\n Point validPoint = getClosestPoint(mapPoints, endPoint);\n if (validPoint != null) {\n //make sure first point and current point aren't the same\n if (firstPoint.x != validPoint.x && firstPoint.y != validPoint.y) {\n return new LineSegment(firstPoint, validPoint);\n }\n }\n }\n isValidStroke = false;\n return null;\n }", "private static boolean isPointOnLine(LineSegment a, Point2D b) {\r\n\t // Move the image, so that a.first is on (0|0)\r\n\t LineSegment aTmp = new LineSegment(new PointDouble(0, 0), new PointDouble(\r\n\t a.endPoint.getX() - a.startPoint.getX(), a.endPoint.getY() - a.startPoint.getY()));\r\n\t PointDouble bTmp = new PointDouble(b.getX() - a.startPoint.getX(), b.getY() - a.startPoint.getY());\r\n\t double r = crossProduct(aTmp.endPoint, bTmp);\r\n\t return Math.abs(r) < 0.000001;\r\n\t}", "boolean isPartiallyOverlapped(int[] x, int[] y) {\n return y[0] <= x[1]; //정렬이 이미 되어 있어서 simplify 할 수 있음\n }", "public static boolean isInsidePolygon(int[] nPolyPoints, double nX, double nY)\n\t{\n\t\tint nCount = 0;\n\t\tSegIterator oSegIt = new SegIterator(nPolyPoints);\n\t\twhile (oSegIt.hasNext())\n\t\t{\n\t\t\tint[] oLine = oSegIt.next();\n\t\t\tint nX1 = oLine[1];\n\t\t\tint nX2 = oLine[3];\n\t\t\tint nY1 = oLine[0];\n\t\t\tint nY2 = oLine[2];\n\n\t\t\tif ((nY1 < nY && nY2 >= nY || nY2 < nY && nY1 >= nY)\n\t\t\t && (nX1 <= nX || nX2 <= nX)\n\t\t\t && (nX1 + (nY - nY1) / (nY2 - nY1) * (nX2 - nX1) < nX))\n\t\t\t\t++nCount;\n\t\t}\n\t\treturn (nCount & 1) != 0;\n\t}", "@Test\n public void isOverlap_interval1ContainsInterval2OnEnd_trueReturned() throws Exception{\n Interval interval1 = new Interval(-1,5);\n Interval interval2 = new Interval(0,3);\n\n boolean result = SUT.isOverlap(interval1,interval2);\n Assert.assertThat(result,is(true));\n }", "private boolean inPolygonLineCount(Double[] p, double x, double y) {\n\t\t\t\tint crosscount = 0;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < p.length ; i++) {\n\t\t\t\t\tdouble pix = p[i].x;\n\t\t\t\t\tdouble piy = p[i].y;\n\t\t\t\t\tdouble pi1x = p[(i+1) % p.length].x;\n\t\t\t\t\tdouble pi1y = p[(i+1) % p.length].y;\n\t\t\t\t\tdouble vx = pi1x - pix;\n\t\t\t\t\tdouble vy = pi1y - piy;\n\t\t\t\t\tdouble xint = pix + ((y-piy) / vy) * vx;\n\t\t\t\t\tif (pix > x || pi1x > x) {\n\t\t\t\t\t\tif (piy < y && y <= pi1y && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t} else if (pi1y < y && y <= piy && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn crosscount%2 == 1;\n\t\t\t}", "public static int sameSegment(Point2D pa0, Point2D pa1, Point2D pb0, Point2D pb1) {\r\n return (pa0.equals(pb0) && pa1.equals(pb1)) ? EQUALSEGMENT : (pa0.equals(pb1) && pa1.equals(pb0) ? OPPOSITESEGMENT : DIFFERENTSEGMENT);\r\n }" ]
[ "0.63838375", "0.62482864", "0.6226381", "0.6106183", "0.6057872", "0.6007602", "0.59950536", "0.594771", "0.5935924", "0.59080875", "0.59044874", "0.58827424", "0.58205616", "0.5817972", "0.57949334", "0.57702136", "0.5760156", "0.57351536", "0.57172704", "0.56287575", "0.5577003", "0.556493", "0.5559974", "0.5538082", "0.5510414", "0.54764426", "0.5474422", "0.5473283", "0.5465334", "0.5457567", "0.54529893", "0.54445183", "0.5443201", "0.54054534", "0.5398493", "0.53917944", "0.5377805", "0.5372672", "0.536733", "0.53670824", "0.5359018", "0.5322528", "0.5304122", "0.53002715", "0.5293015", "0.5288762", "0.52847505", "0.52760994", "0.52511233", "0.5246731", "0.52444655", "0.52400076", "0.52381927", "0.5223672", "0.5217381", "0.520303", "0.5165144", "0.51536745", "0.5152706", "0.51492965", "0.51464736", "0.5145976", "0.5140238", "0.51400757", "0.5132687", "0.5131335", "0.51268154", "0.5115175", "0.5110283", "0.5108675", "0.5108573", "0.50943375", "0.5089906", "0.5076487", "0.506547", "0.5064007", "0.50610113", "0.5048439", "0.5046463", "0.50421697", "0.50389576", "0.5038454", "0.50368506", "0.50348914", "0.5034716", "0.5025934", "0.50111616", "0.5005326", "0.50011885", "0.4999106", "0.4998155", "0.4987861", "0.4983898", "0.4980469", "0.49665752", "0.49580026", "0.49551582", "0.4951248", "0.49430826", "0.4940533" ]
0.5975978
7
Verifies if a segment crosses a polygon defined as it lies within the polygon and intersects the polygon with only two points. The input is assumed to be in MAP coordinate. Note: 1. Do not repeat the first point at the end of the polygon.
private boolean segIntPoly( Coordinate[] segIn, Coordinate[] polyIn ) { boolean qualify = true; //Convert to grid coordinate. Coordinate[] seg = PgenUtil.latlonToGrid( segIn ); Coordinate[] poly = PgenUtil.latlonToGrid( polyIn ); //Get mid-point and form geometries. Coordinate[] midp = new Coordinate[1]; midp[0] = new Coordinate( (seg[0].x + seg[1].x) / 2.0, (seg[0].y + seg[1].y) / 2.0 ); Geometry point = GfaClip.getInstance().pointsToGeometry( midp ); Geometry polygon = GfaClip.getInstance().pointsToGeometry( poly ); //Disqualify if the segment lies outside of the polygon if ( !point.within( polygon ) ) { qualify = false; } else { Geometry segment = GfaClip.getInstance().pointsToGeometry( seg ); if ( segment.intersects( polygon ) ) { Coordinate[] ipts = segment.intersection( polygon ).getCoordinates(); /* * Disqualify if the segment intersects other segments of the polygon - * except the segments that share either the starting or ending * point with the segment on check. */ if ( ipts.length != 2 ) { qualify = false; } } } return qualify; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean rayCrossesSegment(LatLng point, LatLng a, LatLng b) {\n double px = point.longitude,\n py = point.latitude,\n ax = a.longitude,\n ay = a.latitude,\n bx = b.longitude,\n by = b.latitude;\n if (ay > by) {\n ax = b.longitude;\n ay = b.latitude;\n bx = a.longitude;\n by = a.latitude;\n }\n // alter longitude to cater for 180 degree crossings\n if (px < 0 || ax < 0 || bx < 0) {\n px += 360;\n ax += 360;\n bx += 360;\n }\n // if the point has the same latitude as a or b, increase slightly py\n if (py == ay || py == by) py += 0.00000001;\n\n\n // if the point is above, below or to the right of the segment, it returns false\n if ((py > by || py < ay) || (px > Math.max(ax, bx))) {\n return false;\n }\n // if the point is not above, below or to the right and is to the left, return true\n else if (px < Math.min(ax, bx)) {\n return true;\n }\n // if the two above conditions are not met, you have to compare the slope of segment [a,b] (the red one here) and segment [a,p] (the blue one here) to see if your point is to the left of segment [a,b] or not\n else {\n double red = (ax != bx) ? ((by - ay) / (bx - ax)) : Double.POSITIVE_INFINITY;\n double blue = (ax != px) ? ((py - ay) / (px - ax)) : Double.POSITIVE_INFINITY;\n return (blue >= red);\n }\n\n }", "boolean _ptPoly(PVector pt, PVector[] poly) { \n // count edges crossed by the line connecting the target point to \"the outside\"\n int count = 0;\n \n for(int i = 0; i < poly.length; i++) {\n PVector a = poly[i], b = poly[(i+1)%poly.length]; // edge points\n if(_clockwise(a, pt, out) != _clockwise(b, pt, out) && // a & b on different sides of line\n _clockwise(a, b, pt) != _clockwise(a, b, out)) { // tgt & out on diff sides of edge\n count++;\n }\n }\n \n return count % 2 == 1;\n // a convex poly would be crossed on one edge;\n // concave could be crossed on any odd # of edges\n }", "private boolean inPolygonLineCount(Double[] p, double x, double y) {\n\t\t\t\tint crosscount = 0;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < p.length ; i++) {\n\t\t\t\t\tdouble pix = p[i].x;\n\t\t\t\t\tdouble piy = p[i].y;\n\t\t\t\t\tdouble pi1x = p[(i+1) % p.length].x;\n\t\t\t\t\tdouble pi1y = p[(i+1) % p.length].y;\n\t\t\t\t\tdouble vx = pi1x - pix;\n\t\t\t\t\tdouble vy = pi1y - piy;\n\t\t\t\t\tdouble xint = pix + ((y-piy) / vy) * vx;\n\t\t\t\t\tif (pix > x || pi1x > x) {\n\t\t\t\t\t\tif (piy < y && y <= pi1y && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t} else if (pi1y < y && y <= piy && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn crosscount%2 == 1;\n\t\t\t}", "boolean checkPointInsidePolygon(Point[] points, PVector input) {\n\t\tint i, j;\n\t\tboolean c = false;\n\t\tfor (i = 0, j = points.length - 1; i < points.length; j = i++) {\n\t\t\tif (((points[i].y > input.y) != (points[j].y > input.y))\n\t\t\t\t\t&& (input.x < (points[j].x - points[i].x) * (input.y - points[i].y) / (points[j].y - points[i].y)\n\t\t\t\t\t\t\t+ points[i].x))\n\t\t\t\tc = !c;\n\t\t}\n\t\treturn c;\n\t}", "public static boolean intersectsLinePolygon(int x1, int y1, int x2, int y2, Vector2i[] polygon) {\n\n\t\tint n = polygon.length;\n\t\t\n\t\tint x3 = polygon[n-1].x;\n\t\tint y3 = polygon[n-1].y;\n\n\t\tfor(int i=0; i<n; i+=2) {\n\t\t\tint x4 = polygon[i].x;\n\t\t\tint y4 = polygon[i].y;\n\t\t\t\n\t\t\tint d = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\t\t\tif (d != 0) {\n\t\t\t\tint yd = y1 - y3;\n\t\t\t\tint xd = x1 - x3;\n\t\t\t\tint ua = ((x4 - x3) * yd - (y4 - y3) * xd) / d;\n\t\t\t\tif (ua >= 0 && ua <= 1) {\n\t\t\t\t\tint ub = ((x2 - x1) * yd - (y2 - y1) * xd) / d;\n\t\t\t\t\tif (ub >= 0 && ub <= 1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tx3 = x4;\n\t\t\ty3 = x4;\n\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean isOnSegment(Point2D point) {\n double x = point.getX();\n double y = point.getY();\n double val = this.a * x + this.b * y + this.c;\n if (val < 0.0) {\n val = -val;\n }\n if (val > EPS) {\n return false;\n }\n\n if ((x < (this.minx - EPS)) || (x > (this.maxx + EPS))) {\n return false;\n }\n if ((y < (this.miny - EPS)) || (y > (this.maxy + EPS))) {\n return false;\n }\n return true;\n }", "private boolean pointOnSegment(Waypoint w1, Waypoint w3, Waypoint w2){\n\t\tdouble w1x = w1.getX();\n\t\tdouble w1y = w1.getY();\n\t\tdouble w2x = w2.getX();\n\t\tdouble w2y = w2.getY();\n\t\tdouble w3x = w3.getX();\n\t\tdouble w3y = w3.getY();\n\t\t\n\t\tif (w3x <= Math.max(w1x, w2x) && w3x >= Math.min(w1x, w2x) && \n\t\t\tw3y <= Math.max(w1y, w2y) && w3y >= Math.min(w1y, w2y))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "private boolean polysegIntPoly( Coordinate[] seg, Coordinate[] poly ) {\n\t\t\n\t\tboolean qualify = true;\n\t\t\n\t\t//Disqualify if the segment's two end points are adjacent on the polygon.\n\t\tList<Coordinate> polyList = Arrays.asList( poly );\n\t\tint index1 = polyList.indexOf( seg[0] );\n\t\tint index2 = polyList.indexOf( seg[1] );\n\t\tint igap = Math.abs(index2 - index1 );\n\t\t\n\t\tif ( igap == 1 || igap == ( (poly.length) - 1 ) ) {\n\t\t\tqualify = false;\n\t\t}\n\t\telse {\t\t\t\t\t\t\t\n\t\t\tqualify = segIntPoly( seg, poly );\n\t\t}\n\t\t\n\t\treturn qualify;\n\t}", "@Override\n\tpublic boolean collidesWithPolygon(Polygon polygon) {\n\t\treturn false;\n\t}", "public boolean intersects(GLineSegment lineSegment) {\n if(this.equals(lineSegment)) return(true);\n else if(this.slope()==lineSegment.slope()) return(false);\n else {\n //complicated stuff here.\n return(false);\n }\n }", "static boolean isInside(Point polygon[], int n, Point p)\n {\n // There must be at least 3 vertices in polygon[]\n if (n < 3)\n {\n return false;\n }\n\n // Create a point for line segment from p to infinite\n Point extreme = new Point(10000, p.getY());\n\n // Count intersections of the above line\n // with sides of polygon\n int count = 0, i = 0;\n do\n {\n int next = (i + 1) % n;\n\n // Check if the line segment from 'p' to\n // 'extreme' intersects with the line\n // segment from 'polygon[i]' to 'polygon[next]'\n if (doIntersect(polygon[i], polygon[next], p, extreme))\n {\n // If the point 'p' is colinear with line\n // segment 'i-next', then check if it lies\n // on segment. If it lies, return true, otherwise false\n if (orientation(polygon[i], p, polygon[next]) == 0)\n {\n return onSegment(polygon[i], p,\n polygon[next]);\n }\n\n count++;\n }\n i = next;\n } while (i != 0);\n\n // Return true if count is odd, false otherwise\n return (count % 2 == 1); // Same as (count%2 == 1)\n }", "public static boolean pointInPolygon(Vector2i[] polygon, int x, int y) {\n\t\tint intersects = 0;\n\t\tfor(int i=0; i<polygon.length; i++) {\n\t\t\tint x1 = polygon[i].x;\n\t\t\tint y1 = polygon[i].y;\n\t\t\tint x2 = polygon[(i+1) % polygon.length].x;\n\t\t\tint y2 = polygon[(i+1) % polygon.length].y;\n\t\t\tif (((y1 <= y && y < y2) || (y2 <= y && y < y1)) && x < ((x2 - x1) / (y2 - y1) * (y - y1) + x1)) intersects++;\n\t\t}\n\t\treturn (intersects & 1) == 1;\n\t}", "public boolean intersects(S2Point v1) {\n boolean result = true;\n\n if ((v1.x < xmin && lastVertex.x < xmin) || (v1.x > xmax && lastVertex.x > xmax)) {\n result = false;\n } else if ((v1.y < ymin && lastVertex.y < ymin) || (v1.y > ymax && lastVertex.y > ymax)) {\n result = false;\n } else if ((v1.z < zmin && lastVertex.z < zmin) || (v1.z > zmax && lastVertex.z > zmax)) {\n result = false;\n }\n\n lastVertex = v1;\n return result;\n }", "Multimap<String, String> intersects(Polygon bounds);", "@Test\n void shouldBeInsideMap()\n {\n assertTrue(map.isInsideMap(new Vector2(0,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,4)));\n\n assertTrue(map.isInsideMap(new Vector2(1,3)));\n }", "public boolean contains2(Point p) {\n int crossings = 0;\n for (int i = 0; i < N; i++) {\n int j = i + 1;\n boolean cond1 = (a[i].y <= p.y) && (p.y < a[j].y);\n boolean cond2 = (a[j].y <= p.y) && (p.y < a[i].y);\n if (cond1 || cond2) {\n // need to cast to double\n if (p.x < (a[j].x - a[i].x) * (p.y - a[i].y) / (a[j].y - a[i].y) + a[i].x)\n crossings++;\n }\n }\n if (crossings % 2 == 1) return true;\n else return false;\n }", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "private Type establishIntersectionType() {\n\r\n\t\tdouble Pq0 = AngleUtil.getTurn(p0, p1, q0);\r\n\t\tdouble Pq1 = AngleUtil.getTurn(p0, p1, q1);\r\n\r\n\t\tdouble Qp0 = AngleUtil.getTurn(q0, q1, p0);\r\n\t\tdouble Qp1 = AngleUtil.getTurn(q0, q1, p1);\r\n\r\n\t\t// check if all turn have none angle. In this case, lines are collinear.\r\n\t\tif (Pq0 == AngleUtil.NONE && Pq1 == AngleUtil.NONE || Qp0 == AngleUtil.NONE && Qp1 == AngleUtil.NONE) {\r\n\t\t\t// at this point, we know that lines are collinear.\r\n\t\t\t// we must check if they overlap for segments intersection\r\n\t\t\tif (q0.getDistance(p0) <= p0.getDistance(p1) && q0.getDistance(p1) <= p0.getDistance(p1)) {\r\n\t\t\t\t// then q0 is in P limits and p0 or p1 is in Q limits\r\n\t\t\t\t// TODO this check is no sufficient\r\n\t\t\t\tinPLimits = true;\r\n\t\t\t\tinQLimits = true;\r\n\t\t\t}\r\n\t\t\treturn Type.COLLINEAR;\r\n\t\t}\r\n\t\t// check if q0 and q1 lie around P AND p0 and p1 lie around Q.\r\n\t\t// in this case, the two segments intersect\r\n\t\telse if (Pq0 * Pq1 <= 0 && Qp0 * Qp1 <= 0) {\r\n\t\t\t// else if(Pq0 <= 0 && Pq1 >= 0 && Qp0 <= 0 && Qp1 >= 0 ||\r\n\t\t\t// Pq0 >= 0 && Pq1 <= 0 && Qp0 >= 0 && Qp1 <= 0){\r\n\r\n\t\t\tinPLimits = true;\r\n\t\t\tinQLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t}\r\n\r\n\t\t// At this point, we know that segments are not crossing\r\n\t\t// check if q0 and q1 lie around P or p0 and p1 lie around Q.\r\n\t\t// in this case, a segment cross a line\r\n\t\telse if (Pq0 * Pq1 <= 0) {\r\n\t\t\tinQLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t} else if (Qp0 * Qp1 <= 0) {\r\n\t\t\tinPLimits = true;\r\n\t\t\treturn Type.INTERSECT;\r\n\t\t}\r\n\r\n\t\t// At this point, we know that each segment lie on one side of the other\r\n\t\t// We now check the slope to know if lines are Type.PARALLEL\r\n\t\tdouble pSlope = p0.getSlope(p1);\r\n\t\tdouble qSlope = q0.getSlope(q1);\r\n\t\tif (PrecisionUtil.areEquals(pSlope, qSlope))\r\n\t\t\t// TODO check the infinity case\r\n\t\t\t// this test works even if the slopes are \"Double.infinity\" due to the verticality of the lines and division\r\n\t\t\t// by 0\r\n\t\t\treturn Type.PARALLEL;\r\n\t\telse\r\n\t\t\treturn Type.INTERSECT;\r\n\t}", "@Test\n\t\tpublic void testIntersectAtEndPoints2(){\n\t\t\tGenericLineSegmentsIntersect v=new GenericLineSegmentsIntersect();\n\t\t\tint[][] lines={\n\t\t\t\t\t{1,5,5,1},\n\t\t\t\t\t{1,4,5,0},\n\t\t\t\t\t{2,2,6,10}\n\t\t\t};\n\n\t\t\tassertTrue(v.intersects(lines));\n\t\t}", "private static boolean computeBelongingToPolygon(\n final int[] xArr,\n final int[] yArr,\n final int pointCount,\n //\n final int x,\n final int y) {\n\n int hits = 0;\n\n int lastx = xArr[pointCount - 1];\n int lasty = yArr[pointCount - 1];\n int curx;\n int cury;\n\n // Looping on edges.\n for (int i = 0; i < pointCount; lastx = curx, lasty = cury, i++) {\n curx = xArr[i];\n cury = yArr[i];\n\n if (cury == lasty) {\n // Point on same line.\n continue;\n }\n\n int leftx;\n if (curx < lastx) {\n // Going left.\n if (x >= lastx) {\n // But not as far as before.\n continue;\n }\n // New leftmost.\n leftx = curx;\n } else {\n // Going rightish.\n if (x >= curx) {\n continue;\n }\n leftx = lastx;\n }\n\n double test1;\n double test2;\n if (cury < lasty) {\n if ((y < cury) || (y >= lasty)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - curx;\n test2 = y - cury;\n } else {\n if ((y < lasty) || (y >= cury)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - lastx;\n test2 = y - lasty;\n }\n\n /*\n * JDK code uses \"test1 < (test2 / dy * dx)\" here,\n * but we want to avoid the division.\n */\n final int dx = (lastx - curx);\n final int dy = (lasty - cury);\n if (dy < 0) {\n if (test1 * dy > test2 * dx) {\n hits++;\n }\n } else {\n if (test1 * dy < test2 * dx) {\n hits++;\n }\n }\n }\n\n return ((hits & 1) != 0);\n }", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "boolean contains(Polygon p);", "private static boolean isOnSegment(Coord p, Coord q, Coord r) \n {\n if(r.x <= Math.max(p.x, q.x) && r.x >= Math.min(p.x, q.x) && \n r.y <= Math.max(p.y, q.y) && r.y >= Math.min(p.y, q.y)) \n return true; \n return false; \n }", "Multimap<String, String> intersects(PointLatLng point);", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public boolean isInRect2(Point p) {\n\t\tLine AB = new Line(A1, B1);\n\t\tLine CD = new Line(C1, AB.getU());\n\t\tLine AD = new Line(A1, D1);\n\t\tLine BC = new Line(B1, AD.getU());\n\n\t\t// if(Line.isBetween2Lines2(AB, CD, p))\n\t\t// System.out.println(1);\n\t\t// if(Line.isBetween2Lines2(AD, BC, p))\n\t\t// System.out.println(2);\n\n\t\tif (Line.isBetween2Lines2(AB, CD, p) && Line.isBetween2Lines2(AD, BC, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "static int clipSegmentToLine(ClipVertex vOut[], ClipVertex vIn[],\n Vec2 normal, float offset) {\n int numOut = 0;\n\n // Calculate the distance of end points to the line\n float distance0 = Vec2.dot(normal, vIn[0].v) - offset;\n float distance1 = Vec2.dot(normal, vIn[1].v) - offset;\n\n // If the points are behind the plane\n if (distance0 <= 0.0f) {\n vOut[numOut] = new ClipVertex();\n vOut[numOut].id = new ContactID(vIn[0].id);\n vOut[numOut++].v = vIn[0].v.clone();\n }\n if (distance1 <= 0.0f) {\n vOut[numOut] = new ClipVertex();\n vOut[numOut].id = new ContactID(vIn[1].id);\n vOut[numOut++].v = vIn[1].v.clone();\n }\n\n // If the points are on different sides of the plane\n if (distance0 * distance1 < 0.0f) {\n // Find intersection point of edge and plane\n float interp = distance0 / (distance0 - distance1);\n vOut[numOut] = new ClipVertex();\n vOut[numOut].v.x = vIn[0].v.x + interp * (vIn[1].v.x - vIn[0].v.x);\n vOut[numOut].v.y = vIn[0].v.y + interp * (vIn[1].v.y - vIn[0].v.y);\n\n if (distance0 > 0.0f) {\n vOut[numOut].id = new ContactID(vIn[0].id);\n }\n else {\n vOut[numOut].id = new ContactID(vIn[1].id);\n }\n ++numOut;\n }\n\n return numOut;\n }", "void pointCheck(LatLng point, boolean valid);", "@Test\n public void testConstructor() {\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(0, 1, 0),\n new Point3D(1, 0, 0), new Point3D(-1, 1, 1));\n fail(\"Constructed a polygon with wrong order of vertices\");\n } catch (IllegalArgumentException e) {\n }\n\n // TC03: Not in the same plane\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(1, 0, 0),\n new Point3D(0, 1, 0), new Point3D(0, 2, 2));\n fail(\"Constructed a polygon with vertices that are not in the same plane\");\n } catch (IllegalArgumentException e) {\n }\n\n // TC04: Concave quadrangular\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(1, 0, 0),\n new Point3D(0, 1, 0), new Point3D(0.5, 0.25, 0.5));\n fail(\"Constructed a concave polygon\");\n } catch (IllegalArgumentException e) {\n }\n\n // =============== Boundary Values Tests ==================\n\n // TC10: Vertex on a side of a quadrangular\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(1, 0, 0),\n new Point3D(0, 1, 0), new Point3D(0, 0.5, 0.5));\n fail(\"Constructed a polygon with vertix on a side\");\n } catch (IllegalArgumentException e) {\n }\n\n // TC11: Last point = first point\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(1, 0, 0),\n new Point3D(0, 1, 0), new Point3D(0, 0, 1));\n fail(\"Constructed a polygon with vertice on a side\");\n } catch (IllegalArgumentException e) {\n }\n\n // TC12: Colocated points\n try {\n new Polygon(new Point3D(0, 0, 1), new Point3D(1, 0, 0),\n new Point3D(0, 1, 0), new Point3D(0, 1, 0));\n fail(\"Constructed a polygon with vertice on a side\");\n } catch (IllegalArgumentException e) {\n }\n\n }", "public static boolean isIntersecting(Coord p1, Coord q1, Coord p2, Coord q2) \n { \n // Find the four orientations needed for general and \n // special cases \n int o1 = orientation(p1, q1, p2); \n int o2 = orientation(p1, q1, q2); \n int o3 = orientation(p2, q2, p1); \n int o4 = orientation(p2, q2, q1); \n \n // General case \n if(o1 != o2 && o3 != o4) \n return true; \n \n // Special Cases \n // p1, q1 and p2 are colinear and p2 lies on segment p1q1 \n if (o1 == 0 && isOnSegment(p1, q1, p2)) return true; \n \n // p1, q1 and q2 are colinear and q2 lies on segment p1q1 \n if (o2 == 0 && isOnSegment(p1, q1, q2)) return true; \n \n // p2, q2 and p1 are colinear and p1 lies on segment p2q2 \n if (o3 == 0 && isOnSegment(p2, q2, p1)) return true; \n \n // p2, q2 and q1 are colinear and q1 lies on segment p2q2 \n if (o4 == 0 && isOnSegment(p2, q2, q1)) return true; \n \n return false; // Doesn't fall in any of the above cases \n }", "public boolean intersects(Segment2D segment2) {\n if (segment2 == null) {\n throw new IllegalArgumentException(\"can't pass null parameter\");\n }\n\n double det = this.a * segment2.b - this.b * segment2.a;\n if (Math.abs(det) < EPS) {\n if (this.isOnSegment(segment2.point1)) {\n return true;\n }\n if (this.isOnSegment(segment2.point2)) {\n return true;\n }\n if (segment2.isOnSegment(this.point1)) {\n return true;\n }\n if (segment2.isOnSegment(this.point2)) {\n return true;\n }\n return false;\n }\n\n double x = -(segment2.b * this.c - this.b * segment2.c) / det;\n double y = -(-segment2.a * this.c + this.a * segment2.c) / det;\n\n Point2D p = new Point2D.Double(x, y);\n if (!this.isOnSegment(p)) {\n return false;\n }\n if (!segment2.isOnSegment(p)) {\n return false;\n }\n return true;\n }", "public CFWRect intersectsLine( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//1.rejust rect\r\n\t\t//correct: (m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\r\n\t\tif(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange all\r\n\t\t\tCFWPoint poiTmp = m_poiLT;\r\n\t\t\tm_poiLT = m_poiRB;\r\n\t\t\tm_poiRB = poiTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX > m_poiRB.m_fX && m_poiLT.m_fY < m_poiRB.m_fY)\t{\r\n\t\t\t//exchange X\r\n\t\t\tfloat fXTmp = m_poiLT.m_fX;\r\n\t\t\tm_poiLT.m_fX = m_poiRB.m_fX;\r\n\t\t\tm_poiRB.m_fX = fXTmp;\r\n\t\t}\r\n\t\telse if(m_poiLT.m_fX < m_poiRB.m_fX && m_poiLT.m_fY > m_poiRB.m_fY)\t{\r\n\t\t\t//exchange Y\r\n\t\t\tfloat fYTmp = m_poiLT.m_fY;\r\n\t\t\tm_poiLT.m_fY = m_poiRB.m_fY;\r\n\t\t\tm_poiRB.m_fY = fYTmp;\r\n\t\t}\r\n\t\t//2.intersect test\r\n\t\tCFWPoint poiOutOfRect = new CFWPoint();\r\n\t\tboolean bPoiInsideRect = false;\r\n\t\tCFWRect rectRet = new CFWRect();\r\n\t\tif(!checkPoiInside( poiBegI, poiEndI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse if(!checkPoiInside( poiEndI, poiBegI))\t{\r\n\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\treturn(rectRet);\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\tif(isInsideArea( 9, poiBegI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\t\t//System.out.println(\"the line has no cross point with the rectangle!\");\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\t}\r\n\t\t\t\trectRet.m_poiLT = poiBegI;\r\n\t\t\t\tpoiOutOfRect = poiEndI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t\tif(isInsideArea( 9, poiEndI))\t{\r\n\t\t\t\tif(isInsideArea( 9, poiBegI))\r\n\t\t\t\t\treturn(rectRet);\r\n\t\t\t\trectRet.m_poiLT = poiEndI;\r\n\t\t\t\tpoiOutOfRect = poiBegI;\r\n\t\t\t\tbPoiInsideRect = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//3.intersect\r\n\t\t//if the line is vertical to X/Y, return the line segment\r\n\t\tif(poiEndI.m_fX == poiBegI.m_fX)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = poiEndI.m_fX;\r\n\t\t\t\t//less than the m_poiLT'Y, use the m_poiLT'Y\r\n\t\t\t\trectRet.m_poiLT.m_fY = Math.max( Math.min(poiBegI.m_fY, poiEndI.m_fY), m_poiLT.m_fY);\r\n\t\t\t\t//larger than m_poiRB's Y, use the m_poiRB's Y\r\n\t\t\t\trectRet.m_poiRB.m_fY = Math.min( Math.max(poiBegI.m_fY, poiEndI.m_fY), m_poiRB.m_fY);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fY < m_poiLT.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\telse if(poiOutOfRect.m_fY > m_poiRB.m_fY)\r\n\t\t\t\t\trectRet.m_poiRB.m_fY = m_poiRB.m_fY;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fX = poiEndI.m_fX;\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(poiEndI.m_fY == poiBegI.m_fY)\t{\r\n\t\t\tif(!bPoiInsideRect)\t{\r\n\t\t\t\trectRet.m_poiLT.m_fX = Math.max( Math.min( poiBegI.m_fX, poiEndI.m_fX), m_poiLT.m_fX);\r\n\t\t\t\trectRet.m_poiLT.m_fY = poiEndI.m_fY;\r\n\t\t\t\trectRet.m_poiRB.m_fX = Math.min( Math.max( poiBegI.m_fX, poiEndI.m_fX), m_poiRB.m_fX);\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\tif(poiOutOfRect.m_fX < m_poiLT.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\telse if(poiOutOfRect.m_fX > m_poiRB.m_fX)\r\n\t\t\t\t\trectRet.m_poiRB.m_fX = m_poiRB.m_fX;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trectRet.m_poiRB.m_fY = poiEndI.m_fY;\r\n\t\t}\r\n\t\telse\t{\r\n\t\t\t//build line function\r\n\t\t\tdouble dK = (poiEndI.m_fY - poiBegI.m_fY)/(poiEndI.m_fX - poiBegI.m_fX);\r\n\t\t\tdouble dB = poiBegI.m_fY - dK*poiBegI.m_fX;\r\n\t\t\t//find intersect points\r\n\t\t\tCFWPoint poiIntersA = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tCFWPoint poiIntersB = new CFWPoint( m_poiLT.m_fX - 1.0f, m_poiLT.m_fY - 1.0f, 0.0f);\r\n\t\t\tfloat fXTmpA = (float)((m_poiLT.m_fY - dB)/dK);\r\n\t\t\tfloat fXTmpB = (float)((m_poiRB.m_fY - dB)/dK);\r\n\t\t\tfloat fYTmpA = (float)(dK*m_poiLT.m_fX + dB);\r\n\t\t\tfloat fYTmpB = (float)(dK*m_poiRB.m_fX + dB);\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpA, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpA;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiLT.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fXTmpB, m_poiLT.m_fX, m_poiRB.m_fX, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersA.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = fXTmpB;\r\n\t\t\t\t\tpoiIntersB.m_fY = m_poiRB.m_fY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpA, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiLT.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpA;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(CFWMath.isBetweenTwoNum( fYTmpB, m_poiLT.m_fY, m_poiRB.m_fY, true))\t{\r\n\t\t\t\tif(poiIntersA.m_fX < m_poiLT.m_fX && poiIntersA.m_fY < m_poiLT.m_fY)\t{\r\n\t\t\t\t\tpoiIntersA.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersA.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t\telse\t{\r\n\t\t\t\t\tpoiIntersB.m_fX = m_poiRB.m_fX;\r\n\t\t\t\t\tpoiIntersB.m_fY = fYTmpB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(bPoiInsideRect)\t{\r\n\t\t\t\tCFWVector vecBE = new CFWVector(poiOutOfRect.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBA = new CFWVector(poiIntersA.sub(rectRet.m_poiLT));\r\n\t\t\t\tCFWVector vecBB = new CFWVector(poiIntersB.sub(rectRet.m_poiLT));\r\n\t\t\t\tif(vecBE.isSameDir_VerticalIn(vecBA))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersA;\r\n\t\t\t\t}\r\n\t\t\t\telse if(vecBE.isSameDir_VerticalIn(vecBB))\t{\r\n\t\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\t{\r\n\t\t\t\trectRet.m_poiLT = poiIntersA;\r\n\t\t\t\trectRet.m_poiRB = poiIntersB;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//last check : intersected line segment whether inside rectangle\r\n\t\tif(!isInsideArea( 9, rectRet.m_poiLT) || !isInsideArea( 9, rectRet.m_poiRB))\t{\r\n\t\t\tSystem.out.println(\"generated line segment isn't inside rectangle!\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn(rectRet);\r\n\t}", "public static boolean lineSegmentIntersectsRect(float x1, float y1, float x2, float y2, float xmin, float ymin, float xmax, float ymax) {\n\t\tshort code1 = Code(x1, y1, xmin, ymin, xmax, ymax);\n\t\tshort code2 = Code(x2, y2, xmin, ymin, xmax, ymax);\n\n\t\t//both are TOP, or both are BOTTOM , etc.\n\t\tif((code1 & code2) != 0) return false;\n\n\t\t//both are in the middle vertically or horizontally : | shape or - shape\n\t\tif( ((code1 | code2) & (RIGHT | LEFT)) == 0) return true;\n\t\tif( ((code1 | code2) & (TOP | BOTTOM)) == 0) return true;\n\n\t\t//any of them is inside\n\t\tif(code1 == 0 || code2 == 0) return true;\n\n\t\t//calculate intersections and check if they are in the middle\n\t\t//y = y1 + (x - x1) * slope\n\n\t\tfloat x, y;\n\t\ty = y1 + (xmax - x1) * (y2 - y1) /(x2 - x1);\n\t\tif(ymin <= y && y <= ymax) return true;\n\t\ty = y1 + (xmin - x1) * (y2 - y1) /(x2 - x1);\n\t\tif(ymin <= y && y <= ymax) return true;\n\t\tx = x1 + (ymax - y1) * (x2 - x1) / (y2 - y1);\n\t\tif(xmin <= x && x <= ymax) return true;\n\t\tx = x1 + (ymin - y1) * (x2 - x1) / (y2 - y1);\n\t\tif(xmin <= x && x <= ymax) return true;\n\t\treturn false;\n\t}", "public boolean whithinRectangle(Point point1, Point point2) {\n\t\treturn false;\n\t}", "@Test\n public void testOverboundsInside() {\n Coordinate a, b, c, d;\n a = new Coordinate2D(2, 2, 0);\n b = new Coordinate2D(3, 3, 0);\n c = new Coordinate2D(2, 0, 0);\n d = new Coordinate2D(4, 2, 0);\n\n int actual, expected;\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(a);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(b);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(c);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(d);\n assertEquals(expected, actual);\n }", "boolean intersect(Segment other) {\n\t\tint o1 = orientation(other.from);\n\t\tint o2 = orientation(other.to);\n\t\tint o3 = other.orientation(from);\n\t\tint o4 = other.orientation(to);\n\t\treturn (o1 != o2 && o3 != o4) // <- General case, special case below\n\t\t\t\t|| (o1 == 0 && inBoundingBox(other.from)) || (o2 == 0 && inBoundingBox(other.to))\n\t\t\t\t|| (o3 == 0 && other.inBoundingBox(from)) || (o4 == 0 && other.inBoundingBox(to));\n\t}", "public boolean onSegment(Line line) {\n\n // Define minimum and maximum for X and Y values.\n double maxX = Math.max(line.start().getX(), line.end().getX());\n double maxY = Math.max(line.start().getY(), line.end().getY());\n double minX = Math.min(line.start().getX(), line.end().getX());\n double minY = Math.min(line.start().getY(), line.end().getY());\n\n // Calculation deviation.\n double d = 0.0000000001;\n\n // Check if this point is in between minimum and maximum and return result.\n return minX - d <= this.x && this.x <= maxX + d && minY - d <= this.y && this.y <= maxY + d;\n\n }", "public boolean doesLineCut(Line line) {\n if (containsExclusive(line.getPoint1())) {\n return true;\n }\n if (containsExclusive(line.getPoint2())) {\n return true;\n }\n\n double x1 = Math.min(line.getPoint1().getX(), line.getPoint2().getX());\n double x2 = Math.max(line.getPoint1().getX(), line.getPoint2().getX());\n double y1 = Math.min(line.getPoint1().getY(), line.getPoint2().getY());\n double y2 = Math.max(line.getPoint1().getY(), line.getPoint2().getY());\n\n // y = mx + c\n // x = (y-c)/m\n double m = (line.getPoint2().getY() - line.getPoint1().getY()) / (line.getPoint2().getX() - line.getPoint1().getX());\n double c = line.getPoint1().getY() - (m * line.getPoint1().getX());\n\n double xNorth = Double.NaN;\n double xSouth = Double.NaN;\n double yWest = Double.NaN;\n double yEast = Double.NaN;\n if (Double.isInfinite(m)) {\n // Vertical line\n xNorth = x1;\n xSouth = x1;\n } else if (m == 0.0) {\n yWest = c;\n yEast = c;\n } else {\n xNorth = ((double) start.getY() - c) / m;\n xSouth = ((double) end.getY() - 1 - c) / m;\n yWest = m * (double) start.getX() + c;\n yEast = m * (double) end.getX() - 1 + c;\n }\n\n\n // Since both points are outside the rectangle, one crossed edged is enough.\n\n // Check north\n if (!Double.isNaN(xNorth) && start.getX() <= xNorth && xNorth < end.getX() && x1 <= xNorth && xNorth <= x2 && y2 > start.getY() && y1 < end.getY()) {\n return true;\n }\n // Check east\n if (!Double.isNaN(yWest) && start.getY() <= yWest && yWest < end.getY() && y1 <= yWest && yWest <= y2 && x2 > start.getX() && x1 < end.getX()) {\n return true;\n }\n // Check south\n if (!Double.isNaN(xSouth) && start.getX() <= xSouth && xSouth < end.getX() && x1 <= xSouth && xSouth <= x2 && y2 > start.getY() && y1 < end.getY()) {\n return true;\n }\n // Check west\n return !Double.isNaN(yEast) && start.getY() <= yEast && yEast < end.getY() && y2 <= yEast && yEast <= y2 && x2 > start.getX() && x1 < end.getX();\n }", "public boolean intersects(VectorXZ segmentP1, VectorXZ segmentP2) {\n // TODO: (performance): passing \"vector TO second point\", rather than\n // point2, would avoid having to calc it here - and that information\n // could be reused for all comparisons involving the segment\n return getIntersection(segmentP1, segmentP2) != null;\n }", "public boolean inside(Point p) {\n\t\tif (p.getX() < boundingRect.getX() || p.getY() < boundingRect.getY()) return false;\n\t\tif (p.getX() > boundingRect.getX() + boundingRect.getW() || \n\t\t p.getY() > boundingRect.getY() + boundingRect.getH()) return false;\n\n\t\t// Create a line from the point to the left\n\t\tLine l = new Line(p.getX(), p.getY(), p.getX() - boundingRect.getW(), p.getY());\n\n\t\t// Count intersections\n\t\tint count= 0;\t\t\n\t\tfor(int i=0; i<lines.size(); i++ ) {\n\t\t\tif (lines.get(i).intersectsAt(l) != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n // We are inside if the number of intersections is odd\n\t\treturn count%2 == 1;\n\t}", "boolean _insidePts(PVector[] inPts, PVector[] outPts) {\n \n for(int i = 0; i < inPts.length; i++){\n // direction of angular relationship to any side must match\n // direction of relationship to opposite side\n if(!_ptPoly(inPts[i], outPts)) return false;\n }\n return true;\n }", "public boolean isPointInSegment(Coordinates point, Coordinates segmExtremityA, Coordinates segmExtremityB);", "public static boolean checkIfLineSegementsIntersects( Point2D a, Point2D b, Point2D c, Point2D d, Point2D r )\n {\n double distAB, theCos, theSin, newX, ABpos;\n\n // Fail if either line is undefined.\n if( a.x == b.x && a.y == b.y || c.x == d.x && c.y == d.y )\n return false;\n\n // Fail if the segments share an end-point.\n if( a.x == c.x && a.y == c.y || b.x == c.x && b.y == c.y || a.x == d.x && a.y == d.y || b.x == d.x && b.y == d.y )\n return false;\n\n // (1) Translate the system so that point A is on the origin.\n double Bx = b.x - a.x;\n double By = b.y - a.y;\n double Cx = c.x - a.x;\n double Cy = c.y - a.y;\n double Dx = d.x - a.x;\n double Dy = d.y - a.y;\n\n // Discover the length of segment A-B.\n distAB = Math.sqrt( Bx * Bx + By * By );\n\n // (2) Rotate the system so that point B is on the positive X axis.\n theCos = Bx / distAB;\n theSin = By / distAB;\n newX = Cx * theCos + Cy * theSin;\n Cy = (int) (Cy * theCos - Cx * theSin);\n Cx = newX;\n newX = Dx * theCos + Dy * theSin;\n Dy = (int) (Dy * theCos - Dx * theSin);\n Dx = newX;\n\n // Fail if segment C-D doesn't cross line A-B.\n if( Cy < 0. && Dy < 0. || Cy >= 0. && Dy >= 0. )\n return false;\n\n // (3) Discover the position of the intersection point along line A-B.\n ABpos = Dx + (Cx - Dx) * Dy / (Dy - Cy);\n\n // Fail if segment C-D crosses line A-B outside of segment A-B.\n if( ABpos < 0. || ABpos > distAB )\n return false;\n\n // (4) Apply the discovered position to line A-B in the original coordinate system.\n if( r != null )\n {\n r.x = (int) (a.x + ABpos * theCos);\n r.y = (int) (a.y + ABpos * theSin);\n }\n\n // Success.\n return true;\n }", "boolean intersectsProper(tLine l1)\n {\n if(l1.state == penStates.PENUP | this.state == penStates.PENUP)\n return false;\n\n //collinear doesn't count\n if (this.collinear(l1.p0) | this.collinear(l1.p1) | l1.collinear(this.p0) | l1.collinear(this.p1))\n return false;\n\n if(this.left(l1.p0) | this.left(l1.p1))\n {\n if (this.left(l1.p0) && this.left(l1.p1))\n return false;\n if (l1.left(this.p0) | l1.left(this.p1))\n {\n if (l1.left(this.p0) && l1.left(this.p1))\n return false;\n else\n return true;\n }\n }\n return false;\n }", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "static boolean PointOnPolygon(final PT[] p, PT q) {\r\n\t\tfor (int i = 0; i < p.length; i++)\r\n\t\t\tif (dist2(ProjectPointSegment(p[i], p[(i + 1) % p.length], q), q) < EPS)\r\n\t\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic boolean intersectsRectangle(final int ax1, final int ax2, final int ay1, final int ay2)\n\t{\n\t\tif (isInsideZone(ax1, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax1, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Check if any point from this rectangle is inside the other one\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Horizontal lines may intersect vertical lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Vertical lines may intersect horizontal lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "static boolean onSegment(Point p, Point q, Point r)\n {\n if (\n q.getX() <= Math.max(p.getX(), r.getX()) &&\n q.getX() >= Math.min(p.getX(), r.getX()) &&\n q.getY() <= Math.max(p.getY(), r.getY()) &&\n q.getY() >= Math.min(p.getY(), r.getY()))\n {\n return true;\n }\n return false;\n }", "public boolean containsPoint(Point pt)\n {\n\n // E[O(log(n))]\n if(_lineBVH != null)\n {\n throw new Error(\"Implement me Please!\");\n }\n else\n {\n // O(n).\n return _point_in_polygon_test(pt);\n }\n }", "static boolean doIntersect(Point p1, Point q1,\n Point p2, Point q2)\n {\n // Find the four orientations needed for\n // general and special cases\n int o1 = orientation(p1, q1, p2);\n int o2 = orientation(p1, q1, q2);\n int o3 = orientation(p2, q2, p1);\n int o4 = orientation(p2, q2, q1);\n\n // General case\n if (o1 != o2 && o3 != o4)\n {\n return true;\n }\n\n // Special Cases\n // p1, q1 and p2 are colinear and\n // p2 lies on segment p1q1\n if (o1 == 0 && onSegment(p1, p2, q1))\n {\n return true;\n }\n\n // p1, q1 and p2 are colinear and\n // q2 lies on segment p1q1\n if (o2 == 0 && onSegment(p1, q2, q1))\n {\n return true;\n }\n\n // p2, q2 and p1 are colinear and\n // p1 lies on segment p2q2\n if (o3 == 0 && onSegment(p2, p1, q2))\n {\n return true;\n }\n\n // p2, q2 and q1 are colinear and\n // q1 lies on segment p2q2\n if (o4 == 0 && onSegment(p2, q1, q2))\n {\n return true;\n }\n\n // Doesn't fall in any of the above cases\n return false;\n }", "public boolean intersectsSegment(Vector a, Vector b, double R){\r\n\t\tif(floor && !obstructed())\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tVector[] p = getCardinalPoints();\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++){\r\n\t\t\tVector c = p[i];\r\n\t\t\tVector d = p[(i+1)%4];\r\n\t\t\tif(Geometry.segmentIntersect(a, b, c, d) || Geometry.plsDist(a, b, p[i]) <= R)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean intersectAxis(Vector2f[] points0, Vector2f[] points1, Vector2f normal) {\n\t\tfloat proj_dot_00 = getProjectionDot(points0[0], normal);\n\t\tfloat proj_dot_01 = getProjectionDot(points0[1], normal);\n\t\tfloat proj_dot_02 = getProjectionDot(points0[2], normal);\n\t\tfloat proj_dot_03 = getProjectionDot(points0[3], normal);\n\t\tfloat proj_dot_10 = getProjectionDot(points1[0], normal);\n\t\tfloat proj_dot_11 = getProjectionDot(points1[1], normal);\n\t\tfloat proj_dot_12 = getProjectionDot(points1[2], normal);\n\t\tfloat proj_dot_13 = getProjectionDot(points1[3], normal);\n\t\t\n\t\tfloat min_0 = Math.min(Math.min(proj_dot_00, proj_dot_01), Math.min(proj_dot_02, proj_dot_03));\n\t\tfloat max_0 = Math.max(Math.max(proj_dot_00, proj_dot_01), Math.max(proj_dot_02, proj_dot_03));\n\t\tfloat min_1 = Math.min(Math.min(proj_dot_10, proj_dot_11), Math.min(proj_dot_12, proj_dot_13));\n\t\tfloat max_1 = Math.max(Math.max(proj_dot_10, proj_dot_11), Math.max(proj_dot_12, proj_dot_13));\n\t\t\n\t\treturn max_0 >= min_1 && min_0 <= max_1;\n\t}", "@Test\n\tpublic void testContains() {\n\t\tLine l1 = new Line(0, 0, 1, 0);\n\t\tLine l2 = new Line(0, 0, 0, 1);\n\t\tLine l3 = new Line(0, 0, 1, 1);\n\t\tLine l4 = new Line(2.65, 0.3, 2.65, 0.9);\n\n\t\tassertTrue(\"l1 does not contain point (0.5, 0)\",\n\t\t\t\tl1.contains(new Coord(0.5, 0)));\n\t\tassertTrue(\"l2 does not contain point (0, 0.5)\",\n\t\t\t\tl2.contains(new Coord(0, 0.5)));\n\t\tassertTrue(\"l3 does not contain point (0.5, 0.5)\",\n\t\t\t\tl3.contains(new Coord(0.5, 0.5)));\n\n\t\tassertTrue(\n\t\t\t\t\"l4 does not contain (2.6499999999999995, 0.46083784792155075)\",\n\t\t\t\tl4.contains(new Coord(2.6499999999999995, 0.46083784792155075)));\n\n\t\t// Check endpoints for l1\n\t\tassertTrue(\"l1 does not contain point (0, 0)\",\n\t\t\t\tl1.contains(new Coord(0, 0)));\n\t\tassertTrue(\"l1 does not contain point (1, 0)\",\n\t\t\t\tl1.contains(new Coord(1, 0)));\n\t}", "public E3DVector3F checkSegmentCollision(E3DVector3F startPos, E3DVector3F endPos)\r\n {\r\n if(doesSegmentCrossPlane(startPos, endPos))\r\n {\r\n E3DVector3F intersectionPoint = getPlaneIntersectionPoint(startPos, endPos);\r\n if(isPointInTriangle(intersectionPoint))// || triangle.pointInTriangle(intersectionPoint2))\r\n return intersectionPoint;\r\n }\r\n return null;\r\n }", "public boolean isIntersectLineInMiddle(Line line) {\n\t\tdouble a = subFloat(firstPoint.y, secondPoint.y); // a = firstPoint.y - secondPoint.y\n\t\tdouble b = subFloat(secondPoint.x, firstPoint.x); // b = secondPoint.x - firstPoint.x\n\t\tdouble c = subFloat(multiFloat(-a, firstPoint.x), multiFloat(b, firstPoint.y));\n\t\t// c = -a * firstPoint.x - b * firstPoint.y\n\n\t\tdouble aLine = subFloat(line.firstPoint.y, line.secondPoint.y); // aLine = line.firstPoint.y -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.secondPoint.y\n\t\tdouble bLine = subFloat(line.secondPoint.x, line.firstPoint.x); // bLine = line.secondPoint.x -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// line.firstPoint.x\n\t\tdouble cLine = subFloat(multiFloat(-aLine, line.firstPoint.x), multiFloat(bLine, line.firstPoint.y));\n\t\t// cLine = -aLine * line.firstPoint.x - bLine * line.firstPoint.y\n\n\t\t// 4 points on same line\n\t\t// (a * line.firstPoint.x + b * line.firstPoint.y + c == 0) &&\n\t\t// (a * line.secondPoint.x + b * line.secondPoint.y + c == 0)\n\t\tif ((addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c) == 0)\n\t\t\t\t&& (addFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c) == 0)) {\n\t\t\tif ((firstPoint.distanceFrom(line.firstPoint) >= getLength()\n\t\t\t\t\t&& firstPoint.distanceFrom(line.secondPoint) >= this.getLength())\n\t\t\t\t\t|| (secondPoint.distanceFrom(line.firstPoint) >= this.getLength()\n\t\t\t\t\t\t\t&& secondPoint.distanceFrom(line.secondPoint) >= this.getLength()))\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\n\t\t// ((a * line.firstPoint.x + b * line.firstPoint.y + c) * (a *\n\t\t// line.secondPoint.x + b * line.secondPoint.y + c) < 0) &&\n\t\t// ((aLine * firstPoint.x + bLine * firstPoint.y + cLine) * (aLine *\n\t\t// secondPoint.x + bLine * secondPoint.y + cLine) < 0)\n\t\tif ((multiFloat(addFloat(multiFloat(a, line.firstPoint.x), multiFloat(b, line.firstPoint.y), c),\n\t\t\t\taddFloat(multiFloat(a, line.secondPoint.x), multiFloat(b, line.secondPoint.y), c)) < 0)\n\t\t\t\t&& (multiFloat(addFloat(multiFloat(aLine, firstPoint.x), multiFloat(bLine, firstPoint.y), cLine),\n\t\t\t\t\t\taddFloat(multiFloat(aLine, secondPoint.x), multiFloat(bLine, secondPoint.y), cLine)) < 0))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public boolean validStopCheck(){\n return points.validPolygon();\n }", "public boolean isPointInLine(Coordinates point, Coordinates linePointA, Coordinates linePointB);", "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 }", "private static boolean isPointOnLine(LineSegment a, Point2D b) {\r\n\t // Move the image, so that a.first is on (0|0)\r\n\t LineSegment aTmp = new LineSegment(new PointDouble(0, 0), new PointDouble(\r\n\t a.endPoint.getX() - a.startPoint.getX(), a.endPoint.getY() - a.startPoint.getY()));\r\n\t PointDouble bTmp = new PointDouble(b.getX() - a.startPoint.getX(), b.getY() - a.startPoint.getY());\r\n\t double r = crossProduct(aTmp.endPoint, bTmp);\r\n\t return Math.abs(r) < 0.000001;\r\n\t}", "public boolean isIntersectLine(Point p1, Point p2) {\n\t\t// Find the four orientations needed for general and special cases\n\t\tint o1 = orientation(firstPoint, secondPoint, p1);\n\t\tint o2 = orientation(firstPoint, secondPoint, p2);\n\t\tint o3 = orientation(p1, p2, firstPoint);\n\t\tint o4 = orientation(p1, p2, secondPoint);\n\n\t\t// General case\n\t\tif (o1 != o2 && o3 != o4) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Special Cases\n\t\t// p1, q1 and p2 are collinear and p2 lies on segment p1q1\n\t\tif (o1 == 0 && p1.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p1, q1 and p2 are collinear and q2 lies on segment p1q1\n\t\tif (o2 == 0 && p2.onSegment(firstPoint, secondPoint)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and p1 are collinear and p1 lies on segment p2q2\n\t\tif (o3 == 0 && firstPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// p2, q2 and q1 are collinear and q1 lies on segment p2q2\n\t\tif (o4 == 0 && secondPoint.onSegment(p1, p2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Or else\n\t\treturn false;\n\t}", "public static boolean vertexCrossing(S2Point a, S2Point b, S2Point c, S2Point d) {\n // If A == B or C == D there is no intersection. We need to check this\n // case first in case 3 or more input points are identical.\n if (a.equalsPoint(b) || c.equalsPoint(d)) {\n return false;\n }\n\n // If any other pair of vertices is equal, there is a crossing if and only\n // if orderedCCW() indicates that the edge AB is further CCW around the\n // shared vertex than the edge CD.\n if (a.equalsPoint(d)) {\n return orderedCCW(S2.ortho(a), c, b, a);\n }\n if (b.equalsPoint(c)) {\n return orderedCCW(S2.ortho(b), d, a, b);\n }\n if (a.equalsPoint(c)) {\n return orderedCCW(S2.ortho(a), d, b, a);\n }\n if (b.equalsPoint(d)) {\n return orderedCCW(S2.ortho(b), c, a, b);\n }\n\n // assert (false);\n return false;\n }", "boolean between(tPoint p2)\n {\n if (! this.collinear(p2))\n return false;\n \n //check to see if line is vertical\n if (this.p0.x != this.p1.x)\n {\n //if not vertical, check to see if point overlaps in x\n return (((this.p0.x < p2.x) && (p2.x < this.p1.x)) |\n ((this.p0.x > p2.x) && (p2.x > this.p1.x)));\n }\n else\n {\n //if vertical, check to see if point overlaps in y\n return (((this.p0.y < p2.y) && (p2.y < this.p1.y)) |\n ((this.p0.y > p2.y) && (p2.y > this.p1.y)));\n }\n }", "private boolean overlaps(Point2D p0, Point2D p1)\n {\n return Math.abs(p0.getX() - p1.getX()) < 0.001 && Math.abs(p0.getY() - p1.getY()) < 0.001;\n }", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "private int checkIntersections(ArrayList<Segment> segments){\n\t\tint numberOfIntersections = 0;\n\t\tfor (Segment s: segments){\n\t\t\tSegment firstSegment = s;\n\t\t\tfor (Segment t: segments){\n\t\t\t\tSegment secondSegment = t;\n\t\t\t\tif (!(firstSegment.equals(secondSegment))){\n\t\t\t\t\tif (!this.checkSharedVertex(firstSegment, secondSegment)){\n\t\t\t\t\t\tif(this.isIntersected(firstSegment.w1, firstSegment.w2, secondSegment.w1, secondSegment.w2))\n\t\t\t\t\t\t\tnumberOfIntersections ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn numberOfIntersections;\n\t}", "private boolean intersects(int from1, int to1, int from2, int to2) {\n\t\treturn from1 <= from2 && to1 >= from2 // (.[..)..] or (.[...]..)\n\t\t\t\t|| from1 >= from2 && from1 <= to2; // [.(..]..) or [..(..)..\n\t}", "private static HashMap<Integer, ArrayList<String>> checkAndMergeIntersectedPoints(HashMap<Integer, ArrayList<String>> boundedRegionPointsMap) {\n\n\t\t// Iterate over regions one by one, to validate with rest of the regions iteratively.\n\t for(Integer key1 : boundedRegionPointsMap.keySet()) {\n\t ArrayList<String> list1 = boundedRegionPointsMap.get(key1);\n\n\t for (Integer key2 : boundedRegionPointsMap.keySet()) {\n\t \t// Only need to check for keys (region counters) incrementally\n\t if (key1 < key2) {\n\t ArrayList<String> list2 = boundedRegionPointsMap.get(key2);\n\t for(String point : list2) {\n\t \t// If there is an intersecting point in two regions, merge them.\n\t if (list1.contains(point)) {\n\t list1.addAll(list2);\n\t // Just to make sure there won't be any duplicate points introduced after the merge.\n\t Set<String> uniquePoints = new HashSet<String>(list1);\n\t boundedRegionPointsMap.put(key1, new ArrayList<String>(uniquePoints));\n\t break;\n\t }\n\t }\n\t }\n\t }\n\n\t }\n\t return boundedRegionPointsMap;\n\t}", "public static boolean intersectsPolygonPolygon(Vector2i[] polygon1, Vector2i[] polygon2) {\n\t\tint numPointsInPoly1 = 0;\n\t\tfor(Vector2i v1 : polygon1) {\n\t\t\tif(pointInPolygon(polygon1, v1.x, v1.y)) { numPointsInPoly1++; }\n\t\t}\n\t\tif(numPointsInPoly1 > 0) { return true; }\n\t\t\n\t\tint numPointsInPoly2 = 0;\n\t\tfor(Vector2i v2 : polygon2) {\n\t\t\tif(pointInPolygon(polygon2, v2.x, v2.y)) { numPointsInPoly2++; }\n\t\t}\n\t\tif(numPointsInPoly2 > 0) { return true; }\n\t\t\n\t\tfor(int i=0; i<polygon1.length; i++) {\n\t\t\tint x1 = polygon1[i].x;\n\t\t\tint y1 = polygon1[i].y;\n\t\t\tint x2 = polygon1[(i+1) % polygon1.length].x;\n\t\t\tint y2 = polygon1[(i+1) % polygon1.length].y;\n\t\t\tfor(int j=0; j<polygon2.length; j++) {\n\t\t\t\tint x3 = polygon1[j].x;\n\t\t\t\tint y3 = polygon1[j].y;\n\t\t\t\tint x4 = polygon1[(j+1) % polygon2.length].x;\n\t\t\t\tint y4 = polygon1[(j+1) % polygon2.length].y;\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, x3, y3, x4, y4, null)) { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean pointInside(Point2D p) {\n AffineTransform fullTransform = this.getFullTransform();\n AffineTransform inverseTransform = null;\n try {\n inverseTransform = fullTransform.createInverse();\n } catch (NoninvertibleTransformException e) {\n e.printStackTrace();\n }\n Point2D newPoint = (Point2D)p.clone();\n inverseTransform.transform(newPoint, newPoint);\n return rect.contains(newPoint); \n }", "public static Coordinate[] makeArea(Coordinate[] polyLine, double width) {\n Coordinate vertices[];\n int numPoints = polyLine.length;\n // If there aren't at least two points, return an empty list\n if (numPoints < 2) {\n return new Coordinate[0];\n }\n // We've got at least two points, start initializing\n int numNewPoints = numPoints * 2;\n vertices = new Coordinate[numNewPoints];\n\n Coordinate p1, p2, intersectPoint;\n Coordinate[] perpLine1, perpLine2;\n Coordinate[] prevLine1, prevLine2, parallelLine1, parallelLine2;\n prevLine1 = new Coordinate[2];\n prevLine2 = new Coordinate[2];\n parallelLine1 = new Coordinate[2];\n parallelLine2 = new Coordinate[2];\n\n double meterWidth = width;\n\n // Define line p1p2\n p1 = polyLine[0];\n p2 = polyLine[1];\n // Get a line perpendicular to p1p2 through the first point of input\n // 'polyline'\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n // Keep these two endpoints as part of the final polygon\n vertices[0] = perpLine1[0];\n vertices[numNewPoints - 1] = perpLine1[1];\n\n // Get a line perpendicular to p1p2 through the second point of\n // 'polyline'\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Using these new endpoints, determine the 2 parallel lines that\n // straddle p1p2\n // Since the linePerpendicularThruP1 method always rotates in a\n // clockwise\n // direction, perpLine2 endpoints will be rotated 180 degrees wrt\n // perpLine1 endpoints\n prevLine1[0] = perpLine1[0];\n prevLine1[1] = perpLine2[1];\n prevLine2[0] = perpLine1[1];\n prevLine2[1] = perpLine2[0];\n\n for (int i = 2; i < numPoints; i++) {\n // Define p1p2\n p1 = polyLine[i - 1];\n p2 = polyLine[i];\n // Calculate 2 end lines perpendicular to p1p2 that are 'kmWidth'\n // long\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Calculate 2 lines parallel to p1p2 that are 'kmWidth' apart\n parallelLine1[0] = perpLine1[0];\n parallelLine1[1] = perpLine2[1];\n parallelLine2[0] = perpLine1[1];\n parallelLine2[1] = perpLine2[0];\n\n // Compute the intersections\n intersectPoint = intersection(parallelLine1, prevLine1);\n vertices[i - 1] = intersectPoint;\n intersectPoint = intersection(parallelLine2, prevLine2);\n vertices[numNewPoints - i] = intersectPoint;\n\n // Now stash the current lines as the previous lines for future\n // calcs.\n prevLine1[0] = parallelLine1[0];\n prevLine1[1] = parallelLine1[1];\n prevLine2[0] = parallelLine2[0];\n prevLine2[1] = parallelLine2[1];\n }\n // Now tack on the last perpendicular line\n vertices[numNewPoints / 2 - 1] = perpLine2[1];\n vertices[numNewPoints / 2] = perpLine2[0];\n return vertices;\n }", "Multimap<String, String> intersects(RectangleLatLng bounds);", "public static boolean simpleCrossing(S2Point a, S2Point b, S2Point c, S2Point d) {\n // We compute simpleCCW() for triangles ACB, CBD, BDA, and DAC. All\n // of these triangles need to have the same orientation (CW or CCW)\n // for an intersection to exist. Note that this is slightly more\n // restrictive than the corresponding definition for planar edges,\n // since we need to exclude pairs of line segments that would\n // otherwise \"intersect\" by crossing two antipodal points.\n\n S2Point ab = S2Point.crossProd(a, b);\n double acb = -(ab.dotProd(c));\n double bda = ab.dotProd(d);\n if (acb * bda <= 0) {\n return false;\n }\n\n S2Point cd = S2Point.crossProd(c, d);\n double cbd = -(cd.dotProd(b));\n double dac = cd.dotProd(a);\n return (acb * cbd > 0) && (acb * dac > 0);\n }", "@JsMethod(name = \"interiorContainsPoint\")\n public boolean interiorContains(double p) {\n return p > lo && p < hi;\n }", "static boolean PointInPolygon(final PT[] p, PT q) {\r\n\t\tboolean c = false;\r\n\t\tfor (int i = 0; i < p.length; i++) {\r\n\t\t\tint j = (i + 1) % p.length;\r\n\t\t\tif ((p[i].y <= q.y && q.y < p[j].y || p[j].y <= q.y && q.y < p[i].y)\r\n\t\t\t\t\t&& q.x < p[i].x + (p[j].x - p[i].x) * (q.y - p[i].y) / (p[j].y - p[i].y))\r\n\t\t\t\tc = !c;\r\n\t\t}\r\n\t\treturn c;\r\n\t}", "boolean intersects( Geometry gmo );", "public boolean intersects(S2Point v1) {\n double lng1 = S2LatLng.longitude(v1).radians();\n boolean result = interval.intersects(S1Interval.fromPointPair(lng0, lng1));\n lng0 = lng1;\n return result;\n }", "public boolean hasIntersectionSegment(Line3D line) {\n List<Point3D> list = new ArrayList();\n /*\n for (Face3D face : faces)\n if (face.intersectionSegment(line, list) > 0)\n return true;*/\n return false;\n }", "public static boolean detectCollision(Triangle triangle, Point point) {\n\n // Sliced triangles with Point\n Triangle t1 = new Triangle(triangle.getP1(), triangle.getP2(), point);\n Triangle t2 = new Triangle(triangle.getP2(), triangle.getP3(), point);\n Triangle t3 = new Triangle(triangle.getP3(), triangle.getP1(), point);\n\n return triangleClockOrientation(triangle) == triangleClockOrientation(t1) &&\n triangleClockOrientation(t1) == triangleClockOrientation(t2) &&\n triangleClockOrientation(t2) == triangleClockOrientation(t3);\n }", "private boolean overlappingGateways(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\tdouble firstApothem = (s1.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble secondApothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstApothem > secondX - secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public static void collidePoly(Manifold manif, \n \t\tPolygonShape polyA, XForm xfA,\n PolygonShape polyB, XForm xfB) {\n\n //testbed.PTest.debugCount++;\n manif.pointCount = 0; // Fixed a problem with contacts\n MaxSeparation sepA = findMaxSeparation(polyA, xfA, polyB, xfB);\n if (sepA.bestSeparation > 0.0f) {\n return;\n }\n\n MaxSeparation sepB = findMaxSeparation(polyB, xfB, polyA, xfA);\n if (sepB.bestSeparation > 0.0f) {\n return;\n }\n\n PolygonShape poly1; // reference poly\n PolygonShape poly2; // incident poly\n XForm xf1 = new XForm();\n XForm xf2 = new XForm();\n int edge1; // reference edge\n byte flip;\n float k_relativeTol = 0.98f;\n float k_absoluteTol = 0.001f;\n\n // TODO_ERIN use \"radius\" of poly for absolute tolerance.\n if (sepB.bestSeparation > k_relativeTol * sepA.bestSeparation\n + k_absoluteTol) {\n poly1 = polyB;\n poly2 = polyA;\n xf1.set(xfB);\n \t\txf2.set(xfA);\n edge1 = sepB.bestFaceIndex;\n flip = 1;\n }\n else {\n poly1 = polyA;\n poly2 = polyB;\n xf1.set(xfA);\n \t\txf2.set(xfB);\n edge1 = sepA.bestFaceIndex;\n flip = 0;\n }\n\n ClipVertex incidentEdge[] = new ClipVertex[2];\n findIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n\n int count1 = poly1.m_vertexCount;\n Vec2[] vert1s = poly1.m_vertices;\n\n Vec2 v11 = vert1s[edge1];\n Vec2 v12 = edge1 + 1 < count1 ? vert1s[edge1 + 1] : vert1s[0];\n\n Vec2 sideNormal = Mat22.mul(xf1.R, v12.sub(v11));\n sideNormal.normalize();\n Vec2 frontNormal = Vec2.cross(sideNormal, 1.0f);\n\n v11 = XForm.mul(xf1, v11);\n \tv12 = XForm.mul(xf1, v12);\n\n float frontOffset = Vec2.dot(frontNormal, v11);\n float sideOffset1 = -Vec2.dot(sideNormal, v11);\n float sideOffset2 = Vec2.dot(sideNormal, v12);\n\n // Clip incident edge against extruded edge1 side edges.\n ClipVertex clipPoints1[] = new ClipVertex[2];\n ClipVertex clipPoints2[] = new ClipVertex[2];\n int np;\n\n // Clip to box side 1\n np = clipSegmentToLine(clipPoints1, incidentEdge, sideNormal.negate(), sideOffset1);\n\n if (np < 2) {\n return;\n }\n\n // Clip to negative box side 1\n np = clipSegmentToLine(clipPoints2, clipPoints1, sideNormal,\n sideOffset2);\n\n if (np < 2) {\n return;\n }\n\n // Now clipPoints2 contains the clipped points.\n manif.normal = (flip != 0) ? frontNormal.negate() : frontNormal.clone();\n\n int pointCount = 0;\n for (int i = 0; i < Settings.maxManifoldPoints; ++i) {\n float separation = Vec2.dot(frontNormal, clipPoints2[i].v)\n - frontOffset;\n\n if (separation <= 0.0f) {\n ManifoldPoint cp = manif.points[pointCount];\n cp.separation = separation;\n cp.localPoint1 = XForm.mulT(xfA, clipPoints2[i].v);\n \t\t\tcp.localPoint2 = XForm.mulT(xfB, clipPoints2[i].v);\n cp.id = new ContactID(clipPoints2[i].id);\n cp.id.features.flip = flip;\n ++pointCount;\n }\n }\n\n manif.pointCount = pointCount;\n\n return;\n }", "public boolean overlaps(Triangle2D t) {\n\t\treturn true;\n\t}", "public boolean isLineCrossing(Simple2DPoint start, Simple2DPoint end) {\n\n\t\tLog.info(\"Does line:\"+start+\">\"+end+\" cross or is within box \"+this.toString());\n\n\t\t//TODO: we need to write a method that returns true or false depending if the line crosses this box\n\n\t\t//first check if either end of the line is inside\n\t\t//(in most cases this will be good enough)\n\t\tif (isPointInside(topleft.x, topleft.y)){\n\t\t\tLog.info(\"___________________contained within\");\n\t\t\treturn true;\n\t\t}\n\t\tif (isPointInside(end.x, end.y)){\n\t\t\tLog.info(\"___________________contained within\");\n\t\t\treturn true;\n\t\t}\n\n\t\t//Now we check if the line cross's the box, but doesnt end in it.\n\t\t//For collision detection this should be a lot less likely then the above, as it means a character has somehow ended up on either\n\t\t//side of a objects collision map at the same time.\n\n\t\t//We check for crossing lines by checking each side of this box as its own line against the supplied line.\n\t\t//Effectively making 4 separate \"is line crossing line\" tests\n\n\t\t//first we get the 4 corners of the box from the two we know already\n\t\tSimple2DPoint topLeft = topleft;\n\t\tSimple2DPoint topRight = new Simple2DPoint(bottomright.x,topleft.y);\n\t\tSimple2DPoint bottomLeft = new Simple2DPoint(topleft.x,bottomright.y);\n\t\tSimple2DPoint bottomRight = bottomright;\n\n\t\t//then we test each side against the supplied line\n\t\tSimple2DPoint intersectPoint = Polygon.lineIntersect2d(start, end, topLeft, topRight);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint =Polygon.lineIntersect2d(start, end, topRight, bottomRight);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint = Polygon.lineIntersect2d(start, end, bottomRight, bottomLeft);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectPoint = Polygon.lineIntersect2d(start, end, bottomLeft, topLeft);\n\t\tif (intersectPoint!=null){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t\t\n\t}", "@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // This is similar to WedgeContainsOrCrosses, except that we want to\n // distinguish cases (1) [A contains B], (3) [A and B are disjoint],\n // and (2,4,5,6) [A intersects but does not contain B].\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // We are in case 1, 5, or 6, or case 2 if a2 == b2.\n return orderedCCW(b2, b0, a0, ab1) ? 1 : -1; // Case 1 vs. 2,5,6.\n }\n // We are in cases 2, 3, or 4.\n if (!orderedCCW(a2, b0, b2, ab1)) {\n return 0; // Case 3.\n }\n\n // We are in case 2 or 4, or case 3 if a2 == b0.\n return (a2.equalsPoint(b0)) ? 0 : -1; // Case 3 vs. 2,4.\n }", "public int insidePoly(Point p) {\n\n\t\tif (vertices.contains(p))\n\t\t\treturn 0;\n\n\t\tdouble angleSum = 0;\n\t\tPoint u = vertices.get(0);\n\t\tfor (int i = 1; i < vertices.size(); i++) {\n\t\t\tPoint v = vertices.get(i);\n\t\t\tPoint pu = u.subtract(p);\n\t\t\tPoint pv = v.subtract(p);\n\t\t\tdouble angle = Math.atan2(pu.crossProduct(pv), pu.dotProduct(pv));\n\n\t\t\tif (Math.abs(Math.abs(angle) - Math.PI) < EPSILON)\n\t\t\t\treturn 0;\n\n\t\t\tangleSum += angle;\n\t\t\tu = v;\n\t\t}\n\n\t\tif (Math.abs(angleSum) > Math.PI)\n\t\t\treturn 1;\n\t\treturn -1;\n\t}", "protected boolean checkPoiInside( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//[begin point in area 1] unintersect: 1,2,3,7,8\r\n\t\t//[begin point in area 2] unintersect: 1,2,3\r\n\t\t//[begin point in area 3] unintersect: 1,2,3,4,5\r\n\t\t//[begin point in area 4] unintersect: 3,4,5\r\n\t\t//[begin point in area 5] unintersect: 3,4,5,6,7\r\n\t\t//[begin point in area 6] unintersect: 5,6,7\r\n\t\t//[begin point in area 7] unintersect: 5,6,7,8,1\r\n\t\t//[begin point in area 8] unintersect: 7,8,1\r\n\t\t//[begin point in area 9] unintersect: 9\r\n\t\tif(isInsideArea( 1, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 2, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 3, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 4, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 5, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 6, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 7, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 8, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isInsidePolygon(int[] nPolyPoints, double nX, double nY)\n\t{\n\t\tint nCount = 0;\n\t\tSegIterator oSegIt = new SegIterator(nPolyPoints);\n\t\twhile (oSegIt.hasNext())\n\t\t{\n\t\t\tint[] oLine = oSegIt.next();\n\t\t\tint nX1 = oLine[1];\n\t\t\tint nX2 = oLine[3];\n\t\t\tint nY1 = oLine[0];\n\t\t\tint nY2 = oLine[2];\n\n\t\t\tif ((nY1 < nY && nY2 >= nY || nY2 < nY && nY1 >= nY)\n\t\t\t && (nX1 <= nX || nX2 <= nX)\n\t\t\t && (nX1 + (nY - nY1) / (nY2 - nY1) * (nX2 - nX1) < nX))\n\t\t\t\t++nCount;\n\t\t}\n\t\treturn (nCount & 1) != 0;\n\t}", "public static boolean intersectsRectanglePolygon(int rx, int ry, int rWidth, int rHeight, Vector2i[] polygon, List<Vector2i> intersections) {\n\n\t\tint minX = rx;\n\t\tint minY = ry;\n\t\tint maxX = rx + rWidth;\n\t\tint maxY = ry + rHeight;\n\t\t\n\t\tint numPointsInRect = 0;\n\t\tfor(Vector2i v : polygon) {\n\t\t\tif(pointInRectangle(minX, minY, maxX, maxY, v.x, v.y)) { numPointsInRect++; }\n\t\t}\n\t\tif(numPointsInRect > 0) { return true; }\n\t\t\n\t\tint numPointsInPolygon = 0;\n\t\tif(pointInPolygon(polygon, minX, minY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, maxX, minY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, maxX, maxY)) { numPointsInPolygon++; }\n\t\tif(pointInPolygon(polygon, minX, maxY)) { numPointsInPolygon++; }\n\t\tif(numPointsInPolygon > 0) { return true; }\n\n\t\tif(intersections != null) {\n\t\t\tint numIntersections = 0;\n\t\t\tfor(int i=0; i<polygon.length; i++) {\n\t\t\t\tint x1 = polygon[i].x;\n\t\t\t\tint y1 = polygon[i].y;\n\t\t\t\tint x2 = polygon[(i+1) % polygon.length].x;\n\t\t\t\tint y2 = polygon[(i+1) % polygon.length].y;\n\t\t\t\tVector2i v1 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, minY, maxX, minY, v1)) { numIntersections++; intersections.add(v1); }\n\t\t\t\tVector2i v2 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, minY, maxX, maxY, v2)) { numIntersections++; intersections.add(v2); }\n\t\t\t\tVector2i v3 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, maxY, minX, maxY, v3)) { numIntersections++; intersections.add(v3); }\n\t\t\t\tVector2i v4 = new Vector2i();\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, maxY, maxX, minY, v4)) { numIntersections++; intersections.add(v4); }\n\t\t\t}\n\t\t\tif(numIntersections > 0) { return true;}\n\t\t\t\n\t\t} else {\n\t\t\tfor(int i=0; i<polygon.length; i++) {\n\t\t\t\tint x1 = polygon[i].x;\n\t\t\t\tint y1 = polygon[i].y;\n\t\t\t\tint x2 = polygon[(i+1) % polygon.length].x;\n\t\t\t\tint y2 = polygon[(i+1) % polygon.length].y;\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, minY, maxX, minY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, minY, maxX, maxY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, maxX, maxY, minX, maxY, null)) { return true; }\n\t\t\t\tif(intersectsLineLine(x1, y1, x2, y2, minX, maxY, maxX, minY, null)) { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), (-2147483648L));\n boolean boolean0 = range0.equals(range_CoordinateSystem0);\n boolean boolean1 = range0.intersects(range0);\n assertTrue(boolean1 == boolean0);\n assertFalse(boolean1);\n }", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "static boolean SegmentsIntersect(PT a, PT b, PT c, PT d) {\r\n\t\tif (LinesCollinear(a, b, c, d)) {\r\n\t\t\tif (dist2(a, c) < EPS || dist2(a, d) < EPS || dist2(b, c) < EPS || dist2(b, d) < EPS)\r\n\t\t\t\treturn true;\r\n\t\t\tif (dot(c.subtract(a), c.subtract(b)) > 0 && dot(d.subtract(a), d.subtract(b)) > 0\r\n\t\t\t\t\t&& dot(c.subtract(b), d.subtract(b)) > 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (cross(d.subtract(a), b.subtract(a)) * cross(c.subtract(a), b.subtract(a)) > 0)\r\n\t\t\treturn false;\r\n\t\tif (cross(a.subtract(c), d.subtract(c)) * cross(b.subtract(c), d.subtract(c)) > 0)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "private boolean checkSurroundingOfPoint(Point p) {\n\t\tPoint check = new Point();\n\t\tcheck.x\t\t= p.x;\n\t\tcheck.y \t= p.y;\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\tif(occupiedPositions.contains(check)) return false;\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\treturn true;\n\t}", "boolean isPartiallyOverlapped(int[] x, int[] y) {\n return y[0] <= x[1]; //정렬이 이미 되어 있어서 simplify 할 수 있음\n }", "public static boolean\nraysIntersectInPlane(Point2D tail0Pt, Point2D head0Pt, Point2D tail1Pt, Point2D head1Pt,\n\tPoint2D intersect, double[] uArray)\n{\n\tdouble tmp = ((head1Pt.getY() - tail1Pt.getY())*(head0Pt.getX() - tail0Pt.getX()) - (head1Pt.getX() - tail1Pt.getX())*(head0Pt.getY() - tail0Pt.getY()));\n\tif(tmp == 0.0)\n\t\treturn(false);\n\tdouble tmpv = ((tail1Pt.getX() - tail0Pt.getX())*(head0Pt.getY() - tail0Pt.getY()) - (tail1Pt.getY() - tail0Pt.getY())*(head0Pt.getX() - tail0Pt.getX())) / tmp;\n\ttmp = (head0Pt.getX() - tail0Pt.getX())*(head1Pt.getY() - tail1Pt.getY()) - (head1Pt.getX() - tail1Pt.getX())*(head0Pt.getY() - tail0Pt.getY());\n\tif(tmp == 0.0)\n\t\treturn(false);\n\tdouble tmpu = ((tail1Pt.getX() - tail0Pt.getX())*(head1Pt.getY() - tail1Pt.getY()) + (head1Pt.getX() - tail1Pt.getX())*(tail0Pt.getY() - tail1Pt.getY()))/tmp;\n\n\tintersect.setLocation(\n\t\ttail1Pt.getX() + tmpv*(head1Pt.getX() - tail1Pt.getX()),\n\t\ttail1Pt.getY() + tmpv*(head1Pt.getY() - tail1Pt.getY()));\n\n\t// intersect[ZCoor] = tail1Pt[ZCoor] + tmpv*(head1Pt[ZCoor] - tail1Pt[ZCoor]);\n\n\tuArray[0] = tmpu; // u of first ray\n\tuArray[1] = tmpv; // u of second ray\n\n\treturn (true);\n}", "int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2);", "private boolean collides2d(double testMinX, double testMaxX, double testMinY, double testMaxY, double otherMinX, double otherMaxX, double otherMinY, double otherMaxY, double otherExtrudeX, double otherExtrudeY) {\n if (otherExtrudeX == 0)\n return true; //prevent division by 0\n double slope = otherExtrudeY / otherExtrudeX;\n double height;\n double height2;\n Coordinate2D lowerPoint;\n Coordinate2D upperPoint;\n if (otherExtrudeX > 0) { //extruding to the right\n height = -(slope * (otherExtrudeY > 0 ? otherMaxX : otherMinX)) + otherMinY;\n height2 = -(slope * (otherExtrudeY > 0 ? otherMinX : otherMaxX)) + otherMaxY;\n lowerPoint = new Coordinate2D((otherExtrudeY > 0 ? testMaxX : testMinX), testMinY);\n upperPoint = new Coordinate2D((otherExtrudeY > 0 ? testMinX : testMaxX), testMaxY);\n } else { //extruding to the left\n height = -(slope * (otherExtrudeY <= 0 ? otherMaxX : otherMinX)) + otherMinY;\n height2 = -(slope * (otherExtrudeY <= 0 ? otherMinX : otherMaxX)) + otherMaxY;\n lowerPoint = new Coordinate2D((otherExtrudeY <= 0 ? testMaxX : testMinX), testMinY);\n upperPoint = new Coordinate2D((otherExtrudeY <= 0 ? testMinX : testMaxX), testMaxY);\n }\n Line lowerLine = new Line(height, slope);\n Line upperLine = new Line(height2, slope);\n return (lowerPoint.getY() <= upperLine.getYatX(lowerPoint.getX()) && upperPoint.getY() >= lowerLine.getYatX(upperPoint.getX()));\n }", "private boolean intersection(Point2D p1,Point2D p2, Point2D p3, Point2D p4 ){\n if(p1.equals(p3)||p1.equals(p4)||p2.equals(p3)||p2.equals(p4)){ // Point en commun cas particulier\n return true;\n }\n double pv1=produitVectoriel(p1,p2,p3,p4);\n if(pv1==0){ // droite parallele\n return false;\n }\n double pv2=produitVectoriel(p1,p2,p1,p4);\n double pv3=produitVectoriel(p1,p2,p1,p3);\n double pv4=produitVectoriel(p3,p4,p3,p2);\n double pv5=produitVectoriel(p3,p4,p3,p1);\n if(!(pv2*pv3<=0)){\n return false;\n }\n if(!(pv4*pv5<=0)){\n return false;\n }\n return true;\n }", "public boolean isInRect(Point p) {\n\t\tLine AB = new Line(A1, B1);\n\t\tLine CD = new Line(C1, AB.getU());\n\t\tLine AD = new Line(A1, D1);\n\t\tLine BC = new Line(B1, AD.getU());\n\n\t\tif (Line.isBetween2Lines(AB, CD, p) && Line.isBetween2Lines(AD, BC, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n \n // Prompt the user to enter the coordinates of a point\n System.out.print(\"Enter a point with two coordinates: \");\n float x = input.nextFloat(), y = input.nextFloat();\n \n // Declare the constants for the width and height of the rectangle\n final float WIDTH_OF_RECTANGLE = 10;\n final float HEIGHT_OF_RECTANGLE = 5;\n \n // Compute the distance from the center to the end of the +x-axis of the shape\n float xToCenterDistance = WIDTH_OF_RECTANGLE / 2;\n \n // Compute the distance from the center to the end of the +y-axis of the shape\n float yToCenterDistance = HEIGHT_OF_RECTANGLE / 2;\n \n // Declare a boolean variable and assign with a boolean expression of \n // if point is within rectangle\n boolean isWithinRectangle = \n (x > -xToCenterDistance && x < xToCenterDistance) &&\n (y > -yToCenterDistance && y < yToCenterDistance);\n \n // Display the result of if the point is in the rectangle\n System.out.println(\"Point (\" + x + \", \" + y + \") is \" +\n (isWithinRectangle ? \"\" : \"not \") + \"in the rectangle\");\n }", "public boolean passedBy(Line2D path) {\n\t\tfor (int i = 0; i < coordinates.size() - 1; i++) {\n\t\t\tvar p1 = coordinates.get(i);\n\t\t\tvar p2 = coordinates.get(i + 1);\n\t\t\tLine2D buildingEdge = new Line2D.Double(p1.getLng(), p1.getLat(), p2.getLng(), p2.getLat()); // x1, y1, x2, y2 \n\t\t\tif (buildingEdge.intersectsLine(path)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.6336999", "0.6271786", "0.5946218", "0.5934306", "0.5910064", "0.5905473", "0.5803985", "0.5783634", "0.57459295", "0.5709973", "0.56778646", "0.5659957", "0.5652309", "0.5652068", "0.56118053", "0.55841756", "0.5583481", "0.55587924", "0.55503607", "0.55339915", "0.54889995", "0.5462531", "0.5457862", "0.5454768", "0.5453818", "0.54522943", "0.54470897", "0.54409367", "0.54317707", "0.54173744", "0.5383823", "0.53744864", "0.53643966", "0.535755", "0.5345572", "0.53441507", "0.5339587", "0.5325478", "0.53231895", "0.5319148", "0.5288575", "0.5277997", "0.52778995", "0.52726316", "0.5269021", "0.52687055", "0.5264227", "0.52591014", "0.52563643", "0.5253861", "0.524698", "0.52435803", "0.5238941", "0.5234707", "0.5230783", "0.5230447", "0.52179384", "0.52139544", "0.5213184", "0.5203386", "0.5193431", "0.5180304", "0.5175746", "0.5164167", "0.51412195", "0.51384896", "0.5126517", "0.5126353", "0.5115365", "0.50976276", "0.50964236", "0.50870466", "0.5085118", "0.50783366", "0.50760645", "0.5071584", "0.5069209", "0.50661755", "0.50524527", "0.50129765", "0.5010665", "0.50082093", "0.50057924", "0.49849385", "0.4984159", "0.4972194", "0.49706525", "0.49646455", "0.49551773", "0.4944299", "0.49424854", "0.4940518", "0.49398506", "0.4934501", "0.49314794", "0.49290493", "0.49197593", "0.49169645", "0.49165028", "0.4914919" ]
0.60920084
2
Finds the segments that does not intersects with other segments of the polygon and has nonclustering length. "2slack+1" segments are checked each starting at "index"th vertex of the polygon & ends at a vertex within "index + np/2 slack" to "index + np/2 + slack", where np = total number of point in the polygon. Note: do not repeat the first point of the polygon at the end.
private TreeSet<BisectDistInfo> findSegmentsBySlack( int index, int slack, Coordinate[] polyIn ) { TreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>(); //Convert to grid coordinate. Coordinate[] poly = PgenUtil.latlonToGrid( polyIn ); /* * Find the index of ending points to form a splitting segment - * from "index + np/2 - slack" to "index + np/2 + slack" */ int npts = poly.length; int mid = npts / 2; int nseg = 2 * slack + 1; ArrayList<Integer> pointsToCheck = new ArrayList<Integer>(); for ( int ii = 0; ii < nseg; ii++ ) { pointsToCheck.add( ( ii - slack + index + mid + npts ) % npts ); } /* * Find out segments that does not intersect other segments of the * polygon and has a length greater than the clustering distance. */ Coordinate[] seg = new Coordinate[2]; seg[0] = poly[ index ]; boolean qualify; for ( Integer jj : pointsToCheck ) { //Sanity check if( jj >= poly.length ) continue; seg[1] = poly[jj]; qualify = polysegIntPoly( seg, poly ); if ( qualify ) { double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M; if ( dist > GfaSnap.CLUSTER_DIST ) { distInfo.add( new BisectDistInfo( dist, index, jj ) ); } } } return distInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int checkIntersections(ArrayList<Segment> segments){\n\t\tint numberOfIntersections = 0;\n\t\tfor (Segment s: segments){\n\t\t\tSegment firstSegment = s;\n\t\t\tfor (Segment t: segments){\n\t\t\t\tSegment secondSegment = t;\n\t\t\t\tif (!(firstSegment.equals(secondSegment))){\n\t\t\t\t\tif (!this.checkSharedVertex(firstSegment, secondSegment)){\n\t\t\t\t\t\tif(this.isIntersected(firstSegment.w1, firstSegment.w2, secondSegment.w1, secondSegment.w2))\n\t\t\t\t\t\t\tnumberOfIntersections ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn numberOfIntersections;\n\t}", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "private List<Polygon2D> getDistrictsInRing(List<Voter> voters, Point2D innerVertex, Point2D outerVertex, int repPerDistrict, int party) {\n \t\tList<Polygon2D> results = new ArrayList<Polygon2D>();\n \t\tdouble step = 0.1;\n \t\tint dist_num = repPerDistrict == 3 ? 20 : 22;\n \t\tPolygon2D outerTri = getTriByVertex(outerVertex);\n \t\tPolygon2D innerTri = getTriByVertex(innerVertex);\n \t\tPoint2D currIn = innerVertex;\n \t\tPoint2D currOut = outerVertex;\n \t\tdouble lenRate = (outerVertex.getY()/2 - 250 * Math.sqrt(3) / 3) / (innerVertex.getY()/2 - 250 * Math.sqrt(3) / 3);\n \t\tint total_population = Run.countInclusion(voters, outerTri) - Run.countInclusion(voters, innerTri);\n \t\tboolean gmable = true;\n \t\tdouble popRate = 0;\n \t\tfor(int i = 0; i < 3; i++) {\n \t\t\tSystem.out.println(\"Edge: \" + Integer.toString(i));\n\t \t\twhile(results.size() < dist_num-1) {\n\t \t\t\tSystem.out.println(gmable);\n\t \t\t\tPolygon2D p;\n\t \t\t\tif(i == 1)\n\t \t\t\t\tp = findDist(currIn, currOut, innerTri.getPoints().get(i), innerTri.getPoints().get((i+1)%3),\n\t \t\t\t\t\touterTri.getPoints().get(i), outerTri.getPoints().get((i+1)%3), step, lenRate, voters, true, repPerDistrict, party, gmable, popRate);\n\t \t\t\telse\n\t \t\t\t\tp = findDist(currIn, currOut, innerTri.getPoints().get(i), innerTri.getPoints().get((i+1)%3),\n\t\t \t\t\t\t\touterTri.getPoints().get(i), outerTri.getPoints().get((i+1)%3), step, lenRate, voters, false, repPerDistrict, party, gmable, popRate);\n\t \t\t\tif(p == null) {\n\t \t\t\t\tif(i == 0) {\n\t \t\t\t\t\tSystem.out.println(\"1111\");\n\t \t\t\t\t\tp = findDistAtCorner(currIn, currOut, innerTri.getPoints().get(1), innerTri.getPoints().get(2),\n\t \t\t\t\t\t\touterTri.getPoints().get(1), outerTri.getPoints().get(2), step, lenRate, voters, true, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\tif(p == null) {\n\t \t\t\t\t\t\tSystem.out.println(\"3333\");\n\t \t\t\t\t\t\tp = findDistAtTwoCorners(currIn, currOut, innerTri.getPoints().get(1), innerTri.getPoints().get(2), innerTri.getPoints().get(0),\n\t \t\t\t\t\t\touterTri.getPoints().get(1), outerTri.getPoints().get(2), outerTri.getPoints().get(0), step, lenRate, voters, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\t\t i++;\n\t \t\t\t\t\t}\n\t \t\t\t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t \t \t\t\t\tresults.add(p);\n\t \t \t\t\t\tif(gmable) {\n\t \t \t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n\t \t \t\t\t\t\tif(!gmable)\n\t \t \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t \t \t\t\t\t}\n\t \t\t\t\t\tcurrIn = p.getPoints().get(p.getPoints().size()-1);\n\t\t \t \t\t\tcurrOut = p.getPoints().get(p.getPoints().size()-2);\n\t\t \t \t\t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t \t\t\t\t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t\telse if(i == 1) {\n\t \t\t\t\t\tSystem.out.println(\"2222\");\n\t \t\t\t\t\tp = findDistAtCorner(currIn, currOut, innerTri.getPoints().get(2), innerTri.getPoints().get(0),\n\t\t \t\t\t\t\t\touterTri.getPoints().get(2), outerTri.getPoints().get(0), step, lenRate, voters, false, repPerDistrict, party, gmable, popRate);\n\t \t\t\t\t\tSystem.out.println(Run.countInclusion(voters, p));\n\t \t\t\t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t\t \t\t\t\tresults.add(p);\n\t\t \t\t\t\tif(gmable) {\n \t \t\t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n \t \t\t\t\t\t\tif(!gmable)\n\t \t \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t\t \t\t\t\t}\n\t\t\t\t \t\tcurrIn = p.getPoints().get(5);\n\t\t\t\t \t\tcurrOut = p.getPoints().get(4);\n\t\t\t\t \t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t\t\t\t \t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t}\n \t\t\t\tcurrIn = p.getPoints().get(p.getPoints().size()-1);\n\t \t\t\tcurrOut = p.getPoints().get(p.getPoints().size()-2);\n\t \t\t\tSystem.out.println(Run.countInclusion(voters, p));\n\t \t\t\ttotal_population -= Run.countInclusion(voters, p);\n\t \t\t\tresults.add(p);\n\t \t\t\tif(gmable) {\n\t\t\t\t\t\tgmable = isGerryManderable(total_population, dist_num - results.size());\n\t\t\t\t\t\tif(!gmable)\n \t\t\t\t\t\tpopRate = (double)total_population/(dist_num - results.size());\n\t\t\t\t}\n\t \t\t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n\t \t\t}\n \t\t}\n \t\t// We do not check population in the last polygon of a ring now. It should be a limitation for gerrymandering\n \t\tPolygon2D p = new Polygon2D();\n \t\tp.append(currIn);\n \t\tp.append(currOut);\n \t\tif(currIn.getX() > 500 && currIn.getY() > innerTri.getPoints().get(1).getY()) {\n \t\t\tp.append(outerTri.getPoints().get(1));\n \t\t\tp.append(outerTri.getPoints().get(2));\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\t\tp.append(innerTri.getPoints().get(0));\n \t\t\tp.append(innerTri.getPoints().get(2));\n \t\t\tp.append(innerTri.getPoints().get(1));\n \t\t}\n \t\telse if(currIn.getY() == innerTri.getPoints().get(1).getY()) {\n \t\t\tp.append(outerTri.getPoints().get(2));\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(2));\n \t\t}\n \t\telse {\n \t\t\tp.append(outerTri.getPoints().get(0));\n \t\tp.append(innerTri.getPoints().get(0));\n \t\t}\n \t\tresults.add(p);\n \t\tSystem.out.println(\"Polygon num: \" + Integer.toString(results.size()));\n \t\treturn results;\n }", "private boolean containsShortestOddHole(Graph<V, E> g, Set<V> X)\n {\n for (V y1 : g.vertexSet()) {\n if (X.contains(y1))\n continue;\n\n for (V x1 : g.vertexSet()) {\n if (x1 == y1)\n continue;\n GraphPath<V, E> rx1y1 = getPathAvoidingX(g, x1, y1, X);\n for (V x3 : g.vertexSet()) {\n if (x3 == x1 || x3 == y1 || !g.containsEdge(x1, x3))\n continue;\n for (V x2 : g.vertexSet()) {\n if (x2 == x3 || x2 == x1 || x2 == y1 || g.containsEdge(x2, x1)\n || !g.containsEdge(x3, x2))\n continue;\n\n GraphPath<V, E> rx2y1 = getPathAvoidingX(g, x2, y1, X);\n\n double n;\n if (rx1y1 == null || rx2y1 == null)\n continue;\n\n V y2 = null;\n for (V y2Candidate : rx2y1.getVertexList()) {\n if (g.containsEdge(y1, y2Candidate) && y2Candidate != x1\n && y2Candidate != x2 && y2Candidate != x3 && y2Candidate != y1)\n {\n y2 = y2Candidate;\n break;\n }\n }\n if (y2 == null)\n continue;\n\n GraphPath<V, E> rx3y1 = getPathAvoidingX(g, x3, y1, X);\n GraphPath<V, E> rx3y2 = getPathAvoidingX(g, x3, y2, X);\n GraphPath<V, E> rx1y2 = getPathAvoidingX(g, x1, y2, X);\n if (rx3y1 != null && rx3y2 != null && rx1y2 != null\n && rx2y1.getLength() == (n = rx1y1.getLength() + 1)\n && n == rx1y2.getLength() && rx3y1.getLength() >= n\n && rx3y2.getLength() >= n)\n {\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(rx1y1.getEdgeList());\n for (int i = rx2y1.getLength() - 1; i >= 0; i--)\n edgeList.add(rx2y1.getEdgeList().get(i));\n edgeList.add(g.getEdge(x2, x3));\n edgeList.add(g.getEdge(x3, x1));\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, x1, x1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "private TreeSet<BisectDistInfo> findAllSegments( Coordinate[] poly ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\t\t\t\t\n\t Coordinate[] seg = new Coordinate[2];\n\t boolean qualify;\n\t \n\t\tfor ( int ii = 0; ii < (poly.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (poly.length); jj ++ ) {\n\t\t seg[0] = poly[ii];\n\t\t seg[1] = poly[jj]; \n\t\t \n\t\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\t if ( qualify ) {\n\t\t\t\t double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\t if ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\t distInfo.add( new BisectDistInfo( dist, ii, jj ) );\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\t\t\t\n }\n\n\t\treturn distInfo;\n\t\t\n\t}", "static MaxSeparation findMaxSeparation(PolygonShape poly1, XForm xf1,\n \t\t\t\t\t\t\t\t\t PolygonShape poly2, XForm xf2) {\n MaxSeparation separation = new MaxSeparation();\n\n int count1 = poly1.m_vertexCount;\n \n // Vector pointing from the centroid of poly1 to the centroid of poly2.\n \tVec2 d = XForm.mul(xf2, poly2.m_centroid).subLocal(XForm.mul(xf1, poly1.m_centroid));\n \tVec2 dLocal1 = Mat22.mulT(xf1.R, d);\n\n \t// Find edge normal on poly1 that has the largest projection onto d.\n int edge = 0;\n float maxDot = -Float.MAX_VALUE;\n for (int i = 0; i < count1; ++i) {\n float dot = Vec2.dot(poly1.m_normals[i], dLocal1);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n\n // Get the separation for the edge normal.\n float s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f){\n separation.bestSeparation = s;\n return separation;\n }\n\n // Check the separation for the previous edge normal.\n int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;\n float sPrev = edgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n if (sPrev > 0.0f) {\n separation.bestSeparation = sPrev;\n return separation;\n }\n\n int nextEdge = edge + 1 < count1 ? edge + 1 : 0;\n float sNext = edgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n if (sNext > 0.0f){\n separation.bestSeparation = sNext;\n return separation;\n }\n\n // Find the best edge and the search direction.\n int bestEdge;\n float bestSeparation;\n int increment;\n if (sPrev > s && sPrev > sNext) {\n increment = -1;\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s){\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n } else {\n separation.bestFaceIndex = edge;\n separation.bestSeparation = s;\n return separation;\n }\n\n // Perform a local search for the best edge normal.\n while (true) {\n if (increment == -1)\n edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else\n edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;\n\n s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f) {\n separation.bestSeparation = s;\n return separation;\n }\n\n if (s > bestSeparation){\n bestEdge = edge;\n bestSeparation = s;\n } else {\n break;\n }\n }\n\n separation.bestFaceIndex = bestEdge;\n separation.bestSeparation = bestSeparation;\n\n return separation;\n }", "private static void removeNonIntersections(int PegsCount){\n\t\tint correctColor = 0;\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tcorrectColor = 0;\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tArrayList <Peg> victimTemp = new ArrayList<Peg>(victim);\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\tif(victimTemp.contains(aiGuess.get(i))){\n\t\t\t\t\tvictimTemp.remove(aiGuess.get(i));\n\t\t\t\t\tcorrectColor+=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(correctColor<PegsCount){\n\t\t\t\titr.remove();\n\t\t\t}\n\t\t}\n\t}", "public LinkedList<Point> segmentsToDraw() {\n LinkedList<Point> segmentCoordinates = new LinkedList<Point>();\n for (int segment = 1; segment <= snakeSize; segment++) {\n //search array for each segment number\n for (int x = 0; x < maxX; x++) {\n for (int y = 0; y < maxY; y++) {\n if (snakeSquares[x][y] == segment) {\n //make a Point for this segment's coordinates and add to list\n Point p = new Point(x * SnakeGame.getSquareSize(), y * SnakeGame.getSquareSize());\n segmentCoordinates.add(p);\n }\n }\n }\n }\n return segmentCoordinates;\n\n }", "public List<Point2D> getConcentricTriangleTips(List <Voter> voters, int repPerDistrict)\n {\n numVoters = voters.size();\n\n int numTriangles;\n if (repPerDistrict == 1)\n numTriangles = 12;\n else if (repPerDistrict == 3)\n numTriangles = 5;\n else\n return null;\n\n List<Point2D> triTips = new ArrayList<Point2D>();\n List<Polygon2D> triangles = new ArrayList<Polygon2D>();\n final double centerX = 500;\n final double centerY = 500*Math.tan(Math.PI/6);\n final double cos30 = Math.cos(Math.PI/6);\n final double sin30 = Math.sin(Math.PI/6);\n\n // Distance between vertices of triangle to center\n // TODO: Use a binary search algorithm instead of step; too slow\n double distFromCenter = 0;\n double step = 0.5;\n\n // Find most inner triangle\n Polygon2D innerTriangle;\n int innerVoterCount;\n double topX, topY, leftX, rightX, botY;\n\n do {\n distFromCenter += step;\n\n topX = centerX;\n topY = centerY + distFromCenter;\n\n leftX = centerX - distFromCenter*cos30;\n rightX = centerX + distFromCenter*cos30;\n\n botY = centerY - distFromCenter*sin30;\n\n innerTriangle = new Polygon2D();\n innerTriangle.append(topX, topY);\n innerTriangle.append(leftX, botY);\n innerTriangle.append(rightX, botY);\n // System.out.println(topY);\n\n innerVoterCount = Run.countInclusion(voters, innerTriangle);\n } while (needsMoreVoters(innerVoterCount));\n System.out.println(\"found inner triangle\");\n System.out.println(innerVoterCount);\n\n triangles.add(innerTriangle);\n triTips.add(new Point2D.Double(topX, topY));\n\n // Draw numTriangles-1 more triangles around it, each with 20/22 districts\n Polygon2D triangle;\n int voterCount;\n\n for (int i = 0; i < numTriangles - 2; i++) {\n do {\n distFromCenter += step;\n\n topX = centerX;\n topY = centerY + distFromCenter;\n\n leftX = centerX - distFromCenter*cos30;\n rightX = centerX + distFromCenter*cos30;\n\n botY = centerY - distFromCenter*sin30;\n\n triangle = new Polygon2D();\n triangle.append(topX, topY);\n triangle.append(leftX, botY);\n triangle.append(rightX, botY);\n\n voterCount = Run.countInclusion(voters, triangle);\n System.out.println(topY);\n } while (needsMoreVoters(voterCount - innerVoterCount, repPerDistrict == 3 ? 20:22));\n System.out.println(\"found an outer triangle\");\n System.out.println(voterCount - innerVoterCount);\n\n innerVoterCount = voterCount;\n triangles.add(triangle);\n triTips.add(new Point2D.Double(topX, topY));\n }\n\n // Last outer triangle; not necessary but keeping the code for completeness\n Polygon2D outerTriangle = new Polygon2D();\n outerTriangle.append(topX, 500*Math.sqrt(3));\n outerTriangle.append(0, 0);\n outerTriangle.append(1000, 0);\n voterCount = Run.countInclusion(voters, outerTriangle);\n\n System.out.println(\"found an outer triangle\");\n System.out.println(voterCount - innerVoterCount);\n\n triangles.add(outerTriangle);\n triTips.add(new Point2D.Double(topX, 500*Math.sqrt(3)));\n\n return triTips;\n }", "public DetectLED findSegments() {\n\t\tchains = new ArrayList<Chain>();\n\t\t// Every single line segment is a candidate to build a chain upon it\n\t\t// So let's seed the starting points for all potential chains\n\t\tfor (int i=0; i < lights.size(); i++) {\n\t\t\tfor (int j=0; j < lights.size(); j++) {\n\t\t\t\tif(i != j && lights.get(i).minus(lights.get(j)).norm() < maxSeg) {\n\t\t\t\t\t// Also seed chains for different number of nodes\n\t\t\t\t\t// maxNodes/2 is an arbitrary pick but should be good enough\n\t\t\t\t\tfor(int n = maxNodes; n > maxNodes/2; n--) {\n\t\t\t\t\t\tchains.add(new Chain(i, j, n));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}", "private ArrayList<Integer> getOutsideFaceIndicesBeforeAllInfoHasBeenInferred()\n\t{\n\t\t// go through all the simplices and count how often each face is referenced;\n\t\t// inside faces are referenced twice, outside faces once\n\t\t\n\t\t// set up an array that will contain the reference counts for each face\n\t\tint[] faceRefs = new int[faces.size()];\n\t\tfor(int i=0; i<faceRefs.length; i++) faceRefs[i] = 0;\n\t\t\n\t\t// now go through all the simplices...\n\t\tfor(Simplex simplex : simplices)\n\t\t{\n\t\t\t// ... and increase the reference count of all the faces in the simplex\n\t\t\tint[] simplexFaceIndices = simplex.getFaceIndices();\t// should be of length 4\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t{\n\t\t\t\t// increase the reference count of the <i>th face of the simplex\n\t\t\t\tfaceRefs[simplexFaceIndices[i]]++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// now collect the indices of all faces that are referenced only once, i.e. the outside faces\n\t\tArrayList<Integer> outsideFaceIndices = new ArrayList<Integer>();\n\t\tfor(int i=0; i<faceRefs.length; i++)\n\t\t\t// is there exactly one reference to the face with index i?\n\t\t\tif(faceRefs[i] == 1)\n\t\t\t\t// yes; add i to the list of outside-face indices\n\t\t\t\toutsideFaceIndices.add(i);\n\t\t\n\t\t// return the list of outside-face indices\n\t\treturn outsideFaceIndices;\n\t}", "public void convexHull(int n) {\n // There must be at least 3 points\n if (n < 3) return;\n\n // Initialize Result\n Vector<Marker> hull = new Vector<>();\n\n // Find the leftmost point\n int l = 0;\n for (int i = 1; i < n; i++)\n if (markers.get(i).getPosition().longitude < markers.get(l).getPosition().longitude)\n l = i;\n\n // Start from leftmost point, keep moving\n // counterclockwise until reach the start point\n // again. This loop runs O(h) times where h is\n // number of points in result or output.\n int p = l, q;\n do {\n // Add current point to result\n hull.add(markers.get(p));\n\n // Search for a point 'q' such that\n // orientation(p, x, q) is counterclockwise\n // for all points 'x'. The idea is to keep\n // track of last visited most counterclock-\n // wise point in q. If any point 'i' is more\n // counterclock-wise than q, then update q.\n q = (p + 1) % n;\n\n for (int i = 0; i < n; i++) {\n // If i is more counterclockwise than\n // current q, then update q\n if (orientation(p, i, q)\n == 2)\n q = i;\n }\n\n // Now q is the most counterclockwise with\n // respect to p. Set p as q for next iteration,\n // so that q is added to result 'hull'\n p = q;\n\n } while (p != l); // While we don't come to first\n\n drawer = new ArrayList<>(hull);\n }", "static boolean intersectsOppositeEdges(S2Point n) {\n // The line L intersects opposite edges of the [-1,1]x[-1,1] (u,v) square if\n // and only exactly two of the corner vertices lie on each side of L. This\n // is true exactly when ||Nu| - |Nv|| >= |Nw|. The code below evaluates this\n // expression exactly (see comments above).\n double u = Math.abs(n.x);\n double v = Math.abs(n.y);\n double w = Math.abs(n.z);\n // If w is the smallest, the following line returns an exact result.\n if (Math.abs(u - v) != w) {\n return Math.abs(u - v) >= w;\n }\n // Otherwise u - v = w exactly, or w is not the smallest value. In either\n // case the following line returns the correct result.\n return (u >= v) ? (u - w >= v) : (v - w >= u);\n }", "public static void smoothContour(List<PointIndex_I32> v, int minLength) {\n if(v.size() > 0){\n //if the distance between any two sequential points is < minLength, remove that point\n for (int i = v.size() - 2; i >= 0; i--) {\n if (v.get(i).distance(v.get(i + 1)) < minLength) {\n v.remove(i + 1);\n }\n }\n //test the distance between the last point and the first\n if (v.get(v.size() - 1).distance(v.get(0)) < minLength) {\n v.remove(v.size() - 1);\n }\n }\n }", "private Vector detectCommonSegPt(Vector segVL, Stroke theStroke)\n\t{\n\t\t\n\t\tint len = theStroke.getM_ptList().size();\n\t\tint[] stk_Arr = new int[len];\n\t\tint methodCnt = segVL.size(); //number of methods used to detect seg-points. \n\n\t\t// check if accepable value is set to a reasonable vaule\n\t\tif((Prefs.getAcceptableVotes() >= 1) && (Prefs.getAcceptableVotes() <= methodCnt))\n\t\t{\n\t\t\t// set the method count to acceptable votes.\n\t\t\tmethodCnt = Prefs.getAcceptableVotes();\n\t\t}\n\t\t\n\t\t// TODO: is there a better way to do it? \n\t\t// init the array to all 0\n\t\tfor(int i=0; i<len; i++) stk_Arr[i]=0;\n\t\t\n\t\tint commonWindow = COMMON_SEG_WINDOW;\n\t\tdouble commonDistance = COMMON_SEG_DISTANCE+2;\n\t\t/* commonDistance size of anchor_point, which are end-points of segments.\n\t\t * We want to filter-out seg-points too close together and create 'large'\n\t\t * seg-points to replace them.\n\t\t */\n\t\tVector commonSegPts = new Vector();\n\t\tIterator iter = segVL.iterator();\n\t\t\n\t\t// repeat for each segmentation algorithm\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tVector element = (Vector) iter.next();\n\t\t\tIterator iterator = element.iterator();\n\t\t\tint lastUsedPos=-1;\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tInteger obj = (Integer) iterator.next(); //get the seg point index\n\t\t\t\tint index = obj.intValue();\n\t\t\t\tPixelInfo indexPt = (PixelInfo)theStroke.getM_ptList().get(index);\n\t\t\t\t\n\t\t\t\tint start = index - commonWindow;\n\t\t\t\tint end = index + commonWindow;\n\t\t\t\t// check if i is within the array bounds, if yes, increment the array,\n\t\t\t\t// make sure that one segmentation scheme increments one point only once\n\t\t\t\tstart = (start>lastUsedPos)? start:lastUsedPos+1;\n\t\t\t\tend = (end<len)? end:len-1;\n\t\t\t\tfor(int i=start; i<=end; i++)\n\t\t\t\t{\n\t\t\t\t\tPixelInfo pt = (PixelInfo)theStroke.getM_ptList().get(i);\n\t\t\t\t\tif(indexPt.distance(pt) <= commonDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tstk_Arr[i]++;\n\t\t\t\t\t\tlastUsedPos = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// find the points with more than methodCnt value\n\t\tint i = 0;\n\t\twhile(i<len)\n\t\t{\n\t\t\t// store the index as the segment point, if condition is met\n\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t{\n\t\t\t\t// find out the streak of continuous pixels\n\t\t\t\tint beginIdx = i;\n\t\t\t\tint endIdx = i;\n\t\t\t\ti++;\n\t\t\t\twhile(i<len)\n\t\t\t\t{\n\t\t\t\t\tif(stk_Arr[i] >= methodCnt)\n\t\t\t\t\t{\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\tendIdx = i-1;\n\t\t\t\t\n\t\t\t\t// find one point from that streak\n\t\t\t\tint segPt = 0;\n\t\t\t\t// check if the segment is very short\n\t\t\t\tif((beginIdx==0)&&(endIdx==(len-1)))\n\t\t\t\t{\n\t\t\t\t\tif(beginIdx==endIdx) commonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\telse\n\t\t\t\t\t{\t// segment is not just one point\n\t\t\t\t\t\tcommonSegPts.add(new Integer(beginIdx));\n\t\t\t\t\t\tcommonSegPts.add(new Integer(endIdx));\n\t\t\t\t\t}\n\t\t\t\t\treturn commonSegPts;\n\t\t\t\t}\n\t\t\t\telse if(beginIdx==0) segPt = 0;\n\t\t\t\telse if(endIdx==(len-1)) segPt = endIdx;\n\t\t\t\telse segPt = (int)Math.floor((beginIdx+endIdx)/2);\n\t\t\t\t\n\t\t\t\t// add segPt to the list of detected segments.\n\t\t\t\tcommonSegPts.add(new Integer(segPt));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn commonSegPts;\n\t}", "static boolean isInside(Point polygon[], int n, Point p)\n {\n // There must be at least 3 vertices in polygon[]\n if (n < 3)\n {\n return false;\n }\n\n // Create a point for line segment from p to infinite\n Point extreme = new Point(10000, p.getY());\n\n // Count intersections of the above line\n // with sides of polygon\n int count = 0, i = 0;\n do\n {\n int next = (i + 1) % n;\n\n // Check if the line segment from 'p' to\n // 'extreme' intersects with the line\n // segment from 'polygon[i]' to 'polygon[next]'\n if (doIntersect(polygon[i], polygon[next], p, extreme))\n {\n // If the point 'p' is colinear with line\n // segment 'i-next', then check if it lies\n // on segment. If it lies, return true, otherwise false\n if (orientation(polygon[i], p, polygon[next]) == 0)\n {\n return onSegment(polygon[i], p,\n polygon[next]);\n }\n\n count++;\n }\n i = next;\n } while (i != 0);\n\n // Return true if count is odd, false otherwise\n return (count % 2 == 1); // Same as (count%2 == 1)\n }", "@Override\n\tpublic boolean collidesWithPolygon(Polygon polygon) {\n\t\treturn false;\n\t}", "private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }", "public ArrayList<TessSeg> splitAtIsect(TessSeg s1)\r\n {\r\n if (!isLineHit(s1))\r\n {\r\n return null;\r\n }\r\n \r\n //Check for point-line hits\r\n double t00 = -1, t01 = -1, t10 = -1, t11 = -1;\r\n boolean pointMidlineHit = false;\r\n \r\n if (isPointOnLine(s1.c0))\r\n {\r\n double t = pointOnLineT(s1.c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t00 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (isPointOnLine(s1.c1))\r\n {\r\n double t = pointOnLineT(s1.c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t01 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c0))\r\n {\r\n double t = s1.pointOnLineT(c0);\r\n if (t > 0 && t < 1)\r\n {\r\n t10 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n \r\n if (s1.isPointOnLine(c1))\r\n {\r\n double t = s1.pointOnLineT(c1);\r\n if (t > 0 && t < 1)\r\n {\r\n t11 = t;\r\n pointMidlineHit = true;\r\n }\r\n }\r\n\r\n if (pointMidlineHit)\r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n if (t00 > 0 && t01 > 0)\r\n {\r\n if (t00 < t01)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n }\r\n else if (t00 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c0));\r\n list.add(new TessSeg(s1.c0, c1));\r\n }\r\n else if (t01 > 0)\r\n {\r\n list.add(new TessSeg(c0, s1.c1));\r\n list.add(new TessSeg(s1.c1, c1));\r\n }\r\n else\r\n {\r\n list.add(this);\r\n }\r\n \r\n if (t10 > 0 && t11 > 0)\r\n {\r\n if (t10 < t11)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n }\r\n else if (t10 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c0));\r\n list.add(new TessSeg(c0, s1.c1));\r\n }\r\n else if (t11 > 0)\r\n {\r\n list.add(new TessSeg(s1.c0, c1));\r\n list.add(new TessSeg(c1, s1.c1));\r\n }\r\n else\r\n {\r\n list.add(s1);\r\n }\r\n \r\n return list;\r\n }\r\n \r\n if (c0.equals(s1.c0) \r\n || c0.equals(s1.c1)\r\n || c1.equals(s1.c0)\r\n || c1.equals(s1.c1))\r\n {\r\n //No point-midline hits. If we only meet at verts,\r\n // do not split.\r\n return null;\r\n }\r\n \r\n// if (!isParallelTo(s1))\r\n {\r\n //Midpoint crossing for both segments.\r\n // Solve system of linear eqns\r\n double s0x0 = c0.x;\r\n double s0y0 = c0.y;\r\n double s0x1 = c1.x;\r\n double s0y1 = c1.y;\r\n double s1x0 = s1.c0.x;\r\n double s1y0 = s1.c0.y;\r\n double s1x1 = s1.c1.x;\r\n double s1y1 = s1.c1.y;\r\n\r\n double[] t = Math2DUtil.lineIsectFractions(\r\n s0x0, s0y0, s0x1 - s0x0, s0y1 - s0y0,\r\n s1x0, s1y0, s1x1 - s1x0, s1y1 - s1y0,\r\n null);\r\n\r\n if (t == null || t[0] < 0 || t[0] > 1 || t[1] < 0 || t[1] > 1)\r\n {\r\n Logger.getLogger(TessSeg.class.getName()).log(Level.WARNING, \r\n \"Line segments do not overlap\");\r\n }\r\n// assert (t[0] > 0 && t[0] < 1 && t[1] > 0 && t[1] < 1)\r\n// : \"Line segments do not overlap\";\r\n \r\n {\r\n ArrayList<TessSeg> list = new ArrayList<TessSeg>();\r\n \r\n Coord c = new Coord(\r\n (int)Math2DUtil.lerp(s1x0, s1x1, t[1]),\r\n (int)Math2DUtil.lerp(s1y0, s1y1, t[1]));\r\n\r\n list.add(new TessSeg(c0, c));\r\n list.add(new TessSeg(c, c1));\r\n list.add(new TessSeg(s1.c0, c));\r\n list.add(new TessSeg(c, s1.c1));\r\n \r\n return list;\r\n }\r\n }\r\n \r\n// return null;\r\n }", "private boolean inPolygonLineCount(Double[] p, double x, double y) {\n\t\t\t\tint crosscount = 0;\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < p.length ; i++) {\n\t\t\t\t\tdouble pix = p[i].x;\n\t\t\t\t\tdouble piy = p[i].y;\n\t\t\t\t\tdouble pi1x = p[(i+1) % p.length].x;\n\t\t\t\t\tdouble pi1y = p[(i+1) % p.length].y;\n\t\t\t\t\tdouble vx = pi1x - pix;\n\t\t\t\t\tdouble vy = pi1y - piy;\n\t\t\t\t\tdouble xint = pix + ((y-piy) / vy) * vx;\n\t\t\t\t\tif (pix > x || pi1x > x) {\n\t\t\t\t\t\tif (piy < y && y <= pi1y && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t} else if (pi1y < y && y <= piy && xint > x) {\n\t\t\t\t\t\t\tcrosscount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn crosscount%2 == 1;\n\t\t\t}", "private LineSegment[] findSegments() {\n List<LineSegment> segmentList = new ArrayList<>();\n int N = points.length;\n for (int i = 0; i < N; i++) {\n for (int j = i+1; j < N; j++) {\n Double slopePQ = points[i].slopeTo(points[j]);\n for (int k = j+1; k < N; k++) {\n Double slopePR = points[i].slopeTo(points[k]);\n if (slopePQ.equals(slopePR)) {\n for (int l = k + 1; l < N; l++) {\n Double slopePS = points[i].slopeTo(points[l]);\n if (slopePQ.equals(slopePS)) {\n LineSegment lineSegment = new LineSegment(points[i], points[l]);\n segmentList.add(lineSegment);\n }\n }\n }\n }\n }\n }\n return segmentList.toArray(new LineSegment[segmentList.size()]);\n }", "public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void scatter(ArrayList<Wall> listOfWalls, ArrayList<Point> intersections) {\n final int MAXTILE = 160;\r\n double minDistance = 5000000000.0; //no distance is greater than this 4head\r\n double upDistance = 500000000.0;\r\n double downDistance = 5000000.0;\r\n double leftDistance = 50000000.0;\r\n double rightDistance = 5000000.0;\r\n boolean isIntersection = checkIntersection(intersections);\r\n boolean isRightCollision = checkWallCollision(listOfWalls, 2);\r\n boolean isLeftCollision = checkWallCollision(listOfWalls, 3);\r\n boolean isUpCollision = checkWallCollision(listOfWalls,0);\r\n boolean isDownCollision = checkWallCollision(listOfWalls, 1);\r\n\r\n if(isIntersection) {\r\n if(!isRightCollision && this.direction != 3) {\r\n rightDistance = Math.pow((xPos + 20) - SCATTERX,2) + Math.pow(yPos - SCATTERY,2);\r\n }\r\n if(!isLeftCollision && this.direction !=2) {\r\n leftDistance = Math.pow((xPos - 20) - SCATTERX,2) + Math.pow(yPos - SCATTERY,2);\r\n }\r\n if(!isUpCollision && this.direction != 1) {\r\n upDistance = Math.pow((xPos) - SCATTERX,2) + Math.pow((yPos-20) - SCATTERY,2);\r\n }\r\n if(!isDownCollision && this.direction != 0) {\r\n downDistance = Math.pow((xPos) - SCATTERX,2) + Math.pow((yPos+20) - SCATTERY,2);\r\n }\r\n if(upDistance <= downDistance && upDistance <= leftDistance && upDistance <= rightDistance) {\r\n this.direction = 0;\r\n }\r\n else if(downDistance <= upDistance && downDistance <= leftDistance && downDistance <= rightDistance) {\r\n this.direction = 1;\r\n }\r\n\r\n else if(rightDistance <= leftDistance && rightDistance <= downDistance && rightDistance <= upDistance) {\r\n this.direction = 2;\r\n }\r\n\r\n else if(leftDistance <= rightDistance && leftDistance <= upDistance && leftDistance <= downDistance) {\r\n this.direction = 3;\r\n }\r\n\r\n\r\n }\r\n\r\n if(this.direction == 0) {\r\n yPos = yPos - 5;\r\n }\r\n if(this.direction ==1) {\r\n yPos = yPos + 5;\r\n }\r\n if(this.direction ==2) {\r\n xPos = xPos + 5;\r\n }\r\n if(this.direction == 3) {\r\n xPos = xPos -5;\r\n }\r\n\r\n }", "public void verifyDestroyedBoatsOnLines(){\n for (int i = 0; i < canvasNumberOfLines; i++){\n int start = 0;\n int startCopy = 0;\n \n for (int j = 0; j < canvasNumberOfColumns; j++){\n if (gameMatrix[i][j] != 0 && booleanMatrixUserChoices[i][j] == 1 && booleanFoundBoats[i][j] == 0){\n if (startCopy != gameMatrix[i][j] || start == 0){\n start = gameMatrix[i][j]+1;\n startCopy = gameMatrix[i][j];\n }\n }\n \n if (gameMatrix[i][j] == 0){\n start = 0;\n startCopy = 0;\n }\n \n if (start > 0 && booleanMatrixUserChoices[i][j] == 1){\n start--;\n }\n \n if (start == 1){\n if (startCopy == 1){\n boatsNumber[0] -= 1;\n booleanFoundBoats[i][j] = 1;\n }\n else if (startCopy == 2){\n boatsNumber[1] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n }\n else if (startCopy == 3){\n boatsNumber[2] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n }\n else if (startCopy == 4){\n boatsNumber[3] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n }\n else if (startCopy == 5){\n boatsNumber[4] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n booleanFoundBoats[i][j-4] = 1;\n }\n \n start = 0;\n startCopy = 0;\n }\n \n } \n } \n }", "private boolean satisfiesPolygon() {\n \t\treturn this.markers.size() >= 3;\n \t}", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "private void intervalsRootScan(SearchContext ctx, Intervals result) {\n\t\tfinal int dimension = numDim;\n\t\tfinal int[] mins = ctx.qmins;\n\t\tfinal int[] maxs = ctx.qmaxs;\n\t\tfinal SearchNode curNode = ctx.current();\n\t\tfinal int contained = curNode.contained;\n\t\tfinal int rootStart = curNode.rootStart;\n\t\tfinal int rootEnd = rootStart + curNode.width;\n\t\tfinal int notContained = dimension - Integer.bitCount(contained);;\n\t\tint intervalStart = -1;\n\t\tif (notContained == 1) {\n\t\t\t// sequential-scan on final dimension\n\t\t\tfinal int last1d = Integer.numberOfLeadingZeros(~contained);\n\t\t\tfinal int[] basearray = zoPoints[last1d];\n\t\t\tfinal int min = mins[last1d];\n\t\t\tfinal int max = maxs[last1d];\n\t\t\tfor (int j = rootStart; j < rootEnd; j++) {\n\t\t\t\tint val = basearray[j];\n\t\t\t\tif (val >= min && val <= max) {\n\t\t\t\t\tif (intervalStart < 0) {\n\t\t\t\t\t\tintervalStart = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (intervalStart >= 0) {\n\t\t\t\t\t\tresult.addRoot(intervalStart, j);\n\t\t\t\t\t\tintervalStart = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// sequential-scan on not contained dimensions\n\t\t\tfinal int[] dims = ctx.work1;\n\t\t\tfor (int ptr = 0, d = 0; d < dimension; d++) {\n\t\t\t\tif (contained << d < 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdims[ptr++] = d;\n\t\t\t}\n\t\t\tJLOOP: for (int j = rootStart; j < rootEnd; j++) {\n\t\t\t\tfor (int ptr = 0; ptr < notContained; ptr++) {\n\t\t\t\t\tfinal int d = dims[ptr];\n\t\t\t\t\tfinal int val = zoPoints[d][j];\n\t\t\t\t\tif (val < mins[d] || val > maxs[d]) {\n\t\t\t\t\t\tif (intervalStart >= 0) {\n\t\t\t\t\t\t\tresult.addRoot(intervalStart, j);\n\t\t\t\t\t\t\tintervalStart = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue JLOOP;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (intervalStart < 0) {\n\t\t\t\t\tintervalStart = j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (intervalStart >= 0) {\n\t\t\tresult.addRoot(intervalStart, rootEnd);\n\t\t}\n\t}", "private static double[][] makeRegularPoly(double centerLat, double centerLon, double radiusMeters, int gons) {\n\n double[][] result = new double[2][];\n result[0] = new double[gons+1];\n result[1] = new double[gons+1];\n for(int i=0;i<gons;i++) {\n double angle = i*(360.0/gons);\n double x = Math.cos(Math.toRadians(angle));\n double y = Math.sin(Math.toRadians(angle));\n double factor = 2.0;\n double step = 1.0;\n int last = 0;\n\n //System.out.println(\"angle \" + angle + \" slope=\" + slope);\n // Iterate out along one spoke until we hone in on the point that's nearly exactly radiusMeters from the center:\n while (true) {\n double lat = centerLat + y * factor;\n GeoUtils.checkLatitude(lat);\n double lon = centerLon + x * factor;\n GeoUtils.checkLongitude(lon);\n double distanceMeters = SloppyMath.haversinMeters(centerLat, centerLon, lat, lon);\n\n //System.out.println(\" iter lat=\" + lat + \" lon=\" + lon + \" distance=\" + distanceMeters + \" vs \" + radiusMeters);\n if (Math.abs(distanceMeters - radiusMeters) < 0.1) {\n // Within 10 cm: close enough!\n result[0][i] = lat;\n result[1][i] = lon;\n break;\n }\n\n if (distanceMeters > radiusMeters) {\n // too big\n //System.out.println(\" smaller\");\n factor -= step;\n if (last == 1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = -1;\n } else if (distanceMeters < radiusMeters) {\n // too small\n //System.out.println(\" bigger\");\n factor += step;\n if (last == -1) {\n //System.out.println(\" half-step\");\n step /= 2.0;\n }\n last = 1;\n }\n }\n }\n\n // close poly\n result[0][gons] = result[0][0];\n result[1][gons] = result[1][0];\n\n return result;\n }", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static List<Query> readPolygonQueries(String fileName) throws IOException {\n CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder()\n .onMalformedInput(CodingErrorAction.REPORT)\n .onUnmappableCharacter(CodingErrorAction.REPORT);\n int BUFFER_SIZE = 1 << 16; // 64K\n InputStream is = Files.newInputStream(Paths.get(fileName));\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, decoder), BUFFER_SIZE);\n List<Query> result = new ArrayList<>();\n while (true) {\n String line = reader.readLine(); \n if (line == null) {\n break;\n }\n if (line.startsWith(\"count=\") == false) {\n throw new AssertionError();\n }\n // Count is the number of polygons the query has:\n int count = Integer.parseInt(line.substring(6, line.indexOf(' ')));\n List<Polygon> polys = new ArrayList<>();\n for(int i=0;i<count;i++) {\n line = reader.readLine(); \n // How many polygons (if this is > 1, the first poly is the real one, and\n // all others are hole-polys that are subtracted):\n if (line.startsWith(\" poly count=\") == false) {\n throw new AssertionError();\n }\n int polyCount = Integer.parseInt(line.substring(13));\n List<Polygon> polyPlusHoles = new ArrayList<>();\n for(int j=0;j<polyCount;j++) {\n line = reader.readLine(); \n if (line.startsWith(\" vertex count=\") == false) {\n System.out.println(\"GOT: \" + line);\n throw new AssertionError();\n }\n \n int vertexCount = Integer.parseInt(line.substring(17));\n double[] lats = new double[vertexCount];\n double[] lons = new double[vertexCount];\n line = reader.readLine(); \n if (line.startsWith(\" lats \") == false) {\n throw new AssertionError();\n }\n String[] parts = line.substring(11).split(\" \");\n if (parts.length != vertexCount) {\n throw new AssertionError();\n }\n for(int k=0;k<vertexCount;k++) {\n lats[k] = Double.parseDouble(parts[k]);\n }\n \n line = reader.readLine(); \n if (line.startsWith(\" lons \") == false) {\n throw new AssertionError();\n }\n parts = line.substring(11).split(\" \");\n if (parts.length != vertexCount) {\n throw new AssertionError();\n }\n for(int k=0;k<vertexCount;k++) {\n lons[k] = Double.parseDouble(parts[k]);\n }\n polyPlusHoles.add(new Polygon(lats, lons));\n }\n Polygon firstPoly = polyPlusHoles.get(0);\n Polygon[] holes = polyPlusHoles.subList(1, polyPlusHoles.size()).toArray(new Polygon[polyPlusHoles.size()-1]);\n polys.add(new Polygon(firstPoly.getPolyLats(), firstPoly.getPolyLons(), holes));\n }\n Query q;\n if (useLatLonPoint) {\n q = LatLonPoint.newPolygonQuery(\"point\", polys.toArray(new Polygon[polys.size()]));\n } else if (useGeoPoint) {\n q = new GeoPointInPolygonQuery(\"point\", polys.toArray(new Polygon[polys.size()]));\n } else {\n throw new AssertionError();\n }\n result.add(q);\n }\n\n return result;\n }", "private List<List<Segment>> getCleanSegments() {\n List<List<Segment>> clean = new ArrayList<>();\n List<Segment> segments = null;\n Segment previousSegment = null;\n for (Segment segment : getCleanableSegments()) {\n if (segments == null) {\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the previous segment is not an instance of the same version as this segment then reset the segments list.\n // Similarly, if the previous segment doesn't directly end with the index prior to the first index in this segment then\n // reset the segments list. We can only combine segments that are direct neighbors of one another.\n else if (previousSegment != null && (previousSegment.descriptor().version() != segment.descriptor().version() || previousSegment.lastIndex() != segment.firstIndex() - 1)) {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n // If the total count of entries in all segments is less then the total slots in any individual segment, combine the segments.\n else if (segments.stream().mapToLong(Segment::count).sum() + segment.count() < segments.stream().mapToLong(Segment::length).max().getAsLong()) {\n segments.add(segment);\n }\n // If there's not enough room to combine segments, reset the segments list.\n else {\n clean.add(segments);\n segments = new ArrayList<>();\n segments.add(segment);\n }\n previousSegment = segment;\n }\n\n // Ensure all cleanable segments have been added to the clean segments list.\n if (segments != null) {\n clean.add(segments);\n }\n return clean;\n }", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "public static FPoint2[] findSnapErrors(Grid grid, SnapArrangement ar) {\n\n DArray a = new DArray();\n do {\n extractSnapPoints(ar);\n\n // construct a list of segment sections between snap points\n DArray fragList = new DArray();\n FRect fragBounds = null;\n\n Graph g = ar.getGraph();\n for (int jj = 0; jj < ar.nNodes(); jj++) {\n int id1 = jj + ar.idBase();\n for (int kk = 0; kk < g.nCount(id1); kk++) {\n int id2 = g.neighbor(id1, kk);\n if (id2 < id1)\n continue;\n\n // Segment seg = segs[i];\n // for (int j = 0; j < seg.nSnapPoints() - 1; j++) {\n Endpoints ep = new Endpoints(grid, ar.hotPixel(id1), ar.hotPixel(id2));\n if (fragBounds == null)\n fragBounds = new FRect(ep.v0, ep.v1);\n fragBounds.add(ep.v0);\n fragBounds.add(ep.v1);\n fragList.add(ep);\n }\n }\n\n if (fragList.isEmpty())\n break;\n\n // to speed up this process, divide bounds into a grid of bucket/pixels.\n // Each bucket contains the fragments whose minimum bounding rectangles\n // intersect the bucket's pixel. \n // Thus we need only compare fragments against others from the same bucket.\n\n int nBuckets = Math.max(1, ar.nNodes() / 60);\n DArray[] buckets = new DArray[nBuckets * nBuckets];\n {\n double bWidth = fragBounds.width / nBuckets, bHeight = fragBounds.height\n / nBuckets;\n for (int i = 0; i < buckets.length; i++)\n buckets[i] = new DArray();\n for (int i = 0; i < fragList.size(); i++) {\n Endpoints e = (Endpoints) fragList.get(i);\n // add endpoint to every bucket it may intersect\n int y0 = (int) ((Math.min(e.v0.y, e.v1.y) - fragBounds.y) / bHeight);\n int y1 = MyMath.clamp(\n (int) ((Math.max(e.v0.y, e.v1.y) - fragBounds.y) / bHeight), 0,\n nBuckets - 1);\n int x0 = (int) ((Math.min(e.v0.x, e.v1.x) - fragBounds.x) / bWidth);\n int x1 = MyMath.clamp(\n (int) ((Math.max(e.v0.x, e.v1.x) - fragBounds.x) / bWidth), 0,\n nBuckets - 1);\n\n for (int y = y0; y <= y1; y++) {\n for (int x = x0; x <= x1; x++) {\n buckets[y * nBuckets + x].add(e);\n }\n }\n }\n }\n\n final double NEARZERO = .00001;\n\n for (int k = 0; k < buckets.length; k++) {\n DArray b = buckets[k];\n for (int i = 0; i < b.size(); i++) {\n Endpoints ei = (Endpoints) b.get(i);\n\n for (int j = i + 1; j < b.size(); j++) {\n Endpoints ej = (Endpoints) b.get(j);\n\n FPoint2 pt = MyMath.lineSegmentIntersection(ei.v0, ei.v1, ej.v0,\n ej.v1, null);\n if (pt == null)\n continue;\n String err = null;\n\n // make sure the intersection occurs at an endpoint of each\n double di = Math.min(pt.distance(ei.v0), pt.distance(ei.v1));\n double dj = Math.min(pt.distance(ej.v0), pt.distance(ej.v1));\n\n // in triangle grid, fragment endpoint can lie on other fragment.\n // To eliminate this possibility, intersection point must be\n // distinct from all four endpoints.\n\n if (Math.min(di, dj) > NEARZERO) {\n err = \"\";\n }\n if (err != null) {\n a.add(pt);\n // a.add(err);\n }\n }\n }\n }\n } while (false);\n return (FPoint2[]) a.toArray(FPoint2.class);\n }", "Vector selectBestSegPtsSet(Vector IterWiseSegPts){\n\t\tVector Vect = new Vector();\t\t\t// to return final set of segment pts\n\t\tVector TempVect = new Vector(); // to store temporary iteration results\n\t\tint index = -1;\n\t\t// if it consists of only common pts\n\t\tif(IterWiseSegPts.size() == 1) {\n\t\t\tindex = 0;\n\t\t}\n\t\t\n\t\t//if it consists of only two segment pt sets \n\t\telse if(IterWiseSegPts.size() == 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tif((PrevError - NewError) > 100.0){ //selecting the second set if error reduction is > 100.0\n\t\t\t\tindex = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t}\n\t\telse if(IterWiseSegPts.size() > 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tdouble ChangeInPrevError = PrevError - NewError;\n\t\t\tdouble ChangeInNewError;\n\t\t\tPrevError = NewError;\n\t\t\tif(ChangeInPrevError < 15.0){ //selecting the first set if change in error is < 30.0\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint Iterator = 2;\n\t\t\t\tint Iterations = IterWiseSegPts.size();\n\t\t\t\twhile(Iterator < Iterations){\n\t\t\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, Iterator);\n\t\t\t\t\tNewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\t\tChangeInNewError = PrevError - NewError;\n\t\t\t\t\t// if new iteration's error is less (or more) than prev itertion within 30.0 \n\t\t\t\t\t// or if previous change in segment pts Error > 3 times new change in segment pts error\n\t\t\t\t\tif( (ChangeInNewError < 30.0) && (NewError < 1000.0)){// (ChangeInPrevError > (3 * ChangeInNewError))\n\t\t\t\t\t\tindex = Iterator - 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tChangeInPrevError = ChangeInNewError;\n\t\t\t\t\tPrevError = NewError;\n\t\t\t\t\tIterator++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t//}\n\t\tTempVect = clearVector(TempVect);\n\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, index);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\tindex = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tVect.add((Integer)TempVect.get(index++));\n\t\t}\n\t\treturn Vect;\n\t}", "static boolean findBridge(Triangulator triRef, int ind, int i, int start,\n\t\t\t int[] ind1, int[] i1) {\n\tint i0, i2, j, numDist = 0;\n\tint ind0, ind2;\n\tBBox bb;\n\tDistance old[] = null;\n\tboolean convex, coneOk;\n\n\t// sort the points according to their distance from start.\n\tind1[0] = ind;\n\ti1[0] = i;\n\tif (i1[0] == start) return true;\n\tif (numDist >= triRef.maxNumDist) {\n\t // System.out.println(\"(1) Expanding distances array ...\");\n\t triRef.maxNumDist += triRef.INC_DIST_BK;\n\t old = triRef.distances;\n\t triRef.distances = new Distance[triRef.maxNumDist];\n\t System.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t for (int k = old.length; k < triRef.maxNumDist; k++)\n\t\ttriRef.distances[k] = new Distance();\n\t}\n\n\ttriRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\ttriRef.distances[numDist].ind = ind1[0];\n\t++numDist;\n\n\n\tind1[0] = triRef.fetchNextData(ind1[0]);\n\ti1[0] = triRef.fetchData(ind1[0]);\n\twhile (ind1[0] != ind) {\n\t if (i1[0] == start) return true;\n\t if (numDist >= triRef.maxNumDist) {\n\t\t// System.out.println(\"(2) Expanding distances array ...\");\n\t\ttriRef.maxNumDist += triRef.INC_DIST_BK;\n\t\told = triRef.distances;\n\t\ttriRef.distances = new Distance[triRef.maxNumDist];\n\t\tSystem.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t\tfor (int k = old.length; k < triRef.maxNumDist; k++)\n\t\t triRef.distances[k] = new Distance();\n\t }\n\n\t triRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\t triRef.distances[numDist].ind = ind1[0];\n\t ++numDist;\n\t ind1[0] = triRef.fetchNextData(ind1[0]);\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t}\n\n\t// qsort(distances, num_dist, sizeof(distance), &d_comp);\n\tsortDistance(triRef.distances, numDist);\n\n\t// find a valid diagonal. note that no node with index i1 > start can\n\t// be feasible!\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t if (i1[0] <= start) {\n\t\tind0 = triRef.fetchPrevData(ind1[0]);\n\t\ti0 = triRef.fetchData(ind0);\n\t\tind2 = triRef.fetchNextData(ind1[0]);\n\t\ti2 = triRef.fetchData(ind2);\n\t\tconvex = triRef.getAngle(ind1[0]) > 0;\n\n\t\tconeOk = Numerics.isInCone(triRef, i0, i1[0], i2, start, convex);\n\t\tif (coneOk) {\n\t\t bb = new BBox(triRef, i1[0], start);\n\t\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\t\treturn true;\n\t\t}\n\t }\n\t}\n\n\t// the left-most point of the hole does not lie within the outer\n\t// boundary! what is the best bridge in this case??? I make a\n\t// brute-force decision... perhaps this should be refined during a\n\t// revision of the code...\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t ind0 = triRef.fetchPrevData(ind1[0]);\n\t i0 = triRef.fetchData(ind0);\n\t ind2 = triRef.fetchNextData(ind1[0]);\n\t i2 = triRef.fetchData(ind2);\n\t bb = new BBox(triRef, i1[0], start);\n\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\treturn true;\n\t}\n\n\t// still no diagonal??? yikes! oh well, this polygon is messed up badly!\n\tind1[0] = ind;\n\ti1[0] = i;\n\n\treturn false;\n }", "private void splitIntoRoots() {\n\t\tArrayList<ArrayList<Coord>> circ = findCircles();\n\t\tcombinePastRoots(circ);\n\t}", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private final int markSkipVertices() {\n int nSkipVertices = 0;\n \n for (int i=0;i<nNodes;++i) {\n int nLevelWNeighbours = nLevelWNeighbourss[i];\n \n // Skip vertices must have at most 1 or at least 3 level-W neighbours.\n if (nLevelWNeighbours == 0 || nLevelWNeighbours == 2) continue;\n\n // Else, i is a skip-vertex.\n nSkipEdgess[i] = nLevelWNeighbours;\n int[] nextNodes = new int[nLevelWNeighbours];\n int[] edgeIndexes = new int[nLevelWNeighbours];\n float[] weights = new float[nLevelWNeighbours];\n int[] destinations = new int[nLevelWNeighbours];\n\n int[] outgoingEdges = outgoingEdgess[i];\n int[] outgoingEdgeIndexes = outgoingEdgeIndexess[i];\n int[] levelWEdgeOutgoingIndexes = levelWEdgeOutgoingIndexess[i];\n \n for (int j=0;j<nLevelWNeighbours;++j) {\n int index = levelWEdgeOutgoingIndexes[j];\n nextNodes[j] = outgoingEdges[index];\n edgeIndexes[j] = outgoingEdgeIndexes[index];\n }\n\n outgoingSkipEdgess[i] = destinations;\n outgoingSkipEdgeNextNodess[i] = nextNodes;\n outgoingSkipEdgeNextNodeEdgeIndexess[i] = edgeIndexes;\n outgoingSkipEdgeWeightss[i] = weights;\n \n nSkipVertices++;\n }\n return nSkipVertices;\n }", "private Vertex findAW(ArrayList<XVertex> nj) {\n\n\t\tArrayList<Vertex> candidateWs = new ArrayList<>();\n\n\t\t// Handle the first two vertices in NJ\n\t\tfor (int j = 0; j < nj.get(0).getVertexDegree(); j++) {\n\n\t\t\tfor (int k = 0; k < nj.get(1).getVertexDegree(); k++) {\n\n\t\t\t\tif (nj.get(0).getNeighbor(j).getId() == nj.get(1).getNeighbor(k).getId()) {\n\n\t\t\t\t\tcandidateWs.add(nj.get(0).getNeighbor(j));\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Handle every additional vertex in NJ\n\t\tfor (int z = 2; z < nj.size(); z++) {\n\t\t\tfor (int y = 0; y < candidateWs.size(); y++) {\n\t\t\t\tif (!(nj.get(z).getNeighborsArrayList().contains(candidateWs.get(y)))) {\n\t\t\t\t\tcandidateWs.remove(y);\n\t\t\t\t\tz--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check that the nodes in the candidates do NOT exist as neighbors in any other\n\t\t// x outside of nj\n\n\t\t// can use a set difference of all x's minus x's in NJ\n\t\tArrayList<Vertex> copy = (ArrayList) this.allX.clone();\n\t\tcopy.removeAll(nj);\n\n\t\tfor (int s = 0; s < copy.size(); s++) {\n\t\t\tfor (int p = 0; p < candidateWs.size(); p++) {\n\t\t\t\tif (copy.get(s).getNeighborsArrayList().contains(candidateWs.get(p))) {\n\t\t\t\t\tcandidateWs.remove(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (candidateWs.size() == 0) {\n\t\t\tthis.numNotRecovered++;\n\t\t\treturn null;\n\t\t}\n\t\treturn candidateWs.get(0); // return the remaining w candidate\n\n\t}", "public void checkForSurroundedAnts(int antIndex) {\n checkForSurroundedAntAt(antIndex);\n int currentY = antIndex/130;\n int currentX = antIndex % 130;\n for (int n = 0; n < 6; n++) {\n checkForSurroundedAntAt(adjacentCell(currentX, currentY, n));\n }\n }", "public Collection<GJPoint2D> singularPoints() {\n\t\tArrayList<GJPoint2D> points = new ArrayList<GJPoint2D>(this.segments.size());\n\t\t\n\t\t// iterate on segments, and add the last control of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tGJPoint2D p = seg.lastControl();\n\t\t\tif (p != null)\n\t\t\t\tpoints.add(p);\n\t\t}\n\t\t\n\t\t// return the set of singular points\n\t\treturn points;\n\t}", "private List<InternalConstraint> genInternalCtrsForNonOverlapping(NonOverlapping ectr, GeostObject o) {\n List<InternalConstraint> ictrs = new ArrayList<InternalConstraint>();\n List<ShiftedBox> sb = stp.getShape(o.getShapeId().getLB());\n Iterator<Integer> itr;\n itr = ectr.getFrame().getRelForbidRegions().keySet().iterator();\n boolean printit = false;\n while (itr.hasNext()) {\n int i = itr.next();\n if (!(o.getObjectId() == i)) {\n for (int k = 0; k < sb.size(); k++) {\n // We will generate an outbox constraint corresponding to each relative forbidden region we already generated\n // for the shifted boxes of the shape corresponding to the Obj o\n\n // here we go into the relative forbidden regions\n loop:\n for (int l = 0; l < ectr.getFrame().getRelForbidRegions(i).size(); l++) {\n int[] t = new int[cst.getDIM()];\n int[] s = new int[cst.getDIM()];\n for (int j = 0; j < cst.getDIM(); j++) {\n int min = ectr.getFrame().getRelForbidRegions(i).get(l).getMinimumBoundary(j) - sb.get(k).getOffset(j) - sb.get(k).getSize(j);\n int max = ectr.getFrame().getRelForbidRegions(i).get(l).getMaximumBoundary(j) - sb.get(k).getOffset(j);\n\n s[j] = max - min + 1; // length of the jth coordinate\n if (s[j] <= 0) // since the length is negative\n continue loop;\n t[j] = min; // It is the offset. lower left corner.\n\n if (printit) System.out.println(o.getObjectId() + \" \" + j + \" \" + o);\n int supDom = o.getCoord(j).getUB();// + sb.get(k).getOffset(j) + sb.get(k).getSize(j);\n int infDom = o.getCoord(j).getLB();// + sb.get(k).getOffset(j) ;\n int maxObj = o.getCoord(j).getUB() + sb.get(k).getOffset(j) + sb.get(k).getSize(j) - 1;\n if (maxObj > o.getCoord(j).getUB()) maxObj = o.getCoord(j).getUB();\n int minObj = o.getCoord(j).getLB() + sb.get(k).getOffset(j);\n if (minObj < o.getCoord(j).getLB()) minObj = o.getCoord(j).getLB();\n\n if (printit) System.out.println(\"box: \" + t[j] + \" \" + s[j]);\n if (printit) System.out.println(\"dom: \" + minObj + \" \" + maxObj);\n\n\n if ((supDom < t[j]) || (infDom > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip\");\n continue loop;\n }\n if ((maxObj < t[j]) || (minObj > t[j] + s[j])) {\n // this means the intersection of dom(o.x) and the region forbidden region associated with Outbox(t,s) is empty. In the other words all\n // the placement space is feasible for o.x according to the constraint Outbox(t,s)\n if (printit) System.out.println(\"skip2\");\n continue loop;\n }\n\n //clipping\n if (stp.opt.clipping) {\n // t[j] = Math.max(minObj, t[j]);\n // s[j] = Math.min(maxObj, t[j] + s[j]) - t[j] ;\n }\n\n if (printit) System.out.println(\"result box: \" + t[j] + \" \" + s[j]);\n\n\n }\n\n Outbox new_ob = new Outbox(t, s);\n\n\n Pair<Outbox, Boolean> result;\n if (ictrs.size() != 0) {\n Outbox last_ob = (Outbox) ictrs.get(ictrs.size() - 1);\n result = mergeAdjacent(new_ob, last_ob);\n\n new_ob = result.fst;\n\n if (result.snd) ictrs.remove(ictrs.size() - 1);\n\n }\n\n ictrs.add(new_ob);\n }\n }\n }\n }\n return ictrs;\n }", "public void checkForCollisions()\r\n\t{\r\n\t\t//collision detection\r\n\t\tfor(PolygonD obj : objects)\r\n\t\t{\r\n\t\t\t//find points in character that intersected with the scene\r\n\t\t\tfor(PointD p : aSquare.getBoundary().getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(obj.contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = obj.getVerts().get(obj.getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : obj.getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tVector offset = new Vector(p, closestPoint);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//find points in scene that intersected with the character\r\n\t\t\tfor(PointD p : obj.getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(aSquare.getBoundary().contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = aSquare.getBoundary().getVerts().get(aSquare.getBoundary().getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : aSquare.getBoundary().getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get the angle of object by 'feeling' it\r\n\t\t\t\t\tint numVerts = obj.verts.size();\r\n\t\t\t\t\tint objI = obj.verts.indexOf(p);\r\n\t\t\t\t\tint lastI = (objI - 1) % numVerts;\r\n\t\t\t\t\tif(lastI == -1)\r\n\t\t\t\t\t\tlastI = numVerts - 1;\r\n\t\t\t\t\tint nextI = (objI + 1) % numVerts;\r\n\t\t\t\t\t\r\n\t\t\t\t\tint angle = (int)Math.round((new Vector(obj.verts.get(objI), obj.verts.get(lastI))).angleBetween(new Vector(obj.verts.get(objI), obj.verts.get(nextI))));\r\n\t\t\t\t\t\r\n\t\t\t\t\taSquare.sendMsg(new Msg(aSquare, \"Felt Vertex: \" + angle + \"deg\"));//null means status message\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//reverse direction to make aSquare move out of wall\r\n\t\t\t\t\tVector offset = new Vector(closestPoint, p);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\taSquare.getCenter();\r\n\t}", "public static double noLineDelineation() \n {\n int nTries = 0; //the number of tries (landing both inside and outside the circle)\n int inCircle = 0; //the number of points that landed inside the circle\n \n double x, y; //the x and y coordinates (random) of the point chosen\n \n for (int i = 0; i < ITERATIONS; i++) \n {\n // (2*Math.random()-1) returns a random number from -1 to 1\n \n x = 2 * Math.random() - 1; \n y = 2 * Math.random() - 1;\n \n //if the point lands on the line or in the circle, increment the inCircle count\n if (x * x + y * y <= 1) \n {\n inCircle++;\n }\n \n nTries++;\n }\n \n /*\n * Prints the output if DEBUG is set to true. The output consists of two lines:\n * an estimate of pi to 30 decimal places using the no line delineation method \n * as well as an error percentage from the real value (Math.PI).\n */\n if(DEBUG) \n {\n System.out.printf(\"[no line boolean] pi = %.30f\\n\", 4. * (double) inCircle / (double) nTries);\n System.out.printf(\"[no line boolean] Error = %.30f\\n\", (((4. * (double) inCircle / (double) nTries) - Math.PI)/Math.PI));\n }\n \n //returns the estimated value of pi\n return 4. * (double) inCircle / (double) nTries;\n }", "private ArrayList<Vertex> truncateHeadAtConflictArea(ArrayList<Vertex> vertices) {\n \t\tPoint2D.Double polygon[] = new Point2D.Double[conflictArea.size()];\r\n \t\tfor (int i = conflictArea.size(); --i >= 0; )\r\n \t\t\tpolygon[i] = conflictArea.get(i).getPoint();\r\n \t\tArrayList<Vertex> result = new ArrayList<Vertex>();\r\n \t\tresult.add(vertices.get(0));\r\n \t\tPoint2D.Double prevPoint = null;\r\n \t\tfor (Vertex v : vertices) {\r\n \t\t\tPoint2D.Double p = v.getPoint();\r\n \t\t\tif (null != prevPoint) {\r\n \t\t\t\tLine2D.Double line = new Line2D.Double(prevPoint, p);\r\n \t\t\t\tdouble closest = Double.MAX_VALUE;\r\n \t\t\t\tPoint2D.Double replacementPoint = null;\r\n \t\t\t\tArrayList<Point2D.Double> intersections = Planar.lineIntersectsPolygon(line, polygon);\r\n \t\t\t\t// find intersections with the polygon\r\n \t\t\t\tfor (Point2D.Double intersection : intersections) {\r\n \t\t\t\t\t// if statement added \r\n \t\t\t\t\tif (intersection != null) {\r\n \t\t\t\t\t\tdouble distance = intersection.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = intersection;\r\n \t\t\t\t\t\t\tclosest = distance;\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// find very near misses with the polygon\r\n \t\t\t\tfor (Point2D.Double pp : polygon) {\r\n \t\t\t\t\tif (Planar.distanceLineSegmentToPoint(line, pp) < veryClose) {\r\n \t\t\t\t\t\tdouble distance = pp.distance(p);\r\n \t\t\t\t\t\tif (distance < closest) {\r\n \t\t\t\t\t\t\treplacementPoint = pp;\r\n \t\t\t\t\t\t\tclosest = distance;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (null != replacementPoint) {\r\n \t\t\t\t\tresult.clear();\r\n \t\t\t\t\tresult.add(new Vertex(replacementPoint, z));\r\n \t\t\t\t}\r\n \t\t\t\tresult.add(v);\r\n \t\t\t}\r\n \t\t\tprevPoint = p;\r\n \t\t}\t\t\r\n \t\treturn result;\r\n \t}", "private ArrayList<DataSegment> splitSegment(DataSegment segment, ArrayList<int[]> overlapping) {\n int start=segment.getSegmentStart();\n int end=segment.getSegmentEnd();\n ArrayList<DataSegment> newlist=new ArrayList<DataSegment>();\n for (int[] sub:overlapping) {\n DataSegment subsegment=segment.getEmptySubSegmentGenomicPositions(sub[0], sub[1]);\n if (subsegment!=null) newlist.add(subsegment); else return null;\n// engine.logMessage(\"Segment (\"+segment.getLocationAsString()+\") overlaps with [\"+sub[0]+\",\"+sub[1]+\"]. Creating new subsegment => \"+subsegment.toString());\n Collections.sort(newlist); \n }\n // now fill in missing bits\n fillInMissingSegments(newlist, start, end, segment.getDatatrackName(), segment.getOrganism(), segment.getGenomeBuild(), segment.getChromosome());\n // one last check...\n String error=checkSegments(newlist, start, end);\n if (error!=null) engine.logMessage(\"SYSTEM WARNING: Detected problems while processing cached data (error code:\"+error+\".2)\"); \n return newlist;\n }", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "private Vector combinationAlgorithm(Stroke theStroke){\n\t\tCurvatureBasedDetection cbd = new CurvatureBasedDetection();\n\t\tSpeedBasedDetection sbd = new SpeedBasedDetection();\n\t\tCommonSegmentPts = new Vector();\n\t\tCurvPts = cbd.getCurvatureData();\n\t\tdouble SpeedPts[][] = sbd.getSpeedData();\n\t\tCurvPtCount = cbd.getIndex();\n\t\tint SpeedPtCount = sbd.getIndex();\n\t\tint index ;\n\t\tCurvVector = new Vector();\n\t\t//copy the speed and curvature data in two vectors\n\t\tfor (index = 0; index < CurvPtCount ; index++){\n\t\t\tDouble obj = CurvPts[index][0];\n\t\t\tCurvVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Curvature Indices\");\n\t\tprintValues(CurvVector);\n\t\t\n\t\tSpeedVector = new Vector();\n\t\tfor (index = 0; index < SpeedPtCount ; index++){\n\t\t\tDouble obj = SpeedPts[index][0];\n\t\t\tSpeedVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\tSystem.out.println(\"Speed Indices\");\n\t\tprintValues(SpeedVector);\n\t\tSort sort = new Sort();\n\t\tint ElementIndex;\n\t\t// find common points (intersection of speed and curvature) and put it in CommonSegmentPts vector\n\t\t\n\t\tboolean flag = false;\n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\t\n\t\t\tElementIndex = sort.linearSearch(CurvVector, (Integer)SpeedVector.elementAt(index));\n\t\t\t\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tCommonSegmentPts.add((Integer)(CurvVector.elementAt(ElementIndex)));\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index --); // point is removed from vectors\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\tSystem.out.println(\"Common Points\");\n\t\tprintValues(CommonSegmentPts);\n\t\tint ElemAtIndex;\n\t\t// Find the curvature based segment points in the Tolerance Distance of speed based segment points \n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\tElementIndex = FindNearbyPts(CurvVector, (Integer)SpeedVector.elementAt(index), theStroke);\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tElemAtIndex = ((Integer)CurvVector.elementAt(ElementIndex) + (Integer)SpeedVector.elementAt(index))/2;\n\t\t\t\tCommonSegmentPts.add(ElemAtIndex);\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index--);\n\t\t\t}\n\t\t}\n\t\t//printValues(CommonSegmentPts);\n\t\tremoveNearbyPixels(theStroke);\n\t\t//setNewScalingFactor(theStroke);\n\t\tCollections.sort(CommonSegmentPts);\n\t\tprintValues(CommonSegmentPts);\n\t\tdouble PrevIterError;\n\t\tdouble NewIterError;\n\t\tVector IterationPts = new Vector(); \n\t\t//System.out.println(\"Error \" + (PrevIterError = calculateError(CommonSegmentPts, theStroke)));\n\t\t// create a vector that stores segment points of each iteration\n\t\tIterWiseSegPts = new Vector();\n\t\t// for hybrid\n\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\tdouble PrevError = calculateError(IterationPts, theStroke);\n\t\tif(PrevError > 10000.0){\t// if stroke consists of curves\n\t\t\terrorTolerance = 90.0;\n\t\t}\n\t\tIterationPts.add((double ) PrevError);\n\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\tdouble NewError = -1;\n/*\t\tint vectorIndex = 0;\n\t\t\n\t\twhile(CurvVector.size()!=0 || SpeedVector.size()!=0){\n\t*/\t\t\n\t\t\t// code for accepting seg points uptil pts reduce the error by 100\n\t\t/*\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tCommonSegmentPts.add(CurvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(CurvIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(CurvVector.size()!=0){\n\t\t\t\t\t\tCurvVector.remove(0);\n\t\t\t\t\t}\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tCommonSegmentPts.add(SpeedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tSystem.out.println(\"New Error = \" + NewIterError);\n\t\t\t//CommonSegmentPts.add((Double)NewIterError);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0 ){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(SpeedIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(SpeedVector.size()!=0){\n\t\t\t\t\t\tSpeedVector.remove(0);\n\t\t\t\t\t}\t\t\n\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\t\t// my approach\n\t/*\t\t\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\t\t\tCurvVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tCurvVector = clearVector(CurvVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\t\t\tSpeedVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tIterationPts = clearVector(IterationPts);\n\t\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\t\tCollections.sort(IterationPts);\n\t\t\tIterError = calculateError(IterationPts, theStroke);\n\t\t\tIterationPts.add((double) IterError);\n\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\t\tremoveNearbyPixels(theStroke);\n\n\t\t}\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t/*\tif(CurvVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\tCurvVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tCurvVector = clearVector(CurvVector);\n\t\t}\n\t}\n\tif(SpeedVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\tSpeedVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t}\n\t}\n\tIterationPts = clearVector(IterationPts);\n\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\tCollections.sort(IterationPts);\n\tIterError = calculateError(IterationPts, theStroke);\n\tIterationPts.add((double) IterError);\n\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\tremoveNearbyPixels(theStroke);\n\n}\nCommonSegmentPts = clearVector(CommonSegmentPts);\nCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t\n\t\t// hybrid fit approach\n\t\tint curvIndex = -1, speedIndex = -1;\n\t\tdouble curvError,speedError;\n\t\tVector curvPts = new Vector();\n\t\tVector speedPts = new Vector();\n\t\tVector changeInError = new Vector();\n\t\twhile((CurvVector.size() != 0) || (SpeedVector.size() != 0) ){\n\t\t\tcurvError = DEFAULT;\n\t\t\tspeedError = DEFAULT;\n\t\t\t\n\t\t\tif(CurvVector.size() != 0){\n\t\t\t\tclearVector(curvPts);\n\t\t\t\tcurvPts = copyVector(curvPts, CommonSegmentPts);\n\t\t\t\tcurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tcurvPts.add((Integer)curvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(curvPts);\n\t\t\t\tcurvError = calculateError(curvPts, theStroke);\n\t\t\t\tcurvPts.add((Double)curvError);\n\t\t\t}\n\t\t\t\n\t\t\tif(SpeedVector.size() != 0){\n\t\t\t\tclearVector(speedPts);\n\t\t\t\tspeedPts = copyVector(speedPts, CommonSegmentPts);\n\t\t\t\tspeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tspeedPts.add((Integer)speedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(speedPts);\n\t\t\t\tspeedError = calculateError(speedPts, theStroke);\n\t\t\t\tspeedPts.add((Double)speedError);\n\t\t\t}\n\t\t\t\n\t\t\tif((speedError <= curvError) || (curvError == DEFAULT)){\n\t\t\t\tNewError = speedError;\n\t\t\t\t//changeInError.add((Double)(NewError - PrevError));\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, speedPts);\n\t\t\t\tCommonSegmentPts.add((Integer)speedIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((curvError < speedError) || (speedError == DEFAULT)){\n\t\t\t\tNewError = curvError;\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, curvPts);\n\t\t\t\tCommonSegmentPts.add((Integer)curvIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tVector TempVect = new Vector();\n\t\tCommonSegmentPts = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() - 1);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\t/*index = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tCommonSegmentPts.add((Integer)TempVect.get(index++));\n\t\t}*/\n\t\t//CommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);\n\t\t\n\t\treturn CommonSegmentPts;\n\t}", "public boolean validStopCheck(){\n return points.validPolygon();\n }", "List<Long> getBestSolIntersection();", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "private ArrayList<Point> calculateMidPoints() {\n ArrayList<Point> midPoints = new ArrayList<>();\n boolean isFirst = true; // Holds weather or not both points have been found yet.\n\n // Iterate over every point in the left and right lanes.\n for (int idx = 0; idx < leftLine.getLanePoints().size(); idx++) {\n Point leftPoint = leftLine.getLanePoints().get(idx); // The left point at the element idx.\n Point rightPoint = rightLine.getLanePoints().get(idx); // The right point at the element idx.\n int yValue = getCameraHeight() - (START_SEARCH + idx); // The y value of the left and right points.\n\n // If neither line is found, add a point at cameraWidth / 2, yValue\n if (leftPoint.isEmpty() && rightPoint.isEmpty()) {\n if (USE_NO_LANE_DETECTION) {\n midPoints.add(new Point(getCameraWidth() / 2, yValue));\n }\n // If Ony the right Point is found, add a point at the x rightPoint - road width / 2.\n } else if (leftPoint.isEmpty()) {\n midPoints.add(new Point(rightPoint.getX() - (calculateRoadWidth(yValue) / 2), yValue));\n // If Only the left Point is found, add a point at the x leftPoint + road width / 2.\n } else if (rightPoint.isEmpty()) {\n midPoints.add(new Point(leftPoint.getX() + (calculateRoadWidth(yValue) / 2), yValue));\n // If both lines are found, average the two lines.\n } else {\n midPoints.add(new Point((int) Math.round((leftPoint.getX() + rightPoint.getX()) / 2.0), yValue));\n // Set x1 and y1 to be the first Points to have lines on both sides.\n if (isFirst) {\n calcSlopePoint1.setX(Math.abs(leftPoint.getX() - rightPoint.getX()));\n calcSlopePoint1.setY(yValue);\n isFirst = false;\n // set x2 and y2 to be the last points to have lines on both sides.\n } else {\n calcSlopePoint2.setX(Math.abs(leftPoint.getX() - rightPoint.getX()));\n calcSlopePoint2.setY(yValue);\n }\n }\n }\n\n if (isReliable(calcSlopePoint1, calcSlopePoint2)) {\n slope = calculateRoadSlope(calcSlopePoint1, calcSlopePoint2);\n }\n return midPoints;\n }", "boolean containsCleanShortestOddHole(Graph<V, E> g)\n {\n /*\n * Find 3 Paths which are an uneven odd hole when conjunct\n */\n for (V u : g.vertexSet()) {\n for (V v : g.vertexSet()) {\n if (u == v || g.containsEdge(u, v))\n continue;\n\n GraphPath<V, E> puv = new DijkstraShortestPath<>(g).getPath(u, v);\n if (puv == null)\n continue;\n\n for (V w : g.vertexSet()) {\n if (w == u || w == v || g.containsEdge(w, u) || g.containsEdge(w, v))\n continue;\n GraphPath<V, E> pvw = new DijkstraShortestPath<>(g).getPath(v, w);\n if (pvw == null)\n continue;\n GraphPath<V, E> pwu = new DijkstraShortestPath<>(g).getPath(w, u);\n if (pwu == null)\n continue;\n Set<V> set = new HashSet<>();\n set.addAll(puv.getVertexList());\n set.addAll(pvw.getVertexList());\n set.addAll(pwu.getVertexList());\n Graph<V, E> subg = new AsSubgraph<>(g, set);\n // Look for holes with more than 6 edges and uneven length\n if (set.size() < 7 || subg.vertexSet().size() != set.size()\n || subg.edgeSet().size() != subg.vertexSet().size()\n || subg.vertexSet().size() % 2 == 0\n || subg.vertexSet().stream().anyMatch(t -> subg.degreeOf(t) != 2))\n continue;\n\n if (certify) {\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(puv.getEdgeList());\n edgeList.addAll(pvw.getEdgeList());\n edgeList.addAll(pwu.getEdgeList());\n\n double weight = edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, u, u, edgeList, weight);\n }\n return true;\n\n }\n\n }\n }\n return false;\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\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\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "@Test\n\t\tpublic void testIntersectAtEndPoints2(){\n\t\t\tGenericLineSegmentsIntersect v=new GenericLineSegmentsIntersect();\n\t\t\tint[][] lines={\n\t\t\t\t\t{1,5,5,1},\n\t\t\t\t\t{1,4,5,0},\n\t\t\t\t\t{2,2,6,10}\n\t\t\t};\n\n\t\t\tassertTrue(v.intersects(lines));\n\t\t}", "@Test\n public void testTransect() throws GeoTessException {\n\n double dist = Math.toRadians(60);\n double azimuth = Math.toRadians(10);\n double[] vertex1 = posLinear.getModel().getGrid().getVertex(1);\n\n //System.out.println(GeoTessUtils.getLatLonString(vertex1)); System.out.println();\n\n double[] start = GeoTessUtils.move(vertex1, dist / 2., Math.PI + azimuth);\n double[] end = GeoTessUtils.move(vertex1, dist / 2., azimuth);\n\n // build the transect data structures and populate the point positions.\n int npoints = 51;\n GreatCircle gc = new GreatCircle(start, end);\n ArrayList<double[]> points = gc.getPoints(npoints, false);\n points.set(npoints / 2, vertex1);\n\n double[] distance = new double[npoints];\n double[] valuesLinear = new double[npoints];\n double[] valuesNN = new double[npoints];\n\n for (int i = 0; i < npoints; ++i) {\n distance[i] = GeoTessUtils.angleDegrees(vertex1, points.get(i));\n if (i < npoints / 2) {\n distance[i] *= -1.;\n }\n valuesLinear[i] = 1. / posLinear.set(4, points.get(i), 1e4).getValue(0);\n }\n\n int nloops = 1; // 100000;\n posNN.set(4, points.get(0), 1e4);\n\n long timer = System.currentTimeMillis();\n for (int n = 0; n < nloops; ++n) {\n for (int i = 0; i < npoints; ++i) {\n valuesNN[i] = 1. / posNN.set(4, points.get(i), 1e4).getValue(0);\n }\n }\n timer = System.currentTimeMillis() - timer;\n //System.out.println(\"cpuTime = \"+timer);\n\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%12.6f %12.6f %12.6f%n\", \n//\t\t\t\t//GeoTessUtils.getLatLonString(points.get(i)),\n//\t\t\t\tdistance[i], valuesLinear[i], valuesNN[i]);\n//\t\t\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", distance[i]);\n//\t\tSystem.out.println();\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", valuesLinear[i]);\n//\t\tSystem.out.println();\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", valuesNN[i]);\n//\t\tSystem.out.println();\n\n double[] expDistance = new double[]{-30.000000, -28.800000,\n -27.600000, -26.400000, -25.200000, -24.000000, -22.800000,\n -21.600000, -20.400000, -19.200000, -18.000000, -16.800000,\n -15.600000, -14.400000, -13.200000, -12.000000, -10.800000,\n -9.600000, -8.400000, -7.200000, -6.000000, -4.800000,\n -3.600000, -2.400000, -1.200000, 0.000001, 1.200000, 2.400000,\n 3.600000, 4.800000, 6.000000, 7.200000, 8.400000, 9.600000,\n 10.800000, 12.000000, 13.200000, 14.400000, 15.600000,\n 16.800000, 18.000000, 19.200000, 20.400000, 21.600000,\n 22.800000, 24.000000, 25.200000, 26.400000, 27.600000,\n 28.800000, 30.000000};\n double[] expLinear = new double[]{8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.054137, 8.071930, 8.089795, 8.107838,\n 8.126071, 8.144387, 8.162803, 8.181334, 8.200000, 8.168896,\n 8.138100, 8.107579, 8.077304, 8.047246, 8.018002, 8.002167,\n 8.002729, 8.005888, 8.009046, 8.012206, 8.016119, 8.035189,\n 8.054353, 8.078359, 8.105569, 8.132947, 8.160519, 8.143446,\n 8.120925, 8.098519, 8.083079, 8.078281, 8.073490, 8.089623};\n double[] expNN = new double[]{8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.041202,\n 8.048167, 8.058878, 8.072557, 8.089860, 8.107915, 8.126098,\n 8.143861, 8.161247, 8.179631, 8.200000, 8.162554, 8.129212,\n 8.099322, 8.072501, 8.048067, 8.023506, 8.006961, 8.004099,\n 8.005888, 8.010183, 8.016907, 8.026038, 8.038366, 8.056879,\n 8.080395, 8.104321, 8.120821, 8.128538, 8.127940, 8.118928,\n 8.103649, 8.089243, 8.080988, 8.085650, 8.097606};\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expDistance[i], distance[i], 1e-6);\n }\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expLinear[i], valuesLinear[i], 1e-6);\n }\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expNN[i], valuesNN[i], 1e-6);\n }\n }", "public void symmetric() {\n\t\tint i,j,segment=0;\n\t\tint symmetry = _geneticCode.getSymmetry();\n\t\tint mirror = _geneticCode.getMirror();\n\t\tint sequence = _segments / symmetry;\n\t\tint left=0, right=0, top=0, bottom=0;\n\t\tint centerX, centerY;\n\t\tdouble cx, cy;\n\n\t\tfor (i=0; i<symmetry; i++) {\n\t\t\tfor (j=0; j<sequence; j++,segment++) {\n\t\t\t\t// Here, we take the vector that forms the segment, scale it depending on\n\t\t\t\t// the relative size of the organism and rotate it depending on the\n\t\t\t\t// symmetry and mirroring.\n\t\t\t\tv.setModulus(_geneticCode.getGene(j).getLength()/Utils.scale[_growthRatio-1]);\n\t\t\t\tif (j==0) {\n\t\t\t\t\t_startPointX[segment] = 0;\n\t\t\t\t\t_startPointY[segment] = 0;\n\t\t\t\t\tif (mirror == 0 || i%2==0)\n\t\t\t\t\t\tv.setTheta(_geneticCode.getGene(j).getTheta()+i*2*FastMath.PI/symmetry);\n\t\t\t\t\telse {\n\t\t\t\t\t\tv.setTheta(_geneticCode.getGene(j).getTheta()+(i-1)*2*FastMath.PI/symmetry);\n\t\t\t\t\t\tv.invertX();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (_geneticCode.getGene(j).getBranch() == -1) {\n\t\t\t\t\t\t_startPointX[segment] = _endPointX[segment - 1];\n\t\t\t\t\t\t_startPointY[segment] = _endPointY[segment - 1];\n\t\t\t\t\t\tif (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t} else {\n\t\t\t\t\tif (_geneticCode.getGene(j).getBranch() == 0) {\n\t\t\t\t\t\t_startPointX[segment] = 0;\n\t\t\t\t\t _startPointY[segment] = 0;\n\t\t\t\t\t if (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_startPointX[segment] = _endPointX[(i * sequence) + _geneticCode.getGene(j).getBranch() - 1];\n\t\t\t\t\t _startPointY[segment] = _endPointY[(i * sequence) + _geneticCode.getGene(j).getBranch() - 1];\n\t\t\t\t\t if (mirror == 0 || i%2==0)\n\t\t\t\t\t\t\tv.addDegree(_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tv.addDegree(-_geneticCode.getGene(j).getTheta());\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Apply the vector to the starting point to get the ending point.\n\t\t\t\t_endPointX[segment] = (int) FastMath.round(v.getX() + _startPointX[segment]);\n\t\t\t\t_endPointY[segment] = (int) FastMath.round(v.getY() + _startPointY[segment]);\n\t\t\t // Calculate the bounding rectangle of this organism\n\t\t\t left = Math.min(left, _endPointX[segment]);\n\t\t\t right = Math.max(right, _endPointX[segment]);\n\t\t\t top = Math.min(top, _endPointY[segment]);\n\t\t\t bottom = Math.max(bottom, _endPointY[segment]);\n\t\t\t}\n\t\t}\n\t\t_sizeRect.setBounds(left, top, right-left+1, bottom-top+1);\n\t\t// image center\n\t\tcenterX = (left+right)>>1;\n\t\tcenterY = (top+bottom)>>1;\n\t\t_mass = 0;\n\t\t_I = 0;\n\t\tfor (i=0; i<_segments; i++) {\n\t\t\t// express points relative to the image center\n\t\t\t_startPointX[i]-=centerX;\n\t\t\t_startPointY[i]-=centerY;\n\t\t\t_endPointX[i]-=centerX;\n\t\t\t_endPointY[i]-=centerY;\n\t\t\t// calculate points distance of the origin and modulus\n\t\t\t_m1[i] = FastMath.sqrt(_startPointX[i]*_startPointX[i]+_startPointY[i]*_startPointY[i]);\n\t\t\t_m2[i] = FastMath.sqrt(_endPointX[i]*_endPointX[i]+_endPointY[i]*_endPointY[i]);\n\t\t\t_m[i] = FastMath.sqrt(FastMath.pow(_endPointX[i]-_startPointX[i],2) +\n FastMath.pow(_endPointY[i]-_startPointY[i],2));\n\t\t\t_mass += _m[i];\n\t\t\t_mphoto[i] = (0.6 + (0.48 / (double)sequence) + (1.44 / (double)symmetry)) * _m[i];\n\t\t\t// calculate inertia moment\n\t\t\t// the mass center of a segment is its middle point\n\t\t\tcx = (_startPointX[i] + _endPointX[i]) / 2d;\n\t\t\tcy = (_startPointY[i] + _endPointY[i]) / 2d;\n\t\t\t// add the effect of this segment, following the parallel axis theorem\n\t\t\t_I += FastMath.pow(_m[i],3)/12d +\n\t\t\t\t_m[i] * cx*cx + cy*cy;// mass * length^2 (center is at 0,0)\n\t\t}\n\t}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "private void managePolygonsCollisions() {\n for ( int m = 0; m < polygons.size(); m++ ) {\n for ( int n = m + 1; n < polygons.size(); n++ ) {\n managePolygonCollision(polygons.get(m), polygons.get(n));\n }\n }\n }", "boolean ignoreExistingVertices();", "private static boolean computeBelongingToPolygon(\n final int[] xArr,\n final int[] yArr,\n final int pointCount,\n //\n final int x,\n final int y) {\n\n int hits = 0;\n\n int lastx = xArr[pointCount - 1];\n int lasty = yArr[pointCount - 1];\n int curx;\n int cury;\n\n // Looping on edges.\n for (int i = 0; i < pointCount; lastx = curx, lasty = cury, i++) {\n curx = xArr[i];\n cury = yArr[i];\n\n if (cury == lasty) {\n // Point on same line.\n continue;\n }\n\n int leftx;\n if (curx < lastx) {\n // Going left.\n if (x >= lastx) {\n // But not as far as before.\n continue;\n }\n // New leftmost.\n leftx = curx;\n } else {\n // Going rightish.\n if (x >= curx) {\n continue;\n }\n leftx = lastx;\n }\n\n double test1;\n double test2;\n if (cury < lasty) {\n if ((y < cury) || (y >= lasty)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - curx;\n test2 = y - cury;\n } else {\n if ((y < lasty) || (y >= cury)) {\n continue;\n }\n if (x < leftx) {\n hits++;\n continue;\n }\n test1 = x - lastx;\n test2 = y - lasty;\n }\n\n /*\n * JDK code uses \"test1 < (test2 / dy * dx)\" here,\n * but we want to avoid the division.\n */\n final int dx = (lastx - curx);\n final int dy = (lasty - cury);\n if (dy < 0) {\n if (test1 * dy > test2 * dx) {\n hits++;\n }\n } else {\n if (test1 * dy < test2 * dx) {\n hits++;\n }\n }\n }\n\n return ((hits & 1) != 0);\n }", "private Polygon2D findDistAtTwoCorners(Point2D currIn, Point2D currOut, Point2D innerEndpoint1, Point2D innerEndpoint2, Point2D innerEndpoint3,\n \t\tPoint2D outerEndpoint1, Point2D outerEndpoint2, Point2D outerEndPoint3, double step, double lenRate, List<Voter> voters, int repPerDistrict, int party, boolean gmable, double popRate) {\n\t\tdouble efgp;\n\t\tdouble max_efgp = 0;\n\t\tPolygon2D result = null;\n\t\tfor(double innerX = innerEndpoint2.getX(); innerX <= innerEndpoint3.getX(); innerX += step) {\n\t\t\tdouble innerY = findYByX(innerX, innerEndpoint2, innerEndpoint3);\n\t\t\tdouble outerX = lenRate * (innerX - innerEndpoint2.getX()) + outerEndpoint2.getX();\n\t\t\tdouble outerY = findYByX(outerX, outerEndpoint2, outerEndPoint3);\n\t\t\tPolygon2D polygon = new Polygon2D();\n\t\t\tpolygon.append(innerEndpoint2);\n\t\t\tpolygon.append(innerEndpoint1);\n\t\t\tpolygon.append(currIn);\n\t\t\tpolygon.append(currOut);\n\t\t\tpolygon.append(outerEndpoint1);\n\t\t\tpolygon.append(outerEndpoint2);\n\t\t\tpolygon.append(outerX, outerY);\n\t\t\tpolygon.append(innerX, innerY);\n\t\t\tint p = Run.countInclusion(voters, polygon);\n\t\t\tif(gmable) {\n\t\t\t\tif(p >= 0.9*avgVotersPerDistrict && p <= 1.1*avgVotersPerDistrict) {\n\t\t\t\t\tefgp = efficiencyGap(voters, polygon, repPerDistrict, party);\n\t\t\t\t\tif(efgp > max_efgp) {\n\t\t\t\t\t\tmax_efgp = efgp;\n\t\t\t\t\t\tresult = polygon;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(p >= 1.1*(double)(avgVotersPerDistrict))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(p >= (1.0 - th)*popRate && p <= (1.0 + th)*popRate) {\n\t\t\t\t\treturn polygon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private Polygon2D findDist(Point2D currIn, Point2D currOut, Point2D innerEndpoint1, Point2D innerEndpoint2,\n \t\tPoint2D outerEndpoint1, Point2D outerEndPoint2, double step, double lenRate, List<Voter> voters, boolean reverse, int repPerDistrict, int party, boolean gmable, double popRate) {\n \t\tdouble efgp;\n \t\tdouble max_efgp = 0;\n \t\tPolygon2D result = null;\n \t\tdouble dir_step = step;\n \t\tif(reverse)\n \t\t\tdir_step = -dir_step;\n \t\tfor(double innerX = currIn.getX(); ; innerX += dir_step) {\n \t\t\tif(reverse && innerX < innerEndpoint2.getX())\n \t\t\t\tbreak;\n \t\t\tif(!reverse && innerX > innerEndpoint2.getX())\n \t\t\t\tbreak;\n\t\t\tdouble innerY = findYByX(innerX, innerEndpoint1, innerEndpoint2);\n\t\t\tdouble outerX = lenRate * (innerX - currIn.getX()) + currOut.getX();\n\t\t\tdouble outerY = findYByX(outerX, outerEndpoint1, outerEndPoint2);\n\t\t\tPolygon2D polygon = new Polygon2D();\n\t\t\tpolygon.append(currIn);\n\t\t\tpolygon.append(currOut);\n\t\t\tpolygon.append(outerX, outerY);\n\t\t\tpolygon.append(innerX, innerY);\n\t\t\tint p = Run.countInclusion(voters, polygon);\n\t\t\tif(gmable) {\n\t\t\t\tif(p >= 0.9*(double)(avgVotersPerDistrict) && p <= 1.1*(double)(avgVotersPerDistrict)) {\n\t\t\t\t\tefgp = efficiencyGap(voters, polygon, repPerDistrict, party);\n\t\t\t\t\tif(efgp > max_efgp) {\n\t\t\t\t\t\tmax_efgp = efgp;\n\t\t\t\t\t\tresult = polygon;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(p >= 1.1*(double)(avgVotersPerDistrict))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(p >= (1.0 - th)*popRate && p <= (1.0 + th)*popRate) {\n\t\t\t\t\treturn polygon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t\treturn result;\n \t}", "void removeContactMeans(int i);", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "public static void main(String args[]) throws IOException\r\n\t{\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint n=sc.nextInt();\r\n\t\t\r\n\t\tint[] counter=new int[n];\r\n\t\tint count=0; //Number of changes needed\r\n\t\tint count1=0; //Number of sections, where a section starts with a 0\r\n\t\tint count2=0; //Section length counter\r\n\t\tint count3=0;//Count for over counting in 'length'\r\n\t\tArrayList<Integer> length=new ArrayList<Integer>(); //section lengths\r\n\t\tArrayList<Integer> over=new ArrayList<Integer>();//potential overcounts\r\n\t\tint tem=0;\r\n\t\tboolean x=false;\r\n\t\tfor(int i=0; i<n; i++)\r\n\t\t{\r\n\t\t\tcounter[i]=sc.nextInt();\r\n\t\t\tif(i==0)\r\n\t\t\t{\r\n\t\t\t\tif(counter[i]==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tcounter[0]=0;\r\n\t\t\t\t}\r\n\t\t\t\tcount1++;\r\n\t\t\t}\r\n\t\t\telse if(counter[i]==0)\r\n\t\t\t{\r\n\t\t\t\tcount1++;\r\n\t\t\t\tif(tem+1==i)\r\n\t\t\t\tover.add(i-1);\r\n\t\t\t}\r\n\t\t\telse if(counter[i]<=counter[i-1])\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\ttem=i;\r\n\t\t\t\tcount3++;\r\n\t\t\t}\r\n\t\t\tif(counter[i]==0&&i!=0||i==n-1)\r\n\t\t\t{\r\n\t\t\t\tif(i==n-1)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount2++;\r\n\t\t\t\t}\r\n\t\t\t\tif(x)\r\n\t\t\t\t{\r\n\t\t\t\t\tlength.add(count2-count3);\r\n\t\t\t\t}\r\n\t\t\t\tcount3=0;\r\n\t\t\t\tx=true;\r\n\t\t\t\tcount2=0;\r\n\t\t\t}\r\n\t\t\tcount2++;\r\n\t\t}\r\n\t\tCollections.sort(length);\r\n\t\t//for(int i=0; i<length.size(); i++)\r\n\t\t//{\r\n\t\t//\tSystem.out.println(length.get(i));\r\n\t\t//}\r\n\t\tint temp=count;\r\n\t\tfor(int i=1; i<=n; i++) \r\n\t\t{\r\n\t\t\tif(count1-i>0)\r\n\t\t\t{\r\n\t\t\t\tfor(int j=0; j<count1-i; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp+=length.get(j);\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\tfor(int j=0; j<i-count1; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(over.size()>j)\r\n\t\t\t\t\ttemp--;\r\n\t\t\t\t}\r\n\t\t\t\ttemp+=(i-count1);\r\n\t\t\t}\r\n\t\t\t//pr.println(temp);\r\n\t\t\tSystem.out.println(temp);\r\n\t\t\ttemp=count;\r\n\t\t}\r\n\t\tsc.close();\r\n\t\t//pr.close();\r\n\t}", "public void findLeftAndRightEdge() throws NoSudokuFoundException{\n int bestLeftHit = 0;\n int bestRightHit = 0;\n for (int v=0; v<nextV; v++) {\n int leftHit = 0;\n int rightHit = 0;\n // for every vertical line, check if horizontal edge points A B\n // are on that line.\n double[] vline = verticalLines[v];\n double vx1 = vline[0],\n vx2 = vline[2];\n for (int h=0; h<nextH; h++){\n double[] vec = horizontalLines[h];\n double ax = vec[0],\n bx = vec[2];\n if(ax < bx) { // A is left of B\n if ((vx1<=ax && ax<=vx2) || (vx1>=ax && ax>=vx2)){\n // A is between the upper and lower edge point\n if(vx1 < centerX && vx2 < centerX) {\n leftHit++;\n }\n } else if ((vx1<=bx&& bx<=vx2) || (vx1>=bx && bx>=vx2)){\n if(vx1 > centerX && vx2 > centerX) {\n rightHit++;\n }\n }\n } else {\n if ((vx1<=bx && bx<=vx2) || (vx1>=bx && bx>=vx2)){\n if(vx1 < centerX && vx2 < centerX) {\n leftHit++;\n }\n } else if ((vx1<=ax && ax<=vx2) || (vx1>=ax && ax>=vx2)){\n if(vx1 > centerX && vx2 > centerX) {\n rightHit++;\n }\n }\n }\n }\n // take the lines with the highest counts\n if(leftHit > bestLeftHit) {\n edges[3] = verticalLines[v];\n bestLeftHit = leftHit;\n } else if (rightHit > bestRightHit){\n edges[1] = verticalLines[v];\n bestRightHit = rightHit;\n }\n }\n if(bestLeftHit < LINE_THRESHOLD || bestRightHit < LINE_THRESHOLD){\n throw new NoSudokuFoundException(\"Number of left or right line ends below threshold: L\" + bestLeftHit + \" R\" + bestRightHit);\n }\n Log.v(TAG, \"Best left hit: \" + bestLeftHit + \", best right: \" + bestRightHit);\n }", "public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }", "public void findUpperAndLowerEdge() throws NoSudokuFoundException{\n int bestUpperHit = 0;\n int bestLowerHit = 0;\n double t = INTERSECT_TOLERANCE;\n for (int h=0; h<nextH; h++) {\n int upperHit = 0;\n int lowerHit = 0;\n // for every horizontal line, check if vertical edge points A and B \n // are on that line.\n double[] hline = horizontalLines[h];\n double hy1 = hline[1],\n hy2 = hline[3];\n for (int v=0; v<nextV; v++){\n double[] vec = verticalLines[v];\n double ay = vec[1],\n by = vec[3];\n // if they are, count them\n if(ay < by) { // A is above B\n if ((hy1<=ay+t && ay<=hy2+t) || (hy1+t>=ay && ay+t>=hy2)){\n // A is between the left and right edge point.\n // only count it if it is above the screen center.\n if(hy1 < centerY && hy2 < centerY) {\n upperHit++;\n }\n } else if ((hy1<=by+t && by<=hy2+t) || (hy1+t>=by && by+t>=hy2)) {\n if(hy1 > centerY && hy2 > centerY) {\n lowerHit++;\n }\n }\n } else { // B is above A\n if ((hy1<=by+t && by<=hy2+t) || (hy1+t>=by && by+t>=hy2)) {\n if(hy1 < centerY && hy2 < centerY) {\n upperHit++;\n }\n } else if ((hy1<=ay+t && ay<=hy2+t) || (hy1+t>=ay && ay+t>=hy2)) {\n if(hy1 > centerY && hy2 > centerY) {\n lowerHit++;\n }\n } \n }\n }\n // take the lines with the highest counts\n if(upperHit > bestUpperHit) {\n edges[0] = horizontalLines[h];\n bestUpperHit = upperHit;\n } else if (lowerHit > bestLowerHit){\n edges[2] = horizontalLines[h];\n bestLowerHit = lowerHit;\n }\n }\n if(bestUpperHit < LINE_THRESHOLD || bestLowerHit < LINE_THRESHOLD){\n throw new NoSudokuFoundException(\"Number of upper (\"+bestUpperHit+\") or lower (\"+bestLowerHit+\") line ends below threshold. h\");\n }\n // Log.v(TAG, \"Best upper hit: \" + bestUpperHit + \", best lower: \" + bestLowerHit);\n }", "public SimpleFeatureCollection simplify(SimpleFeatureCollection bus_links) {\r\n\t\t\r\n\t\t//lists hold simplified and split slope segments\r\n\t\tList<SimpleFeature> simpleSlopes = new ArrayList<SimpleFeature>();\r\n\t List<SimpleFeature> segmentsSlopes = new ArrayList<SimpleFeature>();\r\n\t\t\r\n\t\t//list to hold the assigned rids of the segments\r\n\t \tList<Integer> assigned = new ArrayList<Integer>();\r\n\t \t\r\n\t\t//collections to lists\r\n\t\tList<SimpleFeature> intersections = FeatureOperations.featureCollectionToList(this.intersections);\r\n\t\tList<SimpleFeature> slopeLinks = FeatureOperations.featureCollectionToList(this.getSlopeLinks());\r\n\t\tList<SimpleFeature> slopeLiftLinks = FeatureOperations.featureCollectionToList(this.getLinks());\r\n\t\tList<SimpleFeature> busLinks = (bus_links != null) ? FeatureOperations.featureCollectionToList(bus_links) : null;\r\n\t\t\r\n\t\t//INTERSECTIONS USING KDTREE\r\n\t\t//create spatial index to contain all intersections\r\n\t\tfinal KdTree pointIndex = new KdTree();\r\n\t\tfor (SimpleFeature intersection: intersections) {\r\n\t\t\tpointIndex.insert(((Geometry)intersection.getDefaultGeometry()).getCoordinate(), intersection);\r\n\t\t}\r\n\t\tif (pointIndex.isEmpty()) {\r\n\t\t\tLogger.getLogger(SlopeLinkMatching.class.getName()).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t\tLogger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, \"kdTree is Emtpy. No Intersections loaded while simplifying slopes\");\r\n\t\t}\r\n\t\t\r\n\t\t//SLOPE LINKS, SLOPE LIFT LINKS AND BUS LINKS USING STRTREE\r\n\t\tfinal SpatialIndex lineIndex = new STRtree();\r\n\t\t//insert all slope links\r\n\t\tfor (SimpleFeature link: slopeLinks) {\r\n\t\t\tEnvelope linkEnvelope = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope, link);\r\n\t\t}\r\n\t\t//insert all slopeLift links\r\n\t\tfor (SimpleFeature link: slopeLiftLinks) {\r\n\t\t\tEnvelope linkEnvelope2 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\tlineIndex.insert(linkEnvelope2, link);\r\n\t\t}\r\n\t\t//insert all bus links\r\n\t\tif (busLinks!=null) {\r\n\t\t\tfor (SimpleFeature link: busLinks) {\r\n\t\t\t\tEnvelope linkEnvelope3 = new Envelope(((Geometry) link.getDefaultGeometry()).getEnvelopeInternal());\r\n\t\t\t\tlineIndex.insert(linkEnvelope3, link);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//KEEP INTERSECTING LINKS FOR EACH SLOPE\r\n\t\tfor (SimpleFeature slope_original: this.getFeatures_in()) {\r\n\t\t\t\r\n//if (!slope_original.getAttribute(\"DE_GR_L_1\").equals(\"Sportgastein\")) continue;\r\n\r\n\t\t\t//fetch slope geometry as LengthIndexedLine\r\n\t\t\tGeometry slopeGeom = (Geometry) slope_original.getDefaultGeometry();\r\n\t\t\tLengthIndexedLine lengthLine = new LengthIndexedLine(slopeGeom);\r\n\t\t\t\r\n\t\t\t//get envelope and expand by 5.00 meters\r\n\t\t\tEnvelope search = new Envelope(slopeGeom.getEnvelopeInternal()); \r\n\t\t\tsearch.expandBy(5.00);\r\n\r\n\t\t\t//Vertex ordered Map as index on lengthLine and corresponding coordinate\r\n\t\t\tMap<Double, Coordinate> newVertices = new TreeMap<Double, Coordinate>();\r\n\t\t\t//insert start and end-point\r\n\t\t\tnewVertices.put(lengthLine.getStartIndex(), lengthLine.extractPoint(lengthLine.getStartIndex()));\r\n\t\t\tnewVertices.put(lengthLine.getEndIndex(), lengthLine.extractPoint(lengthLine.getEndIndex()));\r\n\r\n\t\t\t/*------------------------ INTERSECTIONS ------------------------*/\r\n\t\t\t//fetch intersections in the slope envelope\r\n\t\t\tList<?> neighbourIntersections = pointIndex.query(search);\r\n\t\t\t\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following intersections: \");\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through intersections and keep only those on line (using distance threshold)\r\n\t\t\tfor (Object inters: neighbourIntersections) {\r\n\t\t\t\t//get geometry and coordinate\r\n\t\t\t\tGeometry geom = (Geometry) ((SimpleFeature)((KdNode )inters).getData()).getDefaultGeometry();\r\n\t\t\t\tCoordinate coord = geom.getCoordinate();\r\n\t\t\t\t//check if intersection is on line (using distance with threshold 1cm)\r\n\t\t\t\tif (slopeGeom.distance(geom) < 0.001) {\r\n\t\t\t\t\tdouble index = lengthLine.indexOf(coord);\r\n\t\t\t\t\t//add it if not already contained\r\n\t\t\t\t\tif(!newVertices.containsKey(index) && !newVertices.containsValue(coord)) {\r\n\t\t\t\t\t\tnewVertices.put(index, coord);\r\n\t\t\t\t\t}\r\n//\t\t\t\t\tSystem.out.println(\"\\tintersection: \" + ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_start\") + \", \" \r\n//\t\t\t\t\t+ ((SimpleFeature)((KdNode )inters).getData()).getAttribute(\"gid_end\"));\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/*------------------------ LINKS ------------------------*/\r\n\t\t\t//fetch links in the envelope\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<SimpleFeature> neighbourLinks = lineIndex.query(search);\r\n\r\n/*\t\t\tSystem.out.println(\"For slope \" + slope.getAttribute(\"XML_GID\") \r\n\t\t\t\t+ \" found following links: \");\r\n\t\t\tfor (SimpleFeature link: neighbourLinks) {\r\n\t\t\t\tSystem.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"----------------------------------\");\r\n*/\r\n\t\t\t\r\n\t\t\t//iterate through links and keep only those on line (using distance threshold)\r\n\t\t\tfor (SimpleFeature link : neighbourLinks) {\t\t\t\t\r\n\t\t\t\tGeometry linkGeom = (Geometry) link.getDefaultGeometry();\r\n\t\t\t\t//filter out links not intersecting with slope\r\n\t\t\t\tif(slopeGeom.distance(linkGeom) < 0.05) {\r\n\t\t\t\t\tCoordinate[] linkCoords = linkGeom.getCoordinates();\r\n\t\t\t\t\t//check which link end-point is on line (using distance with threshold 5cm) and add if not already contained\r\n\t\t\t\t\tfor (Coordinate linkCoord: linkCoords) {\r\n\t\t\t\t\t\tif (slopeGeom.distance(FeatureMatching.geomOps.coordinateToPointGeometry(linkCoord)) < 0.05 && !newVertices.containsValue(linkCoord)) {\r\n\t\t\t\t\t\t\tnewVertices.put(lengthLine.indexOf(linkCoord), linkCoord);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t//System.out.println(\"\\tlink: \" + link.getAttribute(\"gid_start\") + \", \" + link.getAttribute(\"gid_end\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*-------------------------------------------------------*/\r\n\t\t\t\r\n\t\t\t//new coordinate list from kept indices, for the creation of the simplified feature\r\n\t\t\tList<Coordinate> simplifiedCoords = new ArrayList<Coordinate>();\r\n\t\t\tfor (Entry<Double, Coordinate> entry: newVertices.entrySet()){\r\n\t\t\t\tif (!simplifiedCoords.contains(entry.getValue()))\r\n\t\t\t\tsimplifiedCoords.add(entry.getValue());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//use the simplified coordinates to split original bus geometry to its bus segments at topologic nodes\r\n\t\t\t//geometry must be preserved\r\n\t\t\t//semantic attributes must be preserved\r\n\t\t\t// r_id attribute must be added\r\n\t\t\tArrayList<SimpleFeature> splitSegments = FeatureMatching.featOps.splitFeatureAtCoordinates(slope_original, simplifiedCoords);\r\n\t\t\t\r\n\t\t\t//create new feature and add to feature collection\r\n\t\t\tSimpleFeatureType simplifiedType = FeatureOperations.makeLineStringFeatureType(this.getFeatures_in()[0].getFeatureType().getCoordinateReferenceSystem(), \"merged_pivots\");\r\n\t\t\tSimpleFeature simplifiedSlope = FeatureMatching.featOps.getFeatureFromCoordinates(simplifiedType, simplifiedCoords.toArray(new Coordinate[0]));\r\n\t\t \tString deName = slope_original.getAttribute(\"DE_GR_L_0\").toString() + \" \" + slope_original.getAttribute(\"DE_GR_L_1\").toString();\r\n\t\t \t//split feature at remaining vertices to line segments (for each vertex pair)\r\n\t\t \tArrayList<SimpleFeature> simpleSegments = FeatureMatching.featOps.splitFeatureAtVertices(simplifiedSlope);\r\n\t\t \t//rids building\r\n\t\t \tint segmentNumber = 1;\r\n//if(splitSegments.size() != simpleSegments.size()) {\t\t \t\r\n//System.out.println(slope_original.getAttribute(\"XML_GID\").toString() + \": \" +splitSegments.size() + \" / \" + simpleSegments.size());\t\r\n//System.exit(0);\r\n//}\t\t\t\r\n\t\t \tfor (SimpleFeature simpleSegment: simpleSegments) {\r\n\t\t \t\tGeometry segment_geom = (Geometry) simpleSegment.getDefaultGeometry();\r\n\t\t \t\tCoordinate[] segment_coords = segment_geom.getCoordinates(); \r\n\t\t \t\t//indexedLineGeom to getLength\r\n\t\t \t\tdouble length = lengthLine.extractLine(lengthLine.indexOf(segment_coords[0]), lengthLine.indexOf(segment_coords[1])).getLength();\r\n\t\t \t\t//in case segment has zero length ignore it and proceed to the next\r\n\t\t \t\tif (length == 0.0) continue;\t//{System.err.println(length);}\r\n\t\t \t\tdouble cost_1, cost_2, cost_3, r_cost_1, r_cost_2, r_cost_3;\r\n if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 1) {\r\n r_cost_1 = length; r_cost_2 = 10 * length; r_cost_3 = 15 * length;\r\n cost_1 = length; cost_2 = 10 * length; cost_3 = 15 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 2) {\r\n r_cost_1 = 5 * length; r_cost_2 = length; r_cost_3 = 5 * length;\r\n cost_1 = 5 * length; cost_2 = length; cost_3 = 5 * length;\r\n } else if (Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()) == 3) {\r\n r_cost_1 = 15 * length; r_cost_2 = 10 * length; r_cost_3 = length;\r\n cost_1 = 15 * length; cost_2 = 10 * length; cost_3 = length;\r\n } else {\r\n r_cost_1 = length; r_cost_2 = length; r_cost_3 = length;\r\n cost_1 = length; cost_2 = length; cost_3 = length;\r\n }\r\n \r\n\t\t \t\t//build unique r_id\r\n int slopeNumber = Integer.parseInt(slope_original.getAttribute(\"XML_GID\").toString());\r\n\t\t \t\tint rid = Integer.parseInt(\"1\"+ digitRectifier(slopeNumber, 5) + digitRectifier(segmentNumber, 3));\r\n\t\t \t\twhile (assigned.contains(rid)) {\r\n\t\t \t\t\trid++;\r\n\t\t \t\t\tsegmentNumber++;\r\n\t\t \t\t}\r\n\t\t \t\tassigned.add(rid);\r\n\t\t \t\tsegmentNumber++;\r\n\t\t \t\t//pass computed r_id to the corresponded split segment\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"r_id\", rid);\r\n\t\t \t\tsplitSegments.get(simpleSegments.indexOf(simpleSegment)).setAttribute(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n \r\n\t\t\t \tMap <String, Object> attrs = new LinkedHashMap<String, Object>();\r\n\t\t\t \tattrs.put(\"XML_TYPE\", \"slopes\");\r\n\t\t\t \tattrs.put(\"de_name\", deName);\r\n\t\t\t \tattrs.put(\"difficulty\", Integer.parseInt(slope_original.getAttribute(\"difficulty\").toString()));\r\n\t\t\t \tattrs.put(\"source\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"target\", String.valueOf(0));\r\n\t\t\t \tattrs.put(\"duration\", Double.parseDouble(\"0\")); //duration 0 for slopes\r\n\t\t\t \tattrs.put(\"length\", length); \r\n\t\t\t \tattrs.put(\"r_length\", length); \r\n attrs.put(\"r_rev_c\", (double) -1);\r\n attrs.put(\"rev_c\", (double) -1);\r\n\t\t\t \tattrs.put(\"cost_1\", cost_1);\r\n\t\t\t \tattrs.put(\"cost_2\", cost_2);\r\n\t\t\t \tattrs.put(\"cost_3\", cost_3);\r\n\t\t\t \tattrs.put(\"r_cost_1\", r_cost_1);\r\n\t\t\t \tattrs.put(\"r_cost_2\", r_cost_2);\r\n\t\t\t \tattrs.put(\"r_cost_3\", r_cost_3);\r\n\t\t\t \tattrs.put(\"open\", (int) 0);\r\n\t\t\t \tattrs.put(\"start_z\", segment_coords[0].z/10);\r\n\t\t\t \tattrs.put(\"end_z\", segment_coords[segment_coords.length-1].z/10);\r\n\t\t\t\tattrs.put(\"r_id\", rid);\r\n\t\t\t\t//add attributes\r\n\t\t\t\tfor (Map.Entry<String, Object> attribute : attrs.entrySet()){\r\n\t\t\t\t\tsimpleSegment = FeatureOperations.addAttribute(simpleSegment, attribute.getKey(), attribute.getValue());\r\n\t\t\t\t\tsimpleSegment.setAttribute(attribute.getKey(), attribute.getValue());\r\n\t\t\t\t}\r\n\t\t\t\tsimpleSlopes.add(simpleSegment);\r\n\t\t \t}\r\n\t\t \tsegmentsSlopes.addAll(splitSegments);\r\n\r\n\t\t\t//CONTROL METHOD PRINTS OUT SLOPE WITH NO CONNECTIONS\r\n/*\t\t\tif (neighbourLinks.size() == 0 && neighbourIntersections.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links and no intersections\");\r\n\t\t\t} else if (neighbourLinks.size() == 0) {\r\n\t\t\t\tSystem.err.println(\"Slope with 'r_id' \" + slope_original.getAttribute(\"XML_GID\") + \" was found with no links\");\r\n\t\t\t}*/\r\n\t\t\t//TODO:METHOD END PRINT RESULT TO FILE\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//create segments_buses shapeFile\r\n\t\tSimpleFeatureCollection newSlopeSegments = new ListFeatureCollection(segmentsSlopes.get(0).getFeatureType(), segmentsSlopes);\r\n\t\tFileOperations.createShapeFile(newSlopeSegments, StartConfiguration.getInstance().getFolder_out() + \"segments_slopes.shp\");\t\r\n\t\t//return feature collection\r\n\t\tSimpleFeatureCollection simplifiedSlopes = new ListFeatureCollection(simpleSlopes.get(0).getFeatureType(), simpleSlopes);\r\n\t\t\r\n\t\t\r\n\t\treturn simplifiedSlopes;\r\n\t}", "public void findBoundary(boolean useDestinations)\r\n\t{\n\tdouble maxSpacing = res/5.0;\r\n\tif(maxSpacing<1) maxSpacing = 1;\r\n\t\r\n\t//First make sure point sampling is dense enough:\t\r\n\tVector<Int2d> surfaceT = new Vector<Int2d>();\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tsurfaceT.add(p);\r\n\t\tInt2d p2 = surface.get((it+1)%sl);\r\n\t\tdouble pdist = p2.distance(p);\r\n\t\tif(pdist > maxSpacing)\r\n\t\t\t{\r\n\t\t\t// populate this line segment with points\r\n\t\t\tint extraPoints = (int)(pdist/maxSpacing); // - 2 cause we already have 2 points\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<extraPoints; i++)\r\n\t\t\t\t{\r\n\t\t\t\tInt2d pN = new Int2d(p);\r\n\t\t\t\tInt2d diff = new Int2d();\r\n\t\t\t\tdiff.sub(p2,p);\r\n\t\t\t\tpN.scaleAdd((double)(i+1.)/(extraPoints+1.),diff,pN);\r\n\t\t\t\tsurfaceT.add(pN);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//System.out.println(\"got here2.1\");\r\n\tsurface = surfaceT;\r\n\tcanvas1.surface = surface;\r\n\tsl = surfaceT.size();\r\n\t\t\r\n\t//System.out.println(sl);\r\n\t\r\n\t\t\t\t\r\n\tfor(int it=0; it<sl; it++)\r\n\t\t{\r\n\t\tInt2d p = surface.get(it);\r\n\t\tint i = (int)(p.x/res);\r\n\t\tint j = (int)(p.y/res);\r\n\t\tboolean extraWide = false;\r\n\t\tboolean extraHigh = false;\t\t\r\n\t\t\r\n\t\tif((p.y % res) == 0)\r\n\t\t\t{\r\n\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\textraHigh = true;\r\n\t\t\t}\r\n\t\tif((p.x % res) == 0)\r\n\t\t\t{\r\n\t\t\textraWide = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tint len = 4;\r\n\t\tif(extraWide && extraHigh) len = 9;\r\n\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\r\n\t\tInt2d[] pi = new Int2d[len];\r\n\t\tint[] ic = new int[len];\r\n\t\tint[] jc = new int[len];\r\n\t\t\r\n\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\r\n\t\tfor(int c=0; c<len; c++)\r\n\t\t\t{\r\n\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t{\r\n\t\t\t\tif(!useDestinations)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//else phi[ic[c]][jc[c]] = -phiStart;\r\n\t\t\t\t// Way suggested in paper, but this looks bad with interpolation\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"got here2.2\");\r\n\t\t\r\n\tif(useDestinations) //Use destinations\r\n\t\t{\t\t\r\n\t\t// Sets destination point distances accordingly\r\n\t\t\r\n\t\tint dl = destinations.size();\r\n\t\tfor(int it=0; it<dl; it++)\r\n\t\t\t{\r\n\t\t\tInt2d p = destinations.get(it);\r\n\t\t\tint i = (int)(p.x/res);\r\n\t\t\tint j = (int)(p.y/res);\r\n\t\t\tboolean extraWide = false;\r\n\t\t\tboolean extraHigh = false;\t\t\r\n\t\t\t\r\n\t\t\tif((p.y % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t//System.out.println(\"Extra high at i,j = \" + i + \", \" + j);\r\n\t\t\t\textraHigh = true;\r\n\t\t\t\t}\r\n\t\t\tif((p.x % res) == 0)\r\n\t\t\t\t{\r\n\t\t\t\textraWide = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tint len = 4;\r\n\t\t\tif(extraWide && extraHigh) len = 9;\r\n\t\t\telse if(extraWide || extraHigh) len = 6;\r\n\t\t\t\r\n\t\t\tInt2d[] pi = new Int2d[len];\r\n\t\t\tint[] ic = new int[len];\r\n\t\t\tint[] jc = new int[len];\r\n\t\t\t\r\n\t\t\tgenerateStencil(i,j,extraWide,extraHigh,ic,jc,pi,len);\r\n\t\t\t\r\n\t\t\tfor(int c=0; c<len; c++)\r\n\t\t\t\t{\r\n\t\t\t\tif(withinBounds(ic[c],jc[c]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(!boundary.contains(pi[c])) boundary.add(pi[c]);\r\n\t\t\t\t\tInt2d piX = new Int2d(res*pi[c].x,res*pi[c].y);\r\n\t\t\t\t\tdouble dCur = piX.distance(p);\r\n\t\t\t\t\tint sign = 1;\r\n\t\t\t\t\tif(poly.contains(res*pi[c].x,res*pi[c].y)) sign = -1;\r\n\t\t\t\t\t//if(ic[c] == 10 && jc[c] == 10) System.out.println(\"sign = \" + sign);\r\n\t\t\t\t\tif(dCur<Math.abs(phi[ic[c]][jc[c]]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tphi[ic[c]][jc[c]] = sign*dCur;\r\n\t\t\t\t\t\t//System.out.println(sign*dCur);\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\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\tint bl = boundary.size();\r\n\t/*\r\n\tfor(int k=0; k<bl; k++)\r\n\t\t{\r\n\t\tSystem.out.println(boundary.get(k).x + \", \" + boundary.get(k).y + \": element \" + k);\r\n\t\t}\r\n\t\t*/\r\n\t\t\t\r\n\tfor(int i=0; i<bl; i++)\r\n\t\t{\r\n\t\tInt2d pi = boundary.get(i);\r\n\t\tpi.phi = phi[pi.x][pi.y];\r\n\t\t}\r\n\t}", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-2147483648L), 1146L);\n long long0 = range0.getBegin();\n assertEquals((-2147483648L), long0);\n \n Range range1 = Range.of(1146L);\n range1.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range1.forEach(consumer0);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n List<Range> list0 = range1.complementFrom(linkedList0);\n range0.complementFrom(list0);\n Range range2 = Range.ofLength(1146L);\n Range range3 = range2.intersection(range1);\n assertTrue(range3.isEmpty());\n \n long long1 = range1.getEnd();\n assertEquals(1146L, long1);\n \n boolean boolean0 = range0.intersects(range2);\n assertTrue(boolean0);\n \n range1.equals(range2);\n Range.of(2641L);\n List<Range> list1 = range0.complement(range2);\n assertEquals(1, list1.size());\n }", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "private Polygon2D findDistAtCorner(Point2D currIn, Point2D currOut, Point2D innerEndpoint1, Point2D innerEndpoint2,\n \t\tPoint2D outerEndpoint1, Point2D outerEndPoint2, double step, double lenRate, List<Voter> voters, boolean reverse, int repPerDistrict, int party, boolean gmable, double popRate) {\n \t\tdouble efgp;\n\t\tdouble max_efgp = 0;\n\t\tPolygon2D result = null;\n \t\tdouble dir_step = step;\n\t\tif(reverse)\n\t\t\tdir_step = -dir_step;\n\t\tfor(double innerX = innerEndpoint1.getX(); ; innerX += dir_step) {\n\t\t\tif(reverse && innerX < innerEndpoint2.getX())\n\t\t\t\tbreak;\n\t\t\tif(!reverse && innerX > innerEndpoint2.getX())\n\t\t\t\tbreak;\n\t\t\tdouble innerY = findYByX(innerX, innerEndpoint1, innerEndpoint2);\n\t\t\tdouble outerX = lenRate * (innerX - innerEndpoint1.getX()) + outerEndpoint1.getX();\n\t\t\tdouble outerY = findYByX(outerX, outerEndpoint1, outerEndPoint2);\n\t\t\tPolygon2D polygon = new Polygon2D();\n\t\t\tpolygon.append(innerEndpoint1);\n\t\t\tpolygon.append(currIn);\n\t\t\tpolygon.append(currOut);\n\t\t\tpolygon.append(outerEndpoint1);\n\t\t\tpolygon.append(outerX, outerY);\n\t\t\tpolygon.append(innerX, innerY);\n\t\t\tint p = Run.countInclusion(voters, polygon);\n\t\t\tif(gmable) {\n\t\t\t\tif(p >= 0.9 * avgVotersPerDistrict && p <= 1.1 * avgVotersPerDistrict) {\n\t\t\t\t\tefgp = efficiencyGap(voters, polygon, repPerDistrict, party);\n\t\t\t\t\tif(efgp > max_efgp) {\n\t\t\t\t\t\tmax_efgp = efgp;\n\t\t\t\t\t\tresult = polygon;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(p >= 1.1*(double)(avgVotersPerDistrict))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(p >= (1.0 - th)*popRate && p <= (1.0 + th)*popRate) {\n\t\t\t\t\treturn polygon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public Collection<IntPair> findEmptyNeighbors(int x, int y);", "public static Coordinate[] makeArea(Coordinate[] polyLine, double width) {\n Coordinate vertices[];\n int numPoints = polyLine.length;\n // If there aren't at least two points, return an empty list\n if (numPoints < 2) {\n return new Coordinate[0];\n }\n // We've got at least two points, start initializing\n int numNewPoints = numPoints * 2;\n vertices = new Coordinate[numNewPoints];\n\n Coordinate p1, p2, intersectPoint;\n Coordinate[] perpLine1, perpLine2;\n Coordinate[] prevLine1, prevLine2, parallelLine1, parallelLine2;\n prevLine1 = new Coordinate[2];\n prevLine2 = new Coordinate[2];\n parallelLine1 = new Coordinate[2];\n parallelLine2 = new Coordinate[2];\n\n double meterWidth = width;\n\n // Define line p1p2\n p1 = polyLine[0];\n p2 = polyLine[1];\n // Get a line perpendicular to p1p2 through the first point of input\n // 'polyline'\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n // Keep these two endpoints as part of the final polygon\n vertices[0] = perpLine1[0];\n vertices[numNewPoints - 1] = perpLine1[1];\n\n // Get a line perpendicular to p1p2 through the second point of\n // 'polyline'\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Using these new endpoints, determine the 2 parallel lines that\n // straddle p1p2\n // Since the linePerpendicularThruP1 method always rotates in a\n // clockwise\n // direction, perpLine2 endpoints will be rotated 180 degrees wrt\n // perpLine1 endpoints\n prevLine1[0] = perpLine1[0];\n prevLine1[1] = perpLine2[1];\n prevLine2[0] = perpLine1[1];\n prevLine2[1] = perpLine2[0];\n\n for (int i = 2; i < numPoints; i++) {\n // Define p1p2\n p1 = polyLine[i - 1];\n p2 = polyLine[i];\n // Calculate 2 end lines perpendicular to p1p2 that are 'kmWidth'\n // long\n perpLine1 = linePerpendicularThruP1(p1, p2, meterWidth);\n perpLine2 = linePerpendicularThruP1(p2, p1, meterWidth);\n // Calculate 2 lines parallel to p1p2 that are 'kmWidth' apart\n parallelLine1[0] = perpLine1[0];\n parallelLine1[1] = perpLine2[1];\n parallelLine2[0] = perpLine1[1];\n parallelLine2[1] = perpLine2[0];\n\n // Compute the intersections\n intersectPoint = intersection(parallelLine1, prevLine1);\n vertices[i - 1] = intersectPoint;\n intersectPoint = intersection(parallelLine2, prevLine2);\n vertices[numNewPoints - i] = intersectPoint;\n\n // Now stash the current lines as the previous lines for future\n // calcs.\n prevLine1[0] = parallelLine1[0];\n prevLine1[1] = parallelLine1[1];\n prevLine2[0] = parallelLine2[0];\n prevLine2[1] = parallelLine2[1];\n }\n // Now tack on the last perpendicular line\n vertices[numNewPoints / 2 - 1] = perpLine2[1];\n vertices[numNewPoints / 2] = perpLine2[0];\n return vertices;\n }", "private void drawScanlines(Graphics g, ArrayList<Vector2f> vertices) {\r\n if (vertices.isEmpty()) return;\r\n g.setColor(Color.GREEN);\r\n // 1. Sort vertices by y-axis-value\r\n vertices.sort((v0, v1) -> Float.compare(v0.y, v1.y));\r\n // 2. Iterate through sorted vertices\r\n int i = 0;\r\n while (i < vertices.size()) {\r\n // Get the vertices with the lowest y-value\r\n int currentY = (int)vertices.get(i).y;\r\n List<Vector2f> vList = vertices\r\n .stream().filter(v -> v.y == currentY)\r\n .collect(Collectors.toList());\r\n // Check if there is at least a pair of vertices on the same 'level'\r\n // to be drawn in between\r\n if (vList.size() >= 2) {\r\n // Get the lowest x-value\r\n float minX = vList.stream().min((v1, v2) -> Float.compare(v1.x, v2.x)).get().x;\r\n // Get the highest x-value\r\n float maxX = vList.stream().max((v1, v2) -> Float.compare(v1.x, v2.x)).get().x;\r\n // Loop through x-values until maximum x is reached\r\n while(minX < maxX) {\r\n // Check if there is still space between lowest and highest x-value\r\n if (!vertices.contains(new Vector2f(minX, currentY))) {\r\n // Fill the space with an arc\r\n g.drawArc((int)minX, currentY, 1, 1, 0, 360);\r\n }\r\n // Continue with next x-value\r\n minX++;\r\n }\r\n }\r\n // Current y-value has been processed, skip those\r\n i += vList.size();\r\n }\r\n }", "public boolean IsDisappearing(){\r\n for (int i = 2; i < 10; i++) {\r\n ArrayList<Block> blocks = blockList.GetBlockList(i);//get all blocks\r\n int[] indexI = new int[blocks.size()], indexJ = new int[blocks.size()];\r\n //put i and j of All blocks with same color on i&j arrays\r\n for (int j = 0; j < indexI.length; j++) {\r\n indexI[j] = blocks.get(j).getI();\r\n indexJ[j] = blocks.get(j).getJ();\r\n }\r\n //check if 2 block beside each other if yes return true\r\n if (CheckBoom(indexI, indexJ))\r\n return true;\r\n else if (blocks.size() == 3) {//else check if there is another block have same color if yes swap on i,j array\r\n int temp = indexI[2];\r\n indexI[2] = indexI[1];\r\n indexI[1] = temp;\r\n temp = indexJ[2];\r\n indexJ[2] = indexJ[1];\r\n indexJ[1] = temp;\r\n if (CheckBoom(indexI, indexJ))//check\r\n return true;\r\n else {//else check from another side\r\n temp = indexI[0];\r\n indexI[0] = indexI[2];\r\n indexI[2] = temp;\r\n temp = indexJ[0];\r\n indexJ[0] = indexJ[2];\r\n indexJ[2] = temp;\r\n if (CheckBoom(indexI, indexJ))//check\r\n return true;\r\n }\r\n }\r\n }\r\n //if not return true so its false\r\n return false;\r\n }", "private boolean takeoutOverlaps(\r\n\t\t\tint root_frame_idx,\r\n\t\t\tint group_right_offset_idx,\r\n\t\t\tString [] segments_strs) {\r\n\r\n\t\tfor(int i = root_frame_idx; i < (root_frame_idx+group_right_offset_idx); i++) {\r\n\t\t\tfor(int j = 0; j < segments_strs.length; j ++) {\r\n\t\t\t\tString test_segment = segments_strs[j];\r\n\t\t\t\tSkeletonNode test_node = skeletonWrappers[i].getFromHash(test_segment);\r\n\r\n\t\t\t\t/**If node exist for this frame group within the skeleton\r\n\t\t\t\t * wrappers, remove it so that it does not appear in this\r\n\t\t\t\t * location for other frame groups with lower position in\r\n\t\t\t\t * the sorted list of frame groups**/\r\n\t\t\t\tif(test_node != null) {\r\n\t\t\t\t\tskeletonWrappers[i].remopveFromHash(test_segment);\r\n\t\t\t\t\tif(test_node.isFirstLevel()) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/**If this node doesn't exit then it must already\r\n\t\t\t\t * belong to some other frame group with higher\r\n\t\t\t\t * significance. So filter this frame group out.**/\r\n\t\t\t\telse {\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\r\n\t\treturn false;\r\n\t}", "private List<List<Edge>> dfs(List<Point> vertices, int start, int end) {\n\n /**\n * used for the answer returned\n */\n List<List<Edge>> allTessellations = new ArrayList<>();\n\n /**\n * Base Case: Return an empty list if current polygon is already a\n * triangle. If the difference between the end vertices and the start\n * vertices is less than 3, there can't be any possible tessellations\n * made\n */\n if (end - start < 3) {\n return allTessellations;\n }\n\n /**\n * iterate through the current polygon\n */\n for (int k = start + 1; k < end; k++) {\n\n /**\n * placeholder for storing possible tessellations\n */\n List<Edge> temp = new ArrayList<>();\n\n /**\n * Add the length of the internal edge to the list \n *\n * An internal edge can only be internal if the k vertices is either\n * not the adjacent vertices of the start or end point of the\n * current tessellation of the polygon.\n */\n if (start + 1 < k) {\n temp.add(new Edge(new Point(vertices.get(k).getxPos(), vertices.get(k).getyPos()),\n new Point(vertices.get(start).getxPos(), vertices.get(start).getyPos())));\n }\n\n if (end - 1 > k) {\n temp.add(new Edge(new Point(vertices.get(k).getxPos(), vertices.get(k).getyPos()),\n new Point(vertices.get(end).getxPos(), vertices.get(end).getyPos())));\n }\n\n /**\n * get the left and right tessellations\n */\n List<List<Edge>> left = dfs(vertices, start, k);\n List<List<Edge>> right = dfs(vertices, k, end);\n\n /**\n * if the left and right tessellations are empty then only add the\n * temp list\n * \n * if not, then get the cartesian product of each side to get every \n * possible tessellation with both lists\n */\n if (left.isEmpty() && right.isEmpty()) \n allTessellations.add(temp);\n else\n allTessellations.addAll(combine(left, right, temp));\n\n }\n\n return allTessellations;\n\n }", "public Position.PositionList buildSegment() {\n List<Position> positions = new ArrayList<>(3);\n\n // determine the middle point of the descending segment\n Position middlePos;\n if (startPoint.getElevation() > endPoint.getElevation()) {\n middlePos = new Position(\n Position.interpolateGreatCircle(1 - PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), startPoint.getElevation());\n } else {\n middlePos = new Position(\n Position.interpolateGreatCircle(PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), endPoint.getElevation());\n }\n\n // add the last points\n positions.add(middlePos);\n positions.add(endPoint);\n\n return new Position.PositionList(positions);\n }", "public void testGetLengthCentroid() {\n\n for (int i = 0; i < 100; ++i) {\n // Choose a coordinate frame for the great circle.\n S2Point x = randomPoint();\n S2Point y = S2Point.normalize(S2Point.crossProd(x, randomPoint()));\n S2Point z = S2Point.normalize(S2Point.crossProd(x, y));\n\n List<S2Point> vertices = Lists.newArrayList();\n for (double theta = 0; theta < 2 * S2.M_PI; theta += Math.pow(rand.nextDouble(), 10)) {\n S2Point p = S2Point.add(S2Point.mul(x, Math.cos(theta)), S2Point.mul(y, Math.sin(theta)));\n if (vertices.isEmpty() || !p.equals(vertices.get(vertices.size() - 1))) {\n vertices.add(p);\n }\n }\n // Close the circle.\n vertices.add(vertices.get(0));\n S2Polyline line = new S2Polyline(vertices);\n S1Angle length = line.getArclengthAngle();\n assertTrue(Math.abs(length.radians() - 2 * S2.M_PI) < 2e-14);\n }\n }", "private Geometry crackPolygonWithPointOrLine(Polygon polygon,\r\n\t\t\tGeometry geometry) {\r\n\t\tif (!(geometry instanceof LineString) && !(geometry instanceof Point))\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Este metodo solo funciona con puntos y lineas y se recibio \"\r\n\t\t\t\t\t\t\t+ geometry.getGeometryType());\r\n\t\tLinearRing shell = (LinearRing) polygon.getExteriorRing();\r\n\t\tLinearRing crackedShell = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\tcrackTo(shell.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\"LINEARRING\");\r\n\t\tint numberOfHoles = polygon.getNumInteriorRing();\r\n\t\tLinearRing[] crackedHoles = new LinearRing[numberOfHoles];\r\n\t\tfor (int i = 0; i < numberOfHoles; i++) {\r\n\t\t\tLinearRing hole = (LinearRing) polygon.getInteriorRingN(i);\r\n\t\t\tLinearRing crackedHole = (LinearRing) JtsUtil.createGeometry(\r\n\t\t\t\t\tcrackTo(hole.getCoordinates(), geometry.getCoordinates()),\r\n\t\t\t\t\t\"LINEARRING\");\r\n\t\t\tcrackedHoles[i] = crackedHole;\r\n\t\t}\r\n\t\treturn JtsUtil.GEOMETRY_FACTORY.createPolygon(crackedShell,\r\n\t\t\t\tcrackedHoles);\r\n\t}", "int prepareHalfEdges() {\n // remove unused half edges\n ListIterator<VoronoiHalfEdge> halfEdgeIterator = halfEdges.listIterator();\n while (halfEdgeIterator.hasNext()) {\n VoronoiEdge edge = halfEdgeIterator.next().getEdge();\n if (edge.getEndingPoint() == null || edge.getStartingPoint() == null) {\n halfEdgeIterator.remove();\n }\n }\n // sort them by angle\n halfEdges.sort(Comparator.comparing(VoronoiHalfEdge::getAngle).reversed());\n // return the number of remaining edges\n return halfEdges.size();\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic static void Relaxation(Object o, Iterable<Point2i> ring) {\n\t\tContext context = (Context) ContextUtils.getContext(o);\n\t\tGrid grid = (Grid) context.getProjection(\"grid-space\");\n\t\tContinuousSpace space = (ContinuousSpace) context.getProjection(\"continuous-space\");\n\n\t\t// Loop on ring boxes\n\t\tfor(Point2i p: ring) {\n\n\t\t\tfor (Object a1: grid.getObjectsAt(p.getX(), p.getY())) {\n\t\t\t\tfor (Object a2: grid.getObjectsAt(p.getX(), p.getY())) {\n\t\t\t\t\tif(!(a1 instanceof VEColi) || !(a2 instanceof VEColi) || a1.equals(a2)) continue;\n\t\t\t\t\tif( Agent.collided( (VEColi) a1, (VEColi) a2, 0.1) ) {\n\n\t\t\t\t\t\t//Teniendo en cuenta que la bacteria a1 es el centro de coordenadas tiene los puntos A1, B1, C1, D1\n\t\t\t\t\t\tdouble xA1 = - (( (VEColi) a1).getLength())/2; \n\t\t\t\t\t\tdouble yA1 = (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xB1 = - (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yB1 = - (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xC1 = (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yC1 = - (( (VEColi) a1).getWidth())/2;\n\t\t\t\t\t\tdouble xD1 = (( (VEColi) a1).getLength())/2;\n\t\t\t\t\t\tdouble yD1 = (( (VEColi) a1).getWidth())/2;\n\n\n\t\t\t\t\t\t//Angulo entre bacteria a1 y bacteria a2\n\t\t\t\t\t\tdouble alpha1 = Math.toRadians(Angle.convheading(((VEColi) a1).getHeading())); //angulo de a1 en radianes\n\t\t\t\t\t\tdouble alpha2 = Math.toRadians(Angle.convheading(((VEColi) a2).getHeading())); //angulo de a2 en radianes\n\t\t\t\t\t\tdouble alpha = alpha1 - alpha2;\n\t\t\t\t\t\t\n\t\t\t\t\t\tNdPoint a1Location = space.getLocation(a1); //Posicion de la celula a1.\n\t\t\t\t\t\tdouble xa1 = a1Location.getX();\n\t\t\t\t\t\tdouble ya1 = a1Location.getY();\n\t\t\t\t\t\tNdPoint a2Location = space.getLocation(a2); //Posicion de la celula a2.\n\t\t\t\t\t\tdouble xa2 = a2Location.getX();\n\t\t\t\t\t\tdouble ya2 = a2Location.getY();\n\n\t\t\t\t\t\t//double xG2 = Math.cos(alpha) * (xa2 - xa1) + Math.sin(alpha) * (ya2 - ya1);\n\t\t\t\t\t\t//Dado que el centro de G1 con el cambio de coordenadas esta en (0,0).\n\t\t\t\t\t\tdouble xG2 = Math.cos(alpha) * xa2 + Math.sin(alpha) * ya2;\n\t\t\t\t\t\tdouble yG2 = -Math.sin(alpha) * xa2 + Math.cos(alpha) * ya2;\n\n\t\t\t\t\t\t// Puntos de la Bacteria a2 A2,B2,C2,D2 teniendo en cuenta que el origen de coordenadas esta en el centro de la Bacteria1.\n\t\t\t\t\t\tdouble xA2 = xG2 - ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yA2 = yG2 - ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xB2 = xG2 - ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yB2 = yG2 - ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xC2 = xG2 + ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yC2 = yG2 + ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\tdouble xD2 = xG2 + ( ((VEColi) a2).getLength()/2) * Math.cos( alpha ) - ( (( (VEColi) a2).getWidth())/2 * Math.sin( alpha ));\n\t\t\t\t\t\tdouble yD2 = yG2 + ( ((VEColi) a2).getLength()/2) * Math.sin( alpha ) + ( (( (VEColi) a2).getWidth())/2 * Math.cos( alpha ));\n\n\t\t\t\t\t\t//Voy a ver donde se encuentra la bacteria 2 con respecto a la bacteria 1 para poder hacer el cambio.\n\t\t\t\t\t\tboolean cambio = false;\n\t\t\t\t\t\tint caso = 0;\n\t\t\t\t\t\tif( xG2 > 0 && yG2 > 0 && alpha > 0 ){\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 1;\n\t\t\t\t\t\t}else if( xG2 > 0 && yG2 > 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 2. Simetria respecto al EJE X. \n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 2; //Me encuentro en el caso2.\n\t\t\t\t\t\t} else if(xG2 < 0 && yG2 > 0 && alpha > 0) {\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 3;\n\t\t\t\t\t\t}else if( xG2 < 0 && yG2 > 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 4. Simetria respecto al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 4; //Me encuentro en el caso4.\n\t\t\t\t\t\t} else if( xG2 < 0 && yG2 < 0 && alpha > 0 ) {\n\t\t\t\t\t\t\t//Caso 5. Simetria respecto al EJE X y al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 5;\n\t\t\t\t\t\t} else if( xG2 < 0 && yG2 < 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 6. Simetria respecto al EJE X.\n\t\t\t\t\t\t\tyA2 = -yA2;\n\t\t\t\t\t\t\tyB2 = -yB2;\n\t\t\t\t\t\t\tyC2 = -yC2;\n\t\t\t\t\t\t\tyD2 = -yD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 6; //Me encuentro en el caso5.\n\n\t\t\t\t\t\t} else if( xG2 > 0 && yG2 < 0 && alpha > 0 ){\n\t\t\t\t\t\t\tcambio = false;\n\t\t\t\t\t\t\tcaso = 7;\n\t\t\t\t\t\t} else if( xG2 > 0 && yG2 < 0 && alpha < 0 ) {\n\t\t\t\t\t\t\t//Caso 8. Simetria respecto al EJE Y.\n\t\t\t\t\t\t\txA2 = -xA2;\n\t\t\t\t\t\t\txB2 = -xB2;\n\t\t\t\t\t\t\txC2 = -xC2;\n\t\t\t\t\t\t\txD2 = -xD2;\n\t\t\t\t\t\t\tcambio = true;\n\t\t\t\t\t\t\tcaso = 8; //Me encuentro en el caso8.\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tPoint2D.Double A1 = new Point2D.Double(xA1, yA1);\n\t\t\t\t\t\tPoint2D.Double B1 = new Point2D.Double(xB1, yB1);\n\t\t\t\t\t\tPoint2D.Double C1 = new Point2D.Double(xC1, yC1);\n\t\t\t\t\t\tPoint2D.Double D1 = new Point2D.Double(xD1, yD1);\n\t\t\t\t\t\tPoint2D.Double A2 = new Point2D.Double(xA2, yA2);\n\t\t\t\t\t\tPoint2D.Double B2 = new Point2D.Double(xB2, yB2);\n\t\t\t\t\t\tPoint2D.Double C2 = new Point2D.Double(xC2, yC2);\n\t\t\t\t\t\tPoint2D.Double D2 = new Point2D.Double(xD2, yD2);\n\n\n\t\t\t\t\t\tPoint2D.Double P = interseccion(A1,D1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double Q = interseccion(A1,D1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double R = interseccion(C1,D1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double S = interseccion(C1,D1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double T = interseccion(A1,B1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double U = interseccion(A1,B1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double V = interseccion(A1,D1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double W = interseccion(A1,B1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double X = interseccion(B1,C1,A2,B2);\n\t\t\t\t\t\tPoint2D.Double Y = interseccion(B1,C1,B2,C2);\n\t\t\t\t\t\tPoint2D.Double Z = interseccion(C1,D1,A2,D2);\n\t\t\t\t\t\tPoint2D.Double N = interseccion(B1,C1,A2,D2);\n\n\n\t\t\t\t\t\tdouble solapamiento = 0.01 ;\n\t\t\t\t\t\tPoint2D.Double baricentro = new Point2D.Double(0,0);\n\n\t\t\t\t\t\tif( yA2>yA1 && yB1<yB2 && yB2<yA1) {\n\t\t\t\t\t\t\tif( P.getX() < xA1) {\n\t\t\t\t\t\t\t\tif(xB2 < xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 1 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de UA1Q\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(U,A1,Q);\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(U,A1,Q);\n\t\t\t\t\t\t\t\t} else if(xB2 > xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 2 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de TA1B2 + A1QB2\n\t\t\t\t\t\t\t\t\tdouble areaTA1B2 = calculateArea(T,A1,B2);\n\t\t\t\t\t\t\t\t\tdouble areaA1QB2 = calculateArea(A1,Q,B2);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTA1B2 + areaA1QB2;\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,A1,B2);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A1,Q,B2);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if(P.getX() > xA1) {\n\t\t\t\t\t\t\t\tif(xB2 > xD1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 3 ***\n\t\t\t\t\t\t\t\t\t//Calculo el area de PD1S\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(P,D1,S);\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(P,D1,S);\n\t\t\t\t\t\t\t\t} else if(xB2 < xD1) {\n\t\t\t\t\t\t\t\t\tif( Q.getX() < xD1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 4 ***\n\t\t\t\t\t\t\t\t\t\t//Calculo el area de PB2Q\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(P,B2,Q);\n\t\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\t\tbaricentro = getBar(P,B2,Q);\n\t\t\t\t\t\t\t\t\t} else if( Q.getX() > xD1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 5 ***\n\t\t\t\t\t\t\t\t\t\t//Calculo el area de PB2D1 y B2RD1\n\t\t\t\t\t\t\t\t\t\tdouble areaPB2D1 = solapamiento + calculateArea(P,B2,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaB2RD1 = solapamiento + calculateArea(B2,R,D1);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = areaPB2D1 + areaB2RD1;\n\t\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(P,B2,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B2,R,D1);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yB1<yA2 && yA2 < yA1 && yB1<yB2 && yB2<yA1 ){\n\t\t\t\t\t\t\tif(xC1 > xB2) {\n\t\t\t\t\t\t\t\tif(xA2<xA1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 6 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de TWV + TVB2 + VB2Q\n\t\t\t\t\t\t\t\t\tdouble areaTWV = calculateArea(T,W,V);\n\t\t\t\t\t\t\t\t\tdouble areaTVB2 = calculateArea(T,V,B2);\n\t\t\t\t\t\t\t\t\tdouble areaVB2Q = calculateArea(V,B2,Q);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTWV + areaTVB2 + areaVB2Q;\n\t\t\t\t\t\t\t\t\t//Calculo el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,W,V);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(T,V,B2);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,B2,Q);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t} else if(xA2>xA1) {\n\t\t\t\t\t\t\t\t\tif(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 7 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de A2VB2 + VB2Q\n\t\t\t\t\t\t\t\t\t\tdouble areaA2VB2 = calculateArea(A2,V,B2);\n\t\t\t\t\t\t\t\t\t\tdouble areaVB2Q = calculateArea(V,B2,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2VB2 + areaVB2Q;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,V,B2);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,B2,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\t\t\t} else if(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 8 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de VA2B2 + B2VD1 + D1RB2\n\t\t\t\t\t\t\t\t\t\tdouble areaVA2B2 = calculateArea(V,A2,B2);\n\t\t\t\t\t\t\t\t\t\tdouble areaB2VD1 = calculateArea(B2,V,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaD1RB2 = calculateArea(D1,R,B2);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVA2B2 + areaB2VD1 + areaD1RB2;\n\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,A2,B2);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B2,V,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(D1,R,B2);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\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} else if(xC1 < xB2) {\n\t\t\t\t\t\t\t\tif( V.getX() < xD1 ) {\n\t\t\t\t\t\t\t\t\t//*** Caso 9 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de A2VD1 + A2SD1\n\t\t\t\t\t\t\t\t\tdouble areaA2VD1 = calculateArea(A2,V,D1);\n\t\t\t\t\t\t\t\t\tdouble areaA2SD1 = calculateArea(A2,S,D1);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2VD1 + areaA2SD1;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,V,D1);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A2,S,D1);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t} else if( V.getX() > xD1 ) {\n\t\t\t\t\t\t\t\t\t//*** Caso 10 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de ZA2S\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(Z,A2,S);\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tbaricentro = getBar(Z,A2,S);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yB1<yA2 && yA2<yA1 && yB2<yB1) {\n\t\t\t\t\t\t\tif(xA2 > xA1) {\n\t\t\t\t\t\t\t\tif(Y.getX()<xC1) {\n\t\t\t\t\t\t\t\t\tif(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 11 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de XA2V + XVQ + XYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaXA2V = calculateArea(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVQ = calculateArea(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaXYQ = calculateArea(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2V + areaXVQ + areaXYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 12 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de A2XV + XVY + VD1Y + YD1R\n\t\t\t\t\t\t\t\t\t\tdouble areaA2XV = calculateArea(A2,X,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVY = calculateArea(X,V,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaVD1Y = calculateArea(V,D1,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaYD1R = calculateArea(Y,D1,R);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA2XV + areaXVY + areaVD1Y + areaYD1R;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A2,X,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,D1,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar4 = getBar(Y,D1,R);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()+bar4.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()+bar4.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(Y.getX()>xC1) {\n\t\t\t\t\t\t\t\t\tif(X.getX() < xC1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 13***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de VA2X + VXD1 + D1XC1\n\t\t\t\t\t\t\t\t\t\tdouble areaVA2X = calculateArea(V,A2,X);\n\t\t\t\t\t\t\t\t\t\tdouble areaVXD1 = calculateArea(V,X,D1);\n\t\t\t\t\t\t\t\t\t\tdouble areaD1XC1 = calculateArea(D1,X,C1);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVA2X + areaVXD1 + areaD1XC1;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,A2,X);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,X,D1);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(D1,X,C1);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(X.getX() > xC1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 10 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de ZA2S\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + calculateArea(Z,A2,S);\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tbaricentro = getBar(Z,A2,S);\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} else if(xA2 < xA1) {\n\t\t\t\t\t\t\t\tif(X.getX() < xB1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 14 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de VWB1 + B1VY + VYQ\n\t\t\t\t\t\t\t\t\tdouble areaVWB1 = calculateArea(V,W,B1);\n\t\t\t\t\t\t\t\t\tdouble areaB1VY = calculateArea(B1,V,Y);\n\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(V,Y,Q);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaVWB1 + areaB1VY + areaVYQ;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(V,W,B1);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(B1,V,Y);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,Y,Q);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\n\t\t\t\t\t\t\t\t} else if (X.getX() > xB1) {\n\t\t\t\t\t\t\t\t\tif(V.getX() < xA1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 15 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de TA1Q + TQX + QXY\n\t\t\t\t\t\t\t\t\t\tdouble areaTA1Q = calculateArea(T,A1,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaTQX = calculateArea(T,Q,X);\n\t\t\t\t\t\t\t\t\t\tdouble areaQXY = calculateArea(Q,X,Y);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaTA1Q + areaTQX + areaQXY;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(T,A1,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(T,Q,X);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(Q,X,Y);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if( V.getX() > xA1 ) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 16 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de XA2V + XVQ + XYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaXA2V = calculateArea(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tdouble areaXVQ = calculateArea(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tdouble areaXYQ = calculateArea(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2V + areaXVQ + areaXYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,V);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,V,Q);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(X,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if( yA2<yB1 && yB2<yB1) {\n\t\t\t\t\t\t\tif(Y.getX() > xC1) {\n\t\t\t\t\t\t\t\t//*** Caso 17 ***\n\t\t\t\t\t\t\t\t//Calcular el area de NC1V + VC1D1\n\t\t\t\t\t\t\t\tdouble areaNC1V = calculateArea(N,C1,V);\n\t\t\t\t\t\t\t\tdouble areaVC1D1 = calculateArea(V,C1,D1);\n\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNC1V + areaVC1D1; \n\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,C1,V);\n\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,C1,D1);\n\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\n\t\t\t\t\t\t\t} else if(Y.getX() < xC1) {\n\t\t\t\t\t\t\t\tif(Q.getX() > xD1) {\n\t\t\t\t\t\t\t\t\t//*** Caso 18 ***\n\t\t\t\t\t\t\t\t\t//Calcular el area de NVR + NRY + VD1R\n\t\t\t\t\t\t\t\t\tdouble areaNVR = calculateArea(N,V,R);\n\t\t\t\t\t\t\t\t\tdouble areaNRY = calculateArea(N,R,Y);\n\t\t\t\t\t\t\t\t\tdouble areaVD1R = calculateArea(V,D1,R);\n\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNVR + areaNRY + areaVD1R;\n\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,V,R);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(N,R,Y);\n\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(V,D1,R);\n\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t} else if(Q.getX() < xD1) {\n\t\t\t\t\t\t\t\t\tif(xA2 < xB1) {\n\t\t\t\t\t\t\t\t\t\t//*** Caso 19 ***\n\t\t\t\t\t\t\t\t\t\t//Calcular el area de NVY + VYQ\n\t\t\t\t\t\t\t\t\t\tdouble areaNVY = calculateArea(N,V,Y);\n\t\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(V,Y,Q);\n\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaNVY + areaVYQ;\n\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro \n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(N,V,Y);\n\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(V,Y,Q);\n\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t} else if(xA2 > xB1) {\n\t\t\t\t\t\t\t\t\t\tif(V.getX() > xA1) {\n\t\t\t\t\t\t\t\t\t\t\t//*** Caso 20 ***\n\t\t\t\t\t\t\t\t\t\t\t//Calcular WB1Y + WVY + VYQ\n\t\t\t\t\t\t\t\t\t\t\tdouble areaWB1Y = calculateArea(W,B1,Y);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaWVY = calculateArea(W,V,Y);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaVYQ = calculateArea(Y,V,Q);\n\t\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaWB1Y + areaWVY + areaVYQ;\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(W,B1,Y);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(W,V,Y);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar3 = getBar(Y,V,Q);\n\t\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX()+bar2.getX()+bar3.getX()))/solapamiento, (solapamiento * (bar1.getY()+bar2.getY()+bar3.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t\t} else if(V.getX() < xA1) {\n\t\t\t\t\t\t\t\t\t\t\t//*** Caso 21 ***\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el area de A1YB1 + A1YQ\n\t\t\t\t\t\t\t\t\t\t\tdouble areaA1YB1 = calculateArea(A1,Y,B1);\n\t\t\t\t\t\t\t\t\t\t\tdouble areaA1YQ = calculateArea(A1,Y,Q);\n\t\t\t\t\t\t\t\t\t\t\tsolapamiento = solapamiento + areaA1YB1 + areaA1YQ;\n\t\t\t\t\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(A1,Y,B1);\n\t\t\t\t\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(A1,Y,Q);\n\t\t\t\t\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if(yA2 < yA1 && yB2 < yB1 && Y.getX() > xC1 && V.getX() > xD1) {\n\t\t\t\t\t\t\t//*** Caso 22 ***\n\t\t\t\t\t\t\t//Calcular el area de XA2Z + XC1Z\n\t\t\t\t\t\t\tdouble areaXA2Z = calculateArea(X,A2,Z);\n\t\t\t\t\t\t\tdouble areaXC1Z = calculateArea(X,C1,Z);\n\t\t\t\t\t\t\tsolapamiento = solapamiento + areaXA2Z + areaXC1Z;\n\t\t\t\t\t\t\t//Calcular el baricentro\n\t\t\t\t\t\t\tPoint2D.Double bar1 = getBar(X,A2,Z);\n\t\t\t\t\t\t\tPoint2D.Double bar2 = getBar(X,C1,Z);\n\t\t\t\t\t\t\tbaricentro.setLocation((solapamiento * (bar1.getX() + bar2.getX()))/solapamiento, (solapamiento * (bar1.getY() + bar2.getY()))/solapamiento);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tdouble m1 = ((VEColi) a1).getMass();\n\t\t\t\t\t\tdouble m2 = ((VEColi) a2).getMass();\n\t\t\t\t\t\tdouble ba1 = ((VEColi) a1).getLength();\n\t\t\t\t\t\tdouble ha1 = ((VEColi) a1).getWidth();\n\t\t\t\t\t\tdouble lambdaG = 0.01;\n\t\t\t\t\t\tdouble lambdaD = 0.005; //0.025\n\t\t\t\t\t\tdouble k1 = (m2/m1)*lambdaD;\n\t\t\t\t\t\tdouble k2 = ( m2/m1 ) * (1/ (Math.pow(ba1, 2) + Math.pow(ha1, 2)))*lambdaG;\n\n\t\t\t\t\t\tdouble D = k1 * Math.sqrt(solapamiento);\n\t\t\t\t\t\tdouble G = k2 * solapamiento;\n\n\t\t\t\t\t\tdouble newHeading = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**Estudio los casos en los que he hecho un movimiento simetrico anteriormente\n\t\t\t\t\t\tpara ver como será el giro del angulo con el nuevo posicionamiento.**/\n\t\t\t\t\t\tif(cambio) {\n\t\t\t\t\t\t\tif(caso == 2) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if(caso == 4) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\n\t\t\t\t\t\t\t} else if(caso == 5) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t} else if(caso == 6) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0)\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t} else if(caso == 8) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0)\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(caso == 1) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() > 0 ){\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\n\t\t\t\t\t\t\t} else if(caso == 3){\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() < 0 )\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() + G;\n\t\t\t\t\t\t\t} else if(caso == 7) {\n\t\t\t\t\t\t\t\tif(baricentro.getX() * baricentro.getY() < 0 )\n\t\t\t\t\t\t\t\t\tnewHeading = ((VEColi) a1).getHeading() - G;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t/*Movimiento lo consideramos descomponiendolo en dos partes\n\t\t\t\t\t\t * \t1.Un desplazamiento de la bacteria en la direccion que une el centro de gravedad de las dos bacterias.\n\t\t\t\t\t\t * \t2.Un giro que se determina segun la geometria del sistema.\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\t//Giro la bacteria.\n\t\t\t\t\t\t((VEColi) a1).setHeading( ((VEColi) a1).getHeading() + newHeading );\n\t\t\t\t\t\t//Lo movemos en la direccion del vector que va del centro de la bacteria 2 a la bacteria 1.\n\t\t\t\t\t\t//Desplazo la bacteria.\n\t\t\t\t\t\t\n\t\t\t\t\t\tdouble t = Math.sqrt(Math.pow(xG2, 2) + Math.pow(yG2,2));\n\t\t\t\t\t\tif(t != 0) {\n\t\t\t\t\t\t\txG2 = xG2 /t;\n\t\t\t\t\t\t\tyG2 = yG2 /t;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tspace.moveTo(((VEColi) a1), space.getLocation(((VEColi) a1)).getX() + xG2*D, space.getLocation(((VEColi) a1)).getY() + yG2*D,0); \n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "boolean _ptPoly(PVector pt, PVector[] poly) { \n // count edges crossed by the line connecting the target point to \"the outside\"\n int count = 0;\n \n for(int i = 0; i < poly.length; i++) {\n PVector a = poly[i], b = poly[(i+1)%poly.length]; // edge points\n if(_clockwise(a, pt, out) != _clockwise(b, pt, out) && // a & b on different sides of line\n _clockwise(a, b, pt) != _clockwise(a, b, out)) { // tgt & out on diff sides of edge\n count++;\n }\n }\n \n return count % 2 == 1;\n // a convex poly would be crossed on one edge;\n // concave could be crossed on any odd # of edges\n }", "public List<ga_Triangle2D> tesselatePolygon(ga_Polygon poly);", "public void wallsAndGatesV0(int[][] rooms) {\n if (checkCornerCase(rooms)) {\n return;\n }\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] >= 0) { // gate or room\n bfsHelper(rooms, i, j);\n }\n }\n }\n }", "int getNumSegments();", "public List<Segment2> verticalLinesinCell() {\n\n\t\tList<Float> boundings = getBoundingsOfCell();\n\t\tint partitionPrecision = 1000;\n\t\tfloat distanceBtwLineSegments = (boundings.get(1) - boundings.get(0))\n\t\t\t\t/ partitionPrecision;\n\n\t\tList<Segment2> segments = new ArrayList<Segment2>();\n\t\tdouble startingPoint = boundings.get(0);\n\t\tint i = 0;\n\n\t\twhile (startingPoint < boundings.get(1)) {\n\n\t\t\tstartingPoint = boundings.get(0) + i\n\t\t\t\t\t* distanceBtwLineSegments;\n\t\t\tPoint2 source = new Point2(startingPoint,\n\t\t\t\t\tboundings.get(2));\n\t\t\tPoint2 target = new Point2(startingPoint,\n\t\t\t\t\tboundings.get(3));\n\n\t\t\tSegment2 segment = new Segment2(source, target);\n\t\t\ti++;\n\t\t\tsegments.add(segment);\n\t\t}\n\n\t\treturn segments;\n\n\t}", "public void detect_lines(float[] image,long width, long height, Lines contours, MutableLong num_result, double sigma, double low, double high, long mode, boolean compute_width, boolean correct_pos,boolean extend_lines, Junctions junctions)\r\n\t{\r\n\t byte[] ismax;\r\n\t float[] ev, n1, n2, p1, p2;\r\n\t float[][] k = new float[5][(int) (width*height)];\r\n\t \r\n\t// for (i=0;i<5;i++)\r\n\t// k[i] = xcalloc(width*height,sizeof(float));\r\n\t Convol convol = new Convol();\r\n\t convol.convolve_gauss(image,k[0],width,height,sigma,LinesUtil.DERIV_R);\r\n\t convol.convolve_gauss(image,k[1],width,height,sigma,LinesUtil.DERIV_C);\r\n\t convol.convolve_gauss(image,k[2],width,height,sigma,LinesUtil.DERIV_RR);\r\n\t convol.convolve_gauss(image,k[3],width,height,sigma,LinesUtil.DERIV_RC);\r\n\t \r\n\t convol.convolve_gauss(image,k[4],width,height,sigma,LinesUtil.DERIV_CC);\r\n\t\r\n\t ismax = new byte[(int) (width*height)];\r\n\t ev = new float[(int) (width*height)];\r\n\t n1 = new float[(int) (width*height)];\r\n\t n2 = new float[(int) (width*height)];\r\n\t p1 = new float[(int) (width*height)];\r\n\t p2 = new float[(int) (width*height)];\r\n\t /*\r\n\t * The C library function void *memset(void *str, int c, size_t n) \r\n\t * copies the character c (an unsigned char) to the first n characters \r\n\t * of the string pointed to by the argument str.\r\n\t */\r\n\t // memset(ismax,0,width*height*sizeof(*ismax));\r\n\t // memset(ev,0,width*height*sizeof(*ev));\r\n\t for(int j = 0; j < ismax.length; j++){\r\n\t\t ev[j] = 0;\r\n\t\t ismax[j] = 0;\r\n\t }\r\n\r\n\t compute_line_points(k,ismax,ev,n1,n2,p1,p2,width,height,low,high,mode);\r\n\t \r\n\t Link l = new Link();\r\n\t l.compute_contours(ismax,ev,n1,n2,p1,p2,k[0],k[1],contours,num_result,sigma,\r\n\t extend_lines,(int)mode,low,high,width,height,junctions);\r\n\t Width w = new Width();\r\n\t if (compute_width)\r\n\t w.compute_line_width(k[0],k[1],width,height,sigma,mode,correct_pos,contours,\r\n\t num_result);\r\n\r\n\t}", "private static List<int[]> getSkyLineRecur(int[][] buildings, int start, int end) {\n List<int[]> result = new ArrayList<>();\n if (start == end) {\n int[] building = buildings[start];\n result.add(new int[]{building[0], building[2]});\n result.add(new int[]{building[1], 0});\n return result;\n }\n int mid = start + (end - start) / 2;\n List<int[]> leftPoints = getSkyLineRecur(buildings, start, mid);\n List<int[]> rightPoints = getSkyLineRecur(buildings, mid + 1, end);\n int prevLeftHeight = 0, prevRightHeight = 0;\n int prevHeight = 0;\n int l = 0, r = 0;\n for(; l < leftPoints.size() && r < rightPoints.size();) {\n int[] leftPoint = leftPoints.get(l);\n int[] rightPoint = rightPoints.get(r);\n if (leftPoint[0] < rightPoint[0]) {\n int newHeight = Math.max(leftPoint[1], prevRightHeight);\n if (newHeight != prevHeight) {\n result.add(new int[]{leftPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevLeftHeight = leftPoint[1];\n l++;\n } else if (leftPoint[0] > rightPoint[0]) {\n int newHeight = Math.max(rightPoint[1], prevLeftHeight);\n if (newHeight != prevHeight) {\n result.add(new int[]{rightPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevRightHeight = rightPoint[1];\n r++;\n } else {\n int newHeight = Math.max(leftPoint[1], rightPoint[1]);\n if (newHeight != prevHeight) {\n result.add(new int[]{leftPoint[0], newHeight});\n prevHeight = newHeight;\n }\n prevLeftHeight = leftPoint[1];\n prevRightHeight = rightPoint[1];\n l++;\n r++;\n }\n }\n List<int[]> rest = (l == leftPoints.size()) ? rightPoints : leftPoints;\n int i = (l == leftPoints.size()) ? r : l;\n for (; i < rest.size(); ++i) {\n result.add(rest.get(i));\n }\n return result;\n }", "public List<Triangle2D> tesselatePolygon(Polygon2D poly);", "void findCriticalPaths()\n {\n\t\tint criticalnodes = 0;\n\t\t \t\n\t\tinputgraph.calculateEC();\n\t\tinputgraph.calculateLC();\n \t\n \tfor(Vertex v:inputgraph)\n \t{\n \t\tv.seen = false;\n \t\tv.cno = 0;\n \t\tv.parent = null;\n \t}\n \t\n \t//find critical path length\n \tSystem.out.println(inputgraph.t.ec);\n \t\n \t//find a critical path from s to t\n \tinputgraph.dfs();\n \tSystem.out.println();\n \t\n \t\n \t//get the number of vertices in critical paths\n \tfor(Vertex v:inputgraph)\n \t{\n \t\tif(v.lc == v.ec && v!=inputgraph.s && v!=inputgraph.t)\n \t\t{\n \t\t\tcriticalnodes++;\n \t\t}\n \t}\n \t\n \t//array of critical paths\n \tinputgraph.pathArray = new Vertex[criticalnodes+2];\n \t\n \t\n \tSystem.out.println();\n \tSystem.out.println(\"Task\" + \"\t\" + \"EC\" + \"\t\" + \"LC\" + \"\t\" + \"Slack\");\n \t\n \t//print the task its EC, LC and Slack values\n \tfor(Vertex v:inputgraph)\n \t{\n \t\tif(v!=inputgraph.s && v!=inputgraph.t)\n \t\t\tSystem.out.println(v + \"\t\" + v.ec + \"\t\" + v.lc + \"\t\" + v.slack);\n \t}\n \t\n \t//print the number of nodes in a critical path\n \tSystem.out.println();\n \tSystem.out.println(criticalnodes);\n \t\n \t//calculate number of critical paths\n \tinputgraph.calculateCriticalPaths();\n \tSystem.out.println(inputgraph.t.criticalpaths);\n \t\n \t//print all critical paths\n \tinputgraph.enumeratePaths(inputgraph.s,0);\n \tSystem.out.println();\n \t\n }", "private void findLaneLines(int[] pixels, int row, int leftStartingX, int rightStartingX) {\n if (row > getCameraHeight() * LOOK_DIST) {\n Point lastLeftPoint = leftLine.getLeftPoint(pixels, row, getScreenWidth(), leftStartingX);\n Point lastRightPoint = rightLine.getRightPoint(pixels, row, getScreenWidth(), rightStartingX, getCameraWidth());\n leftLine.getLanePoints().add(lastLeftPoint);\n rightLine.getLanePoints().add(lastRightPoint);\n\n // If no lane was found, search from the last startingX\n if (lastLeftPoint.isEmpty() && lastRightPoint.isEmpty()) {\n findLaneLines(pixels, row - 1, leftStartingX, rightStartingX);\n\n // If Only the right lane was found, right starts from last starting X. Left starts from last startingX\n } else if (lastLeftPoint.isEmpty()) {\n int startSearchX = lastRightPoint.getX() - SEARCH_OFFSET;\n findLaneLines(pixels, row - 1, startSearchX, startSearchX);\n\n // If Only the left lane was found, left starts from last starting X. Right starts from last startingX\n } else if (lastRightPoint.isEmpty()) {\n int startSearchX = lastLeftPoint.getX() + SEARCH_OFFSET;\n findLaneLines(pixels, row - 1, startSearchX, startSearchX);\n\n // If Both lanes are found start search from last X + or - 100.\n } else {\n findLaneLines(pixels, row - 1, lastLeftPoint.getX() + SEARCH_OFFSET,\n lastRightPoint.getX() - SEARCH_OFFSET);\n }\n }\n }", "public static double wallSmoothing(Rectangle2D.Double field, double bfWidth,\n double bfHeight, Point2D.Double startLocation, double startAngleRadians,\n int orientation, double wallStick) {\n\n/*\n double angle = startAngle;\n _lastWallSmoothAway = false;\n while (!field.contains(x + Math.sin(Math.toRadians(angle))*WALL_STICK,\n y+Math.cos(Math.toRadians(angle))*WALL_STICK)) {\n angle += orientation*smoothNormal*7.0;\n if (smoothNormal == -1) { _lastWallSmoothAway = true; }\n }\n\n return angle;\n*/\n // Trying to do almost exactly the equivalent of the above in more\n // code but less CPU time. The above needs a low increment to work\n // perfectly smoothly, which results in very slow execution.\n //\n // NOTE: The two algorithms can give slightly different results,\n // but that is mainly because the iterative one never tests a\n // very specific angle in a corner that would turn up \"in bounds\";\n // if it increased the angle var by (1/INFINITY), they'd be the\n // same (as far as I can tell.)\n\n double angle = startAngleRadians;\n double wallDistanceX = Math.min(startLocation.x - 18,\n bfWidth - startLocation.x - 18);\n double wallDistanceY = Math.min(startLocation.y - 18,\n bfHeight - startLocation.y - 18);\n\n if (wallDistanceX > wallStick && wallDistanceY > wallStick) {\n return startAngleRadians;\n }\n\n double testX = startLocation.x + (Math.sin(angle) * wallStick);\n double testY = startLocation.y + (Math.cos(angle) * wallStick);\n double testDistanceX = Math.min(testX - 18, bfWidth - testX - 18);\n double testDistanceY = Math.min(testY - 18, bfHeight - testY - 18);\n\n double adjacent = 0;\n int g = 0;\n\n while (!field.contains(testX, testY) && g++ < 25) {\n if (angle < 0) {\n angle += (2 * Math.PI);\n }\n if (testDistanceY < 0 && testDistanceY < testDistanceX) {\n // wall smooth North or South wall\n angle = ((int) ((angle + (Math.PI / 2)) / Math.PI)) * Math.PI;\n adjacent = Math.abs(wallDistanceY);\n } else if (testDistanceX < 0 && testDistanceX <= testDistanceY) {\n // wall smooth East or West wall\n angle = (((int) (angle / Math.PI)) * Math.PI) + (Math.PI / 2);\n adjacent = Math.abs(wallDistanceX);\n }\n\n angle += orientation *\n (Math.abs(Math.acos(adjacent / wallStick)) + 0.0005);\n\n testX = startLocation.x + (Math.sin(angle) * wallStick);\n testY = startLocation.y + (Math.cos(angle) * wallStick);\n testDistanceX = Math.min(testX - 18, bfWidth - testX - 18);\n testDistanceY = Math.min(testY - 18, bfHeight - testY - 18);\n }\n\n return angle;\n }", "private static int countIntersects(List<Rectangle2D.Double> rectangles,\n Rectangle2D.Double rectangle1,\n Rectangle2D.Double rectangle2) {\n return getVertices(rectangle1)\n .stream()\n .parallel()\n .mapToInt(p1 -> getVertices(rectangle2)\n .stream()\n .parallel()\n .mapToInt(p2 -> countIntersects(rectangles,\n rectangle1, p1,\n rectangle2, p2))\n .max()\n .orElse(0))\n .max()\n .orElse(0);\n }", "private Point[] getBresenhamLine(Point p0, Point p1, int lineWidth) {\n int x0 = p0.X;\n int y0 = p0.Y;\n int x1 = p1.X;\n int y1 = p1.Y;\n\n // Calculate the distance between the 2 points for x and y\n int dx = Math.abs(x1 - x0);\n int dy = Math.abs(y1 - y0);\n\n // Define a direction to move\n int sx = x0 < x1 ? 1 : -1;\n int sy = y0 < y1 ? 1 : -1;\n\n // \n int err = dx - dy;\n\n List<Point> points = new ArrayList();\n\n while (true) {\n // Add the current point to the list\n points.add(new Point(x0, y0));\n for (int i = 0; i < lineWidth / 2; i++) {\n points.add(new Point(x0 + sx * i, y0));\n points.add(new Point(x0 - sx * i, y0));\n\n points.add(new Point(x0, y0 + sy * i));\n points.add(new Point(x0, y0 - sy * i));\n\n points.add(new Point(x0 + sx * i, y0 + sy * i));\n points.add(new Point(x0 - sx * i, y0 + sy * i));\n points.add(new Point(x0 + sx * i, y0 - sy * i));\n points.add(new Point(x0 - sx * i, y0 - sy * i));\n }\n\n // If the current point equals to the end position, break the loop\n if (x0 == x1 && y0 == y1) {\n break;\n }\n\n int e2 = 2 * err;\n if (e2 > -dy) {\n err = err - dy;\n x0 = x0 + sx;\n }\n if (e2 < dx) {\n err = err + dx;\n y0 = y0 + sy;\n }\n }\n\n Set<Point> uniquePoints = new HashSet<>(points);\n\n return uniquePoints.toArray(new Point[uniquePoints.size()]);\n }", "public void eraseLines() {\n for (int i = 0; i < segments.size() - 1; i++) {\n paintLine((Point2D) (segments.elementAt(i)),\n (Point2D) (segments.elementAt(i + 1)));\n }\n }" ]
[ "0.52169174", "0.51800406", "0.51625746", "0.51340985", "0.51304626", "0.49719995", "0.49638823", "0.49501613", "0.49173814", "0.48926315", "0.47922412", "0.47178683", "0.4699934", "0.469106", "0.46589825", "0.4653225", "0.46498954", "0.46216214", "0.46208456", "0.4613327", "0.4595674", "0.45240492", "0.4518189", "0.45171776", "0.45001757", "0.44864058", "0.44827813", "0.4442495", "0.4440517", "0.4439833", "0.44277978", "0.44208574", "0.43989462", "0.43962276", "0.43861315", "0.4383392", "0.438038", "0.43797565", "0.43758014", "0.4373288", "0.43699476", "0.43647876", "0.4362065", "0.43594235", "0.43585205", "0.4347426", "0.43448362", "0.4339641", "0.43350866", "0.43340644", "0.43087584", "0.43059918", "0.43023682", "0.42968044", "0.42965114", "0.4293011", "0.4291364", "0.42882678", "0.42878622", "0.42763534", "0.42758596", "0.42716968", "0.4267579", "0.42650297", "0.4262933", "0.42623466", "0.42587456", "0.42518234", "0.42479873", "0.42452016", "0.4242129", "0.42394865", "0.42324853", "0.42323872", "0.4232048", "0.42240015", "0.42213127", "0.4221282", "0.422028", "0.4207639", "0.42066294", "0.42019558", "0.41969186", "0.4194767", "0.41937742", "0.41705915", "0.41667345", "0.416179", "0.415661", "0.4154766", "0.41496232", "0.4149256", "0.4147758", "0.4145356", "0.414509", "0.41323423", "0.412899", "0.41184217", "0.4115957", "0.41132838" ]
0.6758249
0
/ Check if two FA areas (connected by "") belong to the same FA region.
private boolean isSameFaRegion( String areas ) { return ( areas.equalsIgnoreCase( Gfa.BOS + "-" + Gfa.MIA ) || areas.equalsIgnoreCase( Gfa.MIA + "-" + Gfa.BOS ) || areas.equalsIgnoreCase( Gfa.SLC + "-" + Gfa.SFO ) || areas.equalsIgnoreCase( Gfa.SFO + "-" + Gfa.SLC ) || areas.equalsIgnoreCase( Gfa.CHI + "-" + Gfa.DFW ) || areas.equalsIgnoreCase( Gfa.DFW + "-" + Gfa.CHI ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean intersects(GISArea other) {\n if (this.isPoint() && other.isPoint()) {\n return this.latitudes.equals(other.latitudes) && this.longitudes.equals(other.longitudes);\n }\n // 2. We're a point, they're not.\n else if (this.isPoint() && other.isRegion()) {\n Area them = new Area(other.path);\n return them.contains(this.latitudes.get(0), this.longitudes.get(0));\n }\n // 3. We're a region, they're a point.\n else if (this.isRegion() && other.isPoint()) {\n Area us = new Area(this.path);\n return us.contains(other.latitudes.get(0), other.longitudes.get(0));\n }\n // 4. We're both regions.\n else {\n // Make the shapes for both areas.\n // Take the intersect\n // If an empty shape, no intersection.\n Area us = new Area(path);\n Area them = new Area(other.path);\n us.intersect(them);\n return !us.isEmpty();\n }\n }", "public boolean intersects (GraphicalFigure fig) {\n\t\t\n\t\t// Check to see if there is any overlap between the 2 figures horizontally\n\t\tif (fig.getOffset().xCoord() > this.gfPos.xCoord() + this.getWidth() || this.gfPos.xCoord() > fig.getOffset().xCoord() + fig.getWidth()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check to see if there is any overlap between the 2 figures vertically\n\t\tif (fig.getOffset().yCoord() > this.gfPos.yCoord() + this.getHeight() || this.gfPos.yCoord() > fig.getOffset().yCoord() + fig.getHeight()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean iguales(Pares f){\n\t\t\tboolean devolucion = false;\n\t\t\t\n\t\t\tif(f!=null){\n\t\t\t\tif(primero.iguales(f.getSegundo())){\n\t\t\t\t\tif(segundo.iguales(f.getPrimero())){\n\t\t\t\t\t\tif(distancia==f.getDistancia()){\n\t\t\t\t\t\t\tdevolucion=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn devolucion;\n\t\t}", "public boolean isOverlapping(Filter f);", "private boolean overlappingEvents(BpmnShape s1, BpmnShape s2) {\n\t\t\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX();\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public boolean overlap(float[] a, float[] b) {\r\n return ( (b[0] <= a[0] && a[0] <= b[3]) || (b[0] <= a[3] && a[3] <= b[3]) ) &&\r\n ( (b[1] <= a[1] && a[1] <= b[4]) || (b[1] <= a[4] && a[4] <= b[4]) ) &&\r\n ( (b[2] <= a[2] && a[2] <= b[5]) || (b[2] <= a[5] && a[5] <= b[5]) );\r\n }", "boolean intersect(Segment other) {\n\t\tint o1 = orientation(other.from);\n\t\tint o2 = orientation(other.to);\n\t\tint o3 = other.orientation(from);\n\t\tint o4 = other.orientation(to);\n\t\treturn (o1 != o2 && o3 != o4) // <- General case, special case below\n\t\t\t\t|| (o1 == 0 && inBoundingBox(other.from)) || (o2 == 0 && inBoundingBox(other.to))\n\t\t\t\t|| (o3 == 0 && other.inBoundingBox(from)) || (o4 == 0 && other.inBoundingBox(to));\n\t}", "public boolean in_area(char area) {\n return (areas != null) && (areas.indexOf(area) != -1);\n }", "protected boolean isOverlapping(ArrayList<Rectangle> first, ArrayList<Rectangle> second) {\n\t\tfor (Rectangle f : first) {\n\t\t\tfor (Rectangle s : second) {\n\t\t\t\tif (f.overlaps(s)) return true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public boolean win(){\n\t\tint num=0;//number of the boxes are in the areas\n\t\tfor(int i=0;i<boxes.size();i++){\n\t\t\tbox a =boxes.get(i);\n\t\t\tfor(int j=0;j<areas.size();j++){\n\t\t\t\tarea b = areas.get(j);\n\t\t\t\tif(a.getX()==b.getX()&&a.getY()==b.getY()){//check whether all the boxes have been in the certain areas\n\t\t\t\t\t//System.out.println(j);\n\t\t\t\t\t//System.out.println(\"area: \"+j);\n\t\t\t\t\tb.emptyImage();//clear the original image of boxes\n\t\t\t\t a.setImage();//change to the colorful one\n\t\t\t\t\tnum++;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//\t b.setImage(); \t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(num==areas.size()){//whether their number are same \n\t\t\tnum=0;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean overlapsWith(IRegion range1, IRegion range2) {\n \t\treturn overlapsWith(range1.getOffset(), range1.getLength(), range2.getOffset(), range2.getLength());\n \t}", "private boolean overlappingGateways(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\tdouble firstApothem = (s1.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble secondApothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstApothem > secondX - secondApothem || firstY - firstApothem < secondY + secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstApothem < secondX + secondApothem || firstY + firstApothem > secondY - secondApothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean isCompoundInTheSameArea(final List<ShapeModel> letters) {\n if (letters == null || letters.size() == 0) {\n return false;\n }\n if (letters.size() == 1) {\n return true;\n }\n int start = 0;\n double distance;\n while (start < letters.size() - 1) {\n for (int i = start; i < letters.size() - 1; i++) {\n distance = ShapeMaths.computeDistanceForPoints(letters.get(i).getCenter(),\n letters.get(i + 1).getCenter());\n if (distance > ShapeComparator.averageSize) {\n return false;\n }\n }\n start++;\n }\n return true;\n }", "private static boolean isCorridor(int[][] area, int x, int y, int x2, int y2) {\r\n\t\tboolean one = false;\r\n\t\tboolean two = false;\r\n\t\tif ((y < 0) || (x >= area.length) || (x < 0) || (y >= area[x].length)) {\r\n\t\t\tone = true;\r\n\t\t} else {\r\n\t\t\tone = (area[x][y] >= 1);\r\n\t\t}\r\n\t\tif ((y2 < 0) || (x2 >= area.length) || (x2 < 0) || (y2 >= area[x2].length)) {\r\n\t\t\ttwo = true;\r\n\t\t} else {\r\n\t\t\ttwo = (area[x2][y2] >= 1);\r\n\t\t}\r\n\t\tif(!one && !two) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "private void checkOverlaps() {\r\n final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);\r\n final int count = getOutlineNumber();\r\n boolean firstpass = true;\r\n do {\r\n for (int cc = 0; cc < count; cc++) {\r\n final Outline outline = getOutline(cc);\r\n int vertexCount = outline.getVertexCount();\r\n for(int i=0; i < outline.getVertexCount(); i++) {\r\n final Vertex currentVertex = outline.getVertex(i);\r\n if ( !currentVertex.isOnCurve()) {\r\n final Vertex nextV = outline.getVertex((i+1)%vertexCount);\r\n final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);\r\n final Vertex overlap;\r\n\r\n // check for overlap even if already set for subdivision\r\n // ensuring both triangular overlaps get divided\r\n // for pref. only check in first pass\r\n // second pass to clear the overlaps array(reduces precision errors)\r\n if( firstpass ) {\r\n overlap = checkTriOverlaps0(prevV, currentVertex, nextV);\r\n } else {\r\n overlap = null;\r\n }\r\n if( overlaps.contains(currentVertex) || overlap != null ) {\r\n overlaps.remove(currentVertex);\r\n\r\n subdivideTriangle(outline, prevV, currentVertex, nextV, i);\r\n i+=3;\r\n vertexCount+=2;\r\n addedVerticeCount+=2;\r\n\r\n if(overlap != null && !overlap.isOnCurve()) {\r\n if(!overlaps.contains(overlap)) {\r\n overlaps.add(overlap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n firstpass = false;\r\n } while( !overlaps.isEmpty() );\r\n }", "@Override public boolean equals(Object o) {\r\n\t\tif (o instanceof Shape) {\r\n\t\t\treturn this.area() == ((Shape)o).area();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean checkCollisions()\n {\n for (int i = 1; i < numFigs; i++)\n if (figures[0].collidedWith(figures[i]))\n return true;\n return false;\n }", "public static boolean hasBehindGatesTransfer (int from, int to, NYCFareDataCache fareData) {\n if (from == to) return true; // same platform\n else {\n String previousFareArea = fareData.fareAreaForStop.get(from);\n String thisFareArea = fareData.fareAreaForStop.get(to);\n // both in the same fare area (behind gates)\n // okay to use == here since fare areas are interned - warning can be ignored\n //noinspection StringEquality,ConditionCoveredByFurtherCondition\n return previousFareArea != null && thisFareArea != null && previousFareArea == thisFareArea;\n }\n }", "private static boolean doBoundingBoxesIntersect(Rectangle a, Rectangle b) {\r\n\t return a.getMinX() <= b.getMaxX() \r\n\t && a.getMaxX() >= b.getMinX() \r\n\t && a.getMinY() <= b.getMaxY()\r\n\t && a.getMaxY() >= b.getMinY();\r\n\t}", "boolean checkIfValidToCreate(int start, int end) {\n return myMarkerTree.processOverlappingWith(start, end, region->{\n int rStart = region.getStartOffset();\n int rEnd = region.getEndOffset();\n if (rStart < start) {\n if (region.isValid() && start < rEnd && rEnd < end) {\n return false;\n }\n }\n else if (rStart == start) {\n if (rEnd == end) {\n return false;\n }\n }\n else {\n if (rStart > end) {\n return true;\n }\n if (region.isValid() && rStart < end && end < rEnd) {\n return false;\n }\n }\n return true;\n });\n }", "@Test\n public void testEqualsTrue() {\n Rectangle r5 = new Rectangle(7, 4, new Color(255, 0, 0), new Position2D(50, 75));\n Rectangle r6 = new Rectangle(0, 4, new Color(255, 255, 255),\n new Position2D(-50, 75));\n Rectangle r7 = new Rectangle(7, 0, new Color(255, 255, 0), new Position2D(50, -75));\n Rectangle r8 = new Rectangle(0, 0, new Color(200, 150, 133),\n new Position2D(-50, -75));\n\n assertEquals(r1, r5);\n assertEquals(r2, r6);\n assertEquals(r3, r7);\n assertEquals(r4, r8);\n }", "private static boolean isCorner(int[][] area, int x, int y, boolean countEdges) {\r\n\t\t// Find the coordinates of the spaces adjacent to this one\r\n\t\tint[][] around = { { x - 1, y },// Left 1\r\n\t\t\t\t{ x + 1, y },// Right 1\r\n\t\t\t\t{ x, y - 1 },// Down 1\r\n\t\t\t\t{ x, y + 1 } };// Up 1\r\n\t\tint walls = 0; // Create a variable to store how many walls are next to\r\n\t\t\t\t\t // the current space\r\n\t\tfor (int[] coords : around) {// test each adjacent space\r\n\t\t\tif ((coords[1] < 0) || (coords[0] >= area.length)\r\n\t\t\t\t\t|| (coords[0] < 0) || (coords[1] >= area[x].length)) {\r\n\t\t\t\t// If this square is out of the map then it counts as a wall\r\n\t\t\t\tif (countEdges) {\r\n\t\t\t\t\twalls++;\r\n\t\t\t\t}\r\n\t\t\t} else if (area[coords[0]][coords[1]] >= 1) {\r\n\t\t\t\t// The space has a wall next to it\r\n\t\t\t\twalls++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (walls == 2 || walls == 3) { // if the block is surrounded by 2 or 3\r\n\t\t\t\t\t\t\t\t\t\t// walls, it's a corner \r\n\t\t\t\r\n\t\t\t//Check to see if this wall is just a corridor\r\n\t\t\tif( (isCorridor(area, around[0][0],around[0][1], around[1][0], around[1][1])) && \r\n\t\t\t\t\t(!isCorridor(area, around[2][0],around[2][1], around[3][0], around[3][1]))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif( (!isCorridor(area, around[0][0],around[0][1], around[1][0], around[1][1])) && \r\n\t\t\t\t\t(isCorridor(area, around[2][0],around[2][1], around[3][0], around[3][1]))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean markersClose(Marker one, Marker two) {\n if (one.getID() == two.getID()) {\n if (one.getArea() - two.getArea() < 20 && one.getArea() - two\n .getArea\n () > -20) {\n log.debug(TAG, \"Removing double marker! ID: \" + one.getID());\n return true;\n }\n }\n return false;\n }", "boolean hasRect2Value();", "public boolean isInterior() {\n\t\tif (this.eltZero != null && this.eltOne != null && this.eltTwo != null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private boolean overlappingEventAndGateway(BpmnShape s1, BpmnShape s2) {\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX();\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\tdouble apothem = (s2.getBounds().getHeight() * Math.sqrt(2)) / 2;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif ((firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight) &&\n\t\t\t\t(firstX + firstWidth > secondX - apothem || firstY - firstHeight < secondY + apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif ((firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight) &&\n\t\t\t\t(firstX - firstWidth < secondX + apothem || firstY + firstHeight > secondY - apothem))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private boolean isChoseFine(){\n if(freeSpaces.size()!=2 & freeSpaces.size()!=3){ //if the number of chosen spaces is not 3 or 2, that means it can't be good.\n return false;\n }\n else if(freeSpaces.size()==2){ //if there are 2.\n if(freeSpaces.elementAt(0).place.distance(freeSpaces.elementAt(1).place)==1)\n return true;\n else //if the distance between the spaces isn't 1, that means it can't be two suite spaces.\n return false;\n }\n else{ //if there are 3.\n //get the all 3 elements.\n int aX = freeSpaces.elementAt(0).place.x;\n int aY = freeSpaces.elementAt(0).place.y;\n int bX = freeSpaces.elementAt(1).place.x;\n int bY = freeSpaces.elementAt(1).place.y;\n int cX = freeSpaces.elementAt(2).place.x;\n int cY = freeSpaces.elementAt(2).place.y;\n if(aX==bX && bX==cX){ //if they are in the same column.\n int min = Math.min(aY, Math.min(bY, cY));\n int max = Math.max(aY, Math.max(bY, cY));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else if(aY==bY && bY==cY){ //if they are in the same row.\n int min = Math.min(aX, Math.min(bX, cX));\n int max = Math.max(aX, Math.max(bX, cX));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else //if they are in different rows and columns, so it isn't good.\n return false;\n }\n }", "private boolean identicalAtoms(IAtomContainer molecule1, List<IAtomContainer> fragsToCompare) {\n\t\n \tfor (int i = 0; i < fragsToCompare.size(); i++) {\n \t\t//no match\n \t\tif (molecule1.getBondCount() != fragsToCompare.get(i).getBondCount() && molecule1.getAtomCount() != fragsToCompare.get(i).getAtomCount()) \n \t\t{\n \t\t\tcontinue;\n \t\t}\n \t\t\n\n \t\tint n = 0;\n \t\t//array storing all already tried atoms\n \t\tboolean[] doneAtoms = new boolean[atomsContained + 1];\n \t\tfor (int j = 0; j < molecule1.getAtomCount(); j++) {\n \t\t\tfor (int k = 0; k < fragsToCompare.get(i).getAtomCount(); k++) \n \t\t\t{\n \t\t\t\t//compare atoms by symbol, thus only check for the same sum formula --> EXPERIMENTAL\n \t\t\t\tif(molecularFormulaRedundancyCheck)\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).getSymbol().equals(fragsToCompare.get(i).getAtom(k).getSymbol()) &&\n \t\t\t\t\t\t\t!doneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())]) {\n \t\t\t\t\tn++;\n \t\t\t\t\tdoneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())] = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t} \t\t\t\t\n \t\t\t\t//normal test creates way more fragments!\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).equals(fragsToCompare.get(i).getAtom(k))) {\n \t\t\t\t\tn++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif(n == molecule1.getAtomCount())\n \t\t\treturn true;\n\t\t}\n\t //no match found\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean intersectsRectangle(final int ax1, final int ax2, final int ay1, final int ay2)\n\t{\n\t\tif (isInsideZone(ax1, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax1, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay1, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isInsideZone(ax2, ay2, (zoneZ2 - 1)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Check if any point from this rectangle is inside the other one\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX1 > ax1 && zoneX1 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY1 > ay1 && zoneY1 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (zoneX2 > ax1 && zoneX2 < ax2 && zoneY2 > ay1 && zoneY2 < ay2)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Horizontal lines may intersect vertical lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX2, zoneY1, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax1, ay1, ax1, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY2, zoneX2, zoneY2, ax2, ay1, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Vertical lines may intersect horizontal lines\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX1, zoneY1, zoneX1, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay1, ax2, ay1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (lineIntersectsLine(zoneX2, zoneY1, zoneX2, zoneY2, ax1, ay2, ax2, ay2))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean intersects(BoundingBox other) {\r\n\t\treturn !(other.left > getRight()\r\n\t\t\t || other.getRight() < left\r\n\t\t\t || other.top > getBottom()\r\n\t\t\t || other.getBottom() < top);\r\n\t}", "static boolean Isosceles(long AA, long BB, long CC){\n if((AA==BB)||((AA==CC)||(BB==CC)))\n return true;\n else\n return false;\n }", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "public boolean overlapsBlock ( ) {\r\n\t\tif (current_block >= getBlockCount())\r\n\t\t\treturn true;\r\n\r\n\t\tif (circum_area == null)\r\n\t\t\treturn true;\r\n\r\n\t\tCoor start_coor = new Coor((double)ra_start[(int)current_block], -6.0);\r\n\t\tCoor end_coor = new Coor((double)ra_end[(int)current_block], 90.0);\r\n\t\tif (circum_area.overlapsArea(start_coor, end_coor))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "private boolean hasOverlap(int[] i1, int[] i2)\n {\n // Special case of consecutive STEP-BY-STEP intervals\n if(i1[0] <= i2[0] && i2[0] <= i1[1])\n return true;\n if(i2[0] <= i1[0] && i1[0] <= i2[1])\n return true;\n return false;\n }", "private boolean overlaps(Point2D p0, Point2D p1)\n {\n return Math.abs(p0.getX() - p1.getX()) < 0.001 && Math.abs(p0.getY() - p1.getY()) < 0.001;\n }", "static boolean rectanglesOverlap(Rectangle r1, Rectangle r2){\n List<int[]> pointsOfInterest = new ArrayList<int[]>();\n for (int[] i : r1.getPoints())\n for (int[] j : r2.getPoints())\n if (i[0] >= j[0] && i[1] >= j[1])\n pointsOfInterest.add(i); \n\n if (!pointsOfInterest.isEmpty())\n for (int[] i : pointsOfInterest)\n for (int[] j : r2.getPoints())\n if (i[0] <= j[0] && i[1] <= j[1])\n return true;\n\n // Check if any points in rectangle 2 fall in 1\n //List<int[]> pointsOfInterest = new ArrayList<int[]>();\n pointsOfInterest.clear();\n for (int[] i : r2.getPoints())\n for (int[] j : r1.getPoints())\n if (i[0] >= j[0] && i[1] >= j[1])\n pointsOfInterest.add(i); \n\n if (!pointsOfInterest.isEmpty())\n for (int[] i : pointsOfInterest)\n for (int[] j : r1.getPoints())\n if (i[0] <= j[0] && i[1] <= j[1])\n return true;\n \n return false;\n }", "public static boolean isIntersecting(Coord p1, Coord q1, Coord p2, Coord q2) \n { \n // Find the four orientations needed for general and \n // special cases \n int o1 = orientation(p1, q1, p2); \n int o2 = orientation(p1, q1, q2); \n int o3 = orientation(p2, q2, p1); \n int o4 = orientation(p2, q2, q1); \n \n // General case \n if(o1 != o2 && o3 != o4) \n return true; \n \n // Special Cases \n // p1, q1 and p2 are colinear and p2 lies on segment p1q1 \n if (o1 == 0 && isOnSegment(p1, q1, p2)) return true; \n \n // p1, q1 and q2 are colinear and q2 lies on segment p1q1 \n if (o2 == 0 && isOnSegment(p1, q1, q2)) return true; \n \n // p2, q2 and p1 are colinear and p1 lies on segment p2q2 \n if (o3 == 0 && isOnSegment(p2, q2, p1)) return true; \n \n // p2, q2 and q1 are colinear and q1 lies on segment p2q2 \n if (o4 == 0 && isOnSegment(p2, q2, q1)) return true; \n \n return false; // Doesn't fall in any of the above cases \n }", "public final boolean mo2031a() {\n return this.f4204a.exists() || this.f4205b.exists();\n }", "boolean hasBasis();", "@Override\n public int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2) {\n // This is similar to WedgeContainsOrCrosses, except that we want to\n // distinguish cases (1) [A contains B], (3) [A and B are disjoint],\n // and (2,4,5,6) [A intersects but does not contain B].\n\n if (orderedCCW(a0, a2, b2, ab1)) {\n // We are in case 1, 5, or 6, or case 2 if a2 == b2.\n return orderedCCW(b2, b0, a0, ab1) ? 1 : -1; // Case 1 vs. 2,5,6.\n }\n // We are in cases 2, 3, or 4.\n if (!orderedCCW(a2, b0, b2, ab1)) {\n return 0; // Case 3.\n }\n\n // We are in case 2 or 4, or case 3 if a2 == b0.\n return (a2.equalsPoint(b0)) ? 0 : -1; // Case 3 vs. 2,4.\n }", "public abstract boolean isInterior();", "private boolean twoCornersWithSameColor(OthelloBitBoard board) {\r\n\t\tlong playerBoard = board.getBitBoardOf(playerColor);\r\n\t\tlong opponentBoard = board.getBitBoardOf(opponentColor);\r\n\t\treturn Long.bitCount(playerBoard & CORNER_MASK) > 1 || Long.bitCount(opponentBoard & CORNER_MASK) > 1;\r\n\t}", "public boolean intersects(GraphicalFigure fig) {\n\n\t\t// Get the distance between the 2 figures on the x axis\n\t\tint xDist = pos.xCoord() - fig.getOffset().xCoord();\n\n\t\t// Get the distance on the y axis\n\t\tint yDist = pos.yCoord() - fig.getOffset().xCoord();\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check to see if the figure is on the right and overlaps\n\t\tif (xDist >= 0 && xDist < fig.getWidth()) {\n\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = pos.xCoord(); i < pos.xCoord() + fig.getWidth() - xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check if the figure is on the left and overlaps\n\t\telse if (xDist >= 0 && xDist < width) {\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = fig.getOffset().xCoord(); i < fig.getOffset().xCoord() + width + xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no intersection found, return false\n\t\treturn false;\n\t}", "private boolean overlappingTaskAndEvent(BpmnShape s1, BpmnShape s2) {\n\t\t\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondX = s2.getBounds().getX();\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private boolean hasUniqueState()\n {\n return (getExternalArcState() == getMiddleArcState() && getExternalArcState() == getInternalArcState() && getExternalArcState() == getCircleState());\n }", "private boolean colisionPalas() {\r\n\t\treturn game.racketIzq.getBounds().intersects(getBounds())\r\n\t\t\t\t|| game.racketDer.getBounds().intersects(getBounds());\r\n\t}", "public boolean linesIntersect() {\n\t\twhile (true) {\n\t\t\t// for loop for the asteroid's lines\n\t\t\tfor (int i = 0; i < NUM_LINES; i++) {\n\t\t\t\t// for loop for the ship's lines\n\t\t\t\tfor (int j = 0; j < ship.shipOutLine().length; j++) {\n\t\t\t\t\tint o1 = orientation(outLine[i].getStart(),\n\t\t\t\t\t\t\toutLine[i].getEnd(),\n\t\t\t\t\t\t\tship.shipOutLine()[j].getStart());\n\t\t\t\t\tint o2 = orientation(outLine[i].getStart(),\n\t\t\t\t\t\t\toutLine[i].getEnd(), ship.shipOutLine()[j].getEnd());\n\t\t\t\t\tint o3 = orientation(ship.shipOutLine()[j].getStart(),\n\t\t\t\t\t\t\tship.shipOutLine()[j].getEnd(),\n\t\t\t\t\t\t\toutLine[i].getStart());\n\t\t\t\t\tint o4 = orientation(ship.shipOutLine()[j].getStart(),\n\t\t\t\t\t\t\tship.shipOutLine()[j].getEnd(), outLine[i].getEnd());\n\n\t\t\t\t\tif (o1 != o2 && o3 != o4) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean onStairs(){\n\t\tint yp = 0; int xp = 0;\n\t\tint ys = 1; int xs = 1;\n\t\tfor(int i = 0; i < this.position.length; i ++){//looks though arrays to gather position\n\t\t\tfor(int p = 0 ; p < this.position.length; p++){\n\t\t\t\tif(this.position[i][p] == 1 && this.Stairs[i][p] == 1){\n\t\t\t\t\typ=i; xp=p;\n\t\t\t\t\tys=i; xs=p;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\tif(yp==ys && xp==xs){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;//if they are not in the same location, return false\n\t}", "protected boolean checkPoiInside( CFWPoint poiBegI, CFWPoint poiEndI)\t{\r\n\t\t//[begin point in area 1] unintersect: 1,2,3,7,8\r\n\t\t//[begin point in area 2] unintersect: 1,2,3\r\n\t\t//[begin point in area 3] unintersect: 1,2,3,4,5\r\n\t\t//[begin point in area 4] unintersect: 3,4,5\r\n\t\t//[begin point in area 5] unintersect: 3,4,5,6,7\r\n\t\t//[begin point in area 6] unintersect: 5,6,7\r\n\t\t//[begin point in area 7] unintersect: 5,6,7,8,1\r\n\t\t//[begin point in area 8] unintersect: 7,8,1\r\n\t\t//[begin point in area 9] unintersect: 9\r\n\t\tif(isInsideArea( 1, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 2, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 3, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 2, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 4, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 5, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 3, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 4, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 6, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 7, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 5, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 6, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\tif(isInsideArea( 8, poiBegI))\t{\r\n\t\t\tif(isInsideArea( 7, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 8, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t\telse if(isInsideArea( 1, poiEndI))\r\n\t\t\t\treturn(false);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean m23476b(C4208a aVar, C4208a aVar2) {\n return aVar.f19238c == aVar2.f19238c && aVar.f19241f == aVar2.f19241f && aVar.f19239d == aVar2.f19239d && aVar.f19240e == aVar2.f19240e && aVar.f19237b.equals(aVar2.f19237b);\n }", "private static boolean m32219a(C40439f c40439f, C40439f c40439f2) {\n AppMethodBeat.m2504i(112324);\n if (c40439f == null || C5046bo.isNullOrNil(c40439f.field_appIconUrl)) {\n AppMethodBeat.m2505o(112324);\n return true;\n } else if (c40439f2 == null || C5046bo.isNullOrNil(c40439f2.field_appIconUrl)) {\n AppMethodBeat.m2505o(112324);\n return false;\n } else if (c40439f.field_appIconUrl.equals(c40439f2.field_appIconUrl)) {\n AppMethodBeat.m2505o(112324);\n return false;\n } else {\n AppMethodBeat.m2505o(112324);\n return true;\n }\n }", "public final boolean mo88502a() {\n if (!(this.f91136f == null || this.f91137g == null)) {\n List<C43187ae> list = this.f91137g;\n if (list == null) {\n C7573i.m23580a();\n }\n int size = list.size();\n List<C43281f> list2 = this.f91136f;\n if (list2 == null) {\n C7573i.m23580a();\n }\n if (size == list2.size()) {\n return true;\n }\n }\n return false;\n }", "public static boolean intersects(Geometry a, Geometry b) {\r\n GeometryFactory factory = new GeometryFactory(a.getPrecisionModel(),\r\n a.getSRID());\r\n List aComponents = components(a);\r\n List bComponents = components(b);\r\n\r\n for (Iterator i = aComponents.iterator(); i.hasNext();) {\r\n Geometry aComponent = (Geometry) i.next();\r\n Assert.isTrue(!(aComponent instanceof GeometryCollection));\r\n\r\n //Collapse to point as workaround for JTS defect: #contains doesn't work for\r\n //polygons and zero-length vectors. [Jon Aquino]\r\n aComponent = collapseToPointIfPossible(aComponent, factory);\r\n\r\n for (Iterator j = bComponents.iterator(); j.hasNext();) {\r\n Geometry bComponent = (Geometry) j.next();\r\n Assert.isTrue(!(bComponent instanceof GeometryCollection));\r\n bComponent = collapseToPointIfPossible(bComponent, factory);\r\n\r\n if (aComponent.intersects(bComponent)) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }", "@Override\r\n public boolean collocated(Space other) {\r\n return this.row == other.getRow() &&\r\n this.col == other.getCol();\r\n }", "private boolean collision1() {\n return game.racket1.getBounds1().intersects(getBounds()); // returns true if the two rectangles intersect\r\n }", "private boolean overlappingTasks(BpmnShape s1, BpmnShape s2) {\n\n\t\tdouble firstHeight = s1.getBounds().getHeight() / 2;\n\t\tdouble firstWidth = s1.getBounds().getWidth() / 2;\n\t\t//The coordinates refer to the upper-left corner of the task, adding Width and Height \n\t\t//cause the coordinates to reflect the position of the center of the shape\n\t\tdouble firstX = s1.getBounds().getX() + firstWidth;\n\t\tdouble firstY = s1.getBounds().getY() + firstHeight;\n\t\t\n\t\tdouble secondHeight = s2.getBounds().getHeight() / 2;\n\t\tdouble secondWidth = s2.getBounds().getWidth() / 2;\n\t\tdouble secondX = s2.getBounds().getX() + secondWidth;\n\t\tdouble secondY = s2.getBounds().getY() + secondHeight;\n\t\t\n\t\tif (firstX > secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY > secondY){\n\t\t\t//Second shape is on the upper-right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY < secondY){\n\t\t\t//Second shape is on the lower-shape\n\t\t\tif (firstX + firstWidth > secondX - secondWidth && firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY == secondY)\n\t\t\t//completely overlapped shapes\n\t\t\t\treturn true;\n\t\t\n\t\tif (firstX == secondX && firstY > secondY){\n\t\t\t//second shape is on top of the first one\n\t\t\tif (firstY - firstHeight < secondY + secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX < secondX && firstY == secondY){\n\t\t\t//second shape is on the right\n\t\t\tif (firstX + firstWidth > secondX - secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX == secondX && firstY < secondY){\n\t\t\t//second shape is on bottom of the first one\n\t\t\tif (firstY + firstHeight > secondY - secondHeight)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (firstX > secondX && firstY == secondY){\n\t\t\t//second shape is on the left\n\t\t\tif (firstX - firstWidth < secondX + secondWidth)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public synchronized boolean CheckArea(Integer bombArea) {\n Integer area;\n // green\n if (coord.getKey() <= sizeSide/2 && coord.getValue() > sizeSide/2) {\n area = 0;\n }\n // red\n else if (coord.getKey() > sizeSide/2 && coord.getValue() > sizeSide/2) {\n area = 1;\n }\n // blue\n else if (coord.getKey() <= sizeSide/2 && coord.getValue() <= sizeSide/2) {\n area = 2;\n }\n // yellow\n else {\n area = 3;\n }\n return area.equals(bombArea);\n }", "public boolean isFullHouse() {\n // TODO: complete this method. Hint: could you call the pair and three-of-a-kind\n // methods here?\n \treturn rankSet().size() ==2 && sameSet.size() == 2;\n }", "public boolean isFullHouse(){\r\n int temp[] = getIntArr();\r\n if(temp[0] == temp[1] && temp[1] == temp[2] && temp[3] == temp[4])\r\n return true;\r\n\r\n else if(temp[0] == temp[1] && temp[2] == temp[3] && temp[3]== temp[4] )\r\n return true;\r\n\r\n else return false;\r\n }", "public boolean ariFight(){\n\t\tint Xari = 0;\n\t\tint Yari = 0;\n\t\tint Xyou = 1;\n\t\tint Yyou = 1;\n\t\tfor(int i = 0 ; i < this.Ari.length;i++){\n\t\t\tfor(int p = 0; p < this.Ari.length;p++){\n\t\t\t\tif(this.Ari[i][p] == 1){\n\t\t\t\t\tYari = i;\n\t\t\t\t\tXari = p;\n\t\t\t\t}\n\t\t\t\tif(this.position[i][p] == 1){\n\t\t\t\t\tYyou = i;\n\t\t\t\t\tXyou = p;\n\t\t\t\t}\n\t\t\t}\n\t\t}//end of outter for\n\t\tif(Yari==Yyou && Xari==Xyou){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private static Boolean isFilled() \n\t{\n\t\tfor(Cells[] cellList : board)\n\t\t{\n\t\t\tfor(Cells cell : cellList)\n\t\t\t{\n\t\t\t\tif(cell==Cells.VOID)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isFilled(char[][] plane){\n for (char[] plane1 : plane) {\n for (int j = 0; j < plane.length; j++) {\n if (plane1[j] != 'X') {\n return false; //If the seat is not occupied (without an X, in the element)\n // then method will return false,\n }\n // then method will return false,\n }\n }\n return true;//or else it will return true, finishing the loop.\n }", "boolean checkBorders();", "public boolean intersecta(ObjetoMapa o) {\n\t\tRectangle r1 = getRectangulo();\n\t\tRectangle r2 = o.getRectangulo();\n\t\t\n\t\treturn r1.intersects(r2);\n\t}", "public boolean isIsosceles () {\r\n\t\tif ((startSide1 == startSide2 || startSide1 == startSide3 || startSide2 == startSide3) && isTriangle () == true && isEquilateral() == false) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse return false;\r\n\t}", "private boolean isInArea(Area area, Position p) {\n long shipLongitude = p.getLongitude();\n long shipLatitude = p.getLatitude();\n\n if (shipLongitude >= area.getLongLeft() && shipLongitude <= area.getLongRight()\n && shipLatitude >= area.getLatBottom() && shipLatitude <= area.getLatTop()) {\n return true;\n }\n return false;\n }", "private boolean overlaps(ThingTimeTriple a, ThingTimeTriple b)\r\n/* 227: */ {\r\n/* 228:189 */ return (a.from < b.to) && (a.to > b.from);\r\n/* 229: */ }", "public boolean doWeHaveSameStops(String corridorA, String corridorB);", "public boolean overlaps(Triangle2D t) {\n\t\treturn true;\n\t}", "private boolean intersectsAggregate( Aggregate mprim ) throws Exception {\n boolean inter = false;\n\n int cnt = mprim.getSize();\n\n for ( int i = 0; i < cnt; i++ ) {\n if ( intersects( mprim.getObjectAt( i ) ) ) {\n inter = true;\n break;\n }\n }\n\n return inter;\n }", "public boolean almostEqual(Coordinates a, Coordinates b);", "public boolean ShareEdge (int i, int j)\n\t{\n\t\tboolean first = false, second = false, third = false;\n\t\tfirst = trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[0]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\tsecond = trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[1]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\tthird = trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[0] ||\n\t\t trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[1] ||\n\t\t trimesh.faces[i].fvlist[2]\n\t\t == trimesh.faces[j].fvlist[2];\n\t\treturn (first && second || first && third || second && third);\n\t}", "private HashMap<Coordinate, Coordinate> getAreaIntersectionPt( Geometry gfaPoly )\n\t{\n\t\tHashMap<Coordinate, Coordinate>\tinterPtsPair = new HashMap<Coordinate, Coordinate>();\t\n\n\t\tArrayList<Coordinate> interPts = new ArrayList<Coordinate>();\t\t\n\t\tArrayList<Coordinate> pts;\n\t\tArrayList<Integer> interIndex = new ArrayList<Integer>();\n\t\tArrayList<Integer> indx = new ArrayList<Integer>();\n\t\t\n\t\t//Reorder in clockwise - first point is repeated at the end.\n\t\tArrayList<Coordinate> gfaPoints = new ArrayList<Coordinate>();\n\t\tfor ( Coordinate c : gfaPoly.getCoordinates() ) {\n\t\t\tgfaPoints.add( c );\n\t\t}\n\t\t\n\t\tArrayList<Coordinate> cwGfaPts = GfaSnap.getInstance().reorderInClockwise( gfaPoints, null );\n\t\t\n\t\t//Get all intersection point with FA region common border.\n\t\tHashMap<String, Geometry> areaCommBnds = GfaClip.getInstance().getFaAreaXCommBounds();\t\n\t\tfor ( Geometry bnd : areaCommBnds.values() ) {\n\t\t\tpts = GfaClip.getInstance().lineIntersect( cwGfaPts.toArray( new Coordinate[ cwGfaPts.size() ]), \n\t\t\t\t\t bnd.getCoordinates(), indx );\n\t\t\t\n\t\t\tif ( pts.size() > 0 ) {\n\t\t\t\tinterPts.addAll( pts );\n\t\t\t\tinterIndex.addAll( indx );\n\t\t\t}\n\t\t}\n\n\t\tif ( interPts.size() <= 0 ) {\n\t\t\treturn interPtsPair;\n\t\t}\n\n\t\t/*\n\t\t * Find the area common bound points inside the polygon to ensure\n\t\t * the new snap points will not cluster with these points.\n\t\t */\n\t\t ArrayList<Coordinate> checkPoints = new ArrayList<Coordinate>();\n\t\t for ( Geometry g : areaCommBnds.values() ) {\t\t\t \n\t\t\t for ( Coordinate c : g.getCoordinates() ) {\n\t\t\t\t Geometry pp = GfaClip.getInstance().pointsToGeometry( new Coordinate[]{ c } );\n\t\t\t\t if ( !checkPoints.contains( c ) && pp.within( gfaPoly ) ) {\n\t\t\t\t\t checkPoints.add( c );\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t /*\n\t\t * Now insert each common intersection point into the el polygon\n\t\t * and snap it outside of the el polygon.\n\t\t * \n\t\t * Note: the point cannot be any point of the el polygon or any \n\t\t * snap point that has been used.\n\t\t * \n\t\t * If an intersection point is not within the clustering distance of \n\t\t * the point before it (Pb) or point after it (Pa), simply insert it into \n\t\t * the polygon and snap it. Otherwise, do the following:\n\t\t * \n\t\t * 1. Pick the closer one of Pb and Pa as Pn. \n\t\t * 2. Check if Pn is within the clustering distance of the common boundary\n\t\t * points inside the FROM line. \n\t\t * 3. If so, snap Pn to the closest point not within the clustering distance\n\t\t * and match the intersection point and Pn to the new point. \n\t\t * 4. If not, match the intersection point with Pn.\n\t\t */\n\t\t ArrayList<Coordinate> usedPoints = new ArrayList<Coordinate>();\n\t\t usedPoints.addAll( cwGfaPts );\n\t\t \n\t\t ArrayList<Coordinate> ePts = new ArrayList<Coordinate>();\t\t \n\t\t for ( int ii = 0; ii < interPts.size(); ii++ ) {\n\t\t\t \n\t\t Coordinate interP = interPts.get( ii );\n\t\t\t Coordinate ptBefore = cwGfaPts.get( interIndex.get( ii ) );\n\t\t\t Coordinate ptAfter = cwGfaPts.get( interIndex.get( ii ) + 1 );\n\t\t\t \n\t\t\t double qdist1 = GfaSnap.getInstance().distance( interP, ptBefore );\n\t\t\t double qdist2 = GfaSnap.getInstance().distance( interP, ptAfter );\n\n\t\t\t int addOne = -1; \t \n\t\t\t int qmatch = -1;\n\t\t\t double qdist;\n\n\t\t\t if ( qdist1 < qdist2 ) {\n\t\t\t\t qmatch = interIndex.get( ii ); \n\t\t\t\t qdist = qdist1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t qmatch = interIndex.get( ii ) + 1;\n\t\t\t\t qdist = qdist2;\n\t\t\t }\n\n\t\t\t if ( ( qdist / PgenUtil.NM2M ) < GfaSnap.CLUSTER_DIST ) {\n\n\t\t\t\t Coordinate ptMatch = cwGfaPts.get( qmatch );\n\t\t\t\t for ( Coordinate c : checkPoints ) {\n\t\t\t\t\t if ( GfaSnap.getInstance().isCluster( c, ptMatch ) ) {\n\t\t\t\t\t\t addOne = qmatch;\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \t\t\t\t \n\t\t\t\t if ( addOne < 0 ) {\n\t\t\t\t\t interPtsPair.put( new Coordinate( interP ),\n\t\t\t\t\t\t\t new Coordinate( ptMatch ) );\n\t\t\t\t\t continue; //Done - ptMatch is a snapped point.\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // Snap\n\t\t\t int kk, kk2;\n\t\t\t if ( addOne >= 0 ) {\n\t\t\t kk = addOne;\n\t\t\t kk2 = kk;\n\n\t\t\t ePts.clear();\n\t\t\t ePts.addAll( cwGfaPts );\n\t\t\t }\n\t\t\t else {\t\t\t\t \n\t\t\t ePts.clear();\n\t\t\t\t ePts.addAll( GfaSnap.getInstance().insertArray( cwGfaPts, interIndex.get( ii ) + 1, interP ) );\n\t\t\t\t kk = interIndex.get( ii ) + 1;\n\t\t\t\t kk2 = kk;\n\t\t\t }\n\n\t\t\t \n\t\t\t ePts.remove( ePts.size() - 1 );\n\t\t\t \n\t\t\t Coordinate[] snapped = new Coordinate[1];\n \n\t\t\t //snap....\n\t\t\t int status = GfaSnap.getInstance().snapPtGFA( kk, kk2, usedPoints, checkPoints, \n\t\t\t\t\t\t ePts, true, true, 3.0F, snapped );\n\t\t\t \n\t\t\t if ( status != 0 ) {\n\t\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( ePts.get( kk ) );\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t snapped[ 0 ] = new Coordinate( interP );\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t interPtsPair.put( new Coordinate( interP ), \n\t\t\t new Coordinate( snapped[ 0 ] ) );\n\t\t\t \n\t\t\t if ( addOne >= 0 ) {\n\t\t\t\t interPtsPair.put( new Coordinate( cwGfaPts.get( addOne ) ), \n\t\t new Coordinate( snapped[ 0 ] ) );\t\t\t\t \n\t\t\t }\t\n\t\t\t \n\t\t\t usedPoints.add( snapped[ 0 ] );\n\t\t\t \n\t\t }\n\t\t\n\t\treturn interPtsPair;\n\t}", "public boolean isFillArea() {\n\t\treturn fillArea;\n\t}", "static boolean allInAreaHuh ( AddressBookEntry ae, int someArea ) {\n\t/*\n\treturn ... ae.home ... ae.office ... ae.cell ... someArea ;\n\treturn ... inAreaHuh( ... ae.home ...) ... inAreaHuh( ... ae.office ...) ... inAreaHuh( ... ae.cell ...) ... someArea ;\n\treturn ... inAreaHuh( ae.home, someArea ) ... inAreaHuh( ae.office, someArea ) ... inAreaHuh( ae.cell, someArea ) ... someArea ;\n\t*/\n\treturn inAreaHuh( ae.home, someArea ) \n\t && inAreaHuh( ae.office, someArea ) \n\t && inAreaHuh( ae.cell, someArea );\t\n }", "private boolean checkAllRingAtomsHasCoordinates(IAtomContainer ac) {\n\t\tfor (int i = 0; i < ac.getAtomCount(); i++) {\n\t\t\tif (ac.getAtom(i).getPoint3d() != null && ac.getAtom(i).getFlag(CDKConstants.ISINRING)) {\n\t\t\t} else if (!ac.getAtom(i).getFlag(CDKConstants.ISINRING)) {\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean iguales(Sector s){\n\t\tboolean devolucion=false;\n\t\t\n\t\tif((this.coordenada.getCoordenadas()[0]==s.getCoordenada().getCoordenadas()[0]) && (this.coordenada.getCoordenadas()[1]==s.getCoordenada().getCoordenadas()[1]) && (this.coordenada.getCoordenadas()[2]==s.getCoordenada().getCoordenadas()[2])){\n\t\t\tfor (int i = 0; i < almacen.length; i++) {\n\t\t\t\tif(this.almacen[i].iguales(s.getAlmacen()[i])){\n\t\t\t\t\tif(this.existencias[i]==s.getExistencias()[i]){\n\t\t\t\t\t\tdevolucion=true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdevolucion=false;\n\t\t\t\t\t\ti=almacen.length;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tdevolucion=false;\n\t\t\t\t\ti=almacen.length;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tdevolucion=false;\n\t\t}\n\t\t\n\t\treturn devolucion;\n\t}", "boolean hasRect();", "int checkInside(Rectangle r1, Rectangle r2) {\n if (r1.x - r1.w / 2 >= r2.x - r2.w / 2 // left edge\n && r1.x + r1.w / 2 <= r2.x + r2.w / 2 // right edge\n && r1.y + r1.h / 2 <= r2.y + r2.h / 2 // top\n && r1.y - r1.h / 2 >= r2.y - r2.h / 2 // bottom\n ) {\n return 1;\n }\n // check if r2 is inside r1\n if (r2.x - r2.w / 2 >= r1.x - r1.w / 2 // left edge\n && r2.x + r2.w / 2 <= r1.x + r1.w / 2 // right edge\n && r2.y + r2.h / 2 <= r1.y + r1.h / 2 // top\n && r2.y - r2.h / 2 >= r1.y - r1.h / 2 // bottom\n ) {\n return 2;\n }\n\n return 0;\n }", "private static boolean isCornerTile(Tile tile, Map<Border, List<Tile>> borderMap) {\n int n = 0;\n for (Border border : tile.getBorders()) {\n if (borderMap.get(border).size() == 1) {\n n++;\n }\n }\n return n == 2;\n }", "@Override\r\n public boolean isClef ()\r\n {\r\n return ShapeSet.Clefs.contains(getShape());\r\n }", "public boolean isInRect2(Point p) {\n\t\tLine AB = new Line(A1, B1);\n\t\tLine CD = new Line(C1, AB.getU());\n\t\tLine AD = new Line(A1, D1);\n\t\tLine BC = new Line(B1, AD.getU());\n\n\t\t// if(Line.isBetween2Lines2(AB, CD, p))\n\t\t// System.out.println(1);\n\t\t// if(Line.isBetween2Lines2(AD, BC, p))\n\t\t// System.out.println(2);\n\n\t\tif (Line.isBetween2Lines2(AB, CD, p) && Line.isBetween2Lines2(AD, BC, p)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static boolean doRegionsOverlap(int x1, int y1, int width1, int height1, int x2, int y2,\n\t\t\t\t\t\t\t\t\t\t int width2, int height2, Orientation orientation) \n\t\t\t\t\t\t\tthrows IllegalArgumentException{\n\t\t\n\t\tswitch (orientation) {\n\t\t\n\t\t\tcase RIGHT: \n\t\t\t\treturn x1 + width1 > x2 &&\n\t\t\t\t\t\tx1 + width1 <= x2 + width2 &&\n\t\t\t\t\t\tCollision.doPixelsOverlap(y1, height1, y2, height2);\n\t\t\tcase LEFT:\n\t\t\t\treturn x1 >= x2 &&\n\t\t\t\t\t\tx1 < x2 + width2 &&\n\t\t\t\t\t\tCollision.doPixelsOverlap(y1, height1, y2, height2);\n\t\t\tcase TOP:\n\t\t\t\treturn \ty1 + height1 > y2 && \n\t\t\t\t\t\ty1 + height1 <= y2 + height2 &&\n\t\t\t\t\t\tCollision.doPixelsOverlap(x1, width1, x2, width2);\t\t\t\t\n\t\t\tcase BOTTOM:\n\t\t\t\treturn \ty1 >= y2 &&\n\t\t\t\t\t\ty1 < y2 + height2 &&\n\t\t\t\t\t\tCollision.doPixelsOverlap(x1, width1, x2, width2);\n\t\t\tcase ALL:\n\t\t\t\treturn ! ( // Dus geeft true als elke deelexpressie false geeft\n\t\t\t\t\t\t (x1 + (width1 - 1) < x2) \n\t\t\t\t\t\t|| (x2 + (width2 - 1) < x1)\n\t\t\t\t\t\t|| (y1 + (height1 - 1) < y2) // top\n\t\t\t\t\t\t|| (y2 + (height2 - 1) < y1) //bottom\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\tthrow new IllegalArgumentException(\"Given orientation not implemented!\");\n\t\t}\n\t}", "public static boolean contenido (int[] arrayA, int[] arrayB){\n\t\tboolean iguales=true;\n\t\t\n\t\tfor (int i=0; i<arrayA.length && iguales ; i++)\n\t\t\t\n\t\t\tif (arrayA[i] != arrayB[i]) \n\t\t\t\tiguales=false;\n\t\t\t\n\t\treturn iguales;\n\t}", "public boolean intersects(Shape other) {\n boolean result = false;\n ArrayList<Vector3D> points = getPoints();\n for (Vector3D point : points) {\n if (other.contains(point)) {\n if (other.contains(point)) {\n if (other.contains(point)) {\n System.out.println(this.part.name + \" contains \" + other.part.name + \" : \" + point);\n\n result = true;\n }\n }\n }\n }\n\n points = other.getPoints();\n for (Vector3D point : points) {\n if (this.contains(point)) {\n if (this.contains(point)) {\n if (this.contains(point)) {\n System.out.println(this.part.name + \" contains \" + other.part.name + \" : \" + point);\n\n result = true;\n }\n }\n }\n }\n\n return result;\n }", "boolean allFacesPainted() {\n\n\n for (int i = 0; i < s; i ++){\n if (the_cube[i] == false){\n return false;\n\n }\n }\n return true;\n }", "boolean isDone(){\n\t\t\n\t\treturn (x0==x1 && y0==y1);\n\t}", "public boolean isFull(){\n for(int i=0;i<3;i++){\n for(int j=0;j<3;j++){\n if(!gameBoard[i][j].equals(\"O\") && !gameBoard[i][j].equals(\"X\")){\n return false;\n }\n }\n }\n return true;\n }", "static boolean isPositionAlreadyFilled(int i, int j, String[][] board) {\r\n\t\tboolean isOccupied = false;\r\n\t\tif (board[i][j] == \"*\" || board[i][j] == \"O\") {\r\n\t\t\tSystem.out.println(i + \" \" + j + \"board is \" + board[i][j]\r\n\t\t\t\t\t+ \"The current place is already filled Please choose the other place to fill\");\r\n\t\t\tisOccupied = true;\r\n\t\t}\r\n\t\treturn isOccupied;\r\n\t}", "private static boolean hasVisibleRegion(int begin,int end,int first,int last) {\n return (end > first && begin < last);\n }", "private boolean allCellsCorrect() {\n for (int i = 0;i < btArray.length;i++) {\n for (int j = 0;j < btArray[0].length;j++) {\n int cellState = mainField.getCellState(i,j);\n // if the cell has a mine\n if (mainField.getValue(i,j) == -1) {\n // tests to see if it isn't marked\n if (cellState != mainField.MARKED) {\n // returns false if it isn't, because it should be marked if the game is complete\n return false;\n }\n }\n // if it isn't a mine\n else {\n // tests to see if the cell is marked\n if (cellState == mainField.MARKED) {\n // returns false, because this nonmine cell should not be marked if the game is complete\n return false;\n }\n }\n }\n }\n return true;\n }", "private boolean quickCheck(IAtomContainer molecule1, List<IAtomContainer> fragsToCompare) throws NoSuchAtomException\n {\n \tIMolecule mol = new Molecule(molecule1);\n \tIsomorphismTester it = new IsomorphismTester(mol);\n \tfor (int i = 0; i < fragsToCompare.size(); i++) {\n \t\t//no match\n \t\tif (molecule1.getBondCount() != fragsToCompare.get(i).getBondCount() && molecule1.getAtomCount() != fragsToCompare.get(i).getAtomCount()) \n \t\t{\n \t\t\tcontinue;\n \t\t}\n\n\t\t\t//compare to molecule1\n \t\tIMolecule mol2 = new Molecule(fragsToCompare.get(i));\n\t\t\tif (it.isIsomorphic((mol2))) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t //no match found\n\t\treturn false;\n\t}", "boolean hasCoordinates();", "boolean hasCoordinates();", "boolean hasCoordinates();", "public boolean overlaps(Shape2D s)\r\n {\r\n if (isPhasing)\r\n return false;\r\n \r\n return super.overlaps(s);\r\n }", "static boolean inAreaHuh ( PhoneNumber pn, int someArea ) {\n\t// return ... pn.areaCode ... pn.prefix ... pn.line ... someArea ;\n\treturn pn.areaCode == someArea ;\n }", "public final boolean checkIfInZone(int x, int y) { return (getSiege(x, y) != null); }", "public boolean isCalibrated() {\n return ( clicked1!=null && clicked2!=null );\n }" ]
[ "0.6242988", "0.60303676", "0.58830184", "0.58716106", "0.57639563", "0.5739823", "0.5718594", "0.57171834", "0.5705322", "0.57025516", "0.5691092", "0.5678772", "0.5662314", "0.5627295", "0.5616903", "0.55916154", "0.55674285", "0.555516", "0.55467665", "0.5546269", "0.5513466", "0.54811114", "0.54669136", "0.5450793", "0.5426931", "0.5425627", "0.5423992", "0.54199743", "0.5419253", "0.5412965", "0.5411619", "0.5405325", "0.5404335", "0.53980446", "0.53847235", "0.53757685", "0.53616405", "0.5360385", "0.5358337", "0.5354318", "0.5352009", "0.5345962", "0.53426296", "0.5338875", "0.53347635", "0.53322613", "0.5330808", "0.5318764", "0.5316699", "0.5313391", "0.5312735", "0.52972084", "0.529523", "0.52938765", "0.5290122", "0.5279249", "0.5273399", "0.5272964", "0.5271275", "0.526677", "0.5263483", "0.5262146", "0.52588403", "0.5257133", "0.52498597", "0.5248009", "0.52294266", "0.5226265", "0.5224455", "0.5222488", "0.521947", "0.5219382", "0.5216759", "0.5216675", "0.5215397", "0.52127457", "0.52098155", "0.5208567", "0.52084017", "0.5206883", "0.52018094", "0.51983863", "0.5194687", "0.5193952", "0.5187557", "0.5187463", "0.5184911", "0.5183095", "0.5182314", "0.51818234", "0.51817703", "0.5179428", "0.51722664", "0.51674587", "0.51674587", "0.51674587", "0.5165827", "0.5161215", "0.5160194", "0.5157954" ]
0.78019327
0
/ Wrapper to do regular point reduction on a smear.
private Gfa regularPointReduction( Gfa smearIn ) { ArrayList<Coordinate> xyList = new ArrayList<Coordinate>( smearIn.getPoints() ); List<Integer> reduceFlg = new ArrayList<Integer>(); List<Integer> orig = new ArrayList<Integer>(); boolean[] reduceF = smearIn.getReduceFlags(); for ( int ii = 0; ii < reduceF.length; ii++ ) { if ( reduceF[ ii ] ) { reduceFlg.add( 1 ); } else { reduceFlg.add( 0 ); } orig.add( 1 ); } /* for ( int ii = 0; ii < smearIn.getPoints().size(); ii++ ) { System.out.println( "Point " + ii + " (" + smearIn.getPoints().get( ii ).x + "," + smearIn.getPoints().get( ii ).y + ") is " + reduceFlg.get(ii) ); } */ double incrPct = SMEAR_INCR_PCT; double incrPctOrig = REDUCEPTS_INCR_PCT_ORIG; double incrDst = SMEAR_INCR_DST; String prefix = getPrefixString( smearIn ); int ier = ReduceGfaPoints.reduceByPctDist( xyList, reduceFlg, orig, incrPct, incrPctOrig, incrDst, prefix ); boolean[] reduceFl = new boolean[ xyList.size() ]; for (int ii = 0; ii < xyList.size(); ii++ ) { if ( reduceFlg.get( ii ) == 1 ) reduceFl[ ii ] = true; else reduceFl[ ii ] = false; } Gfa newSmear = smearIn.copy(); newSmear.setPointsOnly( xyList ); newSmear.setReduceFlags( reduceFl ); return newSmear; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Gfa> reducePoints( Gfa smear, ArrayList<Gfa> snapshots ) {\n\t\t\t\t\n\t\tArrayList<Gfa> glist = new ArrayList<Gfa>();\n \n\t\t/*\n\t\t * Step 1 - reduce points on the whole smear polygon. Note that freezing level \n\t\t * contours are point reduced in af_fzlvl2fmt().\n\t\t */ \t\t\n\t\tGfa tSmear = regularPointReduction( smear );\n\t\t\n\t\t/*\n\t\t * Create a smear with the reduced points and return if the smear can be \n\t\t * formatted into 3-line text now.\n\t\t */\n\t\tif ( canBeFormatted( tSmear ) ) {\n\t\t smear.setPointsOnly( tSmear.getPoints() );\n\t\t smear.setReduceFlags( tSmear.getReduceFlags() );\n\t\t glist.add( smear );\n\t\t return glist;\n\t\t}\n \t\t\t\t\t\n\t\t/*\n\t\t * Step 2 - Do area clipping to split up the ORIGINAL smear \n\t\t * \t\t\talong area boundary, if needed.\n\t\t */\n\t\tArrayList<Gfa> listOfAreaClip = new ArrayList<Gfa>();\n\t\tlistOfAreaClip.addAll( faAreaClip( smear, snapshots ) );\n\t\t\n\t\t// Step 3 - Do first round of bisection, if necessary. \t\t\n\t\tArrayList<Gfa> listOfFirstBisect = new ArrayList<Gfa>();\t\t\n\t\tfor ( Gfa gg : listOfAreaClip ) {\t\t \t\t\t\n\t\t\t\n\t\t\t//First do point reduction on each of the clipped smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\n \t\tgg.setPointsOnly( tmpSmear.getPoints() );\n \t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n if ( canBeFormatted( tmpSmear ) ) {\n glist.add( gg ); \t\n }\n else {\n listOfFirstBisect.addAll( bisect( gg, true ) );\n }\n\t\t}\n\t\t\n\t\t//See if any middle point are generated in bisection.\n\t\tCoordinate midPt = null;\n\t\tif ( listOfFirstBisect.size() > 0 ) {\n\t\t midPt = (Coordinate)listOfFirstBisect.get(0).getAttribute( BISECT_MIDDLE_POINT );\n\t\t}\n\t\t\n\t\t// Step 4 - Do second round of bisection, if necessary. \n\t\tfor ( Gfa gg : listOfFirstBisect ) {\t\t \n\t\t\t\n\t\t\t//First do point reduction on each of the bisected smears.\n\t\t\tGfa tmpSmear = regularPointReduction( gg );\t\t\t\t\t\t\n\t\t\tgg.setPointsOnly( tmpSmear.getPoints() );\n\t\t\tgg.setReduceFlags( tmpSmear.getReduceFlags() );\n\t\t\t\n\t\t\tif ( canBeFormatted( tmpSmear ) ) {\n\t\t\t\tglist.add( gg ); \n\t\t\t}\n\t\t\telse { \n\t\t\t\t//Another round of bisect, done.\n\t\t\t\tglist.addAll( bisect( gg, false) );\n\t\t\t}\n\t\t}\t\t\n\n\t\t\n\t\t//\n\t\t// If bisection happens, check if the middle point generated in the first round\n\t\t// has been used for the second round. If not, remove the middle point from \n\t\t// all smears.\n\t\t//\n\t\tboolean removeMidPt = false;\n\t\tif ( midPt != null ) {\n\t\t\tint ii = 0;\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tii++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ii < 3 ) {\n\t\t\t\tremoveMidPt = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( removeMidPt ) {\n\t\t\t\n\t\t\tfor ( Gfa gg : glist ) {\n\t\t\t\tCoordinate removePt = null;\n\t\t\t\tfor ( Coordinate cc : gg.getPoints() ) {\n\t\t\t\t\tif ( GfaSnap.getInstance().isSamePoint( cc , midPt, GfaSnap.MAP_PRECISION ) ) {\n\t\t\t\t\t\tremovePt = cc;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( removePt != null ) gg.getPoints().remove( removePt ) ;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn glist;\n\n\t}", "public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) {\n\n\t\tArrayList<Gfa> smearList = new ArrayList<Gfa>(); \n\n\t\t// Do area clipping and bisection for each smear.\n\t\tfor ( Gfa gg : glist ) {\n\t\t\tsmearList.addAll( reducePoints( gg, snapshots ) );; \n\t\t}\n\t\t\n\t\t// Replace the smear list with the new list.\n\t\tglist.clear();\n\t\tglist.addAll( smearList );\n\t\t\n\t}", "public RMPoint convertedPointFromShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointFromShape(new RMPoint(aPoint), aShape);\n}", "Point mult (double s, Point result);", "@NonNull\n @Override\n public PointF transformMeteringPoint(@NonNull PointF point) {\n final PointF referencePoint = new PointF(point.x, point.y);\n Size referenceSize = previewSize;\n\n // 1. Account for cropping.\n // This will enlarge the preview size so that aspect ratio matches.\n referenceSize = applyPreviewCropping(referenceSize, referencePoint);\n\n // 2. Scale to the preview stream coordinates.\n // This will move to the preview stream coordinates by scaling.\n referenceSize = applyPreviewScale(referenceSize, referencePoint);\n\n // 3. Rotate to the stream coordinate system.\n // This leaves us with sensor stream coordinates.\n referenceSize = applyPreviewToSensorRotation(referenceSize, referencePoint);\n\n // 4. Move to the crop region coordinate system.\n // The crop region is the union of all currently active streams.\n referenceSize = applyCropRegionCoordinates(referenceSize, referencePoint);\n\n // 5. Move to the active array coordinate system.\n referenceSize = applyActiveArrayCoordinates(referenceSize, referencePoint);\n LOG.i(\"input:\", point, \"output (before clipping):\", referencePoint);\n\n // 6. Probably not needed, but make sure we clip.\n if (referencePoint.x < 0) referencePoint.x = 0;\n if (referencePoint.y < 0) referencePoint.y = 0;\n if (referencePoint.x > referenceSize.getWidth()) referencePoint.x = referenceSize.getWidth();\n if (referencePoint.y > referenceSize.getHeight()) referencePoint.y = referenceSize.getHeight();\n LOG.i(\"input:\", point, \"output (after clipping):\", referencePoint);\n return referencePoint;\n }", "public RMPoint convertedPointToShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointToShape(new RMPoint(aPoint), aShape);\n}", "@SuppressWarnings(\"DuplicatedCode\")\n @Override\n public Point3D triangulate() throws LockedException, NotReadyException,\n RobustEstimatorException {\n if (isLocked()) {\n throw new LockedException();\n }\n if (!isReady()) {\n throw new NotReadyException();\n }\n\n final LMedSRobustEstimator<Point3D> innerEstimator =\n new LMedSRobustEstimator<>(\n new LMedSRobustEstimatorListener<Point3D>() {\n\n // point to be reused when computing residuals\n private final Point2D mTestPoint = Point2D.create(\n CoordinatesType.HOMOGENEOUS_COORDINATES);\n\n // non-robust 3D point triangulator\n private final SinglePoint3DTriangulator mTriangulator =\n SinglePoint3DTriangulator.create(mUseHomogeneousSolution ?\n Point3DTriangulatorType.LMSE_HOMOGENEOUS_TRIANGULATOR :\n Point3DTriangulatorType.LMSE_INHOMOGENEOUS_TRIANGULATOR);\n\n // subset of 2D points\n private final List<Point2D> mSubsetPoints = new ArrayList<>();\n\n // subst of cameras\n private final List<PinholeCamera> mSubsetCameras =\n new ArrayList<>();\n\n @Override\n public int getTotalSamples() {\n return mPoints2D.size();\n }\n\n @Override\n public int getSubsetSize() {\n return MIN_REQUIRED_VIEWS;\n }\n\n @Override\n public void estimatePreliminarSolutions(final int[] samplesIndices,\n final List<Point3D> solutions) {\n mSubsetPoints.clear();\n mSubsetPoints.add(mPoints2D.get(samplesIndices[0]));\n mSubsetPoints.add(mPoints2D.get(samplesIndices[1]));\n\n mSubsetCameras.clear();\n mSubsetCameras.add(mCameras.get(samplesIndices[0]));\n mSubsetCameras.add(mCameras.get(samplesIndices[1]));\n\n try {\n mTriangulator.setPointsAndCameras(mSubsetPoints,\n mSubsetCameras);\n final Point3D triangulated = mTriangulator.triangulate();\n solutions.add(triangulated);\n } catch (final Exception e) {\n // if anything fails, no solution is added\n }\n }\n\n @Override\n public double computeResidual(final Point3D currentEstimation, final int i) {\n final Point2D point2D = mPoints2D.get(i);\n final PinholeCamera camera = mCameras.get(i);\n\n // project estimated point with camera\n camera.project(currentEstimation, mTestPoint);\n\n // return distance of projected point respect to the original one\n // as a residual\n return mTestPoint.distanceTo(point2D);\n }\n\n @Override\n public boolean isReady() {\n return LMedSRobustSinglePoint3DTriangulator.this.isReady();\n }\n\n @Override\n public void onEstimateStart(final RobustEstimator<Point3D> estimator) {\n if (mListener != null) {\n mListener.onTriangulateStart(\n LMedSRobustSinglePoint3DTriangulator.this);\n }\n }\n\n @Override\n public void onEstimateEnd(final RobustEstimator<Point3D> estimator) {\n if (mListener != null) {\n mListener.onTriangulateEnd(\n LMedSRobustSinglePoint3DTriangulator.this);\n }\n }\n\n @Override\n public void onEstimateNextIteration(\n final RobustEstimator<Point3D> estimator, final int iteration) {\n if (mListener != null) {\n mListener.onTriangulateNextIteration(\n LMedSRobustSinglePoint3DTriangulator.this,\n iteration);\n }\n }\n\n @Override\n public void onEstimateProgressChange(\n final RobustEstimator<Point3D> estimator, final float progress) {\n if (mListener != null) {\n mListener.onTriangulateProgressChange(\n LMedSRobustSinglePoint3DTriangulator.this,\n progress);\n }\n }\n });\n\n try {\n mLocked = true;\n innerEstimator.setConfidence(mConfidence);\n innerEstimator.setMaxIterations(mMaxIterations);\n innerEstimator.setProgressDelta(mProgressDelta);\n innerEstimator.setStopThreshold(mStopThreshold);\n return innerEstimator.estimate();\n } catch (final com.irurueta.numerical.LockedException e) {\n throw new LockedException(e);\n } catch (final com.irurueta.numerical.NotReadyException e) {\n throw new NotReadyException(e);\n } finally {\n mLocked = false;\n }\n }", "void optimiseSetPointProfile()\n\t{\n\t\tif (this.owner.storageHeater != null)\n\t\t{\n\t\t\toptimiseStorageHeater(this.owner.storageHeater);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"WattboxController:: optimise set point called for agent \" + this.owner.getAgentName());\n\t\t}\n\n\t\t// Initialise optimisation\n\t\tdouble[] localSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tdouble[] deltaT = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(this.priorDayExternalTempProfile));\n\t\tdouble[] localDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\tdouble leastCost = this.evaluateCost(localDemandProfile);\n\t\tdouble newCost = leastCost;\n\t\tdouble maxRecoveryPerTick = 0.5d\n\t\t\t\t* Consts.DOMESTIC_COP_DEGRADATION_FOR_TEMP_INCREASE\n\t\t\t\t* ((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * ArrayUtils.max(deltaT)); // i.e.\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// can't\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// recover\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// more\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// than\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// 50%\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// of\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// heat\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// loss\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// at\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// 90%\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// COP.\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// TODO:\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// Need\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// to\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// code\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// this\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// better\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// later\n\n\t\tfor (int i = 0; i < localSetPointArray.length; i++)\n\t\t{\n\t\t\t// Start each evaluation from the basepoint of the original (user\n\t\t\t// specified) set point profile\n\t\t\tlocalSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tdouble totalTempLoss = 0;\n\t\t\tdouble[] otherPrices = Arrays.copyOf(this.dayPredictedCostSignal, this.dayPredictedCostSignal.length);\n\n\t\t\tfor (int j = 0; (j < Consts.HEAT_PUMP_MAX_SWITCHOFF && (i + j < this.ticksPerDay)); j++)\n\t\t\t{\n\t\t\t\tdouble tempLoss = (((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * Math\n\t\t\t\t\t\t.max(0, (localSetPointArray[i + j] - this.priorDayExternalTempProfile[i + j]))) / this.owner\n\t\t\t\t\t\t.getBuildingThermalMass());\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Temp loss in tick \" + (i + j) + \" = \" + tempLoss);\n\t\t\t\t}\n\t\t\t\ttotalTempLoss += tempLoss;\n\n\t\t\t\tfor (int k = i + j; k < localSetPointArray.length; k++)\n\t\t\t\t{\n\t\t\t\t\tlocalSetPointArray[k] = this.setPointProfile[k] - totalTempLoss;\n\t\t\t\t\t// availableHeatRecoveryTicks++;\n\t\t\t\t}\n\t\t\t\tdouble availableHeatRecoveryTicks = localSetPointArray.length - j;\n\n\t\t\t\t// Sort out where to regain the temperature (if possible)\n\t\t\t\tint n = (int) Math.ceil((totalTempLoss * this.owner.getBuildingThermalMass()) / maxRecoveryPerTick);\n\t\t\t\t// Take this slot out of the potential cheap slots to recover\n\t\t\t\t// temp in.\n\t\t\t\totherPrices[i + j] = Double.POSITIVE_INFINITY;\n\n\t\t\t\tif (n < availableHeatRecoveryTicks && n > 0)\n\t\t\t\t{\n\t\t\t\t\t// We know it's possible to recover the temperature lost\n\t\t\t\t\t// in switch off period under the constraints set.\n\t\t\t\t\tdouble tempToRecover = (totalTempLoss / n);\n\n\t\t\t\t\t// Find the cheapest timeslots in which to recover the\n\t\t\t\t\t// temperature\n\t\t\t\t\t// If this selection results in a tie, the slot is chosen\n\t\t\t\t\t// randomly\n\t\t\t\t\tint[] recoveryIndices = ArrayUtils.findNSmallestIndices(otherPrices, n);\n\n\t\t\t\t\t// Add on temperature in each temperature recovery slot and\n\t\t\t\t\t// all subsequent slots - thus building an optimised\n\t\t\t\t\t// profile.\n\t\t\t\t\tfor (int l : recoveryIndices)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int m = l; m < this.ticksPerDay; m++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalSetPointArray[m] += tempToRecover;\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Adding \" + tempToRecover + \" at index \" + m + \" to counter temp loss at tick \"\n\t\t\t\t\t\t\t\t\t+ (i + j + 1));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Evaluating switchoff for tick zero, set point array = \"\n\t\t\t\t\t\t\t\t\t+ Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"In here, adding temp \" + tempToRecover + \" from index \" + l);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"With result \" + Arrays.toString(localSetPointArray));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdouble[] tempDifference = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(localSetPointArray));\n\n\t\t\t\t\tif (ArrayUtils.max(ArrayUtils.add(ArrayUtils.absoluteValues(tempDifference), ArrayUtils\n\t\t\t\t\t\t\t.negate(Consts.MAX_PERMITTED_TEMP_DROPS))) > Consts.FLOATING_POINT_TOLERANCE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if the temperature drop, or rise, is too great, this\n\t\t\t\t\t\t// profile is unfeasible and we return null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// calculate energy implications and cost for this\n\t\t\t\t\t\t// candidate setPointProfile\n\t\t\t\t\t\tlocalDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(localSetPointArray);\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Calculated demand for set point array turning off at tick \" + i + \" for \"\n\t\t\t\t\t\t\t\t\t+ (j + 1) + \" ticks \" + Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Demand = \" + Arrays.toString(localDemandProfile));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (localDemandProfile != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// in here if the set point profile is achievable\n\t\t\t\t\t\t\tnewCost = this.evaluateCost(localDemandProfile);\n\n\t\t\t\t\t\t\t// Decide whether to swap the new profile with the\n\t\t\t\t\t\t\t// current best one\n\t\t\t\t\t\t\t// based on cost.\n\t\t\t\t\t\t\t// Many strategies are available - here we give two\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\t// Either the new cost must be better by an amount\n\t\t\t\t\t\t\t// greater than some decision threshold\n\t\t\t\t\t\t\t// held in Consts.COST_DECISION_THRESHOLD\n\t\t\t\t\t\t\t// OR (currently used) the cost must simply be\n\t\t\t\t\t\t\t// better, with a tie in cost\n\t\t\t\t\t\t\t// being decided by a \"coin toss\".\n\n\t\t\t\t\t\t\t// if((newCost - leastCost) < (0 -\n\t\t\t\t\t\t\t// Consts.COST_DECISION_THRESHOLD))\n\t\t\t\t\t\t\tif (newCost < leastCost || (newCost == leastCost && RandomHelper.nextIntFromTo(0, 1) == 1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tleastCost = newCost;\n\t\t\t\t\t\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(localSetPointArray, localSetPointArray.length);\n\t\t\t\t\t\t\t\tthis.heatPumpDemandProfile = ArrayUtils\n\t\t\t\t\t\t\t\t\t\t.multiply(localDemandProfile, (1 / Consts.DOMESTIC_HEAT_PUMP_SPACE_COP));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Impossible to recover heat within heat pump\n\t\t\t\t\t\t\t// limits - discard this attempt.\n\t\t\t\t\t\t\tif (this.owner.getAgentID() == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.err.println(\"WattboxController: Can't recover heat with \" + availableHeatRecoveryTicks\n\t\t\t\t\t\t\t\t\t\t+ \" ticks, need \" + 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\t\t\t}\n\t\t}\n\n\t\tthis.expectedNextDaySpaceHeatCost = leastCost;\n\t}", "public Point getAlteredCoord(Point actualPoint) {\n //If breath rate is out of range, returns an altered coordinate according to the level of out of range and\n //the current game level (Easy, Medium, Hard). If breath is in range, return the same coord.\n Point alteratedPoint = actualPoint;\n\n Random randomNoise = new Random();\n\n //As USER_CURRENT_BREATH_RATE will be changing, we must do a \"snapshot\" at this time to work with proper measures.\n double userCurrentSnap = USER_CURRENT_BREATH_RATE;\n\n //Consider 6-8, MAX_IDEAL_BREATH_RATE (8) will be the max\n double referenceDistance = MAX_BREATH_RATE - MAX_IDEAL_BREATH_RATE;\n double myRateExcess = userCurrentSnap - MAX_IDEAL_BREATH_RATE;\n double relationPreferedActual = myRateExcess / referenceDistance;\n\n //How much far of the ideal is?, according to our limit of 20\n double percentOfExcess = relationPreferedActual * 100;\n\n /*\n EASY:\n Speed: 25%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 30% of the maximum number on coord x or y\n MEDIUM:\n Speed: 45%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 50% of the maximum number on coord x or y\n HARD:\n Speed: 80%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 80% of the maximum number on coord x or y\n */\n\n //Maximum increment of speed in 15% of MAX_SCALED_SPEED\n double mxSpdInc = MAX_SCALED_SPEED * .15;\n\n //NOTE: The formulas obtained were based on x^2\n /*\n *Solving y=ax^2 + b\n *Finding the variables a, and b. X represents the amount of excess and Y represents the speed for that amount\n */\n double a, b;\n double maxSpeed; //Max space in case of 100% of\n double easyNoise = .38, mediumNoise = .58, hardNoise = .75; //Percents\n\n //drive_control works acording to the size of the wheel. And as closer to the circumference as faster that will be.\n int maxX = this.wheel.getBounds().width(); //This represent the max X possible coord on the wheel\n int maxY = this.wheel.getBounds().height();\n\n if (percentOfExcess > 0) {\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n\n //Alter speed. The speed will be changed\n maxSpeed = EASY_BASE_SPEED + mxSpdInc;\n b = EASY_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n\n alteratedPoint = getFinalPoint(maxX, maxY, easyNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n break;\n case MEDIUM:\n maxSpeed = MEDIUM_BASE_SPEED + mxSpdInc;\n b = MEDIUM_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, mediumNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n case HARD:\n maxSpeed = HARD_BASE_SPEED + mxSpdInc;\n b = HARD_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, hardNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n }\n } else {//Else, the user's breath rate must be under 8 so it's ok.\n //In this case, we will ensure that the speed it's acording to the level.\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n this.drive_control.setSpeedScale(this.EASY_BASE_SPEED);\n break;\n case MEDIUM:\n this.drive_control.setSpeedScale(this.MEDIUM_BASE_SPEED);\n break;\n case HARD:\n this.drive_control.setSpeedScale(this.HARD_BASE_SPEED);\n break;\n }\n }\n return alteratedPoint;\n }", "abstract double apply(double x, double y);", "void pointScaleFree() {\n\t\t// offsetP = PVector.sub(P, beginOffsetP); // get the offset (because\n\t\t// mouse isnt' exatly at the pressed point, there a little offset)\n\t\toffset = PVector.sub(P, beginOffset); // calculate the offset made by\n\t\t\t\t\t\t\t\t\t\t\t\t// mouseDrag -- subtract\n\t\t\t\t\t\t\t\t\t\t\t\t// beginOffset from P\n\t\toffsetP = PVector.add(beginOffsetP, offset); // reposition point A based\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the offset made\n\n\t\tleftOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\t\trightOppositeLine.detectX(offsetP); // update X (dot product magic)\n\t\t\t\t\t\t\t\t\t\t\t// constantly\n\n\t\tfloat scaleFactorRight, scaleFactorLeft;\n\t\tscaleFactorRight = rightOppositeLine.X.dist(offsetP) / rightOppositeLine.beginX.dist(beginOffsetP);\n\t\tscaleFactorLeft = leftOppositeLine.X.dist(offsetP) / leftOppositeLine.beginX.dist(beginOffsetP);\n\n\t\t// needs exaplainin drawing\n\t\tPVector tmpR = new PVector();\n\t\tPVector tmpL = new PVector();\n\n\t\tif (rightOppositeLine.isOnThisSideOfLine == rightOppositeLine.checkLineSide(offsetP)) {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginStart, leftOppositeLine.beginEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tif (leftOppositeLine.isOnThisSideOfLine == leftOppositeLine.checkLineSide(offsetP)) {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginStart, rightOppositeLine.beginEnd);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t} else {\n\t\t\t\ttmpR = PVector.sub(rightOppositeLine.beginEnd, rightOppositeLine.beginStart);\n\t\t\t\ttmpL = PVector.sub(leftOppositeLine.beginEnd, leftOppositeLine.beginStart);\n\t\t\t}\n\t\t}\n\n\t\t// needs exaplainin drawing\n\n\t\ttmpL.mult(scaleFactorRight);\n\t\ttmpL.add(leftOppositeLine.end);\n\n\t\ttmpR.mult(scaleFactorLeft);\n\t\ttmpR.add(rightOppositeLine.end);\n\n\t\t// set left neigbor point\n\t\tpoint[neighbor(selectedPoint)[0]].position.set(tmpL);\n\n\t\t// set right neighbor point\n\t\tpoint[neighbor(selectedPoint)[1]].position.set(tmpR);\n\t\tpoint[selectedPoint].position.set(offsetP);\n\t\tselectedLine = -1; // disable line focus\n\t\tupdateGlobalLines();\n\t}", "@Override\n public double calculate(double measurement, double setpoint) {\n // Set setpoint to provided value\n setSetpoint(setpoint);\n return calculate(measurement);\n }", "public abstract void mv(int y, int x);", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public RMPoint convertPointFromShape(RMPoint point, RMShape shape)\n{\n if(shape==_parent && !isRSS()) { point.offset(-getX(), -getY()); return point; }\n return getTransformFromShape(shape).transform(point);\n}", "Point mult (double s);", "protected abstract void calcOrigin();", "public Point safeApply(Point point, Region region)\n {\n assert(_index >= 0);\n assert(_index < _pattern.length);\n\n Delta delta = _pattern[_index];\n\n if (point.wouldGoOutside(delta, region)) return point;\n\n return point.move(_pattern[_index]);\n }", "public abstract double evaluate(Point p);", "abstract void mulS();", "public abstract double calcSA();", "public RMPoint convertPointToShape(RMPoint point, RMShape shape)\n{\n if(shape==_parent && !isRSS()) { point.offset(getX(), getY()); return point; }\n return getTransformToShape(shape).transform(point);\n}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "private void process(double sample)\r\n {\n System.arraycopy(samples, 0, samples, 1, sampleSize - 1);\r\n samples[0] = sample;\r\n\r\n currentValue = AnalysisUtil.rms(samples);\r\n }", "public abstract double calcular();", "public interface Mutator {\n\n /**\n * Applies this mutation to the given graph.\n *\n * @param graph The graph to be mutated\n * @throws IllegalArgumentException If the given graph is null\n */\n void apply(GraphOfPixels graph) throws IllegalArgumentException;\n\n /**\n * Represents a filter applied to sharpen a pixel.\n */\n class SharpenFilter extends AbstractFilter {\n\n private static final Matrix kernel =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n -0.125, -0.125, -0.125, -0.125, -0.125,\n -0.125, 0.25, 0.25, 0.25, -0.125,\n -0.125, 0.25, 1.0, 0.25, -0.125,\n -0.125, 0.25, 0.25, 0.25, -0.125,\n -0.125, -0.125, -0.125, -0.125, -0.125)),\n 5, 5);\n\n\n @Override\n protected PixelAsColors applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Given node is null.\");\n }\n\n double newRed = 0.0;\n double newGreen = 0.0;\n double newBlue = 0.0;\n\n for (int i = -2; i <= 2; i += 1) {\n for (int j = 2; j >= -2; j -= 1) {\n double kernelValue = kernel.getValue(i + 2, Math.abs(j - 2));\n newRed += kernelValue * n.getNearby(i, j).getRed();\n newGreen += kernelValue * n.getNearby(i, j).getGreen();\n newBlue += kernelValue * n.getNearby(i, j).getBlue();\n }\n }\n\n return new SimplePixel(Utils.roundDouble(newRed), Utils.roundDouble(newGreen),\n Utils.roundDouble(newBlue));\n }\n }\n\n /**\n * Represents a filter which can be applied to a graph of pixels to alter an image.\n */\n interface Filter extends Mutator {\n\n }\n\n /**\n * Represents a filter applied to blur a pixel.\n */\n class BlurFilter extends AbstractFilter {\n\n private static final Matrix kernel =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.0625, 0.125, 0.0625,\n 0.125, 0.25, 0.125,\n 0.0625, 0.125, 0.0625)),\n 3, 3);\n\n\n @Override\n protected PixelAsColors applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Given node is null.\");\n }\n\n double newRed = 0.0;\n double newGreen = 0.0;\n double newBlue = 0.0;\n\n for (int i = -1; i <= 1; i += 1) {\n for (int j = 1; j >= -1; j -= 1) {\n double kernelValue = kernel.getValue(i + 1, Math.abs(j - 1));\n newRed += kernelValue * n.getNearby(i, j).getRed();\n newGreen += kernelValue * n.getNearby(i, j).getGreen();\n newBlue += kernelValue * n.getNearby(i, j).getBlue();\n }\n }\n\n return new SimplePixel(Utils.roundDouble(newRed), Utils.roundDouble(newGreen),\n Utils.roundDouble(newBlue));\n }\n }\n\n /**\n * Represents an abstraction of a image filter.\n */\n abstract class AbstractFilter implements Filter {\n\n /**\n * Applies this filter to the given pixel.\n *\n * @param n represents a node in the graph for an image in a pixel\n * @return PixelAsColors representing new color of pixel\n * @throws IllegalArgumentException if node given is null\n */\n protected abstract PixelAsColors applyToPixel(Node n) throws IllegalArgumentException;\n\n @Override\n public void apply(GraphOfPixels graph) throws IllegalArgumentException {\n if (graph == null) {\n throw new IllegalArgumentException(\"Null graph given.\");\n }\n\n ArrayList<PixelAsColors> updatedColors = new ArrayList<PixelAsColors>();\n\n for (Node n : graph) {\n updatedColors.add(this.applyToPixel(n));\n }\n\n int counter = 0;\n for (Node n : graph) {\n n.updateColors(updatedColors.get(counter));\n counter += 1;\n }\n }\n }\n\n /**\n * Represents a color transformation to Sepia tone.\n */\n class SepiaTransform extends AbstractColorTransformation {\n\n private static final Matrix baseMatrix =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.393, 0.769, 0.189,\n 0.349, 0.686, 0.168,\n 0.272, 0.534, 0.131)),\n 3, 3);\n\n @Override\n protected Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException {\n return baseMatrix.matrixMultiply(rgb);\n }\n\n }\n\n /**\n * Represents a color transformation to Greyscale.\n */\n class GreyscaleTransform extends AbstractColorTransformation {\n\n private static final Matrix baseMatrix =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.2126, 0.7152, 0.0722,\n 0.2126, 0.7152, 0.0722,\n 0.2126, 0.7152, 0.0722)),\n 3, 3);\n\n @Override\n protected Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException {\n return baseMatrix.matrixMultiply(rgb);\n }\n }\n\n /**\n * Represents an abstraction of possible color transformations.\n */\n abstract class AbstractColorTransformation implements ColorTransformation {\n\n /**\n * Gets a new Matrix representing the new transformed colors of a pixel.\n *\n * @param rgb represents the original colors of the pixel\n * @return the transformed colors of the pixel\n * @throws IllegalArgumentException if rgb is null.\n */\n protected abstract Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException;\n\n /**\n * Applies this color transformation to the given pixel.\n *\n * @param n represents a node in the graph for an image in a pixel\n */\n protected void applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Null node given.\");\n }\n ArrayList<Double> nodeRGB = new ArrayList<Double>(\n Arrays.asList(n.getRed() + 0.0, n.getGreen() + 0.0, n.getBlue() + 0.0));\n Matrix ogRGB = new MatrixImpl(nodeRGB, 1, 3);\n\n Matrix newRGB = this.generateNewColorMatrix(ogRGB);\n\n n.updateColors(new SimplePixel(\n Utils.roundDouble(newRGB.getValue(0, 0)),\n Utils.roundDouble(newRGB.getValue(0, 1)),\n Utils.roundDouble(newRGB.getValue(0, 2))));\n }\n\n @Override\n public void apply(GraphOfPixels graph) throws IllegalArgumentException {\n if (graph == null) {\n throw new IllegalArgumentException(\"Null graph given.\");\n }\n\n for (Node n : graph) {\n this.applyToPixel(n);\n }\n }\n }\n\n /**\n * Represents a color transformation to mutate an image.\n */\n interface ColorTransformation extends Mutator {\n\n }\n}", "public void calc()\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(oldInfo.calcInfo!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\toldInfo.calcInfo.calc();\n\t\t\t\t\t\t\toldInfo.calcInfo=null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Filter particles\n\t\t\t\t\t\tfor(int id:oldInfo.keySet())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tParticleInfo pInfo=oldInfo.get(id);\n\t\t\t\t\t\t\tif(filter.acceptParticle(id, pInfo))\n\t\t\t\t\t\t\t\tnewInfo.put(id,pInfo);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private double processImg() {\n\n\t\ttry {\n\t\t\timgPreview.setVisibility(View.VISIBLE);\n\n\t\t\t// bitmap factory\n\t\t\tBitmapFactory.Options options = new BitmapFactory.Options();\n\n\t\t\t// downsizing image as it throws OutOfMemory Exception for larger\n\t\t\t// images\n\t\t\toptions.inSampleSize = 8;\n\n\t\t\tbitmap_ref = BitmapFactory.decodeFile(fileUriSafe.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\tbitmap_sample = BitmapFactory.decodeFile(fileUriMole.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\t//convert from bitmap to Mat\n\t\t\tMat ref = new Mat(bitmap_ref.getHeight(), bitmap_ref.getWidth(), CvType.CV_8UC4);\n\t\t\tMat sample = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\t\t\tMat mask = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC4);\n\t\t\tMat sample2calcgrad = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\n\t\t\tUtils.bitmapToMat(bitmap_ref, ref);\n\t\t\tUtils.bitmapToMat(bitmap_sample, sample);\n\t\t\tUtils.bitmapToMat(bitmap_sample,sample2calcgrad);\n\n\t\t\t//normalize image based on reference\t\t\t\n\t\t\t//sample = normalizeImg(sample, ref);\n\n\t\t\t//Using Sobel filter to calculate gradient\n\t\t\tMat grad_x = new Mat();\n\t\t\tMat grad_y = new Mat();\n\t\t\tMat abs_grad_x = new Mat();\n\t\t\tMat abs_grad_y = new Mat();\n\t\t\tMat gradVals = new Mat();\n\t\t\tMat sample_gray = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC1);\n\t\t\tImgproc.cvtColor(sample2calcgrad, sample_gray, Imgproc.COLOR_BGRA2GRAY);\n\t\t\tImgproc.GaussianBlur(sample_gray, sample_gray, new Size(5,5), 0);\n\n\t\t\t//Gradient X\n\t\t\tImgproc.Sobel(sample_gray, grad_x, CvType.CV_8UC1, 1, 0);\n\t\t\tCore.convertScaleAbs(grad_x, abs_grad_x,10,0);\n\n\t\t\t//Gradient Y\n\t\t\tImgproc.Sobel(sample_gray, grad_y, CvType.CV_8UC1, 0, 1);\n\t\t\tCore.convertScaleAbs(grad_y,abs_grad_y, 10, 0);\n\n\t\t\t//combine with grad = sqrt(gx^2 + gy^2)\n\t\t\tCore.addWeighted(abs_grad_x, .5, abs_grad_y, .5, 0, gradVals);\n\n\n\t\t\t//Using CANNY to further smooth Gaussian blurred image; extract contours\n\t\t\tImgproc.Canny(sample_gray, mIntermediateMat, 80, 90);\n\n\t\t\t//find contours of filtered image\n\t\t\tList <MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\t\t\tImgproc.findContours(mIntermediateMat, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n\t\t\t// Find max contour area\n\t\t\tdouble maxArea = 0;\n\t\t\tIterator<MatOfPoint> each = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint wrapper = each.next();\n\t\t\t\tdouble area = Imgproc.contourArea(wrapper);\n\t\t\t\tif (area > maxArea)\n\t\t\t\t\tmaxArea = area;\n\t\t\t}\n\n\t\t\t// Filter contours by area and only keep those above thresh value\n\t\t\tmContours.clear();\n\t\t\teach = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint contour = each.next();\n\t\t\t\tif (Imgproc.contourArea(contour) > mMinContourArea*maxArea) {\n\t\t\t\t\tmContours.add(contour);\n\t\t\t\t\tborder.addAll(contour.toList());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//segment border into 8 parts \n\t\t\t//calc gradient along contour segment & normalize based on number of points in border\n\t\t\t//upto 7 points at end of border list ignored\n\t\t\tdouble [] seg_val = new double [8];\n\t\t\tint seg_len = border.size()/8;\n\t\t\tfor(int i = 0; i<8; i++){\n\t\t\t\tdouble contourGradientSum = 0;\n\t\t\t\tfor(int j=i*seg_len; j<(i+1)*seg_len;j++){\n\t\t\t\t\tPoint pt = border.get(j);\n\t\t\t\t\tint x = (int) pt.x;\n\t\t\t\t\tint y = (int) pt.y;\t\t\t\n\t\t\t\t\tcontourGradientSum += Core.mean(gradVals.submat(y-1, y+1, x-1, x+1)).val[0];\n\t\t\t\t}\n\t\t\t\tseg_val[i]=contourGradientSum/seg_len;\n\t\t\t}\n\n\n\t\t\tLog.v(TAG, \"grad vals: [\" + seg_val[0] + \",\" + seg_val[1] + \",\" \n\t\t\t\t\t+ seg_val[2] + \",\"+ seg_val[3] + \",\"\n\t\t\t\t\t+ seg_val[4] + \",\"+ seg_val[5] + \",\"\n\t\t\t\t\t+ seg_val[6] + \",\"+ seg_val[7] + \"]\");\n\t\t\t\n\t\t\tdouble thresh = 140;\n\t\t\tdouble score = 0;\n\n\t\t\tfor(double val:seg_val){\n\t\t\t\tif (val<=thresh){\n\t\t\t\t\tscore++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(score<8){\n\t\t\t\tscore += mContours.size()/7;\n\t\t\t\tscore = Math.min(8,score);\n\t\t\t}\n\n\n\n\t\t\tLog.v(TAG, \"score: \" +score);\n\t\t\tLog.v(TAG, \"Contours count: \" + mContours.size());\n\t\t\tLog.v(TAG, \"Border size: \" + border.size());\n\t\t\tImgproc.drawContours(sample, mContours, -1, CONTOUR_COLOR);\n\t\t\tImgproc.drawContours(mask, mContours, -1, COLOR_WHITE, -1);\n\t\t\tborders = mask;\n\n\t\t\t//display image with contours\n\t\t\tUtils.matToBitmap(sample, bitmap_sample);\n\t\t\timgPreview.setImageBitmap(bitmap_sample);\n\t\t\timgPreview.setFocusable(true);\n\n\t\t\treturn score;\n\n\t\t\t//\t\t\t\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn -1;\n\t}", "public Point apply(Point point)\n {\n assert(_index >= 0);\n assert(_index < _pattern.length);\n\n point.move(_pattern[_index]);\n\n return point;\n }", "public abstract boolean ableToReshape(Point p);", "public abstract boolean illuminates(Point3 point);", "public double pointCost (scala.collection.TraversableOnce<org.apache.spark.mllib.clustering.VectorWithNorm> centers, org.apache.spark.mllib.clustering.VectorWithNorm point) { throw new RuntimeException(); }", "@Override\n public double calculate(double measurement) {\n return calculate(measurement) + (m_Kf * getSetpoint());\n }", "protected abstract boolean reduce();", "private ArrayList<Gfa> bisect( Gfa smear, boolean addMidPt ) {\n\t \n\t\tArrayList<Gfa> newSmears = new ArrayList<Gfa>();\n\t\t\n\t //First check if the polygon can be represented on 3 lines of text.\n\t\tboolean cbf = canBeFormatted( smear );\n\t\t\t\t\n\t //Return if it can be formatted already.\n\t\tif ( cbf ) {\n\t\t\tnewSmears.add( smear );\n\t\t\treturn newSmears;\n\t\t}\n\t\t\n\t /*\n\t * Find the all potential splitting segments - from the one with the \n\t * shortest length among those segments that do not intersect the polygon.\n\t */\t\t\n\t\tCoordinate[] smearPts = smear.getLinePoints();\t\t\n\t\tTreeSet<BisectDistInfo> segments = findAllSegments( smearPts );\n\t \n\t /*\n\t * Compute the size of the original polygon.\n\t */\n\t double polyArea = PgenUtil.getSphPolyArea( smearPts );\n\n\t /*\n\t * Now loop over all the possible splitting segments, from shortest\n\t * to longest, to find the shortest segment which divides the original \n\t * polygon in an acceptable proportion.\n\t */\n\t\tdouble prefPct = 100.0 - GFA_AF_BISECT_PCT;\n\t\tdouble prefPctMax = Math.max( prefPct, GFA_AF_BISECT_PCT );\n\t\tdouble prefPctMin = Math.min( prefPct, GFA_AF_BISECT_PCT );\n\n\t ArrayList<Coordinate> tmpPoly = new ArrayList<Coordinate>();\n double tarea;\n double pct;\n BisectDistInfo bisectSeg = null;\n \n\t for ( BisectDistInfo bd : segments ) {\n\t \t\n\t //Generate the polygon starting from indx1 and ending at indx2.\n\t tmpPoly.clear();\n\t for ( int ii = bd.start; ii <= bd.end; ii++ ) {\n\t \ttmpPoly.add( new Coordinate( smearPts[ ii ] ) );\n\t }\n\t \n\t \t //Compute and compare it's size to the original polygon as a percentage\n\t tarea = PgenUtil.getSphPolyArea( tmpPoly.toArray( new Coordinate[ tmpPoly.size() ] ) );\n\t pct = 100.0F * ( tarea / polyArea );\n\t \n\n\t \t//If the percentage is within the limits, we've found our splitting segment.\n\t \tif ( pct >= prefPctMin && pct <= prefPctMax ) {\n\t \t bisectSeg = new BisectDistInfo( bd.distance, bd.start, bd.end );\n\t \t break;\n\t \t}\t \n\t \n\t }\n\t \n\t /*\n\t * Find the correct number of points for new polygons. For first round\n\t * division, the middle point on the splitting segment is calculated\n\t * and snapped to be used later. The splitting segment is thus divided\n\t * into two segments at the middle point. If either one of them intersects\n\t * with the original polygon, the middle point will not be added.\n\t */\n\t if ( bisectSeg == null ) {\n\t \tnewSmears.add( smear );\n\t }\n\t else {\n\t \t\n\t \t//First figure out if we need and could add a middle point.\n \t\tCoordinate midPt = null;\n\t \tif ( addMidPt ) {\n\t \t\tmidPt = new Coordinate();\n\t \t\tmidPt.x = ( smearPts[ bisectSeg.start ].x + smearPts[ bisectSeg.end ].x ) / 2.0;\n\t \t\tmidPt.y = ( smearPts[ bisectSeg.start ].y + smearPts[ bisectSeg.end ].y ) / 2.0;\n\t \t\t\n\t\t\t\tCoordinate snappedMidPt = GfaSnap.getInstance().snapOnePt( midPt );\n\n\t \t\tif ( !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.start ] ) && \n\t \t\t\t !GfaSnap.getInstance().isCluster( snappedMidPt, smearPts[ bisectSeg.end] ) ) {\n\n\t \t\t\tCoordinate[] seg1 = new Coordinate[]{ smearPts[ bisectSeg.start ], snappedMidPt };\n\t \t\t\tCoordinate[] seg2 = new Coordinate[]{ smearPts[ bisectSeg.end ], snappedMidPt };\n\n\t \t\t\tif ( segIntPoly( seg1, smearPts ) && segIntPoly( seg2, smearPts ) ) {\n\t \t\t\t\tmidPt.x = snappedMidPt.x;\n\t \t\t\t\tmidPt.y = snappedMidPt.y;\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\taddMidPt = false;\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t/*\n\t * First polygon - from bisectSeg.start to bisectSeg.end, plus a middle point.\n\t */ \n\t\t\tGfa first = smear.copy();\n\t\t\t\t\t\t\n\t\t\tArrayList<Coordinate> coor1 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg1 = new ArrayList<Boolean>();\n\t\t\tfor ( int ii = bisectSeg.start; ii <= bisectSeg.end; ii++ ) {\n\t\t\t\tcoor1.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg1.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt1 = new Coordinate( midPt );\n\t\t\t\tcoor1.add( mpt1 );\n\t\t\t\tfirst.addAttribute( BISECT_MIDDLE_POINT, mpt1 );\n\t\t\t\treduFlg1.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfirst.setPointsOnly( coor1 );\n\t\t\tfirst.setGfaTextCoordinate( first.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu1 = new boolean[ reduFlg1.size() ];\n\t\t\tint kk = 0;\n\t\t\tfor ( Boolean bb : reduFlg1 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu1[ kk ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu1[ kk ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkk++;\n\t\t\t}\n\t\t\tfirst.setReduceFlags( redu1 );\n\t \t\t \t\t \t\n\t /*\n\t * Second polygon - from 0 to bisectSeg.start, then middle point, continue \n\t * from bisectSeg.end to the end.\n\t */ \n\t\t\tGfa second = smear.copy();\n\t\t\tArrayList<Coordinate> coor2 = new ArrayList<Coordinate>();\n\t\t\tArrayList<Boolean> reduFlg2 = new ArrayList<Boolean>();\n\t\t\t\t\t\t\n\t\t\tfor ( int ii = 0; ii <= bisectSeg.start; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( addMidPt ) {\n\t\t\t\tCoordinate mpt2 = new Coordinate( midPt );\t\t\t\t\n\t\t\t\tcoor2.add( mpt2 );\n\t\t\t\tsecond.addAttribute( BISECT_MIDDLE_POINT, mpt2 );\n\t\t\t\treduFlg2.add( new Boolean( false ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( int ii = bisectSeg.end; ii < smearPts.length; ii++ ) {\n\t\t\t\tcoor2.add( new Coordinate( smearPts[ ii ] ) );\n\t\t\t\treduFlg2.add( new Boolean( smear.getReduceFlags()[ ii ] ) );\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsecond.setPointsOnly( coor2 );\t\t\n\t\t\tsecond.setGfaTextCoordinate( second.getCentroid() );\n\t\t\t\n\t\t\tboolean[] redu2 = new boolean[ reduFlg2.size() ];\n\t\t\tint kj = 0;\n\t\t\tfor ( Boolean bb : reduFlg2 ) {\n\t\t\t\tif ( bb ) {\n\t\t\t\t\tredu2[ kj ] = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tredu2[ kj ] = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkj++;\n\t\t\t}\n\t\t\tsecond.setReduceFlags( redu2 );\n\t \t\n\t\t\t//Add new smears to the list.\n\t newSmears.add( first );\n\t newSmears.add( second );\n\t \n\t }\n\n\t\treturn newSmears;\n\n\t}", "private void power(){\n this.powerX = realX * radius;\n this.powerY = realY * radius;\n }", "public abstract double costPerMin (CallZone zone);", "public abstract void mutate();", "public abstract Number calculateDirectValue(Parallax parallax);", "int apply(int x, int y, int origin);", "@Override\r\n\tpublic void compute() {\r\n\r\n\t\t// compute s1, s2 secret shares for all the parties\r\n\t\t// s1s2[i] - pair(s1 SecretShare, s2 SecretShare) for party i\r\n\t\tArrayList<ArrayList<SecretShare>> s1s2 = new ArrayList<ArrayList<SecretShare>>();\r\n\t\tfor (GateIO in : this.input) {\r\n\t\t\tArrayList<SecretShare> theShares = new ArrayList<SecretShare>();\r\n\t\t\ttheShares.add(0, in.getValue().get(0)); // s1\r\n\t\t\ttheShares.add(1, in.getValue().get(1)); // s2\r\n\t\t\ts1s2.add(in.getIndex(), theShares);\r\n\t\t\t// System.out.println(\"party \" + in.getIndex());\r\n\t\t\t// System.out.println(\"s1 = \" + in.getValue().get(0));\r\n\t\t\t// System.out.println(\"s2 = \" + in.getValue().get(1));\r\n\r\n\t\t}\r\n\r\n\t\t// compute locally - s1*s2\r\n\t\tArrayList<SecretShare> localMults = new ArrayList<SecretShare>();\r\n\t\tfor (int i = 0; i < s1s2.size(); i++) {\r\n\t\t\tlocalMults.add(i, new SecretShare(s1s2.get(i).get(0).x,\r\n\t\t\t\t\tmodField(s1s2.get(i).get(0).y * s1s2.get(i).get(1).y)));\r\n\t\t\t// System.out.println(new SecretShare(s1s2.get(i).get(0).x,\r\n\t\t\t// modField(s1s2.get(i).get(0).y * s1s2.get(i).get(1).y)));\r\n\t\t}\r\n\r\n\t\t// share the local multiplications between the parties\r\n\t\t// localMultShare[i] - the secrets shares of party i new secret(mult)\r\n\t\tArrayList<ArrayList<SecretShare>> localMultsShare = new ArrayList<ArrayList<SecretShare>>();\r\n\t\tfor (int i = 0; i < localMults.size(); i++) {\r\n\t\t\tlocalMultsShare.add(i, new ArrayList<SecretShare>());\r\n\t\t}\r\n\r\n\t\tfor (SecretShare mult : localMults) {\r\n\t\t\tArrayList<SecretShare> yiShares = Polynomial\r\n\t\t\t\t\t.createShareSecret(mult.y);\r\n\t\t\t// for (int i = 0; i < yiShares.size(); i++) {\r\n\t\t\t// System.out.println(\"i = \" + i + \" y = \" + yiShares.get(i));\r\n\t\t\t// }\r\n\t\t\tfor (int i = 0; i < yiShares.size(); i++) {\r\n\t\t\t\tArrayList<SecretShare> tmp = localMultsShare.get(i);\r\n\t\t\t\ttmp.add(yiShares.get(i));\r\n\t\t\t\tlocalMultsShare.set(i, tmp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// System.out.println(\"start\");\r\n\t\t// for (int i = 0; i < localMultsShare.size(); i++) {\r\n\t\t// for (int j = 0; j < localMultsShare.get(i).size(); j++) {\r\n\t\t// System.out.println((localMultsShare.get(i)).get(j));\r\n\t\t// }\r\n\t\t// }\r\n\t\t// System.out.println(\"end\");\r\n\r\n\t\t// compute the outPut = Yi * Zi\r\n\t\tthis.result = new ArrayList<GateIO>();\r\n\t\tfor (int i = 0; i < localMultsShare.size(); i++) {\r\n\t\t\tGateIO out = new GateIO(i);\r\n\r\n\t\t\tint outYValue = 0;\r\n\t\t\tfor (int j = 0; j < localMultsShare.get(i).size(); j++) {\r\n\t\t\t\toutYValue += computeZi(j + 1)\r\n\t\t\t\t\t\t* ((localMultsShare.get(i)).get(j)).y;\r\n\t\t\t}\r\n\t\t\tout.value.add(new SecretShare(i + 1, modField(outYValue)));\r\n\t\t\tthis.result.add(out);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < this.result.size(); i++) {\r\n\t\t\t// System.out.println(this.result.get(i).value.get(0));\r\n\t\t}\r\n\r\n\t}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public abstract void moveShape(double lon, double lat);", "private double squash(double tmpPotential)\r\n\t{\t\t\r\n\t\treturn gradient*tmpPotential;\r\n\t}", "@SuppressWarnings(\"DuplicatedCode\")\n @Override\n public RadialDistortion estimate() throws LockedException,\n NotReadyException, RadialDistortionEstimatorException {\n if (isLocked()) {\n throw new LockedException();\n }\n if (!isReady()) {\n throw new NotReadyException();\n }\n\n try {\n mLocked = true;\n if (mListener != null) {\n mListener.onEstimateStart(this);\n }\n\n final int nPoints = mDistortedPoints.size();\n\n int numRows;\n if (isLMSESolutionAllowed()) {\n // initialize new matrix having two rows per point\n numRows = 2 * nPoints;\n } else {\n // when LMSE is not allowed, restrict matrix to two rows (minimum\n // value required for a solution)\n numRows = 2 * getMinNumberOfMatchedPoints();\n }\n\n final Matrix aMatrix = new Matrix(numRows, mNumKParams);\n final double[] b = new double[numRows];\n\n final Iterator<Point2D> iteratorDistorted = mDistortedPoints.iterator();\n final Iterator<Point2D> iteratorUndistorted =\n mUndistortedPoints.iterator();\n\n Point2D distorted;\n Point2D undistorted;\n int counter = 0;\n\n // undistorted normalized homogeneous coordinates\n double uNormHomX;\n double uNormHomY;\n double uNormHomW;\n // undistorted normalized inhomogeneous coordinates\n double uNormInhomX;\n double uNormInhomY;\n // undistorted denormalized homogeneous coordinates\n double uDenormHomX;\n double uDenormHomY;\n double uDenormHomW;\n // undistorted denormalized inhomogeneous coordinates\n double uDenormInhomX;\n double uDenormInhomY;\n // distorted inhomogeneous coordinates\n double dInhomX;\n double dInhomY;\n double rowNormX;\n double rowNormY;\n\n // radial distortion center\n double centerX = 0.0;\n double centerY = 0.0;\n if (mDistortionCenter != null) {\n centerX = mDistortionCenter.getInhomX();\n centerY = mDistortionCenter.getInhomY();\n }\n\n // radial distance of undistorted normalized (calibration independent)\n // coordinates\n double r2;\n double a;\n double value;\n\n while (iteratorDistorted.hasNext() && iteratorUndistorted.hasNext()) {\n distorted = iteratorDistorted.next();\n undistorted = iteratorUndistorted.next();\n\n undistorted.normalize();\n\n uDenormHomX = undistorted.getHomX();\n uDenormHomY = undistorted.getHomY();\n uDenormHomW = undistorted.getHomW();\n\n uDenormInhomX = uDenormHomX / uDenormHomW;\n uDenormInhomY = uDenormHomY / uDenormHomW;\n\n // multiply intrinsic parameters by undistorted point\n uNormHomX = mKinv.getElementAt(0, 0) * uDenormHomX +\n mKinv.getElementAt(0, 1) * uDenormHomY +\n mKinv.getElementAt(0, 2) * uDenormHomW;\n uNormHomY = mKinv.getElementAt(1, 0) * uDenormHomX +\n mKinv.getElementAt(1, 1) * uDenormHomY +\n mKinv.getElementAt(1, 2) * uDenormHomW;\n uNormHomW = mKinv.getElementAt(2, 0) * uDenormHomX +\n mKinv.getElementAt(2, 1) * uDenormHomY +\n mKinv.getElementAt(2, 2) * uDenormHomW;\n\n uNormInhomX = uNormHomX / uNormHomW;\n uNormInhomY = uNormHomY / uNormHomW;\n\n r2 = uNormInhomX * uNormInhomX + uNormInhomY * uNormInhomY;\n\n dInhomX = distorted.getInhomX();\n dInhomY = distorted.getInhomY();\n\n a = 1.0;\n rowNormX = rowNormY = 0.0;\n for (int i = 0; i < mNumKParams; i++) {\n a *= r2;\n\n // x and y coordinates generate linear dependent equations, for\n // that reason we need more than one point\n\n // x coordinates\n value = (uDenormInhomX - centerX) * a;\n aMatrix.setElementAt(2 * counter, i, value);\n\n rowNormX += Math.pow(value, 2.0);\n\n // y coordinates\n value = (uDenormInhomY - centerY) * a;\n aMatrix.setElementAt(2 * counter + 1, i, value);\n\n rowNormY += Math.pow(value, 2.0);\n }\n\n // x coordinates\n value = dInhomX - uDenormInhomX;\n b[2 * counter] = value;\n\n rowNormX += Math.pow(value, 2.0);\n\n // y coordinates\n value = dInhomY - uDenormInhomY;\n b[2 * counter + 1] = value;\n\n rowNormY += Math.pow(value, 2.0);\n\n // normalize rows to increase accuracy\n for (int i = 0; i < mNumKParams; i++) {\n aMatrix.setElementAt(2 * counter, i,\n aMatrix.getElementAt(2 * counter, i) / rowNormX);\n aMatrix.setElementAt(2 * counter + 1, i,\n aMatrix.getElementAt(2 * counter + 1, i) / rowNormY);\n }\n\n b[2 * counter] /= rowNormX;\n b[2 * counter + 1] /= rowNormY;\n\n counter++;\n\n if (!isLMSESolutionAllowed() && (counter >= getMinNumberOfMatchedPoints())) {\n break;\n }\n }\n\n final double[] params = Utils.solve(aMatrix, b);\n\n final RadialDistortion distortion =\n new RadialDistortion(params, mDistortionCenter,\n mHorizontalFocalLength, mVerticalFocalLength, mSkew);\n\n if (mListener != null) {\n mListener.onEstimateEnd(this);\n }\n\n return distortion;\n } catch (final AlgebraException | RadialDistortionException e) {\n throw new RadialDistortionEstimatorException(e);\n } finally {\n mLocked = false;\n }\n }", "double squaredDistanceTo(IMovingObject m);", "abstract protected boolean clearSquareHitMine(Location m);", "@Override\r\n\tpublic Point2D.Double transform(Point2D.Double p) {\r\n\t\tRealVector s = new ArrayRealVector(new double[] { p.x, p.y, 1 }, false);\r\n\t\tRealVector t = H.operate(s);\r\n\t\tp.x = t.getEntry(0) / t.getEntry(2);\r\n\t\tp.y = t.getEntry(1) / t.getEntry(2);\r\n\t\treturn p;\r\n\t}", "public void mul() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->mul() unimplemented!\\n\");\n }", "public BufferedImage transform(BufferedImage image) {\n\t\tpoint.setFuzziness(10);\r\n\t\treturn point.filter(image, null);\r\n\t}", "private void condenseSteam() {\n if (getPressure()> Constants.ATMOSPHERIC_PRESSURE) {\n double boilingPoint = Water.getBoilingTemperature(getPressure());\n if (boilingPoint > steam.getTemperature()) { // remove steam such that it equalizes to the boiling point\n double newSteamPressure = Math.max(Water.getBoilingPressure(steam.getTemperature()), Constants.ATMOSPHERIC_PRESSURE);\n \n\n int newQuantity = steam.getParticlesAtState(newSteamPressure, getCompressibleVolume());\n int deltaQuantity = steam.getParticleNr() - newQuantity;\n if (deltaQuantity < 0) {\n System.out.println(\"BAD\");\n }\n steam.remove(deltaQuantity);\n getWater().add(new Water(steam.getTemperature(), deltaQuantity));\n }\n } \n }", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "private static Location permutateLocation(Location location){\n while (isMaterialInBlackList(location))\n location = locationYIncrementer(location, 2);\n return location;\n }", "protected abstract double getReductionFactor();", "public abstract boolean illuminates(Point3 point, World world);", "@Override\n\tvoid averageDistance() {\n\t\t\n\t}", "public abstract void recalc();", "public abstract float[] computeRepulsiveForce(float deltaX, float deltaY, float distance, float squareDistance, int v1Deg, int v2Deg);", "void reduceStarsBy(final int amount);", "@NonNull\n @Override\n public PointF transformMeteringPoint(@NonNull PointF point) {\n PointF scaled = new PointF();\n scaled.x = -1000F + (point.x / previewSize.getWidth()) * 2000F;\n scaled.y = -1000F + (point.y / previewSize.getHeight()) * 2000F;\n\n // Apply rotation to this point.\n // https://academo.org/demos/rotation-about-point/\n PointF rotated = new PointF();\n double theta = ((double) displayToSensor) * Math.PI / 180;\n rotated.x = (float) (scaled.x * Math.cos(theta) - scaled.y * Math.sin(theta));\n rotated.y = (float) (scaled.x * Math.sin(theta) + scaled.y * Math.cos(theta));\n LOG.i(\"scaled:\", scaled, \"rotated:\", rotated);\n return rotated;\n }", "protected abstract void shiftReduceAlgorithm() throws ParseException;", "public void mainProcess(java.util.ArrayList<double[]> dataPoint, String dist) throws Exception {\n double[][] S = initAP(dataPoint);\r\n// double[][] S = readData(fn);\r\n double[][] A = new double[N][N];\r\n double[][] R = new double[N][N];\r\n //////////////////////////////////////\r\n\tfor(int m=0; m<iter; m++) {\r\n// System.out.println(m);\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n double max = -1e100;\r\n for(int kk=0; kk<k; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n for(int kk=k+1; kk<N; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n R[i][k] = (1-lambda)*(S[i][k] - max) + lambda*R[i][k];\r\n }\r\n }\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n if(i==k) {\r\n double sum = 0.0;\r\n for(int ii=0; ii<i; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=i+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*sum + lambda*A[i][k];\r\n } else {\r\n double sum = 0.0;\r\n int maxik = Math.max(i, k);\r\n int minik = Math.min(i, k);\r\n for(int ii=0; ii<minik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=minik+1; ii<maxik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=maxik+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*Math.min(0.0, R[k][k]+sum) + lambda*A[i][k];\r\n }\r\n }\r\n }\r\n }\r\n \r\n//\tdouble E[N][N] = {0};\r\n double[][] E = new double[N][N];\r\n\r\n//\tvector<int> center;\r\n java.util.ArrayList<Integer> center = new java.util.ArrayList<>();\r\n for(int i=0; i<N; i++) {\r\n E[i][i] = R[i][i] + A[i][i];\r\n if(E[i][i]>0) {\r\n center.add(i);\r\n }\r\n }\r\n// int idx[N] = {0};\r\n int idx[] = new int[N];\r\n\r\n\tfor(int i=0; i<N; i++) {\r\n int idxForI = 0;\r\n double maxSim = -1e100;\r\n for(int j=0; j<center.size(); j++) {\r\n int c = center.get(j);\r\n if (S[i][c]>maxSim) {\r\n maxSim = S[i][c];\r\n idxForI = c;\r\n }\r\n }\r\n idx[i] = idxForI;\r\n }\r\n// java.util.HashMap<Integer, String> colorMap = new java.util.HashMap<>();\r\n java.util.HashMap<Integer, Integer> idcMap = new java.util.HashMap<>();\r\n java.util.HashSet<Integer> idSet = new java.util.HashSet<>();\r\n for(int i=0; i<N; i++) {\r\n idcMap.put(i, idx[i]);\r\n idSet.add(idx[i]);\r\n// System.out.println(idx[i]+1);\r\n\t}\r\n java.io.FileWriter out = new java.io.FileWriter(dist);\r\n java.util.HashMap<Integer, String> colorMap = getColorMap(idSet);\r\n for(int i=0; i<N; i++){\r\n double d[] = dataPoint.get(i);\r\n if(idSet.contains(i)){\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(i)+\"\\n\");\r\n }\r\n else{\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i))+\"\\n\");\r\n }\r\n// System.out.println(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i)));\r\n }\r\n out.close();\r\n// System.out.println(colorMap);\r\n /////////////////////////////////////////\r\n }", "public abstract double calculatePerimeter();", "public abstract double calculatePerimeter();", "protected abstract SoyValue compute();", "private static void mapScaler(android.hardware.camera2.impl.CameraMetadataNative r1, android.hardware.camera2.legacy.ParameterUtils.ZoomData r2, android.hardware.Camera.Parameters r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void\");\n }", "public void discretize(double esize, boolean squareCaps, double interpPower) {\n\t\tint nbp = basePoints.length;\n\t\tTreePoint[] rnodes = new TreePoint[nbp];\n\n\t\tfor (int i = 0; i < nbp; i++) {\n\t\t\tTreePoint p = basePoints[i];\n\t\t\trnodes[i] = p.makeCopy();\n\t\t\tif (p.index < 0) {\n\t\t\t\tE.fatalError(\"lost index\");\n\t\t\t}\n\t\t\trnodes[i].setInStructure();\n\t\t\tif (rnodes[i].getSourceIndex() < 0) {\n\t\t\t\tE.error(\"lost source index....\");\n\t\t\t}\n\n\t\t\t/*\n\t\t\tif (rnodes[i].getSourceIndex() == 5) {\n\t\t\t\tE.info(\"processing index 5 \" + nbp);\n\t\t\t\tfor (int k = 0; k < nbp; k++) {\n\t\t\t\t\tE.info(\"others \" + basePoints[k].getSourceIndex() + \" \" + basePoints[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\n\t\t}\n\n\t\tif (basePoints[1].minor) {\n\t\t\tminor = true;\n\t\t\trnodes[0].setRadius(rnodes[1].getRadius());\n\t\t\tif (squareCaps) {\n\t\t\t\t// E.info(\"got minor point, but using square Caps \" + basePoints[1]);\n\n\t\t\t} else {\n\t\t\t //TODO - anything? E.info(\"adjusting minor point for round caps \" + basePoints[1]);\n\t\t\t\tdouble f = rnodes[0].getRadius() / (rnodes[0].distanceTo(rnodes[1]));\n\t\t\t\tif (f < 0.9) {\n\t\t\t\t\trnodes[0].shiftTowards(rnodes[1], f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\tTreePoint sna = rnodes[0];\n\t\tsna.setCumulativeArea(0.);\n\t\tsna.setCumulativeLength(0.);\n\t\tsna.setCumulativeResistance(0.);\n\t\tsna.setCumulativeRecR32(0.);\n\n\n\t\tfor (int i = 1; i < nbp; i++) {\n\t\t\tTreePoint snb = rnodes[i];\n\t\t\tdouble dl = sna.distanceTo(snb);\n\t\t\tsnb.setCumulativeLength(sna.getCumulativeLength() + dl);\n\n\t\t\tdouble ra = sna.getRadius();\n\t\t\tdouble rb = snb.getRadius();\n\t\t\t// POSSERR this is not the area of a fustrum, its just the bit parallel to the axis\n\t\t\t// if dl is zero, there's still an area, though we don't want to include it in the \n\t\t\t// squareCaps case. In effect, this applies squareCaps and neglects the end area\n\t\t\t// when a thin section emerges from the end of a fat one.\n\t\t\tdouble darea = Math.PI * (rb + ra) * dl;\n\t\t\tsnb.setCumulativeArea(sna.getCumulativeArea() + darea);\n\n\t\t\tdouble dres = dl / (Math.PI * ra * rb);\n\t\t\tsnb.setCumulativeResistance(sna.getCumulativeResistance() + dres);\n\n\t\t\tdouble dsrt = powRIntegral(ra, rb, dl, interpPower);\n\n\t\t\tsnb.setCumulativeRecR32(sna.getCumulativeRecR32() + dsrt);\n\t\t\tsna = snb;\n\t\t}\n\n\n\t\tTreePoint snend = rnodes[nbp - 1];\n\t\tdouble tlb = snend.getCumulativeRecR32();\n\n\n\t\t//E.info(\"segment length is \" + snend.getCumulativeLength() + \" rec r32 \" + tlb + \" \" +\n\t\t//\t\tsna.getRadius() + \" \" + snend.getRadius());\n\t\tdouble esizeeff = esize / Math.pow(2., interpPower);\n\t\t// TODO this is so esize 1 with diameter 1 gives expected no of cpts - check....\n\n\t\tint ninner = (int)(tlb / esizeeff);\n\t\tdouble dlf = tlb / (ninner + 1);\n\n\t\tint nwn = ninner + 2;\n\t\tTreePoint[] wknodes = new TreePoint[nwn];\n\n\n\t\tint ipr = 0;\n\t\tfor (int i = 0; i < nwn; i++) {\n\t\t\tdouble fcrr32 = i * dlf;\n\n\t\t\tArrayList<TreePoint> preNodes = new ArrayList<TreePoint>();\n\t\t\twhile (ipr < nbp-2 && fcrr32 > rnodes[ipr+1].getCumulativeRecR32()) {\n\t\t\t\tipr += 1;\n\t\t\t\tpreNodes.add(rnodes[ipr]);\n\n\t\t\t}\n\t\t\tTreePoint sa = rnodes[ipr];\n\t\t\tif (ipr + 1 >= rnodes.length) {\n\t\t\t\tE.error(\"interpolate miscount? \" + fcrr32 + \" \" + rnodes[rnodes.length-1].getCumulativeRecR32());\n\t\t\t}\n\n\t\t\tTreePoint sb = rnodes[ipr+1];\n\n\t\t\tTreePoint newn = interpolateNode(sa, sb, fcrr32, interpPower);\n\n\n\t\t\twknodes[i] = newn;\n\t\t\tnewn.setDiscPre(preNodes);\n\n\t\t\tfor (TreePoint sn : preNodes) {\n\t\t\t\tString sid = sn.getID();\n\t\t\t\tif (sid != null) {\n\t\t\t\t\treapplyLabel(sn, sid, wknodes[i-1], newn);\n\t\t\t\t}\n\t\t\t\tif (sn.hasLabels()) {\n\t\t\t\t\tfor (String s : sn.getLabels()) {\n\t\t\t\t\t\treapplyLabel(sn, s, wknodes[i-1], newn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (minor) {\n\t\t\twknodes[1].setMinor();\n\t\t}\n\n\t\tfor (int i = 1; i < nwn; i++) {\n\t\t\twknodes[i].localizeParentConnection(wknodes[i-1]);\n\t\t}\n\n\t\tTreePoint oldlast = rnodes[nbp-1];\n\t\tTreePoint newlast = wknodes[nwn-1];\n\n\t\tdouble dlast = oldlast.distanceTo(newlast);\n\t\tif (Math.abs(dlast) > 1.e-6) {\n\t\t\tE.error(\"interpolation mess up...\" + dlast);\n\t\t}\n\t\t if (oldlast.getID() != null) {\n\t\t\t newlast.setID(oldlast.getID());\n\t\t }\n\t\t newlast.setInStructure();\n\n\t\t newlast.index = oldlast.index;\n\t\t newlast.pathLength = oldlast.pathLength;\n\n\t\tbaseSegment.setNewPoints(wknodes);\n\t}", "@Override\n\tpublic float somar(float op1, float op2) {\n\t\treturn op1 + op2;\n\t}", "public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }", "@Override\n\tpublic IVector mutiraj(IVector jedinka, Double p) {\n\t\treturn null;\n\t}", "double distanceSq (IPoint p);", "protected abstract void fromSpace( float[] abc );", "private primitives.Color AdaptiveDiffusedAndGlossyRec(Point3D centerP, double WidthAndHeight, double minCubeSize, Point3D pIntersection,Vector Vright,Vector Vup , Vector normal, int direction, int level , double k, double ktr, List<Point3D> prePoints) throws Exception {\r\n List<Point3D> nextCenterPList = new LinkedList<Point3D>();\r\n List<Point3D> cornersList = new LinkedList<Point3D>();\r\n List<primitives.Color> colorList = new LinkedList<primitives.Color>();\r\n Point3D tempCorner;\r\n GeoPoint gp;\r\n Ray tempRay;\r\n for (int i = -1; i <= 1; i += 2)\r\n for (int j = -1; j <= 1; j += 2) {\r\n tempCorner = centerP.add(Vright.scale(i * WidthAndHeight / 2)).add(Vup.scale(j * WidthAndHeight / 2));\r\n cornersList.add(tempCorner);\r\n if (prePoints == null || !isInList(prePoints, tempCorner)) {\r\n tempRay = new Ray(pIntersection, tempCorner.subtract(pIntersection), normal);\r\n if ((normal.dotProduct(tempRay.getDir()) < 0 && direction == 1) || (normal.dotProduct(tempRay.getDir()) > 0 && direction == -1)) {\r\n nextCenterPList.add(centerP.add(Vright.scale(i * WidthAndHeight / 4)).add(Vup.scale(j * WidthAndHeight / 4)));\r\n gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n colorList.add(scene.background);\r\n else {\r\n colorList.add(calcColor(gp, tempRay, level - 1, k));\r\n } \r\n }\r\n \r\n }\r\n }\r\n\r\n if (nextCenterPList == null || nextCenterPList.size() == 0) {\r\n return primitives.Color.BLACK;\r\n }\r\n\r\n\r\n if (WidthAndHeight < minCubeSize * 2) {\r\n primitives.Color sumColor = primitives.Color.BLACK;\r\n for (primitives.Color color : colorList) {\r\n sumColor = sumColor.add(color);\r\n }\r\n return sumColor.reduce(colorList.size());\r\n }\r\n\r\n\r\n boolean isAllEquals = true;\r\n primitives.Color tempColor = colorList.get(0);\r\n for (primitives.Color color : colorList) {\r\n if (!tempColor.isAlmostEquals(color))\r\n isAllEquals = false;\r\n }\r\n if (isAllEquals && colorList.size() > 1)\r\n return tempColor;\r\n\r\n\r\n tempColor = primitives.Color.BLACK;\r\n for (Point3D center : nextCenterPList) {\r\n tempColor = tempColor.add(AdaptiveDiffusedAndGlossyRec(center, WidthAndHeight / 2, minCubeSize, pIntersection, Vright, Vup, normal, direction, level, k, ktr, cornersList));\r\n }\r\n return tempColor.reduce(nextCenterPList.size());\r\n }", "protected IPoint scalePointIntoPixels(IPoint point) {\n\t\t\n\t\tdouble newX = point.getX() * getPixelsPerX();\n\t\tdouble newY = point.getY() * getPixelsPerY();\n\t\treturn new Point(newX, newY, point.getTime());\n\t}", "public void Reduce(float[] inData, float[] outData, MpiOp op, int root) {\n\n if (TREE) {\n tree_reduce(inData, outData, op, root);\n } else {\n naive_reduce(inData, outData, op, root);\n }\n\n REDUCE_TAG--;\n }", "protected void optimize() {\n int[][] cutMemo = new int[dimX + 1][dimY + 1];\n Tuple[][] tupleMemo = new Tuple[dimX + 1][dimY + 1];\n Memo memo = new Memo(cutMemo,tupleMemo);\n\n //array is filled with -1 because -1 is used as a flag in the memo\n fillMemo(0, dimX, 0, dimY, cutMemo);\n\n //Calculates optimal value of cloth\n ArrayList<FittedPattern> answer = computeOptimal(dimX, dimY, pattern, memo, new ArrayList<>(), 0);\n coordinates = answer;\n finalValue = memo.getFittedPatternMemo()[dimX][dimY].getOptimalValue();\n\n }", "private DPoint m2833m() {\r\n IPoint iPoint = new IPoint();\r\n this.f1769m.mo353a(this.f1761e.latitude, this.f1761e.longitude, iPoint);\r\n IPoint iPoint2 = new IPoint();\r\n this.f1769m.mo353a(this.f1762f.latitude, this.f1762f.longitude, iPoint2);\r\n IPoint iPoint3 = new IPoint();\r\n this.f1769m.mo353a(this.f1763g.latitude, this.f1763g.longitude, iPoint3);\r\n double d = (double) iPoint.f3639x;\r\n double d2 = (double) iPoint.f3640y;\r\n double d3 = (double) iPoint2.f3639x;\r\n double d4 = (double) iPoint2.f3640y;\r\n double d5 = (double) iPoint3.f3639x;\r\n double d6 = (double) iPoint3.f3640y;\r\n double d7 = (((d6 - d2) * ((((d4 * d4) - (d2 * d2)) + (d3 * d3)) - (d * d))) + ((d4 - d2) * ((((d2 * d2) - (d6 * d6)) + (d * d)) - (d5 * d5)))) / (((2.0d * (d3 - d)) * (d6 - d2)) - ((2.0d * (d5 - d)) * (d4 - d2)));\r\n double d8 = (((d5 - d) * ((((d3 * d3) - (d * d)) + (d4 * d4)) - (d2 * d2))) + ((d3 - d) * ((((d * d) - (d5 * d5)) + (d2 * d2)) - (d6 * d6)))) / (((2.0d * (d4 - d2)) * (d5 - d)) - ((2.0d * (d6 - d2)) * (d3 - d)));\r\n this.f1773q = Math.sqrt(((d - d7) * (d - d7)) + ((d2 - d8) * (d2 - d8)));\r\n this.f1774r = m2830a(d7, d8, d, d2);\r\n d = m2830a(d7, d8, d3, d4);\r\n this.f1775s = m2830a(d7, d8, d5, d6);\r\n if (this.f1774r < this.f1775s) {\r\n if (d <= this.f1774r || d >= this.f1775s) {\r\n this.f1775s -= 6.283185307179586d;\r\n }\r\n } else if (d <= this.f1775s || d >= this.f1774r) {\r\n this.f1775s += 6.283185307179586d;\r\n }\r\n return new DPoint(d7, d8);\r\n }", "private void computeDirect() {\n\t\t\tif (startY > 0) {\n\t\t\t\toffset = (startY - 1) * width;\n\t\t\t} else {\n\t\t\t\toffset = 0;\n\t\t\t}\n\n\t\t\tendY = endY == height ? endY - 1 : endY;\n\n\t\t\tfor (int y = startY; y <= endY; y++) {\n\t\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\t\tfinal Point3D moveX = xAxis.scalarMultiply(x * horizontal / (width - 1));\n\t\t\t\t\tfinal Point3D moveY = yAxis.scalarMultiply(y * vertical / (height - 1));\n\t\t\t\t\tfinal Point3D screenPoint = screenCorner.add(moveX).sub(moveY);\n\n\t\t\t\t\tfinal Ray ray = Ray.fromPoints(eye, screenPoint);\n\n\t\t\t\t\tRayCasterUtil.tracer(scene, ray, rgb);\n\t\t\t\t\tred[offset] = rgb[0] > 255 ? 255 : rgb[0];\n\t\t\t\t\tgreen[offset] = rgb[1] > 255 ? 255 : rgb[1];\n\t\t\t\t\tblue[offset] = rgb[2] > 255 ? 255 : rgb[2];\n\n\t\t\t\t\toffset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public abstract Point_3 evaluate(double u, double v);", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "public abstract void compute();", "public Result call()\n {\n // create peptide\n Peptide peptide = Rotamer.reconstitute(startingPeptide, rotamersToReconstitute);\n\n // analyze interactions\n List<Interaction> interactions = OPLScalculator.getInteractions(peptide);\n\n // initialize maps that will contain the answers\n Map<Rotamer,Double> rotamerMap = new LinkedHashMap<>();\n\n // analyze all interactions in this peptide\n Double[][] energyMatrix = Interaction.getRotamerEnergyMatrix(peptide, interactions, true);\n\n // get rotamer energies\n for (Rotamer rotamer : rotamers)\n {\n Double singleEnergy = Interaction.getRotamerEnergy(rotamer, energyMatrix); \n //if ( rotamerMap.containsKey(rotamer) && Math.abs(rotamerMap.get(rotamer) - singleEnergy) > 0.01 )\n // System.out.println(\"mismatch\");\n rotamerMap.put(rotamer,singleEnergy);\n }\n\n // get backbone energy\n double thisBackboneEnergy = Interaction.getBackboneEnergy(energyMatrix); \n\n // concurrently update results\n map.putAll(rotamerMap);\n backboneEnergy.compareAndSet(0.0, thisBackboneEnergy);\n\n // return result\n //return new RotamerEnergyResult(rotamerMap, rotamerPairMap, thisBackboneEnergy); \n return null;\n }", "void scalePointProportionally2() {\n\t\tmyParent.fill(255, 0, 0);\n\t\tmyParent.ellipse(point[neighbor(selectedPoint)[2]].position.x, point[neighbor(selectedPoint)[2]].position.y, 30,\n\t\t\t\t30);\n\t\tmyParent.ellipse(point[neighbor(selectedPoint)[1]].position.x, point[neighbor(selectedPoint)[1]].position.y, 20,\n\t\t\t\t20);\n\t\tmyParent.ellipse(point[neighbor(selectedPoint)[0]].position.x, point[neighbor(selectedPoint)[0]].position.y, 10,\n\t\t\t\t10);\n\t\t// offsetP = PVector.sub(P, beginP); // calculate the offset made by P\n\t\tdiagonal.detectX(P); // aka find X\n\t\t// diagonal.offsetX = PVector.sub(diagonal.X, diagonal.beginX); //\n\t\t// calculate the offset made by X\n\t\tdiagonal.end = PVector.add(diagonal.beginEnd, diagonal.offsetX);\n\t\tdiagonalScaleFactor = diagonal.start.dist(diagonal.X) / diagonal.start.dist(diagonal.beginX);\n\t\tpoint[selectedPoint].position.set(diagonal.end);\n\n\t\t// scale neighbors\n\t\tPVector leftNeighbor = new PVector();\n\t\tPVector rightNeighbor = new PVector();\n\t\tPVector opposite = new PVector();\n\t\tleftNeighbor.set(point[neighbor(selectedPoint)[0]].beginPosition);\n\t\trightNeighbor.set(point[neighbor(selectedPoint)[1]].beginPosition);\n\t\topposite.set(point[neighbor(selectedPoint)[2]].beginPosition);\n\n\t\tleftNeighbor.sub(opposite);\n\t\tleftNeighbor.mult(diagonalScaleFactor);\n\t\tleftNeighbor.add(opposite);\n\t\tpoint[neighbor(selectedPoint)[0]].position.set(leftNeighbor);\n\n\t\trightNeighbor.sub(opposite);\n\t\trightNeighbor.mult(diagonalScaleFactor);\n\t\trightNeighbor.add(opposite);\n\t\tpoint[neighbor(selectedPoint)[1]].position.set(rightNeighbor);\n\t}", "public abstract void markForSweep();", "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 centreModel(gb_Vector3 offset){\n\t\tfor(int i = 0; i < point.length; i++)\n\t\t\tpoint[i].sub(offset);\n\t\tmodOffset = new gb_Vector3();\n\t}", "@Override\n\tpublic Pnt2d applyTo(Pnt2d uv) {\n\t\tdouble[] xy = Ai.operate(MathUtil.toHomogeneous(uv.toDoubleArray()));\n\t\t// apply the camera's radial lens distortion in the normalized plane:\n\t\tdouble[] xyd = cam.warp(xy);\n\t\t// apply the (forward) camera mapping to get the undistorted sensor point (u',v'):\n\t\treturn PntDouble.from(cam.mapToSensorPlane(xyd));\n\t}", "protected abstract void useOutput(float output, float setpoint);", "protected IPoint scalePointIntoCoordinates(IPoint point) {\n\t\t\n\t\tdouble newX = point.getX() / getPixelsPerX();\n\t\tdouble newY = point.getY() / getPixelsPerY();\n\t\treturn new Point(newX, newY, point.getTime());\n\t}", "@Override\n public Tuple<Double, DoubleVector> call() throws Exception {\n for (int particleIndex = range.getStart(); particleIndex < range.getEnd(); particleIndex++) {\n DoubleVector currentPosition = particlePositions[particleIndex];\n DoubleVector currentBest = particlePersonalBestPositions[particleIndex];\n DenseDoubleVector vec = new DenseDoubleVector(dim);\n for (int index = 0; index < vec.getDimension(); index++) {\n double value = (phi * currentPosition.get(index)) // inertia\n + (alpha * random.nextDouble() * (currentBest.get(index) - currentPosition\n .get(index))) // personal memory\n + (beta * random.nextDouble() * (globalBestPosition.get(index) - currentPosition\n .get(index))); // group memory\n vec.set(index, value);\n }\n particlePositions[particleIndex] = vec;\n double cost = f.evaluateCost(vec).getCost();\n // check if we have a personal best\n if (cost < particlePersonalBestCost[particleIndex]) {\n particlePersonalBestCost[particleIndex] = cost;\n particlePersonalBestPositions[particleIndex] = vec;\n // if we had a personal best, do we have a better global?\n if (cost < globalCost) {\n globalCost = cost;\n globalBestPosition = vec;\n }\n }\n }\n return new Tuple<>(globalCost, globalBestPosition);\n }", "public int run(Point xS, Point xE)\n throws OptimizerException, Exception\n {\n boolean terminate = false;\n boolean f1eqf2 = false;\n // Vector of points, used for parallel computation\n Point[] x = new Point[2];\n x[0] = new Point(xS.getDimensionContinuous(), xS.getDimensionDiscrete(), xS.getDimensionF());\n x[1] = (Point)x0.clone();\n \n x0 = (Point)xS.clone();\n x3 = (Point)xE.clone();\n \n dx = LinAlg.subtract(x3.getX(), x0.getX());\n double I = 1.; // interval length (in terms of alpha, which is normalized)\n nIntRed = 0; // zero-based step of interval division\n I *= getReductionFactor();\n x[1].setX( LinAlg.add(x0.getX(), LinAlg.multiply(I, dx)) );\n nIntRed++;\n I *= getReductionFactor();\n x[0].setX( LinAlg.add(x0.getX(), LinAlg.multiply(I, dx)) );\n // initial function evaluation\n\n x = getF(x);\n \tx1 = (Point)x[0].clone();\n x2 = (Point)x[1].clone();\n\n do\n {\n nIntRed++;\n I *=getReductionFactor();\n\n if (x2.getF(0) < x1.getF(0))\n { // data management\n fLowBor = x1.getF(0); // we need that for one of the stopping criteria\n x0 = (Point)x1.clone();\n x1 = (Point)x2.clone();\n // new point\n x2.setX( LinAlg.subtract(x3.getX(), LinAlg.multiply(I, dx)) );\n x2 = getF(x2);\n }\n else\n { // data management\n fLowBor = x2.getF(0); // we need that for one of the stopping criteria\n x3 = (Point)x2.clone();\n x2 = (Point)x1.clone();\n // new point\n x1.setX( LinAlg.add(x0.getX(), LinAlg.multiply(I, dx)) );\n x1 = getF(x1);\n }\n\n // check for null space of objective function, unless\n // stoCri is equal to one\n if (stoCri != 1 && x1.getF(0) == x2.getF(0))\n {\n if (f1eqf2) // the last two were also equal, so the\n terminate = true; // current three are equal\n f1eqf2 = true;\n }\n else // reset flag\n f1eqf2 = false;\n } while (iterate() && !terminate);\n\n // tolerance achieved or maximum number of iteration exceeded\n // store minimum value\n if (x1.getF(0) < x2.getF(0))\n {\n xLow = (Point)x0.clone();\n xMin = (Point)x1.clone();\n xUpp = (Point)x2.clone(); \n }\n else\n {\n xLow = (Point)x1.clone();\n xMin = (Point)x2.clone();\n xUpp = (Point)x3.clone(); \n }\n // if we got a null space\n if (terminate) return -2;\n // check whether the maximum number of iteration is exceeded\n if (stoCri == 1)\n if (!isDFltdFMin()) return -1;\n // if search has been successful\n return +1;\n }", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "private void reduce(){\n int min;\n //Subtract min value from rows\n for (int i = 0; i < rows; i++) {\n min = source[i][0];\n for (int j = 1; j < cols; j++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int j = 0; j < cols; j++)\n source[i][j] -= min;\n }\n\n //Subtract min value from cols\n for (int j = 0; j < cols; j++) {\n min = source[0][j];\n for (int i = 1; i < rows; i++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int i = 0; i < rows; i++)\n source[i][j] -= min;\n\n }\n }", "@Override\n public void apply$mcVF$sp (float arg0)\n {\n\n }", "private static double calculateSekante(double left, double right) {\n\n\t\t// if there was only a small change in angle , should be unnecessary\n\t\tif (Math.abs(newangle) < deviationAngle) {\n\t\t\tdistance = (left + right) / 2.0;\n\t\t\t// isLine = false;\n\t\t\treturn distance;\n\t\t}\n\t\t// compute radius\n\n\t\tdouble r = 0.5 * (left + right) / newangle;\n\t\tradius = r;\n\n\t\tInputHandler.stepForward(\"ra.\" + radius);\n\n\t\t// compute distance with the center pos\n\t\tdistance = 2.0 * (r) * Math.sin(newangle / 2.0);\n\n\t\treturn (distance);\n\t}", "protected void func_77041_b(EntityLivingBase par1EntityLiving, float par2)\n/* */ {\n/* 87 */ scaleSpider((EntityTaintSpider)par1EntityLiving, par2);\n/* */ }", "public void smelt() {\n if (this.canSmelt()) {\n ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.items[0]);\n if (this.items[1] == null) {\n this.items[1] = itemstack.copy();\n } else if (this.items[1].getItem() == itemstack.getItem()) {\n this.items[1].stackSize += itemstack.stackSize; // Forge BugFix:\n // Results may\n // have multiple\n // items\n }\n\n --this.items[0].stackSize;\n\n if (this.items[0].stackSize <= 0) {\n this.items[0] = null;\n }\n // TODO: Enable after update\n //energy.extractEnergy(1600, false);\n }\n }", "private static void reduceNoise(Mat image) {\n\n\t\t// create structuring element that will be used to \"dilate\" and \"erode\"\n\t\t// image. the element chosen here is a 3px by 3px rectangle\n\t\tMat erodeElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(1, 1));\n\n\t\t// dilate with larger element so make sure object is nicely visible\n\t\tMat dilateElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(12, 12));\n\n\t\t// Erode will shrink the grouping of pixels\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\n\t\t// // Dilate will expand the grouping of pixels\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\t// Imgproc.dilate(image, image, dilateElement);\n\n\t}", "public Point getPoint(final Point otherPoint)\n\t\t{\n\n\t\t\t//to get the edge point on the shape\n\t\t\tif(shape.equals(\"poly\") || shape.equals(\"ellipse\"))\n\t\t\t\treturn getCentrePoint();\n\n\t\t\tfinal Point cp = getCentrePoint();\n\t\t\tfinal int rise = otherPoint.y-cp.y;\n\t\t\tfinal int run = otherPoint.x-cp.x;\n\n\t\t\tif(shape.equals(\"rect\"))\n\t\t\t{\n\t\t\t\tif(rise == 0)\n\t\t\t\t{\n\t\t\t\t\tif(otherPoint.x >= cp.x)\n\t\t\t\t\t\treturn new Point(coords[0]+coords[2]+4,coords[1]+(coords[3]/2));\n\t\t\t\t\treturn new Point(coords[0]-2,coords[1]+(coords[3]/2));\n\t\t\t\t}\n\t\t\t\telse if(run == 0)\n\t\t\t\t{\n\t\t\t\t\tif(otherPoint.y >= cp.y)\n\t\t\t\t\t\treturn new Point(coords[0]+(coords[2]/2),coords[1]+coords[3]+4);\n\t\t\t\t\treturn new Point(coords[0]+(coords[2]/2),coords[1]-2);\n\t\t\t\t}else\n\t\t\t\t{\n\n\t\t\t\t\tfinal double m = (double)rise / (double)run;\n\t\t\t\t\tfinal double mx = (double)run / (double)rise;\n\n\t\t\t\t\tif(otherPoint.x >= cp.x && otherPoint.y >= cp.y)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]+coords[2]+4,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]+coords[3]+4);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\n\t\t\t\t\t}else if(otherPoint.x < cp.x && otherPoint.y >= cp.y)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(-1*m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]-2,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]+coords[3]+4);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}else if(otherPoint.x < cp.x)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(-1*m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]-2,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(-1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]-2);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int yPoint = (int)(m*(coords[2]/2))+cp.y;\n\t\t\t\t\t\tfinal Point yInter = new Point(coords[0]+coords[2]+4,yPoint);\n\n\t\t\t\t\t\tfinal int xPoint = (int)(-1*mx*(coords[3]/2))+cp.x;\n\t\t\t\t\t\tfinal Point xInter = new Point(xPoint,coords[1]-2);\n\n\t\t\t\t\t\tif(dist(xInter,cp) < dist(yInter,cp))\n\t\t\t\t\t\t\treturn xInter;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn yInter;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}else if(shape.equals(\"circle\"))\n\t\t\t{\n\t\t\t\tif(rise != 0 && run != 0)\n\t\t\t\t{\n\t\t\t\t\tfinal double ratio = (coords[2] / Math.sqrt(rise*rise+run*run));\n\n\t\t\t\t\treturn new Point(cp.x+(int)(run*ratio),cp.y+(int)(rise*ratio));\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tif(rise == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(run > 0)\n\t\t\t\t\t\t\treturn new Point(cp.x+coords[2],cp.y);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn new Point(cp.x-coords[2],cp.y);\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tif(rise > 0)\n\t\t\t\t\t\t\treturn new Point(cp.x,cp.y+coords[2]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn new Point(cp.x,cp.y-coords[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t\t//return cp;\n\t\t}", "public abstract void recalcNormalizationExtrema();" ]
[ "0.6295542", "0.5626382", "0.54034525", "0.5352315", "0.5162585", "0.5056087", "0.5027245", "0.50212187", "0.50188303", "0.5012523", "0.5006624", "0.4992073", "0.49919254", "0.49818024", "0.49510595", "0.49509734", "0.49389496", "0.48895228", "0.48834074", "0.48798546", "0.4872292", "0.48676154", "0.48591545", "0.48288047", "0.48249462", "0.4822065", "0.48031747", "0.47943193", "0.4770236", "0.4768992", "0.47631422", "0.47407228", "0.4735321", "0.47266465", "0.4718826", "0.4708888", "0.47074902", "0.47067615", "0.47067323", "0.47030422", "0.4696745", "0.46876675", "0.46635225", "0.46530253", "0.46474648", "0.46466562", "0.46448782", "0.4619632", "0.4616697", "0.46147048", "0.46139625", "0.46127394", "0.45982084", "0.45793444", "0.45792714", "0.45719418", "0.4571283", "0.4555948", "0.45509213", "0.45456615", "0.4518408", "0.44990054", "0.4490751", "0.4490751", "0.4490017", "0.4479979", "0.44780007", "0.44759622", "0.44716182", "0.44704205", "0.4470416", "0.44699788", "0.44668522", "0.44661504", "0.44630283", "0.44583935", "0.44548333", "0.4432069", "0.4426915", "0.44268396", "0.44261342", "0.4425847", "0.44152027", "0.44132224", "0.4411837", "0.44049037", "0.4403263", "0.44029444", "0.44023493", "0.43985128", "0.43984926", "0.43966925", "0.43957922", "0.4393443", "0.43911496", "0.43902725", "0.4387982", "0.43850276", "0.4381776", "0.4376222" ]
0.7409085
0
/ Test could be removed later.
private void test() { Coordinate[] polyPts = new Coordinate[]{ new Coordinate(-98.50165524249245,45.216163960194365), new Coordinate(-96.07562805826798,39.725652270504796), new Coordinate(-88.95179971518155,39.08088689505274), new Coordinate(-87.96893561066132,44.647653935023214), new Coordinate(-89.72876449996915,41.54448973482366) }; Coordinate[] seg = new Coordinate[2]; Coordinate midPt = new Coordinate(); midPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0; midPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0; seg[0] = polyPts[ 0 ]; seg[1] = midPt; for ( int ii = 0; ii < (polyPts.length - 2); ii++ ) { for ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) { seg[0] = polyPts[ii]; seg[1] = polyPts[jj]; boolean good = polysegIntPoly( seg, polyPts ); String s; if ( good ) { s = "Qualify!"; } else { s = "Not qualify"; } System.out.println( "\npoint " + ii + "\t<Point Lat=\"" + polyPts[ii].y + "\" Lon=\"" + polyPts[ii].x + "\"/>" + "\t=>\t" + "point " + jj+ "\t<Point Lat=\"" + polyPts[jj].y + "\" Lon=\"" + polyPts[jj].x + "\"/>" + "\t" + s ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testRemoveACopy() {\n }", "public void testRemoveOrder() {\n }", "@Test\n void removeItem() {\n }", "@Test\n void removeItem() {\n\n }", "@Test\n public void remove() {\n testList.add(42);\n testList.remove(42);\n assertEquals(0, testList.count());\n }", "@Test\n public void testRemoveFromWaitList() throws Exception {\n }", "@Test\n void removeTask() {\n }", "@Test\n\tpublic void testUndo()\n\t{\n\t}", "@Test\n void testRemoveExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n list.add(t);\n assertTrue(list.remove(t));\n }", "public void removeTestCase(){\n\t\tgetSelectedPanel().removeSelectedTestCase(); \n\t}", "void onTestSuiteRemoved() {\n // not interested in\n }", "public void testGetDelDyn() {\n }", "@Test\n void testRemoveNotExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n assertFalse(list.remove(t));\n }", "public void testRemove() {\n try {\n test1.remove();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n for (int i = 0; i < 10; i++) {\n test1.insert(new Buffer(i, rec));\n }\n Buffer test = test1.remove();\n assertEquals(9, test.getRecord(3).getKey());\n for (int i = 0; i < 9; i++) {\n test1.remove();\n }\n assertTrue(test1.isEmpty());\n }", "public void xxxtestDestroy() throws Exception\n {\n fail(\"Unimplemented test\");\n }", "private void testRemove() {\n System.out.println(\"------ TESTING: remove(int index) -----\");\n try{\n for(int i = 0; i < iSize; i++){\n if(iTestList.remove(0) != i)\n throw new RuntimeException(\"FAILED -> remove not working correctly\");\n }\n\n iTestList.remove(-9);\n iTestList.remove(iSize+10);\n }catch(RuntimeException e){\n System.out.println(e.getMessage());\n }\n }", "@Test\n public void testUndo(){\n //TODO\n }", "protected void tearDown() {\r\n (new File(dest, \"RenameFieldTest.java\")).delete();\r\n (new File(dest, \"UsesFieldTest.java\")).delete();\r\n (new File(dest, \"InheritFieldTest.java\")).delete();\r\n (new File(root + \"\\\\XDateChooser.java\")).delete();\r\n }", "@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}", "@Test\n public void ensureCanRemoveExisitingAllergenUnit() {\n System.out.println(\"Ensure Can remove an Allergen Unit Test\");\n\n Allergen allergen = new Allergen(\"al1\", \"allergen 1\");\n\n profile_unit.addAllergen(allergen);\n\n\n assertTrue(profile_unit.removeAllergen(allergen));\n\n }", "public void testRemove() {\n TaskSeriesCollection c = new TaskSeriesCollection();\n TaskSeries s1 = new TaskSeries(\"S1\");\n c.add(s1);\n c.remove(0);\n c.add(s1);\n boolean pass = false;\n try {\n c.remove(-1);\n } catch (IllegalArgumentException e) {\n pass = true;\n }\n pass = false;\n try {\n c.remove(1);\n } catch (IllegalArgumentException e) {\n pass = true;\n }\n }", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n\tpublic void testDelete(){\n\t}", "@Test\r\n public void testRemoveIdx() {\r\n\r\n TestingTypeList test = new TestingTypeList();\r\n\r\n try {\r\n test.removeTestingTypeAt(0);\r\n fail();\r\n } catch (Exception e) {\r\n assertEquals(0, test.size());\r\n }\r\n\r\n test.addTestingType(\"TestType1\", \"test1\");\r\n test.addTestingType(\"TestType2\", \"test2\");\r\n test.addTestingType(\"TestType3\", \"test3\");\r\n test.addTestingType(\"TestType4\", \"test4\");\r\n test.addTestingType(\"TestType5\", \"test5\");\r\n test.addTestingType(\"TestType6\", \"test6\");\r\n test.addTestingType(\"TestType7\", \"test7\");\r\n\r\n assertEquals(\"TestType4\", test.removeTestingTypeAt(3).getName());\r\n\r\n try {\r\n test.removeTestingTypeAt(6);\r\n fail();\r\n } catch (Exception e) {\r\n assertEquals(6, test.size());\r\n }\r\n\r\n }", "private void assertRemoved()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttestController.getContentTypeDefinitionVOWithId(testDefinition.getId());\n\t\t\tfail(\"The ContentTypeDefinition was not deleted\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{ /* expected */ }\n\t}", "@Test\r\n\tvoid testRemove2() {\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\tString output = test.toString();\r\n\t\tassertNotEquals(\"9 10\", output);\r\n\t}", "@Override\n\tpublic void teardown() {\n\t}", "@Test\n\tpublic void testRemovePregunta(){\n\t\tej1.addPregunta(pre);\n\t\tej1.removePregunta(pre);\n\t\tassertFalse(ej1.getPreguntas().contains(pre));\n\t}", "@Test\n public void testFeedBackDelete(){\n }", "@Override\n\tpublic boolean deleteTestValidation(TestDeValidation test) {\n\t\tthrow new RuntimeException(\"Méthode nom implémentée\");\n\t}", "@Test\n public void removeShiftCatch(){\n Shift dummy = new Shift(4, 1, 1, 1);\n shiftDAO.createShift(dummy);\n\n //test\n assertFalse(shiftDAO.removeShift(5));\n //clean up\n shiftDAO.removeShift(dummy.getShift_id());\n }", "@Test\n public void testRemove() {\n System.out.println(\"remove\");\n\n Piece piece = new Piece(PlayerColor.WHITE, 3);\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.remove(piece);\n\n assertFalse(instance.getBagContent().contains(piece));\n\n }", "private void test() {\n\n\t}", "public static void removeTest(Logger logger, Statement s, int run, int test ) {\n removeTest(logger,s,run,run,test);\n }", "public void testRemove() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n tree.remove(\"apple\");\r\n tree.remove(\"bagel\");\r\n\r\n tree.insert(\"ab\");\r\n tree.remove(\"ab\");\r\n\r\n try {\r\n tree.remove(\"apple\");\r\n }\r\n catch (ItemNotFoundException e) {\r\n assertNotNull(e);\r\n }\r\n }", "@Test\n\tpublic void testRemove() {\n\t\ttry {\n\t\t\tVRDevice v1 = new VRDevice(\"Serial\", \"Name\", 0);\n\t\t\ts1.putOnWaitingList(v1);\n\t\t} catch (BadDeviceInformationException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t\ts1.remove(null, 0);\n\n\t\tassertEquals(\"\", s1.printWaitList(null));\n\t\t\n\t\ttry {\n\t\t\tVRDevice v1 = new VRDevice(\"Serial\", \"Name\", 0);\n\t\t\ts1.putOnWaitingList(v1);\n\t\t} catch (BadDeviceInformationException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\ts1.remove(\"n\", 0);\n\t\tassertEquals(\"\", s1.printWaitList(null));\n\t}", "public void testRemoveObj() {\r\n list.add(\"A\");\r\n list.add(\"B\");\r\n assertTrue(list.remove(\"A\"));\r\n assertEquals( \"B\", list.get(0));\r\n assertEquals( 1, list.size());\r\n list.add(\"C\");\r\n assertTrue(list.remove(\"C\"));\r\n assertEquals(\"B\", list.get(0));\r\n }", "protected void runAfterTest() {}", "@Override\n public void teardown() {\n }", "@AfterTest\n\tpublic void afterTest() {\n\t}", "@Test\r\n\tpublic void testDeleteNote() throws Exception {\r\n\t\tyakshaAssert(currentTest(), \"true\", exceptionTestFile);\r\n\t}", "@Test\n public void removeUserCatch() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n assertFalse(userResource.removeUser(\"notdummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@AfterClass\n\tpublic static void testCleanup() {\n\t}", "@Test(timeout = 4000)\n public void test14() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n fileUtil0.deleteFile(\"\");\n }", "public void testNormalRemoveItem()\r\n throws Exception\r\n {\r\n try\r\n {\r\n SCOMapTests.checkRemove(pmf,\r\n HashMap1.class,\r\n ContainerItem.class);\r\n }\r\n finally\r\n {\r\n clean(HashMap1.class);\r\n clean(ContainerItem.class);\r\n }\r\n }", "@Test\r\n\tvoid testRemove3() {\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(10);\r\n\t\tassertEquals(8, test.list.length);\r\n\t}", "@Test\n public void ensureCannotRemoveNonExisitingAllergenUnit() {\n\n System.out.println(\"Ensure Cannot remove an Allergen Unit Test\");\n\n Allergen allergen = new Allergen(\"al5\", \"allergen 5\");\n\n assertFalse(profile_unit.removeAllergen(allergen));\n\n }", "@Test\r\n public void testRemoveElement() {\r\n System.out.println(\"removeElement\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = false;\r\n boolean result = instance.removeElement(o);\r\n\r\n }", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "@Test(priority = 28)\r\n\tpublic void removalUserLinkCheckAnew() {\r\n\tAssert.assertEquals(mainPage.removalUserLinkCheck(), true);\r\n\t}", "@Test\n public void testRemoveUser_User04() {\n System.out.println(\"removeUser\");\n User user = new User(\"nick10\", \"[email protected]\");\n\n Set<User> expResult = new HashSet<>();\n expResult.add(new User(\"nick0\", \"[email protected]\"));\n expResult.add(new User(\"nick1\", \"[email protected]\"));\n expResult.add(new User(\"nick2\", \"[email protected]\"));\n expResult.add(new User(\"nick3\", \"[email protected]\"));\n expResult.add(new User(\"nick4\", \"[email protected]\"));\n expResult.add(new User(\"nick5\", \"[email protected]\"));\n expResult.add(new User(\"nick6\", \"[email protected]\"));\n expResult.add(new User(\"nick7\", \"[email protected]\"));\n expResult.add(new User(\"nick8\", \"[email protected]\"));\n expResult.add(new User(\"nick9\", \"[email protected]\"));\n\n sn10.removeUser(user);\n Set<User> result = sn10.getUsersList();\n assertEquals(expResult, result);\n }", "@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}", "@Test\n public void abandonFight() {\n }", "private static void deleteTest() throws SailException{\n\n\t\tString dir2 = \"repo-temp\";\n\t\tSail sail2 = new NativeStore(new File(dir2));\n\t\tsail2 = new IndexingSail(sail2, IndexManager.getInstance());\n\t\t\n//\t\tsail.initialize();\n\t\tsail2.initialize();\n\t\t\n//\t\tValueFactory factory = sail2.getValueFactory();\n//\t\tCloseableIteration<? extends Statement, SailException> statements = sail2\n//\t\t\t\t.getConnection().getStatements(null, null, null, false);\n\n\t\tSailConnection connection = sail2.getConnection();\n\n\t\tint cachesize = 1000;\n\t\tint cached = 0;\n\t\tlong count = 0;\n\t\tconnection.removeStatements(null, null, null, null);\n//\t\tconnection.commit();\n\t}", "@Test(expected = IllegalStateException.class)\n public void testRemove_After_Remove() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.remove();\n\n instance.remove();\n\n }", "public void testRemoveAt() {\n if (disableTestsBug347491) {\n System.out.println(getName() + \" disabled due to Bug 347491\");\n return;\n }\n if (disableTestsBug493357) {\n System.out.println(getName() + \" disabled due to Bug 493357\");\n return;\n }\n assertTrue(\"SWT.SetData not received\", setDataCalled);\n TreeViewer treeViewer = (TreeViewer) fViewer;\n // correct what the content provider is answering with\n treeViewer.getTree().update();\n offset = 1;\n treeViewer.remove(treeViewer.getInput(), 3);\n assertEquals(NUM_ROOTS - 1, treeViewer.getTree().getItemCount());\n treeViewer.setSelection(new StructuredSelection(new Object[] { \"R-0\", \"R-1\" }));\n assertEquals(2, ((IStructuredSelection) treeViewer.getSelection()).size());\n processEvents();\n assertTrue(\"expected less than \" + (NUM_ROOTS / 2) + \" but got \" + updateElementCallCount, updateElementCallCount < NUM_ROOTS / 2);\n updateElementCallCount = 0;\n // printCallbacks = true;\n // correct what the content provider is answering with\n offset = 2;\n treeViewer.remove(treeViewer.getInput(), 1);\n assertEquals(NUM_ROOTS - 2, treeViewer.getTree().getItemCount());\n processEvents();\n assertEquals(1, ((IStructuredSelection) treeViewer.getSelection()).size());\n assertEquals(1, updateElementCallCount);\n // printCallbacks = false;\n }", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "public void testReset() {\n\t}", "@Override\n\t\t\t\tpublic void remove() {\n\t\t\t\t\t\n\t\t\t\t}", "public void testSetDelDyn() {\n }", "@Test\n public void testRemove(){\n FunctionalLinkedList newList = new FunctionalLinkedList();\n for(int i = 1; i < 101; i++){\n if(i%2 == 1){\n newList.add(\"Odd\");\n } else {\n newList.add(\"Even\");\n }\n }\n stack = new ImprovedStackImpl(newList);\n \n // Remove one set of elements & check size.\n stack.remove(\"Odd\");\n assertEquals(\"Size of list is incorrect.\", 50, stack.size());\n String even;\n for(int i = 0; i < stack.size(); i++){\n even = (String) stack.pop().getReturnValue();\n assertEquals(\"'Odd' not removed at loop \"+ i +\".\", \"Even\", even);\n }\n }", "@After\n public void tearDown() throws Exception {\n testInstance = null;\n }", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "@Test\r\n public void testAdiciona() {\r\n TipoItemRN rn = new TipoItemRN();\r\n TipoItem tipoitem = new TipoItem();\r\n \r\n if (tipoitem != null){\r\n rn.remover(tipoitem);\r\n }\r\n tipoitem = new TipoItem();\r\n tipoitem.setDescricao(\"TesteAdiciona\");\r\n assertEquals(tipoitem.getDescricao(),\"TesteAdiciona\");\r\n \r\n rn.remover(tipoitem);\r\n \r\n }", "@Test\n public void testRemoveSong() {\n\n Song song1 = new Song(\"1\", \"titre1\", \"artiste1\", \"album1\", \"1\", new LinkedList<String>(), new HashMap<String,Rights>());\n Song song2 = new Song(\"2\", \"titre2\", \"artiste2\", \"album2\", \"2\", new LinkedList<String>(), new HashMap<String,Rights>());\n ArrayList<Song> songs = new ArrayList<>();\n songs.add(song1);\n songs.add(song2);\n SongLibrary library = new SongLibrary(songs);\n \n String songId = \"1\";\n \n library.removeSong(songId);\n \n assertFalse(library.islocal(\"1\"));\n assertTrue(library.islocal(\"2\"));\n \n\n }", "@Test\n public void testDeleteMember() throws Exception {\n }", "@Test\r\n\tvoid testRemove() {\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(10);\r\n\t\tString output = test.toString();\r\n\t\tassertEquals(\"9 7\", output);\r\n\t}", "@Test\r\n\tpublic void testRemoveObject() {\r\n\t\tAssert.assertFalse(list.remove(null));\r\n\t\tAssert.assertTrue(list.remove(new Munitions(2, 3, \"iron\")));\r\n\t\tAssert.assertEquals(14, list.size());\r\n\t}", "@Test\n public void removeSellerTest(){\n }", "@Test\n public void testHandleBtnExcluir() throws Exception {\n }", "@Override\n\tpublic Test deleteTest(BigInteger testId) throws UserException {\n\t\treturn null;\n\t}", "@Test\n public void testRemoveProduct() {\n }", "public void onTestSkipped() {}", "@Test\n public void testRemove(){\n DogHouse testDogHouseRem = new DogHouse();\n Integer expected = 0;\n\n Dog newDog = new Dog(\"Thor\", new Date(), 23);\n testDogHouseRem.add(newDog);\n\n testDogHouseRem.remove(newDog);\n Integer actual = testDogHouseRem.getNumberOfDogs();\n\n Assert.assertEquals(expected, actual);\n }", "@Test\n public void testRemove_Not_Contains() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n\n Integer item = 2;\n boolean expResult = false;\n boolean result = instance.remove(item);\n assertEquals(expResult, result);\n }", "@AfterTest\r\n public void tearDown() {\n }", "@Test\n public void testStaffFactoryRemove() {\n StaffController staffController = staffFactory.getStaffController();\n staffController.removeStaff(STAFF_NAME, 1);\n assertEquals(0, staffController.getStaffList().size());\n }", "@Override\n protected void tearDown() throws Exception {\n m_TestHelper.deleteFileFromTmp(\"regression.arff\");\n\n super.tearDown();\n }", "@Test(priority = 28)\r\n\tpublic void removalUserLinkCheck() {\r\n\tAssert.assertEquals(mainPage.removalUserLinkCheck(), true);\r\n\t}", "@Test\n void deleteList() {\n }", "@Test\n public void test007_test_remove() {\n try {\n HashTableADT test = new HashTable<Integer, String>();\n test.insert(1, \"2\");\n if(test.remove(2) != false) {\n fail(\"remove didn't work correctly on value not present.\");\n }\n test.insert(2, \"3\");\n if (test.remove(2) != true) {\n fail(\"remove didn't work correctly on an added value\");\n }\n } catch (Exception e) {\n fail(\"Exception shouldn't be thrown\");\n }\n }", "@Test\n public void removeTimeListCatch(){\n userDAO.createUser(new User(\"dummy2\", \"dummy2\", 1));\n timeListDAO.createTimeList(new TimeList(\"dummy2\", 1990, 0, 60, 0, 0));\n\n assertFalse(timeListResource.removeTimeList(1990, 0, \"notdummy2\"));\n\n //clean up\n timeListDAO.removeTimeList(1990, 0, \"dummy2\");\n userDAO.removeUser(\"dummy2\");\n }", "@Test\r\n @Ignore\r\n public void testHaveToQuit() {\r\n }", "@Test\n void deleteItem() {\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n fileUtil0.deleteFile(\"8<U\");\n }", "@After\n public void tearDown(){\n choose = null;\n tmp = null;\n }", "@Test\n public void testRemovePropertyChangeListener() {\n // trivial\n }", "@Test\n public void testRemoveSetting() {\n System.out.println(\"removeSetting\");\n Setting s = Setting.factory();\n Setting s1 = Setting.factory();\n Setting s2 = Setting.factory();\n Setting s3 = Setting.getSetting(\"test1\");\n Setting[] settings = {s, s1, s2, s3};\n for (Setting ss : settings) {\n assertFalse(Setting.isNotUsed(ss.getName()));\n }\n Setting.removeSetting(s3);\n for (int i = 0; i < 3; i++) {\n assertFalse(Setting.isNotUsed(settings[i].getName()));\n }\n assertTrue(Setting.isNotUsed(s3.getName()));\n for (Setting ss : settings) {\n Setting.removeSetting(ss);\n }\n for (Setting ss : settings) {\n assertTrue(Setting.isNotUsed(ss.getName()));\n }\n }", "@Test(expected = IllegalStateException.class)\n public void removeOne() {\n this.reset();\n this.bps.remove(6, 2, 6, 6);\n }", "@Test\n public void testRemove()\n {\n example.insert(6);\n example.insert(12);\n example.insert(3);\n example.insert(1);\n example.insert(8);\n example.remove(6);\n String testAns = example.printTree().toString();\n System.out.println(\"List is \" + example.printTree().toString());\n String ans2 = \"[8, 3, 12, 1]\";\n assertEquals(ans2, testAns);\n \n //Testing removing a node that has a child in the tree\n example2.insert(6);\n example2.insert(12);\n example2.insert(3);\n example2.insert(1);\n example2.insert(8);\n example2.remove(12);\n String ans3 = \"[6, 3, 8, 1]\";\n String testAns3 = example2.printTree().toString();\n assertEquals(ans3, testAns3);\n \n \n //Testing remove on a leaf\n example3.insert(6);\n example3.insert(12);\n example3.insert(3);\n example3.insert(1);\n example3.insert(8);\n example3.remove(1);\n String ans4 = \"[6, 3, 12, 8]\";\n String testAns4 = example3.printTree().toString();\n assertEquals(ans4, testAns4);\n \n }", "@Test\n\tpublic void test2() {\n\t\tassertEquals(-1,b.removeNode(500));\n\t\t\n\t\t//Borro una hoja\n\t\tassertEquals(0,b.removeNode(3));\n\t\tassertEquals(\"1:FB=0\\t2:FB=0\\t7:FB=0\\t10:FB=1\\t13:FB=1\\t15:FB=0\\t20:FB=-1\\t23:FB=0\\t30:FB=0\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=-1\\t90:FB=0\\t100:FB=0\\t110:FB=0\\t230:FB=0\\t\",b.inOrder());\n\n\t\t//Borra un elemento con un hijo\n\t\tassertEquals(0,b.removeNode(110));\n\t\tassertEquals(\"1:FB=0\\t2:FB=0\\t7:FB=0\\t10:FB=1\\t13:FB=1\\t15:FB=0\\t20:FB=-1\\t23:FB=0\\t30:FB=0\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=-1\\t90:FB=0\\t100:FB=1\\t230:FB=0\\t\",b.inOrder());\n\t\t//Borra un elemento con dos hijos\n\t\tassertEquals(0,b.removeNode(90));\n\t\tassertEquals(\"1:FB=0\\t2:FB=0\\t7:FB=0\\t10:FB=1\\t13:FB=1\\t15:FB=0\\t20:FB=-1\\t23:FB=0\\t30:FB=0\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=1\\t100:FB=1\\t230:FB=0\\t\",b.inOrder());\t\n\t\t\n\t\t//Borra la raiz (30)\n\t\tassertEquals(0,b.removeNode(30));\n\t\tassertEquals(\"1:FB=0\\t2:FB=0\\t7:FB=0\\t10:FB=0\\t13:FB=0\\t15:FB=0\\t20:FB=0\\t23:FB=1\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=1\\t100:FB=1\\t230:FB=0\\t\",b.inOrder());\n\t\t\n\t\t//Borro 1\\t7\\t13\n\t\tassertEquals(0,b.removeNode(1));\n\t\tassertEquals(0,b.removeNode(7));\n\t\tassertEquals(0,b.removeNode(13));\n\t\tassertEquals(\"2:FB=0\\t10:FB=1\\t15:FB=1\\t20:FB=0\\t23:FB=1\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=1\\t100:FB=1\\t230:FB=0\\t\",b.inOrder());\n\t\t\n\t\t//Borro 20. RSD 2,0\n\t\tassertEquals(0,b.removeNode(20));\n\t\t\n\t\t\n\t\t\n\t\tassertEquals(\"2:FB=0\\t10:FB=0\\t15:FB=0\\t23:FB=1\\t40:FB=0\\t43:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=-1\\t65:FB=0\\t70:FB=1\\t100:FB=1\\t230:FB=0\\t\",b.inOrder());\n\t\t\n\t\t//Borro el 230. RDI -2, 1\n\t\tassertEquals(0,b.removeNode(230));\n\t\tassertEquals(\"2:FB=0\\t10:FB=0\\t15:FB=0\\t23:FB=-1\\t40:FB=0\\t43:FB=0\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=0\\t100:FB=0\\t\",b.inOrder());\n\t\t\n\t\t//Borro 23\n\t\tassertEquals(0,b.removeNode(23));\n\t\tassertEquals(\"2:FB=0\\t10:FB=-1\\t15:FB=-1\\t40:FB=0\\t43:FB=0\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=0\\t100:FB=0\\t\",b.inOrder());\n\t\t\n\t\t//Borro 43 (raiz) y RSI sobre el nodo 15\n\t\tassertEquals(0,b.removeNode(43));\n\t\tassertEquals(\"2:FB=0\\t10:FB=0\\t15:FB=0\\t40:FB=1\\t49:FB=1\\t50:FB=0\\t60:FB=0\\t65:FB=0\\t70:FB=0\\t100:FB=0\\t\",b.inOrder());\n\t\t\n\t}", "@Override\r\n\t\tpublic void remove() {\r\n\t\t\t// YOU DO NOT NEED TO WRITE THIS\r\n\t\t}", "@Override\n\tpublic boolean removeTest(String testId) {\n\t\tOptional<MedicalTest> optional = testDao.findById(testId);\n\t\tif (optional.isPresent()) {\n\t\t\tMedicalTest test = optional.get();\n\t\t\ttestDao.delete(test);\n\t\t\treturn true;\n\t\t}\n\t\tthrow new MedicalTestNotFoundException(\"Test Id not found\");\n\t}" ]
[ "0.7389616", "0.69074035", "0.68849605", "0.6801025", "0.66928935", "0.6644814", "0.662277", "0.6612536", "0.6556189", "0.655424", "0.6529844", "0.6526358", "0.6517384", "0.651662", "0.64513814", "0.6448276", "0.6378294", "0.63454944", "0.6338456", "0.63328135", "0.6302977", "0.6299587", "0.6290839", "0.6263643", "0.6251333", "0.6236547", "0.6236499", "0.62354046", "0.62263614", "0.6207192", "0.6203432", "0.62020093", "0.61954105", "0.6174592", "0.6165474", "0.6164367", "0.615909", "0.6151546", "0.6149085", "0.6137975", "0.6125859", "0.6119365", "0.61175346", "0.61078566", "0.61039627", "0.6094785", "0.60894424", "0.6082257", "0.6081154", "0.6079125", "0.6075831", "0.6075556", "0.60691416", "0.6046975", "0.60396415", "0.60347754", "0.603026", "0.603026", "0.603026", "0.603026", "0.603026", "0.603026", "0.603026", "0.603026", "0.60279596", "0.6018169", "0.6017126", "0.6015944", "0.60142034", "0.60130984", "0.60130984", "0.6012521", "0.600996", "0.60031086", "0.5998619", "0.59984887", "0.59969306", "0.59942526", "0.5991087", "0.59899944", "0.5989646", "0.5989321", "0.5984528", "0.59826094", "0.5982178", "0.5978785", "0.59786683", "0.5975192", "0.59750044", "0.5968595", "0.5967237", "0.59670585", "0.59649795", "0.5964056", "0.5957345", "0.5955375", "0.595491", "0.59525245", "0.5939883", "0.5939512", "0.59310544" ]
0.0
-1
Check if a smear can be formatted into 3 65character lines, if not, pops up a warning.
public static void WarningForOverThreeLines( Gfa smear ) { if ( !smear.isSnapshot() ) { String prefix = getPrefixString( smear ); boolean formattable = canBeFormatted( smear.getPoints(), prefix ); if ( !formattable ) { String message = ""; if ( prefix.equals( Gfa.FROM ) ) { message = new String( "This AIRMET will generate more than 3 FROM lines when formatted."); } else { message = new String( "This OUTLOOK will generate more than 3 FROM lines when formatted."); } MessageDialog confirmDlg = new MessageDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Over 3 FROM Lines", null, message, MessageDialog.WARNING, new String[]{"OK"}, 0 ); confirmDlg.open(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean weAreTooBrokenToWaitUntilWeAreAbleToCarryThisOut() {\n return (isLineWrappingInvalid() || isShowing() == false);\n }", "private void validateLine1304(Errors errors) {\n }", "public static boolean canBeFormatted( Gfa smear ) {\n\t\t\n\t\tboolean formattable = false;\n\t\tif ( !smear.isSnapshot() ) { \n\t\t String prefix = getPrefixString( smear );;\n\t\t formattable = \tcanBeFormatted( smear.getPoints(), prefix );\n\t\t}\n\t\t\n\t return formattable;\n\t \n//\t\treturn ( smear.getLinePoints().length <= 5 ) ? true : false; //test purpose only\n\t\t\n\t}", "@Test\n public void issue9926() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue9926.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());\n FileAnnotation annotation = warnings.iterator().next();\n checkWarning(annotation, 52, \"large integer implicitly truncated to unsigned type\",\n \"src/test_simple_sgs_message.cxx\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n }", "@Test\n public void issue4712() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4712.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 2, warnings.size());\n Iterator<FileAnnotation> iterator = warnings.iterator();\n checkWarning(iterator.next(),\n 352,\n \"&apos;s2.mepSector2::lubrications&apos; may be used\",\n \"main/mep.cpp\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n checkWarning(iterator.next(),\n 1477,\n \"&apos;s2.mepSector2::lubrications&apos; was declared here\",\n \"main/mep.cpp\",\n TYPE, \"GCC note\", Priority.LOW);\n }", "private boolean checkFile(Object[] fileObject) {\n for (Object lineObject : fileObject) {\n if (lineObject.toString().split(\",\").length != 11 || lineObject.toString().contains(\"%\")) {\n System.out.println(\"Check File Error on line: \" + lineObject.toString());\n return false;\n }\n }\n return true;\n }", "private boolean checkDesignCMT() {\n // check null\n if (jTFChungMinhThu.getText().trim().isEmpty()) {\n JOptionPane.showMessageDialog(rootPane, \"Nhập CMT và nhấn Enter để tìm kiếm\\nHoặc nhấn nút \\\"SHOW INFO\\\" để chọn nhân khẩu.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // check dinh dang so chung minh thu\n try {\n long d = Long.parseLong(jTFChungMinhThu.getText());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT không thể chứa các ký tự chữ cái\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // kiem tra do dai cmt\n if (jTFChungMinhThu.getText().length() != 9 && jTFChungMinhThu.getText().length() != 12) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT có 9 hoặc 12 số\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n return true;\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 }", "@Test\n public void issue34141() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue34141.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 0, warnings.size());\n }", "@Test\n public void issue4707() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4707.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 22, warnings.size());\n Iterator<FileAnnotation> iterator = warnings.iterator();\n checkWarning(iterator.next(),\n 1128,\n \"NULL used in arithmetic\",\n \"/Users/rthomson/hudson/jobs/Bryce7-MacWarnings/workspace/bryce7/src/Bryce/Plugins/3DSExport/3DSExport.cpp\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n }", "@Override\n public String checkRule() {\n if (line.matches(\"^\\\\D+$\")) {\n return (\"Complies rule 'Has no numbers' \\n\");\n } else {\n return \"\";\n }\n }", "@Test\n public void issue4260() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4260.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());\n }", "private static boolean checkWords(String line) {\n\t\tint count = 0;\n\t\tScanner reader = new Scanner(line);\n\t\twhile (reader.hasNext()) {\n\t\t\tcount++;\n\t\t\treader.next();\n\t\t}\n\t\treader.close();\n\t\tif (count >= 4) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean formatCheck()\n\t{\n\t\t// The freeList has to be 2 or greater since the first block (index 0)\n\t\t// is the SuperBlock, and the the second block (index 1) contains\n\t\t// information about Inodes.\n\t\tif (totalBlocks != Kernel.NUM_BLOCKS || totalInodes <= 0 || \n\t\t\tfreeList < 2 || freeList >= totalBlocks && \n\t\t\tlastFreeBlock < 2 || lastFreeBlock >= totalBlocks)\n\t\t{\n\t\t\ttotalBlocks = Kernel.NUM_BLOCKS;\n\t\t\tlastFreeBlock = totalBlocks - 1;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean checkLineLength(String matrice){\r\n String[] lignes = matrice.trim().split(\" {1,}\");\r\n int longeur = lignes[0].length();\r\n int i = 1;\r\n boolean memeLongeur = true;\r\n while(i < lignes.length && memeLongeur){\r\n memeLongeur = (longeur == lignes[i].length());\r\n ++i;\r\n }\r\n\r\n if(! memeLongeur){\r\n System.out.println(\"Matrice invalide, lignes de longueurs differentes !\");\r\n }\r\n\r\n return memeLongeur;\r\n }", "@Test\n public void checkUniqueCharacter() {\n int numberOfChars = compressor.getCodes().size();\n assertTrue(numberOfChars == 86 || numberOfChars == 87, \"You appear to have some very strange end-of-line configuration on your machine!\");\n }", "private boolean isDisplayable(int c) {\n return 20 <= c && c <= 126 && c != '\"';\n }", "public static void incorrect3() {\r\n\r\n System.out.println(\" *---*\");\r\n System.out.println(\" | |\");\r\n System.out.println(\" 0 |\");\r\n System.out.println(\" /| | Incorrect - 3\");\r\n System.out.println(\" |\");\r\n System.out.println(\" |\");\r\n System.out.println(\"==========\");\r\n }", "private boolean m29108b(String str) {\n if (str != null) {\n if (str.endsWith(\"\\n\")) {\n str = str.substring(0, str.length() - 1);\n }\n return 24 == str.length() && !this.f22553a.matcher(str).find();\n }\n }", "static boolean isWellFormed(String move) {\n if (move.length() != 4) {\n return false;\n } else {\n boolean mPieces = _PIECES.indexOf(move.substring(0, 1)) != -1;\n boolean mCol = _POSITIONS.indexOf(move.substring(1, 2)) != -1;\n boolean mRow = _POSITIONS.indexOf(move.substring(2, 3)) != -1;\n boolean mOrientations = _ORIENTATIONS.indexOf(move.substring(3, 4)) != -1;\n return mPieces && mCol && mRow && mOrientations;\n }\n }", "public boolean syntaktischRichtig() \n\t{\n\t\tcounters = new int[37];\n\t\tmaxCount = 0;\n\t\tboolean breakIt = false;\n\t\tfor (char[] zeile : level) \n\t\t{\n\t\t\tfor (char elm : zeile) \n\t\t\t{\n\t\t\t\tint cti = charToInt(elm);\n\t\t\t\tif (cti == -1) \n\t\t\t\t{\n\t\t\t\t\tbreakIt = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else \n\t\t\t\t{\n\t\t\t\t\tcounters[cti]++;\n\t\t\t\t\tif (counters[cti] > 4 && elm != '-') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tmaxCount++;\n\t\t\t}\n\t\t\tif (breakIt){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (maxCount <= 144 && maxCount%2==0) \n\t\t{\n\t\t\tfor (int count : counters) \n\t\t\t{\n\t\t\t\tif (!(count % 2 == 0 || count % 4 == 0)) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\r\n\tint check_sweetness() {\n\t\treturn 30;\r\n\t}", "public static void invalidShowRemainingLimitPrinter() {\n System.out.println(line);\n System.out.println(INVALID_FORMAT_MSG);\n System.out.println(SHOW_FORMAT_MSG);\n System.out.println(line);\n }", "private void smell() {\n try {\n this.console.println(MapControl.checkSmell(FireSwamp.getPlayer().getPlayerPosition(),\n FireSwamp.getCurrentGame().getGameMap()));\n } catch (MapControlException ex) {\n Logger.getLogger(GameMenuView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void checkLines() {\n int cont2 = 0;\n int cont3, cont4;\n int casillasVacias;\n int vInicial, vFinal;\n\n for(cont3=20; cont3>0; cont3--) {\n vInicial = cont3*12 + 1;\n vFinal = vInicial + 10;\n casillasVacias = 10;\n\n //Bucle para todas las casillas de una fila\n for(cont4=vInicial; cont4<vFinal; cont4++) {\n if(colMatrix[cont4]) casillasVacias--;\n }\n\n if(casillasVacias == 0) {\n completeLines[cont2] = cont3;\n cont2++;\n }\n }\n removeLines();\n }", "private void checkPaintMeasures() {\r\n\t\t\r\n\t\t//Check from change\r\n\t\tint sizeNow = fontSize;\r\n\t\tif(sizeNow == sizeThen)return;\r\n\t\tsizeThen = sizeNow;\r\n\t\t\r\n\t\t//Set units\r\n\t\tmarkWidth = (double) sizeNow / 15;\r\n\t\tsizePaintLength = p.textLength(text, surface, sizeNow, bold, italic);\r\n\t\tif (viewPaintLength != viewPaintLength) viewPaintLength = sizePaintLength;\r\n\t}", "private boolean handleWhisper(String line){\n if (line.indexOf(\"whispers: \") == -1)\n return false;\n \n Matcher matcher = WHISPER_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String ratingString = matcher.group(3);\n String gameNumberString = matcher.group(4);\n String message = matcher.group(5);\n\n int rating = (ratingString != null) && !ratingString.equals(\"----\") ? Integer.parseInt(ratingString) : -1;\n int gameNumber = Integer.parseInt(gameNumberString);\n\n if (!processWhisper(username, titles, rating, gameNumber, message))\n processLine(line);\n\n return true;\n }", "@Test\n public void issue4700() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4700.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 0, warnings.size());\n }", "@Test\n public void issue4274() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue4274.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 4, warnings.size());\n Iterator<FileAnnotation> iterator = warnings.iterator();\n checkWarning(iterator.next(),\n 638,\n \"local declaration of &quot;command&quot; hides instance variable\",\n \"folder1/file1.m\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n checkWarning(iterator.next(),\n 640,\n \"instance variable &quot;command&quot; accessed in class method\",\n \"folder1/file1.m\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n checkWarning(iterator.next(),\n 47,\n \"&quot;oldGeb&quot; might be used uninitialized in this function\",\n \"file1.m\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n checkWarning(iterator.next(),\n 640,\n \"local declaration of &quot;command&quot; hides instance variable\",\n \"file1.m\",\n TYPE, GCC_WARNING, Priority.NORMAL);\n }", "public boolean qualityIsHigh()\n\t{\n\t\tint counter = 0;\n\t\tfor(int i = 0; i < quality.length(); i++) {\n\t\t\tif(quality.charAt(i) == '!') {\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\treturn counter >= 3;\n\t}", "private static boolean validate(String line){\n\t\tString[] lineArray = line.split(\" \");\n\t\t\n\t\tif(lineArray.length != 3) return false; //skip lines in incorrect format\n\t\t\n\t\t//http://stackoverflow.com/questions/25873636/regex-pattern-for-exactly-hhmmss-time-string\n\t\tif(!lineArray[0].matches(\"(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)\")) return false;\n\n\t\tif(!lineArray[2].equals(\"Start\") && !lineArray[2].equals(\"End\")) return false;\n\t\t\n\t\treturn true;\n\t}", "private static boolean isMalformed3(int b1, int b2, int b3) {\n return (b1 == (byte) 0xe0 && (b2 & 0xe0) == 0x80) || (b2 & 0xc0) != 0x80 || (b3 & 0xc0) != 0x80;\n }", "@Test\r\n public void testParseViolationData() throws IOException {\r\n Collection<FileAnnotation> results = new GendarmeParser().parse(openFile());\r\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 3, results.size());\r\n\r\n Iterator<FileAnnotation> iterator = results.iterator();\r\n\r\n checkWarning(iterator.next(), 0, \"This assembly is not decorated with the [CLSCompliant] attribute.\",\r\n \"\", \"MarkAssemblyWithCLSCompliantRule\", Priority.HIGH);\r\n checkWarning(iterator.next(), 10, \"This method does not use any instance fields, properties or methods and can be made static.\",\r\n \"c:/Dev/src/hudson/Hudson.Domain/Dog.cs\", \"MethodCanBeMadeStaticRule\", Priority.LOW);\r\n checkWarning(iterator.next(), 22, \"This method does not use any instance fields, properties or methods and can be made static.\",\r\n \"c:/Dev/src/hudson/Hudson.Domain/Dog.cs\", \"MethodCanBeMadeStaticRule\", Priority.LOW);\r\n }", "private void check3(){\n \n if (errorCode == 0){\n \n if (firstDigit * fifthDigit * ninthDigit != 24){\n valid = false;\n errorCode = 3;\n }\n }\n\t}", "int getBrokenLines();", "private boolean checkLengthPlateNumber(EditText text, TextInputLayout TFB, String massage) {\n if(text.getText().toString().length() > 10)\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n }", "boolean hasUnknown13();", "boolean isError() {\n if (firstChar == '5' || firstChar == '4') {\n return true;\n }\n\n return false;\n }", "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 }", "static zzco m26829a() {\n return new zzco(\"While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.\");\n }", "private static void testBadChars() throws IOException {\n\t// say what output is expected\n\tSystem.err.println(\"\\nTEST BAD CHARS: BAD CHARS ON LINES 1-5\");\n\n\t// open input file\n\tFileReader inFile = null;\n\ttry {\n\t inFile = new FileReader(\"inBadChars\");\n\t} catch (FileNotFoundException ex) {\n\t System.err.println(\"File inBadChars not found.\");\n\t System.exit(-1);\n\t}\n\n\t// create and call the scanner\n\tYylex scanner = new Yylex(inFile);\n\tSymbol token = scanner.next_token();\n\tif (token.sym != sym.EOF) {\n\t System.err.println(\"ERROR TESTING BAD CHARS: not at EOF\");\n\t}\n }", "private boolean validMessage(String message){\r\n //35 lines of text seems to be the max\r\n //TODO check if its a character limit and not a newline limit in iteration 4\r\n int newLines = 0;\r\n for(int i = 1; i < message.length(); i++)\r\n if(message.substring(i-1, i).equals(\".\")){\r\n newLines++;\r\n }\r\n return newLines <= this.lineBound;\r\n }", "public static void errorCheck(String[] token, String line, Song song, PrintWriter file) {\r\n\t\t\r\n\t\tif(token.length < 7) { //if the length is less than 7, means it doesn't have enough aspect values\r\n\t\t\tfile.println(line +\" Not enough aspect values\");\r\n\t\t\tsong.setSongStatus(false);\r\n\t\t}\r\n\t\t\r\n\t\telse if(token.length == 7) { //if the length is equal to 7, the possible errors are\r\n\t\t\t\t\t\t\t\t\t// that it may have decimal aspect value or an aspect value greater than 10\r\n\t\t\ttry {\r\n\t\t\t\tfor(int i=1; i<token.length; i++) {\r\n\t\t\t\t\tif(Integer.parseInt(token[i])>10) { //if the aspect isn't an integer, it will be \"caught\"\r\n\t\t\t\t\t\tfile.println(line +\" Aspect value isn't in the range of 0-10\"); //writes to error.txt\r\n\t\t\t\t\t\tsong.setSongStatus(false);\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t}\r\n\t\t\tcatch(Exception E1) {\r\n\t\t\t\tfile.println(line +\" One of the aspect value isnt't an integer\"); //writes to error.txt\r\n\t\t\t\tsong.setSongStatus(false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(token.length > 7) { //if the length is more than 7, possible errors are it has more than 6 aspect values or that there \r\n\t\t\t\t\t\t\t\t\t//is a comma in the song ID (since the the tokens are split by comma)\r\n\t\t\ttry {\r\n\t\t\t\tDouble.parseDouble(token[1]); //if there is an error in converting to double, the 2nd token isn't an aspect value and there is a comma in the ID,\r\n\t\t\t\tfile.println(line +\" Too many aspect values\");//writes to error.txt\r\n\t\t\t\tsong.setSongStatus(false);\r\n\t\t\t}\t\r\n\t\t\tcatch(NumberFormatException E2) {\r\n\t\t\t\tfile.println(line +\" Comma in ID\");//writes to error.txt\r\n\t\t\t\tsong.setSongStatus(false);\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}", "public void showBadInputMessage() {\n\t\tJOptionPane.showMessageDialog(frame, \"Vänligen skriv siffror mellan 1 och \" + size);\n\t}", "public void checkText()\n\t{\n\t\ttry\n\t\t{\n\t\t\tqualityNum = Integer.parseInt(quality.getText());\n\t\t\tsidesNum = Integer.parseInt(sides.getText());\n\t\t\tlengthNum = Double.parseDouble(length.getText());\n\t\t\twidthNum = Double.parseDouble(width.getText());\n\t\t\theightNum = Double.parseDouble(height.getText());\n\t\t\tradiusNum = Double.parseDouble(radius.getText());\n\t\t\tradius2Num = Double.parseDouble(radius2.getText());\n\t\t\trollNum = Double.parseDouble(roll.getText());\n\t\t\tpitchNum = Double.parseDouble(pitch.getText());\n\t\t\tyawNum = Double.parseDouble(yaw.getText());\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t}\n\t\t\n\t\tquality.setText(Integer.toString(qualityNum));\n\t\tsides.setText(Integer.toString(sidesNum));\n\t\tlength.setText(Double.toString(lengthNum));\n\t\twidth.setText(Double.toString(widthNum));\n\t\theight.setText(Double.toString(heightNum));\n\t\tradius.setText(Double.toString(radiusNum));\n\t\tradius2.setText(Double.toString(radius2Num));\n\t\troll.setText(Double.toString(rollNum));\n\t\tpitch.setText(Double.toString(pitchNum));\n\t\tyaw.setText(Double.toString(yawNum));\n\t}", "public boolean checkInvalid7(String x) {\n if (x.length() > 3) {\n for (int i = 0; i < x.length() - 2; i++) {\n if (consonants.contains(String.valueOf(x.charAt(i)))\n && (consonants.contains(String.valueOf(x.charAt(i + 1))))\n && consonants.contains(String.valueOf(x.charAt(i + 2)))\n && ((x.charAt(i) != 'n') || x.charAt(i + 1) !=\n 'g' || x.charAt(i + 2) != 'h')) {\n return true;\n }\n }\n }\n return false;\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 }", "@Test\n public void issue17309() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue17309.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());\n FileAnnotation annotation = warnings.iterator().next();\n checkWarning(annotation, 4, \"dereferencing pointer &apos;&lt;anonymous&gt;&apos; does break strict-aliasing rules\",\n \"foo.cc\", TYPE, GCC_ERROR, Priority.HIGH);\n }", "@Test\r\n\tvoid testImportRecordsShouldReturnFalseIfALineHasTooManyWords() throws IOException {\r\n\t\tFile badData = File.createTempFile(\"badData\", \"tmp\");\r\n\t\tFileWriter writer = new FileWriter(badData);\r\n\t\twriter.write(\"This is a sentence and cannot be parsed to a person because it's too long.\");\r\n\t\twriter.flush();\r\n\t\twriter.close();\r\n\t\tbadData.deleteOnExit();\r\n\t\tRecordParser parser = new RecordParser();\r\n\t\ttry {\r\n\t\t\tassertFalse(parser.importRecords(badData));\r\n\t\t} catch (FileNotFoundException fnfe) {\r\n\t\t\tfnfe.printStackTrace();\r\n\t\t}\r\n\t}", "private boolean isLineInformationRepairNeeded(String text) {\n\t\t\tif (text == null)\n\t\t\t\treturn false;\n\n\t\t\tint length= text.length();\n\t\t\tif (length == 0)\n\t\t\t\treturn false;\n\n\t\t\tint rIndex= text.indexOf('\\r');\n\t\t\tint nIndex= text.indexOf('\\n');\n\t\t\tif (rIndex == -1 && nIndex == -1)\n\t\t\t\treturn false;\n\n\t\t\tif (rIndex > 0 && rIndex < length-1 && nIndex > 1 && rIndex < length-2)\n\t\t\t\treturn false;\n\n\t\t\tString defaultLD= null;\n\t\t\ttry {\n\t\t\t\tdefaultLD= getLineDelimiter(0);\n\t\t\t} catch (BadLocationException x) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (defaultLD == null)\n\t\t\t\treturn false;\n\n\t\t\tdefaultLD= getDefaultLineDelimiter();\n\n\t\t\tif (defaultLD.length() == 1) {\n\t\t\t\tif (rIndex != -1 && !\"\\r\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t\tif (nIndex != -1 && !\"\\n\".equals(defaultLD)) //$NON-NLS-1$\n\t\t\t\t\treturn true;\n\t\t\t} else if (defaultLD.length() == 2)\n\t\t\t\treturn rIndex == -1 || nIndex - rIndex != 1;\n\n\t\t\treturn false;\n\t\t}", "private void checkEmptyLine(String line) {\n if (line.substring(5).replace('\\t', ' ')\n .replace('\\n', ' ').trim().length() != 0) {\n throw new IllegalArgumentException(\"Invalid characters after tag.\");\n }\n }", "public boolean checkInvalid4(String x) {\n int temp = x.length();\n for (int i = 0; i < x.length(); i++) {\n if (consonants.contains(String.valueOf(x.charAt(i))))\n temp--;\n }\n return temp > 3;\n }", "@SuppressWarnings(\"unused\")\r\n\tpublic static void checkNumberOfCoffeeDispensers() {\r\n\t\tif (NUMBEROFCOFFEEDISPENSER > 5) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Danger! A person who probably likes 42 has manipulated the interface above its limits.\\n\\nYou can get more rooms for money. ;-)\\n\\nprogram will terminate...\", \"Warning Number Of CoffeeDispensers\",\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE, ICONWARNING);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public boolean isMultiLine() {\n/* 1236 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "protected boolean checkBioScarso() {\n return bioService.count() < BIO_NEEDED_MINUMUM_SIZE;\n }", "private boolean ignoreCardvalidations(ATMSparrowMessage atmSparrowMessage) {\n boolean isLoro = false;\n String message = atmSparrowMessage.getMessageType() + atmSparrowMessage.getTransactionType();\n if (message.equals(\"599\") || message.equals(\"099\") || message.equals(\"899\") || message.equals(\"625\")\n || message.equals(\"626\") || message.equals(\"725\") || message.equals(\"726\")) {\n isLoro = true;\n }\n return isLoro;\n }", "public CheckFunctionHasEnoughComments(Program program) {\n\t\tsuper(program);\n\t}", "private static boolean containsIllegals(String toExamine) {\n Pattern pattern = Pattern.compile(\"[+]\");\n Matcher matcher = pattern.matcher(toExamine);\n return matcher.find();\n }", "public static void wellFormed(){\n System.out.println(\"A well-formed Java program has\");\n System.out.println(\"a main method with { and }\");\n System.out.println(\"braces.\");\n System.out.println(\"\");\n System.out.println(\"A System.out.println statement\");\n System.out.println(\"has ( and ) and usually a\");\n System.out.println(\"String that starts and ends\");\n System.out.println(\"with a \\\" character.\");\n System.out.println(\"(But we type \\\\\\\" instead!)\");\n }", "@Override\n\tpublic boolean hasStyleIssues() {\n\t\treturn sheets.hasErrorsOrWarnings() || getErrorHandler().hasErrors() || getErrorHandler().hasWarnings();\n\t}", "public boolean checkLine(String line) {\n int len = line.length();\n return !(len > 0 && Character.isWhitespace(line.charAt(len-1)));\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 static boolean checkForSyntaxErrors(String line, int lineCounter) {\n boolean good = true;\n if (checkIfNested(line)) {\n if (checkFirstLastTag(line)) {\n System.out.println(\"Error on line \" + lineCounter + \": Error type : Syntax \" + \": Bad nested tags : \" + line.charAt(1) + \" : \" + line.charAt(line.length() - 2));\n good = false;\n }\n if (!checkForInnerTags(line, lineCounter)) {\n System.out.println(\"Error on line \" + lineCounter + \": Error type : Syntax \" + \": Inner tag issue\");\n good = false;\n }\n } else {\n if (brackets(line)) {\n if (line.charAt(1) == '<' || line.charAt(line.length() - 2) == '>') {\n System.out.println(\"Error on line \" + lineCounter + \": Error type : Syntax \" + \": Extra bracket\");\n good = false;\n }\n } else {\n System.out.println(\"Error on line \" + lineCounter + \": Error type : Syntax \" + \": Not closed brackets\");\n good = false;\n }\n }\n return good;\n }", "@Override\n public long resultPart2() throws Exception {\n Scanner sc = inputScanner();\n\n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int a = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int b = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \")); // No +1 means first character is automatically '1'\n \n if(line.length() <= a) continue;\n if(line.charAt(a) == c) {\n if(line.length() <= b || line.charAt(b) != c) valid++;\n }\n else if(line.length() > b && line.charAt(b) == c) valid++;\n }\n\n return valid;\n }", "public void validateRpd13s15()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean checkDescription() {\n int size = description.length();\n return size >= 1 && size <= 256;\n }", "@Test\n public void issue3897and3898() throws IOException {\n Collection<FileAnnotation> warnings = new GccParser().parse(openFile(\"issue3897.txt\"));\n\n assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 3, warnings.size());\n Iterator<FileAnnotation> iterator = warnings.iterator();\n checkWarning(iterator.next(),\n 12,\n \"file.h: No such file or directory\",\n \"/dir1/dir2/file.c\",\n TYPE, GccParser.GCC_ERROR, Priority.HIGH);\n checkWarning(iterator.next(),\n 233,\n \"undefined reference to `MyInterface::getValue() const&apos;\",\n \"/dir1/dir3/file.cpp\",\n TYPE, GccParser.GCC_ERROR, Priority.HIGH);\n checkWarning(iterator.next(),\n 20,\n \"invalid preprocessing directive #incldue\",\n \"/dir1/dir2/file.cpp\",\n TYPE, GccParser.GCC_ERROR, Priority.HIGH);\n }", "public String checkSystem() {\r\n\t\tif(currentSheeps > totalSheeps || currentSheeps < 0) {\r\n\t\t\treturn \"inconsistent!\";\r\n\t\t}\r\n\t\telse if(currentSheeps < totalSheeps) {\r\n\t\t\treturn \"incomplete!\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn \"complete!\";\r\n\t\t}\r\n\t}", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean isSSNFourDigits(String toCheck) {\r\n if (toCheck.length() > 0 && toCheck.length() != 4) {\r\n JOptionPane.showMessageDialog\r\n (null, \"Social Security # Must Have 4 Characters\");\r\n return false;\r\n } else if (toCheck.length() == 0) {\r\n JOptionPane.showMessageDialog\r\n (null, \"No Social Security # entered\");\r\n return false;\r\n } else if (toCheck.length() == 4) {\r\n for (int i = 0; i < 4; i++) {\r\n if (!Character.isDigit(toCheck.charAt(i))) {\r\n JOptionPane.showMessageDialog\r\n (null, \"Social Security # Must Have Only Numbers\");\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "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 }", "boolean hasWarnings();", "public void validateRpd22s3()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "private boolean handleStyle12(String line){\n if (!line.startsWith(\"<12> \"))\n return false;\n\n Style12Struct data = Style12Struct.parseStyle12Line(line);\n\n if (!processStyle12(data))\n processLine(line);\n\n return true;\n }", "private static int partialIsValidUtf8(long r11, int r13) {\n /*\n // Method dump skipped, instructions count: 170\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.protobuf.Utf8.UnsafeProcessor.partialIsValidUtf8(long, int):int\");\n }", "boolean hasIndispensableYn();", "boolean hasIndispensableYn();", "public void validateRpd3s5()\n {\n // <b> and <i> are not allowed.\n String key = \"rpd3s5.invalidMarkup\";\n assertFalse(Type.ERROR, key, containsElement(ELEM_BOLD));\n assertFalse(Type.ERROR, key, containsElement(ELEM_ITALIC));\n }", "public boolean validatePlay(int column, char[][] grid) {\n //Where given column is between 0 - 6\n if (column < 0 || column > grid[0].length) {\n return false;\n }\n\n //Verifying whether given column is full\n if (grid[0][column] != ' ') {\n System.out.println();\n System.out.println(\"Entered column is already full.. Kindly enter the other column\");\n return false;\n }\n\n return true;\n }", "private boolean doesSquareHaveLessThan2SidesMarked(Line line, Square[][] board) {\n Set<Square> attachedSquaresSet = getSquares(board, line);\n Iterator<Square> squareIterator = attachedSquaresSet.iterator();\n while (squareIterator.hasNext()) {\n if (squareIterator.next().openLines().size() <= 2)\n return false;\n }\n return true;\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public static boolean isLegal(int[][] board) {\nif (!isRectangleLegal(board, 0, 2, 0, 2, \"Block 1\")) return false;\nif (!isRectangleLegal(board, 3, 5, 0, 2, \"Block 2\")) return false;\nif (!isRectangleLegal(board, 6, 8, 0, 2, \"Block 3\")) return false;\nif (!isRectangleLegal(board, 0, 2, 3, 5, \"Block 4\")) return false;\nif (!isRectangleLegal(board, 3, 5, 3, 5, \"Block 5\")) return false;\nif (!isRectangleLegal(board, 6, 8, 3, 5, \"Block 6\")) return false;\nif (!isRectangleLegal(board, 0, 2, 6, 8, \"Block 7\")) return false;\nif (!isRectangleLegal(board, 3, 5, 6, 8, \"Block 8\")) return false;\nif (!isRectangleLegal(board, 6, 8, 6, 8, \"Block 9\")) return false;\n \n// check the nine columns\nif (!isRectangleLegal(board, 0, 0, 0, 8, \"Column 0\")) return false;\nif (!isRectangleLegal(board, 1, 1, 0, 8, \"Column 1\")) return false;\nif (!isRectangleLegal(board, 2, 2, 0, 8, \"Column 2\")) return false;\nif (!isRectangleLegal(board, 3, 3, 0, 8, \"Column 3\")) return false;\nif (!isRectangleLegal(board, 4, 4, 0, 8, \"Column 4\")) return false;\nif (!isRectangleLegal(board, 5, 5, 0, 8, \"Column 5\")) return false;\nif (!isRectangleLegal(board, 6, 6, 0, 8, \"Column 6\")) return false;\nif (!isRectangleLegal(board, 7, 7, 0, 8, \"Column 7\")) return false;\nif (!isRectangleLegal(board, 8, 8, 0, 8, \"Column 8\")) return false;\n \n// check the nine rows\nif (!isRectangleLegal(board, 0, 8, 0, 0, \"Row 0\")) return false;\nif (!isRectangleLegal(board, 0, 8, 1, 1, \"Row 1\")) return false;\nif (!isRectangleLegal(board, 0, 8, 2, 2, \"Row 2\")) return false;\nif (!isRectangleLegal(board, 0, 8, 3, 3, \"Row 3\")) return false;\nif (!isRectangleLegal(board, 0, 8, 4, 4, \"Row 4\")) return false;\nif (!isRectangleLegal(board, 0, 8, 5, 5, \"Row 5\")) return false;\nif (!isRectangleLegal(board, 0, 8, 6, 6, \"Row 6\")) return false;\nif (!isRectangleLegal(board, 0, 8, 7, 7, \"Row 7\")) return false;\nif (!isRectangleLegal(board, 0, 8, 8, 8, \"Row 8\")) return false;\nreturn true;\n }", "static boolean isValid (int n) {\n\t\t\tString temp = \"\" + n;\n\t\t\t\n\t\t\tfor(int i = 0; i < (n+\"\").length(); i++) {\n\t\t\t\n\t\t\t\tString c = \"\" + temp.charAt(i);\n\t\t\t\tif(!line.contains(c))\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private void formatWarnings(String unformat){\n //Removes the square bracket from the end of the text\n unformat = unformat.replaceAll(\"[\\\\[\\\\]]\",\"\");\n //Splits the String into cells in a String Array\n String [] formatDesc = unformat.split(\",\");\n\n //Assigns in the individual Strings into the\n //relevant TextViews\n warning1.setText(formatDesc[0]);\n warning2.setText(formatDesc[1]);\n warning3.setText(formatDesc[2]);\n warning4.setText(formatDesc[3]);\n warning5.setText(formatDesc[4]);\n warning6.setText(formatDesc[5]);\n warning7.setText(formatDesc[6]);\n warning8.setText(formatDesc[7]);\n }", "private boolean isChoseFine(){\n if(freeSpaces.size()!=2 & freeSpaces.size()!=3){ //if the number of chosen spaces is not 3 or 2, that means it can't be good.\n return false;\n }\n else if(freeSpaces.size()==2){ //if there are 2.\n if(freeSpaces.elementAt(0).place.distance(freeSpaces.elementAt(1).place)==1)\n return true;\n else //if the distance between the spaces isn't 1, that means it can't be two suite spaces.\n return false;\n }\n else{ //if there are 3.\n //get the all 3 elements.\n int aX = freeSpaces.elementAt(0).place.x;\n int aY = freeSpaces.elementAt(0).place.y;\n int bX = freeSpaces.elementAt(1).place.x;\n int bY = freeSpaces.elementAt(1).place.y;\n int cX = freeSpaces.elementAt(2).place.x;\n int cY = freeSpaces.elementAt(2).place.y;\n if(aX==bX && bX==cX){ //if they are in the same column.\n int min = Math.min(aY, Math.min(bY, cY));\n int max = Math.max(aY, Math.max(bY, cY));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else if(aY==bY && bY==cY){ //if they are in the same row.\n int min = Math.min(aX, Math.min(bX, cX));\n int max = Math.max(aX, Math.max(bX, cX));\n return (max - min == 2); //if the distance between the max and the min is 2, that means they 3 suited.\n }\n else //if they are in different rows and columns, so it isn't good.\n return false;\n }\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 }", "private static boolean isLamAlefChar(char ch) {\n return ch >= '\\uFEF5' && ch <= '\\uFEFC';\n }", "private void bufferCheck() {\r\n bufferScreen.setText(stringBuffer);\r\n bufferLength++;\r\n if (bufferLength == 4) {\r\n if (isCorrectWord()) {\r\n SCORE++;\r\n bufferScreen.setTextColor(Color.GREEN);\r\n } else bufferScreen.setTextColor(Color.RED);\r\n newWord();\r\n }\r\n }", "private void check6(){\n \n if (errorCode == 0){\n \n int firstSecond = Integer.parseInt(number.substring(0,2));\n int seventhEight = Integer.parseInt(number.substring(6,8));\n \n if (firstSecond + seventhEight != 100){\n valid = false;\n errorCode = 6;\n }\n }\n\t}", "private static boolean isAlefMaksouraChar(char ch) {\n return ( (ch == 0xFEEF) || ( ch == 0xFEF0) || (ch == 0x0649));\n }", "protected boolean checkFormat() {\n\t\t// Read the card contents and check that all is ok.\n\t byte[] memory = utils.readMemory();\n\t if (memory == null)\n\t return false;\n\t \n\t // Check the application tag.\n\t for (int i = 1; i < 4; i++)\n\t if (memory[4 * 4 + i] != applicationTag[i])\n\t return false;\n\t \n\t // Check zeros. Ignore page 36 and up because of the safe mode.\n\t for (int i = 5 * 4; i < 36 * 4; i++)\n\t if (memory[i] != 0)\n\t return false;\n\t \n\t // Check that the memory pages 4..39 are not locked.\n\t // Lock 0: Check lock status for pages 4-7\n\t if (memory[2 * 4 + 2] != 0) \n\t return false;\n\t // Lock 1: \n\t if (memory[2 * 4 + 3] != 0)\n\t return false;\n\t // Lock 2:\n\t if (memory[40 * 4] != 0)\n\t \t\treturn false;\n\t // Lock 1:\n\t if (memory[40 * 4 + 1] != 0)\n\t \t\treturn false;\n\t \n\t return true;\n\t}", "public void assertErrorMsgCheck() {\r\n\t\t\tassertEquals(errorMsg.getText().substring(0,52), \"Warning: Please check the form carefully for errors!\");\r\n\t\t\tSystem.out.println(\"Asserted that the msg has been displayed: \"+ errorMsg.getText().substring(0,52));\r\n\t\t}", "public void makeErrors() {\n Random rnd = new Random();\n String charset = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz\";\n for (int i = 0; i < message.length(); i += 3) {\n message.setCharAt(i + rnd.nextInt(3),\n charset.charAt(rnd.nextInt(charset.length())));\n }\n }", "public void _checkVariables(int width, int height) {\r\n\t\tSystem.out.println(\"Hoehe: \" + height);\r\n\t\tSystem.out.println(\"Breite: \" + width);\r\n\t\tchar fruit = Fruit.getSymbol();\r\n\t\tchar wall = Wall.getSymbol();\r\n\t\tchar snake = Snake.getSymbol();\r\n\t\tSystem.out.println(\"fruit: \" + fruit);\r\n\t\tSystem.out.println(\"wall: \" + wall);\r\n\t\tSystem.out.println(\"snake: \" + snake);\r\n\t}", "public boolean isValidMove(String move){\n String[] art = move.split(\" \");\n if(!art[0].equals(\"mark\")){\n return false;\n }\n int x,y;\n try {\n x=Integer.parseInt(art[1]);\n y=Integer.parseInt(art[2]);\n if(0<x && x<17 && y>0 && 17>y){\n if(board.getMark(x-1,y-1) == '-') {\n //pozitie valida si libera\n return true;\n }\n else {\n //pozitie ocupata\n return false;\n }\n }\n }catch (Exception e){\n //cazul in care nu se trimit numere ca parametri\n return false;\n }\n //daca pozitia este invalida\n return false;\n }", "void markWellFormed() {\n knownToBeWellFormed = true;\n }", "boolean judgeValid()\r\n\t{\r\n\t\tif(loc.i>=0 && loc.i<80 && loc.j>=0 && loc.j<80 && des.i>=0 && des.i<80 && des.j>=0 && des.j<80)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public String toStringDeleteriousBedLine(boolean collapse){\n\t\t//scan for deleterious mutations\n\t\tArrayList<Integer> bad = new ArrayList<Integer>();\n\t\tfor (int i=0; i< effects.length; i++){\n\t\t\tif (effects[i].contains(\"Non-synonymous\") || effects[i].contains(\"splice\")){\n\t\t\t\tif (collapse){\n\t\t\t\t\tString test = geneModel.getChrom()+\"_\"+ alleles[i].getStart()+ \"_\"+ alleles[i].getStop() +new String (numberWhiteSpace.matcher(effects[i]).replaceAll(\"\"));\n\t\t\t\t\tif (printedTranscripts.contains(test) == false) {\n\t\t\t\t\t\tbad.add(new Integer(i));\n\t\t\t\t\t\tprintedTranscripts.add(test);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse bad.add(new Integer(i));\n\t\t\t}\n\t\t}\n\t\tif (bad.size()==0) return null;\n\t\t//get chrom\n\t\tString chrom = geneModel.getChrom()+\"\\t\";\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tint[] badAlleles = Num.arrayListOfIntegerToInts(bad);\n\t\tfor (int i=0; i< badAlleles.length; i++){\n\t\t\t\n\t\t\t//add chrom\n\t\t\tsb.append(chrom);\n\t\t\t//watch out for INDELS\n\t\t\tint start = alleles[badAlleles[i]].getStart();\n\t\t\tint stop = alleles[badAlleles[i]].getStop();\n\t\t\tif (start == stop){\n\t\t\t\tstart--;\n\t\t\t\tstop++;\n\t\t\t}\n\t\t\tsb.append(start);\n\t\t\tsb.append(\"\\t\");\n\t\t\tsb.append(stop);\n\t\t\tsb.append(\"\\t\");\n\t\t\tString simple = geneModel.getNames(\"_\") +\"_|_\"+ alleles[badAlleles[i]].getNotes()+\"_|_\"+effects[badAlleles[i]];\n\t\t\tsimple = simple.trim();\n\t\t\tsimple = whiteSpace.matcher(simple).replaceAll(\"_\");\n\t\t\tsb.append(simple);\t\t\t\n\t\t\tsb.append(\"\\t1000\\t\");\n\t\t\tsb.append(geneModel.getStrand());\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}", "public boolean testFillstyles(EIfcfillareastyle type) throws SdaiException;" ]
[ "0.6030822", "0.58537984", "0.5850573", "0.58098584", "0.57473594", "0.55176145", "0.5514774", "0.55096567", "0.550167", "0.5486207", "0.5467394", "0.5453604", "0.5451983", "0.54425627", "0.5421417", "0.5377577", "0.53394216", "0.52858996", "0.5282954", "0.52696896", "0.5236086", "0.5205633", "0.5187915", "0.51860416", "0.517707", "0.5170701", "0.5166415", "0.5156761", "0.51409924", "0.5120891", "0.5111988", "0.5106409", "0.50948906", "0.50857615", "0.5059531", "0.5055424", "0.5042941", "0.5039108", "0.50358826", "0.50352836", "0.50110555", "0.5010195", "0.50064313", "0.5004177", "0.49992415", "0.49932718", "0.49890155", "0.49702317", "0.49643388", "0.49604213", "0.495481", "0.4953702", "0.49476042", "0.49454114", "0.49430853", "0.49386626", "0.49207157", "0.49197575", "0.49194685", "0.49103326", "0.49091122", "0.49084413", "0.49018788", "0.4897162", "0.48933685", "0.4888476", "0.48877338", "0.48812652", "0.4872754", "0.4871908", "0.48677012", "0.4867107", "0.48645395", "0.486202", "0.48573998", "0.48557732", "0.48545521", "0.48545521", "0.48530394", "0.48455882", "0.48321646", "0.48293737", "0.48277283", "0.4824543", "0.48216513", "0.4810154", "0.48060402", "0.48033166", "0.48016843", "0.48016554", "0.4797117", "0.47961268", "0.47960022", "0.47929657", "0.4779455", "0.47780722", "0.47728533", "0.47723487", "0.47717792", "0.47692224" ]
0.7113057
0
Script Settings (Browser definition and behavior
@BeforeTest public void beforeTest() { System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32\\chromedriver.exe"); driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get("https://www.facebook.com/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void configJS() { // Default Joystick else as gamepad\n // jsConfig = chsr.getSelected() == null ? 0 : chsr.getSelected();\n // SmartDashboard.putNumber(\"JS/JS_Config\", jsConfig);\n\n switch (jsConfig) {\n case 0: // Normal 3 joystick config\n norm3JS();\n break;\n\n case 1: // Normal 2 joystick config No CoDrvr\n norm2JS();\n break;\n\n case 2: // Gamepad only\n a_GP();\n break;\n\n default: // Bad assignment\n System.out.println(\"Bad JS choice - \" + jsConfig);\n caseDefault();\n break;\n }\n }", "@SuppressLint(\"SetJavaScriptEnabled\")\n private void configureWebViewSettings() {\n WebSettings settings = getSettings();\n settings.setJavaScriptEnabled(true);\n settings.setAppCacheEnabled(true);\n settings.setDomStorageEnabled(true);\n settings.setBuiltInZoomControls(true);\n settings.setLoadWithOverviewMode(true);\n settings.setUseWideViewPort(true);\n settings.setSupportMultipleWindows(false); // to enable opening links which require opening a new tab\n settings.setLoadsImagesAutomatically(true);\n settings.setBuiltInZoomControls(true);\n }", "public ScriptEditorConfiguration(EditorMode mode) {\n\t\tassistant = new ContentAssistant();\n\t\treconciler = new PresentationReconciler();\n\t\tscriptScanner = new ScriptScanner(mode);\n\t\trepairer = new DefaultDamagerRepairer(scriptScanner);\n\t}", "public static void setBrowser() {\n\t\t browser=\"Chrome\";\n\t }", "public void testSingleBrowserMultiScript() {\n\t\t// Create a SingleBrowserMultiScriptHelper object. A new object should be created for a full set\n\t\t// of openBrowser, executeScript, executeScript, executeScript..., killBrowser calls.\n\t\tSingleBrowserMultiScriptHelper helper = new SingleBrowserMultiScriptHelper(sahiHost, sahiPort, browserType);\n\t\tboolean opened = false;\n\n\t\ttry {\n\t\t\t// Logging default script execution timeout.\n\t\t\tSystem.out.println(helper.getScriptExecutionTimeout());\n\n\t\t\t// Set the script execution timeout to 15 minutes. This applies for each script.\n\t\t\t// Depending on the duration of your scripts, adjust this time accordingly.\n\t\t\thelper.setScriptExecutionTimeout(15*60*1000); // 15 minutes\n\n\t\t\t// Log debug messages\n\t\t\thelper.setLogDebugMessages(true);\n\n\t\t\t// Launch the browser with a start url\n\t\t\topened = helper.launchBrowser(\"http://sahi.co.in/demo/\");\n\n\t\t\tif (!opened) {\n\t\t\t\tSystem.out.println(\"Failed to launch browser correctly. Tests will not proceed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Browser opened\");\n\n\t\t\t// Execute the script\n\t\t\tboolean success = helper.executeScript(userDataScriptsFolder, \"demo/clickCombo.sah\");\n\n\t\t\t// NOTE: If script fails, you may decide whether to move ahead or not depending upon the flow.\n\t\t\tif (!success) {\n\t\t\t\tSystem.out.println(\"Script 1 failed. Tests will not proceed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Script1 success\");\n\n\t\t\t// Randomly doing something between two scripts\n\t\t\tdoSomethingElse();\n\n\t\t\t// Execute the second script\n\t\t\tsuccess = helper.executeScript(userDataScriptsFolder, \"demo/clicksTest.sah\");\n\n\t\t\tif (!success) {\n\t\t\t\tSystem.out.println(\"Script 2 failed. Tests will not proceed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Script2 success\");\n\n\t\t\tdoSomethingElse();\n\n\t\t\t// Execute the third script, by passing in parameters.\n\t\t\tMap<String, String> inputParams = new HashMap<String, String>();\n\t\t\tinputParams.put(\"user\", \"test\");\n\t\t\tinputParams.put(\"password\", \"secret\");\t\t\t\n\t\t\tsuccess = helper.executeScript(userDataScriptsFolder, \"demo/sampleapp_with_params.sah\", inputParams);\n\n\t\t\tif (!success) {\n\t\t\t\tSystem.out.println(\"Script 3 failed. Tests will not proceed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Script3 success\");\n\t\t}\n\t\tfinally {\n\t\t\tif (opened) {\n\t\t\t\t// Kill the browser.\n\t\t\t\thelper.killBrowser();\n\t\t\t}\n\t\t}\t\n\t}", "void setBrowser(String browser);", "protected CommonSettings() {\r\n port = 1099;\r\n objectName = \"library\";\r\n }", "public JpSetting() {\n initComponents();\n fillThongtin();\n }", "public abstract void initialSettings();", "public Script() {\n\n fs = System.getProperty(\"file.separator\");\n ps = System.getProperty(\"path.separator\");\n\n try {\n env = new Environment();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void setScript(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n script_ = value;\n }", "public ExecScriptCallback()\n {\n\tchooserTitle = DragonUI.textSource.getI18NText(TextKeys.SPTFILE,\n\t\t\t\t\t\t \"SCRIPT FILE TO RUN\");\n\t}", "public static void main(String[] args) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t getProperty(\"browser\"); System.out.println(\"The property is \"+ key1 + \"\\n\");\n\t\t\t \n\t\t\tsetProperty(\"version\", \"5\");\n\t\t\tgetProperty(\"version\");\n\t\t\tSystem.out.println(\"The property is \"+ key1 + \"\\n\"); \n\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "void openSettings() {\n\t}", "int wkhtmltoimage_get_global_setting(PointerByReference settings, Pointer name, Pointer value, int vs);", "static Menu settings ()\r\n \t{\r\n \t\tfinal byte width = 45;\r\n \t\tOption ram, rightHanded, dumpState, trackTime, assembly, compression;\r\n \t\tString label [] = {\"Which settings field would you\",\r\n \t\t\"like to modify?\"};\r\n \t\tMenu settings = new Menu (label, \"Change program settings.\", width);\r\n \t\t\r\n \t\t//Initialising options:\r\n \t\tassembly = new Editor (Settings.assembly, \"Assembly Definitions\");\r\n \t\trightHanded = new Toggle (Settings.rightHanded, \"RAM select\", \"Right\", \"Left\"); //True stands for right;\r\n \t\t//False for left.\r\n \t\tdumpState = new Toggle (Settings.dumpState, \"Data Recording\");\r\n \t\ttrackTime = new Toggle (Settings.trackTime, \"Time Tracking\");\r\n \t\tram = new PickNumber (Settings.rAMallowed, \"RAM Allowed\", \"bytes\");\r\n \t\tcompression = new Toggle (Settings.compressNBT, \"Schematic compression\");\r\n \t\t\r\n \t\t//Adding options to setting menu:\r\n \t\tsettings.addOption(assembly);\r\n \t\tsettings.addOption(rightHanded);\r\n \t\tsettings.addOption(dumpState);\r\n \t\tsettings.addOption(trackTime);\r\n \t\tsettings.addOption(ram);\r\n \t\t//Settings menu will display these options in the order they are added here.\r\n \t\t\r\n \t\t//TODO option for program name, target and programming language settings.\r\n \t\t\r\n \t\treturn settings;\r\n \t}", "private void init_settings() {\n\t\tSettings.setDifficulty(Difficulty.NORMAL);\n\t\tSettings.setGravity(BowmanConstants.DEFAULT_GRAVITY);\n\t}", "protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }", "Settings ()\n {\n }", "private AppSettings() {\n /* =============== UI settings =============== */\n brightnessInNightModeOnly = false;\n fullScreen = false;\n showTitle = true;\n pageInTitle = true;\n pageNumberToastPosition = ToastPosition.Bottom;\n zoomToastPosition = ToastPosition.Bottom;\n showAnimIcon = false;\n linkHighlightColor = 0x80FFFF00;\n searchHighlightColor = 0x3F0000FF;\n currentSearchHighlightColor = 0x7F007F00;\n storeGotoHistory = false;\n storeLinkGotoHistory = false;\n storeOutlineGotoHistory = false;\n storeSearchGotoHistory = false;\n\n /* =============== Tap & Scroll settings =============== */\n tapsEnabled = true;\n scrollHeight = Dips.dpToPx(10);\n touchProcessingDelay = 50;\n animateScrolling = true;\n /* =============== Performance settings =============== */\n\n\t\tpagesInMemory = 2;\n decodingThreadPriority = Thread.NORM_PRIORITY; // 7\n drawThreadPriority = Thread.NORM_PRIORITY; // 6\n\n hwaEnabled = false;\n bitmapSize = 9;// 6-64,7-128,8-256,9-512,10-1024\n bitmapFileringEnabled = false;\n textureReuseEnabled = true;\n useBitmapHack = false;\n useEarlyRecycling = false;\n reloadDuringZoom = false;\n heapPreallocate = 0;// 0-256\n pdfStorageSize = 64;// 16-128\n\n /* =============== DjVU Format-specific settings =============== */\n djvuRenderingMode = 0;// 0-color,1-black,2 color only, 3 mask, 4 backgroud, 5 foreground\n }", "public String getSettings();", "public void mode() {\n APIlib.getInstance().addJSLine(jsBase + \".mode();\");\n }", "@Test\n\tpublic void details() throws IOException {\n\t\tSystem.out.println(\"Executing globally by providing details in property file. Not Hardcoding\");\n\t\t// Initially we need to provide where the property file is located\n\t\t// for that we have to invoke the Object of Properties class from java.util package as Below\n\t\tProperties property = new Properties();\n\t\t// now we need to mention where the Property file is Located using FileInputStream.\n\t\tFileInputStream input = new FileInputStream(\n\t\t\t\t\"G:\\\\SeleniumWorkspace_Neon\\\\UdemyProject\\\\projectKeyDetails.properties\");\n\t\t// Here we can provide the path of Property file.\n\t\tproperty.load(input);\n\t\t// We Can do our Stuff\n \n\t\tif(property.getProperty(\"browser\").equals(\"firefox\")){\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"G:\\\\Selenium Drivers\\\\geckodrivers\\\\geckodriver.exe\");\n\t\tdriver = new FirefoxDriver();\n\t\t}else if(property.getProperty(\"browser\").equals(\"chrome\")){\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"G:\\\\Selenium Drivers\\\\ChromeDriver\\\\chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\t}\n\t\telse{\n\t\t\t System.setProperty(\"webdriver.ie.driver\", \"G:\\\\Selenium Drivers\\\\InternetExplorerDrivers\\\\IEDriverServer_Win32_3.6.0\\\\IEDriverServer.exe\");\n\t\tdriver = new InternetExplorerDriver();\n\t\t}\n\t\t//Till Now The Browser and the property file is invoked globally\n\t\t//You can work on any web Applications providing the URL and selenium script details.\n\t\tdriver.get(property.getProperty(\"url\"));\n\t}", "PointerByReference wkhtmltoimage_create_global_settings();", "int wkhtmltoimage_set_global_setting(PointerByReference settings, Pointer name, Pointer value);", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "GuiSettings getGuiSettings();", "void open() throws FileNotFoundException, IOException{\r\n \r\n //Call setup to get global settings and check if this is the first run. \r\n File settings = new File(settingsPath);\r\n if (!settings.isDirectory()){\r\n //then this is the first run...call setup\r\n Setup firstrun = new Setup(this, ax);\r\n }else{\r\n //Get the settings from the file, if the file has dissappeared since\r\n //first setup, recreate.\r\n InputStream in = null;\r\n try {\r\n \r\n File sFile = new File(\"c:\\\\AE\\\\settings\\\\setting.txt\");\r\n if (!sFile.exists()){\r\n System.out.println(\"Creating Settings File with defaults.\");\r\n sFile.createNewFile();\r\n Writer w = new FileWriter(sFile);\r\n w.append(\"Password:password:Homepage:www.google.com:Runs:1\\n\");\r\n w.close();\r\n \r\n }\r\n in = new FileInputStream(\"c:/ae/settings/setting.txt\");\r\n } catch (FileNotFoundException fileNotFoundException) {\r\n System.out.println(\"File Not Found!\");\r\n }\r\n \r\n Scanner scanner = new Scanner(in);\r\n \r\n while (scanner.hasNext()){ \r\n \r\n String[] Settings = scanner.nextLine().split(\":\");\r\n password = Settings[1];\r\n setPassword(password);\r\n \r\n String homepage = Settings[3];\r\n System.out.println(homepage);\r\n setHome(homepage);\r\n \r\n in.close();\r\n \r\n }\r\n }\r\n //Ask for password until the correct password is entered.\r\n \r\n Password pw = new Password();\r\n \r\n do {pw.showDialog();}\r\n while (!(pw.pass.getText() == null ? password == null : pw.pass.getText().equals(password)));\r\n \r\n \r\n //Add the browser into the browser Pane\r\n \r\n \r\n SwingUtilities.invokeLater(new Runnable() {\r\n\r\n @Override\r\n public void run() {\r\n \r\n ax.browserPane.add(\"Browser\", ax.browser.getComponent());\r\n \r\n \r\n }\r\n }); \r\n \r\n ///////////////////////////////////\r\n //Action listeners start here. //\r\n ///////////////////////////////////\r\n \r\n /**\r\n * Get the current page status and display in the statusLabel\r\n */\r\n ax.browser.addStatusListener(new StatusListener() {\r\n \r\n @Override\r\n public void statusChanged(final StatusChangedEvent event) {\r\n \r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.statusLabel.setText(event.getStatusText());\r\n }\r\n });\r\n \r\n }\r\n });\r\n \r\n //Action Listener for homeButton\r\n ax.homeButton.addActionListener(new ActionListener(){\r\n\r\n @Override\r\n public void actionPerformed(ActionEvent ae) {\r\n try {\r\n ax.browser.navigate(getHome());\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n ax.browser.waitReady();\r\n try {\r\n tokenString = (\"<Action Home>::\" + getHome() + delim);\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n \r\n \r\n } });\r\n \r\n //Action Listener Go to a new http web address\r\n ax.goButton.addActionListener(new ActionListener(){\r\n\r\n @Override\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n \r\n ax.browser.navigate( ax.addressBar.getText());\r\n ax.browser.waitReady();\r\n tokenString = (\"<Action Navigate>::\" +ax.browser.getCurrentLocation() + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n \r\n \r\n }});\r\n \r\n\r\n \r\n \r\n //Browser tab and enter listener\r\n \r\n ax.browser.getComponent().addKeyListener(new KeyListener() {\r\n \r\n @Override\r\n public void keyTyped(KeyEvent ke) {\r\n \r\n }\r\n @Override\r\n public void keyPressed(KeyEvent ke) {\r\n }\r\n\r\n @Override\r\n public void keyReleased(KeyEvent ke) {{\r\n if(ke.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER){ \r\n \r\n tokenString = (\"<Action Key>::\" + \"Enter\" + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n } {\r\n if(ke.getKeyCode() == java.awt.event.KeyEvent.VK_TAB){ \r\n \r\n tokenString = (\"<Action Key>::\" + \"Tab\" + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n }\r\n }\r\n \r\n }}\r\n });\r\n\r\n \r\n //Address Bar Enter Key listener, same as above but with Enter Key\r\n ax.addressBar.addKeyListener(new java.awt.event.KeyAdapter() {\r\n \r\n @Override\r\n public void keyPressed(java.awt.event.KeyEvent evt) {\r\n if(evt.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER){ \r\n \r\n ax.browser.navigate( ax.addressBar.getText());\r\n ax.browser.waitReady(); \r\n \r\n tokenString = (\"<Action Navigate>::\" +ax.browser.getCurrentLocation() + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n \r\n }\r\n }});\r\n \r\n //Search Bar Enter Key listener\r\n ax.searchField.addKeyListener(new java.awt.event.KeyAdapter() {\r\n @Override\r\n public void keyPressed(java.awt.event.KeyEvent evt) {\r\n if(evt.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER){\r\n \r\n ax.browser.navigate(\"http://www.google.com/search?q=\" + ax.searchField.getText());\r\n ax.browser.waitReady();\r\n tokenString = (\"<Action Google_Search>::\" +ax.browser.getCurrentLocation() + delim);\r\n \r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n \r\n \r\n }\r\n }});\r\n \r\n //Action Listener Go Back\r\n ax.backButton.addActionListener(new ActionListener(){\r\n\r\n @Override\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n ax.browser.goBack();\r\n ax.browser.waitReady();\r\n tokenString = (\"<Action Back>::\" +ax.browser.getCurrentLocation() + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n });\r\n \r\n \r\n \r\n \r\n \r\n \r\n }});\r\n \r\n //Action go forward\r\n ax.forwardButton.addActionListener(new ActionListener(){\r\n\r\n @Override\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n ax.browser.goForward();\r\n ax.browser.waitReady();\r\n tokenString = (\"<Action Forward>::\" + ax.browser.getCurrentLocation() + delim);\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.consoleTextArea.setText(tokenString);\r\n }\r\n }); \r\n \r\n }});\r\n \r\n /*Now we need to update the address bar when we go to a new page\r\n * \r\n * Change the navigation text, and most importantly, process clicks \r\n */\r\n \r\n ax.browser.addNavigationListener(new NavigationListener() {\r\n @Override\r\n public void navigationStarted(final NavigationEvent event) {\r\n documentElement.removeEventListener(\"click\", clickEventListener, false); \r\n documentElement.removeEventListener(\"change\", changeEventListener, false); \r\n documentElement.removeEventListener(\"focusin\", inEventListener, false); \r\n documentElement.removeEventListener(\"focusout\", outEventListener, false); \r\n \r\n }\r\n\r\n @Override\r\n public void navigationFinished(NavigationFinishedEvent event) {\r\n \r\n \r\n ax.addressBar.setText(event.getUrl());\r\n \r\n //set the webpage title on the tab\r\n //set the title in its own swing thread\r\n String checkTitle =ax.browser.getTitle();\r\n if (checkTitle.length() > 40){\r\n for (int i = 0; i<=checkTitle.length(); ++i){\r\n checkTitle = checkTitle.substring(0, 30);\r\n }\r\n \r\n \r\n }\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n ax.browserPane.setTitleAt(0,ax.browser.getTitle());\r\n }\r\n });\r\n \r\n \r\n \r\n document = ax.browser.getDocument();\r\n documentElement = (DOMElement) document.getDocumentElement();\r\n EventListener init = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n HTMLElement t = (HTMLElement) evt.getTarget();\r\n \r\n \r\n documentElement.addEventListener(\"change\", changeEventListener, captureInput);\r\n \r\n \r\n \r\n \r\n }\r\n };\r\n \r\n documentElement.addEventListener(\"load\",init,false);\r\n \r\n ((EventTarget) documentElement).addEventListener(\"click\", new EventListener() {\r\n public void handleEvent(Event evt) {\r\n HTMLElement t = (HTMLElement) evt.getTarget();\r\n System.out.println(\"Type = \" + t.getNodeName());\r\n \r\n htmlEvent.processThis(ax, t, documentElement);\r\n if (\"textarea\".equals(t.getNodeName().toLowerCase())){\r\n documentElement.addEventListener(\"change\", changeEventListener, captureInput);\r\n }\r\n \r\n }\r\n}, false);\r\n \r\n //Listener for element clicks\r\n \r\n clickEventListener = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n \r\n \r\n org.w3c.dom.events.MouseEvent event = (org.w3c.dom.events.MouseEvent) evt;\r\n \r\n HTMLElement target = (HTMLElement) event.getTarget();\r\n \r\n String tagName = target.getNodeName().toLowerCase();\r\n \r\n if (tagName.equals(\"input\")){\r\n documentElement.addEventListener(\"keyup\", keyEventListener, false);\r\n \r\n }\r\n \r\n else {\r\n htmlEvent.processThis(ax, target, documentElement);\r\n }\r\n \r\n \r\n \r\n }\r\n };\r\n \r\n \r\n //Looks for changes in text. \r\n keyEventListener = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n \r\n org.w3c.dom.events.Event event = (org.w3c.dom.events.Event) evt;\r\n HTMLElement target = (HTMLElement) event.getTarget();\r\n System.out.println(\"target value: \"+ event.getType()); \r\n \r\n htmlEvent.processThis(ax, target, documentElement);\r\n \r\n \r\n }\r\n };\r\n changeEventListener = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n HTMLElement t = (HTMLElement) evt.getTarget();\r\n System.out.println(\"Type = \" + t.getNodeName());\r\n \r\n htmlEvent.processThis(ax, t, documentElement);\r\n \r\n \r\n \r\n }\r\n };\r\n \r\n inEventListener = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n \r\n documentElement.addEventListener(\"click\", clickEventListener, false);\r\n \r\n }\r\n };\r\n\r\n documentElement.addEventListener(\"focusin\", inEventListener, false);\r\n\r\n \r\n \r\n outEventListener = new EventListener() {\r\n\r\n @Override\r\n public void handleEvent(Event evt) {\r\n \r\n //Remove Listeners on focus out.\r\n System.out.println(\"Focused out, removing click and change listeners\");\r\n documentElement.removeEventListener(\"change\", changeEventListener, false);\r\n documentElement.removeEventListener(\"click\", clickEventListener, false);\r\n \r\n }\r\n };\r\n\r\n documentElement.addEventListener(\"focusout\", outEventListener, false);\r\n\r\n\r\n \r\n \r\n }\r\n });\r\n \r\n //Navigate to our home screen and wait for it to be ready.\r\n ax.browser.navigate(getHome());\r\n ax.browser.waitReady();\r\n ax.conscriptPane.setVisible(false);\r\n \r\n //Get the history.\r\n /*\r\n HistoryListModel hlm = new HistoryListModel(ax);\r\n ax.HistoryCombo.setModel(hlm);\r\n */\r\n //Change the tab text to current page\r\n SwingUtilities.invokeLater(new Runnable() {\r\n \r\n @Override\r\n public void run() {\r\n \r\n //Setup the ax.browser tab, html tab and addressbar\r\n ax.browserPane.setTitleAt(0,ax.browser.getTitle());\r\n String stringToken1 = null; \r\n try {\r\n stringToken1 = (\"<Navigate Home>::\" + getHome());\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n ax.consoleTextArea.setText(stringToken1);\r\n //Put the current html address in the addressbar\r\n ax.addressBar.setText(ax.browser.getCurrentLocation());\r\n \r\n }\r\n });\r\n \r\n }", "@BeforeSuite\n\t\n\tpublic void setUp()\n\t{\n\t\t\n\t\tSystem.out.println(\" set system property for chrome\");\n\t}", "public void settings() {\n btSettings().push();\n }", "public SettingsSaver() {\n set[0] = advModeUnlocked;\n set[1] = LIM_NOTESPERLINE;\n set[2] = LIM_96_MEASURES;\n set[3] = LIM_VOLUME_LINE;\n set[4] = LIM_LOWA;\n set[5] = LIM_HIGHD;\n set[6] = LOW_A_ON;\n set[7] = NEG_TEMPO_FUN;\n set[8] = LIM_TEMPO_GAPS;\n set[9] = RESIZE_WIN;\n set[10] = ADV_MODE;\n }", "public void configure() throws IOException {\n\n\n mWebClient = new WebClient(BrowserVersion.getDefault());\n\n // 1 启动JS\n mWebClient.getOptions().setJavaScriptEnabled(true);\n // 2 禁用Css,可避免自动二次请求CSS进行渲染\n mWebClient.setCssErrorHandler(new SilentCssErrorHandler());\n mWebClient.setAjaxController(new NicelyResynchronizingAjaxController());\n mWebClient.getOptions().setCssEnabled(true);\n // 3 启动客户端重定向\n mWebClient.getOptions().setRedirectEnabled(true);\n\n mWebClient.getOptions().setAppletEnabled(false);\n\n mWebClient.getOptions().setPopupBlockerEnabled(true);\n\n // 4 js运行错误时,是否抛出异常\n //mWebClient.getOptions().setThrowExceptionOnScriptError(false);\n // 5 设置超时\n mWebClient.getOptions().setTimeout(20000);\n\n //HtmlPage htmlPage = mWebClient.getPage();\n // 等待JS驱动dom完成获得还原后的网页\n mWebClient.waitForBackgroundJavaScript(50000);\n\n }", "int wkhtmltoimage_set_global_setting(PointerByReference settings, String name, String value);", "public Test11__import_configuration_tests(String browser) {\n\t \n\t System.out.println(\"Browser - \" + browser);\n\t this.usedBrowser = browser;\n }", "@Override\n\tprotected void handleSettings(ClickEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void initSettings() {\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \".\\\\tools\\\\chromedriver.exe\");\n\t\tWebDriver driver=new ChromeDriver();\n\t\t\n\t\t//open baidu site with chrome brower\n\t\tdriver.get(\"https://www.baidu.com\");\n\t\t\n\t\t//Locate setting with chrome browser\n\t\tWebElement setting =driver.findElement(By.xpath(\".//*[@id='ul']/a[8]\"));\n\t\t\n\t\t//move mouse to setting labek\n\t\tActions action =(Actions) new Actions(driver);\n\t\taction.moveToElement(setting).build().perform();\n\t\t\n\t\t//click searchSetting and open it\n\t\tWebElement searchSetting=driver.findElement(By.xpath(\".//*[@id='']\"));\n\t\t\n\t\t\n\t\t\n\t}", "private void settings() {\n mainTitle = makeLabel(\"Settings\", true);\n add(mainTitle);\n add(content);\n add(diffSlider);\n add(colourChooser);\n add(mainB);//button to main menu\n diffSlider.requestFocus();\n }", "public void settings() {\n int widthOfWindow = 900;\n int heightOfWindow = 900;\n\n //Size of the program window\n size(widthOfWindow, heightOfWindow);\n //making the movement smooth, i think, comes from processing\n smooth();\n }", "static void setDefaultProperties() {\n properties.put(\"VERSION\", \"6\");\n\n // Directories and file names\n properties.put(\"SOURCE_DIRECTORY\", \"jspin-examples\");\n properties.put(\"C_COMPILER\", \"clang\");\n properties.put(\"SPIN\", \"/home/victor/Spin/spin\");\n properties.put(\"PAN\", \"pan\");\n properties.put(\"DOT\", \"dot\");\n properties.put(\"HELP_FILE_NAME\", \"txt\" + sep + \"help.txt\");\n properties.put(\"ABOUT_FILE_NAME\", \"txt\" + sep + \"copyright.txt\");\n\n // Options for executing Spin\n properties.put(\"SINGLE_QUOTE\", Boolean.toString(false));\n properties.put(\"COMMON_OPTIONS\", \"-g -l -p -r -s\");\n // Check options changed for version 6 (for now)\n // properties.put(\"CHECK_OPTIONS\", \"-a -v\");\n properties.put(\"CHECK_OPTIONS\", \"-a\");\n properties.put(\"RANDOM_OPTIONS\", \"-X\");\n properties.put(\"INTERACTIVE_OPTIONS\", \"-i -X\");\n properties.put(\"VERIFY_OPTIONS\", \"-a\");\n properties.put(\"C_COMPILER_OPTIONS\", \"-o pan pan.c\");\n properties.put(\"PAN_OPTIONS\", \"-X\");\n properties.put(\"TRAIL_OPTIONS\", \"-t -X\");\n properties.put(\"TRANSLATE_OPTIONS\", \"-f\");\n\n // Settings\n properties.put(\"MAX_STEPS\", \"250\");\n properties.put(\"MAX_DEPTH\", \"2000\");\n properties.put(\"SEED\", \"0\");\n properties.put(\"NEGATE_LTL\", Boolean.toString(true));\n properties.put(\"FAIRNESS\", Boolean.toString(true));\n properties.put(\"VERIFY_MODE\", Safety);\n properties.put(\"RAW\", Boolean.toString(false));\n properties.put(\"PROCESS_WIDTH\", Integer.toString(7));\n properties.put(\"STATEMENT_WIDTH\", Integer.toString(18));\n properties.put(\"VARIABLE_WIDTH\", Integer.toString(10));\n properties.put(\"LINES_PER_TITLE\", Integer.toString(20));\n\n // Size of main frame\n properties.put(\"WIDTH\", Integer.toString(1000));\n properties.put(\"HEIGHT\", Integer.toString(700));\n\n // Select dialog\n properties.put(\"SELECT_BUTTON\", Integer.toString(220));\n properties.put(\"SELECT_HEIGHT\", Integer.toString(70));\n properties.put(\"SELECT_MENU\", Integer.toString(5));\n properties.put(\"UNEXECUTABLE\", Boolean.toString(false));\n\n // Location of dividers in JSplitPanes: Left-right and top-bottom\n properties.put(\"LR_DIVIDER\", Integer.toString(400));\n properties.put(\"TB_DIVIDER\", Integer.toString(500));\n properties.put(\"MIN_DIVIDER\", Integer.toString(50));\n\n // Font\n properties.put(\"FONT_FAMILY\", \"Lucida Sans Typewriter\");\n properties.put(\"FONT_STYLE\", Integer.toString(java.awt.Font.PLAIN));\n properties.put(\"FONT_SIZE\", Integer.toString(14));\n\n // Tab size in editor\n properties.put(\"TAB_SIZE\", Integer.toString(4));\n\n // Display of Spin output\n properties.put(\"WRAP\", Boolean.toString(true));\n properties.put(\"MSC\", Boolean.toString(false));\n properties.put(\"PROCESS_TITLE\", \"Process \");\n properties.put(\"STATEMENT_TITLE\", \"Statement \");\n\n // Delay while waiting for user input\n properties.put(\"POLLING_DELAY\", Integer.toString(200));\n }", "public void baiscSetting(){\n generations_ = 0;\n maxGenerations_ = ((Integer) this.getInputParameter(\"maxGenerations\")).intValue();\n populationSize_ = ((Integer) this.getInputParameter(\"populationSize\")).intValue();\n mutation_ = operators_.get(\"mutation\");\n crossover_ = operators_.get(\"crossover\");\n selection_ = operators_.get(\"selection\");\n learning_ = operators_.get(\"learning\");\n\n }", "private NKE_BrowserWindow() {}", "static private void defineSettings()\n {\n //\n // Define the AK settings (parameters) that will be allowed for setting by the Ds effect.\n // Default values are also set here which will be used to initialize new DsAkSettings objects.\n // Settings other than those defined here will not be able to be set in the Ds effect.\n //\n int paramIndex = 0, elemIndex = 0, nElemPerParam = 0, elemLen = 0;\n\n //\n // Get the AK parameter array's total length.\n //\n for (paramIndex = 0; paramIndex < akParams_.length; ++paramIndex)\n {\n if (isParamSettable(akParams_[paramIndex].paramName))\n elemLen += akParams_[paramIndex].len;\n }\n settingsDefaults_ = new int[elemLen];\n\n //\n // Initialise internal collections.\n //\n for (paramIndex = 0; paramIndex < akParams_.length; ++paramIndex)\n {\n if (isParamSettable(akParams_[paramIndex].paramName))\n {\n nElemPerParam = akParams_[paramIndex].len;\n if (nElemPerParam == 1)\n {\n settingsDefinitions_.put(new SettingDefn(paramIndex, 0), elemIndex);\n settingsDefaults_[elemIndex] = 0;\n ++elemIndex;\n }\n else\n {\n for (int i = 0; i < nElemPerParam; ++i)\n {\n settingsDefinitions_.put(new SettingDefn(paramIndex, i), elemIndex);\n settingsDefaults_[elemIndex] = 0;\n ++elemIndex;\n }\n }\n }\n }\n }", "public SettingPage() {\n\t\tPageFactory.initElements(driver, this);\t\t\n\t}", "@BeforeMethod\r\n\tpublic void Setup()\r\n\t{\n\t\tString strBrowserName=objConfig.getProperty(\"browser\");\r\n\t\tif(strBrowserName.equalsIgnoreCase(\"CHROME\"))\r\n\t\t{\r\n\t\t\tobjDriver=new ChromeDriver();\r\n\t\t}\r\n\t\telse if(strBrowserName.equalsIgnoreCase(\"FIREFOX\"))\r\n\t\t{\r\n\t\t\tobjDriver=new FirefoxDriver();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tobjDriver=new InternetExplorerDriver();\r\n\t\t}\r\n\t\t\r\n\t\t//To open the URL\r\n\t\t\r\n\t\tobjDriver.get(objConfig.getProperty(\"url\"));\r\n\t\t\r\n\t\t//To maximize the browser window.\r\n\t\tif(objConfig.getBooleanProperty(\"runFullScreen\"))\r\n\t\t\tobjDriver.manage().window().maximize();\r\n\r\n\t\t//To set the implicit wait time\r\n\t\tobjDriver.manage().timeouts().implicitlyWait(objConfig.getLongProperty(\"implicitTimeoutInSeconds\"), TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "void getSettings(ControlsSettings settings);", "public void setSettings(final String settings);", "protected static void getSettingsFromFile(){\n\t\t Properties properties = new Properties();\r\n\t\t try {\r\n\t\t\t try {\r\n\t\t\t\t FileInputStream fi = new FileInputStream(MT4jSettings.getInstance().getDefaultSettingsPath() + \"Settings.txt\");\r\n\t\t\t\t properties.load(fi);\t\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\tlogger.debug(\"Couldnt load Settings.txt from the File system. Trying to load it as a resource..\");\r\n\t\t\t\tInputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"Settings.txt\");\r\n\t\t\t\t if (in != null){\r\n\t\t\t\t\t properties.load(in);\t\r\n\t\t\t\t }else{\r\n\t\t\t\t\t logger.debug(\"Couldnt load Settings.txt as a resource. Using defaults.\");\r\n\t\t\t\t\t throw new FileNotFoundException(\"Couldnt load Settings.txt as a resource\");\r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\r\n\t\t\t MT4jSettings.fullscreen = Boolean.parseBoolean(properties.getProperty(\"Fullscreen\", Boolean.valueOf(MT4jSettings.getInstance().isFullscreen()).toString()).trim());\r\n\t\t\t //Use java's fullscreen exclusive mode (real fullscreen) or just use an undecorated window at fullscreen size \r\n\t\t\t MT4jSettings.getInstance().fullscreenExclusive = Boolean.parseBoolean(properties.getProperty(\"FullscreenExclusive\", Boolean.valueOf(MT4jSettings.getInstance().isFullscreenExclusive()).toString()).trim());\r\n\t\t\t //Which display to use for fullscreen\r\n\t\t\t MT4jSettings.getInstance().display = Integer.parseInt(properties.getProperty(\"Display\", String.valueOf(MT4jSettings.getInstance().getDisplay())).trim());\r\n\t\r\n\t\t\t MT4jSettings.getInstance().windowWidth = Integer.parseInt(properties.getProperty(\"DisplayWidth\", String.valueOf(MT4jSettings.getInstance().getWindowWidth())).trim());\r\n\t\t\t MT4jSettings.getInstance().windowHeight = Integer.parseInt(properties.getProperty(\"DisplayHeight\", String.valueOf(MT4jSettings.getInstance().getWindowHeight())).trim());\r\n\t\t\t \r\n\t\t\t //FIXME at fullscreen really use the screen dimension? -> we need to set the native resoultion ourselves!\r\n\t\t\t //so we can have a lower fullscreen resolution than the screen dimensions\r\n\t\t\t if (MT4jSettings.getInstance().isFullscreen() && !MT4jSettings.getInstance().isFullscreenExclusive()){\r\n\t\t\t\t Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\r\n\t\t\t\t MT4jSettings.getInstance().windowWidth = screenSize.width;\r\n\t\t\t\t MT4jSettings.getInstance().windowHeight = screenSize.height;\r\n\t\t\t }\r\n\t\t\t /*\r\n\t\t\t //Comment this to not change the window width to the screen width in fullscreen mode\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 \r\n\t\t\t MT4jSettings.getInstance().maxFrameRate = Integer.parseInt(properties.getProperty(\"MaximumFrameRate\", String.valueOf(MT4jSettings.getInstance().getMaxFrameRate())).trim());\r\n\t\t\t MT4jSettings.getInstance().renderer = Integer.parseInt(properties.getProperty(\"Renderer\", String.valueOf(MT4jSettings.getInstance().getRendererMode())).trim());\r\n\t\t\t MT4jSettings.getInstance().numSamples = Integer.parseInt(properties.getProperty(\"OpenGLAntialiasing\", String.valueOf(MT4jSettings.getInstance().getNumSamples())).trim());\r\n\t\r\n\t\t\t MT4jSettings.getInstance().vSync = Boolean.parseBoolean(properties.getProperty(\"Vertical_sync\", Boolean.valueOf(MT4jSettings.getInstance().isVerticalSynchronization()).toString()).trim());\r\n\t\r\n\t\t\t //Set frametitle\r\n\t\t\t String frameTitle = properties.getProperty(\"Frametitle\", MT4jSettings.getInstance().getFrameTitle().trim());\r\n\t\t\t MT4jSettings.getInstance().frameTitle = frameTitle;\r\n\t\r\n\t\t } catch (Exception e) {\r\n\t\t\t logger.error(\"Error while loading Settings.txt. Using defaults.\");\r\n\t\t }\r\n\t\t settingsLoadedFromFile = true;\r\n\t}", "private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }", "@Override\r\n\tpublic void setWindow(BasePanel windowName) {\n\t\tjavaScriptWindow = (JavaScriptWindow) windowName;\r\n\t\tsetJavaScript(javaScriptWindow.getJavaScript());\r\n\r\n\t}", "public SettingsPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "int wkhtmltoimage_get_global_setting(PointerByReference settings, String name, ByteBuffer value, int vs);", "public static void setup(String browser) throws Exception{\n if(browser.equalsIgnoreCase(\"firefox\")){\n \tFile pathToBinary = new File(\"C:\\\\Program Files (x86)\\\\Mozilla Firefox 41\\\\firefox.exe\");\n \tFirefoxBinary binary = new FirefoxBinary(pathToBinary);\n \tFirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());\n \t\n \t//System.setProperty(\"webdriver.firefox.driver\",\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n \t/*DesiredCapabilities capabilies = DesiredCapabilities.firefox();\t\t\t\n capabilies.getBrowserName();\n capabilies.getVersion();*/\n \t\t\t\n \t//create Firefox instance\t \n //driver = new FirefoxDriver(); \n System.out.println(\"Browser Used: \"+browser);\n }\t \n //Check if parameter passed is 'Chrome'\n // https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html\n // http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.remote.DesiredCapabilities (Singleton)\n else if(browser.equalsIgnoreCase(\"chrome\")){\t \t \n System.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n ChromeOptions opt = new ChromeOptions();\n opt.setBinary(\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n opt.setExperimentalOption(\"Browser\", \"Chrome\");\n opt.getExperimentalOption(\"version\");\n \n// DesiredCapabilities capabilies = DesiredCapabilities.chrome();\n// capabilies.setBrowserName(\"chrome\");\n// capabilies.setPlatform(Platform.WINDOWS);\n// capabilies.setVersion(\"38\");\n// DesiredCapabilities capabilities = new DesiredCapabilities();\n \n //Create Chrome instance\n driver = new ChromeDriver(opt);\t \n }\n \n //Check if parameter passed is 'Safari'\t\n else if(browser.equalsIgnoreCase(\"safari\")){\t \t \n \tSystem.setProperty(\"webdriver.safari.driver\",\"C:/safaridriver.exe\");\n \t\n \t//System.setProperty(\"webdriver.safari.noinstall\", \"true\");\n \tdriver = new SafariDriver();\n \t\n /*\tSafariOptions options = new SafariOptions();\n \tSafariDriver driver = new SafariDriver(options);\n \tDesiredCapabilities capabilities = DesiredCapabilities.safari();\n \tcapabilities.setCapability(SafariOptions.CAPABILITY, options);*/\n }\n \n //Check if parameter passed is 'IE'\t \n else if(browser.equalsIgnoreCase(\"ie\")){\n \t//String IE32 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_32.exe\"; //IE 32 bit\n\t\t\tString IE64 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_64.exe\"; //IE 64 bit\n \tSystem.setProperty(\"webdriver.ie.driver\",IE64);\n \t\n /* \tDesiredCapabilities capabilies = DesiredCapabilities.internetExplorer();\n \tcapabilies.setBrowserName(\"ie\");\n capabilies.getBrowserName();\n capabilies.getPlatform();\n capabilies.getVersion();*/\n \n \t//Create IE instance\n \tdriver = new InternetExplorerDriver();\n }\t \n else{\t \n //If no browser passed throw exception\t \n throw new Exception(\"Browser is not correct\");\t \n }\t \n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\n\t}", "public Settings() {\r\n\t\tthis.settings = new HashMap<String, Object>();\r\n\t\tloadDefaults();\r\n\t}", "public String getScript() { \n\t\treturn null;\n\t}", "public Builder setScript(String script) {\n/* 1583 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private SizeModifierSettingsEditor() {\n\t\tinitComponents();\n\t\tsettings = SizeModifierSettings.getInstance();\n\t\tloadSettings();\n\t\tmainShell.pack();\n\t\tmainShell.setBounds(\n\t\t\tCrunch3.mainWindow.getShell().getBounds().x + Crunch3.mainWindow.getShell().getBounds().width / 2 - mainShell.getBounds().width / 2,\n\t\t\tCrunch3.mainWindow.getShell().getBounds().y + Crunch3.mainWindow.getShell().getBounds().height / 2 - mainShell.getBounds().height / 2,\n\t\t\tmainShell.getBounds().width,\n\t\t\tmainShell.getBounds().height);\n\t\tmainShell.open();\n\t}", "private void settingsParameters(){\n String settings = Settings.System.getString(context.getContentResolver(), this.watchface+\"Settings\");\n if (settings == null || settings.equals(\"\")) {settings = \"{}\";}\n\n // Extract data from JSON\n JSONObject json_settings;\n try {\n json_settings = new JSONObject(settings);\n\n // Circles Widget\n if (json_settings.has(\"battery\")) {this.batteryBool = json_settings.getBoolean(\"battery\");}\n if (json_settings.has(\"steps\")) {this.stepsBool = json_settings.getBoolean(\"steps\");}\n if (json_settings.has(\"todayDistance\")) {this.todayDistanceBool = json_settings.getBoolean(\"todayDistance\");}\n if (json_settings.has(\"totalDistance\")) {this.totalDistanceBool = json_settings.getBoolean(\"totalDistance\");}\n if (json_settings.has(\"batteryCircle\")) {this.batteryCircleBool = json_settings.getBoolean(\"batteryCircle\");}\n if (json_settings.has(\"stepsCircle\")) {this.stepCircleBool = json_settings.getBoolean(\"stepsCircle\");}\n if (json_settings.has(\"todayDistanceCircle\")) {this.todayDistanceCircleBool = json_settings.getBoolean(\"todayDistanceCircle\");}\n if(isCircles()){\n if(batteryBool){\n\n\n }\n\n }\n\n } catch (JSONException e) {\n //Settings.System.putString(getContentResolver(), this.watchface+\"Settings\", \"{}\");//reset wrong settings data\n }\n }", "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "void setConfiguration();", "private Settings() {}", "public static void Javascript() {\n\n\t}", "boolean supportsScripts();", "private void readPreferences() {\n configAutonomousCommand();\n }", "protected JsManifestationFile() {\n\n\t}", "public interface DefaultSettings {\n int SAMPLERATE = 16000;\n int BEAT_LENGTH_IN_MS = 100;\n int BUFFER_SIZE = 4096;\n int MAX_TEMPO_VALUE = 400;\n int MIN_TEMP_VALUE = 1;\n\n int PRESS_TEMPO_CHANGE_TIME_IN_MS = 500;\n}", "private void getSettings(){\n SharedPreferences sp = getSharedPreferences(\"PACERUNNER_SETTINGS\", Activity.MODE_PRIVATE);\n AMOUNT_OF_SECONDS_WHEN_TRIGGERING_NOTIFICATION = sp.getInt(\"NOTIFICATION_SENSITIVITY\", -15);\n REQUIRED_METERS_BEFORE_SHOWING_AVGPACE = sp.getInt(\"NOTIFICATION_METERS_BEFORE_START\", 500);\n }", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "void setGuiSettings(GuiSettings guiSettings);", "private void settings() {\n\n\t\tthis.addWindowListener(controller);\n\t\tthis.setVisible(true);\n\t\tthis.setSize(1000, 660);\n\t\tthis.validate();\n\t\tthis.repaint();\n\n\t}", "@DISPID(23)\n\t// = 0x17. The runtime will prefer the VTID if present\n\t@VTID(34)\n\t@ReturnValue(type = NativeType.Dispatch)\n\tcom4j.Com4jObject executionSettings();", "private Settings() {\n prefs = NbPreferences.forModule( Settings.class );\n }", "public SettingsController(){\n SharedPreferences prefs = MainActivity.context.getSharedPreferences(MY_PREFERENCES, MODE_PRIVATE);\n backgroundMusicOn = prefs.getBoolean(MUSIC_PREFERENCES, true);\n soundEffectsOn= prefs.getBoolean(SOUND_EFFECTS_PREFERENCES, true);\n deckSkin=prefs.getString(DECK_SKIN_PREFERENCES, \"back1\");\n animationSpeed=prefs.getInt(ANIMATION_SPEED_PREFERENCES,ANIMATION_MEDIUM);\n }", "public static void main(String[] args) {\n\t\t System.setProperty(\"webdriver.chrome.driver\", \"D:/workspace/chromedriver\");\r\n\t\t //System.setProperty(\"webdriver.chrome.driver\", ...);\r\n\t\t \r\n\t\t System.setProperty(\"selenide.browser\", \"Chrome\");\r\n\t\t Configuration.browser=\"chrome\";\r\n\t\t open(\"http://google.com\");\r\n\t\t //$(By.id(\"registerLink\")).pressEnter();\r\n\t\t }", "public String getScript() {\n return script;\n }", "Settings getSettings();", "private void setPrefs( File build_file ) {\n if ( _settings != null )\n _settings.load( build_file );\n else\n _settings = new OptionSettings( build_file );\n _prefs = _settings.getPrefs();\n }", "@BeforeClass\n\t\tpublic static void setup() {\n\t\t\t// Get the browser to use in testing\n\t\t\tSystem.setProperty(\"testBrowser\", \"chrome\");\n\t\t\t\n\t\t\t// Get the browser to use in testing\n\t\t\tString browserToUse = System.getProperty(\"testBrowser\");\n\t\t\t\n\t\t\t// Open the specified browser\n\t\t\topenBrowser(browserToUse);\n\t\t}", "@Test\n public void testSetScriptDriver_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 ScriptDriver driver = ScriptDriver.SilkPerformer;\n\n fixture.setScriptDriver(driver);\n\n }", "private void setupSettingWindow()\n {\n setGUI.setWindowListener(new WindowListener() {\n @Override\n public void windowOpened(WindowEvent we) {\n }\n\n @Override\n public void windowClosing(WindowEvent we) {\n }\n\n @Override\n public void windowClosed(WindowEvent we) {\n player1Color = setGUI.getPlayer1Color();\n player2Color = setGUI.getPlayer2Color();\n }\n\n @Override\n public void windowIconified(WindowEvent we) {\n }\n\n @Override\n public void windowDeiconified(WindowEvent we) {\n }\n\n @Override\n public void windowActivated(WindowEvent we) {\n }\n\n @Override\n public void windowDeactivated(WindowEvent we) {\n }\n });\n }", "private void setLocalWebdriver() {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setJavascriptEnabled(true);\n capabilities.setCapability(\"handlesAlerts\", true);\n switch (getBrowserId(browser)) {\n case 0:\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n driver.set(new InternetExplorerDriver(capabilities));\n break;\n case 1:\n driver.set(new FirefoxDriver(capabilities));\n break;\n case 2:\n driver.set(new SafariDriver(capabilities));\n break;\n case 3:\n driver.set(new ChromeDriver(capabilities));\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n }", "public SettingsWindow()\n {\n House.seed = System.currentTimeMillis();\n initWindow();\n showWindows();\n }", "public interface GameSettings {\n\n\tint getThirdPersonSetting();\n\n\tboolean getBobbing();\n\n\tvoid setBobbing(boolean bobbing);\n\n\tboolean isKeyDown(GameKeybind keybind);\n\n\tboolean isKeyPressed(GameKeybind keybind);\n\n\tvoid setKeyState(GameKeybind keybind, boolean state);\n\n\tint getKeyCode(String name);\n\n\tfloat getGamma();\n\n\tvoid setGamma(float gamma);\n}", "public void testOptions() {\n OptionsOperator optionsOper = OptionsOperator.invoke();\n optionsOper.selectEditor();\n optionsOper.selectFontAndColors();\n optionsOper.selectKeymap();\n optionsOper.selectGeneral();\n // \"Manual Proxy Setting\"\n String hTTPProxyLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Use_HTTP_Proxy\");\n new JRadioButtonOperator(optionsOper, hTTPProxyLabel).push();\n // \"HTTP Proxy:\"\n String proxyHostLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Host\");\n JLabelOperator jloHost = new JLabelOperator(optionsOper, proxyHostLabel);\n new JTextFieldOperator((JTextField) jloHost.getLabelFor()).setText(\"www-proxy.uk.oracle.com\"); // NOI18N\n // \"Port:\"\n String proxyPortLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Port\");\n JLabelOperator jloPort = new JLabelOperator(optionsOper, proxyPortLabel);\n new JTextFieldOperator((JTextField) jloPort.getLabelFor()).setText(\"80\"); // NOI18N\n optionsOper.ok();\n }", "public void loadDefaultSettings(){\r\n try{\r\n File propFile;\r\n String curLine;\r\n CodeSource codeSource = EMSimulationSettingsView.class.getProtectionDomain().getCodeSource();\r\n File jarFile = new File(codeSource.getLocation().toURI().getPath());\r\n File jarDir = jarFile.getParentFile();\r\n \r\n propFile = new File(jarDir, \"default_EMSettings.txt\");\r\n FileReader fr = new FileReader(propFile);//reads in the pdb\r\n BufferedReader br = new BufferedReader(fr);\r\n while ((curLine = br.readLine()) != null) {\r\n String[] setting = curLine.split(\"[\\t]+\");//split by whitespace into an array to read\r\n if(setting[0].toString().compareTo(\"Minim Method\")==0){\r\n jComboBox1.setSelectedIndex(Integer.parseInt(setting[1]));\r\n }\r\n\t\t\t \r\n if(setting[0].compareTo(\"Step Size\")==0){\r\n if(setting[1].compareTo(\"0.0\")!=0&&setting[1].compareTo(\"0\")!=0)jTextField1.setText(setting[1]);\r\n }\r\n \r\n if(setting[0].compareTo(\"Numsteps\")==0){\r\n jTextField2.setText(setting[1]);\r\n }\r\n \r\n if(setting[0].compareTo(\"Convergence\")==0){\r\n jTextField3.setText(setting[1]);\r\n }\r\n\t\t\t \r\n\t\tif(setting[0].compareTo(\"Interval\")==0){\r\n jTextField4.setText(setting[1]);\r\n }\r\n }\r\n this.setVisible(true);\r\n br.close();\r\n fr.close();\r\n }\r\n catch (Exception e){\r\n System.err.println(\"Error: \" + e.getMessage());\r\n }\r\n }", "private static void initialiseBrowser() {\n\t\tif (System.getProperty(\"proxyname\") != null) {\n\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setPreference(\"network.proxy.type\", 1);\n\t\t\tprofile.setPreference(\"network.proxy.http\", System.getProperty(\"proxyname\"));\n\t\t\tprofile.setPreference(\"network.proxy.http_port\", 3128);\n\n\t\t\tdriver = new FirefoxDriver(profile);\n\t\t\tsetDriver(driver);\n\t\t}\n\t\telse{\n\t\t\tdriver = new FirefoxDriver();\n\t\t\tsetDriver(driver);\n\t\t}\n\t}", "private EscidocConfiguration() throws SystemException {\r\n System.setProperty(\"java.awt.headless\", \"true\");\r\n this.properties = loadProperties();\r\n }", "private Settings() { }", "@BeforeClass\n public void BeforeTest(){\n Configuration.browser = \"Chrome\";\n\n }", "@BeforeTest\n public void setup() {\n\n String browser = Environment.getProperties().browser().toString().toLowerCase();\n\n switch (browser) {\n \n case \"firefox\":\n FirefoxOptions options = new FirefoxOptions(); \n if(Environment.getProperties().headless()){\n options.addArguments(\"--headless\");\n }\n driver = new FirefoxDriver();\n break;\n \n default:\n ChromeOptions optionsChrome = new ChromeOptions();\n if(Environment.getProperties().headless()){\n optionsChrome.addArguments(\"--headless\");\n } \n driver = new ChromeDriver(optionsChrome);\n break;\n } \n\n driver.manage().window().maximize();\n }" ]
[ "0.5911377", "0.5879003", "0.5782814", "0.5708359", "0.56964475", "0.5642966", "0.5630488", "0.55884343", "0.5560596", "0.55480266", "0.55250967", "0.55056673", "0.5499582", "0.5441063", "0.54339516", "0.5433305", "0.54280925", "0.54184085", "0.54146516", "0.5413434", "0.54126847", "0.5398984", "0.5384505", "0.53807336", "0.5375992", "0.53596276", "0.53496504", "0.53496504", "0.53496504", "0.53496504", "0.53496504", "0.53496504", "0.53496504", "0.53479314", "0.5341748", "0.534126", "0.53369135", "0.53298277", "0.5326679", "0.5321252", "0.53017014", "0.5286759", "0.5276447", "0.5274483", "0.5265349", "0.5260099", "0.523427", "0.52229077", "0.52186966", "0.51904637", "0.51895356", "0.51693475", "0.5168742", "0.51680446", "0.5162369", "0.51467794", "0.5146516", "0.51462346", "0.5141911", "0.5141346", "0.51398885", "0.5137465", "0.5135454", "0.5134369", "0.51281935", "0.5121973", "0.51144886", "0.511284", "0.5109011", "0.51050156", "0.5093166", "0.5093084", "0.50909704", "0.5090014", "0.5090014", "0.5090014", "0.5090014", "0.5090014", "0.5090014", "0.5090014", "0.50897074", "0.50839514", "0.5079516", "0.5074548", "0.50646687", "0.50574875", "0.50538987", "0.5050121", "0.504539", "0.5045356", "0.504278", "0.5039767", "0.5029435", "0.5023826", "0.5013402", "0.500844", "0.50071067", "0.4996907", "0.49931246", "0.4992403", "0.49896672" ]
0.0
-1
Creates new form ChangeUserPassword
public ChangeUserPassword(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendPasswordToUser(UserForm userForm) {\n }", "void updateUserPassword(User user);", "public void registerNewPassword(View view) {\r\n\t\t// Get the user's current password\r\n\t\tString currentPassword = currentPasswordInput.getText().toString();\r\n\r\n\t\t// Get the new, permanent password the user wants\r\n\t\tString newPassword = newPasswordInput.getText().toString();\r\n\t\t\r\n\t\t// Get the confirmation of the new, permanent password (should be the same as the previous field)\r\n\t\tString confirmNewPassword = confirmNewPasswordInput.getText().toString();\r\n\r\n\t\t/* Pass all three to the ResetPassword class, which will check validity, and, if valid,\r\n\t\t * reset the permanent password */\r\n\t\tResetPassword resetPassword = new ResetPassword(this);\r\n\t\tresetPassword.checkInputsAndTryToResetPassword(currentPassword, newPassword, confirmNewPassword);\r\n\t}", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "private void changePassword(){\n\t\tif (changeCancelButton.getText().equals(\"Anuluj\")){\n\t\t\thidePassword();\n\t\t\tchangeCancelButton.setText(\"Zmień hasło\");\n\t\t\tchangePassword = false;\n\t\t}\t\n\t\telse {\n\t\t\tif (usersTable.getSelectionModel().getSelectedIndex() > -1) {\n\t\t\t\tchangePassword = true;\n\t\t\t\tchangeCancelButton.setText(\"Anuluj\");\n\t\t\t\tuserPasswordField.setText(\"\");\n\t\t\t\tuserConfirmPasswordField.setText(\"\");\n\t\t\t\tlackUserPasswordLabel.setVisible(false);\n\t\t\t\tlackUserConfirmPasswordLabel.setVisible(false);\t\t\t\t\n\t\t\t\tshowPassword();\n\t\t\t}\n\t\t}\n\t}", "@GetMapping(\"/login/{id}/changePassword\")\n public String showChangePasswordForm(@PathVariable(name = \"id\") Long id, Model model){\n User user = userService.getUser(id);\n model.addAttribute(\"tempUser\", new TempUser());\n model.addAttribute(\"user\", user);\n return \"changePassword\";\n }", "private void updateUserWithNewPassword() throws ClassNotFoundException, NoSuchAlgorithmException{\n\t\tint currentPositionInTableView = usersTable.getSelectionModel().getSelectedIndex(); // zapamiętaj bieżące podświetlenie w tabeli\n\t\tif ((isAllFieldsAreFull()) \n\t\t\t\t&& (isTheSamePassword())\n\t\t\t\t&& (isLoginUnique(usersTable.getSelectionModel().getSelectedItem().getId()))){\t\n\t\t\t\t\tcurrentPositionInTableView = usersTable.getSelectionModel().getSelectedIndex(); // zapamiętaj bieżące podświetlenie w tabeli\n\t\t\t\t\tMain.getMMUser().update(\t\t\t\t \n\t\t\t\t\t\t\tnew User(\n\t\t\t\t\t\t\t\t\tusersTable.getSelectionModel().getSelectedItem().getId(),\n\t\t\t\t\t\t\t\t\tuserLoginField.getText(), \n\t\t\t\t\t\t\t\t\tHelper.encryptPassword(userPasswordField.getText()), \n\t\t\t\t\t\t\t\t\tuserNameField.getText(), \n\t\t\t\t\t\t\t\t\tuserLastNameField.getText(), \n\t\t\t\t\t\t\t\t\tpermission,\n\t\t\t\t\t\t\t\t\teditingCheck.isSelected(),\n\t\t\t\t\t\t\t\t\treminderCheck.isSelected()));\n\t\t\t\t\t// pokaż aktualny stan bazy pracowników\n\t\t\t\t\treadUsers();\n\t\t\t\t\tshowUsers();\n\t\t\t\t\tusersTable.getSelectionModel().select(currentPositionInTableView); // ustaw podswietlenie na bieżący wiersz\n\t\t\t\t\tnew AlertDialog(\"Operacja zakończona\", \"Zaktualizowano dane\", AlertType.INFORMATION);\n\t\t\t\t\tchangePassword = false;\n\t\t}\n\t}", "public void setPassword(java.lang.String newPassword);", "public Forgotpassword()\n {\n initComponents();\n \n }", "@Override\n\tpublic void updatePassword(AdminUser userModel) {\n\n\t}", "public ChangePassword() {\n initComponents();\n SQLConnect sqlcon = new SQLConnect();\n con=sqlcon.sqlCon(con);\n jPasswordField2.setEnabled(false);\n jPasswordField3.setEnabled(false);\n }", "@POST\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n @Path(\"user/account/password\")\n public void updatePassword(@FormParam(\"password\") String password, @FormParam(\"con_password\") String confirmPassword, @FormParam(\"new_password\") String newPassword) {\n System.out.println(password);\n System.out.println(confirmPassword);\n System.out.println(newPassword);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n renewPass = new javax.swing.JPasswordField();\n newpass = new javax.swing.JPasswordField();\n pass = new javax.swing.JPasswordField();\n txtUsername = new javax.swing.JTextField();\n confirm = new javax.swing.JButton();\n cancel = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel1.setText(\"CHANGE PASSWORD\");\n\n jLabel2.setText(\"Enter Username :\");\n\n jLabel3.setText(\"Password :\");\n\n jLabel4.setText(\"New Password :\");\n\n jLabel5.setText(\"Re-Enter New Password :\");\n\n confirm.setText(\"CONFIRM\");\n confirm.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n confirmActionPerformed(evt);\n }\n });\n\n cancel.setText(\"CANCEL\");\n cancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cancelActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(144, 144, 144)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGap(119, 119, 119)\n .addComponent(confirm, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(68, 68, 68)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(jLabel4)\n .addComponent(jLabel3)\n .addComponent(jLabel2))))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)\n .addComponent(pass)\n .addComponent(newpass)\n .addComponent(renewPass)))\n .addGroup(layout.createSequentialGroup()\n .addGap(66, 66, 66)\n .addComponent(cancel, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(109, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(49, 49, 49)\n .addComponent(jLabel1)\n .addGap(30, 30, 30)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(txtUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3)\n .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(24, 24, 24)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(newpass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(renewPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(61, 61, 61)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(confirm)\n .addComponent(cancel))\n .addContainerGap(44, Short.MAX_VALUE))\n );\n\n pack();\n }", "@Transactional\n\tpublic void createRemindedPassword(RegisterUserForm ruf)\n\t{\n\t\tMd5PasswordEncoder passwordEncoder = new Md5PasswordEncoder();\n\t\tString hashedPassword = passwordEncoder.encodePassword(ruf.getPassword(), null);\n\t\n\t\t// create remindpassword for the user\n\t\t\n\t\tDate \t\tdt \t= new Date();\n\t\tTimestamp \tnow = new Timestamp(dt.getTime());\n\t\t\n\t\tString confKey \t= \"\" + dt;\n\t\tString confirmKey = encoder.encodeConfirmAccountHash(confKey);\n\t\tString sql = \"UPDATE confirmaccount SET confirmkey=:key, createdon=:date, remindpassword=BIT'1'\" +\n\t\t\t\t\" WHERE username=:user\";\n\t\tem.createNativeQuery(sql)\n\t\t.setParameter(\"user\", ruf.getUserName())\n\t\t.setParameter(\"date\", now)\n\t\t.setParameter(\"key\", confirmKey)\n\t\t.executeUpdate();\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==this.btnNewButton)\n\t\t{\n\t\t\tString user = this.textField.getText();\n\t\t\tString oldPwd = new String(this.passwordField.getPassword());\n\t\t\tString newPwd = new String(this.passwordField_1.getPassword());\n\t\t\tString newPwd2 = new String(this.passwordField_2.getPassword());\n\t\t\ttry {\n\t\t\t\tBeanyonghuxinxi.currentLoginUser=yonghuUttil.yonghuManager.changePwd(user, oldPwd, newPwd, newPwd2);\n\t\t\t}catch (BaseException e1) {\n\t\t\t\tJOptionPane.showMessageDialog(null, e1.getMessage(), \"´يخَ\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\tthis.setVisible(false);\n\t\t}\n\t\telse if(e.getSource() == this.button)\n\t\t{\n\t\t\tFrmyonghujiemian wewe = new Frmyonghujiemian();\n\t\t\twewe.setVisible(true);\n\t\t\tthis.setVisible(false);\n\t\t}\n\t}", "@Override\n\tpublic boolean setNewPassword(BigInteger tUserFId,String password) {\n\t\tint res = accountManageDao.updateApplyPwdWithMainUser(tUserFId,password);\n\t\treturn res>0?true:false;\n\t}", "private void addChangePasswordForm() {\n // The panel to hold all form components to change the login accounts password\n final JPanel changePasswordForm = new JPanel();\n changePasswordForm.setPreferredSize(new Dimension(650, 345));\n changePasswordForm.setVisible(true);\n changePasswordForm.setBackground(Color.white);\n changePasswordForm.setLayout(new GridBagLayout());\n \n /**\n * Password label and text field and info label.\n */\n // Label to hold the login accounts new password form field text.\n final JLabel passwordLabel = new JLabel(\"New Password:\");\n setLabelAttributes(passwordLabel);\n passwordLabel.setPreferredSize(new Dimension(200, 50));\n\n // The coordinates for where to add this component to the edit login account password form layout.\n c.gridx = 0;\n c.gridy = 0;\n changePasswordForm.add(passwordLabel, c);\n \n // The text field input for login accounts new password\n passwordField = new JTextField(15);\n passwordField.setInputVerifier(inputVerifier);\n passwordField.setName(passwordFieldName);\n passwordField.setFont(textFont);\n \n // The coordinates for where to add this component to the edit login account password form layout.\n c.gridx = 1;\n c.gridy = 0;\n changePasswordForm.add(passwordField, c);\n \n // Label to hold the information tooltip and tooltip icon for the login accounts password field\n final JLabel info1Label = new JLabel();\n // Sets the standard attributes for a info label\n setInfoLabelAttributes(info1Label);\n // The info image icon for the label\n info1Label.setIcon(new ImageIcon(\"images/icons/information.png\"));\n // The tooltip on mouse hover for the icon\n info1Label.setToolTipText(\"<HTML> The <b> new password </b>field MUST contain atleast: \"\n + \"One upper and lower case letter, a number and be atleast 5 characters long.</b> </HTML>\");\n \n // The coordinates for where to add this component to the layout.\n c.gridx = 2;\n c.gridy = 0;\n changePasswordForm.add(info1Label, c);\n \n \n /**\n * Password Confirmation label and text field and info label.\n */\n // Label to hold the login accounts password confirmation form field text.\n final JLabel passwordConfirmationLabel = new JLabel(\"Password Confirmation:\");\n setLabelAttributes(passwordConfirmationLabel);\n passwordConfirmationLabel.setPreferredSize(new Dimension(200, 50));\n \n // The coordinates for where to add this component to the edit login account password form layout.\n c.gridx = 0;\n c.gridy = 1;\n changePasswordForm.add(passwordConfirmationLabel, c);\n \n // The text field input for login accounts password confirmation\n passwordConfirmationField = new JTextField(15);\n passwordConfirmationField.setInputVerifier(inputVerifier);\n passwordConfirmationField.setName(passwordConfirmationFieldName);\n passwordConfirmationField.setFont(textFont);\n \n // The coordinates for where to add this component to the edit login account password form layout.\n c.gridx = 1;\n c.gridy = 1;\n changePasswordForm.add(passwordConfirmationField, c);\n \n // Label to hold the information tooltip and tooltip icon for the login accounts password confirmation field\n final JLabel info2Label = new JLabel();\n // Sets the standard attributes for a info label\n setInfoLabelAttributes(info2Label);\n // The info image icon for the label\n info2Label.setIcon(new ImageIcon(\"images/icons/information.png\"));\n // The tooltip on mouse hover for the icon\n info2Label.setToolTipText(\"<HTML> The <b> password confirmation </b>field cannot: \"\n + \"be empty, or be different from the password entered in the password field.</b> </HTML>\");\n \n // The coordinates for where to add this component to the layout.\n c.gridx = 2;\n c.gridy = 1;\n changePasswordForm.add(info2Label, c);\n \n // Adds the change password form to the dynamic edit panel and updates the UI.\n dynamicEditPanel.add(changePasswordForm);\n dynamicEditPanel.updateUI();\n }", "private void sendEmailWithNewPassword(final BusinessUserDetail user, final String newPassword) {\n eventBus.setLoadingProgress(60, null);\n ContactUsDetail dialogDetail = new ContactUsDetail();\n dialogDetail.setRecipient(user.getEmail());\n dialogDetail.setMessage(Storage.MSGS.resetPasswordEmail(user.getPersonFirstName(), newPassword));\n dialogDetail.setSubject(Storage.MSGS.resetPasswordEmailSubject());\n mailService.sendMail(dialogDetail, new SecuredAsyncCallback<Boolean>(eventBus) {\n @Override\n public void onSuccess(Boolean result) {\n eventBus.setLoadingProgress(100, Storage.MSGS.resetPasswordInfoStatus());\n }\n });\n }", "@Override\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tUser u = user;\r\n\t\t\t\t\t\tuser.setUser_password(NewPassword.getText());\r\n\t\t\t\t\t\tif (NewPassword.getText().equals(surePassword.getText())) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tDAOFactory.getIUserDAOInstance().update(u);\r\n\t\t\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(UserFrame.this, \"更改成功\", \"提示\", \r\n\t\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(UserFrame.this, \"两次输入不同\", \"提示\", \r\n\t\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public void changePassword(View v){\n Intent intent = new Intent();\n intent.setClass(ProfileModify.this,ChangePassword.class);\n startActivity(intent);\n }", "@RequestMapping(\"/editPass\")\r\n\tpublic ModelAndView editPass(@ModelAttribute(\"UserEditPassForm\") final UserEditPassForm form) {\r\n\t\treturn new ModelAndView(\"users/changePass\");\r\n\t}", "@Override\r\n\tpublic void modifyPassword(String username, String password, String confirmPassword, String oldPassword) {\n\t}", "void onChangePasswordSuccess(ConformationRes data);", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n txtNewPass = new javax.swing.JPasswordField();\n btnSave = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n txtConfirmPass = new javax.swing.JPasswordField();\n txtCurrentPass = new javax.swing.JPasswordField();\n jLabel4 = new javax.swing.JLabel();\n\n setClosable(true);\n setMaximizable(true);\n setTitle(\"CHANGE PASSWORD\");\n addInternalFrameListener(new javax.swing.event.InternalFrameListener() {\n public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {\n }\n public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {\n formInternalFrameClosed(evt);\n }\n public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {\n formInternalFrameClosing(evt);\n }\n public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {\n }\n public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {\n }\n public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {\n }\n public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {\n }\n });\n\n jLabel1.setText(\"CURRENT PASSWORD :\");\n\n jLabel2.setText(\"NEW PASSWORD :\");\n\n btnSave.setText(\"SAVE\");\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"CONFIRM PASSWORD :\");\n\n jLabel4.setText(\"Password must contain min 8 character with uppercase, number and symbol\");\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(69, 69, 69)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtNewPass, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtConfirmPass))\n .addComponent(txtCurrentPass, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))))\n .addContainerGap(64, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(145, 145, 145))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(53, 53, 53)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtCurrentPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(9, 9, 9)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtNewPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtConfirmPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(btnSave)\n .addContainerGap(33, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "String getNewPassword();", "private void setNewPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n newPassword_ = value;\n }", "public ChangePasswordForm(CollabSession session) {\n initComponents();\n\n this.session = session;\n\n dialogDescriptor = new DialogDescriptor(\n this, NbBundle.getMessage(ChangePasswordForm.class, \"TITLE_ChangePasswordForm\")\n ); // NOI18N\n dialogDescriptor.setValid(false);\n\n DocumentListener docListener = new DocumentListener() {\n public void changedUpdate(DocumentEvent e) {\n }\n\n public void insertUpdate(DocumentEvent e) {\n checkValidity();\n }\n\n public void removeUpdate(DocumentEvent e) {\n checkValidity();\n }\n };\n\n newPasswdTextField.getDocument().addDocumentListener(docListener);\n confirmTextField.getDocument().addDocumentListener(docListener);\n }", "public void createModifPassword(JFrame jFrame, ControllerAdmin controllerAdminPersonalInfos){\n JLabel jLabelModifPassword = new JLabel(\"Entrer le nouveau mot de passe :\");\n jLabelModifPassword.setBounds(560, 290, 300, 28);\n JTextField jTextFieldNewPassword = new JTextField(controllerAdminPersonalInfos.getUser().getPassword());\n jTextFieldNewPassword.setBounds(560, 320, 200, 28);\n JButton jButtonCancel = new JButton(\"Annuler\");\n jButtonCancel.setBounds(560, 350, 100, 28);\n JButton jButtonOk = new JButton(\"Valider\");\n jButtonOk.setBounds(660, 350, 100, 28);\n\n jFrame.add(jLabelModifPassword);\n jFrame.add(jTextFieldNewPassword);\n jFrame.add(jButtonCancel);\n jFrame.add(jButtonOk);\n\n jButtonCancel.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n jFrame.getContentPane().remove(jLabelModifPassword);\n jFrame.getContentPane().remove(jTextFieldNewPassword);\n jFrame.getContentPane().remove(jButtonCancel);\n jFrame.getContentPane().remove(jButtonOk);\n jFrame.repaint();\n }\n });\n jButtonOk.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n jFrame.getContentPane().remove(jLabelModifPassword);\n jFrame.getContentPane().remove(jTextFieldNewPassword);\n jFrame.getContentPane().remove(jButtonCancel);\n jFrame.getContentPane().remove(jButtonOk);\n jFrame.repaint();\n controllerAdminPersonalInfos.getUser().updatePassword(jTextFieldNewPassword.getText());\n }\n });\n\n jFrame.setVisible(true);\n }", "public void changePassword(View view) {\n }", "void changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword) throws PasswordNotMatchException;", "public PasswordChangeRequestPage( WOContext context )\n {\n super( context );\n }", "public ForgotPasswordPage goToNewPasswordPage(){\n\n botStyle.click(forgotPasswordLink);\n\n return PageFactory.initElements(driver, ForgotPasswordPage.class);\n }", "private void changePassword() throws EditUserException {\n String userIDInput = userID.getText();\n String passwordInput = passwordChange.getText();\n try {\n Admin.changeUserPassword(userIDInput, passwordInput);\n JOptionPane.showMessageDialog(null, \"Change Password Success: \" + userIDInput + \" password successfully changed\");\n // Reset Values\n userID.setText(\"\");\n passwordChange.setText(\"\");\n } catch (EditUserException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n throw new EditUserException(e.getMessage());\n } catch (SQLException throwables) {\n throw new EditUserException(\"Change Password Error: Cannot Change\" + userIDInput + \" password\");\n } catch (NullPointerException e) {\n String msg = \"Change Password Error: User ID \" + userIDInput + \" is an invalid userID.\";\n JOptionPane.showMessageDialog(null, msg);\n throw new EditUserException(\"Change Password Error: User ID \" + userIDInput + \" is an invalid userID.\");\n }\n }", "public ResetPasswordWindow(DaoDelegatingContainer<User> userContainer, Object objectId) {\n super(\"Reset Password\");\n super.center();\n super.setModal(true);\n\n FormLayout mainLayout = new FormLayout();\n mainLayout.setSizeUndefined();\n mainLayout.setMargin(true);\n mainLayout.setSpacing(true);\n\n RandomString rs = new RandomString(10);\n\n TextField textField = new TextField(\"new Password\", rs.nextString());\n textField.setRequired(true);\n textField.addValidator(new StringLengthValidator(\"The Password is too short!\", 8, null, false));\n mainLayout.addComponent(textField);\n\n mainLayout.addComponent(new Button(\"Reset\", (event) -> {\n textField.validate();\n\n if (objectId instanceof User) {\n ((User) objectId).setPassword(PermissionService.hashPassword(textField.getValue()));\n userContainer.updateItem((User) objectId);\n\n EmailService.sendUserNewPasswordEmail(textField.getValue(), (User) objectId);\n super.close();\n }\n }));\n\n mainLayout.addComponent(new Button(\"Cancel\", (event) -> {\n\n super.close();\n }));\n super.setContent(mainLayout);\n }", "public passwordForm() {\n initComponents();\n }", "public void update() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n reauthenticate();\n }", "public void setPassword2(String password2);", "ChangePassword.Req getChangePasswordReq();", "public void savePassword(SecurityUserBaseinfoForm form,SecurityUserBaseinfo data) {\n\t\t\tString passwd = \"\";\r\n\t\t\tif(form.getPassWord().equals(\"\")){\r\n\t\t\t\tpasswd = BaseSecurityInit.getProperty(\"USER_PASSWORD\");\r\n\t\t\t}else{\r\n\t\t\t\tpasswd = form.getPassWord();\r\n\t\t\t}\r\n\t\t\tString passwdMD5 = MD5.toMD5(passwd);\r\n\t\t\tSecurityConfigUsers sysUser = new SecurityConfigUsers();\r\n\t\t\tsysUser.setSecurityUserBaseinfoId(data.getId());\r\n\t\t\tsysUser.setPasswd(passwdMD5);\r\n\t\t\tthis.securityUserBaseinfoDAO.save(sysUser);\r\n\t}", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tView rootView = inflater.inflate(R.layout.changepassword, container, false);\n\t\toldpass = (EditText) rootView.findViewById(R.id.oldpassword);\n\t\tnewpass = (EditText) rootView.findViewById(R.id.newpassword);\n\t\trepass = (EditText) rootView.findViewById(R.id.retypepassword);\n\t\tfinal Button changepass = (Button) rootView.findViewById(R.id.changepassword);\n\t\tchangepass.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tString uname = ((MyApplicationData)getActivity().getApplication()).getUserName();\n\t\t\t\tString upass = oldpass.getText().toString();\n\t\t\t\tString npass = newpass.getText().toString();\n\t\t\t\tString rpass = repass.getText().toString();\n\t\t\t\t\n\t\t\t\tSQLiteDatabase db = getActivity().openOrCreateDatabase(\"userinfo\", 0, null);\n\t\t\t\tdb.execSQL(\"create table if not exists signin (uname varchar ,pass varchar);\");\n\t\t\t\tCursor cs = db.rawQuery(\"select * from signin where uname = '\"+uname+\"' and pass = '\"+upass+\"'\" , null);\n\t\t\t\tif (cs.getCount() > 0){\n\t\t\t\t\tif(npass.equals(rpass)){\n\t\t\t\t\t\tdb.execSQL(\"update signin set pass = '\"+npass+\"' where uname = '\"+uname+\"'\");\n\t\t\t\t\t\tToast.makeText(getActivity(), \"Password Changed\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tgetFragmentManager().popBackStackImmediate();\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t\tToast.makeText(getActivity(), \"NEW PASSWORDS DO NOT MATCH\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tToast.makeText(getActivity(), \"INCORRECT PASSWORD\", Toast.LENGTH_LONG).show();\n\t\t\t\tdb.close();\n\t\t\t\n\t\t\t}\n\t\t});\n\t\treturn rootView;\n\t}", "@RequestMapping(value = \"/changepassword/{id}\", method = RequestMethod.GET)\n\n\tpublic ModelAndView changePassword(HttpServletRequest request, HttpSession session, @PathVariable int id,\n\t\t\t@ModelAttribute(\"edituser\") UserBean edituser, Model model) {\n\t\tString adminId = (String) request.getSession().getAttribute(\"adminId\");\n\t\tif (adminId != null) {\n\t\t\tUserBean user = userdao.getUserById(id);\n\t\t\tmodel.addAttribute(\"user\", user);\n\n\t\t\treturn new ModelAndView(\"changePasswordView\");\n\t\t} else\n\t\t\treturn new ModelAndView(\"redirect:Login\");\n\t}", "public ConfirmUser(TextField tfUserName, TextField tfEmail,\r\n TextField tfFirstName, TextField tfLastName, PasswordField pfPassword) {\r\n\r\n this.txtUserName.setText(String.valueOf(tfUserName.getText()));\r\n this.txtEmail.setText(String.valueOf(tfEmail.getText()));\r\n this.txtFirstName.setText(String.valueOf(tfFirstName.getText()));\r\n this.txtLastName.setText(String.valueOf(tfLastName.getText()));\r\n this.txtPassword.setText(String.valueOf(pfPassword.getText()));\r\n }", "public void setUserPassword(String newPassword) {\n profile.setPassword(currentUser, newPassword);\n }", "public JPasswordChange(Bonde innloggetBonde) {\n this.newPass2 = \"\";\n this.gammelPass = \"\";\n this.newPass1 = \"\";\n initComponents();\n this.innloggetBonde = innloggetBonde;\n\n }", "@PostMapping(\"/login/{id}/changePassword\")\n public String changeUserPassword(@PathVariable(name = \"id\") Long id, TempUser tempUser, Model model, HttpSession session)\n throws Exception {\n\n User user = userService.getUser(id);\n\n userService.changePassword(tempUser,user);\n session.setAttribute(\"password\", tempUser.getNewPass());\n model.addAttribute(\"tempUser\", tempUser);\n model.addAttribute(\"user\", user);\n return \"redirect:/login/\" + user.getId();\n }", "public ChangePasswordPanel() {\n initComponents();\n }", "User resetPassword(User user);", "private void changePassword(String newPassword) {\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n firebaseUser.updatePassword(newPassword).addOnCompleteListener(this, new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ProfileSettingsActivity.this, PASSWORD_CHANGED_SUCCESSFUL, Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "public CambiarPassword(UsuarioVO usu) {\r\n\t\tsuper();\r\n\t\tusuario = usu;\r\n\t\tinitialize();\r\n\t}", "public ChangePasswordBean() {\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton3 = new javax.swing.JButton();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n userNametxt = new javax.swing.JTextField();\n updatePass = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n userOldPassword = new javax.swing.JTextField();\n userNewPassword = new javax.swing.JTextField();\n userConfirmPassword = new javax.swing.JTextField();\n\n jButton3.setText(\"jButton3\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"PMS - Change Password\");\n setLocation(new java.awt.Point(300, 40));\n setResizable(false);\n\n jLabel1.setText(\"User Name\");\n\n jLabel2.setText(\"Old Password\");\n\n jLabel3.setText(\"New Password\");\n\n jLabel4.setText(\"Confirm Password\");\n\n updatePass.setText(\"Update\");\n updatePass.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updatePassActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Cancel\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(65, 65, 65)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(99, 99, 99)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(userNametxt, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)\n .addComponent(userOldPassword)\n .addComponent(userNewPassword)\n .addComponent(userConfirmPassword))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 130, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(updatePass, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(77, 77, 77))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(42, 42, 42)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(userNametxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(updatePass))\n .addGap(28, 28, 28)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jButton2)\n .addComponent(userOldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(22, 22, 22)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(userNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(userConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(46, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "@Override\n public void onClick(View v) {\n AlertDialog alertDialog = new AlertDialog.Builder(MyAccount.this).create();\n\n //Put edit text into the alert dialog\n alertDialog.setTitle(\"Change Password\");\n\n LinearLayout linearLayout = new LinearLayout(getApplicationContext());\n linearLayout.setOrientation(LinearLayout.VERTICAL);\n final EditText editTextPassword = new EditText(getApplication());\n editTextPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n editTextPassword.setHint(\"Enter current password\");\n editTextPassword.setHintTextColor(getResources().getColor(R.color.alpha_gray));\n editTextPassword.setTextColor(getResources().getColor(R.color.black));\n\n final EditText editTextNewPassword = new EditText(getApplication());\n editTextNewPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n editTextNewPassword.setTextColor(getResources().getColor(R.color.black));\n editTextNewPassword.setHintTextColor(getResources().getColor(R.color.alpha_gray));\n editTextNewPassword.setHint(\"Enter new password\");\n\n final EditText editTextReenterNewPassword = new EditText(getApplication());\n editTextReenterNewPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n editTextReenterNewPassword.setTextColor(getResources().getColor(R.color.black));\n editTextReenterNewPassword.setHintTextColor(getResources().getColor(R.color.alpha_gray));\n editTextReenterNewPassword.setHint(\"Reenter new password\");\n\n linearLayout.addView(editTextPassword);\n linearLayout.addView(editTextNewPassword);\n linearLayout.addView(editTextReenterNewPassword);\n\n alertDialog.setView(linearLayout);\n //Set positive button (submit)\n alertDialog.setButton(AlertDialog.BUTTON_POSITIVE,\"Enter\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n String currentPassword = editTextPassword.getText().toString();\n\n if(currentPassword.contentEquals(user.getPassword())) {\n //Check if the reentered password matches\n String newPassword = editTextNewPassword.getText().toString();\n String reenterNewPassword = editTextReenterNewPassword.getText().toString();\n\n if(newPassword.equals(reenterNewPassword) && !newPassword.equals(user.getPassword())\n && !currentPassword.equals(\"\") &&!newPassword.equals(\"\")&&!reenterNewPassword.equals(\"\")) {\n //Update password\n dialog.dismiss();\n BackgroundUpdatePasswordTask backgroundUpdatePasswordTask = new BackgroundUpdatePasswordTask();\n backgroundUpdatePasswordTask.execute(user.getUsername(), newPassword);\n\n } else if(newPassword.equals(user.getPassword())){\n Toast.makeText(getApplicationContext(),\"new password cannot be current password\", Toast.LENGTH_LONG).show();\n }else if(currentPassword.equals(\"\")||newPassword.equals(\"\")||reenterNewPassword.equals(\"\")){\n Toast.makeText(getApplicationContext(),\"All fields must be entered\", Toast.LENGTH_LONG).show();\n }\n else {\n //New passwords don't match\n editTextReenterNewPassword.setError(\"Reentered new password does not match new password\");\n Toast.makeText(getApplicationContext(),\"Passwords do not match\", Toast.LENGTH_LONG).show();\n }\n\n } else {\n //Incorrect user password\n //Don't let them update password\n dialog.dismiss();\n Toast.makeText(getApplicationContext(),\"Wrong password\",Toast.LENGTH_LONG).show();\n }\n\n\n }\n });\n //Set negative button (cancel)\n alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE,\"Cancel\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n\n alertDialog.show();\n\n }", "private ForgotPasswordUser populateForgotPassword()\n\t{\n\t\tForgotPasswordUser fUser = new ForgotPasswordUser();\n\t\tfUser.setAction(WebServiceAction.FORGOTPASSWORD);\n\t\tfUser.setEmail(medtUserName.getText().toString());\n\t\treturn fUser;\n\t}", "@FXML private void setToNewUser(){\n\t\tshowPassword();\n\t\tclearFields();\n\t\thideLackMessages();\n\t\tchangeCancelButton.setText(\"Anuluj\");\n\t\tnewUser = true;\n\t}", "@Override\n\t\t\tpublic void onClick(View v) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tchange_pass(Singleton.user_id, old_pass.getText().toString(), new_pass.getText().toString(), \n\t\t\t\t\t\tnew_pass.getText().toString());\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n String newPassword = resetPassword.getText().toString();\n user.updatePassword(newPassword).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void unused) {\n Toast.makeText(profile.this, \"Password Reset Successfully\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(profile.this, \"Password Reset Failed.\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "public Builder setNewPassword(\n String value) {\n copyOnWrite();\n instance.setNewPassword(value);\n return this;\n }", "@Override\n public void onClick(View view) {\n String password = contraseña_antigua.getText().toString();\n String newPassword = contraseña_nueva.getText().toString();\n String repeatPassword=repetir_contraseña_nueva.getText().toString();\n\n // Check if username, password is filled\n\n if(password.trim().length() <= 0) {\n contraseña_antigua.setError(\"Escriba Antigua Contraseña\");\n }else if (newPassword.trim().length() <= 0){\n contraseña_nueva.setError(\"Escriba Nueva Contraseña\");\n\n }else if (repeatPassword.trim().length() <= 0){\n repetir_contraseña_nueva.setError(\"Repita La Nueva Contraseña\");\n }else if (!newPassword.equals(repeatPassword)){\n repetir_contraseña_nueva.setError(\"No Coincide La Nueva Contraseña\");\n }\n else {\n Cursor cursor;\n\n database.open();\n cursor=database.getUserByName(sessionManager.getUserDetails().get(\"name\"));\n if(!password.equals(cursor.getString(3))){\n contraseña_antigua.setError(\"Contraseña Incorrecta\");\n }\n else{\n database.updateUser(cursor.getLong(0),cursor.getString(1),cursor.getString(2),newPassword,cursor.getString(4));\n Toast.makeText(getApplicationContext(),\"Se ha actualizado la contraseña correctamente\",Toast.LENGTH_LONG).show();\n finish();\n }\n database.close();\n\n }\n\n }", "public ChangePass() {\n initComponents();\n this.setTitle(\"Change Password\");\n this.setLocation(400, 300);\n }", "private void updateData() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n\n if (firebaseUser == null) {\n return;\n }\n\n firebaseUser\n .updatePassword(user.getNewPassword())\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if (task.isSuccessful()) {\n newPassword.setText(Util.EMPTY);\n password.setText(Util.EMPTY);\n\n Toast.makeText(\n getContext(), getResources().getString(R.string.password_updated),\n Toast.LENGTH_SHORT\n ).show();\n }\n }\n })\n .addOnFailureListener((Activity) getContext(), new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n FirebaseCrash.report(e);\n Toast.makeText(\n getContext(),\n e.getMessage(),\n Toast.LENGTH_SHORT\n ).show();\n }\n });\n }", "@Override\n\tpublic void alterpassword(User user) throws Exception {\n\n\t}", "private void passwordJBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passwordJBActionPerformed\n String newPassword = String.valueOf(passwordJPF.getPassword());\n BD.cambiarPassword(newPassword);\n JOptionPane.showMessageDialog(null, \"La PASSWORD se ha modificado con éxito.\",\n \"Información\", JOptionPane.INFORMATION_MESSAGE);\n }", "@RequestMapping(value = \"/reikningur/breyta-lykilordi\", method = RequestMethod.POST)\n private String changePasswordHandler (\n HttpSession session, @RequestParam Map<String,String> params, ModelMap model) \n throws PasswordVerificationException, HashException {\n String oldPassword = params.get(\"old-password\");\n String newPassword1 = params.get(\"new-password1\");\n String newPassword2 = params.get(\"new-password2\");\n \n String loggedInUserEmail = (String) session.getAttribute(\"user\");\n \n if (!newPassword1.equals(newPassword2)) {\n model.addAttribute(\"message\", \"Ný lykilorð eru ekki eins, reyndu aftur.\");\n }\n else if (!accountService.verifyPassword(loggedInUserEmail, oldPassword)) {\n model.addAttribute(\"message\", \"Lykilorð er ekki rétt, reyndu aftur.\");\n }\n else if (accountService.changePassword(loggedInUserEmail, newPassword1)) {\n model.addAttribute(\"message\", \"Lykilorði þínu hefur verið breytt.\");\n \n } else {\n model.addAttribute(\"message\", \"Úúúps! Eitthvað fór úrskeiðis. Reyndu aftur síðar.\");\n }\n \n return \"settings\";\n }", "public int editPassword(User user) {\n User currentUser = userRepository.findByUsername(user.getUsername());\n if (currentUser == null)\n return 0;\n currentUser.setPassword(user.getPassword());\n userRepository.save(currentUser);\n return 1;\n }", "private PasswordScreen() {\n initComponents();\n\n //cbUserType.setModel(new DefaultComboBoxModel(new String[] {User.USER_TYPE_MANAGER, User.USER_TYPE_CASHIER, User.USER_TYPE_SERVER}));\n\n btnConfigureDatabase.setAction(goAction);\n btnConfigureDatabase.setActionCommand(\"DBCONFIG\");\n }", "public String modifyPassword(ActionEvent evt) {\r\n\r\n\t\tString v$navigation = null;\r\n\r\n\t\tString v$oldPwd = getDefaultVue().getOldPassword();\r\n\t\tString v$newPwd = getDefaultVue().getNewPassword();\r\n\t\tString v$confirmPwd = getDefaultVue().getConfirmNewPassword();\r\n\t\t\r\n\t\tif(v$newPwd == null || v$newPwd.isEmpty()){\r\n\t\t\tFacesUtil.addInfoMessage(\"\", \"Nouveau mot de passe vide\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif(v$newPwd.length()>30){\r\n\t\t\tFacesUtil.addInfoMessage(\"\", \"Taille du nouveau mot de passe trés longue, moins de 30 caractéres\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif(v$oldPwd.equals(v$newPwd)){\r\n\t\t\tFacesUtil.addInfoMessage(\"\", \"Ancien mot de passe identique au nouveau\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tif (v$newPwd.equals(v$confirmPwd)) {\r\n\t\t\ttry {\r\n\r\n\t\t\t\tAdminSvcoDeleguate.getSvcoUsr().modifierPwd(getDefaultVue().getLogin(), v$oldPwd, v$newPwd, SysGehoToolBox.getInfoUser());\r\n\r\n\t\t\t\t getDefaultVue().setModified(true);\r\n\t\t\t\t FacesUtil.addInfoMessage(\"\", \"Modification de mot de passe réussie\");\r\n\t\t\t}\r\n\r\n\t\t\tcatch (SysGehoAppException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ServiceLocatorException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tFacesUtil.addWarnMessage(\"\", \"Confirmation différente du nouveau mot de passe\");\r\n\t\t}\r\n\r\n\t\treturn v$navigation;\r\n\t}", "public boolean changePassword(HttpServletRequest request, HttpServletResponse response);", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString uname = ((MyApplicationData)getActivity().getApplication()).getUserName();\n\t\t\t\tString upass = oldpass.getText().toString();\n\t\t\t\tString npass = newpass.getText().toString();\n\t\t\t\tString rpass = repass.getText().toString();\n\t\t\t\t\n\t\t\t\tSQLiteDatabase db = getActivity().openOrCreateDatabase(\"userinfo\", 0, null);\n\t\t\t\tdb.execSQL(\"create table if not exists signin (uname varchar ,pass varchar);\");\n\t\t\t\tCursor cs = db.rawQuery(\"select * from signin where uname = '\"+uname+\"' and pass = '\"+upass+\"'\" , null);\n\t\t\t\tif (cs.getCount() > 0){\n\t\t\t\t\tif(npass.equals(rpass)){\n\t\t\t\t\t\tdb.execSQL(\"update signin set pass = '\"+npass+\"' where uname = '\"+uname+\"'\");\n\t\t\t\t\t\tToast.makeText(getActivity(), \"Password Changed\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tgetFragmentManager().popBackStackImmediate();\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t\tToast.makeText(getActivity(), \"NEW PASSWORDS DO NOT MATCH\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tToast.makeText(getActivity(), \"INCORRECT PASSWORD\", Toast.LENGTH_LONG).show();\n\t\t\t\tdb.close();\n\t\t\t\n\t\t\t}", "@GetMapping(\"/login/{id}/addPassword\")\n public String addPasswordShowForm(@PathVariable(name = \"id\") Long id, Model model, HttpSession session){\n User user = userService.getUser(id);\n model.addAttribute(\"user\", user);\n model.addAttribute(\"password\", new Password());\n\n\n return \"addPassword\";\n }", "public void setPassword(String newPassword) {\n this.password = newPassword;\n \n //make the changes in the database\n db.updateUserProperty(username, Property.PASSWORD, newPassword);\n }", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n String newpass = resetpass.getText().toString();\n user.updatePassword(newpass).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(Profile.this, \"Password reset successfully\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Profile.this, \"Password reset failed\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPasswordField2 = new javax.swing.JPasswordField();\n jLabel1 = new javax.swing.JLabel();\n oldPassword = new javax.swing.JPasswordField();\n jLabel2 = new javax.swing.JLabel();\n newPassword1 = new javax.swing.JPasswordField();\n jLabel3 = new javax.swing.JLabel();\n newPassword2 = new javax.swing.JPasswordField();\n changePassword = new javax.swing.JButton();\n cancel = new javax.swing.JButton();\n\n jPasswordField2.setText(\"jPasswordField2\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Endre passord\");\n\n jLabel1.setText(\"Gammelt passord\");\n\n oldPassword.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n oldPasswordActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Nytt passord \");\n\n newPassword1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n newPassword1ActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Gjenta nytt passord\");\n\n changePassword.setText(\"Endre passord\");\n changePassword.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n changePasswordActionPerformed(evt);\n }\n });\n\n cancel.setText(\"Avbryt\");\n cancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cancelActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(changePassword)\n .addGap(18, 18, 18)\n .addComponent(cancel))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel1)\n .addComponent(jLabel3)\n .addComponent(jLabel2)\n .addComponent(oldPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)\n .addComponent(newPassword1)\n .addComponent(newPassword2)))\n .addContainerGap(60, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(oldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(newPassword1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(newPassword2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(changePassword)\n .addComponent(cancel))\n .addContainerGap())\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "com.google.protobuf.ByteString\n getNewPasswordBytes();", "private void setNewPasswordBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n newPassword_ = value.toStringUtf8();\n }", "@RequestMapping(\"ChangeUserPasswords\")\n\tpublic ModelAndView viewUserPasswords(HttpServletRequest request, HttpSession session, UserBean userbean) {\n\t\tString adminId = (String) request.getSession().getAttribute(\"adminId\");\n\t\tif (adminId != null) {\n\t\t\tList<UserBean> list = userdao.getUserDetails();\n\n\t\t\treturn new ModelAndView(\"ChangeUserPasswords\", \"list\", list);\n\t\t}\n\n\t\telse\n\t\t\treturn new ModelAndView(\"redirect:/Login\");\n\n\t}", "@RequestMapping(value = \"/user/forgotPasswordForm\", method = RequestMethod.GET)\n\tpublic ModelAndView forgotPasswordForm(HttpServletRequest request) {\n\t\tModelAndView model=new ModelAndView(\"form/forgotPassword\",\"command\",new User()); \n\t\treturn model; \n\t}", "void setUserPasswordHash(String passwordHash);", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n lblPhoto = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n cbxRole = new javax.swing.JComboBox<>();\n txtUserID = new javax.swing.JTextField();\n txtUserName = new javax.swing.JTextField();\n txtPhone = new javax.swing.JTextField();\n txtEmail = new javax.swing.JTextField();\n btnChangePhoto = new javax.swing.JButton();\n btnClear = new javax.swing.JButton();\n btnCreate = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n jLabel9 = new javax.swing.JLabel();\n txtPassword = new javax.swing.JPasswordField();\n txtConfirmPassword = new javax.swing.JPasswordField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n });\n\n jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel2.setText(\"Creating New User\");\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel1.setText(\"User ID:\");\n\n lblPhoto.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n lblPhoto.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel4.setText(\"Password:\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel5.setText(\"User Name:\");\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel6.setText(\"Role:\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n jLabel7.setText(\"Phone:\");\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel8.setText(\"Email:\");\n\n cbxRole.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n txtUserID.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n txtUserName.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n txtPhone.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n txtEmail.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n btnChangePhoto.setText(\"Change Photo\");\n btnChangePhoto.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnChangePhotoActionPerformed(evt);\n }\n });\n\n btnClear.setText(\"Clear\");\n btnClear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnClearActionPerformed(evt);\n }\n });\n\n btnCreate.setText(\"Create\");\n btnCreate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCreateActionPerformed(evt);\n }\n });\n\n btnCancel.setText(\"Cancel\");\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(evt);\n }\n });\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel9.setText(\"Confirm Password:\");\n\n txtPassword.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n txtConfirmPassword.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(lblPhoto, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(btnChangePhoto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(txtUserName))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(txtUserID, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel9)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtConfirmPassword)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(cbxRole, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(txtEmail)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btnCreate)\n .addGap(18, 18, 18)\n .addComponent(btnClear)\n .addGap(18, 18, 18)\n .addComponent(btnCancel)\n .addGap(0, 0, Short.MAX_VALUE))))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtUserID, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)\n .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(15, 15, 15)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtConfirmPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)\n .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cbxRole, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnClear, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(lblPhoto, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnChangePhoto, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(18, Short.MAX_VALUE))\n );\n\n pack();\n }", "ChangePassword.Rsp getChangePasswordRsp();", "public void setPassword(String pass);", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblOldPassword = new javax.swing.JLabel();\n lblNewPassword = new javax.swing.JLabel();\n lblonfirmPassword = new javax.swing.JLabel();\n txtOldPassword = new javax.swing.JPasswordField();\n txtNewPassword = new javax.swing.JPasswordField();\n txtConfirmPassword = new javax.swing.JPasswordField();\n btnConfirm = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n\n setBackground(new java.awt.Color(153, 217, 234));\n setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n\n lblOldPassword.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblOldPassword.setText(\"Old Password :\");\n\n lblNewPassword.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblNewPassword.setText(\"New Password :\");\n\n lblonfirmPassword.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblonfirmPassword.setText(\"Confirm Password :\");\n\n btnConfirm.setText(\"Confirm\");\n btnConfirm.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnConfirmActionPerformed(evt);\n }\n });\n\n btnCancel.setText(\"Cancel\");\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(461, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(btnConfirm, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(lblonfirmPassword)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(btnCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(lblNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(64, 64, 64)\n .addComponent(txtNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(lblOldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(64, 64, 64)\n .addComponent(txtOldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(432, 432, 432))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(104, 104, 104)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtOldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblOldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblonfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(btnConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(11, 11, 11)\n .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(153, Short.MAX_VALUE))\n );\n }", "public ForgotPassword() {\n initComponents();\n SQLConnect sqlcon = new SQLConnect();\n con=sqlcon.sqlCon(con);\n }", "@Override\n\tpublic User changePasswordUser(User user) throws CustomException {\n\t\tlog.info(\"change password!\");\n\t\tUser existingUser=userRepository.findByLoginId(user.getLoginId());\n\t\tif(existingUser!=null) {\n\t\t\texistingUser.setPassword(user.getPassword());\n\t\t\treturn userRepository.save(existingUser);\n\t\t}else {\n\t\t\tthrow new CustomException(\"User doesnt exists.Please Register to login\");\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n pfoldpwd = new javax.swing.JPasswordField();\n pfnewpwd = new javax.swing.JPasswordField();\n pfcpwd = new javax.swing.JPasswordField();\n btnexit = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n jLabel1.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jLabel1.setText(\"Change password.........\");\n\n jLabel2.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n jLabel2.setText(\"New Password\");\n\n jLabel3.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n jLabel3.setText(\"Old Password\");\n\n jLabel4.setFont(new java.awt.Font(\"Times New Roman\", 0, 13)); // NOI18N\n jLabel4.setText(\"Confirm Password\");\n\n jButton1.setFont(new java.awt.Font(\"Times New Roman\", 1, 13)); // NOI18N\n jButton1.setText(\"Change\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n pfnewpwd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n pfnewpwdActionPerformed(evt);\n }\n });\n\n btnexit.setFont(new java.awt.Font(\"Times New Roman\", 1, 13)); // NOI18N\n btnexit.setText(\"EXIT\");\n btnexit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnexitActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(57, 57, 57)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addGap(62, 62, 62)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pfcpwd, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\n .addComponent(pfnewpwd)\n .addComponent(pfoldpwd))\n .addGap(81, 81, 81))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(91, 91, 91)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnexit))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(125, 125, 125)\n .addComponent(jButton1)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addComponent(jLabel1))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btnexit)))\n .addGap(46, 46, 46)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(pfoldpwd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(pfnewpwd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(pfcpwd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(28, 28, 28)\n .addComponent(jButton1)\n .addGap(40, 40, 40))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "public ChangePasswordOperation() {\r\n }", "@RequestMapping(value = \"/changeNewPassword\", method = RequestMethod.POST)\r\n\tpublic String changeNewPassword(@RequestParam String oldPassword, @RequestParam String newPassword,\r\n\t\t\t@RequestParam String confirmPassword, Model model) {\r\n\t\r\n\t\tLOG.info(\"Inside changeNewPassword controller\");\r\n\t\r\n\t\ttry {\r\n\t\t\tUser userDetails = userService.findUserById(SecurityLibrary.getLoggedInUser().getId());\r\n\t\t\tBCryptPasswordEncoder enc = new BCryptPasswordEncoder();\r\n\t\t\tLOG.info(\" Pass : \"+enc.matches(oldPassword, userDetails.getPassword()) +\" old pass : \"+userDetails.getPassword());\r\n\t\t\t\r\n\t\t\tif (enc.matches(oldPassword, userDetails.getPassword())) {\r\n//\t\t\tif (userDetails.getPassword().trim().equals(oldPassword.trim())) {\r\n\t\t\t\tLOG.debug(\" Both Equal \");\r\n\t\t\t\tif (!(newPassword.trim().equals(confirmPassword.trim()))) {\r\n\t\t\t\t\tLOG.debug(\" Same Password \");\r\n\t\t\t\t\tmodel.addAttribute(\"error\", \"New password And Confirm Password Must Be Same\");\r\n\t\t\t\t\treturn \"newUserPassword\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tString conPass = enc.encode(confirmPassword);\r\n\t\t\t\t\tuserDetails.setPassword(conPass);\r\n\t\t\t\t\tuserService.updateUserDetails(userDetails);\r\n\t\t\t\t\tmodel.addAttribute(\"success\", \"Your password has been Changed Successfully .\");\r\n\t\t\t\t\t//return \"dashboard\";\r\n\t\t\t\t\treturn \"redirect:/user/dashboard\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tmodel.addAttribute(\"error\", \"Your entered Old Password Is Incorrect\");\r\n\t\t\t\treturn \"newUserPassword\";\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tLOG.error(e.getMessage(), e);\r\n\t\t\te.printStackTrace();\r\n\t\t\tmodel.addAttribute(\"error\", e.getMessage());\r\n\t\t\t\r\n\t\t}\r\n\t\tmodel.addAttribute(\"error\", \"Your entered Old Password Is Incorrect\");\r\n\t\treturn \"newUserPassword\";\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n bxNama = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n bxUser = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n tblRegis = new javax.swing.JButton();\n bxPas = new javax.swing.JPasswordField();\n jLabel5 = new javax.swing.JLabel();\n bxPaslang = new javax.swing.JPasswordField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Rgistrasi\");\n\n jLabel2.setText(\"Masukkan Nama\");\n\n bxNama.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bxNamaActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Masukkan Username\");\n\n jLabel4.setText(\"Masukkan Password\");\n\n tblRegis.setText(\"Register\");\n tblRegis.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tblRegisActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"Masukkan Ulang Password\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(228, 228, 228)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(tblRegis))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addGap(140, 140, 140)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(bxNama)\n .addComponent(bxUser)\n .addComponent(bxPas)\n .addComponent(bxPaslang, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE))))\n .addContainerGap(149, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(bxNama, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(bxUser, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)\n .addGap(3, 3, 3)))\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(bxPas, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(4, 4, 4)))\n .addGap(18, 18, 18)\n .addComponent(bxPaslang, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)\n .addComponent(tblRegis)\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n back = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n jButton5 = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n field = new javax.swing.JPasswordField();\n field2 = new javax.swing.JPasswordField();\n field3 = new javax.swing.JPasswordField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n back.setText(\"BACK\");\n back.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backActionPerformed(evt);\n }\n });\n\n jButton1.setText(\"LOGOUT\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"OLD PASSWORD\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setText(\"NEW PASSWORD\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jButton4.setText(\"RETYPE NEW PASSWORD\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n jButton5.setText(\"UPDATE PASSWORD\");\n jButton5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton5ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(40, 40, 40))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(55, 55, 55)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(back, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1))\n .addComponent(jButton5, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(field)\n .addComponent(field2)\n .addComponent(field3))\n .addGap(25, 25, 25))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(back)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(32, 32, 32)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton2)\n .addComponent(field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton3)\n .addComponent(field2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton4)\n .addComponent(field3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jButton5))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(5, 5, 5)))\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n dgForgotPassword = new javax.swing.JDialog();\n lblForgotMessage = new javax.swing.JLabel();\n lblForgotMessage2 = new javax.swing.JLabel();\n btnCancel3 = new javax.swing.JButton();\n txtfUsername2 = new javax.swing.JTextField();\n btnNext = new javax.swing.JButton();\n lblFor = new javax.swing.JLabel();\n cbUser2 = new javax.swing.JComboBox<>();\n jSeparator1 = new javax.swing.JSeparator();\n btnClose = new javax.swing.JButton();\n dgForgotPassword2 = new javax.swing.JDialog();\n lblResetMessage = new javax.swing.JLabel();\n lblConfirmMessage2 = new javax.swing.JLabel();\n txtfCode = new javax.swing.JTextField();\n lblConfirmMessage3 = new javax.swing.JLabel();\n lblConfirmMessage4 = new javax.swing.JLabel();\n txtfNewPassword = new javax.swing.JTextField();\n btnBack = new javax.swing.JButton();\n btnConfirm = new javax.swing.JButton();\n lblEmail = new javax.swing.JLabel();\n jSeparator3 = new javax.swing.JSeparator();\n btnClose3 = new javax.swing.JButton();\n txtfUsername = new javax.swing.JTextField();\n lblUsername = new javax.swing.JLabel();\n lblPassword = new javax.swing.JLabel();\n exitButton = new javax.swing.JButton();\n lblLoginTitle = new javax.swing.JLabel();\n cbUser = new javax.swing.JComboBox<>();\n login = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n lblCreate = new javax.swing.JLabel();\n btnCreateAccount = new javax.swing.JButton();\n lblMessage = new javax.swing.JLabel();\n pwdPassword = new javax.swing.JPasswordField();\n lblForgotIt = new javax.swing.JLabel();\n btnForgotPassword = new javax.swing.JButton();\n lblLoginFor = new javax.swing.JLabel();\n btnMinimize = new javax.swing.JButton();\n lblPosIcon = new javax.swing.JLabel();\n lblHPOS = new javax.swing.JLabel();\n jSeparator2 = new javax.swing.JSeparator();\n\n dgForgotPassword.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n dgForgotPasswordMouseDragged(evt);\n }\n });\n dgForgotPassword.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n dgForgotPasswordMousePressed(evt);\n }\n });\n\n lblForgotMessage.setForeground(new java.awt.Color(235, 235, 235));\n lblForgotMessage.setText(\"resetting your password\");\n\n lblForgotMessage2.setForeground(new java.awt.Color(235, 235, 235));\n lblForgotMessage2.setText(\"your username\");\n\n btnCancel3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/FCancelNormal.png\"))); // NOI18N\n btnCancel3.setBorderPainted(false);\n btnCancel3.setFocusable(false);\n btnCancel3.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnCancel3MouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnCancel3MouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnCancel3MousePressed(evt);\n }\n });\n btnCancel3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancel3ActionPerformed(evt);\n }\n });\n\n txtfUsername2.setBackground(new java.awt.Color(35, 35, 35));\n txtfUsername2.setForeground(new java.awt.Color(235, 235, 235));\n txtfUsername2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(80, 137, 182)));\n\n btnNext.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/NextNormal.png\"))); // NOI18N\n btnNext.setBorderPainted(false);\n btnNext.setFocusable(false);\n btnNext.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnNextMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnNextMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnNextMousePressed(evt);\n }\n });\n btnNext.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnNextActionPerformed(evt);\n }\n });\n\n lblFor.setForeground(new java.awt.Color(235, 235, 235));\n lblFor.setText(\"for\");\n\n cbUser2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Manager\", \"Employee\" }));\n cbUser2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(35, 35, 35)));\n\n jSeparator1.setBackground(new java.awt.Color(80, 137, 182));\n jSeparator1.setForeground(new java.awt.Color(35, 35, 35));\n\n btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/CloseIconNormal.png\"))); // NOI18N\n btnClose.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));\n btnClose.setBorderPainted(false);\n btnClose.setContentAreaFilled(false);\n btnClose.setFocusable(false);\n btnClose.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnCloseMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnCloseMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnCloseMousePressed(evt);\n }\n });\n btnClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCloseActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout dgForgotPasswordLayout = new javax.swing.GroupLayout(dgForgotPassword.getContentPane());\n dgForgotPassword.getContentPane().setLayout(dgForgotPasswordLayout);\n dgForgotPasswordLayout.setHorizontalGroup(\n dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addComponent(lblForgotMessage2, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addComponent(btnNext, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)\n .addComponent(btnCancel3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(txtfUsername2))\n .addContainerGap())\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addComponent(lblForgotMessage)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dgForgotPasswordLayout.createSequentialGroup()\n .addComponent(lblFor)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(cbUser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addComponent(btnClose, javax.swing.GroupLayout.Alignment.TRAILING)))))\n .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)\n );\n dgForgotPasswordLayout.setVerticalGroup(\n dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPasswordLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lblForgotMessage))\n .addComponent(btnClose))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbUser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblFor))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtfUsername2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblForgotMessage2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(dgForgotPasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnCancel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnNext, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n dgForgotPassword2.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n dgForgotPassword2MouseDragged(evt);\n }\n });\n dgForgotPassword2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n dgForgotPassword2MousePressed(evt);\n }\n });\n\n lblResetMessage.setForeground(new java.awt.Color(235, 235, 235));\n lblResetMessage.setText(\"changing your password\");\n\n lblConfirmMessage2.setForeground(new java.awt.Color(235, 235, 235));\n lblConfirmMessage2.setText(\"a generated resetting code is sent to your email \");\n\n txtfCode.setBackground(new java.awt.Color(35, 35, 35));\n txtfCode.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n txtfCode.setForeground(new java.awt.Color(235, 235, 235));\n txtfCode.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n txtfCode.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(80, 137, 182)));\n\n lblConfirmMessage3.setForeground(new java.awt.Color(235, 235, 235));\n lblConfirmMessage3.setText(\"Code\");\n\n lblConfirmMessage4.setForeground(new java.awt.Color(235, 235, 235));\n lblConfirmMessage4.setText(\"new password\");\n\n txtfNewPassword.setBackground(new java.awt.Color(35, 35, 35));\n txtfNewPassword.setForeground(new java.awt.Color(235, 235, 235));\n txtfNewPassword.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(80, 137, 182)));\n\n btnBack.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/BackNormal.png\"))); // NOI18N\n btnBack.setBorderPainted(false);\n btnBack.setFocusable(false);\n btnBack.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnBackMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnBackMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnBackMousePressed(evt);\n }\n });\n btnBack.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnBackActionPerformed(evt);\n }\n });\n\n btnConfirm.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/ConfirmNormal.png\"))); // NOI18N\n btnConfirm.setBorderPainted(false);\n btnConfirm.setContentAreaFilled(false);\n btnConfirm.setFocusable(false);\n btnConfirm.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnConfirmMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnConfirmMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnConfirmMousePressed(evt);\n }\n });\n btnConfirm.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnConfirmActionPerformed(evt);\n }\n });\n\n lblEmail.setForeground(new java.awt.Color(235, 235, 235));\n\n jSeparator3.setBackground(new java.awt.Color(80, 137, 182));\n jSeparator3.setForeground(new java.awt.Color(35, 35, 35));\n\n btnClose3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/CloseIconNormal.png\"))); // NOI18N\n btnClose3.setBorderPainted(false);\n btnClose3.setContentAreaFilled(false);\n btnClose3.setFocusable(false);\n btnClose3.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnClose3MouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnClose3MouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnClose3MousePressed(evt);\n }\n });\n btnClose3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnClose3ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout dgForgotPassword2Layout = new javax.swing.GroupLayout(dgForgotPassword2.getContentPane());\n dgForgotPassword2.getContentPane().setLayout(dgForgotPassword2Layout);\n dgForgotPassword2Layout.setHorizontalGroup(\n dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addGap(108, 108, 108)\n .addComponent(btnConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnBack, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(lblConfirmMessage2)\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addComponent(lblConfirmMessage3)\n .addGap(18, 18, 18)\n .addComponent(txtfCode))\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addComponent(lblConfirmMessage4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(txtfNewPassword))\n .addComponent(lblEmail))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addComponent(lblResetMessage)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnClose3, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addComponent(jSeparator3)\n );\n dgForgotPassword2Layout.setVerticalGroup(\n dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(dgForgotPassword2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lblResetMessage))\n .addComponent(btnClose3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(lblConfirmMessage2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(5, 5, 5)\n .addComponent(lblEmail)\n .addGap(18, 18, 18)\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtfCode, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblConfirmMessage3))\n .addGap(18, 18, 18)\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblConfirmMessage4)\n .addComponent(txtfNewPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(dgForgotPassword2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnBack, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n formMouseDragged(evt);\n }\n });\n addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n formMousePressed(evt);\n }\n });\n\n txtfUsername.setBackground(new java.awt.Color(35, 35, 35));\n txtfUsername.setForeground(new java.awt.Color(235, 235, 235));\n txtfUsername.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n txtfUsername.setToolTipText(\"Enter you username\");\n txtfUsername.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(80, 137, 182)));\n txtfUsername.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n txtfUsernameActionPerformed(evt);\n }\n });\n txtfUsername.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtfUsernameKeyReleased(evt);\n }\n });\n\n lblUsername.setFont(new java.awt.Font(\"Minecraft\", 0, 11)); // NOI18N\n lblUsername.setForeground(new java.awt.Color(235, 235, 235));\n lblUsername.setText(\"Username\");\n\n lblPassword.setForeground(new java.awt.Color(235, 235, 235));\n lblPassword.setText(\"Password\");\n\n exitButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/CloseIconNormal.png\"))); // NOI18N\n exitButton.setBorderPainted(false);\n exitButton.setContentAreaFilled(false);\n exitButton.setFocusable(false);\n exitButton.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n exitButtonMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n exitButtonMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n exitButtonMousePressed(evt);\n }\n });\n exitButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n exitButtonActionPerformed(evt);\n }\n });\n\n lblLoginTitle.setForeground(new java.awt.Color(235, 235, 235));\n lblLoginTitle.setText(\"Login\");\n\n cbUser.setForeground(new java.awt.Color(235, 235, 235));\n cbUser.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Manager\", \"Employee\", \"Owner\" }));\n cbUser.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(35, 35, 35)));\n\n login.setBackground(new java.awt.Color(52, 52, 52));\n login.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/LoginNormal.png\"))); // NOI18N\n login.setToolTipText(\"login\");\n login.setContentAreaFilled(false);\n login.setFocusable(false);\n login.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n loginMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n loginMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n loginMousePressed(evt);\n }\n });\n login.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n loginActionPerformed(evt);\n }\n });\n\n btnCancel.setBackground(new java.awt.Color(52, 52, 52));\n btnCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/CancelNormal.png\"))); // NOI18N\n btnCancel.setToolTipText(\"exit\");\n btnCancel.setContentAreaFilled(false);\n btnCancel.setFocusable(false);\n btnCancel.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnCancelMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnCancelMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnCancelMousePressed(evt);\n }\n });\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(evt);\n }\n });\n\n lblCreate.setForeground(new java.awt.Color(235, 235, 235));\n lblCreate.setText(\"create a new account?\");\n\n btnCreateAccount.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/CreateNormal.png\"))); // NOI18N\n btnCreateAccount.setToolTipText(\"create your account to use this\");\n btnCreateAccount.setContentAreaFilled(false);\n btnCreateAccount.setFocusable(false);\n btnCreateAccount.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnCreateAccountMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnCreateAccountMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnCreateAccountMousePressed(evt);\n }\n });\n btnCreateAccount.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCreateAccountActionPerformed(evt);\n }\n });\n\n lblMessage.setForeground(new java.awt.Color(235, 235, 235));\n\n pwdPassword.setBackground(new java.awt.Color(35, 35, 35));\n pwdPassword.setForeground(new java.awt.Color(235, 235, 235));\n pwdPassword.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n pwdPassword.setToolTipText(\"Enter your password\");\n pwdPassword.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(80, 137, 182)));\n pwdPassword.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n pwdPasswordActionPerformed(evt);\n }\n });\n pwdPassword.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n pwdPasswordKeyReleased(evt);\n }\n });\n\n lblForgotIt.setForeground(new java.awt.Color(235, 235, 235));\n lblForgotIt.setText(\"forgot your password?\");\n\n btnForgotPassword.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/ForgotNormal.png\"))); // NOI18N\n btnForgotPassword.setToolTipText(\"retrieve your password using email (gmail only)\");\n btnForgotPassword.setContentAreaFilled(false);\n btnForgotPassword.setFocusable(false);\n btnForgotPassword.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnForgotPasswordMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnForgotPasswordMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnForgotPasswordMousePressed(evt);\n }\n });\n btnForgotPassword.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnForgotPasswordActionPerformed(evt);\n }\n });\n\n lblLoginFor.setForeground(new java.awt.Color(235, 235, 235));\n lblLoginFor.setText(\"Login For\");\n\n btnMinimize.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/HSoft/UI/RemoveIconNormal.png\"))); // NOI18N\n btnMinimize.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));\n btnMinimize.setBorderPainted(false);\n btnMinimize.setContentAreaFilled(false);\n btnMinimize.setFocusable(false);\n btnMinimize.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n btnMinimizeMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n btnMinimizeMouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n btnMinimizeMousePressed(evt);\n }\n });\n btnMinimize.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnMinimizeActionPerformed(evt);\n }\n });\n\n lblPosIcon.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n lblPosIconMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n lblPosIconMouseExited(evt);\n }\n });\n\n lblHPOS.setFont(new java.awt.Font(\"Roboto\", 0, 36)); // NOI18N\n lblHPOS.setForeground(new java.awt.Color(235, 235, 235));\n lblHPOS.setText(\"HPOS\");\n lblHPOS.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n lblHPOSMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n lblHPOSMouseExited(evt);\n }\n });\n\n jSeparator2.setBackground(new java.awt.Color(80, 137, 182));\n jSeparator2.setForeground(new java.awt.Color(35, 35, 35));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(lblForgotIt, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)\n .addComponent(lblCreate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnForgotPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnCreateAccount, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(101, 101, 101))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lblMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lblLoginFor)\n .addGap(18, 18, 18)\n .addComponent(cbUser, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(45, 45, 45)\n .addComponent(lblLoginTitle)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnMinimize)\n .addGap(3, 3, 3)\n .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(login, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)\n .addComponent(lblPassword, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pwdPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtfUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(203, 203, 203)\n .addComponent(lblPosIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(lblHPOS)\n .addGap(0, 89, Short.MAX_VALUE)))\n .addGap(101, 101, 101))\n .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(lblLoginTitle))\n .addComponent(exitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnMinimize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblPosIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblHPOS))\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtfUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pwdPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(login, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(lblCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(btnCreateAccount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnForgotPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblForgotIt, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)\n .addComponent(lblMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cbUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblLoginFor, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())))\n );\n\n pack();\n }", "private void updatePwd_click(ActionEvent e) {\n\t\tstatus.setText(\"修改密码\");\r\n\t\tStudentPwdFrm studentPwdFrm = new StudentPwdFrm();\r\n\t\tstudentPwdFrm.loginName = loginName;\r\n\t\tstudentPwdFrm.setVisible(true);\r\n\r\n\t}", "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "@Override\n public void onClick(View view) {\n changePassword();\n }", "public void savePasswordChange(ActionEvent actionEvent) throws SQLException {\n if (validPasswordInput()) {\n DatabaseManager.passwordChange(user.getDatabaseConnection(), user.getUser(), firstPasswordField.getText());\n displayMessage(messagePane,\"Password is changed\", false);\n closeChangePasswordPane(actionEvent);\n }\n }", "@PostMapping(\"/login/{id}/{passId}/edit\")\n public String editPasswordForm(@PathVariable Long id, @PathVariable Long passId, Password password, Model model,HttpSession session) throws Exception {\n User user = userService.getUser(id);\n Password savedPassword = passwordService.editPasswordById(passwordService.getPassword(passId), password, user);\n actionService.saveAction(\"Edited password\", session.getAttribute(\"user\").toString());\n\n model.addAttribute(\"password\", savedPassword);\n model.addAttribute(\"user\", user);\n model.addAttribute(\"mode\", session.getAttribute(\"mode\"));\n\n return \"redirect:/login/\" + id ;\n }", "public void login_pw() {\n\t\tIntent intent = new Intent(this, ResetPasswordActivity.class);\n\t\tstartActivity(intent);\n\t}", "@Headers({\n \"Content-Type:application/json\"\n })\n @PUT(\"users/{id}/password\")\n Call<Void> setPassword(\n @retrofit2.http.Path(\"id\") Integer id, @retrofit2.http.Body PasswordChangeRequest passwordRequest\n );", "@Test\n public void testCreateAccountWithPassword() {\n final CreateUserRequest createUserRequest = new CreateUserRequest();\n createUserRequest.setUsername(\"[email protected]\");\n createUserRequest.setPassword(\"beta\");\n createUserRequest.setFirstname(\"Alpha\");\n createUserRequest.setLastname(\"Gamma\");\n\n // Now, perform the actual test - create the Account, and verify that\n // the response is ok, and that a Notification was sent\n final CreateUserResponse result = administration.createUser(token, createUserRequest);\n assertThat(result.isOk(), is(true));\n assertThat(result.getUser(), is(not(nullValue())));\n assertThat(result.getUser().getUserId(), is(not(nullValue())));\n // Creating a new User should generate an Activate User notification\n final NotificationType type = NotificationType.ACTIVATE_NEW_USER;\n assertThat(spy.size(type), is(1));\n final String activationCode = spy.getNext(type).getFields().get(NotificationField.CODE);\n assertThat(activationCode, is(not(nullValue())));\n }", "@Override\n\tpublic void modifyUserPassword(String user_id, String user_password) {\n\t\tuserInfoDAO.modifyPassword(user_id, user_password);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n viewNama = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n viewID = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n viewUsername = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n btnSimpanPerubahan = new javax.swing.JButton();\n changePassword = new javax.swing.JCheckBox();\n viewPassword1 = new javax.swing.JPasswordField();\n viewPassword2 = new javax.swing.JPasswordField();\n passwordError = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Konfigurasi Akun\");\n setType(java.awt.Window.Type.UTILITY);\n\n jLabel1.setText(\"Nama\");\n\n jLabel2.setText(\"ID User\");\n\n viewID.setEditable(false);\n\n jLabel3.setText(\"Username\");\n\n viewUsername.setEditable(false);\n\n jLabel4.setText(\"Password\");\n\n jLabel5.setText(\"Re-type Password\");\n\n btnSimpanPerubahan.setText(\"Simpan Perubahan\");\n btnSimpanPerubahan.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSimpanPerubahanActionPerformed(evt);\n }\n });\n\n changePassword.setText(\"Ubah Password\");\n changePassword.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n changePasswordActionPerformed(evt);\n }\n });\n\n viewPassword1.setEditable(false);\n\n viewPassword2.setEditable(false);\n\n passwordError.setFont(new java.awt.Font(\"Dialog\", 0, 12)); // NOI18N\n passwordError.setForeground(new java.awt.Color(153, 0, 0));\n passwordError.setText(\"Password tidak sama!\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnSimpanPerubahan, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(changePassword)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel2)\n .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel4))\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(viewPassword2)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(viewNama)\n .addComponent(viewUsername)\n .addComponent(viewID, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)\n .addComponent(viewPassword1))\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(passwordError, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(viewNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(viewID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(viewUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(viewPassword1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(viewPassword2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(passwordError)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)\n .addComponent(changePassword)\n .addGap(2, 2, 2)\n .addComponent(btnSimpanPerubahan)\n .addContainerGap())\n );\n\n pack();\n }" ]
[ "0.70647395", "0.6937595", "0.6790869", "0.67750597", "0.675988", "0.675375", "0.65856767", "0.6567402", "0.65416104", "0.65377533", "0.6481368", "0.6465452", "0.6453811", "0.6431941", "0.6430164", "0.64246154", "0.6424431", "0.63945067", "0.6383595", "0.6381813", "0.6377711", "0.635804", "0.6329267", "0.6311626", "0.6295187", "0.6294683", "0.629404", "0.6292755", "0.62911797", "0.62843335", "0.62764823", "0.6272725", "0.6272536", "0.6267401", "0.62402153", "0.62301195", "0.6223365", "0.6221797", "0.62197953", "0.62133193", "0.621222", "0.6197715", "0.6195618", "0.6186629", "0.61858", "0.6183447", "0.6175513", "0.6164329", "0.6164329", "0.61441636", "0.6131923", "0.61295146", "0.6108217", "0.6104902", "0.6104584", "0.60992134", "0.6089121", "0.6089085", "0.60882974", "0.6079028", "0.6077391", "0.6068636", "0.60681", "0.6063488", "0.6058646", "0.6056626", "0.6038696", "0.60345006", "0.6028193", "0.6023995", "0.602189", "0.60136247", "0.60126877", "0.60099816", "0.6008799", "0.6005448", "0.5990966", "0.5989825", "0.5985343", "0.598143", "0.59811753", "0.5978544", "0.59782827", "0.59772253", "0.5961831", "0.5958543", "0.5957102", "0.5956781", "0.595406", "0.5936136", "0.5934757", "0.5934757", "0.5934757", "0.59339136", "0.593347", "0.5928112", "0.592657", "0.5924266", "0.5921867", "0.5920829", "0.59134" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jPasswordField1 = new javax.swing.JPasswordField(); jLabel3 = new javax.swing.JLabel(); jPasswordField2 = new javax.swing.JPasswordField(); jLabel4 = new javax.swing.JLabel(); jPasswordField3 = new javax.swing.JPasswordField(); jLabel5 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jTextField2 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("මුර පදය වෙනස් කරගන්න"); setResizable(false); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(74, 138, 240), 3)); jLabel1.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel1.setText("පරිශීලක කේතය :"); jTextField1.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel2.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel2.setText("පැරණි මුර පදය :"); jPasswordField1.setEditable(false); jPasswordField1.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); jLabel3.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel3.setText("නව මුර පදය :"); jPasswordField2.setEditable(false); jPasswordField2.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jPasswordField2.setEnabled(false); jPasswordField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField2ActionPerformed(evt); } }); jLabel4.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel4.setText("නැවත ඇතුලත් කරන්න :"); jPasswordField3.setEditable(false); jPasswordField3.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jPasswordField3.setEnabled(false); jPasswordField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField3ActionPerformed(evt); } }); jLabel5.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel5.setText("පරිශීලක නාමය :"); jButton1.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jButton1.setText("වෙනස් කරන්න"); jButton1.setEnabled(false); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jButton2.setText("ඉවත් වන්න"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jTextField2.setEditable(false); jTextField2.setFont(new java.awt.Font("Iskoola Pota", 0, 18)); // NOI18N jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); pack(); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\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 frmVenda() {\n initComponents();\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 EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public 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.73191476", "0.72906625", "0.72906625", "0.72906625", "0.72860986", "0.7248112", "0.7213479", "0.72078276", "0.7195841", "0.71899796", "0.71840525", "0.7158498", "0.71477973", "0.7092748", "0.70800966", "0.70558053", "0.69871384", "0.69773406", "0.69548076", "0.69533914", "0.6944929", "0.6942576", "0.69355655", "0.6931378", "0.6927896", "0.69248974", "0.6924723", "0.69116884", "0.6910487", "0.6892381", "0.68921053", "0.6890637", "0.68896896", "0.68881863", "0.68826133", "0.68815064", "0.6881078", "0.68771756", "0.6875212", "0.68744373", "0.68711984", "0.6858978", "0.68558776", "0.6855172", "0.6854685", "0.685434", "0.68525875", "0.6851834", "0.6851834", "0.684266", "0.6836586", "0.6836431", "0.6828333", "0.68276715", "0.68262815", "0.6823921", "0.682295", "0.68167603", "0.68164384", "0.6809564", "0.68086857", "0.6807804", "0.6807734", "0.68067646", "0.6802192", "0.67943805", "0.67934304", "0.6791657", "0.6789546", "0.6789006", "0.67878324", "0.67877173", "0.6781847", "0.6765398", "0.6765197", "0.6764246", "0.6756036", "0.6755023", "0.6751404", "0.67508715", "0.6743043", "0.67387456", "0.6736752", "0.67356426", "0.6732893", "0.6726715", "0.6726464", "0.67196447", "0.67157453", "0.6714399", "0.67140275", "0.6708251", "0.6707117", "0.670393", "0.6700697", "0.66995865", "0.66989213", "0.6697588", "0.66939527", "0.66908985", "0.668935" ]
0.0
-1
End of variables declaration//GENEND:variables
private void logIn() { char[] password = jPasswordField1.getPassword(); String userCode = jTextField1.getText(); String txtpassword = ""; for (char pw : password) { txtpassword += pw; } if ("".equals(txtpassword)) { JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString("enterPassword"), "No Password", JOptionPane.WARNING_MESSAGE); } else if (txtpassword.equals(userData.get(0).toString())) { jPasswordField2.setEnabled(true); jPasswordField3.setEnabled(true); jPasswordField2.setEditable(true); jPasswordField3.setEditable(true); jPasswordField2.grabFocus(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo21779D() {\n }", "public final void mo51373a() {\n }", "protected boolean func_70041_e_() { return false; }", "public void mo4359a() {\n }", "public void mo21782G() {\n }", "private void m50366E() {\n }", "public void mo12930a() {\n }", "public void mo115190b() {\n }", "public void method_4270() {}", "public void mo1403c() {\n }", "public void mo3376r() {\n }", "public void mo3749d() {\n }", "public void mo21793R() {\n }", "protected boolean func_70814_o() { return true; }", "public void mo21787L() {\n }", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo21780E() {\n }", "public void mo21792Q() {\n }", "public void mo21791P() {\n }", "public void mo12628c() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo97908d() {\n }", "public void mo21878t() {\n }", "public void mo9848a() {\n }", "public void mo21825b() {\n }", "public void mo23813b() {\n }", "public void mo3370l() {\n }", "public void mo21879u() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void mo21795T() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void m23075a() {\n }", "public void mo21789N() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21794S() {\n }", "public final void mo12688e_() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo6944a() {\n }", "public static void listing5_14() {\n }", "public void mo1405e() {\n }", "public final void mo91715d() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo9137b() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void func_70295_k_() {}", "void mo57277b();", "public void mo21877s() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "void berechneFlaeche() {\n\t}", "public void mo115188a() {\n }", "public void mo21880v() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo21784I() {\n }", "private stendhal() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo56167c() {\n }", "public void mo44053a() {\n }", "public void mo21781F() {\n }", "public void mo2740a() {\n }", "public void mo21783H() {\n }", "public void mo1531a() {\n }", "double defendre();", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public void stg() {\n\n\t}", "void m1864a() {\r\n }", "private void poetries() {\n\n\t}", "public void skystonePos4() {\n }", "public void mo2471e() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private void yy() {\n\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@AnyLogicInternalCodegenAPI\n private void setupPlainVariables_Main_xjal() {\n }", "static void feladat4() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "public void furyo ()\t{\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "protected void mo6255a() {\n }" ]
[ "0.6359434", "0.6280371", "0.61868024", "0.6094568", "0.60925734", "0.6071678", "0.6052686", "0.60522056", "0.6003249", "0.59887564", "0.59705925", "0.59680873", "0.5967989", "0.5965816", "0.5962006", "0.5942372", "0.5909877", "0.5896588", "0.5891321", "0.5882983", "0.58814824", "0.5854075", "0.5851759", "0.58514243", "0.58418584", "0.58395296", "0.5835063", "0.582234", "0.58090156", "0.5802706", "0.5793836", "0.57862717", "0.5784062", "0.5783567", "0.5782131", "0.57758564", "0.5762871", "0.5759349", "0.5745087", "0.57427835", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.573309", "0.57326084", "0.57301426", "0.57266665", "0.57229686", "0.57175463", "0.5705802", "0.5698347", "0.5697827", "0.569054", "0.5689405", "0.5686434", "0.56738997", "0.5662217", "0.56531453", "0.5645255", "0.5644223", "0.5642628", "0.5642476", "0.5640595", "0.56317437", "0.56294966", "0.56289655", "0.56220204", "0.56180173", "0.56134313", "0.5611337", "0.56112075", "0.56058615", "0.5604383", "0.5602629", "0.56002104", "0.5591573", "0.55856615", "0.5576992", "0.55707216", "0.5569681", "0.55570376", "0.55531484", "0.5551123", "0.5550893", "0.55482954", "0.5547471", "0.55469507", "0.5545719", "0.5543553", "0.55424106", "0.5542057", "0.55410767", "0.5537739", "0.55269134", "0.55236584", "0.55170715", "0.55035424", "0.55020875" ]
0.0
-1
/ Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false. Each letter in the magazine string can only be used once in your ransom note. Note: You may assume that both strings contain only lowercase letters.
public boolean canConstruct(String ransomNote, String magazine) { int[] arr = new int[26]; for(char c : magazine.toCharArray()) arr[c - 'a']++; for(char c : ransomNote.toCharArray()) { if(--arr[c - 'a'] < 0) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean canConstruct(String ransomNote, String magazine) {\n if (ransomNote == null || magazine == null) return false;\r\n if (ransomNote.length() > magazine.length()) return false;\r\n int[] countNote = new int[26];\r\n for (char ch : ransomNote.toCharArray()) {\r\n countNote[ch - 'a'] ++;\r\n }\r\n int[] magCount = new int[26];\r\n for (char ch : magazine.toCharArray()) {\r\n magCount[ch - 'a'] ++;\r\n }\r\n for (int i = 0 ; i < 26; i ++) {\r\n if (countNote[i] > magCount[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public boolean canConstruct(String ransomNote, String magazine) {\n int[] count = new int[26];\n System.out.println(Arrays.toString(count));\n for (char ch : magazine.toCharArray()) {\n count[(int) ch - (int) 'a'] += 1;\n }\n System.out.println(Arrays.toString(count));\n for (char ch : ransomNote.toCharArray()) {\n count[(int) ch - (int) 'a'] -= 1;\n }\n System.out.println(Arrays.toString(count));\n for (int i : count) {\n if (i < 0)\n return false;\n }\n return true;\n }", "public static void checkMagazine(List<String> magazine, List<String> note) {\n Map<String, Integer> magazineMap = new HashMap<>();\n for (String m : magazine) {\n if (magazineMap.containsKey(m)) {\n int val = magazineMap.get(m);\n magazineMap.put(m, ++val);\n }\n else {\n magazineMap.put(m, 1);\n }\n }\n\n for (String n : note) {\n //check if the value exists and is false\n if (magazineMap.containsKey(n) && magazineMap.get(n) > 0) {\n // passes\n int val = magazineMap.get(n);\n magazineMap.put(n, --val);\n }\n else {\n System.out.println(\"No\");\n return;\n }\n }\n\n System.out.println(\"Yes\");\n\n }", "public boolean rotationCheck(String a, String b) {\r\n\t\tif(a.length() != b.length()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tString c = a + a;\r\n\t\tif(c.contains(b)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static void checkMagazine(String[] magazine, String[] ransom) {\n HashMap<String, Integer> usableWords = makeMap(magazine);\n for (int i = 0; i < ransom.length; i++) {\n if (usableWords.containsKey(ransom[i]) && usableWords.get(ransom[i]) > 0) {\n usableWords.merge(ransom[i], -1, Integer::sum); // uses the word\n } else {\n System.out.println(\"No\");\n return;\n }\n }\n System.out.println(\"Yes\");\n}", "public static boolean is_rotation_of_another_string(String word1, String word2) {\n\n String s3 = word1 + word1;\n\n if (s3.contains(word2))\n return true;\n else\n return false;\n }", "public static void main(String[] args) {\n Character wildCard = '*';\n List<Character> chars = new ArrayList<>(Arrays.asList('d', 'o', 'r', wildCard));\n String testWord = \"door\";\n System.out.println(isWordCreatable(chars, testWord, wildCard));\n }", "public static boolean isRotation(String str1, String str2) {\n if ((str1.length() != str2.length()) || str1.isEmpty() || str2.isEmpty()\n || str1 == null || str2 == null) {\n return false;\n }\n return isSubString(str1, str2 + str2);\n // return (str2 + str2).contains(str1);\n // return ((str2 + str2).indexOf(str1) > -1);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString[] magazine = {\"apgo\", \"clm\", \"w\", \"lxkvg\", \"mwz\", \"elo\", \"bg\", \"elo\", \"lxkvg\", \"elo\", \"apgo\", \"apgo\", \"w\", \"elo\", \"bg\"};\n\t\t\t// {\"two\", \"times\", \"three\", \"is\", \"not\", \"four\"};\n\t\tString[] note = {\"elo\", \"lxkvg\", \"bg\", \"mwz\", \"clm\", \"w\"};\n\t\t\t//{\"two\", \"times\", \"two\", \"is\", \"four\"};\n\t\t\n\t\tcheckMagazine2(magazine, note);\n\n\t}", "private boolean matchSequences ( String sequence1, String sequence2 )\n{\n int matches = 0;\n\n // Check for sequences with less than 20 characters.\n if ( ( sequence1.length () <= 20 ) ||\n ( sequence2.length () <= 20 ) )\n {\n return sequence1.equalsIgnoreCase ( sequence2 );\n } // if\n\n // Count the matching bases in the first 20 characters.\n for ( int i = 0; i < 20; i++ )\n\n // Count the matching characters (but not N bases).\n if ( ( sequence1.charAt ( i ) == sequence2.charAt ( i ) ) &&\n ( sequence1.charAt ( i ) != 'x' ) &&\n ( sequence1.charAt ( i ) != 'n' ) )\n\n matches++;\n\n // Check for 90% identity (18/20) for a valid match\n if ( matches >= 18 ) return true;\n return false;\n}", "public static void main(String[] args) {\n List<String> magazine = Arrays.asList(\"give\", \"me\", \"one\", \"grand\", \"today\", \"night\");\n List<String> note = Arrays.asList(\"give\", \"one\", \"grand\", \"today\");\n checkMagazine(magazine, note);\n }", "public boolean solve() {\n\t\tSet<String> noteWords = noteMap.keySet();\n\t\tSet<String> magazineWords = magazineMap.keySet();\n\t\tSystem.out.println(\"M containsAll N : \" + magazineWords.containsAll(noteWords));\n\t\tif (magazineWords.containsAll(noteWords)) {\n\t\t\tfor (String noteWord : noteWords) {\n\t\t\t\tif (noteMap.get(noteWord) > magazineMap.get(noteWord)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "static boolean areAnagram(String sa, String sb) {\n\n // **** populate character arrays ****\n char[] aa = sa.toCharArray();\n char[] ab = sb.toCharArray();\n\n // **** sort character arrays ****\n Arrays.sort(aa);\n Arrays.sort(ab);\n\n // **** traverse arrays checking for mismatches ****\n for (int i = 0; i < aa.length; i++) {\n if (aa[i] != ab[i]) {\n return false;\n }\n }\n\n // **** strings are anagrams ****\n return true;\n }", "static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }", "public static void main(String[] args)\r\n\t{\n\t\tString S=\"A quick brown fox jumps over the dog\";\t//Missing characters: l y z\r\n\t\t//String S=\"A quick brown fox jumps over the lazy dog and cat\";\r\n\t\tchar[] ch=S.toLowerCase().toCharArray();\r\n\t\tfinal Set set=new HashSet();\r\n\t\tfor(char c:ch)\r\n\t\t{\r\n\t\t\tif(c>=97&&c<=122)\r\n\t\t\t\tset.add(c);\r\n\t\t}\r\n\t\tif(set.size()==26)\r\n\t\t\tSystem.out.println(\"String is a Pangram!!!\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"String is not a Pangram!!!\");\r\n\t\r\n\t// Ohum1.main(args);\r\n\t}", "private boolean isRotation(String s1, String s2) {\n\t\treturn (s1.length() == s2.length()) && isSubstring(s1 + s1, s2);\n\t}", "public static boolean abrevChecker(String abrv, String word) {\r\n \r\n //our 3rd word make by decrypting the given word\r\n String newWord = \"\";\r\n\r\n //splitting our two inputs into arrayLists and redefining them\r\n char[] firstWord = abrv.toCharArray();\r\n char[] secondWord = word.toCharArray();\r\n\r\n /*a for loop to check if each letter in word is inside the abbrevbation\r\n and creating a new word made of the commmon letters*/\r\n for (char letter : secondWord) {\r\n if (abrv.indexOf(letter) != -1) {\r\n newWord += letter;\r\n }\r\n }\r\n \r\n //check if the abrevation contains any forgein letters that word doesnt have\r\n for (char letter : firstWord) {\r\n if (word.indexOf(letter) == -1) {\r\n return false;\r\n\r\n /*if the abbrevation contains only letters found in word checks if\r\n the abbrevation is inside the new word*/\r\n } else if (word.indexOf(letter) != -1) {\r\n if (newWord.contains(abrv)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n }\r\n\t\treturn false;\r\n }", "@Test\n public void isAnagram() {\n\n Assert.assertEquals(true,Computation.isAnagram(\"read\",\"dear\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"deard\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"reaaad\"));\n Assert.assertEquals(false,Computation.isAnagram(\"readd\",\"reaad\"));\n }", "public boolean isAnagrams(String inputA, String inputB) {\n String one = inputA.toLowerCase();\n String two = inputB.toLowerCase();\n return sameLength(one, two) && sameLetters(one, two) && sameLetterCounts(one, two);\n }", "private static boolean isAnagram(String str, String anagram) {\n\n\t\tchar[] string = str.toCharArray();\n\t\tchar[] anag = anagram.toCharArray();\n\n\t\tArrays.sort(string);\n\t\tArrays.sort(anag);\n\n\t\treturn Arrays.equals(string, anag);\n\n\t}", "public boolean isARotation(String s1, String s2) {\n\t\tif(s1.length() != s2.length()) return false;\n\t\t\n\t\tStringBuilder stb = new StringBuilder();\n\t\tint i = 0;\n\t\twhile(i < s1.length()) {\n\t\t\tif(s1.charAt(i) == s1.charAt(i)) {\n\t\t\t\treturn subString(s1.substring(0, i), s2) \n\t\t\t\t\t\t&& stb.toString().compareTo(s2.substring(i, s2.length()-1)) == 0;\n\t\t\t}\n\t\t\ti++;\n\t\t\tstb.append(s1.charAt(i));\n\t\t}\n\t\treturn false;\n\t}", "boolean isPartOf(String genomeName);", "private boolean isAnagrams(String s1, String s2) {\n char[] ss1 = s1.toCharArray();\n \n char[] ss2 = s2.toCharArray();\n \n Arrays.sort(ss1);\n Arrays.sort(ss2);\n return ss1.equals(ss2);\n\n }", "public static boolean stringRotation(String str1, String str2) {\n String temp = str2 + str2;\n return temp.contains(str1);\n }", "public static void main(String[] args) {\n//\n// String pattern = \"abba\";\n// String s = \"dog cat cat fish\";\n\n\n// String pattern = \"aaaa\";\n// String s = \"dog cat cat dog\";\n\n String pattern = \"abba\";\n String s = \"dog dog dog dog\";\n\n// String pattern = \"e\";\n// String s = \"eukera\";\n\n boolean flag = wordPattern(pattern, s);\n\n System.out.println(flag);\n }", "public boolean validateMetaCaracteres(String MetaCaracteres){\n Pattern pattern;\n Matcher matcher; \n// pattern = Pattern.compile(\"^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ]+$\");\n pattern = Pattern.compile(\"^[a-zA-ZñÑáéíóúÁÉÍÓÚ]+$\");\n matcher = pattern.matcher(MetaCaracteres);\n return matcher.matches();\n }", "public static void main(String[] args) {\n\t\t String s1=new String(\"great\");\n\t\t String s2=new String(\"rgtae\");\n\t\t if(isScrableString(s1, s2)){\n\t\t\t System.out.println(\"two string is scramble string!\");\n\t\t }else{\n\t\t\t System.out.println(\"two string is not scramble string!\");\n\t\t }\n\t}", "public static boolean stringIntersect(String a, String b, int len) {\n\t\tHashSet<String> mySet = new HashSet<String>();\n\t\tfor (int i=0; i+len <= a.length(); i++){\n\t\t\tmySet.add(a.substring(i, i+len));\n\t\t}\n\t\tfor (int i=0; i+len <= b.length(); i++){\n\t\t\tif (mySet.contains(b.substring(i, i+len))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false; // TO DO ADD YOUR CODE HERE\n\t}", "private boolean m76078a(String str) {\n return str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF52FAECCBC22497D008B223\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAD7D27B8E9A0AAD39BD28E517\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAD7D27B8E9A0AAD39BD28E517\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF58E0ECD5D66A9A\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBF2CF403DF58E0ECD5D66A9A\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAC2C77986D416E025BF24D91D9F5DE0E6C68A688DD108B039AF\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA2AE5018546E6AAC2C77986D416E025BF24D91D9F5DE0E6C68A688DD108B039AF\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668DEA0EA620AE\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668DEA0EA620AE\")) || str.contains(C6969H.m41409d(\"G738BDC12AA6AE466F51B9245FBF1FCD16C86D118BE33A0\")) || str.contains(Uri.encode(C6969H.m41409d(\"G738BDC12AA6AE466F51B9245FBF1FCD16C86D118BE33A0\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668D\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA39F618994DE5AACBD26593EA19BA3EBF2CF441815DF7F6D7DE668D\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466E340C110ABABC0D92690D111F031AC3BE30B9D4DFCF18CD36C97D413B37EAF26B906994CF7F1CCC73497C70FBA\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466E340C110ABABC0D92690D111F031AC3BE30B9D4DFCF18CD36C97D413B37EAF26B906994CF7F1CCC73497C70FBA\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F10F8006F1E8D3D67A90C515AD24E52AE903DF5AF7F6CCC27B80D009F038BF24EA419347FCF1D1D66A979B12AB3DA7\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F10F8006F1E8D3D67A90C515AD24E52AE903DF5AF7F6CCC27B80D009F038BF24EA419347FCF1D1D66A979B12AB3DA7\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466EB1DDE52E8FD9A996A8D9A12AB3DA766E90F855CFAAAD3C56697DA19B03CF967EE1A9D44\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466EB1DDE52E8FD9A996A8D9A12AB3DA766E90F855CFAAAD3C56697DA19B03CF967EE1A9D44\"))) || str.contains(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA27F2078358F3E88CC26781D915BC3B\")) || str.contains(Uri.encode(C6969H.m41409d(\"G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FAA27F2078358F3E88CC26781D915BC3B\")));\n }", "public boolean checkPalindromeFormation(String a, String b) {\n int n = a.length();\n return findCommonSubstring(a.toCharArray(), b.toCharArray(), 0, n - 1) ||\n findCommonSubstring(b.toCharArray(), a.toCharArray(), 0, n - 1);\n }", "public static void main(String[] args) {\n\t\tString str=\"army\";\n\t\tString str1=\"mary\";\n\t\tchar arr[]=str.toLowerCase().toCharArray();\n\t\tchar arr1[]=str1.toLowerCase().toCharArray();\n\t\tArrays.sort(arr);\n\t\tArrays.sort(arr1);\n\t\tif(Arrays.equals(arr, arr1))\n\t\t{\n\t\t\tSystem.out.println(\"given strings are anagrams\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"given strings are not anagram\");\n\t\t}\n\t\t\n\n\t}", "public static boolean checkForAnagram(final String a, final String b) {\n boolean isAnagram = false;\n\n if(a == null || b == null){\n throw new IllegalArgumentException(\"Invalid input\");\n }\n if(a.length() != b.length()){\n return isAnagram;\n }\n char [] lowerCaseA = a.trim().toLowerCase().toCharArray();\n String upperCaseB= b.trim().toLowerCase();\n boolean check =true;\n for(int i =0; i<lowerCaseA.length ; i++){\n Character c = lowerCaseA[i];\n int n = c;\n if(c >=95 && c <=122){\n if(! upperCaseB.contains(c.toString())){\n check=false;\n break;\n }\n }\n else {\n continue;\n }\n }\n if(check){\n isAnagram =true;\n }\n\n return isAnagram;\n }", "@Test //TEST SIX\n void testSpecialCharactersBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"Champagne d'Argent\");\n assertFalse(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z- ][a-zA-z- ]*\"));\n }", "public boolean isActivationString(String word);", "private boolean m81839a(String str) {\n return C6969H.m41409d(\"G738BDC12AA\").equals(str) || C6969H.m41409d(\"G738BDC12AA39A528F61E\").equals(str);\n }", "public abstract boolean mo70724g(String str);", "public boolean startsWithM(String sequence) {\n if (sequence.length() > 0 && sequence.substring(0, 1).equals(\"M\")) {\n return true;\n }\n return false;\n }", "public static void main(String[] args) {\n\t\tString s = \"aab\";//\"aab\";//\"aaaaaa\";//\"mississpp\";//\"aaabbbccc\";\r\n\t\tString p = \"c*a*b\";//\"c*a*b\";//\"a*\";//\"mis*is*p*.\";//\"a*bb.cc*\"\r\n\r\n\t\tSystem.out.println(\"Match ? \" + isMatchLC(s, p));\r\n\r\n\t}", "private static boolean isUniqueM1(String str) {\n boolean isUnique = true;\n\n for (int i = 0; i < str.length(); i++) {\n\n for (int j = i + 1; j < str.length(); j++) {\n if (str.charAt(i) == str.charAt(j)) {\n isUnique = false;\n }\n }\n }\n return isUnique;\n }", "public static void main(String[] args) {\n\t\t\n\t\tString pan = \"ABEEM9341A\";\n\t\t\n\t\tif (pan.matches(\"[A-Z]{5}[0-9]{4}[A-Z]{1}\")) {\n\t\t\tSystem.out.println(\"VAlid Pan\");\n\t\t}else {\n\t\t\tSystem.out.println(\"InVAlid Pan\");\n\t\t}\nString pan1 = \"ABE EM9341A\";\n\t\t\n\t\tif (pan1.matches(\"[A-Z]{3} [A-Z]{2}[0-9]{4}[A-Z]{1}\")) {\n\t\t\tSystem.out.println(\"VAlid Pan\");\n\t\t}else {\n\t\t\tSystem.out.println(\"InVAlid Pan\");\n\t\t}\n\n\t}", "public static boolean stringIntersect(String a, String b, int len) {\n\t\tif(len == 0) return true;\n\t\tSet<String> first = new HashSet<String>();\n\t\tSet<String> second = new HashSet<String>();\n\t\tfor(int i = 0; i < a.length() - len + 1; i++){\n\t\t\tfirst.add(a.substring(i, i + len));\n\t\t}\n\t\tfor(int i = 0; i < b.length() - len + 1; i++){\n\t\t\tsecond.add(b.substring(i, i + len));\n\t\t}\n\t\tboolean intersects = !Collections.disjoint(first, second);\n\t\treturn intersects;\n\t}", "public static boolean isAnagram(char[]s1, char[]s2)\r\n{\n\t if(s1.length!=s2.length)\r\n\t\t return false; \r\n\t \r\n\t //sort both strings using Arrays sort method\r\n\t Arrays.sort(s1); \r\n\t Arrays.sort(s2);\r\n\t \r\n\t for(int i=0; i<s1.length;i++)\r\n\t if(s1[i]!=s2[i])\r\n\t\t return false; \r\n\t\r\n\treturn true; \r\n\t \r\n}", "private static boolean isAnagram2(String str, String anagram) {\n\n\t\tchar[] chararray = str.toCharArray();\n\n\t\tStringBuilder sb = new StringBuilder(anagram);\n\n\t\tfor (char ch : chararray) {\n\t\t\t\n\t\t\tint index = sb.indexOf(\"\" + ch);\n\n\t\t\tif (index != -1) {\n\n\t\t\t\tsb.deleteCharAt(index);\n\t\t\t} else {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn sb.length() == 0 ? true : false;\n\t}", "private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }", "private boolean checkInputContent(String contents){\n try {\n char[] temC = contents.toCharArray();\n for (int i=0;i<temC.length;i++) {\n char mid = temC[i];\n if(mid>=48&&mid<=57){//数字\n continue;\n }\n if(mid>=65&&mid<=90){//大写字母\n continue ;\n }\n if(mid>=97&&mid<=122){//小写字母\n continue ;\n }\n// temp.replace(i, i+1, \" \");\n return false;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return true;\n }", "private void checkEasterEgg (String word) {\r\n if (word.startsWith (\"IMAC\") || word.equals (\"APPLE\") || word.equals (\"KATZ\") || word.startsWith (\"IPOD\") || word.startsWith (\"IPHONE\")\r\n || word.startsWith (\"MAC\") && !word.startsWith (\"MACR\") && !word.startsWith (\"MACE\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered cannot be recognized\\nSince we are nice, we will add it for you anyways.\",\r\n \"Woah There!\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n }", "public boolean testSpecificChars(String str, String specificCharacters)\r\n {\r\n boolean ok=false;\r\n if(specificCharacters.length()>str.length())\r\n {\r\n return false;\r\n }\r\n else if(specificCharacters.length()==str.length())\r\n {\r\n return compare2Strings(str,specificCharacters);///daca au aceeasi lungime-> inseamn ca cele 2 str trebuie sa fie egale\r\n\r\n }\r\n else\r\n {\r\n\r\n for (int i = 0; i < str.length(); i++)\r\n {\r\n if(str.charAt(i)==specificCharacters.charAt(0)) {\r\n ///gasim primul caracter\r\n for (int j = 1; j < specificCharacters.length(); j++)\r\n {\r\n if ((str.charAt(i + j) == specificCharacters.charAt(j)))\r\n {\r\n ok=true;\r\n }\r\n else\r\n {ok=false;break;}\r\n }\r\n\r\n }\r\n }\r\n\r\n }\r\n if(ok){return true;}\r\n else {return false;}\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tString date=\"1990-02-02\";// yy-mm-dd\n\t\tLocalDate dat =LocalDate.parse(date,DateTimeFormatter.ISO_DATE);\n\t\tSystem.out.println(dat);\n\t\t\n//compare 2 strings\n\t\tString s1=\"The Boeing 747 \";\n\t\tString s2=\" this year's Australian rules\";\n\t\t\n\t\tif(s1==s2) {\n\t\t\tSystem.out.println(\"String equal\");\n\t\t}else {\n\t\t\tSystem.out.println(\"String not equal\");\n\t\t}\n//verify if a string is numeric\n\t\tString N=\"12345\";\n\t\tSystem.out.println(N.contains(\"1\"));\n\t\tboolean numeric=true;\n\t\ttry {\n\t\t\tDouble d=Double.parseDouble(N);\n\t\t\t\n\t\t}catch(NumberFormatException e) {\n\t\t\tnumeric=false;\n\n\t\t}\n\t\t\n\t\tif(numeric) {\n\t\t\tSystem.out.println(\"String is numeric \"+N);\n\t\t}else {\n\t\t\tSystem.out.println(\"String is not numeric\");\n\t\t}\n\t\t\n//verify if 2 strings are anagrams-\n\t\tString st1=\"DOG\";\n\t\tString st2=\"GOD\";\n\t \n\t\tif(st1.length()==st2.length()) {\n\t\t\t\n\t\t\tchar[] c1= st1.toCharArray();\n\t\t\tchar[] c2=st2.toCharArray();\n\t\t\t\n\t\t\tArrays.sort(c2);\n\t\t\tArrays.sort(c1);\n\n\t\t\tboolean result=Arrays.equals(c1, c2);\n\t\t\t\n\t\t\tif(result) {\n\t\t\t\tSystem.out.println(st1 +\" and \"+ st2 + \" are anagrams\");\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n//verify if a string contains a substring\n\t\tString str=\"Welcome to Maldives Enjoy your stay\";\n\t\tString mal=\"Maldives\";\n\t\tString sta=\"Stay\";\n\t\t\n boolean result=str.contains(mal);\n if(result) {\n\t System.out.println(\"contains substring \"+ mal);\n }else {\n\t System.out.println(\"does not contains substring\"+mal);\n }\n result=str.contains(sta);\n if(result) {\n\t System.out.println(\"contains substring \"+ sta);\n }else {\n\t System.out.println(\"does not contains substring \"+sta);\n }\n\n//iterate through each character of a string;\n\n String it=\"Testing Selenium\";\n char[] ch=it.toCharArray();\n for(char e:ch) {\n \t System.out.println(e);\n }\n\t\t\n //create random stringd\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "static boolean areAnagram(char[] str1, char[] str2)\n\t{\n\t\t// Get lengths of both strings\n\t\tint n1 = str1.length;\n\t\tint n2 = str2.length;\n\n\t\t// If length of both strings is not same,\n\t\t// then they cannot be anagram\n\t\tif (n1 != n2)\n\t\t\treturn false;\n\n\t\t// Sort both strings\n\t\tArrays.sort(str1);\n\t\tArrays.sort(str2);\n\n\t\t// Compare sorted strings\n\t\tfor (int i = 0; i < n1; i++)\n\t\t\tif (str1[i] != str2[i])\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString str = \"Cybertek\";\n\t\t boolean R1 = str.isEmpty(); // False\n\t\t System.out.println(R1);\n\t\t \n\t\t String str2 = \"\";\n\t\t if(str2.isEmpty()) { // True\n\t\t\t System.out.println(\"it's empty String\");\n\t\t }\n\t\t else {\n\t\t\t System.out.println(\"it's not empty\");\n\t\t }\n\t\t \n\t\t \n\t /*\n\t equals(str): checks if two Strings' visible texts are equal or not.\n\t */\n\t\t \n\t\t String A1 = \"Cybertek\";\n\t\t String A2 = new String (\"Cybertek\");\n\t\t System.out.println(A1 == A2); // false\n\t\t \n\t\t boolean R2 = A1.contentEquals(A2);\n\t\t System.out.println(R2);\n\t\t \n\t\t System.out.println( \"java\".equals(\"Java\")); // false, because of case sensitivity\n\t\t \n\t\t \n\t\t /*\n\t\t equalsIgnoreCase(str): \n\t\t checks if two Strings' visible texts are equal or not,\n\t\t then returns a boolean expression.\n\t\t Case sensitivity does not matter.\n\t\t */\n\t\t \n\t\t String s1 = \"JAVA\";\n\t\t String s2 = new String(\"java\");\n\t\t System.out.println(s1 == s2); // false\n\t\t \n\t\t System.out.println(s1.equals(s2)); // false\n\t\t System.out.println(s1.equalsIgnoreCase(s2)); // true\n\t\t \n\t\t\n\t\t\n\t /*\n\t contains(str): checks if the str is contained in the String or not,\n\t then it returns a boolean expression.\n\t \n\t if it is contained ==> true\n\t if it is !contained ==> false\n\t */\n\t\t \n\t\t String name = \"Muhtar\";\n\t\t boolean Result = name.contains(\"ABC\"); // false\n\t\t System.out.println(Result);\n\t\t \n\t\t String name2 = \"Marufjon\";\n\t\t System.out.println(name2.contains(\"m\")); // false, case sensitivity\n\t\t \n\t\t \n\t\t \n\t\t /*\n\t\t startsWith(str): checks if the String is started with the str or not,\n\t\t then returns a boolean expression.\n\t\t \n\t\t startedwith ==> tru\n\t\t !startedwith ==> false\n\t\t */\n\t\t \n\t\t String today = \"Java\";\n\t\t boolean result = today.startsWith(\"J\");\n\t\t System.out.println(result); // true\n\t\t \n\t\t String names = \"Cybertek School is a great place to learn Java\";\n\t\t System.out.println(names.startsWith(\"Cybertek School\")); //true\n\t\t \n\t\t \n\t\t /*\n\t\t endsWith(str): checks if the String is ended with the given str or not, \n\t\t then returns a boolean expression.\n\t\t \n\t\t endedwith ==> true !endedwith ==> false\n\t\t \n\t\t */\n\t\t \n\t\t String B1 = \"Muhtar\";\n\t\t System.out.println(B1.endsWith(\"R\")); //false, case sensitivity\n\t\t System.out.println(B1.endsWith(\"r\")); // true\n\t\t \n\t\t \n\t\t\t\t \n\t\t \n\t\t \n\t}", "private boolean validate(String s)\r\n\t{\r\n\t\tint i=0;\r\n\t\tchar[] s1=s.toLowerCase().toCharArray();\r\n\t\twhile(i<s1.length)\r\n\t\t{\r\n\t\t\tif(s1[i]=='*' || s1[i]=='?')\r\n\t\t\t\tbreak;\r\n\t\t\tif(s1[i]<'a' || s1[i]>'z') return false;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean checkInclusion(String s1, String s2) {\n\n if (s1.length() > s2.length()) {\n return false;\n }\n\n // Assume the input strings contain only lower case letters [a-z] <-> [97-123] in ASCII\n int[] aux1 = generateFrequencyArray(s1);\n\n for (int i = 0; i <= s2.length() - s1.length(); i++) {\n String temp = s2.substring(i, i + s1.length());\n int[] aux = generateFrequencyArray(temp);\n if (Arrays.equals(aux1, aux)) {\n return true;\n }\n }\n return false;\n }", "public boolean isOneLetterOff(String word1, String word2){\n \tif(word1.equals(word2)){ //all letters same\n \t\treturn false;\n \t}\n \tif(word1.substring(1).equals(word2.substring(1))){\t//all letters same except 1st\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,1).equals(word2.substring(0, 1)) && word1.substring(2).equals(word2.substring(2))){ //all letters same except 2nd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,2).equals(word2.substring(0,2)) && word1.substring(3).equals(word2.substring(3))){\t//all letters same except 3rd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,3).equals(word2.substring(0,3)) && word1.substring(4).equals(word2.substring(4))){\t//all letters same except 4th\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,4).equals(word2.substring(0,4))){\t//all letters same except 5th\n\t\t\treturn true;\n\t\t}\n \treturn false;\n }", "@Test\n public void testNormalAnagrams() {\n AnagramFinderImpl anagramFinderObj = new AnagramFinderImpl();\n boolean inputNormalAnagrams = anagramFinderObj.areAnagrams(\"aba\", \"aba\");\n assertTrue(\"true\", inputNormalAnagrams);\n }", "public boolean checkForAnagrams(String inp) {\n return (new StringBuffer(inp).reverse().toString().equals(inp));\n }", "public boolean verifyString(String s) {\n\t\t\n\t\tfor (int i = 0; i<s.length();i++) {\n\t\t\tif (!alphabet.contains(s.charAt(i))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "private boolean verifySequence(String seq) {\n for (int i = 0; i < seq.length(); i++) {\n if (seq.charAt(i) != 'A' && seq.charAt(i) != 'T'\n && seq.charAt(i) != 'C' && seq.charAt(i) != 'G') {\n return false;\n }\n }\n return true;\n }", "public static boolean containsString (char[] letters, String word){\n int numberOfSameLetters = 0;\n word.toCharArray();\n for(char charInWord : word.toCharArray()) {\n for (char letter : letters) {\n if(charInWord == letter){\n// System.out.println(\"letter \" + letter);\n numberOfSameLetters ++;\n break;\n }\n }\n }\n if(numberOfSameLetters == word.length()){\n// System.out.println(true);\n return true;\n }\n// System.out.println(\"false\");\n return false;\n }", "@org.junit.jupiter.api.Test\n void searchMagazinesValid() {\n String testMagazine = \"Tiny Houses\";\n int expectedIndex = 1;\n int actualIndex;\n\n actualIndex = Magazines.searchMagazines(testMagazine);\n\n if (actualIndex == expectedIndex) {\n System.out.println(\"searchMagazinesValid: PASSED\");\n } else {\n System.out.println(\"searchMagazinesValid: FAILED\");\n }\n\n }", "void mo9699a(String str, String str2, boolean z);", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "static boolean m22727a(String str) {\n if (TextUtils.isEmpty(str)) {\n return false;\n }\n for (String contains : f20300a.f20309c) {\n if (str.contains(contains)) {\n return true;\n }\n }\n return false;\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString s1=sc.nextLine();\r\nString s2=sc.nextLine();\r\ns1=s1.replaceAll(\"\\\\s\",\"\");\r\ns2=s2.replaceAll(\"\\\\s\",\"\");\r\ns1=s1.toLowerCase();\r\ns2=s2.toLowerCase();\r\nchar str1[]=s1.toCharArray();\r\nchar str2[]=s2.toCharArray();\r\nArrays.sort(str1);\r\nArrays.sort(str2);\r\nboolean k=true;\r\nif(s1.length()!=s2.length())\r\n\tk=false;\r\nelse\r\n{\r\nk=Arrays.equals(str1,str2);\t\r\n}\r\nif(k==false)\r\n\tSystem.out.print(\"not annagram\");\r\nelse\r\n\tSystem.out.print(\"annagram\");\r\n\t}", "public static void main(String[] args) {\n String s = \"acdcb\", p = \"a*?b\";//true\n System.out.println(isMatch(s, p));\n }", "private static boolean isAnagram(String a, String b) {\n\t\tint[] charsA = new int[26];\n\t\tint[] charsB = new int[26];\n\t\t\n\t\tfor(int i = 0 ; i < a.length(); i++)\n\t\t\tcharsA[a.charAt(i) - 'a']++;\n\t\tfor(int i = 0 ; i < b.length(); i++)\n\t\t\tcharsB[b.charAt(i) - 'a']++;\n\t\t\n\t\tfor(int i = 0 ; i < 26 ; i++) \n\t\t\tif(charsA[i] != charsB[i])\n\t\t\t\treturn false;\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n System.out.println(\"1. \" + StringTools.isAlpha(\"Happy\"));\n System.out.println(\"2. \" + StringTools.isAlpha(\"Happy-Happy\"));\n System.out.println(\"3. \" + StringTools.isAlpha(\"Happy-Happy\", '-'));\n System.out.println(\"\");\n System.out.println(\"1. \" + StringTools.isNumeric(\"09368955866\"));\n System.out.println(\"2. \" + StringTools.isNumeric(\"0936-895-5866\"));\n System.out.println(\"3. \" + StringTools.isNumeric(\"0936/895/5866\", '/'));\n System.out.println(\"\");\n System.out.println(\"1. \" + StringTools.isAlpha(\"HappyDay\"));\n System.out.println(\"2. \" + StringTools.isAlpha(\"#Happy-Day\"));\n System.out.println(\"3. \" + StringTools.isAlpha(\"Happy-Happy\", '#', '-'));\n // alpha space\n System.out.println(\"1. \" + StringTools.isAlpha(\"asd\", ' '));\n }", "@Test\n public void shouldNotFindSubstringWithMismatchedFirstCharacterAtTheEndOfThString() {\n // Given\n String string = \"123ABc\";\n CharSequence charSequence = new StringBuilder(\"cBc\");\n\n // When\n boolean containsCharSequence = string.contains(charSequence);\n\n // Then\n assertFalse(containsCharSequence);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner sc= new Scanner(System.in);\r\n\t\tString a=sc.nextLine();\r\n\t\tString b=sc.nextLine();\r\n\t\tStringBuilder c= new StringBuilder(); //immutable\r\n\t\t\r\n\t c.append(a); //appending the string a in c \r\n\t \r\n\t\r\n\t\tc.reverse(); //reversing the string\r\n\t\t\r\n\t\r\n\r\n\t\tif(b.contentEquals(c)) //stringbuilder uses contentEquals \r\n\t\t{\r\n\t\t\tSystem.out.println(\"YES\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"NO\");\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "public static boolean goodRuns(String sequence) {\n\t\tString run = sequence.charAt(0) + \"\";\n\t\tint longestRun = 0;\n\t\tfor (int i = 1; i < sequence.length(); i++) {\n\t\t\tif (run.contains(sequence.charAt(i) + \"\")) run += sequence.charAt(i);\n\t\t\telse {\n\t\t\t\tif (longestRun < run.length()) longestRun = run.length();\n\t\t\t\trun = sequence.charAt(i) + \"\";\n\t\t\t}\n\t\t}\n\t\treturn longestRun <= MAX_RUN;\n\t}", "public static boolean isCompound(String a, String b) {\n\t\t\n\t\tboolean test = false;\n\n\t\tString[] acompounds = a.split(\"(?<=.)(?=\\\\p{Lu})\");\n\t\tString[] bcompounds = b.split(\"(?<=.)(?=\\\\p{Lu})\");\n\t\t\n\t\tSystem.out.println(\"length-1: \" + bcompounds[bcompounds.length-1]);\n\t\tSystem.out.println(\"length-2: \" + bcompounds[bcompounds.length-2]);\n\t\tSystem.out.println(\"length-3: \" + bcompounds[bcompounds.length-3]);\n\n\t\tif (acompounds.length > 2 && bcompounds.length > 2) {\n\t\t\t\n\t\t\tSystem.err.println(\"true\");\n\n\t\t\t//if (RadioNavigationAid.equals(Aid) || (RadioNavigationAid.equals(X|X|Aid)\n\t\t\tif (b.equals(acompounds[acompounds.length-1]) || b.equals(acompounds[acompounds.length-1]+acompounds[acompounds.length-2] + acompounds[acompounds.length-3])) {\n\n\t\t\t\ttest = true;\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\t//if (NavigationAid.equals(Aid) || (NavigationAid.equals(Radio|Navigation|Aid)\n\t\t\tSystem.out.println(\"Trying: \" + a + \" = \" + bcompounds[bcompounds.length-1]);\n\t\t\tif (a.equals(bcompounds[bcompounds.length-1]) || a.equals(bcompounds[bcompounds.length-1]+bcompounds[acompounds.length-2] + bcompounds[bcompounds.length-3])) {\n\t\t\t\t\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t\t\n\t\t\t//if (NavigationAid.equals(NavigationAid) || (NavigationAid.equals(Radio|Navigation|Aid)\n\t\t\tSystem.out.println(\"Trying: \" + a + \" = \" + bcompounds[bcompounds.length-1]);\n\t\t\tif (a.equals(bcompounds[bcompounds.length-1]) || a.equals(bcompounds[bcompounds.length-3]+bcompounds[acompounds.length-2] + bcompounds[bcompounds.length-1])) {\n\t\t\t\t\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t else if (acompounds.length > 1) {\n\n\t\t\tif (b.equals(acompounds[acompounds.length-1]) || b.equals(acompounds[acompounds.length-1]+acompounds[acompounds.length-2])) {\n\n\t\t\t\ttest = true;\n\t\t\t}\n\t\t}\n\t\treturn test;\n\n\t}", "private boolean isMatrix(String s) {\n\t\treturn (s.equals(\"A\") || s.equals(\"B\"));\n\t}", "private boolean isCanLink(String[] strA1, String[] strA2) {\n\t\tboolean flag = true;\n\t\tif(strA1.length != strA2.length){\n\t\t\treturn false;\n\t\t}else {\n\t\t\tfor(int i = 0; i < strA1.length - 1; i++){\n\t\t\t\tif(!strA1[i].equals(strA2[i])){\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(strA1[strA1.length -1].equals(strA2[strA1.length -1])){\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "private static boolean rotation(String in, String out) {\n\t\tStringBuilder sb = new StringBuilder(in+in);\n\t\tSystem.out.println(sb.toString());\n\n\n\t\tSystem.out.println((in+in).contains(out));\n\t\treturn in.contentEquals(out);\n\t}", "private boolean checkString(){\n createString();\n char[] charsJoinedString=this.joinedTextPalindrome.toCharArray();\n int lengthString=charsJoinedString.length-1;\n for(int i=0;i<charsJoinedString.length;i++){\n if(charsJoinedString[i]!=charsJoinedString[lengthString]){\n return false;\n }\n lengthString--;\n }\n return true;\n \n }", "public abstract boolean accepts(String string);", "public static void main(String[] args) {\n\n\t\tString a = \"aabbbc\", b =\"cbad\";\n\t\t// a=abc\t\t\t\tb=cab\n\t\t\n\t\t\n\t\tString a1 =\"\" , b1 = \"\"; // to store all the non duplicated values from a\n\t\t\n\t\tfor(int i=0; i<a.length();i++) {\n\t\t\tif(!a1.contains(a.substring(i,i+1)))\n\t\t\t\ta1 += a.substring(i,i+1);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length();i++) {\n\t\t\tif(!b1.contains(b.substring(i,i+1)))\n\t\t\t\tb1 += b.substring(i,i+1);\n\t\t}\n\t\t\t\t\n\t\tchar[] ch1 = a1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\t\n\t\tchar[] ch2 = b1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tArrays.sort(ch1);\n\t\tArrays.sort(ch2);\n\t\t\n\t\tSystem.out.println(\"=====================================================\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tString str1 = Arrays.toString(ch1);\n\t\tString str2 = Arrays.toString(ch2);\n\t\t\n\t\tif(str1.contentEquals(str2)) {\n\t\t\tSystem.out.println(\"true, they build out of same letters\");\n\t\t}else { \n\t\t\tSystem.out.println(\"fasle, there is something different\");\n\t\t}\n\t\t\n\n\t\t\n\t\t// SHORTER SOLUTION !!!!!!!!!!!!!!!!!!!!\n\t\t\n//\t\tString Str1 = \"aaaabbbcc\", Str2 = \"cccaabbb\";\n//\t\t\n//\t\tStr1 = new TreeSet<String>( Arrays.asList(Str1.split(\"\"))).toString();\n//\t\tStr2 = new TreeSet<String>( Arrays.asList(Str2.split(\"\"))).toString();\n//\t\tSystem.out.println(Str1.equals(Str2));\n//\t\t\n//\t\t\n\t\t\n}", "public static boolean isAnagram (String word1, String word2){\n boolean check = false;\n String one = \"\";\n String two = \"\";\n int counter =0;\n int counter1 =0;\n for(int i=0; i<word1.length(); i++){\n counter=0;\n for(int k=0; k<word2.length(); k++){\n if(word1.charAt(i) == word2.charAt(k) ){\n counter++;\n }\n }\n if(counter ==1){\n counter1++;\n }\n }\n if (counter1 == word1.length() && counter1 == word2.length() ){\n check = true;\n }\n return check;\n }", "private boolean containedIn(String a, String b){\n if(a.length() > b.length())return false;\n int aInd = 0;\n int bInd = 0;\n\n while(bInd < b.length()){\n if(aInd >= a.length())return true;\n char bChar = b.charAt(bInd);\n char aChar = a.charAt(aInd);\n if(bChar == aChar){\n aInd++;\n }\n bInd++;\n }\n return false;\n }", "@Override\n\tpublic boolean checkAnagram(String firstString, String secondString) {\n\t\tchar[] characters = firstString.toCharArray();\n\t\tStringBuilder sbSecond = new StringBuilder(secondString);\n\n\t\tfor(char ch : characters){\n\t\t\tint index = sbSecond.indexOf(\"\" + ch);\n\t\t\tif(index != -1){\n\t\t\t\tsbSecond.deleteCharAt(index);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Test //TEST TWO\n void testallLowerBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"dwarfhotot\"); //Dwarf Hotot\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Plate number exercise\");\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\tString ABC1234aaa = \"ABC1234aaa\";\r\n\t\tSystem.out.println(\"Is ABC1234aaa valid? -- \" + ABC1234aaa.matches(PLATE_NUMBER_FORMAT));\r\n\t\t\r\n\t\tString AB1234DF= \"AB1234DF\";\r\n\t\tSystem.out.println(\"Is AB1234DF valid? -- \" + AB1234DF.matches(PLATE_NUMBER_FORMAT));\r\n\t\t\r\n\t\t\r\n\t\tString AB1234DFG = \"AB1234DFG\";\r\n\t\tSystem.out.println(\"Is AB1234DFG valid? -- \" + AB1234DFG.matches(PLATE_NUMBER_FORMAT));\r\n\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\t\r\n\t\tSystem.out.println(\"Replace All exercise\");\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\t\r\n\t\tString str1 = \"123458\";\r\n\t\t\r\n\t\tSystem.out.println(str1 + \" replace 8 with 'eight' \\t\" +str1.replaceAll(\"8\", EIGHT));\r\n\t\t\r\n\t\tString str2 = \"ABC82348GHIJ8\";\r\n\t\tSystem.out.println(str2 + \" replace 8 with 'eight' \\t\" +str2.replaceAll(\"8\", EIGHT));\r\n\t\t\r\n\t\tSystem.out.println(\"Regular Expression exercise\");\r\n\t\t\r\n\t\tSystem.out.println(\"Count words exercise\");\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\t\r\n\t\tString myString = \"I am currently very hungry.\";\r\n\t\t\r\n\t\tSystem.out.println(\"Word count: \" + myString.split(WORD).length);\r\n\t\t\r\n\t\tSystem.out.println(\"Check area code exercise\");\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\t\r\n\t\tString phone1 = \"651-345-6789\";\r\n\t\tString phone2 = \"641-451-3222\";\r\n\t\tString phone3 = \"231-651-3442\";\r\n\t\t\r\n\t\tSystem.out.println(\"Is phone number: \" + phone1 + \" from IA?\\t\" + phone1.matches(IA_AREA_CODE) );\r\n\t\tSystem.out.println(\"Is phone number: \" + phone2 + \" from IA?\\t\" + phone2.matches(IA_AREA_CODE) );\r\n\t\tSystem.out.println(\"Is phone number: \" + phone3 + \" from IA?\\t\" + phone3.matches(IA_AREA_CODE) );\r\n\t\t\r\n\t\tSystem.out.println(\"Email address format checker\");\r\n\t\tSystem.out.println(\"------------------------------------------------------\");\r\n\t\t\r\n\t\tString email1 = \"[email protected]\";\r\n\t\tString email2 = \"[email protected]\";\r\n\t\tString email3 = \"abc.def*gmail.com\";\r\n\t\t\r\n\t\tSystem.out.println(\"Is email address: \" + email1 + \" valid?\\t\" + email1.matches(EMAIL_ADDRESS_FORMAT));\r\n\t\tSystem.out.println(\"Is email address: \" + email2 + \" valid?\\t\" + email2.matches(EMAIL_ADDRESS_FORMAT));\r\n\t\tSystem.out.println(\"Is email address: \" + email3 + \" valid?\\t\" + email3.matches(EMAIL_ADDRESS_FORMAT));\r\n\t\t\r\n\t\tSystem.out.println(\"======================================================\\n\");\r\n\t\tSystem.out.println(\"Using Pattern and Matcher Classes\");\r\n\t\t\r\n\t\tMatcher matcher;\r\n\t\tPattern pattern = Pattern.compile(PLATE_NUMBER_FORMAT);\r\n\t\t\r\n\t\tmatcher = pattern.matcher(ABC1234aaa);\r\n\t\tSystem.out.println(\"Is ABC1234aaa valid? -- \" + matcher.matches());\r\n\t\t\r\n\t\tmatcher = pattern.matcher(AB1234DF);\r\n\t\tSystem.out.println(\"Is AB1234DF valid? -- \" + matcher.matches());\r\n\t\t\r\n\t\tmatcher = pattern.matcher(AB1234DFG);\r\n\t\tSystem.out.println(\"Is AB1234DFG valid? -- \" + matcher.matches());\r\n\t\t\r\n\t\tSystem.out.println(\"======================================================\");\r\n\t\tpattern = Pattern.compile(\"8\");\r\n\t\tmatcher = pattern.matcher(str1);\r\n\t\t\r\n\t\tSystem.out.println(str1 + \" replace 8 with 'eight' \\t\" +matcher.replaceAll(EIGHT));\r\n\t\t\r\n\t\tmatcher = pattern.matcher(str2);\r\n\t\tSystem.out.println(str2 + \" replace 8 with 'eight' \\t\" +matcher.replaceAll(EIGHT));\r\n\t\t\r\n\t\t\r\n\t}", "public static boolean isAnagramFuncApproach(String str1, String str2) {\n List<String> list1 = str1.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n List<String> list2 = str2.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n return list1.equals(list2);\n }", "@Test //TEST FOUR\n void testSpacesAndCapitalsBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"Netherland Dwarf\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "public boolean anagram(char [] a, char [] b);", "public static void main(String[] args) {\n\t\tBoolean[] b= new Boolean[26];\n\t\tArrays.fill(b, false);\n\t\tint index=0;\n\t\tString test =\"aabbcc\";\n\t\tfor(int i=0;i<test.length();i++)\n\t\t{\n\t\t\tindex=(int)test.charAt(i)-'a';\n\t\t\tb[index]=true;\n\t\t}\n\t\tfor(int i=0;i<b.length;i++)\n\t\t{\n\t\t\tif(b[i]==false)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"Not pangram\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t String str = \"Happy%^&*Christmas*&*&*)NewYear\"; \n \n\t // similar to Matcher.replaceAll \n\t str = str.replaceAll(\"\\\\p{Punct}\",\" \"); \n\t \n\t System.out.println(str); \n\n\t}", "private static Boolean isAlien(String personaggio){\n\t\treturn personaggio.toLowerCase().contains(\"alien\");\n\t}", "public boolean checkAnagram(char[] str1, char[] str2)\n {\n// Finding lengths of strings\n int len1 = str1.length;\n int len2 = str2.length;\n// If lengths do not match then they cannot be anagrams\n if (len1 != len2)\n return false;\n// Sort both strings\n Arrays.sort(str1);\n Arrays.sort(str2);\n// Comparing the strings which are sorted earlier\n for (int i = 0; i < len1; i++)\n if (str1[i] != str2[i])\n return false;\n return true;\n }", "public static boolean goodRepeats(String sequence) {\n\t\tString repeat = sequence.substring(0, 2);\n\t\tint longestRepeat = 0;\n\t\tfor (int i = 2; i + 1 < sequence.length(); i+=2) {\n\t\t\tif (repeat.startsWith(sequence.substring(i, i + 2))) repeat += sequence.substring(i, i + 2);\n\t\t\telse {\n\t\t\t\tif (repeat.length() / 2 > longestRepeat) longestRepeat = repeat.length() / 2;\n\t\t\t\trepeat = sequence.substring(i, i + 2);\n\t\t\t}\n\t\t}\n\t\trepeat = sequence.substring(1, 3);\n\t\tfor (int i = 1; i + 1 < sequence.length(); i+=2) {\n\t\t\tif (repeat.startsWith(sequence.substring(i, i + 2))) repeat += sequence.substring(i, i + 2);\n\t\t\telse {\n\t\t\t\tif (repeat.length() / 2 > longestRepeat) longestRepeat = repeat.length() / 2;\n\t\t\t\trepeat = sequence.substring(i, i + 2);\n\t\t\t}\n\t\t}\n\t\treturn longestRepeat <= MAX_REPEATS;\n\t}", "public boolean checkIfDublicate(String testPart){\n\t\t\n\t\tchar[] characters = testPart.toCharArray();\n // build HashMap with character and number of times they appear in String\n Map<Character, Integer> charMap = new HashMap<Character, Integer>();\n for (Character ch : characters) {\n if (charMap.containsKey(ch)) {\n charMap.put(ch, charMap.get(ch) + 1);\n } else {\n charMap.put(ch, 1);\n }\n }\n\n\n // Iterate through HashMap and return true if duplicates\n Set<Map.Entry<Character, Integer>> entrySet = charMap.entrySet();\n \n for (Map.Entry<Character, Integer> entry : entrySet) {\n if (entry.getValue() > 1) {\n return false;\n }\n }\n return true;\n\n//Read more: http://www.java67.com/2014/03/how-to-find-duplicate-characters-in-String-Java-program.html#ixzz4KEbZ7fhC\t\n\t}", "static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }", "public static void main(String[] args) {\n String firstString = \"abcd\";\n String secondString = \"dcba\";\n\n // two string may be anagram of they are same in length, character wise.\n if (firstString.length() != secondString.length()) {\n System.out.println(\"Both string are not anagram\");\n }else {\n char[] firstArray = firstString.toCharArray();\n char[] secondArray = secondString.toCharArray();\n\n anagramDetection(firstArray, secondArray);\n }\n }", "private static boolean isIsomorphic(String s, String t) {\n // quick check: diff len => cannot match\n if (s.length() != t.length()) {\n return false;\n }\n\n // record mapping of chars s -> t\n Map<Character, Character> map = new HashMap<>();\n // mark chars that has been mapped\n Set<Character> set = new HashSet<>();\n\n for (int i = 0; i < s.length(); ++i) {\n char sc = s.charAt(i);\n char tc = t.charAt(i);\n // check and map s[i] and t[i]\n if (map.containsKey(sc)) {\n if (map.get(sc) != tc) {\n // a is mapped to b & c\n return false;\n }\n } else {\n if (set.contains(tc)) {\n // cannot map a -> c\n // since there exist b -> c\n return false;\n }\n // map sc -> tc\n map.put(sc, tc);\n set.add(tc);\n }\n }\n\n return true;\n }", "public abstract boolean mo70721d(String str);", "private static boolean anagramWord(String first, String second) {\n\t\tif(first.length()!=second.length())return false;\n\t\tint matches = 0;\n\t\tchar[] a = first.toLowerCase().toCharArray();\n\t\tchar[] b = second.toLowerCase().toCharArray();\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tfor(int j=0; j<b.length; j++){\n\t\t\t\tif(a[i]==b[j])matches++;\n\t\t\t}\n\t\t}\n\t\tif( matches==a.length && matches==b.length )return true;\n\t\treturn false;\n\t}", "private static boolean makeMatch(String strPattern, String lexeme) {\n Pattern pattern = Pattern.compile(strPattern);\n Matcher matcher = pattern.matcher(lexeme);\n return matcher.matches();\n }", "static boolean m5603a(boolean z, String str) {\n return z && str != null && str.endsWith(\"_nomap\");\n }", "public boolean checkSam(String stringA, String stringB) {\r\n\t\tString[] s1 = stringA.split(\" \");\r\n\t\tString[] s2 = stringB.split(\" \");\r\n\t\tif(s1.length == s2.length){\r\n\t\t\tint count = 0;\r\n\t\t\tfor (String sB : s2) {\r\n\t\t\t\tfor (String sA : s1) {\r\n\t\t\t\t\tif(sA.equals(sB)){\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == s2.length){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Input Testing: anargram and margana\");\n\t\tSystem.out.println(\"Expercted output: Anagrams\");\n\t\tif (isAnagram(\"anagram\", \"margana\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t\t\n\t\t//Test Case 2\n\t\tSystem.out.println(\"\\nInput Testing: anagramm and marganaa\");\n\t\tSystem.out.println(\"Expercted output: Not Anagrams\");\n\t\tif (isAnagram(\"anagramm\", \"marganaa\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t\t\n\t\t//Test Case 3\n\t\tSystem.out.println(\"\\nInput Testing: Hello and hello\");\n\t\tSystem.out.println(\"Expercted output: Anagrams\");\n\t\tif (isAnagram(\"Hello\", \"hello\") ) \n\t\t\tSystem.out.println(\"Your output: Anagrams\");\n\t\telse\n\t\t\tSystem.out.println(\"Your output: Not Anagrams\");\n\t}", "public static boolean checkString(String s, Predicate<String> pre1,Predicate<String> pre2) {\n return pre1.or(pre2).test(s);\n }", "public static void main(String[] args) {\n IsomorphicStrings mytest = new IsomorphicStrings();\n String st1 = \"ab\";\n String st2 = \"aa\";\n boolean result = mytest.isIsomorphic(st1, st2);\n System.out.println(\"result is \"+result);\n }" ]
[ "0.78507906", "0.7575345", "0.6075167", "0.582383", "0.5773452", "0.5736795", "0.5734417", "0.5715327", "0.5715183", "0.5713248", "0.566163", "0.5625287", "0.55996996", "0.5599318", "0.5567408", "0.555214", "0.55454063", "0.5541264", "0.55228233", "0.54754764", "0.54636294", "0.5457916", "0.54522437", "0.54436153", "0.5418748", "0.54101413", "0.53836465", "0.53734964", "0.53734624", "0.53695506", "0.5356745", "0.53461266", "0.53224224", "0.5316358", "0.5310556", "0.5309735", "0.53095794", "0.53082603", "0.5306909", "0.5289592", "0.52804923", "0.52789986", "0.5270741", "0.52647567", "0.52644145", "0.52627707", "0.5256382", "0.5248364", "0.5238658", "0.52383846", "0.522985", "0.52293754", "0.5215928", "0.5207598", "0.5203922", "0.5201314", "0.52007794", "0.52006775", "0.52004737", "0.519542", "0.5194855", "0.51914316", "0.5190164", "0.5174772", "0.516874", "0.5165765", "0.51621515", "0.51615375", "0.51540494", "0.5151491", "0.5149226", "0.514788", "0.5138381", "0.5137914", "0.51309556", "0.5130655", "0.5127906", "0.5121345", "0.5121219", "0.51207715", "0.5119203", "0.5115235", "0.51142323", "0.51126766", "0.5108157", "0.5105038", "0.509232", "0.5089314", "0.50892234", "0.5088954", "0.5088837", "0.50888157", "0.5086998", "0.50841296", "0.5080533", "0.5079001", "0.50766456", "0.50741124", "0.5065908", "0.506119" ]
0.79508
0
enleve le brouillard dans toutes les cases que le soldat en argument peut voir
void enleverBrouillard(Soldat s);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sleutelWaarde(){\n if(sleutel100.getX() == speler.getX() && sleutel100.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel100.getWaarde());\n }\n else if(sleutel1002.getX() == speler.getX() && sleutel1002.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel1002.getWaarde());\n }\n else if(sleutel200.getX() == speler.getX() && sleutel200.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel200.getWaarde());\n }\n else if(sleutel300.getX() == speler.getX() && sleutel300.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel300.getWaarde());\n }\n }", "public void buyFarm(){\n bought = !bought;\n }", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }", "public void changerDirectionBateau() {\n\t\tif (partie.getJoueur().getIndiceBateauEnCours() != -1) {\n\t\t\tplacerEauSurVue();\n\t\t\tthis.partie.getJoueur().modifierDirection();\n\t\t\tplacerBateauSurVue();\n\t\t}\n\t}", "@Override\n public void llenardeposito(){\n this.setCombustible(getTankfuel());\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public void alteraBrilhoDeExibicao(float NovoBrilho){\n if (ligado)\n if(NovoBrilho >= 0 && NovoBrilho <= 10){\n brilho = NovoBrilho;\n System.out.println(\"Brilho:\" + NovoBrilho+ \"\\n\");\n \n } else if(NovoBrilho <= 0 && NovoBrilho >= -brilho){\n brilho += NovoBrilho;\n System.out.println(\"Brilho:\" + brilho + \"\\n\");\n }else\n System.out.println(\"Brilho invalido \\n\");\n else \n System.out.println(\"Driver desligado \\n\");\n }", "void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "private boolean analyseQueryBefore(Spieler spieler,Spieler spielerB, Board board) {\r\n\t\t// Switch mit der Spielphase des Spielers\r\n\t\tboolean back = false;\r\n\t\tswitch (spieler.getSpielPhase()) {\r\n\t\t\tcase 0: \t// Werte nur Regel 1 aus\r\n\t\t\t\t\t\tList<Stein> rueckgabe = this.logikCheck.sucheZweiInGleicherReihe(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!rueckgabe.isEmpty() && !rueckgabe.get(0).equals(new Stein(0,0,0, null))) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe.get(0));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 1:\t\tfor(Regel regel: uebergreifendeRegeln) {\r\n\t\t\t\t\t\t\tif(regel.getIfTeil().contains(\"eigene Steine\")) {\r\n\t\t\t\t\t\t\t\tList<Stein> getDataBack = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!getDataBack.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tStein stein = getDataBack.get(1);\r\n\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tList<Stein> zweiGegner = this.logikCheck.sucheZweiInGleicherReihe(spielerB.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!zweiGegner.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tList<Stein> result = this.logikCheck.sucheSteinInderNäheUmGegnerZuBlocken(zweiGegner, spieler);\r\n\t\t\t\t\t\t\t\t\tif(!result.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tStein stein = result.get(0);\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 2:\t\tList<Stein> rueckgabe2 = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\tif(!rueckgabe2.isEmpty()) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(0));\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(1));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault: break;\t\r\n\t\t}\r\n\t\treturn back;\r\n\t}", "@Override\n public boolean checkBuilding(Integer recherche, Integer money) {\n if (money <= Constantes.IMPROVE_HOUSE){\n System.out.println(\"Vous n'avez pas les fonds suffisants pour acheter une nouvelle maison.\");\n return false;\n }\n else {\n return true;\n }\n }", "@Override\n public void atacar(SoldadoDeInfanteria soldado, Pieza receptor) {\n }", "public void faiLavoro(){\n System.out.println(\"Scrivere 1 per Consegna lunga\\nSeleziona 2 per Consegna corta\\nSeleziona 3 per Consegna normale\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n soldiTam += 500;\n puntiVita -= 40;\n puntiFame -= 40;\n puntiFelicita -= 40;\n }\n case 2 -> {\n soldiTam += 300;\n puntiVita -= 20;\n puntiFame -= 20;\n puntiFelicita -= 20;\n }\n case 3 -> {\n soldiTam += 100;\n puntiVita -= 10;\n puntiFame -= 10;\n puntiFelicita -= 10;\n }\n }\n checkStato();\n }", "private boolean shiboudeDeRavNosson(ArrayList<Gelt> m_gelts, ArrayList<Gelt> m_geltHelper, Gelt m_gelt) {\n\t\tplay.Logger.info(\"shiboude De Rav Nosson Algorithm Started\");\n\t\tboolean isUpdate = false;\n\t\tfor (Gelt currGelt : m_gelts) {\n\t\t\tif (!isUpdate) {\n\t\t\t\tif ((currGelt.getDebterID() == m_gelt.getEntitledID()) && (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tint nNewAmount = currGelt.getAmount() - m_gelt.getAmount();\n\t\t\t\t\tif (nNewAmount == 0) {\n\t\t\t\t\t\tcurrGelt.setnDebterID(m_gelt.getDebterID());\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount > 0)) {\n\t\t\t\t\t\tcurrGelt.setnAmount(nNewAmount);\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), m_gelt.getAmount(), currGelt.getEntitledID(),\n\t\t\t\t\t\t\t\tcurrGelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount < 0)) {\n\t\t\t\t\t\tcurrGelt.setnDebterID(m_gelt.getDebterID());\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), Math.abs(nNewAmount), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tcurrGelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t} else if ((currGelt.getEntitledID() == m_gelt.getDebterID()) && (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tint nNewAmount = currGelt.getAmount() - m_gelt.getAmount();\n\t\t\t\t\tif (nNewAmount == 0) {\n\t\t\t\t\t\tcurrGelt.setnEntitledID(m_gelt.getEntitledID());\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount > 0)) {\n\t\t\t\t\t\tcurrGelt.setnAmount(nNewAmount);\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(currGelt.getDebterID(), m_gelt.getAmount(), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tm_gelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount < 0)) {\n\t\t\t\t\t\tcurrGelt.setnEntitledID(m_gelt.getEntitledID());\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), Math.abs(nNewAmount), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tm_gelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn isUpdate;\n\t}", "void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }", "public void bajarBloque() {\n\t\tif (piezaActual != null) {\n\t\t\tif (Mapa.getInstance().estaLibre(piezaActual.getBloque3().getX(),\n\t\t\t\t\tpiezaActual.getBloque3().getY() + 1)) {\n\t\t\t\tpiezaActual.getBloque3().bajar(); // Dejar en ese orden\n\t\t\t\tpiezaActual.getBloque2().bajar();\n\t\t\t\tpiezaActual.getBloque1().bajar();\n\t\t\t} else {\n\t\t\t\tthis.piezaNueva();\n\t\t\t}\n\t\t}\n\t}", "public void effetDeCarte(int idEffet, Joueur joueurQuiJoueLaCarte, Plateau plateau) {\n switch (idEffet) {\n case 0:\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 1:\n joueurQuiJoueLaCarte.deck.piocher(2);\n break;\n case 2:\n joueurQuiJoueLaCarte.deck.piocher(3);\n break;\n case 3:\n joueurQuiJoueLaCarte.gagnerDegats(1);\n break;\n case 4:\n joueurQuiJoueLaCarte.gagnerDegats(2);\n break;\n case 5:\n joueurQuiJoueLaCarte.gagnerDegats(3);\n\n break;\n case 6:\n joueurQuiJoueLaCarte.gagnerDegats(4);\n break;\n case 7:\n joueurQuiJoueLaCarte.gagnerRunes(1);\n break;\n case 8:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n break;\n case 9:\n gagnerDesRunes(joueurQuiJoueLaCarte,3);\n break;\n case 11:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n break;\n case 12:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n break;\n case 14:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n joueurQuiJoueLaCarte.piocher(1);\n break;\n case 15:\n joueurQuiJoueLaCarte.tuerUneCarteAvecDeLattaqueGratuitement(plateau);\n System.out.println(\"DEfeat a monster that has 4 D or less without paying it cost\");\n break;\n case 16:\n System.out.println(\"DEfeat a monster that has 6 D or less without paying it cost\");\n break;\n case 17:\n //joueurQuiJoueLaCarte.deck.piocher(1);\n System.out.println(\" You may banish a card in the center row\");\n break;\n case 18:\n System.out.println(\"Discard a card, if you do, draw two cards\");\n break;\n case 19:\n System.out.println(\"Copy l'effet d'un Héros joué ce tour-ci\");\n break;\n case 20:\n System.out.println(\"Once per turn you may draw a card\");\n break;\n case 21:\n System.out.println(\"You may banish this Construct to take an additional turn after this one.\");\n break;\n case 22:\n System.out.println(\"Acquire a Hero without paying its cost. Place in on top of your deck.\");\n break;\n case 23:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n break;\n case 24:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n verifLifebound(joueurQuiJoueLaCarte);\n break;\n case 25:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 26:\n System.out.println(\"Once per turn, gain 1 runes, the first time you play a lifebound hero, each turn gain 1 recompense\");\n break;\n case 27:\n System.out.println(\"Once per turn , gain 1d\" +\n \"Once per turn, you may spend 4r to gain 3 recompense\");\n break;\n case 28:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n plusDeDeuxConstructeur(joueurQuiJoueLaCarte);\n System.out.println(\"Draw a card if you control 2 or moreConstrcut\");\n break;\n case 29:\n System.out.println(\"Gain 1d or 1r\");\n break;\n case 30:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Gain 2r You pay 1R less the next time you acquire a Construc this turn\");\n break;\n case 31:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, when you put a Mechana Construc into play (including this one) , draw a card\");\n break;\n case 32:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, gain 2d.You may spend it only to acquire Mechana Construct\");\n break;\n case 33:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\" Once per turn\");\n gagner1DParTourPourChaqueMechaConstruct(joueurQuiJoueLaCarte);\n\n break;\n case 34:\n System.out.println(\"You may treat all Construcs as Mechana Construcs\");\n break;\n case 35:\n System.out.println(\"Once per turn, when you acquire another Mechana Construc, you may put it directly into play\");\n break;\n case 36:\n System.out.println(\"Once per turn ,gain 1 r . you may spend it only to acquire Mechana Construc\");\n break;\n case 37:\n joueurQuiJoueLaCarte.deck.piocher(2);\n System.out.println(\"Banish a card in you hand\");\n break;\n case 38:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 39:\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 40:\n System.out.println(\"Once per turn, gain 3d\");\n break;\n case 41:\n System.out.println(\"Once per turn, gain 1d\");\n break;\n case 42:\n System.out.println(\"Once per turn gain 1 The first time you deafeat a monster in the center row each turn, gain 1 R\");\n break;\n case 43:\n System.out.println(\"Unbanishable You may acquire or defeat any car in the center row without paying its cost\");\n break;\n case 44:\n System.out.println(\"Each opponent must destryo a Construc he controls\");\n break;\n case 45:\n System.out.println(\"Banish a card un the center row and/or in you discard pile\");\n break;\n case 46:\n System.out.println(\"Banish a card un the center row\");\n break;\n case 47:\n System.out.println(\"If an opponent has more than one construct, that player must destroy all but one Construct he controls\");\n break;\n case 48:\n System.out.println(\"Take a card at random from each oppenent's hand and add that card to your hands\");\n break;\n }\n\n }", "private void moverJogadorDaVez(int dado1, int dado2) throws Exception {\n // System.out.println(\"moverJogadorDaVez\" + dado1 + \" , \" + dado2);\n\n print(\"\\ttirou nos dados: \" + dado1 + \" , \" + dado2);\n int valorDados = dado1 + dado2;\n\n int jogador = this.jogadorAtual();\n\n boolean ValoresIguais = false;\n\n\n //preciso saber se o jogador vai passar pela posição 40, o que significa\n //ganhar dinheiro\n this.completouVolta(jogador, valorDados);\n\n if (dado1 == dado2) {\n ValoresIguais = true;\n } else {\n ValoresIguais = false;\n }\n\n //movendo à posição\n this.moverJogadorAPosicao(jogador, valorDados, ValoresIguais);\n this.print(\"\\tAtual dinheiro antes de ver a compra:\" + this.listaJogadores.get(jogador).getDinheiro());\n this.print(\"\\tVai até a posição \" + this.posicoes[jogador]);\n\n //vendo se caiu na prisao\n if (this.posicoes[this.jogadorAtual()] == 30 && this.prisao == true) {\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n DeslocarJogador(jogador, 10);\n listaJogadores.get(jogadorAtual()).adicionarComandoPay();\n }\n\n\n\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);//busca em -1, pois eh um vetor\n\n\n if (this.isCompraAutomatica()) {\n this.realizarCompra(jogador, lugar);\n }\n\n if (!this.posicaoCompravel(this.posicoes[jogador])) {\n this.print(\"\\t\" + lugar.getNome() + \" não está à venda!\");\n\n\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n //não cobrar aluguel de si mesmo\n if (!nomeDono.equals(this.listaJogadores.get(this.jogadorAtual()).getNome())) {\n\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n if (!lugar.estaHipotecada()) {\n this.pagarFerrovia(possivelDono.getId(), jogador, 25, lugar.getNome());\n }\n } else {\n\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n int valorAluguel = 0;\n if (this.posicoes[this.jogadorAtual()] != 12 && this.posicoes[this.jogadorAtual()] != 28) {\n valorAluguel = this.tabuleiro.getLugarPrecoAluguel(this.posicoes[jogador]);\n\n } else {\n if (possivelDono.getQuantidadeCompanhias() == 1) {\n valorAluguel = 4 * valorDados;\n\n }\n if (possivelDono.getQuantidadeCompanhias() == 2) {\n valorAluguel = 10 * valorDados;\n\n }\n }\n if (!lugar.estaHipotecada()) {\n this.pagarAluguel(possivelDono.getId(), jogador, valorAluguel, lugar.getNome());\n }\n\n }\n\n }\n }\n\n }\n\n\n this.pagarEventuaisTaxas(jogador);\n\n if ((this.posicoes[this.jogadorAtual()] == 2 || this.posicoes[jogadorAtual()] == 17 || this.posicoes[jogadorAtual()] == 33) && cards == true) {\n realizaProcessamentoCartaoChest();\n }\n\n if ((this.posicoes[this.jogadorAtual()] == 7 || this.posicoes[jogadorAtual()] == 22 || this.posicoes[jogadorAtual()] == 36) && cards == true) {\n realizaProcessamentoCartaoChance();\n }\n\n\n\n\n this.print(\"\\tAtual dinheiro depois:\" + this.listaJogadores.get(jogador).getDinheiro());\n\n\n\n }", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}", "public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}", "public void billeMurs() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\tint mur = 0;\n\n\t\t// Contact Gauche de la bille\n\t\tif (billeEnCours.GM()[0] <= 0) {\n\t\t\tmur = 1;\n\t\t}\n\n\t\t// Contact Droite de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.DM()[0] >= limiteDroite) {\n\t\t\t\tmur = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Contact Haut de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.MH()[1] <= 0) {\n\t\t\t\tmur = 3;\n\t\t\t}\n\t\t}\n\n\t\t// Contact Bas de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.MB()[1] >= limiteHaut) {\n\t\t\t\tmur = 7;\n\t\t\t\tperteDeVie();\n\t\t\t\tbilleEnCours.changeVitesse(vitBilleInitiale);\n\t\t\t\tbilleEnCours.changePosition(posBilleInitiale);\n\t\t\t\tbarreEnCours.changePosition(posBarreInitiale);\n\t\t\t}\n\t\t}\n\n\t\t// Mise à jour de la vitesse\n\n\t\tif ((mur == 1)||(mur == 5)) {\n\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t\tif (mur == 3) {\n\t\t\tint[] nv = {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t}", "private void pulsarItemMayus(){\n if (mayus) {\n mayus = false;\n texto_frases = texto_frases.toLowerCase();\n }\n else {\n mayus = true;\n texto_frases = texto_frases.toUpperCase();\n }\n fillList(false);\n }", "@Override\n\tpublic boolean vender(String placa) {\n\t\treturn false;\n\t}", "private boolean canBlackSaveItselfRightAhead(Pedina pedina) {\n boolean condizione1 = false;\n boolean condizione2 = false;\n boolean fine1 = false;\n boolean fine2 = false;\n boolean fine3 = false;\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 1 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 1 == arrayPedineBianche.get(i).getY()) {\n condizione1 = true;\n }\n }\n \n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() - 1))\n condizione2 = true;\n \n \n if (condizione1 && condizione2) {\n if(pedina.getX() - 1 < 0 || pedina.getY() - 1 < 0)\n return false;\n else {\n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n fine1 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine1 = true;\n }\n }\n }\n \n if(!fine1){\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n fine1 = true;\n }\n \n if(pedina instanceof Damone) {\n if(pedina.getX() - 1 < 0 || pedina.getY() + 1 > 7)\n fine2 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 2 == arrayPedineBianche.get(i).getY()) {\n fine2 = true;\n }\n }\n }\n \n if(!fine2) {\n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() + 1)) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() + 1);\n return true;\n } else\n fine2 = true;\n }\n \n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine3 = true;\n }\n }\n \n if(!fine3) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n return false;\n \n } else\n return false; \n } \n } else\n return false; \n }", "private void caiu(Bola bola, Paddle paddle) {\n\t\tint continuar;\n\t\tbola.bolaInicio();\n\t\tpaddle.paddleInicio();\n\t\tmove = false;\n\t\tvida--;\n\t\tif (vida == 0) {\n\t\t\tcontinuar = JOptionPane.showConfirmDialog(null, \"Deseja jogar novamente?\", \"Game Over\",\n\t\t\t\t\tJOptionPane.YES_NO_OPTION);\n\t\t\tif (continuar == 0) {\n\t\t\t\treiniciar();\n\t\t\t} else {\n\t\t\t\tSystem.exit(0);\n\t\t\t} // fecha else interno\n\t\t} // fecha if para continuar\n\n\t}", "private void reserveChambre() {\n\t\tfor(Chambre chambre : this.getChambres()) {\n\t\t\tif(chambre.equals(this.chambresVides().get(0))) {\n\t\t\t\tchambre.setReserve(true);\n\t\t\t\tSystem.out.println(\"\\n---------------------------------------\\nVous avez bien réservé cette chambre: |\");\n\t\t\t\tSystem.out.println(chambre.toString());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "public void renovarBolsa() {\n\t\tSystem.out.println(\"Bolsa renovada com suceso!\");\n\t}", "public void moverJugador(char letra) {\n switch (letra) {\n case 'w':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x,y+3,AnchoJugador,largoJugador))){//Comprobamos si en el array de rectangles hacer overlaps con nuestro jugador\n olision=true;//Si lo hace olision se vuelve true y no se movera\n break;\n }else{\n olision=false;//Si no lo hace olision de volvera false y se movera\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){//Comprobamos si nuestro personaje hace overlaps con alguna salida\n switch (colisiones.getObj2()[b].getName()){//Si colisiona este switch se encargara de ver con que salida estamos chocando mediante el nombre de los rectangulos(Esto se pone en el tiled)\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,10));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n break;\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n y=y+3;\n }else{\n\n }\n\n break;\n case 's':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x,y-3,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\");\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n break;\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n\n y=y-3;\n }\n break;\n case 'd':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x+3,y,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\");\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.getScreen().dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n x=x+3;\n }\n break;\n case 'a':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x-3,y,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\"+colisiones.getObj2()[b].getName());\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n x=x-3;\n }\n break;\n }\n }", "public void placerBateauSurVue() {\n\t\tint compteur = 1;\n\t\tif (partie.verifierSiPoseBateauPossible()) {\n\t\t\tfor (int i : partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()].getCaseOnId()) {\n\t\t\t\tif (i != -1)\n\t\t\t\t\tvue.setfield(i, partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()]\n\t\t\t\t\t\t\t.getImageDirectoryFinal(), compteur, true);\n\n\t\t\t\tcompteur++;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int i : partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()].getCaseOnId()) {\n\t\t\t\tif (i != -1)\n\t\t\t\t\tvue.setfield(i, partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()]\n\t\t\t\t\t\t\t.getImageDirectoryFinal(), compteur, false);\n\n\t\t\t\tcompteur++;\n\t\t\t}\n\t\t}\n\t}", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "public void angreifen(Lebewesen lebewesen) {\n\t\tdouble zahl = Math.random(); //generiert eine Zahl (double) zwischen 0 und 1\r\n\t\tif(zahl < 0.9d){ //leichtverletzen\r\n\t\t\tlebewesen.leichtVerletzen();\r\n\t\t\t//System.out.println(\"Monster: \"+ this.aktuellerZustand);\r\n\t\t}else if(zahl < 0.98d){ //schwer verletzen\r\n\t\t\tlebewesen.starkVerletzen();\r\n\t\t\t//System.out.println(\"Monster: \"+ this.aktuellerZustand);\r\n\t\t}else{ //direkt töten\r\n\t\t\tlebewesen.toetlichVerletzen();\r\n\t\t\t//System.out.println(\"Monster: \"+ this.aktuellerZustand);\r\n\t\t}\r\n\t}", "private String mayorTurno(ABBTurnosTDA a){\t\t\n\t\tif(a.hijoDer().arbolVacio())\n\t\t\treturn a.turno();\n\t\telse\n\t\t\treturn mayorTurno(a.hijoDer());\n\t}", "public void HandleLejos(Integer old_position, Integer new_position){\n int compare = new_position-old_position;\n switch (compare){\n case(1):\n Lejos.Right();\n Lejos.TimeToBombSound = TIME_STRAIGHT+TIME_SIDE*2;\n break;\n case(-1):\n Lejos.Left();\n Lejos.TimeToBombSound = TIME_STRAIGHT+TIME_SIDE*2;\n break;\n case(-10):\n Lejos.Forward();\n Lejos.TimeToBombSound = TIME_STRAIGHT;\n break;\n case(10):\n Lejos.Back();\n Lejos.TimeToBombSound = TIME_STRAIGHT;\n break;\n case(-9):\n Lejos.ForwardRight();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(9):\n Lejos.BackLeft();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(-11):\n Lejos.ForwardLeft();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n case(11):\n Lejos.BackRight();\n Lejos.TimeToBombSound = TIME_STRAIGHT*2+TIME_SIDE*2;\n break;\n }\n checkBombs(new_position);\n }", "private void balancearAgrega(Vertice<T> v){\n\tif(v == this.raiz){\n\t v.color = Color.NEGRO;\n\t return;\n\t}else if(v.padre.getColor() == Color.NEGRO){\n\t return;\n\t}\n\tVertice<T> abuelo = v.padre.padre;\n\tif(v.padre == abuelo.derecho){\n\t if(abuelo.izquierdo != null &&\n\t abuelo.izquierdo.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.izquierdo.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\t \n\t }else if(v.padre.izquierdo == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraDerecha(v.padre);\n\t\tbalancearAgrega(v2); \n\t }else if(v.padre.derecho == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraIzquierda(abuelo);\n\t }\n\t}else if(v.padre == abuelo.izquierdo){\n\t if(abuelo.derecho != null &&\n\t abuelo.derecho.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.derecho.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\n\t }else if(v.padre.derecho == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraIzquierda(v.padre);\n\t\tbalancearAgrega(v2); \n\t \n\t }else if(v.padre.izquierdo == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraDerecha(abuelo);\n\t }\n\t} \t\n\t\n }", "public void billeBarre() { \t\t\t\t\t\t\t\t\t\t\t\n\t\tint contact = 0;\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\t// Étude des contacts avec les 8 points de la bille\n\t\t// Contact GaucheHaut de la bille\n\n\t\t// Contact haut de la bille\n\t\tint[] p = billeEnCours.MH();\n\t\tif (p[1] <= barreEnCours.bas() && p[1] >= barreEnCours.haut() && p[0] <= barreEnCours.droite() && p[0] >= barreEnCours.gauche()) {\n\t\t\tcontact = 3;\n\t\t}\n\n\t\t// Contact bas de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.MB();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 7;\n\t\t\t}\n\t\t}\n\n\t\t// Contact droite de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.DM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Contact gauche de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.GM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 1;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 2;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 4;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 8;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 6;\n\t\t\t}\n\t\t}\n\n\t\t// Mise à jour de la vitesse \n\n\t\t// Rencontre d'un coin\n\t\tif ((((contact == 2) || (contact == 4))) || ((contact == 8) || (contact == 6))) {\n\t\t\tbilleEnCours.demiTour();\n\t\t}\n\n\t\t// Contact Classique\n\t\t// Gauche - Droite\n\t\tif ((contact == 1) || (contact == 5)) {\n\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t\t// Haut - Bas : Déviation de la balle\n\t\tif ((contact == 3) || (contact == 7)) {\n\t\t\tint[] nv = new int[] {1,1};\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4 && billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] - 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] + 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\t\t\t\n\n\n\t}", "public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public void bouger(int origine, int destination) {\n\t\t\n\t}", "@Test\n public void bateauAtNoBateau() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux ba = new ContreTorpilleur(new Place[]{new Place(\"A5\")}, j, p, true);\n g.setListBateaux(Collections.singletonList(ba));\n\n Bateaux b = j.bateauAt(new Place(\"A6\"), g);\n\n assertNull(\"Il n'y a pas de bateau ici\", b);\n }", "private String menorTurno(ABBTurnosTDA a){\t\t\n\t\tif(a.hijoIzq().arbolVacio())\n\t\t\treturn a.turno();\n\t\telse\n\t\t\treturn menorTurno(a.hijoIzq());\n\t}", "final boolean hanArribatAlFinal() {\n int cont = 0;\n for (int i = 0; i < soldats.size(); i++) {\n if (soldats.get(i).isHaArribat()) {\n cont++;\n }\n }\n\n if (cont == soldats.size()) {\n\n return true;\n }\n\n return false;\n\n }", "public static void jouerAuJustePrix() {\n\t\tint nbVies=Tools.inputInt(\"Combien de tentatives voulez-vous ? \");\n\t\tint limite=Tools.inputInt(\"Quel est le nombre maximum à prendre en compte?\");\n\t\tint nbATrouver=Tools.randomint(limite);\n\t\tint nbPropose;\n\t\t\n\t\twhile (nbVies>0){\n\t\t\tnbPropose=Tools.inputInt(\"Saisissez un nombre : \");\n\t\t\tif (afficherResultatProposition(nbPropose, nbATrouver)) {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tnbVies=nbVies-1;\n\t\t}\n\t\t\n\t\tif (nbVies==0) {\n\t\t\tSystem.out.println(\"Game Over\");\n\t\t}\n\t}", "public static void brisanjeVozila() {\n\t\tint i = 0;\n\t\tfor (Vozilo v : Main.getVozilaAll()) {\n\t\t\tSystem.out.println(i + \"-Vrsta Vozila|\" + v.getVrstaVozila() + \" Registarski broj|\" + v.getRegBR()\n\t\t\t\t\t+ \" Status izbrisanosti vozila|\" + v.isVozObrisano());\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println(\"----------------------------------------\");\n\t\tSystem.out.println(\"Unesite redni broj vozila koje zelite da izbrisete ili vratite u neobrisano stanje\");\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tVozilo temp = Main.getVozilaAll().get(redniBroj);\n\t\t\tif (UtillMethod.voziloImaRezervacije(temp)) {\n\t\t\t\tSystem.out.println(\"Ovo vozilo ima aktivne rezervacije i ne moze biti obrisano!\");\n\t\t\t} else {\n\t\t\t\tif (temp.isVozObrisano()) {\n\t\t\t\t\ttemp.setVozObrisano(false);\n\t\t\t\t\tSystem.out.println(\"Vozilo je vraceno u sistem(neobrisano stanje)\");\n\t\t\t\t} else {\n\t\t\t\t\ttemp.setVozObrisano(true);\n\t\t\t\t\tSystem.out.println(\"Vozilo je uspesno izbrisano!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Ne postoji vozilo sa tim brojem!\");\n\t\t}\n\t}", "@Override\r\n\tpublic void verteidigen(Lebewesen lebewesen) {\n\t}", "protected void lowerBot() {\n lowerBot(-.3);\n }", "@Override\r\n\tpublic String fly() {\n\t\tString volar = \"Puede volar\";\r\n\t\treturn volar;\r\n\t}", "private boolean canBlackSaveItselfRightBehind(Pedina pedina) {\n boolean condizione1 = false;\n boolean condizione2 = false;\n boolean fine1 = false;\n boolean fine2 = false;\n boolean fine3 = false;\n\n for (Pedina pedinaBianca : arrayPedineBianche) {\n if (pedina.getX() - 1 == pedinaBianca.getX()\n && pedina.getY() + 1 == pedinaBianca.getY()\n && (pedinaBianca instanceof Damone))\n condizione1 = true;\n }\n \n if(pedina.getX() + 1 <= 7 && pedina.getY() - 1 >= 0 && \n controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1))\n condizione2 = true;\n \n \n if (condizione1 && condizione2) {\n \n if(pedina.getX() + 1 > 7 || pedina.getY() + 1 > 7)\n fine1 = true;\n else { \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() + 2 == arrayPedineBianche.get(i).getY()) {\n fine1 = true;\n }\n }\n }\n \n if(!fine1) {\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() + 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() + 1);\n return true;\n } else\n fine1 = true;\n } \n \n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n fine2 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine2 = true;\n }\n }\n }\n \n if(!fine2) {\n if(controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n fine2 = true;\n }\n \n \n if(pedina instanceof Damone){\n if(pedina.getX() - 1 < 0 || pedina.getY() - 1 < 0)\n fine3 = true;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() - 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()) {\n fine3 = true;\n }\n }\n }\n \n if(!fine3) {\n if(controllaSeCasellaLibera(pedina.getX() - 1, pedina.getY() - 1)) {\n pedina.setXTemp(pedina.getX() - 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n } else\n return false;\n } else\n return false;\n \n } else\n return false;\n \n } else \n return false;\n\n }", "@Test\n public void bateauAtBateau() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux ba = new ContreTorpilleur(new Place[]{new Place(\"A5\")}, j, p, true);\n g.setListBateaux(Collections.singletonList(ba));\n\n Bateaux b = j.bateauAt(new Place(\"A5\"), g);\n\n assertEquals(\"Il n'y a pas de bateau ici\", ba, b);\n }", "public void sendeSpielerWeg(String spieler);", "public void refuelBoat(double amount){\n\t if(amount > 0.0 && amount < 6.0){\n\t if (amount + amountOfFuelInTheTank > capacityOfTheFuelTank)\n\t \tamountOfFuelInTheTank = capacityOfTheFuelTank;\n\t else\n\t \tamountOfFuelInTheTank += amount;\n\t }\n\t }", "private static void verifPayement(){\n\t\tint x,y, dime;\n\t\tx=jeu.getAssam().getXPion()-1;\n\t\ty=jeu.getAssam().getYPion()-1;\n\t\tint caseInfoTapis = jeu.cases[x][y].getCouleurTapis();\n\t\tif(caseInfoTapis == tour || caseInfoTapis == 0){\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t\t\tdime = jeu.payerDime(caseInfoTapis,x,y,0,new boolean[7][7]);\n\t\t\tJoueur payeur = jeu.getJoueurs()[tour-1];\n\t\t\tJoueur paye = jeu.getJoueurs()[caseInfoTapis-1];\n\t\t\tif(jeu.payerVraimentDime(payeur,paye,dime)){\n\t\t\t\tjoueurElimine++;\n\t\t\t}\n\t\t\tconsole.afficherPayeurPaye(payeur, paye, dime);\n\t\t}\n\t}", "protected String comprobarConsumoEnergetico(Letra letra){\r\n if(getConsumoEnergetico() == Letra.A | getConsumoEnergetico() == Letra.B | getConsumoEnergetico() == Letra.C \r\n | getConsumoEnergetico() == Letra.D | getConsumoEnergetico() == Letra.E | getConsumoEnergetico() == Letra.F){\r\n return \"Consumo energetico correcto; letra correcta\";\r\n }\r\n else{\r\n return \"Consumo energetico incorrecto; letra erronea\";\r\n }\r\n}", "private void sterben()\n {\n lebendig = false;\n if(position != null) {\n feld.raeumen(position);\n position = null;\n feld = null;\n }\n }", "public void applyBrake() {\n\t\t\r\n\t}", "public void enfoncerEgal() {\n\t\tthis.pile.push(this.valC);\n\t\tthis.raz = true;\n\t}", "public void placerEauSurVue() {\n\t\tif (partie.getJoueur().getIndiceBateauEnCours() != -1) {\n\t\t\tfor (int i : partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()].getCaseOnId()) {\n\t\t\t\tif (i != -1)\n\t\t\t\t\tvue.setWater(i);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void doit() {\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint i = saisie_entier();\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint j = saisie_entier();\n\t\t// tous deux strictements positifs ou strictement négatifs? \n\t\t// vrai => produit positif\n\t\t// faux => produit negatif ou nul\n\t\tboolean Truth = TrueIfSameTruthValue(i,j,this.estposit);\n if (Truth){afficher_texte(UtilitaireChainesCommunes.resultat_positif);}\n else{ \n \t// l un des deux est soit de signe différent soit nul.\n \t// on vire le cas \"est de signe différent\" (on aurait pu faire l autre)\n \tboolean Truth2 = ((i < 0 && j > 0) || (i > 0 && j < 0));\n \tif (Truth2){afficher_texte(UtilitaireChainesCommunes.resultat_negatif);}\n \telse {afficher_texte(UtilitaireChainesCommunes.nombre_nul);}\n }\n\n\t}", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "public void changerJoueur() {\r\n\t\t\r\n\t}", "public void breathe(){\n\n System.out.println(\"Through big nostrills\");\n }", "@Override\r\n\tpublic boolean lancar(Combativel origem, Combativel alvo) {\r\n DadoVermelho dado = new DadoVermelho();\r\n int valor = dado.jogar();\r\n if(valor < origem.getInteligencia()) {\r\n alvo.defesaMagica(dano);\r\n return true;\r\n }\r\n else {\r\n \tSystem.out.println(\"Voce nao conseguiu usar a magia\");\r\n }\r\n return false;\r\n }", "private void wisselPunten(Speler a, Speler b, int score){\n a.veranderScore(score);\n b.veranderScore(-score);\n }", "public void vainqueurs (HashMap<Integer, Integer> vainqueurs) {\r\n\t\t// Mettre a jour Global.banque si on gagne\r\n\t}", "public void bewegeKamel(Charakter charakter);", "public void onderbreek(){\n \n }", "public static void main(String[] args) {\n\t\tint posIndi = 1;\n\t\tint posLara = 4;\n\n\t\t// Position de la bague\n\t\tint posBague = 7;\n\t\tboolean laraEstSurLaBague = false;\n\t\tboolean indiEstSurLaBague = false;\n\n\t\t// Position de la bombe, le joueur qui tombe sur cette case, voit sa partie\n\t\t// renitialisée\n\t\tint posBombe = 11;\n\n\t\t// Position du passage secret, si un joueur atteint cette case il est direct\n\t\t// propulsé à la case 14\n\t\tint posPassageSecret = 6;\n\n\t\t// Etat du jeu, vrai si personne n'a encore atteint le trésor\n\t\tboolean estEnCours = true;\n\n\t\t// Joueur Courant Indi --> 1 Lara --> 2\n\t\tint joueurCourant = 1;\n\n\t\tPlateauJeu jeu = new PlateauJeu();\n\t\tjeu.placerIndi(posIndi);\n\t\tjeu.placerLara(posLara);\n\t\tjeu.placerBague(posBague);\n\t\tjeu.placerPassage(posPassageSecret);\n\t\tjeu.placerBombe(posBombe);\n\n\t\t// Jeu\n\t\twhile (estEnCours) {\n\t\t\tif (joueurCourant == 1) {\n\t\t\t\tjeu.afficherInformation(\"Tour d'Indi!\");\n\t\t\t\tint de = jeu.lancerDe();\n\t\t\t\tposIndi += de;\n\t\t\t\tif (posIndi == posLara) {\n\t\t\t\t\tposIndi++;\n\t\t\t\t}\n\t\t\t\t// Si Indi est sur la case du passage, on supprime le passage et on empêche tout autre personne de marcher sur le passage\n\t\t\t\tif (posIndi == posPassageSecret) {\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Indi a pris le passage secret, il sera à la case 14, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tposIndi = 14;\n\t\t\t\t\tjeu.supprimerPassage();\n\t\t\t\t\tposPassageSecret = -1;\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\t// Si Indi est sur la case de la bombe, on supprime la bombe et on empêche tout autre personne de marcher sur une bombe\n\t\t\t\tif (posIndi == posBombe) {\n\t\t\t\t\tjeu.supprimerIndi();\n\t\t\t\t\tposIndi = 1;\n\t\t\t\t\tjeu.placerIndi(posIndi);\n\t\t\t\t\tjeu.supprimerBombe();\n\t\t\t\t\tposBombe = -1;\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Indi a pris la bombe, sa partie est renitialisée, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\t// Si Indi est sur la case de la bague, on supprime la bague et on empêche tout autre personne de marcher sur une bague\n\t\t\t\tif (posIndi == posBague) {\n\t\t\t\t\tindiEstSurLaBague = true;\n\t\t\t\t\tjeu.supprimerBague();\n\t\t\t\t\tjeu.placerIndi(posIndi);\n\t\t\t\t\tposBague = -1;\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Indi a pris la bague, il perd un tour, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tposIndi = (posIndi > 16) ? 16 : posIndi;\n\t\t\t\tjeu.deplacerIndi(posIndi);\n\t\t\t\t\n\t\t\t\t// Si Lara n'a pas marché sur la bague, le tour prochain est le sien\n\t\t\t\tif (!laraEstSurLaBague) {\n\t\t\t\t\tjoueurCourant = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Si Lara a marché sur la bague, elle perd un tour\n\t\t\t\tif (laraEstSurLaBague) {\n\t\t\t\t\tlaraEstSurLaBague = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjeu.afficherInformation(\"Tour de Lara!\");\n\t\t\t\tint de = jeu.lancerDe();\n\t\t\t\tposLara += de;\n\t\t\t\tif (posLara == posIndi) {\n\t\t\t\t\tposLara++;\n\t\t\t\t}\n\t\t\t\t// Si Lara est sur la case du passage, on supprime le passage et on empêche tout autre personne de marcher sur le passage\n\t\t\t\tif (posLara == posPassageSecret) {\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Lara a pris le passage secret, elle sera à la case 14, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tposLara = 14;\n\t\t\t\t\tjeu.supprimerPassage();\n\t\t\t\t\tposPassageSecret = -1;\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\t// Si Lara est sur la case de la bombe, on supprime la bombe et on empêche tout autre personne de marcher sur une bombe\n\t\t\t\tif (posLara == posBombe) {\n\t\t\t\t\tjeu.supprimerLara();\n\t\t\t\t\tposLara = 4;\n\t\t\t\t\tjeu.placerLara(posLara);\n\t\t\t\t\tjeu.supprimerBombe();\n\t\t\t\t\tposBombe = -1;\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Lara a pris la bombe, sa partie est renitialisée, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\t// Si Lara est sur la case de la bague, on supprime la bague et on empêche tout autre personne de marcher sur une bague\n\t\t\t\tif (posLara == posBague) {\n\t\t\t\t\tlaraEstSurLaBague = true;\n\t\t\t\t\tjeu.supprimerBague();\n\t\t\t\t\tjeu.placerLara(posLara);\n\t\t\t\t\tposBague = -1;\n\t\t\t\t\tjeu.afficherInformation(\n\t\t\t\t\t\t\t\"Lara a pris la bague, elle perd un tour, cliquez \\\"suivant\\\" pour continuer\");\n\t\t\t\t\tjeu.suivant();\n\t\t\t\t}\n\t\t\t\tposLara = (posLara > 16) ? 16 : posLara;\n\t\t\t\tjeu.deplacerLara(posLara);\n\t\t\t\t\n\t\t\t\t// Si Indi n'a pas marché sur la bague, le tour prochain est le sien\n\t\t\t\tif (!indiEstSurLaBague) {\n\t\t\t\t\tjoueurCourant = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Si Indi a marché sur la bague, il perd un tour\n\t\t\t\tif (indiEstSurLaBague) {\n\t\t\t\t\tindiEstSurLaBague = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Condition de continuation du jeu\n\t\t\testEnCours = posLara < 16 && posIndi < 16;\n\t\t}\n\n\t\tif (posLara == 16) {\n\t\t\tjeu.afficherInformation(\"Lara a gagné! La partie est terminée\");\n\t\t} else {\n\t\t\tjeu.afficherInformation(\"Indi a gagné! La partie est terminée\");\n\t\t}\n\n\t}", "Bicho evolucionar(int bicho);", "final void moureExercit(final Main campB) {\n\n Random r = new Random();\n\n int indexRandom = r.nextInt(soldats.size());\n\n if (!soldats.get(indexRandom).isHaArribat()) {\n soldats.get(indexRandom).mouSoldat(ubicacio, campB);\n\n }\n\n }", "protected void loupNeMangePlus(Plateau.Cases c) throws ActionFailureException {\n\t\t\n\t\tActionAnimal animal = c.getAnimal().getAction();\n\t\t\n\t\t/* Si le loup veut manger, on l'en empêche et on sauve le mouton */\n\t\tif (c.isLoup()) {\n\t\t\tif (animal.isMange()) {\n\n animal.unsetMange();\n ActionAnimal mouton = c.getMouton();\n if (mouton == null) throw new ActionFailureException(\"Loup mange sans mouton\");\n mouton.unsetSeFaitManger();\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif (animal.isSeFaitManger()) {\n\n animal.unsetSeFaitManger();\n ActionAnimal loup = c.getLoup();\n if (loup == null) throw new ActionFailureException(\"Mouton se fait manger sans loup\");\n loup.unsetMange();\n\t\t\t}\n\t\t}\n\t}", "public void stoperJeux() {\n\t\t\n\t\tliaison.stopper();\n\t}", "public boolean buy() throws Exception {\n\n int jogador = this.jogadorAtual();\n\n String lugar = this.tabuleiro.getPlaceName(posicoes[jogador]);\n // System.out.println(\"lugar[jogador]\" + lugar);\n boolean posicaoCompravel = this.posicaoCompravel(posicoes[jogador]);\n boolean isEstatal = this.isPosicaoEstatal(this.posicoes[jogador]);\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true && verificaSeServicoPublicoFoiComprado(this.posicoes[jogador]))) {\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true)) {\n this.listaJogadores.get(jogadorAtual()).addQuantidadeCompanhias();\n\n }\n int posicaoTabuleiro = posicoes[jogador];\n int preco = this.tabuleiro.getLugarPrecoCompra(posicaoTabuleiro);\n Jogador j = listaJogadores.get(jogador);\n this.terminarAVez();\n if (preco <= j.getDinheiro()) {\n this.print(\"\\tPossui dinheiro para a compra!\");\n j.retirarDinheiro(preco);\n this.Donos.put(posicaoTabuleiro, j.getNome());\n\n String nomeLugar = this.tabuleiro.getPlaceName(posicaoTabuleiro);\n j.addPropriedade(nomeLugar);\n if (nomeLugar.equals(\"Reading Railroad\") || nomeLugar.equals(\"Pennsylvania Railroad\") ||\n nomeLugar.equals(\"B & O Railroad\") || nomeLugar.equals(\"Short Line Railroad\")) {\n DonosFerrovias[jogador]++;\n }\n this.print(\"\\tVocê adquiriu \" + nomeLugar + \" por \" + preco);\n this.print(\"\\tAtual dinheiro: \" + j.getDinheiro());\n if (j.temPropriedades() && hipotecaAtiva) {\n j.adicionarComandoHipotecar();\n }\n if (j.verificaSeTemGrupo(posicaoTabuleiro)) {\n if (this.build == true) {\n j.adicionarComandoBuild();\n }\n\n this.tabuleiro.duplicarAluguelGrupo(posicaoTabuleiro);\n\n }\n } else {\n this.print(\"\\tNão possui dinheiro para realizar a compra!\");\n throw new Exception(\"Not enough money\");\n }\n\n } else {\n\n if (this.jaTemDono(posicoes[jogador])) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n\n if (isEstatal && this.publicServices == false) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n if (!posicaoCompravel) {\n throw new Exception(\"Place doesn't have a deed to be bought\");\n }\n }\n\n\n\n return false;\n\n\n\n }", "public void sueldo(){\n if(horas <= 40){\n sueldo = horas * cuota;\n }else {\n if (horas <= 50) {\n sueldo = (40 * cuota) + ((horas - 40) * (cuota * 2));\n } else {\n sueldo = ((40 * cuota) + (10 * cuota * 2)) + ((horas - 50) + (cuota * 3));\n }\n }\n\n }", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }", "@Override\n public boolean controleerWoord(String woord) {\n return true;\n }", "@Override\n\tpublic void effetCase() {\n\t\t\n\t}", "public int bewerten(String spieler){\n\t\treihenPruefen pruefen = new reihenPruefen();\n\t\tString gegner;\n\t\t\n\t\tif(spieler.equals(\"o\")){\n\t\t\tgegner = \"x\";\n\t\t}else{\n\t\t\tgegner = \"o\";\n\t\t}\n\t\t\n\t\tif (pruefen.viererReihe(spielfeld, spieler)){\n\t\t\treturn 4;\n\t\t}\n\t\t\n\t\tif (pruefen.viererReihe(spielfeld, gegner)){\n\t\t\treturn -4;\n\t\t}\n\t\t\n\t\tif (pruefen.dreierReihe(spielfeld, spieler)){\n\t\t\treturn 3;\n\t\t}\n\t\t\n\t\tif (pruefen.dreierReihe(spielfeld, gegner)){\n\t\t\treturn -3;\n\t\t}\n\t\t\n\t\tif (pruefen.zweierReihe(spielfeld, spieler)){\n\t\t\treturn 2;\n\t\t}\n\t\t\t\n\t\tif (pruefen.zweierReihe(spielfeld, gegner)){\n\t\t\treturn -2;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public void beeindig(int gehaaldeSlagen){\n //doe het reguliere-geval\n if(rondetype.isRegulier()){\n updateScore(gehaaldeSlagen);\n }\n // doe het passpel-geval\n else{\n \n }\n }", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "private void heilenTrankBenutzen() {\n LinkedList<Gegenstand> gegenstaende = spieler.getAlleGegenstaende();\n for (Gegenstand g : gegenstaende) {\n if (g.getName().equalsIgnoreCase(\"heiltrank\")) {\n spieler.heilen();\n gegenstaende.remove(g);\n System.out.print(\"Heiltrank wird benutzt\");\n makePause();\n System.out.println(\"Du hast noch \" + zaehltGegenstand(\"heiltrank\") + \" Heiltranke!\");\n return;\n }\n }\n System.out.println(\"Du hast gerade keinen Heiltrank\");\n }", "void appliquerBrouillard();", "private void liberateAroom() {\n\t\tif(this.adminLogin() == 1) {\n\t\t\tSystem.out.println(\"\\n------------------\\n| Bonjour Ibobai |\\n------------------\");\n\t\t\tfor(Chambre chambre : this.getChambres()) {\n\t\t\t\tif(chambre.equals(this.chambresNonVides().get(this.chambresNonVides().size()-1))) {\n\t\t\t\t\tchambre.setReserve(false);\n\t\t\t\t\tSystem.err.println(\"--------------------------------------------------\\nVous avez bien libérée cette chambre:\\n--------------------------------------------------\\n\");\n\t\t\t\t\tSystem.out.println(chambre.toString());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}else {\n\t\t\tSystem.err.println(\"----------------------------\\nVous n'êtes pas un admin! |\\n----------------------------\");\n\t\t}\n\t\t\n\t}", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }", "public static int turnoEnemigo(String enemigoRecibido){\n String enemigo; //variables locales a utilizar\n int ataqueEnemigo;\n Random aleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int inferior;\n int superior;\n \n enemigo=enemigoRecibido;//recibiendo al enemigo elegido por la funcion enemigos\n //comparando con los enemigos disponibles\n switch(enemigo){\n case \"Dark_Wolf\":{\n //ejecutando acciones del enemigo Dark\n inferior=10+nivel;\n superior=10+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo;//retornando el ataque de Dark\n }\n case \"Dragon\":{\n inferior=15+nivel; //ejecutando acciones del enemigo Dragon\n superior=15+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo; //retornando ataque del enemigo Dragon\n }\n default:{\n inferior=25+nivel; //ejecutando acciones del enemigo Golem\n superior=25+nivel+10;\n ataqueEnemigo=(aleatorio.nextInt(superior-inferior+1)+inferior);\n return ataqueEnemigo; //retornando ataque del enemigo Golem\n }\n }\n }", "@Override\n\tpublic String hablar() {\n\t\treturn \"Hola, soy un Buitre y sť volar\";\n\t}", "private boolean canBlackMoveLeft(Pedina pedina) {\n if(!controllaSeCasellaLibera(pedina.getX() + 1, pedina.getY() - 1))\n return false;\n else {\n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY())\n seVadoSinistraVengoMangiato = true;\n }\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() + 2 == arrayPedineBianche.get(i).getX()\n && pedina.getY() == arrayPedineBianche.get(i).getY()\n && pedina.getY() - 2 >= 0\n && controllaSeCasellaLibera(pedina.getX(), pedina.getY() - 2))\n seVadoSinistraVengoMangiato = true;\n }\n \n for (int i = 0; i < arrayPedineBianche.size(); i++) {\n if (pedina.getX() == arrayPedineBianche.get(i).getX()\n && pedina.getY() - 2 == arrayPedineBianche.get(i).getY()\n && pedina.getX() + 2 <= 7\n && arrayPedineBianche.get(i) instanceof Damone\n && controllaSeCasellaLibera(pedina.getX() + 2, pedina.getY())) \n seVadoSinistraVengoMangiato = true;\n }\n \n if(pedina.getX() + 1 > 7 || pedina.getY() - 1 < 0)\n return false;\n else {\n pedina.setXTemp(pedina.getX() + 1);\n pedina.setYTemp(pedina.getY() - 1);\n return true;\n }\n }\n }", "@Override\n public boolean isBoatOnTheLeftBank() {\n return false;\n }", "private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}", "private void white(){\n\t\tthis.arretes_fW();\n\t\tthis.coins_fW();\n\t\tthis.coins_a1W();\n\t\tthis.coins_a2W();\n\t\tthis.aretes_aW();\n\t\tthis.cube[4] = \"W\";\n\t}", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "public void verurteilen(Schurke schurke) {\n\t\tif (!this.korrupt) {\n\t\t\tschurke.MetroDollarVeraendern(-1000);\n\t\t}\n\t\tthis.metroDollar += 60000;\n\t}", "public void blackMove(Pedina pedina) {\n if (!canBlackMove(pedina)) {\n pedina.setPriority(-6); \n return;\n } else if (canBlackEat3(pedina)) {\n pedina.setPriority(16);\n return;\n } else if (canBlackEat2(pedina)) {\n pedina.setPriority(14);\n return;\n } else if (canBlackEat(pedina)) {\n pedina.setPriority(12);\n return;\n } else if (canBlackSaveItself(pedina)) {\n pedina.setPriority(11);\n return;\n } else if (canBlackSaveOther(pedina)) {\n pedina.setPriority(8);\n return;\n } else if (canBlackBecomeDamone(pedina)) {\n pedina.setPriority(7);\n return;\n } else if (canBlackMoveRight(pedina) && !seVadoDestraVengoMangiato) { \n pedina.setPriority(6);\n return;\n } else if (canBlackMoveLeft(pedina) && !seVadoSinistraVengoMangiato) {\n pedina.setPriority(5);\n return;\n } else if (canBlackMoveRight(pedina)) {\n pedina.setPriority(0);\n return;\n } else if (canBlackMoveLeft(pedina)) {\n pedina.setPriority(-1); \n return;\n }\n }", "public void recibirAtaque(Integer danio) {\n List<Soldado> eliminados = new ArrayList<Soldado>();\n for (Soldado soldado : soldados) {\n if (danio > 0) {\n danio = soldado.recibirAtaque(danio);\n if (soldado.getVida() <= 0) {\n eliminados.add(soldado);\n }\n } else {\n break;\n }\n }\n eliminarSoldados(eliminados);\n }", "@Override\n\tpublic void verkaufen() {\n\t\tif( (bestand - abgenommeneMenge) < 0)\n\t\t\tthis.setBestand(0);\n\t\telse\n\t\t\tthis.setBestand(this.getBestand() - abgenommeneMenge);\n//\t\tSystem.out.println(\"Bestand danach:\" + bestand);\n\t}", "public void eisagwgiFarmakou() {\n\t\t// Elegxw o arithmos twn farmakwn na mhn ypervei ton megisto dynato\n\t\tif(numOfMedicine < 100)\n\t\t{\n\t\t\tSystem.out.println();\t\n\t\t\tmedicine[numOfMedicine] = new Farmako();\t\n\t\t\tmedicine[numOfMedicine].setCode(rnd.nextInt(1000000)); // To sistima dinei automata ton kwdiko tou farmakou\n\t\t\tmedicine[numOfMedicine].setName(sir.readString(\"DWSTE TO ONOMA TOU FARMAKOU: \")); // Zitaw apo ton xristi na mou dwsei to onoma tou farmakou\n\t\t\tmedicine[numOfMedicine].setPrice(sir.readPositiveFloat(\"DWSTE THN TIMH TOU FARMAKOU: \")); // Pairnw apo ton xristi tin timi tou farmakou\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos monadikotitas tou kwdikou tou farmakou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tif(medicine[i].getCode() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(10);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfMedicine++;\n\t\t}\n\t\t// An xeperastei o megistos arithmos farmakwn\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLA FARMAKA!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}" ]
[ "0.6418562", "0.61340654", "0.6106357", "0.6052642", "0.6024607", "0.5930905", "0.5906739", "0.5904978", "0.58909464", "0.58742213", "0.58500284", "0.58210677", "0.5764773", "0.5759889", "0.5747489", "0.5739166", "0.57372", "0.57168025", "0.5710908", "0.5690081", "0.56816673", "0.56712383", "0.5660511", "0.5658259", "0.5646613", "0.56097114", "0.56089985", "0.5580186", "0.5578164", "0.5569674", "0.5568749", "0.5568602", "0.5566493", "0.5560288", "0.55589086", "0.55587536", "0.55357695", "0.5527562", "0.5523709", "0.55227214", "0.55213964", "0.5501436", "0.54923224", "0.5477844", "0.5468752", "0.5468153", "0.54663223", "0.5463714", "0.54585105", "0.54576206", "0.54560655", "0.5428512", "0.5426116", "0.542534", "0.54151577", "0.54114574", "0.54088205", "0.5402038", "0.53965515", "0.539624", "0.53827393", "0.5377004", "0.5376291", "0.5375972", "0.53678954", "0.5366947", "0.5366221", "0.5360189", "0.53570354", "0.5353708", "0.53496426", "0.5344632", "0.53440017", "0.5342546", "0.53413355", "0.53412086", "0.53386873", "0.5337232", "0.5337076", "0.5333367", "0.53265864", "0.5324997", "0.5321432", "0.5318686", "0.531832", "0.5315007", "0.530784", "0.53031814", "0.530217", "0.5302137", "0.5300615", "0.5292912", "0.5292081", "0.5291228", "0.5288749", "0.5287377", "0.5287115", "0.5283696", "0.5281505", "0.5273357" ]
0.63674355
1
applique le brouillard sur toute la carte
void appliquerBrouillard();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }", "public void bajarBloque() {\n\t\tif (piezaActual != null) {\n\t\t\tif (Mapa.getInstance().estaLibre(piezaActual.getBloque3().getX(),\n\t\t\t\t\tpiezaActual.getBloque3().getY() + 1)) {\n\t\t\t\tpiezaActual.getBloque3().bajar(); // Dejar en ese orden\n\t\t\t\tpiezaActual.getBloque2().bajar();\n\t\t\t\tpiezaActual.getBloque1().bajar();\n\t\t\t} else {\n\t\t\t\tthis.piezaNueva();\n\t\t\t}\n\t\t}\n\t}", "public void roam()\n {\n super.roam();\n System.out.println(\", and now that it is a wolf it is very dangerous for its prey\");\n }", "@Override\n\tpublic String hablar() {\n\t\treturn \"Hola, soy un Buitre y sť volar\";\n\t}", "public void billeBarre() { \t\t\t\t\t\t\t\t\t\t\t\n\t\tint contact = 0;\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\t// Étude des contacts avec les 8 points de la bille\n\t\t// Contact GaucheHaut de la bille\n\n\t\t// Contact haut de la bille\n\t\tint[] p = billeEnCours.MH();\n\t\tif (p[1] <= barreEnCours.bas() && p[1] >= barreEnCours.haut() && p[0] <= barreEnCours.droite() && p[0] >= barreEnCours.gauche()) {\n\t\t\tcontact = 3;\n\t\t}\n\n\t\t// Contact bas de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.MB();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 7;\n\t\t\t}\n\t\t}\n\n\t\t// Contact droite de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.DM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Contact gauche de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.GM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 1;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 2;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 4;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 8;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 6;\n\t\t\t}\n\t\t}\n\n\t\t// Mise à jour de la vitesse \n\n\t\t// Rencontre d'un coin\n\t\tif ((((contact == 2) || (contact == 4))) || ((contact == 8) || (contact == 6))) {\n\t\t\tbilleEnCours.demiTour();\n\t\t}\n\n\t\t// Contact Classique\n\t\t// Gauche - Droite\n\t\tif ((contact == 1) || (contact == 5)) {\n\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t\t// Haut - Bas : Déviation de la balle\n\t\tif ((contact == 3) || (contact == 7)) {\n\t\t\tint[] nv = new int[] {1,1};\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4 && billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] - 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] + 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\t\t\t\n\n\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "public Arbre residuelSousArbre(char c){\n\t\tArbre g, d;\n\t\tif(this.symbole == '.'){\n\t\t\tif(gauche.contientMotVide){\n\t\t\t\tg = gauche.residuelSousArbre(c);\n\t\t\t\td = droit.clone();\n\t\t\t\tif(g == null || d == null) g = null;\n\t\t\t\telse g = new Binaire('.', g, d);\n\t\t\t\td = droit.residuelSousArbre(c);\n\t\t\t\tif(g == null && d == null) return null;\n\t\t\t\tif(g == null) return d;\n\t\t\t\tif(d == null) return g;\n\t\t\t\treturn new Binaire('+', g, d);\n\t\t\t}\n\t\t\tg = gauche.residuelSousArbre(c);\n\t\t\td = droit.clone();\n\t\t\tif(g == null || d == null) return null;\n\t\t\treturn new Binaire('.', g, d);\n\t\t}else{\n\t\t\tg = gauche.residuelSousArbre(c);\n\t\t\td = droit.residuelSousArbre(c);\n\t\t\tif(g == null && d == null) return null;\n\t\t\tif(g == null) return d;\n\t\t\tif(d == null) return g;\n\t\t\treturn new Binaire('+', g, d);\n\t\t}\n\t}", "protected void lowerBot() {\n lowerBot(-.3);\n }", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "public void baocun() {\n\t\t\n\t}", "public void breathe(){\n\n System.out.println(\"Through big nostrills\");\n }", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "java.lang.String getBunho();", "java.lang.String getBunho();", "private void reserveChambre() {\n\t\tfor(Chambre chambre : this.getChambres()) {\n\t\t\tif(chambre.equals(this.chambresVides().get(0))) {\n\t\t\t\tchambre.setReserve(true);\n\t\t\t\tSystem.out.println(\"\\n---------------------------------------\\nVous avez bien réservé cette chambre: |\");\n\t\t\t\tSystem.out.println(chambre.toString());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void ordenarXNombreBurbuja() {\r\n\t\tfor (int i = datos.size(); i > 0; i-- ) {\r\n\t\t\tfor (int j=0; j<i-1; j++) {\r\n\t\t\t\tif(\tdatos.get(j).compare(datos.get(j), datos.get(j+1)) == (1)) {\r\n\t\t\t\t\tJugador tmp = datos.get(j);\r\n\t\t\t\t\tdatos.set(j, datos.get(j+1));\r\n\t\t\t\t\tdatos.set((j+1), tmp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void onderbreek(){\n \n }", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "public void applyBrake() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void sueldo(){\n if(horas <= 40){\n sueldo = horas * cuota;\n }else {\n if (horas <= 50) {\n sueldo = (40 * cuota) + ((horas - 40) * (cuota * 2));\n } else {\n sueldo = ((40 * cuota) + (10 * cuota * 2)) + ((horas - 50) + (cuota * 3));\n }\n }\n\n }", "public void bewegeKamel(Charakter charakter);", "public void billeMurs() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\tint mur = 0;\n\n\t\t// Contact Gauche de la bille\n\t\tif (billeEnCours.GM()[0] <= 0) {\n\t\t\tmur = 1;\n\t\t}\n\n\t\t// Contact Droite de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.DM()[0] >= limiteDroite) {\n\t\t\t\tmur = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Contact Haut de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.MH()[1] <= 0) {\n\t\t\t\tmur = 3;\n\t\t\t}\n\t\t}\n\n\t\t// Contact Bas de la bille\n\t\tif (mur == 0) {\n\t\t\tif (billeEnCours.MB()[1] >= limiteHaut) {\n\t\t\t\tmur = 7;\n\t\t\t\tperteDeVie();\n\t\t\t\tbilleEnCours.changeVitesse(vitBilleInitiale);\n\t\t\t\tbilleEnCours.changePosition(posBilleInitiale);\n\t\t\t\tbarreEnCours.changePosition(posBarreInitiale);\n\t\t\t}\n\t\t}\n\n\t\t// Mise à jour de la vitesse\n\n\t\tif ((mur == 1)||(mur == 5)) {\n\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t\tif (mur == 3) {\n\t\t\tint[] nv = {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t}", "Bicho evolucionar(int bicho);", "public void affichage() {\n if (blanc){\n System.out.print(\"Cb\");\n }\n else{\n System.out.print(\"Cn\");\n }\t\t\n }", "private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }", "private static void cajas() {\n\t\t\n\t}", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "public void cogerLetra(String letra){\r\n sb.append(letra);\r\n }", "private String construyeCaracter(String palabra) throws IOException {\n\t\tToken aux = null;\n \t\twhile(!((aux = this.nextTokenWithWhites()).get_lexema().equals(\"'\"))) {\n \t\t\tif (aux.get_lexema().equals(\"fin\"))\n \t\t\t\treturn palabra;\n \t\t\tpalabra = palabra + aux.get_lexema();\n \t\t\t// Si vemos que el caracter se alarga mucho, paramos de leer\n \t\t\tif (palabra.length() > 4) {\n \t\t\t\treturn palabra;\n \t\t\t}\n \t\t}\n \t\tpalabra = palabra + aux.get_lexema();\n\t\treturn palabra;\n\t}", "@Override\n\tpublic void coba() {\n\t\t\n\t}", "private char hallarLetra() {\r\n\t\tchar[] letra= {'T','R','W','A','G','M','Y','F','P','D','X',\r\n\t\t\t\t\t'B','N','J','Z','S','Q','V','H','L','C','K','E'};\r\n\t\treturn letra[numeroDNI%23];\r\n\t}", "@Override\n\tpublic void bolumSoyle() {\n\t\tSystem.out.println(\"Benim Bölümüm Psi\");\n\t}", "private String mayorTurno(ABBTurnosTDA a){\t\t\n\t\tif(a.hijoDer().arbolVacio())\n\t\t\treturn a.turno();\n\t\telse\n\t\t\treturn mayorTurno(a.hijoDer());\n\t}", "public void eisagwgiFarmakou() {\n\t\t// Elegxw o arithmos twn farmakwn na mhn ypervei ton megisto dynato\n\t\tif(numOfMedicine < 100)\n\t\t{\n\t\t\tSystem.out.println();\t\n\t\t\tmedicine[numOfMedicine] = new Farmako();\t\n\t\t\tmedicine[numOfMedicine].setCode(rnd.nextInt(1000000)); // To sistima dinei automata ton kwdiko tou farmakou\n\t\t\tmedicine[numOfMedicine].setName(sir.readString(\"DWSTE TO ONOMA TOU FARMAKOU: \")); // Zitaw apo ton xristi na mou dwsei to onoma tou farmakou\n\t\t\tmedicine[numOfMedicine].setPrice(sir.readPositiveFloat(\"DWSTE THN TIMH TOU FARMAKOU: \")); // Pairnw apo ton xristi tin timi tou farmakou\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos monadikotitas tou kwdikou tou farmakou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tif(medicine[i].getCode() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(10);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfMedicine++;\n\t\t}\n\t\t// An xeperastei o megistos arithmos farmakwn\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLA FARMAKA!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}", "public void moverAbajo() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, -1));\n }", "@Override\r\n\tpublic boolean isChocado(Bola bola) {\r\n\t isChocado = bola.getBounds().intersects(this.getBounds());\r\n\t if(isChocado) {\r\n\t \tif(ark.existeBloque(this)) {\r\n\t \t\tsetY(getY()-getHeight()-3);\r\n\t \t\treturn false;\r\n\t \t}\r\n\t \tark.setUltimoBloque(new BloqueNaranja(getX(),getY(),getWidth(),getHeight(),ark));\r\n\t \tsetVivo(false);\r\n\t }\r\n\t return isChocado;\r\n }", "public void changerDirectionBateau() {\n\t\tif (partie.getJoueur().getIndiceBateauEnCours() != -1) {\n\t\t\tplacerEauSurVue();\n\t\t\tthis.partie.getJoueur().modifierDirection();\n\t\t\tplacerBateauSurVue();\n\t\t}\n\t}", "private String elaboraRitorno() {\n String testo = VUOTA;\n String titoloPaginaMadre = getTitoloPaginaMadre();\n\n if (usaHeadRitorno) {\n if (text.isValid(titoloPaginaMadre)) {\n testo += \"Torna a|\" + titoloPaginaMadre;\n testo = LibWiki.setGraffe(testo);\n }// fine del blocco if\n }// fine del blocco if\n\n return testo;\n }", "public void quemaRueda() {\n System.out.println(\"¡Huele a plástico quemado de tanto quemar ruedas!\");\n }", "public void ComenzarJuego() {\n Random R = new Random();\n int i = -1; // declaro una variable i(intentos como deducion) para realizar la la busqueda de dicha palabra\n do{ //inicio un ciclo tipo (do) para que intentos sea igual a R.nextInt(palabras) en teoria el bucle\n //se ejecuta obligatoriamente\n i = R.nextInt(PalabrasAdivinar.length);\n \n }while (posicion == i); //si la condicion posicion se cumple, posicion va ser igual a i(intentos)\n posicion = i;\n palabras = PalabrasAdivinar[posicion];\n \n // y palbras va ser igual a PalabrasAdivinadar\n for (i = 0; i < palabras.length(); i++);{ \n //el ciclo for que es i(intentos) va ser igual a cero, donde inicia posicion, la condicion i va ser menor a palabras (relaciona),{ // y la ultima va manipular los valores que mencionamos\n if(palabras.charAt(i)!) // si se cumple palabras va ser igual a '' y solucion = caract sino = espacio para generar las palabras\n Solucion += (\"_\"); // debemos pensar que es muy necesario por el hecho de los espacios si por ejemplo gears of war \n else \n Solucion += (\" \");\n \n }\n \n Dibujar();\n \n }", "@Override\n\tprotected void 关上冰箱门() {\n\t\tSystem.out.println(\"我是张飞,我叫喊着粗鲁的把冰箱门关上\");\n\t}", "private void caiu(Bola bola, Paddle paddle) {\n\t\tint continuar;\n\t\tbola.bolaInicio();\n\t\tpaddle.paddleInicio();\n\t\tmove = false;\n\t\tvida--;\n\t\tif (vida == 0) {\n\t\t\tcontinuar = JOptionPane.showConfirmDialog(null, \"Deseja jogar novamente?\", \"Game Over\",\n\t\t\t\t\tJOptionPane.YES_NO_OPTION);\n\t\t\tif (continuar == 0) {\n\t\t\t\treiniciar();\n\t\t\t} else {\n\t\t\t\tSystem.exit(0);\n\t\t\t} // fecha else interno\n\t\t} // fecha if para continuar\n\n\t}", "private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}", "public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}", "Binarbre<E> equilibre();", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "public static void dormir(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int restoDeMana; //variables locales a utilizar\n int restoDeVida;\n if(oro>=30){ //condicion de oro para recuperar vida y mana\n restoDeMana=10-puntosDeMana;\n puntosDeMana=puntosDeMana+restoDeMana;\n restoDeVida=150-puntosDeVida;\n puntosDeVida=puntosDeVida+restoDeVida;\n //descotando oro al jugador\n oro=oro-30;\n System.out.println(\"\\nrecuperacion satisfactoria\");\n }\n else{\n System.out.println(\"no cuentas con 'Oro' para recuperarte\");\n }\n }", "@Override\n public String comer(String c)\n {\n c=\"Gato No puede Comer Nada\" ;\n \n return c;\n }", "protected abstract void composeSnare(final Phrase snare);", "public String toString(){\n return \"+-----------------------+\\n\" +\n \"| Boleto para el metro |\\n\" +\n \"|derjere0ranfeore |\\n\" +\n \"+-----------------------+\\n\" ;\n }", "void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }", "public void aapne() {\n trykketPaa = true;\n setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY)));\n if (bombe) {\n setText(\"x\");\n Color moerkeregroenn = Color.rgb(86, 130, 3, 0.5);\n setBackground(new Background(new BackgroundFill(moerkeregroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n } else if (bombeNaboer == 0) {\n setText(\" \");\n } else {\n setText(bombeNaboer + \"\");\n if (bombeNaboer == 1) {\n setTextFill(Color.BLUE);\n } else if (bombeNaboer == 2) {\n setTextFill(Color.GREEN);\n } else if (bombeNaboer == 3) {\n setTextFill(Color.RED);\n } else if (bombeNaboer == 4) {\n setTextFill(Color.DARKBLUE);\n } else if (bombeNaboer == 5) {\n setTextFill(Color.BROWN);\n } else if (bombeNaboer == 6) {\n setTextFill(Color.DARKCYAN);\n }\n }\n }", "public String annulerRv(){\n\t\t// Traitement ici ... \n\t\treturn AFFICHER;\n\t}", "public int AmbosHijosR() { //Hecho por mi\n return AmbosHijosR(raiz);\n }", "@Override\r\n\tpublic void chocarOvos() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void chocarOvos() {\n\t\t\r\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn super.getCor().equals(\"Branco\") ? \" ♘ \": \" ♞ \";\r\n\t}", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public void leerAlimentos();", "@Override\r\n\tpublic String Fly() {\n\t\treturn \"EL Helicoptero esta volando\";\r\n\t}", "public SuperRodada(){\n this.pontos_em_disputa=0;\n this.truco=false;\n this.Desafiante=null;\n this.addPontosEmDisputa(2);\n Game game = Game.getGame();\n DonoDoBaralho=(DonoDoBaralho==null)?game.getDupla(1).getJogadorA():this.proximoAJogar(DonoDoBaralho);\n \n }", "public void chocoContraBomba(Bomba bomba){}", "@Override\n\tpublic void compete() {\n\t\tSystem.out.println(\"Pawan is competing as a swimming Athlete \");\n\t\t\n\t}", "@Test\n public void bateauAtBateau() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux ba = new ContreTorpilleur(new Place[]{new Place(\"A5\")}, j, p, true);\n g.setListBateaux(Collections.singletonList(ba));\n\n Bateaux b = j.bateauAt(new Place(\"A5\"), g);\n\n assertEquals(\"Il n'y a pas de bateau ici\", ba, b);\n }", "@Override\r\n\tpublic String fly() {\n\t\tString volar = \"Puede volar\";\r\n\t\treturn volar;\r\n\t}", "private void colidiuBloco(Bloco[] linhaBloco) {\n\n\t\tfor (int i = 0; i < blocoArray; i++) {\n\t\t\tif (linhaBloco[i].bateu(bola)) {\n\t\t\t\tbola.invertVertical();\n\t\t\t\tscore = score + 100;\n\t\t\t} // fecha if\n\t\t} // fecha for\n\n\t}", "public void billeBriques() {\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\t// Parcours des briques pour vérifier les contacts\n\t\tListIterator <Brique> iter = niveauEnCours.grilleBriques.listIterator(0);\n\t\tint contact = 0;\n\n\t\twhile (iter.hasNext() && contact == 0) {\n\t\t\tBrique b = iter.next();\n\n\t\t\t// Étude des contacts avec les 8 points de la bille\n\n\t\t\t// Contact GaucheHaut de la bille\n\t\t\tdouble[] q = billeEnCours.GH();\n\t\t\tif (((q[1] <= b.bas) && (q[1] >= b.haut)) && ((q[0] <= b.droite) && (q[0] >= b.gauche))) {\n\t\t\t\tcontact = 2;\n\t\t\t\tb.coup();\n\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact DroiteHaut de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tq = billeEnCours.DH();\n\t\t\t\tif (((q[1] <= b.bas) && (q[1] >= b.haut)) && ((q[0] <= b.droite) && (q[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 4;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact GaucheBas de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tq = billeEnCours.GB();\n\t\t\t\tif (((q[1] <= b.bas) && (q[1] >= b.haut)) && ((q[0] <= b.droite) && (q[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 8;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact DroiteBas de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tq = billeEnCours.DB();\n\t\t\t\tif (((q[1] <= b.bas) && (q[1] >= b.haut)) && ((q[0] <= b.droite) && (q[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 6;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact haut de la bille\n\t\t\tint[] p = billeEnCours.MH();\n\t\t\tif (contact == 0) {\n\t\t\t\tif (p[1] <= b.bas && p[1] >= b.haut && p[0] <= b.droite && p[0] >= b.gauche) {\n\t\t\t\t\tcontact = 3;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact bas de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tp = billeEnCours.MB();\n\t\t\t\tif (((p[1] <= b.bas) && (p[1] >= b.haut)) && ((p[0] <= b.droite) && (p[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 7;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact droite de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tp = billeEnCours.DM();\n\t\t\t\tif (((p[1] <= b.bas) && (p[1] >= b.haut)) && ((p[0] <= b.droite) && (p[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 5;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Contact gauche de la bille\n\t\t\tif (contact == 0) {\n\t\t\t\tp = billeEnCours.GM();\n\t\t\t\tif (((p[1] <= b.bas) && (p[1] >= b.haut)) && ((p[0] <= b.droite) && (p[0] >= b.gauche))) {\n\t\t\t\t\tcontact = 1;\n\t\t\t\t\tb.coup();\n\t\t\t\t\tif (b.estDetruite()) {\n\t\t\t\t\t\tniveauEnCours.bonusEnChute.add(b.renvoyerBonus());\n\t\t\t\t\t\tniveauEnCours.grilleBriques.remove(iter.nextIndex()-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// Mise à jour de la vitesse \n\n\t\t\t// Rencontre d'un coin\n\t\t\tif ((((contact == 2) || (contact == 4))) || ((contact == 8) || (contact == 6))) {\n\t\t\t\tbilleEnCours.demiTour();\n\t\t\t}\n\n\t\t\t// Contact Classique\n\t\t\t// Gauche - Droite\n\t\t\tif ((contact == 1) || (contact == 5)) {\n\t\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t\t}\n\n\t\t\t// Haut - Bas\n\t\t\tif ((contact == 3) || (contact == 7)) {\n\t\t\t\tint[] nv = {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t\t}\t\t\t\n\n\t}", "public static void main(String[] args) {\n Cachorro x = new Cachorro();\n //x.emitirSom();\n \n // Programa Principal\n Cachorro c = new Cachorro();\n \n c.reagir(\"Olá\"); // Abanar e Latir\n System.out.println(\"\");\n c.reagir(\"Vai apanhar\"); // Rosnar\n System.out.println(\"\");\n c.reagir(11, 45); // Abanar\n System.out.println(\"\");\n c.reagir(21, 00); // Ignorar\n System.out.println(\"\");\n c.reagir(true); // Abanar\n System.out.println(\"\");\n c.reagir(false); // Rosnar e Latir (// emitirSom();)\n System.out.println(\"\");\n c.reagir(2, 12.5f); // Latir\n System.out.println(\"\");\n c.reagir(17, 4.5f); // Rosnar\n \n }", "private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }", "public void alteraBrilhoDeExibicao(float NovoBrilho){\n if (ligado)\n if(NovoBrilho >= 0 && NovoBrilho <= 10){\n brilho = NovoBrilho;\n System.out.println(\"Brilho:\" + NovoBrilho+ \"\\n\");\n \n } else if(NovoBrilho <= 0 && NovoBrilho >= -brilho){\n brilho += NovoBrilho;\n System.out.println(\"Brilho:\" + brilho + \"\\n\");\n }else\n System.out.println(\"Brilho invalido \\n\");\n else \n System.out.println(\"Driver desligado \\n\");\n }", "public String soovitus(){\n double BMI = kehamassiindeks();\n String soovitus = \"\";\n if ( BMI < 18.6){\n\n soovitus=\"Tarbi rohkem toitu,\\noled alakaalus.\";\n }\n if ( BMI > 25){\n\n soovitus=\"Pead rohkem liigutama,\\noled natuke ülekaalus\";\n }\n if (BMI > 30){\n\n soovitus=\"Tee trenni või tarbi vähem toitu,\\nsest oled üsna ülekaalus.\";\n }\n if( BMI > 18.5 & BMI <= 25 ){\n\n soovitus=\"Oled normaalkaalus.\";\n }\n return soovitus;\n }", "public static void quienHaGanado(Mano[] jugadores, int actual,int carro){\n if(jugadores[actual].getNPiezas()!=0){\n boolean dosIguales=false;\n actual=0;\n for (int i = 1; i < jugadores.length; i++) {\n if(jugadores[i].getPuntuacion()==jugadores[actual].getPuntuacion()){//El jug i y el actual tienen la misma putnuacion\n if(i==carro){//el jugador i es el carro\n actual=i;\n dosIguales=false;\n }\n else if(actual==carro){//el jugador actual es el carro\n dosIguales=false;\n }\n else{//ninguno es el carro y hay que acudir a un metodo para nombrar a los dos ganadores.\n dosIguales=true;\n }\n }\n if(jugadores[i].getPuntuacion()<jugadores[actual].getPuntuacion()){//el jugador i tiene menor puntuacion que el jugador actual\n actual=i;\n dosIguales=false;\n }\n }\n if(dosIguales){\n System.out.println(\"pene\");\n Excepciones.cambiarColorAzul(\"Y los GANADORES SON....\");\n for (int i = 0; i < jugadores.length; i++) {\n if (jugadores[i].getPuntuacion()==jugadores[actual].getPuntuacion()) {\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(i+1)+\": \"+jugadores[i].getNombre());\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(i+1)+\": \"+jugadores[i].getNombre());\n }\n }\n System.out.println(\"\\u001B[30m\");\n }\n else{\n Excepciones.cambiarColorAzul(\"Y el GANADOR ES....\");\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre()+\"\\u001B[30m\");\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre());\n }\n }\n else {\n Excepciones.cambiarColorAzul(\"Y el GANADOR ES....\");\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre()+\"\\u001B[30m\");\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre());\n }\n }", "public void diagrafiFarmakou() {\n\t\t// Elegxw an yparxoun farmaka sto farmakeio\n\t\tif(numOfMedicine != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA FARMAKWN\");\n\t\t\t// Emfanizw ola ta famraka tou farmakeiou\n\t\t\tfor(int j = 0; j < numOfMedicine; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA FARMAKOU: \");\n\t\t\t\tSystem.out.println();\n\t \t \tmedicine[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO TOU FARMAKOU POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfMedicine)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO FARMAKOU: \");\n\t\t\t}\n\t\t\t// Metakinw ta epomena farmaka mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfMedicine - 1; k++)\n\t\t\t{\n\t\t\t\tmedicine[k] = medicine[k+1]; // Metakinw to farmako sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfMedicine--; // Meiwse ton ari8mo twn farmakwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMA FARMAKA PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void bouger(int origine, int destination) {\n\t\t\n\t}", "public void atrapar() {\n if( una == false) {\n\t\tif ((app.mouseX > 377 && app.mouseX < 591) && (app.mouseY > 336 && app.mouseY < 382)) {\n\t\t\tint aleotoridad = (int) app.random(0, 4);\n\n\t\t\tif (aleotoridad == 3) {\n\n\t\t\t\tSystem.out.print(\"Lo atrapaste\");\n\t\t\t\tcambioEnemigo = 3;\n\t\t\t\tsuerte = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\t\t\tif (aleotoridad == 1 || aleotoridad == 2 || aleotoridad == 0) {\n\n\t\t\t\tSystem.out.print(\"Mala Suerte\");\n\t\t\t\tcambioEnemigo = 4;\n\t\t\t\tmal = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\n\t\t}\n }\n\t}", "public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}", "public void eisagwgiAstheni() {\n\t\t// Elegxw o arithmos twn asthenwn na mhn ypervei ton megisto dynato\n\t\tif(numOfPatient < 100)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tpatient[numOfPatient] = new Asthenis();\n\t\t\tpatient[numOfPatient].setFname(sir.readString(\"DWSTE TO ONOMA TOU ASTHENH: \")); // Pairnei to onoma tou asthenh apo ton xrhsth\n\t\t\tpatient[numOfPatient].setLname(sir.readString(\"DWSTE TO EPWNYMO TOU ASTHENH: \")); // Pairnei to epitheto tou asthenh apo ton xrhsth\n\t\t\tpatient[numOfPatient].setAMKA(rnd.nextInt(1000000)); // To sistima dinei automata ton amka tou asthenous\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\t//Elegxos monadikotitas tou amka tou astheni\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfPatient; i++)\n\t\t\t{\n\t\t\t\tif(patient[i].getAMKA() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(1000000);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfPatient++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLOUS ASTHENEIS!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}", "public void cheat() {\r\n\t\t\t\tnourriture += population*10;\r\n\t\t\t\tarmee += population/2;\r\n\t\t\t\tpopulation += armee*tailleArmee;\r\n\t\t\t}", "@Override\n\tpublic void smile() {\n\t\tSystem.out.println(\"黄种人-笑\");\n\t}", "public void gored() {\n\t\t\n\t}", "private String hardMove() {\n return super.makeAMove(getBestMoveForBlack(FORESEEN_MOVES * 2));\n }", "public void tradOra(){\r\n leerOracion();\r\n String res=\"\";\r\n for(int i=0; i<orac.size(); i++){\r\n res+=tradPal(rz, orac.get(i).trim())+\" \";\r\n }\r\n System.out.println(res);\r\n }", "@Override\n\tpublic void onBlue() {\n\t\taddSequential(new DriveStraightByDistance(PEG_STRAIGHT - ROBOT_LENGTH / 2), 3.5);\n\t\t//TODO: might need to change to a little less\n\t\taddSequential(new TurnDegrees(90), 2.5);\n\t\taddSequential(new DriveStraightByDistance(EXTRA_DIS), 4);\n\t\taddSequential(new OpenPlacer2());\n\t\taddSequential(new ArcadeDriveByValues(-0.5, -0.5), 1);// TODO change commad\n\t\taddSequential(new ClosePlacer());\n\t\t\n\t}", "@Override\n public void imprime(){\n System.out.println(\" ----- Arbol Splay ----- \");\n imprimeAS(super.getRaiz());\n }", "private void obsluga_bonusu()\n {\n if(bonusy_poziomu>0)\n {\n boolean numer= los.nextBoolean();\n if(numer){\n bon.add(new Bonus(w.getPolozenie_x(),w.getPolozenie_y(),getWidth(),getHeight()));\n bonusy_poziomu--;\n }\n }\n }", "public void borra() {\n dib.borra();\n dib.dibujaImagen(limiteX-60,limiteY-60,\"tierra.png\");\n dib.pinta(); \n }", "public String turno(enemigo enem){\n\t\tString tur;\n\t\ttur=atacar(enem);\n\t\treturn tur;\n\t}", "@Override\n public String bite() {\n String bite = getName()+ \" bites \";\n return bite;\n }", "public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}", "void enleverBrouillard(Soldat s);", "public static void main(String[] args) {\n\tScanner s = new Scanner ( System.in);\n\tSystem.out.println( \" Program sabira sve unete pozitivne brojeve. Za izlazak iz programa unesi negativan broj.\");\n\tint broj, zbir = 0;\n\tbroj = s.nextInt();\n\twhile ( broj >= 0 ) {\n\t\tzbir = zbir + broj;\n\t\tbroj = s.nextInt();\n\t}\n\tSystem.out.println( \" Zbir unesenih pozitivnih brojeva je : \" + zbir );\n\t}", "@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}", "@Override\r\n\tpublic String Land() {\n\t\treturn \"El Helicoptero esta Aterrizando\";\r\n\t}", "private static void benvenuto() {\n\t\tUtilityIO.header(MSG_BENVENUTO, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t\t\n\t}", "public static void batalla(){\n\tSystem.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int turno; //declaracion de variables locales a utilizar\n int numeroAleatorio;\n int numeroAleatorio2;\n int ataqueEnemigo;\n int experienciaGanada;\n int oroGanado;\n String enemigo;\n Random aleatorio = new Random();//declarando variables tipo random para aleatoriedad\n Random aleatorio2 = new Random();\n Random aleatorio3 = new Random();\n //Inicializando la batalla\n System.out.println(\"...Bienvenido a la batalla...\");\n System.out.println(\"El turno de atacar es aleatorio.\");\n //eligiendo al oponente en battalla mediante el llamado de la funcion enemigos\n enemigo = enemigos();\n System.out.printf(\"\\nTu oponente es: \"+enemigo);\n //eligiendo turno aleatorio si es 1 inicia enemigo, si es 2 inicia jugador\n turno = (aleatorio.nextInt(2)+1);\n do{//condicion si primer turno es del jugador\n if(turno%2==0){\n turnoJugador();//llamando a funcion turnoJugador \n\t\t\t\tSystem.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n \t\tSystem.out.flush(); \n }\n else{\n System.out.println(\"\\nturno de:\"+enemigo);\n ataqueEnemigo= turnoEnemigo(enemigo);//enviando parametro enemigo\n puntosDeVida= puntosDeVida-ataqueEnemigo;//descontando vida a jugador \n } \n turno=turno+1;//contador para los turnos correspondientes\n //validando la continuidad del juego mediante los puntos de vida.\n }while(puntosDeVida>0 && puntosDeVidaEnemigo>0&&opcionMiedo!=1);\n\n if(opcionMiedo!=1){//condicion de huida del jugador \n \t//condicion si el ganador de la battala es el Jugador\n \tif(puntosDeVida>puntosDeVidaEnemigo){\n \t\tSystem.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n \t\tSystem.out.flush();\n \t\tSystem.out.println(\"Ganador de la batalla: \"+nombrePersonaje);\n \t//sumando los atributos ganados en battala\n \t\tnumeroAleatorio = (aleatorio2.nextInt(30-20+1)+20);\n \t\texperienciaGanada= ((nivel+1)*10)+numeroAleatorio;\n \t\texperiencia=experiencia+experienciaGanada;\n \n \t\tnumeroAleatorio2 = (aleatorio3.nextInt(45-15+1)+15);\n \t\toroGanado= ((nivel+1)*10)+numeroAleatorio2;\n \t\toro=oro+oroGanado;\n \t//imprimiendo los atributos ganados en batalla\n \t\tSystem.out.println(\"Oro Ganado: \"+oroGanado);\n \t\tSystem.out.println(\"experiencia Ganada: \"+experienciaGanada);\n \t//reiniciando la vida a los enemigos\n \t\tpuntosDeVidaEnemigo=0;\n \t//contador de derrotas para los enemigos disponibles\n\t\t\tswitch(enemigo){\n\t\t\t\tcase \"Dark_Wolf\":{\n \t\tenemigoVencido1=enemigoVencido1+1;\n \tbreak;\n \t\t}\n \tcase \"Dragon\":{\n \t\tenemigoVencido2=enemigoVencido2+1;\n \tbreak;\n \t\t}\n \tdefault:{\n enemigoVencido3=enemigoVencido3+1;\n break;\n }\n }\n }\n \telse{//mostrando al enemigo ganador en pantalla\n \t\tSystem.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n \t\tSystem.out.flush();\n \t\tSystem.out.println(\"Ganador de la batalla: \"+enemigo);\n \t\t//reiniciando las caracteristicas principales al jugador\n \t\tpuntosDeVida=150;\n \t\tpuntosDeMana=10;\n \t\tnivel=0;\n \t\texperiencia=0;\n \t\toro=0;\n \t\tarticulo1=0;\n \t\tarticulo2=0;\n \t\tarticulo3=0;\n \t\tenemigoVencido1=0;\n \t\tenemigoVencido2=0;\n \t\tenemigoVencido3=0;\n }\n }else{\n\t\t\tSystem.out.println(\"Huiste de la batalla!!!\");\n\t\t\tSystem.out.println(\"oro perdido:\"+oroPerdido);\n\t\t\tpuntosDeVidaEnemigo=0;}//reiniciando solo la vida del enemigo despues de la huida del jugador\n }" ]
[ "0.60416687", "0.59372014", "0.59216213", "0.58677274", "0.5866296", "0.58059967", "0.5788677", "0.5782895", "0.5774513", "0.57207805", "0.5714609", "0.5665438", "0.5663891", "0.56372774", "0.56372774", "0.562886", "0.5594413", "0.558297", "0.5580461", "0.5559589", "0.5555107", "0.5555107", "0.55389464", "0.5528772", "0.55280983", "0.5527471", "0.5506434", "0.55052316", "0.54916185", "0.54702747", "0.54591686", "0.5448537", "0.5441328", "0.54349756", "0.5432799", "0.543018", "0.54173476", "0.5412774", "0.5410111", "0.53907394", "0.5368264", "0.53635556", "0.5358932", "0.53548396", "0.5350062", "0.534859", "0.5347988", "0.5347135", "0.53431267", "0.5340839", "0.5333607", "0.5332213", "0.5323675", "0.53221804", "0.5302929", "0.5301486", "0.5296555", "0.529442", "0.529442", "0.5293545", "0.52911955", "0.52907276", "0.5285528", "0.528199", "0.5281742", "0.5280892", "0.52769697", "0.5267337", "0.52621764", "0.5259439", "0.52528477", "0.5252784", "0.52514076", "0.52497405", "0.5245985", "0.5244585", "0.5238759", "0.52318645", "0.52309805", "0.5230248", "0.5228011", "0.5221599", "0.5214584", "0.52142143", "0.5207868", "0.52035046", "0.5200164", "0.51952803", "0.5189794", "0.5187882", "0.5187396", "0.51854825", "0.51791424", "0.5175663", "0.51706773", "0.51702774", "0.5167752", "0.51649445", "0.51645535", "0.51623607" ]
0.6557642
0
compte le nb de monstres sur la map
int compteMonstres(Soldat unites[][]);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int mapCount(){\r\n\t\treturn this.mapCount;\r\n\t}", "@SuppressWarnings(\"rawtypes\")\n\tpublic static int getMapSize(String titre,Map<Integer, String> map){\n\t\tMap<Integer, String> treeMap = new TreeMap<Integer, String>(map);\n\t\tIterator<Entry<Integer, String>> it = treeMap.entrySet().iterator();\n\t\tString taille=titre;\n\t while (it.hasNext()) {\n\t Map.Entry pair = (Map.Entry)it.next();\n\t taille+=pair.getKey()+\".\"+pair.getValue()+\" \";\n\t }\n\t System.out.println(\"taille du menu ==>\"+taille.length());\n\t taille=taille.trim();\n\t System.out.println(\"taille du menu apres trim()==>\"+taille.length());\n\t return taille.length();\n\t}", "private int getVariablesNumberInMap() {\n\t\tSet<String> variables = KeyValue.getFirstLevelKeys();\n\t\tint count = 0;\n\t\tfor (String name : variables) {\n\t\t\tif (!name.contains(\"~\")) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int total_maps() {\r\n\t\tcheck( 1 );\r\n\r\n\t\treturn total_maps;\r\n\t}", "public int getNumElements() {\n return theMap.size();\n }", "private static Map<Integer, Integer> vratiBrojStudenataPoOcjenama(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.collect(Collectors.toMap(StudentRecord::getGrade, s -> 1, (o, n) -> o + 1));\n\t}", "private Map<Card, Integer> tally() {\n Map<Card, Integer> result = new HashMap<Card, Integer>();\n for (Card card: this.cards) {\n Integer value = result.get(card);\n if (value == null) {\n result.put(card, 1);\n } else {\n result.put(card, value + 1);\n }\n }\n return result;\n }", "private void initCountMap() {\n\t\tcountMap.put(\"cells.BlueSchellingCell\", 0);\n\t\tcountMap.put(\"cells.OrangeSchellingCell\", 0);\n\t\tcountMap.put(\"cells.LiveCell\", 0);\n\t\tcountMap.put(\"cells.DeadCell\", 0);\n\t\tcountMap.put(\"cells.TreeCell\", 0);\n\t\tcountMap.put(\"cells.BurningTreeCell\", 0);\n\t\tcountMap.put(\"cells.EmptyLandCell\", 0);\n\t\tcountMap.put(\"cells.EmptyCell\", 0);\n\t\tcountMap.put(\"cells.SharkCell\", 0);\n\t\tcountMap.put(\"cells.FishCell\", 0);\n\t\tcountMap.put(\"cells.AntGroupCell\", 0);\n\t\tcountMap.put(\"cells.BlueRPSCell\", 0);\n\t\tcountMap.put(\"cells.GreenRPSCell\", 0);\n\t\tcountMap.put(\"cells.RedRPSCell\", 0);\n\t\tcountMap.put(\"cells.WhiteRPSCell\", 0);\n\t}", "public int getTotalMaps() {\r\n\t\treturn total_maps;\r\n\t}", "public int countPoolMaps(){\n\n\t\treturn poolMaps.size();\n\t}", "@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }", "public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }", "public int getCount() {\n\t\t\treturn maplist2.size();\n\t\t}", "public int nombrePions(Couleur uneCouleur) {\n\t\tCollection<Pion> pions = mesPions.values();\n\t\tint nb = 0;\n\t\tfor (Pion p: pions) {\n\t\t\tif (p.aMemeCouleur(uneCouleur))\n\t\t\tnb++; \n\t\t}\n\t\treturn nb; \n }", "public static void cuentaLetras(char[] c)\n{\n for(int k=0; k < c.length; k++)\n {\n char currentChar = c[k]; \n //to check that currentChar is not in map, if not will add 1 count for firsttime\n if(map1.get(currentChar) == null){\n map1.put(currentChar, 1); \n } \n /*If it is repeating then simply we will increase the count of that key(character) by 1*/\n else {\n map1.put(currentChar, map1.get(currentChar) + 1);\n }\n } //todo el parrafo\n\n}", "public static TreeMap<Integer, ArrayList<String>> countOccur(Map<String,Integer> map){\n\t\tTreeMap<Integer,ArrayList<String>> num_map = new TreeMap<Integer,ArrayList<String>>();\n\t\tfor(String key : map.keySet()) {\n\t\t\tInteger i = map.get(key);\n\t\t\tif(!num_map.containsKey(i)) {\n\t\t\t\tnum_map.put(i, new ArrayList<String>());\n\t\t\t\tnum_map.get(i).add(key);\n\t\t\t} else {\n\t\t\t\tnum_map.get(i).add(key);\n\t\t\t}\n\t\t}\n\t\treturn num_map;\n\t}", "public Integer sizeOfMap() {\n\t\tMap<String, String> simpleMap = createSimpleMap(\"Key\", \"Value\");\n numberOfEntries = 10;\n\t\treturn simpleMap.size();\n\t}", "int getClassIdXyPairsMapCount();", "private int getTotalMobilKeys(Map<String, Set<String>> mobileKeysMap) {\n\t\tint totalMobileKeys = 0;\n\t\tSet<String> mobileKeySet = mobileKeysMap.keySet();\n\t\tfor(String mobileKey: mobileKeySet) {\n\t\t\ttotalMobileKeys += mobileKeysMap.get(mobileKey).size();\n\t\t}\n\t\treturn totalMobileKeys;\n\t}", "private int visit(TreeNode node, Map<Integer, Integer> map, int maxCount) {\n int newCount = map.getOrDefault(node.val,0) + 1;\n map.put(node.val, newCount);\n return Math.max(newCount, maxCount);\n }", "public int size() {\n return map.size();\n }", "public Map<String,Integer> getNumKeysMapping(){\n\t\treturn num_keys;\n\t}", "public int sizeOfMap(){return size;}", "private void createBitStremMap(){\n itemListMap = new HashMap<>();\n \n for (ArrayList<Integer> transactions_set1 : transactions_set) {\n ArrayList curr_tr = (ArrayList) transactions_set1;\n if(curr_tr.size() >= min_itemset_size_K) \n for (Object curr_tr1 : curr_tr) {\n int item = (int) curr_tr1;\n itemListMap.put(item, itemListMap.getOrDefault(item, 0)+1);\n }\n }\n \n // 3. Remove items without minimum support\n itemListMap.values().removeIf(val -> val<min_sup);\n \n // 4. Sort the map to a set of entries\n Set<Map.Entry<Integer, Integer>> set = itemListMap.entrySet();\n frequentItemListSetLenOne = new ArrayList<>(set);\n Collections.sort( frequentItemListSetLenOne, new Comparator<Map.Entry<Integer, Integer>>(){\n @Override\n public int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2 )\n {\n return (o2.getValue()).compareTo( o1.getValue() );\n }\n });\n\n // 5.\n itemIndex = new HashMap<>();\n for(Map.Entry<Integer, Integer> entry : frequentItemListSetLenOne){\n itemIndex.put(entry.getKey(), itemIndex.size());\n }\n\n // 6.\n bitsetLen = frequentItemListSetLenOne.size();\n }", "public int size(){\r\n return cjtMap.size();\r\n }", "void numberOfOpenMapInformation(int number, int pIndex);", "@Override\n public Map<EFruits, Integer> count(Branch branch) {\n bananaNumber = super.countBananas(branch);\n super.fruitMap.put(EFruits.BANANAS, bananaNumber);\n return super.fruitMap;\n }", "public Map<String, Integer> wordCount(String[] strings) {\n\n\n Map<String, Integer> mojaMapa = new HashMap<String, Integer>();\n\n for (String element : strings) {\n if (mojaMapa.containsKey(element)) {\n Integer iloscWystapienElementu = mojaMapa.get(element);\n mojaMapa.put(element, iloscWystapienElementu + 1);\n } else {\n mojaMapa.put(element, 1);\n }\n\n\n }\n return mojaMapa;\n }", "private List<Tuple> charCountMap(Tuple input) {\n \n String[] words = input.snd().replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n \n List<Tuple> output = new ArrayList<Tuple>();\n \n for(String word : words) {\n Integer chars = word.length();\n output.add(new Tuple(chars.toString(),\"1\"));\n }\n \n lolligag();\n \n //<charCount, 1>, <charCount, 1> ...\n return output;\n }", "@Override\r\n\tpublic int dataCount(Map<String, Object> map) {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int listCount(Map<String, Object> map) throws SQLException {\n\t\treturn 0;\r\n\t}", "public Map<Entity, Integer> computeHyponymCountMap()\r\n\t{\n\t\treturn null;\r\n\t}", "public int getCount(HashMap map) {\n\t\treturn GoodsManager.getCount(map);\n\t}", "public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();", "public int size() {\n return map.size();\n }", "public int numberOfBoomerangs(int[][] points) {\n\n Map<Integer, Integer> map = new HashMap<>();\n int result = 0;\n for (int i = 0; i < points.length; i++){\n for(int j = 0; j < points.length; j++){\n if(j != i){\n int distance = calcSquareDistance(points[i],points[j]);\n map.put(distance, map.getOrDefault(distance,0) + 1);\n }\n }\n for(Integer val : map.values()){\n result += (val * (val-1));\n }\n map.clear();\n }\n return result;\n }", "public static int getMapWidth() {\r\n\t\treturn 7;\r\n\t}", "@Override\n public int getSize() {\n return map.size();\n }", "@Test\n public void TEST_UR_MAP_OBJECT_COUNT() {\n Map[] maps = new Map[3];\n maps[0] = new Map(\"Map1/Map1.tmx\", 1000, \"easy\");\n maps[1] = new Map(\"Map1/Map1.tmx\", 1000, \"medium\");\n maps[2] = new Map(\"Map1/Map1.tmx\", 1000, \"hard\");\n for (int i = 0; i <= 2; i++) {\n Map map = maps[i];\n map.createLanes();\n int obstacleCount = map.lanes[0].obstacles.length;\n int powerupCount = map.lanes[0].powerUps.length;\n for (int j = 1; j <= 3; j++) {\n assertEquals(map.lanes[j].obstacles.length, obstacleCount);\n assertEquals(map.lanes[j].powerUps.length, powerupCount);\n }\n }\n }", "public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}", "@Override\n public int size() {\n return map.size();\n }", "private Map<String,Integer> maxCountsMapMerge(Map<String,Integer> map1, Map<String,Integer> map2) {\n\t\tfor (String name : map1.keySet()) {\n\t\t\t// If name is already in map, then just take the higher count.\n\t\t\tInteger map1Count = map1.get(name);\n\t\t\tif (map2.containsKey(name)) {\n\t\t\t\tInteger map2Count = map2.get(name);\n\t\t\t\tif (map1Count > map2Count) {\n\t\t\t\t\tmap2.put(name,map1Count);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmap2.put(name,map1Count);\n\t\t\t}\n\t\t}\t\n\t\treturn map2;\n\t}", "public void sortCount() {\n\t\tfor(Entry<String, TreeMap<String, Integer>> entry:map.entrySet()){\r\n\t\t\tTreeMap<String, Integer> tmap = entry.getValue();\r\n\t\t\tList<Entry<String, Integer>> sorttmap = MapSort.sortMapByIntegerValue(tmap);\r\n\t\t\t int flag=0;\r\n for(Entry<String, Integer> word:sorttmap){ \r\n \tflag++;\r\n \tkeyword.add(word.getKey());\r\n// System.out.println(mapping.getKey()+\":\"+mapping.getValue()); \r\n \tif(flag==5)\r\n \t\tbreak;\r\n } \r\n\t\t}\r\n\t\r\n\t}", "public void sinkCounterMap(){\n for(int i=1; i<(sinkCounter+1); i++){\n sinkCounterMap.put(i,1); //sink is included in basin count;\n \n }\n }", "@Override\r\n public int size() {\r\n return map.size();\r\n }", "public int size() {\n int size = 0;\n for (Collection<V> value : map.values()) {\n size += value.size();\n }\n return size;\n }", "public int size() {\n\t\treturn map.size();\n\t}", "public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }", "private static void doBucketCount(HashMap<String, Integer> bigramCount) {\n\t\t//bucketCountT\n\t\tbucketCountT= new HashMap<Integer,Double>();\n\t\t\t\t\n\t\tfor(String s:bigramCount.keySet()){\n\t\t\tdouble count= bucketCountT.getOrDefault(bigramCount.get(s), (double)0);\n\t\t\tbucketCountT.put(bigramCount.get(s), count+1);\n\t\t}\n\t}", "public void doCount(ArrayList<String> liste){\n\t\tint j;\n\t\t\n\t\tfor (int i = 0; i < liste.size(); i++) {\n\t\t\t// check if string already exists\n\t\t\tif(!map.containsKey(liste.get(i))){\n\t\t\t\t// check frequency of the given string\n\t\t\t\tj = Collections.frequency(liste, liste.get(i));\t\n\t\t\t\t\n\t\t\t\t// underscore instead of blank space\n\t\t\t\tif(liste.get(i).equals(\" \"))\n\t\t\t\t\tmap.put(\"_\", j);\t\n\t\t\t\telse\n\t\t\t\t\tmap.put(liste.get(i), j);\t// (char, frequency)\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t\n\t\t//return map;\n\t}", "private static HashMap<CardRank, Integer>\n getCardMap(ArrayList<CardRank> ranks){\n HashMap<CardRank, Integer> CardMap = new HashMap<>();\n //for every rank in ranks, put this rank into the key\n // and put its frequency into the value\n for(CardRank r :ranks) {\n if (CardMap.containsKey(r)){\n CardMap.put(r, CardMap.get(r) + 1);\n }else{\n CardMap.put(r,1);\n }\n }\n return CardMap;\n }", "@Override\n\tpublic int size() {\n\t\treturn map.size();\n\t}", "public static void main(String[] args) {\n\n\t\tint[] a = {1,2,3,8,8,9,6,4};\n\t String s = \"hello2java\"; \n\t\tHashMap<Integer,Integer> countMap1 = new HashMap<Integer,Integer>();\n\t\tHashMap<Character,Integer> countMap2 = new HashMap<Character,Integer>();\n \n\t\tchar[] ch = s.toCharArray();\n\t\t\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tif(countMap1.containsKey(a[i])){\n\t\t\t\t\tcountMap1.put(a[i], countMap1.get(a[i])+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcountMap1.put(a[i],1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//}\n\t\tSystem.out.println(countMap1);\n\t\t\n\t\tfor(int i=0;i<ch.length;i++){\n\t\t\tif(countMap2.containsKey(ch[i])){\n\t\t\t\tcountMap2.put(ch[i], countMap2.get(ch[i])+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap2.put(ch[i],1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(countMap2);\n\t\t\n\t\tSet<Character> ket = countMap2.keySet();\n for(Character c:ket){\n \tif(countMap2.get(c)>1){\n \t\tSystem.out.println(c+\"-->\"+countMap2.get(c));\n \t}\n }\n\t}", "public int\tsize() {\n\t\treturn map.size();\n\t}", "@Override\r\n\tpublic Integer countFiltering(Map<String, Object> map) {\n\t\treturn filteringMapper.countFiltering(map);\r\n\t}", "int getMonstersCount();", "int getMonstersCount();", "private static Map<String, Integer> mapMonths(final String[] months) {\n final Map<String, Integer> mapping = new LinkedHashMap<String, Integer>();\n\n for (final String month : months) {\n if (!month.isEmpty()) { // 13th month may or may not be empty,\n // depending on default calendar.\n mapping.put(month, mapping.size() + 1);\n }\n }\n\n return mapping;\n }", "public int size() {\r\n return this.map.size();\r\n }", "public static Integer getMapWidth() {\n\t\treturn MAPWIDTH;\n\t}", "public int getNumGruppoPacchetti();", "public void ball_counter()\n {\n ballot_count=0;\n for (HashMap.Entry<String,Ballot> set : allBallots.entrySet())\n {\n ballot_count++;\n }\n }", "private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}", "@Override\n\tpublic int count(HashMap<String, String> map) {\n\t\treturn dao.count(map);\n\t}", "@Override\r\n public String getUsoMaggiore() {\n int maxpacchetti=0;\r\n int npacchetti=0;\r\n String a;\r\n Map<String, String> mappatemp=new HashMap<>();\r\n Iterator<Map<String, String>> iterator;\r\n iterator = getUltimaEntry().iterator();\r\n System.out.println(getUltimaEntry().size());\r\n\t\twhile (iterator.hasNext()) {\r\n \r\n\t\t\tMap<String, String> m = iterator.next();\r\n //si fa la ricerca della più utilizzata all'inerno della mappa\r\n \r\n npacchetti=Integer.parseInt(m.get(\"RX-OK\"))+Integer.parseInt(m.get(\"TX-OK\"));\r\n System.out.println(maxpacchetti);\r\n if (maxpacchetti<npacchetti){\r\n maxpacchetti=npacchetti;\r\n mappatemp.put(\"Iface\",m.get(\"Iface\"));\r\n mappatemp.put(\"Pacchetti_TX+RX_OK\",String.valueOf(npacchetti));\r\n \r\n }\r\n }\r\n \r\n try {\r\n String json = new ObjectMapper().writeValueAsString(mappatemp);\r\n System.out.println(json);\r\n \r\n \r\n if (json!=null) return json ;\r\n } catch (JsonProcessingException ex) {\r\n Logger.getLogger(NetstatSingleton.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n \r\n return \"NOT WORKING\";\r\n \r\n }", "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 int count( K key ) {\n Integer i = map.get( key );\n return i == null ? 0 : i;\n }", "private void calculateMapSize() {\n calculateMapSize(true);\n }", "@Test\n public void test() {\n char[][] map = new char[][] {\n new char[]{ '1', '1', '1', '1', '0' },\n new char[]{ '1', '1', '0', '1', '0' },\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '0', '0', '0', '0', '0' },\n };\n assertThat(numIslands(map), equalTo(1));\n\n //11000\n //11000\n //00100\n //00011\n char[][] map2 = new char[][] {\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '1', '1', '0', '0', '0' },\n new char[]{ '0', '0', '1', '0', '0' },\n new char[]{ '0', '0', '0', '1', '1' },\n };\n assertThat(numIslands(map2), equalTo(3));\n }", "public int getPreItemCountByName(Map<String, Object> map) {\n\t\treturn simpleDao.getEntity(\"PreItem_NS.getPreItemCountByName\", map);\n\t}", "public int total() {\n int summation = 0;\n for ( int value : map.values() ) {\n summation += value;\n }\n return summation;\n }", "public int numeroOcupado() {\n int i = 0;\n for (Map.Entry e : lista.entrySet()) {\n Equipamento eq = (Equipamento) e.getValue();\n if (eq.getEstado().equals(\"Ocupado\"))\n i++;\n }\n return i;\n }", "public Map<Long, Long> getInstanceCount() {\n if (instanceCountMap == null) {\n FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<Long, Long>() {\n @Override\n public Long get(Object key) {\n return EJBLookup.getTypeEngine().getInstanceCount(Long.valueOf(key.toString()));\n }\n }, true);\n }\n return instanceCountMap;\n }", "public HashMap<Integer,Integer> countStudent(){\n int i=students.size();\n int y=class_s.size();\n for (int j=0;j<y;j++){\n count=0;\n for (int z=0;z<i;z++){\n if(class_s.get(j).getClassID()==students.get(z).getClassID()){\n count++;\n\n }\n \n }\n map.put(class_s.get(j).getClassID(),count);\n \n }\n return (HashMap<Integer,Integer>)map;\n }", "public static int m112594b(Map<String, String> map) {\n if (map == null || !map.containsKey(f91122r)) {\n return 0;\n }\n return C34949d.m112623a((String) map.get(f91122r));\n }", "private static int df(TLongLongMap docs, Map<Long, Document> docsMap) {\n\t\tint compteur = 0;\n\t\tlong[] keys = docs.keys();\n\t\t\n\t\tfor (int i = 0; i < keys.length; i ++) {\n\t\t\tif (docsMap.get(keys[i]).getType() == Document.Type_Element.ARTICLE \n\t\t\t\t\t&& docsMap.get(keys[i]).getCheminDocument().equals(\"article[1]/\")) {\n\t\t\t\tcompteur += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn compteur;\n\t}", "public abstract java.util.Map<java.lang.String, java.lang.Integer> idiosyncraticEventIncidenceCountMap();", "@Override\n\tpublic int size() \n\t{\n\t\treturn this.map.size();\n\t}", "private Map<String, Integer> getWordCountPerSentenceMap(List<String> sentences) {\n Map<String, Integer> wordCountPerSentenceMap = new LinkedHashMap<>();\n sentences.stream().forEach(sentence -> wordCountPerSentenceMap.put(sentence.trim(), sentence.trim().split(\" \").length));\n return wordCountPerSentenceMap;\n }", "private int obtem_primeiro(int numero)\n {\n for (Map.Entry i : janela.entrySet()) if(((Estado)i.getValue()).getNumero_sequencia() == numero && !((Estado) i.getValue()).isEstado()) return (int) i.getKey();\n return 0;\n }", "public int getMountainCount() {\n\t\tcounter = 0;\n\t\tfor (int row = 0; row < battlefield.length; row++) {\n\t\t\tfor (int column = 0; column < battlefield[row].length; column++) {\n\t\t\t\tif (battlefield[row][column].getTerrain().getIcon() == \"M\") {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}", "public int findByCount(Map<String, Object> map) {\n\treturn projectmapper.findByCount(map);\n}", "@Override\n\tpublic int size() {\n\t\tint tamano = 0;\n\t\tint i = 0;\n\t\tIterator it = tabla.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tit.next();\n\t\t\ttamano += tabla.get(i).keySet().size();\n\t\t\ti++;\n\t\t}\n\t\treturn tamano;\n\t}", "public int getNumMarkers() {\n if ( dofs == null ) return 0;\n return dofs[0].length/3;\n }", "public int size()\r\n/* 106: */ {\r\n/* 107:194 */ assert (checkRep());\r\n/* 108:195 */ return this.map.keySet().size();\r\n/* 109: */ }", "static public int numberOfPersons() {\n return personMap.size();\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 int recNumMapTasks(int mis)\r\n\t{\r\n\t long splitSize = mis*1024*1024;\r\n\t return (int)(inputSize/splitSize)+1;\r\n\t}", "public int nbLibres() {\n\t\tint libre = 0;\n\t\tfor(Borne b : bornes) {\n\t\t\tlibre += b.getEtatBorne();\n\t\t}\n\t\treturn libre;\n\t}", "@Override\n\t\tpublic int hashCode() {\n\t\t\treturn countMap.hashCode();\n\t\t}", "java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();", "public MapSum() {\n map = new HashMap<>();\n }", "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 }", "public void pleitegeierSperren() {\n kontoMap.values().stream()\n .filter(konto -> konto.getKontostand() < 0)\n .forEach(Konto::sperren);\n }", "public Map<String, Integer> verCarritoConCantidades(){\n\t\treturn this.datosCompras;\n\t}", "private static Map<String, Integer> getWords(){\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tStringTokenizer tokens = new StringTokenizer(status.getText());\n\t\t\twhile(tokens.hasMoreTokens()){\n\t\t\t\tString token = tokens.nextToken();\n\t\t\t\tif(!token.equals(\"RT\")){\n\t\t\t\t\tif(map.containsKey(token)){\n\t\t\t\t\t\tint count = map.get(token);\n\t\t\t\t\t\tmap.put(token, ++count);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap.put(token, 1);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn map;\n\t}", "public void getCounts() {\t\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++)\r\n\t\t\tfor(int j = 0; j < 3; j++)\r\n\t\t\t\tthecounts[i][j] = 0;\r\n\t\t\r\n\t\tfor(int i=0;i<maps.length-1;i++) {\r\n\t\t\tif(maps.Array1.charAt(i) == 'H' && maps.Array1.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[0][0]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == 'E' && maps.Array1.charAt(i+1) =='-') \r\n\t\t\t\tthecounts[0][1]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[0][2]++;\r\n\t\t\tif(maps.Array2.charAt(i) == 'H' && maps.Array2.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[1][0]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == 'E' && maps.Array2.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[1][1]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == '-' && maps.Array2.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[1][2]++;\r\n\t\t\tif(maps.Array3.charAt(i) == 'H' && maps.Array3.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[2][0]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == 'E' && maps.Array3.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[2][1]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == '-' && maps.Array3.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[2][2]++;\r\n\t\t\tif(maps.Array4.charAt(i) == 'H' && maps.Array4.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[3][0]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == 'E'&&maps.Array4.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[3][1]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[3][2]++;\r\n\t\t}\r\n\t\t\r\n\t\t//Getting transition value between 1 and 0\r\n\t\tfor(int i=0;i<4;i++) {\r\n\t\t\tfor(int j=0;j<3;j++) {\r\n\t\t\t\tthecounts[i][j]/=maps.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Displaying the obtained values\r\n\t\tSystem.out.println(\"\\nTRANSITION\");\r\n\t\tSystem.out.println(\"HYDROPHOBICITY: 1->2: \" + thecounts[0][0] + \" 2->3: \" + thecounts[0][1] + \" 3->1: \" + thecounts[0][2]);\r\n\t\tSystem.out.println(\"POLARIZABILITY: 1->2: \" + thecounts[1][0] + \" 2->3: \" + thecounts[1][1] + \" 3-1: \" + thecounts[1][2]);\r\n\t\tSystem.out.println(\"POLARITY: 1->2: \" + thecounts[2][0] + \" 2->3: \" + thecounts[2][1] + \" 3->1: \" + thecounts[2][2]);\r\n\t\tSystem.out.println(\"VAN DER WALLS VOLUME: 1->2: \" + thecounts[3][0] + \" 2->3: \" + thecounts[3][1] + \" 3->1: \" + thecounts[3][2]);\r\n\t\t\r\n\t}", "public int pageCount(Map map) {\n\t\treturn iSBookMapper.pageCount(map);\n\t}", "abstract Map<String, Integer> mapOfNamesToSalary();", "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 }", "static HashMap runLengthEncoding(List<Character> list){\r\n\t\t\r\n\t\tHashMap<Character,Integer> map=new HashMap<>();\r\n\t\t\r\n\t\tfor(char a:list)\r\n\t\t{\r\n\t\tif(map.get(a)==null)\r\n\t\t{\r\n\t\t\tmap.put(a, 1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmap.put(a, map.get(a)+1);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\treturn map;\r\n\t\r\n\t}" ]
[ "0.6370444", "0.6321366", "0.6199439", "0.618473", "0.6121973", "0.61197263", "0.61194557", "0.6006211", "0.60039717", "0.59708506", "0.59364617", "0.5921319", "0.59150606", "0.58279926", "0.5824692", "0.5813416", "0.5803952", "0.57918197", "0.57719505", "0.5771523", "0.5770704", "0.5744456", "0.5741105", "0.57245344", "0.57230955", "0.5722528", "0.5694408", "0.5669142", "0.5668222", "0.5655091", "0.5634905", "0.5633959", "0.56331", "0.56209546", "0.56137717", "0.56085575", "0.56082106", "0.5607155", "0.56027955", "0.5598871", "0.5586883", "0.5584383", "0.5581726", "0.5577101", "0.55580056", "0.55526537", "0.5547835", "0.5537041", "0.5533177", "0.5526552", "0.55180997", "0.551307", "0.5509179", "0.54919803", "0.54868156", "0.54647326", "0.54647326", "0.5459585", "0.545461", "0.54519176", "0.54295695", "0.5427739", "0.54260886", "0.5414806", "0.5411693", "0.5411011", "0.54070735", "0.5404864", "0.5403039", "0.5402548", "0.54023886", "0.5401348", "0.5378726", "0.5360245", "0.5357256", "0.5357152", "0.5354323", "0.53409266", "0.5335824", "0.5331451", "0.5331219", "0.5324487", "0.53234166", "0.53217834", "0.5317007", "0.53115535", "0.5309584", "0.53012097", "0.5299822", "0.52989596", "0.5298124", "0.52974427", "0.5294743", "0.5286571", "0.52755046", "0.52710617", "0.52698463", "0.5269344", "0.52657783", "0.5263956", "0.52612585" ]
0.0
-1
retourne la table des unites
Soldat[][] getUnites();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Units getUnitTable();", "public void setUnitTable(Units value);", "public void llenarTabla(){\n pedidoMatDao.llenarTabla();\n }", "private void setNewTable() {\n\n for (List<Entity> list:\n masterList) {\n for (Entity entity :\n list) {\n entity.removeFromWorld();\n }\n list.clear();\n }\n\n gameFacade.setGameTable(gameFacade.newFullPlayableTable(\"asd\",\n 6, 0.5, 2, 2));\n for (Bumper bumper :\n gameFacade.getBumpers()) {\n Entity bumperEntity = factory.newBumperEntity(bumper);\n targets.add(bumperEntity);\n getGameWorld().addEntity(bumperEntity);\n }\n\n for (Target target :\n gameFacade.getTargets()) {\n Entity targetEntity = factory.newTargetEntity(target);\n targets.add(targetEntity);\n getGameWorld().addEntity(targetEntity);\n }\n }", "Tablero consultarTablero();", "TableFull createTableFull();", "private void UpdateTable() {\n\t\t\t\t\n\t\t\t}", "private void updateALUTableTomasulo() {\n\t\t// Get a copy of the memory stations\n\t\tALUStation[] temp_alu = alu_rsTomasulo;\n\n\t\t// Update the table with current values for the stations\n\t\tfor (int i = 0; i < temp_alu.length; i++) {\n\t\t\t// generate a meaningfull representation of busy\n\t\t\tString busy_desc = (temp_alu[i].isBusy() ? \"Yes\" : \"No\");\n\n\t\t\tReservationStationModelTomasulo\n\t\t\t\t\t.setValueAt(((temp_alu[i].isReady() && temp_alu[i].isBusy()) ? temp_alu[i].getCycle() : \"0\"), i, 0);\n\n\t\t\tReservationStationModelTomasulo.setValueAt(temp_alu[i].getName(), i, 1);\n\t\t\tReservationStationModelTomasulo.setValueAt(busy_desc, i, 2);\n\t\t\tReservationStationModelTomasulo.setValueAt(((temp_alu[i].isBusy()) ? temp_alu[i].getOperation() : \" \"), i,\n\t\t\t\t\t3);\n\t\t\tReservationStationModelTomasulo.setValueAt(temp_alu[i].getVj(), i, 4);\n\t\t\tReservationStationModelTomasulo.setValueAt(temp_alu[i].getVk(), i, 5);\n\t\t\tReservationStationModelTomasulo.setValueAt(temp_alu[i].getQj(), i, 6);\n\t\t\tReservationStationModelTomasulo.setValueAt(temp_alu[i].getQk(), i, 7);\n\t\t}\n\t}", "private void limparTabela() {\n while (tmLivro.getRowCount() > 0) {\n tmLivro.removeRow(0);\n }\n }", "private void srediTabelu() {\n\n mtu = (ModelTabeleUlica) jtblUlica.getModel();\n ArrayList<Ulica> ulice = kontrolor.Kontroler.getInstanca().vratiUlice();\n mtu.setLista(ulice);\n\n }", "private void limparTabela() { \n while (tmLivro.getRowCount() > 0) { \n tmLivro.removeRow(0);\n }\n }", "private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}", "private void srediTabelu() {\n ModelTabeleStavka mts = new ModelTabeleStavka();\n mts.setLista(n.getLista());\n tblStavka.setModel(mts);\n }", "public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }", "private void updateMemTableTomasulo() {\n\t\t// Get a copy of the memory stations\n\t\tMemStation[] temp_ms = MemReservationTomasulo;\n\n\t\t// Update the table with current values for the stations\n\t\tfor (int i = 0; i < temp_ms.length; i++) {\n\t\t\t// generate a meaningfull representation of busy\n\t\t\tString busy_desc = (temp_ms[i].isBusy() ? \"Yes\" : \"No\");\n\n\t\t\tMemoryModelTomasulo.setValueAt(temp_ms[i].getName(), i, 0);\n\t\t\tMemoryModelTomasulo.setValueAt(busy_desc, i, 1);\n\t\t\tMemoryModelTomasulo.setValueAt(temp_ms[i].getAddress(), i, 2);\n\t\t}\n\t}", "public static void viewtable() {\r\n\t\tt.dibuixa(table);\r\n\t}", "private EstabelecimentoTable() {\n\t\t\t}", "private void loadTable() {\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n try {\n String sql = \"select * from tb_mahasiswa\";\n Statement n = a.createStatement();\n ResultSet rs = n.executeQuery(sql);\n while (rs.next()) {\n Object[] o = new Object[6];\n o[0] = rs.getString(\"id_mahasiswa\");\n o[1] = rs.getString(\"nama\");\n o[2] = rs.getString(\"tempat\");\n o[3] = rs.getString(\"waktu\");\n o[4] = rs.getString(\"status\");\n model.addRow(o);\n }\n } catch (Exception e) {\n }\n }", "private void updateRegisterTableTomasulo() {\n\t\tint temp_it_index = 0; // tempory index tracker\n\n\t\t// Get the Integer Registers\n\t\tMap<String, String> temp_int_reg = registersTomasulo.getIntegerRegisters();\n\t\t// Get the FP Registers\n\t\tMap<String, String> temp_fp_reg = registersTomasulo.getFPRegisters();\n\n\t\t// add rows if needed\n\t\twhile ((temp_int_reg.size() > RegisterModelTomasulo.getRowCount())\n\t\t\t\t|| (temp_fp_reg.size() > RegisterModelTomasulo.getRowCount())) {\n\t\t\tRegisterModelTomasulo.addRow(new Object[] { \" \", \" \", \" \", \" \" });\n\t\t}\n\n\t\t// Update Integer Table Values\n\t\tfor (Map.Entry<String, String> int_entry : temp_int_reg.entrySet()) {\n\t\t\tRegisterModelTomasulo.setValueAt(int_entry.getKey(), temp_it_index, 2);\n\t\t\tRegisterModelTomasulo.setValueAt(int_entry.getValue(), temp_it_index, 3);\n\n\t\t\ttemp_it_index++;\n\t\t}\n\n\t\ttemp_it_index = 0;\n\t\t// Update Integer Table Values\n\t\tfor (Map.Entry<String, String> fp_entry : temp_fp_reg.entrySet()) {\n\t\t\tRegisterModelTomasulo.setValueAt(fp_entry.getKey(), temp_it_index, 0);\n\t\t\tRegisterModelTomasulo.setValueAt(fp_entry.getValue(), temp_it_index, 1);\n\n\t\t\ttemp_it_index++;\n\t\t}\n\t}", "private void Actualizar_Tabla() {\n String[] columNames = {\"iditem\", \"codigo\", \"descripcion\", \"p_vent\", \"p_comp\", \"cant\", \"fecha\"};\n dtPersona = db.Select_Item();\n // se colocan los datos en la tabla\n DefaultTableModel datos = new DefaultTableModel(dtPersona, columNames);\n jTable1.setModel(datos);\n }", "void prepareTables();", "private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}", "private void populaUnidadeMedida()\n {\n UnidadeMedida u = new UnidadeMedida(\"Gramas\", \"g\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Quilo\", \"kg\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Quilo\", \"kg\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Unidade\", \"unidade\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Colher de Sopa\", \"col. sopa\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Colher de Sobremesa\", \"col. sobremesa\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Colher de Chá\", \"col. chá\");\n unidadeMedidaDAO.insert(u);\n u = new UnidadeMedida(\"Copo\", \"copo\");\n unidadeMedidaDAO.insert(u);\n\n }", "@Query(\"SELECT * FROM unit WHERE sync_delete = 0\")\n public List<Unit> getUnitTerhapus();", "private void popuniTabelu() {\n try {\n List<PutnikEntity> putnici=Controller.vratiSvePutnike();\n TableModel tm=new PutnikTableModel(putnici);\n jtblPutnici.setModel(tm);\n } catch (Exception ex) {\n Logger.getLogger(FIzaberiLet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void loadAllManufacturesTable(){\n \n \n try {\n String query = \"SELECT manufacture.maID as 'Manufacture ID', name as 'Manufacture Name', address as 'Manufacture Address', email as 'Manufacture Email', manufacture_phone.phone as 'Phone' FROM manufacture left outer join manufacture_phone ON manufacture.maID=manufacture_phone.maID ORDER BY manufacture.maID\";\n ps = connection.prepareStatement(query);\n rs = ps.executeQuery();\n \n allManufactureTable.setModel(DbUtils.resultSetToTableModel(rs));\n \n //change row height\n allManufactureTable.setRowHeight(30);\n \n //change column width of column two\n /* TableColumnModel columnModel = allManufactureTable.getColumnModel();\n columnModel.getColumn(0).setPreferredWidth(10);\n columnModel.getColumn(1).setPreferredWidth(70);\n columnModel.getColumn(2).setPreferredWidth(5);\n columnModel.getColumn(3).setPreferredWidth(70); */\n \n } catch (SQLException ex) {\n Logger.getLogger(viewAllBrands.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void updateTable(){\n try{\n String query = \" select id,name as Name,address as Address,description as Description, capacity as Capacity from public_spaces where category = 'accomodation' \";\n PreparedStatement pst = connect.prepareStatement(query);\n ResultSet rs = pst.executeQuery();\n users_table.setModel(DbUtils.resultSetToTableModel(rs));\n }\n catch(Exception e){\n System.out.println(e);\n }\n }", "public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }", "public static void resetTable() {\n tableModel.resetDefault();\n updateSummaryTable();\n }", "private void intiPlanTable(){\n //gets all plans that are linked with the current profile\n List<Plan> planList = profile.getPlans().getPlans();\n //now add all plans to the table\n DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel();\n model.setRowCount(0);\n planList.forEach((p) -> {\n model.addRow(new Object[]{p.getPlanName(),p});\n });\n }", "private void prepareTable() {\n TeamsRepository tr = new TeamsRepository();\n //ka uradim ovo dle odma mi samo inicijalizuje tabelu\n// tblTeams.setModel(new TeamsTableModel(tr.getTeams()));\n// ni ovaj kod mi nista nije radio\n// TeamsTableModel ttm = new TeamsTableModel(tr.getTeams());\n TableColumnModel tcm = tblTeams.getColumnModel();\n TableColumn tc = tcm.getColumn(1);\n TableCellEditor tce = new DefaultCellEditor(getComboBox());\n tc.setCellEditor(tce);\n }", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "private void populaUnidade()\n {\n Unidade unidade = new Unidade(\"Unidade Santo Amaro\", \"Horario de funcionamento: 6:00 as 23:00\");\n unidadeDAO.insert(unidade);\n unidade = new Unidade(\"Unidade Aclimação\", \"Horario de funcionamento: 7:00 as 22:00\");\n unidadeDAO.insert(unidade);\n unidade = new Unidade(\"Unidade Vinhedo\", \"Horario de funcionamento: 6:00 as 22:00\");\n unidadeDAO.insert(unidade);\n }", "public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }", "public void createTable() {\n try {\n tableLayout = findViewById(R.id.tabla);\n tb = new TableDinamic(tableLayout, getApplicationContext(), \"cargarDetalle\", clc, cap_1, cap_2, cap_ct, txtidReg, txtId, txtBloque, txtVariedad);\n tableLayout.removeAllViews();\n tb.addHeader(header);\n tb.addData(cargarTabla());\n tb.backgroundHeader(\n Color.parseColor(\"#20C0FF\")\n );\n tb.backgroundData(\n Color.parseColor(\"#FFFFFF\"),\n Color.parseColor(\"#81F0EDED\")\n );\n } catch (Exception e) {\n Toast.makeText(this, \"Error de la table: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n }", "public LinkedList<PersonnelUnit> getAllUnits(PersonnelUnit unit) {\n MysqlDbManager dbManager = MysqlDbManager.getInstance();\n LinkedList<PersonnelUnit> personnelUnits = new LinkedList<PersonnelUnit>();\n String tableName = \"\";\n if (unit.getClass() == Employee.class) {\n tableName = \"employees\";\n } else if (unit.getClass() == Technology.class) {\n tableName = \"technologies\";\n } else if (unit.getClass() == Affair.class) {\n tableName = \"affair\";\n }\n String SQL = \"SELECT * FROM \" + tableName + \"\";\n try {\n ResultSet resultSet = dbManager.getResultSet(SQL);\n while (resultSet.next()) {\n if (unit.getClass() == Employee.class) {\n personnelUnits.add(new Employee(resultSet));\n } else if (unit.getClass() == Technology.class) {\n personnelUnits.add(new Technology(resultSet));\n } else if (unit.getClass() == Affair.class) {\n personnelUnits.add(new Affair(resultSet));\n }\n }\n } catch (SQLException e) {\n LOGGER.log(Level.SEVERE, \"SQLException4: \" + e.toString());\n } finally {\n try {\n if (!dbManager.getResultSet().isClosed()) {\n dbManager.getResultSet().close();\n }\n if (!dbManager.getPreparedStatement().isClosed()) {\n dbManager.getPreparedStatement().close();\n }\n if (!dbManager.getConnection().isClosed()) {\n dbManager.getConnection().close();\n }\n } catch (SQLException e) {\n LOGGER.log(Level.SEVERE, \"SQLException: \" + e.toString());\n }\n }\n return personnelUnits;\n }", "public static void resetTableRam(){\r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(ram);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n \r\n }", "public Rooms getRmTable();", "public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }", "private void dealToTable()\r\n\t{\r\n\t\tthis.onTable.clear();\r\n\t\tif(this.deck.size() >= Config.TableCards)\r\n\t\t{\r\n\t\t\tthis.onTable.addAll(this.deck.subList(0, Config.TableCards));\r\n\t\t\tthis.deck = this.deck.subList(Config.TableCards, this.deck.size());\r\n\t\t}\r\n\t}", "private void setTable() {\n try {\n DefaultTableModel dtm = (DefaultTableModel) table.getModel();\n dtm.setRowCount(0);\n ArrayList<Item> itemList = ItemController.getAllItem();\n if (itemList != null) {\n for (Item item : itemList) {\n String qoh = BatchController.getQOH(item.getCode());\n if (qoh != null) {\n if (item.getRol() >= Integer.valueOf(qoh)) {\n Object row[] = {item.getCode(), item.getDesciption(), item.getRol(), qoh};\n dtm.addRow(row);\n }\n }\n\n }\n }\n if (dtm.getRowCount() == 0) {\n JOptionPane.showMessageDialog(this, \"Stock level is above ROL\");\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void listarutilizador() {\n \n \n List<Utilizador> cs =new UtilizadorJpaController().findUtilizadorEntities();\n \n DefaultTableModel tbm=(DefaultTableModel) listadeutilizador.getModel();\n \n for (int i = tbm.getRowCount()-1; i >= 0; i--) {\n tbm.removeRow(i);\n }\n int i=0;\n for (Utilizador c : cs) {\n tbm.addRow(new String[1]);\n listadeutilizador.setValueAt(c.getIdutilizador(), i, 0);\n listadeutilizador.setValueAt(c.getNome(), i, 1);\n listadeutilizador.setValueAt(c.getUtilizador(), i, 2);\n listadeutilizador.setValueAt(c.getIdprevilegio().getPrevilegio(), i, 3);\n// listaderelatorio.setValueAt(f.getTotal(), i, 4);\n// Distrito di = new DistritoJpaController().getDistritoByLoc(f.getIdlocalidade());\n// Localidade lo = new LocalidadeJpaController().findLocalidade(f.getIdlocalidade());\n// listaderelatorio.setValueAt(di.getDistrito(), i, 0);//lo.getIdposto().getIddistrito().getDistrito(), i, 0);\n// listaderelatorio.setValueAt(lo.getLocalidade(), i, 1);\n \n//// listadeformando.setValueAt(f.getSexo(), i, 2);\n// listaderelatorio.setValueAt(f.getQhomem(), i, 2);\n// listaderelatorio.setValueAt(f.getQmulher(), i, 3);\n// listaderelatorio.setValueAt(f.getTotal(), i, 4);\n// \n// \n i++;\n }\n \n \n \n }", "Table getTable();", "private void refTable() {\n try {\n String s = \"select * from stock\";\n pstm = con.prepareStatement(s);\n res = pstm.executeQuery(s);\n table.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"There Is No Data In Server\");\n }\n }", "public void reloadRoomTable() {\r\n\t\t// controller for table methods\r\n\t\tIntfCtrlGenericTables genericTablesController = new CtrlGenericTables();\r\n\t\t// set the Semester label\r\n\t\tthis.lblvaluesemester_.setText(ViewManager.getInstance()\r\n\t\t\t\t.getCoreBaseTab().getComboBoxSemesterFilter().getSelectedItem()\r\n\t\t\t\t.toString());\r\n\t\t// get the room allocations from the temprary storage\r\n\t\tList<IntfRoomAllocation> roomAllocationList = this.roomAllocList_;\r\n\t\t// call the reload method\r\n\t\tgenericTablesController.reloadTable(getStundenplanTable(),\r\n\t\t\t\troomAllocationList, true, true);\r\n\r\n\t\t// Set the maximum size of the scroll pane (don't forget to add the\r\n\t\t// table header!)\r\n\t\tscrollPane_.setMaximumSize(new Dimension(32767, ((int) timetableTable_\r\n\t\t\t\t.getPreferredSize().getHeight() + 26)));\r\n\t\tthis.updateUI();\r\n\t}", "private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}", "private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }", "private void reloadPlanTable() {\n\t\t\r\n\t}", "public UnitTableModel(IMsoModelIf model)\r\n\t{\r\n\t\t// forward\r\n\t\tsuper(IUnitIf.class,NAMES,CAPTIONS,false);\r\n\r\n\t\t// install model\r\n\t\tconnect(model,IUnitIf.ALL_SELECTOR,IUnitIf.TYPE_AND_NUMBER_COMPARATOR);\r\n\r\n\t\t// load units from model\r\n\t\tload(model.getMsoManager().getCmdPost().getUnitList());\r\n\r\n\t}", "private void actualizarTablaPeriodos() {\n\t\tMap<Integer, Periodo> periodos = modelo\n\t\t\t\t.obtenerPeriodos(Integer.parseInt(jfad.cBCursosMod.getSelectedItem().toString()));\n\t\tDefaultTableModel dtm = new DefaultTableModel(new Object[][] {},\n\t\t\t\tnew String[] { \"Periodo\", \"Dia inicio\", \"Dia fin\", \"Hora inicio\", \"Hora_fin\", \"Habilitado\" });\n\n\t\tfor (Integer key : periodos.keySet()) {\n\n\t\t\tdtm.addRow(new Object[] { key, periodos.get(key).getDia_inicio(), periodos.get(key).getDia_fin(),\n\t\t\t\t\tperiodos.get(key).getHora_inicio(), periodos.get(key).getHora_fin(),\n\t\t\t\t\tperiodos.get(key).getHabilitado() });\n\t\t}\n\t\tjfad.tPeriodos.setModel(dtm);\n\t}", "public void prepareTable() {\n \tthis.table = new Tape(this.height,this.width,2,this.map);\n }", "private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }", "public void updateTable() {\n tabelModel.setRowCount(0);\n Link current = result.first;\n for (int i = 0; current != null; i++) {\n Object[] row = {current.getMasjid(), current.getAlamat()};\n tabelModel.addRow(row);\n current = current.next;\n }\n }", "public void PreencherTabela() throws SQLException {\n try (Connection connection = ConnectionFactory.getConnection()) {\n String[] colunas = new String[]{\"ID\", \"Nome\", \"Nomenclatura\", \"Quantidade\"};\n ArrayList dados = new ArrayList();\n for (ViewProdutoPedido v : viewProdutoPedidos) {\n dados.add(new Object[]{v.getId(), v.getNome(), v.getNomenclatura(), v.getQuantidade()});\n }\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n jTableItensPedido.setModel(modelo);\n jTableItensPedido.setRowSorter(new TableRowSorter(modelo));\n jTableItensPedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTableItensPedido.getColumnModel().getColumn(0).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(1).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(2).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(2).setResizable(false);\n jTableItensPedido.getColumnModel().getColumn(3).setPreferredWidth(20);\n jTableItensPedido.getColumnModel().getColumn(3).setResizable(false);\n\n }\n }", "private static void dodajClanaUTabelu(Clan c) {\r\n\t\tDefaultTableModel dtm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\t\tdtm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\tcentrirajTabelu();\r\n\t}", "public void popularTabela() {\n\n try {\n\n RelatorioRN relatorioRN = new RelatorioRN();\n\n ArrayList<PedidoVO> pedidos = relatorioRN.buscarPedidos();\n\n javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) tRelatorio.getModel();\n dtm.fireTableDataChanged();\n dtm.setRowCount(0);\n\n for (PedidoVO pedidoVO : pedidos) {\n\n String[] linha = {\"\" + pedidoVO.getIdpedido(), \"\" + pedidoVO.getData(), \"\" + pedidoVO.getCliente(), \"\" + pedidoVO.getValor()};\n dtm.addRow(linha);\n }\n\n } catch (SQLException sqle) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + sqle.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n \n } catch (Exception e) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + e.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private static void popuniTabelu() {\r\n\t\tDefaultTableModel dfm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\r\n\t\tdfm.setRowCount(0);\r\n\r\n\t\tfor (int i = 0; i < listaClanova.size(); i++) {\r\n\t\t\tClan c = listaClanova.getClan(i);\r\n\t\t\tdfm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\t}\r\n\t\tcentrirajTabelu();\r\n\t}", "public void updateTable() {\n\t\ttable.getSelectionModel().removeListSelectionListener(lsl);\n\t\tdtm = new DefaultTableModel();\n\t\td = new Diet();\n\t\tdtm.addColumn(\"Id\");\n\t\tdtm.addColumn(\"Meal Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Food Type\");\n\t\tdtm.addColumn(\"Food Category\");\n\t\tdtm.addColumn(\"Ready Time\");\n\t\tdtm.addColumn(\"Calories (g)\");\t\t\n\t\tdtm.addColumn(\"Protein (g)\");\n\t\tdtm.addColumn(\"Fat (g)\");\n\t\tdtm.addColumn(\"Carbohydrates\");\n\t\tdtm.addColumn(\"VitaminA\");\n\t\tdtm.addColumn(\"VitaminC\");\n\t\tdtm.addColumn(\"Calcium\");\n\t\tdtm.addColumn(\"Iron\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<Diet> dietList = dI.getDietList();\n\t\tif(isOrder && orderby!=\"\")\n\t\t{\t\t\t\n\t\t\tSystem.out.println(\"entering ----------------\"+orderby);\n\t\t\tdietList=dI.getDietOrderedList(type,orderby);\n\t\t\tfor (Diet d : dietList) {\t\n\t\t\t\tSystem.out.println(d.getId()+\" ------ \"+d.getCalories());\n\t\t\t}\n\t\t}\n\t\tif(isFiltered)\n\t\t{\n\t\t\tif(mealtypeSel!=\"\")\n\t\t\tdietList=dI.getFilteredMealTypeList(mealtypeSel);\n\t\t\tif(foodtypeSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredFoodTypeList(foodtypeSel);\n\t\t\tif(authorSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredauthorList(authorSel);\n\t\t\tif(foodCategorySel!=\"\")\n\t\t\t\tdietList=dI.getFilterFoodCategoryList(foodCategorySel);\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Diet d : dietList) {\t\n\t\t\tdtm.addRow(d.getVector());\n\t\t}\n\t\ttable.setModel(dtm);\n\n\t\ttable.getSelectionModel().addListSelectionListener(lsl);\n\n\t}", "public void formDatabaseTable() {\n }", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "public void updateTeamTables() {\n ArrayList<Player> tempTeam = new ArrayList<>();\n ArrayList<Player> tempTaxi = new ArrayList<>();\n teamTable.getItems().clear();\n for (Team tt : dataManager.getDraft().getFantasyTeams()) {\n if (tt.getTeamName().equals(selectTeam.getSelectionModel().getSelectedItem())) {\n tempTeam = tt.getTeamList();\n tempTaxi = tt.getTaxiList();\n }\n }\n teamTable = resetTeamTable(tempTeam);\n teamTaxiTable = resetTaxiTable(tempTaxi);\n \n teamTable.getSortOrder().add(posCol);\n posCol.setComparator(positionCompare);\n posCol.setSortType(SortType.ASCENDING);\n posCol.setSortable(true);\n posCol.setSortable(false);\n }", "List<UnitDTO> getAllUnits();", "public void llenarTabla() {\n DefaultTableModel modelos = (DefaultTableModel) tableProducto.getModel();\n while (modelos.getRowCount() > 0) {\n modelos.removeRow(0);\n }\n MarcaDAO marcaDao = new MarcaDAO();\n CategoriaProductoDAO catProDao = new CategoriaProductoDAO();\n ProductoDAO proDao = new ProductoDAO();\n Marca marca = new Marca();\n CategoriaProducto catPro = new CategoriaProducto();\n\n for (Producto producto : proDao.findAll()) {\n DefaultTableModel modelo = (DefaultTableModel) tableProducto.getModel();\n modelo.addRow(new Object[10]);\n int nuevaFila = modelo.getRowCount() - 1;\n tableProducto.setValueAt(producto.getIdProducto(), nuevaFila, 0);\n tableProducto.setValueAt(producto.getNombreProducto(), nuevaFila, 1);\n tableProducto.setValueAt(producto.getCantidadProducto(), nuevaFila, 2);\n tableProducto.setValueAt(producto.getPrecioCompra(), nuevaFila, 3);\n tableProducto.setValueAt(producto.getPrecioVenta(), nuevaFila, 4);\n tableProducto.setValueAt(producto.getFechaCaducidadProducto(), nuevaFila, 5);\n tableProducto.setValueAt(producto.getFechaCaducidadProducto(), nuevaFila, 6);\n tableProducto.setValueAt(producto.getDescripcionProducto(), nuevaFila, 7);\n marca.setIdMarca(producto.getFK_idMarca());\n tableProducto.setValueAt(marcaDao.findBy(marca, \"idMarca\").get(0).getNombreMarca(), nuevaFila, 8);//PARA FK ID MARCA\n catPro.setIdCategoriaProducto(producto.getFK_idCategoriaProducto());\n tableProducto.setValueAt(catProDao.findBy(catPro, \"idCategoriaProducto\").get(0).getNombreCategoriaProducto(), nuevaFila, 9);\n //PARA FK ID CATEGORIA PRODUCTO\n\n }\n }", "public void vaciarTabla() {\n\n DefaultTableModel modelo = (DefaultTableModel) table1Calificaciones.getModel();\n int total = table1Calificaciones.getRowCount();\n for (int i = 0; i < total; i++) {\n modelo.removeRow(0);\n }\n\n }", "void initTable();", "public void atualizarTabela(String sql) {\n try {\n listaAluno = alunoDAO.consultarSQL(sql);\n if (listaAluno != null) {\n tableAluno.setModel(new AlunoTableModel(listaAluno));\n }\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, ex.getMessage());\n }\n }", "public void llenarTabla(int inicio, int limite) {\n DefaultTableModel dtm = (DefaultTableModel) jTableVerRondas.getModel();//se usa DefaultTableModel para manipular facilmente el Tablemodel\n dtm.setRowCount(0);//eliminando la s filas que ya hay. para agregar desde el principio.\n //los datos se agregan la defaultTableModel.\n ArrayList<Partido> llenar = miOpenAustralia.getPartidos();//sacando al informacion a agregar en la tabla.\n\n //como se va a llenar una tabla de 5 columnas, se crea un vector de 3 elementos.\n //se usa un arreglo de Object para poder agregar a la tabla cualquier tipo de datos.\n Object[] datos = new Object[5];\n for (int i = inicio; i < limite; i++) {\n\n Partido parti = llenar.get(i);\n //Se agrega este if para evitar que el extraiga datos en un campo null\n if (parti != null) {\n\n datos[0] = parti.getId();\n datos[1] = parti.getFechaHora();//el primer elemetno del arreglo va a ser el id,la primera col en la Tabla.\n datos[2] = parti.getJugador1().getNombre();\n datos[3] = parti.getJugador2().getNombre();\n datos[4] = parti.getPista().getNombre();\n\n //agrego al TableModleo ese arreglo\n dtm.addRow(datos);\n }\n }\n }", "public void updateUnit(String id, String unit, String tableName) {\n\t\tif(!unitFlag){\n\t\t\tString query = \"SELECT unit FROM \" + tableName;\n\t\t\ttry{\n\t\t\t\tthis.connect.getSession().execute(query);\n\t\t\t} catch(com.datastax.driver.core.exceptions.InvalidQueryException e){\n\t\t\t\tthis.connect.getSession().execute(\"ALTER TABLE \" + tableName + \" ADD unit text\");\n\t\t\t} finally {\n\t\t\t\tString update = \"UPDATE \" + tableName + \" SET unit = '\" + unit + \"' WHERE id = '\" + id + \"'\"; \n\t\t\t\tthis.connect.getSession().execute(update);\n\t\t\t}\n\t\t} else {\n\t\t\tString update = \"UPDATE \" + tableName + \" SET unit = '\" + unit + \"' WHERE id = '\" + id + \"'\"; \n\t\t\tthis.connect.getSession().execute(update);\n\t\t}\n\t}", "Table createTable();", "public void resetTable() {\n\t\tif (table != null) {\n\t\t\ttable.removeAll();\n\t\t}\n\t}", "public static void updateTable()\r\n\t{\r\n\t\tfor (int i = 0; i < DataHandler.getClassesSize(); i++)\r\n\t\t{\r\n\t\t\ttable.getModel().setValueAt(\r\n\t\t\t\t\tString.valueOf(LogicHandler.getRelativeOccurences(DataHandler.getList(), DataHandler.getSampleSize())[i]),\r\n\t\t\t\t\ti, 3);\r\n\t\t}\r\n\t}", "public String getNomTable();", "public void initTable();", "public void atualizarTabela() {\n\t\tJTAlocar.setModel(modelAlocar = new TableModelAlocar(ManipulacaoXml.getInstace().todasAlocacoes()));\n\t}", "public void readTable() {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setRowCount(0);\n\n }", "private void createTableBill(){\r\n //Se crean y definen las columnas de la Tabla\r\n TableColumn col_orden = new TableColumn(\"#\"); \r\n TableColumn col_city = new TableColumn(\"Ciudad\");\r\n TableColumn col_codigo = new TableColumn(\"Código\"); \r\n TableColumn col_cliente = new TableColumn(\"Cliente\"); \r\n TableColumn col_fac_nc = new TableColumn(\"FAC./NC.\"); \r\n TableColumn col_fecha = new TableColumn(\"Fecha\");\r\n TableColumn col_monto = new TableColumn(\"Monto\"); \r\n TableColumn col_anulada = new TableColumn(\"A\");\r\n \r\n //Se establece el ancho de cada columna\r\n this.objectWidth(col_orden , 25, 25); \r\n this.objectWidth(col_city , 90, 150); \r\n this.objectWidth(col_codigo , 86, 86); \r\n this.objectWidth(col_cliente , 165, 300); \r\n this.objectWidth(col_fac_nc , 70, 78); \r\n this.objectWidth(col_fecha , 68, 68); \r\n this.objectWidth(col_monto , 73, 73); \r\n this.objectWidth(col_anulada , 18, 18);\r\n\r\n col_fac_nc.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, String>() {\r\n @Override\r\n public void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_fecha.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, Date>() {\r\n @Override\r\n public void updateItem(Date item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if(!empty){\r\n setText(item.toLocalDate().toString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n else\r\n setText(null);\r\n }\r\n };\r\n }\r\n }); \r\n\r\n col_monto.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Double>() {\r\n @Override\r\n public void updateItem(Double item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER_RIGHT);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n String gi = getItem().toString();\r\n NumberFormat df = DecimalFormat.getInstance();\r\n df.setMinimumFractionDigits(2);\r\n df.setRoundingMode(RoundingMode.DOWN);\r\n\r\n ret = df.format(Double.parseDouble(gi));\r\n } else {\r\n ret = \"0,00\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_anulada.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Integer>() {\r\n @Override\r\n public void updateItem(Integer item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n\r\n setTextFill(isSelected() ? Color.WHITE :\r\n ret.equals(\"0\") ? Color.BLACK :\r\n ret.equals(\"1\") ? Color.RED : Color.GREEN);\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n //Se define la columna de la tabla con el nombre del atributo del objeto USUARIO correspondiente\r\n col_orden.setCellValueFactory( \r\n new PropertyValueFactory<>(\"orden\") );\r\n col_city.setCellValueFactory( \r\n new PropertyValueFactory<>(\"ciudad\") );\r\n col_codigo.setCellValueFactory( \r\n new PropertyValueFactory<>(\"codigo\") );\r\n col_cliente.setCellValueFactory( \r\n new PropertyValueFactory<>(\"cliente\") );\r\n col_fac_nc.setCellValueFactory( \r\n new PropertyValueFactory<>(\"numdocs\") );\r\n col_fecha.setCellValueFactory( \r\n new PropertyValueFactory<>(\"fecdoc\") );\r\n col_monto.setCellValueFactory( \r\n new PropertyValueFactory<>(\"monto\") );\r\n col_anulada.setCellValueFactory( \r\n new PropertyValueFactory<>(\"anulada\") );\r\n \r\n //Se Asigna ordenadamente las columnas de la tabla\r\n tb_factura.getColumns().addAll(\r\n col_orden, col_city, col_codigo, col_cliente, col_fac_nc, col_fecha, \r\n col_monto, col_anulada \r\n ); \r\n \r\n //Se Asigna menu contextual \r\n tb_factura.setRowFactory((TableView<Fxp_Archguid> tableView) -> {\r\n final TableRow<Fxp_Archguid> row = new TableRow<>();\r\n final ContextMenu contextMenu = new ContextMenu();\r\n final MenuItem removeMenuItem = new MenuItem(\"Anular Factura\");\r\n removeMenuItem.setOnAction((ActionEvent event) -> {\r\n switch (tipoOperacion){\r\n case 1:\r\n tb_factura.getItems().remove(tb_factura.getSelectionModel().getSelectedIndex());\r\n break;\r\n case 2:\r\n tb_factura.getItems().get(tb_factura.getSelectionModel().getSelectedIndex()).setAnulada(1);\r\n col_anulada.setVisible(false);\r\n col_anulada.setVisible(true);\r\n break;\r\n }\r\n });\r\n contextMenu.getItems().add(removeMenuItem);\r\n // Set context menu on row, but use a binding to make it only show for non-empty rows:\r\n row.contextMenuProperty().bind(\r\n Bindings.when(row.emptyProperty())\r\n .then((ContextMenu)null)\r\n .otherwise(contextMenu)\r\n );\r\n return row ; \r\n });\r\n \r\n //Se define el comportamiento de las teclas ARRIBA y ABAJO en la tabla\r\n EventHandler eh = new EventHandler<KeyEvent>(){\r\n @Override\r\n public void handle(KeyEvent ke){\r\n //Si fue presionado la tecla ARRIBA o ABAJO\r\n if (ke.getCode().equals(KeyCode.UP) || ke.getCode().equals(KeyCode.DOWN)){ \r\n //Selecciona la FILA enfocada\r\n selectedRowInvoice();\r\n }\r\n }\r\n };\r\n //Se Asigna el comportamiento para que se ejecute cuando se suelta una tecla\r\n tb_factura.setOnKeyReleased(eh); \r\n }", "private void makeTable() {\n String [] cols = new String[] {\"Planets\", \"Weights (in lbs)\", \"Weights (in kgs)\"};\n model = new DefaultTableModel(result,cols) {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n table = new JTable(model);\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setPreferredSize(new Dimension(310,155));\n middlePanel.add(scrollPane);\n revalidate();\n repaint();\n }", "public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }", "public void limpiarTabla(JTable tbl, DefaultTableModel plantilla) {\n for (int i = 0; i < tbl.getRowCount(); i++) {\n plantilla.removeRow(i);\n i -= 1;\n }\n }", "private void updateTabela() {\n\n if (txBuscar.getText().isEmpty()) {\n ListaEmprestimosBEANs = new ControlerEmprestimos().listaEmprestimoss();\n } else {\n try {\n Integer buscar = Integer.parseInt(txBuscar.getText());\n ListaEmprestimosBEANs = new ArrayList<>();\n ListaEmprestimosBEANs.add(new ControlerEmprestimos().findEmprestimos(buscar));\n } catch (Exception e) {\n\n }\n }\n DefaultTableModel model = new DefaultTableModel(null, new String[]{\"ID\", \"Data de Saida\", \"Data Estimada do Retorno\", \"Data do Retorno\"});\n try {\n jTable1.setModel(model);\n String[] dados = new String[9];\n for (EmprestimosBEAN a : ListaEmprestimosBEANs) {\n dados[0] = String.valueOf(a.getId_emprestimo());\n dados[1] = a.getDtSaida().toString();\n dados[2] = a.getDtVolta().toString();\n dados[3] = a.getDtRetorno() == null ? \"\" : a.getDtRetorno().toString();\n model.addRow(dados);\n }\n } catch (Exception ex) {\n\n }\n\n }", "public void writeTable(){\n\n PersistenceUtil pu= PersistenceUtil.getInstance();\n EntityManagerFactory emf =pu.getEmf();\n EntityManager em = emf.createEntityManager();\n\n\n\n final Integer[] i = {0};\n\n tabela.getColumns().forEach((Consumer<TableColumn<Map, String>>) col -> {\n col.setCellValueFactory(new MapValueFactory<>(\"column\" + (i[0]).toString()));\n\n\n if(alegereBD!=\"0\")\n switch(alegereTabela){\n case \"Artists\":\n\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"Country\");\n if(i[0]==3)\n col.setText(\"\");\n if(i[0]==4)\n col.setText(\"\");\n textField1.disableProperty().setValue(false);\n textField2.disableProperty().setValue(false);\n\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n\n\n\n break;\n case \"Albums\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"Genre\");\n if(i[0]==3)\n col.setText(\"Artist\");\n if(i[0]==4)\n col.setText(\"Realease\");\n\n textField3.disableProperty().setValue(false);\n textField4.disableProperty().setValue(false);\n textField5.disableProperty().setValue(false);\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n\n\n break;\n case \"Genres\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"\");\n if(i[0]==3)\n col.setText(\"\");\n if(i[0]==4)\n col.setText(\"\");\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n break;\n case \"Charts\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Album\");\n if(i[0]==2)\n col.setText(\"Artist\");\n if(i[0]==3)\n col.setText(\"Position\");\n if(i[0]==4)\n col.setText(\"\");\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n break;\n }\n\n\n System.out.println(i[0]);\n i[0]++;\n });\n\n\n\n tabela.setItems(generateDataInMap());\n }", "private void clearTable() {\n fieldTable.removeAllRows();\n populateTableHeader();\n }", "public void listarEquipamentos() {\n \n \n List<Equipamento> formandos =new EquipamentoJpaController().findEquipamentoEntities();\n \n DefaultTableModel tbm=(DefaultTableModel) listadeEquipamento.getModel();\n \n for (int i = tbm.getRowCount()-1; i >= 0; i--) {\n tbm.removeRow(i);\n }\n int i=0;\n for (Equipamento f : formandos) {\n tbm.addRow(new String[1]);\n \n listadeEquipamento.setValueAt(f.getIdequipamento(), i, 0);\n listadeEquipamento.setValueAt(f.getEquipamento(), i, 1);\n \n i++;\n }\n \n \n \n }", "private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}", "public void clearTable(){\n\t\tloaderImage.loadingStart();\n\t\tfullBackup.clear();\n\t\tlist.clear();\n\t\toracle.clear();\n\t\tselectionModel.clear();\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }", "public void refreshTable() {\n\t\tmyTable.refreshTable();\n\t}", "public static void toutAfficher(JTable table) {\n\t\ttry {\n\t\t\tConnection conn = bdconnect.getConnection();\n\t\t\tString sql = \"SELECT * FROM commande\";\n\t java.sql.Statement stmt = conn.createStatement();\n\t\t\tjava.sql.ResultSet RS = stmt.executeQuery(sql);\n\t\t\ttable.setModel(DbUtils.resultSetToTableModel(RS));\n\t\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t}", "public void llenadoDeTablas() {\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Articulo\");\n modelo.addColumn(\"Fecha Ingreso\");\n modelo.addColumn(\"Nombre Articulo\");\n modelo.addColumn(\"Talla XS\");\n modelo.addColumn(\"Talla S\");\n modelo.addColumn(\"Talla M\");\n modelo.addColumn(\"Talla L\");\n modelo.addColumn(\"Talla XL\");\n modelo.addColumn(\"Color Articulo\");\n modelo.addColumn(\"Nombre Proveedor\");\n modelo.addColumn(\"Existencias\");\n\n RegistroArticuloDAO registroarcticuloDAO = new RegistroArticuloDAO();\n\n List<RegistroArticulo> registroarticulos = registroarcticuloDAO.select();\n TablaArticulo.setModel(modelo);\n String[] dato = new String[11];\n for (int i = 0; i < registroarticulos.size(); i++) {\n dato[0] = Integer.toString(registroarticulos.get(i).getPK_id_articulo());\n dato[1] = registroarticulos.get(i).getFecha_ingreso();\n dato[2] = registroarticulos.get(i).getNombre_articulo();\n dato[3] = registroarticulos.get(i).getTalla_articuloXS();\n dato[4] = registroarticulos.get(i).getTalla_articuloS();\n dato[5] = registroarticulos.get(i).getTalla_articuloM();\n dato[6] = registroarticulos.get(i).getTalla_articuloL();\n dato[7] = registroarticulos.get(i).getTalla_articuloXL();\n dato[8] = registroarticulos.get(i).getColor_articulo();\n dato[9] = registroarticulos.get(i).getNombre_proveedor();\n dato[10] = registroarticulos.get(i).getExistencia_articulo();\n\n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }\n }", "public void tblLimpiar(JTable tabla, DefaultTableModel modelo1){\n for (int i = 0; i < tabla.getRowCount(); i++) {\n modelo1.removeRow(i);\n i-=1;\n }\n }", "private void tableLoad() {\n try{\n String sql=\"SELECT * FROM salary\";\n pst = conn.prepareStatement(sql);\n rs = pst.executeQuery();\n \n table1.setModel(DbUtils.resultSetToTableModel(rs));\n \n \n }\n catch(SQLException e){\n \n }\n }", "private void establecerTablaPlatillos() {\n Object[] columnas = {\"Platillo\", \"Cantidad\", \"Costo\"};\n Object[][] modelo = new Object[platillosAVender.size()][3];\n int x = 0;\n\n for (VentaPlatillo ventaPlatillo : platillosAVender) {\n\n modelo[x][0] = ventaPlatillo.getPlatillo().getNombre();\n modelo[x][1] = ventaPlatillo.getCantidad();\n modelo[x][2] = ventaPlatillo.getCosto();\n x++;\n }\n // Se establece el modelo en la tabla con los datos\n tablaPlatillosAVender.setDefaultEditor(Object.class, null);\n tablaPlatillosAVender.setModel(new DefaultTableModel(modelo, columnas));\n tablaPlatillosAVender.setCellSelectionEnabled(false);\n tablaPlatillosAVender.setRowSelectionAllowed(false);\n txtTotal.setText(total + \"\");\n }", "public void loadData() {\n String[] header = {\"Tên Cty\", \"Mã Cty\", \"Cty mẹ\", \"Giám đốc\", \"Logo\", \"Slogan\"};\n model = new DefaultTableModel(header, 0);\n List<Enterprise> list = new ArrayList<Enterprise>();\n list = enterpriseBN.getAllEnterprise();\n for (Enterprise bean : list) {\n Enterprise enterprise = enterpriseBN.getEnterpriseByID(bean.getEnterpriseParent()); // Lấy ra 1 Enterprise theo mã\n Person person1 = personBN.getPersonByID(bean.getDirector());\n Object[] rows = {bean.getEnterpriseName(), bean.getEnterpriseID(), enterprise, person1, bean.getPicture(), bean.getSlogan()};\n model.addRow(rows);\n }\n listEnterprisePanel.getTableListE().setModel(model);\n setupTable();\n }", "public void llenadoDeTablas() {\n /**\n *\n * creaccion de la tabla de de titulos \n */\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Bitacora\");\n modelo.addColumn(\"Usuario\");\n modelo.addColumn(\"Fecha\");\n modelo.addColumn(\"Hora\");\n modelo.addColumn(\"Ip\");\n modelo.addColumn(\"host\");\n \n modelo.addColumn(\"Accion\");\n modelo.addColumn(\"Codigo Aplicacion\");\n modelo.addColumn(\"Modulo\");\n /**\n *\n * instaciamiento de las las clases Bitacora y BiracoraDAO\n * intaciamiento de la clases con el llenado de tablas\n */\n BitacoraDao BicDAO = new BitacoraDao();\n List<Bitacora> usuario = BicDAO.select();\n JtProductos1.setModel(modelo);\n String[] dato = new String[9];\n for (int i = 0; i < usuario.size(); i++) {\n dato[0] = usuario.get(i).getId_Bitacora();\n dato[1] = usuario.get(i).getId_Usuario();\n dato[2] = usuario.get(i).getFecha();\n dato[3] = usuario.get(i).getHora();\n dato[4] = usuario.get(i).getHost();\n dato[5] = usuario.get(i).getIp();\n dato[6] = usuario.get(i).getAccion();\n dato[7] = usuario.get(i).getCodigoAplicacion();\n dato[8] = usuario.get(i).getModulo();\n \n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }}", "private void reloadShoppingCarTable() {\n\t\t\r\n\t}", "tbls createtbls();", "public static void buildTable() {\r\n\t\t//This method keeps the user from editing the table\r\n\t\ttableModel = new DefaultTableModel() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\t//All cells false\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttableModel.setNumRows(dblogic.getSize());\r\n\t\ttableModel.setColumnCount(COL_COUNT);\r\n\t\ttableModel.setColumnIdentifiers(columnNames);\r\n\t\ttable.setRowSelectionAllowed(true);\r\n\t\ttable.setColumnSelectionAllowed(false);\r\n\t\ttable.setDragEnabled(false);\r\n\t\ttable.getTableHeader().setReorderingAllowed(false);\r\n\t\ttable.setModel(tableModel);\r\n\r\n\t\t//Build rows\r\n\t\tfor (int i = 0; i < dblogic.getSize(); i++) {\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronSinceString(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}", "private void tampilkan() {\n int row = table.getRowCount();\n for(int a= 0; a<row;a++){\n model.removeRow(0);\n }\n \n \n }", "public void LlenarPagos(){\n datos=new DefaultTableModel();\n LlenarModelo();\n this.TablaPagos.setModel(datos);\n }", "public void limpiarcarrito() {\r\n setTotal(0);//C.P.M limpiamos el total\r\n vista.jTtotal.setText(\"0.00\");//C.P.M limpiamos la caja de texto con el formato adecuado\r\n int x = vista.Tlista.getRowCount() - 1;//C.P.M inicializamos una variable con el numero de columnas\r\n {\r\n try {\r\n DefaultTableModel temp = (DefaultTableModel) vista.Tlista.getModel();//C.P.M obtenemos el modelo actual de la tabla\r\n while (x >= 0) {//C.P.M la recorremos\r\n temp.removeRow(x);//C.P.M vamos removiendo las filas de la tabla\r\n x--;//C.P.M y segimos disminuyendo para eliminar la siguiente \r\n }\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al limpiar la venta\");\r\n }\r\n }\r\n }" ]
[ "0.70610803", "0.6893498", "0.6506551", "0.63660896", "0.63643736", "0.63273096", "0.62824124", "0.6244671", "0.6234154", "0.620473", "0.6189486", "0.6160619", "0.6140341", "0.6101922", "0.60981697", "0.60963124", "0.60842395", "0.6059312", "0.6052557", "0.6002683", "0.60014904", "0.59893525", "0.5950182", "0.5941395", "0.5925323", "0.5923349", "0.5919297", "0.5900084", "0.58996606", "0.58986354", "0.5897765", "0.5885234", "0.58848596", "0.5878673", "0.58690614", "0.5855826", "0.58534896", "0.5843011", "0.5831489", "0.5830729", "0.5822883", "0.5812894", "0.5781597", "0.57734835", "0.5773438", "0.57590723", "0.57349014", "0.5729004", "0.5724593", "0.57185155", "0.5717843", "0.571566", "0.57122827", "0.57065934", "0.57007784", "0.56994843", "0.5696779", "0.5694891", "0.56823224", "0.56804675", "0.5671097", "0.56650376", "0.5663662", "0.56609994", "0.56565243", "0.56543106", "0.5653688", "0.56536734", "0.5653394", "0.5645696", "0.5643288", "0.56390005", "0.5635789", "0.56313443", "0.5627852", "0.56242144", "0.56236064", "0.56228757", "0.5622766", "0.56226057", "0.56182796", "0.561406", "0.56035787", "0.56013435", "0.5599336", "0.55875546", "0.5583915", "0.5582798", "0.5580149", "0.5578802", "0.5577766", "0.55771875", "0.55754834", "0.557236", "0.55715936", "0.55605847", "0.55574316", "0.5557146", "0.555655", "0.55544716" ]
0.6056015
18
retourne l'element a la position donnee
Element getElement(Position pos);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void findElement() {\n\t\t\r\n\t}", "private void actualizarEnConsola() {\n\t\tfor(int i=0; i<elementos.size();i++){\n\t\t\tElemento e = elementos.get(i);\n\t\t\tSystem.out.println(e.getClass().getName()+\"- Posicion: , X: \"+e.getPosicion().getX()+\", Y: \"+ e.getPosicion().getY());\n\t\t}\n\t\t\n\t}", "public void access(E e) {\n Position<Item<E>> p = findPosition(e); // try to locate existing element\n if (p == null) // new element\n p = list.addLast(new Item<E>(e)); // if new , place at end\n p.getElement().increment(); // always increment count\n moveUp(p);\n }", "public void firstElement() {\r\n \t\tcurrentObject = 0;\r\n \t}", "@Override\r\n\tpublic void updateElement() {\n\r\n\t}", "public void getLastMove(Element lastmove){\n\n}", "public abstract void removeElement(int id) throws PositionEX;", "@Override\n\tpublic int getPosition() {\n\t\treturn 0;\n\t}", "private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }", "int getPosition(Object elementID) throws Exception;", "@Override\n public int getPosition() {\n return position;\n }", "public void moveFirst() {\n\t\tcurrentElement = 0;\n\t}", "protected Object remObject(int position){\n \n }", "public void set (Object element)\n {\n if(!isAfterNext){\n throw new IllegalStateException(); \n }\n position.data = element;\n \n \n }", "public ElementIterator (PositionList<E> l) {\n\t\tlist = l;\t//Guardo la referencia a la lista a iterar\n\t\tif(list.isEmpty()) cursor = null; //Si la lista esta vacia la posicion corriente es nula\n\t\telse\n\t\t\ttry {\n\t\t\t\tcursor = list.first();//sino la posicion corriente es la primerea de la lista\n\t\t\t} catch (EmptyListException e) {e.printStackTrace();}\n\t}", "Object getPosition();", "public abstract Element getElement(int id) throws PositionEX;", "public void offerFront(E elem);", "public int getPosition();", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "public void add (Object element)\n {\n if (position == null)\n {\n addFirst(element);//LL is empty\n position = first;\n }\n else{\n Node newNode = new Node();\n newNode.data = element; // Alias \n newNode.next = position.next; //I know who is next \n position.next =newNode; //Iterator thinks next is me\n position= newNode;// current posiion is me, little conflict if you call remove\n \n \n }\n isAfterNext = false;\n \n }", "void element() {}", "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 revolver() {\n this.lista = Lista.escojerAleatorio(this, this.size()).lista;\n }", "public void update(E element) {\n // TODO: YOUR CODE HERE\n if (!contains(element)) {\n throw new NoSuchElementException();\n }\n int indexOfElement = backwards.get(element);\n if(getElement(indexOfElement).equals(element)){\n setElement(indexOfElement, element);\n if (getElement(getParentOf(indexOfElement)) != null &&\n getElement(indexOfElement).compareTo(getElement(getParentOf(indexOfElement))) < 0) { //if current element is greater than its parent\n bubbleUp(indexOfElement);\n }\n if (getElement(getLeftOf(indexOfElement)) != null &&\n getElement(indexOfElement).compareTo(getElement(getLeftOf(indexOfElement))) > 0) {\n bubbleDown(indexOfElement);\n }\n if (getElement(getRightOf(indexOfElement)) != null &&\n getElement(indexOfElement).compareTo(getElement(getRightOf(indexOfElement))) > 0) {\n bubbleDown(indexOfElement);\n }\n }\n }", "Position getNewPosition();", "public void setElement(E e){\r\n\t\trotulo = e;\r\n\t}", "public void moverElementoAnterior() {\n\t\tif(indiceElementoMenuActual>0) {\n\t\t\tindiceElementoMenuActual--;\n\t\t}\n\t\tsetElementoMenuActual();\n\t}", "public int getPosition(){\n return -1;\n }", "public int eleminardelInicio(){\n int elemento=inicio.dato;\n if(inicio==fin){\n inicio=fin=null;\n }else{\n inicio=inicio.siguiente;\n inicio.anterior=null; \n }\n return elemento;\n }", "int getPosition();", "void moveElement(int elementId, double xCoordinate, double yCoordinate);", "public int replaceSelectedElement(T element) {\r\n\t\tint index=getSelectionIndex();\r\n\t\treturn replaceElement(element, index<0 ? 0 : index);\r\n\t}", "@Override\r\n public T pop (){\r\n T elemento= (T) miLista.get(posicion-1);\r\n miLista.remove(posicion-1);\r\n posicion--;\r\n return elemento;\r\n }", "public Article moveArticleAt(Article a, int newPos) {\n for (Article article : list) {\n if (article.equals(a)) {\n list.remove(article);\n list.add(newPos, article);\n return article;\n }\n }\n return null;\n }", "public void onClickNom(Personne item, int position);", "private void deleteElement(int index) {\n Object[] first = new Object[index];\n System.arraycopy(this.container, 0, first, 0, index);\n\n Object[] second = new Object[this.container.length - index - 1];\n System.arraycopy(this.container, index + 1, second, 0, second.length);\n\n this.container = new Object[this.container.length];\n System.arraycopy(first, 0, this.container, 0, first.length);\n System.arraycopy(second, 0, this.container, index, second.length);\n\n this.position--;\n }", "public void setPosition(){\r\n currentPosition = 0; \r\n }", "int find(int element){\n if(parent[element]!=element)\n parent[element]=find(parent[element]);\n return parent[element];\n }", "public Object getObject(int pos) {\n return elements.get(pos);\n }", "public void newElement() {\r\n }", "public void impactoContra(Elemento elemento){}", "private Element getElement(int index) {\n if (index < this._size / 2) {\n return this.getElementForwards(index);\n } else {\n return this.getElementBackwards(index);\n }\n }", "private void sterben()\n {\n lebendig = false;\n if(position != null) {\n feld.raeumen(position);\n position = null;\n feld = null;\n }\n }", "public ListaPalabras() {\n\n //pos=0;\n }", "Position_changerOrdonnee createPosition_changerOrdonnee();", "@Override\n public Object getSubElement(int index)\n {\n return null;\n }", "public void offerBack(E elem);", "public void visite(Element element) {\n\t\t\n\t}", "private void editElement(int position) {\n Intent intent = new Intent(this, NewNoteActivity.class);\n Task t = this.printedTasks.get(position);\n intent.putExtra(\"id\", t.getUid());\n intent.putExtra(\"intitule\", t.getIntitule());\n intent.putExtra(\"description\", t.getDescription());\n intent.putExtra(\"duree\", t.getDuree());\n intent.putExtra(\"date\", t.getDate());\n intent.putExtra(\"color\", t.getColor());\n intent.putExtra(\"url\", t.getUrl());\n intent.putExtra(\"position\", position);\n\n // Send boolean -> edit mode\n intent.putExtra(\"edit\", true);\n startActivityForResult(intent, SECOND_ACTIVITY_REQUEST);\n\n reloadWidget();\n }", "public void setPosicion(){\n ejeX = 0;\n ejeY = 0;\n }", "public abstract E remove(Position<E> p);", "public void agregar_Alinicio(int elemento){\n inicio=new Nodo(elemento, inicio);// creando un nodo para que se inserte otro elemnto en la lista\r\n if (fin==null){ // si fin esta vacia entonces vuelve al inicio \r\n fin=inicio; // esto me sirve al agregar otro elemento al final del nodo se recorre al inicio y asi sucesivamnete\r\n \r\n }\r\n \r\n }", "Elem getPointedElem();", "public int getX(){\n return this.position[0];\n }", "Position getPosition();", "Position getPosition();", "private void insert(int pos, T elem) {\n for (int i = size; i >= pos + 1; i--) {\n arr[i] = arr[i-1];\n }\n arr[pos] = elem;\n }", "public abstract Stone clonar(int vidaInicial, int vida, Elemento[] elementos);", "public Integer getPosition();", "private Vector2d generateNewPositionForChild()\n {\n\n Random generator = new Random();\n List<Vector2d> freePositions = new LinkedList<>(); //tutaj przechowywane sa wolne pozycje wokol\n Vector2d position;\n Directions directionToAdd;\n\n for(int i = 0; i<8; i++)\n {\n directionToAdd = new Directions(i); //wykorzystujemy klase directions do generowania pozycji wokol\n position = this.position.add(directionToAdd.move());\n if(map.animalsAt(position).isEmpty())\n {\n freePositions.add(position);\n }\n }\n\n if(freePositions.isEmpty()) //jezeli nie ma wolnych pozycji\n {\n //jesli nie ma wolnych pozycji\n int x = generator.nextInt(8);\n directionToAdd = new Directions(x);\n return this.position.add(directionToAdd.move());\n }\n\n //jezeli mamy wolne pozycje to generujemy dowolna z listy\n int x = generator.nextInt(freePositions.size());\n Vector2d newPosition = freePositions.get(x);\n\n return newPosition;\n }", "<E> void poke(ArrayList<E> list, int pos, E val) {\n for (int i = list.size(); i <= pos; ++i) {\n list.add(i, null);\n }\n list.set(pos, val);\n }", "public String changeElementAtPos(int pos, String element) {\r\n String temp = wordBoard[this.rowPos(pos)][this.colPos(pos)];\r\n wordBoard[this.rowPos(pos)][this.colPos(pos)] = element;\r\n return temp;\r\n }", "public interface Position<E> {\n\n /**\n * Returns the element stored at this position\n *\n * @return the stored element\n * @throws IllegalStateException if position no longer valid\n */\n E getElement() throws IllegalStateException;\n}", "public int eliminardelInicio(){\n int elemento = inicio.dato;\n if(inicio == fin){\n inicio=fin=null;\n }else{\n inicio = inicio.sig;\n inicio.ant = null;\n }\n return elemento;\n \n \n }", "public void moverElementoSiguiente() {\n\t\tif(elementosMenu!=null && indiceElementoMenuActual< elementosMenu.size()-1) {\n\t\t\tindiceElementoMenuActual++;\n\t\t}\n\t\tsetElementoMenuActual();\n\t}", "public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}", "private int setFirstFree(final T element) {\r\n\t\tfinal int idx = firstFree;\r\n\t\tserializer.setRandomAccess(idx, element);\r\n\t\tfirstFree = getNextPointer(idx);\r\n\t\t// the pointer will be 0 if it was not unlinked before\r\n\t\tif (firstFree == 0) {\r\n\t\t\tfirstFree = idx + 1;\r\n\t\t}\r\n\t\treturn idx;\r\n\t}", "public void deleteCurrentJoueur(){\n\t\tElement elementPreviousToCurrent = this.getCurrentElement().getPrevious();\n\t\tElement elementNextToCurrent = this.getCurrentElement().getNext();\n\t\t\n\t\telementPreviousToCurrent.setNext(elementNextToCurrent);\n\t\telementNextToCurrent.setPrevious(elementPreviousToCurrent);\n\t\t\n\t\t// l'element suivant devient l'element courant (on passe au suivant)\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}", "public void remove() {\n\n\t\t\tsuprimirNodo(anterior);\n\n\t\t}", "public abstract void setDataToElementXY();", "@Override\n\tpublic void aumenta(int i) {\n\t\t\n\t}", "@Override\t\n\tpublic void innKoe(T element){\n\t\t\tLinearNode<T> nyNode= new LinearNode<T>(element);\n\t\t\t\n\t\t\tif(erTom()){\n\t\t\t\tfront = nyNode;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tbak.setNeste(nyNode);\n\t\t\t}\n\t\t\tbak = nyNode;\n\t\t\tantall++;\n\t\t\t}", "public int getPositionRow(){return this.positionRow;}", "private E getElement(int index) {\n if (index >= contents.size()) {\n return null;\n } else {\n return contents.get(index);\n }\n }", "public int getPos();", "public int getPos();", "public void removerInicio() {\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 this.primeiro = this.primeiro.irParaProximo();\n this.total--;\n break;\n }\n }", "public void pop() {\n if (cabeza!= null) {\n //SI CABEZA.SIGUENTE ES DISTINTO A NULO\n if (cabeza.siguiente==null) {\n //CABEZA SERA NULO\n cabeza=null; \n //SE IRAN RESTANDO LOS NODOS\n longitud--;\n } else {\n //DE LO CONTRARIO EL PUNTERO SERA IGUAL A CABEZA\n Nodo puntero=cabeza;\n //MIENTRTAS EL PUNTERO SEA DISITINTO A NULO \n while (puntero.siguiente.siguiente!=null) { \n //PUNTYERO SERA IGUAL A LA DIRECCION DEL SIGUIENTE NODO\n puntero=puntero.siguiente;\n }\n puntero.siguiente=null;\n longitud--;\n }\n }\n }", "Vaisseau_positionner createVaisseau_positionner();", "private void adjustPosition(Element elem, BoxCoordinates pos)\n {\n try {\n if (elem.getAttribute(\"llx\") == null || elem.getAttribute(\"llx\").getDoubleValue() > pos.getLlx()) {\n elem.setAttribute(\"llx\", String.valueOf(pos.getLlx()));\n }\n if (elem.getAttribute(\"lly\") == null || elem.getAttribute(\"lly\").getDoubleValue() < pos.getLly()) {\n elem.setAttribute(\"lly\", String.valueOf(pos.getLly()));\n }\n if (elem.getAttribute(\"urx\") == null || elem.getAttribute(\"urx\").getDoubleValue() < pos.getUrx()) {\n elem.setAttribute(\"urx\", String.valueOf(pos.getUrx()));\n }\n if (elem.getAttribute(\"ury\") == null || elem.getAttribute(\"ury\").getDoubleValue() > pos.getUry()) {\n elem.setAttribute(\"ury\", String.valueOf(pos.getUry()));\n }\n }\n catch(org.jdom.DataConversionException ex)\n {\n log.error( ex.getClass().getName() + \": \" + ex.getMessage() );\n }\n }", "public void remove() {\n if (kaltPaaNeste) {\n listehode.neste = listehode.neste.neste;\n antall--;\n } else {\n throw new IllegalStateException();\n }\n }", "public int eliminardelfinal(){\n int elemento=fin.dato;\n if(inicio==fin){\n inicio=fin=null;\n }else{\n fin=fin.anterior;\n fin.siguiente=null;}\n return elemento;\n }", "@Override\n\t\t\tpublic void remove() {\n\t\t\t\tthrow new UnsupportedOperationException();\n//\t\t\t\tif (i == begin || removed)\n//\t\t\t\t\tthrow new IllegalStateException();\n//\t\t\t\telements.set(i-1, null);\n//\t\t\t\tremoved = true;\n\t\t\t}", "public int hapus() {\r\n return elemen[--ukuran];\r\n }", "public android.renderscript.Element getSubElement(int index) { throw new RuntimeException(\"Stub!\"); }", "@Override\n\tpublic Position insertAfter(Position p, Object element) throws InvalidPositionException {\n\t\treturn null;\n\t}", "public void enfileira(T elemento){\n\t\t\n\t\tthis.adiciona(elemento);\n\t}", "void miauler() {\r\n\t\tSystem.out.println(this.miaulement);\r\n\t}", "public void insererEnTeteDeListe(Personne personne) {\n\t\tElement ancienPremier= premier;\n\t\tpremier= new Element(personne,ancienPremier);\n\t\t nbElt ++;\n\t}", "public int elementAt(int position) {\n\tif (position >= 0 && position < length() ) {\n\t if (position == 0) return datum;\n\t else return next.elementAt(position - 1);\n\t}\n\telse throw new RuntimeException(\"precondition violated\");\n }", "private void mouseDraggedElement(MouseEvent evt) {\n\t\tif (draggable) {\n\t\t\t// if the element is rope holder or umlenkrolle wich is not standing\n\t\t\t// alone. then it could not be dragged -> return without doing anything\n\t\t\tif (this instanceof Seilaufhaenger) {\n\t\t\t\treturn;\n\t\t\t} else if (this instanceof Umlenkrolle) {\n\t\t\t\tUmlenkrolle umlenkrolle = (Umlenkrolle) this;\n\t\t\t\tif (umlenkrolle.isFree())\n\t\t\t\t\treturn;\n\t\t\t} else if (this instanceof DoppelUmlenkrolle) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!dragging) {\n\t\t\t\taufzugschacht.eraseCircRect();\n\t\t\t\tdragging = true;\n\t\t\t}\n\t\t\tint mx = evt.getX();\n\t\t\tint my = evt.getY();\n\t\t\tif (firstMove) {\n\t\t\t\t// at first move the old-mx and -my are set to the actual mx and my\n\t\t\t\tomx = mx;\n\t\t\t\tomy = my;\n\t\t\t\tfirstMove = false;\n\t\t\t}\n\t\t\t// the difference between old and new mouse coordinates\n\t\t\tint dx = mx - omx;\n\t\t\tint dy = my - omy;\n\n\t\t\t// the old coordintes of the element\n\t\t\tint ox = getX();\n\t\t\tint oy = getY();\n\n\t\t\t// getting the new coordinates of the element\n\t\t\tPoint xy;\n\t\t\tif (this instanceof Seilaufhaenger)\n\t\t\t\txy = getDraggingXYAufhaenger(ox, oy, dx, dy);\n\t\t\telse\n\t\t\t\txy = getDraggingXY(ox, oy, dx, dy);\n\t\t\tint x = (int) xy.getX();\n\t\t\tint y = (int) xy.getY();\n\n\t\t\t// move only if new coordinates are not on existing element\n\t\t\tint cy = y;\n\t\t\tint ch = getHeight();\n\t\t\t// if the element has a umlenkrolle or rope holder, than make the\n\t\t\t// searching area bigger\n\t\t\tif (this instanceof EndElement) {\n\t\t\t\tEndElement endElement = (EndElement) this;\n\t\t\t\tif (endElement.getUmlenkrolle() != null) {\n\t\t\t\t\tcy = cy - endElement.getUmlenkrolle().getHeight();\n\t\t\t\t\tch = ch + endElement.getUmlenkrolle().getHeight();\n\t\t\t\t}\n\t\t\t\tif (endElement.getDoppelUmlenkrolle() != null) {\n\t\t\t\t\tcy = cy - endElement.getDoppelUmlenkrolle().getHeight();\n\t\t\t\t\tch = ch + endElement.getDoppelUmlenkrolle().getHeight();\n\t\t\t\t}\n\t\t\t\tif (endElement.getSeilaufhaenger() != null) {\n\t\t\t\t\tcy = cy - endElement.getSeilaufhaenger().getHeight();\n\t\t\t\t\tch = ch + endElement.getSeilaufhaenger().getHeight();\n\t\t\t\t}\n\t\t\t}\n\t\t\tVector<Element> elementVector = aufzugschacht.getElementAt(x, cy, getWidth(), ch);\n\t\t\tboolean onlyElement = true;\n\t\t\tfor (int i = 0; i < elementVector.size(); i++) {\n\t\t\t\tif (!elementVector.elementAt(i).equals(this))\n\t\t\t\t\tif (this instanceof EndElement) {\n\t\t\t\t\t\t// the own clipped elements does not interfere the own move\n\t\t\t\t\t\tEndElement endElement = (EndElement) this;\n\t\t\t\t\t\tif (!elementVector.elementAt(i).equals(endElement.getSeilaufhaenger())\n\t\t\t\t\t\t\t\t&& !elementVector.elementAt(i).equals(endElement.getUmlenkrolle())\n\t\t\t\t\t\t\t\t&& !elementVector.get(i).equals(endElement.getDoppelUmlenkrolle()))\n\t\t\t\t\t\t\tonlyElement = false;\n\t\t\t\t\t} else\n\t\t\t\t\t\tonlyElement = false;\n\t\t\t}\n\t\t\tif (onlyElement) {\n\t\t\t\t// if the new location is not reserved by another element, the\n\t\t\t\t// element\n\t\t\t\t// is moved there and the rope is repainted\n\t\t\t\tsetLocation(x, y);\n\t\t\t\txRel = (int) ((double) x / xscale);\n\t\t\t\tyRel = (int) ((double) y / yscale);\n\t\t\t\tomx = mx - dx;\n\t\t\t\tomy = my - dy;\n\t\t\t\tif (aufzugschacht.getSeil() != null) {\n\t\t\t\t\taufzugschacht.getSeil().refreshSeil();\n\t\t\t\t\taufzugschacht.getSeil().repaint();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tdragging = true;\n\t\t}\n\t}", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public void tapis (int position, int valeur) {\r\n\t\t((JJoueur)joueurs.get(position)).miser(valeur);\r\n\t\tthis.ajouterPot(valeur);\r\n\t\t//TODO Faire tapis pour un joueur\r\n\t\t//TODO Créer un nouveau pot de table\r\n\t}", "Object element();", "Object element();", "public void agregarAlFinal(int el){\n if(!estVacia()){\n fin=new NodoDoble(el,null,fin);\n fin.anterior.siguiente=fin;\n }else{\n inicio=fin=new NodoDoble(el);\n }\n }", "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 }", "public void inserirFinal(int elemento) {\n No novo = new No(elemento, null);\n No temp = ini;\n\n if (eVazia()) {\n ini = novo;\n } else {\n //Percorrer até chegar no ultimo Nó\n while (temp.getProximo() != null) {\n temp = temp.getProximo();\n }\n temp.setProximo(novo);\n }\n\n }", "@Override\n\tpublic void getChild(int index) {\n\t\t\n\t}" ]
[ "0.6315445", "0.623787", "0.6051065", "0.59647214", "0.59534115", "0.5945614", "0.5930392", "0.5886008", "0.58752936", "0.5829929", "0.57988185", "0.57895", "0.57883793", "0.5777059", "0.5752169", "0.57491237", "0.5745502", "0.5743012", "0.57360464", "0.5689369", "0.5682025", "0.5676827", "0.5674384", "0.5642543", "0.56318074", "0.56287163", "0.56250834", "0.5617116", "0.5609667", "0.56095344", "0.5606296", "0.560503", "0.55963475", "0.55750126", "0.55699116", "0.55664647", "0.55471474", "0.55407", "0.5540624", "0.5530895", "0.5524386", "0.55232894", "0.5513082", "0.5512249", "0.55121297", "0.5505784", "0.5504204", "0.5498139", "0.54966515", "0.54952925", "0.54952043", "0.5485656", "0.54853326", "0.548519", "0.5481782", "0.54757977", "0.54757977", "0.5474219", "0.54735744", "0.54700667", "0.5466083", "0.54388726", "0.5434892", "0.5433037", "0.54292095", "0.54239786", "0.5419458", "0.5417681", "0.5417062", "0.5416408", "0.54156476", "0.5412393", "0.5411361", "0.5400495", "0.5393078", "0.5380708", "0.5380708", "0.5378558", "0.53769886", "0.53766185", "0.5376176", "0.53758067", "0.53749007", "0.53725606", "0.5371498", "0.53683", "0.53647137", "0.53578454", "0.5354651", "0.53541857", "0.53499275", "0.5348454", "0.5346943", "0.5338935", "0.53378177", "0.53378177", "0.5333234", "0.53327465", "0.53285724", "0.5328329" ]
0.6399005
0
trouve une position vide a partir de la position pos a une distance distance
Position trouverPositionVide(Position pos, int distance);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "double distance (double px, double py);", "static double distanceToOrigin ( Posn p ) {\n\t// return ... p.x ... p.y ... ;\n\treturn Math.sqrt(Math.pow(p.x,2) + Math.pow(p.y,2)) ;\n }", "double distanceSq (double px, double py);", "private double distance(Position pos1, Position pos2)\r\n {\r\n assert pos1 != null;\r\n assert pos2 != null;\r\n\r\n int x = Math.abs(pos1.column() - pos2.column());\r\n int y = Math.abs(pos1.line() - pos2.line());\r\n\r\n return Math.sqrt(x * x + y * y);\r\n }", "public void dirigirHaciaPunto(int x, int y){ \r\n\r\n\tint coordenadaXObjetivo;\r\n\tint coordenadaYObjetivo;\r\n\tint distanciaEnX;\r\n\tint distanciaEnY;\r\n\tint incrementoDesplazamiento = 1;\t\t\r\n\t\t\t\t\t\t\r\n\tcoordenadaXObjetivo = x;\t\r\n\tdistanciaEnX = coordenadaXObjetivo - this.x;\r\n\t\t\t\t\t\r\n\tcoordenadaYObjetivo = y;\t\r\n\tdistanciaEnY = coordenadaYObjetivo - this.y;\r\n\t\r\n\tif(distanciaEnX <= 0){\r\n\t\tif (distanciaEnX == 0){\r\n\t\t\tif(distanciaEnY < 0){\r\n\t\t\t\tthis.y -= incrementoDesplazamiento; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tif(distanciaEnY <= 0){\r\n\t\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\telse{\r\n\t\tif(distanciaEnY <= 0){\r\n\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse{\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((this.x >= x - incrementoDesplazamiento) && (this.x <= x + incrementoDesplazamiento) && \r\n\t\t\t(this.y >= y - incrementoDesplazamiento) && (this.y <= y + incrementoDesplazamiento)){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.entroAlCirculo = true;\r\n\t\t\r\n\t\t}\t\t\t\t\t\t\t\t\t\r\n\t}", "private void dist2Pos3Beacons()\n {\n //Betrachtung bei 3 Empfaengern\n double dist12 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[1][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[1][1], 2));\n double dist13 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[2][1], 2));\n double dist23 = Math.sqrt(Math.pow(posReceiver[1][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[1][1] - posReceiver[2][1], 2));\n\n boolean temp12 = Math.abs(radius[0] - radius[1]) > dist12;\n boolean temp23 = Math.abs(radius[1] - radius[2]) > dist23;\n boolean temp13 = Math.abs(radius[0] - radius[2]) > dist13;\n\n //Zwei Kreise innerhalb eines anderen Kreises\n if ((temp12 && temp23) || (temp12 && temp13) || (temp23 && temp13))\n {\n double f0 = (dist12 / radius[0] + dist13 / radius[0]) / 2;\n double f1 = (dist12 / radius[1] + dist23 / radius[1]) / 2;\n double f2 = (dist12 / radius[2] + dist13 / radius[2]) / 2;\n\n radius[0] = radius[0] * f0;\n radius[1] = radius[1] * f1;\n radius[2] = radius[2] * f2;\n }\n //Kreis 2 in Kreis 1\n if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[0] > radius[1]))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[0],radius[1],radius[2]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kreis 1 in Kreis 2\n else if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[1] > radius[0]))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[1],radius[0],radius[2]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 1\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[0] > radius[2]))//Kreis 3 in 1\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[2],radius[0],radius[1]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 1 in Kreis 3\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[2] > radius[0]))//Kreis 1 in 3\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[0],radius[2],radius[1]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 2\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[1] > radius[2]))//Kreis 3 in 2\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[2],radius[1],radius[0]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 2 in Kreis 3\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[2] > radius[1]))//Kreis 2 ind 3\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[1],radius[2],radius[0]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kein Kreis liegt innerhalb eines Anderen\n else\n {\n\n if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double p1[] = new double[2];\t//x\n double p2[] = new double[2];\t//y\n\n double norm12 = norm(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1]);\n // Verbindungspunkte Kreis 1 und 2\n p1[0] = posReceiver[0][0] + (radius[0]/ norm12) * (posReceiver[1][0] - posReceiver[0][0]); //x-P1\n p1[1] = posReceiver[0][1] + (radius[0]/ norm12) * (posReceiver[1][1] - posReceiver[0][1]); //y-P1\n p2[0] = posReceiver[1][0] + (radius[1]/ norm12) * (posReceiver[0][0] - posReceiver[1][0]); //x-P2\n p2[1] = posReceiver[1][1] + (radius[1]/ norm12) * (posReceiver[0][1] - posReceiver[1][1]); //y-P2\n double m12[] = new double[2];\n m12[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m12[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm23 = norm(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1]);\n // Verbindungspunkte Kreis 2 und 3\n p1[0] = posReceiver[1][0] + (radius[1]/ norm23) * (posReceiver[2][0] - posReceiver[1][0]); //x-P1\n p1[1] = posReceiver[1][1] + (radius[1]/ norm23) * (posReceiver[2][1] - posReceiver[1][1]); //y-P1\n p2[0] = posReceiver[2][0] + (radius[2]/ norm23) * (posReceiver[1][0] - posReceiver[2][0]); //x-P2\n p2[1] = posReceiver[2][1] + (radius[2]/ norm23) * (posReceiver[1][1] - posReceiver[2][1]); //y-P2\n double m23[] = new double[2];\n m23[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m23[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm31 = norm(posReceiver[2][0], posReceiver[2][1], posReceiver[0][0], posReceiver[0][1]);\n // Verbindungspunkte Kreis 3 und 1\n p1[0] = posReceiver[2][0] + (radius[2]/ norm31) * (posReceiver[0][0] - posReceiver[2][0]); //x-P1\n p1[1] = posReceiver[2][1] + (radius[2]/ norm31) * (posReceiver[0][1] - posReceiver[2][1]); //y-P1\n p2[0] = posReceiver[0][0] + (radius[0]/ norm31) * (posReceiver[2][0] - posReceiver[0][0]); //x-P2\n p2[1] = posReceiver[0][1] + (radius[0]/ norm31) * (posReceiver[2][1] - posReceiver[0][1]); //y-P2\n double m31[] = new double[2];\n m31[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m31[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n // Norm der drei Punkte berechnen\n double a_p = Math.sqrt((m12[0] * m12[0]) + (m12[1] * m12[1]));\n double b_p = Math.sqrt((m23[0] * m23[0]) + (m23[1] * m23[1]));\n double c_p = Math.sqrt((m31[0] * m31[0]) + (m31[1] * m31[1]));\n\n double denominator = 2 * (((m12[0] * m23[1]) - (m12[1] * m23[0])) + (m23[0] * m31[1] - m23[1] * m31[0]) + (m31[0] * m12[1] - m31[1] * m12[0]));\n xPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*(-m12[1]) + (c_p * c_p - a_p * a_p)* (-m23[1]) + (a_p * a_p - b_p * b_p)*(-m31[1])));\n yPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*m12[0] + (c_p * c_p - a_p * a_p)* m23[0] + (a_p * a_p - b_p * b_p)*m31[0]));\n errRad_func = norm(xPos_func, yPos_func, m12[0], m12[1]);\n\n }\n // Kreis 1 und 3 schneiden sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc2Circle(posRec,rad);\n }\n //Kreis 2 und 3 schneide sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc2Circle(posRec,rad);\n }\n //Kreis 1 und 2 schneiden sich\n else if ((dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc2Circle(posRec,rad);\n }\n else if ((dist12 > (radius[0] + radius[1])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc1Circle(posRec,rad);\n }\n else if ((dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc1Circle(posRec,rad);\n }\n else if ((dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc1Circle(posRec,rad);\n }\n else\n {\n double x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n double pos12[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1], radius[0], radius[1]);\n double pos23[][] = circlepoints2(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1], radius[1], radius[2]);\n double pos13[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[2][0], posReceiver[2][1], radius[0], radius[2]);\n\n if(radius[0] >= norm(pos23[0][0],pos23[0][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[0][0];\n y1 = pos23[0][1];\n }\n else if(radius[0] >= norm(pos23[1][0], pos23[1][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[1][0];\n y1 = pos23[1][1];\n }\n\n if(radius[1] >= norm(pos13[0][0], pos13[0][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[0][0];\n y2 = pos13[0][1];\n }\n else if(radius[1] >= norm(pos13[1][0], pos13[1][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[1][0];\n y2 = pos13[1][1];\n }\n\n if(radius[2] >= norm(pos12[0][0], pos12[0][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[0][0];\n y3 = pos12[0][1];\n }\n else if(radius[2] >= norm(pos12[1][0], pos12[1][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[1][0];\n y3 = pos12[1][1];\n }\n\n double tempD = x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2;\n\n xPos_func = (0.5*(\n -y1*(y2*y2)\n +y1*(y3*y3)\n -y1*(x2*x2)\n +y1*(x3*x3)\n\n +y2*(y1*y1)\n -y2*(y3*y3)\n +y2*(x1*x1)\n -y2*(x3*x3)\n\n -y3*(y1*y1)\n +y3*(y2*y2)\n -y3*(x1*x1)\n +y3*(x2*x2)\n ))/ tempD;\n\n yPos_func = (0.5*(\n +x1*(x2*x2)\n -x1*(x3*x3)\n +x1*(y2*y2)\n -x1*(y3*y3)\n\n -x2*(x1*x1)\n +x2*(x3*x3)\n -x2*(y1*y1)\n +x2*(y3*y3)\n\n +x3*(x1*x1)\n -x3*(x2*x2)\n +x3*(y1*y1)\n -x3*(y2*y2)\n ))/ tempD;\n\n errRad_func = norm(x1, y1, xPos_func, yPos_func);\n }\n }\n }", "private void positionMinimap(){\n\t\tif(debutX<0)//si mon debutX est negatif(ca veut dire que je suis sorti de mon terrain (ter))\n\t\t\tdebutX=0;\n\t\tif(debutX>ter.length)//si debutX est plus grand que la taille de mon terrain(ter).\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY<0)\n\t\t\tdebutY=0;\n\t\tif(debutY>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\tif(debutX+100>ter.length)\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY+100>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\t//cette fonction est appelee uniquement si le terrain est strictement Superieur a 100\n\t\t// Donc je sais que ma fin se situe 100 cases apres.\n\t\tfinX=debutX+100;\n\t\tfinY=debutY+100;\n\t}", "public void move(int distance);", "public int dist(Position p) {\n\t\treturn Math.abs(this.x - p.x) + Math.abs(this.y - p.y);\n\t}", "public void minotaurMove(boolean[][] maze, Player p){\r\n int distRow = _curPos.getRow() - p.getPlayerPosition().getRow();\r\n int distCol = _curPos.getCol() - p.getPlayerPosition().getCol();\r\n if(_curPos.getRow()== 0 && _curPos.getCol()==14) {\r\n _curPos = new Position(0,14);\r\n }\r\n else {\r\n if(distRow > 0){\r\n if(!maze[_curPos.getRow() - 1][_curPos.getCol()]){\r\n _curPos.setRow(_curPos.getRow() - 1);\r\n }\r\n else{\r\n if(distCol > 0 && !maze[_curPos.getRow()][_curPos.getCol() - 1]){\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n else if(!maze[_curPos.getRow()][_curPos.getCol() + 1]){\r\n _curPos.setCol(_curPos.getCol() + 1);\r\n }\r\n else if(!maze[_curPos.getRow()][_curPos.getCol() - 1]){\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n else{\r\n _curPos.setRow(_curPos.getRow() + 1);\r\n }\r\n }\r\n }\r\n else if(distRow == 0){\r\n if(distCol > 0 && !maze[_curPos.getRow()][_curPos.getCol() - 1]){\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n else if(!maze[_curPos.getRow()][_curPos.getCol() + 1]){\r\n _curPos.setCol(_curPos.getCol() + 1);\r\n }\r\n else if(!maze[_curPos.getRow() + 1][_curPos.getCol()]){\r\n _curPos.setRow(_curPos.getRow() + 1);\r\n }\r\n else if(!maze[_curPos.getRow() - 1][_curPos.getCol()]){\r\n _curPos.setRow(_curPos.getRow() - 1);\r\n }\r\n else{\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n }\r\n else{\r\n if(!maze[_curPos.getRow() + 1][_curPos.getCol()]){\r\n _curPos.setRow(_curPos.getRow() + 1);\r\n }\r\n else{\r\n if(distCol > 0 && !maze[_curPos.getRow()][_curPos.getCol() - 1]){\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n else if(!maze[_curPos.getRow()][_curPos.getCol() + 1]){\r\n _curPos.setCol(_curPos.getCol() + 1);\r\n }\r\n else if(!maze[_curPos.getRow()][_curPos.getCol() - 1]){\r\n _curPos.setCol(_curPos.getCol() - 1);\r\n }\r\n else{\r\n _curPos.setRow(_curPos.getRow() - 1);\r\n }\r\n }\r\n }\r\n }\r\n }", "public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }", "private void set_distance() {\n int[] k = new int[getQueue().length];\n distance = 0.0;\n for (int i = 1; i < getQueue().length; i++) {\n distance += getPoints().get(way[i]).distance(getPoints().get(way[i - 1]));\n }\n distance += getPoints().get(getQueue()[getPoints().size() - 1]).distance(getPoints().get(0));\n enterd = true;\n }", "public double calcDistance(Planet p){\n double sq_dis = (xxPos - p.xxPos) * (xxPos - p.xxPos) + (yyPos - p.yyPos) * (yyPos - p.yyPos);\n double distance = Math.sqrt(sq_dis);\n return distance;\n }", "public float getDistance();", "private void dist2Pos2Beacons(){\n double dist = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[1][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[1][1], 2));\n //Wenn Distanz ist größer als summe der Radien, dann gibt es keine Überschneidungen\n if (dist > (radius[0] + radius[1])) {\n //Berechne mittlere Distanz zwischen den Empfängern, da sich Kreise nicht überschneiden\n xPos_func = (posReceiver[0][0] + posReceiver[1][0]) / 2;\n yPos_func = (posReceiver[0][1] + posReceiver[1][1]) / 2;\n }\n else {\n double[][] pos = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1], radius[0], radius[1]);\n //Schnittpunkte sind identisch, Beacon ist exakt zu lokalisieren\n if ((pos[0][0] == pos[1][0]) && (pos[0][1] == pos[1][1])) {\n xPos_func = pos[0][0];\n yPos_func = pos[0][1];\n }else {\n xPos_func = (pos[0][0] + pos[1][0]) / 2;\n yPos_func = (pos[0][1] + pos[1][1]) / 2;\n errRad_func = Math.abs(dist -(radius[0] + radius[1]));\n }\n }\n }", "public double calcDistance(Planet p){\n\t\treturn(Math.sqrt((this.xxPos-p.xxPos)*(this.xxPos-p.xxPos)\n\t\t\t+(this.yyPos-p.yyPos)*(this.yyPos-p.yyPos)));\n\t}", "public int distance(PuzzleState state) {\n int numOfTiles = 9;\n int rowLength = 3;\n int finalDistance = 0;\n for(int i = 1; i < numOfTiles; i++){\n if(goalState.posOf(i) != state.posOf(i)){\n int indexOfMissplacedTile = state.posOf(i);\n int indexOfGoalplacedTile = goalState.posOf(i);\n int indexDifference = Math.abs(indexOfGoalplacedTile - indexOfMissplacedTile);\n int finalDistanceOfThisTile = 0;\n if(indexDifference >= rowLength){\n finalDistanceOfThisTile += indexDifference / 3;// number of rows moved\n finalDistanceOfThisTile += indexDifference % 3;// number of columns moved\n }\n else if(indexDifference < rowLength && (indexDifference + 1)%rowLength == 0){//special case if the tile needs to travel ex(from index 3 to 4 or vice verca);\n finalDistanceOfThisTile += 3;\n }\n else{\n finalDistanceOfThisTile += indexDifference;\n }\n finalDistance += finalDistanceOfThisTile;\n }\n }\n return finalDistance;\n }", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "@Override\n public final void move() {\n int x = getPosisi().getX();\n int y = getPosisi().getY();\n int dx = 0, dy = 0;\n\n if (getWaktu() % getDeltaTime() == 0) {\n do {\n do {\n Random randomGenerator = new Random();\n dx = randomGenerator.nextInt(N_RAND) - 1;\n dy = randomGenerator.nextInt(N_RAND) - 1;\n } while (dx == 0 && dy == 0);\n } while (x + dx < 0 || x + dx > getWorldSize() - 1\n || y + dy < 0 || y + dy > getWorldSize() - 1);\n }\n setPX(x + dx);\n setPY(y + dy);\n }", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public abstract double distanceFrom(double x, double y);", "double getDistance();", "private double findDistance(int[] pos1, int[] pos2) {\n return sqrt((pos1[0]-pos2[0])*(pos1[0]-pos2[0])+\n (pos1[1]-pos2[1])*(pos1[1]-pos2[1]));\n }", "public double calcDistance(Planet p){\n\t\t\tdouble dx = this.xxPos - p.xxPos;\n\t\t\tdouble dy = this.yyPos - p.yyPos;\n\t\treturn Math.sqrt(dx*dx + dy*dy);\n\t}", "public PVector cohesion (ArrayList<Shark> sharks) {\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 (Shark other : sharks) {\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 }", "private float checkDistance(float d) {\r\n if (d < 0) {\r\n return 0f;\r\n }\r\n if (d > 1) {\r\n return 1f;\r\n }\r\n return d;\r\n }", "public void move(Vector start,Vector dist);", "double getDistance(Point p);", "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 }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public int stapelPosition(Farbe farbe);", "boolean hasDistance();", "public double distanceTo(Position pos) {\n return Math.sqrt(squareDistanceTo(pos));\n }", "public void setDistance(float dist);", "public double calcDistance(Planet p){\n\t\tdouble dx = p.xxPos - this.xxPos;\n\t\tdouble dy = p.yyPos - this.yyPos ;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\n\t}", "public int distance(Coord coord1, Coord coord2);", "double V2SquaredLength(Position a){\r\n\t\treturn((a.getX() * a.getX())+(a.getY() * a.getY()));\r\n\t}", "@Test\r\n\tpublic void testDistancia0() \r\n\t{\r\n\t\tAssert.assertEquals(1.41, new Ponto(3,3).dist(new Ponto(4,2)), EPSILON);\r\n\t\tAssert.assertEquals(26.20, new Ponto(-7,-4).dist(new Ponto(17,6.5)), EPSILON);\t\r\n\t\tAssert.assertEquals(0.00, new Ponto(0,0).dist(new Ponto(0,0)), EPSILON);\t\r\n\t}", "@Override\n\tpublic int getDistanceFrom(final SabrePlayer other) {\n\t\tGuard.ArgumentNotNull(other, \"other\");\n\t\t\n\t\tif (!isOnline() || !other.isOnline()) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tLocation myLocation = bukkitPlayer.getLocation();\n\t\tLocation otherLocation = other.getBukkitPlayer().getLocation();\n\t\tint dx = otherLocation.getBlockX() - myLocation.getBlockX();\n\t\tint dz = otherLocation.getBlockZ() - myLocation.getBlockZ();\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow(dx, 2) + Math.pow(dz, 2));\n\t}", "private boolean distanciaPuntos(int x, int y, int di){\r\n\t\tdouble distancia = Math.sqrt((x-this.x)*(x-this.x) + (y-this.y)*(y-this.y));\r\n\t\treturn distancia <= (di+this.diameter);\r\n\t}", "Execution getClosestDistance();", "private Point move(Point[] players, int[] chat_ids, Point self)\n\t{\n\t\t//Move to a new position within the room anywhere within 6 meters of your current position. Any conversation you were previously engaged in is terminated: you have to be stationary to chat.\n\t\t//Initiate a conversation with somebody who is standing at a distance between 0.5 meters and 2 meters of you. In this case you do not move. You can only initiate a conversation with somebody on the next turn if they and you are both not currently engaged in a conversation with somebody else. \t\n\t\tint i = 0, target = 0;\n\t\twhile (players[i].id != self_id) i++;\n\t\t//look through players who are within 6 meters => Point[] players\n\t\tPoint p = self;\n for (target = 0; target<players.length; ++target) {\n\t\t\t//if we do not contain any information on them, they are our target => W[]\n\t\t\tif (W[p.id] != -1 || p.id == self.id) continue;\n p = players[target];\n }\n if (p.equals(self)) {\n for (target = 0; target < players.length; ++target) {\n if (W[p.id] == 0 || p.id == self.id) continue;\n p = players[target];\n }\n }\n if (!p.equals(self)) {\n\t\t\t// compute squared distance\n\t\t\tdouble dx1 = self.x - p.x;\n\t\t\tdouble dy1 = self.y - p.y;\n\t\t\tdouble dd1 = dx1 * dx1 + dy1 * dy1;\n\t\t\t//check if they are engaged in conversations with someone\n\t\t\tint chatter = 0;\n\t\t\twhile (chatter<players.length && players[chatter].id != chat_ids[target]) chatter++;\n\n\t\t\t//check if they are engaged in conversations with someone and whether that person is in our vicinity\n\t\t\tif(chat_ids[target]!=p.id && chatter!=players.length)\n\t\t\t{\n\t\t\t\t//if they are, we want to stand in front of them, .5 meters in the direction of who they're conversing with => check if result is within 6meters\n\t\t\t\tPoint other = players[chatter];\n\t\t\t\tdouble dx2 = self.x - other.x;\n\t\t\t\tdouble dy2 = self.y - other.y;\n\t\t\t\tdouble dd2 = dx2 * dx2 + dy2 * dy2;\n\n\t\t\t\tdouble dx3 = dx2-dx1;\n\t\t\t\tdouble dy3 = dy2-dy1;\n\t\t\t\tdouble dd3 = Math.sqrt(dx3 * dx3 + dy3 * dy3);\n\n\t\t\t\tdouble dx4 = (dx2 - 0.5*(dx3/dd3)) * -1;\n\t\t\t\tdouble dy4 = (dy2 - 0.5*(dy3/dd3)) * -1;\n\t\t\t\tdouble dd4 = dx4 * dx4 + dy4 * dy4;\n\n\t\t\t\tif (dd4 <= 2.0)\n\t\t\t\t\treturn new Point(dx4, dy4, self.id);\n }\n\t\t\t//if not chatting to someone or don't know position of chatter, just get as close to them as possible\n\t\t\telse return new Point((dx1-0.5*(dx1/dd1)) * -1, (dy1-0.5*(dy1/dd1)) * -1, self.id);\t\t\t\t\n\t\t}\n\n\t\t\tdouble dir = random.nextDouble() * 2 * Math.PI;\n\t\t\tdouble dx = 6 * Math.cos(dir);\n\t\t\tdouble dy = 6 * Math.sin(dir);\n\t\t\treturn new Point(dx, dy, self_id);\n\t}", "public int distanceL1(Position p_o)\n {\n return Math.abs(this.x - p_o.x) + Math.abs(this.y - p_o.y);\n }", "private static Boolean deplacementL(int initialLigne, int initialColonne, int destinationLigne, int destinationColonne) {\n return ((Math.abs(initialLigne - destinationLigne) == 2 && Math.abs(initialColonne - destinationColonne) == 1) || (Math.abs(initialLigne - destinationLigne) == 1 && Math.abs(initialColonne - destinationColonne) == 2));\n }", "public double calcDistance(Planet p){\n\t\tdouble dx=-(xxPos-p.xxPos);\n\t\tdouble dy=-(yyPos-p.yyPos);\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "float distTo(Sprite s) {\n return dist(_x, _y, s._x, s._y);\n }", "@Test\n public void chunkPosShouldBeMinus1ByMinus1WhenPlayerPosIsMinus1byMinus1() {\n final int sideLengthOfBlock = 10;\n final int rowAmountInChunk = 11;\n\n MatcherAssert.assertThat(\n this.targetCompass(\n sideLengthOfBlock,\n rowAmountInChunk,\n new Point(-1, -1)\n ).chunkPos(),\n CoreMatchers.equalTo(new Point(-1, -1))\n );\n }", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "void loopy() {\n if (position.y < -50) {\n position.y = Constants.height + 50;\n } else\n if (position.y > Constants.height + 50) {\n position.y = -50;\n }\n if (position.x< -50) {\n position.x = Constants.width +50;\n } else if (position.x > Constants.width + 50) {\n position.x = -50;\n }\n }", "private int getDist(int x, int y, int direction) {\n\t\tint Spaces = 0;\n\t\tif(direction == 0)\n\t\t{\n\t\t\t\n\t\t\tPoint nextPoint = new Point(x, y++);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y++);\n\t\t\t}\n\t\t}\n\t\tif(direction == 1)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x++, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x++, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 2)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x--, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x--, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 3)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x, y--);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y--);\n\t\t\t}\n\t\t}\n\t\treturn Spaces;\n\t}", "public void movePlayer(String nomeArq, int px, int py) {\r\n if(Main.player1.Vez()) {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)){\r\n \tMain.player1.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player1.MudaLado(false,true);\r\n } \r\n pos = Main.player1.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0.1;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false) {\r\n \tMain.player1.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player1.Size()[0],Main.player1.Size()[1])==false)\r\n {\r\n \tMain.player1.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n Main.Fase.repinta(); \r\n }\r\n else {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)) {\r\n \tMain.player2.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player2.MudaLado(false,true);\r\n } \r\n pos = Main.player2.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false) {\r\n \tMain.player2.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false)\r\n {\r\n \tMain.player2.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n }\r\n }", "private void deslocarBloco(double dist) {\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < distance * 10.0) {\r\n\t\t\t\t\tsendData(\"U\");\t\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsendData(\"u\");\r\n\t\t\t\t\r\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < 1000.0) {\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t}", "public void driveToDistance(double distance) {\n //TODO\n }", "public void move(long deltaTime) {\n\n Point currentTile = getOccupyingTile(position);\n\n /*\n if (!Simulator.getInstance().getTileMap().isInsideMap(currentTile))\n return;\n\n if (Simulator.getInstance().getTileMap().isAWall(currentTile) || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n*/\n\n if (Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n\n\n if (!Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile) && Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector().equals(new Point2D.Double(0.0, 0.0))) {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n double angle = 0;\n while ((angle >= 60 && angle <= 120) || (angle >= 150 && angle <= 210) || (angle >= 240 && angle <= 300) || (angle >= 330) || (angle <= 30)) {\n\n angle = Math.random() * 360;\n }\n setVector(new Point2D.Double(Math.cos(Math.toRadians(angle)) / 1.5, Math.sin(Math.toRadians(angle)) / 1.5));\n } else {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n }\n\n\n Point2D vectorDiff = new Point2D.Double(vector.getX() - targetVector.getX(), vector.getY() - targetVector.getY());\n\n if (vectorDiff.getX() < 0)\n vector.setLocation(vector.getX() + 0.001 * velocity * deltaTime, vector.getY());\n else if (vectorDiff.getX() > 0)\n vector.setLocation(vector.getX() - 0.001 * velocity * deltaTime, vector.getY());\n\n if (vectorDiff.getY() < 0)\n vector.setLocation(vector.getX(), vector.getY() + 0.001 * velocity * deltaTime);\n else if (vectorDiff.getY() > 0)\n vector.setLocation(vector.getX(), vector.getY() - 0.001 * velocity * deltaTime);\n\n\n Point2D newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n Point targetTile = getOccupyingTile(newPosition);\n\n\n Point direction = getDirection(currentTile, targetTile);\n\n\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) {// || Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n\n if (Simulator.getInstance().isUsingBounceCollision()) {\n if (direction.x > 0 || direction.x < 0)\n vector.setLocation(vector.getX() * -0.5, vector.getY());\n if (direction.y > 0 || direction.y < 0)\n vector.setLocation(vector.getX(), vector.getY() * -0.5);\n\n newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n targetTile = getOccupyingTile(newPosition);\n\n //Secondary check to make sure the bounce doesn't make it go out of bounds\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) { //|| Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n vector.setLocation(0, 0);\n } else {\n setPosition(newPosition);\n }\n\n\n } else {\n vector.setLocation(0, 0);\n }\n\n } else {\n setPosition(newPosition);\n }\n\n }", "private Vector2d generateNewPositionForChild()\n {\n\n Random generator = new Random();\n List<Vector2d> freePositions = new LinkedList<>(); //tutaj przechowywane sa wolne pozycje wokol\n Vector2d position;\n Directions directionToAdd;\n\n for(int i = 0; i<8; i++)\n {\n directionToAdd = new Directions(i); //wykorzystujemy klase directions do generowania pozycji wokol\n position = this.position.add(directionToAdd.move());\n if(map.animalsAt(position).isEmpty())\n {\n freePositions.add(position);\n }\n }\n\n if(freePositions.isEmpty()) //jezeli nie ma wolnych pozycji\n {\n //jesli nie ma wolnych pozycji\n int x = generator.nextInt(8);\n directionToAdd = new Directions(x);\n return this.position.add(directionToAdd.move());\n }\n\n //jezeli mamy wolne pozycje to generujemy dowolna z listy\n int x = generator.nextInt(freePositions.size());\n Vector2d newPosition = freePositions.get(x);\n\n return newPosition;\n }", "public void movimentar_dragao(int pos) {\n\t\tint check = 0;\n\t\tint counter = 0; //After 1000 tries it means that the dragon is trapped and cant move either way\n\t\twhile (check == 0 && counter < 1000) {\n\t\t\tint random = 1 + (int)(Math.random()*4);\n\t\t\tif (random == 1) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'X' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setX_coord(dragoes[pos].getX_coord()+1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (random == 2) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setX_coord(dragoes[pos].getX_coord()-1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (random == 3) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setY_coord(dragoes[pos].getY_coord()-1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setY_coord(dragoes[pos].getY_coord()+1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcounter++;\n\t\t}\n\t}", "public boolean moveForward(){\n \n int[] last = (int[]) this.snake.elementAt(this.snake.size() -1);\n int[] sLast = (int[]) this.snake.elementAt(this.snake.size() -2);\n int[] diff = new int[2];\n int[] diff2 = new int[2];\n \n diff[0] = last[0] - sLast[0];\n diff[1] = last[1] - sLast[1];\n \n //left\n if( direction == 1){\n diff2[0]--;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff = diff2; \n }\n \n //down\n }else if(direction == 2){\n \n diff2[1]++;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n //System.out.println(\"first one: \" + diff[0] + \", \" + diff[1]);\n }\n \n //right\n }else if(direction == 3){\n diff2[0]++;\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n }\n \n //up\n }else if(direction == 4){\n \n diff2[1]--;\n //System.out.println(\"\" + diff[0] + \", \" + diff[1]);\n if(diff2[0] == -1*diff[0] &&diff2[1] == -1*diff[1]){\n diff = new int[]{0,0}; \n }else{\n diff=diff2; \n }\n }else{ \n diff[0] = last[0] - sLast[0];\n diff[1] = last[1] - sLast[1];\n }\n \n int[] newPoint = new int[2];\n newPoint[0] = last[0] + diff[0];\n newPoint[1] = last[1] + diff[1];\n \n //if it hits the snake itself\n boolean hits = false;\n Enumeration enu = this.snake.elements();\n int[] temp = new int[2];\n while(enu.hasMoreElements()){\n temp = (int[]) enu.nextElement();\n if(temp[0] == newPoint[0] && temp[1] == newPoint[1]){\n hits = true; \n }\n }\n if(hits){\n return false; \n }\n //if it hits the wall\n if( newPoint[0] >50 || newPoint[0] <0 || newPoint[1] >50 || newPoint[1] <0){\n return false; \n }else{\n if(newPoint [0] == this.apple[0] && newPoint[1] == this.apple[1]){\n this.snake.add(newPoint);\n this.ateApple();\n }else{\n this.snake.add(newPoint);\n this.snake.remove(0);\n \n \n }\n return true;\n }\n }", "private int distBetween(Cell u, Cell v) {\r\n\t\t\tint dist;\r\n\t\t\tint dx = u.col - v.col;\r\n\t\t\tint dy = u.row - v.row;\r\n\t\t\tif (diagonal.isSelected()) {\r\n\t\t\t\t// with diagonal movements\r\n\t\t\t\t// calculate 1000 times the Euclidean distance\r\n\t\t\t\tdist = (int) ((double) 1000 * Math.sqrt(dx * dx + dy * dy));\r\n\t\t\t} else {\r\n\t\t\t\t// without diagonal movements\r\n\t\t\t\t// calculate Manhattan distances\r\n\t\t\t\tdist = Math.abs(dx) + Math.abs(dy);\r\n\t\t\t}\r\n\t\t\treturn dist;\r\n\t\t}", "public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "public double distancia(Ponto p){\n double dx = Math.pow((p.x - this.x), 2);\n double dy = Math.pow((p.y - this.y), 2);\n return Math.sqrt((dx+dy));\n }", "private double getDistance(Vector2i tile, Vector2i goal) {\n\t\t double dx = tile.getX() - goal.getX();\n\t\t double dy = tile.getY() - goal.getY();\n\t\t return Math.sqrt(dx * dx + dy *dy); //distance \n\t }", "@Override\n\tpublic void update() {\n\t\tif(!shortestPath.isEmpty())\n\t\t\tnextPoint = shortestPath.peek();\n\t\telse\n\t\t{\n\t\t\tgameManager.killEnemy(this, false);\n\t\t\tGameStateManager.getInstance().getPlayState().removeEnemy(this);\n\t\t\treturn;\n\t\t}\n\t\tnextVector = new Vector2d(nextPoint.x * PlayState.INGAMETILESIZE, nextPoint.y * PlayState.INGAMETILESIZE);\n\t\tdirection = Vector2d.sub(nextVector, position);\n\t\tif(direction.mag() < tolerance)\n\t\t{\n\t\t\tposition = nextVector;\n\t\t\tshortestPath.pop();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdirection.normalize();\n\t\t\tposition.add(direction);\n\t\t}\n\t}", "public void mueveBala() {\n switch (direccion) {\n case NORTE:\n posY -= velocidadBala;\n break;\n case SUR:\n posY += velocidadBala;\n break;\n case ESTE:\n posX += velocidadBala;\n break;\n case OESTE:\n posX -= velocidadBala;\n break;\n }\n actualizaHitbox();\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 situerClick() {\n\n\tSystem.out.println(\"Allez-y, cliquez donc.\") ;\n\t\n\tif (dessin.waitClick()) {\n\t float lon = dessin.getClickLon() ;\n\t float lat = dessin.getClickLat() ;\n\t \n\t System.out.println(\"Clic aux coordonnees lon = \" + lon + \" lat = \" + lat) ;\n\n\t // On cherche le noeud le plus proche. O(n)\n\t float minDist = Float.MAX_VALUE ;\n\t Noeud noeud = null ;\n\t \n\t for(Map.Entry<Integer, Noeud> entry : noeuds.entrySet())\t{\r\n\t \tNoeud n = entry.getValue();\r\n\t \tfloat londiff = n.getLongitude() - lon;\r\n\t \tfloat latdiff = n.getLatitude() - lat;\r\n\t \tfloat dist = londiff*londiff + latdiff*latdiff ;\r\n\t \tif(dist < minDist)\t{\r\n\t \t\tnoeud = n;\r\n\t \t\tminDist = dist;\r\n\t \t}\r\n\t }\n\n\t System.out.println(\"Noeud le plus proche : \" + noeud) ;\n\t System.out.println() ;\n\t dessin.setColor(java.awt.Color.red) ;\n\t dessin.drawPoint(noeud.getLongitude(), noeud.getLatitude(), 5) ;\n\t}\n }", "@Test\n public void chunkPosShouldBeMinus2ByMinus2WhenPlayerPosIsMinus111byMinus111() {\n final int sideLengthOfBlock = 10;\n final int rowAmountInChunk = 11;\n\n final int playerPos = -111;\n final int expectedChunkPos = -2;\n\n MatcherAssert.assertThat(\n this.targetCompass(\n sideLengthOfBlock,\n rowAmountInChunk,\n new Point(playerPos, playerPos)\n ).chunkPos(),\n CoreMatchers.equalTo(new Point(expectedChunkPos, expectedChunkPos))\n );\n }", "public Position findWeedPosition() {\n int x = 0;\n int y = 0;\n int sum = 0;\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(sum==0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n x = i;\n y = j;\n sum = tmpSum;\n }\n }\n else {\n x = i;\n y = j;\n sum = tmpX + tmpY;\n\n }\n }\n }\n\n }\n }\n return new Position(x,y);\n }", "void updateDistance(int distance);", "public int CalcDistance ( )\r\n\t{\r\n\t\tfor ( int i = 0; i<size; i++ )\r\n\t\t{\r\n\t\t\tfor ( int offR = 0; offR <= size/2; offR++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( int offR = size-1; offR >= size/2; offR-- )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn maze [currentRow] [currentCol].getDistanceToExit();\r\n\t}", "public void getMissDistance() {\n missDistance = targetDistance - projDistance;\n }", "public PVector align (ArrayList<Shark> sharks) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0);\n int count = 0;\n for (Shark other : sharks) {\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\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 }", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "public void moveSeagull( Envelope bounds ) {\n \n \n if (moveListener != null){\n moveListener.gullMoved(this.location);\n }\n \n double x = location.x;\n double offset = 0.008;\n if (generator.nextDouble() < 0.5 ){\n x = x - bounds.getWidth() * offset;\n }else{\n x = x + bounds.getWidth() * offset;\n }\n double y = location.y;\n if (generator.nextDouble() < 0.5){\n y = y - bounds.getHeight() * offset;\n }else{\n y = y + bounds.getHeight() * offset;\n }\n// double x = generator.nextDouble() * 2 - 1; // num between -1 and 1\n// double y = generator.nextDouble() * 2 - 1;\n \n// Coordinate new_loc = new Coordinate(location.x + x,location.y + y);\n Coordinate new_loc = new Coordinate(x,y);\n if (bounds.contains(new_loc)){\n this.location = new_loc;\n }else{\n //center on screen\n this.location = new Coordinate(bounds.getWidth()/2 + bounds.getMinX(), bounds.getHeight()/2 + bounds.getMinY());\n }\n\n }", "public boolean isInRangeToRenderDist(double distance) {\n/* 38 */ return (distance < 4096.0D);\n/* */ }", "public float distanceTo(YUV yuv){\n//\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v));\n\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v) + (y-yuv.y)*(y-yuv.y));\n\t}", "private void setPoints () {\n\t\tArrayList<Point> emptySpot = new ArrayList<Point>();\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\tif (maze[i][j] == 0) {\n\t\t\t\temptySpot.add(new Point (i, j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(emptySpot);\n\t\tthis.goal = emptySpot.get(0);\n\t\tdouble goalRange = this.goal.getX() + this.goal.getY();\n\t\tfor (int i = 1; i < emptySpot.size(); i++) {\n\t\t\tPoint playerStart = emptySpot.get(i);\n\t\t\tdouble playerRange = playerStart.getX() + playerStart.getY();\n\t\t\tif (Math.abs(playerRange - goalRange) > width/2)\n\t\t\tthis.playerStart = playerStart;\n\t\t}\n\t}", "T distance(S from, S to);", "private void disparo()\n {\n switch(this.posicion){\n case 0:\n setLocation(getX(),getY()-this.velocidadDisparo);\n break;\n case 1:\n setLocation(getX(),getY()+this.velocidadDisparo);\n break;\n case 2:\n setLocation(getX()+this.velocidadDisparo,getY());\n break;\n case 3:\n setLocation(getX()-this.velocidadDisparo,getY());\n break;\n }\n }", "private void pointTowardsPlayer(Direction dir, Position playerPos, Position enemyPos)\n {\n dir.x = playerPos.x - enemyPos.x;\n dir.y = playerPos.y - enemyPos.y;\n\n // Normalize direction vector\n double length = Math.sqrt(dir.x * dir.x + dir.y * dir.y);\n dir.x /= length;\n dir.y /= length;\n }", "float lookInDirection(PVector direction) {\n\n PVector currentPosition = new PVector(position.x, position.y);//the position where we are currently looking for food or tail or wall\n float distance = 0;\n //move once in the desired direction before starting\n currentPosition.add(direction);\n distance +=1;\n\n //look in the direction until you reach a wall\n while (distance <= 60) {\n for (Asteroid a : asteroids) {\n if (a.lookForHit(currentPosition) ) {\n //return 1/distance;\n return (60 - distance) / 60;\n }\n }\n\n //look further in the direction\n currentPosition.add(direction);\n\n //loop it\n if (currentPosition.y < -50) {\n currentPosition.y += Constants.height + 100;\n } else\n if (currentPosition.y > Constants.height + 50) {\n currentPosition.y -= Constants.height - 100;\n }\n if (currentPosition.x < -50) {\n currentPosition.x += Constants.width + 100;\n } else if (currentPosition.x > Constants.width + 50) {\n currentPosition.x -= Constants.width + 100;\n }\n\n distance +=1;\n }\n return 0;\n }", "@Override\n public float distanceAdjacent(int x1, int y1, int x2, int y2) {\n float duration = 0;\n\n if (x1 == x2 || y1 == y2) {\n MapTile.Instance fromTile = getTileData(x1, y1);\n MapTile.Instance toTile = getTileData(x2, y2);\n assert fromTile != null && toTile != null;\n\n Direction move = Direction.get(x2 - x1, y2 - y1);\n\n int fromHeight = fromTile.heightOf(move);\n int toHeight = toTile.heightOf(move.inverse());\n\n // steepness\n float t1inc = (fromHeight - fromTile.getHeight()) / (TILE_SIZE / 2);\n float t2inc = (toHeight - toTile.getHeight()) / (TILE_SIZE / 2);\n\n // actual duration of walking\n float walkSpeedT1 = (1f / hypoLength(t1inc)) * walkSpeed;\n float walkSpeedT2 = (1f / hypoLength(t2inc)) * walkSpeed;\n\n // duration += walkspeed(steepness_1) * dist + walkspeed(steepness_2) * dist\n duration += (walkSpeedT1 + walkSpeedT2) * TILE_SIZE;\n\n // height difference on the sides of the tiles\n float cliffHeight = (toHeight - fromHeight) * TILE_SIZE_Z;\n\n // climbing if more than 'an acceptable height'\n if (cliffHeight > 0) {\n duration += (cliffHeight / climbSpeed);\n }\n\n } else {\n // TODO allow diagonal tracing\n Logger.WARN.print(String.format(\n \"Pathfinding (%s) asked for non-adjacent tiles (%d, %d) (%d, %d)\",\n getClass(), x1, y1, x2, y2\n ));\n\n return Float.POSITIVE_INFINITY;\n }\n\n return duration;\n }", "@Override\r\n protected Double h(Point from, Point to) {\r\n /* Use the Manhattan distance heuristic. */\r\n return (double) Math.abs(finish.x - to.x) + Math.abs(finish.y - to.y);\r\n }", "double getSquareDistance();", "private Position getTestPos1() {\r\n Grid grid = GridBuilder.builder()\r\n .withMaxX(10)\r\n .withMaxY(10)\r\n .withMinY(-20)\r\n .withMinY(-20)\r\n .build();\r\n Moveable moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(Positions.of(Directions.S, 0, 0, 0))\r\n .build())\r\n .withVelocity(100)\r\n .build();\r\n moveable.moveForward();\r\n moveable.turnRight();\r\n moveable = MoveableBuilder.builder()\r\n .withGrid(grid)\r\n .withShape(PositionShapeBuilder.builder()\r\n .withPosition(moveable.getPosition())\r\n .build())\r\n .withVelocity(50)\r\n .build();\r\n moveable.moveForward();\r\n PositionImpl position = (PositionImpl) moveable.getPosition();\r\n moveable.makeTurn(position.calcAbsoluteAngle() - position.getDirection().getAngle());\r\n return moveable.getPosition();\r\n }", "void addDistance(float distanceToAdd);", "public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }", "private double distanceToCarBack(double fromPosition) {\n\t\t double carBackPosition = Double.POSITIVE_INFINITY;\n\t\t for (Car c : cars)\n\t\t\t if (c.backPosition() >= fromPosition && c.backPosition() < carBackPosition)\n\t\t\t\t carBackPosition = c.backPosition();\n\t\t return carBackPosition;\n\t }", "@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}", "public int resta(){\r\n return x-y;\r\n }", "public static void ITdistances()\n\t{\n\t\t//System.err.println(\"Position\");\n\n\t\tclade = clad[k];\n\n\t\tclade.tipDistance = 0;\n\t\tclade.intDistance = 0;\n\t\tclade.tipDisNested = 0;\n\t\tclade.intDisNested = 0;\n\t\tclade.indTipClades = 0;\n\t\tclade.indIntClades = 0;\n\n\n\t\tif(clade.check != (double) clade.numSubClades && clade.check != 0)\n\t\t{ \n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\tif (clade.Position[i] == tip)\n\t\t\t\t\tclade.indTipClades += clade.rowTotal[i];\n\t\t\t\telse\n\t\t\t\t\tclade.indIntClades += clade.rowTotal[i];\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\t// weigthing within class\n\t\t\t\tclade.tipDistance += clade.Position[i] * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.tipDisNested += clade.Position[i] * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\n\t\t\t\tclade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\t\n\t\t\t\t\n\t\t\t\t// unweighted\n\t\t\t\t//clade.tipDistance += clade.Position[i] * clade.Dc[i] / (double) clade.check;\n\t\t\t\t//clade.tipDisNested += clade.Position[i] * clade.Dn[i] / (double) clade.check;\n\t\t\t\t//clade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] / (double) (clade.numSubClades - clade.check);\n\t\t\t\t//clade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] / (double) (clade.numSubClades - clade.check);\t\n\t\t\t}\n\n\t\t clade.tipIntDistance = clade.intDistance - clade.tipDistance;\n\t\t clade.tipIntDisNested = clade.intDisNested - clade.tipDisNested;\n\t\t if(verbose){\n\t\t\tlogfile.println(\"\\nIT \" + clade.cladeName + \" indTipClades = \" + clade.indTipClades\n\t\t\t\t+ \" indIntClades + \" + clade.indIntClades);\n\t\t\tlogfile.println(\"\\nITc \" + clade.cladeName + \" meanInt = \" + clade.intDistance\n\t\t\t\t+ \" meanTip = \" + clade.tipDistance);\n\t\t\tlogfile.println(\"ITn \" + clade.cladeName + \" meanInt = \" + clade.intDisNested\n\t\t\t\t+ \" meanTip = \" + clade.tipDisNested);\n\t\t }\n\t\t}\n\n\t\t//System.err.println(\"IT clade \" + clade.cladeName + \" meanInt = \" + clade.intDistance + \" meanTip = \" + clade.tipDistance);\n\n\t}", "public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}", "public void Move (double distancia){\n if(isPowerOn) {\n double consumeGas = this.gasConsumption * distancia;\n if (consumeGas > gas) {\n double distance = consumeGas/this.gasConsumption;\n gas = 0;\n this.mileage += distance;\n System.out.println(\"You can continue only \" + distance + \" km more\");\n } else {\n gas -= consumeGas;\n this.mileage += distancia;\n }\n System.out.println(\"you have traveled by car\" + this.mileage + \" km\");\n }\n else\n {\n System.out.println(\"Car is powerOff, it is not possible to move\");\n }\n }", "@Test\n public void test_distanceLinaireSurY_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionX = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(positionX, 2));\n pays.setPositionVille(1, new Point(positionX, 3));\n pays.setPositionVille(2, new Point(positionX, 4));\n pays.setPositionVille(3, new Point(positionX, 5));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "private double calculateDistanceOfTwoBox(BoundingBox box1, BoundingBox to) {\n if (box1.getPage() != to.getPage()) {\n return 1000 * Math.abs(box1.getPage() - to.getPage());\n }\n\n //the current box is completely \"lefter\"\n boolean left = box1.getX2() < to.getX();\n boolean right = to.getX2() < box1.getX();\n boolean bottom = to.getY2() < box1.getY();\n boolean top = box1.getY2() < to.getY();\n if (top && left) {\n return dist(box1.getX2(), box1.getY2(), to.getX(), to.getY());\n } else if (left && bottom) {\n return dist(box1.getX2(), box1.getY(), to.getX(), to.getY2());\n } else if (bottom && right) {\n return dist(box1.getX(), box1.getY(), to.getX2(), to.getY2());\n } else if (right && top) {\n return dist(box1.getX(), box1.getY2(), to.getX2(), to.getY());\n } else if (left) {\n return to.getX() - box1.getX2();\n } else if (right) {\n return box1.getX() - to.getX2();\n } else if (bottom) {\n return box1.getY() - to.getY2();\n } else if (top) {\n return to.getY() - box1.getY2();\n } else {\n return 0;\n }\n\n }", "double getDistance(int i, int j){\r\n\tdouble d = (coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0])+ (coord[i][1]-coord[j][1])*(coord[i][1]-coord[j][1]);\r\n\td = Math.sqrt(d);\r\n\treturn d;\r\n}", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "public void deplacementMinimap(){\n\t\t\tboolean changement=false;//ce boolean me sert a savoir si les coordonnees ont change.\n\t\t\tif(mX>=3 || mX<=-3){//si l'utilisateur est alle a droite ou a gauche avec la souris (3 fois d'affiler)\n\t\t\t\tdebutX+=mX*5; //on bouge la minimap de 15 cases vers la droite ou la gauche.\n\t\t\t\tchangement=true;//on dit qu'on a change les coordonnees\n\t\t\t}\n\t\t\tif(mY>=3 || mY<=-3){//si l'utilisateur est alle en haut ou en bas avec la souris (3 fois d'affiler)\n\t\t\t\tdebutY+=mY*5; //on bouge la minimap de 15 cases vers en haut ou en bas.\n\t\t\t\tchangement=true;//on dit qu'on a change les coordonnees\n\t\t\t}\n\t\t\tif (changement){//s'il y a eu des changements.\n\t\t\t\tmY=0;//Je reInitialise mY,mX.\n\t\t\t\tmX=0;\n\t\t\t\tpositionMinimap();//je repositionne ma minimap\n\t\t\t\tposition();//je repositionne mon rectangle qui indique l'endroit que je zone.\n\t\t\t\tfenetreterrain.zoneZoom(zoom, positionX/widthCase+debutX, positionY/heightCase+debutY);//et je met a jour ma FenetreTerrain.\n\t\t\t}\n\t\t}", "@Test\n public void testHorizontalDisplacementTo() {\n System.out.println(\"Testing HorizontalDisplacementTo() for a range of different GPS coordinates\");\n double distancesExpected[] = {\n 555.998,\n 555.998,\n -555.998,\n -555.998,\n\t\t\t72.266,\n\t\t\t72.266,\n\t\t\t-72.266,\n\t\t\t-72.266\n };\n\t\t\n for (int i = 0; i < this.testCoordinates.length; i++) {\n double expResult = distancesExpected[i];\n double result = this.origin.horizontalDisplacementTo(this.testCoordinates[i]);\n\t\t\tSystem.out.println(\"Expected: \" + expResult + \", Actual: \" + result);\n assertEquals(expResult, result, 0.1);\n }\n }" ]
[ "0.6345015", "0.6294691", "0.6107608", "0.6073681", "0.60491395", "0.604098", "0.59146357", "0.59104323", "0.5888211", "0.58323985", "0.58318555", "0.5809257", "0.57702875", "0.57413393", "0.57375866", "0.57352686", "0.5729237", "0.57100403", "0.57075214", "0.56578994", "0.56500983", "0.5646094", "0.563903", "0.5626305", "0.56106085", "0.56035054", "0.5591562", "0.5564786", "0.555768", "0.5536367", "0.5529876", "0.55290914", "0.5522825", "0.5522011", "0.5519825", "0.551642", "0.55023074", "0.5494584", "0.54895246", "0.5489389", "0.5487364", "0.54801965", "0.5460048", "0.54556274", "0.5451926", "0.54315686", "0.542891", "0.5428711", "0.5424226", "0.5417286", "0.541026", "0.5398536", "0.53899145", "0.5380787", "0.5377575", "0.53676724", "0.53585047", "0.5351486", "0.53429055", "0.5341017", "0.5333047", "0.5328467", "0.53281426", "0.5327994", "0.53230417", "0.53183573", "0.53177416", "0.5314439", "0.5307444", "0.5298412", "0.52866256", "0.5276588", "0.5272602", "0.5272249", "0.52637684", "0.5259336", "0.5243974", "0.5243162", "0.52423716", "0.52417946", "0.52414113", "0.5236012", "0.52313894", "0.52289426", "0.5225388", "0.52206266", "0.5216719", "0.5213816", "0.5210953", "0.5209302", "0.52089465", "0.52085364", "0.5204228", "0.5201212", "0.5196065", "0.51956576", "0.5184443", "0.51838803", "0.51837814", "0.5180899" ]
0.73604876
0
trouve si possible un hero a une distance
public Position trouverHeros(Position pos, int range);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Hero aventurier = new Hero(200, 100);\n Equipement epee = new Equipement(\"epee\", 0);\n Monsters sorciere = new Monsters(\"witch\", 180, 0);\n Monsters barbare = new Monsters(\"olaf\", 160, 0);//Degat et point attaque sont à 0 car ils prendront les valeurs du random\n\n\n System.out.println(\"Bienvenue dans le dongeon\");\n System.out.println(\"Vous avez \" + aventurier.getPointDeVie() + \" Point de vie, \" + aventurier.getFlasqueDeau() + \" flasques pour combatre vos ennemies et une \");\n\n // i=room ;si pointdevie > room-->room+1 sinon game over(pas besoin de creer une classe)\n int i = 1;\n do {\n\n if (aventurier.getPointDeVie() > 0) ;\n {\n System.out.println(\"Room\" + i);\n\n Monsters enemieActuel = barbare;\n//nbr aleatoire entre sorcier et monster\n Random random = new Random();\n int nbrAl = random.nextInt(2 );\n//si nbr=0 = sorcier sinon barbare\n if (nbrAl == 0) {\n enemieActuel = sorciere;\n //sinon barbare\n } else {\n enemieActuel = barbare;\n }\n\n\n //Si barbare faire le do while\n\n if (enemieActuel == barbare) {\n\n do { //Faire des degats aleatoire grace au random à l'aide de l'epee\n epee.setDegat((int) (5 + (Math.random() * 30)));//comme .set dega=0 on lui donne la valeur de math.random\n int degat = epee.getDegat(); //.get renvoi la valeur au int nommer degat\n barbare.setPointDeVie(barbare.getPointDeVie() - degat);//vie - degat\n System.out.println(\"Il reste au barbare \" + barbare.getPointDeVie());//nouvelle valeur de point de vie\n\n\n //idem avec l'aventurier\n barbare.setPointAttaque((int) (5 + (Math.random() * 30)));\n int pointDattaque = barbare.getPointAttaque();\n aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque);\n System.out.println(\"il vous reste \" + aventurier.getPointDeVie());\n\n // tant que les Pvie de l'aventurier >= 0 et idem barbare continuer le combat\n } while (aventurier.getPointDeVie() >= 0 && barbare.getPointDeVie() >= 0);\n //à la fin du combat si pvie de l'aventurier sont >0 et que i (room) egale 5 \"gagné\"\n if (aventurier.getPointDeVie() > 0 && i==5) {\n System.out.println(\"Bravo vous avez gagné ! =)\");\n\n //Si juste pvie de l'aventurier > 0 --->room suivante\n }else if (aventurier.getPointDeVie() > 0 ){\n System.out.println(\"Bravo tu passes à la pièce suivante\");\n //on redonne les valeurs de depart pdeVie pour la nouvelle room\n aventurier.setPointDeVie(200);\n barbare.setPointDeVie(180);\n i+=1;\n }\n\n // sinon room = 6 pour envoyer le sout \"game over\"\n else {\n System.out.println(\"Game Over\");\n i = 6;\n }\n\n\n\n }\n\n //IDEM avec sorciere\n else {\n do {\n\n\n aventurier.setFlasqueDeau((int) (5 + (Math.random() * 30)));\n int degat = aventurier.getFlasqueDeau();\n sorciere.setPointDeVie(sorciere.getPointDeVie() - degat);\n System.out.println(\"Il reste à la sorciere \" + sorciere.getPointDeVie());\n\n sorciere.setPointAttaque((int) (5 + (Math.random() * 30)));\n int pointDattaque = sorciere.getPointAttaque();\n aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque);\n System.out.println(\"il vous reste \" + aventurier.getPointDeVie());\n\n } while (aventurier.getPointDeVie() >= 0 && sorciere.getPointDeVie() >= 0);\n if (aventurier.getPointDeVie() > 0 && i==5) {\n System.out.println(\"Bravo vous avez gagné ! =)\");\n }else if (aventurier.getPointDeVie() > 0 ){\n System.out.println(\"Bravo tu passes à la pièce suivante\");\n aventurier.setPointDeVie(200);\n sorciere.setPointDeVie(160);\n i+=1;\n }\n else {\n System.out.println(\"Game Over\");\n i = 6;\n }\n }\n } } while (i <= 5 && aventurier.getPointDeVie() > 0);\n\n\n }", "public int distBonus(){\n Player currentplayer = state.getCurrentPlayer();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n ArrayList<GameObject> listObjectsOnCurrentCell;\n GameObject objectOnCell;\n int distTmp;\n int dist= tabcells.length+tabcells[0].length;\n for(int i=0;i<tabcells.length;i++){\n for(int j=0;j<tabcells[0].length;j++){\n listObjectsOnCurrentCell = tabcells[i][j].getGameObjects();\n for(GameObject object: listObjectsOnCurrentCell){\n if(object instanceof Bonus || object instanceof BonusWall){\n distTmp = manhattan(object,currentplayer);\n if(distTmp<dist){\n dist = distTmp;\n }\n }\n }\n }\n }\n return dist;\n }", "public void Move (double distancia){\n if(isPowerOn) {\n double consumeGas = this.gasConsumption * distancia;\n if (consumeGas > gas) {\n double distance = consumeGas/this.gasConsumption;\n gas = 0;\n this.mileage += distance;\n System.out.println(\"You can continue only \" + distance + \" km more\");\n } else {\n gas -= consumeGas;\n this.mileage += distancia;\n }\n System.out.println(\"you have traveled by car\" + this.mileage + \" km\");\n }\n else\n {\n System.out.println(\"Car is powerOff, it is not possible to move\");\n }\n }", "public void calculateShooterInfo(double distance) {\n }", "boolean hasDistance();", "Position trouverPositionVide(Position pos, int distance);", "@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}", "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}", "public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }", "@Override\r\n\tpublic boolean lancar(Combativel origem, Combativel alvo) {\r\n DadoVermelho dado = new DadoVermelho();\r\n int valor = dado.jogar();\r\n if(valor < origem.getInteligencia()) {\r\n alvo.defesaMagica(dano);\r\n return true;\r\n }\r\n else {\r\n \tSystem.out.println(\"Voce nao conseguiu usar a magia\");\r\n }\r\n return false;\r\n }", "public void moveHero(Labirinto lab, String direction, sword espada, ArrayList<dragon> dragons) {\n\t\tlab.getTable()[pos_x][pos_y] = ' ';\n\t\tswitch(direction)\n\t\t{\n\t\tcase \"n\":\n\t\tcase \"N\":\n\t\t\tif (lab.getTable()[pos_x - 1][pos_y] == ' ')\n\t\t\t{\n\t\t\t\tpos_x--;\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x - 1][pos_y] == 'E')\n\t\t\t{\n\t\t\t\tpos_x--;\n\t\t\t\tequipHero();\n\t\t\t\tespada.changeState();\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x - 1][pos_y] == 'D' || lab.getTable()[pos_x - 1][pos_y] == 'd')\n\t\t\t{\n\t\t\t\tif(tipo == 'A'){\n\t\t\t\t\tfindDragon(dragons, pos_x - 1, pos_y).changeState();\n\t\t\t\t\tpos_x--;\n\t\t\t\t\tkillDragonsAround(dragons);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x - 1][pos_y] == 'S' && tipo == 'A')\n\t\t\t{\n\t\t\t\tboolean dead = true;\n\t\t\t\tfor(int i = 0;i < dragons.size(); i++){\n\t\t\t\t\tif (dragons.get(i).getState() == true)\n\t\t\t\t\t\tdead = false;\n\t\t\t\t}\n\t\t\t\tif (dead)\n\t\t\t\t\tpos_x--;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"s\":\n\t\tcase \"S\":\n\t\t\tif (lab.getTable()[pos_x + 1][pos_y] == ' ')\n\t\t\t{\n\t\t\t\tpos_x++;\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x + 1][pos_y] == 'E')\n\t\t\t{\n\t\t\t\tpos_x++;\n\t\t\t\tequipHero();\n\t\t\t\tespada.changeState();\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x + 1][pos_y] == 'D' || lab.getTable()[pos_x + 1][pos_y] == 'd')\n\t\t\t{\n\t\t\t\tif(tipo == 'A'){\n\t\t\t\t\tfindDragon(dragons, pos_x + 1, pos_y).changeState();\n\t\t\t\t\tpos_x++;\n\t\t\t\t\tkillDragonsAround(dragons);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x + 1][pos_y] == 'S' && tipo == 'A')\n\t\t\t{\n\t\t\t\tboolean dead = true;\n\t\t\t\tfor(int i = 0;i < dragons.size(); i++){\n\t\t\t\t\tif (dragons.get(i).getState() == true)\n\t\t\t\t\t\tdead = false;\n\t\t\t\t}\n\t\t\t\tif (dead)\n\t\t\t\t\tpos_x++;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"e\":\n\t\tcase \"E\":\n\t\t\tif (lab.getTable()[pos_x][pos_y + 1] == ' ')\n\t\t\t{\n\t\t\t\tpos_y++;\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y + 1] == 'E')\n\t\t\t{\n\t\t\t\tpos_y++;\n\t\t\t\tequipHero();\n\t\t\t\tespada.changeState();\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y + 1] == 'D' || lab.getTable()[pos_x][pos_y + 1] == 'd')\n\t\t\t{\n\t\t\t\tif(tipo == 'A'){\n\t\t\t\t\tfindDragon(dragons, pos_x, pos_y + 1).changeState();\n\t\t\t\t\tpos_y++;\n\t\t\t\t\tkillDragonsAround(dragons);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y + 1] == 'S' && tipo == 'A')\n\t\t\t{\n\t\t\t\tboolean dead = true;\n\t\t\t\tfor(int i = 0;i < dragons.size(); i++){\n\t\t\t\t\tif (dragons.get(i).getState() == true)\n\t\t\t\t\t\tdead = false;\n\t\t\t\t}\n\t\t\t\tif (dead)\n\t\t\t\t\tpos_y++;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"o\":\n\t\tcase \"O\":\n\t\t\tif (lab.getTable()[pos_x][pos_y - 1] == ' ')\n\t\t\t{\n\t\t\t\tpos_y--;\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y - 1] == 'E')\n\t\t\t{\n\t\t\t\tpos_y--;\n\t\t\t\tequipHero();\n\t\t\t\tespada.changeState();\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y - 1] == 'D' || lab.getTable()[pos_x][pos_y - 1] == 'd')\n\t\t\t{\n\t\t\t\tif(tipo == 'A'){\n\t\t\t\t\tfindDragon(dragons, pos_x, pos_y - 1).changeState();\n\t\t\t\t\tpos_y--;\n\t\t\t\t\tkillDragonsAround(dragons);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (lab.getTable()[pos_x][pos_y - 1] == 'S' && tipo == 'A')\n\t\t\t{\n\t\t\t\tboolean dead = true;\n\t\t\t\tfor(int i = 0;i < dragons.size(); i++){\n\t\t\t\t\tif (dragons.get(i).getState() == true)\n\t\t\t\t\t\tdead = false;\n\t\t\t\t}\n\t\t\t\tif (dead)\n\t\t\t\t\tpos_y--;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected Double h(Point from, Point to) {\r\n /* Use the Manhattan distance heuristic. */\r\n return (double) Math.abs(finish.x - to.x) + Math.abs(finish.y - to.y);\r\n }", "@Override\r\n public void combattre(Creature c) {\r\n System.out.println(\"Tour de combat de \" + getNom() + \" :\");\r\n if (this.getPtMana() > 0) {\r\n this.setPtMana(this.getPtMana() - 1);\r\n Random rand = new Random();\r\n int success = rand.nextInt(100), distance;\r\n distance = this.getPos().distance(c.getPos());\r\n if (distance <= this.getDistAttMax()) {//On vérifie que l'on peut toucher l'adversaire\r\n if (success < this.getPourcentageMag()) { // L'attaque réussie\r\n c.setPtVie(c.getPtVie() - this.getDegAtt()); //on inflige des dégats à l'adversaire.\r\n System.out.println(\"Attaque réussie de \" + getNom() + \" : \" + this.getDegAtt() + \" dégats infligés.\");\r\n } else {\r\n System.out.println(\"Dans le vide!\");\r\n }\r\n } else {\r\n System.out.println(\"Trop loin.\");\r\n }\r\n } else {\r\n System.out.println(\"Oups... plus de mana.\");\r\n }\r\n }", "@Override\r\n\tpublic int calculateDistance(Attackable target, Attackable attacker) {\r\n\t\tint attackerPosX = attacker.getPosition().getX();\r\n\t\tint attackerPosY = attacker.getPosition().getY();\r\n\t\tint targetPosX = target.getPosition().getX();\r\n\t\tint targetPosY = target.getPosition().getY();\r\n\t\tif ((targetPosX <= attackerPosX+2 && targetPosY == attackerPosY) || (targetPosX <= attackerPosX-2 && targetPosY == attackerPosY)\r\n\t\t\t\t|| (targetPosX == attackerPosX && targetPosY <= attackerPosY+2) || (targetPosX == attackerPosX && targetPosY <= attackerPosY-2)\r\n\t\t\t\t|| (targetPosX <= attackerPosX+2 && targetPosY <= attackerPosY-2) || (targetPosX <= attackerPosX+2 && targetPosY <= attackerPosY+2)\r\n\t\t\t\t|| (targetPosX <= attackerPosX-2 && targetPosY <= attackerPosY-2) || (targetPosX <= attackerPosX-2 && targetPosY <= attackerPosY+2)){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "boolean moveCharacter(Player player, Location.Direction direction) {\n Location currentLocation = player.getLocation();\r\n //check to see if move is possible\r\n Location destination = currentLocation.compass(direction);\r\n if (destination != null)\r\n {\r\n currentLocation.exit(player);\r\n destination.enter(player);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n } \r\n }", "private float checkDistance(float d) {\r\n if (d < 0) {\r\n return 0f;\r\n }\r\n if (d > 1) {\r\n return 1f;\r\n }\r\n return d;\r\n }", "private static String checkMonster(Board board, Player hero) {\n String monsterId = null;\n int row = hero.getPlayerPosition()[1]; //hero's row position\n int col = hero.getPlayerPosition()[0]; //hero's column position\n if (hero.getCurrentSide().equals(\"up\")) { //Check up\n monsterId = board.getMonster(row - 1, col);\n } else if (hero.getCurrentSide().equals(\"right\")) { //Check right\n monsterId = board.getMonster(row, col + 1);\n } else if (hero.getCurrentSide().equals(\"down\")) { //Check down\n monsterId = board.getMonster(row + 1, col);\n } else if (hero.getCurrentSide().equals(\"left\")) { //Check left\n monsterId = board.getMonster(row, col - 1);\n }\n return monsterId;\n }", "public void driveToDistance(double distance) {\n //TODO\n }", "private boolean canMageHarrasing(Creature m) {\n return (heroC.getX() - m.getX()) * (heroC.getX() - m.getX()) == (heroC.getY() - m.getY()) * (heroC.getY() - m.getY());\n }", "private int computingDistance(Human human) {\n\n double coefficient = 1;\n if (human instanceof AmbulanceTeam) {\n coefficient = 0.90;\n } else if (human instanceof PoliceForce) {\n coefficient = 0.95;\n } else if (human instanceof FireBrigade) {\n coefficient = 0.97;\n } else {//human is instance of Civilian\n coefficient = 1;\n }\n\n\n return (int) (coefficient * Util.distance(human.getPosition(worldInfo.getRawWorld()).getLocation(worldInfo.getRawWorld()), worldInfo.getLocation(agentInfo.me())));\n }", "public void drive(double distance)\n {\n fuelInTank -= distance / fuelEfficiency; \n }", "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}", "public void move(int distance);", "public void doAttackMoove(Point player, int move){\n MoveAction action = new MoveAction();\n action.setSource(this.player);\n VisualArea tab[] = action.getVisualArea( this.engine.getGameInformation() );\n Point better = player;\n for( int i = 0 ; i < tab.length ; i++ ){\n if( team == 0 ){\n if( tab[i].getX() > better.getX() )better = tab[i];\n }else if ( team == 1 ) {\n if( tab[i].getX() < better.getX() )better = tab[i];\n }else{\n new JOptionPane(\"Error\");\n }\n action.setDestination(better);\n this.engine.performAction( action );\n }\n }", "private int distBetween(Cell u, Cell v) {\r\n\t\t\tint dist;\r\n\t\t\tint dx = u.col - v.col;\r\n\t\t\tint dy = u.row - v.row;\r\n\t\t\tif (diagonal.isSelected()) {\r\n\t\t\t\t// with diagonal movements\r\n\t\t\t\t// calculate 1000 times the Euclidean distance\r\n\t\t\t\tdist = (int) ((double) 1000 * Math.sqrt(dx * dx + dy * dy));\r\n\t\t\t} else {\r\n\t\t\t\t// without diagonal movements\r\n\t\t\t\t// calculate Manhattan distances\r\n\t\t\t\tdist = Math.abs(dx) + Math.abs(dy);\r\n\t\t\t}\r\n\t\t\treturn dist;\r\n\t\t}", "public static boolean pointDistribute(String str, MC hero) \n {\n Scanner scan = new Scanner (System.in); \n if (str.equalsIgnoreCase(\"N\") || str.equalsIgnoreCase(\"None\") || str.equalsIgnoreCase(\"Done\"))\n {\n return false; //if hero doesn't want to use points, he can just say none and method returns false to end\n }\n else if (str.equalsIgnoreCase(\"H\") || str.equalsIgnoreCase(\"Health\"))\n {\n System.out.print(\"Points to add on to health: \");\n int i = scan.nextInt();\n if (i <= hero.getPoints()) //if their points is greater or equal to how much they want to use\n {\n hero.setMaxHP(10*i + hero.getMaxHP()); //if so then the computer performs the action\n hero.setCurrentHP(hero.getMaxHP());\n hero.setPoints(hero.getPoints()-i);\n }\n else\n {System.out.println(\"Error. Limit to points.\" + \"\\n\");} //if not return that they have too little points\n }\n else if (str.equalsIgnoreCase(\"HL\") || str.equalsIgnoreCase(\"Heal\"))\n {\n System.out.print(\"Points to add on to raise heal: \");\n int i = scan.nextInt();\n if (i <= hero.getPoints()) //if their points is greater or equal to how much they want to use\n {\n hero.setMaxHeal(i + hero.getMaxHeal()); //if so then the computer performs the action\n hero.setMinHeal(i + hero.getMinHeal());\n hero.setPoints(hero.getPoints()-i);\n }\n else\n {System.out.println(\"Error. Limit to points.\" + \"\\n\");} //if not return that they have too little points\n }\n else if (str.equalsIgnoreCase(\"s\") || str.equalsIgnoreCase(\"strength\")) //same as health but with strength\n {\n System.out.print(\"Points to add on to strength: \");\n int i = scan.nextInt();\n if (i <= hero.getPoints())\n {\n hero.setStrength(hero.getStrength() + i);\n hero.setPoints(hero.getPoints()-i);\n }\n else\n {System.out.println(\"Error. Limit to points.\" + \"\\n\");} \n }\n else if (str.equalsIgnoreCase(\"a\") || str.equalsIgnoreCase(\"agility\"))\n {\n System.out.print(\"Points to add on to agility: \");\n int i = scan.nextInt();\n if (i <= hero.getPoints())\n {\n hero.setAgility(hero.getAgility() + i);\n hero.setPoints(hero.getPoints()-i);\n }\n else\n {System.out.println(\"Error. Limit to points.\" + \"\\n\");} \n }\n else if (str.equalsIgnoreCase(\"d\") || str.equalsIgnoreCase(\"defence\"))\n {\n System.out.print(\"Points to add on to defence: \");\n int i = scan.nextInt();\n if (i <= hero.getPoints())\n {\n hero.setDefence(hero.getDefence() + i);\n hero.setPoints(hero.getPoints()-i);\n }\n else\n {System.out.println(\"Error. Limit to points.\" + \"\\n\");}\n }\n else {return false;}\n if (hero.getPoints() == 0) //checks if they have 0 points, no more to use.\n {\n return false; //returns false if true\n }\n else\n {return true;} //else returns that they can use points again.\n }", "@Override\n\tpublic void move(Herbivore h, Plant p) {\n\t\tif(Flatland.distance(myX, myY, h.getX(), h.getY()) < 50){\n\t\t\tisHidden = false;\n\t\t\tmoveTowards(h.getX(), h.getY());\n\t\t\tmoveTowards(h.getX(), h.getY());\n\t\t\tmoveTowards(h.getX(), h.getY());\n\t\t\tmyColor = StdDraw.RED;\n\t\t}\n\t\telse{\n\t\t\tisHidden = true;\n\t\t\tmyX = myX;\n\t\t\tmyY = myY;\n\t\t\tmyColor = StdDraw.GREEN;\n\t\t}\n\t\t//if moved off screen, predator shows up on other side\n\t\tif(myX < 0){\n\t\t\tmyX = 1000;\n\t\t}\n\t\tif(myX > 1000){\n\t\t\tmyX = 0;\n\t\t}\n\t\tif(myY < 0){\n\t\t\tmyY = 1000;\n\t\t}\n\t\tif(myY > 1000){\n\t\t\tmyY = 0;\n\t\t}\n\t}", "void moveHero(int x, int y) {\n setOnTile(heroC.getX(), heroC.getY(), false);\n // vector needed to aim\n setVector(x, y, heroC);\n setLastXYArray(heroC);\n //Log.i(\"dan\", \"SET VECTOR TO : \" + heroC.getVector());\n creatures.get(0).setX(x);\n creatures.get(0).setY(y);\n setOnTile(x, y, true);\n paintSquare(-1, -1);\n checkHeroHarrasing();\n checkEnemyDeath();\n addTurn();\n enemyTurn();\n saveGame(context, level, turn, creatures);\n }", "private boolean canArcherHarrasing(Creature a) {\n return heroC.getX() == a.getX() || heroC.getY() == a.getY();\n }", "public void chase(int targetX, int targetY, ArrayList<Wall> listOfWalls, ArrayList<Point> intersections) {\n double minDistance = 5000000000.0; //no distance is greater than this 4head\r\n double upDistance = 500000000.0;\r\n double downDistance = 5000000.0;\r\n double leftDistance = 50000000.0;\r\n double rightDistance = 5000000.0;\r\n boolean isIntersection = checkIntersection(intersections);\r\n boolean isRightCollision = checkWallCollision(listOfWalls, 2);\r\n boolean isLeftCollision = checkWallCollision(listOfWalls, 3);\r\n boolean isUpCollision = checkWallCollision(listOfWalls, 0);\r\n boolean isDownCollision = checkWallCollision(listOfWalls, 1);\r\n\r\n if (isIntersection) {\r\n if (!isRightCollision && this.direction != 3) {\r\n rightDistance = Math.pow((xPos + 20) - targetX, 2) + Math.pow(yPos - targetY, 2);\r\n }\r\n if (!isLeftCollision && this.direction != 2) {\r\n leftDistance = Math.pow((xPos - 20) - targetX, 2) + Math.pow(yPos - targetY, 2);\r\n }\r\n if (!isUpCollision && this.direction != 1) {\r\n upDistance = Math.pow((xPos) - targetX, 2) + Math.pow((yPos - 20) - targetY, 2);\r\n }\r\n if (!isDownCollision && this.direction != 0) {\r\n downDistance = Math.pow((xPos) - targetX, 2) + Math.pow((yPos + 20) - targetY, 2);\r\n }\r\n if (upDistance <= downDistance && upDistance <= leftDistance && upDistance <= rightDistance) {\r\n this.direction = 0;\r\n } else if (downDistance <= upDistance && downDistance <= leftDistance && downDistance <= rightDistance) {\r\n this.direction = 1;\r\n } else if (rightDistance <= leftDistance && rightDistance <= downDistance && rightDistance <= upDistance) {\r\n this.direction = 2;\r\n } else if (leftDistance <= rightDistance && leftDistance <= upDistance && leftDistance <= downDistance) {\r\n this.direction = 3;\r\n }\r\n\r\n\r\n }\r\n\r\n if (this.direction == 0) {\r\n yPos = yPos - 5;\r\n }\r\n if (this.direction == 1) {\r\n yPos = yPos + 5;\r\n }\r\n if (this.direction == 2) {\r\n xPos = xPos + 5;\r\n }\r\n if (this.direction == 3) {\r\n xPos = xPos - 5;\r\n }\r\n\r\n }", "private int check_movimento(int x, int y, int choice) {\n\t\t//if sword\t\n\t\tif (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == 'E') {\n\t\t\tlabirinto.setLabCell(heroi.getX_coord(), heroi.getY_coord(), ' ');\n\t\t\theroi.setArmado(true);\n\t\t\tif (x == -1)\n\t\t\t\theroi.x_coord_dec();\n\t\t\telse if (x == 1)\n\t\t\t\theroi.x_coord_inc();\n\t\t\telse if (y == -1)\n\t\t\t\theroi.y_coord_dec();\n\t\t\telse\n\t\t\t\theroi.y_coord_inc();\n\t\t\tchange_hero_pos();\n\t\t}\n\t\t//if shield\n\t\telse if (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == 'O') {\n\t\t\tlabirinto.setLabCell(heroi.getX_coord(), heroi.getY_coord(), ' ');\n\t\t\theroi.setShielded(true);\n\t\t\tescudo.set_caught(true);\n\t\t\tif (x == -1)\n\t\t\t\theroi.x_coord_dec();\n\t\t\telse if (x == 1)\n\t\t\t\theroi.x_coord_inc();\n\t\t\telse if (y == -1)\n\t\t\t\theroi.y_coord_dec();\n\t\t\telse\n\t\t\t\theroi.y_coord_inc();\n\t\t\tchange_hero_pos();\n\t\t}\n\n\t\t//if dart\n\t\telse if (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == '\\\\') {\n\t\t\tlabirinto.setLabCell(heroi.getX_coord(), heroi.getY_coord(), ' ');\n\t\t\theroi.inc_dardos();\n\t\t\tcatch_dardo(heroi.getX_coord()+x,heroi.getY_coord()+y);\n\t\t\tif (x == -1)\n\t\t\t\theroi.x_coord_dec();\n\t\t\telse if (x == 1)\n\t\t\t\theroi.x_coord_inc();\n\t\t\telse if (y == -1)\n\t\t\t\theroi.y_coord_dec();\n\t\t\telse\n\t\t\t\theroi.y_coord_inc();\n\t\t\tchange_hero_pos();\n\t\t}\n\n\t\t//if blank space\n\t\telse if (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == ' ') {\n\t\t\tlabirinto.setLabCell(heroi.getX_coord(), heroi.getY_coord(), ' ');\n\t\t\tif (x == -1)\n\t\t\t\theroi.x_coord_dec();\n\t\t\telse if (x == 1)\n\t\t\t\theroi.x_coord_inc();\n\t\t\telse if (y == -1)\n\t\t\t\theroi.y_coord_dec();\n\t\t\telse\n\t\t\t\theroi.y_coord_inc();\n\t\t\tchange_hero_pos();\n\t\t}\n\n\t\t//if exit\n\t\telse if (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == 'S') {\n\t\t\tif (checkIfDragonsAreAlive() == false) {\n\t\t\t\tif (inter == 0) \n\t\t\t\t\tconsole_interface.way_out();\n\t\t\t\telse if (inter == 3) \n\t\t\t\t\tMazeDisplay.way_out();\n\t\t\t\telse {}\n\t\t\t\treturn 10;\t\t\t\t\t\t\t\t//finish the game\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (inter == 0)\t\n\t\t\t\t\tconsole_interface.dragon_still_alive();\n\t\t\t\telse if (inter == 3)\n\t\t\t\t\tMazeDisplay.dragon_still_alive();\n\t\t\t\telse {}\n\t\t\t\treturn 9;\t\t\t\t\t\t\t\t//there are dragons alive in the maze therefore the hero cannot exit \n\t\t\t}\n\t\t}\n\n\t\t//if dragon\n\t\telse if (labirinto.getLab()[heroi.getX_coord()+x][heroi.getY_coord()+y] == 'd')\n\t\t\tif (inter == 0) \n\t\t\t\tconsole_interface.dragon_sleeping();\n\t\t\telse if (inter == 3) \n\t\t\t\tMazeDisplay.dragon_sleeping();\n\t\t\telse {}\n\n\t\t//else/if wall\n\t\telse\n\t\t\tif (inter == 0)\t\n\t\t\t\tconsole_interface.wall();\n\t\t\telse if (inter == 3) \n\t\t\t\tMazeDisplay.wall();\n\t\t\telse {}\n\t\treturn choice;\n\t}", "private double getDistance(Vector2i tile, Vector2i goal) {\n\t\t double dx = tile.getX() - goal.getX();\n\t\t double dy = tile.getY() - goal.getY();\n\t\t return Math.sqrt(dx * dx + dy *dy); //distance \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}", "public static int heroAttack(String role) {\n int hAttack = 0;\n\n if (role.equalsIgnoreCase(\"воин\")) {\n\n hAttack = diceRoll() + 20;\n if ((diceRoll() >= 15) && (diceRoll() <= 20)) {\n hAttack = hAttack * 2;\n System.out.println(\"Вы наносите критический удар и \" + hAttack + \" урона\");\n }\n System.out.println(\"Вы наносите \" + hAttack + \" урона\");\n\n }\n if (role.equalsIgnoreCase(\"маг\")) {\n\n hAttack = diceRoll() + 30;\n if ((diceRoll() >= 15) && (diceRoll() <= 20)) {\n hAttack = hAttack * 2;\n System.out.println(\"Вы наносите критический удар и \" + hAttack + \" урона\");\n }\n System.out.println(\"Вы наносите \" + hAttack + \" урона\");\n }\n if (role.equalsIgnoreCase(\"разбойник\")) {\n\n hAttack = diceRoll() + 20;\n if ((diceRoll() >= 15) && (diceRoll() <= 20)) {\n hAttack = hAttack * 2;\n System.out.println(\"Вы наносите критический удар и \" + hAttack + \" урона\");\n }\n System.out.println(\"Вы наносите \" + hAttack + \" урона\");\n }\n return hAttack;\n }", "public void setDistance(float dist);", "private boolean distanciaPuntos(int x, int y, int di){\r\n\t\tdouble distancia = Math.sqrt((x-this.x)*(x-this.x) + (y-this.y)*(y-this.y));\r\n\t\treturn distancia <= (di+this.diameter);\r\n\t}", "void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }", "void measure_small_object() {\n down_angle=Math.abs(down_angle);\n up_angle=Math.abs(up_angle);\n double distance_angle=90-down_angle;\n distance_from_object = human_length*Math.tan(Math.toRadians(distance_angle));\n double part_of_my_tall=distance_from_object*Math.tan(Math.toRadians(up_angle));\n length_of_object=human_length-part_of_my_tall;\n if(length_of_object/100>0) {\n ORI.setText(\"length_of_object :\\n\" + String.valueOf(String.format(\"%.2f\", (length_of_object / 100)) + \" M\" +\n \"\\n\" + \"distance_from_object :\\n\" + String.valueOf(String.format(\"%.2f\", (distance_from_object / 100))) + \" M\"));\n ORI.setVisibility(View.VISIBLE);\n }\n else {\n Toast.makeText(Online.this, \"Move Forward\", Toast.LENGTH_LONG).show();\n down_angle = 0;\n up_angle = 0;\n touch_ground_switch.setVisibility(View.VISIBLE);\n }\n\n }", "int distanceMan(Coord other) {\n\t\tint deltaX = abs(x - other.x);\n\t\tint deltaY = abs(y - other.y);\n\t\treturn deltaX + deltaY;\n\t}", "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 }", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "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 }", "@Test\r\n\tpublic void testDistancia0() \r\n\t{\r\n\t\tAssert.assertEquals(1.41, new Ponto(3,3).dist(new Ponto(4,2)), EPSILON);\r\n\t\tAssert.assertEquals(26.20, new Ponto(-7,-4).dist(new Ponto(17,6.5)), EPSILON);\t\r\n\t\tAssert.assertEquals(0.00, new Ponto(0,0).dist(new Ponto(0,0)), EPSILON);\t\r\n\t}", "public void move(Mob mob) {\n double x = mob.getxPos() - xPos;\n double y = mob.getyPos() - yPos;\n if (x < 18 && x > -18 && y < 18 && y > -18) {\n mob.reduceHealth(damage);\n hasHit = true;\n } else {\n double distancesq = x * x + y * y;\n double distance = Math.sqrt(distancesq);\n xPos += speed * x / distance;\n yPos += speed * y / distance;\n }\n }", "private void collide() {\n int collisionRange;\n \n if(isObstacle) {\n for(Thing thg: proximity) {\n if(\n thg.isObstacle\n &&\n !thg.equals(this)\n ) {\n collisionRange = (thg.size + this.size)/2;\n deltaA = this.distance(thg);\n \n if( \n Math.abs(deltaA[0]) <= collisionRange\n &&\n Math.abs(deltaA[1]) <= collisionRange\n ){\n if(deltaA[0] > deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == 1) {\n dA[0] = 0;\n }\n }\n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == -1) {\n dA[1] = 0;\n }\n }\n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n if(dA[0] != 0) {\n dA[1] = dA[0];\n }\n if(dA[1] != 0) {\n dA[0] = dA[1];\n }\n }\n }\n \n if(deltaA[0] < deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == -1) {\n dA[0] = 0;\n }\n } \n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == 1) {\n dA[1] = 0;\n }\n } \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = dA[0];\n }\n }\n \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = -dA[0];\n }\n }\n }\n }\n }\n }", "public void move() {\n health -= 2; //health decrement\n age++; //age increment\n if (yPos > 300) {\n speed += 3;\n }\n boolean canMove = false;\n int distancex = (int) (Math.random() * speed);\n int distancey = (int) (Math.random() * speed);\n int counterx = r.nextInt(2);\n int countery = r.nextInt(2);\n while (!canMove) {\n distancex = (int) (Math.random() * speed);\n distancey = (int) (Math.random() * speed);\n counterx = r.nextInt(2);\n countery = r.nextInt(2);\n if (counterx == 0 && this.xPos - distancex > 0\n && countery == 0 && this.yPos - distancey > 0) {\n canMove = true;\n } else if (counterx == 1 && this.xPos + distancex < 510\n && countery == 1 && this.yPos + distancey < 530) {\n canMove = true;\n }\n }\n if (counterx == 0 && countery == 0) {\n xPos -= distancex;\n yPos -= distancey;\n } else if (counterx == 0 && countery == 1) {\n xPos -= distancex;\n yPos += distancey;\n } else if (counterx == 1 && countery == 0) {\n xPos += distancex;\n yPos -= distancey;\n } else if (counterx == 1 && countery == 1) {\n xPos += distancex;\n yPos += distancey;\n }\n }", "boolean resultingCellHasCreature(MazePoint point, Direction dir,\r\n CreatureType creatureType, int distance);", "public void elementosMapa() {\n\t\t\n\t\tHeroes heroe = (Heroes) ven.getHeroe();\n\t\t\n\t\tif(heroe.getPosX() >= 250 && heroe.getPosX() <= 302 && heroe.getPosY() >= 208 && heroe.getPosY() <= 255 && pregunta1 == false) {\n\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Cuántas transformaciones sufre Freezer?\" + \"\\n\" + \"a) 4\" + \"\\n\" + \"b) 5\" + \"\\n\" + \"c) 2\");\n\t\t\t\n\t\t\tif(respuesta == null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthrow new RespuestaNulaException();\n\t\t\t\t} catch (RespuestaNulaException e) {\n\t\t\t\t\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\n\t\t\telse if(respuesta.equalsIgnoreCase(\"a\")) {\n\t\t\t\t\n\t\t\t\tpregunta1 = true;\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es correcta, acabas de ganar una nueva esfera :D\");\n\t\t\t\tven.modificarEsfera(2);\n\t\t\t\tven.actualizarInfo();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta != \"a\") {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es incorrecta :(\");\n\t\t\t\theroe.setPosX(281); \n\t\t\t\theroe.setPosY(311);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\telse if(heroe.getPosX() >= 1148 && heroe.getPosX() <= 1202 && heroe.getPosY() >= 33 && heroe.getPosY() <= 84 && pregunta2 == false) {\n\t\t\t\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Quién logró liberar la espada Z?\" + \"\\n\" + \"a) Goten\" + \"\\n\" + \"b) Goku\" + \"\\n\" + \"c) Gohan\");\n\t\t\t\n\t\t\tif(respuesta == null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthrow new RespuestaNulaException();\n\t\t\t\t} catch (RespuestaNulaException e) {\n\t\t\t\t\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\n\t\t\telse if(respuesta.equalsIgnoreCase(\"c\")) {\n\t\t\t\t\n\t\t\t\tpregunta2 = true;\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es correcta, acabas de ganar una nueva esfera\");\n\t\t\t\tven.modificarEsfera(4);\n\t\t\t\tven.actualizarInfo();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta != \"a\") {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es incorrecta :(\");\n\t\t\t\theroe.setPosX(1280);\n\t\t\t\theroe.setPosY(119);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse if(heroe.getPosX() >= 50 && heroe.getPosX() <= 103 && heroe.getPosY() >= 558 && heroe.getPosY() <= 607 && pregunta3 == false) {\n\t\t\t\n\t\t\t\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Quién es hijo de Paragus?\" + \"\\n\" + \"a) Bardock\" + \"\\n\" + \"b) Broly\" + \"\\n\" + \"c) Freezer\");\n\t\t\t\n\t\t\tif(respuesta == null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthrow new RespuestaNulaException();\n\t\t\t\t} catch (RespuestaNulaException e) {\n\t\t\t\t\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\n\t\t\telse if(respuesta.equalsIgnoreCase(\"b\")) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tpregunta3 = true;\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es correcta, acabas de ganar una nueva esfera :D\");\n\t\t\t\tven.modificarEsfera(6);\n\t\t\t\tven.actualizarInfo();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta != \"b\") {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es incorrecta :(\");\n\t\t\t\theroe.setPosX(135);\n\t\t\t\theroe.setPosY(593);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\telse if(heroe.getPosX() >= 70 && heroe.getPosX() <= 130 && heroe.getPosY() >= 1 && heroe.getPosY() <= 55 && pregunta4 == false) {\n\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Quién se convirtío primero en SSJ2?\" + \"\\n\" + \"a) Goku\" + \"\\n\" + \"b) Trunks\" + \"\\n\" + \"c) Gohan\");\n\t\t\t\n\t\t\tif(respuesta == null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthrow new RespuestaNulaException();\n\t\t\t\t} catch (RespuestaNulaException e) {\n\t\t\t\t\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\n\t\t\telse if(respuesta.equalsIgnoreCase(\"c\")) {\n\t\t\t\t\n\t\t\t\tpregunta4 = true;\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es correcta, has aumentado el poder de tus ataques :D\");\n\t\t\t\theroe.setAtaque1(20);\n\t\t\t\theroe.setAtaque2(20);\n\t\t\t\theroe.setAtaque3(20);\n\t\t\t\theroe.setAtaqueEspecial(20);\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta != \"c\") {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es incorrecta :(\");\n\t\t\t\theroe.setPosX(208); \n\t\t\t\theroe.setPosY(47);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\n\t\telse if(heroe.getPosX() >= 585 && heroe.getPosX() <= 640 && heroe.getPosY() >= 258 && heroe.getPosY() <= 310 && pregunta5 == false) {\n\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Quién mantuvo su cola hasta la muerte?\" + \"\\n\" + \"a) Vegeta\" + \"\\n\" + \"b) Bardock\" + \"\\n\" + \"c) Gohan\");\n\t\t\t\n\t\t\tif(respuesta == null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthrow new RespuestaNulaException();\n\t\t\t\t} catch (RespuestaNulaException e) {\n\t\t\t\t\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\n\t\t\telse if(respuesta.equalsIgnoreCase(\"b\")) {\n\t\t\t\t\n\t\t\t\tpregunta5 = true;\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es correcta, has aumentado el poder de tus ataques :D\");\n\t\t\t\theroe.setAtaque1(20);\n\t\t\t\theroe.setAtaque2(20);\n\t\t\t\theroe.setAtaque3(20);\n\t\t\t\theroe.setAtaqueEspecial(20);\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta != \"b\") {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"La respuesta es incorrecta :(\");\n\t\t\t\theroe.setPosX(577); \n\t\t\t\theroe.setPosY(356);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\telse if(heroe.getPosX() >= 396 && heroe.getPosX() <= 444 && heroe.getPosY() >= 230 && heroe.getPosY()<= 300 && Broly == false) {\n\t\t\t\n\t\t\tVillanos villano = (Villanos) ven.getJuego().getHeroe(\"Broly\");\n\t\t\tvillanoActual = \"Broly\";\n\t\t\t\n\t\t\tint resp = JOptionPane.showConfirmDialog(null,\"Broly: \" + villano.getFrasePelea() + \"\\n\" + \"\\n\" + \"¿Desea pelear para ganar una esfera?\" , \"Batallar\", JOptionPane.YES_NO_OPTION);\n\n\t\t\tif(resp == JOptionPane.YES_OPTION) {\n\n\t\t\t\tven.getBatalla().getFondo().setImagenRuta(\"Datos/Fondos/FondoBatalla3.jpg\");\n\t\t\t\theroe.setVida(500);\n\t\t\t\tvillano.setVida(500);\n\t\t\t\tven.visualizarBatalla();\n\t\t\t\theroe.setPosX(414);\n\t\t\t\theroe.setPosY(352);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}else if(resp == JOptionPane.NO_OPTION) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Debes pelear para ganar una esfera :(\");\n\t\t\t\theroe.setPosX(414);\n\t\t\t\theroe.setPosY(352);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(heroe.getPosX() >= 1235 && heroe.getPosX() <= 1295 && heroe.getPosY() >= 290 && heroe.getPosY() <= 360 && Freezer == false) {\n\t\t\tVillanos villano = (Villanos) ven.getJuego().getHeroe(\"Freezer\");\n\t\t\tvillanoActual = \"Freezer\";\n\t\t\t\n\t\t\tint resp = JOptionPane.showConfirmDialog(null,\"Freezer: \" + villano.getFrasePelea() + \"\\n\" + \"\\n\" + \"¿Desea pelear para ganar una esfera?\" , \"Batallar\", JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(resp == JOptionPane.YES_OPTION) {\n\n\t\t\t\tven.getBatalla().getFondo().setImagenRuta(\"Datos/Fondos/FondoBatalla2.png\");\n\t\t\t\theroe.setVida(500);\n\t\t\t\tvillano.setVida(500);\n\t\t\t\tven.visualizarBatalla();\n\t\t\t\theroe.setPosX(1279);\n\t\t\t\theroe.setPosY(229);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}else if(resp == JOptionPane.NO_OPTION) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Debes pelear para ganar una esfera :(\");\n\t\t\t\theroe.setPosX(1279);\n\t\t\t\theroe.setPosY(229);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse if(heroe.getPosX() >= 1015 && heroe.getPosX() <= 1067 && heroe.getPosY() >= 7 && heroe.getPosY() <= 57 && MajinB == false) {\n\t\t\tVillanos villano = (Villanos) ven.getJuego().getHeroe(\"Majin boo\");\n\t\t\tvillanoActual = \"Majin boo\";\n\t\t\t\n\t\t\tint resp = JOptionPane.showConfirmDialog(null,\"Majin boo: \" + villano.getFrasePelea() + \"\\n\" + \"\\n\" + \"¿Desea pelear para ganar una esfera?\" , \"Batallar\", JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(resp == JOptionPane.YES_OPTION) {\n\n\t\t\t\tven.getBatalla().getFondo().setImagenRuta(\"Datos/Fondos/FondoBatalla4.jpg\");\n\t\t\t\theroe.setVida(500);\n\t\t\t\tvillano.setVida(500);\n\t\t\t\tven.visualizarBatalla();\n\t\t\t\theroe.setPosX(1020);\n\t\t\t\theroe.setPosY(106);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}else if(resp == JOptionPane.NO_OPTION) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Debes pelear para ganar una esfera :(\");\n\t\t\t\theroe.setPosX(1020);\n\t\t\t\theroe.setPosY(106);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else if(heroe.getPosX() >= 222 && heroe.getPosX() <= 294 && heroe.getPosY() >= 480 && heroe.getPosY() <= 560 && Cell == false) {\n\t\t\tVillanos villano = (Villanos) ven.getJuego().getHeroe(\"Cell\");\n\t\t\tvillanoActual = \"Cell\";\n\t\t\t\n\t\t\tint resp = JOptionPane.showConfirmDialog(null,\"Cell: \" + villano.getFrasePelea() + \"\\n\" + \"\\n\" + \"¿Desea pelear para ganar una esfera?\" , \"Batallar\", JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(resp == JOptionPane.YES_OPTION) {\n\n\t\t\t\tven.getBatalla().getFondo().setImagenRuta(\"Datos/Fondos/FondoBatalla.jpg\");\n\t\t\t\theroe.setVida(500);\n\t\t\t\tvillano.setVida(500);\n\t\t\t\tven.visualizarBatalla();\n\t\t\t\theroe.setPosX(364);\n\t\t\t\theroe.setPosY(583);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}else if(resp == JOptionPane.NO_OPTION) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Debes pelear para ganar una esfera :(\");\n\t\t\t\theroe.setPosX(364);\n\t\t\t\theroe.setPosY(583);\n\t\t\t\tven.actualizarMapa();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}else if(heroe.getPosX() >= 900 && heroe.getPosX() <= 988 && heroe.getPosY() >= 314 && heroe.getPosY() <= 421) {\n\t\t\t\n\t\t\theroe.setPosX(956);\n\t\t\theroe.setPosY(484);\n\t\t\t\n\t\t\tString respuesta = JOptionPane.showInputDialog(this, \"¿Qué deseas hacer \" + ven.getNombreUsuario() + \"?\" + \"\\n\" + \"a) Guardar puntaje\" + \"\\n\" + \"b) Ver información de los personajes\" + \"\\n\" + \"c) Ver puntajes\");\n\t\t\tif(respuesta.equalsIgnoreCase(\"a\")) {\n\t\t\t\t\n\t\t\t\tven.guardarPuntaje();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else if(respuesta.equalsIgnoreCase(\"c\")){\n\t\t\t\tven.cargarPuntajes();\n\t\t\t\tven.visualizarPuntajes();\n\t\t\t}\n\t\t\t\n\t\t\telse if(respuesta.equalsIgnoreCase(\"b\")) {\n\t\t\t\t\n\t\t\t\tString per = JOptionPane.showInputDialog(this, \"¿De qué personaje deseas ver la información \" + ven.getNombreUsuario() + \"\\n\" + \"a) Goku\" + \"\\n\" + \"b) Roshi\" + \"\\n\" + \"c) Vegeta\" + \"\\n\" + \"d) Freezer\" + \"\\n\" + \"e) Cell\" + \"\\n\" + \"f) Majin boo\" + \"\\n\" + \"g) Broly\");\n\t\t\t\t\n\t\t\t\tif(per.equalsIgnoreCase(\"a\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Goku\");\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"b\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Roshi\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"c\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Vegeta\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"d\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Freezer\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"e\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Cell\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"f\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Majin boo\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(per.equalsIgnoreCase(\"g\")) {\n\t\t\t\t\t\n\t\t\t\t\tven.mostrarInfoPersonajes(\"Broly\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\ttry {\n\t\t\t\t\tthrow new CaracterEquivocadoException();\n\t\t\t\t} catch (CaracterEquivocadoException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void target() {\n\t\t// find distance to flower\n\t\tdouble dist = grid.getDistance(grid.getLocation(this),\n\t\t\t\t\t\t\t\t\t grid.getLocation(targetFlower));\n\t\t// if close to flower start harvesting nectar\n\t\tif(dist < 3) {\n\t\t\tstate = \"HARVESTING\";\n\t\t}\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\telse if(dist > 200){\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// else keep moving toward flower\n\t\telse{\n\t\t\tmoveTowards(grid.getLocation(targetFlower), 3);\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "@Override\n\tpublic int getDistanceFrom(final SabrePlayer other) {\n\t\tGuard.ArgumentNotNull(other, \"other\");\n\t\t\n\t\tif (!isOnline() || !other.isOnline()) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tLocation myLocation = bukkitPlayer.getLocation();\n\t\tLocation otherLocation = other.getBukkitPlayer().getLocation();\n\t\tint dx = otherLocation.getBlockX() - myLocation.getBlockX();\n\t\tint dz = otherLocation.getBlockZ() - myLocation.getBlockZ();\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow(dx, 2) + Math.pow(dz, 2));\n\t}", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "public void dirigirHaciaPunto(int x, int y){ \r\n\r\n\tint coordenadaXObjetivo;\r\n\tint coordenadaYObjetivo;\r\n\tint distanciaEnX;\r\n\tint distanciaEnY;\r\n\tint incrementoDesplazamiento = 1;\t\t\r\n\t\t\t\t\t\t\r\n\tcoordenadaXObjetivo = x;\t\r\n\tdistanciaEnX = coordenadaXObjetivo - this.x;\r\n\t\t\t\t\t\r\n\tcoordenadaYObjetivo = y;\t\r\n\tdistanciaEnY = coordenadaYObjetivo - this.y;\r\n\t\r\n\tif(distanciaEnX <= 0){\r\n\t\tif (distanciaEnX == 0){\r\n\t\t\tif(distanciaEnY < 0){\r\n\t\t\t\tthis.y -= incrementoDesplazamiento; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tif(distanciaEnY <= 0){\r\n\t\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.x -= incrementoDesplazamiento;\r\n\t\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\telse{\r\n\t\tif(distanciaEnY <= 0){\r\n\t\t\tif(distanciaEnY == 0){\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse{\r\n\t\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\t\tthis.y -= incrementoDesplazamiento;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\tthis.x +=incrementoDesplazamiento;\r\n\t\t\tthis.y += incrementoDesplazamiento;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((this.x >= x - incrementoDesplazamiento) && (this.x <= x + incrementoDesplazamiento) && \r\n\t\t\t(this.y >= y - incrementoDesplazamiento) && (this.y <= y + incrementoDesplazamiento)){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.entroAlCirculo = true;\r\n\t\t\r\n\t\t}\t\t\t\t\t\t\t\t\t\r\n\t}", "private void set_distance() {\n int[] k = new int[getQueue().length];\n distance = 0.0;\n for (int i = 1; i < getQueue().length; i++) {\n distance += getPoints().get(way[i]).distance(getPoints().get(way[i - 1]));\n }\n distance += getPoints().get(getQueue()[getPoints().size() - 1]).distance(getPoints().get(0));\n enterd = true;\n }", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public void act(Person hero)\r\n { \r\n // dead people can't act\r\n if (room != null)\r\n {\r\n if(Game.random(5)==0)\r\n {\r\n if (type == MONSTER) \r\n eat(hero);\r\n else \r\n attack(hero);\r\n }\r\n }\r\n }", "private Actor nearestThreat(float search_distance) {\n\t\t//ArrayList<Actor> threats = new ArrayList<Actor>();\n\t\tPriorityQueue<Actor> threats = new PriorityQueue<Actor>(10, new RiskAssessor());\n\n\t\tfor (Actor a: Actor.actors) {\n\t\t\t// Don't be scared of yourself\n\t\t\tif (a == this)\n\t\t\t\tcontinue;\n\n\t\t\t// do not consider these types threats\n\t\t\tif (a instanceof PowerUp)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t// Do not consider our own bullets threats\n\t\t\tif (a instanceof Bullet || a.parentId == id)\n\t\t\t\tcontinue;\n\n\t\t\tVector displacement = position.differenceOverEdge(a.position);\n\n\t\t\tif (displacement.magnitude2() > search_distance * search_distance)\n\t\t\t\tcontinue;\n\n\t\t\t// If the threat is a player we do not continue a threat until we are much closer\n\t\t\tif (a instanceof PlayerShip &&\n\t\t\t\t\tdisplacement.magnitude2() > MIN_PLAYER_SHIP_DISTANCE * MIN_PLAYER_SHIP_DISTANCE)\n\t\t\t\tcontinue;\n\n\t\t\tthreats.add(a);\n\t\t}\n\n\t\tswitch(threats.size()) {\n\t\tcase(0):\n\t\t\treturn null;\n\t\tdefault:\n\t\t\treturn threats.remove();\n\t\t}\n\t}", "@Override\n public int estimatedDistanceToGoal() {\n return manhattan();\n }", "public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }", "@Override\n public int damageCalculator(final Heroes enemy, final Heroes hero) {\n float landModifier;\n int firstAbilityDamage;\n int secondAbilityDamage;\n if (enemy.getLocation().equals(\"V\")) {\n landModifier = factory.getLandModifiers(\"V\");\n } else {\n landModifier = LandModifiersFactory.getNoModifiers();\n }\n firstAbilityDamage = Math.round(landModifier * (factory.getAllDamages(\"fireblast\")\n + hero.getLevel() * factory.getAllLevelDamages(\"fireblast\")));\n secondAbilityDamage = Math.round(landModifier * (factory.getAllDamages(\"ignite\")\n + hero.getLevel() * factory.getAllLevelDamages(\"ignite\")));\n //retin damage-ul fara modificatori in caz ca adversarul este wizard\n enemy.setDamageReceived(firstAbilityDamage + secondAbilityDamage);\n firstAbilityDamage = Math.round(firstAbilityDamage\n * hero.getRaceModifiers1(enemy.getTypeOfHero()));\n secondAbilityDamage = Math.round(secondAbilityDamage\n * hero.getRaceModifiers2(enemy.getTypeOfHero()));\n //ii setez damage overtime\n enemy.setIgniteOvertimeDamage(2);\n return firstAbilityDamage + secondAbilityDamage;\n }", "@Override\n protected float duration(final float distance) {\n if (distance < 100) {\n return 0.15f;\n } else if (distance < 200) {\n return 0.3f;\n } else if (distance < 300) {\n return 0.45f;\n } else if (distance < 400) {\n return 0.6f;\n } else if (distance < 500) {\n return 0.75f;\n } else if (distance < 600) {\n return 0.9f;\n }\n return 1.1f;\n }", "@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }", "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "protected boolean findTarget(){\n\t\t// shoot units\n\t\tfloat tmpDist = -1;\n\t\tUnit tmpUnit = null;\n\t\tfor(Unit u:Game.map.get(tileId).unitMap){ // loop through units on\n\t\t\t\t\t\t\t\t\t\t\t\t\t// maptile\n\t\t\tif(this.id == u.id)\n\t\t\t\tcontinue;\n\t\t\tif(this.ownerId == u.ownerId)\n\t\t\t\tcontinue;\n\t\t\tif(u.dead)\n\t\t\t\tcontinue;\n\t\t\tVector3f tmp = Vector3f.sub(this.modelPos, u.modelPos, null);\n\t\t\tif(tmpDist == -1 || tmp.length() < tmpDist){\n\t\t\t\ttmpUnit = u;\n\t\t\t\ttmpDist = tmp.length();\n\t\t\t}else\n\t\t\t\tcontinue;\n\t\t}\n\t\tif(tmpDist != -1 && tmpDist <= range && tmpUnit != null){\n\t\t\tthis.hostile = tmpUnit;\n\t\t\tthis.target = this.hostile.modelPos;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void func_180430_e(float distance, float damageMultiplier) {}", "public Long calculateDistanceVision() {\n return this.getVision() + lazyPlayboardActor.get().getCarte().getCarte().getValue(this.point).getVisionAdvantage();\n }", "@Override\n\tpublic boolean step(){\n\t\tboolean ret=false;\n\t\tif(!isFollowing()){\n\t\t\t//80% valoszinuseggel leptet egy szomszedra\n\t\t\tRandom rng=new Random();\n\t\t\tboolean doAStep =rng.nextInt(10)>1;\n\t\t\tif(doAStep){\n\t\t\t\tif(tile != null){\n\t\t\t\tint bound=tile.getNeighbors().size();\n\t\t\t\t//System.out.println(\"bound :\"+bound);\n\t\t\t\t//System.out.println(\"ez lett a bound: \"+rng.nextInt(bound));\n\t\t\t\tret=step(tile.getNeighbors().get(rng.nextInt(bound)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "double getDistance();", "public void verificaCoordenada() {\r\n\t\tif (X < 0) {\r\n\t\t\tX = Const.TAMANHO - 1;\r\n\t\t} else {\r\n\t\t\tX = X % Const.TAMANHO;\r\n\t\t}\r\n\r\n\t\tif (Y < 0) {\r\n\t\t\tY = Const.TAMANHO - 1;\r\n\t\t} else {\r\n\t\t\tY = Y % Const.TAMANHO;\r\n\t\t}\r\n\t}", "public boolean isInRangeToRenderDist(double distance) {\n/* 38 */ return (distance < 4096.0D);\n/* */ }", "@Override\n public final void move() {\n int x = getPosisi().getX();\n int y = getPosisi().getY();\n int dx = 0, dy = 0;\n\n if (getWaktu() % getDeltaTime() == 0) {\n do {\n do {\n Random randomGenerator = new Random();\n dx = randomGenerator.nextInt(N_RAND) - 1;\n dy = randomGenerator.nextInt(N_RAND) - 1;\n } while (dx == 0 && dy == 0);\n } while (x + dx < 0 || x + dx > getWorldSize() - 1\n || y + dy < 0 || y + dy > getWorldSize() - 1);\n }\n setPX(x + dx);\n setPY(y + dy);\n }", "protected void wander() {\n\t\tfor(int i=3;i>0;){\n\t\t\tfindChest();\n\t\t\tint num = ((int) (Math.random()*100)) % 4;\n\t\t\tswitch (num+1){\n\t\t\t\tcase 1 :\n\t\t\t\t\tif(!(character.xOfFighter-1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())\n\t\t\t\t\t\t\t&&game.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter-1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter-1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter-1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 :\n\t\t\t\t\tif(!(character.xOfFighter+1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter+1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter+1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter+1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfindChest();\n\t}", "public void getMissDistance() {\n missDistance = targetDistance - projDistance;\n }", "public static boolean isGivenSafe(int dist, int durat, int exhal)\r\n\t{\r\n\t\tif (dist == 13 && durat == 30 && exhal == 30) return true;\r\n\t\telse if (dist == 6 && durat == 30 && exhal == 10) return true;\r\n\t\telse if (dist == 27 && durat == 30 && exhal == 50) return true;\r\n\t\telse if (dist == 13 && durat == 15 && exhal == 50) return true;\r\n\t\telse if (dist == 13 && durat == 120 && exhal == 10) return true;\r\n\t\telse if (dist == 27 && durat == 120 && exhal == 30) return true;\r\n\t\telse if (dist == 6 && durat == 15 && exhal == 30) return true;\r\n\t\telse { return false;}\r\n\t}", "private void deslocarBloco(double dist) {\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < distance * 10.0) {\r\n\t\t\t\t\tsendData(\"U\");\t\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsendData(\"u\");\r\n\t\t\t\t\r\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < 1000.0) {\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t}", "public float getDistance();", "private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}", "public static void applyPhysics(Drone drone, float dt) throws DroneCrashException, MaxAoAException {\r\n\t\t\r\n\t\t// stepsize bepalen\r\n\t\tfloat h;\r\n\t\tif (dt - drone.getPredictionMethod().getStepSize() >= 0) {\r\n\t\t\th = drone.getPredictionMethod().getStepSize();\r\n\t\t} else if (dt > 0) {\r\n\t\t\th = dt;\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t// huidige versnellingen bepalen\r\n\t\tVector3f[] currentAccelerationsW = calculateAccelerations(drone, h);\r\n\t\t\r\n\t\t// snelheid voorspellen in functie van de huidige vernsellingen en posities\r\n\t\tVector3f[] newVelocities = drone.getPredictionMethod().predictVelocity(drone.getLinearVelocity(), drone.getAngularVelocity(), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcurrentAccelerationsW[0], currentAccelerationsW[1], h);\r\n\t\t\r\n\t\t// nieuwe positie berekenen aan de hand van de nieuwe snelheid\r\n\t\tVector3f[] deltaPositions = calculatePositionDifferences(drone, newVelocities, h);\r\n\r\n\t\t// nieuwe snelheid opslaan\r\n\t\tdrone.setLinearVelocity(newVelocities[0]);\r\n\t\tdrone.setAngularVelocity(newVelocities[1]);\r\n\r\n\t\t// translatie en rotatie uitvoeren\r\n\t\tdrone.translate(deltaPositions[0]);\r\n\r\n\t\tif (!deltaPositions[1].equals(new Vector3f(0, 0, 0))) {\r\n\t\t\tVector3f rotationAxis = new Vector3f(0, 0, 0);\r\n\t\t\tdeltaPositions[1].normalise(rotationAxis);\r\n\t\t\tdrone.rotate(deltaPositions[1].length(), rotationAxis);\r\n\t\t}\r\n\r\n\t\t// checken of de drone crasht\r\n\t\tVector3f leftWingCenterOfMass = new Vector3f(0,0,0);\r\n\t\tVector3f.add(drone.transformToWorldFrame(drone.getLeftWing().getCenterOfMass()), drone.getPosition(), leftWingCenterOfMass);\r\n\t\tVector3f rightWingCenterOfMass = new Vector3f(0,0,0);\r\n\t\tVector3f.add(drone.transformToWorldFrame(drone.getRightWing().getCenterOfMass()),drone.getPosition(), rightWingCenterOfMass);\r\n\t\t\r\n\t\tif (drone.transformToWorldFrame(drone.getEnginePosition()).y + drone.getPosition().y <=\tgroundLevel) {\r\n\t\t\tthrow new DroneCrashException(\"Drone Crashed: the engine hit the ground!\");\r\n\t\t} if (drone.transformToWorldFrame(drone.getTailMassPosition()).y + drone.getPosition().y <= groundLevel) {\r\n\t\t\tthrow new DroneCrashException(\"Drone Crashed: the tail hit the ground!\");\r\n\t\t} if (leftWingCenterOfMass.y + drone.getPosition().y <= groundLevel) {\r\n\t\t\tthrow new DroneCrashException(\"Drone Crashed: the left wing hit the\tground!\");\r\n\t\t} if (rightWingCenterOfMass.y + drone.getPosition().y <= groundLevel) {\r\n\t\t\tthrow new DroneCrashException(\"Drone Crashed: the right wing hit the ground!\");\r\n\t\t}\r\n\t\tfor (Tyre tyre : drone.getTyres()) {\r\n\t\t\tif (tyre.getRadius() < tyre.getCompression()) {\r\n\t\t\t\tthrow new DroneCrashException(\"Drone Crashed: tyre compressed too much!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// recursieve oproep\r\n\t\tPhysicsEngine.applyPhysics(drone, (dt - h));\r\n\t}", "private boolean isEnPassant(Move move){\n if (super.player() == Player.WHITE){\n if (move.fromRow == 6){\n return true;\n }\n }else{\n if (move.fromRow == 1){\n return true;\n }\n }\n return false;\n }", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "public void act() \n {\n World myWorld = getWorld();\n \n Mapa mapa = (Mapa)myWorld;\n \n EnergiaMedicZ vidaMZ = mapa.getEnergiaMedicZ();\n \n EnergiaGuerriZ vidaGZ = mapa.getEnergiaGuerriZ();\n \n EnergiaConstrucZ vidaCZ = mapa.getEnergiaConstrucZ();\n \n GasZerg gasZ = mapa.getGasZerg();\n \n CristalZerg cristalZ = mapa.getCristalZerg();\n \n BunkerZerg bunkerZ = mapa.getBunkerZerg();\n \n Mina1 mina1 = mapa.getMina1();\n Mina2 mina2 = mapa.getMina2();\n Mina3 mina3 = mapa.getMina3();\n \n \n //movimiento del personaje\n if(Greenfoot.isKeyDown(\"b\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }\n }\n else if(Greenfoot.isKeyDown(\"z\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }}\n //encuentro con objeto\n \n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"s\"))\n {\n setLocation(getX(),getY()-1);\n }\n \n \n //probabilida de daño al enemigo\n \n if(isTouching(MedicTerran.class) && Greenfoot.getRandomNumber(100)==3)\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n if(isTouching(ConstructorTerran.class) && (Greenfoot.getRandomNumber(100)==3 ||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n if(isTouching(GuerreroTerran.class) && (Greenfoot.getRandomNumber(100)==3||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1||Greenfoot.getRandomNumber(100)==4||Greenfoot.getRandomNumber(100)==5))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n \n \n //encuentro con Bunker\n \n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"s\"))\n \n {\n setLocation(getX(),getY()-1);\n }\n \n //AccionesUnicas\n \n if(isTouching(YacimientoDeGas.class) && gasZ.gasZ < 100)\n {\n \n gasZ.addGasZ();\n \n }\n \n \n if(isTouching(Mina1.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina1.removemina1();\n \n }\n \n if(isTouching(Mina2.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina2.removemina2();\n \n }\n \n if(isTouching(Mina3.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina3.removemina3();\n \n }\n \n \n if(isTouching(DepositoZ.class) && gasZ.gasZ > 4 && bunkerZ.bunkerZ() < 400){\n \n gasZ.removeGasZ();\n bunkerZ.addbunkerZ();\n }\n \n if(isTouching(DepositoZ.class) && cristalZ.cristalZ() > 0 && bunkerZ.bunkerZ() < 400 ){\n \n cristalZ.removeCristalZ();\n bunkerZ.addbunkerZ();\n }\n \n //determinar si la vida llega a 0\n \n if( vidaCZ.vidaCZ <= 0 )\n {\n \n getWorld().removeObjects(getWorld().getObjects(EnergiaConstrucZ.class)); \n \n getWorld().removeObjects(getWorld().getObjects(ConstructorZerg.class));\n \n EnergiaZerg energiaZ = mapa.getEnergiaZerg(); \n \n energiaZ.removenergiaCZ();\n }\n \n if( mina1.mina1() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina1.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal1.class));\n \n }\n \n if( mina2.mina2() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina2.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal2.class));\n \n }\n \n if( mina3.mina3() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina3.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal3.class));\n \n }\n \n \n}", "public void makeHero()\r\n { \r\n maxHealth = 100;\r\n health = maxHealth;\r\n }", "public int distance(PuzzleState state) {\n int numOfTiles = 9;\n int rowLength = 3;\n int finalDistance = 0;\n for(int i = 1; i < numOfTiles; i++){\n if(goalState.posOf(i) != state.posOf(i)){\n int indexOfMissplacedTile = state.posOf(i);\n int indexOfGoalplacedTile = goalState.posOf(i);\n int indexDifference = Math.abs(indexOfGoalplacedTile - indexOfMissplacedTile);\n int finalDistanceOfThisTile = 0;\n if(indexDifference >= rowLength){\n finalDistanceOfThisTile += indexDifference / 3;// number of rows moved\n finalDistanceOfThisTile += indexDifference % 3;// number of columns moved\n }\n else if(indexDifference < rowLength && (indexDifference + 1)%rowLength == 0){//special case if the tile needs to travel ex(from index 3 to 4 or vice verca);\n finalDistanceOfThisTile += 3;\n }\n else{\n finalDistanceOfThisTile += indexDifference;\n }\n finalDistance += finalDistanceOfThisTile;\n }\n }\n return finalDistance;\n }", "public int distTo(final int one) {\n return distace[one];\n }", "public static double distanceFallen(double time){\n return square(time)*(9.8)*(.5);\n }", "public void hitBall(int distance, int playerIndex) {\n distanceLeft[playerIndex] -= distance;\n updateTable();\n }", "public double calculateDistanceRH(HumanState msg){\n\t\tdouble x1 = msg.human_position.x;\n\t\tdouble x2 = msg.robot_position.x;\n\t\tdouble y1 = msg.human_position.y;\n\t\tdouble y2 = msg.robot_position.y;\n\n\t\tdouble dis=Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));\n\t\treturn dis;\n\t}", "Execution getClosestDistance();", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "private void moveHeroBy(Player hero, int dx, int dy, Board board) {\n if (dx == 0 && dy == 0) {\n return;\n }\n int x = hero.getPlayerMovement().getXPosition() + dx;\n int y = hero.getPlayerMovement().getYPosition() + dy;\n moveHeroTo(hero, x, y, board);\n }", "@Test\n public void test_distanceLinaireSurY_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionX = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(positionX, 2));\n pays.setPositionVille(1, new Point(positionX, 3));\n pays.setPositionVille(2, new Point(positionX, 4));\n pays.setPositionVille(3, new Point(positionX, 5));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "private void intelligentDecideMove() {\n\t\tMonster target=nearestEnemy();\r\n\t\tif(target!=null){\t\t\t\t//FIRST PRIORITY: pursue the target if it can be seen.\r\n\t\t\tswitchStates(PURSUIT);\r\n\t\t\ttargetTile=new Tile(target.currentTile);\r\n\t\t\t//saveMove();\r\n\t\t\tmonster.moveTowards(target);\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\ttargetLostResponse();\r\n\t\t\t}\r\n\t}", "public Command run() {\n Worm enemyWormSpecial = getFirstWormInRangeSpecial();\n if (enemyWormSpecial != null) {\n if (gameState.myPlayer.worms[1].id == gameState.currentWormId) {\n if (gameState.myPlayer.worms[1].bananaBombs.count > 0) {\n return new BananaBombCommand(enemyWormSpecial.position.x, enemyWormSpecial.position.y);\n }\n }\n if (gameState.myPlayer.worms[2].snowballs.count > 0) {\n return new SnowballCommand(enemyWormSpecial.position.x, enemyWormSpecial.position.y);\n }\n }\n\n //PRIORITAS 2: NORMAL ATTACK (Shoot)\n Worm enemyWorm = getFirstWormInRange();\n if (enemyWorm != null) {\n Direction direction = resolveDirection(currentWorm.position, enemyWorm.position);\n return new ShootCommand(direction);\n }\n\n //PRIORITAS 3: MOVE (Karena sudah opsi serang tidak memungkinkan)\n\n //Ambil semua koordinat di cell Worm saat ini selain current cell\n List<Cell> surroundingBlocks = getSurroundingCells(currentWorm.position.x, currentWorm.position.y);\n \n\n //Kalau Worm saat ini adalah Commander, masuk ke algoritma move khusus Commander\n if(gameState.currentWormId == 1){\n\n //Commander akan memprioritaskan untuk bergerak menuju Technician (Worm yang memiliki Snowball)\n Worm technicianWorm = gameState.myPlayer.worms[2];\n\n\n //Mencari cell yang akan menghasilkan jarak terpendek menuju Worm tujuan\n Cell shortestCellToTechnician = getShortestPath(surroundingBlocks, technicianWorm.position.x, technicianWorm.position.y);\n \n //Commander akan bergerak mendekati Technician sampai dengan jarak dia dan Technician paling dekat adalah 3 satuan\n if (euclideanDistance(currentWorm.position.x, currentWorm.position.y, technicianWorm.position.x, technicianWorm.position.y) > 3) {\n if(shortestCellToTechnician.type == CellType.AIR) {\n return new MoveCommand(shortestCellToTechnician.x, shortestCellToTechnician.y);\n }else if (shortestCellToTechnician.type == CellType.DIRT) {\n return new DigCommand(shortestCellToTechnician.x, shortestCellToTechnician.y);\n }\n }\n\n //Apabila Commander dan Technician sudah berdekatan, maka Commander akan bergerak mencari musuh terdekat untuk melancarkan serangan\n int min = 10000000;\n Worm wormMusuhTerdekat = opponent.worms[0];\n for (Worm calonMusuh : opponent.worms) {\n if (euclideanDistance(currentWorm.position.x, currentWorm.position.y, calonMusuh.position.x, calonMusuh.position.y) < min) {\n min = euclideanDistance(currentWorm.position.x, currentWorm.position.y, calonMusuh.position.x, calonMusuh.position.y);\n wormMusuhTerdekat = calonMusuh;\n }\n }\n\n //Mencari cell yang paling dekat ke musuh yang sudah ditemukan\n Cell shortestCellToEnemy = getShortestPath(surroundingBlocks, wormMusuhTerdekat.position.x, wormMusuhTerdekat.position.y);\n if(shortestCellToEnemy.type == CellType.AIR) {\n return new MoveCommand(shortestCellToEnemy.x, shortestCellToEnemy.y);\n }else if (shortestCellToEnemy.type == CellType.DIRT) {\n return new DigCommand(shortestCellToEnemy.x, shortestCellToEnemy.y);\n }\n }\n\n //Command move untuk worm selain Commando. Worm selain commando akan mendekat menuju posisi worm Commando\n Worm commandoWorm = gameState.myPlayer.worms[0];\n \n //Selama Commando masih hidup, maka Worm lainnya akan mendekat menuju Commando\n if (commandoWorm.health > 0) {\n //Cell cellCommandoWorm = surroundingBlocks.get(0);\n\n //Mencari cell yang membuat jarak menuju Commando paling dekat\n Cell shortestCellToCommander = getShortestPath(surroundingBlocks, commandoWorm.position.x, commandoWorm.position.y);\n\n if(shortestCellToCommander.type == CellType.AIR) {\n return new MoveCommand(shortestCellToCommander.x, shortestCellToCommander.y);\n }else if (shortestCellToCommander.type == CellType.DIRT) {\n return new DigCommand(shortestCellToCommander.x, shortestCellToCommander.y);\n }\n }\n\n // PRIORITAS 4: Bergerak secara acak untuk memancing musuh mendekat\n int cellIdx = random.nextInt(surroundingBlocks.size());\n Cell block = surroundingBlocks.get(cellIdx);\n if (block.type == CellType.AIR) {\n return new MoveCommand(block.x, block.y);\n } else if (block.type == CellType.DIRT) {\n return new DigCommand(block.x, block.y);\n }\n // Kalau udah enggak bisa ngapa-ngapain.\n return new DoNothingCommand();\n \n }", "float distTo(Sprite s) {\n return dist(_x, _y, s._x, s._y);\n }", "public int heroAttack(int i) {\n switch (i) {\n case 1:\n return rand.nextInt(2) + 1;\n case 2:\n return rand.nextInt(2) + 2;\n case 3:\n return rand.nextInt(2) + 3;\n case 4:\n return rand.nextInt(4) + 4;\n default:\n return 0;\n }\n }", "@Override\n\tpublic ArrayList<Unit> getMoveUnit() {\n\t\tArrayList<Unit> canMove = new ArrayList<Unit>();\n\t\tGameBoard gameBoard = GameController.gameBoard;\n\t\tArrayList<ArrayList<Integer>> distance = gameBoard.getDistance(this.getCoordinate().getX(),\n\t\t\t\tthis.getCoordinate().getY(), false);\n\t\tif(!this.isMovable()) {\n\t\t\treturn canMove;\n\t\t}\n\t\tfor (int i = 0; i < distance.size(); i++) {\n\t\t\tfor (int j = 0; j < distance.size(); j++) {\n\t\t\t\tif (distance.get(i).get(j) == 1) {\n\t\t\t\t\tfor (Unit u : gameBoard.getAdjacentUnit(i, j)) {\n\t\t\t\t\t\tif (u == null) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!(u instanceof Empty) && u != this) {\n\t\t\t\t\t\t\tcanMove.add(gameBoard.getUnit(i, j));\n\t\t\t\t\t\t\t// System.out.println(gameBoard.getUnit(i, j).getCoordinate().toString());\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\treturn canMove;\n\t}", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "private boolean check_vicinity(FishTankItem TankItem) {\r\n if (getDirection()) {\r\n return 0 <= (TankItem.firstCoordinate - this.firstCoordinate)\r\n && (TankItem.firstCoordinate - this.firstCoordinate) <= 7;\r\n } else {\r\n return 0 <= (this.firstCoordinate - TankItem.firstCoordinate)\r\n && (this.firstCoordinate - TankItem.firstCoordinate) <= 5;\r\n }\r\n }", "private void straightDistance(double distance) {\n\t\tdouble marginOfError = 0.3;// in inches\n\t\tdouble distanceTraveled = 0;// in inches\n\t\tdouble forwardSpeed = 0;\n\t\tdouble rightSpeed = 0;\n\t\tdouble leftSpeed = 0;\n\t\t// desiredAngle = maggie.getAngle();\n\t\tleftEncoder.reset();\n\t\trightEncoder.reset();\n\n\t\twhile (Math.abs(distanceTraveled - distance) > marginOfError && isEnabled() && isAutonomous()) {\n\t\t\tdistanceTraveled = kDriveToInches * ((-leftEncoder.get() + rightEncoder.get()) / 2);\n\t\t\tSmartDashboard.putNumber(\"distance Traveled\", distanceTraveled);\n\t\t\t// slowed down for now\n\t\t\tforwardSpeed = Math.atan(0.125 * (distance - distanceTraveled)) / (0.5 * Math.PI);//replace arctan with 1/(1+(1.0*e^(-1.0*x)))\n\t\t\t/*rightSpeed = forwardSpeed * (1 + (0.01 * (maggie.getAngle() - desiredAngle)));\n\t\t\tleftSpeed = forwardSpeed * (1 - 0.01 * (maggie.getAngle() - desiredAngle));*/\n\t\t\trobot.lDrive(leftSpeed);\n\t\t\trobot.rDrive(rightSpeed);\n\t\t\televator.update();\n\t\t\trobot.eDrive(elevator.motorMovement);\n\t\t\treportEncoder();\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 sueldo(){\n if(horas <= 40){\n sueldo = horas * cuota;\n }else {\n if (horas <= 50) {\n sueldo = (40 * cuota) + ((horas - 40) * (cuota * 2));\n } else {\n sueldo = ((40 * cuota) + (10 * cuota * 2)) + ((horas - 50) + (cuota * 3));\n }\n }\n\n }" ]
[ "0.62517035", "0.62056184", "0.60278416", "0.6017205", "0.59991777", "0.5953987", "0.5934248", "0.5905491", "0.58122736", "0.5768745", "0.5746105", "0.5702628", "0.5697852", "0.5693759", "0.568167", "0.5665749", "0.56601477", "0.56480163", "0.56461114", "0.56457835", "0.56400764", "0.5636821", "0.5611966", "0.56109285", "0.5603949", "0.5587707", "0.55846345", "0.55833673", "0.5580808", "0.55617964", "0.5539043", "0.5522858", "0.55223215", "0.55129963", "0.5509937", "0.55097073", "0.550268", "0.5500261", "0.54993737", "0.54944736", "0.5493043", "0.548295", "0.54820776", "0.5475001", "0.547168", "0.5467368", "0.5464641", "0.5454391", "0.54513615", "0.5446782", "0.5445251", "0.54442537", "0.5442853", "0.5433393", "0.54312634", "0.5426853", "0.5425009", "0.54223263", "0.54142207", "0.54108745", "0.54072803", "0.54017454", "0.539311", "0.5392222", "0.53912383", "0.5386966", "0.5384597", "0.53706443", "0.53683364", "0.53606534", "0.53564805", "0.53547835", "0.53508866", "0.53505623", "0.53491133", "0.5338933", "0.5336806", "0.5329641", "0.5327035", "0.5324489", "0.53228074", "0.53222543", "0.5319742", "0.5315538", "0.53093624", "0.5306686", "0.5301285", "0.52989835", "0.52968115", "0.52957153", "0.52886933", "0.52882284", "0.5285929", "0.52835816", "0.52823216", "0.5280207", "0.5277428", "0.5275185", "0.5274018", "0.5271377", "0.5268425" ]
0.0
-1
deplace le soldat soldat a la position pos
public boolean deplacerSoldat(Position pos, Soldat soldat) throws WargameException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void descolaPosicao();", "public void despegar(){\n if(this.posicion == 1){\n this.setPosicion(2);\n this.indicarEstado(\"Volando\");\n } else{\n System.out.println(\"No estoy preparado para el despegue\");\n }\n }", "public void removePos(String word, IPosition pos) throws WordException;", "private void disparo()\n {\n switch(this.posicion){\n case 0:\n setLocation(getX(),getY()-this.velocidadDisparo);\n break;\n case 1:\n setLocation(getX(),getY()+this.velocidadDisparo);\n break;\n case 2:\n setLocation(getX()+this.velocidadDisparo,getY());\n break;\n case 3:\n setLocation(getX()-this.velocidadDisparo,getY());\n break;\n }\n }", "public void desligar() {\n\r\n\t}", "private void sterben()\n {\n lebendig = false;\n if(position != null) {\n feld.raeumen(position);\n position = null;\n feld = null;\n }\n }", "public void destruirLegion(Soldado soldado) {\n Legion legion = (Legion) soldado;\n for (Soldado soldadosLegion : legion.getSoldados()) {\n this.soldados.add(soldadosLegion);\n }\n }", "@Override\n\tpublic void desligar() {\n\t\t\n\t}", "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void remove(int offs,int len) throws BadLocationException {\n super.remove(offs, len);\r\r\r\r\r\r\n System.out.println(\"[*********]REMOVE\");\r\r\r\r\r\r\n if(validate==false){ \r\r\r\r\r\r\n String result = m_parent.getGrp_TField_encode().getText(0,getLength()); \r\r\r\r\r\r\n System.out.println(\"je remove \"+result.length());\r\r\r\r\r\r\n if (result.length() >= m_longeur_saisie && m_longeur_saisie!=0 ) {\r\r\r\r\r\r\n System.out.println(\"+grand \"+result);\r\r\r\r\r\r\n if(m_parent.getGrp_PopMenu_popup().isVisible())\r\r\r\r\r\r\n search(result);\r\r\r\r\r\r\n }\r\r\r\r\r\r\n else\r\r\r\r\r\r\n {\r\r\r\r\r\r\n System.out.println(\"+petit \"+result); \r\r\r\r\r\r\n affichePopup(false);\r\r\r\r\r\r\n charger=false; \r\r\r\r\r\r\n m_model.setM_vector(null);\r\r\r\r\r\r\n } \r\r\r\r\r\r\n }\r\r\r\r\r\r\n else{\r\r\r\r\r\r\n affichePopup(false);\r\r\r\r\r\r\n }\r\r\r\r\r\r\n }", "void positionCleared();", "private void eliminarLibro(int pos) {\n\t\t// TODO Auto-generated method stub\n\t\tint contador = 0;\n\t\tboolean parar = false;\n\t\tLibro aux;\n\t\t\n\t\twhile((contador < lb.length) && !parar) {\n\t\t\tif(lb[contador] == null) {\n\t\t\t\tparar = true;\n\t\t\t\tcontador--;\n\t\t\t}else {\n\t\t\t\tcontador++;\n\t\t\t}\n\t\t}\n\t\tif(!parar) contador = lb.length-1;\n\t\t\n\t\taux = lb[pos];\n\t\tlb[pos] = lb[contador];\n\t\tlb[contador] = null;\n\t\tlb[lb.length-1] = aux;\n\t\tlb = Arrays.copyOf(lb, lb.length-1);\n\t\tif(lb[pos] == null) {\n\t\t\tfor(int i=pos; i<lb.length-1;i++) {\n\t\t\t\tlb[i] = lb[i+1];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void removeAt(int pos)\n {\n for (int i = pos; i < length - 1; i++)\n {\n list[i] = list[i + 1];\n }\n length--;\n }", "public void deplaceSur(int x, int y, Robot r) {\r\n\t\tif(y >= 0 && y < hauteur && x >= 0 && x < largeur)\r\n\t\t\tthis.plateau[y][x].deplaceSur(r);\r\n\t}", "public String escolheRemove(int pos) {\n\t\tString e = null;\n\t\tint i = 1;\n\t\tCampusModel aux = inicio;\n\n\t\tif (inicio == null) {\n\t\t\tSystem.out.println(\"Lista Vazia!\");\n\t\t\treturn e;\n\t\t}\n\t\tif (pos == 1) {\n\t\t\te = RemoveInicio();\n\t\t\treturn e;\n\t\t} else {\n\t\t\twhile (aux.getProx() != null) {\n\t\t\t\taux = aux.getProx();\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (pos > i || pos == 0) {\n\t\t\t\tSystem.out.println(\"Posição Invalida!\");\n\t\t\t\treturn e;\n\t\t\t} else if (pos == i) {\n\t\t\t\te = RemoveFinal();\n\t\t\t\treturn e;\n\t\t\t} else {\n\t\t\t\taux = inicio;\n\t\t\t\tCampusModel aux2 = aux;\n\n\t\t\t\twhile (pos > 1) {\n\t\t\t\t\taux2 = aux;\n\t\t\t\t\taux = aux.getProx();\n\t\t\t\t\tpos--;\n\t\t\t\t}\n\t\t\t\te = aux.getNomeCampus();\n\t\t\t\taux2.setProx(aux.getProx());\n\n\t\t\t\treturn e;\n\t\t\t}\n\t\t}\n\t}", "public void change_sword_pos() {\n\t\tif (!heroi.isArmado())\n\t\t\tlabirinto.setLabCell(espada.getX_coord(), espada.getY_coord(), 'E');\n\t}", "public void borraFrase(int posicion) {\n\n System.arraycopy(\n frases,\n posicion + 1,\n frases, \n posicion, \n frases.length - posicion - 1\n );\n\n pos--;\n }", "public void supprimerPCPosition(int position) {\n if (position == 1) // if deleted computer is at the start\n {\n if (taille == 1) {\n start = null;\n end = null;\n taille = 0;\n return;\n }\n start = start.getLinkNext();\n start.setLinkPrev(end);\n end.setLinkNext(start);\n taille--;\n return;\n }\n if (position == taille) // If deleted computer is at the end\n {\n end = end.getLinkPrevious();\n end.setLinkNext(start);\n start.setLinkPrev(end);\n taille--;\n }\n\n Computer Computer = start.getLinkNext();\n for (int i = 2; i <= taille; i++) {\n if (i == position) {\n Computer p = Computer.getLinkPrevious();\n Computer n = Computer.getLinkNext();\n\n p.setLinkNext(n);\n n.setLinkPrev(p);\n taille--;\n return;\n }\n Computer = Computer.getLinkNext();\n }\n }", "public void gerak() \n {\n setLocation(getX(),getY()-5);\n if(getY()<20){\n getWorld().removeObject(this);\n }else\n cek_kena();\n \n }", "private void supprimerPion(Position unePosition) {\n\t\tmesPions.remove(unePosition); \n }", "@Override\r\n\t\t\tpublic void eliminar() {\n\r\n\t\t\t}", "private void undoPosition() {\r\n String undoingBoard = listOfBoards.pop();\r\n listOfMoves.pop();\r\n for (Square sq : map.keySet()) {\r\n char piece = undoingBoard.charAt(sq.index() + 1);\r\n if (piece == '-') {\r\n map.put(sq, EMPTY);\r\n }\r\n if (piece == 'B') {\r\n map.put(sq, BLACK);\r\n }\r\n if (piece == 'W') {\r\n map.put(sq, WHITE);\r\n }\r\n if (piece == 'K') {\r\n map.put(sq, KING);\r\n }\r\n board[sq.col()][sq.row()] = map.get(sq);\r\n }\r\n _moveCount -= 1;\r\n _turn = _turn.opponent();\r\n _repeated = false;\r\n }", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "public boolean setNovelPosition(final int pos, final SimpleReference ref) {\n\n // replace ref\n int len = this.ref.length;\n\n if (len > 0) {\n byte[] temp_ref = ref.byteRange(chr, pos, pos + len);\n\n for (byte b : temp_ref) {\n if (b == 'N') {\n // don't allow N's\n log.warn(\"N found at \" + pos + \" to \" + (pos + len));\n return false;\n }\n }\n\n for (Alt alt : alts) {\n if (alt.getSequence() != null) {\n // make sure there is no prefix the same\n for (int i = 0; i < temp_ref.length; i++) {\n if (i < alt.getSequence().length) {\n if (temp_ref[i] == alt.getSequence()[i]) {\n log.warn(\"Same ref at alt at \" + pos + \" to \" + (pos + len));\n return false;\n } else {\n break;\n }\n }\n }\n\n }\n }\n\n this.ref = temp_ref;\n }\n\n // replace ref_deleted\n len = refDeleted.length();\n if (len > 0) {\n try {\n byte[] deleted_temp = ref.byteRange(chr, pos - len, pos);\n if (deleted_temp == null) {\n throw new IllegalArgumentException(\"Error record: \" + this);\n }\n refDeleted = new String(deleted_temp, \"US-ASCII\");\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }\n\n // do the replacing\n this.pos = pos;\n\n return true;\n }", "@Override\n\tpublic void eliminar() {\n\n\t}", "public void setPosEnSaliente(Position<Arco<E>> pos){\r\n\t\tposV1 = pos;\r\n\t}", "public Position opposite(Position vp, Position ep) throws InvalidPositionException;", "void unsetBeginPosition();", "public void suppressionJoueur (int position) {\r\n\t\tjoueurs.put(position , new JVide(joueur_lg, joueur_ht));\r\n\t\tthis.formerTable();\r\n\t}", "@Override\n\tpublic void eliminar() {\n\t\t\n\t}", "protected Object remObject(int position){\n \n }", "public void removeSword() {\n \tthis.sword =null;\n \tthis.UIsword().set(false);\n \tdungeon.swordLeft().set(\"Sword Hits Left: 0\\n\");\n }", "public void moverVerticalSuave( int posicion )\n {\n brazo.moverVerticalSuave( posicion );\n }", "public void undoMove()\n {\n positions.remove(positions.size()-1);\n String position = positions.get(positions.size()-1);\n ArrayList<Piece> pieces = Chess.stringToPieces(position.substring(4));\n setTurn(Integer.parseInt(position.substring(0,2)));\n setFiftyMove(Integer.parseInt(position.substring(2,4)));\n for (int i = 0; i < Chess.ROWS; i++)\n for (int j = 0; j < Chess.COLUMNS; j++)\n {\n squares[i][j].setPiece(null);\n for (Piece p: pieces)\n if (p.getOrigin().equals(new Location(i,j)))\n squares[i][j].setPiece(p);\n }\n setFirstSelected(null);\n squares[0][0].deselectSquares();\n if (getTurn()<20)\n frame.setOptionVisibility(false);\n \n DefaultTableModel d = (DefaultTableModel)frame.getNotation().getModel();\n if (colorGoing()==PieceColor.BLACK)\n d.setValueAt(\"\",turn/2,1);\n else\n d.removeRow((turn+1)/2);\n frame.getSide().getDrawBox().setSelected(false);\n updateUI();\n }", "private Posicion posicionAlDesarmarSuperion(Posicion posicion) {\n\t\tPosicion posAux;\n\t\ttry{\n\t\t\tposAux=new Posicion(posicion.getFila(),posicion.getColumna()-2);\n\t\t}catch(ErrorPosicionInvalida e){\n\t\t\tposAux=new Posicion(posicion.getFila(),posicion.getColumna()+1);\n\t\t}\n\t\t\n\t\treturn posAux;\n\t}", "public void removeByLeftShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = size - pos - 1;\r\n int from = ((start + pos) + 1) % cir.length;\r\n int to = from - 1;\r\n if (to < 0) {\r\n to = cir.length - 1;\r\n }\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from++;\r\n }\r\n cir[(start + size - 1) % cir.length] = \"null\";\r\n // start++;\r\n size--;\r\n }\r\n }", "static void hardDrop(Block b) {\n int[] pos = b.pos;\n char[][] piece = b.piece;\n\n while (canPlace(pos[0] + 1, pos[1], piece))\n pos[0]++;\n\n place(pos[0], pos[1], piece);\n }", "public void decida(){\n int vecinasVivas=vecinos();\n if(vecinasVivas==3 && estadoActual=='m'){\n estadoSiguiente='v';\n }else if((estadoActual=='v' && vecinasVivas==2) || (estadoActual=='v' && vecinasVivas==3)){\n estadoSiguiente='v';\n }else if(vecinasVivas<2 || vecinasVivas>3){\n estadoSiguiente='m';\n }\n }", "private void deslocarBloco(double dist) {\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < distance * 10.0) {\r\n\t\t\t\t\tsendData(\"U\");\t\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsendData(\"u\");\r\n\t\t\t\t\r\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tnow = 0;\r\n\t\t\t\twhile(now < 1000.0) {\r\n\t\t\t\t\tnow = System.currentTimeMillis() - time;\r\n\t\t\t\t}\r\n\t\t\t}", "public void decida(){\r\n int f=this.getFila();\r\n int c=this.getColumna();\r\n int cont=alRededor(f,c);\r\n if(this.isVivo()){\r\n if(cont==2 || cont==3){\r\n estadoSiguiente=VIVA;\r\n }else/* if(cont==1 || cont>3)*/{\r\n estadoSiguiente=MUERTA;\r\n }\r\n }else{\r\n if(cont==3){\r\n estadoSiguiente=VIVA;\r\n }else if(cont==1 || cont>3){\r\n estadoSiguiente=MUERTA;\r\n }\r\n }\r\n }", "public void moveKangaroo (Kangaroo a){\n if (!kangaroosInPoint.isEmpty()){\n kangaroosInPoint.remove(a);\n }\n else {\n System.out.println(\"Kangaroo not found\");\n }\n }", "public void BeforeClearSpaceBlockReplaced(BlockPos pos) {\n }", "public void delVampire(int ind) {\n\n Vampiro.restarVampiro();\n\n for (int i=ind; i < Vampiro.getNumVamp(); i++) {\n\n lista[i] = lista[i+1];\n }\n }", "public void DelTrack(int position);", "@Override\n\tvoid desligar() {\n\t\tsuper.desligar();\n\t\tSystem.out.println(\"Automovel desligando\");\n\t}", "public void eliminarEnIndice(int indice){\n if(irAIndice(indice)){\n eliminarBodegaActual();\n }\n }", "@Override\r\n public boolean onEliminar(Vector3f vel) {\n return false;\r\n }", "@Override\n\tpublic void devolucao(Livros livro) {\n\t\t\n\t}", "void removeRobot(Position pos);", "public void resetSaleAndCostTracking() {\n for (int i = 0; i < stockList.size(); i++) {\r\n // If the beanBag object at the current position is \"isSold\" bool is true.\r\n if (((BeanBag) stockList.get(i)).isSold()) {\r\n // Remove beanBag object at that position from the \"stockList\".\r\n stockList.remove(i);\r\n }\r\n }\r\n }", "public void dropCoin(Pair<Integer, Integer> loc) {\r\n \tSprite newCoin = new Sprite(w, door);\r\n \tnewCoin.setPos(loc);\r\n \tnewCoin.setImage(GOLD_COIN);\r\n \tcoins.add(newCoin);\r\n }", "void retract() {\n assert movesMade() > 0;\n Move move = _moves.remove(_moves.size() - 1);\n Piece replaced = move.replacedPiece();\n int c0 = move.getCol0(), c1 = move.getCol1();\n int r0 = move.getRow0(), r1 = move.getRow1();\n Piece movedPiece = move.movedPiece();\n set(c1, r1, replaced);\n set(c0, r0, movedPiece);\n _turn = _turn.opposite();\n }", "private void DeslocarJogador(int jogador, int novaPosicao) {\n this.posicoes[jogador] = novaPosicao;\n }", "public void removeByRightShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = pos;\r\n int from = ((start + pos) - 1) % cir.length;\r\n int to = (from + 1) % cir.length;\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from--;\r\n if (from < 0) {\r\n from = cir.length - 1;\r\n }\r\n }\r\n cir[start] = \"null\";\r\n start++;\r\n size--;\r\n }\r\n }", "public abstract E remove(Position<E> p);", "public void deleteAtPos(int pos)\n { \n if (pos == 1)\n {\n if (size == 1)\n {\n start = null;\n end = null;\n size = 0;\n return;\n }\n start = start.getListNext();\n start.setListPrev(null);\n size--;\n return ;\n }\n if (pos == size)\n {\n end = end.getListPrev();\n end.setListNext(null);\n size-- ;\n }\n List ptr = start.getListNext();\n for (int i = 2; i <= size; i++)\n {\n if (i == pos)\n {\n List p = ptr.getListPrev();\n List n = ptr.getListNext();\n p.setListNext(n);\n n.setListPrev(p);\n size-- ;\n return;\n }\n ptr = ptr.getListNext();\n } \n }", "public void eliminarPais(String txtPais);", "private void borrarPieza(PosicionAjedrez pos){\n\t\tint fila= transformar(pos).getFila();\n\t\tint col= transformar(pos).getColumna();\n\n\t\tthis.getChildren().remove(tablero[col][fila]);\n\t\ttablero[col][fila]=new Canvas(CASILLERO_ANCHO,CASILLERO_ALTO);\n\t\ttablero[col][fila].setTranslateX(CASILLERO_ANCHO*col);\n\t\ttablero[col][fila].setTranslateY(CASILLERO_ALTO*fila);\n\n\t\tthis.getChildren().add(tablero[col][fila]);\n\t}", "private static String removegivenChar(String str,int pos) {\n\t\treturn str.substring(0,pos) + str.substring(pos+1);\r\n\t}", "public void pop() {\n if (cabeza!= null) {\n //SI CABEZA.SIGUENTE ES DISTINTO A NULO\n if (cabeza.siguiente==null) {\n //CABEZA SERA NULO\n cabeza=null; \n //SE IRAN RESTANDO LOS NODOS\n longitud--;\n } else {\n //DE LO CONTRARIO EL PUNTERO SERA IGUAL A CABEZA\n Nodo puntero=cabeza;\n //MIENTRTAS EL PUNTERO SEA DISITINTO A NULO \n while (puntero.siguiente.siguiente!=null) { \n //PUNTYERO SERA IGUAL A LA DIRECCION DEL SIGUIENTE NODO\n puntero=puntero.siguiente;\n }\n puntero.siguiente=null;\n longitud--;\n }\n }\n }", "public static String cadenaDescomponer(String cadena, int posicion, String caracter){\n String caddenaRetorno = \"cadena\"; //Va a tomar valor o lo va a descomponer\n //si se pide una posicion mas\n if(posicion >1){\n //recorrido para quitar datos\n for(int i=0; i<posicion-1;i++){\n //descomposicion pol@juy@5245@liok\n caddenaRetorno = caddenaRetorno.substring(caddenaRetorno.indexOf(caracter) + 1);\n\n }\n }\n //cuando encuentre el valor\n if(caddenaRetorno.indexOf(cadena) > 0){\n caddenaRetorno = caddenaRetorno.substring(0,caddenaRetorno.indexOf(caracter));\n }\n\n //retornamos el valor limpio\n return caddenaRetorno;\n }", "void eliminar(Long id);", "void unsetOrganizationPositionList();", "private void removeAntFromBoard(Board inputBoard, String name) {\nfor (int k = 0; k < inputBoard.getAntsOnBoard().size(); k++) {\nString currentName = inputBoard.getAntsOnBoard().get(k).getName();\nif (currentName.equalsIgnoreCase(name)) {\nint antPosX = inputBoard.getAntsOnBoard().get(k).getAntPosX();\nint antPosY = inputBoard.getAntsOnBoard().get(k).getAntPosY();\ninputBoard.getAntsOnBoard().remove(k);\ninputBoard.getCellCordinates(antPosX, antPosY).removeAnt();\n}\n}\n}", "public void treureDeBultoSortida(Number iddoc, Number idlin)\n {\n Object [] obj = {getIdexped(), getIdbulto(), iddoc, idlin};\n Key key = new Key(obj);\n Row [] rows = getSgaexpedlbulto().findByKey(key, 1);\n if (rows != null && rows.length > 0)\n {\n SgaexpedlbultoImpl lbulto = (SgaexpedlbultoImpl)((ViewRowImpl)rows[0]).getEntity(0); \n lbulto.remove();\n }\n \n \n // Si no queden lbultos, esborrem el bulto\n if (getSgaexpedlbulto().getRowCount() == 0)\n remove();\n }", "void rezervasyonYap(String name, String surname, String islem);", "public int eliminardelFinal(){\n int elemento = fin.dato;\n if(inicio == fin){\n inicio=fin=null;\n }else{\n fin = fin.ant;\n fin.sig = null;\n }\n return elemento;\n \n \n }", "public void eliminarBodegaActual(){\n Nodo_bodega_actual.obtenerAnterior().definirSiguiente(Nodo_bodega_actual.obtenerSiguiente());\n if(Nodo_bodega_actual.obtenerSiguiente() != null){\n Nodo_bodega_actual.obtenerSiguiente().definirAnterior(Nodo_bodega_actual.obtenerAnterior());\n } \n }", "public void reset() {\n\t\tpos.tijd = 0;\r\n\t\tpos.xposbal = xposstruct;\r\n\t\tpos.yposbal = yposstruct;\r\n\t\tpos.hoek = Math.PI/2;\r\n\t\tpos.start = 0;\r\n\t\topgespannen = 0;\r\n\t\tpos.snelh = 0.2;\r\n\t\tbooghoek = 0;\r\n\t\tpos.geraakt = 0;\r\n\t\tgeraakt = 0;\r\n\t\t\r\n\t}", "public void demandeDeplacement(int dx, int dy)\n\t{\n\t\t// Nouvelles coordonnées en fonction des directions d\n\t\tthis.x = this.x + dx;\n\t\tthis.y = this.y + dy;\n\t\t\n\t\tfor (PirateEcouteur piratecouteur : this.pirateEcouteurs.getListeners(PirateEcouteur.class)) {\n\t\t\t//Traitement trésor\n\t\t\tif(this.monkeyIsland.getTresor().coordonneesEgales(this.x, this.y)){\n\t\t\t\tthis.butin++;\n\t\t\t\tthis.monkeyIsland.suppressionTresor();\n\t\t\t\tthis.monkeyIsland.creationTresor();\n\t\t\t}\n\t\t\t//Traitement déplacement pirate\n\t\t\tif(this.monkeyIsland.singeEstPresent(this.x, this.y)){\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t\t//Marcher sur un singe entraine la mort\n\t\t\t\tpiratecouteur.mortPirate(0);\n\t\t\t\tbreak;\n\t\t\t}else if(Constantes.MER != this.monkeyIsland.valeurCarte(this.x, this.y)){\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t}else{\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t\tpiratecouteur.mortPirate(0);\n\t\t\t}\n\t\t\t//Libération clavier pour pouvoir se déplacer\n\t\t\tpiratecouteur.liberationClavier();\n\t\t}\n\t}", "void unsetEndPosition();", "public void undoMove(Move move) {\n b[move.from.row][move.from.column] = true;\r\n\r\n // Set 'to' space to free\r\n b[move.to.row][move.to.column] = false;\r\n\r\n // Set 'step' space to occupied\r\n b[(move.from.row + move.to.row)/2][(move.from.column + move.to.column)/2] = true;\r\n\r\n // Increment number of pegs left on the board\r\n pegsLeft++;\r\n }", "public void removeByLeftShift(int pos){\n int nshift=size-(pos);\n int to=(start+pos)%cir.length;\n int from=(to+1)%cir.length;\n for(int i=0;i<nshift;i++){\n cir[to]=cir[from];\n to=from;\n from=(from+1)%cir.length;\n \n }\n int index=(start+size-1)%cir.length;\n cir[index]=null;\n size--;\n \n }", "private void deplacementFond(Graphics g) {\n\t\tif (PosyFond == Constantes.FENETRE_HEIGHT) {\n\t\t\tPosyFond = 0;\n\t\t}\n\t\tg.drawImage(this.imgBandeFond, 0, this.PosyFond, null);\n\t\tg.drawImage(this.imgBandeFond, 0, this.PosyFond - Constantes.IMAGE_HEIGHT, null);\n\t\tg.drawImage(this.imgBandeFond, 0, this.PosyFond - Constantes.IMAGE_HEIGHT * 2, null);\n\t\tg.drawImage(this.imgBandeFond, 0, this.PosyFond - Constantes.IMAGE_HEIGHT * 3, null);\n\t}", "@Override\r\n public void moveSoldier(int previousLocationX, int previousLocationY, int newLocationX, int newLocationY) {\r\n\r\n // delete soldier representation from previous location \r\n // then render soldier representation in new location \r\n }", "@Override\n public boolean revise(int position) throws ContradictionException {\n boolean revised = false;\n final DisposableIntIterator itr = scope[position].getSVariable()\n .getDomain().getIterator();\n try {\n while (itr.hasNext()) {\n final int a = itr.next();\n if (revise(position, a, Integer.MAX_VALUE)) {\n scope[position].removeVal(a);\n revised = true;\n }\n }\n } finally {\n itr.dispose();\n }\n return revised;\n }", "public void removeFreeSpace(int position) {\n\t\tfor(int i = 0;i<coordinate.size();i++) {\n\t\t\tif(coordinate.get(i) == position) {\n\t\t\t\tcoordinate.remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void ergebnis(TrefferTyp ergebnisTyp, Koordinate position) {}", "private void disparaGuardian()\n {\n // Solo dispara si no hay disparo activo\n if (!disparoGuardian.getVisible()) {\n disparoGuardian.setPosicion(guardian.getPosicionX() + ((guardian.getAncho() - disparoGuardian.getAncho()) / 2), guardian.getPosicionY() - guardian.getAlto());\n disparoGuardian.setVisible(true);\n }\n }", "void removeBall(Coordinates at);", "public void delsal(String idi) {\n\t\tourDatabase.delete(DATABASE_TABLE2, Sales_Id + \"=\" +idi, null);\n\t\t\n\t}", "public abstract boolean dropMaterial(ShortPoint2D pos, EMaterialType materialType, boolean offer, boolean forced);", "private Posicion posicionAlDesarmarMenasor(Posicion posicion) {\n\t\t\t\tPosicion posAux;\n\t\t\t\ttry{\n\t\t\t\t\tposAux=new Posicion(posicion.getFila(),posicion.getColumna()-2);\n\t\t\t\t}catch(ErrorPosicionInvalida e){\n\t\t\t\t\tposAux=new Posicion(posicion.getFila(),posicion.getColumna()+1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn posAux;\n\t\t\t}", "private void deleteItem(int position){\n deleteItem(dataset.get(position),position);\n }", "private Position findeNahrung(Position position)\n {\n List<Position> nachbarPositionen = \n feld.nachbarpositionen(position);\n Iterator<Position> iter = nachbarPositionen.iterator();\n while(iter.hasNext()) {\n Position pos = iter.next();\n Object tier = feld.gibObjektAn(pos);\n if(tier instanceof Hase) {\n Hase hase = (Hase) tier;\n if(hase.istLebendig()) { \n hase.sterben();\n futterLevel = HASEN_NAEHRWERT;\n return pos;\n }\n }\n }\n return null;\n }", "void DropFood(){\r\n if (plateau[this.x][this.y]!='0' && this.charge!='0'){\r\n this.plateau[this.x][this.y]+=this.charge;\r\n this.charge=0;\r\n \r\n } \r\n }", "private void disparaUfo()\n {\n // Solo dispara si no hay disparo activo\n if (!disparoUfo.getVisible()) {\n // Generamos un número aleatorio para obtener el Ufo que va a disparar\n Random aleatorio = new Random();\n int ufoAleatorio;\n ufoAleatorio = aleatorio.nextInt(NUMEROUFOS);\n\n // Si el Ufo aleatorio NO está muerto dispara\n if (ufos.get(ufoAleatorio).getVisible()) {\n disparoUfo.setPosicion(ufos.get(ufoAleatorio).getPosicionX() + ((ufos.get(ufoAleatorio).getAncho() - disparoUfo.getAncho()) / 2), ufos.get(ufoAleatorio).getPosicionY() + ufos.get(ufoAleatorio).getAlto());\n disparoUfo.setVisible(true);\n }\n }\n }", "private void eliminarAux(NodoAVL<T> actual){\n NodoAVL<T> papa= actual.getPapa();\n if(actual.getHijoIzq()==null && actual.getHijoDer()==null)\n eliminaSinHijos(actual,papa); \n else{//CASO2: Nodo con un solo hijo (izq)\n NodoAVL<T> sustituto;\n if(actual.getHijoIzq()!=null && actual.getHijoDer()==null){\n sustituto= actual.getHijoIzq();\n eliminaSoloConHijoIzq(actual,papa,sustituto); \n }\n else//CASO3: Nodo con un solo hijo (der)\n if(actual.getHijoIzq()==null && actual.getHijoDer()!=null){\n sustituto= actual.getHijoDer();\n eliminaSoloConHijoDer(actual,papa, sustituto);\n }\n else //CASO4: Nodo con dos hijos\n if(actual.getHijoIzq()!=null && actual.getHijoDer()!=null)\n eliminaConDosHijos(actual);\n }\n \n }", "public void removedatFeed(int pos) {\n\n //on positive click we delete the feed from selected position\n\n //we're gonna delete them from the db\n //how?\n\n //using a cursor we select items from the two tables\n Cursor cursor = mydb.rawQuery(\"SELECT * FROM feedslist;\", null);\n Cursor cursor2 = mydb.rawQuery(\"SELECT * FROM subtitleslist;\", null);\n\n //set these values dynamically to avoid \"column index out of range\" errors\n\n String url = \"\";\n String name = \"\";\n\n //set url\n if (cursor != null && cursor.moveToFirst()) {\n\n while (!cursor.isAfterLast()) {\n\n //get items at selected position\n url = mUrls.get(pos);\n cursor.moveToNext();\n }\n cursor.close();\n }\n\n //set feed name\n if (cursor2 != null && cursor2.moveToFirst()) {\n\n while (!cursor2.isAfterLast()) {\n\n //we get items at selected position\n name = mFeeds.get(pos);\n cursor2.moveToNext();\n }\n cursor2.close();\n }\n\n //set the names of the two tables\n String table1 = \"feedslist\";\n String table2 = \"subtitleslist\";\n\n //set where clause\n String whereClause_url = \"url\" + \"=?\";\n String whereClause_feed = \"name\" + \"=?\";\n\n //set the where arguments\n String[] whereArgs_url = new String[]{String.valueOf(url)};\n String[] whereArgs_name = new String[]{String.valueOf(name)};\n\n //delete 'em all\n mydb.delete(table1, whereClause_url, whereArgs_url);\n mydb.delete(table2, whereClause_feed, whereArgs_name);\n\n //remove items from the dynamic ListView\n\n //for url\n mUrls.remove(pos);\n\n //for feed name\n mFeeds.remove(pos);\n\n //and update the dynamic list\n //don't move this method above the db deletion method or you'll get javalangindexoutofboundsexception-invalid-index error\n adapter_dynamic.notifyDataSetChanged();\n adapter_dynamic.notifyDataSetInvalidated();\n listfeed.setAdapter(adapter_dynamic);\n }", "public void supprimer() {\n origine.aretes_sortantes.supprimer(this);\n destination.aretes_entrantes.supprimer(this);\n origine.successeurs.supprimer(destination);\n destination.predecesseurs.supprimer(origine);\n position.supprimerElement();\n }", "public void skystonePos2() {\n }", "public void retract(){\n\t\tsolenoid1.set(false);\n\t\tsolenoid2.set(false);\n\t}", "void undo() {\r\n if (_moveCount > 0) {\r\n undoPosition();\r\n }\r\n }", "private void Drop(String[]p){\n List<DeputyTableItem> dti;\n dti = Drop1(p);\n for(DeputyTableItem item:dti){\n deputyt.deputyTable.remove(item);\n }\n }", "public boolean removeTent(Position pos){\n\t\t// remove the tent from position pos\n\t\t// return false if the attempt of removal cannot be performed\n\t\t// return true otherwise\n\t\t// assuming HashMap overhead constant, O(1)\n\t\t\n\t\tboolean decision = false;\n\t\t\n\t\tif(isValidPosition(pos)) { //If the position is valid\n\t\t\t\n\t\t\tif(grid.has(pos, treeSymbol) || grid.has(pos, tentSymbol)) { //if the element exists in the grid\n\t\t\t\t\n\t\t\t\tdecision = grid.remove(pos); //The element will be removed\n\t\t\t\t\n\t\t\t\tif(decision) {\n\t\t\t\t\treturn true;\n\t\t\t\t}else {\n\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}\n\t\treturn false;\n\n\t}", "public boolean deleteAt( int pos ) \n {\n \tint x = 0;\n \tDLLIterator cycle = new DLLIterator();\n \tDLLNode insert = cycle.currentNode;\n \t\n \twhile(x != pos){\n \t\t x++;\n \t\t insert = cycle.nextNode();\n \t\t \n \t }\n \t\n \tDLLNode next = insert.next;\n \tDLLNode prev = insert.prev;\n \t\n \tnext.prev = prev;\n \tprev.next = next;\n return true;\n }", "private void deletarLivro(Livro livro){\n //deletar livro\n myBooksDb.daoLivro().deletar(livro);\n\n //remover livro da lista\n remove(livro);\n }", "@Override\n public boolean eliminar(T dato) {\n if (esVacio())\n return (false); \n super.setRaiz(buscarAS(dato));\n int cmp = ((Comparable)dato).compareTo(super.getRaiz().getInfo()); \n //Si se encontro el elemento\n if (cmp==0){\n if (super.getRaiz().getIzq()==null){\n super.setRaiz(super.getRaiz().getDer());\n } \n else {\n NodoBin<T> x = super.getRaiz().getDer();\n super.setRaiz(super.getRaiz().getIzq());\n super.setRaiz(biselar(super.getRaiz(), dato));\n super.getRaiz().setDer(x);\n }\n return (true);\n }\n //El dato no fue encontrado\n return (false);\n }" ]
[ "0.65202093", "0.6476391", "0.62413865", "0.5904169", "0.58172286", "0.57757425", "0.57653964", "0.574326", "0.5742804", "0.5686212", "0.5630278", "0.56171554", "0.5611016", "0.55934495", "0.5593233", "0.55805707", "0.55640775", "0.5486453", "0.5421943", "0.5382547", "0.5362079", "0.5355041", "0.5329694", "0.5329694", "0.5329694", "0.5306268", "0.5301119", "0.52950025", "0.5283949", "0.52746284", "0.52687484", "0.5265131", "0.52596843", "0.52596116", "0.5259547", "0.52515966", "0.5248339", "0.5237873", "0.52292514", "0.5223762", "0.5220506", "0.52111083", "0.52102095", "0.5208681", "0.5204002", "0.5199883", "0.5191419", "0.51886284", "0.518146", "0.51762", "0.517607", "0.5173888", "0.5170203", "0.51592964", "0.51590776", "0.5153564", "0.514723", "0.5141127", "0.51410264", "0.5126697", "0.5125075", "0.51080287", "0.510658", "0.50967777", "0.50960547", "0.50934976", "0.50897944", "0.5089523", "0.50885344", "0.50865495", "0.5080961", "0.5078978", "0.50747275", "0.5070039", "0.5069786", "0.5062215", "0.5059271", "0.5051251", "0.5049107", "0.5045032", "0.5042374", "0.5028031", "0.50271785", "0.5026777", "0.5019506", "0.50182295", "0.50166386", "0.5013983", "0.4999229", "0.4998498", "0.49961436", "0.49943098", "0.4993427", "0.49908218", "0.499047", "0.4988169", "0.49865493", "0.49833265", "0.49828765", "0.49701396" ]
0.5499966
17
fait s'attaquer deux soldats entre eux
public void combat(Soldat s1, Soldat s2) throws WargameException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void enleverBrouillard(Soldat s);", "final boolean hanArribatAlFinal() {\n int cont = 0;\n for (int i = 0; i < soldats.size(); i++) {\n if (soldats.get(i).isHaArribat()) {\n cont++;\n }\n }\n\n if (cont == soldats.size()) {\n\n return true;\n }\n\n return false;\n\n }", "public boolean buy() throws Exception {\n\n int jogador = this.jogadorAtual();\n\n String lugar = this.tabuleiro.getPlaceName(posicoes[jogador]);\n // System.out.println(\"lugar[jogador]\" + lugar);\n boolean posicaoCompravel = this.posicaoCompravel(posicoes[jogador]);\n boolean isEstatal = this.isPosicaoEstatal(this.posicoes[jogador]);\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true && verificaSeServicoPublicoFoiComprado(this.posicoes[jogador]))) {\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true)) {\n this.listaJogadores.get(jogadorAtual()).addQuantidadeCompanhias();\n\n }\n int posicaoTabuleiro = posicoes[jogador];\n int preco = this.tabuleiro.getLugarPrecoCompra(posicaoTabuleiro);\n Jogador j = listaJogadores.get(jogador);\n this.terminarAVez();\n if (preco <= j.getDinheiro()) {\n this.print(\"\\tPossui dinheiro para a compra!\");\n j.retirarDinheiro(preco);\n this.Donos.put(posicaoTabuleiro, j.getNome());\n\n String nomeLugar = this.tabuleiro.getPlaceName(posicaoTabuleiro);\n j.addPropriedade(nomeLugar);\n if (nomeLugar.equals(\"Reading Railroad\") || nomeLugar.equals(\"Pennsylvania Railroad\") ||\n nomeLugar.equals(\"B & O Railroad\") || nomeLugar.equals(\"Short Line Railroad\")) {\n DonosFerrovias[jogador]++;\n }\n this.print(\"\\tVocê adquiriu \" + nomeLugar + \" por \" + preco);\n this.print(\"\\tAtual dinheiro: \" + j.getDinheiro());\n if (j.temPropriedades() && hipotecaAtiva) {\n j.adicionarComandoHipotecar();\n }\n if (j.verificaSeTemGrupo(posicaoTabuleiro)) {\n if (this.build == true) {\n j.adicionarComandoBuild();\n }\n\n this.tabuleiro.duplicarAluguelGrupo(posicaoTabuleiro);\n\n }\n } else {\n this.print(\"\\tNão possui dinheiro para realizar a compra!\");\n throw new Exception(\"Not enough money\");\n }\n\n } else {\n\n if (this.jaTemDono(posicoes[jogador])) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n\n if (isEstatal && this.publicServices == false) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n if (!posicaoCompravel) {\n throw new Exception(\"Place doesn't have a deed to be bought\");\n }\n }\n\n\n\n return false;\n\n\n\n }", "@Test\n public void notSell() {\n Game game = Game.getInstance();\n Player player = new Player(\"ED\", 4, 4, 4,\n 4, SolarSystems.GHAVI);\n game.setPlayer(player);\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(2, Goods.Water));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Food));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(0, Goods.Furs));\n CargoItem good = game.getPlayer().getShip().getShipCargo().get(2);\n \n int oldCredits = game.getPlayer().getCredits();\n good.getGood().sell(good.getGood(), 1);\n \n CargoItem water = game.getPlayer().getShip().getShipCargo().get(0);\n CargoItem food = game.getPlayer().getShip().getShipCargo().get(1);\n water.setQuantity(2);\n food.setQuantity(1);\n good.setQuantity(0);\n //int P = good.getGood().getPrice(1);\n int curr = game.getPlayer().getCredits();\n //boolean qn = water.getQuantity() == 2 && food.getQuantity() == 1 && good.getQuantity() == 0;\n boolean check = water.getQuantity() == 2;\n System.out.print(curr);\n assertEquals(curr, oldCredits);\n }", "private void checkDutchAuctions() {\n TypedQuery<Auction> namedQuery = getAuctionByTypeQuery(AuctionType.DUTCH);\n\n List<Auction> resultList = namedQuery.getResultList();\n for (Auction auction : resultList) {\n\n List<Bidder> bidder = auction.getBidder();\n if (bidder.size() > 1\n && auction.getPrice().subtract(dutchAuctionSubtrahent).intValue() > 0) {\n auction.setPrice(\n new BigDecimal(\n String.valueOf(auction.getPrice().subtract(dutchAuctionSubtrahent))));\n }\n }\n }", "public void itemsSold() {\n quanitySnacks--;\n }", "public void trade(CheeseConnoisseur c) {\n try {\n if (this.hold.getType() == null || c.hold.getType() == null) {\n CheeseConnoisseur n = this;\n } else if (this.hold.equals(c.hold)) {\n CheeseConnoisseur n = this;\n } else {\n CheeseConnoisseur higher = this.hold.getPrice() > c.hold.getPrice() ? this : c;\n CheeseConnoisseur lower = this.hold.getPrice() < c.hold.getPrice() ? this : c;\n double diff = higher.hold.getPrice() - lower.hold.getPrice();\n System.out.println(diff);\n if (this.hold.getPrice() > c.hold.getPrice() && c.money >= diff) {\n c.money -= diff;\n this.money += diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else if (this.hold.getPrice() < c.hold.getPrice() && this.money >= diff) {\n c.money += diff;\n this.money -= diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else {\n CheeseConnoisseur n = this;\n }\n }\n } catch (Exception e) {\n System.out.println(\"Fail to trade\");\n }\n\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "@Test\n public void testSell() {\n Game game = Game.getInstance();\n Player player = new Player(\"Chisom\", 2, 2, 2,\n 2, SolarSystems.SOMEBI);\n game.setPlayer(player);\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(2, Goods.Water));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Food));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Furs));\n CargoItem good = game.getPlayer().getShip().getShipCargo().get(2);\n good.getGood().sell(good.getGood(), 1);\n CargoItem water = game.getPlayer().getShip().getShipCargo().get(0);\n water.setQuantity(2);\n CargoItem food = game.getPlayer().getShip().getShipCargo().get(1);\n food.setQuantity(1);\n good.setQuantity(0);\n int P = good.getGood().getPrice(1);\n int total = game.getPlayer().getCredits();\n boolean quan = water.getQuantity() == 2 && food.getQuantity() == 1 && good.getQuantity() == 0;\n boolean check = water.getQuantity() == 2;\n System.out.print(total);\n assertTrue(quan && total == 1560);\n //assertEquals(true, quan && total == 1560);\n }", "Couple[] Exchange (Couple[] v,Gift[] G) throws IOException{\n \n \n int i;\n String y;\n int s = 0;\n int e = 99;\n \n for (i = 0; i < 10; i++) {\n \n y = v[i].btype;\n \n \n if (\"Generous\" == y) {\n \n if ((v[i].spend <= v[i].bd)) {\n \n if (v[i].spend <= v[i].m) {\n \n v[i].lc = v[i].lc + 1;\n v[i].lv = v[i].lv + G[e].price;\n v[i].spend = v[i].spend +G[e].price;\n e--;\n \n }else {\n \n v[i].lc = v[i].lc + 1;\n v[i].lv = v[i].lv + G[e].price;\n v[i].spend = v[i].spend +G[e].price;\n v[i].extra = v[i].extra + G[e].price;\n e--;\n \n \n }\n \n }\n \n }else if (\"Miser\" == y) {\n \n if (v[i].spend <= v[i].m) {\n \n v[i].spend = v[i].spend + G[s].price;\n s++;\n }\n \n \n }else if (\"Geeky\" == y) {\n \n if (v[i].spend <= v[i].m) {\n \n v[i].spend = v[i].spend + G[s].price;\n s++;\n }else {\n \n v[i].spend = v[i].spend + G[e].price;\n v[i].extra = v[i].extra + G[e].price;\n \n } \n }\n \n \n \n }\n\n return v;\n}", "public void calculateSale()\n {\n double total = 0.00;\n int numTimbits = 0;\n int numDoughnuts = 0;\n int smallCoffee = 0;\n int mediumCoffee = 0;\n int largeCoffee = 0;\n String order;\n \n for(int i = 0; salesItem[i] != null && i < salesItem.length; i++)\n {\n if(salesItem[i] instanceof Timbit) \n {\n numTimbits = numTimbits + salesItem[i].getNumOfItems();\n }\n else if(salesItem[i] instanceof Doughnut)\n {\n numDoughnuts = numDoughnuts + salesItem[i].getNumOfItems();\n }\n else if(salesItem[i] instanceof Coffee)\n {\n if(salesItem[i].getNumOfItems()==1)\n {\n smallCoffee ++;\n }\n else if(salesItem[i].getNumOfItems()==2)\n {\n mediumCoffee ++;\n }\n else\n {\n largeCoffee ++;\n }\n }\n \n total += salesItem[i].getFinalPrice();\n }\n \n order = \"Timbits: \" + numTimbits + \"\\nDoughnuts: \" + numDoughnuts + \"\\nSmall Coffees: \" + smallCoffee + \"\\nMedium Coffees: \" + mediumCoffee + \"\\nLarge Coffees: \" + largeCoffee ; \n showText(order + String.format(\"\\nTotal Price: $%5.2f\", total), 150, 175);\n }", "int compteMonstres(Soldat unites[][]);", "private boolean shiboudeDeRavNosson(ArrayList<Gelt> m_gelts, ArrayList<Gelt> m_geltHelper, Gelt m_gelt) {\n\t\tplay.Logger.info(\"shiboude De Rav Nosson Algorithm Started\");\n\t\tboolean isUpdate = false;\n\t\tfor (Gelt currGelt : m_gelts) {\n\t\t\tif (!isUpdate) {\n\t\t\t\tif ((currGelt.getDebterID() == m_gelt.getEntitledID()) && (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tint nNewAmount = currGelt.getAmount() - m_gelt.getAmount();\n\t\t\t\t\tif (nNewAmount == 0) {\n\t\t\t\t\t\tcurrGelt.setnDebterID(m_gelt.getDebterID());\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount > 0)) {\n\t\t\t\t\t\tcurrGelt.setnAmount(nNewAmount);\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), m_gelt.getAmount(), currGelt.getEntitledID(),\n\t\t\t\t\t\t\t\tcurrGelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount < 0)) {\n\t\t\t\t\t\tcurrGelt.setnDebterID(m_gelt.getDebterID());\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), Math.abs(nNewAmount), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tcurrGelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t} else if ((currGelt.getEntitledID() == m_gelt.getDebterID()) && (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tint nNewAmount = currGelt.getAmount() - m_gelt.getAmount();\n\t\t\t\t\tif (nNewAmount == 0) {\n\t\t\t\t\t\tcurrGelt.setnEntitledID(m_gelt.getEntitledID());\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount > 0)) {\n\t\t\t\t\t\tcurrGelt.setnAmount(nNewAmount);\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(currGelt.getDebterID(), m_gelt.getAmount(), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tm_gelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t} else if ((nNewAmount < 0)) {\n\t\t\t\t\t\tcurrGelt.setnEntitledID(m_gelt.getEntitledID());\n\n\t\t\t\t\t\tGelt geltToAdd = new Gelt(m_gelt.getDebterID(), Math.abs(nNewAmount), m_gelt.getEntitledID(),\n\t\t\t\t\t\t\t\tm_gelt.getGroupID());\n\t\t\t\t\t\tif ((!foundChavrousse(m_gelts, geltToAdd))\n\t\t\t\t\t\t\t\t&& (!foundSheyteGomour(m_gelts, m_geltHelper, geltToAdd))) {\n\t\t\t\t\t\t\tm_geltHelper.add(geltToAdd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisUpdate = true;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn isUpdate;\n\t}", "int main()\n{\n int f_amt,f_dis,f_shp,s_amt,s_dis,s_shp,a_amt,a_dis,a_shp,f_tot,s_tot,a_tot;\n std::cin>>f_amt>>f_dis>>f_shp>>s_amt>>s_dis>>s_shp>>a_amt>>a_dis>>a_shp;\n f_dis=(f_amt/100)*f_dis;\n s_dis=(s_amt/100)*s_dis;\n a_dis=(a_amt/100)*a_dis;\n f_tot=(f_amt-f_dis)+f_shp;\n s_tot=(s_amt-s_dis)+s_shp;\n a_tot=(a_amt-a_dis)+a_shp;\n std::cout<<\"In Flipkart Rs.\"<<f_tot;\n std::cout<<\"\\nIn Snapdeal Rs.\"<<s_tot;\n std::cout<<\"\\nIn Amazon Rs.\"<<a_tot;\n if((f_tot<s_tot)&&(f_tot<a_tot)||(f_tot==s_tot)&&(f_tot<a_tot)){\n std::cout<<\"\\nHe will prefer Flipkart\";\n }\n else if((s_tot<f_tot)&&(s_tot<a_tot)||(s_tot==a_tot)&&(s_tot<f_tot)){\n std::cout<<\"\\nHe will prefer Snapdeal\";\n \n }\n else if((a_tot<f_tot)&&(a_tot<s_tot)){\n std::cout<<\"\\nHe will prefer Amazon\";\n }\n}", "public HashMap<String, ArrayList[]> determineSale() {\n HashMap<String, ArrayList[]> ordersMap = new HashMap<>();\n ordersMap.put(\"ms\", new ArrayList<Integer>[2]);\n ordersMap.put(\"gs\", new ArrayList<Integer>[2]);\n ordersMap.put(\"xlf\", new ArrayList<Integer>[2]);\n ordersMap.put(\"wfc\", new ArrayList<Integer>[2]);\n ordersMap.put(\"bond\", new ArrayList<Integer>[2]);\n\n Integer temp;\n int ind = 0;\n ArrayList<Integer> prices = ordersMap.get(\"bond\")[0];\n ArrayList<Integer> quantities = ordersMap.get(\"bond\")[1];\n for (int i = 0; i < 3; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"gs\")[0];\n quantities = ordersMap.get(\"gs\")[1];\n for (int i = 0; i < 2; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n } \n ind = 0;\n prices = ordersMap.get(\"ms\")[0];\n quantities = ordersMap.get(\"ms\")[1]; \n for (int i = 0; i < 3; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"wfc\")[0];\n quantities = ordersMap.get(\"wfc\")[1]; \n for (int i = 0; i < 2; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);;\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"xlf\")[0];\n quantities = ordersMap.get(\"xlf\")[1]; \n for (int i = 0; i < 10; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n return ordersMap;\n }", "public void sleutelWaarde(){\n if(sleutel100.getX() == speler.getX() && sleutel100.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel100.getWaarde());\n }\n else if(sleutel1002.getX() == speler.getX() && sleutel1002.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel1002.getWaarde());\n }\n else if(sleutel200.getX() == speler.getX() && sleutel200.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel200.getWaarde());\n }\n else if(sleutel300.getX() == speler.getX() && sleutel300.getY() == speler.getY() && veld[speler.getY()][speler.getX()] == 1){\n speler.setSleutelWaarde(sleutel300.getWaarde());\n }\n }", "public int fondMagasin(){\n\tint total =this.jeton;\n\tfor(Caisse c1 : this.lesCaisses){\n\ttotal = c1.getTotal()+total;\n\t}\n\treturn total;\n}", "public void calculateEarnings(){\n if (wages.size() > expenses.size()){\n //check size difference\n int sizeUp = wages.size() - expenses.size();\n for(int i = 0; i < sizeUp; i++){\n //add zero(s) to expenses to match up(this assumes no expenses for the week(s))\n expenses.add(BigDecimal.ZERO);\n }\n }\n\n if(expenses.size() > wages.size()){\n //check size difference\n int sizeUp = expenses.size() - wages.size();\n for(int i = 0; i < sizeUp; i++){\n //add zero(s) to expenses to match up(this assumes no income for the week(s))\n wages.add(BigDecimal.ZERO);\n }\n }\n for(int i=0; i < wages.size(); i++){\n BigDecimal profits;\n profits = wages.get(i).subtract(expenses.get(i));\n BigDecimal roundUp = profits.setScale(2, RoundingMode.HALF_UP);\n earningsList.add(roundUp);\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tSistemaStock sistema=new SistemaStock();\n\t\t\n\t\tProducto producto1=new Producto(1,\"Producto 1\",20.5);\n Producto producto2=new Producto(2,\"Producto 2\",15.5);\n System.out.println(producto1+\"\\n\"+producto2); \n try {\n\t\t\tsistema.agregarProducto(producto1.getDescripcion(),producto1.getPrecioUnitario());\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n System.out.println(sistema.getProductos().toString());\n Sucursal sucursal1=new Sucursal(1,\"direccion 1\");\n Sucursal sucursal2=new Sucursal(2,\"direccion 2\");\n\t\ttry {\n\t\t\tsistema.agregarSucursal(sucursal1.getDireccion());\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tEmpleado empleado1=new Empleado(\"Juan\",\"Gomez\",11111111,sucursal1);\n\t\tEmpleado empleado2=new Empleado(\"Julian\",\"Suarez\",22222222,sucursal2);\n\t\tSystem.out.println(empleado1+\"\\n\"+empleado2);\n\t\t\n\t\tLote lote1=new Lote(sucursal1, producto1,LocalDate.of(2019, 10, 1),100,100,true);\n\t Lote lote2=new Lote(sucursal1,producto2,LocalDate.of(2019,10,1),50,50,true);\n\t Lote lote3=new Lote(sucursal1,producto1,LocalDate.of(2019,10,3),40,40,true);\n\t Lote lote4=new Lote(sucursal2,producto1,LocalDate.of(2019, 10, 2),80,80,true);\n\t Lote lote5=new Lote(sucursal2, producto2,LocalDate.of(2019,10, 2),80,80,true);\n\t System.out.println(lote1+\"\\n\"+lote2+\"\\n\"+lote3+\"\\n\"+lote4+\"\\n\"+lote5);\n\t \n\t sucursal1.getLotes().add(lote1);\n\t sucursal1.getLotes().add(lote2);\n\t sucursal1.getLotes().add(lote3);\n\t sucursal2.getLotes().add(lote4);\n\t sucursal2.getLotes().add(lote5);\n\t \n\t \n\t System.out.println(\"Cantidad: \"+sucursal1.traerCantidad(producto1));\n\t System.out.println(\"Validar Stock: \"+sucursal1.validarConsumo(producto1, 80));\n\t \n\t \n\t \n\t \n\t sistema.getSucursales().add(sucursal1);\n\t sistema.getSucursales().add(sucursal2);\n\t \n\t Remito remito1=new Remito(LocalDate.of(2019,10,5),producto1,80,empleado1,\"Forma de pago 1\");\n\t Remito remito2=new Remito(LocalDate.of(2019,10,5).plusDays(1),producto1,80,empleado1,\"Forma de pago 1\");\n\t System.out.println(remito1);\n\t System.out.println(remito2);\n\t \n\t try {\n\t\t\tSystem.out.println(\"Remito Generado: \"+sistema.generarRemitoDeConsumo(LocalDate.of(2019,10,5),producto1,500,empleado1,\"Forma de pago 1\"));\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t \n try {\n\t\tSystem.out.println(\"Remito Sucursal: \"+sistema.generarRemitoDeConsumo(sucursal1,LocalDate.of(2019,10,5),producto1,500,empleado1,\"Forma de pago 1\"));\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t \n\t \n\t}", "public void confirmerAppel(List<Eleve> listeElevesAbsents, Seance s, Groupe g);", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "public TransationRecords sellProduct(String species, int number) {\n HashMap<String , List<HashMap<String,String >>> productInfo = new HashMap<>();\n productInfo = productList.getProductInfo();\n if (species.equals(\"CHICKEN\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.chickenList.size(); i++) {\n if (productList.chickenList.get(i).getLifestage() == Animal.LifeStage.ADULT) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.chickenList.size(); i++) {\n int value = new Chicken().getSellValue();\n if (productList.chickenList.get(i).getLifestage() == Animal.LifeStage.ADULT) {\n hasSoldNumber++;\n productList.chickenList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"CHICKEN\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"DOG\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.dogList.size(); i++) {\n if (productList.dogList.get(i).getLifestage() == Animal.LifeStage.ADULT) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.dogList.size(); i++) {\n int value = new Dog().getSellValue();\n if (productList.dogList.get(i).getLifestage() == Animal.LifeStage.ADULT) {\n hasSoldNumber++;\n productList.dogList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"DOG\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"PERCH\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.perchList.size(); i++) {\n if (productList.perchList.get(number).getLifestage() == Animal.LifeStage.ADULT) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.perchList.size(); i++) {\n int value = new Perch().getSellValue();\n if (productList.perchList.get(i).getLifestage() == Animal.LifeStage.ADULT) {\n hasSoldNumber++;\n productList.perchList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"PERCH\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"APPLE\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.appleList.size(); i++) {\n if (productList.appleList.get(i).getPlantState().equals(\"Harvestable\")) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.appleList.size(); i++) {\n int value = new Apple().getSellValue();\n if (productList.appleList.get(i).getPlantState().equals(\"Harvestable\")) {\n hasSoldNumber++;\n productList.appleList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"APPLE\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"CHERRY\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.cherryList.size(); i++) {\n if (productList.cherryList.get(i).getPlantState().equals(\"Harvestable\")) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.cherryList.size(); i++) {\n int value = new Cherry().getSellValue();\n if (productList.cherryList.get(i).getPlantState().equals(\"Harvestable\")) {\n hasSoldNumber++;\n productList.cherryList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"CHERRY\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"POTATO\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.potatoList.size(); i++) {\n if (productList.potatoList.get(i).getPlantState().equals(\"Harvestable\")) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.potatoList.size(); i++) {\n int value = new Potato().getSellValue();\n if (productList.potatoList.get(i).getPlantState().equals(\"Harvestable\")) {\n hasSoldNumber++;\n productList.potatoList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"POTATO\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n } else if (species.equals(\"TOMATO\")) {\n int numberBeSold = 0;\n for (int i = 0; i < productList.tomatoList.size(); i++) {\n if (productList.tomatoList.get(i).getPlantState().equals(\"Harvestable\")) {\n numberBeSold++;\n }\n }\n if (numberBeSold < number) {\n System.out.println(\"Exceeding the maximum quantity available for sale!\");\n return emptyRecords;\n }\n int hasSoldNumber = 0;\n for (int i = 0; i < productList.tomatoList.size(); i++) {\n int value = new Tomato().getSellValue();\n if (productList.tomatoList.get(i).getPlantState().equals(\"Harvestable\")) {\n hasSoldNumber++;\n productList.tomatoList.remove(i);\n this.farmOwner.addMoney(value);\n }\n if (hasSoldNumber == number) {\n return new TransationRecords(\"TOMATO\", TransationRecords.SellOrBuy.SELL,\n number, value, (int) this.farmOwner.getMoney(), productInfo);\n }\n }\n }\n return emptyRecords;\n }", "public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }", "public static void main(String[] args) {\n\n\t\t// hier wird eine Soldatin mit dem default-Konstruktor\n\t\tSoldat soldatErika = new Soldat();\n\t\t\n\t\t//Das konkrete Objekt: soldatErika, ruft das Verhalten/Methode: halloAnAlle() auf.\n\t\tsoldatErika.halloAnAlle();\n\n\t\t// hier wird ein Soldat mit einen anderen Konstruktor (benötigt in den Parametern das alter, name, aktennummer)\n\t\t// erstellt. \n\t\tSoldat soldatPaul = new Soldat(25, \"Paul Seer\", 1);\n\t\t\n\t\t//Das konkrete Objekt: soldatPaul, ruft die Verhalten/Methode: halloAnAlle() auf.\n\t\tsoldatPaul.halloAnAlle();\n\n\t\t//hier wird das alter des konkreten Objekts soldatPaul mit hilfe der Methode getAlter() aufgerufen und auf der Konsole ausgegeben.\n\t\tSystem.out.println(\"das Alter von soldat2 ist: \"\n\t\t\t\t+ soldatPaul.getAlter());\n\n\t\t//hier wird die Personalakte mit inhalt gefüllt. dabei wird erst eine Methode in der Klasse Soldat und dann in der Klasse PersonalAkte aufgerufen.\n\t\tsoldatPaul\n\t\t\t\t.inhaltInAkteHinzufuegen(\"momentan manchmal schlecht gelaunt\");\n\n\t\t//methoden aufruf wirdAelter; dabei wird das Attribut alter zur Laufzeit verändert.\n\t\tsoldatPaul.wirdAelter();\n\t\t\n\t\tsoldatPaul.halloAnAlle();\n\n\t\t//hier wird die logig der methode: wirdAelter(int neuesAlter) auf ihre Funktion getestet\n\t\tsoldatPaul.wirdAelter(12);\n\t\tsoldatPaul.halloAnAlle();\n\n\t\t// direkter zugriff auf die Methode, ohne Objekt der Klasse Helperclass\n\t\t//dabei bekommt die Methode einen String übergeben und gibt diesen auf der Konsole aus\n\t\tHelperClass.consolenAusgabe(\"Test ausgabe\");\n\n\t}", "public static void main(String[] args) {\n int moneyAmount = 10;\n\n int capuccinoPrice = 180;\n int lattePrice = 120;\n int espressoPrice = 80;\n int pureWaterPrise = 20;\n\n var canBuyAnything = false;\n var isMilkEnough = true;\n\n if(moneyAmount >= capuccinoPrice && isMilkEnough) {\n System.out.println(\"Вы можете купить капуччино\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= lattePrice && isMilkEnough) {\n System.out.println(\"Вы можете купить латте\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= espressoPrice) {\n System.out.println(\"Вы можете купить еспрессо\");\n canBuyAnything = true;\n }\n\n if(moneyAmount >= pureWaterPrise) {\n System.out.println(\"Вы можете купить воду\");\n canBuyAnything = true;\n }\n\n if(canBuyAnything == false) {\n System.out.println(\"Недостаточно денег\");\n }\n }", "public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }", "public boolean deplacerSoldat(Position pos, Soldat soldat) throws WargameException;", "public void updateKetraVarka() {\n if (ItemFunctions.getItemCount(this, 7215) > 0) {\n _ketra = 5;\n } else if (ItemFunctions.getItemCount(this, 7214) > 0) {\n _ketra = 4;\n } else if (ItemFunctions.getItemCount(this, 7213) > 0) {\n _ketra = 3;\n } else if (ItemFunctions.getItemCount(this, 7212) > 0) {\n _ketra = 2;\n } else if (ItemFunctions.getItemCount(this, 7211) > 0) {\n _ketra = 1;\n } else if (ItemFunctions.getItemCount(this, 7225) > 0) {\n _varka = 5;\n } else if (ItemFunctions.getItemCount(this, 7224) > 0) {\n _varka = 4;\n } else if (ItemFunctions.getItemCount(this, 7223) > 0) {\n _varka = 3;\n } else if (ItemFunctions.getItemCount(this, 7222) > 0) {\n _varka = 2;\n } else if (ItemFunctions.getItemCount(this, 7221) > 0) {\n _varka = 1;\n } else {\n _varka = 0;\n _ketra = 0;\n }\n }", "public static void setPrice() {\n double summe = 0.0;\n for (Object obj : dlm.getDisplayedArtikel()) {\n if (obj instanceof Article) {\n Article art = (Article) obj;\n if (!art.isIsAbfrage()) {\n if (((art.isJugendSchutz() && art.isJugendSchutzOk())) || !art.isJugendSchutz()) {\n if (art.isEloadingAmmountOk() && !art.isPriceZero()) {\n summe += ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n }\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe += card.getAufladung() / 100;\n }\n }\n for (Object obj : dlm.getRemovedObjects()) {\n if (obj instanceof Article) {\n if (!((Article) ((obj))).isStorno_error()) {\n summe -= ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe -= card.getAufladung() / 100;\n }\n }\n if (Math.round(summe) == 0) {\n summe = 0;\n }\n if (GUIOperations.isTraining()) {\n summe += 1000;\n }\n tfSumme.setText(String.format(\"%.2f\", summe));\n }", "public void rekenAf(Dienblad dienblad, LocalDate date) {\n\n int artikelenopdienblad = getAantalArtikelenOpDienblad(dienblad);\n\n // Factuur wordt aangemaakt, deze berekent automatisch zelf de totaalprijs (ook korting).\n factuur = new Factuur(dienblad, date);\n\n System.out.println(factuur.toString());\n\n double totaalprijs = factuur.getTotaal();\n\n // Saldo wordt gecheckt, en indien toereikend wordt er geld van de klant naar de kassa overgemaakt.\n // Als saldo niet toereikend is dan vertrekt de klant zonder iets te kopen. Hoe dan ook komt hierna de volgende klant.\n EntityTransaction tx = null;\n try {\n dienblad.getKlant().getBetaalwijze().betaal(totaalprijs);\n aantalartikelen += artikelenopdienblad;\n geld += totaalprijs;\n tx = manager.getTransaction();\n tx.begin();\n manager.persist(factuur);\n } catch(TeWeinigGeldException e) {\n System.out.println(e + dienblad.getKlant().getVoornaam() + \" \" + dienblad.getKlant().getAchternaam());\n }\n if (tx != null) {\n tx.commit();\n }\n aantalklanten++;\n kassarij.naarVolgendeKlant();\n }", "public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }", "public void recibirAtaque(Integer danio) {\n List<Soldado> eliminados = new ArrayList<Soldado>();\n for (Soldado soldado : soldados) {\n if (danio > 0) {\n danio = soldado.recibirAtaque(danio);\n if (soldado.getVida() <= 0) {\n eliminados.add(soldado);\n }\n } else {\n break;\n }\n }\n eliminarSoldados(eliminados);\n }", "private int calculatePrice(boolean addWhippedCream, boolean addChocolate,boolean takeAway) {\r\n int price=20;\r\n if (addWhippedCream){\r\n price=price+5;\r\n }\r\n\r\n if (addChocolate){\r\n price=price+7;\r\n }\r\n if (takeAway){\r\n price=price+2;\r\n }\r\n\r\n\r\n return quantity*price;\r\n\r\n }", "@Test\n public void verifyOffersApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tProduct product2 = new Product(\"Apple\", 0.2);\n \tProduct product3 = new Product(\"Orange\", 0.5);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 6);\n \tbasket.getProducts().put(product2, 4);\n \tbasket.getProducts().put(product3, 5);\n \tassertTrue(\"Have to get the price of 15 items = 6.1 ==> \", (calculator.calculatePrice(basket) - 6.1) < 0.0001);\n }", "public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}", "@Override\n public void atacar(SoldadoDeInfanteria soldado, Pieza receptor) {\n }", "public void fillBasket(_essentialGift[] esGifts, _utilityGift[] uGifts, _luxuryGift[] lGifts) {\r\n \r\n this.gbasket = new _giftBasket();\r\n esGifts = _staticFunctions.sortByCost(esGifts);\r\n uGifts = _staticFunctions.sortByCost(uGifts);\r\n lGifts = _staticFunctions.sortByCost(lGifts);\r\n \r\n int grlBudget = 0;\r\n \r\n switch(this.grlType){\r\n case \"The Chosy\":\r\n grlBudget = this.chGrlfrnd.Budget;\r\n break;\r\n case \"The Normal\":\r\n grlBudget = this.nGrlfrnd.Budget;\r\n break;\r\n case \"The Desperate\":\r\n grlBudget = this.dsGrlfrnd.Budget;\r\n break;\r\n }\r\n \r\n double prc = 0;\r\n int esIdx = 0;\r\n int uIdx = 0;\r\n int lIdx = 0;\r\n int eItIdx = 0;\r\n int uItIdx = 0;\r\n int lItIdx = 0;\r\n \r\n \r\n while(prc < grlBudget && (esIdx < _staticFunctions.length(esGifts) || uIdx < _staticFunctions.length(uGifts))){\r\n if((esIdx < _staticFunctions.length(esGifts) && uIdx >= _staticFunctions.length(uGifts))||\r\n (esIdx < _staticFunctions.length(esGifts) && uIdx < _staticFunctions.length(uGifts) && esGifts[esIdx].price/esGifts[esIdx].value < uGifts[uIdx].price/uGifts[uIdx].value)){\r\n this.gbasket.eItems[eItIdx] = esGifts[esIdx];\r\n prc += esGifts[esIdx].price;\r\n eItIdx++;\r\n esIdx++;\r\n }\r\n \r\n else if(uIdx < _staticFunctions.length(uGifts)){\r\n this.gbasket.uItems[uItIdx] = uGifts[uIdx];\r\n prc += uGifts[uIdx].price;\r\n uItIdx++;\r\n uIdx++;\r\n }\r\n \r\n }\r\n\r\n while(lIdx < _staticFunctions.length(lGifts) && prc < grlBudget){\r\n this.gbasket.lItems[lItIdx] = lGifts[lIdx];\r\n prc += lGifts[lIdx].price;\r\n lIdx++;\r\n lItIdx++;\r\n } \r\n \r\n if(lItIdx == 0 && ( lGifts[0].price <= (this.Budget - prc) ) ){\r\n this.gbasket.lItems[lItIdx] = lGifts[0]; \r\n }\r\n \r\n }", "@Override\n\tpublic void eats() {\n\t\t\n\t}", "public void toilette() {\n if (!autoriseOperation()) {\n return;\n }\n incrSale(-3);\n incrHumeur(1);\n incrXp(1);\n\n setChanged();\n notifyObservers();\n }", "public void descontarStock(ComidaDeAnimal tipoDeComida, int cantidadKilos) {\n\t\t\n\t\tif (tipoDeComida.equals(baldeCalamares)) {\n\t\t\tint nuevoStock= this.baldeCalamares.getStock()-cantidadKilos;\n\t\t\tthis.baldeCalamares.setStock(nuevoStock);\n\t\t}\n\n\t\tif (tipoDeComida.equals(baldeCangrejos)) {\n\t\t\tint nuevoStock= this.baldeCangrejos.getStock()-cantidadKilos;\n\t\t\tthis.baldeCangrejos.setStock(nuevoStock);\n\t\t}\n\n\t\tif (tipoDeComida.equals(baldePulpos)) {\n\t\t\tint nuevoStock= this.baldePulpos.getStock()-cantidadKilos;\n\t\t\tthis.baldePulpos.setStock(nuevoStock);\n\t\t}\n\t\t\n\t}", "private boolean checkStock(){\n int i;\n int inventorySize = inventory.size();\n int count = 0;\n for(i = 0; i < inventorySize; i++){\n count = count + inventory.get(i).getStock();\n\n }\n //System.out.println(\"Count was: \" + count);\n if(count < 1){\n return false;\n }else{\n return true;\n }\n }", "public void reestablecerFullStock() { \n bodega Bodega = new bodega();\n Bodega.setProductosList(this.bodegaDefault());\n }", "private void balancearAgrega(Vertice<T> v){\n\tif(v == this.raiz){\n\t v.color = Color.NEGRO;\n\t return;\n\t}else if(v.padre.getColor() == Color.NEGRO){\n\t return;\n\t}\n\tVertice<T> abuelo = v.padre.padre;\n\tif(v.padre == abuelo.derecho){\n\t if(abuelo.izquierdo != null &&\n\t abuelo.izquierdo.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.izquierdo.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\t \n\t }else if(v.padre.izquierdo == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraDerecha(v.padre);\n\t\tbalancearAgrega(v2); \n\t }else if(v.padre.derecho == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraIzquierda(abuelo);\n\t }\n\t}else if(v.padre == abuelo.izquierdo){\n\t if(abuelo.derecho != null &&\n\t abuelo.derecho.getColor() == Color.ROJO){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.derecho.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tbalancearAgrega(abuelo);\n\t\treturn;\n\t }else if(v.padre.derecho == v){\n\t\tVertice<T> v2 = v.padre;\n\t\tsuper.giraIzquierda(v.padre);\n\t\tbalancearAgrega(v2); \n\t \n\t }else if(v.padre.izquierdo == v){\n\t\tv.padre.color = Color.NEGRO;\n\t\tabuelo.color = Color.ROJO;\n\t\tsuper.giraDerecha(abuelo);\n\t }\n\t} \t\n\t\n }", "@Test\n public void amountGreatherThanItemsPrice() {\n Coupon coupon = couponService.calculateCoupon(Arrays.asList(MLA1),PRICE_MLA1+PRICE_MLA2);\n assertEquals(1, coupon.itemsIds().size());\n assertEquals(MLA1, coupon.itemsIds().get(0));\n assertEquals(PRICE_MLA1, coupon.total());\n }", "private int calculatePrice(boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows) {\n int basePrice = 5;\n if (addWhippedCream){\n basePrice = basePrice + 1;\n }\n if (addChocolate){\n basePrice = basePrice + 1;\n }\n if (addCinnamon){\n basePrice = basePrice + 1;\n }\n if (addMarshmallows){\n basePrice = basePrice + 1;\n }\n return quantity * basePrice;\n\n }", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "public void aumentaInSitu(){\n if(quantidade_in_situ<quantidade_disponivel)\n quantidade_in_situ++;\n else\n return;\n }", "public static void addArticle() {\n double summe = 0.0;\n if (!payProcessStarted) {\n int[] indexes = taArtikel.getSelectedRows();\n for (int index : indexes) {\n GUIOperations.getRecorderXml().setIsPayment(true);\n //Artikel, der eingefügt wird\n Article tmp = atm.getFilteredArtikels().get(index);\n double price = 0.0;\n if (tmp.getPreis() == 0.0) {\n try {\n int help = Integer.parseInt(\n JOptionPane.showInputDialog(mainframe.getParent(),\n \"Bitte geben Sie den Preis für das Produkt \" + tmp.getArticleName() + \" ein (in Cent)\"));\n price = help / 100.0;\n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(mainframe.getParent(), \"Artikel konnte nicht eingefügt werden, \"\n + \"da keine valide Zahl eingegeben worden ist\");\n continue;\n }\n } else {\n price = tmp.getPreis();\n }\n if (recorderXml.getBonStornoType() != -1) {\n WarenruecknahmePreisDlg wpdlg = new WarenruecknahmePreisDlg(mainframe, true, tmp.getPreis());\n wpdlg.setVisible(true);\n price = wpdlg.getPreis();\n price *= -1;\n }\n\n if (tmp.getCategory().equalsIgnoreCase(\"Preis EAN\")) {\n price = -1;\n do {\n try {\n price = Integer.parseInt(JOptionPane.showInputDialog(mainframe, \"Geben Sie den Preis für diesen Artikel mit Preis EAN ein\"));\n } catch (NumberFormatException ex) {\n int cancel = JOptionPane.showConfirmDialog(mainframe, \"Es wurde keine gültige Zahl eingeben! Wollen Sie den Kassiervorgang dieses Artikels abbrechen?\");\n if (cancel == 0) {\n return;\n }\n }\n } while (price == -1);\n price = price / 100;\n }\n\n int amount = -1;\n if (tmp.getCategory().equalsIgnoreCase(\"Gewichts EAN\")) {\n do {\n try {\n amount = Integer.parseInt(JOptionPane.showInputDialog(mainframe, \"Geben Sie die Menge für diesen Artikel mit Gewichts EAN ein (in Gramm)\"));\n } catch (NumberFormatException ex) {\n int cancel = JOptionPane.showConfirmDialog(mainframe, \"Es wurde keine gültige Zahl eingeben! Wollen Sie den Kassiervorgang dieses Artikels abbrechen?\");\n if (cancel == 0) {\n return;\n }\n }\n } while (amount == -1);\n }\n\n Article art = new Article(tmp.getXmlArticleName(), tmp.isLeergut(),\n tmp.isJugendSchutz(), tmp.getEan(), tmp.getArticleName(),\n tmp.isPfand(), tmp.getPfandArtikel(), price, tmp.isRabatt(), tmp.getUst(),\n tmp.isWeight(), tmp.getCategory(), tmp.isEloading(), tmp.isSerialNrRequired());\n art.setIsAbfrage(tmp.isIsAbfrage());\n if (amount != -1) {\n art.setGewichts_ean_menge(amount);\n }\n JugendschutzDlg jdlg = null;\n if (tmp.isJugendSchutz() && !tmp.isIsAbfrage()) {\n jdlg = new JugendschutzDlg(mainframe, true);\n jdlg.setVisible(true);\n if (jdlg.isOk()) {\n art.setJugendSchutzOk(true);\n }\n }\n if (tmp.isEloading()) {\n if (dlm.getAmount() <= 1) {\n if (tmp.isJugendSchutz() && !tmp.isIsAbfrage()) {\n if (jdlg.isOk()) {\n String status = null;\n do {\n ELoadingDlg edlg = new ELoadingDlg(mainframe, true);\n edlg.setVisible(true);\n status = edlg.getStatus();\n } while (status == null);\n art.setEloadingState(status);\n if (status.equalsIgnoreCase(\"server_offline\") || status.equalsIgnoreCase(\"aufladung_nok\")) {\n art.setPriceZero(true);\n }\n }\n } else {\n String status = null;\n if (!tmp.isIsAbfrage()) {\n do {\n ELoadingDlg edlg = new ELoadingDlg(mainframe, true);\n edlg.setVisible(true);\n status = edlg.getStatus();\n\n } while (status == null);\n art.setEloadingState(status);\n if (status.equalsIgnoreCase(\"server_offline\") || status.equalsIgnoreCase(\"aufladung_nok\")) {\n art.setPriceZero(true);\n }\n }\n }\n } else {\n JOptionPane.showMessageDialog(mainframe, \"E-Loading Artikel können nicht mit einer Menge > 1 eingefügt werden\");\n art.setEloadingAmmountOk(false);\n }\n }\n\n int weight = -1;\n Path weight_path = null;\n if (tmp.isWeight() && !tmp.isIsAbfrage()) {\n int result = JOptionPane.showConfirmDialog(mainframe, \"Es wurde ein Gewichtsartikel ausgewählt. Wollen sie diesen \"\n + \"Artikel mithilfe einer Tastatureingabe abwiegen?\");\n if (result == 0) {\n do {\n try {\n weight = Integer.parseInt(JOptionPane.showInputDialog(mainframe, \"Geben Sie bitte das Gewicht für den Artikel ein\"));\n } catch (NumberFormatException ex) {\n int cancel = JOptionPane.showConfirmDialog(mainframe, \"Es wurde keine gültige Zahl eingeben! Wollen Sie den Kassiervorgang dieses Artikels abbrechen?\");\n if (cancel == 0) {\n return;\n }\n }\n } while (weight == -1);\n } else {\n JFileChooser fc = new JFileChooser(System.getProperty(\"user.home\") + File.separator + \"Documents\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"txt-Dateien\", \"txt\");\n fc.setFileFilter(filter);\n if (fc.showOpenDialog(mainframe) == JFileChooser.APPROVE_OPTION) {\n weight_path = fc.getSelectedFile().toPath();\n } else {\n JOptionPane.showMessageDialog(mainframe, \"Es wurde keine Datei ausgewählt! Der Kassiervorgang dieses Artikels wird abgebrochen\");\n return;\n }\n }\n }\n\n if (tmp.isSerialNrRequired() && !tmp.isIsAbfrage()) {\n //Seriennummer einlesen\n if ((tmp.isJugendSchutzOk() && tmp.isJugendSchutz()) || !tmp.isJugendSchutz()) {\n String serNr;\n do {\n serNr = JOptionPane.showInputDialog(null,\n \"Bitte geben Sie eine Seriennummer ein:\");\n } while (serNr == null || serNr.equals(\"\") || !serNr.matches(\"[0-9]+\"));\n art.setSerialNr(serNr);\n }\n }\n if (tmp.isWeight()) {\n if (weight == -1) {\n art.setWeigthArticles(weight_path);\n } else {\n art.setWeigthArticles(weight);\n }\n }\n int tmp_pfand_amount = -1;\n if (tmp.isPfand()) {\n tmp_pfand_amount = dlm.getAmount();\n }\n dlm.addArtikel(art);\n if (tmp.isPfand() && (art.isJugendSchutzOk() || !tmp.isJugendSchutz())) {\n for (Article arti : atm.getAllArtikels()) {\n if (arti.getXmlArticleName().equals(art.getPfandArtikel())) {\n Article newA = new Article(arti.getXmlArticleName(), arti.isLeergut(), arti.isJugendSchutz(), arti.getEan(), arti.getArticleName(), arti.isPfand(), arti.getPfandArtikel(), arti.getPreis(), arti.isRabatt(), arti.getUst(), arti.isWeight(), arti.getCategory(), arti.isEloading());\n dlm.setAmount(tmp_pfand_amount);\n newA.setInXml(false);\n dlm.addArtikel(newA);\n tmp_pfand_amount = -1;\n }\n }\n }\n JButton btBonSt = paArticle.getBtBonstorno();\n if (btBonSt.isEnabled()) {\n btBonSt.setEnabled(false);\n }\n\n JButton btWrue = paArticle.getBtWRUE();\n if (btWrue.isEnabled()) {\n btWrue.setEnabled(false);\n }\n }\n\n setPrice();\n setBonStarted(true);\n tfDigitField.setText(\"\");\n money = 0;\n }\n }", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "public void sell() {\n for (Company x : _market.getCompanies()) {\n if (x.getRisk() > _confidence || x.numLeft() < 3 || x.getRisk() < _confidence - 15){\n if (_stocks.get(x) == 1) {\n _stocks.remove(x);\n } else {\n _stocks.put(x, _stocks.get(x) - 1);\n }\n _money += x.getPrice();\n x.gain();\n break;\n } else {\n _happy = true;\n }\n }\n }", "@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "@Test\n\tpublic void test_PNL_2Deals_Aggreg_buy(){\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, 10.0));\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, 15.0));\n\t\tassertEquals( \"150.00\", nf.format(new PNLImpl(pa, AAPL,16.00).getPNLUnrealized(false)) );\n\t}", "public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }", "private void calculatePrice() {\r\n int price = 0;\r\n int day = show.getDateTime().getDayOfMonth();\r\n int month = show.getDateTime().getMonthValue();\r\n \r\n for (int i = 0; i < seats.size(); i++) {\r\n String option = seats.get(i);\r\n \r\n if (Arrays.stream(sectionNames).parallel().anyMatch(option::contains)) {\r\n String section = option.replaceAll(\"\\\\d\",\"\");\r\n int number = Integer.parseInt(option.replaceAll(\"\\\\D+\",\"\"));\r\n \r\n if (section.equals(\"m\")) {\r\n if (number <= 100) {\r\n price += mainFloorPrice;\r\n } else {\r\n price += mainFloorPremium;\r\n }\r\n } else if (section.equals(\"sb\")) {\r\n if (number <= 25) {\r\n price += southBalconyPrice;\r\n } else {\r\n price += southBalconyPremium;\r\n }\r\n } else if (section.equals(\"wb\")) {\r\n price += westBalconyPrice;\r\n } else if (section.equals(\"eb\")) {\r\n price += eastBalconyPrice;\r\n }\r\n }\r\n }\r\n \r\n if (seats.size() >= 5 && seats.size() <= 10 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (2 * seats.size());\r\n }\r\n \r\n if (seats.size() >= 11 && seats.size() <= 20 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (5 * seats.size());\r\n }\r\n \r\n if (month == 12 && (day == 26 || day == 27)) {\r\n price = seats.size() * 20;\r\n }\r\n \r\n totalPrice = price;\r\n }", "private boolean foundChavrousse(ArrayList<Gelt> m_gelts, Gelt m_gelt) {\n\t\tplay.Logger.info(\"Found Chavrousee Algorithm Started\");\n\t\tboolean isUpdate = false;\n\t\tfor (Gelt currGelt : m_gelts) {\n\t\t\tif (!isUpdate) {\n\t\t\t\tif ((currGelt.getDebterID() == m_gelt.getDebterID())\n\t\t\t\t\t\t&& (currGelt.getEntitledID() == m_gelt.getEntitledID())\n\t\t\t\t\t\t&& (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tcurrGelt.setnAmount(currGelt.getAmount() + m_gelt.getAmount());\n\t\t\t\t\tisUpdate = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplay.Logger.info(\"Found Chavrousee Algorithm Finished with value : \" + isUpdate);\n\t\treturn isUpdate;\n\t}", "public String RevenueDerniere(){\n List<Ticket> tickets=ticketRepository.findAll();\n double revenueJours=0,revenueSemaine=0,revenuemois=0;\n for (Ticket ticket:tickets){\n if (ticket.getDate().isAfter(Instant.now().minus(Period.ofDays(30)))){\n revenuemois=revenuemois+ticket.getAddition();\n }\n if (ticket.getDate().isAfter(Instant.now().minus(Period.ofDays(7)))){\n revenueSemaine=revenueSemaine+ticket.getAddition();\n }\n if (ticket.getDate().isAfter(Instant.now().minus(Period.ofDays(1)))){\n revenueJours=revenueJours+ticket.getAddition();\n }\n }\n\n return \"Revenue moins derniere :\"+revenuemois+\"\\n Revenue semaine derniere :\"+revenueSemaine+\"\\n \"\n\t\t+ \"Revenue jour derniere :\"+revenueJours;\n }", "public void VenderCasasOuHoteis(int idPropriedade) throws Exception {\n this.terminarAVez();\n\n if (this.sell == true) {\n if (this.listaJogadores.get(jogadorAtual()).getComandos().contains(\"sell\")) {\n\n if (idPropriedade <= 0 || idPropriedade > 40) {\n throw new Exception(\"Place doesn't exist\");\n }\n\n if (!this.tabuleiro.getLugarById(idPropriedade).isPropriedade()) {\n throw new Exception(\"Can only sell houses built on properties\");\n }\n boolean OJogadorDavezEhDono = this.listaJogadores.get(jogadorAtual()).getPropriedades().contains(this.tabuleiro.getLugarById(idPropriedade).getNome());\n if (OJogadorDavezEhDono) {\n if (this.tabuleiro.getLugarById(idPropriedade).getNivel() == 0) {\n throw new Exception(\"No house is built on this property\");\n }\n } else {\n throw new Exception(\"Player is not the owner of this property\");\n }\n\n //Procedimento De Venda\n\n if (this.tabuleiro.verificaSePodeVenderImovelDoTerreno(idPropriedade) == true) {\n RealizarProtocoloDeVendaDeCasasEHoteis(idPropriedade);\n if(bankruptcy && this.listaJogadores.get(jogadorAtual()).isBankruptcy()){\n adicionaGiveupQuandoPossivel(this.listaJogadores.get(jogadorAtual()));\n }\n if(hipotecaAtiva && verificaSeTemLugarSemConstrucao(listaJogadores.get(jogadorAtual())))\n listaJogadores.get(jogadorAtual()).adicionarComandoHipotecar();\n\n\n } else {\n throw new Exception(\"Uneven distribution of houses\");\n }\n } else {\n throw new Exception(\"Unavailable command\");\n }\n\n\n\n }\n }", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "public void buy() throws CannotAffordException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.decreaseBudget(price);\r\n\t\tgame.getInventory().add(id);\r\n\t}", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "public void figure() {\r\n Currency nAdv = Currency.Zero;\r\n Currency nLow = Currency.NegativeOne;\r\n Currency nHigh = Currency.Zero;\r\n Currency nTotal = Currency.Zero;\r\n \r\n for(int i = 0; i < dayArray.size(); i++) {\r\n DayG dayG = (DayG) dayArray.get(i);\r\n Currency gross = dayG.getGross();\r\n \r\n nAdv = nAdv.add(gross);\r\n nTotal = nTotal.add(gross);\r\n if(nLow == Currency.NegativeOne || gross.lt(nLow)) {\r\n lowD = dayG;\r\n nLow = gross;\r\n }\r\n if(nHigh.lt(gross)) {\r\n highD = dayG;\r\n nHigh = gross;\r\n }\r\n }\r\n \r\n adverage = nAdv.divide(dayArray.size()).round();\r\n low = nLow.round();\r\n high = nHigh.round();\r\n \r\n //no need to round total, right?\r\n total = nTotal;\r\n }", "public void imprimirBilletes()\n {\n maquina1.insertarDinero(800);\n maquina2.insertarDinero(800);\n maquina1.imprimirTicket();\n maquina2.imprimirTicket();\n }", "@Override\r\n\t/**\r\n\t * Actionne l'effet de la carte.\r\n\t * \r\n\t * @param listejoueur\r\n\t * \t\t\tLa liste des joueurs de la partie.\r\n\t * @param cible\r\n\t * \t\t\tLa joueur contre qui l'effet sera joué.\r\n\t * @param table\r\n\t * \t\t\tCollection de cartes situées au centre de la table de jeu.\r\n\t * @param carte\r\n\t * \t\t\tLa carte qui joue l'effet.\r\n\t * @param j\r\n\t * \t\t\tLe joueur qui joue la carte.\r\n\t * @param collection\r\n\t * \t\t\tLe deck de cartes.\r\n\t * @param tourjoueur\r\n\t * \t\t\tLa liste des joueurs selon l'ordre de jeu.\r\n\t */\r\n\tpublic void utiliserEffet(ArrayList<Joueur> listejoueur, int cible, ArrayList<Carte> table, Carte carte,\r\n\t\t\tint j, ArrayList<Carte> collection,ArrayList<Joueur> tourjoueur) {\n\t\tcont = Controller.getInstance();\r\n\t\tint id = carte.getIdentifiantCarte();\r\n\t\tif (id ==9 || id ==10 || id==22 || id==23){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un croyant\");\r\n\t\t\t\t\r\n\t\t\t\tcont.setChoisirCible(true);\r\n\t\t\t\t\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException 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\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\t\t\r\n\t\t\t\tif (listejoueur.get(cont.getChoixCible()).getNombreCroyantTotal()>0){\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\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\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierCroyant(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" n'a aucun croyant a sacrifier \");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\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\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\tif (listejoueur.get(joueurCible).getNombreCroyantTotal()>0){\r\n\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\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\tlistejoueur.get(joueurCible).setDoitSacrifierCroyant(true);\r\n\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun croyant à sacrifier\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( id==11){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un guide\");\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException 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\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\t\r\n\t\t\t\tif(listejoueur.get(cont.getChoixCible()).getGuidePossede().size()>0){\r\n\t\t\t\t\tfor (int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor(int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierGuide(true);\r\n\t\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\tif (listejoueur.get(joueurCible).getGuidePossede().size()>0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).setSelectionnee(true); // On rend possible l'utilisation de la carte\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\tlistejoueur.get(joueurCible).setDoitSacrifierGuide(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "public void teken(){\n removeAll();\n \n //eerste tekening\n if(tekenEerste != false){\n tekenMuur();\n tekenSleutel();\n veld[9][9] = 6;\n tekenEerste = false;\n tekenBarricade();\n }\n \n //methode die de speler de waarde van de sleutel geeft aanroepen\n sleutelWaarde();\n \n //de methode van het spel einde aanroepen\n einde();\n \n //vernieuwd veld aanroepen\n veld = speler.nieuwVeld(veld);\n \n //het veld tekenen\n for(int i = 0; i < coordinaten.length; i++) {\n for(int j = 0; j < coordinaten[1].length; j++){\n switch (veld[i][j]) {\n case 1: //de sleutels\n if(i == sleutel100.getY() && j == sleutel100.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel1002.getY() && j == sleutel1002.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel200.getY() && j == sleutel200.getX()){\n coordinaten[i][j] = new SleutelVakje(200);\n }\n else if (i == sleutel300.getY() && j == sleutel300.getX()){\n coordinaten[i][j] = new SleutelVakje(300);\n } break;\n case 2: //de muren\n coordinaten[i][j] = new MuurVakje();\n break;\n // de barricades\n case 3:\n coordinaten[i][j] = new BarricadeVakje(100);\n break;\n case 4:\n coordinaten[i][j] = new BarricadeVakje(200);\n break;\n case 5:\n coordinaten[i][j] = new BarricadeVakje(300);\n break;\n case 6: // het eindveld vakje\n coordinaten[i][j] = new EindveldVakje();\n break;\n default: // het normale vakje\n coordinaten[i][j] = new CoordinaatVakje();\n break;\n }\n //de speler\n coordinaten[speler.getY()][speler.getX()] = new SpelerVakje();\n \n //het veld aan de JPanel toevoegen\n add(coordinaten[i][j]);\n }\n }\n System.out.println(\"Speler waarde = \" + speler.getSleutelWaarde());\n revalidate();\n repaint();\n }", "private void trade_shortsell() {\n\t\ttext_code.setText(code);\n\t\t\n\t\tDecimalFormat df=new DecimalFormat(\"#.00\");\n\t\ttext_uprice.setText(df.format(Double.parseDouble(information[2])*1.1) );//涨停价\n\t\t\n\t\ttext_downprice.setText(df.format(Double.parseDouble(information[2])*0.9));//跌停价\n\t\t\n\t\t//getfundown().setText(homepage.get_table_userinfo().getItem(1).getText(1));//可用资金\n\t\t\n\t\t//double d1 = Double.parseDouble(homepage.get_table_userinfo().getItem(1).getText(1));\n\t\t//double d2 = Double.parseDouble(information[3]);\n\t\t//text_limitnum.setText(Integer.toString( (int)(d1/d2) ) );//可卖数量\n\t\t\n\n\t}", "@Override\n\tpublic void doit() {\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint i = saisie_entier();\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint j = saisie_entier();\n\t\t// tous deux strictements positifs ou strictement négatifs? \n\t\t// vrai => produit positif\n\t\t// faux => produit negatif ou nul\n\t\tboolean Truth = TrueIfSameTruthValue(i,j,this.estposit);\n if (Truth){afficher_texte(UtilitaireChainesCommunes.resultat_positif);}\n else{ \n \t// l un des deux est soit de signe différent soit nul.\n \t// on vire le cas \"est de signe différent\" (on aurait pu faire l autre)\n \tboolean Truth2 = ((i < 0 && j > 0) || (i > 0 && j < 0));\n \tif (Truth2){afficher_texte(UtilitaireChainesCommunes.resultat_negatif);}\n \telse {afficher_texte(UtilitaireChainesCommunes.nombre_nul);}\n }\n\n\t}", "void u1 (){\n\n\tint rose,sunflower,jasmin,tulip;\n\tdouble money,sale,total,profit,cost;\n\tScanner sc = new Scanner(System.in);\n\tSystem.out.println(\"--------Flower List----------\\n\");\n\tSystem.out.println(\"1.Rose\\t\\t15 Baht\\n2.Sun flower\\t23 Baht\\n3.Jasmin\\t8 Baht\\n4.Tulip\\t\\t20 Baht\\n\");\n\tSystem.out.println(\"-----------------------------\\n\");\n\n\tSystem.out.println(\"Put number flower\\n\");\n\tSystem.out.print(\"Rose --> \");rose = sc.nextInt();\n\tSystem.out.print(\"Sun flower --> \");sunflower = sc.nextInt();\n\tSystem.out.print(\"Jasmin --> \");jasmin = sc.nextInt();\n\tSystem.out.print(\"Tulip --> \");tulip = sc.nextInt();\n\tSystem.out.println(\"\\n-----------------------------\\n\");\n\tmoney = (15*rose)+(23*sunflower)+(8*jasmin)+(20*tulip);\n\tSystem.out.println(\"Money --> \"+money+\"\\tBaht\\n\");\n\n\tif (money>200)\n\t{\n\t\tsale = money*3/100;\n\t\tSystem.out.println(\"Discount --> \"+sale+\"\\tBaht\");\n\t\ttotal = money-sale;\n\t\tSystem.out.println(\"Total Money --> \"+total+\"\\tBaht\");\n\t\t\n\t\tcost = (9*rose)+(13*sunflower)+(4*jasmin)+(8*tulip);\n\t\tprofit =(money-cost)-sale;\n\t\tSystem.out.println(\"Owner get profit --> \"+profit+\"\\tBaht\");\n\n\t}\n\t\telse if (money>500)\n\t\t{\n\t\tsale = money*5/100;\n\t\tSystem.out.println(\"Discount --> \"+sale+\"\\tBaht\");\n\t\ttotal = money-sale;\n\t\tSystem.out.println(\"Total Money --> \"+total+\"\\tBaht\");\n\n\t\tcost = (9*rose)+(13*sunflower)+(4*jasmin)+(8*tulip);\n\t\tprofit =(money-cost)-sale;\n\t\tSystem.out.println(\"Owner get profit --> \"+profit+\"\\tBaht\");\n\t\t}\n\n\t\telse if (money>700)\n\t\t{\n\t\tsale = money*10/100;\n\t\tSystem.out.println(\"Discount --> \"+sale+\"\\tBaht\");\n\t\ttotal = money-sale;\n\t\tSystem.out.println(\"Total Money --> \"+total+\"\\tBaht\");\n\n\t\tcost = (9*rose)+(13*sunflower)+(4*jasmin)+(8*tulip);\n\t\tprofit =(money-cost)-sale;\n\t\tSystem.out.println(\"Owner get profit --> \"+profit+\"\\tBaht\");\n\t\t}\n\t\n\t System.out.println(\"\\n---------Thank You-----------\");\n\n\t\n}", "public void liquidarEmpleado(Fecha fechaLiquidacion) {\n //COMPLETE\n double prima=0; \n boolean antiguo=false;\n double aniosEnServicio=fechaLiquidacion.getAnio()-this.fechaIngreso.getAnio();\n if(aniosEnServicio>0&&\n fechaLiquidacion.getMes()>this.fechaIngreso.getMes())\n aniosEnServicio--; \n \n //System.out.println(\"A:\"+aniosEnServicio+\":\"+esEmpleadoLiquidable(fechaLiquidacion));\n if(esEmpleadoLiquidable(fechaLiquidacion)){\n this.descuentoSalud=salarioBase*0.04;\n this.descuentoPension=salarioBase*0.04;\n this.provisionCesantias=salarioBase/12;\n if(fechaLiquidacion.getMes()==12||fechaLiquidacion.getMes()==6)\n prima+=this.salarioBase*0.5; \n if(aniosEnServicio<6&&\n fechaLiquidacion.getMes()==this.fechaIngreso.getMes())prima+=((aniosEnServicio*5)/100)*this.salarioBase;\n if(aniosEnServicio>=6&&fechaLiquidacion.getMes()==this.fechaIngreso.getMes()) prima+=this.salarioBase*0.3;\n\n this.prima=prima;\n this.setIngresos(this.salarioBase+prima);\n \n this.setDescuentos(this.descuentoSalud+this.descuentoPension);\n this.setTotalAPagar(this.getIngresos()-this.getDescuentos());\n }\n\n }", "private int calculatePrice(boolean hasWhippedCream, boolean hasChocolate) {\n int toppings = 0;\n\n if(hasWhippedCream){\n toppings += 1;\n }\n\n if(hasChocolate){\n toppings += 2;\n }\n\n return quantity * (priceOfCoffee + toppings);\n }", "public static void main(String[] args) {\n \n //Joueur zidane=new Joueur(\"zidane\",\"zinedine\",\"zizou\", \"12/07/1995\",\"marseille\",\"francais\",75.5f,1.82f, Sexe.HOMME,Pied.AMBIDEXTRE,Tenue.SHORT,34,Sponsor.FLY_EMIRATES);\n // Attaquant messi=new Attaquant(\"zidane\",\"zinedine\",\"zizou\", \"12/07/1995\",\"marseille\",\"francais\",75.5f,1.82f, Sexe.HOMME,Pied.AMBIDEXTRE,Tenue.SHORT,10,Sponsor.FLY_EMIRATES,PosteJoueur.DEFENSEUR);\n //Milieu xavi=new Milieu(\"xavi\",\"xava\",\"go\", \"12/07/1990\",\"barcelone\",\"espagnol\",78.5f,1.85f, Sexe.HOMME,Pied.DROIT,Tenue.JOGGING,15,Sponsor.FLY_EMIRATES,PosteJoueur.DEFENSEUR);\n //Defenseur ramos=new Defenseur(\"xavi\",\"ramos\",\"ifjiej\", \"18/07/1990\",\"madrid\",\"espagnol\",78.5f,1.88f, Sexe.HOMME,Pied.GAUCHE,Tenue.SHORT,15,Sponsor.FLY_EMIRATES,PosteJoueur.MILIEU);\n //ramos.celebrer();\n //ramos.defendre();\n //Gardien neuer=new Gardien(\"neuer\",\"manuel\",\"ifjiej\", \"18/07/1991\",\"Bayern\",\"bayern\",88.5f,1.95f, Sexe.HOMME,Pied.GAUCHE,Tenue.SHORT,15,Sponsor.FLY_EMIRATES);\n //neuer.sortir();\n //Spectateur paul=new Spectateur(\"bollart\",12,false,false);\n //Arbitre guillaume=new Arbitre(\"ovigneur\",\"guillaume\",\"guigou\",\"12/07/1676\",\"Lille\", \"France\", 1.98f,1.67f,Sexe.HOMME,Pied.DROIT,Tenue.SHORT,48,Sponsor.MORELLE);\n Equipe marseille= new Equipe (NomEquipe.OM);\n Equipe paris= new Equipe (NomEquipe.PSG);\n Match match=new Match(TypeTerrain.GAZON,marseille,paris);\n match.simulerMatch();\n System.out.println(match.equipeGagnante);\n System.out.println(marseille.attaquants[2].getStatTir());\n \n Tournoi tournoi = new Tournoi(); \n tournoi.qualificaionsTournoi();\n tournoi.huitiemes();\n tournoi.quarts();\n tournoi.demi();\n tournoi.finale();\n \n System.out.println(tournoi.getEquipeEnLis());\n System.out.println(tournoi.getEquipeQualifie());\n System.out.println(tournoi.getEquipePerdanteHuit());\n System.out.println(tournoi.getEquipeGagnanteHuit());\n System.out.println(tournoi.getEquipePerdanteQuarts());\n System.out.println(tournoi.getEquipeGagnanteQuarts());\n System.out.println(tournoi.getEquipePerdanteDemi());\n System.out.println(tournoi.getEquipeGagnanteDemi());\n System.out.println(tournoi.getEquipeFinale());\n\n \n \n //Mise en place de \"l'interface\"\n Scanner sc = new Scanner(System.in);\n \n //Choix du mode de jeu\n System.out.println(\"\\n *** Choix du mode de jeu *** \\n\\t| tournoi : taper 1|\\n\\t| mode solo : taper 2|\");\n int modeDeJeu = sc.nextInt();\n sc.nextLine(); //On vide la ligne\n \n //AJOUTER UNE EXCEPTION POUR LE MODE DE JEU\n \n \n \n //Choix de l'equipe a l'aide d'un scanner\n// System.out.println(\"Choisissez votre équipe :\");\n// NomEquipe equipe;\n// Equipe equipeChoisit = new Equipe(nomEquipe);\n \n\n\n /*Scanner sc = new Scanner(System.in);\n System.out.println(\"Voulez vous disputer un match ? Oui=1 ou NON=2 \");\n int i = sc.nextInt();\n System.out.println(\"Saisissez le numéro de l'equipe avec laquelle vous voulez Jouez \"\n + \"PSG :1\"\n + \"MARSEILLE:2 \");\n //On vide la ligne avant d'en lire une autre\n sc.nextLine();\n int equipe = sc.nextInt(); \n System.out.println(\"FIN ! \");\n \n switch(equipe) {\n case 1:\n Equipe paris= new Equipe (NomEquipe.PSG);\n System.out.println(paris.stade);\n break;\n case 2 :\n Equipe marseille= new Equipe (NomEquipe.OM);\n System.out.println(marseille.stade);\n \n }*/\n }", "public void eisagwgiGiatrou() {\n\t\t// Elegxw o arithmos twn iatrwn na mhn ypervei ton megisto dynato\n\t\tif(numOfDoctors < 100)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tdoctor[numOfDoctors] = new Iatros();\n\t\t\tdoctor[numOfDoctors].setFname(sir.readString(\"DWSTE TO ONOMA TOU GIATROU: \")); // Pairnei apo ton xristi to onoma tou giatrou\n\t\t\tdoctor[numOfDoctors].setLname(sir.readString(\"DWSTE TO EPWNYMO TOU GIATROU: \")); // Pairnei apo ton xristi to epitheto tou giatrou\n\t\t\tdoctor[numOfDoctors].setAM(rnd.nextInt(1000000)); // To sistima dinei automata ton am tou giatrou\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\t// Elegxos monadikotitas tou am tou giatrou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfDoctors; i++)\n\t\t\t{\n\t\t\t\tif(doctor[i].getAM() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(1000000);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfDoctors++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLOUS GIATROUS!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}", "public void dealerUitspelen(Spelers speler, Spelers dealer, ArrayList<Kaarten> kaartenspel) {\n\n\t\twhile ((dealer.berekenScore(dealer.hand) < 17) && (speler.totaal > dealer.totaal)) {\n\n\t\t\tSystem.out.println(\"De dealer pakt een nieuwe kaart\");\n\t\t\tdealer.hand.add(kaartenspel.get(0));\n\t\t\tkaartenspel.remove(0);\n\t\t\tdealer.berekenScore(dealer.hand);\n\t\t}\n\t\tif (dealer.berekenScore(dealer.hand) > 21) {\n\n\t\t\tSystem.out.println(\"U wint dit spelletje!\");\n\n\t\t} else {\n\n\t\t\tSystem.out.println(\"U heeft van de dealer verloren\\n\");\n\n\t\t}\n\t}", "@Test\n public void playerWinDoublonsBySellingHisProductionTest(){\n player.playRole(new Craftman(stockGlobal));\n player.playRole(new Trader(stockGlobal,1));\n assertEquals(1,player.getInventory().getDoublons());\n assertEquals(true,stockGlobal.getStockResource(TypeWare.INDIGO)==initialIndigoInStock-1);\n\n ArrayList<Plantation> plantationsCorn = new ArrayList<>();\n plantationsCorn.add(new CornPlantation());\n player.playRole(new Trader(stockGlobal,1));\n player.playRole(new Farmer(plantationsCorn,stockGlobal));\n\n assertEquals(true,player.getInventory().getDoublons()==1);\n assertEquals(true,stockGlobal.getStockResource(TypeWare.CORN)==initialCornStock);\n\n\n\n }", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "private void drink()\n { \n if(i.item3 == true && i.used == false)\n {\n p.energy += 70;\n i.item3 = false;\n i.used = true;\n System.out.println(\"Energy: \" + p.energy);\n }\n else if(i.used == true && i.item3 == false) \n {\n System.out.println(\"You already drank a redbull!\"); \n }\n else if(i.item3 == false && i.used == false)\n {\n System.out.println(\"no more drinks left!\");\n }\n }", "public void Entrada(int cantidad) {\n if(cantidad*-1>this.stock) {\n System.out.println(\"La cantidad a retirar es mayor que la que hay en stock, no es posible hacer la operacion.\");\n }else {\n this.stock+=cantidad;\n }\n }", "void SendScoutBees()\n\t{\n\tint maxtrialindex,i;\n\tmaxtrialindex=0;\n\tfor (i=1;i<FoodNumber;i++)\n\t {\n\t if (trial[i]>trial[maxtrialindex])\n\t maxtrialindex=i;\n\t }\n\tif(trial[maxtrialindex]>=limit)\n\t{\n\t\tinit(maxtrialindex);\n\t}\n\t}", "@Test\n public void verifyWatermelonOfferApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 7);\n \tassertTrue(\"Have to get the price of 7 items = 4 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 4) == 0);\n }", "private void somarQuantidade(Integer id_produto){\n\t for (ItensCompra it : itensCompra){\n\t\t //verifico se o item do meu arraylist é igual ao ID passado no Mapping\n\t\t if(it.getTable_Produtos().getId_produto().equals(id_produto)){\n\t //defino a quantidade atual(pego a quantidade atual e somo um)\n\t it.setQuantidade(it.getQuantidade() + 1);\n\t //a apartir daqui, faço o cálculo. Valor Total(ATUAL) + ((NOVA) quantidade * valor unitário do produto(ATUAL))\n\t it.setValorTotal(0.);\n\t it.setValorTotal(it.getValorTotal() + (it.getQuantidade() * it.getValorUnitario()));\n }\n}\n\t}", "void evoluer()\n {\n int taille = grille.length;\n int nbVivantes = 0;\n for(int i=-1; i<2; i++)\n {\n int xx = ((x+i)+taille)%taille; // si x+i=-1, xx=taille-1. si x+i=taille, xx=0\n for(int j=-1; j<2; j++)\n {\n if (i==0 && j==0) continue;\n int yy = ((y+j)+taille)%taille;\n if (grille[xx][yy].vivante) nbVivantes++;\n }\n }\n if (nbVivantes<=1 || nbVivantes>=4) {vientDeChanger = (vivante==true); vivante = false;}\n if (nbVivantes==3) {vientDeChanger = (vivante==false); vivante = true;}\n }", "public void buyItem() {\n List<Gnome> cart = user.getCart();\n String message = \"\";\n List<Gnome> bought = shopFacade.buyGnomes(cart);\n if (!bought.isEmpty()) {\n message = bought.size() + \" items bought\";\n } else {\n message = \"Could not buy any items\";\n }\n userFacade.assignBought(user, bought);\n user.getCart().removeAll(bought);\n cart.removeAll(bought);\n userFacade.setCartToUser(user.getUsername(), cart);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Gnomes\", message);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }", "@FXML\r\n public void makeSale(ActionEvent event) throws Exception {\r\n // TODO:\r\n // K, here's what needs to happen to beautify this:\r\n // ShipBar needs to extend javafx.scene.control.Toggle,\r\n // and then we can use ToggleGroup.getSelectedToggle()\r\n // rather than this shit\r\n Map<String, ShipType> ships = Data.SHIPS.get();\r\n for (ShipBar bar : buyShips.getItems()) {\r\n if (bar.isSelected()) {\r\n ShipType ship = ships.get(bar.getKey());\r\n int playerCash = player.getMoney();\r\n int price = ship.getPrice() - currentShip.getNetWorth();\r\n if (!(playerCash < price)) {\r\n // TODO: use a dedicated class to facilitate ship upgrades\r\n // the same way Transaction is used for goods\r\n Ship newShip = new Ship(ship);\r\n player.setShip(newShip);\r\n player.setMoney(playerCash - price);\r\n // update labels\r\n fillLabels();\r\n // rebuild ships list (?)\r\n currentShip = player.getShip();\r\n buildShipsList();\r\n }\r\n /*else {\r\n // TODO: warning: not enough money\r\n\r\n }*/\r\n // TODO: don't use a for loop here (see above)\r\n break;\r\n }\r\n }\r\n }", "@SuppressWarnings(\"FeatureEnvy\")\n @SuppressLint(\"SetTextI18n\")\n @Override\n public void sellItem(String goods, int price) {\n @SuppressWarnings(\"ChainedMethodCall\") int max = player.getInven().get(goods.toLowerCase());\n if ((max - Integer.parseInt(inputStr)) >= 0) {\n player.getInven().put(goods.toLowerCase(), player.getInven().get(goods.toLowerCase())\n -Integer.parseInt(inputStr));\n player.setCargo(player.getCargo() - Integer.parseInt(inputStr));\n player.setCredit(player.getCredit() + (Integer.parseInt(inputStr) * price));\n bay.setText(String.valueOf(player.getCargo()) + \"/\" + player.getSpaceship().getBay());\n credit.setText(String.valueOf(player.getCredit()) + \" Cr\");\n setupInverntory();\n Toast.makeText(getApplicationContext(), \"You sold \" + inputStr + \" \" + goods,\n Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(),\n \"You can not sell anymore. Check your bay.\", Toast.LENGTH_LONG).show();\n }\n }", "private void obtenerGastosDiariosMes() {\n\t\t// Obtenemos las fechas actuales inicial y final\n\t\tCalendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n int diaFinalMes = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n\t\tList<Movimiento> movimientos = this.movimientoService.obtenerMovimientosFechaUsuario(idUsuario, LocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(),1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(), diaFinalMes));\n\t\tList<Double> listaGastos = new ArrayList<Double>();\n\t\tList<String> listaFechas = new ArrayList<String>();\n\t\t\n\t\tDate fechaUtilizadaActual = null;\n\t\tdouble gastoDiario = 0;\n\t\t\n\t\tfor (Iterator iterator = movimientos.iterator(); iterator.hasNext();) {\n\t\t\tMovimiento movimiento = (Movimiento) iterator.next();\n\t\t\tif(fechaUtilizadaActual == null) { //Comprobamos si se acaba de entrar en el bucle para inicializar la fecha del movimiento\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha();\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Si hemos cambiado de fecha del movimiento se procede a guardar los datos recogidos\n\t\t\tif(!fechaUtilizadaActual.equals(movimiento.getFecha())) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t\tgastoDiario = 0; // Reiniciamos el contador del gasto\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha(); // Almacenemos la fecha del nuevo gasto\n\t\t\t}\n\t\t\t\n\t\t\t// Si el movimiento que se ha realizado es un gasto lo sumamos al contador de gasto\n\t\t\tif(movimiento.getTipo().equals(TipoMovimiento.GASTO)) {\n\t\t\t\tgastoDiario += movimiento.getCantidad();\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Comprobamos si es el ultimo item del iterador y almacenamos sus datos\n\t\t\tif(!iterator.hasNext()) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.listadoGastosDiariosDiagrama = new Double[listaGastos.size()];\n\t\tthis.listadoGastosDiariosDiagrama = listaGastos.toArray(this.listadoGastosDiariosDiagrama);\n\t\tthis.fechasDiagrama = new String[listaFechas.size()];\n\t\tthis.fechasDiagrama = listaFechas.toArray(this.fechasDiagrama);\n\t\t\n\t}", "public boolean getDonation(BoutiqueSign bs, Player p)\n\t{\n\t\t\n\t\tString signOwner = bs.getOwnerString();\n\t\t\n\t\t//Teste donation item ou thunes ?\n\t\t\n\t\t//Don d'item\n\t\tif(bs.getItemFrom() != null)\n\t\t{\n\t\t\tInteger qty = bs.getQtyFrom();\n\t\t\tInteger id = bs.getItemFrom().itemId;\n\t\t\tInteger damage = bs.getItemFrom().itemDamage;\n\t\t\t\n\t\t\tif (!PlayerOperator.playerHasEnough( qty, id, damage, p))\n\t\t\t{\n\t\t\t\tp.sendMessage(plugin.chatPrefix + PlayerOperator.playerStockErr);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (bs.isSignServer())\n\t\t\t{\n\t\t\t\t//Enleve le propriétaire du panneau pour les logs (car panneau serveur) !\n\t\t\t\tsignOwner = \"\"; //$NON-NLS-1$\n\t\t\t}\n\t\t\telse if (bs.isSignWebAuction())\n\t\t\t{\n\t\t\t\t// Panneau \"webauctions\"\n\t\t\t\t// Ajoute les objets au stock WebAuctions\n\t\t\t\tif(!plugin.db.wa_AddToStock(p.getName(), id, damage, qty))\n\t\t\t\t{\n\t\t\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.UNABLETOADDINWEBSTOCKS\") + signOwner + Messages.getString(\"Sign.SMILEYSAD\")); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\telse if (bs.isSignChest())\n\t\t\t{\n\t\t\t\t//p.sendMessage(\"dbg0: debut signchest\");\n\t\t\t\t\n\t\t\t\t// Cherche le coffre relié au panneau\n\t\t\t\tChest chest = bs.getChest();\n\t\t\t\tif(chest==null)\t\n\t\t\t\t{\n\t\t\t\t\t//p.sendMessage(\"dbg1: coffre introuvable\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Vérifie qu'il reste de la place dans le coffre pour stocker les objets à acheter\n\t\t\t\tif (!ChestOperator.hasEnoughSpace(qty,id,damage, chest))\n\t\t\t\t{\n\t\t\t\t\tp.sendMessage(plugin.chatPrefix + ChestOperator.notEnoughSpaceErr);\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\n\n\t\t\t\t// Credite le coffre de l'acheteur\n\t\t\t\tChestOperator.addToChestStock(qty, id, damage, chest);\n\t\t\t}\n\t\t\t\n\t\t\t// Retire les objets au donneur\n\t\t\tPlayerOperator.removeFromPlayer(qty, id, damage, p);\n\t\t\t\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.YOUGIVE\") + qty + Messages.getString(\"Sign.QTY1\") + bs.getItemFrom().itemName + \" \" + (bs.isSignServer() ? Messages.getString(\"Sign.TOSERVER\"): Messages.getString(\"Sign.TO\") + signOwner + \".\")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$\n\t\t\t\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tBoutique.getInstance().db.logTransaction(p.getLocation(), p.getName(), signOwner, id , damage, qty , 0.0 ,\"toto\",\"titi\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t}\n\t\t\tcatch (Exception e) \n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse if(bs.getMoneyFrom() != null)\n\t\t{\n\t\t\t\n\t\t\t//Don d'argent\n\t\t\t\n\t\t\t\n\t\t\t//Verif money doneur\n\t\t\tif (EconomyHandler.hasEnough(p.getName(), bs.getMoneyFrom())!=1)\n\t\t\t{\n\t\t\t\tp.sendMessage(plugin.chatPrefix + EconomyHandler.noFundsErr);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//Crédite le receveur (sauf si serveur)\n\t\t\tif(!bs.isSignServer())\n\t\t\t{\n\t\t\t\tEconomyHandler.modifyMoney(bs.getOwnerString(), bs.getMoneyFrom());\n\t\t\t}\n\t\t\t\n\t\t\t//Débite le doneur\n\t\t\tEconomyHandler.modifyMoney(p.getName(), -bs.getMoneyFrom());\n\t\t\t\n\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.YOUGIVE\") + EconomyHandler.formatMoney(bs.getMoneyFrom()) + \" \" + EconomyHandler.formatCurrency(bs.getMoneyFrom()) + \" \" + (bs.isSignServer() ? Messages.getString(\"Sign.TOSERVER\"): Messages.getString(\"Sign.TO\") + signOwner));\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.MONEYREMAINING\") + EconomyHandler.playerHave(p.getName())); //$NON-NLS-1$\n\t\t\t\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tBoutique.getInstance().db.logTransaction(p.getLocation(), p.getName(), signOwner, 0, 0, 0, bs.getMoneyFrom() ,\"toto\",\"titi\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t}\n\t\t\tcatch (Exception e) \n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.VROUMVROUMERR\"));\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public synchronized void setStatusOfSeatTypes() throws SQLException{\n\t\tConnection con=null;\n\t\t\n\t\ttry{\n\t\tcon=this.datasource.getConnection();\n\t\tStatement statement= con.createStatement();\n\t\tPreparedStatement pstate= con.prepareStatement(\"INSERT INTO statusderplätze VALUES(?,0,0)\");\n\t\tPreparedStatement pstate1=con.prepareStatement(\"SELECT COUNT(*) FROM statusderplätze\");\n\t\tPreparedStatement pstate2=con.prepareStatement(\"SELECT * FROM statusderplätze\");\n\t\tResultSet resSet= null;\n\t\t\n\t\tresSet=pstate1.executeQuery();\n\t\tresSet.first();\n\t\tint count= resSet.getInt(1);\n\t\tif(count==0){\n\t\t\t\t\tpstate.setInt(1, allSeats);\n\t\t\t\t\tpstate.execute();\n\t\t}else{\n\t\t\tresSet=pstate2.executeQuery();\n\t\t\tresSet.first();\n\t\t\tint counter=0;\n\t\t\t\n\t\t\twhile(resSet.next()){\n\t\t\t\tthis.freeSeats= resSet.getInt(\"freiePlätze\");\n\t\t\t\tthis.reservationSeats= resSet.getInt(\"reserviertePlätze\");\n\t\t\t\tthis.soldSeats= resSet.getInt(\"verkauftePlätze\");\t\n\t\t\t}\n\t\t\tcounter++;\n\t\t}\n\t\t}finally{\n\t\t\ttry{\n\t\t\tcon.close();\n\t\t\t}catch (SQLException e) {\n\t\t\t\tSystem.out.println(\"Schwerwiegender Datenbankfehler! Versuchen Sie es Später noch einmal!\");\n\t\t\t}\n\t\t}\n\t}", "public void sellGoodsForStore(HashMap<Goods, Integer> interestedGoods) {\n\t\tArrayList<Goods> listInterestedGoods = accessingGoods(interestedGoods);\n\t\t\n\t\tboolean state1 = false;\n\t\twhile(state1 == false) {\n\t\t\tSystem.out.println(\"(99) Cancel sell\");\n\t\t\tprintGoods(interestedGoods, \"Goods that store want to buy: \");\n\t\t\tSystem.out.println(\"Select the goods you want to sell\");\n\t\t\tint selectedAction = scanner.nextInt();\n\t\t\ttry { \n\t\t\t\tif (selectedAction == 99) {\n\t\t\t\t\tstate1 = true;\n\t\t\t\t\tgame.goToStore();\n\t\t\t\t}\n\t\t\t\telse if (selectedAction <= interestedGoods.size() && selectedAction > 0) {\n\t\t\t\t\tGoods selectedGoods = listInterestedGoods.get(selectedAction - 1);\n\t\t\t\t\t\n\t\t\t\t\tif (game.checkAvailability(selectedGoods)){\n\t\t\t\t\t\tSystem.out.println(\"You have \" + selectedGoods.getQuantityOwned() +\" \"+ selectedGoods.getName() + \" stored in your ship!\");\n\t\t\t\t\t\tint goodsPrice = interestedGoods.get(selectedGoods);\n\t\t\t\t\t\tboolean state2 = false;\n\t\t\t\t\t\twhile(state2 == false) {\n\t\t\t\t\t\t\tSystem.out.println(\"How many do you want to sell?\" );\n\t\t\t\t\t\t\tint quantity = scanner.nextInt();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry { \n\t\t\t\t\t\t\t\tif (game.checkQuantity(quantity, selectedGoods)) {\n\t\t\t\t\t\t\t\tstate2 = true;\n\t\t\t\t\t\t\t\tgame.sellGoods(selectedGoods, quantity, goodsPrice);\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\tSystem.out.println(\"You don't have that many quanity of \" + selectedGoods.getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"You have to input an integer!\");\n\t\t\t\t\t\t\t\tscanner.nextLine();\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}\n\t\t\t\t\t\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"You don't have the item!\");\n\t\t\t\t\t}\n\t\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}\t\n\t}", "private void aggiornamento()\n {\n\t gestoreTasti.aggiornamento();\n\t \n\t /*Se lo stato di gioco esiste eseguiamo il suo aggiornamento.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().aggiornamento();\n }\n }", "public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}", "public double getStockFinal(long pv) {\n float entree = 0 ;\n float sortie = 0 ;\n\n ArrayList<Produit> produits = null ;\n if (pv==0) produits = produitDAO.getAll();\n else produits = produitDAO.getAllByPv(pv) ;\n\n ArrayList<Mouvement> mouvements = null;\n\n double valeur = 0 ;\n double total = 0 ;\n double quantite = 0 ;\n double cmpu = 0 ;\n double restant = 0 ;\n double qsortie = 0 ;\n double qentree = 0 ;\n // Vente par produit\n Mouvement mouvement = null ;\n Operation operation = null ;\n\n for (int i = 0; i < produits.size(); i++) {\n try {\n mouvements = mouvementDAO.getManyByProductInterval(produits.get(i).getId_externe(),DAOBase.formatter2.parse(datedebut),DAOBase.formatter2.parse(datefin)) ;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n if (mouvements != null){\n valeur = 0 ;\n quantite = 0 ;\n restant = 0 ;\n qentree = 0 ;\n cmpu = 0 ;\n qsortie = 0 ;\n\n for (int j = 0; j < mouvements.size(); j++) {\n mouvement = mouvements.get(j) ;\n operation = operationDAO.getOne(mouvement.getOperation_id()) ;\n if (operation==null || (operation.getAnnuler()==1 && operation.getDateannulation().before(new Date())) || operation.getTypeOperation_id().startsWith(OperationDAO.CMD)) continue;\n\n //if (pv!=0 && caisseDAO.getOne(operation.getCaisse_id()).getPointVente_id()!=pv) continue;\n if (j==0)\n if (mouvement.getRestant()==mouvement.getQuantite() && mouvement.getEntree()==0){\n restant = 0 ;\n }\n else restant = mouvement.getRestant() ;\n\n if (mouvement.getEntree()==0) {\n valeur -= mouvement.getPrixA() * mouvement.getQuantite() ;\n qentree += mouvement.getQuantite() ;\n cmpu = mouvement.getPrixA() ;\n }\n else {\n valeur += mouvement.getCmup() * mouvement.getQuantite() ;\n qsortie += mouvement.getQuantite() ;\n }\n /*\n if (restant!=0) cmpu = valeur / restant ;\n else cmpu = mouvement.getCmup() ;\n */\n }\n\n quantite = restant + qentree - qsortie ;\n total+=Math.abs(valeur) ;\n }\n }\n\n return total;\n }", "public static void live() throws KorotshNotDifferentException{\r\n Shpuntik sh = new Shpuntik(\"Shpuntik\", 75, true);\r\n Vintik v = new Vintik(\"Vintik\", 30, false);\r\n Pilulkin p = new Pilulkin(\"Pilulkin\", 80, true);\r\n Znaika z = new Znaika(\"Znaiks\", 95, true);\r\n if ((!sh.equals(v)) & (!sh.equals(p)) &(!v.equals(p)) & (!z.equals(p))){\r\n try{\r\n z.exploreGravity();\r\n } catch (RopeNotGoodException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n p.walkInCity();\r\n sh.createTeapod();\r\n Food f = sh.cookPorige();\r\n Food f1 = sh.cookKisel();\r\n Food f2 = sh.cookSoup();\r\n v.eatFood(f);\r\n v.eatFood(f1);\r\n v.eatFood(f2);\r\n }\r\n else\r\n throw new KorotshNotDifferentException(\"Korotshs are not different\");\r\n\r\n }", "private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}", "private static void verifPayement(){\n\t\tint x,y, dime;\n\t\tx=jeu.getAssam().getXPion()-1;\n\t\ty=jeu.getAssam().getYPion()-1;\n\t\tint caseInfoTapis = jeu.cases[x][y].getCouleurTapis();\n\t\tif(caseInfoTapis == tour || caseInfoTapis == 0){\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t\t\tdime = jeu.payerDime(caseInfoTapis,x,y,0,new boolean[7][7]);\n\t\t\tJoueur payeur = jeu.getJoueurs()[tour-1];\n\t\t\tJoueur paye = jeu.getJoueurs()[caseInfoTapis-1];\n\t\t\tif(jeu.payerVraimentDime(payeur,paye,dime)){\n\t\t\t\tjoueurElimine++;\n\t\t\t}\n\t\t\tconsole.afficherPayeurPaye(payeur, paye, dime);\n\t\t}\n\t}", "private BigDecimal getStock(Producto producto, Bodega bodega, Date fechaDesde, Date fechaHasta)\r\n/* 48: */ {\r\n/* 49:74 */ BigDecimal stock = BigDecimal.ZERO;\r\n/* 50:75 */ for (InventarioProducto inventarioProducto : this.servicioInventarioProducto.obtenerMovimientos(producto.getIdOrganizacion(), producto, bodega, fechaDesde, fechaHasta)) {\r\n/* 51:77 */ if (inventarioProducto.getOperacion() == 1) {\r\n/* 52:78 */ stock = stock.add(inventarioProducto.getCantidad());\r\n/* 53:79 */ } else if (inventarioProducto.getOperacion() == -1) {\r\n/* 54:80 */ stock = stock.subtract(inventarioProducto.getCantidad());\r\n/* 55: */ }\r\n/* 56: */ }\r\n/* 57:83 */ return stock;\r\n/* 58: */ }", "public double getGesamtwert(){\n double total = 0;\n for (int i = 0; i < key; i++){\n total += getArtikel(i).getGesamt();\n }\n return total;\n }", "public void destruirLegion(Soldado soldado) {\n Legion legion = (Legion) soldado;\n for (Soldado soldadosLegion : legion.getSoldados()) {\n this.soldados.add(soldadosLegion);\n }\n }", "public int getAmountSold() { return amountSold; }", "@Override \r\npublic double earnings() { \r\n\t return getWage() * getPieces(); \r\n}", "public boolean combattre(List<Armee> armees) {\n\t\treturn false;\n\t}" ]
[ "0.60297126", "0.5985452", "0.5947658", "0.5869291", "0.58382404", "0.58353835", "0.58111805", "0.579223", "0.57583725", "0.57416874", "0.57238793", "0.57119846", "0.5703614", "0.5683134", "0.5676317", "0.5579232", "0.5556319", "0.5547454", "0.5542322", "0.5538337", "0.553022", "0.55206823", "0.5491369", "0.5490799", "0.5490148", "0.548643", "0.54834086", "0.5482712", "0.54748785", "0.5442556", "0.5440258", "0.5436505", "0.5430748", "0.54294395", "0.54272354", "0.54259574", "0.5425531", "0.54229146", "0.54218495", "0.54205096", "0.541809", "0.5393324", "0.5387886", "0.5386566", "0.53782636", "0.5372122", "0.53685164", "0.53601766", "0.5360062", "0.5353533", "0.53458536", "0.53433543", "0.5330923", "0.53271955", "0.5321703", "0.5316361", "0.53124607", "0.5311684", "0.52945036", "0.5293267", "0.528765", "0.5286814", "0.528585", "0.52844834", "0.5279138", "0.52603006", "0.52580965", "0.52566", "0.5256138", "0.52529156", "0.52501184", "0.5246194", "0.5244222", "0.52421176", "0.52412546", "0.5238729", "0.5236827", "0.5235511", "0.5232727", "0.52323335", "0.5231514", "0.52274853", "0.5223354", "0.5222474", "0.52166843", "0.5216594", "0.52162474", "0.5214276", "0.5212756", "0.5201234", "0.5196104", "0.5190028", "0.5188908", "0.51824003", "0.5178529", "0.5175637", "0.5173392", "0.51658994", "0.5163962", "0.5160193" ]
0.5336745
52
charge un fichier de sauvegarde
public void charger() throws WargameException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void salvaPartita(String file) {\n\r\n }", "public void recevoirDossier() {\n try {\n fileInfo = (FileInfo) ois.readObject(); //lire les informations du fichier\n //chemin du fichier en sortie\n String outputFile = fileInfo.getDestinationDirectory() + fileInfo.getFilename();\n dstFile = new File(outputFile);\n if (!new File(fileInfo.getDestinationDirectory()).exists()) { //si le fichier n'existe pas\n new File(fileInfo.getDestinationDirectory()).mkdirs(); //creation du fichier\n fos = new FileOutputStream(dstFile);\n fos.write(fileInfo.getFileData()); //ecrire les données dans le fichier\n fos.flush();\n fileInfo.setFileData(null);\n System.gc();\n fos.close();\n dstFile.setLastModified(fileInfo.getModifier());\n\n } else if (dstFile.lastModified() < fileInfo.getModifier()) { //si le fichier existe et que c'est une nouvelle version alors\n fos = new FileOutputStream(dstFile);\n fos.write(fileInfo.getFileData());\n fos.flush();\n fileInfo.setFileData(null);\n fos.close();\n dstFile.setLastModified(fileInfo.getModifier());\n }\n } catch (IOException | ClassNotFoundException ex) {\n Logger.getLogger(RecevoirFichier.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void sendFile() {\r\n\t\t// 특정 클라이언트에게 파일을 보냄\r\n\t}", "public void afficherFile() {\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Voici la File (tete a gauche, queue a droite): \");\r\n\t\tSystem.out.println(\"----------------------------------------------\");\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tSystem.out.println();\r\n\t\t} else {\r\n\r\n\t\t\tCellule<T> ref = this.tete;\r\n\r\n\t\t\tfor (int i = 1; i <= this.getLongueurFile(); i++) {\r\n\r\n\t\t\t\tSystem.out.print(ref.getValeur() + \" \");\r\n\r\n\t\t\t\tif (ref.getSuivant() != null) {\r\n\r\n\t\t\t\t\tref = ref.getSuivant();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "public void OuvrirAgd() {\n //on charge l'agenda à partir d'un fichier en lecture\n try {\n File agd_a_lire = new File(\"C:\\\\Projet_Agenda_ING3\\\\saved_agendas\");\n Scanner sc = new Scanner(agd_a_lire);\n\n //on lit le fichier ligne par ligne\n /*while (sc.) {\n\n }*/\n\n sc.close();\n } catch (Exception e) {\n System.out.print(\"Erreur d'ouverture du fichier en lecture\\n\");\n }\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfile.save();\r\n\t\t\t\tclose();\r\n//\t\t\t\tfile.de = true;\r\n\r\n\t\t\t}", "private void escoger(){\n partida.escoger(ficha1,ficha2);\n ficha1=null;\n ficha2=null;\n this.ok=partida.ok;\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "public void guardarCV(String nombre, String Apellido,String dni,String mail,String cur ,File ruta,String mensaje){\r\n Alumnos alu=new Alumnos();\r\n alu.setNombre(nombre);\r\n alu.setApellido(Apellido);\r\n alu.setDni(dni);\r\n alu.setMail(mail);\r\n alu.setMensaje(mensaje);\r\n alu.setNom_archivo(cur);\r\n\r\n\r\n\r\n try{ //convierte el archivo pdf a bytes\r\n byte[] pdf= new byte[(int) ruta.length()];\r\n InputStream input= new FileInputStream(ruta);\r\n input.read(pdf);\r\n alu.setArchivo_cv(pdf);\r\n\r\n }catch(IOException e){\r\n alu.setArchivo_cv(null);\r\n }\r\n alu.insertarCV(alu);\r\n }", "public void descargarArchivoVeri()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_veri, nombre FROM anexoverificacion where idverificacion=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "private void grabarArchivo() {\n\t\tPrintWriter salida;\n\t\ttry {\n\t\t\tsalida = new PrintWriter(new FileWriter(super.salida));\n\t\t\tsalida.println(this.aDevolver);\n\t\t\tsalida.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void manageFile() {\n long seconds = System.currentTimeMillis();\n filename = \"sdcard/LocationWise/LocationWiseImages/\" + seconds + \".png\";\n path_to_file = new File(filename);\n if (path_to_file.exists()) {\n boolean delete = path_to_file.delete();\n if (delete == true) {\n writeFile();\n // Toast.makeText(this, \"Deleted Successfully\", Toast.LENGTH_SHORT).show();\n\n } else {\n\n // Toast.makeText(this, \"Deletion Failed\", Toast.LENGTH_SHORT).show();\n }\n\n } else {\n writeFile();\n\n }\n }", "static void LeerArchivo(){ \r\n \t//iniciamos el try y si no funciona se hace el catch\r\n\r\n try{ \r\n \t//se crea un objeto br con el archivo de txt\r\n \tBufferedReader br = new BufferedReader( \r\n \tnew FileReader(\"reporte.txt\")\r\n );\r\n String s;\r\n //Mientras haya una linea de texto se imprime\r\n while((s = br.readLine()) != null){ \r\n System.out.println(s);\r\n }\r\n //se cierra el archivo de texto\r\n br.close(); \r\n } catch(Exception ex){\r\n \t//si no funciona se imprime el error\r\n System.out.println(ex); \r\n }\r\n }", "public String uploadFile(UploadedFile file) {\n String fileName = (file.getFileName());\r\n System.out.println(\"***** fileName: \" + file.getFileName());\r\n \r\n System.out.println(System.getProperty(\"os.name\"));\r\n String basePath = \"C:\" + File.separator + \"aquivosCI\" + File.separator;\r\n System.out.println(\"BasePath: \" + basePath);\r\n File outputFilePath = new File(basePath + fileName);\r\n\r\n// Copy uploaded file to destination path\r\n InputStream inputStream = null;\r\n OutputStream outputStream = null;\r\n try {\r\n inputStream = file.getInputstream();\r\n outputStream = new FileOutputStream(outputFilePath);\r\n\r\n int read = 0;\r\n final byte[] bytes = new byte[1024];\r\n while ((read = inputStream.read(bytes)) != -1) {\r\n outputStream.write(bytes, 0, read);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n\r\n } finally {\r\n if (outputStream != null) {\r\n try {\r\n outputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (inputStream != null) {\r\n try {\r\n inputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n return outputFilePath.getAbsolutePath(); // return to same page\r\n }", "private void getArquivo()\n {\n /*** Obtem o conteudo do pacote através do diretorio ***/\n File file = new File(caminho_origem);\n if (file.isFile())\n {\n try\n {\n /*** Lê o pacote e põe em um array de bytes ***/\n DataInputStream diStream = new DataInputStream(new FileInputStream(file));\n long len = (int) file.length();\n if (len > Utils.tamanho_maximo_arquivo)\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_muito_grande);\n System.exit(0);\n }\n Float numero_pacotes_ = ((float)len / Utils.tamanho_util_pacote);\n int numero_pacotes = numero_pacotes_.intValue();\n int ultimo_pacote = (int) len - (Utils.tamanho_util_pacote * numero_pacotes);\n int read = 0;\n /***\n 1500\n fileBytes[1500]\n p[512]\n p[512]\n p[476]len - (512 * numero_pacotes.intValue())\n ***/\n byte[] fileBytes = new byte[(int)len];\n while (read < fileBytes.length)\n {\n fileBytes[read] = diStream.readByte();\n read++;\n }\n int i = 0;\n int pacotes_feitos = 0;\n while ( pacotes_feitos < numero_pacotes)\n {\n byte[] mini_pacote = new byte[Utils.tamanho_util_pacote];\n for (int k = 0; k < Utils.tamanho_util_pacote; k++)\n {\n mini_pacote[k] = fileBytes[i];\n i++;\n }\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(mini_pacote);\n this.pacotes.add(pacote_);\n pacotes_feitos++;\n }\n byte[] ultimo_mini_pacote = new byte[ultimo_pacote];\n int ultimo_indice = ultimo_mini_pacote.length;\n for (int j = 0; j < ultimo_mini_pacote.length; j++)\n {\n ultimo_mini_pacote[j] = fileBytes[i];\n i++;\n }\n byte[] ultimo_mini_pacote2 = new byte[512];\n System.arraycopy(ultimo_mini_pacote, 0, ultimo_mini_pacote2, 0, ultimo_mini_pacote.length);\n for(int h = ultimo_indice; h < 512; h++ ) ultimo_mini_pacote2[h] = \" \".getBytes()[0];\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(ultimo_mini_pacote2);\n this.pacotes.add(pacote_);\n this.janela = new HashMap<>();\n for (int iterator = 0; iterator < this.pacotes.size(); iterator++) janela.put(iterator, new Estado());\n } catch (Exception e)\n {\n System.out.println(Utils.prefixo_cliente + Utils.erro_na_leitura);\n System.exit(0);\n }\n } else\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_inexistente);\n System.exit(0);\n }\n }", "public void suppfichier(String chemin) {\n Path path = Paths.get(chemin);\n if (path.toFile().isDirectory()) { //si c'esst un dossier\n try (DirectoryStream<Path> listing = Files.newDirectoryStream(path)) {\n if (path != null) {\n for (Path nom : listing) { //parsourir les fichier et sou dossier\n if (!Files.isDirectory(nom)) {\n Files.delete(nom);\n } else {\n suppfichier(nom.toFile().getAbsolutePath());\n }\n }\n Files.delete(path);\n } else {\n Files.delete(path);\n }\n } catch (IOException e) {\n File file = new File(chemin);\n file.delete();\n }\n } else {\n File file = new File(chemin);\n file.delete();\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if ((requestCode == request_code) && (resultCode == RESULT_OK)){\n Toast.makeText(getApplicationContext(),data.getDataString(),Toast.LENGTH_LONG).show();\n elemento = new File(data.getDataString());\n }\n }", "private void pdfActionPerformed(java.awt.event.ActionEvent evt) {\n\n try{\n prepareFile();\n relv.GeneratePDF(path, Client.getNom() + \" \" + Client.getPrenom(), Client.getCin(), operations, periode, from, to);\n JOptionPane.showMessageDialog(this,\"Votre relevé en format PDF a été généré avec Succes\",\"Succes\", JOptionPane.INFORMATION_MESSAGE); \n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, \"Échec lors de l'écriture dans la base de données. Veuillez réessayer plus tard\", \"Echec de l'opération\", JOptionPane.ERROR_MESSAGE);\n } catch (Exception ex) {\n System.out.println(\"error \"+ex.getMessage());\n } \n }", "public void pruebaEscritura() {\n\t\tFileWriter fichero = null;\n\t\tPrintWriter pw = null;\n\t\ttry {\n\t\t\tfichero = new FileWriter(\"//172.16.1.141/Modelo_Raster/Varios/Monitoreo_Forestal/REDD/Metadatos/test.xml\");\n\t\t\tpw = new PrintWriter(fichero);\n\n\t\t\tfor (int i = 0; i < 10; i++)\n\t\t\t\tpw.println(\"Linea \" + i);\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\t// Nuevamente aprovechamos el finally para\n\t\t\t\t// asegurarnos que se cierra el fichero.\n\t\t\t\tif (null != fichero) fichero.close();\n\t\t\t}\n\t\t\tcatch (Exception e2) {\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void descargarArchivo()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_justi, nombre FROM anexoitem where iditem=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }", "public void BotonExportarPDF(String nomRep) {\n //ABRIR CUADRO DE DIALOGO PARA GUARDAR EL ARCHIVO \n JFileChooser fileChooser = new JFileChooser();\n fileChooser.addChoosableFileFilter(new FileNameExtensionFilter(\"todos los archivos *.PDF\", \"pdf\", \"PDF\"));//filtro para ver solo archivos .pdf\n int seleccion = fileChooser.showSaveDialog(null);\n try {\n if (seleccion == JFileChooser.APPROVE_OPTION) {//comprueba si ha presionado el boton de aceptar\n File JFC = fileChooser.getSelectedFile();\n String PATH = JFC.getAbsolutePath();//obtenemos la direccion del archivo + el nombre a guardar\n try (PrintWriter printwriter = new PrintWriter(JFC)) {\n printwriter.print(\"src\\\\Reportes\\\\\" + nomRep + \".jasper\");\n }\n this.ReportePDF(\"src\\\\Reportes\\\\\" + nomRep + \".jasper\", PATH);//mandamos como parametros la ruta del archivo a compilar y el nombre y ruta donde se guardaran \n //comprobamos si a la hora de guardar obtuvo la extension y si no se la asignamos\n if (!(PATH.endsWith(\".pdf\"))) {\n File temp = new File(PATH + \".pdf\");\n JFC.renameTo(temp);//renombramos el archivo\n }\n JOptionPane.showMessageDialog(null, \"Esto puede tardar unos segundos, espere porfavor\", \"Estamos Generando el Reporte\", JOptionPane.WARNING_MESSAGE);\n JOptionPane.showMessageDialog(null, \"Documento Exportado Exitosamente!\", \"Guardado exitoso!\", JOptionPane.INFORMATION_MESSAGE);\n }\n } catch (FileNotFoundException | HeadlessException e) {//por alguna excepcion salta un mensaje de error\n JOptionPane.showMessageDialog(null, \"Error al Exportar el archivo!\", \"Oops! Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public static void Bildeinfuegen()\r\n\t{\n\t\tPath path = FileSystems.getDefault().getPath(\"bilder\", \"bild2.jpg\");\r\n\t\tFile file=path.toFile();\r\n\t\t//File file = new File(getCacheDirectory() + \"\\\\results.txt\");\r\n\t\t\r\n\t\tString INSERT_DATA_SQL=\"INSERT INTO bilder VALUES (?, ?)\";\r\n\t\ttry {\r\n\r\n\t\t\tFileInputStream fis= new FileInputStream(file);\r\n\t\t\tconn = DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t\tpstmt = conn.prepareStatement(INSERT_DATA_SQL);\r\n\t\t\tfis = new FileInputStream(file);\r\n\t\t\t//pstmt = conn.prepareStatement(\"INSERT INTO bilder VALUES (?, ?)\");\r\n\t\t\tpstmt.setString(1, file.getName());\r\n\t\t\tpstmt.setBinaryStream(2, fis, (int)file.length());\r\n\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t\tpstmt.close();\r\n\t\t\tfis.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}catch (SQLException e) {\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\r\n\t\tSystem.out.println(\"Daten in Datenbank gepeichert.\");\r\n\t}", "public static void LeerByte(File rutaLeer, File rutaEscribir) throws IOException {\n\n FileInputStream leer = new FileInputStream(rutaLeer);\n FileOutputStream escribir = new FileOutputStream(rutaEscribir);\n\n char[] letras = new char[numCaracteres(rutaLeer)]; //array para almacenar todos los char\n int b = 0;\n// letras = new char[numCaracteres(rutaLeer)];\n int contador = 0;\n while (b != -1) {\n b = leer.read(); //se lee los bytes\n char c = (char) b; // se convierte a char\n letras[contador] = c; // se guarda los char\n contador++;\n }\n\n //leer y escribir \n String letra = \"\";\n String frase = \"\";\n int contar = 0;\n boolean encontrarSigno = false;\n int data = -1;\n\n escribir.write(\"--------------------------------------\".getBytes());\n escribir.write('\\n');\n escribir.write(\" Cartelera de CineFBMoll\".getBytes());\n escribir.write('\\n');\n escribir.write(\"--------------------------------------\".getBytes());\n escribir.write('\\n');\n\n int corchete = 0;\n for (int i = 0; i < letras.length; i++) {\n if (letras[i] == '{') {\n corchete = i;\n }\n }\n letras[corchete] = '#'; // en la posición 475 ({) se cambia por #\n while (contar <= letras.length - 1 && encontrarSigno == false) {\n if (letras[contar] != '#' && contar != letras.length - 1) {\n letra = Character.toString(letras[contar]);\n frase += letra; // si no es un # se forma una frase\n\n contar++;\n } else {\n encontrarSigno = true;\n data++;\n contar++;\n int espacios = 0;\n int cortarLinea = 14; //cuenta los espacios ' ' para dar un salto de línea\n if (encontrarSigno == true) {\n if (frase.length() < 100) { // si es o no un párrafo\n escribir.write('\\n');\n escribir.write(datos[data].getBytes());\n escribir.write(\" : \".getBytes());\n escribir.write(frase.getBytes());\n escribir.write('\\n');\n\n encontrarSigno = false;\n frase = \"\";\n } else {\n escribir.write('\\n');\n escribir.write(datos[data].getBytes()); //sinopsis\n escribir.write(\" : \".getBytes());\n for (int i = 0; i < frase.length(); i++) {\n char c = frase.charAt(i);\n if (c == ' ') {\n espacios++;\n }\n if (espacios == cortarLinea) { //comprobación para dar salto de línea\n escribir.write('\\n');\n cortarLinea += 15;\n }\n escribir.write(c);\n }\n escribir.write('\\n');\n encontrarSigno = false;\n frase = \"\";\n }\n\n if (data + 1 == datos.length) {\n data = -1;\n escribir.write(\"-----------------------------\".getBytes());\n }\n }//'#'\n }\n }//while\n\n }", "public String upload() throws FileNotFoundException, IOException{\n FileOutputStream fout=new FileOutputStream(\"/tmp/mi_archivo\");\n int read=0;\n byte[] data=new byte[1024];\n InputStream in = archivo.getInputStream();\n\n while((read = in.read(data)) != -1){\n fout.write(data, 0, read);\n }\n\n return \"\";\n }", "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}", "String prepareFile();", "public static void sendFile2ecc(Context context, String fileNo\n ) throws FileNotFoundException {\n final File crashFile = new File(FileUtil.getPath(context) + \"CrashFile.log\");\n\n// File crashNoFile = new File(FileUtil.getPath(context) + fileNo + \".crash.log\");\n\n// crashFile.renameTo(crashNoFile);\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n RandomAccessFile accessFile = new RandomAccessFile(crashFile, \"rw\");\n byte[] bytes = new byte[(int) accessFile.length()];\n accessFile.read(bytes);\n HXLog.eForDeveloper(new String(bytes)+\"====================================\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n uploadFile(URL,crashFile.getAbsolutePath());\n }\n }).start();\n\n }", "public String copiar(String path) throws IOException{\n FileOutputStream fsalida = null;\n try {\n FileInputStream fregis = new FileInputStream(path);\n File miFichero= new File(path);\n String ruta=\"C:/imagenes/\"+miFichero.getName();\n fsalida = new FileOutputStream(ruta, true);\n \n \n int b = fregis.read();\n while (b != -1) { \n fsalida.write(b); \n b = fregis.read(); \n\n }\n fsalida.flush();\n fsalida.close();\n fregis.close();\n return ruta;\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Copiar_Ficheros.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n fsalida.close();\n } catch (IOException ex) {\n Logger.getLogger(Copiar_Ficheros.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return \"\";\n }", "public String call() throws IOException {\n try {\n p2c.readAndWriteFile(file);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "public void upload() throws ServicioException {\n if (justificacionHelper.getArchivoCargado() != null) {\n if (justificacionHelper.getArchivoCargado().getContentType().equals(\"application/pdf\")) {\n ParametroGlobal buscarParametroGlobalPorNemonico =\n administracionServicio.buscarParametroGlobalPorNemonico(\n ParametroGlobalEnum.TAMANIO_MAXIMO_PDF.getCodigo());\n if (justificacionHelper.getArchivoCargado().getSize()\n > buscarParametroGlobalPorNemonico.getValorNumerico().longValue()) {\n mostrarMensajeEnPantalla(\"El tamaño del archivo supera los \"\n + (buscarParametroGlobalPorNemonico.getValorNumerico().longValue() / 1024) + \" MB\",\n FacesMessage.SEVERITY_WARN);\n justificacionHelper.setArchivoRequerido(Boolean.TRUE);\n justificacionHelper.setArchivoCargado(null);\n } else {\n mostrarMensajeEnPantalla(\"ec.gob.mrl.smp.justificacionReglas.archivoCargadoCorrectamente\",\n FacesMessage.SEVERITY_INFO);\n justificacionHelper.setArchivoRequerido(Boolean.FALSE);\n System.out.println(\"Archivo Cargado \" + justificacionHelper.getArchivoCargado().getFileName());\n }\n } else {\n mostrarMensajeEnPantalla(\"ec.gob.mrl.smp.justificacionReglas.archivoCargadoNoesPDF\",\n FacesMessage.SEVERITY_ERROR);\n justificacionHelper.setArchivoRequerido(Boolean.TRUE);\n justificacionHelper.setArchivoCargado(null);\n }\n\n }\n }", "@AfterStep\n\tprivate void deleteFile(){\n\t\tif(LOGGER.isDebugEnabled()){\n\t\tLOGGER.debug(\" Entering into SalesReportByProductEmailProcessor.deleteFile() method --- >\");\n\t\t}\n\t\ttry {\n\t\t\tif(null != salesReportByProductBean){\n\t\t\tReportsUtilBO reportsUtilBO = reportBOFactory.getReportsUtilBO();\n\t\t\tList<String> fileNames = salesReportByProductBean.getFileNameList();\n\t\t\tString fileLocation = salesReportByProductBean.getFileLocation();\n\t\t\treportsUtilBO.deleteFile(fileNames, fileLocation);\n\t\t\t}\n\t\t} catch (PhotoOmniException e) {\n\t\t\tLOGGER.error(\" Error occoured at SalesReportByProductEmailProcessor.deleteFile() method ----> \" + e);\n\t\t}finally {\n\t\t\tif(LOGGER.isDebugEnabled()){\n\t\t\tLOGGER.debug(\" Exiting from SalesReportByProductEmailProcessor.deleteFile() method ---> \");\n\t\t\t}\n\t\t}\n\t}", "public void IntercambiarArchivos(byte[] archivoSinCifrar) {\r\n\t\ttry {\r\n\t\t\tString entry;\r\n\t\t\tServerSocket socketServidor = new ServerSocket();\r\n\t\t\tSocket client = socketServidor.accept();\r\n\t\t\t\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());\r\n\t ObjectInputStream ois = new ObjectInputStream(client.getInputStream());\r\n\t \t \r\n\t BufferedReader inFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));\r\n\t BufferedWriter OutFromServer = new BufferedWriter( new OutputStreamWriter(client.getOutputStream() ) );\r\n\t \r\n\t OutputStream in = client.getOutputStream();\r\n\t DataOutputStream dataOut = new DataOutputStream(in);\r\n\t \r\n\t OutFromServer.write(\"GENERAR DH\");\r\n\t entry = inFromClient.readLine();\r\n\t if(entry.equals(\"LISTO PARA GENERAR DH\")) {\r\n\t \t\r\n\t }\r\n\t \r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void salvaSuFile() {\n\t\tString path = \"alimenti.txt\";\n\t\tString allergeni = Alimento.getStringaAllergeni(getElencoAllergeni());\n\t\ttry {\n\t\t\tFile file = new File(path);\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\tbw.write(getNome() + \" - \" + getPrezzo() + \"€\\n\");\n\t\t\tbw.write(\"Adatto a vegani: \" + (getVegano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Adatto a vegetariani: \" + (getVegetariano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Tipologia: \" + getTipoPortata().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Cottura: \" + getTipoCottura().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Allergeni: \" + (allergeni.isEmpty() ? \"--\" : allergeni) + \"\\n\\n\");\n\t\t\tbw.flush();\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void agregarMetadatos(UploadedFile ArticuloPDF, UploadedFile TablaContenidoPDF, UploadedFile cartaAprobacionPDF) throws IOException, GeneralSecurityException, DocumentException, PathNotFoundException, AccessDeniedException {\n MetodosPDF mpdf = new MetodosPDF();\n String codigoEst = this.pubEstIdentificador.getEstCodigo();\n String codigoFirma = mpdf.codigoFirma(codigoEst);\n codigoFirma = codigoFirma.trim();\n\n String nombreCartaAprob = \"Carta de Aprobacion-\" + codigoFirma;\n String nombrePublicacion = \"\";\n String nombreTablaC = \"Tabla de Contenido-\" + codigoFirma;\n\n if (this.pubTipoPublicacion.equalsIgnoreCase(\"revista\")) {\n nombrePublicacion = this.revista.getRevTituloArticulo();\n\n }\n if (this.pubTipoPublicacion.equalsIgnoreCase(\"congreso\")) {\n nombrePublicacion = this.congreso.getCongTituloPonencia();\n }\n if (this.pubTipoPublicacion.equalsIgnoreCase(\"libro\")) {\n nombrePublicacion = this.libro.getLibTituloLibro();\n\n }\n if (this.pubTipoPublicacion.equalsIgnoreCase(\"capitulo_libro\")) {\n\n nombrePublicacion = this.capituloLibro.getCaplibTituloCapitulo();\n }\n\n\n /*Obtiene la ruta de la ubicacion del servidor donde se almacenaran \n temporalmente los archivos ,para luego subirlos al Gestor Documental OpenKm */\n String realPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/\");\n // String destCartaAprob = realPath + \"WEB-INF\\\\temp\\\\Tabla de Contenido.pdf\";\n String destCartaAprob = realPath + \"WEB-INF\\\\temp\\\\\" + nombreCartaAprob + \".pdf\";\n String destArticulo = realPath + \"WEB-INF\\\\temp\\\\\" + nombrePublicacion + \".pdf\";\n // String destTablaC = realPath + \"WEB-INF\\\\temp\\\\Tabla de Contenido.pdf\";\n String destTablaC = realPath + \"WEB-INF\\\\temp\\\\\" + nombreTablaC + \".pdf\";\n\n\n /* Estampa de Tiempo\n Obtiene el dia y hora actual del servidor para posteriormente adicionarlo\n como Metadato en el documento PDF/A y el Gestor Documental*/\n Date date = new Date();\n DateFormat datehourFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n String estampaTiempo = \"\" + datehourFormat.format(date);\n\n this.setPubFechaRegistro(date);\n\n /* Metodo para almacenar los metadatos de la Carte de Aprobacion , Articulo y Tabla de Contenido \n para almacenarlo en formato PDFA */\n ArrayList<tipoPDF_cargar> subidaArchivos = new ArrayList<>();\n\n /* tipoPDF_cargar cartaAprobacion = new tipoPDF_cargar();\n cartaAprobacion.setNombreArchivo(nombreCartaAprob);\n cartaAprobacion.setRutaArchivo(destCartaAprob);\n cartaAprobacion.setTipoPDF(\"cartaAprobacion\");\n cartaAprobacion.setArchivoIS(cartaAprobacionPDF.getInputstream());\n subidaArchivos.add(cartaAprobacion); */\n if (!cartaAprobacionPDF.getFileName().equalsIgnoreCase(\"\")) {\n tipoPDF_cargar cartaAprobacion = new tipoPDF_cargar();\n cartaAprobacion.setNombreArchivo(nombreCartaAprob);\n cartaAprobacion.setRutaArchivo(destCartaAprob);\n cartaAprobacion.setTipoPDF(\"cartaAprobacion\");\n cartaAprobacion.setArchivoIS(cartaAprobacionPDF.getInputstream());\n subidaArchivos.add(cartaAprobacion);;\n }\n\n if (!ArticuloPDF.getFileName().equalsIgnoreCase(\"\")) {\n tipoPDF_cargar articulo = new tipoPDF_cargar();\n articulo.setNombreArchivo(nombrePublicacion);\n articulo.setRutaArchivo(destArticulo);\n articulo.setTipoPDF(\"tipoPublicacion\");\n articulo.setArchivoIS(ArticuloPDF.getInputstream());\n subidaArchivos.add(articulo);\n }\n if (!TablaContenidoPDF.getFileName().equalsIgnoreCase(\"\")) {\n tipoPDF_cargar tablaContenido = new tipoPDF_cargar();\n tablaContenido.setNombreArchivo(nombreTablaC);\n tablaContenido.setRutaArchivo(destTablaC);\n tablaContenido.setTipoPDF(\"tablaContenido\");\n tablaContenido.setArchivoIS(TablaContenidoPDF.getInputstream());\n subidaArchivos.add(tablaContenido);\n }\n\n CrearPDFA_Metadata(subidaArchivos, estampaTiempo);\n\n String hash = mpdf.obtenerHash(destArticulo);\n\n /* Metodo para almacenar en el Gestor Documental(OPENKM), carta de aprobacion,\n el articulo en formato PDFA y la Tabla de Contenido del Articulo (formato PDFA) */\n // SubirOpenKM(rutasArchivos, nombreArchivos, estampaTiempo, codigoFirma, hash);\n SubirOpenKM(subidaArchivos, estampaTiempo, codigoFirma, hash);\n }", "final public void GuardarCuadruplos() throws ParseException {\ntry {\n // Crea un cuadro de dialogo. El input se guarda en strNomArchivo\n String strNomArchivo = \"\";\n\n // Si el campo quedo vacío o se cerró la ventana, volver a mostrarlo\n while (strNomArchivo==null || strNomArchivo.trim().isEmpty()) {\n strNomArchivo = (String)JOptionPane.showInputDialog(\n null, \"Escribe el nombre que tendra el archivo\", \"Input\", JOptionPane.PLAIN_MESSAGE, null, null, null);\n }\n\n // objeto printwriter con el nombre del archivo\n PrintWriter codigoObj = new PrintWriter(strNomArchivo);\n\n // Agrega uno por uno los cuadruplos al archivo\n for (int i=0; i < cuadruplos.size(); i++) {\n codigoObj.println( Cuadruplo.returnCuadruplo( (Cuadruplo)cuadruplos.get(i) ) );\n }\n\n // cierra el archivo\n codigoObj.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(e.getMessage());\n }\n }", "public void abrirArchivo() {\r\n try {\r\n entrada = new Scanner(new File(\"estudiantes.txt\"));\r\n } // fin de try\r\n catch (FileNotFoundException fileNotFoundException) {\r\n System.err.println(\"Error al abrir el archivo.\");\r\n System.exit(1);\r\n } // fin de catch\r\n }", "private void del_file() {\n\t\tFormatter f;\n\t\ttry{\n\t\t\tf = new Formatter(url2); //deleting file content\n\t\t\tf.format(\"%s\", \"\");\n\t\t\tf.close();\t\t\t\n\t\t}catch(Exception e){}\n\t}", "public void exportarapolice(){\n gettableconteudo();\n conexao.Conectar();\n File f = null;\n try {\n conexao.sql = \"SELECT data, nomefile, arquivo FROM arquivo WHERE data = ?\"; \n conexao.ps = conexao.con.prepareStatement(conexao.sql); \n ps.setString(1, id1);\n ResultSet rs = ps.executeQuery(); \n if ( rs.next() ){ \n byte [] bytes = rs.getBytes(\"arquivo\"); \n String nome = rs.getString(\"nomefile\");\n f = new File(\"C:\\\\rubinhosis\\\\exportacoes\\\\\" + nome); \n FileOutputStream fos = new FileOutputStream( f);\n fos.write( bytes ); \n fos.close(); \n }\n rs.close(); \n ps.close(); \n \n \n } catch (SQLException ex) { \n ex.printStackTrace();\n }\n catch (IOException ex) {\n ex.printStackTrace();\n }\n\n}", "void citire(FileReader f);", "public void gravarArquivo(View v){\n if(capturaDados()){\n try {\n arquivoDB.gravarArquivo(this,ARQ,mapDados.toString());\n Toast.makeText(this, R.string.arquivo_ok,Toast.LENGTH_SHORT).show();\n } catch (FileNotFoundException e) {\n Toast.makeText(this, R.string.arquivo_nok,Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n\n }\n }", "@Override\n\t\t\t\t\t\t\t\t\tpublic void downLoadSuccess(String localFilPath) {\n\t\t\t\t\t\t\t\t\t\tupdate.setEnabled(true);\n\t\t\t\t\t\t\t\t\t\tprogressBar_downLoad.setVisibility(View.INVISIBLE);\n\t\t\t\t\t\t\t\t\t\tFailOpera.Instace(mContext).openFile(localFilPath);\n\t\t\t\t\t\t\t\t\t}", "@Override\n public void dispose() {\n file = null;\n }", "public String guardarPublica(String clave){\r\n\t\t\t\t \r\n\t\t String ok=\"ok\";\r\n\t\t try { \t\r\n\t\t\t File ruta_sd = Environment.getExternalStorageDirectory();\r\n\t\t\t \r\n\t\t File f = new File(ruta_sd.getAbsolutePath()+\"/MIMESIC/\");\r\n\t\t f.mkdir();\r\n\t\t \r\n\t\t File fich = new File(f, \"ibe.txt\");\r\n\t\t \r\n\t\t OutputStreamWriter fout = new OutputStreamWriter(new FileOutputStream(fich));\r\n\t\r\n\t\t \t fout.write(clave);\r\n\t\t\t\t fout.close();\r\n\t\t\r\n\t\t\r\n\t\t\treturn ok;\r\n\r\n\t }\r\n\t\t catch(FileNotFoundException e){\r\n\t\t\t e.printStackTrace();\r\n\t\t\t return \"error\";\r\n\t\t\t \r\n\t\t }\r\n\t catch (IOException ex){\r\n\t ex.printStackTrace();\r\n\t \r\n\t }\r\n\t\t \r\n\t \r\n\t\t return ok;\r\n\t\t \r\n\t }", "@PostMapping(\"/\")\n public ResponseEntity<?> updloadFile (MultipartFile file) throws IOException {\n \n System.out.println(\"file\"+file.getOriginalFilename());\n List<Producto> productos = productoService.readFile(\"C:\\\\Users\\\\Karen Web\\\\Downloads\\\\\"+file.getOriginalFilename());\n //System.out.println(\"producto\"+ productos.toString());\n productoService.guardarFile(productos);\n return ResponseEntity.ok(new SuccessMessage(\"001\", \"producto\"));\n \n }", "public void fileHexCodeIO(){\n deviceName = MySharedPreferences.readString(mContext, MySharedPreferences.DEVICE_NAME, \"Samsung\");\n\n //open file for reading\n try {\n br = new BufferedReader(new InputStreamReader(mContext.getAssets().open(\"devices/\"+deviceName+ ButtonNames.MUTE)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n MuteHexCode = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void guardar() {\n\t\t//JFileChooser fglobal = principal.getFglobal();\n\t\tprincipal.getFglobal().setDialogTitle(ic.buscar(38)); // Tag 38\n\n\t\t\tprincipal.getFglobal().setDialogType(JFileChooser.SAVE_DIALOG);\n\n\t\tAccesorio pep = new Accesorio(principal.getFglobal(),t, principal.getIC());\n\t\tprincipal.getFglobal().setAccessory(pep);\n\t\tpep.setProfundidad(true);\n\t\t\n principal.getFglobal().resetChoosableFileFilters();\n \n ExampleFileFilter filtroT = new ExampleFileFilter (\n new String [] {\"tiff\",\n \"tif\",\n },\n ic.buscar(3)); // Tag 3\n \n\n \n\t\t\t\n ExampleFileFilter filtroJ = new ExampleFileFilter (\n new String [] {\"jpeg\",\n \"jpg\"\n },\n ic.buscar(4)); // Tag 4\n principal.getFglobal().addChoosableFileFilter(filtroT);\n principal.getFglobal().addChoosableFileFilter(filtroJ);\n\t\t\n\t\t\n\t\t\n\t\tint retval = principal.getFglobal().showDialog(t, null);\n\t\tif (retval == JFileChooser.APPROVE_OPTION) \n\t\t{\t\t\n\t\t\tFile guardar = principal.getFglobal().getSelectedFile();\n \n\t\t\tif (\tprincipal.getFglobal().getFileFilter().getDescription().equals(filtroJ.getDescription()) )\n\t\t\t{// Guardar como JPEG\n \n\t\t\t\tJAI.create(\"filestore\",imagen_original,guardar.getPath(),\"JPEG\", new JPEGEncodeParam());\n\t\t\t}\n\t\t\telse if (principal.getFglobal().getFileFilter().getDescription().equals(filtroT.getDescription()))\n\t\t\t{// Guardar como TIFF\n\t\t\t\tint profundidad = pep.getEP().getMarcada();\n\t\t\t\t// Cubre todas las posibilidades (¿esto guarda los metadatos?)\n\t\t\t\tTiledImage tiled = null;\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\ttiled = \n ElegirProfundidad.crearProfundidadReducida(\n ipixel_o, \n profundidad, \n imagen_original.getWidth(), \n imagen_original.getHeight());\n\t\t\t\t}\n\n\t\t\t\t//imgGuardar = djai.getSource();\n\t\t\t\tParameterBlock pb = new ParameterBlock();\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(tiled);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(imagen_original);\n\t\t\t\t}\n\t\t\t\tpb.add(guardar);\n\t\t\t\tpb.add(\"TIFF\");\n\t\t\t\tpb.add(false); //UseProperties\n\t\t\t\tpb.add(false); //Transcode\n\t\t\t\tpb.add(true); //VerifyOutput\n\t\t\t\tpb.add(false); //AllowPixelReplacement\n\t\t\t\tpb.add(null); //TileSize\n\t\t\t\tpb.add(streamData);\n\t\t\t\tpb.add(imageData);\n\t \t\t\tJAI.create(\"imagewrite\", pb);\n\t\t\t\t\n\t\t\t\t//JAI.create(\"imagewrite\",tiled,guardar.getPath(),\"TIFF\");\n\t\t\t}\n\t\t\telse\n\t\t\t{// No tiene extensión o es una extensión extraña\n\t\t\t\tJAI.create(\"imagewrite\",imagen_original,guardar.getPath()+\".tif\",\"TIFF\");\n\t\t\t}\n\t\t\t\n\t\t}\t\t\t \n\t\telse \n\t\t{\n\t\t\tdibujarMensajesError(retval);\n\t\t} \n\t\t\n\t\t\n\t}", "public static void applicaBarcode() throws InvalidPasswordException, IOException, DocumentException, SAXException, ParserConfigurationException {\n\t\tboolean processato = false;\t\t\t\t//per capire se ci sono file\r\n\t\tpath = new File(\"C:\\\\Users\\\\tommolini\\\\Desktop\\\\PROVABARCODEESTERI\\\\\");\r\n\t\tString nomePath = path.toString();\t\t\t\t\t//converto in stringa il path ottenuto in precedenza per darlo in pasto al get seguente\t\t\t\t\t//scelta cartella\r\n\t\t\t\t\r\n\t\tnew File(path + \"/Barcode\").mkdir();\t//creo la cartella per mettere i file con i barcode\r\n\t\tFile [] files = path.listFiles();\t\t//elenco tutti i file della cartella del percorso path\r\n\t\t//System.out.println(\"files: \" + files);\r\n\t\tString nomeFileSenzaEstensione;\r\n\t\tString nomeDaBarcode=\"\";\t\t\t\t\t//stringa in cui filtro il codice da mettere (prime 9 cifre del nome)\r\n\t\tint posizioneUnderscore;\r\n\t\t//System.out.println(\"files.lenght: \" + files.length);\r\n\t\t\r\n\t\tint lunghezzaListaFile= files.length;\r\n\t\t\r\n\t\tfor (int i = 0; i < files.length; i++){\t//ciclo tutti i file nella cartella\r\n\t\t\t\r\n\t\t\t//anche se ci sono dei file nella cartella con estensione diversa da .pdf non vengono considerati grazie al filtro\r\n\t\t\tif (files[i].isFile() & files[i].getName().endsWith((\".pdf\")) & !files[i].getName().contains(\"_A\")){ \t//finchè c'è un file (CON FILTRO .PDF)\r\n\t\t\t\tprocessato=true;\r\n\r\n\t\t\t\t//ripulisco il file dalla sua estensione (mi serve per sapere cosa scrivere come barcode)\r\n\t\t\t\tnomeFileSenzaEstensione = files[i].getName().replaceFirst(\"[.][^.]+$\", \"\");\t//prendo solo il nome file escludendo l'estenzione\r\n\t\t\t\t//System.out.println(\"nomeFileSenzaEstensione \" + nomeFileSenzaEstensione);\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\tposizioneUnderscore = nomeFileSenzaEstensione.indexOf(\"_\"); //trova la posizione del carattere _ fin dove devo arrivare per estrarre il barcode \r\n\t\t\t\tif (posizioneUnderscore != -1) {\t//se _ non è in posizione -1\r\n\t\t\t\t nomeDaBarcode= nomeFileSenzaEstensione.substring(0 , posizioneUnderscore); //estraggo i primi caratteri prima del primo _\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t System.out.println(\"nomeFileSenzaEstensione: \" + nomeFileSenzaEstensione + \" . Barcode estratto: \" + nomeDaBarcode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//System.out.print(path + \"/\" + files[i].getName() + \"\\n\");\r\n\t \tPdfReader reader = new PdfReader(path + \"\\\\\" + files[i].getName());\t\t//creo flusso di lettura verso il file\r\n\t \tSystem.out.println(path + \"\\\\\" + files[i].getName());\r\n\t \tPdfStamper stamper = new PdfStamper(reader, new FileOutputStream(path + \"/Barcode/\" + files[i].getName() ));\t//creo il flusso di scrittura verso un nuovo file all'interno della cartella barcode\r\n\t\t\t \t\r\n\t \tRectangle pageSize = reader.getPageSize(1);\t\t\t\t\t\t//il parametro \"1\" si riferisce alla prima pagina\r\n\t \tPdfContentByte over = stamper.getOverContent(1);\t\t\t\t//overlay sulla prima pagina\r\n\t\t\t \r\n \tBarcode128 code128 = new Barcode128();\r\n code128.setBaseline(-1);\t\t\t\t\t\t\t\t\t\t//posizione della scritta del barcode\r\n code128.setSize(7);\t\t\t\t\t\t\t\t\t\t\t\t//dimensione della scritta del barcode\r\n code128.setCode(nomeDaBarcode);\t\t\t\t\t\t\t\t\t//codice del barcode da mostrare\r\n code128.setCodeType(Barcode128.CODE128);\t\t\t\t\t\t//codifica del barcode\r\n Image code128Image = code128.createImageWithBarcode(over, BaseColor.BLACK, BaseColor.BLACK);\t//colori del barcode\r\n code128Image.scalePercent(100, 70);\t\t\t\t\t\t\t//scala del barcode\r\n \r\n \r\n //System.out.println(\"code128Image.getWidth() \"+code128Image.getWidth());\r\n //System.out.println(\"code128Image.getHeight() \"+code128Image.getHeight());\r\n float x = pageSize.getRight() - code128Image.getWidth() - 110;\t//posizionamento del barcode rispetto alle dimensioni della pagina\r\n float y = pageSize.getTop() - code128Image.getHeight() - 10;\t//posizionamento del barcode rispetto alle dimensioni della pagina\r\n float w = pageSize.getRight() - 10;\t\t\t\t\t\t\t\t//posizionamento del barcode rispetto alle dimensioni della pagina\r\n float h = pageSize.getTop() - 10;\t\t\t\t\t\t\t\t//posizionamento del barcode rispetto alle dimensioni della pagina\r\n \r\n over.saveState();\r\n over.setColorFill(BaseColor.WHITE);\t\t\t\t\t\t\t\t//riempio lo sfondo dell'immagine col colore bianco\r\n over.rectangle(x-10, y-10, code128Image.getScaledWidth()+14, code128Image.getScaledHeight()+14);\t\t\t\t\t\t\t//imposto le dimensioni del rettangolo bianco che fa da sfondo al barcode\t\t\t\t\t\r\n over.fill();\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n over.restoreState();\r\n code128Image.setAbsolutePosition(x-10, y-10);\t\t\t\t\t//imposto la posizione in termini di riferimento assoluti dell'immagine che vado ad aggiungere\r\n over.addImage(code128Image); \t\t\t\t\t\t\t\t//aggiungo l'immagine al pdf\t \t\r\n \r\n\r\n \r\n\t \tstamper.close();\t\t\t\t\t\t\t\t\t\t\t\t//chiudo la scrittura\r\n\t reader.close();\t\t\t\t\t\t\t\t\t\t\t\t\t//chiudo la lettura\r\n\t \r\n\t //System.out.println(\"ifffff \");\r\n\t //elimino i file nella cartella in cui li ho scaricati\r\n\t //files[i].delete();\r\n\r\n\t\t\t} \r\n\t\t}\t\r\n\t}", "private void downFile(HttpServletRequest req, HttpServletResponse res, String file_path ,String file_id, String file_name) throws Exception{\n\t\tSystem.out.println(file_path);\n\t\tSystem.out.println(file_id);\n\t\tSystem.out.println(file_name);\n\t\tFile file = null;\n\t\tBufferedInputStream fin = null;\n\t\tBufferedOutputStream outs = null;\n\ttry {\n\n\t\tfile = new File(file_path + \"\\\\\" + file_id);\n\t // ���� ����\n\t int filelength = (int) file.length();\n\t byte[] bytestream = new byte[2048];\n\t int read = 0;\n\t \n\t if(!file.exists()){\n\t \tthrow new Exception(\"mis.file.noexist\");\n\t }\n\t\t\n\t fin = new BufferedInputStream(new FileInputStream(file));\n\t outs = new BufferedOutputStream(res.getOutputStream());\n\t \n\t\n\t\tString clientHead = req.getHeader(\"User-Agent\");\n\t\t\n\t\tres.setContentLength(filelength);\n\t\tif (clientHead.indexOf(\"MSIE 5.5\") > -1)\n\t\t{\t\t\t\n\t\t\tres.setContentType(\"application/x-filler; charset=EUC-KR\");\n\t\t\tres.setHeader(\"Content-Type\", \"doesn/matter;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres.setHeader(\"Content-Type\", \"application/octet-stream;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"attachment;filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\tres.setHeader (\"Content-Length\", \"\" + filelength);\n\t\n\t //try {\n\t\tif(filelength>0) {\n\t\t\twhile ((read = fin.read(bytestream)) != -1) {\n\t\t\t\touts.write(bytestream, 0, read);\n\t\t\t}\n\t\t}\n\t \n\t //close\n\t outs.close();\n\t fin.close();\n\t} catch (Exception e) {\n\t\t\n\t} finally {\n\t\tif(outs != null) { try { outs.close(); } catch(Exception e) {} }\n\t\tif(fin != null) { try { fin.close(); } catch(Exception e) {} }\n\t}\n}", "public void copiaImg() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString tipo = caminhoImagem.replaceAll(\".*\\\\.\", \"\");\r\n\t\t\tSystem.out.println(tipo);\r\n\t\t\tString l = caminhoImagem;\r\n\t\t\tString i = \"../MASProject/imagens/\" + idObra.getText() + \".\" + tipo;\r\n\t\t\tcaminhoImagem = i;\r\n\t\t\t@SuppressWarnings(\"resource\")\r\n\t\t\tFileInputStream fisDe = new FileInputStream(l);\r\n\t\t\t@SuppressWarnings(\"resource\")\r\n\t\t\tFileOutputStream fisPara = new FileOutputStream(i);\r\n\t\t\tFileChannel fcPara = fisDe.getChannel();\r\n\t\t\tFileChannel fcDe = fisPara.getChannel();\r\n\t\t\tif (fcPara.transferTo(0, fcPara.size(), fcDe) == 0L) {\r\n\t\t\t\tfcPara.close();\r\n\t\t\t\tfcDe.close();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, e);\r\n\t\t}\r\n\t}", "protected final void sendFile(final File file) {\n\t\t// almacenamos el fichero a enviar\n\t\tthis.file = file;\n\t\t// cambiamos al modo transferencia\n\t\tthis.setLocalStage(Stage.FILE);\n\t\t// soliticamos el envio del fichero\n\t\tthis.send(Commands.FILE);\n\t}", "void downloadEvi(File file, int id) throws IOException, SQLException;", "public void Leer() throws FileNotFoundException\n {\n // se crea una nueva ruta en donde se va a ir a leer el archivo\n String ruta = new File(\"datos.txt\").getAbsolutePath(); \n archivo=new File(ruta); \n }", "private void loadData(String fileName, String cobrandPath)\n throws ParserConfigurationException, SAXException, IOException {\n\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n Document doc = db.parse(cobrandPath);\n\n Element root = doc.getDocumentElement();\n\n Element updateElement = doc.createElement(IConstants.IMAGE_FILE);\n Node updateText = doc.createTextNode(fileName);\n\n updateElement.appendChild(updateText);\n root.appendChild(updateElement);\n\n try {\n\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(new FileOutputStream(\n cobrandPath));\n\n TransformerFactory transFactory = TransformerFactory.newInstance();\n Transformer transformer = transFactory.newTransformer();\n\n transformer.transform(source, result);\n\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void comprar() {\n }", "public void uploadFile() {\n \n InputStream input = null;\n try {\n input = file.getInputStream();\n System.out.println(\"chay qua inpustream\");\n String itemName = file.getSubmittedFileName();\n String filename = itemName.substring(\n itemName.lastIndexOf(\"\\\\\") + 1);\n String dirPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/upload/images\");\n fileNamed = \"/upload/images/\"+filename;\n File f = new File(dirPath + \"\\\\\" + filename);\n if (!f.exists()) {\n f.createNewFile();\n }\n FileOutputStream output = new FileOutputStream(f);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = input.read(buffer)) > 0) {\n output.write(buffer, 0, length);\n }\n // resize(dirPath + \"\\\\\" + filename, dirPath + \"\\\\\" + filename, 200, 200);\n input.close();\n output.close();\n } catch (IOException ex) {\n System.out.println(\"loi io\");\n Logger.getLogger(ArtistsManagedBean.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void upload(UploadedFile file) {\n FacesContext faces = FacesContext.getCurrentInstance();\n\n getSelected().setUrlImage(file.getFileName());\n String fileExtension = file.getFileName().split(\"\\\\.\")[file.getFileName().split(\"\\\\.\").length - 1];\n\n //String generatedFileName = \"file\" + System.currentTimeMillis();\n File directory = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE));\n\n if (!directory.exists()) {\n directory.mkdir();\n }\n\n File newFile = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE) + File.separator + file.getFileName());\n try {\n if (!newFile.createNewFile()) {\n String nameGenerated = \"file_generated\" + System.currentTimeMillis();\n newFile = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE) + File.separator + nameGenerated + \".\" + fileExtension);\n getSelected().setUrlImage(nameGenerated);\n }\n\n FileOutputStream output = new FileOutputStream(newFile);\n\n byte[] buffer = new byte[BUFFER];\n\n int bulk;\n\n InputStream input = file.getInputstream();\n\n while (true) {\n bulk = input.read(buffer);\n\n if (bulk < 0) {\n break;\n }\n\n output.write(buffer, 0, bulk);\n output.flush();\n }\n\n output.close();\n input.close();\n\n } catch (Exception ex) {\n ex.printStackTrace();\n FacesContext.getCurrentInstance().addMessage(\"\", new FacesMessage(bundle.getString(\"Error_file_created\")));\n }\n\n }", "public void mo210a(File file) {\n }", "public void closeFile(){\n }", "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 static void Auslesen()\r\n\t{\n\t\tLargeObjectManager lobj;\r\n\t\ttry {\r\n\t\t\tconn= DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t\tlobj = ((org.postgresql.PGConnection)conn).getLargeObjectAPI();\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(\"SELECT bild FROM bilder WHERE bild = ?\");\r\n\t\t\tps.setString(1, \"bild2.jpg\");\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t // Open the large object for reading\r\n\t\t\t\tString name = rs.getString(1);\r\n\t\t\t int oid = rs.getInt(2);\r\n\t\t\t LargeObject obj = lobj.open(oid, LargeObjectManager.READ);\r\n\r\n\t\t\t // Read the data\r\n\t\t\t byte buf[] = new byte[obj.size()];\r\n\t\t\t obj.read(buf, 0, obj.size());\r\n\t\t\t // Do something with the data read here\r\n\t\t\t \r\n\t\t\t String pfad = \"C:/Temp\";\r\n\t\t\t\tFile file = createFile(pfad, \"bild2.jpg\");\r\n\t\t\t\tFiles.copy(obj.getInputStream(), file.toPath());\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t // Close the object\r\n\t\t\t obj.close();\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "public static void Compartir(File file, Activity actividad) {\n Context con = actividad.getApplicationContext();\n String str = actividad.getApplicationContext().getPackageName() + \".fileprovider\";\n Uri uri = FileProvider.getUriForFile(con, str, file);\n //Uri uri = Uri.fromFile(file);\n Intent intent = new Intent();\n intent.setAction(Intent.ACTION_SEND);\n intent.setType(\"*/*\");\n\n intent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"\");\n intent.putExtra(android.content.Intent.EXTRA_TEXT, \"\");\n intent.putExtra(Intent.EXTRA_STREAM, uri);\n try {\n actividad.startActivity(Intent.createChooser(intent, \"Compartir....\"));\n } catch (ActivityNotFoundException e) {\n Toast.makeText(actividad.getApplicationContext(), \"No hay aplicacion instalada para esta accion\", Toast.LENGTH_SHORT).show();\n }\n }", "File getFile();", "File getFile();", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "@FXML\r\n\tprivate void envoyerFichier()\r\n\t{\r\n\t\tclient.startSendFile(textFieldFichier.getText());\r\n\t}", "public void escribir(String cadena) throws IOException\n {\n fileWriter = new FileWriter(archivo);\n printWriter = new PrintWriter(fileWriter);\n printWriter.println(cadena);\n }", "public void zapisz() {\n String nazwaPliku = \"Zadania\";\n FileOutputStream out;\n PrintWriter o = null;\n pobierz();\n\n try {\n out = openFileOutput(nazwaPliku, Context.MODE_APPEND);\n o = new PrintWriter(out);\n pobierz();\n o = zadanie.zapisz(o);\n\n\n Context context = getApplicationContext();\n CharSequence text = \"Zapisano\";\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n finally {\n o.close();\n }\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 void guardaImagenEnDisco(InputStream imagenBuffer)\n {\n try\n {\n File fichero = new File(\"c:\\\\paella.jpg\");\n BufferedInputStream in = new BufferedInputStream(imagenBuffer);\n BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fichero));\n\n byte[] bytes = new byte[8096];\n int len = 0;\n\n depura(\"Copiamos el fichero\");\n\n while ( (len = in.read( bytes )) > 0 )\n {\n out.write( bytes, 0, len );\n }\n\n out.flush();\n out.close();\n in.close();\n\n depura(\"Teminación del proceso con éxito\");\n }\n catch(Exception e)\n {\n depura(\"Error al escribir en disco \" + e.getMessage());\n }\n }", "@Override\n public void corrupt(File file) throws IOException\n {\n FileChannel.open(file.toPath(), StandardOpenOption.WRITE).truncate(file.length() - CodecUtil.footerLength() - 2).close();\n }", "static void CrearArchivo(Vector productos, Vector clientes){ \r\n \ttry{ //iniciamos el try y si no funciona se hace el catch\r\n BufferedWriter bw = new BufferedWriter(\r\n \t\t//Iniciamos el archivo adentro de bw que es un objeto.\r\n new FileWriter(\"reporte.txt\") );\r\n //creamos un producto auxiliar\r\n Producto p; \r\n //mientas existan productos se escribe lo siguiente en el archivo\r\n for(int x = 0; x < productos.size(); x++){ \r\n \t//impresiones de nombre,codigo,stock,precio en el archivo\r\n \tp = (Producto) productos.elementAt(x);\r\n bw.write(\"Nombre del producto: \" + p.getNombre() + \"\\n\"); \r\n bw.write(\"Codigo del producto: \" + p.getCodigo() + \"\\n\");\r\n bw.write(\"Tamaño del stock: \" + p.getStock() + \"\\n\");\r\n bw.write(\"Precio: \" + p.getPrecio() + \"\\n\");\r\n \r\n \r\n }\r\n //creamos un cliente auxiliar\r\n Cliente c;\r\n //mientas existan clientes se escribe lo siguiente en el archivo\r\n for(int x = 0; x < clientes.size(); x++){ \r\n \tc = (Cliente) clientes.elementAt(x);\r\n \t//impresiones de nombre,telefono,cantidad y total en el archivo\r\n bw.write(\"Nombre del cliente: \" + c.getname() + \"\\n\");\r\n bw.write(\"Numero de telefono: \" + c.getTelefono() + \"\\n\"); \r\n bw.write(\"Cantidad de compra: \" + c.getCantidad() + \"\\n\");\r\n bw.write(\"Total de compra: \" + c.getTotal() + \"\\n\");\r\n \r\n \r\n }\r\n // Cerrar archivo al finalizar\r\n bw.close();\r\n System.out.println(\"¡Archivo creado con éxito!\");\r\n //si no funciona imprime el error\r\n } catch(Exception ex){ \r\n System.out.println(ex);\r\n }\r\n }", "String getFile();", "String getFile();", "String getFile();", "public void recibir( )\r\n {\n \t try\r\n\t {\r\n \t\t recibirArchivo();\r\n\t \r\n \t\t cerrarRecibir();\r\n\t \r\n\t }catch( Exception e )\r\n \t {\r\n \t\t System.out.println( \"Recibir: \"+e.toString() ); \r\n \t }\r\n \r\n }", "public static void RDStockePEntrpot(Destination entrepot){\n File file = new File(\"src/StockeParEntrpot.txt\");\n try {\n if(!file.exists())\n file.createNewFile();\n BufferedWriter writer = new BufferedWriter(new FileWriter(file));\n for(int i = 0; i < entrepot.getSize(); i++){\n if(entrepot.getDon(i).getEtat() == Etat.STOCKE) {\n System.out.println(entrepot.getDon(i));\n writer.write(entrepot.getDon(i).toString() + \"\\r\\n\");\n }\n }\n writer.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "private void fecharArquivoLeitura(BufferedReader file) {\n\t\ttry {\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void gerarCupom(String cliente, String vendedor,List<Produto> produtos, float totalVenda ) throws IOException {\r\n \r\n File arquivo = new File(\"cupomFiscal.txt\");\r\n String produto =\" \"; \r\n if(arquivo.exists()){\r\n System.out.println(\"Arquivo localizado com sucessso\");\r\n }else{\r\n System.out.println(\"Arquivo não localizado, será criado outro\");\r\n arquivo.createNewFile();\r\n } \r\n \r\n for(Produto p: produtos){\r\n produto += \" \"+p.getQtd()+\" \"+ p.getNome()+\" \"+p.getMarca()+\" \"+ p.getPreco()+\"\\n \";\r\n }\r\n \r\n \r\n \r\n FileWriter fw = new FileWriter(arquivo, true);\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n \r\n \r\n bw.write(\" \"+LOJA);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"CLIENTE CPF\");\r\n bw.newLine();\r\n bw.write(cliente);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(DateCustom.dataHora());\r\n bw.newLine();\r\n bw.write(\" CUPOM FISCAL \");\r\n bw.newLine();\r\n bw.write(\"QTD DESCRIÇÃO PREÇO\");\r\n bw.newLine();\r\n bw.write(produto);\r\n bw.newLine(); \r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"TOTAL R$ \" + totalVenda);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"Vendedor \" + vendedor);\r\n bw.newLine();\r\n bw.newLine();\r\n bw.close();\r\n fw.close();\r\n }", "public int closeFile() {\n int test=0;\n try{\n _file=null;\n rows.clear();\n _fis.close();\n _bis.close();\n _dis.close();\n test=1;\n }catch( IOException ioe){\n test=0;\n }\n return test;\n }", "public void arquivoSaida() {\r\n\r\n try {\r\n File file = new File(\"arquivoSaida.txt\");\r\n try (FileWriter arquivoSaida = new FileWriter(file, true)) {\r\n arquivoSaida.write(\"Rota do menor caminho entre as cidades escolhidas: \\n\\n\");\r\n Vertice v;\r\n \r\n //Escreve no arquivo a rota de ida de entrega nas cidades\r\n for (int i = 0; i < rota.getLista_de_rota().size() - 1; i++) {\r\n for (int j = 0; j < rota.getLista_de_rota().get(i).size(); j++) {\r\n v = rota.getLista_de_rota().get(i).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n }\r\n \r\n arquivoSaida.write(\"\\n\\nRota do menor caminho de volta: (Considerando que não há mais nenhuma entrega)\\n\\n\");\r\n // pegando a ultima posição da lista geral em que está a lista do menor caminho de volta\r\n int t = rota.getLista_de_rota().size() - 1; \r\n \r\n //Escreve a rota do caminho de volta, verificando a distancia entre a cidade origem e a cidade destino\r\n for (int j = rota.getLista_de_rota().get(t).size() - 1; j >= 0; j--) {\r\n v = (Vertice) rota.getLista_de_rota().get(t).get(j);\r\n arquivoSaida.write(v.getId() + \"; \");\r\n }\r\n arquivoSaida.write(\"Distancia percorrida: \"+rota.getDistancia()+\"\\n\");\r\n arquivoSaida.close();\r\n }\r\n } catch (IOException ex) { //caso nao seja possivel abrir algum dos arquivos\r\n System.out.println(\"Não foi possivel abrir arquivo\");\r\n }\r\n }", "private boolean copiaArquivo(File origem, File destino)\n\t{\n\t\tboolean copiou = false;\n\t\ttry\n\t\t{\n\t\t\tFileInputStream input \t= new FileInputStream(origem);\n\t\t\tFileOutputStream output = new FileOutputStream(destino);\n\t\t\tint sizeBuffer = Integer.parseInt(getPropriedade(\"ordemVoucher.tamanhoBufferArquivos\"));\n\t\t\tbyte[] buffer = new byte[sizeBuffer];\n\t\t\tint count=0;\n\t\t\twhile( (count=input.read(buffer, 0, sizeBuffer)) != -1)\n\t\t\t\toutput.write(buffer,0,count);\n\n\t\t\toutput.close();\n\t\t\tinput.close();\n\t\t\tcopiou = true;\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tcopiou = false;\n\t\t}\n\t\treturn copiou;\n\t}", "@Override\n\t \tpublic void run() {\n\t \t\tsuper.run();\n\t \t\t FileUtil.DeleteFile(new File(Environment.getExternalStorageDirectory() + \"/\"+\"jikedownload\"));\n\t \t}", "public void newFile() {\r\n \t\tcurFile = null;\r\n \t}", "public void crearPDF()\r\n\t{\r\n\t\tif (!new File(ruta).exists())\r\n\t\t\t(new File(ruta)).mkdirs();\r\n\r\n\t\tFile[] files = (new File(ruta)).listFiles();\r\n\t\tString ruta = \"\";\r\n\t\tif (files.length == 0) {\r\n\t\t\truta = this.ruta + huesped + \"0\" + \".pdf\";\r\n\t\t} else {\r\n\t\t\tString path = files[files.length - 1].getAbsolutePath();\r\n\t\t\tString num = path.substring(path.length() - 5, path.length() - 4);\r\n\r\n\t\t\truta = this.ruta + huesped + (Integer.parseInt(num) + 1) + \".pdf\";\r\n\t\t}\r\n\r\n\t\tSimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/YYYY\");\r\n\t\t\r\n\t\tcabecera = \"\\n\"+\"Resonance Home\" + \"\\n\"+ \r\n \"Armenia, Quindio\" + \"\\n\" + \r\n \"Colombia\" + \"\\n\\n\" + \r\n\t\t\t\t\"Fecha \" + reserva.getFecha().toString() + \"\\n\\n\\n\";\r\n\t\tcontenido = \"Reserva de hospedaje: \"+ reserva.getHospedaje().getId() + \"\\n\" + \r\n \t\"Titulo del Hospedaje: \" + reserva.getHospedaje().getTitulo() + \" \" + \"\\n\" +\r\n \t\"Dirección: \" + reserva.getHospedaje().getDireccion().getDireccion() + \", \" + reserva.getHospedaje().getDireccion().toString() + \"\\n\" +\r\n\t\t\t\t\"Anfitrion: \" + nombreAnfitrion + \"\\n\" + \"Correo: \" + emailAnfitrion + \"\\n\\n\\n\" + \"Huesped: \"\r\n\t\t\t\t+ nombreHuesped + \"\\n\" +\r\n \t\"Metodo de pago: \" + reserva.getTarjeta().getNumeroT() + \" Tarjeta de credito\" + \"\\n\\n\" +\r\n \tformato.format(reserva.getFechaInicial()) + \" hasta \"+ formato.format(reserva.getFechaFinal()) +\"\\n\\n\" +\r\n \t\"Descripcion\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalor\" + \"\\n\\n\" + \r\n\t\t\t\t\"Huespedes\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"\r\n\t\t\t\t+ reserva.getNumeroHuespedes() + \"\\n\" +\r\n\t\t\t\t\"Alojamiento\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t \" + precioCompleto + \"\\n\"\r\n\t\t\t\t+ \"Tarifa de limpieza\" + \"\t\t\t\t \t \" + precioLimpieza + \"\\n\" + \"Comision por servicio\"\r\n\t\t\t\t+ \"\t\t\t\t\t\" + precioComision + \"\\n\\n\";\r\n\t\tpiePagina = \"TOTAL \" + \" \" + \"$ \" + reserva.getValor() + \"\\n\" ;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileOutputStream archivo = new FileOutputStream(ruta);\r\n\t\t\tDocument doc = new Document(PageSize.A5, 10, 10, 10, 10);\r\n\t\t\tPdfWriter.getInstance(doc, archivo);\r\n\t\t\tdoc.open();\r\n\t\t\tdoc.add(obtenerCabecera(cabecera));\r\n\t\t\tdoc.add(obtenerContenido(contenido));\r\n\t\t\tdoc.add(obtenerPiePagina(piePagina));\r\n\t\t\tdoc.close();\r\n\t\t\tthis.ruta = ruta;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"\" + e);\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onRequestHandlePathOz(@NotNull PathOz pathOz, @Nullable Throwable throwable) {\n readPdfFile(pathOz.getPath());\n mButtonReadText.setVisibility(View.VISIBLE);\n mHighlightedTextView.setVisibility(View.VISIBLE);\n mFragmentWallpaperTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(fileTextContent);\n Toast.makeText(getActivity(), \"File Uploaded Successfully !\", Toast.LENGTH_SHORT).show();\n Log.e(\"URI\", \"The URI path: \"+pathOz.getPath());\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 }", "void downloadEto(File file, int id) throws IOException, SQLException;", "@Override\n public void corrupt(File file) throws IOException\n {\n try (FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE))\n {\n channel.truncate(file.length() - CodecUtil.footerLength() - 2);\n }\n }", "private void recibirArchivo() {\n \t int tam;\r\n \t try {\r\n \t\t String nombreArchivo = dis.readUTF().toString(); \r\n \t \r\n\t // Obtenemos el tamaño del archivo\r\n\t tam = dis.readInt(); \r\n\t\r\n\t // System.out.println( \"Recibiendo archivo \"+nombreArchivo );\r\n\t \r\n\t // Creamos flujo de salida, este flujo nos sirve para \r\n\t // indicar donde guardaremos el archivo\r\n\t fos = new FileOutputStream( \"C:\\\\Users\\\\feder\\\\\"+nombreArchivo );\r\n\t out = new BufferedOutputStream( fos );\r\n\t in = new BufferedInputStream( socket.getInputStream() );\r\n\t\r\n\t // Creamos el array de bytes para leer los datos del archivo\r\n\t byte[] buffer = new byte[ tam ];\r\n\t\r\n\t // Obtenemos el archivo mediante la lectura de bytes enviados\r\n\t for( int i = 0; i < buffer.length; i++ )\r\n\t {\r\n\t buffer[ i ] = ( byte )in.read( ); \r\n\t }\r\n\t\r\n\t // Escribimos el archivo \r\n\t out.write( buffer ); \r\n\t\r\n\t // System.out.println( \"Archivo Recibido \"+nombreArchivo );\r\n\t \r\n\t }\r\n\t catch( Exception e )\r\n\t {\r\n\t System.out.println( \"Recibir: \"+e.toString() ); \r\n\t }\r\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n Log.d(\"Paul\", \"delete file\");\n\n File file = new File(Environment.getExternalStorageDirectory().getPath(), getString(R.string.temp_file_name));\n try {\n // if file exists in memory\n if (file.exists()) {\n file.delete();\n Log.d(\"Paul\", \"file deleted\");\n }\n } catch (Exception e) {\n Log.d(\"Paul\",\"Some error happened?\");\n }\n\n }", "private void salvaFoto(){\n\n try {\n\n File f = new File(Environment.getExternalStorageDirectory() +getResources().getString(R.string.folder_package)+ \"/\" +id_Familiar+ \".jpg\");\n\n if(f.exists()){ boolean deleted = f.delete();}\n\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, qualidade_image_profile, bytes);\n\n try {\n f.createNewFile();\n FileOutputStream fo = new FileOutputStream(f);\n fo.write(bytes.toByteArray());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n catch (Exception E){\n Log.e(\"error\",\"Erro ao carregar imagem\");\n }\n }", "private void loadActuality(){\n\n Log.i(\"TAG0\", \"TAG0\");\n if (mPaths.size() > 0){\n Log.i(\"TAG1\", \"TAG1\");\n try {\n File file = new File(mPaths.get(0));\n Bitmap bitmap = new Compressor(this)\n .setMaxWidth(320)\n .setMaxHeight(180)\n .setQuality(90)\n .compressToBitmap(file);\n\n Log.i(\"TAG11\", \"TAG11\");\n final String path = getPathFile();\n StorageReference storageReference = FireBaseUtil.mStorageRef.child(path);\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] data = baos.toByteArray();\n\n UploadTask uploadTask = storageReference.putBytes(data);\n\n uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Log.i(\"TAG2\", \"TAG2\");\n url = taskSnapshot.getDownloadUrl().toString();\n\n saveFakenews(url, taskSnapshot.getMetadata().getCreationTimeMillis());\n Log.i(\"TAG3\", \"TAG3\");\n uploading.stop();\n Log.i(\"TAG4\", \"TAG4\");\n }\n });\n }catch (IOException ex){\n Log.e(\"TAG\", ex.getMessage());\n }\n }else {\n Toast.makeText(this,\"Veuillez sélectionner une image\", Toast.LENGTH_SHORT).show();\n }\n }", "void downloadSavi(File file, int id) throws IOException, SQLException;", "public void insercionMasiva() {\r\n\t\tif (!precondInsert())\r\n\t\t\treturn;\r\n\t\tUploadItem fileItem = seleccionUtilFormController.crearUploadItem(\r\n\t\t\t\tfName, uFile.length, cType, uFile);\r\n\t\ttry {\r\n\t\t\tlLineasArch = FileUtils.readLines(fileItem.getFile(), \"ISO-8859-1\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Error al subir el archivo\");\r\n\t\t}\r\n\r\n\t\tStringBuilder cadenaSalida = new StringBuilder();\r\n\t\tString estado = \"EXITO\";\r\n\t\tcantidadLineas = 0;\r\n\t\t//Ciclo para contar la cantdad de adjudicados o seleccionados que se reciben\r\n\t\tfor (String linea : lLineasArch) {\r\n\t\t\tcantidadLineas++;\r\n\t\t\tif(cantidadLineas > 1){\r\n\t\t\t\tseleccionados++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Condicion para verificar si la cantidad de seleccionados es mayor a la cantidad de vacancias (en cuyo caso se procede a abortar el proceso e imprimir\r\n\t\t//un mensaje de error) o verificar si esta es menor (se imprime el mensaje pero se continua)\r\n\t\t\r\n\t\tif(seleccionados > concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\testado = \"FRACASO\";\r\n\t\t\tcadenaSalida.append(estado + \" - CANTIDAD DE AJUDICADOS ES SUPERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\telse if(seleccionados < concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\tcadenaSalida.append(\"ADVERTENCIA - CANTIDAD DE ADJUDICADOS ES INFERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\tseleccionados = 0;\r\n\t\t\r\n\t\tif(!estado.equals(\"FRACASO\")){\r\n\r\n\t\tcantidadLineas = 0;\r\n\t\tfor (String linea : lLineasArch) {\r\n\r\n\t\t\tcantidadLineas++;\r\n\t\t\testado = \"EXITO\";\r\n\t\t\tString observacion = \"\";\r\n\t\t\tFilaPostulante fp = new FilaPostulante(linea);\r\n\t\t\tList<Persona> lista = null;\r\n\t\t\tif (cantidadLineas > 1 && fp != null && fp.valido) {\r\n\t\t\t\t//Verifica si la persona leida en el registro del archivo CSV existe en la Tabla Persona\r\n\t\t\t\tString sqlPersona = \"select * from general.persona where persona.documento_identidad = '\"+fp.getDocumento()+ \"'\";\r\n\t\t\t\tQuery q1 = em.createNativeQuery(sqlPersona, Persona.class);\r\n\t\t\t\tPersona personaLocal = new Persona();\r\n\t\t\t\tint banderaEncontroPersonas = 0;\r\n\t\t\t\t//Si existe, se almacena el registro de la tabla\r\n\t\t\t\tif(!q1.getResultList().isEmpty()){\r\n\t\t\t\t\tlista = q1.getResultList();\r\n\t\t\t\t\tif (compararNomApe(lista.get(0).getNombres(), removeCadenasEspeciales(fp.getNombres()))\r\n\t\t\t\t\t\t\t&& compararNomApe(lista.get(0).getApellidos(), removeCadenasEspeciales(fp.getApellidos())) ) {\r\n\t\t\t\t\t\t\tbanderaEncontroPersonas = 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\t\tobservacion += \" PERSONA NO REGISTRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\tobservacion += \" PERSONA NO REGITRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t}\r\n\t\t\t\t//Verificamos que la persona figure en la lista corta como seleccionado\r\n\t\t\t\tif(!estado.equals(\"FRACASO\")){\r\n\t\t\t\t\tint banderaExisteEnListaCorta = 0;\t\t\t\t\t\r\n\t\t\t\t\tint i=0;\r\n\t\t\t\t\tif (banderaEncontroPersonas == 1) {\r\n\t\t\t\t\t\twhile(i<lista.size()){\r\n\t\t\t\t\t\t\tpersonaLocal = (Persona) lista.get(i);\r\n\t\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\t\tList<EvalReferencialPostulante> listaEvalRefPost = p.getResultList();\r\n\t\t\t\t\t\t\tif (!listaEvalRefPost.isEmpty()) {\r\n\t\t\t\t\t\t\t\tbanderaExisteEnListaCorta = 1;\r\n\t\t\t\t\t\t\t\ti = lista.size();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (banderaExisteEnListaCorta == 0) {\r\n\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\tobservacion += \" NO SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t} else if (banderaExisteEnListaCorta == 1){\r\n\t\t\t\t\t\tobservacion += \" SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\tEvalReferencialPostulante auxEvalReferencialPostulante = (EvalReferencialPostulante) p.getResultList().get(0);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Validaciones para actualizaciones\r\n\t\t\t\t\t\t//Bandera indicadora de actualizaciones hechas\r\n\t\t\t\t\t\tint bandera = 0;\r\n\t\t\t\t\t\tif(auxEvalReferencialPostulante.getSelAdjudicado() == null){\r\n\t\t\t\t\t\t\testado = \"EXITO\";\r\n\t\t\t\t\t\t\tauxEvalReferencialPostulante.setSelAdjudicado(true);;\r\n\t\t\t\t\t\t\tbandera = 1;\r\n\t\t\t\t\t\t\tem.merge(auxEvalReferencialPostulante);\r\n\t\t\t\t\t\t\tem.flush();\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\tagregarEstadoMotivo(linea, estado, observacion, cadenaSalida);\r\n\t\t\t}\r\n\t\t\tif (cantidadLineas > 1 && !fp.valido) {\r\n\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\tcadenaSalida\r\n\t\t\t\t\t\t.append(estado\r\n\t\t\t\t\t\t\t\t+ \" - ARCHIVO INGRESADO CON MENOS CAMPOS DE LOS NECESARIOS. DATOS INCORRECTOS EN ALGUNA COLUMNA.\");\r\n\t\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\r\n\t\t\t// FIN FOR\r\n\t\t}\r\n\t\t//FIN IF\r\n\t\t}\r\n\t\tif (lLineasArch.isEmpty()) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Archivo inválido\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSimpleDateFormat sdf2 = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\r\n\t\t\tString nArchivo = sdf2.format(new Date()) + \"_\" + fName;\r\n\t\t\tString direccion = System.getProperty(\"jboss.home.dir\") + System.getProperty(\"file.separator\") + \"temp\" + System.getProperty(\"file.separator\");\r\n\t\t\tFile archSalida = new File(direccion + nArchivo);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils\r\n\t\t\t\t\t\t.writeStringToFile(archSalida, cadenaSalida.toString());\r\n\t\t\t\tif (archSalida.length() > 0) {\r\n\t\t\t\t\tstatusMessages.add(Severity.INFO, \"Insercion Exitosa\");\r\n\t\t\t\t}\r\n\t\t\t\tJasperReportUtils.respondFile(archSalida, nArchivo, false,\r\n\t\t\t\t\t\t\"application/vnd.ms-excel\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstatusMessages.add(Severity.ERROR, \"IOException\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void upload(FileUploadEvent event){\n UploadedFile file = event.getFile();\n if(file != null){\n try {\n imagePic = new OracleSerialBlob(file.getContents());\n Long size = imagePic.length();\n putProfPic(imagePic);\n //setPhoto_profile(new ByteArrayContent(imagePic.getBytes(1, size.intValue())));\n } catch (SQLException ex) {\n LOG.error(ex);\n GBMessage.putErrorMessage(\"Error al subir el archivo\");\n } catch (IOException ex) {\n Logger.getLogger(StaffBean.class.getName()).log(Level.SEVERE, null, ex);\n }\n GBMessage.putInfoMessage(\"Carga correcta\");\n }\n }", "private void guardarComo() {\r\n\t\tJFileChooser guardar = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tguardar.setFileFilter(filtro);\r\n\t\tif(guardar.showSaveDialog(guardar) == JFileChooser.APPROVE_OPTION){\r\n\t\t\tGestion.setFichero(Gestion.extensionValida(guardar.getSelectedFile()));\r\n\t\t\ttry {\r\n\t\t\t\tif(!Gestion.existe(Gestion.getFichero())){\r\n\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tswitch(JOptionPane.showConfirmDialog(null, \"El archivo existe. Desea sobreescribirlo?\", \"Aviso\", JOptionPane.WARNING_MESSAGE)){\r\n\t\t\t\t\tcase JOptionPane.OK_OPTION:\r\n\t\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n File sdCard = Environment.getExternalStorageDirectory().getAbsoluteFile();\n File path = new File(sdCard + \"/easeWave\");\n path.mkdirs();\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(path));\n startActivity(Intent.createChooser(intent, getActivity().getString(R.string.sendfile)));\n dialog2.dismiss();\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 }", "int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;" ]
[ "0.63803697", "0.6345304", "0.62428755", "0.6206972", "0.6073323", "0.59998995", "0.599807", "0.5969308", "0.59646297", "0.584652", "0.5832955", "0.58302784", "0.582258", "0.5809384", "0.5808967", "0.5804656", "0.5796432", "0.5791643", "0.5785018", "0.57818806", "0.57658875", "0.5740359", "0.5729594", "0.5699133", "0.569089", "0.56390303", "0.5632347", "0.5600333", "0.55727124", "0.5569277", "0.5561829", "0.55428445", "0.5536476", "0.5534345", "0.55280316", "0.54676294", "0.54618824", "0.54569906", "0.54564905", "0.5452331", "0.5447632", "0.54376054", "0.5437438", "0.5412503", "0.5411491", "0.54113716", "0.5407923", "0.53898275", "0.53897846", "0.5376335", "0.53740746", "0.5359175", "0.53539705", "0.535238", "0.53497154", "0.5343924", "0.53438926", "0.5343767", "0.5336378", "0.53341115", "0.5332223", "0.5328647", "0.5323385", "0.5323385", "0.5316857", "0.5315136", "0.5310581", "0.53050274", "0.53017855", "0.5301198", "0.5297356", "0.5294556", "0.52838945", "0.52838945", "0.52838945", "0.52810323", "0.52780324", "0.52742696", "0.52610356", "0.5257019", "0.52545184", "0.5251675", "0.52469885", "0.5245102", "0.5235493", "0.5223671", "0.5222086", "0.5221584", "0.522143", "0.5214917", "0.52041936", "0.5201633", "0.52010757", "0.5197154", "0.5196921", "0.5195919", "0.5185215", "0.5181353", "0.517333", "0.51721704", "0.51712275" ]
0.0
-1
draw the map GUI
public void toutDessiner(Graphics g);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void drawComponents () {\n // Xoa het nhung gi duoc ve truoc do\n mMap.clear();\n // Ve danh sach vi tri cac thanh vien\n drawMembersLocation();\n // Ve danh sach cac marker\n drawMarkers();\n // Ve danh sach cac tuyen duong\n drawRoutes();\n }", "public void printMap()\n {\n this.mapFrame.paint();\n this.miniMapFrame.paint();\n }", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void generateMap(){\n if(currDirections != null){\n\n\t \tPoint edge = new Point(mapPanel.getWidth(), mapPanel.getHeight());\n \tmapPanel.paintImmediately(0, 0, edge.x, edge.y);\n\t \t\n\t \t\n\t \t// setup advanced graphics object\n\t Graphics2D g = (Graphics2D)mapPanel.getGraphics();\n\t g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);\n\n\t \n\t Route rt = currDirections.getRoute();\n\t\n\t boolean singleStreet = rt.getGeoSegments().size() == 1;\n\t Route contextRoute = (!singleStreet ? rt : \n\t \t\tnew Route( virtualGPS.findFullSegment(rt.getEndingGeoSegment()) ) );\n\t \n\t // calculate the longitude and latitude bounds\n\t int[] bounds = calculateCoverage( contextRoute , edge);\n\t \n\t Collection<StreetSegment> map = virtualGPS.getContext(bounds, contextRoute);\n\t \n\t \n\t // draw every segment of the map\n\t g.setColor(Color.GRAY);\n\t for(GeoSegment gs : map){\n\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t \n\t // draw the path over the produced map in BLUE\n\t g.setColor(Color.BLUE);\n\t for(GeoFeature gf : rt.getGeoFeatures()){\n\t for(GeoSegment gs : gf.getGeoSegments()){\n\t\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t Point start = derivePoint(bounds, edge, gf.getStart());\n\t Point end = derivePoint(bounds, edge, gf.getEnd());\n\t \n\t int dX = (int)(Math.abs(start.x - end.x) / 2.0);\n\t int dY = (int)(Math.abs(start.y - end.y) / 2.0);\n\n if(!jCheckBoxHideStreetNames.isSelected()){\n \tg.setFont(new Font(g.getFont().getFontName(), Font.BOLD, g.getFont().getSize()));\n \tg.drawString(gf.getName(), start.x + (start.x<end.x ? dX : -dX),\n \t\t\tstart.y + (start.y<end.y ? dY : -dY));\n }\n\t }\n }\n }", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "public void drawMap() {\n\t\tRoad[] roads = map.getRoads();\r\n\t\tfor (Road r : roads) {\r\n\t\t\tif (r.turn) {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road = true;\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_vert = true;\r\n\t\t\t} else if (r.direction == Direction.NORTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_north = true;\r\n\t\t\telse if (r.direction == Direction.SOUTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_south = true;\r\n\t\t\telse if (r.direction == Direction.WEST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_west = true;\r\n\t\t\telse if (r.direction == Direction.EAST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_east = true;\r\n\t\t\ttry {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].updateImage();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void drawMap(Map map) {\n\t\tSystem.out.println(\"Draw map\"+map.getClass().getName()+\"on SD Screen\");\n\t}", "public void displayMap() {\n MapMenuView mapMenu = new MapMenuView();\r\n mapMenu.display();\r\n \r\n }", "@Override\n protected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tFont f = new Font(\"sansserif\", Font.BOLD, 12);\n\t\tg.setFont(f);\n\t\tif(type == 1){\n\t\t\t //draw the map\n\t g.drawImage(image, 0, 0, getWidth(), getHeight(), this);\n\t //draw the names on the map\n\t for (City city : cities) {\n\t \n\t \tif (city.hasLocation()) {\n\t \t\tPoint location = getLocationFromCoordinate(city.getLatitude(), city.getLongitude());\n\t \t\tg.drawString(city.getName(), (int)(location.getx())*multiplier, (int)(location.gety())*multiplier);\n\t \t\tg.fillRect((int)location.getx()*multiplier, (int)location.gety()*multiplier, 3, 3);\n\t \t}\n\t }\n\t\t}\n\t\tif(type == 2) {\n\t\t\t//draw the map\n\t g.drawImage(image, 0, 0, getWidth(), getHeight(), this);\n\t //draw the names on the map\n\t for (PointOfInterest point : points) {\n\t \tif (point.hasLocation()) {\n\t \t\tPoint location = getLocationFromCoordinate(point.getLatitude(), point.getLongitude());\n\t \t\tg.drawString(point.getName(), (int)(location.getx())*multiplier, (int)(location.gety())*multiplier);\n\t \t}\n\t }\n\t\t}\n\t\tif (type == 3) {\n\t\t\tg.drawImage(image, 0,0,getWidth(),getHeight(), this);\n\t\t\tfor(Region region : regions) {\n\t\t\t\tif (region.hasLocation()) {\n\t\t\t\t\tPoint location = getLocationFromCoordinate(region.getLatitude(), region.getLongitude());\n\t\t\t\t\tg.drawString(region.getName(), (int)location.getx()*multiplier, (int)(location.gety())*multiplier);\n\t\t\t\t\tg.drawRect((int)location.getx()*multiplier - (length/2)*3, (int)(location.gety())*multiplier - (breadth/2)*3, \n\t\t\t\t\t\t\tlength*multiplier, breadth*multiplier);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "public void updateMap(boolean animate) {\n\t\tgetContentPane().add(mapContainer);\n\t\trevalidate();\n\t\t\n\t\t// Setting up map\n\t\tint width = mapContainer.getWidth();\n\t\tint height = mapContainer.getHeight();\n\t\tBufferedImage I = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2d = I.createGraphics();\n\t\tg2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\n\t\t// Setting up map dimensions\n\t\tdouble xM = width*zoom, yM = height*zoom;\n\t\tdouble xL = Math.abs(mapBounds[1]-mapBounds[3]), yL = Math.abs(mapBounds[0]-mapBounds[2]);\n\t\tdouble xI = (xM-(yM-60)*(xL/yL))/2, yI = 30;\n\t\tif(xM/yM < xL/yL) {\n\t\t\txI = 30;\n\t\t\tyI += (yM-(xM-60)*(yL/xL))/2;\n\t\t}\n\t\tdouble yP = yM*yF-yM/zoom/2, xP = xM*xF-xM/zoom/2;\n\t\t\n\t\tg2d.setColor(Color.white);\n\t\tg2d.fillRect(20, 20, width-40, height-40);\n\t\tg2d.setColor(roadColor);\n\t\tg2d.setStroke(new BasicStroke(roadWidth));\n\t\t\n\t\t// Drawing each road\n\t\tint i, n = G.getSize();\n\t\tdouble[] v1, v2;\n\t\tfor(i = 0; i < n; i++) {\n\t\t\tfor(Edge e : G.getEdges(i)) {\t\t\t\t\n\t\t\t\tv1 = V.get(i);\n\t\t\t\tv2 = V.get(e.next);\n\t\t\t\tif(animate)\n\t\t\t\t\tdrawRoad(xM, yM, xL, yL, xI, yI, xP, yP, v1[0], v1[1], v2[0], v2[1], 0, g2d);\n\t\t\t\telse {\n\t\t\t\t\tdrawRoad(xM, yM, xL, yL, xI, yI, xP, yP, v1[0], v1[1], v2[0], v2[1], (int)(v1[2]*v2[2]), g2d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Drawing each path\n\t\tif(animate) {\n\t\t\tn = P.size()-1;\n\t\t\tfor(i = 0; i < n; i++) {\n\t\t\t\t\n\t\t\t\tv1 = V.get(P.get(i));\n\t\t\t\tv2 = V.get(P.get(i+1));\n\t\t\t\t\n\t\t\t\tdrawRoad(xM, yM, xL, yL, xI, yI, xP, yP, v1[0], v1[1], v2[0], v2[1], 1, g2d);\n\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(10);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmapContainer.setIcon(new ImageIcon(I));\n\t\t\t\trevalidate();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Creating image base\n\t\tg2d.setStroke(new BasicStroke(1));\n\t\tg2d.setColor(Color.lightGray);\n\t\tg2d.fillRect(0, 0, width, 20);\n\t\tg2d.fillRect(0, 0, 20, height);\n\t\tg2d.fillRect(width-20, 0, 20, height);\n\t\tg2d.fillRect(0, height-20, width, 20);\n\t\tg2d.setColor(Color.black);\n\t\tg2d.drawRect(20, 20, width-40, height-40);\n\t\tg2d.setFont(titleFont);\n\t\tg2d.drawString(title, 40, 15);\n\t\tint tw = g2d.getFontMetrics().stringWidth(title);\n\t\tg2d.setFont(subtitleFont);\n\t\tg2d.drawString(subtitle, 50+tw, 15);\n\t\t\n\t\t\n\t\tmapContainer.setIcon(new ImageIcon(I));\n\t\trevalidate();\n\t}", "public void showmap() {\n MapForm frame = new MapForm(this.mapLayout);\n frame.setSize(750, 540);\n frame.setLocationRelativeTo(null);\n frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n frame.setVisible(true);\n }", "public void printMap()\n {\n if(this.firstTime)\n {\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() { setVisible(true); }\n });\n this.firstTime = false;\n }\n screen.repaint();\n }", "private void setUpMap() {\n if (points.size()>2) {\n drawCircle();\n }\n\n\n }", "public void draw() {\n GraphicsContext gc = getGraphicsContext2D();\n /*gc.clearRect(0, 0, getWidth(), getHeight());\n\n if (squareMap != null) {\n squareMap.draw(gc);\n }\n if (hexMap != null) {\n hexMap.draw(gc);\n }*/\n\n // Draw animations\n for (SpriteAnimationInstance anim : animationList) {\n anim.draw(gc);\n }\n\n // Lastly draw the dialogue window, no matter which canvas\n // we are on, all the same.\n DfSim.dialogueWindow.draw(gc);\n\n /*if (landMap != null) {\n landMap.draw(gc);\n }*/\n\n // Draw a border around the canvas\n //drawBorder(gc);\n\n // And now just draw everything directly from the simulator\n /*for (Raindrop item : sim.getDrops()) {\n drawMovableCircle(gc, item);\n }\n for (Earthpatch item : sim.getPatches()) {\n drawMovableCircle(gc, item);\n }\n for (SysShape item : sim.getShapes()) {\n drawSysShape(gc, item);\n }\n for (Spike item : sim.getSpikes()) {\n drawMovablePolygon(gc, item);\n }\n for (GravityWell item : sim.getGravityWells()) {\n drawGravityWell(gc, item);\n }*/\n }", "public void displayShapefile(File file) throws Exception {\n FileDataStore store = FileDataStoreFinder.getDataStore(file);\n featureSource = store.getFeatureSource();\n setGeometry(); //definimos la geometria\n\n /*\n * Crea el jmapFrame y lo configura para mostrar el shapefile con estilo por defecto\n */\n MapContent map = new MapContent();\n map.setTitle(\"Ejemplo seleccion y dibujo\");\n Style style = createDefaultStyle();\n Layer layer = new FeatureLayer(featureSource, style);\n map.addLayer(layer);\n mapFrame = new JMapFrame(map);\n mapFrame.enableToolBar(true);\n mapFrame.enableStatusBar(true);\n \n \n /**\n * Agregamos los atributos necesarios para crear los botones que permita dibujar un punto en el mapa y otro para seleccionar la figura\n * geometrica mas cercana a donde el usuario haga click\n */\n JToolBar toolBarDibujo = mapFrame.getToolBar();\n JButton botonDibujo = new JButton(\"Draw\");\n toolBarDibujo.addSeparator();\n toolBarDibujo.add(botonDibujo);\n\n botonDibujo.addActionListener(e -> mapFrame.getMapPane().setCursorTool(new CursorTool() { //accion al seleccionar el boton \"draw\"\n @Override\n public void onMouseClicked(MapMouseEvent ev) {\n \tint respuesta= JOptionPane.showConfirmDialog(null, \"¿Desea guardar este punto?\", \"Confirmar\",JOptionPane.YES_NO_OPTION);\n \tif(respuesta==0) {\n \t\tString texto=JOptionPane.showInputDialog(null, \"Nombre del lugar\");\n \t\tDirectPosition2D p = ev.getWorldPos();\n System.out.println(p.getX() + \" -- \" + p.getY());\n drawMyPoint(p.getX(), p.getY(), map, texto);\n \t}\n \telse{\n \t\tSystem.out.println(\"Punto no guardado\");\n \t}\n \n }\n })); \n\n JToolBar toolBar = mapFrame.getToolBar();\n JButton btn = new JButton(\"Select\"); //el boton que agregamos\n toolBar.addSeparator();\n toolBar.add(btn);\n\n\n btn.addActionListener(e ->mapFrame.getMapPane().setCursorTool(new CursorTool() {@Override //accion al seleccionar el boton \"select\"\n public void onMouseClicked(MapMouseEvent ev) {\n selectFeatures(ev);\n }\n }));\n\n \n mapFrame.setSize(600, 600);\n mapFrame.setVisible(true);\n}", "public void drawMap(Graphics g) {\r\n\t\tfor (UIElement field : fields.values())\r\n\t\t\tfield.draw(g);\r\n\r\n\t\tfor (UIElement stargate : stargates.values())\r\n\t\t\tstargate.draw(g);\r\n\t}", "public MapGUI_JPanel() {\n initComponents();\n initComponents1();\n }", "public void paint(Graphics g)\n\t\t{\n\t\t\t\n\t\t\tif (!gameStarted)\n\t\t\t\ttown.show (g); //when the game first starts draws the map\n//\t\t\ttown.show(g);\n//\t\t\ttestPlayer.show(g);\n//\t\t\thouse1.show (g);\n//\t\t\thome.show (g);\n//\t\t\thouse2.show (g);\n//\t\t\tpokecentre.show (g);\n//\t\t\toakLab.show(g);\n\t\t}", "private void draw() {\n this.player.getMap().DrawBackground(this.cameraSystem);\n\n //Dibujamos al jugador\n player.draw();\n\n for (Character character : this.characters) {\n if (character.getMap() == this.player.getMap()) {\n character.draw();\n }\n }\n\n //Dibujamos la parte \"superior\"\n this.player.getMap().DrawForeground();\n\n //Sistema de notificaciones\n this.notificationsSystem.draw();\n\n this.player.getInventorySystem().draw();\n\n //Hacemos que la cámara se actualice\n cameraSystem.draw();\n }", "public void paint()\n {\n try { Thread.sleep(SPEED); } \n catch (Exception e) { }\n \n this.printMap();\n }", "@Override\n public void paintComponent(final Graphics theGraphics) {\n super.paintComponent(theGraphics);\n final Graphics2D g2 = (Graphics2D) theGraphics;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n g2.setStroke(STROKE);\n\n // draw city map\n\n drawMap(g2);\n\n // draw vehicles\n for (final Vehicle v : myVehicles) {\n final String imageFilename = \"icons//\" + v.getImageFileName();\n //final String imageFilename = v.getImageFileName();\n ImageIcon imgIcon = new ImageIcon(imageFilename);\n\n if (imgIcon.getImageLoadStatus() != MediaTracker.COMPLETE) {\n imgIcon = new ImageIcon(getClass().getResource(imageFilename));\n }\n\n final Image img = imgIcon.getImage();\n g2.drawImage(img, v.getX() * SQUARE_SIZE, v.getY() * SQUARE_SIZE,\n SQUARE_SIZE, SQUARE_SIZE, this);\n\n if (myDebugFlag) {\n drawDebugInfo(g2, v);\n }\n }\n\n if (myDebugFlag) {\n g2.setColor(Color.WHITE);\n g2.drawString(\"Update # \" + myTimestep, DEBUG_OFFSET / 2,\n FONT.getSize() + DEBUG_OFFSET / 2);\n }\n }", "public static void drawMapPoints(ArrayList<PointOfInterest> points) {\n\t\t// Use a label to display the image\n\t\tJFrame frame = new JFrame();\n\t\tframe.setSize(1080, 540);\n\t\tMap map = new Map(null, (ArrayList<PointOfInterest>)(points), null, 2, 0, 0);\n\t\tframe.add(map);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.setVisible(true);\n\t}", "public void drawMap(ArrayList<Entity> entities){\n\t\t//draw map\n\t\tmap.draw(graphics, entities);\n\t}", "public void repaintMap() {\r\n\t\tpolygonMap.repaint();\r\n\t}", "private void drawMap(final Graphics2D theGraphics) {\n for (int y = 0; y < myGrid.length; y++) {\n final int topy = y * SQUARE_SIZE;\n\n for (int x = 0; x < myGrid[y].length; x++) {\n final int leftx = x * SQUARE_SIZE;\n\n switch (myGrid[y][x]) {\n case STREET:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n drawStreetLines(theGraphics, x, y);\n break;\n\n case WALL:\n theGraphics.setPaint(Color.BLACK);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case TRAIL:\n theGraphics.setPaint(Color.YELLOW.darker().darker());\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case LIGHT:\n // draw a circle of appropriate color\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n \n case CROSSWALK:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n \n drawCrossWalkLines(theGraphics, x, y);\n \n // draw a small circle of appropriate color centered in the square\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n topy + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n SQUARE_SIZE / 2, SQUARE_SIZE / 2);\n break;\n\n default:\n }\n\n drawDebugInfo(theGraphics, x, y);\n }\n }\n }", "void iniciaDesenho(){\r\n \r\n \r\n GPSplt.setStroke(new BasicStroke(5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_MITER));\r\n GPSplt.setLineColor(new Color(0,28,28));\r\n //GPSplt.setSize(935,555);\r\n GPSplt.setSize(983,465);\r\n GPSplt.setBackground(new Color(255,255,51));\r\n GPSplt.setLocation(10,34);\r\n //jPanel1.add(GPSplt); \r\n //jPanel1.setSize(600,500);\r\n getContentPane().add(GPSplt);\r\n GPSplt.paintAll(GPSplt.getGraphics());\r\n GPSGoogle.setVisible(false);\r\n \r\n \r\n // Mostrar Figura de Fundo ...\r\n if (CbMapa.isSelected()==true) {\r\n Mostra.setText(Mostra.getText()+\"\\n\"+\"MapaAtivo\");\r\n Mostra.setCaretPosition(Mostra.getText().length() );\r\n \r\n }\r\n \r\n repaint();\r\n \r\n }", "private static void draw() {\n\t\tinitField();\n\t\tview = new View(field);\n\t\tview.setSize(viewWidth, viewHeight);\n\t\tframe = new JFrame();\n\t\tframe.setSize(fwidth, fheight);\n\t\tframe.setTitle(\"Land Mine\");\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.add(view);\n\t\tframe.setVisible(true);\n\t}", "public void paint()\n {\n try { Thread.sleep(SPEED); } \n catch (Exception e) { }\n \n this.printMap();\n }", "private void draw() {\n gsm.draw(g);\n }", "public void renderMap(GameMap gameMap, Player player)\n\t{\n\t\tthis.drawMapGlyphs(gameMap, player);\n\t\t// this.getGlyphs(gameMap, player);\n\t\t// for(Text text : this.getGlyphs(gameMap))\n\t\t// window.getRenderWindow().draw(text);\n\t}", "public void paint(Map map, Graphics graphics, Camera camera, GraphicsManager graphicsManager)\r\n\t{\r\n\t\tgraphics.drawImage(graphicsManager.getPanelGaucheBas(), 0, 0, GameConfiguration.WINDOW_WIDTH, GameConfiguration.WINDOW_HEIGHT, null);\r\n\t\tint tileSize = GameConfiguration.TILE_SIZE;\r\n\t\t\r\n\t\tTile[][] tiles = map.getTiles();\r\n\t\tint width = GameConfiguration.WINDOW_WIDTH;\r\n\t\tint height = GameConfiguration.WINDOW_HEIGHT;\r\n\t\tif(GameConfiguration.launchInFullScreen) {\r\n\t\t\twidth = Toolkit.getDefaultToolkit().getScreenSize().width;\r\n\t\t\theight = Toolkit.getDefaultToolkit().getScreenSize().height;\r\n\t\t}\r\n\t\t//draw map\r\n\t\tfor (int lineIndex = 0; lineIndex < map.getLineCount(); lineIndex++) \r\n\t\t{\r\n\t\t\tfor (int columnIndex = 0; columnIndex < map.getColumnCount(); columnIndex++) \r\n\t\t\t{\r\n\t\t\t\tTile tile = tiles[lineIndex][columnIndex];\r\n//tilePos.x + tilePos.w >= 0 && tilePos.y + tilePos.h >= 0 && tilePos.x <= GAME_WIDTH && tilePos.y <= GAME_HEIGHT\r\n\t\t\t\tif(tile.getColumn() * tileSize - camera.getX() + tileSize >= 0 \r\n\t\t\t\t\t&& tile.getLine() * tileSize - camera.getY() + tileSize >= 0 \r\n\t\t\t\t\t&& tile.getColumn() * tileSize - camera.getX() <= width && tile.getLine() * tileSize - camera.getY() <= height) {\r\n\t\t\t\t\tAnimation animation = tile.getAnimation();\r\n\t\t\t\t\tgraphics.drawImage(graphicsManager.getGrassTile(), tile.getColumn() * tileSize - camera.getX(), tile.getLine() * tileSize - camera.getY(), tileSize, tileSize, null);\r\n\t\t\t\t\tgraphics.drawImage(animation.getFrame(), tile.getColumn() * tileSize - camera.getX(), tile.getLine() * tileSize - camera.getY(), tileSize, tileSize, null);\r\n\t\t\t\t\t/*graphics.setColor(Color.white);\r\n\t\t\t\t\tgraphics.drawRect(tile.getColumn() * tileSize - camera.getX(), tile.getLine() * tileSize - camera.getY(), tileSize, tileSize);*/\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n panelTop = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n panelInfo = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n lstRouteInfo = new javax.swing.JList(model);\n panelMap = new uk.route.bean.DrawPanel();\n panelBottom = new javax.swing.JPanel();\n btnManageRoutes = new javax.swing.JButton();\n btMappings = new javax.swing.JButton();\n btnFindRoute = new javax.swing.JButton();\n btnClearMap = new javax.swing.JButton();\n btnClose = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setMinimumSize(new java.awt.Dimension(900, 700));\n\n panelTop.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 25));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 36));\n jLabel1.setForeground(new java.awt.Color(255, 51, 0));\n jLabel1.setText(\"Uttarakhand Route Map\");\n panelTop.add(jLabel1);\n\n getContentPane().add(panelTop, java.awt.BorderLayout.PAGE_START);\n\n panelInfo.setLayout(new java.awt.BorderLayout());\n\n lstRouteInfo.setMinimumSize(new java.awt.Dimension(100, 90));\n jScrollPane1.setViewportView(lstRouteInfo);\n\n panelInfo.add(jScrollPane1, java.awt.BorderLayout.CENTER);\n\n getContentPane().add(panelInfo, java.awt.BorderLayout.LINE_END);\n\n javax.swing.GroupLayout panelMapLayout = new javax.swing.GroupLayout(panelMap);\n panelMap.setLayout(panelMapLayout);\n panelMapLayout.setHorizontalGroup(\n panelMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 735, Short.MAX_VALUE)\n );\n panelMapLayout.setVerticalGroup(\n panelMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 718, Short.MAX_VALUE)\n );\n\n getContentPane().add(panelMap, java.awt.BorderLayout.CENTER);\n\n btnManageRoutes.setText(\" Manage Routes \");\n btnManageRoutes.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnManageRoutesActionPerformed(evt);\n }\n });\n panelBottom.add(btnManageRoutes);\n\n btMappings.setText(\"Manage Mappings\");\n btMappings.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btMappingsActionPerformed(evt);\n }\n });\n panelBottom.add(btMappings);\n\n btnFindRoute.setText(\" Find Route \");\n btnFindRoute.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnFindRouteActionPerformed(evt);\n }\n });\n panelBottom.add(btnFindRoute);\n\n btnClearMap.setText(\" Clear Map \");\n btnClearMap.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnClearMapActionPerformed(evt);\n }\n });\n panelBottom.add(btnClearMap);\n\n btnClose.setText(\" Close \");\n btnClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCloseActionPerformed(evt);\n }\n });\n panelBottom.add(btnClose);\n\n getContentPane().add(panelBottom, java.awt.BorderLayout.PAGE_END);\n\n pack();\n }", "public GraphicUI() {\n initComponents();\n jPanelAddr.setVisible(false);\n jButtonDBToAddr.setVisible(false);\n jFrameMap.setVisible(false);\n\n selectedFormat = 0;\n quickSearch = false;\n \ttextFieldDefaults = setFieldDefaults();\n \ttextFieldCurrents = setFieldDefaults();;\n\n }", "public static void map(int location)\n\t{\n\t\tswitch(location)\n\t\t{\t\n\t\t\tcase 1:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # X # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * X # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # X # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # X # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 5:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * X # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 6:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # X # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 7:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # X * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 8:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * X # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 9:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # X * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 10:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * X # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 11:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # X # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 12:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # X # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\");\n\t\t}//end switch(location)\n\t\t\n\t}", "public void draw() {\n \n // TODO\n }", "private void drawGraph() {\n // you can show warning messages now\n imrGuiBean.showWarningMessages(true);\n addGraphPanel();\n setButtonsEnable(true);\n }", "private void viewMap() {\r\n \r\n // Get the current game \r\n theGame = cityofaaron.CityOfAaron.getTheGame();\r\n \r\n // Get the map \r\n Map map = theGame.getMap();\r\n Location locations = null;\r\n \r\n // Print the map's title\r\n System.out.println(\"\\n*** Map: CITY OF AARON and Surrounding Area ***\\n\");\r\n // Print the column numbers \r\n System.out.println(\" 1 2 3 4 5\");\r\n // for every row:\r\n for (int i = 0; i < max; i++){\r\n // Print a row divider\r\n System.out.println(\" -------------------------------\");\r\n // Print the row number\r\n System.out.print((i + 1) + \" \");\r\n // for every column:\r\n for(int j = 0; j<max; j++){\r\n // Print a column divider\r\n System.out.print(\"|\");\r\n // Get the symbols and locations(row, column) for the map\r\n locations = map.getLocation(i, j);\r\n System.out.print(\" \" + locations.getSymbol() + \" \");\r\n }\r\n // Print the ending column divider\r\n System.out.println(\"|\");\r\n }\r\n // Print the ending row divider\r\n System.out.println(\" -------------------------------\\n\");\r\n \r\n // Print a key for the map\r\n System.out.println(\"Key:\\n\" + \"|=| - Temple\\n\" + \"~~~ - River\\n\" \r\n + \"!!! - Farmland\\n\" + \"^^^ - Mountains\\n\" + \"[*] - Playground\\n\" \r\n + \"$$$ - Capital \" + \"City of Aaron\\n\" + \"### - Chief Judge/Courthouse\\n\" \r\n + \"YYY - Forest\\n\" + \"TTT - Toolshed\\n\" +\"xxx - Pasture with \"\r\n + \"Animals\\n\" + \"+++ - Storehouse\\n\" +\">>> - Undeveloped Land\\n\");\r\n }", "public void paintComponent(Graphics g) {\r\n \tsuper.paintComponent(g);\r\n \t/*print the boat*/\r\n \tReadFile file = new ReadFile();\r\n \t\tfile.openFile(); \r\n \t\t/* Map include all the points of the boat*/\r\n \t\tMap <String,ArrayList<Point>> map = new HashMap<String,ArrayList<Point>>();\r\n \t\tmap = file.parseFile(); \r\n \t\tfor (String key : map.keySet()) {\r\n \t \tif (key.startsWith(\"line\"))\r\n \t \t{\r\n \t \t System.out.println(key + \" \" + map.get(key));\r\n \t \t\tint x1 = (int) map.get(key).get(0).getX();\r\n \t \t\t int y1 = (int) map.get(key).get(0).getY();\r\n \t \t\t int x2 = (int)map.get(key).get(1).getX();\r\n \t \t\t int y2 = (int)map.get(key).get(1).getY();\r\n \t \t\t drawLine(x1,y1,x2,y2,g);\t \t\t\r\n \t \t}\r\n \t \tif (key.startsWith(\"circle\"))\r\n \t \t{\r\n \t \t System.out.println(key + \" \" + map.get(key));\r\n \t \t\tint x1 = (int) map.get(key).get(0).getX();\r\n \t \t\t int y1 = (int) map.get(key).get(0).getY();\r\n \t \t\t int x2 = (int)map.get(key).get(1).getX();\r\n \t \t\t int y2 = (int)map.get(key).get(1).getY();\r\n \t \t\t drawCircle(x1,y1,x2,y2,g);\t \t\t\r\n \t \t}\r\n \t \tif (key.startsWith(\"curve\"))\r\n \t \t{\r\n \t \t System.out.println(key + \" \" + map.get(key));\r\n \t \t\tint x1 = (int) map.get(key).get(0).getX();\r\n \t \t\tint y1 = (int) map.get(key).get(0).getY();\r\n \t \t\tint x2 = (int)map.get(key).get(1).getX();\r\n \t \t\tint y2 = (int)map.get(key).get(1).getY();\r\n \t \t\tint x3 = (int)map.get(key).get(2).getX();\r\n\t \t\tint y3 = (int)map.get(key).get(2).getY();\r\n\t \t\tint x4 = (int)map.get(key).get(3).getX();\r\n \t \t\tint y4 = (int)map.get(key).get(3).getY();\r\n \t \t\tdrawCurve(x1,y1,x2,y2,x3,y3,x4,y4,200,g); \t \t} \t\t\r\n \t\t}\r\n \t\t\r\n \t\t\r\n \t\t\r\n \tfor (int i = 0; i < clicksforLine.size(); i++ )\r\n\t\t{\r\n \t\tg.drawRect((int)Math.round(clicksforLine.get(i).getX()),(int) Math.round(clicksforLine.get(i).getY()),2,2);\r\n\r\n\t\t}\r\n \tfor (int j = 0; j < clicksforCircle.size(); j++ )\r\n\t\t{\r\n \t\tg.drawRect((int)Math.round(clicksforCircle.get(j).getX()),(int) Math.round(clicksforCircle.get(j).getY()),2,2);\r\n\r\n\t\t}\r\n \tfor (int j = 0; j < clicksforPoly.size(); j++ )\r\n\t\t{\r\n \t\tg.drawRect((int)Math.round(clicksforPoly.get(j).getX()),(int) Math.round(clicksforPoly.get(j).getY()),2,2);\r\n\r\n\t\t}\r\n \tfor (int j = 0; j < clicksforCurve.size(); j++ )\r\n\t\t{\r\n \t\tg.drawRect((int)Math.round(clicksforCurve.get(j).getX()),(int) Math.round(clicksforCurve.get(j).getY()),2,2);\r\n\r\n\t\t}\r\n \r\n \t\r\n \t//check is the list of the shape LINE has at least 2 points to draw line\r\n \tif (clicksforLine.size() >= 2)\r\n {\r\n \tfor (int i=0; i < clicksforLine.size(); i+=2 )\r\n \t \t\t{\r\n \t\t int x1=0, y1=0, x2=0, y2=0;\r\n \t\t \t\tSystem.out.println(\"Line case\");\r\n \t\t\t x1 = (int) clicksforLine.get(i).getX();\r\n \t\t\t y1 = (int) clicksforLine.get(i).getY();\r\n \t\t\t x2 = (int) clicksforLine.get(i+1).getX();\r\n \t\t\t y2 = (int) clicksforLine.get(i+1).getY();\r\n \t\t\t drawLine(x1,y1,x2,y2,g);\r\n \t \t \t\t\r\n \t \t}\r\n }\r\n //check is the list of the shape CIRCLE has at least 2 points to draw circle\r\n if (clicksforCircle.size() >= 2)\r\n {\t\r\n \tfor (int i=0; i < clicksforCircle.size(); i+=2 )\r\n \t\t \t{\r\n \t\t int x1=0, y1=0, x2=0, y2=0;\r\n \t\t \t\tSystem.out.println(\"Line case\");\r\n \t\t\t x1 = (int) clicksforCircle.get(i).getX();\r\n \t\t\t y1 = (int) clicksforCircle.get(i).getY();\r\n \t\t\t x2 = (int) clicksforCircle.get(i+1).getX();\r\n \t\t\t y2 = (int) clicksforCircle.get(i+1).getY();\r\n \t\t\t drawCircle(x1,y1,x2,y2,g);\r\n \t \t \t\t\r\n \t\t \t}\r\n \t }\r\n //check is the list of the shape LINE has at least 2 points to draw line\r\n if (clicksforPoly.size() >= 2)\r\n \t {\r\n \t\t \tfor (int i=0; i < clicksforPoly.size(); i+=2 )\r\n \t\t \t{\r\n \t\t int x1=0, y1=0, x2=0, y2=0;\r\n \t\t \t\tSystem.out.println(\"Line case\");\r\n \t\t\t x1 = (int) clicksforPoly.get(i).getX();\r\n \t\t\t y1 = (int) clicksforPoly.get(i).getY();\r\n \t\t\t x2 = (int) clicksforPoly.get(i+1).getX();\r\n \t\t\t y2 = (int) clicksforPoly.get(i+1).getY();\r\n \t\t\t String text = MyWindow.input.getText();\r\n \t\t\t drawPolygon(x1,y1,x2,y2,Integer.parseInt(text),g);\r\n \t \t \t\t\r\n \t\t \t}\r\n \t }\r\n //check is the list of the shape CURVE has at least 2 points to draw curve\r\n if (clicksforCurve.size() >= 4)\r\n \t {\r\n \t\t \tfor (int i=0; i < clicksforCurve.size(); i+=4 )\r\n \t\t \t{\r\n \t int x1=0, y1=0, x2=0, y2=0, x3=0,y3=0,x4=0,y4=0;\r\n \t \t\tSystem.out.println(\"Line case\");\r\n \t\t x1 = (int) clicksforCurve.get(i).getX();\r\n \t\t y1 = (int) clicksforCurve.get(i).getY();\r\n \t\t x2 = (int) clicksforCurve.get(i+1).getX();\r\n \t\t y2 = (int) clicksforCurve.get(i+1).getY();\r\n \t\t x3 = (int) clicksforCurve.get(i+2).getX();\r\n \t\t y3 = (int) clicksforCurve.get(i+2).getY();\r\n \t\t x4 = (int) clicksforCurve.get(i+3).getX();\r\n \t\t y4 = (int) clicksforCurve.get(i+3).getY();\r\n \t\t String text = MyWindow.input.getText();\r\n \t\t drawCurve(x1,y1,x2,y2,x3,y3,x4,y4,Integer.parseInt(text),g);\r\n \t \t}\r\n \t }\r\n\t\r\n }", "@Override\n\tprotected void onDraw(Canvas canvas)\n\t{\n\t\tdrawMap(canvas);\n\t\t\n\t\t screenwidth= context.getResources().getDisplayMetrics().widthPixels;\n\t\t screenheight= context.getResources().getDisplayMetrics().heightPixels;\n//\t\t\n//\t\tFMDBDatabaseAccess fdb = new FMDBDatabaseAccess(context);\n//\t\tsm = fdb.getSnagsXYvalue(this.getTag().toString());\n//\t\t//sm[0].setXValue(0.4);\n\t\t//sm[0].setYValue(0.5);\n\t\t if(sm==null)\n\t\t {\n\t\t\t sm=getSnag();\n\t\t }\n\t\tif(isFirst)\n\t\t{\n\t\t\tisFirst=false;\n\t\t\ttry{\n\t\t\tfor(int i=0;i<sm.length;i++)\n\t\t\t{\n\t\t\t paint.setStrokeWidth(30);\n\t\t\t //String str=\"\"+(sm[i].getXValue()*screenwidth);\n\t\t\t x = sm[i].getXValue()*screenwidth;\n\t\t\t //str=\"\"+(sm[i].getYValue()*screenheight);\n\t\t\t y = sm[i].getYValue()*screenheight;\n\t\t\t paint.setColor(Color.RED);\n\t\t\t if(x!=0.0f && y!=0.0f)\n\t\t\t {\n\t\t\t\t // canvas.drawRect(x+7.5f, y+7.5f, x-7.5f, y-7.5f,paint);\n\t\t\t\t // canvas.drawRect(x+7.5f, y+7.5f, x-7.5f, y-7.5f,paint);\n\t\t\t\t SnagImageMapping objmap=(SnagImageMapping) context;\n//\t\t\t\t \n\t\t\t\t mapLayout =(RelativeLayout)(objmap).findViewById(R.id.plot_image_layout);\n\t\t\t\t ImageView mapImage = new ImageView(context);\n//\t\t\t\t \n\t\t\t float value;\n\t\t\t\t if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)\n\t\t\t\t {\n\t\t\t\t\t value=screenheight*0.078125f;\n\t\t\t }\n\t\t\t\t else\n \t\t\t {\n\t\t\t\t\t value=screenheight*0.052083332f;\n \t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t float imght=value;\n\t\t\t\t float imgwdth=imght;\n\t\t\t\t RelativeLayout.LayoutParams par=new RelativeLayout.LayoutParams((int)imgwdth,(int)imght);\n\t\t\t\t par.leftMargin=(int)(x-(value/2));\n\t\t\t\t par.topMargin=(int)(y-(value/2));\n\t\t\t\t if(sm[i].getSnagStatus().equalsIgnoreCase(\"pending\"))\n\t\t\t\t {\n\t\t\t\t\t mapImage.setBackgroundResource(R.drawable.plot_yellow);\n\t\t\t\t }\n\t\t\t\t else if(sm[i].getSnagStatus().equalsIgnoreCase(\"reinspected & unresolved\"))\n\t\t\t\t {\n\t\t\t\t\t mapImage.setBackgroundResource(R.drawable.plot_red);\n\t\t\t\t }\n\t\t\t\t else if(sm[i].getSnagStatus().equalsIgnoreCase(\"resolved\"))\n\t\t\t\t {\n\t\t\t\t\t mapImage.setBackgroundResource(R.drawable.plot_green);\n\t\t\t\t }\n\t\t\t\t// R.drawable.pl\n\t\t\t\t mapImage.setId(i);\n\t\t\t\t // mapImage.setTag();\n\t\t\t\t mapImage.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\n\t\t\t\t\t\tint id=v.getId();\n\t\t\t\t\t\tfloat setX,setY;\n\t\t\t\t\t\t String str2=\"\"+(sm[id].getXValue()*screenwidth);\n\t\t\t\t\t\t setX = Float.parseFloat(str2);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t str2=\"\"+(sm[id].getYValue()*screenheight);\n\t\t\t\t\t\t setY = Float.parseFloat(str2);\n\t\t\t\t\t\t//Toast.makeText(getContext(), \"By image click\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t//Log.d(\"x y\",\"\"+setX+\" \"+setY);\n\t\t\t\t\t\t//Button img=new Button(context);\n\t\t\t\t\t\t//img.setBackgroundResource(R.drawable.back_blue_button);\n\t\t\t\t\t\t//img.setText(\"from\"+\"\"+sm[id].getID());\n//\t\t\t\t\t\t RelativeLayout.LayoutParams par2=new RelativeLayout.LayoutParams(android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);\n//\t\t\t\t\t\t par2.leftMargin=(int)(setX);\n//\t\t\t\t\t\t par2.topMargin=(int)(setY);\n//\t\t\t\t\t\t popMsg.setLayoutParams(par2);\n//\t\t\t\t\t\t popMsg.setText(\"from\"+\"\"+sm[id].getID());\n//\t\t\t\t\t\t //popMsg.setText(\"from sfsf dfdfsfd dfdsf df dfdfdf d fdfedfd dfdfdf dfdf df dfdfd \");\n//\t\t\t\t\t\t popMsg.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t//RelativeLayout.LayoutParams par2=v.(RelativeLayout.LayoutParams)getTag();\n\t\t\t\t\t\t // img.setLayoutParams(par2);\n\t\t\t\t\t\t // mapLayout.addView(img);\n\t\t\t\t\t\t String text=\"Project - \"+sm[id].getProjectName()+\"\\n\"+\"Building - \"+sm[id].getBuildingName()+\"\\n\"+\"Floor - \"+sm[id].getFloor()+\"\\n\"+\"Apartment - \"+sm[id].getApartment()+\"\\n\"+\"Area - \"+sm[id].getAptAreaName()+\"\\n\"+\"SnagType - \"+sm[id].getSnagType()+\"\\n\"+\"FaultType - \"+sm[id].getFaultType()+\"\\n\"+\"Status - \"+sm[id].getSnagStatus()+\"\\n\"+\"ReportDate - \"+sm[id].getReportDate()+\"\\n\"+\"SnagDetails - \"+sm[id].getSnagDetails()+\"\\n\"+\"PriorityLevel - \"+sm[id].getSnagPriority()+\"\\n\"+\"Cost - \"+sm[id].getCost()+\"\\n\"+\"CostTO - \"+sm[id].getCostTo()+\"\\n\"+\"AllocatedToName - \"+sm[id].getAllocatedToName()+\"\\n\"+\"InspectorName - \"+sm[id].getInspectorName()+\"\\n\"+\"ContractorName - \"+sm[id].getContractorName()+\"\\n\"+\"SubContractorName - \"+sm[id].getSubContractorName()+\"\\n\"+\"ContractorStatus - \"+sm[id].getContractorStatus();\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n//\t\t\t\t\t\t \n\t\t\t\t\t\t final int loc=id;\n\t\t\t\t\t\t new AlertDialog.Builder(context)\n\t\t\t\t \t .setTitle(\"Snag Detail\")\n\t\t\t\t \t .setMessage(\"\"+text)\n\t\t\t\t \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t \t public void onClick(DialogInterface dialog, int which) { \n\t\t\t\t \t \t//Toast.makeText(context,\"\"+0.052083332*screenwidth+\" \"+0.078125*screenheight,Toast.LENGTH_LONG).show();\n\t\t\t\t \t // continue with delete\n\t\t\t\t \t }\n\t\t\t\t \t })\n\t\t\t\t \t .show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t \n\t\t\t\t mapImage.setLayoutParams(par);\n\t\t\t\t mapLayout.addView(mapImage);\n\t\t\t\t \n\t\t\t }\n\t\t\t if(touched)\n\t\t\t {\n\t\t\t// if((currentX>=(x-7.5f) && currentX<=(x+7.5f)) && ((currentY<=(y+7.5f)) && currentY>=( y-7.5f)))\n\t\t\t // {\n\t\t\t\t if((currentX>=(x-7.5f) && currentX<=(x+7.5f)) && ((currentY<=(y+7.5f)) && currentY>=( y-7.5f)))\n\t\t\t\t {\n\t\t\t\t\t \n\t\t\t\t\t // Toast.makeText(getContext(), \"Click\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t// Log.d(\"in the touch\",\"\");\n //\t\t\t String strID=sm[i].getID();\n //\t\t\t \t\tSnagImageMapping objmap=(SnagImageMapping) context;\n////\t\t\t\t \n//\t\t\t\t RelativeLayout mapLayout =(RelativeLayout)(objmap).findViewById(R.id.plot_image_layout);\n//\t\t\t\t ImageView mapImage = new ImageView(context);\n////\t\t\t\t \n//\t\t\t\t RelativeLayout.LayoutParams par=new RelativeLayout.LayoutParams(300,300);\n//\t\t\t\t mapImage.setBackgroundResource(R.drawable.plot_pink_gray);\n//\t\t\t\t par.setMargins((int)(x+7.5f), (int)(y+7.5f), (int)(x-7.5f), (int)(y-7.5f));\n//\t\t\t\t mapImage.setLayoutParams(par);\n//\t\t\t\t mapLayout.addView(mapImage);\n//\t\t\t\t Toast.makeText(getContext(), \"Green\",Toast.LENGTH_SHORT).show();\n\t\t\t\t \n\t\t\t }\n\t\t\t touched=false;\n\t\t\t }\n\t\t\t \n\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t}\t\n\t }\n\t\t\n\t}", "public void draw(){\n\t\tcomponent.draw();\r\n\t}", "void btnLoadMap();", "public DrawGUI() {\n\n\t\tthis.setTitle(\"Draw 0.2\");\n\t\tsetIconImage(Toolkit.getDefaultToolkit().getImage(\"img/logo.png\"));\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdrawingContainer = new DrawingContainer();\n\t\tscrollpane = new JScrollPane(drawingContainer);\n\n\t\tcontroller = new DrawingController(this);\n\t\ttools = new ToolBox(controller);\n\t\tcontroller.newDrawing(new Dimension(500, 380));\n\n\t\t// statusBar = new StatusBar();\n\n\t\tgetContentPane().add(tools, BorderLayout.WEST);\n\t\tgetContentPane().add(scrollpane, BorderLayout.CENTER);\n\t\t// getContentPane().add(statusBar, BorderLayout.SOUTH);\n\n\t\tMenuListener mainMenuListener = new MenuListener(controller);\n\t\tJMenuBar mainMenu = new MainMenu(mainMenuListener);\n\t\tthis.setJMenuBar(mainMenu);\n\n\t\tpack();\n\t\tsetVisible(true);\n\n\t}", "public void updateMapGrid() {\n char[][] map = controller.getPopulatedMap();\n\t if (mapGrid == null) {\n mapGrid = new MapGrid(map.length, map[0].length, ICON_SIZE);\n }\n mapGrid.insertCharMap(map);\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(map.getImage(), mapX, mapY, mapWidth, mapHeight, null);\n //draw hexagon\n for (int j = 0; j < BOARD_HEIGHT; j++) {\n for (int i = 0; i < BOARD_WIDTH; i++) {\n gridCell.setCellIndex(i, j);\n if (mapCells[j][i] != 0) {\n gridCell.computeCorners(mCornersX, mCornersY);\n// g.setColor((mapCells[j][i] == L_ON) ? Color.ORANGE : Color.GRAY);\n// g.fillPolygon(mCornersX, mCornersY, NUM_HEX_CORNERS);\n g.drawPolygon(mCornersX, mCornersY, NUM_HEX_CORNERS);\n }\n }\n }\n }", "public MapPanel(int size, int style)\r\n {\r\n this.setLayout(new BorderLayout());\r\n zoom = 32;//set initail zoom to 32;\r\n\t\t\t\tyear = -4000;\r\n\r\n //set up initial key movements\r\n keyUp = KeyEvent.VK_W;\r\n keyLeft = KeyEvent.VK_A;\r\n keyRight = KeyEvent.VK_D;\r\n keyDown = KeyEvent.VK_S;\r\n keyZoom = KeyEvent.VK_Z;\r\n\r\n if(size == 100 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 100, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 100, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 75, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 75, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 50, 2, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 50, 2, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n if(size == 100 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 7, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 7, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n if(size == 100 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 120, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 120, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 100, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 100, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 75, 0, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 75, 0, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n //set up the cursor\r\n cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);\r\n\r\n //set up the buttons\r\n leftButton = new JButton();\r\n leftButton.setFocusable(false);\r\n leftButton.setBorder(null);\r\n leftButton.setContentAreaFilled(false);\r\n leftButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/left.gif\");\r\n leftButton.setIcon(iconDefault);\r\n\r\n rightButton = new JButton();\r\n rightButton.setFocusable(false);\r\n rightButton.setBorder(null);\r\n rightButton.setContentAreaFilled(false);\r\n rightButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/right.gif\");\r\n rightButton.setIcon(iconDefault);\r\n\r\n upButton = new JButton();\r\n upButton.setFocusable(false);\r\n upButton.setBorder(null);\r\n upButton.setContentAreaFilled(false);\r\n upButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/up.gif\");\r\n upButton.setIcon(iconDefault);\r\n\r\n downButton = new JButton();\r\n downButton.setFocusable(false);\r\n downButton.setBorder(null);\r\n downButton.setContentAreaFilled(false);\r\n downButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/down.gif\");\r\n downButton.setIcon(iconDefault);\r\n\r\n leftButton.addActionListener(this);\r\n rightButton.addActionListener(this);\r\n upButton.addActionListener(this);\r\n downButton.addActionListener(this);\r\n\r\n //set up the panels\r\n worldPanel = new WorldPanel();\r\n this.add(worldPanel, BorderLayout.CENTER);\r\n\r\n southPanel = new JPanel(new FlowLayout());\r\n southPanel.setBackground(Color.black);\r\n southPanel.add(leftButton);\r\n\t\t\t\tsouthPanel.add(upButton);\r\n southPanel.add(downButton);\r\n southPanel.add(rightButton);\r\n this.add(southPanel, BorderLayout.SOUTH);\r\n\r\n miniMap = new MiniMap();\r\n unitPanel = new UnitInfoPanel();\r\n\r\n eastPanel1 = new JPanel(new BorderLayout());\r\n eastPanel1.setBackground(Color.black);\r\n eastPanel1.add(miniMap ,BorderLayout.SOUTH);\r\n eastPanel1.add(unitPanel, BorderLayout.CENTER);\r\n this.add(eastPanel1, BorderLayout.EAST);\r\n\r\n //create initial map\r\n worldPanel.setInitialMap(mapPieces, mapWidth, mapHeight);\r\n miniMap.setMap(mapPieces, mapWidth, mapHeight, 12, 12);\r\n int x = worldPanel.getFirstX();\r\n int y = worldPanel.getFirstY();\r\n miniMap.setNewXY(x,y,21,15);\r\n addKeyListener(this);\r\n this.setBackground(Color.black);\r\n this.requestFocus();\r\n }", "protected void drawMap(Canvas canvas) {\n\t\tcanvas.save();\n\t\t\n\t\tif (mImage != null) {\n\t\t\tif (!mImage.isRecycled()) {\n\t\t\t\tcanvas.drawBitmap(mImage, mScrollLeft, mScrollTop, null);\n\t\t\t}\n\t\t}\n\t\tcanvas.restore();\n\t}", "public void draw() {\n\t\tsuper.repaint();\n\t}", "public synchronized void draw(Graphics2D g) {\n\t\t\n\t\tfor(Car car : world.carList){\n\t\t\tcar.pointMap.draw(g);\n\t\t}\n\t\t\n\t\tworld.map.draw(g);\n\t\t\n\t}", "void display(Map m) {\r\n\t\tm.tour = this;\r\n\t\tm.update(m.getGraphics());\r\n\t}", "public static void drawMapCities(ArrayList<City> cities) {\n\t\t// Use a label to display the image\n\t\tJFrame frame = new JFrame();\n\t\tframe.setSize(1080, 540);\n\t\tMap map = new Map((ArrayList<City>)(cities), null, null, 1, 0, 0);\n\t\tframe.add(map);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\n\t\t//Frame operations\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 1030, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.X_AXIS));\n\t\tframe.setTitle(\"Get There\");\n\t\tframe.setResizable(false);\n\t\tframe.setVisible(true);\n\n\t\t//Panel Operations\n\t\tuiPanel = new JPanel();\n\t\tframe.getContentPane().add(uiPanel);\n\t\tuiPanel.setLayout(null);\n\n\t\tmapPanel = new JPanel();\n\t\tmapPanel.setBounds(5, 5, 750, 620);\n\t\tuiPanel.add(mapPanel);\n\t\tmapPanel.add(new MyGraphics());\n\n\t\t//Creating Labels\n\t\tstartPoint = new JLabel(\"FROM\");\n\t\tstartPoint.setBounds(780, 6, 132, 29);\n\n\t\tbuildingStart = new JLabel(\"Select Building:\");\n\t\tbuildingStart.setBounds(762, 26, 132, 29);\n\n\t\troomStart = new JLabel(\"Select Room:\");\n\t\troomStart.setBounds(900, 26, 132, 29);\n\n\t\tendPoint = new JLabel(\"TO\");\n\t\tendPoint.setBounds(780, 72, 132, 29);\n\n\t\tbuildingEnd = new JLabel(\"Select Building:\");\n\t\tbuildingEnd.setBounds(762, 92, 132, 29);\n\n\t\troomEnd = new JLabel(\"Select Room:\");\n\t\troomEnd.setBounds(900, 92, 132, 29);\n\n\n\t\t//Add Labels to the uiPanel\n\t\tuiPanel.add(startPoint);\n\t\tuiPanel.add(buildingStart);\n\t\tuiPanel.add(roomStart);\n\t\tuiPanel.add(endPoint);\n\t\tuiPanel.add(buildingEnd);\n\t\tuiPanel.add(roomEnd);\n\n\t\tstartRoomSEL.setModel(new DefaultComboBoxModel(new String[]{}));\n\t\tstartRoomSEL.setBounds(893, 50, 132, 29);\n\t\tstartRoomSEL.setEditable(false);\n\t\tstartRoomSEL.setVisible(true);\n\t\tstartRoomSEL.setName(\"Start\");\n\t\t\n\t\tmapNumber = new JTextPane();\n\t\tmapNumber.setBounds(360, 634, 47, 20);\n\t\tmapNumber.setEditable(false);\n\t\tmapNumber.setFont(new Font(\"Helvetica Neue\", Font.BOLD, 14));\n\t\tmapNumber.setAlignmentX(StyleConstants.ALIGN_CENTER);\n\t\tmapNumber.setAlignmentY(StyleConstants.ALIGN_CENTER);\n\t\tuiPanel.add(mapNumber);\n\n\t\t//Construct Combo boxes to select start point\n\t\tstartBuildingSEL = new JComboBox<String>();\n\t\tstartBuildingSEL.setBounds(755, 50, 132, 29);\n\t\tstartBuildingSEL.setEditable(false);\n\t\tstartBuildingSEL.setVisible(true);\n\t\tstartBuildingSEL.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdatePath = false;\n\t\t\t\tmapNumber.setText(\"\");\n\t\t\t\tstartRoomSELLaunched = false;\n\t\t\t\tendRoomSELLaunched = false;\n\t\t\t\trepaint();\n\t\t\t\trevalidate();\n\t\t\t\tint indexOfCurrentMap;\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tJComboBox<String> cb = (JComboBox<String>)e.getSource();\n\t\t\t\tbuildingSelectedSTART = (String)cb.getSelectedItem();\n\t\t\t\tfor(indexOfCurrentMap = 0; indexOfCurrentMap < maps.size(); ++indexOfCurrentMap){\n\t\t\t\t\tif(buildingSelectedSTART.equals(maps.get(indexOfCurrentMap).getMapName()))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurrentStartNodes = maps.get(indexOfCurrentMap).getNodes();\n startRooms = new String[currentStartNodes.size()];\n\t\t\t\tcurrentStartEdges = maps.get(indexOfCurrentMap).getEdges();\n\t\t\t\tcurrentMapFile = maps.get(indexOfCurrentMap).getImage();\n\t\t\t\tcurrentlyShownMap = maps.get(indexOfCurrentMap);\n\t\t\t\tarrowCounter = 0;\n\t\t\t\tmapsForPaths = null;\n\t\t\t\tstartRoomSEL.removeAllItems();\n\t\t\t\tfor(int i = 0; i < currentStartNodes.size(); ++i){\n\t\t\t\t\tstartRooms[i] = currentStartNodes.get(i).getName();\n\t\t\t\t\tif(startRooms[i] != \"\" && currentStartNodes.get(i).getType() != NodeType.NOTYPE)\n\t\t\t\t\t\tstartRoomSEL.addItem(startRooms[i]);\n\t\t\t\t}\n\t\t\t\tstartHoverFlag = false;\n\t\t\t\tuiPanel.repaint();\n\t\t\t\tframe.repaint();\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = 0; i < maps.size(); i++) {\n\t\t\tif(maps.get(i).getMapName() != null)\n\t\t\t\tstartBuildingSEL.addItem(maps.get(i).getMapName());\n\t\t}\n\n\t\tendRoomSEL.setModel(new DefaultComboBoxModel(new String[]{}));\n\t\tendRoomSEL.setBounds(893, 116, 132, 29);\n\t\tendRoomSEL.setEditable(false);\n\t\tendRoomSEL.setVisible(true);\n\t\tendRoomSEL.setName(\"End\");\n\n\t\t//Construct Combo boxes to select end point\n\t\tendBuildingSEL = new JComboBox<String>();\n\t\tendBuildingSEL.setBounds(755, 116, 132, 29);\n\t\tendBuildingSEL.setEditable(false);\n\t\tendBuildingSEL.setVisible(true);\n\t\tendBuildingSEL.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdatePath = false;\n\t\t\t\tint indexOfCurrentMap;\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tJComboBox<String> cb = (JComboBox<String>)e.getSource();\n\t\t\t\tbuildingSelectedEND = (String)cb.getSelectedItem();\n\t\t\t\tfor(indexOfCurrentMap = 0; indexOfCurrentMap < maps.size(); ++indexOfCurrentMap){\n\t\t\t\t\tif(buildingSelectedEND.equals(maps.get(indexOfCurrentMap).getMapName()))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurrentEndNodes = maps.get(indexOfCurrentMap).getNodes();\n currentMapFile = maps.get(indexOfCurrentMap).getImage();\n\t\t\t\tcurrentlyShownMap = maps.get(indexOfCurrentMap);\n\t\t\t\tendRoomSEL.removeAllItems();\n\t\t\t\tarrowCounter = 0;\n\t\t\t\tmapsForPaths = null;\n\t\t\t\tfor(int i = 0; i < currentEndNodes.size(); ++i){\n\t\t\t\t\tendRooms[i] = currentEndNodes.get(i).getName();\n\t\t\t\t\tif(endRooms[i] != \"\" && currentEndNodes.get(i).getType() != NodeType.NOTYPE)\n\t\t\t\t\t\tendRoomSEL.addItem(endRooms[i]);\n\t\t\t\t}\n\t\t\t\tendHoverFlag = false;\n\t\t\t\tuiPanel.repaint();\n\t\t\t\tframe.repaint();\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = 0; i < maps.size(); i++) {\n\t\t\tif(maps.get(i).getMapName() != null)\n\t\t\t\tendBuildingSEL.addItem(maps.get(i).getMapName());\n\t\t}\n\n\n\n\t\t//Add Combo Boxes to UIPanel\n\n\t\tuiPanel.add(startBuildingSEL);\n\t\tuiPanel.add(startRoomSEL);\n\t\tuiPanel.add(endBuildingSEL);\n\t\tuiPanel.add(endRoomSEL);\n\n\t\t//Construct button and add button to uiPanel\n\t\tsearchButton = new JButton (\"Search\");\n\t\tsearchButton.setBounds(891, 150, 132, 30);\n\t\tuiPanel.add(searchButton);\n\n\t\tclearButton = new JButton (\"Clear\");\n clearButton.setBounds(753, 150, 132, 30);\n uiPanel.add(clearButton);\n clearButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e)\n {\n updatePath = false;\n startClicked = false;\n endClicked = false;\n endNode = null;\n directions.setText(\"\");\n mapsForPaths = null;\n mapNumber.setText(\"\");\n }\n });\n\t\t\n\t\tleftArrow = new JButton(\"<<\");\n\t\tleftArrow.setBounds(275, 630, 80, 29);\n\t\tuiPanel.add(leftArrow);\n\t\tif(arrowCounter == 0){\n\t\t\tleftArrow.setEnabled(false);\n\t\t}\n\n\n\n\t\trightArrow = new JButton(\">>\");\n\t\trightArrow.setBounds(412, 630, 80, 29);\n\t\tuiPanel.add(rightArrow);\n\t\trightArrow.setEnabled(false);\n\n\t\tJLabel instructions = new JLabel(\"How to get there?\");\n\t\tinstructions.setBounds(820, 180, 132, 29);\n\t\tuiPanel.add(instructions);\n\n\t\tdirections = new JTextArea();\n\t\tdirections.setBounds(762, 210, 255, 420);\n\t\tdirections.setFont(new Font(\"Helvetica Neue\", Font.PLAIN, 13));\n\t\tdirections.setLineWrap(true);\n\t\tdirections.setEditable(false);\n\t\tJScrollPane scrollDire = new JScrollPane(directions);\n\t\tscrollDire.setBounds(762, 210, 255, 420);\n\t\tscrollDire.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tuiPanel.add(scrollDire);\n\n\t\temergencyIcon = new ImageIcon(\"IconImages/emergencyIcon.png\");\n\t\tIcon emergencyIconBIG = new ImageIcon(\"IconImages/emergencyIconBIG.png\");\n\t\temergency = new JButton();\n\t\temergency.setToolTipText(\"Emergency Information\");\n\t\temergency.setIcon(emergencyIcon);\n\t\temergency.setBounds(790, 632, 40, 40);\n\t\tuiPanel.add(emergency);\n\t\tString emergencyInfo = \"Call Campus Police:\" + \"\\n\" + \"508-831-5555\";\n\t\temergency.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tJOptionPane.showMessageDialog(null, emergencyInfo, \"Incase of emergency\", JOptionPane.PLAIN_MESSAGE, emergencyIconBIG);\n\t\t\t}\n\t\t});\n\n\t\temailIcon = new ImageIcon(\"IconImages/emailIcon.png\");\n\t\temail = new JButton();\n\t\temail.setToolTipText(\"Send Directions via Email\");\n\t\temail.setIcon(emailIcon);\n\t\temail.setBounds(840, 632, 40, 40);\n\t\tuiPanel.add(email);\n\t\temail.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif(emailDirections != null) {\n\t\t\t\t\tEMailDialogue em = new EMailDialogue(frame, emailDirections);\n\t\t\t\t\tem.setVisible(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransportIcon = new ImageIcon(\"IconImages/transportIcon.png\");\n\t\tIcon transportIconBIG = new ImageIcon(\"IconImages/transportIconBIG.png\");\n\t\tIcon gatewaySchedule = new ImageIcon(\"IconImages/gatewaySchedule.png\");\n\t\tIcon eveningSchedule = new ImageIcon(\"IconImages/eveningSchedule.png\");\n\t\tIcon wpiumassSchedule = new ImageIcon(\"IconImages/wpi-umassSchedule.png\");\n\t\tIcon snapSchedule = new ImageIcon(\"IconImages/snapSchedule.png\");\n\t\ttransport = new JButton();\n\t\ttransport.setToolTipText(\"View Transport Schedule\");\n\t\ttransport.setIcon(transportIcon);\n\t\ttransport.setBounds(890, 632, 40, 40);\n\t\tuiPanel.add(transport);\n\t\ttransport.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tString[] schedules = {\"Gateway Shuttle\", \"Evening Shuttle\", \"WPI-Umass Shuttle\", \"SNAP\"};\n\t\t\t\tObject selectedValue = JOptionPane.showInputDialog(null, \"Which transport would you like to use?\", \"Select Transport type\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE, transportIconBIG,schedules, schedules[0]);\n\t\t\t\tif(selectedValue != null){\n\t\t\t\t\tswitch((String) selectedValue){\n\t\t\t\t\tcase \"Gateway Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"Gateway Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, gatewaySchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Evening Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"Evening Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, eveningSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WPI-Umass Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"WPI-Umass Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, wpiumassSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"SNAP\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"SNAP Shuttle\", JOptionPane.INFORMATION_MESSAGE, snapSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\thistoryIcon = new ImageIcon(\"IconImages/historyIcon.png\");\n\t\tImageIcon historyIconBIG = new ImageIcon(\"IconImages/historyIconBIG.png\");\n\t\thistory = new JButton();\n\t\thistory.setToolTipText(\"...Coming Soon\");\n\t\thistory.setIcon(historyIcon);\n\t\thistory.setBounds(940, 632, 40, 40);\n\t\tuiPanel.add(history);\n\t\thistory.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"....Coming Soon\", \"...Coming Soon\", JOptionPane.PLAIN_MESSAGE, historyIconBIG);\n\t\t\t}\n\t\t});\n\n\t\t//Construct buttons and add action listener\n\t\tsearchButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tint i;\n\t\t\t\tupdatePath = true;\n\t\t\t\tuiPanel.setVisible(true);\n\t\t\t\tframe.setVisible(true);\n\t\t\t\tpathCalc = new Djikstra();\n\t\t\t\tif(!startClicked && !endClicked){\n\t\t\t\t\tfor (i = 0; i < currentStartNodes.size(); i++){\n\t\t\t\t\t\tif(startRoomSEL.getSelectedItem() == currentStartNodes.get(i).getName())\n\t\t\t\t\t\t\tstartNode = currentStartNodes.get(i);\n\t\t\t\t\t}\n\t\t\t\t\tfor(i = 0; i < currentEndNodes.size(); i++){\n\t\t\t\t\t\tif(endRoomSEL.getSelectedItem() == currentEndNodes.get(i).getName())\n\t\t\t\t\t\t\tendNode = currentEndNodes.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(startClicked && !endClicked){\n\t\t\t\t\tdirections.setText(\"Please Select End point\");\n\t\t\t\t\tupdatePath = false;\n\t\t\t\t}\n\t\t\t\tif(updatePath && startNode != null && endNode != null){\n\t\t\t\t\tSystem.out.println(startBuildingSEL.getSelectedItem());\n\t\t\t\t\tSystem.out.println(floor);\n\t\t\t\t\tlistPath = pathCalc.navigate(startNode, endNode);\n\t\t\t\t\tmapsForPaths = new LinkedList<Map>();\n\t\t\t\t\tSystem.out.println(listPath.size());\n\t\t\t\t\tfor (i = 0; i < listPath.size(); i++){\n\t\t\t\t\t\tfor (int j = 0; j < maps.size(); j++){\n\t\t\t\t\t\t\tnodesInMap = maps.get(j).getNodes();\n\t\t\t\t\t\t\tfor(int k = 0; k<nodesInMap.size(); k++){\n\t\t\t\t\t\t\t\tif(listPath.get(i) == nodesInMap.get(k)){\n\t\t\t\t\t\t\t\t\tif(!mapsForPaths.contains(maps.get(j))){\n\t\t\t\t\t\t\t\t\t\tmapsForPaths.add(maps.get(j));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentMapFile = mapsForPaths.getFirst().getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.getFirst();\n\t\t\t\t\t\ttotalMaps = mapsForPaths.size();\n\n\t\t\t\t\t\tif(mapsForPaths.size() > 1){\n\t\t\t\t\t\t\trightArrow.setEnabled(true);\n\t\t\t\t\t\t\tmapNumber.setText(String.valueOf(1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\temailDirections = \"From: \" + startBuildingSEL.getSelectedItem() + \", \" + startRoomSEL.getSelectedItem() + \"\\n\" + \"to \"\n + endBuildingSEL.getSelectedItem() + \", \" + endRoomSEL.getSelectedItem() + \"\\n\" + \"\\n\" +\n pathCalc.gpsInstructions(pathCalc.navigate(startNode, endNode));\n\t\t\t\t\tdirections.setText(emailDirections);\n\t\t\t\t\tSystem.out.println(\"check List: \" + listPath.size());\n\t\t\t\t\trepaint();\n\t\t\t\t\trevalidate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tleftArrow.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tif(mapsForPaths!= null){\n\t\t\t\t\tif(arrowCounter != 0){\n\t\t\t\t\t\trightArrow.setEnabled(true);\n\t\t\t\t\t\tarrowCounter -= 1;\n\t\t\t\t\t\tmapNumber.setText(String.valueOf(arrowCounter + 1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\tcurrentMapFile = mapsForPaths.get(arrowCounter).getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.get(arrowCounter);\n\t\t\t\t\t}else if (arrowCounter == 0){\n\t\t\t\t\t\tleftArrow.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\trightArrow.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tif(mapsForPaths != null){\n\t\t\t\t\tif(arrowCounter != totalMaps-1){\n\t\t\t\t\t\tleftArrow.setEnabled(true);\n\t\t\t\t\t\tarrowCounter += 1;\n\t\t\t\t\t\tmapNumber.setText(String.valueOf(arrowCounter + 1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\tcurrentMapFile = mapsForPaths.get(arrowCounter).getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.get(arrowCounter);\n\t\t\t\t\t}else if (arrowCounter == totalMaps-1){\n\t\t\t\t\t\trightArrow.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuiPanel.setVisible(true);\n\t\tframe.setVisible(true);\n\t}", "private void drawMap(HashMap<String, TrailObj> trailCollection,\n\t\t\tGoogleMap mMap2) {\n\n\t\tfor (TrailObj trail : trailCollection.values()) {\n\t\t\tfor (PlacemarkObj p : trail.getPlacemarks()) {\n\t\t\t\tPolylineOptions rectOptions = new PolylineOptions();\n\t\t\t\tfor (LatLng g : p.getCoordinates()) {\n\t\t\t\t\trectOptions.add(g);\n\t\t\t\t}\n\t\t\t\tPolyline polyline = mMap2.addPolyline(rectOptions);\n\t\t\t\tpolyline.setColor(Color.RED);\n\t\t\t\tpolyline.setWidth(5);\n\t\t\t\tpolyline.setVisible(true);\n\t\t\t}\n\t\t}\n\t}", "public void draw(){\n\t\tif(!visible) return;\n\n\t\twinApp.pushStyle();\n\t\twinApp.style(G4P.g4pStyle);\n\t\tPoint pos = new Point(0,0);\n\t\tcalcAbsPosition(pos);\n\n\t\t// Draw selected option area\n\t\tif(border == 0)\n\t\t\twinApp.noStroke();\n\t\telse {\n\t\t\twinApp.strokeWeight(border);\n\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t}\n\t\tif(opaque)\n\t\t\twinApp.fill(localColor.txfBack);\n\t\telse\n\t\t\twinApp.noFill();\n\t\twinApp.rect(pos.x, pos.y, width, height);\n\t\t\n\t\t// Draw selected text\n\t\twinApp.noStroke();\n\t\twinApp.fill(localColor.txfFont);\n\t\twinApp.textFont(localFont, localFont.getSize());\n\t\twinApp.text(text, pos.x + PADH, pos.y -PADV +(height - localFont.getSize())/2, width - 16, height);\n\n\t\t// draw drop down list\n\t\twinApp.fill(winApp.color(255,255));\n\t\tif(imgArrow != null)\n\t\t\twinApp.image(imgArrow, pos.x + width - imgArrow.width - 1, pos.y + (height - imgArrow.height)/2);\n\t\tif(expanded == true){\n\t\t\tGOption opt;\n\t\t\twinApp.noStroke();\n\t\t\twinApp.fill(localColor.txfBack);\n\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\n\t\t\tfor(int i = 0; i < optGroup.size(); i++){\n\t\t\t\topt = optGroup.get(i);\n\t\t\t\tif(i >= startRow && i < startRow + nbrRowsToShow){\n\t\t\t\t\topt.visible = true;\n\t\t\t\t\topt.y = height * (i - startRow + 1);\n\t\t\t\t\topt.draw();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\topt.visible = false;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Draw box round list\n\t\t\tif(border != 0){\n\t\t\t\twinApp.strokeWeight(border);\n\t\t\t\twinApp.stroke(localColor.txfBorder);\n\t\t\t\twinApp.noFill();\n\t\t\t\twinApp.rect(pos.x,pos.y+height,width,nbrRowsToShow*height);\n\t\t\t}\n\t\t\tif(optGroup.size() > maxRows){\n\t\t\t\tslider.setVisible(true);\n\t\t\t\tslider.draw();\n\t\t\t}\n\t\t}\n\t\twinApp.popStyle();\n\t}", "@Override\n\tpublic void show () {\n overWorld = new Sprite(new TextureRegion(new Texture(Gdx.files.internal(\"Screens/overworldscreen.png\"))));\n overWorld.setPosition(0, 0);\n batch = new SpriteBatch();\n batch.getProjectionMatrix().setToOrtho2D(0, 0, 320, 340);\n\n // Creates the indicator and sets it to the position of the first grid item.\n indicator = new MapIndicator(screen.miscAtlases.get(2));\n // Creates the icon of Daur that indicates his position.\n icon = new DaurIcon(screen.miscAtlases.get(2));\n // Sets the mask position to zero, as this screen does not lie on the coordinate plane of any tiled map.\n screen.mask.setPosition(0, 0);\n screen.mask.setSize(320, 340);\n Gdx.input.setInputProcessor(inputProcessor);\n\n // Creates all relevant text.\n createText();\n // Sets numX and numY to the position of Daur on the map.\n numX = storage.cellX;\n numY = storage.cellY;\n indicator.setPosition(numX * 20, numY * 20 + 19);\n // Sets the icon to the center of this cell.\n icon.setPosition(numX * 20 + 10 - icon.getWidth() / 2, numY * 20 + 29 - icon.getHeight() / 2);\n // Creates all the gray squares necessary.\n createGraySquares();\n }", "protected void drawGUI() {\n batch.draw(background, 0, 0);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n getLocationInfo();\n setUpMap(mMap);\n //drawPath(googleMap, pathString);\n }", "public MAPVIEW() {\n initComponents();\n }", "@Override\r\n\t\tprotected void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponents(g);\r\n\t\t\t\t//drawing image\r\n\t\t\t\tg.drawImage(image, 0, 0, null);\r\n\t\t\t\t\r\n\t\t\t\tQuery q = getQuery();\r\n\t\t\t\tif(q == null || q.getSelectedQuery() == null)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\tif(q.getSelectedQuery().trim().equalsIgnoreCase(\"Whole Region\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(getQuery().isSubmitFlag())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tStringBuffer sqlText = new StringBuffer();\r\n\t\t\t\t\t\t\t\tConnection con=hw2.getDBConnection();\r\n\t\t\t\t\t\t\t\tStatement st=con.createStatement();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(getQuery().isBuildingFlag())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tString sqlAll=\"select shape from buildings1\";\r\n\t\t\t\t\t\t\t\t\tResultSet rs=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.BUILDINGS,rs,Color.YELLOW);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(getQuery().isAsFlag())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tString sqlAll=\"select loc,rad from announcementsystems\";\r\n\t\t\t\t\t\t\t\t\tResultSet rs=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs,Color.RED);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(getQuery().isStudentFlag())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tString sqlAll=\"select cord from test1\";\r\n\t\t\t\t\t\t\t\t\tResultSet rs=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs,Color.GREEN);\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\tcatch(Exception e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//whole region ends\r\n\t\t\t\t\r\n\t\t\t\tif(q.getSelectedQuery().trim().equalsIgnoreCase(\"Point Query\")){\r\n\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\tg.drawRect(pqX, pqY, 5, 5);\r\n\t\t\t\t\tg.drawOval(pqX-50, pqY-50, 50*2, 50*2);\r\n\t\t\t\t\tif(getQuery().isSubmitFlag())\r\n\t\t\t\t\t{\r\n\t\t\t\t\tStringBuffer sqlText = new StringBuffer();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tConnection con=hw2.getDBConnection();\r\n\t\t\t\t\t\tStatement st=con.createStatement();\r\n\t\t\t\t\t\tif(getQuery().isBuildingFlag()){\r\n\t\t\t\t\t\t\tString sqlAll=\"select a.shape from buildings1 a where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null\" +\r\n\t\t\t\t\t\t\t\t\t\",null,sdo_elem_info_array(1,1003,4),sdo_ordinate_array(\"+(pqX-50)+\",\"+(pqY)+\",\"+(pqX+50)+\",\"+(pqY)+\",\"+(pqX)+\",\"+(pqY-50)+\")),\" +\r\n\t\t\t\t\t\t\t\t\t\"'anyinteract',a.shape,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tString sqlNearest=\"select b.shape from buildings1 b where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_nn(b.shape,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE'\";\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.BUILDINGS,rs1,Color.GREEN);\r\n\t\t\t\t\t\t\tResultSet rs2=st.executeQuery(sqlNearest);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.BUILDINGS,rs2,Color.YELLOW);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\" +sqlNearest);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(getQuery().isAsFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tString sqlAll =\"select a.loc,a.rad from announcementsystems a where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null,null,sdo_elem_info_array(1,1003,4),\" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_ordinate_array(\"+(pqX-50)+\",\"+(pqY)+\",\"+(pqX+50)+\",\"+(pqY)+\",\"+(pqX)+\",\"+(pqY-50)+\")),'anyinteract',a.loc,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tString sqlNearest=\"select b.loc,b.rad from announcementsystems b where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_nn(b.loc,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE'\";\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs1,Color.GREEN);\r\n\t\t\t\t\t\t\tResultSet rs2=st.executeQuery(sqlNearest);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs2,Color.YELLOW);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\" +sqlNearest);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(getQuery().isStudentFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tString sqlAll=\" select s.cord from test1 s where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null\" +\r\n\t\t\t\t\t\t\t\t\t\",null,sdo_elem_info_array(1,1003,4),sdo_ordinate_array(\"+(pqX-50)+\",\"+(pqY)+\",\"+(pqX+50)+\",\"+(pqY)+\",\"+(pqX)+\",\"+(pqY-50)+\")),\" +\r\n\t\t\t\t\t\t\t\t\t\"'anyinteract',s.cord,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\tString sqlNearest=\"select s.cord from test1 s where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_nn(s.cord,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE'\";\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs1,Color.GREEN);\r\n\t\t\t\t\t\t\tResultSet rs2=st.executeQuery(sqlNearest);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs2,Color.YELLOW);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\" +sqlNearest);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\tst = null;\r\n\t\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\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\tif(q.getSelectedQuery().trim().equalsIgnoreCase(\"Range Query\")){\r\n\t\t\t\t\tif(path.size() == 1){\r\n\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t\tg.drawRect(path.get(0).x, path.get(0).y, 10, 10);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t\tfor(int i=1;i<path.size();i++){\r\n\t\t\t\t\t\t\tint a = path.get(i-1).x;\r\n\t\t\t\t\t\t\tint b = path.get(i-1).y;\r\n\t\t\t\t\t\t\tint c = path.get(i).x;\r\n\t\t\t\t\t\t\tint d = path.get(i).y;\r\n\t\t\t\t\t\t\txi= path.get(i).x;\r\n\t\t\t\t\t\t\tyi= path.get(i).y;\r\n\t\t\t\t\t\t\tg.drawLine(a, b, c, d);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tif(getQuery().isSubmitFlag())\r\n\t\t\t\t\t{\r\n\t\t\t\t\tStringBuffer sqlText = new StringBuffer();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tConnection con=hw2.getDBConnection();\r\n\t\t\t\t\t\tStatement st=con.createStatement();\r\n\t\t\t\t\t\tString coordinates=\"\";\r\n\t\t\t\t\t\tfor(int i=0;i<path.size();i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcoordinates+=path.get(i).x+\",\"+path.get(i).y+\",\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcoordinates+=path.get(0).x+\",\"+path.get(0).y;\r\n\t\t\t\t\t\tif(getQuery().isBuildingFlag()){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tString sqlAll=\"select a.shape from buildings1 a where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null\" +\r\n\t\t\t\t\t\t\t\t\t\",null,sdo_elem_info_array(1,1003,1),sdo_ordinate_array(\"+coordinates+\")),\" +\r\n\t\t\t\t\t\t\t\t\t\"'anyinteract',a.shape,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.BUILDINGS,rs1,Color.YELLOW);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\" );\r\n\t\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(getQuery().isAsFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tString sqlAll =\"select a.loc,a.rad from announcementsystems a where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null,null,sdo_elem_info_array(1,1003,1),\" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_ordinate_array(\"+coordinates+\")),'anyinteract',a.loc,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs1,Color.RED);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\" );\r\n\t\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getQuery().isStudentFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tString sqlAll=\" select s.cord from test1 s where \" +\r\n\t\t\t\t\t\t\t\t\t\"sdo_geom.relate(sdo_geometry(2003,null\" +\r\n\t\t\t\t\t\t\t\t\t\",null,sdo_elem_info_array(1,1003,1),sdo_ordinate_array(\"+coordinates+\")),\" +\r\n\t\t\t\t\t\t\t\t\t\"'anyinteract',s.cord,0.005)='TRUE'\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tResultSet rs1=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs1,Color.GREEN);\r\n\t\t\t\t\t\t\tsqlText.append(sqlAll + \"\\n\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\tst = null;\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t\tcatch(Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\t// end of Range Query\r\n\t\t\t\t\r\n\t\t\t\tif(q.getSelectedQuery().trim().equalsIgnoreCase(\"Surrounding Student\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\tStringBuffer sqlText = new StringBuffer();\r\n\t\t\t\t\tg.drawRect(pqX, pqY, 5, 5);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tConnection con=hw2.getDBConnection();\r\n\t\t\t\t\t\tStatement st=con.createStatement();\r\n\t\t\t\t\t\tString sqlNearest=\"select a.loc,a.rad from announcementsystems a where \" +\r\n\t\t\t\t\t\t\t\t\"sdo_nn(a.loc,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE'\";\r\n\t\t\t\t\t\tResultSet rs2=st.executeQuery(sqlNearest);\r\n\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs2,Color.RED);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getQuery().isSubmitFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint xco,yco,rad;\r\n\t\t\t\t\t\t\tString sqlAll=\"select p.rad,q.X,q.Y from announcementsystems p\" +\r\n\t\t\t\t\t\t\t\t\t\",table(sdo_util.getvertices(p.loc))q where p.bid in\" +\r\n\t\t\t\t\t\t\t\t\t\"(select a.bid from announcementsystems a where sdo_nn\" +\r\n\t\t\t\t\t\t\t\t\t\"(a.loc,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE')\";\r\n\t\t\t\t\t\t\tResultSet rs3=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\trs3.next();\r\n\t\t\t\t\t\t\t rad=rs3.getInt(1);\r\n\t\t\t\t\t\t\t xco=rs3.getInt(2);\r\n\t\t\t\t\t\t\t yco=rs3.getInt(3);\r\n\t\t\t\t\t\t\tString sqlsurr=\"select c.cord from test1 c where sdo_geom.relate\" +\r\n\t\t\t\t\t\t\t\t\t\"(c.cord,'anyinteract',sdo_geometry(2003,null,null,sdo_elem_info_array(1,1003,4)\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_ordinate_array(\"+(xco+rad)+\",\"+(yco)+\",\"+(xco-rad)+\",\"+(yco)+\",\"+(xco)+\",\"+(yco+rad)+\r\n\t\t\t\t\t\t\t\t\t\")),0.005)='TRUE'\";\r\n\t\t\t\t\t\t\tResultSet rs8=st.executeQuery(sqlsurr);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs8,Color.GREEN);\t\r\n\t\t\t\t\t\t\tsqlText.append(\"Query1:\"+sqlAll + \"\\n\"+\"Query2:\" +sqlNearest+\"\\n\"+\"Query3:\"+sqlsurr);\r\n\t\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}//surronding query end\r\n\t\t\t\t\r\n\t\t\t\tif(q.getSelectedQuery().trim().equalsIgnoreCase(\"Emergency Query\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\tStringBuffer sqlText = new StringBuffer();\r\n\t\t\t\t\tg.drawRect(pqX, pqY, 5, 5);\r\n\t\t\t\t\tint no4=0;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tConnection con=hw2.getDBConnection();\r\n\t\t\t\t\t\tStatement st=con.createStatement();\r\n\t\t\t\t\t\tString sqlNearest=\"select a.loc,a.rad from announcementsystems a where \" +\r\n\t\t\t\t\t\t\t\t\"sdo_nn(a.loc,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE'\";\r\n\t\t\t\t\t\tno4++;\r\n\t\t\t\t\t\tsqlText.append(\"Query\"+no4+\":\"+sqlNearest+\"\\n\");\r\n\t\t\t\t\t\tResultSet rs2=st.executeQuery(sqlNearest);\r\n\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.AS,rs2,Color.RED);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getQuery().isSubmitFlag())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint xco,yco,rad;\r\n\t\t\t\t\t\t\tString aname;\r\n\t\t\t\t\t\t\tno4++;\r\n\t\t\t\t\t\t\tString sqlAll=\"select p.rad,p.bid,q.X,q.Y from announcementsystems p\" +\r\n\t\t\t\t\t\t\t\t\t\",table(sdo_util.getvertices(p.loc))q where p.bid in\" +\r\n\t\t\t\t\t\t\t\t\t\"(select a.bid from announcementsystems a where sdo_nn\" +\r\n\t\t\t\t\t\t\t\t\t\"(a.loc,sdo_geometry(2001,null\" +\r\n\t\t\t\t\t\t\t\t\t\",sdo_point_type(\"+pqX+\",\"+(pqY)+\",null),null,null),\"+\r\n\t\t\t\t\t\t\t\t\t\"'sdo_num_res=1')='TRUE')\";\r\n\t\t\t\t\t\t\tsqlText.append(\"Query\"+no4+\":\"+sqlAll+\"\\n\");\r\n\t\t\t\t\t\t\tResultSet rs3=st.executeQuery(sqlAll);\r\n\t\t\t\t\t\t\trs3.next();\r\n\t\t\t\t\t\t\trad=rs3.getInt(1);\r\n\t\t\t\t\t\t\taname=rs3.getString(2);\r\n\t\t\t\t\t\t\txco=rs3.getInt(3);\r\n\t\t\t\t\t\t\tyco=rs3.getInt(4);\r\n\t\t\t\t\t\t\tString[] A=new String[200];\r\n\t\t\t\t\t\t\tString[] alt=new String[100];\r\n\t\t\t\t\t\t\tString rem=\"select bid from announcementsystems where bid \" +\r\n\t\t\t\t\t\t\t\t\t\"not like '%\"+aname+\"%'\";\r\n\t\t\t\t\t\t\tno4++;\r\n\t\t\t\t\t\t\tsqlText.append(\"Query\"+no4+\":\"+rem+\"\\n\");\r\n\t\t\t\t\t\t\tResultSet remAS=st.executeQuery(rem);\r\n\t\t\t\t\t\t\tint i=0;\r\n\t\t\t\t\t\t\twhile(remAS.next())\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tA[i]=remAS.getString(1);\r\n\t\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tint k=0;\r\n\t\t\t\t\t\t\tfor(k=0;k<i;k++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tno4++;\r\n\t\t\t\t\t\t\t\talt[k]=\"select x.cord from announcementsystems y,test1 x \" +\r\n\t\t\t\t\t\t\t\t\t\t\"where sdo_nn(y.loc,x.cord,'sdo_num_res=2')='TRUE' and y.bid \" +\r\n\t\t\t\t\t\t\t\t\t\t\"like '%\" +A[k]+\"%'\"+\" and x.name in \" +\r\n\t\t\t\t\t\t\t\t\t\t\"(select a.name from test1 a where sdo_geom.relate\" +\r\n\t\t\t\t\t\t\t\t\t\t\"(a.cord,'anyinteract',sdo_geometry(2003,null,\" +\r\n\t\t\t\t\t\t\t\t\t\t\"null,sdo_elem_info_array(1,1003,4)\" +\r\n\t\t\t\t\t\t\t\t\t\t\",sdo_ordinate_array(\"+(xco+rad)+\",\"+(yco)+\",\"+(xco-rad)\r\n\t\t\t\t\t\t\t\t\t\t+\",\"+(yco)+\",\"+(xco)+\",\"+(yco+rad)+\r\n\t\t\t\t\t\t\t\t\t\t\")),0.005)='TRUE')\";\r\n\t\t\t\t\t\t\t\tsqlText.append(\"Query\"+no4+\":\"+alt[k]+\"\\n\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tResultSet rs7=st.executeQuery(alt[0]);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs7,Color.WHITE);\r\n\t\t\t\t\t\t\tResultSet rs8=st.executeQuery(alt[1]);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs8,Color.BLUE);\r\n\t\t\t\t\t\t\tResultSet rs9=st.executeQuery(alt[2]);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs9,Color.CYAN);\r\n\t\t\t\t\t\t\tResultSet rs10=st.executeQuery(alt[2]);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs10,Color.MAGENTA);\r\n\t\t\t\t\t\t\tResultSet rs11=st.executeQuery(alt[2]);\r\n\t\t\t\t\t\t\tdrawCustomPolygon(g,FeatureTypeEnum.STUDENTS,rs11,Color.green);\r\n\t\t\t\t\t\t\tgetDispQuery().setText(sqlText.toString());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}//Emergency Query Ends\r\n\t\t\t\t\t\r\n\t\t\t}", "public void paintComponent( Graphics g )\r\n\t{\r\n Graphics2D g2 = (Graphics2D)g;\r\n \r\n // Draw the map\r\n if( showMap )\r\n drawMap( g2 );\r\n \r\n // Draw mobile objects, beacons, and information sources\r\n drawAWDDevices( g2, sim.getMobileObjects(), MOBILE_OBJECT_COLOUR, MOBILE_OBJECT_RADIUS );\r\n drawAWDDevices( g2, sim.getBeacons(), BEACON_COLOUR, BEACON_RADIUS );\r\n drawAWDDevices( g2, sim.getInformationSources(), INFORMATION_SOURCE_COLOUR, INFORMATION_SOURCE_RADIUS );\r\n \r\n // Draw communication sessions\r\n if( showCommunicationSessions )\r\n {\r\n drawAWDSessions( g2, sim.getMobileObjects() );\r\n drawAWDSessions( g2, sim.getBeacons() );\r\n drawAWDSessions( g2, sim.getInformationSources() );\r\n }\r\n }", "public void draw() {\t\n \t\t// Draw the centre of the maze\n \t\tPoint2D.Double centrePoint = GetCentrePoint();\n \t\t// if size is a factor of 10, this will be a multiple of 2\n \t\tint centreSize = getCentreSize();\n \t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n \t\tStdDraw.filledSquare(centrePoint.getX(), centrePoint.getY(), (centreSize / 2)-0.05);\n \t\t//Draw all the power switches\n \t\tdrawPowerSwitch(switches[0].x, switches[0].y);\n \t\tdrawPowerSwitch(switches[1].x, switches[1].y);\n \t\tdrawPowerSwitch(switches[2].x, switches[2].y);\n \t\tdrawPowerSwitch(switches[3].x, switches[3].y);\n \t\t\n \t\t\n \t\t// Get the data from the maze\n \t\tboolean south[][] = getSouth();\n \t\tboolean north[][] = getNorth();\n \t\tboolean east[][] = getEast();\n \t\tboolean west[][] = getWest();\n \t\tboolean sensor[][] = ms.getMotionSensors();\n \n \t\t//Draw the maze and motion sensors\n \t\tfor (int x = 1; x <= size; x++) {\n \t\t\tfor (int y = 1; y <= size; y++) {\n \t\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n \t\t\t\tif (south[x][y]) {\n \t\t\t\t\tStdDraw.line(x, y, x + 1, y);\n \t\t\t\t}\n \t\t\t\tif (north[x][y]) {\n \t\t\t\t\tStdDraw.line(x, y + 1, x + 1, y + 1);\n \t\t\t\t}\n \t\t\t\tif (west[x][y]) {\n \t\t\t\t\tStdDraw.line(x, y, x, y + 1);\n \t\t\t\t}\n \t\t\t\tif (east[x][y]) {\n \t\t\t\t\tStdDraw.line(x + 1, y, x + 1, y + 1);\n \t\t\t\t}\n \t\t\t\tif (sensor[x][y]) {\n \t\t\t\t\tStdDraw.setPenColor(StdDraw.MAGENTA);\n \t\t\t\t\tStdDraw.filledTriangle(x + 0.5, y + 0.4, 0.5);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public MapPanel(String map, Object[] toLoad) {\n\t\tthis.setLayout(null);\n\t\tthis.setBackground(Color.white);\n\t\tthis.setPreferredSize(new Dimension(WIDTH, HEIGHT));\n\t\tthis.setSize(this.getPreferredSize());\n\t\tthis.setVisible(true);\n\t\tthis.setFocusable(true);\n\t\tthis.requestFocus();\n\t\ttheMap = new Map(map, 50);\n\t\ttheTrainer = new Trainer(theMap, toLoad);\n\n\t\tinBattle = false;\n\t}", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "protected void buildUi() {\n\t\t\t LatLng cawkerCity = LatLng.newInstance(39.509, -98.434);\n\t\t\n\t\t\t map = new MapWidget(cawkerCity, 2);\n\t\t\t map.setSize(\"100%\", \"100%\");\n\t\t\t // Add some controls for the zoom level\n\t\t\t map.addControl(new LargeMapControl());\n\t\t\n\t\t\t // Add a marker\n\t\t\t map.addOverlay(new Marker(cawkerCity));\n\t\t\n\t\t\t // Add an info window to highlight a point of interest\n\t\t\t map.getInfoWindow().open(map.getCenter(),\n\t\t\t new InfoWindowContent(\"World's Largest Ball of Sisal Twine\"));\n\t\t\n\t\t\t root.addNorth(map, 500);\n\n\t}", "public void printMiniMap() \n { \n /* this.miniMapFrame(); */\n }", "@Override\r\n\tpublic void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\t\t//parent.log(\"Height = \" + getHeight());\r\n\t\tpaintGrid((Graphics2D) g);\r\n\t\tpaintMap((Graphics2D) g);\r\n\t\tif (parent.showMesh) paintMesh((Graphics2D) g);\r\n\t\tpaintParticles((Graphics2D) g);\r\n\t\tpaintRobot((Graphics2D) g);\r\n\t\tpaintTarget((Graphics2D) g);\r\n\t\tpaintPath((Graphics2D) g);\r\n\t\tpaintMoves((Graphics2D) g);\r\n\t\tpaintFeatures((Graphics2D) g);\r\n\t\tpaintWaypoints((Graphics2D) g);\r\n\t}", "public void setMap2D(FXMap map);", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public synchronized void draw() {\n // Clear the canvas\n// canvas.setFill(Color.BLACK);\n// canvas.fillRect(0, 0, canvasWidth, canvasHeight);\n canvas.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // Draw a grid\n if (drawGrid) {\n canvas.setStroke(Color.LIGHTGRAY);\n canvas.setLineWidth(1);\n for (int i = 0; i < mapWidth; i++) {\n drawLine(canvas, getPixel(new Point(i - mapWidth / 2, -mapHeight / 2)), getPixel(new Point(i - mapWidth / 2, mapHeight / 2)));\n drawLine(canvas, getPixel(new Point(-mapWidth / 2, i - mapHeight / 2)), getPixel(new Point(mapWidth / 2, i - mapHeight / 2)));\n }\n }\n\n // Draw each player onto the canvas\n int height = 0;\n for (Player p : playerTracking) {\n canvas.setStroke(p.getColor());\n\n drawName(canvas, p.getName(), height, p.getColor());\n height += 30;\n\n canvas.setLineWidth(7);\n\n // Draw each position\n Point last = null;\n int direction = 0;\n for (Point point : p.getPoints()) {\n if (last != null) {\n drawLine(canvas, getPixel(last), getPixel(point));\n\n Point dir = point.substract(last);\n if (dir.X > dir.Y && dir.X > 0) {\n direction = 1;\n } else if (dir.X < dir.Y && dir.X < 0) {\n direction = 3;\n } else if (dir.Y > dir.X && dir.Y > 0) {\n direction = 2;\n } else if (dir.Y < dir.X && dir.Y < 0) {\n direction = 0;\n }\n }\n last = point;\n }\n\n drawSlug(canvas, p.getId() - 1, getPixel(last), direction);\n }\n }", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "public void showMap(boolean isEnd) {\n\t\t// Map shown inbetween games. Works by grabbing the system time in milliseconds,\n\t\t// adding 5000, and then counting down 1 second every second. Effectively keeping\n\t\t// the map screen up for 5 seconds.\n//\t\tif(legnum == 4) {\n//\t\t\treplay = new JButton(\"Replay\");\n//\t\t\treplay.setSize(frameWidth*5/100, frameHeight*5/100);\n//\t\t\tif(isOsprey) {\n//\t\t\t\treplay.setLocation((frameWidth/2)+frameWidth*30/100, frameHeight/2);\n//\t\t\t}\n//\t\t\telse {\n//\t\t\t\treplay.setLocation((frameWidth/2)+frameWidth*15/100, frameWidth/2);\n//\t\t\t}\n//\t\t\tframe.add(replay);\n//\t\t}\n\t\tlong tEnd = System.currentTimeMillis();\n\t\tframe.setVisible(true);\n\t\tlong tStart = tEnd + 3*1000;\n\t\twhile(tStart > tEnd) {\n\t\t\ttStart -= 1000;\n\t\t\ttry {\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\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tint i = (e.getX()) / 6;\r\n\t\t\t\tint j = (e.getY()) / 6;\r\n\t\t\t\tmap.setNextMap(i, j, 1);\r\n\t\t\t\tmap.refresh1();\r\n\t\t\t\trepaint();\r\n\t\t\t}", "static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void showMapTypePanel(){\n mapTypePanel.showMapTypePanel();\n if(mapTypePanel.isVisible() && optionsPanel.isVisible()){\n optionsPanel.setVisible(false);\n if(iconPanel.isVisible()) iconPanel.setVisible(false);\n }\n if(routePanel.isVisible()) routePanel.setVisible(false); closeDirectionList();\n canvas.repaint();\n }", "public void paintGui(Map map, Fog fog, List<Entity> entities, Graphics graphics, Camera camera, JPanel infoTargetPanel, JPanel infoUpPanel, JPanel minimapPanel, Minimap minimap, GraphicsManager graphicsManager)\r\n\t{\t\r\n\t\tTile[][] tiles = map.getTiles();\r\n\t\tboolean[][] removeFog = fog.getFog();\r\n\t\t\r\n\t\t//draw the rect of the minimap\r\n\t\tgraphics.drawImage(graphicsManager.getPanelGaucheBas(), minimapPanel.getX() + minimapPanel.getWidth() / 2, minimapPanel.getY(), minimapPanel.getWidth() / 2, minimapPanel.getHeight(), null);\r\n\t\t\t\t\r\n\t\t//draw the minimap\r\n\t\tfor (int lineIndex = 0; lineIndex < map.getLineCount(); lineIndex++) \r\n\t\t{\r\n\t\t\tfor (int columnIndex = 0; columnIndex < map.getColumnCount(); columnIndex++) \r\n\t\t\t{\r\n\t\t\t\tTile tile = tiles[lineIndex][columnIndex];\r\n\t\t\t\tgraphics.setColor(tile.getColor());\r\n\t\t\t\t\t\r\n\t\t\t\tgraphics.fillRect(tile.getColumn() * minimap.getGridMapWidth() + minimap.getFirstGridXOfMap(), tile.getLine() * minimap.getGridMapHeight() + minimap.getFirstGridYOfMap(), minimap.getGridMapWidth(), minimap.getGridMapHeight());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(Entity entity : entities)\r\n\t\t{\r\n\t\t\tpaintEntityGui(entity, graphics, camera, minimap);\r\n\t\t}\r\n\t\t\r\n\t\tgraphics.setColor(Color.black);\r\n\t\tfor (int lineIndex = 0; lineIndex < fog.getLineCount(); lineIndex++) \r\n\t\t{\r\n\t\t\tfor (int columnIndex = 0; columnIndex < fog.getColumnCount(); columnIndex++) \r\n\t\t\t{\r\n\t\t\t\tif(removeFog[lineIndex][columnIndex] == true) {\r\n\t\t\t\t\tgraphics.fillRect(columnIndex * minimap.getGridMapWidth() + minimap.getFirstGridXOfMap(), lineIndex * minimap.getGridMapHeight() + minimap.getFirstGridYOfMap(), minimap.getGridMapWidth(), minimap.getGridMapHeight());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t//draw rect of the camera on the minimap\r\n\t\tgraphics.setColor(Color.white);\r\n\t\tgraphics.drawRect(camX + (camera.getX() * minimap.getGridMapWidth()) / GameConfiguration.TILE_SIZE, camY + (camera.getY() * minimap.getGridMapHeight()) / GameConfiguration.TILE_SIZE, camW, camH);\t\r\n\t\t\r\n\t\tgraphics.drawImage(graphicsManager.getPanelGaucheBas(), infoTargetPanel.getX(), infoTargetPanel.getY(), infoTargetPanel.getWidth(), infoTargetPanel.getHeight(), null);\r\n\t\tgraphics.drawImage(graphicsManager.getPanelGaucheBas(), infoUpPanel.getX(), infoUpPanel.getY(), infoUpPanel.getWidth(), infoUpPanel.getHeight(), null);\r\n\t}", "public void drawInfoWindow(){\n\n p.pushMatrix();\n p.translate(0,0); // translate whole window if necessary\n\n // display name and show\n p.stroke(0);\n p.strokeWeight(2);\n p.textSize(30);\n p.fill(0);\n p.text(\"Info\",735,35);\n p.rectMode(CORNER);\n p.fill(219, 216, 206);\n p.rect(730,40,550,700);\n p.rectMode(CENTER);\n\n p.fill(0);\n p.pushMatrix();{\n p.translate(740,80);\n p.textSize(15);\n p.text(\"General\",0,-20);\n p.line(-3,-15,150,-15);\n p.text(\"Speed: \" + manipulator.maxSpeed,0,0);\n p.text(\"Angle of rotation for segment_1: \" + p.degrees(manipulator.segment_1_rot),0,20);\n p.text(\"Angle of rotation for segment_2: \" + p.degrees(manipulator.segment_2_rot),0,40);\n\n\n }p.popMatrix();\n\n p.popMatrix();\n\n }", "private void initUI() {\t\t\n\t\t\n\t\t/* Get a handle to the Map Fragment and to \n\t\t * the Map object */\t\t\t\t\n\t\tmvMap = ((MapFragment) getFragmentManager()\n\t\t\t\t.findFragmentById(R.id.frMap)).getMap();\n\t\t\n\t\t/* Enables the my-location layer in the map */\n\t\tmvMap.setMyLocationEnabled(true);\n\t\t\n\t\t/* Disable my-location button */\n\t\tmvMap.getUiSettings().setMyLocationButtonEnabled(false);\n\t\t\n\t}", "@Override\n public void draw() {\n /** preparacion de la ventana **/\n background(255);\n lights();\n directionalLight(40, 90, 100, 1, 40, 40);\n\n translate(origin.x,origin.y);\n scale(zoom);\n\n\n /** entrada del usuario **/\n userInput();\n /** ejes X Y Z **/\n drawAxes();\n /** aplicar ik **/\n writePos();\n\n /** escala de los objetos**/\n scale(-1.2f);\n\n /** esfera que muestra la posicion en coord X Y Z\n *\n * X -> coord[0]\n * Y -> coord[1]\n * Z -> coord[2]\n *\n * **/\n pushMatrix();\n noStroke();\n fill(250, 100, 1);\n translate(-coord_cartesian[1] ,-coord_cartesian[2] -11,-coord_cartesian[0] );\n sphere(2);\n popMatrix();\n\n\n /**\n * Dibuja el brazo\n */\n pushMatrix();\n arm.drawArm();\n popMatrix();\n }", "public void draw() \r\n\t{\r\n\t\tdraw(root, new RectHV(0,0,1,1) );\r\n\t}", "@Override\n public void draw(ElapsedTime elapsedTime, IGraphics2D graphics2D) {\n\n\n // Clear the screen and draw the buttons\n graphics2D.clear(Color.WHITE);\n mOverworldMap.draw(elapsedTime, graphics2D, mLayerViewport, mScreenViewport);\n mLocationButton.draw(elapsedTime, graphics2D, null, null);\n mLocationButton1.draw(elapsedTime, graphics2D, null, null);\n mLocationButton2.draw(elapsedTime, graphics2D, null, null);\n mLocationButton3.draw(elapsedTime, graphics2D, null, null);\n mLocationButton4.draw(elapsedTime, graphics2D, null, null);\n\n\n }", "private void initialize() {\r\n\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 760, 680);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tmapa = new GraphicalMap();\r\n\t\tmapa.setBackground(Color.WHITE);\r\n\t\tmapa.setBounds(236, 20, 500, 500);\r\n\t\tmapa.loadSource();\r\n\t\tmapa.loadBoard(novoJogo.VirtualBoard());\r\n\t\tmapa.addKeyListener(new KeyListener() { \r\n\t\t\t\r\n\t\t\t@Override\r\n public void keyTyped(KeyEvent e) {}\r\n\r\n @Override\r\n public void keyReleased(KeyEvent e) {}\r\n\r\n \r\n\t\t\t@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\r\n\t\t\t\tswitch(e.getKeyCode()){\r\n\t\t\t\tcase KeyEvent.VK_LEFT: \r\n\t\t\t\t\tmovement('a');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase KeyEvent.VK_RIGHT:\r\n\t\t\t\t\tmovement('d');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase KeyEvent.VK_UP: \r\n\t\t\t\t\tmovement('w');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase KeyEvent.VK_DOWN: \r\n\t\t\t\t\tmovement('s');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t }\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\r\n\t\t\t}\r\n );\t\t\t\t\t\t\r\n\t\tmapa.setFocusable(true);\r\n\t\tframe.getContentPane().add(mapa);\r\n\t\t\r\n\t\t\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Number of Ogres: \");\r\n\t\tlblNewLabel.setBounds(10, 11, 104, 27);\r\n\t\tlblNewLabel.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\ttextField = new JTextField();\r\n\t\ttextField.setBounds(107, 14, 119, 20);\r\n\t\ttextField.setText(\"0\");\r\n\t\tframe.getContentPane().add(textField);\r\n\t\ttextField.setColumns(10);\r\n\t\t\r\n\t\tlblGuardPersonality = new JLabel(\"Guard Personality:\");\r\n\t\tlblGuardPersonality.setBounds(10, 47, 94, 14);\r\n\t\tframe.getContentPane().add(lblGuardPersonality);\r\n\t\t\r\n\t\tJComboBox comboBox = new JComboBox();\r\n\t\tcomboBox.setFont(new Font(\"Tahoma\", Font.PLAIN, 12));\r\n\t\tcomboBox.setModel(new DefaultComboBoxModel(new String[] {\"Suspicious\", \"Rookie\", \"Drunken\"}));\r\n\t\tcomboBox.setToolTipText(\"\");\r\n\t\tcomboBox.setBounds(107, 45, 119, 17);\r\n\t\tframe.getContentPane().add(comboBox);\r\n\t\t\r\n\r\n\t\tJComboBox comboBox_1 = new JComboBox();\r\n\t\tcomboBox_1.setModel(new DefaultComboBoxModel(new String[] {\"1\", \"2\"}));\r\n\t\tcomboBox_1.setBounds(107, 73, 119, 20);\r\n\t\tframe.getContentPane().add(comboBox_1);\r\n\t\t\r\n\t\tbtnSaveButton.setEnabled(false);\r\n\t\tbtnSaveButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tjogo.saveGame(novoJogo);\r\n\t\t\t}});\r\n\r\n\t\tbtnSaveButton.setBounds(10, 440, 216, 23);\r\n\t\tframe.getContentPane().add(btnSaveButton);\r\n\t\t\r\n\t\tbtnLoadButton.setEnabled(false);\r\n\t\tbtnLoadButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tnovoJogo = jogo.getBoard();\r\n\t\t\t}});\r\n\r\n\t\tbtnLoadButton.setBounds(10, 470, 216, 23);\r\n\t\tframe.getContentPane().add(btnLoadButton);\r\n\t\t\r\n\t\tbtnNewButton.setEnabled(false);\r\n\t\tbtnNewButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tmovement('w');\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton.setBounds(70, 181, 89, 23);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\t\r\n\t\t\r\n\t\tbtnNewButton_1.setEnabled(false);\r\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tmovement('s');\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_1.setBounds(70, 249, 89, 23);\r\n\t\tframe.getContentPane().add(btnNewButton_1);\r\n\t\t\r\n\t\t\r\n\t\tbtnNewButton_2.setEnabled(false);\r\n\t\tbtnNewButton_2.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tmovement('a');\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_2.setBounds(10, 215, 89, 23);\r\n\t\tframe.getContentPane().add(btnNewButton_2);\r\n\t\t\r\n\t\t\r\n\t\tbtnNewButton_3.setEnabled(false);\r\n\t\tbtnNewButton_3.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tmovement('d');\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_3.setBounds(132, 215, 89, 23);\r\n\t\tframe.getContentPane().add(btnNewButton_3);\r\n\t\t\r\n\t\tJButton btnQuitGame = new JButton(\"Quit Game\");\r\n\t\tbtnQuitGame.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnQuitGame.setBounds(10, 500, 216, 23);\r\n\t\tframe.getContentPane().add(btnQuitGame);\r\n\t\t\r\n\t\tlblGameStatus = new JLabel(\"Game Status\");\r\n\t\tlblGameStatus.setBounds(21, 603, 223, 14);\r\n\t\tframe.getContentPane().add(lblGameStatus);\r\n\t\t\r\n\t\tJLabel lblLevel = new JLabel(\"Level:\");\r\n\t\tlblLevel.setBounds(49, 76, 46, 14);\r\n\t\tframe.getContentPane().add(lblLevel);\r\n\t\t\r\n\t\tJButton btnNewGame = new JButton(\"New Game\");\r\n\t\tbtnNewGame.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tnovoJogo = new Board();\r\n\t\t\t\t\r\n\t\t\t\tGuard guarda = new Guard(1,8);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(comboBox.getSelectedItem().toString() == \"Suspicious\")\r\n\t\t\t\t{\r\n\t\t\t\t\tguarda = new GuardSuspicious(1,8);\r\n\t\t\t\t}\r\n\t\t\t\telse if(comboBox.getSelectedItem().toString() == \"Drunken\")\r\n\t\t\t\t{\r\n\t\t\t\t\tguarda = new GuardDrunken(1,8);\r\n\t\t\t\t}\r\n\t\t\t\telse if(comboBox.getSelectedItem().toString() == \"Rooki\")\r\n\t\t\t\t{\r\n\t\t\t\t\tguarda = new GuardRookie(1,8);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tnovoJogo.addGuard(guarda);\r\n\r\n\t\t\tif (textField.getText().equals(\"\") || Integer.parseInt(textField.getText()) > 5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tlblGameStatus.setText(\"Escolhe um numero valido!!\");\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tfor(int i = 0; i < Integer.parseInt(textField.getText()); i++)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\tint x = rand.nextInt(8);\r\n\t\t\t\t\tx++;\r\n\t\t\t\t\tint y = rand.nextInt(8);\r\n\t\t\t\t\ty++;\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tOgre shrek = new Ogre(x,y);\r\n\t\t\t\t\tnovoJogo.addOgre(shrek);\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\tHero heroi = new Hero(1,1);\r\n\t\t\t\tjogo.setExit(0);\r\n\t\t\t\tif(comboBox_1.getSelectedItem().toString() == \"2\")\r\n\t\t\t\t{\r\n\t\t\t\t\tjogo.setExit(1);\r\n\t\t\t\t\tnovoJogo.newBoard();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tnovoJogo.setHero(heroi);\r\n\t\t\t\t\r\n\t\t\t\tbtnNewButton.setEnabled(true);\r\n\t\t\t\tbtnNewButton_1.setEnabled(true);\r\n\t\t\t\tbtnNewButton_2.setEnabled(true);\r\n\t\t\t\tbtnNewButton_3.setEnabled(true);\r\n\t\t\t\tbtnSaveButton.setEnabled(true);\r\n\t\t\t\tbtnLoadButton.setEnabled(true);\r\n\t\t\t\tmapa.loadBoard(novoJogo.VirtualBoard());\r\n\t\t\t\tmapa.repaint();\r\n\t\t\t\tmapa.requestFocusInWindow();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewGame.setBounds(10, 410, 216, 23);\r\n\t\tframe.getContentPane().add(btnNewGame);\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void update()\n\t{\n\t\tGViewMapManager gViewMapManager = this.guiController.getCurrentStyleMapManager();\n\t\tLayout layout = gViewMapManager.getLayout();\n\n\t\tswitch (layout)\n\t\t{\n\t\t\tcase LINEAR:\n\t\t\t\tthis.linear.setSelected(true);\n\t\t\t\tbreak;\n\t\t\tcase CIRCULAR:\n\t\t\t\tthis.circular.setSelected(true);\n\t\t\t\tbreak;\n default:\n break;\n\t\t}\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n drawGokongweiBuilding();\n getContinuousLocationUpdates();\n }", "private void RadialGradientMapBTActionPerformed(java.awt.event.ActionEvent evt) {\n showRadialGradientMap();\n }", "private void drawMap( Graphics2D g2 )\r\n {\r\n MobilityMap map = sim.getMap();\r\n \r\n /* Draw map nodes and their links */\r\n int numNodes = map.getNumberOfNodes();\r\n \r\n for( int i=0; i < numNodes; i++ )\r\n {\r\n MapNode node = map.getNodeAt(i);\r\n Point2D.Double nodeLoc = node.getLocation();\r\n \r\n // Draw the node\r\n drawCircle( g2, nodeLoc, MAP_NODE_COLOUR, MAP_NODE_RADIUS, false );\r\n \r\n // Draw the node's links\r\n int numLinks = node.getNumberOfLinks();\r\n for( int j=0; j < numLinks; j++ )\r\n {\r\n MapNode destNode = node.getLinkAt(j).getGoesTo();\r\n Point2D.Double destNodeLoc = destNode.getLocation();\r\n drawLine( g2, nodeLoc, destNodeLoc, MAP_LINK_COLOUR );\r\n }\r\n }\r\n }", "public void draw(Graphics g, int... paneOffsets) { }", "@Override\n public void run() {\n Map<String, Object> m = new HashMap<>();\n m.put(\"mAMapLocation\", \"mAMapLocation\");\n Graphic graphic = new Graphic(tapPoint, m, pinDestinationSymbol);\n\n finalMarkerOverlay.getGraphics().add(graphic);\n }", "public GUI(GUIListener gl) {\n // Load certain necessary resources.\n map = getClass().getResource(\"/res/map.html\").toString();\n start = createImageIcon(\"play_16.png\");\n stop = createImageIcon(\"stop_16.png\");\n MIN_FRAME_DIM = new Dimension(960, 540);\n popup = new PopupMenu();\n trayIcon = new TrayIcon(createImageIcon(\"map_16.png\").getImage());\n languageCodes.put(\"English\", \"en\");\n languageCodes.put(\"Dutch\", \"nl\");\n languageCodes.put(\"German\", \"de\");\n languageCodes.put(\"French\", \"fr\");\n languageCodes.put(\"Spanish\", \"es\");\n languageCodes.put(\"Italian\", \"it\");\n languageCodes.put(\"Russian\", \"ru\");\n languageCodes.put(\"Lithuanian\", \"lt\");\n languageCodes.put(\"Hindi\", \"hi\");\n languageCodes.put(\"Tamil\", \"ta\");\n languageCodes.put(\"Arabic\", \"ar\");\n languageCodes.put(\"Chinese\", \"zh\");\n languageCodes.put(\"Japanese\", \"ja\");\n languageCodes.put(\"Korean\", \"ko\");\n languageCodes.put(\"Vietnamese\", \"vi\");\n\n // Create a browser, its associated UI view object and the browser listener.\n browser = new Browser();\n browserView = new BrowserView(browser);\n listener = gl;\n \n /* set link load handler to load all links in the running system's \n default browser.*/\n browser.setLoadHandler(new DefaultLoadHandler(){\n\n @Override\n public boolean onLoad(LoadParams lp) {\n String url = lp.getURL();\n boolean cancel = !url.endsWith(\"map.html\");\n if(cancel) {\n try {\n // open up any other link on the system's default browser.\n UIutils.openWebpage(new java.net.URL(url));\n } catch (MalformedURLException ex) {\n JDialog.setDefaultLookAndFeelDecorated(true);\n JOptionPane.showMessageDialog(null, \"Could not open link.\",\n \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }\n return cancel;\n }\n \n });\n\n /* Set the Windows look and feel and initialize all the GUI components. */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html\n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Windows\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n initComponents();\n\n // Select english as a filter language by default.\n String[] sel = new String[] {\"English\", \"en\"};\n selectedLanguages.put(sel[0], sel[1]);\n ((DefaultTableModel) selectedLangTable.getModel()).addRow(sel);\n\n // Load certain variables.\n timeScale = 60000; // 1min = 60000ms\n\n // Add the map view to the GUI frame and load the map URL.\n mapPanel.add(browserView, BorderLayout.CENTER);\n browser.loadURL(map);\n\n // Adding support for minimizing window to system tray if supported.\n if (SystemTray.isSupported()) {\n systrayCheckBox.setEnabled(true);\n try {\n systrayCheckBox.setSelected(Boolean.parseBoolean(\n listener.getProperties().getProperty(\"MINIMIZE_TO_TRAY\")));\n } catch (Exception ex) {}\n systrayCheckBox.setToolTipText(\"Enable/Disable minimizing to system tray.\");\n\n // Context menu items to system tray icon.\n final MenuItem exitItem = new MenuItem(\"Exit\");\n exitItem.addActionListener((ActionEvent e) -> {\n GUI.this.exitMenuItemActionPerformed(e);\n });\n popup.add(exitItem);\n trayIcon.setPopupMenu(popup);\n trayIcon.addActionListener((ActionEvent e) -> {\n GUI.this.setVisible(true);\n GUI.this.setExtendedState(GUI.NORMAL);\n SystemTray.getSystemTray().remove(trayIcon);\n });\n } else {\n systrayCheckBox.setEnabled(false);\n systrayCheckBox.setToolTipText(\"OS does not support this function.\");\n }\n\n // add a text field change listener to the twitter credentials input dialog.\n DocumentListener dl1 = new DocumentListener() {\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n applyKeysButton.setEnabled(true);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n applyKeysButton.setEnabled(true);\n }\n\n @Override\n public void changedUpdate(DocumentEvent e) {\n }\n };\n consumerKeyTextField.getDocument().addDocumentListener(dl1);\n consumerSecretTextField.getDocument().addDocumentListener(dl1);\n apiKeyTextField.getDocument().addDocumentListener(dl1);\n apiSecretTextField.getDocument().addDocumentListener(dl1);\n\n // add a text field change listener to the MySQL credentials input dialog.\n DocumentListener dl2 = new DocumentListener() {\n\n @Override\n public void insertUpdate(DocumentEvent e) {\n sqlApplyButton.setEnabled(true);\n }\n\n @Override\n public void removeUpdate(DocumentEvent e) {\n sqlApplyButton.setEnabled(true);\n }\n\n @Override\n public void changedUpdate(DocumentEvent e) {\n }\n };\n sqlUserTextField.getDocument().addDocumentListener(dl2);\n sqlPasswordField.getDocument().addDocumentListener(dl2);\n sqlLinkTextField.getDocument().addDocumentListener(dl2);\n \n // Set and start the connection to the MySQL database if USE_MYSQL is true.\n try {\n Properties p = listener.getProperties();\n boolean isSelected = Boolean.parseBoolean(p.getProperty(\"USE_MYSQL\"));\n useDBCheckBox.setSelected(isSelected);\n dbInputDialogShown(null);\n if(isSelected)\n sqlApplyButtonActionPerformed(null);\n } catch (Exception ex) {}\n\n // Display the keywords dialog at start\n keywordsDialog.setVisible(true);\n }", "public void draw(){\n textAlign(CENTER);\n route.update(pp, qq);\n SoundSys();\n fill(0xff31F0FF, 127);\n noStroke();\n ellipse(mouseX, mouseY, 30, 30);\n}", "public void draw() {\n draw(root, false);\n }", "public void drawControlPolygon() {\n\t\t//this.frame.stroke(255, 0, 0);\n\t\tfor(int i=0;i<points.length;i++) {\n\t\t\tfor(int j=0;j<points[i].length;j++)\n\t\t\t\tthis.frame.drawVertex(points[i][j]);\n\t\t}\n\t}", "public void draw(WorldLocation coord){\n \n }", "public void drawAllGraphics(){\r\n\t\t \r\n\t}", "private void setOverlay() {\n //Initial Map\n mapOverlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(R.drawable.kmuttmap))\n .position(position_Initmap, map_wide, map_high);\n\n //Red Line\n red_lineOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(R.drawable.red_line))\n .position(position_Redline, redline_wide, redline_high);\n\n //Yellow Line\n yellow_lineOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(R.drawable.yellow_line))\n .position(position_Yellowline, yellowline_wide, yellowline_high);\n\n //Map with label\n map_labelOverlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(R.drawable.kmuttmap_label2))\n .position(position_Initmap, map_wide, map_high);\n\n }", "public Graphical(Map map, Player player)\n {\n Swing.init();\n \n // Store paramaters\n this.player = player; \n\n /* TODO: Finish editor frame */\n this.editorFrame = new EditorFrame (this);\n this.miniMapFrame = new MiniMapFrame (this, map, player);\n this.mapFrame = new MapFrame (this, map, player);\n }", "public MapPanel() {\n painter = NONE_PAINTER;\n setBackground(BACKGROUND_COLOR);\n mapBounds = new Rectangle2D.Double(0, 0, MIN_WIDTH, MIN_HEIGHT);\n mouseClick = SwingObservable.mouse(this, SwingObservable.MOUSE_CLICK)\n .toFlowable(BackpressureStrategy.LATEST)\n .filter(ev -> ev.getID() == MouseEvent.MOUSE_CLICKED)\n .map(this::mapMouseEvent);\n logger.atDebug().log(\"Created\");\n }", "public void drawOnMapFragment(){\n if(!ifFieldTooBig()){\n isFreeDraw = true;\n mFreeDrawView.setVisibility(View.INVISIBLE);\n mFreeDrawView.cleanCanvas();\n drawPolygonWithMarker(mMapInterface.getPathFrame(), Color.WHITE);\n\n dronePath.findDronePath(mMapInterface.getPathFrame(), RESOLUTION);\n dronePath.drawRout(getDronePath(), googleMap, Color.GREEN);\n isPathReady=true;\n mMapInterface.setFullDronePath(getDronePath());\n Toast.makeText(getContext(), getString(R.string.edit_explain), Toast.LENGTH_LONG).show();\n }\n else{\n deletePath();\n }\n }", "public void draw() {\n draw(root, true);\n }", "@Override\n public void displayMapTiles(MapTile[][] grid)\n {\n Platform.runLater(() -> {\n MapView mapArea = gui.getMapArea();\n mapArea.displayMapGrid(grid, -3, -3);\n });\n }", "private void initialize(Graph G, List<double[]> V, double[] mapBounds) {\n\t\tmapContainer = new JLabel();\n\t\tthis.G = G;\n\t\tthis.V = V;\n\t\tthis.mapBounds = mapBounds;\n\t\t\n\t\tDimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tsetBounds(0, 0, screenSize.width, screenSize.height);\n\t\t\n\t\tsetTitle(\"Street Map\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\taddImage();\n\t\tsetVisible(true);\n\t\taddMouseListener(new MouseInput());\n\t\t\n\t\ttitle = \"Title\";\n\t\ttitleFont = new Font(\"Monospace\", Font.BOLD, 13);\n\t\tsubtitle = \"Subtitle\";\n\t\tsubtitleFont = new Font(\"Monospace\", Font.BOLD, 10);\n\t\t\n\t\troadWidth = 1;\n\t\troadColor = Color.black;\n\t\tpathWidth = 3;\n\t\tpathColor = Color.red;\n\t\tzoom = 1.0;\n\t\txF = yF = 0.5;\n\t}" ]
[ "0.7439049", "0.7219892", "0.7097681", "0.70744056", "0.70689917", "0.7046056", "0.7015417", "0.6835972", "0.681241", "0.6811169", "0.6670361", "0.66486114", "0.65868145", "0.6582706", "0.6517506", "0.6500329", "0.6499941", "0.6455427", "0.6399871", "0.6390839", "0.6352222", "0.63411635", "0.6326661", "0.6318422", "0.63084656", "0.63056344", "0.62622106", "0.6260134", "0.6255336", "0.6240078", "0.61977005", "0.6190697", "0.6190389", "0.6178182", "0.61521316", "0.6145601", "0.6142371", "0.6142224", "0.6138769", "0.61296886", "0.61105984", "0.6108739", "0.6100783", "0.60991323", "0.6097454", "0.6094983", "0.6093682", "0.6088191", "0.60739535", "0.60719734", "0.60603744", "0.60517794", "0.6049694", "0.604929", "0.6036543", "0.6029081", "0.6018832", "0.6018727", "0.6013655", "0.60122615", "0.6007969", "0.59917253", "0.59845155", "0.5983146", "0.5981449", "0.5981414", "0.5981125", "0.59795475", "0.5975288", "0.5972927", "0.5968119", "0.59563273", "0.59464234", "0.59370005", "0.59127194", "0.5907711", "0.590198", "0.590076", "0.58986866", "0.5893335", "0.5892656", "0.58902943", "0.5884144", "0.5881448", "0.58778787", "0.5869081", "0.5868848", "0.58622116", "0.5861765", "0.5847007", "0.5845391", "0.5842606", "0.5842449", "0.58379745", "0.5836965", "0.5835949", "0.58208156", "0.5818513", "0.58163285", "0.5814609", "0.580483" ]
0.0
-1
/ getBusSchedule(String start, Duration frequency) : List Method should return a List of String containing the bus timings for a day given the start time and duration as parameters. The timing in the list should be in 24 hour format hh:mm
public List<String> getBusSchedule(String start, Duration frequency) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("[HH::mm]"); LocalTime startTime = LocalTime.parse(start); LocalTime endTime = LocalTime.MIDNIGHT; int gap = (int) frequency.toMinutes(); List<String> busTimings = new ArrayList(); int startMinVal = startTime.getHour()*60 + startTime.getMinute(); int endMinVal = endTime.minusHours(1).getHour()*60 + endTime.minusMinutes(1).getMinute(); while(endMinVal - startMinVal > gap) { busTimings.add(startTime.format(formatter)); startTime = startTime.plusMinutes(gap); startMinVal = startMinVal+gap; } busTimings.add(startTime.format(formatter)); busTimings.forEach(logger::debug); return busTimings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getSchedule();", "List<Tour> getTourSchedule(String line);", "private List<Schedule> getSchedules(String traverserName, int delay) {\n List<ScheduleTimeInterval> intervals =\n new ArrayList<ScheduleTimeInterval>();\n intervals.add(new ScheduleTimeInterval(\n new ScheduleTime(0),\n new ScheduleTime(0)));\n \n List<Schedule> schedules = new ArrayList<Schedule>();\n Schedule schedule = new Schedule(traverserName, false, 60, delay, intervals);\n schedules.add(schedule);\n return schedules;\n }", "public ArrayList<ArrayList<String>> collateWholeDaySchedule(String routeCode, String dayType);", "@SuppressWarnings(\"unchecked\")\n\tpublic List<ISchedule> getSchedules() throws IOException {\n\t\tfinal String sql = \"SELECT * from record\";\n\t\tList<? extends ISchedule> result = this.queryDataList(Schedule.class,ISchedule.Props.class, sql);\n\t\treturn (List<ISchedule>) result;\t\t\n\t}", "List<WorkingSchedule> getAll();", "private List<Schedules> getSchedulesList(){\r\n//\t\tList<Schedules> list = new ArrayList<Schedules>();\r\n//\t\tSchedules s1 = new Schedules(1, \"Baidu\", \"BUPT\", \"2013-09-11\", \"12:30\");\r\n//\t\tSchedules s2 = new Schedules(2, \"Sina\", \"BUPT\", \"2013-09-11\", \"13:50\");\r\n//\r\n//\t\tlist.add(s1);\r\n//\t\tlist.add(s2);\r\n\t\tif (scheduleList == null) {\r\n\t\t\tscheduleList = mAppContext.scheduleGetAll();\r\n\t\t}\r\n\t\treturn scheduleList;\r\n//\t\treturn list;\r\n\t}", "public abstract ArrayList<ScheduleTime> getScheduleForDay(int day, int month, int year);", "@GetMapping\n public List<ScheduleDTO> getAllSchedules() {\n List<Schedule> scheduleList = scheduleService.getAllSchedules();\n\n List<ScheduleDTO> scheduleDTOList = scheduleList.stream()\n .map(ScheduleController::convertScheduleToScheduleDTO)\n .collect(Collectors.toList());\n return scheduleDTOList;\n }", "List<AirlineFlightDelays> listArrivalFlightDelaysByAirlineAsAirlineFlightDelays();", "Schedule getSchedule(String departure, String arrival, int depYear, int depMonth);", "public Schedule getSchedule(String route, int direction){\r\n // A schedule to hold all the data returned from the query\r\n Schedule weekdayZero = new Schedule();\r\n // Fetch the route id given the route\r\n Cursor getData = getReadableDatabase().rawQuery(\"select _id from routes where route_long_name = '\" + route + \"'\", null);\r\n // Make sure to begin at the first element of the returned data\r\n getData.moveToFirst();\r\n // Store the Route Id\r\n int route_id = getData.getInt(0);\r\n // Calendar id: (90400,90448) - Monday To Friday\r\n final String query = \"select Routes.Route_long_Name, \" +\r\n \"Calendar._Id, Stops.Stop_Name, Stop_Times.Stop_Sequence, Stop_Times.Arrival_Time, routes.route_short_name \" +\r\n \"from Trips join Calendar on Trips.Service_Id=Calendar._Id \" +\r\n \"join Routes on Trips.Route_Id=Routes._Id \" +\r\n \"join Stop_Times on Trips._Id=Stop_Times.Trip_Id \" +\r\n \"join Stops on Stop_Times.Stop_Id=Stops._Id \" +\r\n \"where Calendar._Id in \" + getDayOfTheWeek() + \" \" +\r\n \"AND Trips.Route_Id = \" + route_id + \" \" +\r\n \"AND Trips.Direction_Id = \" + direction + \" \" +\r\n \"AND Stop_Times.Arrival_Time != '' \" +\r\n \"order by arrival_time asc\";\r\n getData.moveToFirst();\r\n getData = getReadableDatabase().rawQuery(query, null);\r\n while (getData.moveToNext()){\r\n weekdayZero.insertData(getData.getString(0), getData.getInt(1), getData.getString(2), getData.getInt(3)\r\n , getData.getString(4), getData.getString(5));\r\n }\r\n return weekdayZero;\r\n }", "protected void listSchedules(Calendar calendar) {\n List<Schedule> schedules = calendar.getSchedules();\n List<String> list = new ArrayList<>();\n\n for (Schedule schedule : schedules) {\n list.add(schedule.getName());\n }\n listItem(list);\n }", "public ArrayList<int[]> getSchedule(){\n // Initialize the output list\n ArrayList<int[]> schedule = new ArrayList<>();\n\n // Initialize a list of tuples in the form (rally id, rally duration, rally deadline)\n ArrayList<int[]> rallyList = new ArrayList<>();\n for (int i = 0; i < _rallies.size(); i++) {\n int[] info = new int[] {i, _rallies.get(i)[0], _rallies.get(i)[1]};\n rallyList.add(info);\n }\n\n // Sort them in an increasing order of the deadline\n rallyList.sort(Comparator.comparingInt(rally -> rally[2]));\n\n // Set the start time\n int f = 0;\n\n // If there is no way to finish any one of the rally before its deadline, then we will set this to true.\n boolean nuke = false;\n\n // Run a greedy algorithm (Scheduling to Minimize Lateness)\n for (int[] rally : rallyList) {\n int[] plan = new int[] {rally[0], f};\n int duration = rally[1];\n int deadline = rally[2];\n f += duration;\n\n if (f > deadline) {\n nuke = true;\n break;\n }\n\n schedule.add(plan);\n }\n\n if (nuke) {\n return new ArrayList<>();\n }\n\n return schedule;\n }", "List<WorkingSchedule> getByPlaceId(Long placeId);", "public List<ScheduledTask> fullSchedule() {\n List<ScheduledTask> scheduledTaskList = new LinkedList<>();\n for (ScheduledTask task : this) {\n if (!task.getNode().getId().equals(\"end\")) {\n scheduledTaskList.add(task);\n }\n }\n return scheduledTaskList;\n }", "List<Map.Entry<Long, String>> getStopTimeTable(String stopId) throws Exception;", "public String getSchedule() {\n return schedule;\n }", "public void generateSchedule(){\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<ScheduledFlights> retrieveScheduledFlights(String source, String destination) {\r\n\t\tQuery query = entityManager.createQuery(\"select s.scheduleId,s.source,s.destination,s.arrivaltime,s.departuretime,f.flightNumber,f.carrierName,f.seatCapacity from Schedule s JOIN ScheduledFlights sf ON s.scheduleId=sf.scheduleId JOIN Flight f on sf.flightId=f.flightNumber where schedule.source= :source AND schedule.destination=:destination\");\r\n\t\treturn query.getResultList();\r\n\t}", "protected static String listSchedule(ArrayList<Room> roomList) {\n String roomName = getRoomName();\n System.out.println(roomName + \" Schedule\");\n System.out.println(\"------------\");\n\n for (Meeting m : getRoomFromName(roomList, roomName).getMeetings()) {\n System.out.println(m.toString());\n }\n\n return \"\";\n }", "@GetMapping(\"/getBusList\")\n\tpublic List<Bus> getBusList() {\n\t\treturn busService.getBusList();\n\t}", "ScheduleStartType getScheduleStart();", "public List<FlightSchedule> getFlightsAvailables(ScheduleRepository scheduleFinderService, String from, String to,\n\t\t\tLocalDateTime startDateTime, LocalDateTime endDateTime) {\n\t\tList<FlightSchedule> flightsAvailables = new ArrayList<FlightSchedule>();\n\t\tint day = 0;\n\t\tint month = 0;\n\t\tint year = startDateTime.getYear();\n\t\tLocalDateTime departureDateTime, arrivalDateTime;\n\t\tFlightSchedule flightResult;\n\t\tList<Schedule> schedules = getSchedules(scheduleFinderService, from, to, startDateTime, endDateTime);\n\t\tif (!schedules.isEmpty()) {\n\t\t\tList<DayFlight> flightsDays = schedules.stream().flatMap(schedule -> schedule.getDays().stream()).collect(Collectors.toList());\n\t\t\tList<DayFlight> flightsOfDay = flightsDays.stream().filter(getDay(startDateTime)).collect(Collectors.toList());\n\t\t\tList<Flight> flights = flightsOfDay.stream().flatMap(flight -> flight.getFlights().stream()).collect(Collectors.toList());\n\t\t\tmonth = startDateTime.getMonthValue();\n\t\t\tday = startDateTime.getDayOfMonth();\n\t\t\tfor (Flight flight : flights) {\n\t\t\t\tdepartureDateTime = createLocalDateTime(year, month, day, flight.getDepartureTime());\n\t\t\t\tarrivalDateTime = createLocalDateTime(year, month, day, flight.getArrivalTime());\n\t\t\t\tif (validFlight(startDateTime, endDateTime, departureDateTime, arrivalDateTime)) {\n\t\t\t\t\tlog.info(String.format(\"Create Fligt Result: from %s, to %s, departureTime %s, arrivalTime %s\",\n\t\t\t\t\t\t\tfrom, to, departureDateTime, arrivalDateTime));\n\t\t\t\t\tflightResult = createFlightResult(from, to, departureDateTime, arrivalDateTime);\n\t\t\t\t\tflightsAvailables.add(flightResult);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn flightsAvailables;\n\t}", "@Override\n\tpublic List<ScheduleTask> getScheduleTaskList() {\n\t\treturn (List<ScheduleTask>) find(\"from ScheduleTask\");\n\t}", "List<Route> getRoutesByArrival(String arrival);", "@Override\n\tpublic List<ScheduleTask> getScheduleTaskList() {\n\t\treturn scheduleTaskDAO.getScheduleTaskList();\n\t}", "public Collection<FrequencyDTO> getSchedulingFrequencies() throws Exception;", "List<Stop> getStops();", "private static List<FacilityFreeSchedule> generateFacilityFreeSchedules(Facility facility) {\n List<FacilityFreeSchedule> facilityFreeSchedules=new ArrayList<>();\n LocalDateTime now = LocalDateTime.now();\n Map<Integer,List<LocalDateTime>> workingHoursForMonth=workingHoursForFacilityPerWeek(facility, now);\n workingHoursForMonth.keySet().stream().forEach(weekIndex -> {\n List<LocalDateTime> workingHoursPerWeek = workingHoursForMonth.get(weekIndex);\n facilityFreeSchedules.addAll(workingHoursPerWeek.stream()\n .map(dateTime -> generateFacilityFreeSchedule(facility, dateTime, weekIndex))\n .collect(Collectors.toList()));\n });\n return facilityFreeSchedules;\n }", "public static String listScheduleIdSymbol(int tambahanBolehABs) {\n DBResultSet dbrs = null;\n String result = \"\";\n try {\n Date dtStart = new Date();\n Date dtEnd = new Date();\n String dtManual = \"\";\n boolean crossDay = false;\n //dtStart.setHours(dtStart.getHours()-tambahanBolehABs);\n dtStart = new Date(dtStart.getYear(), dtStart.getMonth(), (dtStart.getDate()), (dtStart.getHours() - tambahanBolehABs), dtStart.getMinutes(), dtStart.getSeconds());\n dtEnd = new Date(dtEnd.getYear(), dtEnd.getMonth(), (dtEnd.getDate()), (dtEnd.getHours() + tambahanBolehABs), dtEnd.getMinutes(), dtEnd.getSeconds());\n int jamMelebihiOneDay = 23;\n if (dtStart.getHours() == 0 || dtStart.getHours() == 23) {\n dtManual = \"23:\" + \"59:\" + \"59\";\n crossDay = true;\n jamMelebihiOneDay = jamMelebihiOneDay + tambahanBolehABs;\n }\n if (dtEnd.getHours() == 0) {\n dtManual = \"23:\" + \"59:\" + \"59\";\n crossDay = true;\n jamMelebihiOneDay = jamMelebihiOneDay + tambahanBolehABs;\n }\n\n// String dtManual=\"\";\n// if(dt.getHours()==0 || dt.getHours()+tambahanBolehABs>=23){\n// int idtManual = 24+tambahanBolehABs;\n// dtManual = idtManual+\":59:00\" ;\n// }else{\n// dt.setHours(dt.getHours()+tambahanBolehABs);\n// }\n\n String sql = \"SELECT * FROM \" + PstScheduleSymbol.TBL_HR_SCHEDULE_SYMBOL\n + \" WHERE \\\"00:00:00\\\" <=\" + PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_OUT]\n + \" AND \" + PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_IN] + \"<= \\\"\"\n + \"23:59:00\"\n //+ (dtStart.getHours() == 0 || dtStart.getHours() == 23 || dtEnd.getHours() == 0 ? dtManual : Formater.formatDate(dtEnd, \"HH:mm:00\"))\n + \"\\\"\";\n //+ \" WHERE \" + \"(\"+PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_IN] +\" BETWEEN \\\"00:00:00\\\" AND \\\"\"+ (crossDay?dtManual:Formater.formatDate(dtStart, \"HH:mm:00\")) +\"\\\") OR (\"+PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_OUT] +\" BETWEEN \\\"00:00:00\\\" AND \\\"\"+Formater.formatDate(dtEnd, \"HH:mm:00\")+\"\\\")\";\n\n dbrs = DBHandler.execQueryResult(sql);\n ResultSet rs = dbrs.getResultSet();\n while (rs.next()) {\n dtEnd = new Date();\n dtEnd = new Date(dtEnd.getYear(), dtEnd.getMonth(), (dtEnd.getDate()), (dtEnd.getHours() + tambahanBolehABs), dtEnd.getMinutes(), dtEnd.getSeconds());\n \n Date schTimeIn = rs.getTime(PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_IN]);\n\n Date schTimeOut = rs.getTime(PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_TIME_OUT]);\n Date dtTmpSchTimeIn = new Date();\n Date dtTmpSchTimeOut = new Date();\n\n\n if (schTimeIn != null && schTimeOut != null) {\n schTimeOut = new Date(dtTmpSchTimeOut.getYear(), dtTmpSchTimeOut.getMonth(), dtTmpSchTimeOut.getDate(), schTimeOut.getHours(), schTimeOut.getMinutes());\n schTimeIn = new Date(dtTmpSchTimeIn.getYear(), dtTmpSchTimeIn.getMonth(), dtTmpSchTimeIn.getDate(), schTimeIn.getHours(), schTimeIn.getMinutes());\n\n Date dtCobaTimeOut = new Date(schTimeOut.getYear(), schTimeOut.getMonth(), (schTimeOut.getDate()), (schTimeOut.getHours() + tambahanBolehABs), schTimeOut.getMinutes(), schTimeOut.getSeconds());\n boolean melebihiHari=false;\n if (schTimeIn.getHours() == 0 || schTimeOut.getHours() == 0) {\n \n } else {\n if (dtCobaTimeOut.getDate() > schTimeIn.getDate()) {\n //dtEnd = new Date(dtEnd.getYear(), dtEnd.getMonth(), (dtEnd.getDate() + 1), (dtEnd.getHours()), dtEnd.getMinutes(), dtEnd.getSeconds());\n melebihiHari=true;\n }\n\n if ( (melebihiHari && dtEnd.getHours()<dtCobaTimeOut.getHours()) || schTimeIn.getTime() <= dtEnd.getTime() || (schTimeIn.getHours() > schTimeOut.getHours() && dtEnd.getTime() < schTimeOut.getTime())) {\n result = result + rs.getString(PstScheduleSymbol.fieldNames[PstScheduleSymbol.FLD_SCHEDULE_ID]) + \",\";\n }\n }\n\n\n\n\n\n }\n\n }\n if (result != null && result.length() > 0) {\n result = result.substring(0, result.length() - 1);\n }\n rs.close();\n return result;\n\n } catch (Exception e) {\n System.out.println(e);\n } finally {\n DBResultSet.close(dbrs);\n }\n return result;\n }", "java.util.List<com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight> \n getTransitFlightsList();", "public ArrayList<Schedule> getBuddiesSchedules() {\n\n return new ArrayList<Schedule>(buddies);\n }", "public static UseSchedule listActualUsage(Facility f)\n {\n return Database.db.get(f).getFacilityUse().getSchedule();\n }", "private void parseStopSchedule(JSONObject object) throws JSONException\n {\n String info = \"\";\n\n // Get Stop Information\n JSONObject stopObject = object.getJSONObject(\"stop\");\n info += \"Stop: \" + stopObject.getString(\"key\") + \" - \"\n + stopObject.getString(\"name\") + \"\\n\\n\";\n\n // Get route schedules\n JSONArray routeSchedulesArray = object.getJSONArray(\"route-schedules\");\n\n for (int i = 0; i < routeSchedulesArray.length(); i++)\n {\n JSONObject routeScheduleObj = routeSchedulesArray.getJSONObject(i);\n\n // Get route description\n JSONObject routeObj = routeScheduleObj.getJSONObject(\"route\");\n info += \"Route \" + routeObj.getString(\"number\") + \":\\n\";\n\n // Get schedule and estimated times\n JSONArray scheduledArray = routeScheduleObj.getJSONArray(\"scheduled-stops\");\n for (int j = 0; j < scheduledArray.length(); j++)\n {\n JSONObject scheduledObj = scheduledArray.getJSONObject(j);\n\n JSONObject variantObj = scheduledObj.getJSONObject(\"variant\");\n info += \" \" + variantObj.getString(\"name\") + \"\\n\";\n\n JSONObject arrivalObj = scheduledObj.getJSONObject(\"times\").getJSONObject(\"arrival\");\n info += \" Scheduled: \" + extractHourMinute(arrivalObj.getString(\"scheduled\")) + \"\\n\";\n info += \" Estimated: \" + extractHourMinute(arrivalObj.getString(\"estimated\")) + \"\\n\\n\";\n }\n }\n\n TextView tvSchedule = (TextView) findViewById(R.id.tvSchedule);\n tvSchedule.setText(info);\n }", "private void loadScheduleList() {\n\n if (listTbagendamentos != null && !listTbagendamentos.isEmpty()) {\n scheduleAgendamento.clear();\n\n for (Tbagendamento agendamento : listTbagendamentos) {\n DefaultScheduleEvent defaultScheduleEvent = new DefaultScheduleEvent();\n defaultScheduleEvent.setTitle(agendamento.getIdcliente().getNmcliente());\n\n Calendar dtDataInicial = new GregorianCalendar();\n dtDataInicial.setTime(agendamento.getTmdataagendamento());\n\n defaultScheduleEvent.setStartDate(dtDataInicial.getTime());\n\n Calendar dtDataFinal = new GregorianCalendar();\n dtDataFinal.setTime(agendamento.getTmdataagendamento());\n dtDataFinal.set(Calendar.MINUTE, dtDataFinal.get(Calendar.MINUTE) + 30);\n\n defaultScheduleEvent.setEndDate(dtDataFinal.getTime());\n defaultScheduleEvent.setData(agendamento.getIdagendamento());\n scheduleAgendamento.addEvent(defaultScheduleEvent);\n }\n }\n }", "Schedule createSchedule();", "io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling getScheduling();", "com.google.cloud.gkebackup.v1.BackupPlan.Schedule getBackupSchedule();", "public List<String> getWeekSchedule() {\n\t\tList<String> schedule = new ArrayList<String>();\n\t\tfor (DelegatedWork dw: this.delegatedWork) {\n\t\t\tActivity currentActivity = dw.getActivity();\n\t\t\tint totalRegHours = 0;\n\t\t\tfor (RegisteredWork rw: this.registeredWork) {\n\t\t\t\tif (rw.getActivity().equals(currentActivity)) {\n\t\t\t\t\ttotalRegHours += rw.getHalfHoursWorked();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotalRegHours /= 2;\n\t\t\tschedule.add(currentActivity.getName() + \": \" + totalRegHours + \"/\" + dw.getHalfHoursWorked()/2);\n\t\t}\n\t\treturn schedule;\n\t}", "Double getScheduleDuration();", "@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}", "public ArrayList<Activity> getGolfSchedule(int tripId,ActivityType activityType) throws Exception;", "public List<ScheduleInfo> searchForSchedules(@WebParam(name = \"criteria\") QueryByCriteria criteria,\n @WebParam(name = \"contextInfo\") ContextInfo contextInfo)\n throws InvalidParameterException,\n MissingParameterException,\n OperationFailedException,\n PermissionDeniedException;", "public ApiSchedule[] getSchedules() {\n return this.schedules;\n }", "public List<Schedule> getScheduleForEmployee(long employeeId) {\n Employee employee = employeeRepository.findEmployeeById(employeeId);\n if(employee == null) {\n return Collections.emptyList();\n }\n return employee.getSchedules();\n }", "public List<Timetable> getListSearch(String from, String to) throws Exception;", "public static List<Schedule> fetchGeneratedSchedules() {\r\n if (!isComplete()) {\r\n return null;\r\n }\r\n\r\n return generatedSchedules;\r\n }", "public Schedule(List<Integer> SprinklerIDs,int timeOfDay, int minute, int duration, List<Integer> daysOfWeek) {\n\t\tsuper();\n\t\tTimeOfDay = timeOfDay;\n\t\tMinute = minute;\n\t\tDuration = duration;\n\t\tDaysOfWeek = daysOfWeek;\n\t\tSprinklerIDs = SprinklerIDs;\n\t\tType=ScheduleType.TIMED;\n\t}", "public List<ScheduleDisplayInfo> searchForScheduleDisplays(@WebParam(name = \"criteria\") QueryByCriteria criteria,\n @WebParam(name = \"contextInfo\") ContextInfo contextInfo)\n throws InvalidParameterException,\n MissingParameterException,\n OperationFailedException,\n PermissionDeniedException;", "public String GetContactSchedules(List<AppointmentModel> appointments, List<ContactModel> contacts,\n LocalizationService localizationService, Locale locale) throws Exception\n {\n String report = startEndReport + startEndReport;\n String ID = localizationService.GetLocalizedMessage(\"ID\", locale);\n String title = localizationService.GetLocalizedMessage(\"title\", locale);\n String type = localizationService.GetLocalizedMessage(\"type\", locale);\n String description = localizationService.GetLocalizedMessage(\"description\", locale);\n String startDateTime = localizationService.GetLocalizedMessage(\"startdate\", locale);\n String endDateTime = localizationService.GetLocalizedMessage(\"enddate\", locale);\n String customerID = localizationService.GetLocalizedMessage(\"customerID\", locale);\n\n String header = \"\\n\" + ID + \"\\t\\t\" + customerID + \"\\t\" + title + \"\\t\\t\\t\" + type + \"\\t\\t\" + startDateTime + \"\\t\\t\\t\\t\" +\n endDateTime + \"\\t\\t\\t\" + description + \"\\n\";\n\n for (ContactModel contact : contacts)\n {\n report += \"\\n\" + contact.getContactName() + \"\\n\";\n report += header;\n\n List<AppointmentModel> contactAppointments = appointments.stream().filter(x ->\n x.getContactID() == contact.getContactID()).\n collect(Collectors.toList());\n\n for (AppointmentModel appointment : contactAppointments)\n {\n report += \"\\n\" + appointment.getAppointmentID() + \"\\t\\t\" + appointment.getCustomerID() + \"\\t\\t\\t\" + appointment.getTitle() + \"\\t\\t\" +\n appointment.getAppointmentType().toString() + \"\\t\" +\n appointment.getFormattedLocalStartDate() + \"\\t\\t\" + appointment.getFormattedLocalEndDate() + \"\\t\\t\" + appointment.getDescription() + \"\\n\";\n }\n }\n report += startEndReport + startEndReport;\n return report;\n }", "void setSchedule(java.lang.String schedule);", "public Schedule getScheduleForSelectedStopAndRoute(String route, int direction, int stopId){\n Schedule selectedStopSchedule = new Schedule();\r\n // Fetch the route id given the route\r\n Cursor getData = getReadableDatabase().rawQuery(\"select _id from routes where route_long_name = '\" + route + \"'\", null);\r\n // Make sure to begin at the first element of the returned data\r\n getData.moveToFirst();\r\n // Store the Route Id\r\n int route_id = getData.getInt(0);\r\n // Calendar id: (90400,90448) - Monday To Friday\r\n final String query = \"select Routes.Route_long_Name, \" +\r\n \"Calendar._Id, Stops.Stop_Name, Stop_Times.Stop_Sequence, Stop_Times.Arrival_Time, routes.route_short_name \" +\r\n \"from Trips join Calendar on Trips.Service_Id=Calendar._Id \" +\r\n \"join Routes on Trips.Route_Id=Routes._Id \" +\r\n \"join Stop_Times on Trips._Id=Stop_Times.Trip_Id \" +\r\n \"join Stops on Stop_Times.Stop_Id=Stops._Id \" +\r\n \"where Calendar._Id in \" + getDayOfTheWeek() + \" \" +\r\n \"AND Trips.Route_Id = \" + route_id + \" \" +\r\n \"AND Trips.Direction_Id = \" + direction + \" \" +\r\n \"AND Stop_Times.Arrival_Time != '' \" +\r\n \"AND stops._id = \" + stopId + \" \" +\r\n \"order by arrival_time asc\";\r\n getData.moveToFirst();\r\n getData = getReadableDatabase().rawQuery(query, null);\r\n while (getData.moveToNext()){\r\n selectedStopSchedule.insertData(getData.getString(0), getData.getInt(1), getData.getString(2), getData.getInt(3)\r\n , getData.getString(4), getData.getString(5));\r\n }\r\n return selectedStopSchedule;\r\n }", "public static List<String> getAllStartTime(String data) throws SQLException\n {\n \tList<String> all_time = new ArrayList<String>();\n \tResultSet time;\n \tif(data.charAt(0) == 'M')\n \t\ttime = test.readDatabase(\"select distinct Begin_Time from class_2016 where Term_Code = '\"+test.getLatestSemester()+\"' and Monday_Ind1 = 'M' and Wednesday_Ind1 = 'W'and Friday_Ind1 = 'F' and Begin_Time >= 800 and Begin_Time <= 1700 order by Begin_Time\");\n \telse\n \t\ttime = test.readDatabase(\"select distinct Begin_Time from class_2016 where Term_Code = '\"+test.getLatestSemester()+\"' and Tuesday_Ind1 = 'T' and Thursday_Ind1 = 'R' and Begin_Time >= 800 and Begin_Time <= 1700 and (End_Time - Begin_Time) = 120 order by Begin_Time\");\n\t\tall_time = test.writeResultSet(time,\"Begin_Time\");\n \treturn all_time;\n\n }", "com.google.cloud.compute.v1.Scheduling getScheduling();", "@Override\r\n\tpublic String toString() {\t\r\n\t\treturn String.format(\" Bus number \" + busNo + \"********************\" + \"%n\"\r\n\t\t\t\t+ \" Last Stop = \" + (lastStop+1) + \"%n\"\r\n\t\t\t\t+ \" Next Stop = \" + (nextStop+1) + \"%n\" +\r\n\t\t\t\t \" Last Stop Arrival time = \" + lastStopArrivalTime + \"%n\" \r\n\t\t\t\t+ \" Bus At Stop = \" + busAtStop\r\n\t\t\t\t );\r\n\t\t\r\n\t}", "TimerSchedule createTimerSchedule();", "@Path(\"/schedule\")\n @POST\n public Response scheduleStorageReport(@QueryParam(\"startTime\")\n long startTime,\n @QueryParam(\"frequency\")\n long frequency){\n log.debug(\"Scheduling a storage report series\");\n\n try {\n String responseText =\n resource.scheduleStorageReport(startTime, frequency);\n return responseOk(responseText);\n } catch (InvalidScheduleException e) {\n return responseBadRequest(e);\n } catch (Exception e) {\n return responseBad(e);\n }\n }", "public List<WorkoutSchedule> getSchedules() {\n if (schedules == null) {\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n WorkoutScheduleDao targetDao = daoSession.getWorkoutScheduleDao();\n List<WorkoutSchedule> schedulesNew = targetDao._queryWorkout_Schedules(id);\n synchronized (this) {\n if(schedules == null) {\n schedules = schedulesNew;\n }\n }\n }\n return schedules;\n }", "public String eventList() {\n\n\t\tString str = \"\";\n\t\tif(map.isEmpty()) {\n\t\t\tstr = \"No Events Scheduled Yet\";\n\t\t\treturn str;\n\t\t}\n\t\tstr = \"One Time Events: \\n\";\n\t\tstr = str + \"________________ \\n2020\\n\";\n\n\t\tfor(Map.Entry<LocalDate, ArrayList<Event>> entry: map.entrySet() ) {\n\n\t\t\tLocalDate currentDate = entry.getKey();\n\t\t\tArrayList<Event> list = map.get(currentDate);\n\t\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"EEEE MMMM dd\");\n\t\t\tDateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(\"HH:mm a\");\n\t\t\tfor(int i = 0;i<list.size();i++) {\n\t\t\t\tEvent e = list.get(i);\n\t\t\t\tif(e.recurring == false) {\n\t\t\t\t\tstr = str + \" \"+formatter.format(currentDate) +\" \" + timeFormatter.format(e.sTime) + \" - \" + timeFormatter.format(e.eTime) + \" \" + e.name + \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//for recurring events, add this later\n\t\t/*\n\t\tstr = str + \"\\nRecurring Events:\\n\";\n\t\tstr = str + \"________________ \\n\";\n\t\tif(recurringEvents.size()==0) {\n\t\t\tstr = str + \"No Recurring Event Scheduled\\n\";\n\t\t\treturn str;\n\t\t}\n\t\tfor(int i = 0; i<recurringEvents.size(); i++) {\n\t\t\tEvent e = recurringEvents.get(i);\n\t\t\tstr = str + e.name +\"\\n\";\n\t\t\tstr = str + e.rdays + \" \" + e.sTime + \" \" + e.eTime + \" \" + e.recurringStartDate + \" \" + e.eDate +\"\\n\";\n\t\t}\n\t\t */\n\t\treturn str;\n\n\t}", "ScheduledEvents getScheduledEvents();", "private List<RouteInfo> createList() {\r\n\r\n List<RouteInfo> results = new ArrayList<>();\r\n\r\n for (String temp [] : stops) {\r\n\r\n RouteInfo info = new RouteInfo();\r\n info.setTitle(temp[0]);\r\n info.setRouteName(\"Stop ID: \" + temp[1]);\r\n info.setRouteDescription(\"Next bus at: \");\r\n results.add(info);\r\n }\r\n\r\n return results;\r\n }", "public List<XeBusDTO> getBusByTT(Integer TT) {\n String sql = \"select * from xe_bus where TT = ?;\";\n Object[] params = {TT};\n return jdbcTemplate.query(sql, new XeBusDTOMapper(), params);\n }", "java.lang.String getArrivalTime();", "java.lang.String getArrivalTime();", "public List<String> getScheduledDates() {\n if (_schedDates == null) {\n return Collections.emptyList();\n }\n return Collections.unmodifiableList(_schedDates);\n }", "List<Schedule> selectByExample(ScheduleCriteria example);", "public void generateSchedule(){\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\"); // Date formatter used when getting SQL records\r\n Database db = new Database();\r\n Connection connection = null;\r\n String sql = \"\";\r\n String report = \"\";\r\n \r\n // Retrieve the inputted consultant's id\r\n User user = (User) combo_user.getValue();\r\n int userID = user.getId();\r\n try{\r\n connection = db.jdbc_connection.connect();\r\n Statement statement = connection.createStatement(); // Set up statement\r\n \r\n sql = \"SELECT appointment.appointmentID, customer.customerName, appointment.title, appointment.description, appointment.location, appointment.contact, \" +\r\n \"appointment.type, appointment.url, appointment.start, appointment.end FROM appointment \" +\r\n \"INNER JOIN customer ON appointment.customerID=customer.customerID \" +\r\n \"WHERE userID = \" + userID + \" GROUP BY appointment.start\"; \r\n ResultSet results = statement.executeQuery(sql); \r\n \r\n while(results.next()) { \r\n String customer = results.getString(\"customerName\");\r\n String title = results.getString(\"title\");\r\n String description = results.getString(\"description\");\r\n String location = results.getString(\"location\");\r\n String contact = results.getString(\"contact\");\r\n String type = results.getString(\"type\");\r\n String url = results.getString(\"url\");\r\n String start = results.getString(\"start\");\r\n String end = results.getString(\"end\");\r\n \r\n \r\n // Convert the start and end DATETIMES to the user's current timezone \r\n java.time.LocalDateTime start_converted = convertToCurrentZone(java.time.LocalDateTime.parse(start.replace(\".0\", \"\"), formatter));\r\n String month = start_converted.getMonth().toString();\r\n int day = start_converted.getDayOfMonth();\r\n int hour = start_converted.getHour();\r\n String minute = String.valueOf(start_converted.getMinute());\r\n \r\n if(minute.length() == 1) minute += \"0\"; // Add following zeroes\r\n \r\n report += month + \" \" + day + \" at \" + hour + \":\" + minute + \" - appointment with \" + customer + \"\\n\";\r\n } \r\n }catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }finally {\r\n try {\r\n connection.close();\r\n } catch (Exception e2) { // Closing databse error handling\r\n System.err.println(e2.getMessage());\r\n }\r\n } \r\n \r\n text_schedule.setText(report);\r\n }", "@Override\n public List<SurveillantSchedule> getSurveillantSchedule() {\n return surveillantRepository.getSurveillantSchedule();\n }", "public List<Bus> getAllBus() {\n\t\treturn busRepository.findAll();\n\t}", "public static java.util.List<com.services.model.BusRoute> findByStartLocation(\n\t\tlong startLocation)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence().findByStartLocation(startLocation);\n\t}", "public interface ScheduleService {\n BasicSchedule getBasicScheduleByHostelIdAndRoomType(long hostelId, RoomType type);\n\n /**\n * 获得最近一年的酒店基本计划\n *\n * @param hostelId\n * @return\n */\n List<BasicSchedule> getBasisSchedulesByHostelId(long hostelId);\n\n void modifyBasisSchedule(BasicSchedule basicSchedule);\n\n /**\n * 获得最近一年的酒店特殊计划\n *\n * @param hostelId\n * @return\n */\n List<SpecialSchedule> getSpecialScheduleByHostelId(long hostelId);\n\n void modifySpecialSchedule(SpecialSchedule specialSchedule);\n\n void addSpecialSchedule(SpecialSchedule specialSchedule);\n\n void deleteSpecialSchedule(SpecialSchedule specialSchedule);\n\n SpecialSchedule getSpecialSchedule(long hostelId, RoomType roomType, Date date);\n}", "public Schedule getSchedule() {\n\n return schedule;\n }", "public void setList(ScheduleInterface<Schedule> scheduleList){\n this.scheduleList = scheduleList;\n }", "public ArrayList<TrainScheduleEntity> viewTrainSchedule(String dayType);", "public List<String> getScheduleIdsByType(@WebParam(name = \"scheduleTypeKey\") String scheduleTypeKey,\n @WebParam(name = \"contextInfo\") ContextInfo contextInfo)\n throws InvalidParameterException,\n MissingParameterException,\n OperationFailedException,\n PermissionDeniedException;", "public Schedule getSchedule() {\r\n\t\treturn schedule;\r\n\t}", "public List<LocalDateTime> getAllTimes() {\n\t\tList<LocalDateTime> allTimes = new ArrayList<LocalDateTime>();\n\t\tallTimes.add(shiftStartTime);\n\t\tallTimes.add(bedtime);\n\t\tallTimes.add(shiftEndTime);\n\t\treturn allTimes;\n\t}", "private void displayRoutesList() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tlistOfBus = new ArrayList<Bus>();\r\n\t\taBusStop = new BusStop();\r\n\r\n\t\tStrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()\r\n\t\t\t\t.permitAll().build();\r\n\t\tStrictMode.setThreadPolicy(policy);\r\n\r\n\t\tnew LoadRoutesTask().execute();\t\r\n\t\t/* getBusRoutes();\r\n\t\t \r\n\t\t TextView searchTitle = (TextView) findViewById(R.id.searchPageTitle);\r\n\t\t\tsearchTitle.setText(aBusStop.getStopName() + \" (\"\r\n\t\t\t\t\t+ aBusStop.getStopCode() + \")\");\r\n\t\t\tboxAdapter = new ListAdapter(self, listOfBus);\r\n\t\t\tListView lvMain = (ListView) findViewById(R.id.lvMain);\r\n\t\t\tlvMain.setAdapter(boxAdapter);*/\r\n\t}", "public List<TaskMaster> retrieveTasksForIntervalById(long userId, Calendar startTime, Calendar endTime);", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/schedulers\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<SchedulerList, Scheduler> listScheduler();", "@Override\r\n\tpublic ArrayList<Board1> getByTime(String startTime) {\n\t\treturn dao.selectByTime(startTime);\r\n\t}", "public Collection<TimeRange> getAvailableTimes(List<TimeRange> unavailableTimes, long requestDuration) {\n int startTime = TimeRange.START_OF_DAY;\n Collections.sort(unavailableTimes, TimeRange.ORDER_BY_START);\n Collection<TimeRange> availableTimes = new ArrayList<>();\n \n for(TimeRange unavailableTime : unavailableTimes) {\n if(startTime < unavailableTime.start()) {\n TimeRange availableTime = TimeRange.fromStartEnd(startTime, unavailableTime.start(), false);\n if(availableTime.duration() >= requestDuration){\n availableTimes.add(availableTime);\n }\n }\n if(unavailableTime.end() > startTime){\n startTime = unavailableTime.end();\n }\n }\n\n if(startTime != TimeRange.END_OF_DAY+1){\n availableTimes.add(TimeRange.fromStartEnd(startTime, TimeRange.END_OF_DAY, true));\n }\n \n return availableTimes;\n }", "public ScheduleType getScheduleType();", "public List<TimeSlotInfo> getTimeSlotsByDaysAndStartTime(@WebParam(name = \"timeSlotTypeKey\") String timeSlotTypeKey,\n @WebParam(name = \"daysOfWeek\") List<Integer> daysOfWeek,\n @WebParam(name = \"startTime\") TimeOfDayInfo startTime,\n @WebParam(name = \"contextInfo\") ContextInfo contextInfo)\n throws InvalidParameterException,\n MissingParameterException,\n OperationFailedException,\n PermissionDeniedException;", "public static java.util.List<com.services.model.BusRoute> findByStartAndEndLocation(\n\t\tlong startLocation, long endLocation)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getPersistence()\n\t\t\t\t .findByStartAndEndLocation(startLocation, endLocation);\n\t}", "ObservableList<EndTime> getEndTimeList();", "public void setSchedule(String timeframe) {\n\t\t\n\t}", "public static String[] getSchedule(final Object obj) {\n\t\tTasklet annot = obj.getClass().getAnnotation(Tasklet.class);\n\t\tString[] effectiveSchedDefs = null;\n\n\t\tif (annot != null) {\n\t\t\tString[] schedDefs = annot.schedule();\n\n\t\t\tfor (String schedDef : schedDefs) {\n\t\t\t\tif (!schedDef.equals(\"\")) {\n\t\t\t\t\teffectiveSchedDefs = schedDefs;\n\t\t\t\t\tif (schedDef.equals(\"dynamic\")) {\n\t\t\t\t\t\tTasklet.Interface ti = (Interface) obj;\n\t\t\t\t\t\teffectiveSchedDefs = ti.getDynamicSchedule();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn effectiveSchedDefs;\n\t}", "private void generateCheckInTimes() throws ParseException {\n \n int numToGen = (Integer)occurSpinner.getValue();\n SimpleDateFormat aSdf = Constants.CHECKIN_DATE_FORMAT;\n DefaultListModel theModel = (DefaultListModel)checkInTimeList.getModel();\n \n //Get the white listed times\n int startHour = (Integer)startHourSpinner.getValue();\n int startMinute = (Integer)startMinSpinner.getValue(); \n int endHour = (Integer)endHourSpinner.getValue(); \n int endMinute = (Integer)endMinSpinner.getValue(); \n \n //Convert to absolute times\n int startTime = startHour * 60 + startMinute;\n int endTime = endHour * 60 + endMinute;\n \n //Get the frequency\n TimeFreq freqObj = (TimeFreq)freqCombo.getSelectedItem();\n \n //Get the current date\n Calendar theCalendar = Calendar.getInstance();\n Date currentDate;\n if( theModel.isEmpty() ){\n currentDate = new Date();\n } else {\n String currentDateStr = (String)theModel.get( theModel.size() - 1 ); \n currentDate = Constants.CHECKIN_DATE_FORMAT.parse(currentDateStr);\n }\n \n //Set the time\n theCalendar.setTime( currentDate ); \n \n //If the freq is hourly then make sure the start time is after the current time\n int theFreq = freqObj.getType(); \n if( theFreq != TimeFreq.HOURLY ){\n \n //Calculate the range\n int range;\n if( endTime >= startTime ){\n\n range = endTime - startTime;\n\n } else {\n\n //If the start time is greater than the stop time then the range is\n //start to max and min to end\n range = maximumTime - startTime;\n range += endTime;\n\n }\n\n //Generate some dates\n for( int i = 0; i < numToGen; i++ ){\n\n //Get the random num\n float rand = aSR.nextFloat();\n int theRand = (int)(rand * range);\n\n //Get the new absolute time\n int newTime = theRand + startTime;\n if( newTime > maximumTime )\n newTime -= maximumTime;\n \n //Convert to hour and second\n int newHour = newTime / 60;\n int newMin = newTime % 60; \n\n //Everything but hourly\n theCalendar.set( Calendar.HOUR_OF_DAY, newHour);\n theCalendar.set( Calendar.MINUTE, newMin);\n theCalendar.add( theFreq, 1);\n \n //Add the time\n String aDate = aSdf.format( theCalendar.getTimeInMillis());\n theModel.addElement(aDate);\n }\n \n } else {\n \n int currHour = theCalendar.get( Calendar.HOUR_OF_DAY );\n int currSecond = theCalendar.get( Calendar.MINUTE );\n \n int currTime = currHour * 60 + currSecond;\n \n //Go to the next day\n //Generate some dates\n for( int i = 0; i < numToGen; i++ ){\n \n //Get the random num\n float rand = aSR.nextFloat();\n int theRand = (int)(rand * 30);\n\n if( currTime + 60 > endTime ){\n theCalendar.add( Calendar.DAY_OF_YEAR, 1);\n theCalendar.set( Calendar.HOUR_OF_DAY, startHour);\n theCalendar.set( Calendar.MINUTE, startMinute);\n } else {\n theCalendar.add( theFreq, 1); \n theCalendar.add( Calendar.MINUTE, theRand );\n }\n \n \n //Add the time\n String aDate = aSdf.format( theCalendar.getTimeInMillis());\n theModel.addElement(aDate);\n\n //Update time\n currHour = theCalendar.get( Calendar.HOUR_OF_DAY );\n currSecond = theCalendar.get( Calendar.MINUTE );\n currTime = currHour * 60 + currSecond;\n \n }\n } \n \n \n \n }", "public List<TimeSpan> getRequestedTimes()\r\n {\r\n return myRequestedTimes;\r\n }", "List<String> getBuses(String src, String dest, String date);", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/schedulers\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<SchedulerList, Scheduler> listScheduler(\n @QueryMap ListScheduler queryParameters);", "private List<String> calculateCombinations(TimeBean obj) {\r\n\t\tList<String> listTimeComb = new ArrayList<String>();\r\n\r\n\t\twhile(obj.getStartHr() <= obj.getEndHr()) {\r\n\t\t\t//If Hr is not 2 digit then pass to next cycle till end time\r\n\t\t\tif(obj.getStartHr() < 10 && obj.getStartHr()!=0) {\r\n\t\t\t\tTimeUtil.incrementHr(obj);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If both end time and start time is 00\r\n\t\t\tif(obj.getStartHr() == 0 && obj.getEndHr() == 0){\r\n\t\t\t\t\r\n\t\t\t\tif(obj.getStartMin()<10) {\r\n\t\t\t\t\tTimeUtil.incrementMin(obj);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(obj.getStartMin() < obj.getEndMin() ) {\r\n\t\t\t\t\tlistTimeComb.add(\"00:\"+obj.getStartMin()+\":\"+obj.getStartMin());\r\n\t\t\t\t\tTimeUtil.incrementMin(obj);\r\n\t\t\t\t}else if(obj.getStartMin() == obj.getEndMin() && obj.getEndMin() <= obj.getEndSec()) {\r\n\t\t\t\t\tlistTimeComb.add(\"00:\"+obj.getStartMin()+\":\"+obj.getStartMin());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t //If start time is zero but end time is not zero\t\r\n\t\t\t}else if(obj.getStartHr() == 0 && obj.getEndHr()!= 0){\r\n\t\t\t\t\r\n\t\t\t\tif(obj.getStartMin()<10) {\r\n\t\t\t\t\tTimeUtil.incrementMin(obj);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(obj.getStartMin() >= obj.getStartSec()) {\r\n\t\t\t\t\tlistTimeComb.add(\"00:\"+obj.getStartMin()+\":\"+obj.getStartMin());\r\n\t\t\t\t\tTimeUtil.incrementMin(obj);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//Both start Hr and end Hr is same. (Last condition check)\r\n\t\t\t}else if(obj.getStartHr()==obj.getEndHr()) {\r\n\t\t\t\tcheckCombinationWhenHrAreEqual(obj, listTimeComb);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t//Check rest of the combination\t\r\n\t\t\t}else{\r\n\t\t\t\tcheckCombinationWhenHrNotEqual(obj, listTimeComb);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn listTimeComb;\r\n\t}", "@Override\n\t\tpublic List<ProgramScheduledBean> getAllScheduleProgram()\n\t\t\t\tthrows UniversityException {\n\t\t\treturn dao.getAllScheduleProgram();\n\t\t}", "private ArrayList<String> getRecurringEvents(long eventID,\n\t\t\tlong startMillis, long endMillis) {\n\n\t\tArrayList<String> eventList = new ArrayList<String>();\n\n\t\tfinal String[] INSTANCE_PROJECTION = new String[] { Instances.EVENT_ID, // 0\n\t\t\t\tInstances.BEGIN, // 1\n\t\t\t\tInstances.TITLE // 2\n\t\t};\n\n\t\t// The indices for the projection array above.\n\t\tfinal int PROJECTION_ID_INDEX = 0;\n\t\tfinal int PROJECTION_BEGIN_INDEX = 1;\n\t\tfinal int PROJECTION_TITLE_INDEX = 2;\n\n\t\tCursor cur = null;\n\t\tContentResolver cr = getContentResolver();\n\n\t\t// The ID of the recurring event whose instances you are searching\n\t\t// for in the Instances table\n\t\tString selection = Instances.EVENT_ID + \" = ?\";\n\t\tString[] selectionArgs = new String[] { \"\" + eventID };\n\n\t\t// Construct the query with the desired date range.\n\t\tUri.Builder builder = Instances.CONTENT_URI.buildUpon();\n\t\tContentUris.appendId(builder, startMillis);\n\t\tContentUris.appendId(builder, endMillis);\n\n\t\t// Submit the query\n\t\tcur = cr.query(builder.build(), INSTANCE_PROJECTION, selection,\n\t\t\t\tselectionArgs, null);\n\n\t\twhile (cur.moveToNext()) {\n\t\t\tString title = null;\n\n\t\t\t// Get the field values\n\t\t\ttitle = cur.getString(PROJECTION_TITLE_INDEX);\n\n\t\t\teventList.add(title);\n\t\t}\n\n\t\treturn eventList;\n\t}", "public ArrayList getStops(String route, int direction){\r\n // Will hold all the stops returned from query\r\n ArrayList stopDataList = new ArrayList();\r\n Cursor getData = getReadableDatabase().rawQuery(\"select _id from routes where route_long_name = '\" + route + \"'\", null);\r\n // Make sure to begin at the first element of the returned data\r\n getData.moveToFirst();\r\n int route_id = getData.getInt(0);\r\n final String query = \"select distinct Stops.Stop_Name \" +\r\n \"from Trips join \" +\r\n \"Calendar on Trips.Service_Id=Calendar._Id join \" +\r\n \"Routes on Trips.Route_Id=Routes._Id join \" +\r\n \"Stop_Times on Trips._Id=Stop_Times.Trip_Id JOIN \" +\r\n \"Stops on Stop_Times.Stop_Id=Stops._Id \" +\r\n \"where Calendar._Id in \" + getDayOfTheWeek() + \" \" +\r\n \"AND Trips.Route_Id= \" + route_id + \" \" +\r\n \"AND Stop_Times.Arrival_Time != '' \" +\r\n \"AND direction_id = \" + direction;\r\n getData.moveToFirst();\r\n getData = getReadableDatabase().rawQuery(query, null);\r\n // the data count is 0 when a route is not in service on a particular day\r\n if(getData.getCount() == 0){\r\n stopDataList.add(\"No Stops Available Today For This Route\");\r\n return stopDataList;\r\n }else{\r\n while (getData.moveToNext()){\r\n stopDataList.add(getData.getString(0));\r\n }\r\n }\r\n\r\n getData.close();\r\n\r\n return stopDataList;\r\n }", "public ProgramScheduled getProgramScheduleById(int scheduleId);", "public static List<FacilityFreeSchedule> generateFacilitiesFreeSchedules(List<Facility> facilities) {\n List<FacilityFreeSchedule> facilitiesFreeSchedules=new ArrayList<>();\n facilities.stream().forEach(facility-> facilitiesFreeSchedules.addAll(generateFacilityFreeSchedules(facility)));\n return facilitiesFreeSchedules;\n }", "abstract public void computeSchedule();" ]
[ "0.61743087", "0.56702244", "0.56467557", "0.55969167", "0.55790037", "0.55573046", "0.55182934", "0.548158", "0.54597104", "0.5427219", "0.5414575", "0.53855413", "0.5366925", "0.53614765", "0.5352677", "0.5327351", "0.5322732", "0.5321569", "0.53041756", "0.5299536", "0.52877575", "0.5250745", "0.5244353", "0.52428067", "0.52335984", "0.52094626", "0.5200437", "0.5180897", "0.51794916", "0.5169946", "0.5141329", "0.51343656", "0.5117801", "0.51063097", "0.5091426", "0.5071939", "0.5071491", "0.50560224", "0.5054064", "0.5041075", "0.50308293", "0.5005002", "0.5000258", "0.49879467", "0.49713728", "0.4968436", "0.4958888", "0.4920282", "0.49100837", "0.49072057", "0.49036494", "0.48816982", "0.48766962", "0.4875945", "0.4871555", "0.48662028", "0.48623487", "0.4861795", "0.48449165", "0.48277605", "0.48256314", "0.48187077", "0.4816835", "0.48144713", "0.48144713", "0.47975576", "0.47933576", "0.4793052", "0.47905242", "0.47841126", "0.47809392", "0.47801337", "0.4775765", "0.47673753", "0.4766145", "0.47570813", "0.47526798", "0.4744303", "0.47357646", "0.47316858", "0.47219378", "0.47199476", "0.47168073", "0.47103226", "0.47099257", "0.47018445", "0.47005528", "0.4699138", "0.46987635", "0.4697944", "0.4693853", "0.469179", "0.46909034", "0.46765608", "0.46639153", "0.46463117", "0.46396264", "0.46370387", "0.4635744", "0.46323988" ]
0.8831968
0
Created by user1 on 2/20/2017.
public interface ApiCallBack { void onSuccess(ApiResponse response); void onFailure(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Date getCreated()\n {\n return null;\n }", "public Date getDateCreated(){return DATE_CREATED;}", "CreationData creationData();", "public Date getCreationDate() {\n\n \n return creationDate;\n\n }", "public void create() {\n\t\t\n\t}", "private stendhal() {\n\t}", "public abstract long getCreated();", "@Override\r\n\tpublic Date getCreated_date() {\n\t\treturn super.getCreated_date();\r\n\t}", "public Date getCreateDate()\r\n/* */ {\r\n/* 158 */ return this.createDate;\r\n/* */ }", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n public void perish() {\n \n }", "public DateTime getCreationTime() {\n return created;\n }", "private static void oneUserExample()\t{\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "public DateTime getCreationTime() { return creationTime; }", "@Override\n public Date getCreated() {\n return created;\n }", "public Date getCreationTime()\n {\n return created;\n }", "private CreateDateUtils()\r\n\t{\r\n\t}", "UUID getCreatedUUID()\n {\n return conglomerateUUID;\n }", "public final void mo51373a() {\n }", "@Override\n public String getCreationDate() {\n return creationDate;\n }", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public Date getCreateTime()\n/* */ {\n/* 177 */ return this.createTime;\n/* */ }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@java.lang.Override\n public long getCreationDate() {\n return creationDate_;\n }", "@Override\n\tpublic long getCreationTime() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long getCreationTime() {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public Pitonyak_09_02() {\r\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private Person()\r\n\t{\r\n\t\tsuper();\r\n\t\t//created = LocalDateTime.now();\r\n\t\tcreated = Calendar.getInstance().getTime();\r\n\t}", "public void mo4359a() {\n }", "public static void created() {\n\t\t// TODO\n\t}", "public Date getCreation() {\n return creation;\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@java.lang.Override\n public long getCreationDate() {\n return creationDate_;\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "Long getUserCreated();", "public Date getCreationDate()\n {\n return creationDate;\n }", "public void mo12930a() {\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "public Date getCreated() {\n return created;\n }", "public Date getCreated() {\n return created;\n }", "public void mo1531a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public long getCreationDate() {\n return creationDate_;\n }", "Date getDateCreated();", "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 }", "@Test\n public void testGetCreationDate() {\n System.out.println(\"getCreationDate\");\n Comment instance = new Comment(\"Test Komment 2\", testCommentable, testAuthor);\n Date expResult = new Date();\n Date result = instance.getCreationDate();\n assertEquals(expResult.getTime(), result.getTime());\n }", "public Date getDateCreated()\n {\n return dateCreated;\n }", "private TMCourse() {\n\t}", "public void mo21877s() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public static void listing5_14() {\n }", "public int getCreated() {\n return created;\n }", "@Override\n\tpublic void initDate() {\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}", "public String toString() {\r\n \t\treturn \"\\\"\" + _name + \"\\\" by \" + _creator;\r\n \t}", "public void gored() {\n\t\t\n\t}", "public Date getDateCreated();", "Petunia() {\r\n\t\t}", "public Calendar getCreationDate() throws IOException {\n/* 238 */ return getCOSObject().getDate(COSName.CREATION_DATE);\n/* */ }", "public void mo55254a() {\n }", "public Account() {\n dateCreated = new java.util.Date();\n }", "public Account() {\n dateCreated = new java.util.Date();\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public Date getCreated() {\r\n return created;\r\n }", "public Date getCreated() {\r\n return created;\r\n }", "public Date getCreateDate() { return this.createDate; }", "@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }", "@Override\n public int getAmount() {\n return 1;\n }", "public int getnCreated() {\r\n return nCreated;\r\n }", "void setUserCreated(final Long userCreated);", "@DISPID(1001) //= 0x3e9. The runtime will prefer the VTID if present\r\n @VTID(8)\r\n int creator();", "@DISPID(1001) //= 0x3e9. The runtime will prefer the VTID if present\r\n @VTID(8)\r\n int creator();", "public void autoDetails() {\n\t\t\r\n\t}", "public String getDateCreated(){\n return dateCreated.toString();\n }", "@Override\n public void memoria() {\n \n }", "public String getCreated() {\n return this.created;\n }", "public String getCreated() {\n return this.created;\n }", "public abstract String getCreator();", "@Override\r\n\tpublic void billGenerate() {\n\t\t\r\n\t}", "public DateTime getCreated();", "private void getStatus() {\n\t\t\n\t}", "public Date getCreationTime() {\n return creationTime;\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public DateTime getCreatedDateTime() {\n return createdDateTime;\n }" ]
[ "0.5939395", "0.5738768", "0.56898224", "0.5649419", "0.5640232", "0.5601057", "0.55831254", "0.55749094", "0.5573677", "0.55662334", "0.5531503", "0.55246544", "0.55196196", "0.5509174", "0.5507058", "0.5506643", "0.5502224", "0.5492307", "0.54898965", "0.5465646", "0.54564434", "0.54487824", "0.5442448", "0.54331505", "0.5418304", "0.5409298", "0.5404725", "0.5400317", "0.53913236", "0.5389915", "0.5389915", "0.5383718", "0.53477156", "0.5345972", "0.53451395", "0.533849", "0.53237766", "0.5307682", "0.5307407", "0.53021467", "0.530116", "0.5293", "0.52916217", "0.5288321", "0.5286657", "0.52619785", "0.52571684", "0.5257044", "0.5257044", "0.5247992", "0.5244338", "0.5244301", "0.5238025", "0.5233613", "0.5233613", "0.5233613", "0.5233613", "0.5233613", "0.5233613", "0.5233613", "0.5229584", "0.5225766", "0.521407", "0.52013695", "0.51961106", "0.51949936", "0.5193474", "0.5186943", "0.51823926", "0.5178061", "0.5178061", "0.5177389", "0.5174059", "0.5173651", "0.51735264", "0.5167616", "0.51563454", "0.51517045", "0.51517045", "0.5150869", "0.5149135", "0.5149135", "0.51455504", "0.5142147", "0.51378363", "0.513616", "0.5134125", "0.51297", "0.51297", "0.5126559", "0.51245844", "0.51228666", "0.51207304", "0.51207304", "0.5114467", "0.5112067", "0.51103204", "0.5108694", "0.51070416", "0.51070416", "0.5106727" ]
0.0
-1
Constants used internally by the JIVE user interface, possibly across many classes.
public interface IInternalJiveUIConstants { /** * The prefix of all internal constants. */ public String INTERNAL_ID_PREFIX = "edu.buffalo.cse.jive.internal.ui"; /** * The folder ID of the <code>IFolderLayout</code> used to hold views * related to the current launches. */ public String LAUNCH_FOLDER_ID = INTERNAL_ID_PREFIX + ".launchFolder"; /** * The folder ID of the <code>IFolderLayout</code> used to hold views for * the console or other miscellaneous views. */ public String CONSOLE_FOLDER_ID = INTERNAL_ID_PREFIX + ".consoleFolder"; /** * The folder ID of the <code>IFolderLayout</code> used to hold views * related to the execution state of the active target. */ public String EXECUTION_STATE_FOLDER_ID = INTERNAL_ID_PREFIX + ".executionStateFolder"; /** * The folder ID of the <code>IFolderLayout</code> used to hold views * related to the execution history of the active target. */ public String EXECUTION_HISTORY_FOLDER_ID = INTERNAL_ID_PREFIX + ".executionHistoryFolder"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Constants {\n String PATH_SEPARATOR = \"/\";\n String ROOT_DIRECTORY_SYMBOL = \"/\";\n String COMMAND_OPTION_PREFIX = \"-\";\n String SESSION_CLEAR = \"session clear\";\n}", "public interface IssueConstants {\n static final String VIEW_ID = \"net.refractions.udig.issues.view.issues\"; //$NON-NLS-1$\n static final String ISSUES_LIST_EXTENSION_ID = \"net.refractions.udig.issues.issuesList\"; //$NON-NLS-1$\n static final String ISSUES_EXTENSION_ID = \"net.refractions.udig.issues.issue\"; //$NON-NLS-1$\n static final String EXTENSION_CLASS_ATTR = \"class\"; //$NON-NLS-1$\n\n}", "public interface Constants\n{\n\tString EMAIL = \"email\";\n\tString RECORD_ID = \"_id\";\n\tString ENTRY_DATE = \"entryDate\";\n\tString DATE_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssXXX\";\n\tString LEADS = \"leads\";\n}", "public interface UUCConstants {\n\t\n\n\tpublic String SERVICE_NAME = \"uuc.service.name\";\n\t\n\tpublic String SERVICE_ID = \"uuc.service.id\";\n\t\n\tpublic String SERVICE_URI = \"uuc.service.url\";\n\n\tpublic String USER_ID = \"uuc.user.id\";\n\t\n\tpublic String USER_NAME = \"uuc.user.name\";\n\t\n\tpublic String USER_EMAIL = \"uuc.user.email\";\n\t\n\tpublic String USER_GROUP=\"uuc.user.group\";\n\t\n\tpublic String USER_TITLE = \"uuc.user.title\";\n\t\n\tpublic String USER_LEVEL = \"uuc.user.level\";\n\t\n\tpublic String USER_PHOTO = \"uuc.user.photo\";\n\t\n\tpublic String USER_PHONE = \"uuc.user.phone\";\n\t\n\tpublic String USER_PASSWORD=\"uuc.user.password\";\n\t\n\tpublic String USER_EMPLOYEE_ID = \"uuc.user.employeeid\";\n}", "public interface SQL_CONSTANTS {\n\t\tstatic final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";\n\t\tstatic final String DB_URL = \"jdbc:mysql://localhost/EMP\";\n\t\tstatic final String USER = \"username\";\n\t\tstatic final String PASSWORD = \"password\";\n\t}", "public interface ITLCLaunchUIConstants \n{\n public final static String TAB_MAIN_NAME\t\t\t= \"Main\";\n public final static String TAB_ARGUMENTS_NAME\t\t\t= \"Arguments\";\n \n public final static String TAB_MAIN_ICON_NAME \t\t= \"icons/full/obj16/tlc_launch_main_tab.gif\";\n public final static String TAB_ARGUMENTS_ICON_NAME \t= \"icons/full/obj16/tlc_launch_arguments_tab.gif\";\n}", "public interface Constants {\n\n final public static String TAG = \"[PracticalTest02Var04]\";\n\n final public static boolean DEBUG = true;\n\n final public static String EMPTY_STRING = \"\";\n\n final public static String QUERY_ATTRIBUTE = \"query\";\n\n final public static String SCRIPT_TAG = \"script\";\n final public static String SEARCH_KEY = \"wui.api_data =\\n\";\n\n final public static String CURRENT_OBSERVATION = \"current_observation\";\n\n}", "public interface Constants {\n /**\n * String representation for the name of the preferences object storing\n * the Parabank connection settings.\n */\n String PREFS_PARABANK = \"parabankConnectionSettings\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the protocol for the HTTP requests.\n */\n @Deprecated\n String PREFS_PARABANK_PROTOCOL = \"protocol\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the host for the HTTP requests.\n */\n String PREFS_PARABANK_HOST = \"host\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the port for the HTTP requests.\n */\n String PREFS_PARABANK_PORT = \"port\";\n\n /**\n * String representation for key within the {@link android.content.Intent}\n * object which stores the {@link com.parabank.parasoft.app.android.adts.User}\n * object data.\n */\n String INTENT_USER = \"user\";\n String INTENT_PARABANK_URI = \"parabankConnection\";\n}", "public interface Constants {\r\n\r\n\tpublic final static int UP = 1000;\r\n\tpublic final static int DOWN = 1001;\r\n\tpublic final static int RIGHT = 1002;\r\n\tpublic final static int LEFT = 1003;\r\n\t\r\n\t\r\n\tpublic final static int EMPTY = 0;\r\n\tpublic final static int ROAD = 1;\r\n\tpublic final static int TOWER = 2;\r\n\tpublic final static int NPC = 3;\r\n\tpublic final static int NPC_GENERATOR = 4;\r\n\tpublic final static int CASTLE = 5;\r\n\tpublic final static int LANDSCAPE = 6;\r\n\t\r\n\tpublic final static int LANDSCAPE_TREE_1 = 61;\r\n\tpublic final static int LANDSCAPE_TREE_2 = 62;\r\n\tpublic final static int LANDSCAPE_TREE_3 = 63;\r\n\t\r\n\tpublic final static int FIELD_END = 7;\r\n\t\r\n}", "public interface ApplicationConstants {\n\n\t/**\n\t * SQL_CONSTANTS contains data base related properties\n\t * \n\t * @author prajwalnayak\n\t *\n\t */\n\tpublic interface SQL_CONSTANTS {\n\t\tstatic final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";\n\t\tstatic final String DB_URL = \"jdbc:mysql://localhost/EMP\";\n\t\tstatic final String USER = \"username\";\n\t\tstatic final String PASSWORD = \"password\";\n\t}\n}", "private ApplicationConstants(){\n\t\t//not do anything \n\t}", "public interface Constants {\n\t\n\t/** The Constant SPACE_CHAR of type Character of one empty space. */\n\tstatic final char SPACE_CHAR = ' ';\n\t\n\t/** The Constant LETTER_O of type Character which holds mark X. */\n\tstatic final char LETTER_O = 'O';\n\t\n\t/** The Constant LETTER_X of type Character which holds mark O. */\n\tstatic final char LETTER_X = 'X';\n}", "public interface Constants {\n\n String CURRENT_SCORE = \"CURRENT_SCORE\";\n\n String HIGH_SCORES = \"HIGH_SCORES\";\n\n String DB_WRITER = \"DB_WRITER\";\n\n String DB_READER = \"DB_READER\";\n\n String DB_HELPER = \"DB_HELPER\";\n\n\n}", "public interface JCConstants {\n /**\n *\n */\n public final static String[] OP_LEFT = new String[] {\n \"\", \"(\"};\n public final static String[] OP_COMPARE = new String[] {\n \"\", \" = \", \" > \", \" >= \", \" < \", \" <= \", \" <> \", \" LIKE \",\" 包含 \"};\n public final static String[] OP_RIGHT = new String[] {\n \"\", \")\"};\n public final static String[] OP_CONN = new String[] {\n \"\", \"并且\", \"或者\"};\n\n public static final String[] COL_NAMES = {\n \"左(\", \"比较项目\", \"比较符\", \"比较值\", \"右)\", \"连接符\"};\n\n public static final String FILE_NAME = \"wizard.xml\";\n public static final String COBJ_ROOT_NAME = \"BaseConditionObjects\";\n\n public static final int DEFAULT_ROW_HEIGHT = 20;\n\n public static final String COLUMN_NAME_PREFIX=\"Column_\";\n}", "public interface Constants {\n\tpublic interface Paths { \n\t\tfinal String ELASTIC_PUSH_CONTROLLER_PATH = \"/elastic\" ; \n\t\tfinal String SAVE_TRANSACTION = \"/save\"; \n\t\tfinal String SAVE_TARGETS = \"/saveTargets\";\n\t\tfinal String SAVE_FEEDBACK = \"/saveFeedback\"; \n\t\tfinal String SAVE_FEEDBACK_RESPONSE = \"/v1/saveFeedback\"; \n\t}\n\t\n\tpublic static String SUCCESS= \"success\";\n\tpublic static int UNAUTHORIZED_ID = 401;\n\tpublic static int SUCCESS_ID = 200;\n\tpublic static int FAILURE_ID = 320;\n\tpublic static String UNAUTHORIZED = \"Invalid credentials. Please try again.\";\n\tpublic static String PROCESS_FAIL = \"Process failed, Please try again.\";\n\n}", "private LabelUtilsConstants() {}", "private CommonUIConstants()\n {\n }", "public interface Constants {\n\n\t// /**\n\t// * Version string to identify library (e.g., in EXIficientGUI)\n\t// */\n\t// public static final String VERSION = \"1.0.0-SNAPSHOT\";\n\n\t/**\n\t * <p>\n\t * W3C EXI Namespace URI\n\t * </p>\n\t * \n\t * <p>\n\t * Defined to be \"<code>http://www.w3.org/2009/exi</code>\".\n\t */\n\tpublic static final String W3C_EXI_NS_URI = \"http://www.w3.org/2009/exi\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:base64Binary\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_BASE64BINARY = \"base64Binary\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:hexBinary\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_HEXBINARY = \"hexBinary\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:boolean\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_BOOLEAN = \"boolean\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:dateTime\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_DATETIME = \"dateTime\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:time\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_TIME = \"time\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:date\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_DATE = \"date\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:gYearMonth\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_GYEARMONTH = \"gYearMonth\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:gYear\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_GYEAR = \"gYear\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:gMonthDay\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_GMONTHDAY = \"gMonthDay\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:gDay\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_GDAY = \"gDay\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:gMonth\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_GMONTH = \"gMonth\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:decimal\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_DECIMAL = \"decimal\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:float and xsd:double\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_DOUBLE = \"double\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:integer\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_INTEGER = \"integer\";\n\n\t/**\n\t * <p>\n\t * W3C EXI local-name for datatype xsd:string, xsd:anySimpleType and all\n\t * types derived by union\n\t * </p>\n\t */\n\tpublic static final String W3C_EXI_LN_STRING = \"string\";\n\n\t/**\n\t * XML Reader feature\n\t */\n\tpublic static final String W3C_EXI_FEATURE_BODY_ONLY = \"http://www.w3.org/exi/features/exi-body-only\";\n\n\t/**\n\t * Initial Entries in String Table Partitions\n\t */\n\t/* \"\", empty string */\n\tpublic static final String[] PREFIXES_EMPTY = { \"\" };\n\tpublic static final String[] LOCAL_NAMES_EMPTY = {};\n\t/* \"http://www.w3.org/XML/1998/namespace\" */\n\tpublic static String[] PREFIXES_XML = { \"xml\" };\n\tpublic static String[] LOCAL_NAMES_XML = { \"base\", \"id\", \"lang\", \"space\" };\n\t/* \"http://www.w3.org/2001/XMLSchema-instance\", xsi */\n\tpublic static String[] PREFIXES_XSI = { \"xsi\" };\n\tpublic static String[] LOCAL_NAMES_XSI = { \"nil\", \"type\" };\n\t/* \"http://www.w3.org/2001/XMLSchema\", xsd */\n\tpublic static String[] PREFIXES_XSD = {};\n\tpublic static String[] LOCAL_NAMES_XSD = { \"ENTITIES\", \"ENTITY\", \"ID\",\n\t\t\t\"IDREF\", \"IDREFS\", \"NCName\", \"NMTOKEN\", \"NMTOKENS\", \"NOTATION\",\n\t\t\t\"Name\", \"QName\", \"anySimpleType\", \"anyType\", \"anyURI\",\n\t\t\t\"base64Binary\", \"boolean\", \"byte\", \"date\", \"dateTime\", \"decimal\",\n\t\t\t\"double\", \"duration\", \"float\", \"gDay\", \"gMonth\", \"gMonthDay\",\n\t\t\t\"gYear\", \"gYearMonth\", \"hexBinary\", \"int\", \"integer\", \"language\",\n\t\t\t\"long\", \"negativeInteger\", \"nonNegativeInteger\",\n\t\t\t\"nonPositiveInteger\", \"normalizedString\", \"positiveInteger\",\n\t\t\t\"short\", \"string\", \"time\", \"token\", \"unsignedByte\", \"unsignedInt\",\n\t\t\t\"unsignedLong\", \"unsignedShort\" };\n\n\t/**\n\t * \n\t */\n\tpublic static final String EMPTY_STRING = \"\";\n\t// public static final StringValue EMPTY_STRING_VALUE = new\n\t// StringValue(Constants.EMPTY_STRING);\n\n\tpublic static final String XSI_SCHEMA_LOCATION = \"schemaLocation\";\n\tpublic static final String XSI_NONAMESPACE_SCHEMA_LOCATION = \"noNamespaceSchemaLocation\";\n\n\tpublic static final String XML_NS_PREFIX = XMLConstants.XML_NS_PREFIX; // \"xml\"\n\tpublic static final String XML_NULL_NS_URI = XMLConstants.NULL_NS_URI; // \"\"\n\tpublic static final String XML_DEFAULT_NS_PREFIX = XMLConstants.DEFAULT_NS_PREFIX; // \"\"\n\tpublic static final String XML_NS_ATTRIBUTE_NS_URI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI; // \"http://www.w3.org/2000/xmlns/\"\n\tpublic static final String XML_NS_ATTRIBUTE = XMLConstants.XMLNS_ATTRIBUTE; // \"xmlns\"\n\tpublic static final String XML_NS_URI = XMLConstants.XML_NS_URI; // \"http://www.w3.org/XML/1998/namespace\"\n\tpublic static final String XML_SCHEMA_INSTANCE_NS_URI = XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI; // \"http://www.w3.org/2001/XMLSchema-instance\"\n\tpublic static final String XML_SCHEMA_NS_URI = XMLConstants.W3C_XML_SCHEMA_NS_URI; // \"http://www.w3.org/2001/XMLSchema\"\n\n\tpublic static final String XSI_PFX = \"xsi\";\n\tpublic static final String XSI_TYPE = \"type\";\n\tpublic static final String XSI_NIL = \"nil\";\n\n\tpublic static final String COLON = \":\";\n\n\tpublic static final String XSD_LIST_DELIM = \" \";\n\tpublic static final char XSD_LIST_DELIM_CHAR = ' ';\n\tpublic static final char[] XSD_LIST_DELIM_CHAR_ARRAY = { ' ' };\n\n\t// public static final String CDATA_START = \"<![CDATA[\";\n\t// public static final char[] CDATA_START_ARRAY = CDATA_START.toCharArray();\n\t// public static final String CDATA_END = \"]]>\";\n\t// public static final char[] CDATA_END_ARRAY = CDATA_END.toCharArray();\n\n\tpublic static final String XSD_ANY_TYPE = \"anyType\";\n\n\tpublic static final String XSD_BOOLEAN_TRUE = \"true\";\n\tpublic static final String XSD_BOOLEAN_1 = \"1\";\n\tpublic static final String XSD_BOOLEAN_FALSE = \"false\";\n\tpublic static final String XSD_BOOLEAN_0 = \"0\";\n\n\tpublic static final char[] XSD_BOOLEAN_TRUE_ARRAY = XSD_BOOLEAN_TRUE\n\t\t\t.toCharArray();\n\tpublic static final char[] XSD_BOOLEAN_1_ARRAY = XSD_BOOLEAN_1\n\t\t\t.toCharArray();\n\tpublic static final char[] XSD_BOOLEAN_FALSE_ARRAY = XSD_BOOLEAN_FALSE\n\t\t\t.toCharArray();\n\tpublic static final char[] XSD_BOOLEAN_0_ARRAY = XSD_BOOLEAN_0\n\t\t\t.toCharArray();\n\n\tpublic static final String DECODED_BOOLEAN_TRUE = XSD_BOOLEAN_TRUE;\n\tpublic static final String DECODED_BOOLEAN_FALSE = XSD_BOOLEAN_FALSE;\n\tpublic static final char[] DECODED_BOOLEAN_TRUE_ARRAY = DECODED_BOOLEAN_TRUE\n\t\t\t.toCharArray();\n\tpublic static final char[] DECODED_BOOLEAN_FALSE_ARRAY = DECODED_BOOLEAN_FALSE\n\t\t\t.toCharArray();\n\n\tpublic static final int NOT_FOUND = -1;\n\n\t/*\n\t * Block & Channel settings Maximal Number of Values (per Block / Channel)\n\t */\n\tpublic static final int MAX_NUMBER_OF_VALUES = 100;\n\tpublic static final int DEFAULT_BLOCK_SIZE = 1000000;\n\n\t/*\n\t * StringTable settings\n\t */\n\tpublic static final int DEFAULT_VALUE_MAX_LENGTH = -1; // unbounded\n\tpublic static final int DEFAULT_VALUE_PARTITON_CAPACITY = -1; // unbounded\n\n\t/*\n\t * Float & Double Values\n\t */\n\tpublic static final String FLOAT_INFINITY = \"INF\";\n\tpublic static final String FLOAT_MINUS_INFINITY = \"-INF\";\n\tpublic static final String FLOAT_NOT_A_NUMBER = \"NaN\";\n\n\tpublic static final char[] FLOAT_INFINITY_CHARARRAY = FLOAT_INFINITY\n\t\t\t.toCharArray();\n\tpublic static final char[] FLOAT_MINUS_INFINITY_CHARARRAY = FLOAT_MINUS_INFINITY\n\t\t\t.toCharArray();\n\tpublic static final char[] FLOAT_NOT_A_NUMBER_CHARARRAY = FLOAT_NOT_A_NUMBER\n\t\t\t.toCharArray();\n\n\t/* -(2^14) == -16384 */\n\tpublic static final int FLOAT_SPECIAL_VALUES = -16384;\n\tpublic static final int FLOAT_MANTISSA_INFINITY = 1;\n\tpublic static final int FLOAT_MANTISSA_MINUS_INFINITY = -1;\n\tpublic static final int FLOAT_MANTISSA_NOT_A_NUMBER = 0;\n\n\t/* -(2^14-1) == -16383 */\n\tpublic static final long FLOAT_EXPONENT_MIN_RANGE = -16383;\n\t/* 2^14-1 == 16383 */\n\tpublic static final long FLOAT_EXPONENT_MAX_RANGE = 16383;\n\t/* -(2^63) == -9223372036854775808L */\n\tpublic static final long FLOAT_MANTISSA_MIN_RANGE = -9223372036854775808L;\n\t/* 2^63-1 == 9223372036854775807L */\n\tpublic static final long FLOAT_MANTISSA_MAX_RANGE = 9223372036854775807L;\n\n}", "public interface Constants\r\n{\r\n\tfinal public static double EPSILON = 0.0001;\r\n\tfinal public static int LEFT_BUTTON = MouseEvent.BUTTON1;\r\n\tfinal public static int RIGHT_BUTTON = MouseEvent.BUTTON3;\r\n\tfinal public static double SMALL_EPSILON = 0.0000000001;\r\n}", "public interface MainHandlerConstant {\n int PRINT = 100;\n int UI_CHANGE_INPUT_TEXT_SELECTION = 102;\n int UI_CHANGE_SYNTHES_TEXT_SELECTION = 103;\n int INIT_SUCCESS = 101;\n}", "private LevelConstants() {\n\t\t\n\t}", "public interface Constants {\n final public static String TAG = \"[PracticalTest02Var03]\";\n\n final public static boolean DEBUG = true;\n\n final public static String WEB_SERVICE_ADDRESS = \"http://services.aonaware.com/DictService/DictService.asmx/Define\";\n\n final public static String EMPTY_STRING = \"\";\n\n final public static String QUERY_ATTRIBUTE = \"word\";\n\n final public static String SCRIPT_TAG = \"WordDefinition\";\n final public static String SEARCH_KEY = \"wui.api_data =\\n\";\n\n final public static String CURRENT_OBSERVATION = \"current_observation\";\n}", "public interface Constants extends ShareConstants {\n String FASTDEX_DIR = \"fastdex\";\n String PATCH_DIR = \"patch\";\n String TEMP_DIR = \"temp\";\n String DEX_DIR = \"dex\";\n String OPT_DIR = \"opt\";\n String RES_DIR = \"res\";\n}", "public interface ActivityConstants {\n public static final int SCAN_ACTIVITY = 1001;\n public static final int PREVIOUS_ORDERS_ACTIVITY = 1002;\n public static final String PREFS_NAME = \"LoginData\";\n public static final String PREFS_LOGGED = \"LoggedIn\";\n}", "public interface EclipseConstants {\n\n\t/**\n\t * Id of the <code>EclipseUIService</code>.\n\t */\n\tpublic static final String ID_SERVICE_ECLIPSE_UI = \"org.dotplot.standard.EclipseUI\";\n\n\t/**\n\t * ID of the dotplot perspective.\n\t */\n\tpublic static final String ID_PERSPECTIVE_DOTPLOT = \"org.dotplot.plugin.perspective1\";\n\n\t/**\n\t * Id of the dotplot plugin.\n\t */\n\tpublic static final String ID_PLUGIN_DOTPLOT = \"org.dotplot.plugin\";\n\n\t/**\n\t * Id of the dotplot menu.\n\t */\n\tpublic static final String ID_MENU_DOTPLOT = \"org.dotplot.plugin.menu1\";\n}", "public interface Constants {\n\n String KEY_BOOK_INFO = \"key_book_info\";\n\n}", "public interface Constants {\n\n /**\n * 资源路径\n */\n String CONTENT_RESOURCES_PATH = \"content\";\n\n /**\n * 名师头像地址\n */\n String TEACHER_HEADE_IMG_PATH = \"teacher\";\n\n /**\n * 证书保存地址\n */\n String CERTIFICATE_IMG_PATH = \"certificate\";\n\n\n /**\n * 舞谱上传地址目录\n */\n String DANCE_BOOK_PATH = \"dance_book\";\n}", "public interface Constants {\r\n public static final String APPLE_PRODUCT_CODE = \"APP1456\";\r\n public static final String ORANGE_PRODUCT_CODE = \"ORG3456\";\r\n public static final Double APPLE_PRODUCT_PRICE = 0.60;\r\n public static final Double ORANGE_PRODUCT_PRICE = 0.25;\r\n public static final int MAGIC_NUMBER_ZERO = 0;\r\n public static final int MAGIC_NUMBER_TWO = 2;\r\n public static final int MAGIC_NUMBER_THREE = 3;\r\n public static final int MAGIC_NUMBER_FIVE = 5;\r\n public static final int MAGIC_NUMBER_SEVEN = 7;\r\n public static final int MAGIC_NUMBER_NINE = 9;\r\n}", "private Constantes() {\r\n\t\t// No way\r\n\t}", "public interface ModelConstants {\n \n // elements\n @Deprecated\n public final static String ACQUISITION_STRATEGY = \"acquisition-strategy\";\n \n public final static String DATASOURCE = \"datasource\";\n public final static String HISTORY_LEVEL = \"history-level\";\n public final static String JOB_ACQUISITION = \"job-acquisition\";\n public final static String JOB_ACQUISITIONS = \"job-acquisitions\";\n public final static String JOB_EXECUTOR = \"job-executor\";\n public final static String PROCESS_ENGINE = \"process-engine\";\n public final static String PROCESS_ENGINES = \"process-engines\";\n public final static String PROPERTY = \"property\";\n public final static String PROPERTIES = \"properties\";\n public final static String CONFIGURATION = \"configuration\";\n\n public final static String PLUGINS = \"plugins\";\n public final static String PLUGIN = \"plugin\";\n public final static String PLUGIN_CLASS = \"class\";\n \n // attributes\n public final static String DEFAULT = \"default\";\n public final static String NAME = \"name\";\n public final static String THREAD_POOL_NAME = \"thread-pool-name\";\n /** The name of our subsystem within the model. */\n public static final String SUBSYSTEM_NAME = \"camunda-bpm-platform\";\n \n}", "public interface PaperDbConstants {\n String UNIVERSAL_TYPE = \"universal_flavor_type\";\n String PAPER_ACCESS_TOKEN = \"paper_access_token\";\n\n\n String LIVE = \"LIVE\";\n String DEV = \"DEV\";\n\n String LOGIN_CREDENTIALS = \"logininfo\";\n\n}", "public interface UserConstants {\n String TYPE_AUTH_QQ = \"qq\";\n String TYPE_AUTH_WX = \"wx\";\n String TYPE_AUTH_WB = \"wb\";\n String REG_ILLEGAL = \"[`~!@#$^&*()=|{}':;',\\\\[\\\\].<>/?~!@#¥……&*()—|{}【】‘;:”“'。,、?]\";\n\n String NCODE = \"86\";\n\n String FROM = \"whaleyVR\";\n\n\n int THIRD_ERROR = 1097;\n\n int THIRD_CANCEL = 2889;\n int THIRD_INSTALL = 3054;\n int THIRD_WEIBO = 5650;\n //====================================event====================================//\n String EVENT_LOGIN_SUCCESS = \"login_success\";\n String EVENT_SIGN_OUT = \"sign_out\";\n String EVENT_UPATE_NAME = \"update_name\";\n String EVENT_UPATE_AVATAR = \"update_avatar\";\n String EVENT_LOGIN_CANCEL = \"login_cancel\";\n}", "public interface MyConstants {\n String ISPROCTECTED =\"isProctected\";\n String SAFENUMBER = \"safenumber\";\n String SIMNUMBER = \"simnumber\";\n String SPFILE = \"config\";\n String PASSWORD = \"password\";\n String ISSETUP = \"isSetup\";\n}", "private VolumeDataConstants() {\r\n \r\n }", "public interface WebConstants {\n\n String REQUEST_ATTR_ORIGIN_IP = \"ORIGIN_IP\";\n\n String USER_LOGIN_STATUS = \"USER_LOGIN_STATUS\";\n}", "public interface IActivityConstants {\n\n public static final int ADD_UNIT_REQ_CODE = 1;\n\n public static final String METRIC_KEY = \"METRIC\";\n\n public static final String KNOT_KEY = \"KNOT\";\n\n public static final String BEUA_KEY = \"BEUAFORT\";\n\n public static final String INPUT_KEY = \"INPUT\";\n\n}", "public interface DublinCoreConstants {\n \n /** Creates a new instance of Class */\n public static int DC_TITLE = 0;\n public static int DC_CREATOR = 1;\n public static int DC_SUBJECT = 2;\n public static int DC_DATE = 3;\n public static int DC_TYPE= 4;\n public static int DC_FORMAT= 5;\n public static int DC_IDENTIFIER = 6;\n public static int DC_COLLECTION = 7;\n public static int DC_COVERAGE = 8;\n \n public static int SUPPORTED_NUMBER = 9;\n \n public static final String[] DC_FIELDS = {\"title\",\"creator\",\"subject\",\"date\",\"type\",\"format\",\"identifier\",\"collection\",\"coverage\"};\n public static final String DC_NAMESPACE = \"dc:\";\n \n}", "private LoggerConstants() {\n\t\tsuper();\n\t}", "public interface COSConstants {\n\n public static final String CLOTHO_PATH_PREFIX = \"/clotho\";\n public static final String GIRLITY_PATH_PREFIX = \"/girlity\";\n public static final String PACKAGE_PATH_PREFIX = CLOTHO_PATH_PREFIX+ \"/package\";\n public static final String SPLASH_PATH_PREFIX = GIRLITY_PATH_PREFIX+ \"/splash\";\n}", "public interface I18nConstants {\n // Common\n String userName();\n\n String email();\n\n String confirmEmail();\n\n String password();\n\n String confirmPassword();\n\n String skip();\n\n String close();\n\n String tooltipCloseDialog();\n\n String tooltipMinimize();\n\n String tooltipMaximize();\n\n String highScore();\n\n String limitation();\n\n String houseSpace();\n\n String noMoney();\n\n String notEnoughMoney();\n\n String tooManyItems();\n\n String spaceLimitExceeded();\n\n String unregisteredUser();\n\n String unnamedUser();\n\n String yes();\n\n String no();\n\n String newBase();\n\n String startOver();\n\n String stop();\n\n String mission();\n\n String refresh();\n\n String player();\n\n String planet();\n\n String filter();\n\n String activate();\n\n String cancel();\n\n String start();\n\n String description();\n\n String abort();\n\n String date();\n\n String time();\n\n String event();\n\n String save();\n\n String dismiss();\n\n String nameToShort();\n\n String nameAlreadyUsed();\n\n String unknownErrorReceived();\n\n String name();\n\n String send();\n\n String noSuchUser(String userName);\n\n String change();\n\n String message();\n\n String featureNextRelease();\n\n String featureComingSoon();\n\n String loading();\n\n String serverError();\n\n String connectWithFacebook();\n\n String availableCrystals(String text);\n\n // Login logout\n String login();\n\n String loginFailed();\n\n String loginFailedText();\n\n String loginFailedNotVerifiedText();\n\n String logout();\n\n String logoutQuestion();\n\n String logoutTextFacebook(String name);\n\n String tooltipNotRegistered();\n\n String tooltipNotVerified(String userName);\n\n String tooltipLoggedIn(String userName);\n\n String forgotPassword();\n\n // Radar\n String tooltipRadar();\n\n String tooltipZoomIn();\n\n String tooltipZoomOut();\n\n String tooltipZoomHome();\n\n String tooltipZoomAttack();\n\n String tooltipRadarPageLeft();\n\n String tooltipRadarPageRight();\n\n String tooltipRadarPageUp();\n\n String tooltipRadarPageDown();\n\n String radarNoPower();\n\n String radarNoRadarBuilding();\n\n // Dialogs\n String messageDialog();\n\n String inventory();\n\n String inventoryNotAvailableMission();\n\n String inventoryNotAvailableBase();\n\n String startTutorialFinished();\n\n String questPassed();\n\n String boxPicked();\n\n // Connection\n String connectionFailed();\n\n String connectionLost();\n\n String connectionAnotherExits();\n\n String connectionNone();\n\n String connectionNoneLoggedOut();\n\n String wrongBase();\n\n String notYourBase();\n\n // Sell\n String sellConfirmationTitle();\n\n String sellConfirmation();\n\n String tooltipSell();\n\n // Register dialog\n String unregistered();\n\n String unnamed();\n\n String chatUnregistered();\n\n String chatUnnamed();\n\n String registerFacebookNickname();\n\n String registerThanks();\n\n String registerThanksLong();\n\n String registerConfirmationEmailSent(String email);\n\n String register();\n\n String registerDirect();\n\n String registerFacebook();\n\n String registrationFailed();\n\n String registrationFilled();\n\n String registrationMatch();\n\n String registrationEmailNotValid();\n\n String registrationEmailMatch();\n\n String registrationEmail();\n\n String registrationUser();\n\n String setName();\n\n String registrationPasswordNotValid();\n\n String setNameFailedNotVerifiedText();\n\n // Side Cockpit\n String tooltipEnergy();\n\n String tooltipMute();\n\n String tooltipHighScore();\n\n String tooltipFacebookCommunity();\n\n String tooltipFacebookInvite();\n\n String singlePlayer();\n\n String tooltipAbortMission();\n\n String multiplayer();\n\n // Quests\n String questBotBasesText(String botBases);\n\n String nextPlanet();\n\n String tooltipNextPlanet();\n\n String questDialog();\n\n String tooltipQuestDialog();\n\n String questVisualisation();\n\n String tooltipQuestVisualisation();\n\n String pressButtonWhenReady();\n\n String tooltipStartMission();\n\n String reward();\n\n String xpReward(int xp);\n\n String razarionReward(int razarion);\n\n String crystalReward(int crystals);\n\n String activeQuest();\n\n String activeQuestAbort();\n\n String questOverview(int questsDone, int totalQuests);\n\n String missionOverview(int missionsDone, int totalMissions);\n\n String youPassedQuest(String questTitle);\n\n String noMoreQuests();\n\n String noActiveQuest();\n\n String questBasesKilled();\n\n String questBoxesPicked();\n\n String questCrystalsIncreased();\n\n String questArtifactItemAdded();\n\n String questResourcesCollected();\n\n String questTimeRemaining();\n\n String questTimeNotFulfilled();\n\n String questBuilt();\n\n String questUnitStructuresBuilt();\n\n String questArtifactItemAddedActionWord();\n\n String questDestroyed();\n\n String questUnitStructuresDestroyed();\n\n String questMinutesPast();\n\n String startMission();\n\n String competeMission();\n\n String go();\n\n String questEnumPvp();\n\n String questEnumPve();\n\n String questEnumBossPve();\n\n String questEnumMission();\n\n String questEnumGather();\n\n String questEnumMoney();\n\n String questEnumBuildup();\n\n String questEnumHoldTheBase();\n\n String questType();\n\n String abortMission();\n\n String reallyAbortMission();\n\n String placeStartItemTitle();\n\n String placeStartItemDescription();\n\n // Dead-end and new base\n String reachedDeadEnd();\n\n String reachedDeadEndItem();\n\n String reachedDeadEndMoney();\n\n String startNewBase();\n\n String baseLostTitle();\n\n String baseLost();\n\n // Item cockpit\n String guildMembershipRequestItemCockpit();\n\n String tooltipLaunchMissile();\n\n String tooltipUpgrade();\n\n String tooltipBuild(String itemName);\n\n String tooltipNoBuildLevel(String itemName);\n\n String tooltipNoBuildLimit(String itemName);\n\n String tooltipNoBuildHouseSpace(String itemName);\n\n String tooltipNoBuildMoney(String itemName);\n\n String botEnemy();\n\n String botNpc();\n\n String playerEnemy();\n\n String playerFriend();\n\n String itemCockpitGuildMember();\n\n String tooltipSelect(String itemName);\n\n String notPlaceHere();\n\n String notPlaceOver();\n\n String containingNoUnits();\n\n String containing1Unit();\n\n String containingXUnits(int count);\n\n String unloadButton();\n\n String unloadButtonTooltip();\n\n // Highscore\n String findMe();\n\n String rank();\n\n String killed();\n\n String killedPve();\n\n String killedPvp();\n\n String basesKilled();\n\n String basesLost();\n\n String created();\n\n String create();\n\n // Inventory\n String useItem();\n\n String workshop();\n\n String dealer();\n\n String funds();\n\n String artifacts();\n\n String buy();\n\n String tooltipAssemble();\n\n String assemble();\n\n String tooltipArtifact(String artifactName);\n\n String youOwn(int ownCount);\n\n String useItemLimit(String itemName);\n\n String useItemHouseSpace();\n\n String useItemMoney();\n\n String enemyTooNear();\n\n String crystalAmount(int crystals);\n\n String cost(int crystalCost);\n\n String leaveBaseNextPlanet();\n\n String goNextPlanet();\n\n String getInventoryItemTitle();\n\n String getInventoryItemNotEnough(String inventoryItemName);\n\n String getArtifactItemTitle();\n\n String getInventoryArtifactNotEnough(String inventoryArtifactName);\n\n // Startup\n String startupClearGame();\n\n String startupLoadRealGameInfo();\n\n String startupDeltaStartRealGame();\n\n String startupLoadUnits();\n\n String startupInitUnits();\n\n String startupRunRealGame();\n\n String startupCheckCompatibility();\n\n String startupLoadJavaScript();\n\n String startupInitGui();\n\n String startupInitRealGame();\n\n String startupPreloadImageSpriteMaps();\n\n String startupLoadSimulationGameInfo();\n\n String startupInitSimulatedGame();\n\n String startupRunSimulatedGame();\n\n String startupDeltaStartSimulatedGame();\n\n // Unlock dialogs\n String unlockDialogTitle();\n\n String unlockDialogText();\n\n String nothingToUnlockDialogText();\n\n String unlockCrystalCost(int crystals);\n\n String unlockFailed();\n\n String unlockNotEnoughCrystals();\n\n // ???\n String createBase();\n\n String createBaseInBotFailed();\n\n String chooseYourStartPoint();\n\n // Menu\n String tooltipMenuNewBaseSimulated();\n\n String tooltipMenuNewBaseRealGame();\n\n String menuNews();\n\n String menuHistory();\n\n String menuTooltipRegisterLogin();\n\n String menuTooltipNews();\n\n String menuTooltipHistory();\n\n String menuTooltipHistoryOnlyRegistered();\n\n String menuTooltipHistoryOnlyRealGame();\n\n String menuTooltipHistoryOnlyRegisteredVerified();\n\n String menuTooltipGuildsMission();\n\n String guildsOnlyRegisteredVerified();\n\n String guildsOnlyRegistered();\n\n String menuTooltipMyGuild();\n\n String menuTooltipGuilds();\n\n String menuMyGuild();\n\n String menuGuilds();\n\n String menuSearchGuilds();\n\n String menuCreateGuild();\n\n String menuGuildInvitations();\n\n String menuInviteFriends();\n\n String menuInviteFriendsTooltip();\n\n String menuGetCrystals();\n\n String menuTooltipGetCrystals();\n\n String menuBuyPaypal();\n\n String menuBuyFacebook();\n\n String menuOverviewGetCrystals();\n\n String menuStarMap();\n\n String menuStarMapTooltip();\n\n String menuStarMapTooltipMission();\n\n // News Dialog\n String newsDialogTitle();\n\n // History Dialog\n String historyDialogTitle();\n\n // Guild dialogs\n String createGuildDialogTitle();\n\n String createGuildDialog();\n\n String myGuildDialogTitle();\n\n String searchGuildDialogTitle();\n\n String member();\n\n String guildRank();\n\n String kick();\n\n String guildKickMember();\n\n String guildKickMemberMessage(String name);\n\n String guildPresident();\n\n String guildManagement();\n\n String guildMember();\n\n String changeRank();\n\n String gildMemberInvited();\n\n String gildMemberInvitedMessage(String userName);\n\n String inviteMember();\n\n String createGuildInsufficientCrystals();\n\n String createGuildCrystalCost(int cost);\n\n String guildText();\n\n String guildMembers();\n\n String guildMembershipRequestTitle();\n\n String guildMembershipRequest();\n\n String guildMembershipRequestSent(String name);\n\n String joinGuild();\n\n String joinGuildMessage(String name);\n\n String dismissGuildMessage(String name);\n\n String guildTab();\n\n String guildMemberTab();\n\n String guildRecruitingTab();\n\n String guildInviteMessage();\n\n String guildMembershipRequestText();\n\n String leaveGuild();\n\n String closeGuild();\n\n String leaveGuildMessage();\n\n String closeGuildMessage();\n\n String guildNameFilter();\n\n String guildInvitations();\n\n String guildInvitationsMessage();\n\n String changeRankText(String name);\n\n String noGuildRequests();\n\n String noGuildInvitations();\n\n String noGuilds();\n\n String guildToSendRequest();\n\n String guildTextShort();\n\n String guildInvitationNotification();\n\n String openGuildInvitation();\n\n String guildMembershipRequestNotification();\n\n String openGuildMembershipRequest();\n\n String guildInvitationNotRegistered(String playerName);\n\n String guildInvitationBaseAbandoned(String playerName);\n\n String userIsAlreadyAGuildMember(String userName);\n\n String guildLostTitle();\n\n String guildLostMessage();\n\n // Chat\n String tooltipChatMenu();\n\n String globalChat();\n\n String guildChat();\n\n String chatMessageFilter();\n\n String chatMessageFilterNoGuild();\n\n // Invite friends\n String inviteFriends();\n\n String inviteFriendsOnlyRegisteredVerified();\n\n String inviteFriendsOnlyRegistered();\n\n String inviteFriendsDescription();\n\n String inviteFriendsViaFacebook();\n\n String inviteFriendsViaMail();\n\n String inviteFriendsViaUrl();\n\n String inviteUrlDescription();\n\n String tabInvite();\n\n String tabComplete();\n\n String sendButton();\n\n String generateButton();\n\n String invitationCrystalBonus();\n\n String crystalBonus();\n\n String fbInviteTitle();\n\n String fbInviteMessage();\n\n String inviteFriendsEmailNotValid();\n\n String invitationEmailSent(String address);\n\n String invitationFacebookSent();\n\n String noFriendInvited();\n\n // Crystal helper\n String buyDialogCost(int crystalCost);\n\n String buyDialogbalance(int crystalBalance);\n\n String invite();\n\n String howToGetCrystals();\n\n String buyCrystalsViaPayPal();\n\n String buyCrystalsViaFacebook();\n\n String invitationFriendsAndGetCrystals();\n\n String collectBoxesAndGetCrystals();\n\n // Buy crystals dialog\n String buyCrystalsPaypal();\n\n String buyCrystalsPaypal1();\n\n String buyCrystalsPaypal2();\n\n String buyCrystalsPaypa3();\n\n String buyCrystalsPaypal4();\n\n String buyCrystalsPaypal5();\n\n String buyCrystalsPaypalOnlyRegistered();\n\n String buyCrystalsPaypalOnlyRegisteredVerified();\n\n String buyCrystalsPaypalDialogTitle();\n\n String buyCrystalsFacebookDialogTitle();\n\n String buyCrystalsFacebook();\n\n String buyCrystalsFacebook1();\n\n String buyCrystalsFacebook2();\n\n String buyCrystalsFacebook3();\n\n String buyCrystalsFacebook4();\n\n String buyCrystalsFacebook5();\n\n String buyCrystalsFacebookButton(int crystals);\n\n String buyCrystalsFacebookOnlyRegisteredVerified();\n\n String buyCrystalsFacebookOnlyRegistered();\n\n String tanksCrystalBoughtDialogTitle();\n\n String tanksCrystalBoughtDialog(int delta, int value);\n\n // Star map\n String starMapDialogTitle();\n\n String minLevel();\n\n String planetSize();\n\n String allowedUnits();\n\n String bases();\n\n String bots();\n\n String units();\n\n String land();\n\n String wrongLevelForLand();\n\n String tooltipShowUnitsOnPlanet();\n\n String tooltipLandOnPlanet();\n\n String youAreAlreadyOnThisPlanet();\n\n String moveToPlanetTitle();\n\n String moveToPlanet(String name);\n\n String leaveBaseMoveToPlanet(String name);\n\n // Training\n String trainingTipScroll();\n\n String trainingTipSelectItem(String itemTypeName);\n\n String trainingTipClickItem();\n\n String trainingTipSendBuildCommand(String itemTypeName);\n\n String trainingTipSendBuildFinalizeCommand(String itemTypeName);\n\n String trainingTipFactorizeCommand(String itemTypeName);\n\n String trainingTipSendCollectCommand(String itemTypeName);\n\n String trainingTipToBeBuiltPlacer(String itemTypeName);\n\n String trainingTipWatchQuestDialog();\n\n String trainingTipClickContainerItem(String itemTypeName);\n\n String trainingTipClickMove();\n\n String trainingTipClickUnload();\n\n String trainingTipClickUnloadMode();\n\n String apply();\n\n String ok();\n\n // Level up dialog\n String levelUpDialogTitle();\n\n String youReachedLevel(int level);\n\n // User account dialog\n String userAccountDialogTitle();\n\n // System\n String serverRebootTitle();\n\n String serverRebootMissionNotSaved();\n\n String serverRebootNotRegistered();\n\n String planetRestartTitle();\n\n String planetRestartMessage();\n\n String serverRestartTitle();\n\n String serverShuttingDown();\n\n String serverStarting();\n\n String serverRunning();\n\n String unknown();\n}", "public interface Constants {\n int STATE_AGREE = 1;\n int STATE_DISAGREE = 2;\n}", "public interface IntConstant {\n /***\n * 调用系统相机\n */\n int CAMERA = 10001;\n /***\n * 调用系统相册\n */\n int PICTURE = 10006;\n /***\n * 跳转 视频选择\n */\n int VIDEO = 10007;\n /**\n *跳转到裁剪界面的 裁剪类型 0: 头像 1:个人背景图\n */\n int CLIPIMAGETYPE_ICON = 0 ;\n int CLIPIMAGETYPE_USERMSGBG = 1 ;\n /**\n * 跳转到 commonWebView 界面 链接类型 0:直接展示 1:订单详情界面 2:显示标题带返回按钮,如果不手动设置title默认读取网页中title\n */\n int WEBVIEWURL_TYPE_NORMAL = 0;\n int WEBVIEWURL_TYPE_SHOWTITLE = 1;\n /**\n * 跳转到任务列表界面 展示的页面\n */\n int TO_TASKLIS_SHOW_JOIN = 0;\n int TO_TASKLIS_SHOW_COLLECTION = 1;\n /**\n * 修改个人信息的请求类型\n */\n int MODIFYUSERINFO_ALL = 2;\n int MODIFYUSERINFO_BASEINFO = 0;\n int MODIFYUSERINFO_IMAGEINFO = 1;\n\n /**您的性别不符合要求*/\n int ERROR_SEX = 29191164;\n /**您尚未绑定社交媒体,是否立刻绑定?*/\n int ERROR_UNBIND = 29191165;\n /**您尚未完善资料,是否立刻填写?*/\n int ERROR_UNCOMPLETED = 29191166;\n /**您的微博粉丝数量与商家的要求不符,是否继续报名?*/\n int ERROR_FANS = 29191167;\n\n}", "public interface TestConstants {\n\n public static final String MONGO_SERVER = \"dun-tst-devf01\";\n public static final int MONGO_PORT = 27017;\n public static final String MONGO_DB = \"mydbTest\";\n public static final String RESOURCE_FILE = \"/j2eeMonitoring.log\";\n public static final String SERVER_NAME = \"appcfm51\";\n public static final String AS_NAME = \"AS_STEELUSER\";\n public static final String APPLICATION_NAME = \"SteelUserTest\";\n\n}", "private Constants() {\n\t\tthrow new AssertionError();\n\t}", "private USBConstant() {\r\n\r\n\t}", "private Constants() {\n }", "private Constants() {\n }", "@Test\n\tpublic void testPublicConstants() {\n\t\tip = new ImagePlus();\n\t\tassertEquals(0,ImagePlus.GRAY8);\n\t\tassertEquals(1,ImagePlus.GRAY16);\n\t\tassertEquals(2,ImagePlus.GRAY32);\n\t\tassertEquals(3,ImagePlus.COLOR_256);\n\t\tassertEquals(4,ImagePlus.COLOR_RGB);\n\t}", "public interface Constants {\n\n //前端显示描述类内容最长字符串长度\n int MAX_LIST_CONTEXT_LENGTH = 60;\n\n //描述内容最大长度\n int MAX_CONTEXT_LENGTH = 3000;\n\n //评论内容最大长度\n int MAX_COMMENT_LENGTH = 500;\n\n //获取更多评论记录数\n int MAX_MORE_COMMENT_NUM = 100;\n\n //上传文件名字最大长度\n int MAX_FILE_NAME_LENGTH = 30;\n\n //同一作业连续发送提醒交作业通知间隔秒数\n int MIN_SECONDS_WARNSUB = 21600;\n\n //口语作业最多支持单词数\n int MAX_VOICE_WORK_WORDS = 15;\n\n //作业发布最长延迟天数\n int MAX_PUBLISH_WORK_EXDAYS = 60;\n\n // 课外作业\n int WORK_TYPE_EXTRA_WORK = 8;\n\n //板书类型\n int WORK_TYPE_VOICE_WORK = 7;\n\n //板书类型\n int WORK_TYPE_BLACKBOARD_PUBLISH = 6;\n\n //网络课件类型\n int WORK_TYPE_COURSE_REAPPEAR = 5;\n\n //电子作业\n int WORK_TYPE_EXERCISE_WORK = 4;\n\n //同步课堂作业\n int WORK_TYPE_SYNCLASS_WORK = 3;\n\n //同步课堂作业\n int WORK_TYPE_MAGIC_WORK = 2;\n\n //同步课堂作业\n int WORK_TYPE_GUIDANCE_WORK = 1;\n\n //我的课件\n int COURSEWARE_BELONG_TYPE_MY_APPEAR = 1;\n\n //发布的课件\n int COURSEWARE_BELONG_TYPE_COURSE_APPEAR = 3;\n\n //用户类型\n String TEACHER_TYPE = \"1\";\n\n String STUDENT_TYPE = \"2\";\n\n int WORK_TYPE = 1;\n\n int BLACKBOARD_TYPE = 2;\n\n //乐观锁机制尝试次数\n int OPTIMISTIC_LOCK_TRY_TIMES = 10;\n\n //提分宝作业评分描述10\n String MAGIC_WORK_SCORE_CONTEXT10 = \"恭喜你!继续保持,清华北大在等你哦!\";\n\n //提分宝作业评分描述9\n String MAGIC_WORK_SCORE_CONTEXT9 = \"哇噢!可以挑战清华北大了!\";\n\n //提分宝作业评分描述8\n String MAGIC_WORK_SCORE_CONTEXT8 = \"你好聪明,加油冲击重点大学吧!\";\n\n //提分宝作业评分描述7\n String MAGIC_WORK_SCORE_CONTEXT7 = \"太棒了,可以挑战一本大学啦!\";\n\n //提分宝作业评分描述6\n String MAGIC_WORK_SCORE_CONTEXT6 = \"再次挑战,稍微努力下就能二本大学啦!\";\n\n //提分宝作业评分描述5\n String MAGIC_WORK_SCORE_CONTEXT5 = \"再多练练就可以上大学啦!\";\n /**提分宝数据统计前端页面分数描述*/\n //提分宝作业评分描述10\n String STATISTICS_SCORE_CONTEXT10 = \"清华北大\";\n //提分宝作业评分描述9\n String STATISTICS_SCORE_CONTEXT9 = \"重点大学\";\n //提分宝作业评分描述8\n String STATISTICS_SCORE_CONTEXT8 = \"一本大学\";\n //提分宝作业评分描述7\n String STATISTICS_SCORE_CONTEXT7 = \"二本大学\";\n //提分宝作业评分描述6\n String STATISTICS_SCORE_CONTEXT6 = \"三本大学\";\n //提分宝作业评分描述5\n String STATISTICS_SCORE_CONTEXT5 = \"挑战完成\";\n\n\n\n //提醒交作业通知标题\n String WARNSUB_TITLE = \"作业提醒\";\n\n //提醒查看教师发布的板书、网络课件通知标题\n String WARNVIEW_BLACKBOARD_TITLE = \"新板书\";\n String WARNVIEW_COURSEWARE_TITLE = \"新课件\";\n\n //提醒交作业通知内容\n String WARNSUB_CONTENT = \"赶快交作业,老师都着急啦!\";\n\n String GUIDANCE_WORK_NAME = \"预习作业\";\n String MAGIC_WORK_NAME = \"提分宝作业\";\n String SYNCLASS_WORK_NAME = \"同步课堂作业\";\n String EXERCISE_WORK_NAME = \"电子作业\";\n String VOICE_WORK_NAME = \"口语作业\";\n String BLACKBOARD_WORK_NAME = \"板书\";\n String COURSEWARE_WORK_NAME = \"网络课件\";\n String EXTRA_WORK_NAME = \"课外作业\";\n\n String WARN_SUB_WORK_BUSY = \"您太忙碌啦,请休息一会儿,稍后再试\";\n\n // 页面最初加载的评论数\n int MIN_COMMENT_NUM = 4;\n\n // 数字的正则表达式\n final String NUMBER_EXPR = \"^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$\";\n\n // indentifyId\n String IDENTIFY_SCHOOL_MANAGER = \"SCHOOL_MANAGER\";\n String IDENTIFY_TEACHER = \"TEACHER\";\n String IDENTIFY_STUDENT = \"STUDENT\";\n String IDENTIFY_PARENT=\"PARENT\";\n\n final int MAX_STUDENT_NUMBER_FOR_PUBLIC = 1000;\n\n //出题数\n int MAGIC2_WORK_QUEST_NUM = 8;\n //最大衍生题号sort\n int MAGIC2_WORK_MAX_SORT = 5;\n\n //错误率\n double MAGIC2_WORK_WRONG_QUEST_NUM = 0.2;\n\n //默认题目初始平均用时\n final long MAGIC2_WORK_QUEST_AVGTIME = 30000;\n //默认作业时间\n final long DEFAULT_WORK_TIME = 300000;\n}", "public interface Constants {\n String API_LINK_TEXT = \"API_LINK\";\n String USER_ID = \"user_id\";\n String MAPS_KEY = \"AIzaSyBgktirlOODUO9zWD-808D7zycmP7smp-Y\";\n String NEWS_API = \"https://newsapi.org/v1/articles?source=national-geographic&sortBy=top&apiKey=79a22c366b984f11b09d11fb9476d33b\";\n}", "public interface Constants {\n String ASTYANAX_HOSTS = \"127.0.0.1:9160\";\n String DATASTAX_HOSTS = \"127.0.0.1:9042\";\n String GRAPHITE_HOSTS = \"127.0.0.1\";\n int ASTYANAX_PORT = 9160;\n int GRAPHITE_PORT = 2003;\n int WRITE_BATCH_SIZE = 20;\n int READ_BATCH_SIZE = 200;\n int NUMBER_OF_WRITE_THREADS = 10;\n int NUMBER_OF_READ_THREADS = 10;\n}", "public interface Constant {\n\n String ACCESSIBILITY_SERVICE = \"github.hellocsl.smartmonitor/github.hellocsl.smartmonitor.VideoAccessibilityService\";\n\n String QQ_PKG = \"com.tencent.mobileqq\";\n\n String QQ_NUMBER = \"929371293\";\n\n String DIALER = \"com.google.android.dialer\";\n\n String MONITOR_CMD_VIDEO = \"monitor_cmd_video\";\n\n String MONITOR_TAG = \"WaterMonitor\";\n\n String MONITOR_CMD_RESET = \"110\";\n\n String MEIZU_IN_CALL_PKG = \"com.android.incallui\";\n\n //NEXUS 5\n String N5_MODEL = \"Nexus 5\";\n\n //MEIZU\n String MX_MODEL = \"mx\";\n\n\n}", "@ClassVersion(\"$Id$\")\r\npublic interface StrategyUIConstants {\r\n\r\n\t/**\r\n\t * The id of the Strategy perspective.\r\n\t */\r\n\tstatic final String STRATEGY_PERSPECTIVE = \"org.marketcetera.photon.StrategyPerspective\"; //$NON-NLS-1$\r\n\t\r\n\t/**\r\n\t * The id of the Strategies view, showing registered strategies and their state.\r\n\t */\r\n\tstatic final String STRATEGIES_VIEW = \"org.marketcetera.photon.strategy.StrategiesView\"; //$NON-NLS-1$\r\n\t\r\n\t/**\r\n\t * The id of the Trade Suggestions view, showing incoming trade suggestions.\r\n\t */\r\n\tstatic final String TRADE_SUGGESTIONS_VIEW = \"org.marketcetera.photon.strategy.TradeSuggestionsView\"; //$NON-NLS-1$\r\n\t\r\n\t/**\r\n\t * The id of the Project Explorer for the Strategy perspective.\r\n\t */\r\n\tstatic final String PROJECT_EXPLORER_VIEW = \"org.marketcetera.photon.strategy.ProjectExplorer\"; //$NON-NLS-1$\r\n\t\r\n\t/**\r\n\t * The extension used to identify ruby scripts.\r\n\t */\r\n\tstatic final String RUBY_SCRIPT_EXTENSION = \"rb\"; //$NON-NLS-1$\r\n\t\r\n}", "public abstract interface SummaryConstants\n{\n public static final Font FONT = new Font(\"Verdana\", 1, 12);\n public static final Color BACKGROUND_COLOR = new Color(205, 220, 242);\n public static final Color FOREGROUND_COLOR = new Color(6, 22, 157);\n}", "public interface Constants {\n String NA = \"NA\";\n String ARG_USERS=\"user\";\n String SENDER_ID =\"fro9SbG2Eic:APA91bHzUBA35xjcDP7TXu5uG3JetLMENHfJpfKnRjS02-y8W4n1ZonIn9HYNAwjV8F3uiOAV2gXparORINEEps3t0kCZHI2rutU33DaUlDeGJYrKDK_fG9HCdXAq1gNHtfmfqHGDBve\" ;\n}", "public interface LibraryConstant {\n\n public interface LanguageConstant {\n\n public static String JAVA=\"JAVA\";\n public static String C=\"C\";\n public static String CPP=\"C++\";\n }\n\n public interface StyleConstant {\n\n //pre-defined Styles\n\n public static final String NORMAL=\"NORMAL\";\n public static final String BOLD=\"BOLD\";\n public static final String ITALIC=\"ITALIC\";\n public static final String UNDERLINE=\"UNDERLINE\";\n public static final String SUPERSCRIPT=\"SUPERSCRIPT\";\n public static final String SUBSCRIPT=\"SUBSCRIPT\";\n\n\n }\n}", "public interface Constants {\n\n /*TODO KEY VALUE 参数*/\n String BUNDLE = \"bundle\";\n\n /*TODO APP 渠道*/\n String APP_SHANXI = \"SHANXI\";\n}", "public interface AutomationConstants {\r\n\r\n\t/** The user dir. */\r\n\tString USER_DIR = \"user.dir\";\r\n\r\n\t/** The test folder name. */\r\n\tString TEST_FOLDER_NAME = \"testFolderName\";\r\n\r\n\t/** The test file name. */\r\n\tString TEST_FILE_NAME = \"testFileName\";\r\n\r\n\t/** The test suit sheet name. */\r\n\tString TEST_SUIT_SHEET_NAME = \"Suite\";\r\n\r\n\t/** The object repository folder name. */\r\n\tString OBJECT_REPOSITORY_FOLDER_NAME = \"objectFolderName\";\r\n\r\n\t/** The object repository file name. */\r\n\tString OBJECT_REPOSITORY_FILE_NAME = \"objectFileName\";\r\n\r\n\t/** The test suit file name. */\r\n\tString TEST_SUIT_FILE_NAME = \"testSuitname\";\r\n\r\n\t/** The sanity. */\r\n\tString SANITY = \"Sanity\";\r\n\r\n\t/** The yes. */\r\n\tString YES = \"yes\";\r\n\r\n\t/** The no. */\r\n\tString NO = \"no\";\r\n\r\n\t/** The suite. */\r\n\tString SUITE = \"Suite\";\r\n\r\n\t/** The object repository sheet name. */\r\n\tString OBJECT_REPOSITORY_SHEET_NAME = \"OR\";\r\n\r\n\t/** The regression. */\r\n\tString REGRESSION = \"Regression\";\r\n\r\n\t/** The steps. */\r\n\tString STEPS = \"Steps\";\r\n\r\n\t/** The description. */\r\n\tString DESCRIPTION = \"Description\";\r\n\r\n\t/** The keyword. */\r\n\tString KEYWORD = \"Keyword\";\r\n\r\n\t/** The object. */\r\n\tString OBJECT = \"Object\";\r\n\r\n\t/** The value. */\r\n\tString VALUE = \"Value\";\r\n\r\n\t/** The close. */\r\n\tString CLOSE = \"close\";\r\n\r\n\t/** The testcases. */\r\n\tString TESTCASES = \"Testcases\";\r\n\r\n\t/** The property file name. */\r\n\tString PROPERTY_FILE_NAME = \"automation.properties\";\r\n\r\n\t/** The exception ss. */\r\n\tString EXCEPTION_SS = \"Exception_SS_\";\r\n\r\n\t/** The browser. */\r\n\tString BROWSER = \"browser\";\r\n\r\n\t/** The webdriver chrome driver. */\r\n\tString WEBDRIVER_CHROME_DRIVER = \"webdriver.chrome.driver\";\r\n\r\n\t/** The chrome driver. */\r\n\tString CHROME_DRIVER = \"chromedriver\";\r\n\r\n\t/** The screenshot folder. */\r\n\tString SCREENSHOT_FOLDER = \"screenShotFolder\";\r\n\r\n\t/** The double back slash. */\r\n\tString DOUBLE_BACK_SLASH = \"\\\\\";\r\n\r\n\t/** The url. */\r\n\tString URL = \"URL\";\r\n\r\n\t/** The level three. */\r\n\tString LEVEL_THREE = \"Level3\";\r\n\r\n\t/** The level two. */\r\n\tString LEVEL_TWO = \"Level2\";\r\n\r\n\t/** The level one. */\r\n\tString LEVEL_ONE = \"Level1\";\r\n\r\n\t/** The resources. */\r\n\tString RESOURCES = \"resources\";\r\n\r\n\t/** The file separator. */\r\n\tString FILE_SEPARATOR = \"\\\\\";\r\n\r\n\t/** The iedriver. */\r\n\tString IEDRIVER = \"IEDriverServer\";\r\n\r\n\t/** The automation home. */\r\n\tString AUTOMATION_HOME = \"AUTOMATION_HOME\";\r\n\r\n\t/** The results. */\r\n\tString RESULTS = \"results\";\r\n\r\n\t/** The file upload. */\r\n\tString FILE_UPLOAD = \"FileUpload\";\r\n\r\n\t/** The firefox home. */\r\n\tString FIREFOX_HOME = \"FIREFOX_HOME\";\r\n\r\n\t/** The firefox exe. */\r\n\tString FIREFOX_EXE = \"firefox.exe\";\r\n\r\n\t/** The jenkins. */\r\n\tString JENKINS = \"jenkins\";\r\n\r\n\t/** The split string. */\r\n\tString SPLIT_STRING = \",\";\r\n\r\n\t/** The dot xls. */\r\n\tString DOT_XLS = \".xls\";\r\n\r\n\t/** The one. */\r\n\tint ONE = 1;\r\n\t\r\n\t/** The two. */\r\n\tint TWO = 2;\r\n\t\r\n\t/** The three. */\r\n\tint THREE = 3;\r\n\t\r\n\t/** The four. */\r\n\tint FOUR = 4;\r\n\t\r\n\t/** The five. */\r\n\tint FIVE = 5;\r\n\t\r\n\t/** The six. */\r\n\tint SIX = 6;\r\n\t\r\n\t/** The seven. */\r\n\tint SEVEN = 7;\r\n\t\r\n\t/** The eight. */\r\n\tint EIGHT = 8;\r\n\t\r\n\t/** The zero. */\r\n\tint ZERO=0;\r\n\t\r\n\tString PASS=\"pass\";\r\n\t\r\n\tString FAIL=\"fail\";\r\n\t\r\n\tString DATE_FORMAT_EXCEL=\"E yyyy.MM.dd 'at' hh:mm:ss a zzz\";\r\n\r\n\tString REPORT_LEVEL_THREE=\"reportLevelThree.html\";\r\n\tString REPORT_LEVEL_TWO=\"reportLevelTwo.html\";\r\n\tString REPORT_LEVEL_ONE=\"reportLevelOne.html\";\r\n\t\r\n\tString HTML_REPORTS=\"HTML_REPORTS\";\r\n}", "private Constants() {\n\n }", "private WidgetConstants() {\n throw new AssertionError();\n }", "public interface TriggerUtilConstants {\n\n public static final int DEFAULT_MAX_BUFFERS = 1000;\n public static final int DEFAULT_BUFFER_BLEN = 32000;\n}", "public interface XMLConstants {\r\n /** Descriptors are placed into this special package relative to the generated source. */\r\n String DESCRIPTOR_PACKAGE = \"descriptors\";\r\n\r\n /** This suffix is added to a class name to make its descriptor. */\r\n String DESCRIPTOR_SUFFIX = \"Descriptor\";\r\n\r\n /** Whitespace preserve (keep exactly as-is). */\r\n String WHITESPACE_PRESERVE = \"preserve\";\r\n\r\n /** Whitespace replace (replace each whitespace with a blank). */\r\n String WHITESPACE_REPLACE = \"replace\";\r\n\r\n /** Whitespace collapse (replace each whitespace with a blank, remove leading\r\n * and trailing whitespace, collapse consecutive blanks into exactly one blank). */\r\n String WHITESPACE_COLLAPSE = \"collapse\";\r\n\r\n /** XML name type NCName. (non-colonized name.) */\r\n short NAME_TYPE_NCNAME = 0;\r\n\r\n /** XML name type NMTOKEN. (name token.) */\r\n short NAME_TYPE_NMTOKEN = 1;\r\n\r\n /** XML name type CDATA. (character data.)*/\r\n short NAME_TYPE_CDATA = 2;\r\n\r\n /** XML name type QNAME. (qualified name.) */\r\n short NAME_TYPE_QNAME = 3;\r\n\r\n /** name of per package mapping file. */\r\n String PKG_MAPPING_FILE = \".castor.xml\";\r\n \r\n /** name of the class descriptor resolver file. */\r\n String PKG_CDR_LIST_FILE = \".castor.cdr\";\r\n}", "public interface Constants {\r\n\r\n /**\r\n * The maximum number of Prizes allowed\r\n */\r\n int NUMBER_OF_PRIZES = 10;\r\n /**\r\n * The maximum number of students\r\n */\r\n int NUMBER_OF_STUDENTS = 1000;\r\n /**\r\n * The maximum number of topics a student can undertake\r\n */\r\n int NUMBER_OF_TOPICS = 40;\r\n}", "public interface ImageConstants {\n\n\tpublic String SLIPS_UI_BUTTON_IMG=\"/images/Slips_Active.gif\";\n//\n//\tpublic String JACKPOT_UI_BUTTON_IMG=\"/images/Jackpot_Active.gif\";\n//\n//\tpublic String VOUCHER_UI_BUTTON_IMG=\"/images/Voucher_Active.gif\";\n//\n//\tpublic String PENDING_BUTTON_IMG=\"/images/Pending_Active.png\";\n//\n//\tpublic String MANUAL_BUTTON_IMG=\"/images/Manual_Active.png\";\n//\t\n//\tpublic String PRINTER_BUTTON_IMG=\"/images/Printer_Active.png\";\n//\n//\tpublic String KEYBOARD_BUTTON_IMG=\"/images/KeyboardIcon.png\";\n//\n//\tpublic String LOGOUT_BUTTON_IMG=\"/images/LogoutIcon.png\";\n//\n//\tpublic String EXIT_BUTTON_IMG=\"/images/Exit_Active.png\";\n//\t\n//\tpublic String JACKPOT_UI_TEXT_IMAGE=\"/images/Jackpot_UI_Text_Image.png\";\n//\t\n//\tpublic String JACKPOT_UI_TEXT=\"/images/Jackpot_UI_Text_New.png\";\n//\t\n//\tpublic String TICK=\"/images/Tick.png\";\n\t\n\tpublic String CROSS=\"/images/Cross.png\";\n//\t\n//\tpublic String PREVIOUS_PAGE_ARROW=\"/images/Previous_Page_Arrow.png\";\n//\t\n//\tpublic String NEXT_PAGE_ARROW=\"/images/Next_Page_Arrow.png\";\n//\t\n\tpublic String IMAGE_S_TOUCH_SCREEN_PREV_ARROW = \"/images/S_Previous.png\";\n//\t\n\tpublic String IMAGE_S_TOUCH_SCREEN_NEXT_ARROW = \"/images/S_Next.png\";\n//\t\t\n\tpublic String DISPLAY_PREVIOUS_ARROW=\"/images/Display_Previous_Page_Arrow.png\";\n//\t\n\tpublic String DISPLAY_NEXT_ARROW=\"/images/Display_Next_Page_Arrow.png\";\n\t\n//\tpublic String TO_FIRST_PAGE_BUTTON_IMG=\"/images/To_First_Page_Arrow.png\";\n//\t\n//\tpublic String TO_LAST_PAGE_BUTTON_IMG=\"/images/To_Last_Page_Arrow.png\";\n//\t\n//\tpublic String MAIN_FILL_ACTIVE=\"/images/S_Fill_Active.png\";\n//\t\n//\tpublic String PENDING_FILL_ACTIVE=\"/images/S_PendingFill_Active.png\";\n//\t\n//\tpublic String MANUAL_FILL_ACTIVE=\"/images/S_ManualFill_Active.png\";\n//\t\n//\tpublic String AREA_FILL_ACTIVE=\"/images/S_ZoneFill_Active.png\";\n//\t\n//\tpublic String BLEED_ACTIVE=\"/images/S_Bleed_Active.png\";\n\t\n\t//public String MAIN_FILL_INACTIVE=\"/images/S_Fill_Inactive.png\";\n\t\n\t//public String PENDING_FILL_INACTIVE=\"/images/S_PendingFill_Inactive.png\";\n\t\n\t//public String MANUAL_FILL_INACTIVE=\"/images/S_ManualFill_Inactive.png\";\n\t\n\t//public String AREA_FILL_INACTIVE=\"/images/ZoneFill_Inactive.png\";\n\t\n\t//public String BLEED_INACTIVE=\"/images/S_Bleed_Inactive.png\";\n\t\n\t//public String BEEF_INACTIVE=\"/images/S_Beef_Inactive.png\";\n\t\n\t//public String REPORT_INACTIVE=\"/images/S_Report_Inactive.png\";\n\t\n\t//public String AREA_FILL_DISABLED = \"/images/S_ZoneFill_Disabled.png\";\n\t\t\n//\tpublic String PENDING_FILL_DISABLED = \"/images/S_PendingFill_Disabled.png\";\n//\t\n//\tpublic String MAIN_FILL_DISABLED = \"/images/S_Fill_Disabled.png\";\n//\t\n//\tpublic String MANUAL_FILL_DISABLED = \"/images/S_ManualFill_Disabled.png\";\n//\t\n//\tpublic String DISPLAY_DISABLED = \"/images/S_Display_Disabled.png\";\n\t\n//\tpublic String BLEED_DISABLED = \"/images/S_Bleed_Disabled.png\";\n\n//\tpublic String CANCEL_BUTTON=\"/images/Cancel.png\";\n//\t\n//\tpublic String SLIPS_UI_IMG=\"/images/Slips_UI_Image.png\";\n//\t\n//\tpublic String SLIPS_UI_TEXT_IMG=\"/images/Slips_UI_Text.png\";\n\t\n//\tpublic String VOID_INACTIVE=\"/images/S_Void_Inactive.png\";\n\t\n//\tpublic String REPRINT_INACTIVE=\"/images/S_Reprint_Inactive.png\";\n\n//\tpublic String DISPLAY_ACTIVE=\"/images/S_Display_Active.png\";\n//\t\n//\tpublic String DISPLAY_INACTIVE=\"/images/S_Display_Inactive.png\";\n//\t\n//\tpublic String FOOTER_BACKGROUND=\"/images/FooterBG.png\";\n//\t\n//\tpublic String HOME_ICON=\"/images/HomeIcon.png\";\n//\t\n//\tpublic String SLIP_MODULE=\"/images/SlipsTab.png\";\n//\t\n//\tpublic String BALLY_LOGO=\"/images/BallyLogo_32x32.png\";\n//\t\n//\tpublic String PENDING_INACTIVE_BUTTON_IMG=\"/images/S_PendingFill_Inactive.png\";\n//\n//\tpublic String MANUAL_INACTIVE_BUTTON_IMG=\"/images/S_ManualFill_Inactive.png\";\n//\t\n\t\n//\tpublic String BLEED_INACTIVE_BUTTON_IMG=\"/images/S_Bleed_Inactive.png\";\n\n\t\n//\tpublic String DISPLAY_INACTIVE_BUTTON_IMG=\"/images/S_Display_Inactive.png\";\n\n//\tpublic String MODULE_LOGO=\"/images/SlipIcon.png\";\n\n\tpublic String RADIO_BUTTON_IMAGE=\"/images/RadioButton_Selected.png\";\n\t\n\t//FOR LARGER RESOLUTIONS\n\t\n\t//ACTIVE\n\tpublic String BEEF_ACTIVE=\"/images/touchscreen/bluetheme/Dispute_Active.png\";\n\t\n\tpublic String VOID_ACTIVE=\"/images/touchscreen/bluetheme/Void_Active.png\";\n\t\n\tpublic String REPRINT_ACTIVE=\"/images/touchscreen/bluetheme/Reprint_Active.png\";\n\t\n\tpublic String REPORT_ACTIVE=\"/images/touchscreen/bluetheme/Reports_Active.png\";\n\t\n\t//INACTIVE\n\tpublic String BEEF_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Dispute_Inactive.png\";\n\t\n\tpublic String VOID_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Void_Inactive.png\";\n\n\tpublic String REPRINT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reprint_Inactive.png\";\n\n\tpublic String REPORT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reports_Inactive.png\";\n\t\n\t//DISABLED\n\tpublic String BEEF_DISABLED = \"/images/touchscreen/bluetheme/Dispute_Disabled.png\";\n\t\n\tpublic String VOID_DISABLED = \"/images/touchscreen/bluetheme/Void_Disabled.png\";\n\t\n\tpublic String REPRINT_DISABLED = \"/images/touchscreen/bluetheme/Reprint_Disabled.png\";\n\t\n\tpublic String REPORT_DISABLED = \"/images/touchscreen/bluetheme/Reports_Disabled.png\";\n\t\n\t// Slip Images for 800*600 Resolution\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_ACTIVE=\"/images/touchscreen/bluetheme/Dispute_Active_Small.png\";//\"/images/J_Beef_Active.png\";\n\t\n\tpublic String SMALL_RESOLUTION_VOID_ACTIVE=\"/images/touchscreen/bluetheme/Void_Active_Small.png\";//\"/images/J_Void_Active.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_ACTIVE=\"/images/touchscreen/bluetheme/Reprint_Active_Small.png\";//\"/images/J_Reprint_Active.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_ACTIVE=\"/images/touchscreen/bluetheme/Reports_Active_Small.png\";//\"/images/J_Report_Active.png\";\n\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_INACTIVE=\"/images/touchscreen/bluetheme/Dispute_Inactive_Small.png\";//\"/images/J_Beef_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_VOID_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Void_Inactive_Small.png\";//\"/images/J_Void_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reprint_Inactive_Small.png\";//\"/images/J_Reprint_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_INACTIVE=\"/images/touchscreen/bluetheme/Reports_Inactive_Small.png\";//\"/images/J_Report_Inactive.png\";\n\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_DISABLED = \"/images/touchscreen/bluetheme/Dispute_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_VOID_DISABLED = \"/images/touchscreen/bluetheme/Void_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_DISABLED = \"/images/touchscreen/bluetheme/Reprint_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_DISABLED = \"/images/touchscreen/bluetheme/Reports_Disabled_Small.png\";\n\t\n\t\n\n\tpublic String SMALL_RESOLUTION_RADIO_BUTTON_IMAGE=\"/images/Small_RadioButton_Selected.png\";\n\n\t\n\t\n\t\n}", "public interface ClientConstants {\n char DOT_X = 'x'; // This is players dot\n char DOT_Y = 'o'; // This is AI dot\n char DOT_EMPTY = '.'; // Empty dot\n int WINDOW_SIZE_X = 516;\n int WINDOW_SIZE_Y = 565;\n int CELL_SIZE = 50;\n String BTN_NEW_GAME = \"New game\";\n String BTN_EXIT = \"Exit\";\n String[] mapSizeItems = {\"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}; // Array for comboBoxMapSize\n String[] winRowItems = {\"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}; // Array for comboBoxWinRow\n String SERVER_ADDRESS = \"localhost\";\n int PORT = 123;\n}", "@SuppressWarnings(\"unused\")\npublic interface Constants {\n /**\n * Extra data key. Used with intent or some others.\n */\n class Extras {\n public static final String TAG = \"ext_tag\";\n public static final String FLAG = \"ext_flag\";\n public static final String DATA = \"ext_data0\";\n public static final String DATA_1 = \"ext_data1\";\n public static final String DATA_2 = \"ext_data2\";\n public static final String DATA_3 = \"ext_data3\";\n public static final String DATA_4 = \"ext_data4\";\n public static final String DATA_5 = \"ext_data5\";\n public static final String DATA_6 = \"ext_data6\";\n public static final String DATA_7 = \"ext_data7\";\n public static final String DATA_8 = \"ext_data8\";\n public static final String GRADE_INFO = \"ext_grade_info\";\n public static final String MEMBER_VP_INFO = \"ext_member_vp_info\";\n public static final String MEMBER_VP_POSITION = \"ext_member_vp_position\";\n }\n\n\n}", "public interface Constants {\n int SERVER_PORT = 6001;\n String LOCALHOST = \"127.0.0.1\";\n\n String DEFAULT_PHONE_NUMBER = \"+380965354234\";\n\n}", "public interface MainConst extends NetUrl_Const {\n\t/**\n\t * 当为true时为商业模式,此时异常不抛出,日志不打印。关闭所有开发痕迹。\n\t */\n\tpublic final static boolean DEVS_BUSINESS_MODEL = false;\n\n\t/**\n\t * true时打印日志。<br/>\n\t * false不打印日志。\n\t */\n\tpublic final static boolean DEVS_PRINT_LOG = true;\n\t/**\n\t * true时抛出异常\n\t */\n\tpublic final static boolean DEVS_THROW_ALL_EXCEPTION = true;\n\n\t/**\n\t * app_token\n\t */\n\tpublic final static String APP_APP_TOKEN = \"readyGo1408.app_token@bj-china\";\n\t/**\n\t * MD5加密盐\n\t */\n\tpublic final static String APP_MD5_TOKEN = \"readyGo1408.md5@bj-china\";\n\t/**\n\t * 硬件平台,安卓平台\n\t */\n\tpublic final static String APP_PLATFORM = \"2\";\n}", "public interface LevelConstants {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\tString TAG_LEVEL = \"level\";\n\tString TAG_LEVEL_ATTRIBUTE_NAME = \"name\";\n\tString TAG_LEVEL_ATTRIBUTE_UID = \"uid\";\n\tString TAG_LEVEL_ATTRIBUTE_WIDTH = \"width\";\n\tString TAG_LEVEL_ATTRIBUTE_HEIGHT = \"height\";\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n}", "public interface PhotoConstants {\n String ADDRESS_GET_PHOTO = \"PhotoConstants:ADDRESS_GET_PHOTO\";\n\n String PARAM_ACTION = \"PARAM_ACTION\";\n String PARAM_ACTION_GET = \"PARAM_ACTION_GET\";\n\n String PARAM_SOURCE_URL = \"sourceUrl\";\n String PARAM_CACHE_URI = \"cacheUri\";\n String PARAM_IS_CIRCLE = \"isCircle\";\n String PARAM_IS_SYNC = \"isSync\";\n String PARAM_SUCCESS = \"success\";\n}", "public static int[] getConstArray(){\n return new int[]{NAME, PHONE, EMAIL, DATE, TIME, DATE_TIME, URL, PRICE, PHOTO, ITEM_LIST, PRICE_LIST, TEXT, MESSAGE, NUMBER, DECIMAL, DROPDOWN, CHECKBOX, RATING, SUBJECT};\n }", "public interface MyConstants {\n\n //ALL_PREFS\n TinyDB db = TinyDB.getInstance();\n String PREF_TRACKER_APP = \"PREF_TRACKER_APP\";\n String PREF_EMAIL = \"PREF_EMAIL\";\n String PREF_PASSWORD = \"PREF_PASSWORD\";\n String PREF_MOBILE_NUMBER = \"PREF_MOBILE_NUMBER\";\n\n //ALL_VARIABLES\n String LOCATION_TIME = \"time\";\n String POWER = \"power\";\n String LATITUDE = \"latitude\";\n String LONGITUDE = \"longitude\";\n String ALTITUDE = \"altitude\";\n String BEARING = \"bearing\";\n String SPEED = \"speed\";\n String PROVIDER = \"provider\";\n String ACCURACY = \"accuracy\";\n String ELAPSED_REAL_TIME_NANOS = \"elapsedRealtimeNanos\";\n String BEARING_ACCURACY_DEGREES = \"getBearingAccuracyDegrees\";\n String SPEED_ACCURACY_METER_PER_SECOND = \"getSpeedAccuracyMetersPerSecond\";\n String VERTICAL_ACCURACY_METERS = \"getVerticalAccuracyMeters\";\n}", "public interface STConstant {\n\n /** The base resource path for this application. */\n String BASE_RES_PATH = \"/com/sandy/stocktracker/\" ;\n\n /** The date format used for NSE EOD dates in the CSV files. */\n SimpleDateFormat DATE_FMT = new SimpleDateFormat( \"dd-MMM-yyyy\" ) ;\n\n /** The time format used for ITD title displays and general time displays. */\n SimpleDateFormat TIME_FMT = new SimpleDateFormat( \"HH:mm:ss\" ) ;\n\n /** The the expanded time format. */\n SimpleDateFormat DATE_TIME_FMT = new SimpleDateFormat( \"dd-MMM-yyyy HH:mm:ss\" ) ;\n\n /** The prefix for drop values indicating the drop value as scrip name. */\n String DROP_VAL_SCRIP = \"SCRIP:\" ;\n\n /** The application config key against which the install directory is specified. */\n String CFG_KEY_INSTALL_DIR = \"pluto.install.dir\" ;\n\n /** The application config key against which biz start hour is specified. */\n String CFG_KEY_NSE_BIZ_START_HR = \"nse.business.start.time\" ;\n\n /** The application config key against which biz end hour is specified. */\n String CFG_KEY_NSE_BIZ_END_HR = \"nse.business.end.time\" ;\n\n /** The number of days for which to show old news. */\n String CFG_KEY_NUM_OLD_DAYS_NEWS = \"news.display.num.days\" ;\n}", "public interface Constants {\n String NA = \"NA\";\n}", "private Constants() {\n throw new AssertionError();\n }", "private Constants(){\n }", "public interface MessageConstants {\n public static String WRONG_DATA=\"Wrong data!!!Try again:\";\n public static String INPUT_ADDRESS=\"Input address: \";\n public static String INPUT_PHONE=\"Input phone nummber:\";\n public static String INPUT_NICKNAMME=\"Input nickname:\";\n public static String Input_EMAIL=\"Input email:\";\n}", "public interface METHODS {\n public static int TIME = 0;\n public static int DISTANCE= 1;\n public static int STEPS = 2;\n public static int ACHIEVEMENTS = 3;\n }", "public interface ResponseConstants {\n\n String Bad_Request = \"The request was invalid or cannot be otherwise served\";\n String Authentication_failed = \"The request failed due to invalid credentials\";\n String Not_Found = \"No information available or the requested URL was not found on the server\";\n String Internal_Server_Error = \"Something is broken\";\n String Bad_Gateway = \"Oxford Dictionaries API is down or being upgraded\";\n String Service_Unavailable = \"The Oxford Dictionaries API servers are up, but overloaded with requests. Please try again later\";\n String Gateway_timeout = \"The Oxford Dictionaries API servers are up, but the request couldn’t be serviced due to some failure within our stack. Please try again later\";\n\n}", "public interface Constants {\r\n\r\n String ID = \"id\";\r\n String CREATED_AT = \"created_at\";\r\n String UPDATED_AT = \"updated_at\";\r\n String CREATED_BY = \"created_by\";\r\n String MODIFIED_BY = \"modified_by\";\r\n String DESCRIPTION = \"description\";\r\n String START_DATE = \"start_date\";\r\n String END_DATE = \"end_date\";\r\n String PLACE_HOLDER = \"{}\";\r\n String EMPTY = \"\";\r\n\r\n\r\n String USER_DETAIL = \"user_details\";\r\n\r\n String FILE_LOCATION = \"C:\\\\BVN\";\r\n String FILE_LOCATION_DECRYPTED = \"C:\\\\BVN\\\\decrypted\";\r\n String FILE_LOCATION_ENCRYPTED = \"C:\\\\BVN\\\\encrypted\";\r\n\r\n String ERROR_MESSAGE = \"Unable to process action, please try again\";\r\n\r\n String AGENT_ID_IS_REQUIRED = \"Agent Id is required\";\r\n String BRANCH_ID_IS_REQUIRED = \"Branch Id is required\";\r\n\r\n String SECRET_KEY = \"aeskey\";\r\n String IV = \"iv\";\r\n String USERNAME = \"username\";\r\n\r\n}", "public interface Constant {\n //api 说明\n //\n String API= \"/api\";\n\n String AJAXLOGIN =\"ajaxLogin\";\n\n String SAVE = \"register\";\n\n String FORGOT = \"forgot\";\n\n String SUCCESS = \"操作成功\";\n\n String FAIL = \"操作失败\";\n\n //说明\n String LOGIN_SUCCESS = \"登陆成功\";\n\n String PARMS_ERROR = \"参数错误\";\n\n String LOGIN_ERROR= \"账号或密码错误\";\n\n String SAVE_SUCCESS= \"保存成功\";\n\n String SAVE_ERROR= \"保存失败\";\n\n String GET_SUCCESS = \"获取详情成功\";\n\n String GET_ERROR = \"获取详情失败\";\n\n String REGISTER_SUCCESS= \"注册成功\";\n\n String REGISTER_ERROR= \"注册失败\";\n\n}", "private TOTPAuthenticatorConstants() {\n\t}", "public interface Constants {\n\n final public static String[] actionTypes = {\n \"ro.pub.cs.systems.eim.practicaltest01.actionType1\",\n \"ro.pub.cs.systems.eim.practicaltest01.actionType2\",\n \"ro.pub.cs.systems.eim.practicaltest01.actionType3\"\n };\n\n}", "public interface SourceConstants {\n\t\n\tfinal String BEAN_SUFFIX = \"Bean\";\n\tfinal String ACTION_SUFFIX = \"Action\";\n\tfinal String AMPERCEND = \"&\";\n\n\t\n\t\n\tfinal String HTML_BEGIN = \"<html xmlns=\\\"http://www.w3c.org/1999/xhtml\\\" xmlns:f=\\\"http://java.sun.com/jsf/core\\\" xmlns:h=\\\"http://java.sun.com/jsf/html\\\" xmlns:p=\\\"http://primefaces.org/ui\\\">\";\n\tfinal String HTML_CLOSE = \"</html>\"; \n\t\n\tfinal String HEAD_BEGIN = \"<h:head>\";\n\tfinal String HEAD_CLOSE = \"</h:head>\";\n\n\tfinal String BODY_BEGIN = \"<h:body>\";\n\tfinal String BODY_CLOSE = \"</h:body>\";\n\n\tfinal String FORM_BEGIN = \"<h:form>\";\n\tfinal String FORM_CLOSE = \"</h:form>\";\n\t\n\tfinal String CENTER = \"<center>\";\n\n\n}", "public interface ExtraConstant {\n\n String SERVER_CONFIG = \"server_config\"; // 需要服务器配置的数据\n /********************* 图片预览 ********************/\n String PREVIEW_IMAGE_DATA = \"preview_image_data\";//图片预览\n String PREVIEW_IMAGE_POSITION = \"preview_image_position\";//图片预览默认的显示位置\n String IS_ACTIVITY_INIT = \"is_activity_init\"; // 是否初始化\n String ACTIVITY_CONFIG = \"activity_config\";\n String TOKEN_ENTITY = \"token_entity\"; // 登录标识\n String USER_INFO = \"user_bean\"; // 用户信息\n String WEB_URL = \"web_url\"; // 网页地址\n String WEB_IS_ANALYSIS = \"web_is_analysis\"; // 是否统计\n String RIGHT_CUSTOM_TYPE = \"right_custom_type\"; // 右上角显示在线客服类型\n String CUSTOMDIALOG_TYPE = \"customdialog_type\"; // 自定义弹窗类型\n String EXTRA_VERSION = \"extra_version\";//版本\n String NEED_UPDATE = \"need_update\"; // 是否需要更新\n\n String REPAYMENT_TYPE = \"repayment_type\"; // 代偿模式\n\n}", "private FTConfigConstants() {\n }", "public interface KeyValueConst {\n\n String PUBLIC_KEY = \"PublicKey\";\n String PRIVATE_KEY = \"PrivateKey\";\n}", "public interface JpsubsitesSystemConstants {\r\n\t\r\n\t/**\r\n\t * The name of the Spring bean mapping the Subsite Manager.\r\n\t */\r\n\tpublic static final String SUBSITE_MANAGER = \"jpsubsitesSubsiteManager\";\r\n\t\r\n\t/**\r\n\t * The name of the configuration item containing the Subsites Configuration.\r\n\t */\r\n\tpublic static final String SUBSITE_CONFIG_ITEM = \"jpsubsites_subsiteConfig\";\r\n\t\r\n\t/**\r\n\t * The name of the request parameter containing the current subsite.\r\n\t */\r\n\tpublic static final String REQUEST_PARAM_CURRENT_SUBSITE = \"jpsubsites_currentSubsite\";\r\n\t\r\n\tpublic static final String CONTENT_LIST_HELPER = \"jpsubsitesContentListHelper\";\r\n\t\r\n\tpublic static final String BREADCRUMBS_NAVIGATION_PARSER = \"jpsubsitesBreadcrumbsNavigatorParser\";\r\n \r\n public static final String SUBSITE_SUFFIX_SEPARATOR = \"@\";\r\n \r\n public static final String SUBSITE_GROUP_PREFIX = \"subsite\";\r\n \r\n public static final String SESSION_PAR_CURRENT_SUBSITE = \"currentSubsite\";\r\n\t\r\n}", "public interface Constant {\n\n String JWT_SECRET = \"jwtsecret\";\n\n long EXP_TIME_LENGTH = 86400000;\n}", "public Constants() {\n }", "interface ExtConstants {\n public static final String[] IMAGE_EXTENSIONS = { \".tiff\", \".tif\", \".gif \", \".jpeg\", \".jpg\" };\n}", "public interface ConstantsKey {\n// Values\n String TEXT_FONT_STYLE_NAME=\"WorkSans_Regular.ttf\";\n// Urls\n String BASE_URL=\"http://test.code-apex.com/codeapex_project/index.php/api/user/\";\n String BASEURL =\"baseurl\" ;\n// Keys\n}", "public interface ProductTypeConstants {\n // 商品类型 1: 网课; 2: 图书\n Integer NETWORK_COURSE = 1;\n Integer BOOK = 2;\n}", "public interface Constant {\n int TIME_OUT = 30000;\n\n String POST = \"POST\";\n\n String GET = \"GET\";\n}", "public interface WebConstants {\n String SESSION_USER = \"user\";\n}", "public String toString() {\n return super.toString() + \" (\" + constants.size() + \" constants)\";\n }", "public interface Const {\n String SERVER_NAME = \"http://xxx.kenit.net/\";\n String SERVER_PATH = \"http://xxx.kenit.net/androidpart/\";\n String GET_PRODUCT_FILE = \"getproduct.php\";\n}", "public interface Constants {\n public static final short NET_MASK_MAX_LENGTH = 32;\n}", "private CellManagerConstants() { \r\n throw new AssertionError();\r\n }", "public interface BentoConstants extends com.google.gwt.i18n.client.Constants {\n \n /**\n * Translated \"BentoConstants\".\n * \n * @return translated \"BentoConstants\"\n * @gwt.key ClassName\n */\n String ClassName();\n}" ]
[ "0.71057093", "0.6953012", "0.69476205", "0.6896244", "0.68757063", "0.6851217", "0.684965", "0.6842036", "0.67941666", "0.6753452", "0.67505807", "0.6732311", "0.6680983", "0.662809", "0.6621216", "0.66187066", "0.66026175", "0.6581152", "0.65515053", "0.65440434", "0.6541494", "0.6541036", "0.65315133", "0.6527353", "0.6524925", "0.65076804", "0.65066", "0.64958495", "0.6474952", "0.6468481", "0.6454204", "0.6431162", "0.64258856", "0.6365168", "0.63601553", "0.63388956", "0.63380927", "0.6334205", "0.63142294", "0.6310195", "0.6303319", "0.6301176", "0.6298466", "0.6288726", "0.62859094", "0.6271755", "0.6271755", "0.626886", "0.62511903", "0.6244572", "0.6239624", "0.62328947", "0.6222973", "0.62211734", "0.6218518", "0.62062305", "0.6202888", "0.61960804", "0.61890966", "0.6177586", "0.6175716", "0.6167422", "0.6145185", "0.61344594", "0.6129975", "0.6128061", "0.6117331", "0.6116493", "0.61088234", "0.6108434", "0.61059904", "0.6099258", "0.6093841", "0.60830486", "0.6073786", "0.6071236", "0.60517937", "0.60514134", "0.60451394", "0.60048795", "0.6004482", "0.59962964", "0.5995972", "0.59912235", "0.5983009", "0.5972217", "0.59567213", "0.5954515", "0.5949693", "0.59485096", "0.5945405", "0.59421873", "0.5940705", "0.5938159", "0.59364575", "0.59329927", "0.59313166", "0.59312165", "0.5930424", "0.5921044" ]
0.697595
1
private static Logger logger = LoggerFactory.getLogger(PropertiesConfigUtil.class);
public static void main(String[] args) { String realPath = getFileRealPath("config/docService.properties"); getPropertiesConfigByResourceRealPath(realPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logProperties() {\n log.info(\"externalPropertiesConfiguration::whoAmI = {}\", this.externalPropertiesConfiguration.getWhoAmI());\n log.info(\"externalPropertiesConfiguration::propertyOne = {}\", this.externalPropertiesConfiguration.getPropertyOne());\n log.info(\"externalPropertiesConfiguration::propertyTwo = {}\", this.externalPropertiesConfiguration.getPropertyTwo());\n log.info(\"externalPropertiesConfiguration::propertyThree = {}\", this.externalPropertiesConfiguration.getPropertyThree());\n log.info(\"externalPropertiesConfiguration::propertyFour = {}\", this.externalPropertiesConfiguration.getPropertyFour());\n\n log.info(\"anotherPropertiesConfiguration::whoAmI = {}\", this.anotherPropertiesConfiguration.getWhoAmI());\n log.info(\"anotherPropertiesConfiguration::propertyOne = {}\", this.anotherPropertiesConfiguration.getPropertyOne());\n log.info(\"anotherPropertiesConfiguration::propertyTwo = {}\", this.anotherPropertiesConfiguration.getPropertyTwo());\n log.info(\"anotherPropertiesConfiguration::propertyThree = {}\", this.anotherPropertiesConfiguration.getPropertyThree());\n log.info(\"anotherPropertiesConfiguration::propertyFour = {}\", this.anotherPropertiesConfiguration.getPropertyFour());\n }", "private static void logProperties(final MicroConfig config) {\n StringWriter sw = new StringWriter();\n config.list(new PrintWriter(sw));\n String props = sw.toString().replace('\\n', ',').replace('\\r', ' ');\n logger.debug(\"Config \"+props);\n }", "private PropertiesUtils() {}", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "void initializeLogging(String loggingProperties);", "public static synchronized void initializeLogger() {\n\t\t\n\t try {\n\t\t String workingDir = System.getProperty(\"user.dir\");\n\t\t String fileName = workingDir + File.separator + \"config\" + File.separator + \"logging.properties\";\n\t\t \n\t\t FileInputStream fileInputStream = new FileInputStream(fileName);\n\t\t LogManager.getLogManager().readConfiguration(fileInputStream);\n\t\t \n\t } catch (IOException ex) {\n\t\t System.err.println(\"Failed to load logging.properlies, please check the file and the path:\" + ex.getMessage()); \n\t ex.printStackTrace();\n\t System.exit(0);\n\t }\n\t}", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "private void repetitiveWork(){\n\t PropertyConfigurator.configure(\"log4j.properties\");\n\t log = Logger.getLogger(BackupRestore.class.getName());\n }", "private static synchronized Properties getLoggingProperties() {\n if (_hasLoggingProperties && (_loggingProperties == null)) {\n String fileName = System.getProperty(\n \"java.util.logging.config.file\"); // NOI18N\n\n if (fileName == null) {\n fileName = System.getProperty(\"java.home\");\t// NOI18N\n\n if (fileName != null) {\n File file = new File(fileName, \"lib\");\t// NOI18N\n\n file = new File(file, \"logging.properties\");\t// NOI18N\n\n try {\n fileName = file.getCanonicalPath();\n } catch (IOException ioe) {\n fileName = null;\n }\n }\n }\n\n if (fileName != null) {\n InputStream inputStream = null;\n File file = null;\n\n try {\n Properties properties = new Properties();\n BufferedInputStream bufferedInputStream = null;\n\n inputStream = new FileInputStream(fileName);\n bufferedInputStream = new BufferedInputStream(inputStream);\n properties.load(bufferedInputStream);\n _loggingProperties = properties;\n } catch (Exception e) {\n _hasLoggingProperties = false;\n } finally {\n if (inputStream != null) {\n try {\n inputStream.close();\n } catch (IOException ioe) {\n // couldn't close it for some reason\n }\n }\n }\n } else {\n _hasLoggingProperties = false;\n }\n }\n\n return _loggingProperties;\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "public void setup (SProperties config) throws IOException {\n\tString sysLogging =\n\t System.getProperty (\"java.util.logging.config.file\");\n\tif (sysLogging != null) {\n\t System.out.println (\"Logging configure by system property\");\n\t} else {\n\t Logger eh = getLogger (config, \"error\", null, \"rabbit\",\n\t\t\t\t \"org.khelekore.rnio\");\n\t eh.info (\"Log level set to: \" + eh.getLevel ());\n\t}\n\taccessLog = getLogger (config, \"access\", new AccessFormatter (),\n\t\t\t \"rabbit_access\");\n }", "@BeforeClass\n\tpublic void setup() {\n\t\tlogger = Logger.getLogger(\"AveroRestAPI\");\n\t\tPropertyConfigurator.configure(\"Log4j.properties\");\n\t\tlogger.setLevel(Level.DEBUG);\n\n\t}", "public static void getLoggerConfiguration() {\n\t\tPropertyConfigurator.configure(System.getProperty(\"user.dir\")+ \"\\\\Config\\\\log4j.properties\");\n\t}", "void initializeLogging();", "private Logger getLogger() {\n return LoggerFactory.getLogger(ApplicationManager.class);\n }", "private ExtentLogger() {}", "public Slf4jLogService() {\n this(System.getProperties());\n }", "private void initLogger(BundleContext bc) {\n\t\tBasicConfigurator.configure();\r\n\t\tlogger = Logger.getLogger(Activator.class);\r\n\t\tLogger.getLogger(\"org.directwebremoting\").setLevel(Level.WARN);\r\n\t}", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "private Logger configureLogging() {\r\n\t Logger rootLogger = Logger.getLogger(\"\");\r\n\t rootLogger.setLevel(Level.FINEST);\r\n\r\n\t // By default there is one handler: the console\r\n\t Handler[] defaultHandlers = Logger.getLogger(\"\").getHandlers();\r\n\t defaultHandlers[0].setLevel(Level.CONFIG);\r\n\r\n\t // Add our logger\r\n\t Logger ourLogger = Logger.getLogger(serviceLocator.getAPP_NAME());\r\n\t ourLogger.setLevel(Level.FINEST);\r\n\t \r\n\t // Add a file handler, putting the rotating files in the tmp directory \r\n\t // \"%u\" a unique number to resolve conflicts, \"%g\" the generation number to distinguish rotated logs \r\n\t try {\r\n\t Handler logHandler = new FileHandler(\"/%h\"+serviceLocator.getAPP_NAME() + \"_%u\" + \"_%g\" + \".log\",\r\n\t 1000000, 3);\r\n\t logHandler.setLevel(Level.FINEST);\r\n\t ourLogger.addHandler(logHandler);\r\n\t logHandler.setFormatter(new Formatter() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String format(LogRecord record) {\r\n\t\t\t\t\t\tString result=\"\";\r\n\t\t\t\t\t\tif(record.getLevel().intValue() >= Level.WARNING.intValue()){\r\n\t\t\t\t\t\t\tresult += \"ATTENTION!: \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd-MMM-yyyy HH:mm:ss\");\r\n\t\t\t\t\t\tDate d = new Date(record.getMillis());\r\n\t\t\t\t\t\tresult += df.format(d)+\" \";\r\n\t\t\t\t\t\tresult += \"[\"+record.getLevel()+\"] \";\r\n\t\t\t\t\t\tresult += this.formatMessage(record);\r\n\t\t\t\t\t\tresult += \"\\r\\n\";\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t } catch (Exception e) { // If we are unable to create log files\r\n\t throw new RuntimeException(\"Unable to initialize log files: \"\r\n\t + e.toString());\r\n\t }\r\n\r\n\t return ourLogger;\r\n\t }", "protected static Logger initLogger() {\n \n \n File logFile = new File(\"workshop2_slf4j.log\");\n logFile.delete();\n return LoggerFactory.getLogger(Slf4j.class.getName());\n }", "static Properties getConfig()\n {\n return(config);\n }", "static void logBuildInfo() throws IOException {\n\n \tClassPathResource propertiesResource = new ClassPathResource(\"application.properties\");\n \t\n \tURL url = propertiesResource.getURL();\n \tlogger.info(\"config url: \"+url);\n\n \t// \"Build-Timestamp\"\n \tif( url.toString().startsWith(\"jar:\") ) {\n\t\t\tManifest manifest = ((JarURLConnection)url.openConnection()).getManifest();\n\t\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\t\toutputStream.write(\"#jar manifest \\n\".getBytes());\n\t\t\tmanifest.write(outputStream);\n\t\t\tlogger.info(outputStream.toString());\n\t \t\n\t\t\ttry(InputStream propertiesInputStream = propertiesResource.getInputStream()) {\n\t\t\t\tProperties props = new Properties();\n\t\t\t\tprops.load(propertiesInputStream);\n\t\t\t\tByteArrayOutputStream propertiesOutputStream = new ByteArrayOutputStream();\n\t\t\t\tprops.store(propertiesOutputStream, \"application.properties\");\n\t\t\t\tlogger.info(propertiesOutputStream.toString());\n\t\t\t}\n \t}\n }", "private ConfigProperties() {\n\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tLogger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);\n\t\troot.setLevel(Level.INFO);\n\t}", "private void initLoggers() {\n _logger = LoggerFactory.getInstance().createLogger();\n _build_logger = LoggerFactory.getInstance().createAntLogger();\n }", "private HeaderBrandingTest()\n\t{\n\t\tBaseTest.classLogger = LoggerFactory.getLogger( HeaderBrandingTest.class );\n\t}", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "private JavaUtilLogHandlers() { }", "private void configure() {\r\n LogManager manager = LogManager.getLogManager();\r\n String className = this.getClass().getName();\r\n String level = manager.getProperty(className + \".level\");\r\n String filter = manager.getProperty(className + \".filter\");\r\n String formatter = manager.getProperty(className + \".formatter\");\r\n\r\n //accessing super class methods to set the parameters\r\n\r\n\r\n }", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "public static LoggerType init(Properties properties) {\n\n var loggerProperties = getLoggerProperties(properties);\n\n // fetch and verify definitions of some properties\n try {\n setOverrideLogbackLevels(loggerProperties);\n\n setLoggerLevel(loggerProperties, \"debugLogger.level\", \"INFO\", PolicyLogger::setDebugLevel);\n\n // Only check if it is to turn on or off\n setLoggerOnOff(loggerProperties, \"metricsLogger.level\", PolicyLogger::setMetricsLevel);\n setLoggerOnOff(loggerProperties, \"audit.level\", PolicyLogger::setAuditLevel);\n setLoggerOnOff(loggerProperties, \"error.level\", PolicyLogger::setErrorLevel);\n\n isEventTrackerRunning = false;\n\n timerDelayTime = getIntProp(loggerProperties, \"timer.delay.time\", timerDelayTime);\n checkInterval = getIntProp(loggerProperties, \"check.interval\", checkInterval);\n expiredTime = getIntProp(loggerProperties, \"event.expired.time\", expiredTime);\n concurrentHashMapLimit = getIntProp(loggerProperties, \"concurrentHashMap.limit\", concurrentHashMapLimit);\n stopCheckPoint = getIntProp(loggerProperties, \"stop.check.point\", stopCheckPoint);\n\n component = loggerProperties.getProperty(\"policy.component\", \"DROOLS\");\n debugLogger.info(\"component: {}\", component);\n\n return detmLoggerType(loggerProperties);\n\n } catch (Exception e) {\n MDC.put(ERROR_CATEGORY, ERROR_CATEGORY_VALUE);\n\n if (ErrorCodeMap.getErrorCodeInfo(MessageCodes.GENERAL_ERROR) != null) {\n MDC.put(ERROR_CODE, ErrorCodeMap.getErrorCodeInfo(MessageCodes.GENERAL_ERROR).getErrorCode());\n MDC.put(ERROR_DESCRIPTION, ErrorCodeMap.getErrorCodeInfo(MessageCodes.GENERAL_ERROR).getErrorDesc());\n\n }\n errorLogger.error(\"failed to get the policyLogger.properties, so use their default values\", e);\n\n return LoggerType.EELF;\n }\n\n }", "private void setupLogging() {\n\t\t// Ensure all JDK log messages are deferred until a target is registered\n\t\tLogger rootLogger = Logger.getLogger(\"\");\n\t\tHandlerUtils.wrapWithDeferredLogHandler(rootLogger, Level.SEVERE);\n\n\t\t// Set a suitable priority level on Spring Framework log messages\n\t\tLogger sfwLogger = Logger.getLogger(\"org.springframework\");\n\t\tsfwLogger.setLevel(Level.WARNING);\n\n\t\t// Set a suitable priority level on Roo log messages\n\t\t// (see ROO-539 and HandlerUtils.getLogger(Class))\n\t\tLogger rooLogger = Logger.getLogger(\"org.springframework.shell\");\n\t\trooLogger.setLevel(Level.FINE);\n\t}", "private PropertyUtil(){\n\t\ttry{\n\t\t\tloadURL();\n\t\t\tRuntime.getRuntime().addShutdownHook(new UtilShutdownHook());\n\t\t}catch(IOException ioe){\n\t\t\tLOGGER.error(\"Unable to load Property File\\n\"+ioe);\n\t\t}\n\t\tLOGGER.debug(\"INSTANTIATED\");\n\t}", "private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }", "public interface LogBootstrap {\n /**\n * Launch the logging system\n * @param properties - the full set of overlayed properties to bootstrap the logger\n * @throws IOException\n */\n public void init(Properties properties) throws IOException;\n}", "private void configureLogging() throws FileNotFoundException, IOException {\n\t\tConfigurationSource source = new ConfigurationSource(new FileInputStream(CONFIG_LOG_LOCATION));\r\n\t\tConfigurator.initialize(null, source);\r\n\t\tlog = LogManager.getLogger(SekaiClient.class);\r\n\t}", "Map<String, Logger> loggers();", "private void configureLogLevels()\r\n { \r\n String level = properties.getProperty(\"LogLevel\");\r\n \r\n switch(level)\r\n {\r\n case \"INFO\": INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.FINE;\r\n break;\r\n case \"DEBUG\": INFO = Level.INFO;\r\n DEBUG = Level.INFO; \r\n WARNING = Level.INFO;\r\n break;\r\n case \"WARNING\": INFO = Level.FINE; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.INFO; \r\n break;\r\n default: INFO = Level.INFO; \r\n DEBUG = Level.FINE; \r\n WARNING = Level.WARNING;\r\n break;\r\n }\r\n }", "private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "private Logger() {\n\n }", "public interface LogConfig {\n\tLogCfg getLogCfg();\n}", "public ModularConfiguration(Logger logger) {\n this.logger = logger;\n }", "public interface LoggerUtil {\n\t/**\n\t * Set the logger for the controller\n\t * \n\t * @param logName\n\t * @param filePath\n\t * @param logLevel\n\t * @return\n\t */\n\tLogger loggerArrangement(String logName, String filePath, LogeLevel logLevel);\n}", "public LogProfileProperties() {\n }", "@Before\n public void setUp() throws Exception {\n logger.setLevel(Level.DEBUG);\n }", "public void configLog()\n\t{\n\t\tlogConfigurator.setFileName(Environment.getExternalStorageDirectory() + File.separator + dataFileName);\n\t\t// Set the root log level\n\t\t//writerConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\t///writerConfigurator.setMaxFileSize(1024 * 1024 * 500);\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 1024);\n\t\t// Set log level of a specific logger\n\t\t//writerConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setImmediateFlush(true);\n\t\t//writerConfigurator.configure();\n\t\tlogConfigurator.configure();\n\n\t\t//gLogger = Logger.getLogger(this.getClass());\n\t\t//gWriter = \n\t\tgLogger = Logger.getLogger(\"vdian\");\n\t}", "void setupFileLogging();", "private LoggerSingleton() {\n\n }", "@PostConstruct\n private void init() {\n\n log.info(\"Singleton initialized; properties are: {}\", propertiesToString());\n }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "@BeforeAll\n public static void configureLogger() {\n new SuperStructure(null, null, null, null, null);\n\n Logger.configure(null);\n Logger.start();\n }", "@Before\r\n public void setUp() throws Exception {\r\n PropertyConfigurator.configure(\"test_files/log4j.properties\");\r\n\r\n LogManager.setLogFactory(new Log4jLogFactory());\r\n log = LogManager.getLog(this.getClass().getName());\r\n\r\n paramNames = new String[] {\"p1\", \"p2\"};\r\n paramValues = new Object[] {123, \"abc\"};\r\n\r\n value = new Object[] {\"result\"};\r\n exception = new Exception(\"Exception for testing.\");\r\n }", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "private LoggerConstants() {\n\t\tsuper();\n\t}", "public static PropertiesUtil getInstance(){\n if (instance == null) {\n synchronized (PropertiesUtil.class){\n instance = new PropertiesUtil();\n instance.loadProperties();\n }\n }\n return instance;\n }", "public void setupLogging() {\n\t\ttry {\n\t\t\t_logger = Logger.getLogger(QoSModel.class);\n\t\t\tSimpleLayout layout = new SimpleLayout();\n\t\t\t_appender = new FileAppender(layout,_logFileName+\".txt\",false);\n\t\t\t_logger.addAppender(_appender);\n\t\t\t_logger.setLevel(Level.ALL);\n\t\t\tSystem.setOut(createLoggingProxy(System.out));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private Logger(){ }", "public void getProperties() throws IllegalArgumentException, IllegalAccessException {\r\n\t\t Class<?> aClass = this.getClass();\r\n\t\t Field[] declaredFields = aClass.getDeclaredFields();\r\n\t\t Map<String, String> logEntries = new HashMap<>();\r\n\r\n\t\t for (Field field : declaredFields) {\r\n\t\t field.setAccessible(true);\r\n\r\n\t\t Object[] arguments = new Object[]{\r\n\t\t field.getName(),\r\n\t\t field.getType().getSimpleName(),\r\n\t\t String.valueOf(field.get(this))\r\n\t\t };\r\n\r\n\t\t String template = \"- Property: {0} (Type: {1}, Value: {2})\";\r\n\t\t String logMessage = System.getProperty(\"line.separator\")\r\n\t\t + MessageFormat.format(template, arguments);\r\n\r\n\t\t logEntries.put(field.getName(), logMessage);\r\n\t\t }\r\n\r\n\t\t SortedSet<String> sortedLog = new TreeSet<>(logEntries.keySet());\r\n\r\n\t\t StringBuilder sb = new StringBuilder(\"Class properties:\");\r\n\r\n\t\t Iterator<String> it = sortedLog.iterator();\r\n\t\t while (it.hasNext()) {\r\n\t\t String key = it.next();\r\n\t\t sb.append(logEntries.get(key));\r\n\t\t }\r\n\r\n\t\t System.out.println(sb.toString());\r\n\t\t}", "public synchronized static PropertiesUtil getInstance() {\n if(INSTANCE == null) {\n INSTANCE = new PropertiesUtil();\n }\n return INSTANCE;\n }", "public void configLogger() {\n Logger.addLogAdapter(new AndroidLogAdapter());\n }", "static void getProp() throws Exception {\r\n\r\n\t\tFileInputStream fileInputStream = new FileInputStream(\r\n\t\t\t\t\"C:\\\\repos\\\\test\\\\src\\\\main\\\\java\\\\test\\\\config.properties\");\r\n\r\n\t\tProperties properties = new Properties();\r\n\t\tproperties.load(fileInputStream);\r\n\r\n\t\tSystem.out.println(\"By using File Input stream class: \" + properties.getProperty(\"username\"));\r\n\r\n\t}", "@BeforeClass\n public static void setupClass() {\n build = System.getenv(\"BUILD\");\n \n File logFile = new File(LOG_FILE);\n if(!logFile.exists()) {\n System.out.println(\"Creating log file\");\n try {\n logFile.createNewFile();\n System.out.println(\"Created log file: \" + logFile.getPath());\n } catch (IOException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n }\n }\n \n try {\n FileHandler fileHandler = new FileHandler(logFile.getPath());\n fileHandler.setFormatter(new LogFormatter());\n LOGGER.addHandler(fileHandler);\n \n } catch (SecurityException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n } catch (IOException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n }\n \n LOGGER.setUseParentHandlers(false);\n \n }", "private static void initLogger() {\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n System.out.println(\"\");\n System.out.println(\"=> Begin System Logging Configuration\");\n URL fileUrl = null;\n String filePath = null;\n\n try {\n final Region region = EnvironmentConfiguration.getRegion();\n filePath = \"log4j-\" + region.getCode() + \".xml\";\n System.out.println(\"=> searching for log configuration file : \" + filePath);\n fileUrl = LogFactory.class.getResource(\"/\" + filePath);\n DOMConfigurator.configure(fileUrl);\n System.out.println(\"=> found log configuration file : \" + fileUrl);\n System.out.println(\"=> System Logging has been initialized\");\n }\n catch (final NoClassDefFoundError ncdf) {\n System.out.println(\"=> Logging Configuration Failed\");\n System.err.println(LogFactory.class.getName()\n + \"::loadProps() - Unable to find needed classes. Logging disabled. \" + ncdf);\n }\n catch (final Exception e) {\n System.out.println(\"=> Logging Configuration Failed\");\n System.err.println(\n LogFactory.class.getName() + \"::loadProps() - Unable to initialize logger from file=\"\n + filePath + \". Logging disabled.\");\n }\n System.out.println(\"=> End System Logging Configuration\");\n System.out.println(\"\");\n }", "@BeforeClass\n public static void beforeClass()\n throws Exception\n {\n LoggerConfiguration.logSetup();\n }", "public SystemConfiguration() {\r\n\t\tlog = Logger.getLogger(SystemConfiguration.class);\r\n\t}", "public LoggerConfigBean() {\n super();\n }", "public Logger getLogger() {\t\t\n\t\treturn logger = LoggerFactory.getLogger(getClazz());\n\t}", "public void setLogUtilities(LogUtilities log) { this.log = log; }", "public static Logger get() {\n\t\treturn LoggerFactory.getLogger(WALKER.getCallerClass());\n\t}", "protected Logger getLogger() {\n return LoggerFactory.getLogger(getClass());\n }", "private ConfigProperties getProperties() {\n return properties;\n }", "public Logger getLogger() {\n\treturn _logger;\n }", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "private Logger(){\n\n }", "public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }", "public synchronized static void initConfig() {\n SeLionLogger.getLogger().entering();\n Map<ConfigProperty, String> initialValues = new HashMap<>();\n\n initConfig(initialValues);\n\n SeLionLogger.getLogger().exiting();\n }", "@Override\r\n\tpublic Logger getLogger() {\r\n\t\t\r\n\t\treturn LogFileGenerator.getLogger();\r\n\t\t\r\n\t}", "public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }", "protected abstract Logger getLogger();", "public MyLogger () {}", "static void getProps() throws Exception {\r\n\t\tFileReader fileReader = new FileReader(\"C:\\\\repos\\\\test\\\\src\\\\main\\\\java\\\\test\\\\config.properties\");\r\n\t\tProperties properties = new Properties();\r\n\r\n\t\tproperties.load(fileReader);\r\n\r\n\t\tSystem.out.println(\"By using File Reader: \" + properties.getProperty(\"username\"));\r\n\r\n\t}", "public static void initLoad() throws Exception {\n\n String configPath = System.getProperty(\"config.dir\") + File.separatorChar + \"config.cfg\";\n System.out.println(System.getProperty(\"config.dir\"));\n \n Utils.LoadConfig(configPath); \n /*\n \n // log init load \n String dataPath = System.getProperty(\"logsDir\");\n if(!dataPath.endsWith(String.valueOf(File.separatorChar))){\n dataPath = dataPath + File.separatorChar;\n }\n String logDir = dataPath + \"logs\" + File.separatorChar;\n System.out.println(\"logdir:\" + logDir);\n System.setProperty(\"log.dir\", logDir);\n System.setProperty(\"log.info.file\", \"info_sync.log\");\n System.setProperty(\"log.debug.file\", \"error_sync.log\");\n PropertyConfigurator.configure(System.getProperty(\"config.dir\") + File.separatorChar + \"log4j.properties\");\n */\n }", "@Test\n public void configure()\n {\n String message = \"This message should be logged\";\n \n LoggingBean loggingBean = new LoggingBean();\n loggingBean.log(message);\n assertTrue(SYSTEM_OUT_REDIRECT.toString().contains(message));\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tgetLogManager().init();\n\t}", "private static void initializeLog(Properties config)\n {\n // log.file.level = [ ALL | DEBUG | INFO | WARN | ERROR | FATAL ]\n\n try\n {\n PatternLayout layout;\n\n String pattern = config.getProperty(\"log.file.layout\");\n if (null == pattern)\n {\n layout = new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN);\n }\n else\n {\n layout = new PatternLayout(pattern);\n }\n // System.out.println(\"Log4j pattern = \" + pattern);\n // System.out.println(\"Log4j layout = \" + layout);\n\n String fileName = basedir + File.separator + config.getProperty(\"log.dir\") +\n File.separator + config.getProperty(\"log.file\");\n // System.out.println(\"Log4j fileName = \" + fileName);\n\n RollingFileAppender appender = new RollingFileAppender(layout, fileName, true);\n appender.setMaxFileSize(config.getProperty(\"log.file.max.size\"));\n int maxBackup = 14; // default if property not available\n try\n {\n maxBackup = Integer.parseInt(config.getProperty(\"log.file.max.backup\"));\n }\n catch (NumberFormatException e) { }\n appender.setMaxBackupIndex(maxBackup);\n // System.out.println(\"Log4j maxBackup = \" + maxBackup);\n\n Logger log = Logger.getRootLogger();\n log.addAppender(appender);\n log.setLevel(Level.toLevel(config.getProperty(\"log.file.priority\")));\n }\n catch (IOException e)\n {\n System.err.println(\"FAILURE: Error opening log file\");\n System.err.println(e.getMessage());\n System.exit(BAD_RUN);\n }\n }", "public Logger (){}", "private PropertiesHelper() {\n throw new AssertionError(\"Cannot instantiate this class\");\n }", "Map<String, String> getConfigProperties();", "public String getLoggerName() {\n return \"test\";\n }", "Properties getProperties();", "private static DefaultLogger getConsoleLogger() {\n DefaultLogger consoleLogger = new DefaultLogger();\n consoleLogger.setErrorPrintStream(System.err);\n consoleLogger.setOutputPrintStream(System.out);\n consoleLogger.setMessageOutputLevel(Project.MSG_INFO);\n \n return consoleLogger;\n }", "private LogUtil() {\r\n /* no-op */\r\n }", "@BeforeClass\n public static void setUpClass() {\n final Properties p = new Properties();\n p.put(\"log4j.appender.Remote\", \"org.apache.log4j.net.SocketAppender\");\n p.put(\"log4j.appender.Remote.remoteHost\", \"localhost\");\n p.put(\"log4j.appender.Remote.port\", \"4445\");\n p.put(\"log4j.appender.Remote.locationInfo\", \"true\");\n p.put(\"log4j.rootLogger\", \"ALL,Remote\");\n PropertyConfigurator.configure(p);\n }", "Appendable getLog();", "public Logger getLogger(){\n\t\treturn logger;\n\t}", "@Override\n\tprotected PublicationControlLogger getLogger() {\n\t\treturn logger;\n\t}", "public Map<String, String> fetchPropertyFromFile()\n {\n Map<String, String> components = new HashMap<>();\n Properties props = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(\"/slog/properties/LogAnalyzer.properties\");\n props.load(in);\n in.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n catch (IOException e) {\n e.printStackTrace();\n }\n// Add component config , logname RegEx pattern to a Map. This map will be used to search matching files and forming logstash command\n for (String key : props .stringPropertyNames())\n {\n System.out.println(key + \" = \" + props .getProperty(key));\n components.put (key, props.getProperty(key));\n }\n\n return components;\n }", "private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}", "public static Logger logger() {\n return logger;\n }" ]
[ "0.6655808", "0.65820223", "0.6527399", "0.65217936", "0.6423571", "0.6404523", "0.6316277", "0.6277103", "0.6259883", "0.62598413", "0.62246823", "0.6190038", "0.61710954", "0.6167151", "0.6155008", "0.615084", "0.6133244", "0.6125069", "0.61189437", "0.61099905", "0.6103518", "0.6097572", "0.6091384", "0.60787755", "0.60623723", "0.6036575", "0.6036567", "0.6022798", "0.6021282", "0.59848726", "0.5968437", "0.5949189", "0.5910648", "0.590341", "0.5891086", "0.58672273", "0.58593935", "0.585041", "0.584771", "0.5839356", "0.58343166", "0.5828625", "0.5807934", "0.5795152", "0.57845044", "0.5780239", "0.57760316", "0.57722324", "0.5770598", "0.57623166", "0.575415", "0.57368326", "0.5730674", "0.5720373", "0.5720231", "0.5710474", "0.57082784", "0.57016176", "0.5696645", "0.5692508", "0.5690981", "0.5689492", "0.5676862", "0.5676374", "0.5675345", "0.56735265", "0.5672874", "0.56641203", "0.5657256", "0.56559825", "0.56553215", "0.5654821", "0.5648068", "0.5646299", "0.5643861", "0.5640659", "0.5640547", "0.5632025", "0.5623237", "0.56200135", "0.56104016", "0.56084937", "0.5606928", "0.56042814", "0.56033885", "0.5597539", "0.558353", "0.5582227", "0.5581731", "0.55799246", "0.55781746", "0.5575787", "0.5571824", "0.5571291", "0.5563062", "0.5546468", "0.55433625", "0.5542673", "0.55371475", "0.55360705", "0.553252" ]
0.0
-1
Given existing customer in db
@Test public void existing_customer_should_be_found() { final String customerId = "123e4567-e89b-42d3-a456-556642440000"; // When final Customer customer = customerRepository.findById(customerId); // Then assertThat(customer).isNotNull(); assertThat(customer.getId()).isEqualTo(customerId); assertThat(customer.getName()).isEqualTo("NAME1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setExistingCustomer(Customer existingCustomer) { this.existingCustomer = existingCustomer; }", "public boolean addCustomer(Customer customer) throws DatabaseOperationException;", "Customer createCustomer();", "Customer createCustomer();", "Customer createCustomer();", "Customer createCustomer();", "Customer getCustomerById(int customerId);", "Customers createCustomers();", "public Customer findCustomerById(long id) throws DatabaseOperationException;", "private Customer storeCustomer(Customer customer){\n customerRestService.createCustomer(customer);\n return customer;\n }", "@Override\n\tpublic void saveCustomer(Customer theCustomer){\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n//\t\tcurrentSession.createQuery(\"from Customer c where c.firstName=\"+ theCustomer.getFirstName()).executeUpdate();\n\n\t\tQuery<Customer> query =\n\t\t\t\tcurrentSession.createQuery(\"select c from Customer c \"+\n\t\t\t\t\t\t\t\t\"where c.firstName =:theCustomerFirstName and \" +\n\t\t\t\t\t\t\t\t\"c.lastName =:theCustomerLastName and \" +\n\t\t\t\t\t\t\t\t\"c.email=:theCustomerEmail\",\n\t\t\t\t\t\t Customer.class);\n\n\t\t// set parameter on query\n\t\tquery.setParameter(\"theCustomerFirstName\", theCustomer.getFirstName());\n\t\tquery.setParameter(\"theCustomerLastName\", theCustomer.getLastName());\n\t\tquery.setParameter(\"theCustomerEmail\", theCustomer.getEmail());\n\n\t\ttry {\n\t\t\t// execute query and get instructor\n\t\t\tCustomer temp = query.getSingleResult();\n\t\t}\n\t\tcatch (Exception exe){\n\t\t\tlogger.log(Level.INFO,\"Already exists!!\");\n\t\t\tcurrentSession.saveOrUpdate(theCustomer);\n\t\t}\n\t}", "Customer getCustomerByCustomerName(String code) throws CustomerCodeNotExistsException;", "Customer findById(Long id);", "Customer saveCustomer(Customer customer) throws CustomerExistsException;", "private Customer createCustomerData() {\n int id = -1;\n Timestamp createDate = DateTime.getUTCTimestampNow();\n String createdBy = session.getUsername();\n\n if (action.equals(Constants.UPDATE)) {\n id = existingCustomer.getCustomerID();\n createDate = existingCustomer.getCreateDate();\n createdBy = existingCustomer.getCreatedBy();\n }\n\n String name = nameField.getText();\n String address = addressField.getText() + \", \" + cityField.getText();\n System.out.println(address);\n String postal = postalField.getText();\n String phone = phoneField.getText();\n Timestamp lastUpdate = DateTime.getUTCTimestampNow();\n String lastUpdatedBy = session.getUsername();\n\n FirstLevelDivision division = divisionComboBox.getSelectionModel().getSelectedItem();\n int divisionID = division.getDivisionID();\n\n return new Customer(id, name, address, postal, phone, createDate, createdBy, lastUpdate, lastUpdatedBy, divisionID);\n }", "@Override\r\n\tpublic void saveCustomer(CRMDto theCustomer) {\n\t\t\r\n\t\tSession session = factory.openSession();\r\n\t\tTransaction tx = session.beginTransaction();\r\n\t\tsession.update(theCustomer);\r\n\t\ttx.commit();\r\n\t\t//System.out.println(\"pk update is \" +pk);\r\n\t\t\r\n\t\t\r\n\t}", "public boolean insertCustomer(Customer customer){\n\n ContentValues cv = new ContentValues();\n\n cv.put(\"customer_name\", customer.getName());\n cv.put(\"customer_description\", customer.getDescription());\n\n long insert = _db.insert(\"Customer\", null, cv);\n\n // Checks if rows have been updated.\n if(insert == -1){\n return false;\n }\n\n return true;\n }", "void insert(Customer customer);", "io.opencannabis.schema.commerce.OrderCustomer.Customer getCustomer();", "@Override\n\tpublic boolean createCustomer(Customer customer) {\n\n\t\tif (customer != null) {\n\t\t\tcustomers.add(customer);\n\t\t\tlogger.info(\"Customer added to the list\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\tlogger.info(\"Failed to add customer to the list: createCustomer()\");\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic boolean addCustomer(Customer customer) {\n\t\tint result=0;\n\t\tConnection connection;\n\t\ttry {\n\t\t\tconnection = DBConnection.makeConnection();\n\t\t\tPreparedStatement Statement = connection.prepareStatement(INSERT_CUSTOMER_QUERY);\n\t\t\tStatement.setInt(1, customer.getCustomerId());\n\t\t\tStatement.setString(2, customer.getCustomerName());\n\t\t\tStatement.setString(3, customer.getCustomerAddress());\n\t\t\t\tStatement.setInt(4, customer.getBillAmount());\n\t\t\t\tresult=Statement.executeUpdate();\n\n\t\t} \n\t\tcatch(SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\n\t\tif(result==0)\n\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public Customer saveCustomerDetails(Customer customer);", "public static void CreateCustomer() \r\n\t{\n\t\t\r\n\t}", "public void addCustomer(){\n Customer customer = new Customer();\n customer.setId(data.numberOfCustomer());\n customer.setFirstName(GetChoiceFromUser.getStringFromUser(\"Enter First Name: \"));\n customer.setLastName(GetChoiceFromUser.getStringFromUser(\"Enter Last Name: \"));\n data.addCustomer(customer,data.getBranch(data.getBranchEmployee(ID).getBranchID()));\n System.out.println(\"Customer has added Successfully!\");\n }", "Customer getCustomerById(final Long id);", "public boolean addCustomer(CustomerBean customer);", "@Override\n\tpublic Customers create(Customers newcust) {\n\t\tif (newcust.getId()!=null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tCustomers savecust = CustRepo.save(newcust);\n\t\treturn savecust;\n\t}", "public Customer createOrUpdateCustomer(final Customer customer) {\n checkNotNull(customer);\n\n String key = CustomerDbClient.computeKey(customer.getPhone(), customer.getName());\n Customer existing = dbClient.getById(key);\n if (existing == null) {\n return dbClient.putAndUpdateTimestamp(customer.toBuilder().setId(key).build());\n }\n\n List<Address> newAddresses = customer.getAddressesList()\n .stream()\n .filter(t -> !existing.getAddressesList().contains(t))\n .collect(Collectors.toList());\n\n Customer toUpdate = existing.toBuilder()\n .clearAddresses()\n .addAllAddresses(newAddresses) // The new address will be the default one.\n .addAllAddresses(existing.getAddressesList())\n .setDefaultAddressIndex(0)\n .build();\n\n return dbClient.putAndUpdateTimestamp(toUpdate);\n }", "@Transactional\n\t@Override\n\tpublic Customer createCustomer(String name) {\n\t\t\n\t\tvalidateName(name);\n\t\tLocalDateTime now = LocalDateTime.now();\n\t\tAccount account = new Account(5000.0, now);\n\t\taccountRepository.save(account);\n\t\tSet<Item> set = new HashSet<>();\n\t\tCustomer customer = new Customer(name, account,set);\n\t\tcustRepository.save(customer);\n\t\treturn customer;\n\t\t\n\t}", "boolean hasCustomer();", "boolean hasCustomer();", "public static boolean addCustomer(Customer customer) throws SQLException {\n \n if (customerInDatabase(customer.getCustomer())) {\n System.out.println(\"Customer \" + customer.getCustomer() + \" already in DB (addCustomer)\");\n return false;\n }\n else if (customer.getCustomer().isEmpty()) {\n System.out.println(\"Customer given is empty (addCustomer\");\n return false;\n }\n String insertStatement = \"INSERT INTO customer(customerName, addressId, active, createDate, createdBy, lastUpdateBy) \" +\n \"VALUES (?,?,?,?,?,?)\";\n \n DBQueryPrepared.setPreparedStatement(CONN, insertStatement);\n ps = DBQueryPrepared.getPreparedStatement();\n ps.setString(1, customer.getCustomer());\n ps.setString(2, String.valueOf(customer.getAddressId()));\n ps.setString(3, \"1\");\n ps.setString(4, model.timeConversion.getTime().toString());\n ps.setString(5, \"currentUser\");\n ps.setString(6, \"currentUser\");\n ps.execute();\n return true; \n }", "Customer(){}", "public Customer getCustomerByName(String customerName);", "@Override\r\n\tpublic void createAccount(Customer customer) {\n\t\tcustMap.put(customer.getMobileNo(),customer);\r\n\t\t\r\n\t}", "public ResponseEntity<?> createCustomer(customer.controller.Customer customer);", "public String getCustomer(String custId);", "@PostMapping(\"/customers\")\n\tpublic Customer savecustomer(@RequestBody Customer thecustomer) {\n\t\t\n\t\tthecustomer.setId(0); //here 0 is not id, we are telling saveorupdate() DAO method to insert the customer object coz it inserts if id is empty(so give 0 or null)\n\t\tthecustomerService.saveCustomer(thecustomer);\n\t\treturn thecustomer;\n\t}", "@Test\n public void getCustomer() {\n Customer customer = new Customer();\n customer.setFirstName(\"Dominick\");\n customer.setLastName(\"DeChristofaro\");\n customer.setEmail(\"[email protected]\");\n customer.setCompany(\"Omni\");\n customer.setPhone(\"999-999-9999\");\n customer = service.saveCustomer(customer);\n\n // Copy the customer added to the mock database using the CustomerAPI\n Customer customerCopy = service.findCustomer(customer.getCustomerId());\n\n // Test getCustomer() API method\n verify(customerDao, times(1)).getCustomer(customer.getCustomerId());\n TestCase.assertEquals(customerCopy, customer);\n }", "public Customer createCustomer() {\r\n\t\ttry {\r\n\t\t\treturn manager.createCustomer();\t\t\t\r\n\t\t}catch(SQLException e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"The manager was unable to create a new customer\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "Boolean updateOrInsert(Customer customer);", "Customer getCustomer();", "@Override\n\tpublic boolean isCustomerExists(int customerId) {\n\t\treturn false;\n\t}", "private void loadCustomerData() {\n\t\tCustomerDTO cust1 = new CustomerDTO();\n\t\tcust1.setId(null);\n\t\tcust1.setFirstName(\"Steven\");\n\t\tcust1.setLastName(\"King\");\n\t\tcust1.setEmail(\"[email protected]\");\n\t\tcust1.setCity(\"Hyderabad\");\n\t\tcustomerService.createCustomer(cust1);\n\n\t\tCustomerDTO cust2 = new CustomerDTO();\n\t\tcust2.setId(null);\n\t\tcust2.setFirstName(\"Neena\");\n\t\tcust2.setLastName(\"Kochhar\");\n\t\tcust2.setEmail(\"[email protected]\");\n\t\tcust2.setCity(\"Pune\");\n\t\tcustomerService.createCustomer(cust2);\n\n\t\tCustomerDTO cust3 = new CustomerDTO();\n\t\tcust3.setId(null);\n\t\tcust3.setFirstName(\"John\");\n\t\tcust3.setLastName(\"Chen\");\n\t\tcust3.setEmail(\"[email protected]\");\n\t\tcust3.setCity(\"Bangalore\");\n\t\tcustomerService.createCustomer(cust3);\n\n\t\tCustomerDTO cust4 = new CustomerDTO();\n\t\tcust4.setId(null);\n\t\tcust4.setFirstName(\"Nancy\");\n\t\tcust4.setLastName(\"Greenberg\");\n\t\tcust4.setEmail(\"[email protected]\");\n\t\tcust4.setCity(\"Mumbai\");\n\t\tcustomerService.createCustomer(cust4);\n\n\t\tCustomerDTO cust5 = new CustomerDTO();\n\t\tcust5.setId(5L);\n\t\tcust5.setFirstName(\"Luis\");\n\t\tcust5.setLastName(\"Popp\");\n\t\tcust5.setEmail(\"[email protected]\");\n\t\tcust5.setCity(\"Delhi\");\n\t\tcustomerService.createCustomer(cust5);\n\n\t}", "public int insertCustomer() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int insertNewCustomer(Customer cust) throws CustException {\n\t\tmanager.persist(cust);\r\n\t\treturn 1;\r\n\t}", "@PutMapping(\"/customers\")\n\tpublic Customer updatecustomer(@RequestBody Customer thecustomer) {\n\t\t\n\t\tthecustomerService.saveCustomer(thecustomer); //as received JSON object already has id,the saveorupdate() DAO method will update details of existing customer who has this id\n\t\treturn thecustomer;\n\t}", "public Customermodel addCustomer(Customermodel customermodel) {\n\t\t return customerdb.save(customermodel);\n\t }", "private void addCustomer(Customer customer) {\n List<String> args = Arrays.asList(\n customer.getCustomerName(),\n customer.getAddress(),\n customer.getPostalCode(),\n customer.getPhone(),\n customer.getCreateDate().toString(),\n customer.getCreatedBy(),\n customer.getLastUpdate().toString(),\n customer.getLastUpdatedBy(),\n String.valueOf(customer.getDivisionID())\n );\n DatabaseConnection.performUpdate(\n session.getConn(),\n Path.of(Constants.UPDATE_SCRIPT_PATH_BASE + \"InsertCustomer.sql\"),\n args\n );\n }", "private Customer findCustomer(String customerName){\n for(int i=0; i<customers.size(); i+=1){\n Customer existingCustomer = this.customers.get(i);\n if(existingCustomer.getName().equals(customerName)){\n return existingCustomer;\n }\n }\n return null;\n }", "public Customer addCustomer(Customer customer) {\n customer.setMemberSince(LocalDate.now());\n customer.setStatus(MembershipStatus.ACTIVE);\n return customerRepository.save(customer);\n }", "void updateCustomerById(Customer customer);", "public void containsACustomer() {\r\n\t\tSystem.out.println(\"\\nChecking if a customer object is in persistent context\");\r\n\r\n\t\tEntityManager em = emf.createEntityManager();\r\n//\t\tEntityTransaction tx = em.getTransaction();\r\n//\t\ttx.begin();\r\n\t\tCustomer2 customerRetrieved = em.find(Customer2.class, (long)10);\r\n\t\tSystem.out.println(customerRetrieved);\r\n\t\tCustomer2 newCustomer = new Customer2(customerRetrieved.getCustId(), \r\n\t\t\t\t\t\t\t\t\t\t\t customerRetrieved.getFirstName(), \r\n\t\t\t\t\t\t\t\t\t\t\t customerRetrieved.getLastName());\r\n\t\tSystem.out.println(newCustomer);\r\n\t\tSystem.out.println(\"Does persistent context have newCustomer? \" + em.contains(newCustomer));\r\n\t\tSystem.out.println(\"Does persistent context have customerRetrieved? \" + em.contains(customerRetrieved));\r\n\t\tem.remove(customerRetrieved);\r\n\t\tSystem.out.println(\"Does persistent context have customerRetrieved? \" + em.contains(customerRetrieved));\r\n//\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "public Customer saveCustomer(Customer customer) {\n\t\treturn null;\n\t}", "public void create(Customer c){\n Connection conn = ConnectionFactory.getConnection();\n PreparedStatement ppst = null;\n try {\n ppst = conn.prepareCall(\"INSERT INTO customer (name, id, phone) VALUES (?, ?, ?)\");\n ppst.setString(1, c.getName());\n ppst.setString(2, c.getId());\n ppst.setString(3, c.getPhone());\n ppst.executeUpdate();\n System.out.println(\"Customer created.\");\n } catch (SQLException e) {\n throw new RuntimeException(\"Creation error: \", e);\n } finally {\n ConnectionFactory.closeConnection(conn, ppst);\n }\n }", "@Override\n\tpublic void addCustomers(Customer customer) {\n\n\t\tsessionFactory.getCurrentSession().save(customer);\n\t}", "private Customer buildCustomer (ResultSet resultSet) throws SQLException{\r\n long id = resultSet.getLong(1);\r\n String firstName =resultSet.getString(2);\r\n String lastName = resultSet.getString(3);\r\n String email = resultSet.getString(4);\r\n String password = resultSet.getString(5);\r\n return new Customer(id,firstName,lastName,email,password);\r\n }", "@Override\n @Transactional\n public Customer getCustomer(int customerId) {\n Optional<Customer> queryResult = customerRepository.findById(customerId);\n // if null return new Customer(), otherwise return the Customer\n return queryResult.orElseGet(Customer::new);\n }", "private void addCustomer() {\n try {\n FixCustomerController fixCustomerController = ServerConnector.getServerConnector().getFixCustomerController();\n\n FixCustomer fixCustomer = new FixCustomer(txtCustomerName.getText(), txtCustomerNIC.getText(), String.valueOf(comJobrole.getSelectedItem()), String.valueOf(comSection.getSelectedItem()), txtCustomerTele.getText());\n\n boolean addFixCustomer = fixCustomerController.addFixCustomer(fixCustomer);\n\n if (addFixCustomer) {\n JOptionPane.showMessageDialog(null, \"Customer Added Success !!\");\n } else {\n JOptionPane.showMessageDialog(null, \"Customer Added Fail !!\");\n }\n\n } catch (NotBoundException | MalformedURLException | RemoteException ex) {\n new ServerNull().setVisible(true);\n } catch (ClassNotFoundException | IOException ex) {\n Logger.getLogger(InputCustomers.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public Customer findCustomer(String email, String password) throws SQLException {\n //Find if the customer exists in the CUSTOMER TABLE\n String fetch =\"select * from IOTBAY.CUSTOMER where EMAIL='\" + email + \"' and PASSWORD = '\" + password + \"'\";\n ResultSet rs = st.executeQuery(fetch);\n \n while(rs.next()) //goes through every row in the CUSTOMER table\n {\n String customerEmail = rs.getString(6);\n String customerPass = rs.getString(8);\n if (customerEmail.equals(email) && customerPass.equals(password)){\n //number corresponds to the columns of the user table\n Integer customerId=rs.getInt(1);\n String customerName = rs.getString(2);\n String customerGender = rs.getString(4);\n String customerDob = rs.getString(3);\n String customerNumber = rs.getString(5);\n String customerAddress = rs.getString(7);\n Boolean customerPromo = rs.getBoolean(9);\n Integer customerReward = rs.getInt(10);\n return new Customer (customerId, customerName, customerDob, customerGender, customerNumber, customerEmail, customerAddress, customerPass, customerPromo, customerReward);\n }\n }\n return null;\n }", "public Customer Create(Customer customer) {\n\t\tString sqlInsert = \"Insert into customers (name, email, address) values('\" + customer.getName()+ \"','\"\n\t\t+ customer.getEmail()+ \"','\"+ customer.getAddress()+\"')\";\n\t\t\n\t\ttry {\n\t\t\tstmt.executeUpdate(sqlInsert);\n\t\t\treturn readLatest();\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\treturn null;\n\t\t\n\t}", "AccountModel addByCustomer(AccountModel account,String customerId) throws AccountException, CustomerException;", "@Override\n\tpublic void create(Customer t) {\n\n\t}", "public void addCustomer() {\r\n\t\tdo {\r\n\t\t\tString name = getToken(\"Enter the customer's name: \");\r\n\t\t\tString phoneNumber = getToken(\"Enter the phone number: \");\r\n\t\t\tCustomer customer = store.addCustomer(name, phoneNumber);\r\n\t\t\tif (customer == null) {\r\n\t\t\t\tSystem.out.println(\"Could not add customer.\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(customer);\r\n\t\t} while (yesOrNo(\"Would you like to add another Customer?\"));\r\n\t}", "@Override\n\tpublic void createCustomer(Customer customer) throws Exception {\n\t\tConnection con = pool.getConnection();\n\t\ttry {\n\t\t\t\n\t\t\tStatement st = con.createStatement();\n\t\t\tString create = String.format(\"insert into customer values('%s', '%s')\", customer.getCustName(),\n\t\t\t\t\tcustomer.getPassword());\n\t\t\tst.executeUpdate(create);\n\t\t\tSystem.out.println(\"Customer added successfully\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage() + \"Unable to add A customer, Try Again! \");\n\t\t} finally {\n\t\t\tpool.returnConnection(con);\n\t\t}\n\t}", "@Override\n\tpublic CustomerData getCustomer(Long custId) {\n\t \n\t\tOptional<CustomerData> optionalCust = customerRepository.findById(custId);\n\t\t//Optional object use for check if a customer id is existing or not\n if(optionalCust.isPresent()) {\n return optionalCust.get(); //if customer id is exist then return a value\n }\n\t\treturn null;\n\t\t\n\t}", "@Test\n\t// @Disabled\n\tvoid testCreateCustomer() {\n\t\tCustomer customer = new Customer(1, \"tom\", \"son\", \"951771122\", \"[email protected]\");\n\t\tMockito.when(custRep.save(customer)).thenReturn(customer);\n\t\tCustomer persistedCust = custService.addCustomer(customer);\n\t\tassertEquals(1, persistedCust.getCustomerId());\n\t}", "@PostMapping(\"/customers\")\n public Customer addCustomer(@RequestBody Customer theCustomer)\n {\n //also just in case they pass an id in JSON .. set id to o\n //this is to force a save of new item ... instead od update\n theCustomer.setId(0);\n customerService.save(theCustomer);\n return theCustomer;\n }", "public void lookupCustomer(String customerId) {\r\n customer = transaction.getCustomerInfo(customerId);\r\n }", "private Customer addCustomerDetails(CustomerRegRequestDto requestDto) {\n\t\tString customerId = null;\n\n\t\tOptional<Utility> details = utilityRepo.findByUtilityId(requestDto.getCustomerUtilityId());\n\t\tif (!details.isPresent())\n\t\t\tthrow new NoDataFoundException(CustomerConstants.UTILITY_NOT_FOUND);\n\n\t\tOptional<Customer> getCustomer = customerRepo.findFirstByOrderByModifiedDateDesc();\n\t\tif (getCustomer.isPresent()) {\n\t\t\tif (getCustomer.get().getCustomerId().charAt(0) == CustomerConstants.CUSTOMER_STARTING)\n\t\t\t\tcustomerId = Helper.generateNextCustomerId(getCustomer.get().getCustomerId(),\n\t\t\t\t\t\tdetails.get().getUtilityName());\n\t\t\telse\n\t\t\t\tcustomerId = Helper.generateUniqueCustomerId(details.get().getUtilityName());\n\n\t\t} else {\n\t\t\tcustomerId = Helper.generateUniqueCustomerId(details.get().getUtilityName());\n\n\t\t}\n\t\tmodelMapper.getConfiguration().setAmbiguityIgnored(true);\n\t\tCustomer addNewCustomer = modelMapper.map(requestDto, Customer.class);\n\t\taddNewCustomer.setCustomerId(customerId);\n\t\taddNewCustomer.setActive(true);\n\t\taddNewCustomer.setCreatedBy(requestDto.getUserId());\n\t\taddNewCustomer.setCreatedDate(new Date());\n\t\taddNewCustomer.setModifiedBy(requestDto.getUserId());\n\t\taddNewCustomer.setModifiedDate(new Date());\n\t\treturn customerRepo.save(addNewCustomer);\n\t}", "static void addCustomer(customer customer) {\n\n }", "public Customer save(final Customer customer) {\n\t\tAssert.notNull(customer);\r\n\t\tBoolean isCreating = null;\r\n\r\n\t\tAssert.isTrue(!(customer.getEmail().endsWith(\"@\") || customer.getEmail().endsWith(\"@>\")));\r\n\r\n\t\tif (customer.getId() == 0) {\r\n\t\t\tisCreating = true;\r\n\t\t\tcustomer.setSuspicious(false);\r\n\r\n\t\t\t//comprobamos que ningún actor resté autenticado (ya que ningun actor puede crear los customers)\r\n\t\t\t//this.serviceUtils.checkNoActor();\r\n\r\n\t\t} else {\r\n\t\t\tisCreating = false;\r\n\t\t\t//comprobamos que su id no sea negativa por motivos de seguridad\r\n\t\t\tthis.serviceUtils.checkIdSave(customer);\r\n\r\n\t\t\t//este customer será el que está en la base de datos para usarlo si estamos ante un customer que ya existe\r\n\t\t\tCustomer customerBD;\r\n\t\t\tAssert.isTrue(customer.getId() > 0);\r\n\r\n\t\t\t//cogemos el customer de la base de datos\r\n\t\t\tcustomerBD = this.customerRepository.findOne(customer.getId());\r\n\r\n\t\t\t//Si el customer que estamos guardando es nuevo (no está en la base de datos) le ponemos todos sus atributos vacíos\r\n\r\n\t\t\t//\t\t\tcustomer.setUserAccount(new UserAccount());\r\n\t\t\t//\t\t\tfinal Authority authority = new Authority();\r\n\t\t\t//\t\t\tauthority.setAuthority(Authority.CUSTOMER);\r\n\t\t\t//\t\t\tcustomer.getUserAccount().addAuthority(authority);\r\n\t\t\t//los atributos que no pueden estar vacíos\r\n\r\n\t\t\tcustomer.setSuspicious(customerBD.getSuspicious());\r\n\t\t\tcustomer.setUserAccount(customerBD.getUserAccount());\r\n\r\n\t\t\t//Comprobamos que el actor sea un Customer\r\n\t\t\tthis.serviceUtils.checkAuthority(\"CUSTOMER\");\r\n\t\t\t//esto es para ver si el actor que está logueado es el mismo que se está editando\r\n\t\t\tthis.serviceUtils.checkActor(customer);\r\n\r\n\t\t}\r\n\t\tif ((!customer.getPhone().startsWith(\"+\")) && StringUtils.isNumeric(customer.getPhone()) && customer.getPhone().length() > 3) {\r\n\t\t\tfinal Settings settings = this.settingsService.findSettings();\r\n\t\t\tcustomer.setPhone(settings.getCountryCode() + customer.getPhone());\r\n\t\t}\r\n\t\tCustomer res;\r\n\t\t//le meto al resultado final el customer que he ido modificando anteriormente\r\n\t\tres = this.customerRepository.save(customer);\r\n\t\tthis.flush();\r\n\t\tif (isCreating)\r\n\t\t\tthis.folderService.createSystemFolders(res);\r\n\t\treturn res;\r\n\t}", "@Override\n public Customer getCustomerById(Long id) {\n log.debug(\"Inside getCustomerById method\");\n return customerRepository.findById(id).orElseThrow(\n () -> new ResourceNotFoundException(\"No customer present with the id : \" + id));\n }", "@Override\n\t@Transactional\n\tpublic void addCustomer(Customer customer) {\n\n\t\tSystem.out.println(\"here is our customer\" + customer);\n\n\t\thibernateTemplate.saveOrUpdate(customer);\n\n\t}", "public static Customer getCustomer(int id_cust) {\n Connection c = connection();\n PreparedStatement stmt;\n int id = 0;\n String name = null;\n String email = null;\n String password = null;\n Customer customer = null;\n try {\n String sql = \"SELECT * FROM customer WHERE id=?;\";\n stmt = c.prepareStatement(sql);\n stmt.setInt(1, id_cust);\n ResultSet rs = stmt.executeQuery();\n while (rs.next()) {\n id = rs.getInt(\"id\");\n name = rs.getString(\"name\");\n email = rs.getString(\"email\");\n password = rs.getString(\"password\");\n }\n stmt.close();\n c.close();\n customer = new Customer(id, name, email, password);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return customer;\n }", "@Override\n\tpublic Customer viewCustomer(int customerId) {\n\t\t// TODO Auto-generated method stub\n\t\tCustomer cust = repository.findById(customerId)\n\t\t\t\t.orElseThrow(() -> new EntityNotFoundException(\"Currently No Customer is available with this id\"));\n\t\treturn cust;\n\t}", "@Override\n\tpublic void putCustomers(Customer customer) {\n\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(customer);;\n\n\t}", "public Customer putCustomer(final Customer customer) {\n return dbClient.put(customer);\n }", "public void setCustomerId(int customerId) \n {\n this.customerId = customerId;\n }", "public void registerCustomer(Customer customer) {\nSession session=sessionFactory.getCurrentSession();\n\t\t\n\t\tAuthorities authorities=new Authorities();\n\t\tauthorities.setRole(\"ROLE_USER\");\n\t\tauthorities.setUser(customer.getUser());//FK column in authorities table\n\t\t\n\t\tcustomer.getUser().setAuthorities(authorities);\n\t\tcustomer.getUser().setEnabled(true);\n\t\t\n\t\tCart cart=new Cart();\n\t\tcustomer.setCart(cart);\n\t\tcart.setCustomer(customer);\n\t\t\n\t\tsession.save(customer);\n\t\n\t\t\n\t}", "public void addCustomer(Customer customer) {\r\n if (hasID(customer.getID())) {\r\n return;\r\n }\r\n\r\n for (int i = 0; i < customers.length; i++) {\r\n if (customers[i] == null) {\r\n customers[i] = customer;\r\n return;\r\n }\r\n }\r\n\r\n System.err.println(\"No more room in database!\");\r\n }", "public void setCustomer(String customer) {\n this.customer = customer;\n }", "public Boolean addCustomer(Customer customer){\n Boolean success = false;\n try{\n // try and connect\n conn = DriverManager.getConnection(URL);\n\n // make sql query\n PreparedStatement preparedStatement =\n conn.prepareStatement(\"INSERT INTO Customer(CustomerId, FirstName, LastName, Country, PostalCode, Phone, Email)\" + \"VALUES(?,?,?,?,?,?,?)\");\n preparedStatement.setString(1, customer.getCustomerId());\n preparedStatement.setString(2, customer.getFirstName());\n preparedStatement.setString(3, customer.getLastName());\n preparedStatement.setString(4, customer.getCountry());\n preparedStatement.setString(5, customer.getPostalCode());\n preparedStatement.setString(6, customer.getPhoneNumber());\n preparedStatement.setString(7, customer.getEmail());\n\n int result = preparedStatement.executeUpdate();\n success = (result != 0);\n System.out.println(\"Added customer\");\n }\n catch(Exception exception){\n System.out.println(exception.toString());\n }\n finally{\n try{\n conn.close();\n }\n catch (Exception exception){\n System.out.println(exception.toString());\n }\n }\n return success;\n\n }", "@Override\r\n\tpublic Customer addCustomer(Customer customer) {\r\n\r\n\t\tif (!inputValidator.nameValidator(customer.getName()))\r\n\t\t\tthrow new EntityCreationException(\"Enter a Valid Customer Name.\");\r\n\t\tif (!inputValidator.userIdValidator(customer.getUserId()))\r\n\t\t\tthrow new EntityCreationException(\"Enter a Valid UserId.\");\r\n\t\tif (!inputValidator.contactValidator(customer.getContactNo()))\r\n\t\t\tthrow new EntityCreationException(\"Enter a valid Contact Number.\");\r\n\t\tif (!inputValidator.emailValidator(customer.getEmail()))\r\n\t\t\tthrow new EntityCreationException(\"Enter a valid Email.\");\r\n\t\tCustomer customer2 = customerRepository.save(customer);\r\n\t\treturn customer2;\r\n\r\n\t}", "public boolean updateCustomer() {\n\t\treturn false;\r\n\t}", "public void addCustomer(Customer customer) throws UserExistsException {\r\n if (customerExists(customer)){\r\n throw new UserExistsException(\"Customer \"+ customer.getF_Name()+\" already exists\");\r\n }\r\n customers.add(customer);\r\n }", "@Query(\"select acc from Account acc where acc.customer.customerId = :customerId\")\n\tAccount findAccountByCustomer(@Param(\"customerId\") Long customerId);", "int insert(OcCustContract record);", "@Test\n public void testCustomerFactoryGetCustomer() {\n CustomerController customerController = customerFactory.getCustomerController();\n customerController.addCustomer(CUSTOMER_NAME, CUSTOMER_CONTACT, false);\n assertEquals(CUSTOMER_NAME, customerController.getCustomer(1).getName());\n }", "public void addCustomer(int Id, String name, String dob, String gender, String number, String email, String address, String password, Boolean promo, Integer reward, Boolean reg) throws SQLException { //code for add-operation \n st.executeUpdate(\"INSERT INTO IOTBAY.CUSTOMER \" + \"VALUES ('\" \n + Id + \"','\" + name + \"', '\" + dob + \"', '\" \n + gender + \"', '\" + number + \"', '\" \n + email + \"', '\" + address + \"', '\" \n + password + \"', '\" + promo + \"', '\"+ reward + \"', '\"+ reg \n + \"')\");\n\n }", "public void registerNewCustomers(Customer c) {\n if (!newCustomers.contains(c)\n && !modifiedCustomers.contains(c)) {\n newCustomers.add(c);\n }\n }", "CustomerDto updateCustomer(CustomerDto customerDto);", "static Customer getCustomerWithId(int id){ return new Customer();}", "@Override\n\tpublic Customer retrieveCustomer(Integer id) {\n\n\t\tCustomer customer = new Customer();\n\n\t\tfor (Customer cust : customers) {\n\t\t\tif (cust.getId() == id) {\n\t\t\t\tcustomer.setId(id);\n\t\t\t\tcustomer.setUsername(cust.getUsername());\n\t\t\t\tcustomer.setFirstName(cust.getFirstName());\n\t\t\t\tcustomer.setLastName(cust.getLastName());\n\t\t\t\tcustomer.setEmail(cust.getEmail());\n\t\t\t\tcustomer.setUserType(cust.getUserType());\n\t\t\t\tcustomer.setPassword(cust.getPassword());\n\t\t\t\tcustomer.setAddress(cust.getAddress());\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"A GET call retrieved a customer: retrieveCustomer()\");\n\t\treturn customer;\n\t}", "public Customer loadCustomerFromId(int customerId) {\n ResultSet rs = database.getCustomer(customerId);\n Customer newCustomer = null;\n try {\n if (rs.next()) {\n newCustomer = new Customer(rs.getString(\"name\"), rs.getString(\"address\"), rs.getString(\"email\"), \"toBeLoaded\", rs.getDate(\"birthday\"), rs.getInt(\"phonenumber\"));\n newCustomer.setPassword(Customer.fromBase64(rs.getString(\"password\")));\n newCustomer.setSalt(Customer.fromBase64(rs.getString(\"passwordsalt\")));\n // newCustomer.setCurrentOrder(loadOrderFromId(rs.getInt(\"currentorderid\")));\n newCustomer.setCustomerID(customerId);\n } else {\n throw new NoSuchCustomerException(customerId);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n if (newCustomer == null) {\n throw new NoSuchCustomerException(customerId);\n }\n return newCustomer;\n }", "@Override\r\n\tpublic Customer updateCustomer(Customer customer) {\r\n\t\tOptional<Customer> optionalCustomer = null;\r\n\t\tCustomer customer2 = null;\r\n\t\toptionalCustomer = customerRepository.findById(customer.getUserId());\r\n\t\tif (optionalCustomer.isPresent()) {\r\n\t\t\tcustomer2 = customerRepository.save(customer);\r\n\t\t\treturn customer2;\r\n\t\t} else {\r\n\t\t\tthrow new EntityUpdationException(\"Customer With Id \" + customer.getUserId() + \" does Not Exist.\");\r\n\t\t}\r\n\r\n\t}", "@Test\n\tpublic void updateCustomer() {\n\t\t// Given\n\t\tString name = \"Leo\";\n\t\tString address = \"Auckland\";\n\t\tString telephoneNumber = \"021123728381\";\n\t\tICustomer customer = customerController.create(name, address, telephoneNumber);\n\t\tname = \"Mark\";\n\t\taddress = \"Auckland\";\n\t\ttelephoneNumber = \"0211616447\";\n\t\tlong id = customer.getId();\n\n\t\t// When\n\t\tICustomer cus = customerController.update(id, name, address, telephoneNumber);\n\n\t\t// Then\n\t\tAssert.assertEquals(name, cus.getName());\n\t\tAssert.assertEquals(address, cus.getAddress());\n\t\tAssert.assertEquals(telephoneNumber, cus.getTelephoneNumber());\n\t\tAssert.assertEquals(id, cus.getId());\n\t}", "public void addCustomer(CustomerSignup p)\n {\n Session session = this.sessionFactory.getCurrentSession();\n \n session.persist(p);\n \n CustomerLogin cl=new CustomerLogin();\n cl.setUsername(p.getUsername());\n cl.setPassword(p.getPassword());\n cl.setId(p.getId());\n session.persist(cl);\n \n Authorities a = new Authorities();\n a.setUsername(p.getUsername());\n a.setAuthority(\"ROLE_USER\");\n a.setId(p.getId());\n session.saveOrUpdate(a);\n\n session.flush();\n \n logger.info(\"Customer saved successfully, Customer Details=\"+p);\n }", "@Override\n\tpublic Customer saveCustomer(Customer customer) {\n\t\treturn null;\n\t}", "public void addCustomer() {\n\t \n\t try{\n\t\t con = openDBConnection();\n\t\t callStmt = con.prepareCall(\" {call team5.CUSTOMER_ADD_PROC(?,?,?,?,?,?,?)}\");\n\t\t callStmt.setString(1,this.emailad);\n\t\t callStmt.setString(2,this.fname);\n\t\t callStmt.setString(3,this.lname);\n\t\t callStmt.setString(4,this.username);\n\t\t callStmt.setString(5,this.password);\n\t\t callStmt.setString(6,this.adminUsername);\n\t\t callStmt.setInt(7, this.id);\n\t\t callStmt.execute();\n\t\t callStmt.close();\n\t } catch (Exception E) {\n\t E.printStackTrace();\n\t }\n}" ]
[ "0.73939407", "0.72749555", "0.71721673", "0.71721673", "0.71721673", "0.71721673", "0.70315886", "0.70226026", "0.6987213", "0.6940539", "0.6892629", "0.6888843", "0.6859175", "0.6854679", "0.68382347", "0.6717265", "0.671378", "0.6702466", "0.6668849", "0.6659238", "0.665768", "0.66533923", "0.66497487", "0.6649236", "0.6646513", "0.66396743", "0.66379714", "0.65862197", "0.6572908", "0.6541102", "0.6541102", "0.65017056", "0.6496393", "0.64660573", "0.6453083", "0.64490694", "0.64417386", "0.6433083", "0.6432843", "0.64212", "0.6419565", "0.6416996", "0.64117277", "0.6409519", "0.6407042", "0.640203", "0.64011556", "0.6397302", "0.6382894", "0.63812566", "0.63724965", "0.6372011", "0.6370911", "0.6360569", "0.6359635", "0.63451713", "0.6343273", "0.6342453", "0.63413936", "0.6338366", "0.6329696", "0.63242435", "0.6318568", "0.6312407", "0.6306994", "0.63001597", "0.6293637", "0.62883097", "0.6278851", "0.6276208", "0.62757957", "0.6269469", "0.6256732", "0.62538683", "0.6246667", "0.6245601", "0.6237938", "0.62294", "0.6227986", "0.622717", "0.6221223", "0.621902", "0.62078273", "0.62041616", "0.62027353", "0.6192947", "0.6184727", "0.61805606", "0.6177948", "0.6176999", "0.6176911", "0.6174741", "0.6171548", "0.61641705", "0.6164133", "0.6163515", "0.61630154", "0.6160928", "0.6153345", "0.61512" ]
0.6820718
15
Ensure that when we perform a GET /users with multiple users in the system, we retrieved a list containing the users
@Test public void getUsers() throws URISyntaxException { List<CreateUserCommand> usersToCreate = Arrays.asList( new CreateUserCommand(22,"Victor","Varnier"), new CreateUserCommand(23,"Pierre","Bouillon"), new CreateUserCommand(42,"Obi-Wan","Kenobi")); URI createUserUri = getUrlForRoute("/api/users"); List<UserDto> createdUsers = usersToCreate.stream() .map(userToCreate -> restTemplate .postForEntity(createUserUri, userToCreate, UserDto.class) .getBody()) .collect(Collectors.toList()); // Retrieve a list of users URI uri = getUrlForRoute("/api/users"); // Perform the HTTP call ResponseEntity<List<UserDto>> createdResponse = restTemplate.exchange(uri, HttpMethod.GET, null, new ParameterizedTypeReference<>() { }); // Ensure that the list of users is retrieved assertEquals(createdResponse.getStatusCode(), HttpStatus.OK); List<UserDto> retrievedUsers = extractPayload(createdResponse); // Ensure that we retrieved a list containing all the users retrievedUsers.containsAll(createdUsers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<User> getUsers();", "List<User> getUsers();", "public List getUsers(User user);", "public List<User> getUsers();", "public List<UserDTO> getUsers();", "java.util.List<com.heroiclabs.nakama.api.User> \n getUsersList();", "public List getAllUsers();", "@RequestMapping(value = {\"/users/list\"}, method = RequestMethod.GET)\n\tpublic ResponseEntity<List<User>> fetchUsers() {\n\t\t\tSystem.out.println(\"fetching users\");\n\t\t\tList<User> user = userDAO.list(\"APPROVED\");\n\t\t\tSystem.out.println(user);\n\t\t\treturn new ResponseEntity<List<User>>(user, HttpStatus.OK);\n\t\t}", "@GetMapping(\"/allusers\")\n\t@Secured({CommonConstants.ROLE_EMPLOYEE,CommonConstants.ROLE_ADMIN})\n\tpublic ResponseEntity<List<UserEntity>> fetchUsers(){\n\t\treturn new ResponseEntity<List<UserEntity>>(this.service.findAll(), HttpStatus.OK);\n\t}", "@Nonnull\n List<User> getUsers();", "private void listUsers(Request request, Response response) {\r\n\t\tList<UserBean> userList = null;\r\n\r\n\t\ttry {\r\n\t\t\tuserList = userService.findUsers();\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tuserList);\r\n\t\t}\r\n\t}", "@Override\n public Response getUsers() throws NotFoundException {\n List<TechGalleryUser> userEntities = userDao.findAll();\n // if user list is null, return a not found exception\n if (userEntities == null) {\n throw new NotFoundException(OPERATION_FAILED);\n } else {\n UsersResponse response = new UsersResponse();\n List<UserResponse> innerList = new ArrayList<UserResponse>();\n\n for (int i = 0; i < userEntities.size(); i++) {\n TechGalleryUser user = userEntities.get(i);\n UserResponse userResponseItem = new UserResponse();\n userResponseItem.setId(user.getId());\n userResponseItem.setName(user.getName());\n userResponseItem.setEmail(user.getEmail());\n userResponseItem.setPhoto(user.getPhoto());\n innerList.add(userResponseItem);\n }\n\n response.setUsers(innerList);\n return response;\n }\n }", "@GET\n @Path(\"/users\")\n @Produces(\"application/json\")\n public Response getUsersBatch() throws JsonProcessingException {\n LOG.info(\"Batch of users requested.\");\n @NotNull final List<UserEntity> loginUserList = DatabaseAccessLayer.getLoginUserList();\n return Response.ok(new UserBatchHolder(loginUserList).writeJson()).build();\n }", "public List<User> getUserList();", "@RequestMapping(value = \"/users\", method = RequestMethod.GET)\n public ResponseEntity getUsers() {\n logger.debug(\"HTTP GET /users called\");\n List<User> userList = userService.getUsers(0.00, 4000.00);\n\n return new ResponseEntity(new UserResponse(userList), HttpStatus.OK);\n }", "public List<User> getAllUsers();", "Iterable<User> getAllUsers();", "@GetMapping(\"/users\")\n\tpublic ResponseEntity<List<User>> getUsers() {\n\t\tlog.debug(\"REST request to get all Users\");\n\t\treturn new ResponseEntity<List<User>>(userService.getAll(), HttpStatus.OK);\n\t}", "@GetMapping(\"/users\")\n @PreAuthorize(\"hasRole('Admin')\")\n public SuccessResponse<List<UserResponse>> getUsers() {\n if(!connectionService.isReachable()) {\n String exceptionMessage = \"Cannot connect to database.\";\n System.out.println(exceptionMessage);\n throw new DatabaseException(exceptionMessage);\n }\n\n final var users = userService\n .findAllUsers()\n .stream()\n .map(UserResponse::fromUser)\n .collect(Collectors.toList());\n return new SuccessResponse<>(users);\n }", "List<User> getAllUsers();", "List<User> getAllUsers();", "List<KingdomUser> getUsers();", "public ArrayList<UserDetail> gettingAllAvailableUsers() throws Exception;", "public List<User> listUsers(String userName);", "@GET\n\t@Path(\"/allUsers\")\n\t@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\n\tpublic Map<String, List<User>> getUser() throws JsonGenerationException, JsonMappingException, IOException {\n\t\t\n\t\tMap<String, List<User>> user = userDao.getUser();\n\t\t\n\t\treturn user; \n\t}", "public List<IUser> getUsers();", "@RequestMapping(value = \"/user\", method = RequestMethod.GET)\n\t public ResponseEntity<List<Users>> listAllUsers() \n\t {\n\t List<Users> users = userService.findAllUsers();\n\t if(users.isEmpty())\n\t {\n\t return new ResponseEntity<List<Users>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND\n\t }\n\t else\n\t {\n\t \treturn new ResponseEntity<List<Users>>(users, HttpStatus.OK);\n\t }\n\t }", "@Override\n\tpublic List<User> getUserList() {\n\t\treturn userDao.queryUser();\n\t}", "@RequestMapping(value = \"/users/list\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<UsersDTO> findAllUsers() {\n\t\tlogger.info(\"Return All Users.\");\t\n\t\treturn (List<UsersDTO>) usersService.findAllUsers();\n\t}", "com.google.ads.googleads.v6.resources.UserList getUserList();", "@GET\r\n public List<EnterpriseUserDTO> getEnterpriseUserList(){\r\n List <EnterpriseUserEntity> enterpriseUsers = enterpriseUsersLogic.obtenerEnterpriseUsers();\r\n return EnterpriseUserDTO.toEnterpriseUserList(enterpriseUsers);\r\n }", "@GetMapping(\"/\")\n\tpublic ResponseEntity<List<UsersDTO>> listAllusers(){\n\t\tList<UsersDTO> users = userJpaRepository.findAll();\n\t\tif(users.isEmpty()) {\n\t\t\treturn new ResponseEntity<List<UsersDTO>>(HttpStatus.NO_CONTENT);\n\t\t}\n\t\treturn new ResponseEntity<List<UsersDTO>>(users, HttpStatus.OK);\n\t}", "Collection<User> getUsers() throws DataAccessException;", "@ApiResponses(value = {\n\t\t\t@ApiResponse(responseContainer = \"List\", response = User.class, code = 200, message = \"接口正常\"),\n\t\t\t@ApiResponse(code = 401, message = \"\"), @ApiResponse(code = 405, message = \"权限有问题\"),\n\t\t\t@ApiResponse(code = 500, message = \"后台报错了\") })\n\t@ApiOperation(value = \"listUsers\", httpMethod = \"GET\", notes = \"查找用户列表\")\n\t@RequestMapping(value = \"/user/listUsers\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<User> listUsers() {\n\t\tList<User> users = new ArrayList<User>();\n\t\tUser user01 = new User(100L, \"name 1\", \"pwd 1\", \"email 1\", \"telephone 1\", \"address 1\");\n\t\tUser user02 = new User(100L, \"name 2\", \"pwd 1\", \"email 1\", \"telephone 1\", \"address 1\");\n\n\t\tif (users.size() == 0) {\n\t\t\tlogger.error(\"没有用户数据\");\n\t\t}\n\t\tusers.add(user01);\n\t\tusers.add(user02);\n\t\treturn users;\n\t}", "public List<Utilizator> listUsers();", "@RequestMapping(value = \"/getAll\", method = RequestMethod.GET)\n public ResponseEntity getAllUsers() {\n List<User> users = userService.getAllUsers();\n if (CollectionUtils.isEmpty(users)) {\n return new ResponseEntity(HttpStatus.NO_CONTENT);\n }\n return new ResponseEntity(users, HttpStatus.OK);\n }", "@GetMapping(\"/users\")\n\tpublic List<User> getUsers(){\n\t\treturn userRepository.findAll();\n\t\t\n\t}", "public List<Users> getUserList(){\n\t\tList<Users> users = (List<Users>) this.userDao.findAll();\n\t\treturn users;\n\t}", "@POST(\"/ListUsers\")\n\tCollection<User> listUsers();", "public static List<User> getUsersList(){\n\t\tWSResponse response = null;\n\t\tList<User> resultList = new ArrayList<User>();\n\t\ttry{\n\t\tPromise<WSResponse> result = WS.url(Utils.getApiUrl()+Urls.GET_USERS_URL)\n\t\t\t\t\t\t\t\t\t\t.setContentType(Urls.CONTENT_TYPE_JSON)\n\t\t\t\t\t\t\t\t\t\t.get();\n\t\tresponse = result.get(10000);\n\t\tGson gson = new Gson();\n\t\tUser[] users = gson.fromJson(response.getBody(), User[].class);\n\t\tfor(int i=0; i<users.length; i++){\n\t\t\tresultList.add(users[i]);\n\t\t}\n\t\t} catch(Exception exception){\n\t\t\tController.flash(Messages.ERROR, Messages.CANT_LOAD_USERS + exception);\n\t\t}\n\t\treturn resultList;\n\t}", "@GetMapping(\"/userslist\")\n\tpublic List<User> usersList() {\n\t\treturn userService.usersList();\n\t}", "@ApiOperation(value = \"Retourne tous utilisateurs de la BD\")\n @GetMapping(\"/users\")\n @ResponseBody\n public ResponseEntity<Collection<User>> getUsers(){\n Collection<User> users = userService.findAll();\n if (users == null)\n return new ResponseEntity<>(HttpStatus.FORBIDDEN);\n return new ResponseEntity<>(users,HttpStatus.OK);\n }", "Collection<GetUserDto> getAllUsers();", "com.heroiclabs.nakama.api.User getUsers(int index);", "public String[] listUsers();", "@GET(\"/api/users\")\n public void getUser(Callback<List<User>> callback);", "java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();", "java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<User> showUsers() throws JsonMappingException, JsonProcessingException {\n\n\t\tString url = \"http://localhost:8081/fundoouser/showall\";\n\t\t\n\t\tResponse userResponse = restTemplate.getForObject(url, Response.class);\n\t\t\n\t\tList<User> userList = (List<User>) userResponse.getData(); \n\t\t\n\t\treturn userList;\n\t}", "List<User> fetchAllUSers();", "@GetMapping\n public ResponseEntity<List<UserEntity>> getAllUsers() {\n return ResponseEntity.ok(uService.getAllUsers());\n }", "@GetMapping(value = URL)\n @ResponseBody\n public List<Users> listAll() {\n return usersService.listAll();\n }", "List<UserDTO> getAllUsers();", "public List<User> getUserList()\r\n\t{\r\n\t//\tGet the user list\r\n\t//\r\n\t\treturn identificationService.loadUserList();\r\n\t}", "@Override\n\tpublic List<Object> getAllUsers() {\n\t\tList<Object> usersList = new ArrayList<Object>();\n\t\tList<TestUser> users = dao.getAll();\n\t\tSystem.out.println(dao.exists(5));\n\t\tfor(TestUser user : users){\n\t\t\tMap<String,Object> m = new HashMap<String,Object>();\n\t\t\tm.put(\"id\", user.getId());\n\t\t\tm.put(\"name\", user.getUsername());\n\t\t\tm.put(\"pwd\", user.getPassword());\n\t\t\tJSONObject j = new JSONObject(m);\n\t\t\tusersList.add(j);\n\t\t}\n\t\treturn usersList;\n\t}", "ResponseEntity<Response> users();", "@Override\n public Future<Seq<TUser>> getUsers() {\n return futurePool.apply(new BlockingUserRetriever(\"user1\", false))\n .join(futurePool.apply(new BlockingUserRetriever(\"user2\", false)))\n .transformedBy(\n new FutureTransformer<Tuple2<User, User>, List<TUser>>() {\n @Override\n public List<TUser> map(Tuple2<User, User> value) {\n List<TUser> list = new ArrayList<TUser>(2);\n list.add(value._1().toTObject());\n list.add(value._2().toTObject());\n return list;\n }\n\n // if we call BlockingUserRetriever with useRandom=true then\n // one of the users of maybe both can fail because don't exist so\n // we catch the exception and return an empty list instead\n @Override\n public List<TUser> handle(Throwable throwable) {\n return new ArrayList<TUser>();\n }\n }\n ).transformedBy(\n new FutureTransformer<List<TUser>, Seq<TUser>>() {\n @Override\n public Seq<TUser> map(List<TUser> value) {\n return ScalaSupport.toScalaSeq(value);\n }\n }\n );\n }", "@Override\r\n\tpublic List<User> getUserList() throws MyUserException {\n\t\treturn userDao.getUserList();\r\n\t}", "@Override\r\n\tpublic List<User> users() {\r\n\t\tList<User> ris = new ArrayList<>();\r\n\t\tList< Map <String,String>> maps = getAll(SELECT_USERS);\r\n\t\tfor (Map<String, String> map : maps) {\r\n\t\t\tris.add(IMappable.fromMap(User.class, map));\r\n\t\t}\r\n\t\treturn ris;\r\n\t}", "public List<User> listAll() throws Exception;", "public ArrayList<User> getUsers() {return users;}", "@GetMapping\n public List<User> getAllUsers() {\n return userService.getAllUsers();\n }", "public List<User> getAllUsers(){\n myUsers = loginDAO.getAllUsers();\n return myUsers;\n }", "@RequestMapping(value = \"/user\", method = RequestMethod.GET)\n @PreAuthorize(\"hasRole('ADMIN')\")\n public ResponseEntity<List<UserAccount>> listAllUsers() {\n List<UserAccount> users = userAccountDetailsService.findAllUsers();\n if (users.isEmpty()) {\n return new ResponseEntity<List<UserAccount>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND\n }\n return new ResponseEntity<List<UserAccount>>(users, HttpStatus.OK);\n }", "@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<User> getAllUsers() {\n\t\t// This returns a JSON or XML with the users\n\t\treturn userRepository.findAll();\n\t}", "@Override\n\tpublic List<User> getList() {\n\t\treturn Lists.newArrayList(userRepository.findAll());\n\t}", "@Override\n\tpublic List<User> getUserList() {\n\t\treturn userDao.getList();\n\t}", "protected void getUserList() {\n\t\tmyDatabaseHandler db = new myDatabaseHandler();\n\t\tStatement statement = db.getStatement();\n\t\t// db.createUserTable(statement);\n\t\tuserList = new ArrayList();\n\t\tsearchedUserList = new ArrayList();\n\t\tsearchedUserList = db.getUserList(statement);\n\t\tuserList = db.getUserList(statement);\n\t\tusers.removeAllElements();\n\t\tfor (User u : userList) {\n\t\t\tusers.addElement(u.getName());\n\t\t}\n\t}", "@GetMapping(\"/users\")\n\tpublic List<User> retrieveAllUsers() {\n\t\treturn userService.findAll();\n\t}", "@GetMapping(path=\"/all\",produces = MediaType.APPLICATION_JSON_VALUE)\r\n public @ResponseBody\r\n Iterable<UserEntity> getAllUsers() {\n return userService.getAllUsers();\r\n }", "@RequestMapping(value = \"get_all_users\", headers = \"Accept=*/*\", method = {\n\t\t\tRequestMethod.GET }, produces = \"application/json\")\n\t@ResponseBody\n\[email protected](User.class)\n\tpublic User[] getAllUsers() {\n\t\tArrayList<User> users = new ArrayList<>();\n\t\tMongoClient mongoClient = null;\n\t\ttry {\n\t\t\t// Create Mongo client\n\t\t\tmongoClient = new MongoClient(\"localhost\", 27017);\n\t\t\tMongoDatabase db = mongoClient.getDatabase(\"projectDB\");\n\n\t\t\t// Create Users collection\n\t\t\tMongoCollection<Document> collection = db.getCollection(\"USERS\");\n\t\t\tFindIterable<Document> iterDoc = collection.find();\n\n\t\t\t// Create all users collection\n\t\t\tint i = 1;\n\t\t\tIterator it = iterDoc.iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tDocument docUser = (Document) it.next();\n\t\t\t\tUser user = new User((String) docUser.get(\"username\"), (String) docUser.get(\"firstName\"),\n\t\t\t\t\t\t(String) docUser.get(\"lastName\"));\n\t\t\t\tusers.add(user);\n\t\t\t}\n\n\t\t\t// Close DB connection\n\t\t\tmongoClient.close();\n\n\n\t\t} catch (Exception e) {\n\t\t\tmongoClient.close();\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t\t// Insert list to array\n\t\tUser[] usersArray = new User[users.size()];\n\t\tusers.toArray(usersArray);\n\t\treturn usersArray;\n\t}", "public List<User> getUsers(Boolean enabled, Date startDate, Date endDate, int offset, int length) throws UserManagementException;", "public void getAllUsers() {\n\t\t\n\t}", "@Override\r\n\tpublic List<User> getUsers() {\n\t\tList<User> userlist=dao.getUsers();\r\n\t\treturn userlist;\r\n\t}", "@GetMapping(path = \"\")\n\tpublic @ResponseBody Iterable<ApplicationUser> getAllUsers() {\n\t\treturn userService.getUsers();\n\t}", "public Single<UserResponse> userList(int params) {\n return supportAppService.userList(params);\n }", "abstract ArrayList<User> getAllUsers();", "@GetMapping\n\tpublic List<UserRest> getUsers(@RequestParam(value = \"page\", defaultValue = \"0\") int page,\n\t\t\t@RequestParam(value = \"limit\", defaultValue = \"25\") int limit){\n\t\t\n\t\tList<UserRest> returnValue = new ArrayList<>();\n\t\t\n\t\tList<UserDTO> users = userService.getUsers(page, limit);\n\t\t\n\t\tfor (UserDTO userDTO : users) {\n\t\t\tUserRest userModel = new UserRest();\n\t\t\tBeanUtils.copyProperties(userDTO, userModel);\n\t\t\treturnValue.add(userModel);\n\t\t}\n\t\t\n\t\treturn returnValue;\n\t}", "public List<User> list();", "@ApiOperation(value = \"View a list of available users\", response = Iterable.class)\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = UserApplicationConstants.SUCCESS),\n\t\t\t@ApiResponse(code = 401, message = UserApplicationConstants.NOT_AUTHORIZED),\n\t\t\t@ApiResponse(code = 403, message = UserApplicationConstants.FORBIDDEN),\n\t\t\t@ApiResponse(code = 404, message = UserApplicationConstants.USER_NOT_FOUND) })\n\t@GetMapping(value = \"/\")\n\tpublic ResponseEntity<UserResponseWrapper<List<UserDto>>> getAll() {\n\t\treturn new ResponseEntity<UserResponseWrapper<List<UserDto>>>(\n\t\t\t\tnew UserResponseWrapper<List<UserDto>>(UserResponseStatus.SUCCESS, userService.findAll()),\n\t\t\t\tHttpStatus.OK);\n\t}", "@Override\r\n\tpublic List<User> getAll() {\n\t\treturn users;\r\n\t}", "@GetMapping(path=\"/users\")\r\n\tpublic MappingJacksonValue getAllUsers() {\r\n\t\t\r\n\t\tList<AppUser> appUserList = appUserDaoService.getAllUsers();\r\n\t\t\r\n \t\tMappingJacksonValue mapping = new MappingJacksonValue(appUserList);\r\n \t\tmapping.setFilters(this.filters);\r\n\t\t\r\n\t\treturn mapping;\r\n\t}", "public ch.ivyteam.ivy.scripting.objects.List<ch.ivyteam.ivy.security.IUser> getUsers()\n {\n return users;\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public List<User> listUsers() {\n Session session = this.sessionFactory.getCurrentSession();\n List<User> UsersList = session.createQuery(\"from User\").list();\n for(User u : UsersList){\n logger.info(\"User List::\"+u);\n }\n return UsersList;\n }", "@Override\n public Users getUsers() throws UserException {\n Users users = new Users();\n log.debug(\"getUsers\");\n User user = null;\n ResultSet result;\n Connection conn = null;\n PreparedStatement stm = null;\n try {\n conn = provider.getConnection();\n\n stm = conn.prepareStatement(GET_ALL_USERS);\n result = stm.executeQuery();\n\n while (result.next()) {\n user = buildUserFromResult(result);\n log.debug(\"User found {}\", user);\n users.add((DataUser) user);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n throw new UserException(e.getMessage());\n\n } finally {\n try {\n stm.close();\n conn.close();\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }\n return users;\n }", "public void getUsersList(List<Long> ids, AsyncHttpResponseHandler handler) {\n if (ids == null) {\n return;\n }\n\n String apiUrl = getApiUrl(\"users/lookup.json\");\n RequestParams params = new RequestParams();\n\n String strIds = android.text.TextUtils.join(\",\", ids);\n params.put(\"user_id\", strIds);\n\n // Execute the request\n getClient().get(apiUrl, params, handler);\n }", "List<UserDisplayDto> getAllUsers();", "@Override\r\n\tpublic List<User> queryAllUsers() {\n\t\tList<User> users = userMapper.queryAllUsers();\r\n\t\treturn users;\r\n\t}", "public List<TestUser> getAllUsers(){\n\t\tSystem.out.println(\"getting list of users..\");\n\t\tList<TestUser> user=new ArrayList<TestUser>();\n\t\tuserRepositary.findAll().forEach(user::add);\n\t\t//System.out.println(\"data: \"+userRepositary.FindById(\"ff80818163731aea0163731b190c0000\"));\n\t\treturn user;\n\t}", "@Override\n\tpublic List<User> getUsers() {\n\t\treturn mongoTemplate.findAll(User.class);\n\t}", "@Override\n\t@Transactional(readOnly = true)\n\tpublic List<UserDto> getUsers() {\n\n\t\tList<UserEntity> userEntities = userRepository.findAll();\n\t\tList<UserDto> userDTOs = new ArrayList<>();\n\n\t\tfor (UserEntity u : userEntities)\n\t\t\tuserDTOs.add(etd.getUser(u));\n\t\treturn userDTOs;\n\n\t}", "List<KingdomUser> getAllUsers();", "@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<Resource> getAllUsers() {\n\t\treturn resourceRepository.findAll();\n\t}", "public List<User> getUsers()\n\t{\n\t\treturn usersList;\n\t}", "List<BlogUser> getUsers() throws DAOException;", "@Override\n\tpublic List<String> acquireUserList() {\n\t\tString url = WeChatConst.WECHATURL+WeChatConst.GETUSERLISTURI;\n\t\tboolean flag = true;\n\t\tString next_openid = null;\n\t\tList<String> openids = new ArrayList<String>(); \n\t\twhile (flag) \n\t\t{\n\t\t\tMap<String, String> param = new HashMap<String, String>();\n\t\t\tparam.put(\"access_token\",WeChatGlobalVar.accessToken);\n\t\t\tif(next_openid != null)\n\t\t\t{\n\t\t\t\tparam.put(\"next_openid\", next_openid);\n\t\t\t}\n\t\t\tString response = HttpClientUtils.doGetWithoutHead(url, param);\n\t\t\tlog.debug(\" acquireUserList response :\"+response);\n\t\t\ttry {\n\t\t\t\tJSONObject responseJson = JSONObject.parseObject(response);\n\t\t\t\tif(!responseJson.containsKey(\"errcode\"))\n\t\t\t\t{\n\t\t\t\t\tJSONObject data = responseJson.getJSONObject(\"data\");\n\t\t\t\t\tif(data != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tJSONArray openidArray = data.getJSONArray(\"openid\");\n\t\t\t\t\t\tif(openidArray != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (int i = 0; i < openidArray.size(); i++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\topenids.add(openidArray.getString(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\tString nextopenid = responseJson.getString(\"next_openid\");\n\t\t\t\t\tif(StringUtils.isEmpty(nextopenid))\n\t\t\t\t\t{\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\tnext_openid = nextopenid;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tflag = false;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog.error(e);\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t}\n\t\treturn openids;\n\t}", "@Override\r\n\tpublic Object getList() {\n\t\treturn userDao.getList();\r\n\t}", "public void getUsers() {\n CollectionReference ref = FirebaseFirestore.getInstance().collection(\"users\");\n listOfUsers = new ArrayList<>();\n\n ref.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if(task.isSuccessful()) {\n for(DocumentSnapshot doc: task.getResult()) {\n listOfUsers.add(doc.toObject(User.class).getUserID());\n }\n listOfUsers.remove(user.getUserID());\n }\n }\n });\n }", "@Override\n\tpublic List<User> list() \n\t{\n\t\treturn userDAO.list();\n\t}", "List<User> getActivatedUserList();", "@Override\r\n public List<User> userfindAll() {\n return userMapper.userfindAll();\r\n }" ]
[ "0.79290736", "0.79290736", "0.7861477", "0.7821784", "0.7652903", "0.76398045", "0.75936365", "0.7520237", "0.7498928", "0.7481893", "0.74783045", "0.7450487", "0.7447236", "0.7446162", "0.7437137", "0.7436352", "0.7407772", "0.74036115", "0.7390343", "0.7378196", "0.7378196", "0.73557746", "0.73190063", "0.73094326", "0.7279342", "0.7257187", "0.72344184", "0.72281474", "0.72212744", "0.7218797", "0.72130066", "0.7202865", "0.71991354", "0.71947753", "0.71713966", "0.7163034", "0.7154787", "0.71531004", "0.7141075", "0.7138036", "0.7135411", "0.71352416", "0.7125523", "0.7106565", "0.71008", "0.70966274", "0.7094111", "0.70939153", "0.70937645", "0.7090905", "0.7084461", "0.7064843", "0.7062044", "0.7053925", "0.705266", "0.7051134", "0.7049051", "0.70489234", "0.70486724", "0.7035761", "0.70306593", "0.7030354", "0.7029412", "0.70274824", "0.70243156", "0.7023802", "0.70182693", "0.7006216", "0.69962144", "0.699095", "0.69856155", "0.69824016", "0.69714606", "0.6969298", "0.6968468", "0.69426185", "0.69331557", "0.6916335", "0.6911829", "0.6910515", "0.69084", "0.6904788", "0.68947566", "0.6894018", "0.68934196", "0.68916434", "0.6891294", "0.6886485", "0.6881931", "0.6877235", "0.6865651", "0.6858829", "0.6855721", "0.68547565", "0.685354", "0.6852472", "0.68513644", "0.6844599", "0.68369234", "0.6836616", "0.67963296" ]
0.0
-1
This function is called when a page is fetched and ready to be processed by your program.
@Override public void visit(Page page) { // Some business logic I won't expose here // My boss won't be happy ;-) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void crawlPage() {\n\t\tlogger.info(\"Starting to crawl \" + page.getLink());\n\t\tconsoleLogger.info(\"Starting to crawl \" + page.getLink());\n\n\t\tDocument document = fetchContent(page);\n\t\tif (document == null)\n\t\t\treturn;\n\n\t\tif (shouldSavePage) {\n\t\t\tsavePage(document, page.getLink());\n\t\t}\n\n\t\tlogger.info(\"Done crawling \" + page.getLink());\n\t}", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "@Step(\"Waiting for page load\")\n public abstract PageBase load();", "protected void doAdditionalPageInitialization(IPage page) {\n }", "public void process(Page page) {\n\t\t\t\tgetContent(page);\n\t\t\t}", "@Override\n public void waitUntilPageObjectIsLoaded() {\n }", "@Override\n public void process(Page page) {\n PageStore.prePage = page.getHtml().toString();\n }", "@Override\n public void PageFistLoad() {\n }", "public void waitForContentLoad() {\n // TODO implement generic method to wait until page content is loaded\n\n // wait.until(...);\n // ...\n }", "@Override\n\tprotected void load() {\n\t\tisPageLoaded = true;\n\t}", "public void run() {\n getPage(page + 1, false);\n }", "private static void prePageFetch() {\n WEB_CLIENT.getOptions().setJavaScriptEnabled(false);\n WEB_CLIENT.getOptions().setThrowExceptionOnFailingStatusCode(false);\n\n // just turns off all the red stuff from the console\n java.util.logging.Logger.getLogger(\"com.gargoylesoftware.htmlunit\").setLevel(Level.OFF);\n }", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "private void waitForFirstPageToBeLoaded() {\n IdlingResource idlingResource = new ElapsedTimeIdlingResource(LATENCY_IN_MS + 1000);\n IdlingRegistry.getInstance().register(idlingResource);\n\n //Check that first item has been loaded\n onView(withItemText(\"POPULAR MOVIE #1 (1999)\")).check(matches(isDisplayed()));\n\n //Clean up\n IdlingRegistry.getInstance().unregister(idlingResource);\n }", "public void thePageIsLoaded() {\r\n this.page.isLoaded();\r\n }", "public void incPagesCrawled() {\n pagesCrawled++;\n }", "public void loadPage() { \n\t \n\t if((sPref.equals(ANY)) && (wifiConnected || mobileConnected)) {\n\t \tnew DownloadXmlTask().execute(URL);\n\t }\n\t else if ((sPref.equals(WIFI)) && (wifiConnected)) {\n\t new DownloadXmlTask().execute(URL);\n\t } else {\n\t // show error\n\t } \n\t }", "private void processAllPages(final HtmlPage page, final HashMap<String, Object> metaData) {\n int pageNumber = 1;\n\n HtmlPage actualPage = page;\n\n while (actualPage!= null && isPageValid(actualPage)) {\n if (actualPage.getWebResponse().getStatusCode() != HTTP_SUCCESS_CODE) {\n logger.error(\"Received non-200 status code while trying to read from {}.\", actualPage.getUrl());\n throw new UnrecoverableException(\"Crawling failed due to non-200 HTTP response.\");\n }\n\n logger.info(\"Processing page #{}\", pageNumber);\n publishTenders(actualPage, metaData);\n\n logger.debug(\"Data extracted, moving to next page.\");\n pageNumber++;\n\n actualPage = getNextPage(actualPage, pageNumber);\n }\n }", "@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}", "private void gotoCompletePage() {\n WebkitUtil.forward(mWebView, AFTER_PRINT_PAGE);\n }", "@Override\n\tpublic void checkPage() {\n\t}", "public void waitForContentLoad() {\n verifyPageIsOpened(currentPage.get(), \"Please open some page before the waiting for content to load.\");\n currentPage.get().waitLoadFinished();\n }", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "@Override\n public void run() {\n mHunterSeeker.onFinishPage(emailsOnPage, lastHtmlResult);\n onSendUpdate(\"RegexUtils.purify returned \" + emailsOnPage.size() + \" items\");\n }", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "public abstract void pageDisplayed();", "public void loadPage(){\r\n\r\n driver.get(getPAGE_Url());\r\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\r\n\r\n }", "@Override\n public void onPourSoupRaised() {\n }", "@Override\r\n\tpublic void run()\r\n\t{\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\t//System.out.println(\"beginning of Parser code\");\r\n\t\t\t\r\n\t\t\t//pull a page from the page que\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tpageText = SharedPage.getNextPage();\r\n\t\t\t\t//System.out.println(\"Parser Page Pulled\");\r\n\t\t\t} \r\n\t\t\tcatch (InterruptedException e) \r\n\t\t\t{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for all links in anchor (<a href=\"\") elements\r\n\t\t\t\r\n\t\t\t//Regex\r\n\t\t\t//loop will execute for each link found\r\n\t\t\tPattern pattern = Pattern.compile(\"href=\\\"(http:.*?)\\\"\");\r\n\t\t\tMatcher matcher = null;\r\n\t\t\t\r\n\t\t\t//Some pages are returning null values\r\n\t\t\tif(pageText != null)\r\n\t\t\t{\r\n\t\t\t\tmatcher = pattern.matcher(pageText);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add each link found to the link queue\r\n\t\t\t\r\n\t\t\t//sometimes matcher is returning null values\r\n\t\t\twhile(matcher != null && matcher.find())\r\n\t\t\t{\r\n\t\t\t\tString link = matcher.group(1);\r\n\t\t\t\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tSharedLink.addLink(link);\r\n\t\t\t\t} \r\n\t\t\t\tcatch (InterruptedException e) \r\n\t\t\t\t{\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for keywords specified by the user of the webcrawler\r\n\t\t\tArrayList<String> keywords = WebCrawlerConsole.getKeywords();\r\n\t\t\t\r\n\t\t\t\tfor(String word : keywords)\r\n\t\t\t\t{\r\n\t\t\t\t\t//cannot split pageText if it is null\r\n\t\t\t\t\tif(pageText != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString[] keywordSearch = pageText.split(word);\r\n\t\t\t\t\t\tfor(int i=0; i < keywordSearch.length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWebCrawlerConsole.keywordHit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//System.out.println(\"end of Parser code\");\r\n\t\t}\r\n\t}", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "@Override\n protected void onNextPageRequested(int page) {\n\n }", "@Override\n\tpublic void process(Task task, Page page) {\n\t\t\n\t}", "@When(\"Hotels List page has finished loading\")\n public void listpage_i_am_on_list_page() {\n listPage = new HotelsListPage(driver);\n listPage.check_page_title();\n }", "public boolean isPageComplete();", "private void loadPage() {\n \t\n if (((sPref.equals(ANY)) && (wifiConnected || mobileConnected))\n || ((sPref.equals(WIFI)) && (wifiConnected))) {\n // AsyncTask subclass\n \t\n new DownloadXmlTask().execute(URL);\n } else {\n showErrorPage();\n }\n }", "@Override\n\tpublic void process(Page page){\n\n\t CollectTemplate collectTemplate = templateService.getCollectTemplateById(templateId);\n\t String currentUrl=page.getUrl().toString();\n\t String nextUrlXpath=collectTemplate.getNextUrlXpath();\n \tString contentUrlXpath=collectTemplate.getContentUrlXpath();\n \tString listUrlRegex=collectTemplate.getListUrlRegex();\n \tString contentUrlRegex=collectTemplate.getContentUrlRegex();\n \tList<CollectTemplateField> fields=collectTemplate.getFields();\n \ttry {\n\t \t\t\n\t \tHtml currentHtml= page.getHtml();\n\n\t\t\t//判断是否是列表页\n\t if (currentUrl.matches(listUrlRegex)) {\n\n\t\t\t\t//处理列表页\n\t\t\t\tString nextPageUrl=\"\";\n\t\t\t\ttry{\n\t\t\t\t\tnextPageUrl=currentHtml.xpath(nextUrlXpath).toString();\n\t\t\t\t\tif (nextPageUrl==null||StringUtils.isEmpty(nextPageUrl)){\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e){\n\t\t\t\t\tXpath2Selector xpath2Selector = new Xpath2Selector(nextUrlXpath);\n\t\t\t\t\tnextPageUrl = xpath2Selector.select(page.getRawText());\n\n\t\t\t\t\tif (nextPageUrl!=null&&nextPageUrl.startsWith(\"/\")){\n\t\t\t\t\t\tnextPageUrl = \"http://\"+site.getDomain()+nextPageUrl;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t \tif (StringUtils.isNotEmpty(nextPageUrl)) {\n\n\t \t\tRequest request=new Request();\n\t \t\trequest.setUrl(nextPageUrl);\n\t \t\trequest.setPriority(-1);\n\t \t\t\n\t \t\tpage.addTargetRequest(request);\n\n\t \t\tlogService.info(projectId,\"get the next page link \"+nextPageUrl+\" and add it to the queue\");\n\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get the next page link\");\n\n\t\t\t\t}\n\t \tList<String> detailPagesUrl;\n\t \ttry{\n\t\t\t\t\tdetailPagesUrl = currentHtml.xpath(contentUrlXpath).all();\n\n\t\t\t\t}catch (Exception e){\n\n\t\t\t\t\tXpath2Selector xpath2Selector2 = new Xpath2Selector(contentUrlXpath);\n\t\t\t\t\tdetailPagesUrl = xpath2Selector2.selectList(currentHtml.getDocument().text());\n\t\t\t\t}\n\n\n\n\t \tif (detailPagesUrl!=null&&detailPagesUrl.size()!=0) {\n\t\t\t\t\t//添加详情页\n\t\t\t\t\tpage.addTargetRequests(detailPagesUrl, 1);\n\n\t\t\t\t\tlogService.info(projectId,\"get \"+detailPagesUrl.size()+\" detail pages\");\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get detail page\");\n\n\t\t\t\t}\n\t\t\t}else if (StringUtils.isEmpty(contentUrlRegex)||currentUrl.matches(contentUrlRegex)) {\n\t \t//处理详情页\n\t\t\t\tcontentPageProcessService.setProjectId(projectId);\n\t\t\t\tcontentPageProcessService.progressContentPage(page,fields);\n\t\t\t}\n\t \t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t \n\t }", "void startPage(RequestContextHolder request);", "@Override\r\n\tpublic boolean isPageLoaded() {\n\t\treturn false;\r\n\t}", "public void loadStartPage()\n\t{\n\t}", "public void loadPage() {\n\t\tLog.i(TAG, \"MyGardenListActivity::LoadPage ! Nothing to do anymore here :)\");\n\t}", "public static void waitForPageLoad() {\n\n\t\tif (!WebController.driver.getCurrentUrl().contains(\"uhc.com/dashboard\") && !WebController.driver.getCurrentUrl().contains(\"myuhc.com/member/\") && !WebController.driver.getCurrentUrl().contains(\"=securityQuestion\")) {\n\t\t\tWaitForLoadingOverlay();\n\t\t}\n\n\t\tJavascriptExecutor js = null;\n\t\tfor (int i = 0; i < AppConfiguration.getWaitTime(); i++) {\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tjs = (JavascriptExecutor) WebController.driver;\n\t\t\tif (js.executeScript(\"return document.readyState\").toString().equals(\"complete\"))\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "PageAgent getPage();", "@Override\n public void onLoad(String url) {\n \n }", "protected void waitThePageToLoad() {\n ExpectedCondition pageLoadCondition = new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver driver) {\n return ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\n }\n };\n WaitUtils.waitUntil(driver, pageLoadCondition);\n }", "@Override\n public void establish() {\n logger.info(\"Opening page {}...\", pageObject);\n initializePage();\n pageObject.open();\n }", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "public void getNextPage(String url) {\n String kw = \"flag\";\n client = new OkHttpClient();\n final Request request = new Request.Builder()\n .url(url)\n .build();\n Call call = client.newCall(request);\n call.enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n System.out.println(e);\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n String htmlStr = response.body().string();\n //Type listTpye = new TypeToken<LinkedList<QueryRes>>(){}.getType();\n //System.out.println(htmlStr.toString());\n\n try {\n json = new JSONObject(htmlStr);\n //parsePageJson(json);\n System.out.println(json);\n } catch (Exception e) {\n System.out.println(\"error again\");\n }\n //parseJson(json);\n Message msg = handler.obtainMessage();\n msg.what = 1;\n handler.sendMessage(msg);\n //parsePageJson(page_json);\n }\n });\n }", "@Override\n protected void init(PageDto page, HttpServletRequest request, HttpServletResponse response, Model model) {\n\n }", "public void waitForPageLoaded() {\r\n\r\n\t\tExpectedCondition<Boolean> expectation = new ExpectedCondition<Boolean>() {\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\treturn ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t}\r\n\t\t};\r\n\t\tWait<WebDriver> wait = new WebDriverWait(driver, timeout);\r\n\t\twait.until(expectation);\r\n\t}", "@Override\n\tpublic void process(Page page) {\n\t\tDocument doc = Jsoup.parse(page.getHtml().getFirstSourceText());\n\n\t\tif (isFirst) {\n\t\t\tSystem.out.println(\"添加所有列表链接\");\n\t\t\tArrayList<String> urls = new ArrayList<String>();\n\t\t\t// 33\n\t\t\tfor (int i = 2; i < 30; i++) {\n\t\t\t\turls.add(\"http://zyjy.jiangmen.gov.cn//szqjszbgg/index_\" + i + \".htm\");\n\t\t\t}\n\t\t\tpage.addTargetRequests(urls);\n\t\t\tSystem.out.println(\"这一页一共有 \" + urls.size() + \" 条数据\");\n\n\t\t\tisFirst = false;\n\t\t}\n\n\t\tif (page.getUrl().regex(URL_LIST).match() || page.getUrl().toString().trim().equals(url)) {\n\t\t\tSystem.out.println(\"获取列表数据\");\n\n\t\t\tElements uls = doc.getElementsByAttributeValue(\"class\", \"c1-bline\");\n\t\t\tfor (Element ul : uls) {\n\t\t\t\tString url = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).select(\"a\").attr(\"href\").trim();\n\t\t\t\tString title = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).text();\n\t\t\t\tString data = ul.getElementsByAttributeValue(\"class\", \"f-right\").get(0).text();\n\t\t\t\tCacheHashMap.cache.put(url, title + \"###\" + data);\n\t\t\t\tMyUtils.addRequestToPage(page, url);\n\t\t\t\tSystem.out.println(url + \" \" + CacheHashMap.cache.get(url));\n\t\t\t}\n\n\t\t}\n\t\tif (page.getUrl().regex(URL_DETAILS).match()) {\n\n\t\t\tProject project = new Project();\n\t\t\tStringBuffer project_article = new StringBuffer();\n\n\t\t\tString urldetails = CacheHashMap.cache.get(page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"url\" + page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"urldetails \" + urldetails);\n\n\t\t\tString[] value = urldetails.split(\"###\");\n\t\t\tif (value != null && value.length > 1) {\n\t\t\t\tproject.setProjectName(value[0]);\n\t\t\t\tproject.setPublicStart(value[1]);\n\t\t\t}\n\n\t\t\tElements divs = doc.getElementsByAttributeValue(\"class\", \"contlist minheight\");\n\t\t\tfor (Element div : divs.get(0).children()) {\n\t\t\t\tif (div.nodeName().equals(\"table\")) {\n\t\t\t\t\tElements trs = divs.select(\"tbody\").select(\"tr\");\n\t\t\t\t\tfor (Element tr : trs) {\n\t\t\t\t\t\tproject_article.append(tr.text()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tproject_article.append(div.text()).append(\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tproject.setUrl(page.getUrl().toString().trim());\n\t\t\tproject.setState(0);\n\t\t\tproject.setWebsiteType(\"江门市\");\n\t\t\tproject.setTime(MyUtils.getcurentTime());\n\t\t\tproject.setRawHtml(divs.toString());\n\n\t\t\tproject.setArticle(project_article.toString());\n\t\t\tSystem.out.println(project);\n\n\t\t\tHibernateUtil.save2Hibernate(project);\n\n\t\t}\n\n\t}", "@When(\"the user waits for the next news to be loaded\")\r\n\tpublic final void whenTheUserWaitsForTheNextNewsToBeLoaded() {\r\n\t\twaitForNextNews(chromeDriver);\r\n\t\twaitForNextNews(firefoxDriver);\r\n\t\twaitForNextNews(internetExplorerDriver);\r\n\t}", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tboolean redirected=false;\n\t\t\tint responseCode=0;\n\t\t\tint tries=0;\n\t\t\tString location=site.getUrl();\n\t\t\tHttpURLConnection urlConnection=null;\n\t\t\tdo{\n\t\t\t\tURL url = new URL(location);\n\t\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\t\t\t\turlConnection.setConnectTimeout(Constants.CONNECTION_TIMEOUT);\n\t\t\t\turlConnection.setReadTimeout(Constants.READ_TIMEOUT);\n\t\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\t\turlConnection.setInstanceFollowRedirects(true);\n\t\t\t\turlConnection.setUseCaches(false);\n\t\t\t\turlConnection.setAllowUserInteraction(false);\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\tresponseCode = urlConnection.getResponseCode();\n\t\t\t\t\n\t\t\t\tif(responseCode==HttpURLConnection.HTTP_MOVED_TEMP || responseCode==HttpURLConnection.HTTP_MOVED_PERM){ //handle 302 and 301 redirect. \n\t\t\t\t\tredirected=true;\n\t\t\t\t\tlocation = urlConnection.getHeaderField(\"Location\");\n\t\t\t\t\ttries++;\n\t\t\t\t}else\n\t\t\t\t\tredirected=false;\n\t\t\t}while(redirected && tries<3);\n\t\t\t\n\t\t\tif (responseCode == HttpURLConnection.HTTP_OK){\n\t\t\t\ttry (InputStream is = urlConnection.getInputStream();\n\t\t BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n\t\t String content = br.lines().collect(Collectors.joining(System.lineSeparator()));\n\t \tthis.callback.webContentCallBack(site, content);\n\t\t } \n\t\t\t}else this.callback.webContentCallBack(site, null); //any other case, null is returned as the content. \n\t\t}catch (Exception e) {\n\t\t\tLogger.getLogger(Fetcher.class.getName()).log(Level.WARNING, \"Site:\"+site.getUrl()+\" failed fetching.\", e);\n\t\t\ttry {\n\t\t\t\tthis.callback.webContentCallBack(site, null); //any exception, null is returned as the content. \n\t\t\t} catch (Exception e1) {\n\t\t\t} \n\t\t}\n\t}", "static Page Download(){\n // TODO: reference to fetch to download webpages\n WebURL url = queue.poll();\n // call http request to get the web page\n return null;\n }", "@Override\r\n public void visit(Page page) {\r\n String url = page.getWebURL().getURL();\r\n System.out.println(\"URL: \" + url);\r\n\r\n if (page.getParseData() instanceof HtmlParseData) {\r\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\r\n String text = htmlParseData.getText();\r\n String html = htmlParseData.getHtml();\r\n List<WebURL> links = htmlParseData.getOutgoingUrls();\r\n\r\n System.out.println(\"Text length: \" + text.length());\r\n System.out.println(\"Html length: \" + html.length());\r\n System.out.println(\"Number of outgoing links: \" + links.size());\r\n\r\n try {\r\n Configuration config = new Configuration();\r\n System.setProperty(\"HADOOP_USER_NAME\", \"admin\");\r\n FileSystem fileSystem = FileSystem.get(new URI(\"hdfs://192.168.51.116:8022/\"), config);\r\n FSDataOutputStream outStream = fileSystem.append(new Path(\"/user/admin/crawler-results.txt\"));\r\n\r\n IOUtils.write(text.replace('\\n', ' '), outStream);\r\n outStream.flush();\r\n IOUtils.closeQuietly(outStream);\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n throw new RuntimeException(ex);\r\n }\r\n }\r\n }", "@Test(priority = 1)\n public void testIsPageLoad() throws MalformedURLException {\n\t\tassertTrue(true);\n }", "public void handleStatuScode(Page page);", "public void loadLastReadPage(){\n \t\t\tlastReadLoaded = false;//recalculate and jump to the last read page\n \t\t\tpageHasChanged = false;//navigating between pages causes the view to jump to top of page, this'll reset that\n \t\t\tloadPage(false, null);\n \t\t}", "public void run() {\n\t\t\t\t\t\tif (__delayCounter == _delayCounter[0]) {\r\n\t\t\t\t\t\t\t_pageBook.showPage(__page);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public void processDocument(String url) throws PageReadException {\n // TODO: reset the results.\n impossible = false;\n givenUrl = url;\n nextPageLink = null;\n if (!notFirstPage) {\n xmlImages = new ArrayList<String>();\n title = null;\n }\n\n String content = pageReader.readPage(url);\n\n document = Jsoup.parse(content);\n\n if (document.getElementsByTag(\"body\").size() == 0) {\n LOG.error(\"no body to parse \" + url);\n impossible = true;\n throw new PageReadException(\"no body to parse\");\n }\n\n init(); // this needs another name, it does all the work.\n if (readAllPages && nextPageLink != null) {\n try {\n String textSoFar = articleText;\n notFirstPage = true;\n processDocument(nextPageLink);\n if (articleText != null) {\n articleText = textSoFar + articleText;\n }\n } finally {\n notFirstPage = false;\n System.out.println(articleText);\n }\n }\n\n }", "public PageList() { \n// fileIO = new CharFileIO(\"utf-8\");\n// We are not currently using this to extract 'title' because it doesn't work \n// for whose title and meta-description tags are not explicitly specified;\n// Such as pages written in scripting languages like .jsp, .asp etc \n// parseJob = new ParseJob();\n }", "public void run() {\n\t\tHtmlPage page = null;\n\t\tHtmlSelect select = null;\n\t\tHtmlOption option = null;\n\t\tDataStreamWriter connection = null;\n\t\tWebClient client = new WebClient(BrowserVersion.FIREFOX_3);\n\t\t/* eseguo i job assegnati al thread in esecuzione */\n\t\tfor(int j = 0; j < this.jobs.length; j++) {\n\t\t\tint currentJob = this.jobs[j];\n\t\t\ttry {\n\t\t\t\t/* faccio dei tentativi per collegarmi alle pagine */\n\t\t\t\tpage = getPage(client, this.getDataSourceURL());\n\t\t\t\t/* seleziono l'opzione relativa alla regione assegnata al task */\n\t\t\t\tselect = (HtmlSelect) page.getByXPath(\"//select\").get(0);\n\t\t\t\toption = select.getOption(currentJob);\n\t\t\t\toption.setSelected(true);\n\t\t\t\tString regione = option.asText();\n\t\t\t\t/* seleziono l'opzione ed ottengo la pagina aggiornata */\n\t\t\t\tpage = (HtmlPage) select.fireEvent(Event.TYPE_CHANGE).getNewPage();\n\t\t\t\t\n\t\t\t\t/* estraggo i dati e li salvo nello \"storage\" */\n\t\t\t\tconnection = this.storageFacade.getDataStreamWriter();\n\t\t\t\tconnection.openStreamWriter();\n\t\t\t\tthis.extractData(client, connection, page, regione);\n\t\t\t}\n\t\t\tcatch (HTMLCrawlerException e) {\n\t\t\t\tSystem.err.println(\"@ HTMLCrawlerException : Extracting Data Error\");\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t//client.closeAllWindows();\n\t\t\t\tif (connection != null)\n\t\t\t\t\tconnection.closeStreamWriter();\n\t\t\t}\n\t\t}\n\t\tclient.closeAllWindows();\n\t}", "public void onModuleLoad() {\n \t\tMainPage.currentPage = this;\n \t\t\n \t\tif(Window.Location.getHash().length() == 0){\n \t\t\tloggedIn = false;\n \t\t}else{\n \t\t\tloggedIn = true;\n \t\t}\n \t\t\n \t\tinitUI();\n \t\t\n \t\tif(loggedIn){\n \t\t\tsetStatus(\"fetching JSON...\", false);\n \t\t\tfbFetcher.fetchNeededJSON();\n \t\t}\n \t\t\n \t}", "public interface PageDispatcher {\n\t/**\n\t * Process a webpage\n\t * @param url The URL to process\n\t * @param link The link that was followed to get there\n\t */\n\tpublic void dispatch(URL url, Weblink link, long delay);\n\t\n\t/**\n\t * Register a redirect\n\t * @param oldURL The URL that was redirected\n\t * @param newURL The URL it was redirected to\n\t * @param delay The number of milliseconds to wait before loading the page\n\t */\n\tpublic void registerRedirect(String oldURL, String newURL);\n\t\n\t/**\n\t * Remove all traces of having crawled a URL\n\t * @param url the URL to remove\n\t */\n\tpublic void undispatchURL(String url);\n\t\n\t/**\n\t * Notify the dispatcher that a page has been parsed\n\t * @param page The final version of the page\n\t * @param link The link that was followed to reach the page\n\t */\n\tpublic void notifyPage(Webpage page, Weblink link);\n\t\n\t/**\n\t * Send a command to the Builders\n\t * @param cmd The Command to send\n\t */\n\tpublic void sendCommand(Command cmd);\n}", "private void notifyPageInit() {\n\t\tString nativeNotificationCallback = JS_NOTIFICATION_FROM_NATIVE;\n\t\tString notificationArgument = \"\" + SmartConstants.NATIVE_EVENT_PAGE_INIT_NOTIFICATION;\n\t\tnotifyToJavaScript(nativeNotificationCallback, notificationArgument);\n\t}", "@When(\"Hotels Details page has finished loading\")\n public void detailspage_i_am_on_details_page() {\n detailsPage = new HotelsDetailsPage(driver);\n detailsPage.check_page_title();\n }", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\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\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "@Override\n public void run() {\n numStarted ++;\n\n while (true) {\n try {\n // pull a link from the link queue\n URL url = new URL(SharedLinkQueue.getNextLink());\n\n // download the HTML page text at the given URL\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n BufferedReader download = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\n // store the HTML page text on the page queue as a string\n String pageText = \"\";\n String inputLine;\n while ((inputLine = download.readLine()) != null) {\n pageText += inputLine;\n }\n SharedPageQueue.addPage(pageText);\n\n download.close();\n } catch (MalformedURLException e) {\n errorCount ++;\n System.out.println(\"MalformedURLException: \" + e.getMessage());\n } catch (IOException e) {\n errorCount ++;\n System.out.println(\"IOException: \" + e.getMessage());\n } catch (InterruptedException e) {\n errorCount ++;\n System.out.println(\"InterruptedException: \" + e.getMessage());\n }\n }\n }", "@Override\n\tpublic void loadNextPage() {\n\t\tif(curr_content.isLastPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是最后一页:\", 3000);\n\t\t}else{\n\t\t\texchangeNext(m_bookFactory.getNextPageContent(next_content));\n\t\t}\n\t}", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public abstract void ready();", "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}", "public void postProcessing() {\n //empty\n }", "public PageVisits() {\n LOG.info(\"=========================================\");\n LOG.info(\"Page Visit Counter is being created\");\n LOG.info(\"=========================================\");\n }", "private void hitURL(String URL){\n Log.v(\".hitURL\", \" now crawling at: \" + URL);\n String refinedURL = NetworkUtils.makeURL(URL).toString();\n visitedLinks.add(refinedURL);\n browser.loadUrl(refinedURL);\n\n\n // OR, you can also load from an HTML string:\n// String summary = \"<html><body>You scored <b>192</b> points.</body></html>\";\n// webview.loadData(summary, \"text/html\", null);\n // ... although note that there are restrictions on what this HTML can do.\n // See the JavaDocs for loadData() and loadDataWithBaseURL() for more info.\n }", "public HTMLParser () {\r\n this.pagepart = null;\r\n }", "public void torrentScrape() {\n\t\tAlfred.getTorrentScraper().scrape();\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "public void beginCrawling() {\n\n if (urlsFile != null\n && emailsFile != null\n && urlsWriter != null\n && emailsWriter != null) {\n crawl(startUrl);\n }\n }", "@Override\n public void onPageFinished(WebView view, String url)\n {\n }", "public void nextPage() {\n\t\tthis.skipEntries += NUM_PER_PAGE;\n\t\tloadEntries();\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public interface PageConnector {\n void onLastPage();\n void onNormalPage();\n}", "public DynamicPage whenPageLoaded() {\n\t\tDynamicUtil.waitForPageLoadComplete(driver);\n\t\treturn this;\n\t}", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "private void loadContent()\n {\n // locking the function to prevent the adapter\n // from calling multiples async requests with\n // the same definitions which produces duplicate\n // data.\n locker.lock();\n\n // this function contruct a GraphRequest to the next paging-cursor from previous GraphResponse.\n GraphRequest nextGraphRequest = lastGraphResponse.getRequestForPagedResults(GraphResponse.PagingDirection.NEXT);\n\n // if we reached the end of our pages, the above method 'getRequestForPagedResults'\n // return 'null' object\n if(nextGraphRequest != null)\n {\n // for clarificating and formatting purposes\n // I declared the callback besides the members\n // variables.\n nextGraphRequest.setCallback(callback);\n nextGraphRequest.executeAsync();\n }\n }", "Point onPage();", "@Override\n protected void postSequenceProcessing() {\n htmlReport.addTestVerdict(getVerdict(latestState));\n }", "public OutOfOrderPlanningPage() {\n waitUntilPageObjectIsLoaded();\n }", "public void onLoad() {\n\t}", "public void getInfoPage(URL urlLocation) throws RuntimeException\r\n {\r\n BufferedReader in = null;\r\n\r\n try\r\n {\r\n URL url = urlLocation;\r\n\r\n HTTPConnection con = getConnectionToURL(url);\r\n\r\n HTTPResponse headRsp = con.Head(url.getFile());\r\n HTTPResponse rsp = con.Get(url.getFile());\r\n\r\n int status = headRsp.getStatusCode();\r\n\r\n if (status < 300 && DEBUG)\r\n {\r\n System.out.println(\"No authorization required to access \" + url);\r\n }\r\n else if (status >= 400 && status != 401 && status != 407)\r\n {\r\n String errorMsg = \"Error trying to access \" + url + \":\\n\" + headRsp;\r\n if (DEBUG)\r\n {\r\n System.out.println(errorMsg);\r\n }\r\n }\r\n else\r\n { // Everything else\r\n String errorMsg = \"Access to URL \" + url + \"returned status = \" + status + \":\\n\" + headRsp;\r\n if (DEBUG)\r\n {\r\n System.out.println(errorMsg);\r\n }\r\n }\r\n in = new BufferedReader(new InputStreamReader(rsp.getInputStream()));\r\n String inputLine;\r\n\r\n while ((inputLine = in.readLine()) != null)\r\n {\r\n processHTMLLine(inputLine);\r\n if (DEBUG)\r\n {\r\n System.out.println(inputLine);\r\n }\r\n }\r\n\r\n }\r\n catch (Exception exc)\r\n {\r\n String errorMsg = \"GetPageInfo::getInfoPage(URL) Caught: \\n[\" + exc + \"]\";\r\n if (DEBUG)\r\n {\r\n System.out.println(errorMsg);\r\n }\r\n throw new RuntimeException(errorMsg);\r\n }\r\n }", "public void run()\r\n {\n\ttopLevelSearch=FIND_TOP_LEVEL_PAGES;\r\n\ttopLevelPages=new Vector();\r\n\tnextLevelPages=new Vector();\r\n \r\n\t// Check to see if a proxy is being used. If so then we use IP Address rather than host name.\r\n\tproxyDetected=detectProxyServer();\r\n\t \r\n\tstartSearch();\r\n \r\n\tapp.enableButtons();\r\n\tapp.abort.disable();\r\n \r\n\tif(hitsFound == 0 && pageOpened == true)\r\n\t app.statusArea.setText(\"No Matches Found\");\r\n else if(hitsFound==1)\r\n\t app.statusArea.setText(hitsFound+\" Match Found\");\r\n else app.statusArea.setText(hitsFound+\" Matches Found\");\r\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}", "protected void proccess(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\n\t\t// set response type to text/html\n\t\tresponse.setContentType(\"text/html\");\n\n\t\t// Get PrintWriter to write back to client\n\t\tPrintWriter out = response.getWriter();\n\n\t\t// Get contextPath for any external files such as css, js path\n\t\tString contextPath = getContextPath();\n\n\t\tSTGroup templates = this.getSTGroup();\n\t\tST page = templates.getInstanceOf(\"home\");\n\t\t\n\t\tList<City> cities = service.getAllCitySort();\n\t\t\n\t\tpage.add(\"contextPath\", contextPath);\n\t\tpage.add(\"cities\", cities);\n\n\t\tout.print(page.render());\n\t\tout.flush();\n\t}", "@Override\n\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\tview.saveWebArchive(webUri.getPath());\n\t\t\treadWeb.setEnabled(true);\n\t\t\tif(loadingFailed){\n\t\t\t\tLog.d(TAG, \"loading failed\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tLog.d(TAG, \"onPageFinished and downloaded:\" + url);\n\t\t\t}\n\t\t\t\n\t\t}", "@Override\n public void idle() {\n if (session.peek() == null) {\n crawlCompletedBarrier.countDown();\n }\n }", "@Override\n protected void waitThePageToLoad() {\n WaitUtils.waitUntil(driver, ExpectedConditions.visibilityOf(driver\n .findElement(By.xpath(SEARCH_XPATH))));\n }", "private void pageCacheChanged() {\n // Ok to have a race here, see the field javadoc.\n if (!pageCacheChanged)\n pageCacheChanged = true;\n }" ]
[ "0.6647673", "0.6546964", "0.65196913", "0.645459", "0.6384946", "0.6371112", "0.62784666", "0.6235635", "0.6221516", "0.6207534", "0.6107179", "0.60983235", "0.6091018", "0.60809875", "0.6075406", "0.60425985", "0.60071355", "0.59910786", "0.59888446", "0.59649545", "0.59581333", "0.5936306", "0.5928758", "0.5914087", "0.58934426", "0.5855692", "0.5855217", "0.5839569", "0.5837715", "0.5837337", "0.5824506", "0.58196104", "0.5810778", "0.5804132", "0.5798916", "0.579168", "0.5788772", "0.5788463", "0.57778597", "0.5768253", "0.57569724", "0.5735566", "0.573121", "0.5716183", "0.5699064", "0.5682267", "0.56615245", "0.56613296", "0.5648005", "0.563992", "0.5633764", "0.5620938", "0.5616573", "0.5614514", "0.56061876", "0.55950725", "0.55759174", "0.5574598", "0.55700827", "0.55607295", "0.55454934", "0.5537227", "0.5532317", "0.5527729", "0.5516377", "0.55068314", "0.54817903", "0.547277", "0.5463826", "0.5459188", "0.54473007", "0.54440486", "0.54383796", "0.5432579", "0.5432373", "0.5427485", "0.54148984", "0.5412394", "0.54107773", "0.54041153", "0.5403454", "0.53944343", "0.5392039", "0.5392039", "0.53859603", "0.53806186", "0.5374289", "0.53566843", "0.53496885", "0.5347545", "0.5346854", "0.53403646", "0.5339215", "0.5337709", "0.53353184", "0.5327793", "0.531728", "0.531094", "0.53080213", "0.53044313" ]
0.59786063
19
/ 10: / 11:
public boolean generate(World paramaqu, Random paramRandom, BlockPosition paramdt) /* 12: */ { /* 13: 19 */ int i = paramRandom.nextInt(4) + 5; /* 14: 20 */ while (paramaqu.getBlock(paramdt.down()).getType().getMaterial() == Material.water) { /* 15: 21 */ paramdt = paramdt.down(); /* 16: */ } /* 17: 24 */ int j = 1; /* 18: 25 */ if ((paramdt.getY() < 1) || (paramdt.getY() + i + 1 > 256)) { /* 19: 26 */ return false; /* 20: */ } /* 21: */ int n; /* 22: */ int i2; /* 23: 29 */ for (int k = paramdt.getY(); k <= paramdt.getY() + 1 + i; k++) /* 24: */ { /* 25: 30 */ int m = 1; /* 26: 31 */ if (k == paramdt.getY()) { /* 27: 32 */ m = 0; /* 28: */ } /* 29: 34 */ if (k >= paramdt.getY() + 1 + i - 2) { /* 30: 35 */ m = 3; /* 31: */ } /* 32: 37 */ for (n = paramdt.getX() - m; (n <= paramdt.getX() + m) && (j != 0); n++) { /* 33: 38 */ for (i2 = paramdt.getZ() - m; (i2 <= paramdt.getZ() + m) && (j != 0); i2++) { /* 34: 39 */ if ((k >= 0) && (k < 256)) /* 35: */ { /* 36: 40 */ BlockType localatr3 = paramaqu.getBlock(new BlockPosition(n, k, i2)).getType(); /* 37: 41 */ if ((localatr3.getMaterial() != Material.air) && (localatr3.getMaterial() != Material.leaves)) { /* 38: 42 */ if ((localatr3 == BlockList.water) || (localatr3 == BlockList.flowingWater)) /* 39: */ { /* 40: 43 */ if (k > paramdt.getY()) { /* 41: 44 */ j = 0; /* 42: */ } /* 43: */ } /* 44: */ else { /* 45: 47 */ j = 0; /* 46: */ } /* 47: */ } /* 48: */ } /* 49: */ else /* 50: */ { /* 51: 51 */ j = 0; /* 52: */ } /* 53: */ } /* 54: */ } /* 55: */ } /* 56: 57 */ if (j == 0) { /* 57: 58 */ return false; /* 58: */ } /* 59: 61 */ BlockType localatr1 = paramaqu.getBlock(paramdt.down()).getType(); /* 60: 62 */ if (((localatr1 != BlockList.grass) && (localatr1 != BlockList.dirt)) || (paramdt.getY() >= 256 - i - 1)) { /* 61: 63 */ return false; /* 62: */ } /* 63: 66 */ makeDirt(paramaqu, paramdt.down()); /* 64: */ int i3; /* 65: */ int i4; /* 66: */ BlockPosition localdt3; /* 67: 68 */ for (int m = paramdt.getY() - 3 + i; m <= paramdt.getY() + i; m++) /* 68: */ { /* 69: 69 */ n = m - (paramdt.getY() + i); /* 70: 70 */ i2 = 2 - n / 2; /* 71: 71 */ for (i3 = paramdt.getX() - i2; i3 <= paramdt.getX() + i2; i3++) /* 72: */ { /* 73: 72 */ i4 = i3 - paramdt.getX(); /* 74: 73 */ for (int i5 = paramdt.getZ() - i2; i5 <= paramdt.getZ() + i2; i5++) /* 75: */ { /* 76: 74 */ int i6 = i5 - paramdt.getZ(); /* 77: 75 */ if ((Math.abs(i4) != i2) || (Math.abs(i6) != i2) || ((paramRandom.nextInt(2) != 0) && (n != 0))) /* 78: */ { /* 79: 78 */ localdt3 = new BlockPosition(i3, m, i5); /* 80: 79 */ if (!paramaqu.getBlock(localdt3).getType().m()) { /* 81: 80 */ setBlock(paramaqu, localdt3, BlockList.leaves); /* 82: */ } /* 83: */ } /* 84: */ } /* 85: */ } /* 86: */ } /* 87: 86 */ for (int m = 0; m < i; m++) /* 88: */ { /* 89: 87 */ BlockType localatr2 = paramaqu.getBlock(paramdt.up(m)).getType(); /* 90: 88 */ if ((localatr2.getMaterial() == Material.air) || (localatr2.getMaterial() == Material.leaves) || (localatr2 == BlockList.flowingWater) || (localatr2 == BlockList.water)) { /* 91: 89 */ setBlock(paramaqu, paramdt.up(m), BlockList.log); /* 92: */ } /* 93: */ } /* 94: 93 */ for (int m = paramdt.getY() - 3 + i; m <= paramdt.getY() + i; m++) /* 95: */ { /* 96: 94 */ int i1 = m - (paramdt.getY() + i); /* 97: 95 */ i2 = 2 - i1 / 2; /* 98: 96 */ for (i3 = paramdt.getX() - i2; i3 <= paramdt.getX() + i2; i3++) { /* 99: 97 */ for (i4 = paramdt.getZ() - i2; i4 <= paramdt.getZ() + i2; i4++) /* 100: */ { /* 101: 98 */ BlockPosition localdt1 = new BlockPosition(i3, m, i4); /* 102:100 */ if (paramaqu.getBlock(localdt1).getType().getMaterial() == Material.leaves) /* 103: */ { /* 104:101 */ BlockPosition localdt2 = localdt1.west(); /* 105:102 */ localdt3 = localdt1.east(); /* 106:103 */ BlockPosition localdt4 = localdt1.north(); /* 107:104 */ BlockPosition localdt5 = localdt1.south(); /* 108:106 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt2).getType().getMaterial() == Material.air)) { /* 109:107 */ a(paramaqu, localdt2, bbv.S); /* 110: */ } /* 111:109 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt3).getType().getMaterial() == Material.air)) { /* 112:110 */ a(paramaqu, localdt3, bbv.T); /* 113: */ } /* 114:112 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt4).getType().getMaterial() == Material.air)) { /* 115:113 */ a(paramaqu, localdt4, bbv.Q); /* 116: */ } /* 117:115 */ if ((paramRandom.nextInt(4) == 0) && (paramaqu.getBlock(localdt5).getType().getMaterial() == Material.air)) { /* 118:116 */ a(paramaqu, localdt5, bbv.R); /* 119: */ } /* 120: */ } /* 121: */ } /* 122: */ } /* 123: */ } /* 124:122 */ return true; /* 125: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = 4000)\n public void test108() throws Throwable {\n XPathLexer xPathLexer0 = new XPathLexer(\":_]J_/L!uFQ7%)BrL\");\n Token token0 = xPathLexer0.minus();\n assertEquals(\":\", token0.getTokenText());\n assertEquals(6, token0.getTokenType());\n \n Token token1 = xPathLexer0.nextToken();\n assertEquals(\"_\", token1.getTokenText());\n assertEquals(15, token1.getTokenType());\n }", "@Override\n\tpublic void challenge10() {\n\n\t}", "private static String m10f() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sh\");\n stringBuilder.append(\"el\");\n stringBuilder.append(\"la\");\n return stringBuilder.toString();\n }", "private void kk12() {\n\n\t}", "@Test\n public void allSpareAndLast_2_Expected_111(){\n String input = \"1/1/1/1/1/1/1/1/1/1/2\";\n assertEquals(game.scoreOfGame(input),111);\n }", "public static void main002(String[] args) {\n\n\t\tint number\t= 20;\n\t\tSystem.out.println(\"Start = \" + number);\n\t\t\n\t\tnumber += 10;\t// number\t= number + 10;\n\t\tnumber -= 10;\t// number\t= number - 10\n\t\tnumber *= 10;\t// number\t= number * 10\n\t\tnumber /= 10;\t// number\t= number / 10\n\t\tnumber %= 10;\t// number\t= number % 10\n\t\tSystem.out.println(\"End = \" + number);\n\t}", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n String string0 = SQLUtil.normalize(\"b}v&-;$$:Hw1:\", false);\n assertEquals(\"b } v & - ; $ $ : Hw1 :\", string0);\n }", "static void feladat10() {\n\t}", "private int e(String paramString, int paramInt)\r\n/* 628: */ {\r\n/* 629:624 */ int i1 = paramString.length();\r\n/* 630:625 */ int i2 = 0;\r\n/* 631:626 */ int i3 = 0;\r\n/* 632:627 */ int i4 = -1;\r\n/* 633:628 */ int i5 = 0;\r\n/* 634:631 */ for (; i3 < i1; i3++)\r\n/* 635: */ {\r\n/* 636:632 */ char c1 = paramString.charAt(i3);\r\n/* 637:634 */ switch (c1)\r\n/* 638: */ {\r\n/* 639: */ case '§': \r\n/* 640:636 */ if (i3 < i1 - 1)\r\n/* 641: */ {\r\n/* 642:637 */ char c2 = paramString.charAt(++i3);\r\n/* 643:638 */ if ((c2 == 'l') || (c2 == 'L')) {\r\n/* 644:639 */ i5 = 1;\r\n/* 645:640 */ } else if ((c2 == 'r') || (c2 == 'R') || (c(c2))) {\r\n/* 646:641 */ i5 = 0;\r\n/* 647: */ }\r\n/* 648: */ }\r\n/* 649:643 */ break;\r\n/* 650: */ case '\\n': \r\n/* 651:646 */ i3--;\r\n/* 652:647 */ break;\r\n/* 653: */ case ' ': \r\n/* 654:649 */ i4 = i3;\r\n/* 655: */ default: \r\n/* 656:651 */ i2 += a(c1);\r\n/* 657:652 */ if (i5 != 0) {\r\n/* 658:653 */ i2++;\r\n/* 659: */ }\r\n/* 660: */ break;\r\n/* 661: */ }\r\n/* 662:657 */ if (c1 == '\\n')\r\n/* 663: */ {\r\n/* 664:658 */ i3++;i4 = i3;\r\n/* 665: */ }\r\n/* 666: */ else\r\n/* 667: */ {\r\n/* 668:662 */ if (i2 > paramInt) {\r\n/* 669: */ break;\r\n/* 670: */ }\r\n/* 671: */ }\r\n/* 672: */ }\r\n/* 673:667 */ if ((i3 != i1) && (i4 != -1) && (i4 < i3)) {\r\n/* 674:668 */ return i4;\r\n/* 675: */ }\r\n/* 676:670 */ return i3;\r\n/* 677: */ }", "public static void pattern10(int input){\n\t\tfor(int i= input;i >0;i--){\n\t\t\tfor(int j=i;j<=input;j++){\n\t\t\t\tSystem.out.print(j+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Test\n public void testTakeNumberFromString224() { // FlairImage: 224\n assertEquals(\"From: FlairImage line: 225\", 123, takeNumberFromString(\"123\")); \n assertEquals(\"From: FlairImage line: 226\", 0, takeNumberFromString(\"123a\")); \n assertEquals(\"From: FlairImage line: 227\", -123, takeNumberFromString(\"-123\")); \n assertEquals(\"From: FlairImage line: 228\", 0, takeNumberFromString(\"--123\")); \n assertEquals(\"From: FlairImage line: 229\", 0, takeNumberFromString(\"pz4\")); \n }", "@Test\n public void Keypad() {\n Assert.assertEquals(11, Computation.keypadTime(\"91566165\",\"639485712\"));\n Assert.assertEquals(1, Computation.keypadTime(\"5111\",\"752961348\"));\n }", "public static int i()\r\n/* 25: */ {\r\n/* 26: 48 */ return 9;\r\n/* 27: */ }", "public void mo21877s() {\n }", "public static void main(String[] args) {\n\t\tint first;\n\t\tint second;\n\t\tfor (first=0; first <=5; first++) {\n\t\t\tfor (second=0; second<=5;second++) {\n\t\t\t\tSystem.out.printf(\"%d%d\\t\",first,second);//is there any kind of methode u can represent with 00\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}", "String canonHr(String s) {\n List<String> l = StringUtil.breakAt(s, \":\");\n if (l.size() == 2) {\n return l.get(0) + \":\" + l.get(1).toUpperCase();\n }\n return s.toUpperCase();\n }", "public static void main(String[] args) {\nint i=1;//display from 20 to 10\nSystem.out.println(\"odd even\");\nwhile(i<=10)\n{\n\tif(i%2!=0) {\n\tSystem.out.println(i+\" \"+(i+1));//for space /t is fine\n\t}\ni++;\n}\n\t}", "@Test\n\tpublic void test7()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\\n\" +\n\t\t\t\"$webpage: {<slashdot>}\",\n\t\t\texplodeRulesAndCreateString(\"webpage:\\n\\tspacex (webpage|(web page))\\n\\tslashdot\")\n\t\t);\n\t}", "@Test public void Time_len_6()\t\t\t\t\t\t\t\t\t{tst_time_(\"041526\"\t\t\t\t\t, \"04:15:26.000\");}", "public static void main(String[] args){\n for(int i = 23; i <= 89; i++){\n System.out.print(i + \" \");\n if(i % 10 == 2)\n System.out.print(\"\\n\"); }\n }", "private static void printDigit(int number) {\n\t\tswitch (number) {\n\t\tcase 10:\n\t\t\tSystem.out.println(\"ten\");\n\t\t\tbreak;\n\n\t\tcase 20:\n\t\t\tSystem.out.println(\"twenty\");\n\n\t\t\tbreak;\n\t\tcase 30:\n\t\t\tSystem.out.println(\"thirty\");\n\n\t\t\tbreak;\n\t\t}\n\t}", "public static void tenthProgram() {\n\t\tfor(int i=1;i<=4;i++) {\n\t\t\tfor(int j=1;j<=i-1;j++) {\n\t\t\t\tSystem.out.print(\" \");\t\t\t\n\t\t\t}for(int k=1;k<=4;k++) {\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t}", "public java.lang.String c(java.lang.String r9, java.lang.String r10) {\n /*\n r8 = this;\n r0 = 0;\n if (r9 == 0) goto L_0x0071;\n L_0x0003:\n r1 = r9.length();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n goto L_0x0071;\n L_0x000a:\n r1 = r9.length();\n r2 = 59;\n r3 = r9.indexOf(r2);\n r4 = 1;\n r3 = r3 + r4;\n if (r3 == 0) goto L_0x0070;\n L_0x0018:\n if (r3 != r1) goto L_0x001b;\n L_0x001a:\n goto L_0x0070;\n L_0x001b:\n r5 = r9.indexOf(r2, r3);\n r6 = -1;\n if (r5 != r6) goto L_0x0023;\n L_0x0022:\n r5 = r1;\n L_0x0023:\n if (r3 >= r5) goto L_0x006f;\n L_0x0025:\n r7 = 61;\n r7 = r9.indexOf(r7, r3);\n if (r7 == r6) goto L_0x0066;\n L_0x002d:\n if (r7 >= r5) goto L_0x0066;\n L_0x002f:\n r3 = r9.substring(r3, r7);\n r3 = r3.trim();\n r3 = r10.equals(r3);\n if (r3 == 0) goto L_0x0066;\n L_0x003d:\n r7 = r7 + 1;\n r3 = r9.substring(r7, r5);\n r3 = r3.trim();\n r7 = r3.length();\n if (r7 == 0) goto L_0x0066;\n L_0x004d:\n r9 = 2;\n if (r7 <= r9) goto L_0x0065;\n L_0x0050:\n r9 = 0;\n r9 = r3.charAt(r9);\n r10 = 34;\n if (r10 != r9) goto L_0x0065;\n L_0x0059:\n r7 = r7 - r4;\n r9 = r3.charAt(r7);\n if (r10 != r9) goto L_0x0065;\n L_0x0060:\n r9 = r3.substring(r4, r7);\n return r9;\n L_0x0065:\n return r3;\n L_0x0066:\n r3 = r5 + 1;\n r5 = r9.indexOf(r2, r3);\n if (r5 != r6) goto L_0x0023;\n L_0x006e:\n goto L_0x0022;\n L_0x006f:\n return r0;\n L_0x0070:\n return r0;\n L_0x0071:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.fabric.sdk.android.services.network.HttpRequest.c(java.lang.String, java.lang.String):java.lang.String\");\n }", "void nhap(String tenHinh) {\n this.tenHinh = tenHinh;\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n String string0 = SQLUtil.normalize(\"aT:7W`oI)N(jLl^oF<HQ\", false);\n assertEquals(\"aT : 7W ` oI) N (jLl ^ oF < HQ\", string0);\n }", "public static void main(String[] args) {\nint i=1;\nwhile(i<=10)\n{\n\tSystem.out.println(i+\"raj\");//display nos from 1 to 10 and raj \n\ti=i+1;\n}\n\t}", "public static void main(String[] args) {\n\r\n for (int x = 1; x < 10; x++) {// x=1\r\n\r\n for (int h = 1; h < 10; h++) { // h=1+1+1...8+1\r\n\r\n System.out.println(x + \"*\" + h \"=\" +x*h);// 1-2-3....8-9\r\n\r\n if(h==2){\r\n break;\r\n }\r\n }\r\n\r\n if(x==4){\r\n continue;\r\n }\r\n\r\n }\r\n\r\n }", "public static void main003(String[] args) {\n\t\t/*\n\t\t * numberStart++ tra ve gia tri cua numberStart, sau đo tang number lan mot đon vi\n\t\t * numberStart-- tra ve gia tri cua numberStart, sau đo giam number xuong mot đon vi\n\t\t * ++numberStart tang numberStart len mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t * --numberStart giam numberStart xuong mot don vi, sau đo tra ve gia tri cua numberStart\n\t\t */\n\t\tint numberStart\t= 20;\n\t\tint numberEnd\t= 0;\n\t\t\n//\t\tnumberEnd\t\t= ++numberStart;\n\t\tnumberEnd\t\t= --numberStart;\n\t\tSystem.out.println(\"Number Start = \" + numberStart);\n\t\tSystem.out.println(\"Number End = \" + numberEnd);\n\t}", "int main()\n{\n cin>>a.h>>a.m>>a.s>>b.h>>b.m>>b.s;\n int x=a.s-b.s;\n int y=a.m-b.m;\n int z=a.h-b.h;\n if(y<0){\n y+=60;\n z--;\n }\n if(x<0){\n x+=60;\n y--;\n }\n cout<<z<<\":\"<<y<<\":\"<<x;\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tint k,n=10;\r\n\t\tk=n-1;\r\n\t\tfor(int i=0;i<=n;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<=k;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tk=k-1;\r\n\t\t\tfor(int j=0;j<=i;j++)\r\n\t\t\t\tSystem.out.print(\"*\"+\" \");\r\n\t\t\tSystem.out.println(\"\\r\");\r\n\t\t}\r\n\t}", "public static void ninethProgram() {\n\t\tfor(int i=1;i<=4;i++) {\n\t\t\tfor(int j=4-1;j>=i;j--) {\n\t\t\t\tSystem.out.print(\" \");\t\n\t\t\t}for(int k=1;k<=4;k++) {\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t}", "@Override\n\tpublic void challenge9() {\n\n\t}", "public String digit(String digit);", "public String c()\r\n/* 30: */ {\r\n/* 31:175 */ return \"step.\" + this.a;\r\n/* 32: */ }", "void mo11024a(int i, int i2, String str);", "public void mo21783H() {\n }", "private String calibrate(int count)\n {\n String str = \"\";\n if(count < 10)\n {\n str = \" \" + Integer.toString(count);\n }\n else if(count < 100)\n {\n str = \" \" + Integer.toString(count);\n }\n else if(count < 1000)\n {\n str = \" \" + Integer.toString(count);\n }\n else\n {\n str = Integer.toString(count);\n }\n\n return str;\n }", "void mo1507n();", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n Discretize discretize0 = new Discretize();\n assertFalse(discretize0.getUseBinNumbers());\n \n Discretize discretize1 = new Discretize();\n discretize0.m_UseBinNumbers = true;\n discretize0.makeBinaryTipText();\n discretize0.getCapabilities();\n String string0 = discretize0.getAttributeIndices();\n assertEquals(\"first-last\", string0);\n }", "public void mo21800a() {\n }", "public void Series() {\n\t\tint n=2;\n\t\twhile (n<=10) {\n\t\t\tSystem.out.print(n+\" \");\n\t\t\tn=n+2;\n\t\t}\n\t/*\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;\n\t\tSystem.out.println(n);\n\t\tn=n+2;*/\n\t}", "@Override\n\tpublic void challenge11() {\n\n\t}", "@Test\n public void NineAndMissExpected_90(){\n String input = \"9-9-9-9-9-9-9-9-9-9-\";\n assertEquals(game.scoreOfGame(input),90);\n }", "@Override\r\n\tprotected void doF10() {\n\t\t\r\n\t}", "public void mo21788M() {\n }", "public void mo21786K() {\n }", "public void mo21789N() {\n }", "public static void main(String[] args){\n\n for(int n = 2; n < 102; n+=2)System.out.printf(\"%d\\n\",n);\n \n \n }", "static int getNumPatterns() { return 64; }", "int nbColonnes();", "public void mo6081a() {\n }", "public static void main(String[] args) {\n\t\t\n\t\tint num = 999;\n\t\tString numXXX = \"\";\n\t\t\n\t\tif ((num < 100) & (num >=10) ){\n\t\t\tnumXXX = \"0\" + num;\t\t\n\t\t} else if (num < 10) {\n\t\t\tnumXXX = \"00\" + num; \t\n\t\t} else {\n\t\t\tnumXXX = \"\" + num;\n\t\t}\n\t\t\n\t\tint hundred = Character.digit(numXXX.charAt(0),10);\n\t\tint ten = Character.digit(numXXX.charAt(1),10);\n\t\tint digit = Character.digit(numXXX.charAt(2),10);\n\t\t\n\t\t//System.out.println(numXXX + \":\" + hundred + ten + digit);\n\t\t\n\t\tString hundredStr = \"\";\n\t\tString tenStr = \"\";\n\t\tString digitStr = \"\";\n\t\t\n\t\tswitch (hundred) {\n\t\t\tcase 1: \n\t\t\t\thundredStr = \"one hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\thundredStr = \"two hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 3: \n\t\t\t\thundredStr = \"three hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 4: \n\t\t\t\thundredStr = \"four hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 5: \n\t\t\t\thundredStr = \"five hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 6: \n\t\t\t\thundredStr = \"six hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 7: \n\t\t\t\thundredStr = \"seven hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 8: \n\t\t\t\thundredStr = \"eight hundred\";\n\t\t\t\tbreak;\n\t\t\tcase 9: \n\t\t\t\thundredStr = \"nine hundred\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\tswitch (ten) {\n\t\t\tcase 1:\n\t\t\t\tif (digit == 0){\n\t\t\t\t\ttenStr = \"ten\";\n\t\t\t\t} else {\n\t\t\t\t\tswitch (digit) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\ttenStr = \"eleven\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\ttenStr = \"twelve\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\ttenStr = \"thirteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\ttenStr = \"fourteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\ttenStr = \"fifteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\ttenStr = \"sixteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\ttenStr = \"seventeen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\ttenStr = \"eighteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\ttenStr = \"nineteen\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n \t\t\tcase 2: \n \t\t\t\ttenStr = \"twenty\";\n \t\t\t\tbreak;\n \t\t\tcase 3: \n \t\t\t\ttenStr = \"thirty\";\n \t\t\t\tbreak;\n \t\t\tcase 4: \n \t\t\t\ttenStr = \"fourty\";\n \t\t\t\tbreak;\n \t\t\tcase 5: \n \t\t\t\ttenStr = \"fifty\";\n \t\t\t\tbreak;\n \t\t\tcase 6: \n \t\t\t\ttenStr = \"sixty\";\n \t\t\t\tbreak;\n \t\t\tcase 7: \n \t\t\t\ttenStr = \"seventy\";\n \t\t\t\tbreak;\n \t\t\tcase 8: \n \t\t\t\ttenStr = \"eighty\";\n \t\t\t\tbreak;\n \t\t\tcase 9: \n \t\t\t\ttenStr = \"ninety\";\n \t\t\t\tbreak;\t\n }\n\t\t\n\t\tif ((ten != 1) | (ten == 0)){\n\t\t\tswitch (digit) {\n\t\t\t\tcase 0:\n\t\t\t\t\tif ((ten == 0) & (hundred == 0)){\n\t\t\t\t\t\tdigitStr = \"zero\";\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tdigitStr = \"one\";\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tdigitStr = \"two\";\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tdigitStr = \"three\";\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tdigitStr = \"four\";\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tdigitStr = \"five\";\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tdigitStr = \"six\";\n\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tdigitStr = \"seven\";\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tdigitStr = \"eight\";\n\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tdigitStr = \"nine\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (ten == 0){\n\t\t\tSystem.out.println(num + \" => \" + hundredStr + \" \" + digitStr);\n\t\t} else if (ten == 1){\n\t\t\tSystem.out.println(num + \" => \" + hundredStr + \" \" + tenStr);\n\t\t} else if ((ten != 1) & (digit == 0)){\n\t\t\tSystem.out.println(num + \" => \" + hundredStr + \" \" + tenStr);\n\t\t} else {\n\t\t\tSystem.out.println(num + \" => \" + hundredStr + \" \" + tenStr + \"-\" + digitStr);\n\t\t}\n\t\t\n\t}", "public int p_()\r\n/* 96: */ {\r\n/* 97:117 */ return 64;\r\n/* 98: */ }", "private static void displayHelp(){\n System.out.println(\"1. (R)eport\");\n System.out.println(\"2. (M)inimum Spanning Tree\");\n System.out.println(\"3. (S)hortest Path from i j\");\n System.out.println(\"4. (D)own i j\");\n System.out.println(\"5. (U)p i j\");\n System.out.println(\"6. (C)hange Weight i j x\");\n System.out.println(\"7. (E)ulerian\");\n System.out.println(\"8. (Q)uit\");\n }", "public static void main(String[] args) {\n System.out.println(\"1.1\");\n System.out.println(\"Welcome to java\");\n System.out.println(\"Learning java now\");\n System.out.println(\"Programming is fun\");\n\n // Kapitel3.opgave 1.2 (display 5 messages)\n System.out.println(1.2);\n int i = 0;\n while (i <= 4) {\n System.out.println(\"I love java\");\n i++;\n }\n // Kapitel3.opgave 1.4 (print a table)\n System.out.println(\"1.4\");\n System.out.println(\"a a^2 a^3 a^4\");\n System.out.println(\"1 1 1 1\");\n System.out.println(\"2 4 8 16\");\n System.out.println(\"3 9 27 81\");\n System.out.println(\"4 16 64 256\");\n\n // Kapitel3.opgave 1.5\n System.out.println(1.5);\n System.out.print(\"(7.5 * 6.5 - 4.5 * 3)/(47.5 - 5.5 ) = \");\n System.out.println((7.5 * 6.5 - 4.5 * 3)/(47.5 - 5.5));\n\n // Kapitel3.opgave 1.6\n System.out.println(\"1.6\");\n System.out.print(\"1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = \");\n System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10);\n\n //Kapitel3.opgave 1.12\n System.out.println(\"1.12\");\n // vi skal omskrive miles til kilometer\n System.out.println(\"Miles to kilometers is \" + (24 * 1.6));\n // vi skal omskrive 1 time 40 min og 35 sek til sekunder\n System.out.println(\"Number of hour in fraction is \" + ((60 * 60) + (40 * 60) + 35)/ (60.0 * 60));\n\n System.out.println(\"he ran \" + (38.400000000000006 / 1.676388888888889 ) + \" kilometers per hour\");\n\n }", "@Test(timeout = 4000)\n public void test33() throws Throwable {\n String string0 = EWrapperMsgGenerator.fundamentalData((-1622103582), \"convertible = \");\n assertEquals(\"id = -1622103582 len = 14\\nconvertible = \", string0);\n }", "public static void main(String[] args) {\n\tfor(int k=1; k<=3;k++)\r\n\t{\r\n\t\tfor(int i=1; i<=9; i++)\r\n\t\t {\r\n\t\t\tSystem.out.println();\r\n\t\t for(int j=3*k-1; j<=3*k+1;j++)\r\n\t\t {\r\n\t\t if(j!=10)\r\n\t\t System.out.printf(j+\"*\"+i+\"=\"+i*j+\"\\t\");\r\n\t\t }\r\n\t\t }\r\n\t}\t\r\n }", "public void mo21878t() {\n }", "@Test\r\n void findRouteDifferentLine() {\r\n List<Station> route = model.findRoute(9, 60);\r\n assertNotNull(route);\r\n assertEquals(10, route.size());\r\n assertEquals(\"SuffolkDowns\", route.get(0).getName());\r\n assertEquals(\"Broadway\", route.get(9).getName());\r\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n String string0 = SQLUtil.normalize(\"t*VmK\", true);\n assertEquals(\"t * VmK\", string0);\n }", "@Test(timeout = 4000)\n public void test013() throws Throwable {\n XPathLexer xPathLexer0 = new XPathLexer(\":E<;\");\n xPathLexer0.nextToken();\n Token token0 = xPathLexer0.getPreviousToken();\n assertEquals(\":\", token0.getTokenText());\n assertEquals(18, token0.getTokenType());\n }", "@Test\n\tpublic void getStartingSpaceCorrect(){\n\t\tassertEquals(11, adventurer1.getStartingSpace());\n\t}", "public String tri4(int h){\n\t\tString S = \"\";\n\t\tint H = h;\n\t\tint HH = H;\n\t\tint Counter = 0;\n\t\tint UsingCounter = Counter;\n\n\t\twhile (H > 0){\n\t\t\tHH = H;\n\t\t\twhile (UsingCounter > 0){\n\t\t\t\tS = S + \" \";\n\t\t\t\tUsingCounter = UsingCounter - 1;}\n\t\t\twhile (HH > 0) {\n\t\t\t\tS = S + \"*\";\n\t\t\t\tHH = HH - 1;}\n\t\t\tCounter = Counter + 1;\n\t\t\tUsingCounter = Counter;\n\t\t\tS = S + \"\\n\";\n\t\t\tH = H - 1;}\n\n\t\treturn S; }", "public static void main(String[] args) {\n\n\t\tint i, j, k;\n\n\t\tfor (i = 1; i <= 9; i++)\n\t\t{\n\t\t for (j = 1; j <= i; ++j)\n\t\t System.out.print(j);\n\n\t\t for (k = 9 - i; k >= 1; k--)\n\t\t System.out.print(\"*\");\n\n\t\t System.out.println(\"\");\n\t\t}\n\n\t}", "@Test\n\tpublic void test6()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\",\n\t\t\texplodeRulesAndCreateString(\"webpage: spacex (webpage|(web page))\")\n\t\t);\n\t}", "private static int nextSemiColon(final String cmd)\n {\n int start = 0;\n int ret = -1;\n while (true)\n {\n ret = cmd.indexOf(';', start);\n if (ret == -1) break;\n int begin = cmd.lastIndexOf(\"BEGIN\", ret);\n int end = cmd.lastIndexOf(\"END;\", ret);\n if (begin == -1) break;\n if (end > begin) break;\n start = ret + 1;\n }\n return ret;\n }", "public static void main(String[] args) {\n\n String time =\"16:49:40\".substring(0,2);\n System.out.println(time);\n\n }", "@Test\n public void testSegmentationGreedyness() {\n assertMetrics(\"match:0.3717\",\"a b c\",\"a x b x x x x x x x x b c\");\n assertMetrics(\"match:0.4981\",\"a b c\",\"a x z x x x x x x x x b c\");\n }", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString readLine = reader.readLine();\n\t\treader.close();\n\t\tString[] split = readLine.split(\" \");\n\t\tint num=Integer.valueOf(split[1])-Integer.valueOf(split[0]);\n\t\tint rs=(int)Math.rint((double)num/100.0);\n\t\tint s=rs%60;\n\t\tint m=(rs/60)%60;\n\t\tint h=rs/3600;\n\t\tSystem.out.println((h<10?(\"0\"+h):h)+\":\"+(m<10?(\"0\"+m):m)+\":\"+(s<10?(\"0\"+s):s));\n\t}", "public String designPN(String nr)\r\n {\r\n String newStr=\"(\";\r\n if(nr.length()!=10){return null;}\r\n else\r\n {\r\n newStr=newStr+nr.substring(0,4)+\")-\";\r\n // System.out.println(\"phase 1 \"+ newStr);\r\n newStr=newStr+nr.substring(4,7)+\"-\";\r\n // System.out.println(\"phase 2 \"+ newStr);\r\n newStr=newStr+nr.substring(7,10);\r\n // System.out.println(\"phase 3 \"+ newStr);\r\n }\r\n return newStr;\r\n\r\n }", "public void mo21794S() {\n }", "public void mo55254a() {\n }", "public void mo32111rr(int i) {\n }", "public static void main(String[] args) {\n int n;\n int i = 1;\n Scanner sc= new Scanner(System.in);\n n = sc.nextInt();\n \n while(i<=n)\n {\n int spaces = 1;\n while(spaces<=n-i)\n {\n System.out.print(' ');\n spaces = spaces + 1;\n }\n int numb = 1;\n while(numb<=i)\n {\n System.out.print('*');\n numb = numb + 1;\n }\n int dec = i - 1;\n while(dec>=1)\n {\n System.out.print('*');\n dec = dec - 1;\n }\n System.out.println();\n i = i +1;\n }\t\n\t}", "public void mo21795T() {\n }", "@Test\n public void testSplitTime(){\n \tCountDownTimer s = new CountDownTimer();\n \ts.splitTime(3975);\n \tassertEquals(s.toString(), \"1:06:15\");\n \t\n \ts.splitTime(45);\n \tassertEquals(s.toString(), \"0:00:45\");\n \t\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "void mo9075h(String str, int i, int i2);", "public static void main(String[] args) {\nint t = 101010101;\n// koden begynner her\nString s = \"\";\nwhile ( t % 10 > 0 ) {\ns = t % 10 + s;\nt = t / 10;\n}\ns = \"s = \" + s;\nout.println(s);\n\n }", "public void mo21793R() {\n }", "@Override\n\t\tpublic void visit(Integer key, Character value) {\n\t\t\tStringBuffer toPrint = new StringBuffer();\n\n\t\t\tif ((int) value == 9) {\n\t\t\t\ttoPrint.append(\"\\\\t\");\n\n\t\t\t} else if ((int) value == 10) {\n\t\t\t\ttoPrint.append(\"\\\\n\");\n\n\t\t\t} else {\n\t\t\t\ttoPrint.append(value);\n\t\t\t}\n\n\t\t\ttoPrint.append(\":\" + key);\n\t\t\tSystem.out.println(toPrint.toString());\n\n\t\t}", "public void mo9233aH() {\n }", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n String string0 = EWrapperMsgGenerator.updateMktDepth((-1403), 4832, (-1403), 1220, (-1403), 1220);\n assertEquals(\"updateMktDepth: -1403 4832 -1403 1220 -1403.0 1220\", string0);\n }", "public static void main(String args[]){\nSystem.out.println(Integer.toOctalString(8)); \nSystem.out.println(Integer.toOctalString(19)); \nSystem.out.println(Integer.toOctalString(81)); \n}", "public static void pattern9(int input){\n\t\tfor(int i= 1;i <= input;i++){\n\t\t\tfor(int j=i;j<=input;j++){\n\t\t\t\tSystem.out.print(j+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args) {\n\t\tchar first = 'T';\n\t\tchar second = 'R' ;\n\t\tchar third = 'H';\n\t\t\n\t System.out.println( first + \".\" + second + \".\" + third + \".\" );\n\t}", "public void mo12310b(String str) {\n int a = m14928a();\n int d = C3205z0.INFO.mo12550d();\n }", "@Test\n\t public void test4()\n\t{\n\t\t\t// String s = new String();\n\t // s = s.replaceAll(\"\\\\s+\", \" \");\n\t\t\tassertEquals(\"\", LRS.lcp(\"vcd\",\"cd\"));\n\t}", "private static String m11g() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sh\");\n stringBuilder.append(\"el\");\n stringBuilder.append(\"la\");\n stringBuilder.append(\"_ve\");\n stringBuilder.append(\"rs\");\n stringBuilder.append(\"i\");\n stringBuilder.append(\"on\");\n return stringBuilder.toString();\n }", "public int a(char paramChar)\r\n/* 484: */ {\r\n/* 485:481 */ if (paramChar == '§') {\r\n/* 486:482 */ return -1;\r\n/* 487: */ }\r\n/* 488:485 */ if (paramChar == ' ') {\r\n/* 489:486 */ return 4;\r\n/* 490: */ }\r\n/* 491:489 */ int i1 = \"\".indexOf(paramChar);\r\n/* 492:490 */ if ((paramChar > 0) && (i1 != -1) && (!this.k)) {\r\n/* 493:491 */ return this.d[i1];\r\n/* 494: */ }\r\n/* 495:495 */ if (this.e[paramChar] != 0)\r\n/* 496: */ {\r\n/* 497:496 */ int i2 = this.e[paramChar] >>> 4;\r\n/* 498:497 */ int i3 = this.e[paramChar] & 0xF;\r\n/* 499:499 */ if (i3 > 7)\r\n/* 500: */ {\r\n/* 501:500 */ i3 = 15;\r\n/* 502:501 */ i2 = 0;\r\n/* 503: */ }\r\n/* 504:503 */ i3++;\r\n/* 505: */ \r\n/* 506:505 */ return (i3 - i2) / 2 + 1;\r\n/* 507: */ }\r\n/* 508:508 */ return 0;\r\n/* 509: */ }", "public void mo21782G() {\n }", "public static void m10() {\r\n\tint size =4;\r\n\tfor(int i =size;i>=-size;i--) {\r\n\t\tchar ch ='A';\r\n\t\tfor(int j =size;j>=Math.abs(i);j-- ) {\r\n\t\t\tSystem.out.print(ch);\r\n\t\t\tch++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}\r\n}", "public void mo97908d() {\n }", "@Test\n\tpublic void checkNumberOfDifferentRoutes() {\n\t\tassertEquals(Trains.numberDifferentRoutes(\"C\",\"C\",30), 7);\n\t}" ]
[ "0.5190743", "0.51410323", "0.50466883", "0.50062495", "0.5000807", "0.49855527", "0.49763608", "0.49398744", "0.49367988", "0.49208373", "0.49089244", "0.49027774", "0.48807818", "0.48748085", "0.48624796", "0.48130545", "0.48081034", "0.47957042", "0.47924152", "0.47883958", "0.4788334", "0.47791958", "0.47699562", "0.47655013", "0.4762757", "0.47470868", "0.47358826", "0.4729376", "0.4724341", "0.47000653", "0.4699915", "0.46758813", "0.46757126", "0.4674499", "0.46733382", "0.46603808", "0.46584103", "0.46574685", "0.46550575", "0.46549308", "0.46518883", "0.4645849", "0.46402216", "0.4639077", "0.4638825", "0.46335262", "0.46326247", "0.46292844", "0.46286768", "0.46216604", "0.46212283", "0.46211183", "0.46208972", "0.46205485", "0.4620195", "0.46189302", "0.46165657", "0.4613818", "0.46098873", "0.46091756", "0.46049038", "0.46036282", "0.4601302", "0.45992717", "0.4590425", "0.45901272", "0.45884892", "0.45869234", "0.4582172", "0.45750287", "0.45720255", "0.45717835", "0.4568014", "0.4563273", "0.4560436", "0.45577717", "0.4556318", "0.4556318", "0.4556318", "0.4556318", "0.4556318", "0.4556318", "0.4556318", "0.45560718", "0.4554444", "0.45511374", "0.4550212", "0.4547541", "0.45445594", "0.45380446", "0.45378572", "0.45376417", "0.45352775", "0.4533051", "0.45311934", "0.45299163", "0.45297095", "0.45293537", "0.45261008", "0.45258087", "0.45221418" ]
0.0
-1
/ 126: / 127:
private void a(World paramaqu, BlockPosition paramdt, int paramInt) /* 128: */ { /* 129:126 */ setBlock(paramaqu, paramdt, BlockList.vine, paramInt); /* 130:127 */ int i = 4; /* 131: */ /* 132:129 */ paramdt = paramdt.down(); /* 133:130 */ while ((paramaqu.getBlock(paramdt).getType().getMaterial() == Material.air) && (i > 0)) /* 134: */ { /* 135:131 */ setBlock(paramaqu, paramdt, BlockList.vine, paramInt); /* 136:132 */ paramdt = paramdt.down(); /* 137:133 */ i--; /* 138: */ } /* 139: */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = 4000)\n public void test104() throws Throwable {\n int int0 = JavaCharStream.hexval('D');\n assertEquals(13, int0);\n }", "public char failsafe_GET()\n { return (char)((char) get_bytes(data, 35, 1)); }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n StringReader stringReader0 = new StringReader(\"kE4X 9\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-1), 66, 1279);\n char char0 = javaCharStream0.readChar();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals('k', char0);\n }", "public void setVar126(java.lang.CharSequence value) {\n this.var126 = value;\n }", "public void errors_comm_SET(char src)\n { set_bytes((char)(src) & -1L, 2, data, 6); }", "public void setNChar()\n/* */ {\n/* 1168 */ this.isNChar = true;\n/* */ }", "@Test(timeout = 4000)\n public void test136() throws Throwable {\n PipedInputStream pipedInputStream0 = new PipedInputStream();\n JavaCharStream javaCharStream0 = new JavaCharStream(pipedInputStream0, 9, (-6208), 9);\n javaCharStream0.getBeginColumn();\n assertEquals((-1), javaCharStream0.bufpos);\n }", "public static void main(String[] args) {\n\t\tbyte a=(byte)130;\n\t\tSystem.out.println(\"128을 저장한 byte 값은 : \"+ a);\n\n\t}", "public java.lang.CharSequence getVar126() {\n return var126;\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n int int0 = JavaCharStream.hexval('C');\n assertEquals(12, int0);\n }", "public java.lang.CharSequence getVar126() {\n return var126;\n }", "@Test(timeout = 4000)\n public void test072() throws Throwable {\n int int0 = JavaCharStream.hexval('e');\n assertEquals(14, int0);\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null, 122, 122, 122);\n javaCharStream0.adjustBeginLineColumn(122, 122);\n int int0 = javaCharStream0.getBeginColumn();\n assertEquals(122, int0);\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n int int0 = JavaCharStream.hexval('d');\n assertEquals(13, int0);\n }", "public static void main(String args[]) {\n\n\n byte b = (byte) 128;\n System.out.println(b);\n byte b1 = (byte) 129;\n System.out.println(b1);\n byte b2 = (byte) -128;\n System.out.println(b2);\n byte b3 = (byte) 127;\n System.out.println(b3);\n }", "@Test(timeout = 4000)\n public void test128() throws Throwable {\n StringReader stringReader0 = new StringReader(\"D!tcbD=EVjn`\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-7), 6);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(\"D\", token0.toString());\n assertEquals(74, token0.kind);\n }", "@Test(timeout = 4000)\n public void test106() throws Throwable {\n int int0 = JavaCharStream.hexval('B');\n assertEquals(11, int0);\n }", "public static void main(String[] args) {\n\n\n\n\n\n System.out.println((char) ('a' - 32));\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n int int0 = JavaCharStream.hexval('9');\n assertEquals(9, int0);\n }", "Character getCode();", "@Test(timeout = 4000)\n public void test137() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null);\n PipedInputStream pipedInputStream0 = new PipedInputStream();\n javaCharStream0.ReInit((InputStream) pipedInputStream0, 122, 122);\n assertEquals((-1), javaCharStream0.bufpos);\n }", "@Test(timeout = 4000)\n public void test106() throws Throwable {\n Character character0 = new Character('v');\n String string0 = SQLUtil.renderValue(character0);\n assertEquals(\"'v'\", string0);\n }", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n int int0 = JavaCharStream.hexval('8');\n assertEquals(8, int0);\n }", "abstract public int get(int codePoint);", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null, 122, 122, 122);\n int[] intArray0 = new int[0];\n javaCharStream0.bufline = intArray0;\n // Undeclared exception!\n try { \n javaCharStream0.adjustBeginLineColumn(122, 122);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 0\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public static void main(String[] args) {\n byte b1=125;\n System.out.println(b1);\n byte b2=(byte)129;\n System.out.println(b2);\t\t\n\t}", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "@Test(timeout = 4000)\n public void test074() throws Throwable {\n int int0 = JavaCharStream.hexval('c');\n assertEquals(12, int0);\n }", "private static int specialChar(char ch) {\n if ((ch > '\\u0621' && ch < '\\u0626') ||\n (ch == '\\u0627') ||\n (ch > '\\u062E' && ch < '\\u0633') ||\n (ch > '\\u0647' && ch < '\\u064A') ||\n (ch == '\\u0629')) {\n return 1;\n } else if (ch >= '\\u064B' && ch<= '\\u0652') {\n return 2;\n } else if (ch >= 0x0653 && ch <= 0x0655 ||\n ch == 0x0670 ||\n ch >= 0xFE70 && ch <= 0xFE7F) {\n return 3;\n } else {\n return 0;\n }\n }", "@Test(timeout = 4000)\n public void test125() throws Throwable {\n int int0 = JavaCharStream.hexval('0');\n assertEquals(0, int0);\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n int int0 = JavaCharStream.hexval('6');\n assertEquals(6, int0);\n }", "public static void main(String[] args) \n\t{\n\t\t\n\t\tfor(int i=0;i<=127;i++)\n\t\t{\n\t\t\tSystem.out.printf(\"%d : %c \\n \" ,i,i);\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n StringReader stringReader0 = new StringReader(\"^z{b>wblu8^IJ+?\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 21, 47, 21);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(47, javaCharStream0.getColumn());\n }", "public void mo12628c() {\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n byte[] byteArray0 = new byte[9];\n byteArray0[0] = (byte)120;\n byteArray0[1] = (byte) (-68);\n ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0);\n JavaCharStream javaCharStream0 = new JavaCharStream(byteArrayInputStream0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "@Test\n public void checkUniqueCharacter() {\n int numberOfChars = compressor.getCodes().size();\n assertTrue(numberOfChars == 86 || numberOfChars == 87, \"You appear to have some very strange end-of-line configuration on your machine!\");\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n int int0 = JavaCharStream.hexval('2');\n assertEquals(2, int0);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n int int0 = JavaCharStream.hexval('7');\n assertEquals(7, int0);\n }", "@Test(timeout = 4000)\n public void test119() throws Throwable {\n int int0 = JavaCharStream.hexval('5');\n assertEquals(5, int0);\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n int int0 = JavaCharStream.hexval('A');\n assertEquals(10, int0);\n }", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n Character character0 = Character.valueOf('O');\n String string0 = SQLUtil.renderValue(character0);\n assertEquals(\"'O'\", string0);\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n int int0 = JavaCharStream.hexval('F');\n assertEquals(15, int0);\n }", "int getUnknown13();", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n int int0 = JavaCharStream.hexval('E');\n assertEquals(14, int0);\n }", "@Test void testHexCharLiteralOutsideRangeFails() {\n final String sql = \"^_unicode'cg'^XCF\";\n final String expected = \"Unknown character set 'unicode'\";\n expr(sql).fails(expected);\n }", "@Test(timeout = 4000)\n public void test159() throws Throwable {\n StringReader stringReader0 = new StringReader(\"x/C9mX)\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-2632), (-2632));\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n javaParserTokenManager0.getNextToken();\n assertEquals(1, javaCharStream0.bufpos);\n assertEquals((-2631), javaCharStream0.getEndColumn());\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1225, 754, 1225);\n javaCharStream0.backup(1);\n javaCharStream0.adjustBeginLineColumn(1, (-1));\n int int0 = javaCharStream0.getColumn();\n assertEquals(1223, javaCharStream0.bufpos);\n assertEquals((-1), int0);\n }", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n StringReader stringReader0 = new StringReader(\"9F}n S'~C\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(74, token0.kind);\n assertEquals(\"F\", token0.toString());\n }", "@Test\n public void testEncodingNegative()\n {\n byte[] orginalBytes = sensitiveString.getBytes();\n byte[] encoded = StateUtils.encode(orginalBytes);\n encoded[1] = (byte) 9;\n try\n {\n byte[] decoded = StateUtils.decode(encoded);\n Assertions.assertFalse(Arrays.equals(decoded, orginalBytes));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "private char toChar(int u)\r\n { \r\n return (char)(u + 64);\r\n }", "public int getSingleChar() {\n return -1;\n }", "public BinaryFormatException(int charPos, char badChar){\n super(\"Binary numbers consist only of 0's and 1's\");\n this.charPos = charPos;\n this.badChar = badChar;\n }", "public char getBadChar(){\n return badChar;\n }", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n JavaCharStream javaCharStream0 = null;\n try {\n javaCharStream0 = new JavaCharStream((InputStream) null, (-2365), (-2365));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.Reader\", e);\n }\n }", "@Override\n\tpublic SerializableString getEscapeSequence(int ch) {\n\t\t// no further escaping (beyond ASCII chars) needed:\n\t\treturn null;\n\t}", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n int int0 = JavaCharStream.hexval('a');\n assertEquals(10, int0);\n }", "public void cog_SET(char src)\n { set_bytes((char)(src) & -1L, 2, data, 6); }", "@Test(timeout = 4000)\n public void test071() throws Throwable {\n int int0 = JavaCharStream.hexval('f');\n assertEquals(15, int0);\n }", "public void setVar127(java.lang.Integer value) {\n this.var127 = value;\n }", "@Test(timeout = 4000)\n public void test079() throws Throwable {\n try { \n JavaCharStream.hexval('^');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public static void main(String[] args) {\n\t\tchar ch1 = '헐';\n\t\tchar ch2 = '확';\n\t\tSystem.out.println(ch1 + \" \" + ch2);\n\t\t\n\t\tchar ch3 = 0xD5D0;\n\t\tchar ch4 = 0xD655;\n\t\tSystem.out.println(ch3 + \" \" + ch4);\n\t\t\n\t\tchar ch5 = 54736;\n\t\tchar ch6 = 54869;\n\t\tSystem.out.println(ch5 + \" \" + ch6);\n\t}", "private static byte charToByte(char c) {\n if (c >= 0x30 && c <= 0x39) {\n return (byte) (c - 0x30);\n } else if (c >= 0x41 && c <= 0x46) {\n return (byte) (c - 0x37);\n } else if (c >= 0x61 && c <= 0x66) {\n return (byte) (c - 0x57);\n }\n return 0;\n }", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n int int0 = JavaCharStream.hexval('3');\n assertEquals(3, int0);\n }", "public int a(char paramChar)\r\n/* 484: */ {\r\n/* 485:481 */ if (paramChar == '§') {\r\n/* 486:482 */ return -1;\r\n/* 487: */ }\r\n/* 488:485 */ if (paramChar == ' ') {\r\n/* 489:486 */ return 4;\r\n/* 490: */ }\r\n/* 491:489 */ int i1 = \"\".indexOf(paramChar);\r\n/* 492:490 */ if ((paramChar > 0) && (i1 != -1) && (!this.k)) {\r\n/* 493:491 */ return this.d[i1];\r\n/* 494: */ }\r\n/* 495:495 */ if (this.e[paramChar] != 0)\r\n/* 496: */ {\r\n/* 497:496 */ int i2 = this.e[paramChar] >>> 4;\r\n/* 498:497 */ int i3 = this.e[paramChar] & 0xF;\r\n/* 499:499 */ if (i3 > 7)\r\n/* 500: */ {\r\n/* 501:500 */ i3 = 15;\r\n/* 502:501 */ i2 = 0;\r\n/* 503: */ }\r\n/* 504:503 */ i3++;\r\n/* 505: */ \r\n/* 506:505 */ return (i3 - i2) / 2 + 1;\r\n/* 507: */ }\r\n/* 508:508 */ return 0;\r\n/* 509: */ }", "@Test(timeout = 4000)\n public void test128() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null, 6, 651, 6);\n // Undeclared exception!\n try { \n javaCharStream0.getLine();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -1\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test063() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null);\n javaCharStream0.maxNextCharInd = 2;\n javaCharStream0.prevCharIsCR = true;\n char char0 = javaCharStream0.readChar();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals('\\u0000', char0);\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null, 122, 122, 122);\n javaCharStream0.backup(122);\n javaCharStream0.adjustBeginLineColumn(122, 122);\n assertEquals(122, javaCharStream0.getBeginColumn());\n }", "private char toChar(int u) {\n\t\t \n\t\treturn (char)(u + 64);\n\t}", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n StringReader stringReader0 = new StringReader(\"sh5zor\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 66, 109);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(5, javaCharStream0.bufpos);\n assertEquals(114, javaCharStream0.getColumn());\n }", "private static int decodeHex(int c) {\n if (c >= '0' && c <= '9') return c - '0';\n else if (c >= 'a' && c <= 'f') return c - ('a' - 10);\n else if (c >= 'A' && c <= 'F') return c - ('A' - 10);\n else throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid %HH code\");\n }", "@Test(timeout = 4000)\n public void test095() throws Throwable {\n try { \n JavaCharStream.hexval('N');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Z[^o)j]BO6Ns,$`3$e\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1, 1, 0);\n char char0 = javaCharStream0.readChar();\n assertEquals(1, javaCharStream0.getBeginColumn());\n assertEquals(1, javaCharStream0.getEndLine());\n assertEquals('Z', char0);\n }", "@Test(timeout = 4000)\n public void test097() throws Throwable {\n try { \n JavaCharStream.hexval('K');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public static void main(String[] args){\n \tbyte[] bytes = {90, -103};\n \tfor(byte by:bytes){\n \t\tif(Instruction.HEAD[0]!=by&&ESCAPE!=by&&Instruction.TAIL[0]!=by){\n \t\t\tSystem.out.println(\"escape code error.\"+by);\n \t\t}\n \t}\n \t\n \tSystem.out.println(Instruction.HEAD[0]);\n \tSystem.out.println(Instruction.HEAD[0]==0x5a);\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte)43;\n byteArray0[1] = (byte) (-110);\n ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0);\n JavaCharStream javaCharStream0 = new JavaCharStream(byteArrayInputStream0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"+\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 91, 91);\n javaCharStream0.BeginToken();\n javaCharStream0.adjustBeginLineColumn((-366), 1);\n int int0 = javaCharStream0.getLine();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals((-366), int0);\n }", "@Override\n public void btPutChar(int value) {\n }", "@Test(timeout = 4000)\n public void test096() throws Throwable {\n try { \n JavaCharStream.hexval('M');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test127() throws Throwable {\n StringReader stringReader0 = new StringReader(\"<EOF>\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 89, 302);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n stringReader0.read();\n javaParserTokenManager0.getNextToken();\n assertEquals(2, javaCharStream0.bufpos);\n assertEquals(304, javaCharStream0.getEndColumn());\n }", "@Test\n public void Test8484()\n {\n String s = \"\\u9FE1\\uCEF3\\u2798\\uAAB6\\uDA7C\";\n Collator coll = Collator.getInstance();\n CollationKey collKey = coll.getCollationKey(s); \n logln(\"Pass: \" + collKey.toString() + \" generated OK.\");\n }", "@Test(timeout = 4000)\n public void test001() throws Throwable {\n StringReader stringReader0 = new StringReader(\"~\\\"Py BTn?,~tnf\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 15, 15);\n javaCharStream0.bufpos = (-1396);\n javaCharStream0.backup((-1396));\n javaCharStream0.adjustBeginLineColumn((-1396), 76);\n assertEquals(0, javaCharStream0.bufpos);\n }", "private int convert(int keyCode) {\n\t\tif (keyCode >= 96 && keyCode <= 105) {\n\t\t\treturn keyCode - 48;\n\t\t} else if (keyCode == 81) { // qwertyuiop -> 0-9\n\t\t\tkeyCode = 49;\n\t\t} else if (keyCode == 87) {\n\t\t\tkeyCode = 50;\n\t\t} else if (keyCode == 69) {\n\t\t\tkeyCode = 51;\n\t\t} else if (keyCode == 82) {\n\t\t\tkeyCode = 52;\n\t\t} else if (keyCode == 84) {\n\t\t\tkeyCode = 53;\n\t\t} else if (keyCode == 89) {\n\t\t\tkeyCode = 54;\n\t\t} else if (keyCode == 85) {\n\t\t\tkeyCode = 55;\n\t\t} else if (keyCode == 37) {\n\t\t\tkeyCode = 56;\n\t\t} else if (keyCode == 79) {\n\t\t\tkeyCode = 57;\n\t\t} else if (keyCode == 80) {\n\t\t\tkeyCode = 48;\n\t\t}\n\t\treturn keyCode;\n\t}", "private int decode(int index) {\n return (encoded[index] - 32) & 0x3F;\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n StringReader stringReader0 = new StringReader(\";{\\\"9n/s(2C'#tQX*\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n byte[] byteArray0 = new byte[8];\n byteArray0[0] = (byte)115;\n byteArray0[1] = (byte)93;\n ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0);\n javaCharStream0.ReInit((InputStream) byteArrayInputStream0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"s\", token0.toString());\n }", "protected int mo3987c() {\n return -1;\n }", "private static int getX(char chr) {\n \t\tswitch (chr) {\n \t\tcase '1':\n \t\tcase '!':\n \t\tcase '~':\n \t\tcase '`':\n \t\tcase 'q':\n \t\tcase 'a':\n \t\tcase 'z':\n \t\t\treturn 0;\n \t\tcase '2':\n \t\tcase 'w':\n \t\tcase 's':\n \t\tcase 'x':\n \t\t\treturn 1;\n \t\tcase '#':\n \t\tcase '3':\n \t\tcase 'e':\n \t\tcase 'd':\n \t\tcase 'c':\n \t\t\treturn 3;\n \t\tcase '4':\n \t\tcase 'r':\n \t\tcase 'f':\n \t\tcase 'v':\n \t\t\treturn 4;\n \t\tcase '5':\n \t\tcase 't':\n \t\tcase 'g':\n \t\tcase 'b':\n \t\t\treturn 5;\n \t\tcase '6':\n \t\tcase 'y':\n \t\tcase 'h':\n \t\tcase 'n':\n \t\t\treturn 6;\n \t\tcase '7':\n \t\tcase 'u':\n \t\tcase 'j':\n \t\tcase 'm':\n \t\t\treturn 7;\n \t\tcase '8':\n \t\tcase 'i':\n \t\tcase 'k':\n \t\tcase ',':\n \t\t\treturn 8;\n \t\tcase '9':\n \t\tcase 'o':\n \t\tcase 'l':\n \t\tcase '.':\n \t\t\treturn 9;\n \t\tcase '-':\n \t\tcase '_':\n \t\tcase '+':\n \t\tcase '=':\n \t\tcase 'p':\n \t\tcase '/':\n \t\t\treturn 10;\n \t\tdefault:\n \t\t\treturn 11;\n \t\t}\n \t}", "public static int ascii(char c) {\n \treturn (int)c;\n }", "private static void task41() {\n System.out.println(\"Enter character: \");\n char ch = scanStr().charAt(0);\n\n System.out.println(\"ASCII value of \" + ch + \" is \" + (int)ch);\n }", "@Test(timeout = 4000)\n public void test096() throws Throwable {\n StringReader stringReader0 = new StringReader(\"q,rv8PAfKjbSw`H(r\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-3465), (-2086));\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(\"q\", token0.toString());\n assertEquals(74, token0.kind);\n }", "@Test(timeout = 4000)\n public void test147() throws Throwable {\n StringReader stringReader0 = new StringReader(\"*22Wt+'F\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-1142), 109);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"*\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n StringReader stringReader0 = new StringReader(\"+%WC\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 12, (-1783), 1289);\n javaCharStream0.BeginToken();\n int int0 = javaCharStream0.getEndColumn();\n assertEquals(12, javaCharStream0.getBeginLine());\n assertEquals((-1783), int0);\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n try { \n JavaCharStream.hexval('P');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "private AsciiUtils() {\r\n\t}", "int decodeInt();", "@Test(timeout = 4000)\n public void test137() throws Throwable {\n StringReader stringReader0 = new StringReader(\"9F83|i5vU 84Kd\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 887, 887);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n // // Unstable assertion: assertEquals(3, javaCharStream0.bufpos);\n // // Unstable assertion: assertEquals(890, javaCharStream0.getColumn());\n }", "public static void main(String[] args) {\n\t\tbyte bs = -127;\n\t\t\n\t\tSystem.out.println(bs);\n\t\t\n\t\t//int iVal = 12345678900;\n\t\tlong lVal = 2147483647;\n\t\tlong lVal1 = 9999999999L; //기준 이상값을때는 L을 넣어주는것이 좋다.\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test092() throws Throwable {\n StringReader stringReader0 = new StringReader(\"s15IMZA$C/uXdG]R\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0, 0);\n javaParserTokenManager0.getNextToken();\n javaParserTokenManager0.getNextToken();\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(13, javaCharStream0.bufpos);\n assertEquals(\"uXdG\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test066() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null, 4087, 122, 682);\n javaCharStream0.backup(4087);\n // Undeclared exception!\n try { \n javaCharStream0.BeginToken();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -3405\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n try { \n JavaCharStream.hexval('W');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public java.lang.Integer getVar127() {\n return var127;\n }", "@Test(timeout = 4000)\n public void test095() throws Throwable {\n String string0 = DBUtil.escape(\"Ucb\");\n assertEquals(\"Ucb\", string0);\n }" ]
[ "0.6015965", "0.59742177", "0.5972257", "0.5922428", "0.57983136", "0.57620585", "0.5718899", "0.57070845", "0.570368", "0.5678297", "0.5667697", "0.56634325", "0.566164", "0.5661466", "0.56435716", "0.56243074", "0.56216264", "0.5612129", "0.5611534", "0.5604216", "0.560108", "0.55978984", "0.55869526", "0.557333", "0.55541164", "0.5547992", "0.5531693", "0.55305785", "0.5528873", "0.55273384", "0.55177236", "0.5515961", "0.5514454", "0.55139226", "0.55119526", "0.54955435", "0.54806554", "0.5472053", "0.5470926", "0.54671025", "0.5466312", "0.5463248", "0.5461182", "0.5458361", "0.54347", "0.5429415", "0.54194117", "0.5417058", "0.5399385", "0.5388928", "0.5385547", "0.5385136", "0.53830945", "0.5378888", "0.5375087", "0.5370064", "0.5364195", "0.5363276", "0.53599685", "0.5357632", "0.5344329", "0.5340922", "0.5334076", "0.5320675", "0.53160477", "0.5307947", "0.53059095", "0.53011894", "0.52960443", "0.52937317", "0.5291718", "0.52894956", "0.5279349", "0.52767915", "0.5272188", "0.5268148", "0.52676183", "0.52614456", "0.5256717", "0.5256193", "0.52529246", "0.52508", "0.5246367", "0.5244756", "0.52384275", "0.5233833", "0.5232409", "0.52292603", "0.5223673", "0.52209985", "0.52205616", "0.52184707", "0.52113533", "0.52047706", "0.52039653", "0.52037156", "0.51999027", "0.51965183", "0.519602", "0.51959777", "0.51860183" ]
0.0
-1
check if they are the same
public boolean equals(Vector2F v) { return (this.xPos == v.xPos && this.yPos == v.yPos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasSameAs();", "public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplicatesE(input);\n return dupA == dupB && dupA == dupC && dupA == dupD && dupA == dupE;\n }", "private boolean isEqual(int[] x, int[] y) {\n for (int i = 0; i < 3; i++) {\n if (x[i] != y[i]) {\n return false;\n }\n }\n return true;\n }", "public static boolean same(int[] a, int[] b) {\r\n \treturn (a[0] == b[0] && a[1] == b[1]) || (a[0] == b[1] && a[1] == b[0]);\r\n }", "public boolean same(GameState c, GameState g) \n\t{\n\t\tfor(int x = 0; x<18; x++) //loop through the boards\n\t\t{\n\t\t\tif(c.getBoard()[x] != g.getBoard()[x]) //if one value is not the same in the afrra return false\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;//if they all are the same return true\n\t}", "private boolean inSameSuit() {\n for (int i = 0; i < cards.length-2; i++) {\n if (cards[i].charAt(1) != cards[i + 1].charAt(1)) {\n return false;\n }\n }\n \n return true;\n }", "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 }", "boolean hasIsEquivalent();", "@Test\n public void testEquals() {\n \t\n \t//create data set\n \tString strJava = \"java\";\n \tString strScala = \"scala\";\n \tString strPhp = \"php\";\n \t\n \tfinal LastWriteWinSet<String> lastWriteWinSet1 = new LastWriteWinSet<>();\n\n \tlastWriteWinSet1.add(time1, strJava);\n \tlastWriteWinSet1.add(time1, strScala);\n \tlastWriteWinSet1.add(time1, strPhp);\n\n \tlastWriteWinSet1.delete(time2, strJava);\n \n final LastWriteWinSet<String> lastWriteWinSet2 = new LastWriteWinSet<>();\n\n lastWriteWinSet2.add(time1, strJava);\n lastWriteWinSet2.add(time1, strScala);\n lastWriteWinSet2.add(time1, strPhp);\n\n lastWriteWinSet2.delete(time2, strJava);\n \n final LastWriteWinSet<String> lastWriteWinSet3 = lastWriteWinSet2;\n \t\n assertTrue(lastWriteWinSet1.equals(lastWriteWinSet2));\n assertTrue(lastWriteWinSet3.equals(lastWriteWinSet2));\n assertTrue(lastWriteWinSet1.equals(lastWriteWinSet1));\n assertTrue(!lastWriteWinSet1.equals(null));\n }", "public boolean checkEquality(){\n boolean flag = true;\n for (int i = 0; i < boardRows ; i++) {\n for (int j = 0; j < boardColumns; j++) {\n if(this.currentBoardState[i][j] != this.goalBoardState[i][j]){\n flag = false;\n }\n }\n }\n return flag;\n }", "public boolean isSame(){\r\n\t\tHugeInt mod2 = new HugeInt(this.p);\r\n\t\tmod2.modByHugeInt(new HugeInt(\"2\"));\r\n\t\tmod2.printHugeInt();\r\n\t\t\r\n\t\tHugeInt mod3 = new HugeInt(this.p);\r\n\t\tmod3.modByHugeInt(new HugeInt(\"3\"));\r\n\t\t\r\n\t\tif(this.p.compareHugeInts(this.p, new HugeInt(\"1\")) != -1)\r\n\t\t\tSystem.out.println(\"less than or equal to 1\");\r\n\t\telse if(this.p.compareHugeInts(this.p, new HugeInt(\"3\")) != -1)\r\n\t\t\tSystem.out.println(\"greater than 1 but less than 3\");\r\n\t\telse if(mod2.areAllZeros() || mod3.areAllZeros())\r\n\t\t\tSystem.out.println(\"mod by 2 or 3\");\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }", "protected boolean isSameSnakSet(Iterator<Snak> snaks1, Iterator<Snak> snaks2) {\n\t\tArrayList<Snak> snakList1 = new ArrayList<>(5);\n\t\twhile (snaks1.hasNext()) {\n\t\t\tsnakList1.add(snaks1.next());\n\t\t}\n\n\t\tint snakCount2 = 0;\n\t\twhile (snaks2.hasNext()) {\n\t\t\tsnakCount2++;\n\t\t\tSnak snak2 = snaks2.next();\n\t\t\tboolean found = false;\n\t\t\tfor (int i = 0; i < snakList1.size(); i++) {\n\t\t\t\tif (snak2.equals(snakList1.get(i))) {\n\t\t\t\t\tsnakList1.set(i, null);\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn snakCount2 == snakList1.size();\n\t}", "Boolean same(MultiSet<X> s);", "@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 public void equalsSameTest() {\n Device device2 = new Device(deviceID, token);\n assertEquals(device, device2);\n }", "@Override\n public boolean areContentsTheSame(Item one,\n Item two) {\n return one.equals(two);\n }", "private boolean checkComp() {\n\t\tfor (int i = 0; i < comp.length; i++) {\n\t\t\tfor (int j = 0; j < comp[i].length; j++) {\n\t\t\t\tif (comp[i][j] != answer[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean 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}", "static boolean areIdentical(Line l1, Line l2) {\n return areParallel(l1, l2) && (Math.abs(l1.c - l2.c) < EPS);\n }", "private boolean isValuesEqual(BinaryMessage tocmp, BinaryMessage original) {\n\t\tif(tocmp.getValue().equals(original.getValue())) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isEquals() {\n long len = -1L;\n\n //1. check the lengths of the words\n for(S left : slp.getAxioms()) {\n if(len == -1L) {\n len = slp.length(left);\n }\n else {\n if(len != slp.length(left)) {\n return false;\n }\n }\n }\n\n // all words are the empty word\n if(len == 0) {\n return true;\n }\n\n // 2. the length are all equals and not zero => execute the recompression\n execute();\n\n S otherSymbol = null;\n boolean first = true;\n\n // 3. chech now if for all axioms X : |val(X)| = 1 and all val(X) are equals.\n for(S left : slp.getAxioms()) {\n if(first) {\n slp.length(left, true);\n first = false;\n }\n\n if(slp.length(left) != 1) {\n return false;\n }\n else {\n S symbol = slp.get(left, 1);\n if(otherSymbol == null) {\n otherSymbol = symbol;\n }\n\n if(!symbol.equals(otherSymbol)) {\n return false;\n }\n }\n }\n\n return true;\n }", "@Test\n\tpublic void testSampleEquals() {\n\n\t\tassertTrue(square.equals(squareRotate));\n\t\t\n\t\tassertTrue(pyr1.equals(pyr5));\n\t\t\n\t\tassertTrue(s.equals(sInitial));\n\t\tassertFalse(stick.equals(stickRotated));\n\t\tassertFalse(s.equals(sRotated));\n\n\n\t}", "@Test\n void compareTo_Identical_AllParts()\n {\n runIsMatchTest(AnswerType.yes, AnswerType.yes, AnswerType.yes, AnswerType.yes, ContactMatchType.Identical);\n }", "private boolean isSamePass(byte[] saved) {\n\t\t// They must have the same length.\n\t\tif ( generatedHash.length != saved.length ) return false;\n\n\t\t// Get the index where the salt starts for this user.\n\t\tint saltStart = getSaltStartIndex();\n\t\tint saltEnd = saltStart + SALT_LENGTH;\n\n\t\tfor ( int i = 0 ; i < generatedHash.length; i++ ) {\n\t\t\t// Before the salt, indexes must match up\n\t\t\tif ( i < saltStart ) if ( generatedHash[i] != saved[i] ) return false;\n\t\t\telse if ( i < saltEnd ) continue; // ignore the salt\n\t\t\telse if ( saved[i] != saved[i] ) return false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean same1(int[] c, int[] g) \n\t{\n\t\tfor(int x = 0; x<18; x++) //loop through the boards\n\t\t{\n\t\t\tif(c[x] != g[x]) //if one value is not the same in the afrra return false\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;//if they all are the same return true\n\t}", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "private static boolean areTheyEqual(int[][] tempArray, int[][] array2) {\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tif (tempArray[i][j] != array2[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testHashcodeReturnsSameValueForIdenticalRecords() {\n int hashcodeA = record.hashCode();\n int hashcodeB = otherRecord.hashCode();\n\n assertThat(hashcodeA == hashcodeB, is(true));\n }", "private static boolean isEqual(int[] nums1, int[] nums2){\n \tfor(int i=0; i<nums1.length; i++){\n \t\tif(nums1[i]!=nums2[i]){\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\n }", "@Test\n public void testEqual () {\n CountDownTimer s1 = new CountDownTimer(5, 59, 00);\n CountDownTimer s2 = new CountDownTimer(6, 01, 00);\n CountDownTimer s3 = new CountDownTimer(6, 01, 00);\n CountDownTimer s4 = new CountDownTimer(\"5:59:00\");\n\n assertFalse(s1.equals(s2));\n assertTrue(s1.equals(s4));\n assertFalse(CountDownTimer.equals(s1,s3));\n assertTrue(CountDownTimer.equals(s2, s3));\n }", "@Test\n public void testEquals_differentParameters() {\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 + 1,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are different\n assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr);\n }", "@Test\r\n public void ObjectsAreNotTheSame() {\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n Assert.assertNotSame(try_scorers ,try_scorers.updateGamesPlayed(4),\"The Objects are the same\"); \r\n \r\n }", "private boolean isSameList(CardList l1, CardList l2){\r\n\t\tif (l1.size()!=l2.size())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tIterator<Card> i1 = l1.iterator();\r\n\t\tIterator<Card> i2 = l2.iterator();\r\n\t\twhile(i1.hasNext()){\r\n\t\t\tif (!i1.next().equals(i2.next()))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Sanpham)) {\n return false;\n }\n Sanpham that = (Sanpham) other;\n Object myMasp = this.getMasp();\n Object yourMasp = that.getMasp();\n if (myMasp==null ? yourMasp!=null : !myMasp.equals(yourMasp)) {\n return false;\n }\n return true;\n }", "private Boolean equalWebItemImages(WebItemImage webItemImageOne, WebItemImage webItemImageTwo) {\n\t\tif (webItemImageOne==null && webItemImageTwo==null) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif (webItemImageOne==null || webItemImageTwo==null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (webItemImageOne.getSourceURL() == webItemImageTwo.getSourceURL()) {\r\n\t\t\treturn true;\r\n\t\t } else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "static boolean Isosceles(long AA, long BB, long CC){\n if((AA==BB)||((AA==CC)||(BB==CC)))\n return true;\n else\n return false;\n }", "@Test\n public void testIsSameNumber() {\n int x = 1;\n int y = 1;\n int z = 2;\n\n assertEquals(true, Flik.isSameNumber(x, y));\n assertEquals(false, Flik.isSameNumber(x, z));\n }", "@Test\n\tpublic void testEqualsVerdadeiro() {\n\t\t\n\t\tassertTrue(contato1.equals(contato3));\n\t}", "private static boolean allElementsEqual(Mark[] array) {\n\t\t\n\t\tboolean areEqual = true;\n\t\t\n for(int i=0 ; i < array.length; i++) {\n \t\n \t\n \tif (array[i] == null) {\n \t\tareEqual = false;\n \t\tbreak;\n \t}\n \t\n if(!array[0].equals(array[i])) {\n areEqual = false;\n break;\n }\n }\n\n return areEqual;\n }", "@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}", "@Override\n public boolean areItemsTheSame(Concert oldConcert, Concert newConcert) {\n return oldConcert.getId() == newConcert.getId();\n }", "@Test\n void testSameHashCodes() {\n assertEquals(loginRequest1.hashCode(), loginRequest1.hashCode());\n }", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "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 }", "private boolean isSame(Calendar first, Calendar second)\n {\n return (first.get(Calendar.DAY_OF_MONTH) == second.get(Calendar.DAY_OF_MONTH))\n && (first.get(Calendar.MONTH) == second.get(Calendar.MONTH))\n && (first.get(Calendar.YEAR) == second.get(Calendar.YEAR));\n }", "@Test\n public void testEqualsReturnsTrueOnIdenticalRecords() {\n boolean equals = record.equals(otherRecord);\n\n assertThat(equals, is(true));\n }", "public final boolean equal() {\n\t\tif (size > 1) {\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue == secondTopMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Acquirente)) {\n return false;\n }\n Acquirente that = (Acquirente) other;\n if (this.getIdacquirente() != that.getIdacquirente()) {\n return false;\n }\n return true;\n }", "private static boolean equalityTest5(String a, String b)\n {\n return a.hashCode() == b.hashCode();\n }", "private boolean oneEquals(AccessPath that) {\n //if (this._n != that._n) return false;\n if (this._field != that._field) return false;\n if (this._last != that._last) return false;\n if (this.succ.size() != that.succ.size()) return false;\n return true;\n }", "private boolean identicalAtoms(IAtomContainer molecule1, List<IAtomContainer> fragsToCompare) {\n\t\n \tfor (int i = 0; i < fragsToCompare.size(); i++) {\n \t\t//no match\n \t\tif (molecule1.getBondCount() != fragsToCompare.get(i).getBondCount() && molecule1.getAtomCount() != fragsToCompare.get(i).getAtomCount()) \n \t\t{\n \t\t\tcontinue;\n \t\t}\n \t\t\n\n \t\tint n = 0;\n \t\t//array storing all already tried atoms\n \t\tboolean[] doneAtoms = new boolean[atomsContained + 1];\n \t\tfor (int j = 0; j < molecule1.getAtomCount(); j++) {\n \t\t\tfor (int k = 0; k < fragsToCompare.get(i).getAtomCount(); k++) \n \t\t\t{\n \t\t\t\t//compare atoms by symbol, thus only check for the same sum formula --> EXPERIMENTAL\n \t\t\t\tif(molecularFormulaRedundancyCheck)\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).getSymbol().equals(fragsToCompare.get(i).getAtom(k).getSymbol()) &&\n \t\t\t\t\t\t\t!doneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())]) {\n \t\t\t\t\tn++;\n \t\t\t\t\tdoneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())] = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t} \t\t\t\t\n \t\t\t\t//normal test creates way more fragments!\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).equals(fragsToCompare.get(i).getAtom(k))) {\n \t\t\t\t\tn++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif(n == molecule1.getAtomCount())\n \t\t\treturn true;\n\t\t}\n\t //no match found\n\t\treturn false;\n\t}", "@Test(testName = \"duplicateElementsFromOneArrays\")\n\t public static void commonElementsFromOneArray() \n\t {\n\t int[] my_array = {1, 2, 5, 5, 6, 6, 7, 2};\n\t \n\t for (int i = 0; i < my_array.length-1; i++)\n\t {\n\t for (int j = i+1; j < my_array.length; j++)\n\t {\n\t if ((my_array[i] == my_array[j]) && (i != j))\n\t {\n\t System.out.println(\"Duplicate Element : \"+my_array[j]);\n\t }\n\t }\n\t }\n\t }", "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 void main(String[] args) {\n Pair first = new Pair(\"Pesho\", \"Gosho\");\r\n Pair second = new Pair(\"Pesho\", \"Gosho\");\r\n Pair third = new Pair(\"Pesho\", \"Mariika\");\r\n \r\n System.out.println(first.equals(second));\r\n System.out.println(first.equals(third));\r\n }", "private static boolean equals(int[] array1, int[] array2) {\n if(array1.length != array2.length)\n return false;\n \n Arrays.sort(array1);\n Arrays.sort(array2);\n \n int i = 0;\n for(; i < array1.length; ++i) {\n if(array1[i] != array2[i])\n break;\n }\n \n return (i == array1.length);\n }", "boolean areTheyEqual(int[] array_a, int[] array_b) {\n if(array_a == null || array_b == null || array_a.length!=array_b.length) return false;\n\n HashMap<Integer,Integer> count = new HashMap<>();\n for(int x : array_a){\n count.put(x, count.getOrDefault(x,0)+1);\n }\n for(int y : array_b){\n count.put(y, count.getOrDefault(y,0)-1);\n if(count.get(y)==0) count.remove(y);\n }\n return count.size()==0;\n }", "public static boolean haveIdenticalContents(List list1, List list2)\r\n {\r\n if ((list1 == null) != (list2 == null))\r\n {\r\n // One is null and other is not.\r\n return false;\r\n }\r\n if (list1 != null)\r\n {\r\n // Both are not null.\r\n if (list1.size() != list2.size())\r\n {\r\n // Different sizes.\r\n return false;\r\n }\r\n // Both not null and same size.\r\n for (int i = 0; i < list1.size(); i++)\r\n {\r\n if (list1.get(i) != list2.get(i))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "private static boolean flush(ArrayList<CardSuit> suits) {\n //this for loop traverse the suits in order to check if there\n // are two cards of different suits\n for (int i = 1; i < suits.size(); i++) {\n if (suits.get(i) != suits.get(i -1)){\n return false;\n }\n }\n return true;\n }", "@Test\n public void equals_SameBuyQuery_Test() {\n Assert.assertTrue(bq1.equals(bq0));\n }", "public boolean isEqual(MatchingCardsTile other){\n return this.getNumber() == other.getNumber();\n }", "private boolean equalsChars(char[] first, char[] second) {\n for (int i = 0; i < second.length; i++)\n if (first[i] != second[i])\n return false;\n return true;\n }", "public boolean isValid() {\n\n if (this.eTime == INFINITY) return false;\n\n int oldCountA = (a != null) ? a.getCount() : 0;\n int oldCountB = (b != null) ? b.getCount() : 0;\n\n if (countA != oldCountA || countB != oldCountB)\n return false;\n\n return true;\n }", "private boolean isEqual(Roster r2)\n\t{\n\t\tIterator<Player> it1 = iterator();\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tPlayer p = it1.next();\n\t\t\tif(!r2.has(p))\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tIterator<Player> it2 = r2.iterator();\n\t\twhile(it2.hasNext())\n\t\t{\n\t\t\tPlayer p = it2.next();\n\t\t\tif(!has(p))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean sameElements(List firstList, List secondList)\r\n\t{\r\n\t\t\r\n\t\t// The size hould be the same, otherwise stop.\r\n\t\tif (firstList.size() != secondList.size())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Iterate over the elements of the first list.\r\n\t\tfor (int index = 0; index < firstList.size(); index++)\r\n\t\t{\r\n\t\t\t// Check if the element is also in the second list.\r\n\t\t\tif (!secondList.contains(firstList.get(index)))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// They heve the same elements.\r\n\t\treturn true;\r\n\t}", "public boolean hasAdjacentEqualPair()\n { \n \tfor( int i = 0; i < purchases.size()-1; i++ )\n \t{\n \t\tGizmo curr = purchases.get( i );\n \t\tGizmo nxt = purchases.get( i + 1 );\n \t\tif( curr.equals( nxt ) )\n \t\t\treturn true;\n \t}\n \treturn false; \t\n }", "@Test\n\tpublic void equalsSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tboolean equals = key1.equals(key2);\n\t\tSystem.out.println();\n\t\tAssert.assertTrue(equals);\n\t}", "@Test\n\tpublic void testEqualsFalso() {\n\t\t\n\t\tassertFalse(contato1.equals(contato2));\n\t}", "private static boolean checkIsTrue() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(col[i]!=colTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(row[i]!=rowTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean haveSameSkeleton(JsonObject object1, JsonObject object2){\n\t\tboolean res = (object1.entrySet().size() == object2.entrySet().size());\n\t\tSystem.err.println(res);\n\t\tif (res){\n\t\t\tfor(java.util.Map.Entry<String, JsonElement> entry : object1.entrySet()){\n\t\t\t\tif (!object2.has(entry.getKey())) return false;\n\t\t\t}\n\t\t\treturn true;\t\t\t\n\t\t}\n\t\telse return false;\n\t}", "public void compareAddress()\n {\n Address a = new Address(\"Amapolas\",1500,\"Providencia\",\"Santiago\");\n Address b = new Address(\"amapolas\",1500, \"providencia\",\"santiago\");\n Address c = new Address(\"Hernando Aguirre\",1133,\"Providencia\", \"Santiago\");\n \n boolean d = a.equals(b); \n }", "public Boolean checkIfTumblerRowIsAllTheSame(Tumbler tum) {\n if (tum.getTumbler1() == tum.getTumbler2() && tum.getTumbler1() == tum.getTumbler3() && tum.getTumbler1() == tum.getTumbler4()\n && tum.getTumbler1() == tum.getTumbler5()) {\n return true;\n }\n return false;\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 boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }", "public boolean isEqual(FusableBooks record1, FusableBooks record2) {\n\t\treturn sim.calculate(record1.getBookName(), record2.getBookName()) == 1.0;\n\t}", "@Test\n public void equals_trulyEqual() {\n SiteInfo si1 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n SiteInfo si2 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n\n Assert.assertEquals(si1, si2);\n }", "public static boolean same(int[][] list) {\r\n \tfor (int i=1; i<list.length; i++)\r\n \t\tif (!same(list[0], list[i]))\r\n \t\t\treturn false;\r\n \treturn true;\r\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "public boolean sameState(State s){\n\t\tint i = s.getHound1();\n\t\tint j = s.getHound2();\n\t\tint k = s.getHound3();\n\t\tint hare = s.getHare();\n\t\tif(hare==r){\n\t\t\tif((i==h1||i==h2||i==h3)&&(j==h1||j==h2||j==h3)&&(k==h1||k==h2||k==h3)){\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static boolean equal(int[] one, int[] two)\r\n {\r\n if(one.length!=two.length) return false;\r\n for(int i= 0; i<one.length; i++) \r\n {\r\n if(one[i]!=two[i]) return false;\r\n }\r\n return true;\r\n }", "@Test\n\tpublic void addSameValueTwice() {\n\t\tXSet xset = new XSet(3);\n\t\txset.add(1);\n\t\txset.add(1);\n\t\tassertTrue(xset.getSize() == 1);\n\t}", "public void testEquals() throws Exception {\n State state1 = new State();\n state1.setCanJump(1);\n state1.setDirection(1);\n state1.setGotHit(1);\n state1.setHeight(1);\n state1.setMarioMode(1);\n state1.setOnGround(1);\n state1.setEnemiesSmall(new boolean[3]);\n state1.setObstacles(new boolean[4]);\n state1.setDistance(1);\n state1.setStuck(1);\n\n State state2 = new State();\n state2.setCanJump(1);\n state2.setDirection(1);\n state2.setGotHit(1);\n state2.setHeight(1);\n state2.setMarioMode(1);\n state2.setOnGround(1);\n state2.setEnemiesSmall(new boolean[3]);\n state2.setObstacles(new boolean[4]);\n state2.setStuck(1);\n\n State state3 = new State();\n state3.setCanJump(1);\n state3.setDirection(1);\n state3.setGotHit(1);\n state3.setHeight(1);\n state3.setMarioMode(2);\n state3.setOnGround(1);\n state3.setEnemiesSmall(new boolean[3]);\n state3.setObstacles(new boolean[4]);\n assertEquals(state1,state2);\n assertTrue(state1.equals(state2));\n assertFalse(state1.equals(state3));\n Set<State> qTable = new HashSet<State>();\n qTable.add(state1);\n qTable.add(state2);\n assertEquals(1,qTable.size());\n qTable.add(state3);\n assertEquals(2,qTable.size());\n\n }", "public static boolean areImagesSame(Image a, Image b) {\n if(a.getWidth() == b.getWidth() && a.getHeight() == b.getHeight()) {\n for(int x=0; x<(int) a.getWidth(); x++) {\n for(int y=0; y<(int) a.getHeight(); y++) {\n // If even a single pixel doesn't match color then it will return false\n if(!a.getPixelReader().getColor(x, y).equals(b.getPixelReader().getColor(x, y))) return false;\n }\n }\n }\n return true;\n }", "public static boolean isEqualSet(Collection set1, Collection set2) {\n/* 99 */ if (set1 == set2) {\n/* 100 */ return true;\n/* */ }\n/* 102 */ if (set1 == null || set2 == null || set1.size() != set2.size()) {\n/* 103 */ return false;\n/* */ }\n/* */ \n/* 106 */ return set1.containsAll(set2);\n/* */ }", "boolean equals(GameState b) {\n for (int i = 0; i < SIZE; i++) {\n for (int j = 0; j < SIZE; j++) {\n if (board[i][j] != b.board[i][j]) {\n return false;\n }\n }\n }\n return true;\n\n }", "private static boolean diffOne(String s1, String s2) {\n int count = 0;\n for (int i = 0; i < s1.length(); i++) {\n if (s1.charAt(i) != s2.charAt(i)) count++;\n if (count > 1) return false;\n }\n return count == 1;\n }", "public boolean RepVec(String []a){\n boolean rep=false;\n String aux1=\"\",aux2=\"\";\n for (int i = 0; i < a.length; i++) {\n aux1=a[i];\n for (int j = 0; j < a.length; j++) {\n aux2=a[j];\n if( i!=j ){ \n if(aux1==aux2){\n rep=true;\n return rep;\n } \n } \n }\n }\n return rep;\n \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 }", "private Comparison checkEquality(SimpleNode node1, SimpleNode node2) {\n // Compare the classes.\n Comparison comparison = compareClasses(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the values.\n comparison = compareValues(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the images.\n comparison = compareImages(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the children.\n return compareChildren(node1, node2);\n }", "public boolean coordsAreEqual(Cell anotherCell){\n return (getI() == anotherCell.getI()) && (getJ() == anotherCell.getJ());\n }", "private static boolean slowEquals(final byte[] a, final byte[] b) {\n int diff = a.length ^ b.length;\n for (int i = 0; i < a.length && i < b.length; i++) {\n diff |= a[i] ^ b[i];\n }\n return diff == 0;\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof User)) {\n return false;\n }\n User that = (User) other;\n if (this.getIduser() != that.getIduser()) {\n return false;\n }\n return true;\n }", "@Test\n\tpublic void doEqualsTestSameMapDifferentInstances() {\n\t\tassertTrue(bigBidiMap.equals(bigBidiMap_other));\n\n\t}", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof RegistrationItems)) {\n return false;\n }\n RegistrationItems that = (RegistrationItems) other;\n Object myRegItemUid = this.getRegItemUid();\n Object yourRegItemUid = that.getRegItemUid();\n if (myRegItemUid==null ? yourRegItemUid!=null : !myRegItemUid.equals(yourRegItemUid)) {\n return false;\n }\n return true;\n }", "private boolean compareMomenta(int[] a, int[] b){\n return ((a[0] == b[0]) &&\n (a[1]) == b[1]) ;\n }", "private boolean samePosition(ITarget t1, ITarget t2) {\n assert t1.getTag() == t2.getTag() : \"Programmer error; tags must match.\";\n switch (t1.getTag()) {\n case JPL_MINOR_BODY:\n case MPC_MINOR_PLANET:\n case NAMED:\n\n // SUPER SUPER SKETCHY\n // The .equals logic in NonSiderealTarget actually does what we want here, at\n // least according to the old implementation here. So we'll leave it for now.\n // This will be easier with the new model.\n return t1.equals(t2);\n\n case SIDEREAL:\n final HmsDegTarget hms1 = (HmsDegTarget) t1;\n final HmsDegTarget hms2 = (HmsDegTarget) t2;\n return hasSameCoordinates(hms1, hms2) &&\n hasSameProperMotion(hms1, hms2) &&\n hasSameTrackingDetails(hms1, hms2);\n\n default:\n throw new Error(\"Unpossible target tag: \" + t1.getTag());\n }\n }", "@Test\n public void equal() {\n assertTrue(commandItem.equals(commandItemCopy));\n assertTrue(commandItem.isSameCommand(commandItemCopy));\n //not commanditem return false\n assertFalse(commandItem.equals(commandWord));\n }", "private void testEquals() {\n init();\n assertTrue(\"l0.equals(l0)\", l0.equals(l0));\n assertTrue(\"l3.equals(l5)\", l3.equals(l5));\n }", "private static boolean slowEquals(byte[] a, byte[] b) {\r\n int diff = a.length ^ b.length;\r\n for (int i = 0; i < a.length && i < b.length; i++) {\r\n diff |= a[i] ^ b[i];\r\n }\r\n return diff == 0;\r\n }", "public boolean equivalentInteractions(InteractionObject first, InteractionObject second) {\n\t\tboolean result = \n\t\t\tfirst.getType() == second.getType() &&\n\t\t\tfirst.getIndex() == second.getIndex();\n\t\treturn result;\n\t}", "boolean isUnique();" ]
[ "0.7683209", "0.706411", "0.6961017", "0.6869651", "0.6816665", "0.6796233", "0.6758268", "0.6661888", "0.6659506", "0.6637798", "0.6614542", "0.65862", "0.65196705", "0.64968354", "0.6478967", "0.6467523", "0.6421595", "0.6421298", "0.6412242", "0.6408763", "0.64026153", "0.6359664", "0.63507617", "0.63474655", "0.6346152", "0.6336257", "0.63320625", "0.6327927", "0.6326964", "0.6315499", "0.6313958", "0.6312154", "0.6299449", "0.62957746", "0.6295356", "0.62879395", "0.62858355", "0.62814903", "0.6279619", "0.62682897", "0.6265294", "0.6256529", "0.6243009", "0.62364995", "0.62355435", "0.6230691", "0.6224181", "0.62226075", "0.62223786", "0.6217876", "0.62107944", "0.62096274", "0.6208257", "0.62001395", "0.6198649", "0.6190519", "0.6181952", "0.6176208", "0.617419", "0.6171837", "0.61703503", "0.61645573", "0.61532176", "0.61501", "0.61373127", "0.61365634", "0.6135365", "0.6134642", "0.6133804", "0.61268836", "0.6126264", "0.61247987", "0.61232966", "0.61165494", "0.61137545", "0.61050296", "0.6103643", "0.60961145", "0.6092941", "0.60914314", "0.6086647", "0.6086067", "0.60841846", "0.6076124", "0.60752153", "0.60715353", "0.606856", "0.6066965", "0.6051596", "0.6048904", "0.60482764", "0.6047232", "0.6046576", "0.60456824", "0.60426897", "0.60424364", "0.60395396", "0.60387456", "0.60365266", "0.60341287", "0.6032395" ]
0.0
-1
getter for screen location
public Vector2F getScreenLocation() { return new Vector2F(xPos, yPos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Point getLocation() { return loc; }", "public ScreenPosition getPosition()\n {\n return myPosition;\n }", "public abstract String getDisplayLocation();", "public int getLocation()\r\n {\r\n return location;\r\n }", "public Point getLocation() {\n\t\treturn location;\n\t}", "public Vector2f getLocation() {\r\n\t\treturn location.getLocation();\r\n\t}", "public final Coord getLocation() {\n return location;\n }", "@Override\n public Location getDisplayedLocation() {\n this.displayedLocation = new Location((int)pane.getHvalue(), (int)pane.getVvalue(), curFloor, \"Unknown\");\n return displayedLocation;\n }", "public final Point getLocation() {\n return this.location ;\n }", "public Point getLocation() {\r\n return layout.location;\r\n }", "public Point getLocation() {\n return location;\n }", "public Location getLocation() {\n return loc;\n }", "public Location getLocation() {\n return loc;\n }", "public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}", "public int getLocation()\r\n {\n }", "public PVector getLoc() {\n return location;\n }", "public PVector getLoc() {\n return location;\n }", "public Location getLocation() {\n\t\treturn loc;\n\t}", "SiteLocation getLocatedAt();", "public Point getLocationDialog(){\n try{\n return new Point( (int)this.getLocationOnScreen().getX() +(this.getWidth() /3), (int)this.getLocationOnScreen().getY()+this.menuBarData.getHeight());\n }catch(IllegalComponentStateException e){\n return new Point(100,100);\n }\n }", "public String getLocationString() {\n return getCenter().toString();\n }", "public String getLocation() {\r\n\t\treturn location; \r\n\t}", "public String getLocation() {\n\t\treturn mLocation;\n\t}", "public String getLocation() {\r\n return location;\r\n }", "public String getLocation() {\r\n return location;\r\n }", "public String getLocation() {\r\n\t\treturn location;\r\n\t}", "public Location getLocation() \n\t{\n\t\treturn location;\n\t}", "public Point getLocation();", "public int getLocY() {\n return locY;\n }", "public Coordinate getLocation() {\n return location;\n }", "public String getLocation() {\n return mLocation;\n }", "public PVector getLocation()\n\t{\n\t\treturn location;\n\t}", "Location getLocation();", "Location getLocation();", "Location getLocation();", "Location getLocation();", "public String getLocation()\n {\n return location;\n }", "public double getLocation(){\n\t\treturn location;\n\t}", "public String getLocation() { return location; }", "public String getLocation() { return location; }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n\t\treturn location;\n\t}", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public Point getRobotLocation();", "public native final String location() /*-{\n\t\treturn this[\"location\"];\n\t}-*/;", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "@Override\n public PointF getLocation() {\n return location;\n }", "public String getLocation() {\n return this.location;\n }", "public Location getLocation() {\n return getLocation(null);\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n\t\t\treturn location;\n\t\t}", "public String getLocation(){\r\n return Location;\r\n }", "public int getLocY() {\n return locY;\n }", "public Point getLocation() {\n return currentLocation;\n }", "public final String getLocation() {\n return location;\n }", "public final double getScreenY() {\n return screenY;\n }", "public WotlasLocation getLocation() {\n return this.getBasicChar().getLocation();\n }", "public Location getLocation() {\n\t\treturn location;\n\t}", "public int getSquareLocation()\n\t\t{\n\t\t\treturn location; // return location of square\n\t\t}", "public Point getLocation() {\n\t\treturn location.getCopy();\n\t}", "public GridLocation getLocation();", "public Coordinate getLocation();", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location location()\n {\n return myLoc;\n }", "public String getLocation(){\r\n return location;\r\n }", "public Point getLocation() {\n return pos;\n }", "public int getLocY ()\n {\n return locY;\n }", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "@Override\n\tpublic String getLocation() {\n\t\treturn this.location;\n\t}", "String getLocation();", "String getLocation();", "String getLocation();", "public Pixel getPixelLocation() {\n\t\treturn _PixelLocation;\n\t}" ]
[ "0.7384814", "0.72312456", "0.7216091", "0.7154688", "0.7107671", "0.7106168", "0.71050406", "0.71045065", "0.71020865", "0.71012187", "0.7066448", "0.705774", "0.705774", "0.7035144", "0.7031836", "0.70088917", "0.70088917", "0.6993178", "0.69880146", "0.69862694", "0.6981394", "0.6956973", "0.695277", "0.6948002", "0.69391227", "0.6937999", "0.6931463", "0.6922426", "0.69192636", "0.6911539", "0.69113004", "0.69031787", "0.6898998", "0.6898998", "0.6898998", "0.6898998", "0.6898804", "0.68935394", "0.6891037", "0.6891037", "0.6883911", "0.6882309", "0.68806183", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.68759876", "0.6875589", "0.68671227", "0.68658674", "0.68658674", "0.6863201", "0.68579906", "0.6855802", "0.6851306", "0.6851306", "0.6851306", "0.6851306", "0.6851306", "0.6850016", "0.68491244", "0.6843408", "0.6840717", "0.6839535", "0.6838778", "0.68351555", "0.683272", "0.68321425", "0.682607", "0.68045294", "0.67976904", "0.67951256", "0.67951256", "0.67951256", "0.67951256", "0.67911166", "0.6788342", "0.6781228", "0.67794484", "0.6759534", "0.6759534", "0.6759534", "0.6759534", "0.6759534", "0.6759534", "0.6759534", "0.6759534", "0.67555803", "0.6752288", "0.6752288", "0.6752288", "0.6751371" ]
0.80762565
0
getter for world location
public Vector2F getWorldLocation() { return new Vector2F(xPos, yPos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public World getWorld() {\n return location.getWorld();\n }", "public Location getLocation(){\n\t\tWorld w = Bukkit.getWorld(worldName);\n\t\tif(w==null){\n\t\t\tSystem.out.println(\"Error, null world in Location from SQL\");\n\t\t\treturn null;\n\t\t}\n\t\treturn new Location(w, x+0.5, y, z+0.5);\n\t\t\n\t}", "public final World getWorld() {\n\t\treturn location.getWorld();\n\t}", "public HashMap<String, Location> getWorld() {\r\n\t\treturn this.world;\r\n\t}", "public Vector2f getLocation() {\r\n\t\treturn location.getLocation();\r\n\t}", "public final Coord getLocation() {\n return location;\n }", "public Point getLocation() { return loc; }", "public PVector getLoc() {\n return location;\n }", "public PVector getLoc() {\n return location;\n }", "public Location getLocation()\n {\n if (worldData == null || position == null)\n {\n // Must have a world and position to make a location;\n return null;\n }\n\n if (orientation == null)\n {\n return new Location(worldData.getWorld(), position.getX(), position.getY(), position.getZ());\n }\n\n return new Location(worldData.getWorld(), position.getX(), position.getY(), position.getZ(), orientation.getYaw(), orientation.getPitch());\n }", "public double getLocation(){\n\t\treturn location;\n\t}", "public Coordinate getLocation();", "public Location getLocation() {\n return loc;\n }", "public Location getLocation() {\n return loc;\n }", "public PVector getLocation()\n\t{\n\t\treturn location;\n\t}", "public geo_location getLocation() {\n return _pos;\n }", "public World getWorld() {\n return world;\n }", "public World getWorld() {\n return world;\n }", "public Coordinate getLocation() {\n return location;\n }", "public int getLocation()\r\n {\r\n return location;\r\n }", "Location getLocation();", "Location getLocation();", "Location getLocation();", "Location getLocation();", "public int getLocation()\r\n {\n }", "public Location location()\n {\n return myLoc;\n }", "public GameData getWorld() {\r\n return world;\r\n }", "public double[] getLocation()\n\t{\n\t\treturn location;\n\t}", "public World getWorld () {\n\t\treturn world;\n\t}", "public static MapLocation myLocation() {\n return RC.getLocation();\n }", "public World getWorld() {\n\t\treturn world;\n\t}", "public Location getLocation() \n\t{\n\t\treturn location;\n\t}", "@Basic\n\tpublic World getWorld() {\n\t\treturn this.world;\n\t}", "@Basic\n\tpublic World getWorld() {\n\t\treturn this.world;\n\t}", "public Location getLocation() {\n return getLocation(null);\n }", "public Point getLocation() {\n return location;\n }", "public final Point getLocation() {\n return this.location ;\n }", "public Location getLocation() {\n\t\treturn loc;\n\t}", "public World getWorld();", "public SbVec3f getPoint() {\n \t return worldPoint; \n }", "public GridLocation getLocation();", "public Point getLocation() {\n\t\treturn location;\n\t}", "public Point getLocation();", "@NotNull\r\n World getWorld();", "Location getPlayerLocation();", "public static World getWorld() {\n\t\treturn world;\n\t}", "public Point getLocation() {\n\t\treturn location.getCopy();\n\t}", "public FrillLoc getLocation() {\n return MyLocation;\n }", "@Pure\n @NonNull\n public Location getLocation() {\n return this.location;\n }", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "public Location getLocation() {\r\n\t\treturn location;\r\n\t}", "public Location getLocation()\n\t{\n\t\treturn l;\n\t}", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public Location getLocation() {\n return location;\n }", "public String getLocation() {\n\t\treturn \"-12.9990189,-38.5140298\";\n\t}", "public LatLng getLocation() {\n\t\treturn location;\n\t}", "public Location getLocation() {\n\t\treturn location;\n\t}", "public World getWorld()\n {\n if (worldData == null)\n {\n return null;\n }\n\n return worldData.getWorld();\n }", "@Nonnull\n Location getPlayerLocation();", "public Location getLocation(){\n return location;\n }", "public Location getLocation(String name) {\n String world = cfg.getString(name + \".World\");\n double x = cfg.getDouble(name + \".X\");\n double y = cfg.getDouble(name + \".Y\");\n double z = cfg.getDouble(name + \".Z\");\n float yaw = (float) cfg.getDouble(name + \".Yaw\");\n float pitch = (float) cfg.getDouble(name + \".Pitch\");\n\n return new Location(getWorld(name), x, y, z, yaw, pitch);\n }", "@Override\n public geo_location getLocation() {\n return location;\n }", "public World getWorld(String worldName);", "public Vector getWorldPosition(){\n\t\treturn this.absPos;\n\t}", "public Location getLocation() {\n\t\treturn location.clone();\n\t}", "public String getLocation() {\n return mLocation;\n }", "public LatLng getLocation() {\n return location;\n }", "public WotlasLocation getLocation() {\n return this.getBasicChar().getLocation();\n }", "public String getWorld() {\r\n\t\treturn mainSpawn.getWorld().toString();\r\n\t}", "public Vector getLocation();", "@Override\n\tpublic World getWorld() { return world; }", "public String getLocation()\n {\n return location;\n }", "public String getLocation() { return location; }", "public String getLocation() { return location; }", "public String getLocation() {\r\n return location;\r\n }", "double getLongitude();", "public String getLocation() {\r\n return location;\r\n }", "int getLongitude();", "public BwLocation getLocation() {\n if (location == null) {\n location = BwLocation.makeLocation();\n }\n\n return location;\n }", "public int getLon();", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return this.location;\n }", "public TileLocation getLocation() {\n return location;\n }", "public String getLocation() {\n\t\treturn mLocation;\n\t}", "public Location getCurrentLocation();", "World getWorld();", "public String getLocation(){\r\n return location;\r\n }", "public final Location getLocation() {\n\t\treturn location.clone();\n\t}", "public final World getWorld() {\n\t\treturn baseTile.getWorld();\n\t}", "public String getLocation() {\n return this.location;\n }", "public String getLocation() {\n return location;\n }", "public ThingNode getWorld()\n {\n return world;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }", "public String getLocation() {\n return location;\n }" ]
[ "0.82231605", "0.80275977", "0.7996986", "0.7620403", "0.7520297", "0.7452055", "0.7433667", "0.7428227", "0.7428227", "0.7421314", "0.7339166", "0.7268007", "0.7254311", "0.7254311", "0.72472423", "0.7239686", "0.7232304", "0.7232304", "0.72313005", "0.7228514", "0.7226471", "0.7226471", "0.7226471", "0.7226471", "0.72193456", "0.7205551", "0.7201765", "0.7192704", "0.71773696", "0.71753424", "0.7168525", "0.71603715", "0.7149458", "0.7149458", "0.7135153", "0.71328664", "0.7129916", "0.71270096", "0.7123398", "0.7121035", "0.7108479", "0.7095581", "0.7064242", "0.704965", "0.7028244", "0.699587", "0.6993116", "0.69888055", "0.69810635", "0.69802064", "0.69802064", "0.6979856", "0.6977628", "0.6977628", "0.6977628", "0.6977628", "0.6970853", "0.6967152", "0.69496346", "0.6938142", "0.6929066", "0.6896288", "0.68920726", "0.6885551", "0.6879308", "0.6875377", "0.68602663", "0.68591183", "0.6858171", "0.6848633", "0.68478405", "0.6840026", "0.68312645", "0.68301994", "0.6816319", "0.6816319", "0.68151844", "0.68138534", "0.6810421", "0.680581", "0.6802728", "0.68011945", "0.6795671", "0.6795671", "0.6795671", "0.6795671", "0.6795671", "0.6792968", "0.6791933", "0.67898476", "0.6788756", "0.67823327", "0.67809206", "0.6774589", "0.67738247", "0.6764599", "0.6762802", "0.67541933", "0.67541933", "0.67541933" ]
0.7810708
3
on screen not in world
public static double getDistanceOnScreen(Vector2F v1, Vector2F v2) { float vector1 = v1.xPos - v2.xPos; float vector2 = v2.yPos - v2.yPos; return Math.sqrt(vector1 * vector1 + vector2 * vector2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSurfaceWorld()\n {\n return false;\n }", "public boolean isOnscreen( )\r\n {\r\n if ( this.transform.tx( ) + this.width( ) < 0.0f ) return false;\r\n if ( this.transform.tx( ) > SkyDiver.WindowWidth ) return false;\r\n if ( this.transform.ty( ) + this.height( ) < 0.0f ) return false;\r\n if ( this.transform.ty( ) > SkyDiver.WindowHeight ) return false;\r\n\r\n return true;\r\n }", "public boolean isSurfaceWorld() {\n\t\treturn false;\n\t}", "Point onScreen();", "@Override\r\npublic boolean isOnScreen() {\nreturn false;\r\n}", "@Override\n public boolean isInScreen(){\n return this.getX() > App.START_COORDINATE_X - this.getSpriteImage().getWidth() / 2\n && this.getX() < App.SCREEN_WIDTH + this.getSpriteImage().getWidth() / 2;\n }", "void checkCurrentScreen();", "public boolean isOffScreen()\r\n\t{\r\n\t\treturn (getX()<-10&&xVel<0)||(getX()>WIDTH_SCREEN&&xVel>0)||getY()<-10||getY()>HEIGHT_SCREEN;\r\n\t\t\t\r\n\t}", "@Override\n\tpublic void canLand() {\n\t\tSystem.out.println(\"IF IM IN THE SKY, I CANT LAND. BY THE OMNISSIAH\");\n\t}", "private boolean isOnScreen(float x, float y) {\r\n /* I'm not sure if it is necessary to check that the number is greater than 0 */\r\n return ((x < _offScreenCanvas.getWidth()) && (x > 0)) && ((y < _offScreenCanvas.getHeight()) && (y > 0));\r\n }", "public boolean isOnscreen(Rectangle screen) {\n\t\tboolean onscreen = false;\n\t\tonscreen = (screen.contains(NW) || screen.contains(NE) || screen.contains(SW) || screen.contains(SE));\n\t\treturn onscreen;\n\t}", "public boolean offScreen() {\r\n\t\treturn (this.getY() < -TREE_HEIGHT || this.getY() > 1000); \r\n\t}", "public boolean isOnGround() {\n return this.sim_pos.getY() <= 2;\n }", "private final boolean isInsideWorld() {\n\t\t// Check it is inside the world\n\t\tif (x<=0 || y<=0 || x+width>=_world.getWidth() || y+height>=_world.getHeight()) {\n\t\t\tif (_mass == 0 && alive && x == 0 && y == 0)\n\t\t\t\tdie(this);\n\t\t\t// Adjust direction\n\t\t\tif (x <= 0 || x + width >= _world.getWidth())\n\t\t\t\tdx = -dx;\n\t\t\tif (y <= 0 || y + height >= _world.getHeight())\n\t\t\t\tdy = -dy;\n\t\t\tdtheta = 0;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean onScreen(double x, double y) {\n // get the in game coordinates and real coordinates on screen\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n double basex = (map.getWidth() * scaledWidth) / 2.0\n + scaledWidth / 4.0;\n double basey = scaledHeight / 4.0;\n\n //reverse the math logic from the GameRenderer\n double realX = ((y - x) / 2.0) * scaledWidth + currentXOffset + xOffset + basex;\n double realY = ((y + x) / 2.0) * scaledHeight + currentYOffset + yOffset + basey;\n\n return !(realX < -0.1 * viewPortWidth - basex || realX > 1.1 * viewPortWidth + basex ||\n realY < -0.1 * viewPortHeight - basex || realY > 1.1 * viewPortHeight + basey);\n }", "public boolean onGround() {\n return getLocation().getY() <= 0 || (interactingWithY != null && interactingWithY.getLocation().getY() + interactingWithY.size.height <= getLocation().getY());\n }", "public boolean atWorldEdge()\n {\n if(getX() < 20 || getX() > getWorld().getWidth() - 20)\n return true;\n if(getY() < 20 || getY() > getWorld().getHeight() - 20)\n return true;\n else\n return false;\n }", "public boolean atWorldEdge()\n {\n if(getX() < 20 || getX() > getWorld().getWidth() - 20)\n return true;\n if(getY() < 20 || getY() > getWorld().getHeight() - 20)\n return true;\n else\n return false;\n }", "private boolean visible() {\r\n return NOT(GO() && CATS(Cc,Cn,Co,Cs,Zl,Zp)) && POINT();\r\n }", "private boolean isInGameWindow(){\n if (currPos.x > Window.getWidth() || currPos.y > Window.getHeight()){\n return false;\n }\n return true;\n }", "boolean outOfSight();", "boolean land();", "@Override\n public boolean detect() {\n QQRobot.findWindowLocation(RGB_SCREEN);\n if (QQTetris.QQCoord.x != -1) {\n return true;\n } else {\n return false;\n }\n }", "public final boolean isOnScreen() {\n\t\treturn Calculations.isOnScreen(this.getCenterPointOnScreen());\n\t}", "@Override\n public void world() {\n super.world();\n }", "boolean isCanSeeFriendlyInvisibles();", "@Override\n\tpublic boolean isGamePlayScreen () {\n\t\treturn false;\n\t}", "boolean hasWorldid();", "boolean hasWorldid();", "public void land() {\n Game currentGame = this.getGame();\n this.setHasBeenVisited(true);\n currentGame.setMode( Game.Mode.GAME_WON);\n\n }", "public boolean isWall();", "public void makeInvisible()\n {\n wall.makeInvisible();\n roof.makeInvisible();\n window.makeInvisible();\n }", "@Override\n\tpublic boolean isGameTied() {\t\n\t\treturn false;\n\t}", "public boolean checkWorld(Entity entity) {\r\n return entity.getWorld() == worldFrom;\r\n }", "public boolean offscreen(int top, int left, int w, int h) {\r\n return this.getPosx() + this.bound < left\r\n || this.getPosx() - this.bound > left + w\r\n || this.getPosy() + this.bound < top\r\n || this.getPosy() - this.bound > top + h;\r\n }", "public boolean isCrossWorldActivationAllowed() {\n return getConfig().getBoolean(\"teleportal.cross-world\", true);\n }", "@Override\n public boolean isTileFriendly(){\n return false;\n }", "public static boolean locationOnScreen(int id) {\n\t\tfor(SceneObject loc1 : SceneEntities.getLoaded())\n\t\t\tif(loc1.getId()==id)\n\t\t\t\treturn SceneEntities.getNearest(id).isOnScreen();\n\t\treturn false;\n\t}", "public boolean onScreen(Entity entity) {\n\n if (entity.getXLength() == 1 && entity.getYLength() == 1 && Math.abs(entity.getElevation()) == 0) {\n return onScreen(entity.getX(), entity.getY());\n }\n\n //reverse the math logic from the GameRenderer\n for (int i = 0; i < entity.getXLength(); i++) {\n if (onScreen(entity.getX() - i, entity.getY())) {\n return true;\n }\n }\n\n for (int j = 0; j < entity.getYLength(); j++) {\n if (onScreen(entity.getX(), entity.getY() - j)) {\n return true;\n }\n }\n\n if (onScreen(entity.getX() - entity.getElevation(), entity.getY() - entity.getElevation())) {\n return true;\n }\n\n if (entity instanceof AbstractScenery) {\n double height = ((AbstractScenery) entity).getSceneryType().getHeight();\n if (onScreen(entity.getX() - entity.getElevation() - height,\n entity.getY() - entity.getElevation() - height)) {\n return true;\n }\n }\n\n return false;\n\n }", "private void inAvanti() {\n\t\tif (Game.getInstance().isOnGround) {\n\t\t\tjump=false;\n\t\t\tGame.getInstance().getPersonaggio().setStato(Protagonista.RUN);\n\t\t\tGraficaProtagonista.getInstance().cambiaAnimazioni(Protagonista.RUN);\n\t\t}\n\t}", "public boolean isInThing(Graphics2D g, CoordinateMapper cm, int worldX, int worldY){\n\t\treturn false;\n/*\n\t\treturn((worldX >= t.getX1()) &&\n\t\t\t(worldX <= t.getX2()) &&\n\t\t\t(worldY >= t.getY1()) &&\n\t\t\t(worldY <= t.getY2()));\n\t\t\t*/\n\t}", "@Override\n public boolean activate() {\n //When will this activate?\n return Areas.FALADOR.contains(ctx.players.local().tile())\n && ctx.widgets.component(1371,0).visible()\n && !ctx.objects.select().name(\"Waterpump\").within(6.0).isEmpty();\n }", "public boolean canTravelFromWorld(Player p, MultiverseWorld w) {\n List<String> blackList = w.getWorldBlacklist();\n \n boolean returnValue = true;\n \n for (String s : blackList) {\n if (s.equalsIgnoreCase(p.getWorld().getName())) {\n returnValue = false;\n break;\n }\n }\n \n return returnValue;\n }", "private boolean gameOver() {\r\n\t\treturn (lifeBar == null || mehran == null);\r\n\t}", "public void checkCubeInRobot() {\n\t\tRobotMap.pinThree.set(!RobotMap.cubeInRobot.get());\n\t}", "private boolean seesWall() {\n\t\treturn getFilteredData() <= WALL_DIST;\n\t}", "public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }", "@Override\n\tpublic void show () {\n overWorld = new Sprite(new TextureRegion(new Texture(Gdx.files.internal(\"Screens/overworldscreen.png\"))));\n overWorld.setPosition(0, 0);\n batch = new SpriteBatch();\n batch.getProjectionMatrix().setToOrtho2D(0, 0, 320, 340);\n\n // Creates the indicator and sets it to the position of the first grid item.\n indicator = new MapIndicator(screen.miscAtlases.get(2));\n // Creates the icon of Daur that indicates his position.\n icon = new DaurIcon(screen.miscAtlases.get(2));\n // Sets the mask position to zero, as this screen does not lie on the coordinate plane of any tiled map.\n screen.mask.setPosition(0, 0);\n screen.mask.setSize(320, 340);\n Gdx.input.setInputProcessor(inputProcessor);\n\n // Creates all relevant text.\n createText();\n // Sets numX and numY to the position of Daur on the map.\n numX = storage.cellX;\n numY = storage.cellY;\n indicator.setPosition(numX * 20, numY * 20 + 19);\n // Sets the icon to the center of this cell.\n icon.setPosition(numX * 20 + 10 - icon.getWidth() / 2, numY * 20 + 29 - icon.getHeight() / 2);\n // Creates all the gray squares necessary.\n createGraySquares();\n }", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "boolean isInsideScreen() {\n if (_hitbox.length == 1) {\n float r = _hitbox[0].x;\n PVector c = _getCenter();\n return 0 <= c.x + r && c.x - r < width && 0 <= c.y + r && c.y - r < height;\n }\n \n PVector[] points = this._getPoints();\n for(PVector p : points) {\n if(0 <= p.x && p.x < width && 0 <= p.y && p.y < height) {\n return true;\n }\n }\n return false;\n }", "public boolean getCanSpawnHere()\r\n {\r\n return false;\r\n }", "public boolean getCanSpawnHere()\n {\n return this.isValidLightLevel() && super.getCanSpawnHere();\n }", "public boolean isGround()\n {\n return true;\n }", "public boolean isLanding() {\n\t\treturn isLanding;\n\t}", "@Override\n public boolean active() {\n General.sleep(100); // Sleep to reduce CPU usage.\n return fishing_spots[0].isOnScreen();\n }", "public void currentWorld(WumpusWorld world) throws RemoteException {\n\t\twidth = world.getWidth();\n\t\theight = world.getHeight();\n\t\tif (frame == null) {\n\t\t\tframe = new Frame();\n\t\t\tframe.addWindowListener(new WindowAdapter() {\n\t\t\t\tpublic void windowClosing(WindowEvent evt) {\n\t\t\t\t\tframe.dispose();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t});\n\t\t\tframe.setTitle(\"The Wumpus Monitor\");\n\t\t\tframe.setLayout(new GridLayout(width * 2, height * 2));\n\t\t\tDimension d = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\tframe.setBounds(0, 0, d.width - 1, d.height - 1);\n\t\t} else {\n\t\t\tframe.removeAll();\n\t\t}\n\t\trooms = new DirectionalPanel[width][height][8];\n\t\tfor (int row = 0; row < width; row++) {\n\t\t\tfor (int col = 0; col < height; col++) {\n\t\t\t\trooms[row][col][0] = new DirectionalPanel(-1,\n\t\t\t\t\t\t\t\t\t\tImagePanel.NORTH | ImagePanel.WEST);\n\t\t\t\trooms[row][col][1] = new DirectionalPanel(-1,\n\t\t\t\t\t\t\t\t\t\tImagePanel.NORTH | ImagePanel.EAST);\n\t\t\t\trooms[row][col][2] = new DirectionalPanel(-1,\n\t\t\t\t\t\t\t\t\t\tImagePanel.SOUTH | ImagePanel.WEST);\n\t\t\t\trooms[row][col][3] = new DirectionalPanel(-1,\n\t\t\t\t\t\t\t\t\t\tImagePanel.SOUTH | ImagePanel.EAST);\n\t\t\t\tfor (int k = 4; k < 8; k++) {\n\t\t\t\t\trooms[row][col][k] = new DirectionalPanel(-1);\n\t\t\t\t}\n\t\t\t\tagentPositions.put(new Point(row, col), new HashSet());\n\t\t\t}\n\t\t}\n\t\tfor (int row = 0; row < world.getWidth(); row++) {\n\t\t\tfor (int turn = 0; turn < 2; turn++) {\n\t\t\t\tfor (int col = 0; col < world.getHeight(); col++) {\n\t\t\t\t\tframe.add(rooms[height - row - 1][col][2*turn]);\n\t\t\t\t\tframe.add(rooms[height - row - 1][col][2*turn + 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int row = 0; row < width; row++) {\n\t\t\tfor (int col = 0; col < height; col++) {\n\t\t\t\tRoom room = world.getRoom(row, col);\n\t\t\t\tif (room.getPit()) {\n\t\t\t\t\taddImage(row, col, PIT_FILE, PIT_FILE);\n\t\t\t\t}\n\t\t\t\tif (room.getGold()) {\n\t\t\t\t\taddImage(row, col, GOLD_FILE, GOLD_FILE);\n\t\t\t\t}\n\t\t\t\tWumpus w = room.getWumpus();\n\t\t\t\tif (w != null) {\n\t\t\t\t\taddImage(row, col, w.getName(), WUMPUS_FILE);\n\t\t\t\t\tsetDirection(row, col, w.getName(), w.getDirection());\n\t\t\t\t\tPoint pos = new Point(w.getRow(), w.getColumn());\n\t\t\t\t\tagents.put(w.getName(), pos);\n\t\t\t\t\tSet s = (Set) agentPositions.get(pos);\n\t\t\t\t\ts.add(w);\n\t\t\t\t\tcheckStench(row + 1, col - 1, row - 1, col + 1);\n\t\t\t\t}\n\t\t\t\tSet explorers = room.getExplorers();\n\t\t\t\tfor (Iterator it = explorers.iterator(); it.hasNext(); ) {\n\t\t\t\t\tExplorer e = (Explorer) it.next();\n\t\t\t\t\taddImage(row, col, e.getName(), EXPLORER_FILE);\n\t\t\t\t\tsetDirection(row, col, e.getName(), e.getDirection());\n\t\t\t\t\tPoint pos = new Point(e.getRow(), e.getColumn());\n\t\t\t\t\tagents.put(e.getName(), pos);\n\t\t\t\t\tSet s = (Set) agentPositions.get(pos);\n\t\t\t\t\ts.add(e);\n\t\t\t\t}\n\t\t\t\tboolean breeze = false;\n\t\t\t\tif (row > 0 && world.getRoom(row - 1, col).getPit()) {\n\t\t\t\t\tbreeze = true;\n\t\t\t\t} else if (row < world.getWidth() - 1 &&\n\t\t\t\t\t\t\t\t\tworld.getRoom(row + 1, col).getPit()) {\n\t\t\t\t\tbreeze = true;\n\t\t\t\t} else if (col > 0 && world.getRoom(row, col - 1).getPit()) {\n\t\t\t\t\tbreeze = true;\n\t\t\t\t} else if (col < world.getHeight() - 1 &&\n\t\t\t\t\t\t\t\t\tworld.getRoom(row, col + 1).getPit()) {\n\t\t\t\t\tbreeze = true;\n\t\t\t\t}\n\t\t\t\tif (breeze) {\n\t\t\t\t\taddImage(row, col, BREEZE_FILE, BREEZE_FILE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tframe.show();\n\t\tthis.enabled = true;\n\t}", "public boolean isInViewport(ObjectWithPosition obj){\n Point viewPoint = convertToViewCoordinates(obj.xCoordinate,obj.yCoordinate);\n if(viewPoint.getX() > 0 && viewPoint.getX() < 1024){\n if(viewPoint.getY() > 0 && viewPoint.getY() < 528){\n return true;\n }\n else return false;\n }\n else return false;\n }", "@Override\n public void onScreenStatus(boolean isAs) {\n }", "public boolean isVisible() {\r\n return !((x + width) < ocean.getXmin() || x > ocean.getXmax() || (y + height) < ocean.getYmin()\r\n || y > ocean.getYmax());\r\n }", "protected boolean isStayingOnGroundSurface() {\n/* 342 */ return isShiftKeyDown();\n/* */ }", "public void onWorldChanged(World world);", "public OverWorld()\n { \n // Create a new world with 800x600 cells with a cell size of 1x1 pixels.\n super(1024, 600, 1, false);\n Setup();\n }", "private boolean isScreenFull(){\n for(int i = 0; i < mPixelX.length; i++){\n if(i % 10 == 0 && mPixelX[i] == 0){\n return false;\n }\n }\n for(int i = 0; i < mPixelY.length; i++){\n if(i % 10 == 0 && mPixelY[i] == 0){\n return false;\n }\n }\n return true;\n }", "@Model\n private boolean isValidSuperWorld(World world){\n \t return (world == null || !world.isTerminatedWorld());\n }", "public boolean isShooting()\r\n\t{\r\n\t\treturn false;\r\n\t}", "boolean safeToRun() {\n return game.i != null;\n }", "public void isStillInCombat() {\n isInCombat = enemiesInCombat.size() > 0;\n }", "boolean UnlockedEscapeTheIsland() {\n if (allMissions.missionStatus.get(\"Escape the island\") == true) {\n return false;\n }\n return true;\n }", "public boolean checkNorth(HashMap<Coordinate,MapTile> currentView){\n\t\t\tCoordinate currentPosition = new Coordinate(getPosition());\n\t\t\tfor(int i = 0; i <= wallSensitivity; i++){\n\t\t\t\tMapTile tile = currentView.get(new Coordinate(currentPosition.x, currentPosition.y+i));\n\t\t\t\tif(tile.isType(MapTile.Type.WALL)){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}", "public boolean checkNorth(HashMap<Coordinate,MapTile> currentView){\n\t\tCoordinate currentPosition = new Coordinate(getPosition());\n\t\tfor(int i = 0; i <= wallSensitivity; i++){\n\t\t\tMapTile tile = currentView.get(new Coordinate(currentPosition.x, currentPosition.y+i));\n\t\t\tif(tile.isType(MapTile.Type.WALL)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isGround() {\n\t return this != WALL && this != BOUNDS;\n\t}", "private boolean isInCanvas() {\n\t\tif ((sens.getXPos() >= sens.getXMax()) || (sens.getYPos() >= sens.getYMax()) || (sens.getXPos() < 0) || (sens.getYPos() < 0)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean isInCanvas() {\n\t\tif ((sens.getXPos() >= sens.getXMax()) || (sens.getYPos() >= sens.getYMax()) || (sens.getXPos() < 0) || (sens.getYPos() < 0)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\r\npublic void setOnScreen(boolean os) {\n}", "public boolean land() {\n\t\treturn (Math.random() > this.crashProb);\r\n\t}", "synchronized boolean go() {\n boolean retVal = false;\n if (!isVisible()) {\n retVal = true;\n //System.out.println(\"Tumbleweed.go-->not visible\");\n myJumpedOver = false;\n setVisible(true);\n // set the tumbleweed's position to the point\n // where it just barely appears on the screen\n // to that it can start approaching the cowboy:\n if (myLeft) {\n setRefPixelPosition(myCurrentRightBound, myY);\n move(-1, 0);\n } else {\n setRefPixelPosition(myCurrentLeftBound, myY);\n move(1, 0);\n }\n } else {\n //System.out.println(\"Tumbleweed.go-->visible\");\n }\n return (retVal);\n }", "public boolean isOnLand() {\r\n\t\treturn isOnLand;\r\n\t}", "@Override\n\tpublic void show() {\n\t\tworld = new Worlds();\n\t\trenderer = new WorldRenderer(world, false);\n\t\tcontroller = new WorldController(world);\n\t\tGdx.input.setInputProcessor(this);\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic boolean canSeeNemesisRobot() {\n\t\tboolean isVisible= false;\n\t\tList<Wall> walls = (List<Wall>) (List<?>) getEngine()\n\t\t\t\t.requestSimObject(simo -> (simo instanceof Wall) && (((Wall) simo).getType() == 2||((Wall) simo).getType() == 3));\n\t\tList<Bounds> bounds = new ArrayList<Bounds>();\n\t\tfor (Wall w : walls) {\n\t\t\tbounds.addAll(w.getBounds());\n\t\t}\n\n\t\t\n\t\tRobot bad = null;\n\t\tList<Robot> objets = (List<Robot>) (List<?>) getEngine().requestSimObject(simo -> (simo instanceof Robot) && (simo != getParent()));\n\n\t\tif (objets.size() == 1) {\n\t\t\tbad = objets.get(0);\n\t\t\t\n\t\t\t//on cr�e donc un cylindre entre les deux positions\n\t\t\t//on pourra afficher le cylindre dans la vue 3D\n\t\t\tCylinder lineOfSight = BorderAndPathGenerator.generateCylinderBetween(bad.getPosition(), Util.rectifi(positionR()));\n\t\t\tlineOfSight.setMaterial(new PhongMaterial(Color.AQUA));\n\n\t\t\t//le robot gentil ne peut pas voire le mauvais robot à plus de 15m \n\t\t\tif(lineOfSight.getHeight() < 10){\n\t\t\t\t\n\t\t\t\tisVisible = BorderAndPathGenerator.intervisibilityBetween(bad.getPosition(), Util.rectifi(positionR()),bounds);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn isVisible;\n\t\t} else\n\t\t\treturn false;\n\n\t}", "@Override\n public void afterWorldInit() {\n }", "public void showLobby() {\n \t\tgameMain.showScreen(lobby);\n \t}", "public UIMainWorld()\n { \n super(600, 400, 1); \n startScreen();\n }", "public boolean isOutsidePlatform(GameObject object, Platform platform, GameObject gameObject2){\n if ( (object.isAirborne()) //if already airborne, it is still airborne (until it is belowPlatform\n || (object.getPos().getY()==platform.getY())\n && ((object.getPos().getX()<platform.getX()-object.getWidth()) //Outside to the left\n || (platform.getX()+platform.getWidth()<object.getPos().getX())) //Outside te the right\n && !(hasCollided(object,gameObject2)) \n || (object.getPos().getY()>720) //if object over screen its probably in air\n ){ //\n return true;\n } else {\n return false;\n }\n }", "private boolean birdIsOffscreen() {\r\n return (bird.getYpos() + bird.getRadius() < 0) ||\r\n (bird.getXpos() + bird.getRadius() < 0) ||\r\n (bird.getXpos() - bird.getRadius() > width);\r\n }", "public void win()\r\n {\n Actor win;\r\n win=getOneObjectAtOffset(0,0,Goal.class);\r\n if (win !=null)\r\n {\r\n World myWorld=getWorld();\r\n Congrats cong=new Congrats();\r\n myWorld.addObject(cong,myWorld.getWidth()/2,myWorld.getHeight()/2); //(Greenfoot,2013) \r\n \r\n Greenfoot.stop();\r\n Greenfoot.playSound(\"finish.wav\"); //(Sound-Ideas,2014)\r\n \r\n }\r\n }", "boolean isGameSpedUp();", "public abstract void onLand(Player player);", "private boolean atLeastOneNonWallLocation() {\n\t\tfor (int x = 0; x < this.map.getMapWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.map.getMapHeight(); y++) {\n\n\t\t\t\tif (this.map.getMapCell(new Location(x, y)).isWalkable()) {\n\t\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "protected boolean hasGameStarted() {\r\n return super.hasGameStarted();\r\n }", "@NotNull\n boolean isTrustedWholeLand();", "@Override\n public boolean atFriendlyBase() {\n return gameMap.isLocationBase(side, reference);\n }", "public OverworldScreen(Game game) {\n super(\"OverworldScreen\", game);\n\n mScreenViewport = new ScreenViewport(0, 0, mGame.getScreenWidth(),\n mGame.getScreenHeight());\n if (mScreenViewport.width > mScreenViewport.height)\n mLayerViewport = new LayerViewport(240.0f, 240.0f\n * mScreenViewport.height / mScreenViewport.width, 240,\n 240.0f * mScreenViewport.height / mScreenViewport.width);\n else\n mLayerViewport = new LayerViewport(240.0f * mScreenViewport.height\n / mScreenViewport.width, 240.0f, 240.0f\n * mScreenViewport.height / mScreenViewport.width, 240);\n\n // Load in the bitmaps used on the main menu screen\n AssetStore assetManager = mGame.getAssetManager();\n\n\n assetManager.loadAndAddBitmap(\"LocationArrow\", \"img/LocationArrow.png\");\n assetManager.loadAndAddBitmap(\"OverworldMap\", \"img/OverworldMap.png\");\n\n // Define the spacing that will be used to position the buttons\n int spacingX = game.getScreenWidth() / 5;\n int spacingY = game.getScreenHeight() / 3;\n\n mOverworldMap = new GameObject(LEVEL_WIDTH / 2.0f,\n LEVEL_HEIGHT / 2.0f, LEVEL_WIDTH, LEVEL_HEIGHT, getGame()\n .getAssetManager().getBitmap(\"OverworldMap\"), this);\n\n // Create the trigger buttons\n mLocationButton = new PushButton(\n spacingX * 1.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton1 = new PushButton(\n spacingX * 2.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton2 = new PushButton(\n spacingX * 3.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton3 = new PushButton(\n spacingX * 4.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n mLocationButton4 = new PushButton(\n spacingX * 5.0f, spacingY * 1.5f, spacingX*.16f, spacingY*0.1f, \"LocationArrow\", this);\n\n\n }", "public void updateScreen() {\r\n\t\tsuper.updateScreen();\r\n\r\n\t\tif (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) {\r\n\t\t\tthis.mc.thePlayer.closeScreen();\r\n\t\t}\r\n\t}", "@Raw\n\tpublic boolean canHaveAsWorld(World world) {\n\t\tif (world != null && (getXCoordinate() > world.getWidth() || getYCoordinate() > world.getHeight()))\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean withinWorld(int x, int y) {\n\t\treturn x >= 0 && x < MAX_WIDTH && y >= 0 && y < MAX_HEIGHT;\n\t}", "public default boolean activeFromObject(SpellData dataIn, World worldIn){ return getRangeType() != RangeType.PERSONAL; }", "@Override\n public boolean isLocationEmpty(Unit unit, int x, int y)\n {\n Unit resident = master.getLocation(x, y).getResident();\n // if there's nothing there, yeah...\n if (resident == null)\n return true;\n // say it's not there if we dunno it's there\n if (resident.model.hidden && !confirmedVisibles.contains(resident)) \n return true;\n // otherwise, consult the fog map and master map\n return isLocationFogged(x, y) || master.isLocationEmpty(unit, x, y);\n }", "public boolean isDropped(){\r\n\t\treturn getDirectHolder() == World.world;\r\n\t}" ]
[ "0.6943547", "0.69248235", "0.67614764", "0.65683377", "0.64717865", "0.6433857", "0.6396018", "0.6368049", "0.6364466", "0.6353017", "0.63472885", "0.6340626", "0.6335178", "0.6320418", "0.631841", "0.63057554", "0.6300734", "0.6300734", "0.627571", "0.625473", "0.6246357", "0.6245445", "0.6242134", "0.61886775", "0.6168216", "0.61519086", "0.614368", "0.6143093", "0.6143093", "0.61414385", "0.60845214", "0.60818946", "0.6043176", "0.60346437", "0.6017436", "0.597436", "0.59664166", "0.5953204", "0.5941047", "0.593681", "0.5925176", "0.59237504", "0.59219724", "0.5878137", "0.5861519", "0.5858295", "0.5853996", "0.5846323", "0.5831434", "0.58244246", "0.5821446", "0.57919884", "0.5789541", "0.57846534", "0.57791936", "0.5776622", "0.5776302", "0.5770877", "0.5756421", "0.575563", "0.5751145", "0.5749495", "0.5745771", "0.5744486", "0.5740558", "0.57378834", "0.5734908", "0.572895", "0.5725214", "0.57161176", "0.571222", "0.5710046", "0.5708355", "0.5701927", "0.57002133", "0.57002133", "0.569919", "0.5695137", "0.5691277", "0.56870526", "0.5681913", "0.5679645", "0.567598", "0.56699157", "0.5666179", "0.56641406", "0.5664026", "0.5662698", "0.5661643", "0.56602955", "0.56571484", "0.5649024", "0.5648498", "0.56444573", "0.564414", "0.5639825", "0.5639216", "0.56355894", "0.5632175", "0.56312937", "0.56244373" ]
0.0
-1
get distance in the world location
public double getDistanceBetweenWorldVectors(Vector2F v) { float dX = Math.abs(getWorldLocation().xPos - v.getWorldLocation().xPos); float dY = Math.abs(getWorldLocation().yPos - v.getWorldLocation().yPos); return Math.abs(dX * dX - dY * dY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getDistance();", "double getDistanceInMiles();", "public float getDistance();", "public double getDistance() {\n\n final int R = 6371; // Radius of the earth\n double lat1 = latitude;\n double lon1 = longitude;\n double lat2 = 41.917715; //lat2, lon2 is location of St.Charles, IL\n double lon2 = -88.266027;\n double el1=0,el2 = 0;\n double latDistance = Math.toRadians(lat2 - lat1);\n double lonDistance = Math.toRadians(lon2 - lon1);\n double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))\n * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = R * c * 1000; // convert to meters\n\n double height = el1 - el2;\n\n distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\n return Math.sqrt(distance);\n }", "private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "public Vector3D getDistance()\n\t{\n\t\treturn distance;\n\t}", "public double getDistance(){\n\t\treturn this.distance;\n\t}", "public double distanceTo(MC_Location loc)\n\t {\n\t\t // If dimensions are different, instead of throwing an exception just treat different dimensions as 'very far away'\n\t\t if(loc.dimension != dimension) return Double.MAX_VALUE/2; // don't need full max value so reducing so no basic caller wrap-around.\n\t\t \n\t\t // Pythagoras...\n\t\t double dx = x - loc.x;\n\t\t double dy = y - loc.y;\n\t\t double dz = z - loc.z;\n\t\t return Math.sqrt(dx*dx + dy*dy + dz*dz);\n\t }", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "public double getDistance() {\n return distance;\n }", "public final float getDistance() {\n return distance;\n }", "public double getDistance () {\n return distance;\n }", "public double getDistance() {\n\t\treturn distance;\n\t}", "public double getDistance() {\n\t\treturn distance;\n\t}", "public double getDistance() {\n\t\t// miles = miles/hr * s / (s/hr)\n\t\treturn (double)speed/10.0 * duration / 3600.0;\n\t}", "double distance (double px, double py);", "public double getDistance() {\r\n return this.distance;\r\n }", "public float getDistance() {\n return distance;\n }", "public double getDistance() {\n return this.distance;\n }", "public Distance getDistance() {\n return distance;\n }", "public float getDistance() {\r\n return distance;\r\n }", "public int getDistance() {\n return distance;\n }", "public int getDistance() {\n return distance;\n }", "public float getDistance() {\n return distance;\n }", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public int getDistance() {\r\n\t\treturn distance;\r\n\t}", "public int getDistance() {\r\n\t\treturn distance;\r\n\t}", "public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}", "public double getDist() {\n return distance;\n }", "public int distance() {\n return distance;\n }", "public double distance() {\n return distance;\n }", "public double distance() {\n return distance;\n }", "public int getDistance() {\n\t\treturn distance;\n\t}", "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t\t, 2 )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "public Dimension2D getDistance() {\n\t\treturn distance;\n\t}", "public float getDistanceFromBirth() {\n double dx = location.x - birthLocation.x;\n double dy = location.y - birthLocation.y;\n return (float) Math.sqrt(dx * dx + dy * dy);\n }", "public double getDistance()\n {\n return Math.abs(getDifference());\n }", "public double calculateDistance(MapLocation a, MapLocation b) {\r\n\t\treturn Math.sqrt((double) ( Math.pow((b.x - a.x),2) + Math.pow((b.y - a.y),2) ));\r\n\t}", "public double ComputeDistance(){ \n\t\tdouble lat1 = this.depAirportCity.getLatDegs() + (double)(this.depAirportCity.getLatMins())/60; \n\t\tdouble lon1 = this.depAirportCity.getLongDegs() + (double)(this.depAirportCity.getLongMins())/60;\n\t\tdouble lat2 = this.arrAirportCity.getLatDegs() + (double)(this.arrAirportCity.getLatMins())/60; \n\t\tdouble lon2 = this.arrAirportCity.getLongDegs() + (double)(this.arrAirportCity.getLongMins())/60;\n\t\t\n\t\tdouble distance = Haversine.getMiles(lat1, lon1, lat2, lon2);\n\t\treturn distance;\n\t}", "public int getDistance(){\n if (distance == 0) {\n int tourDistance = 0;\n // Loop through our tour's cities\n for (int cityIndex=0; cityIndex < tourSize(); cityIndex++) {\n // Get city we're travelling from\n City fromCity = getCity(cityIndex);\n // City we're travelling to\n City destinationCity;\n // Check we're not on our tour's last city, if we are set our \n // tour's final destination city to our starting city\n if(cityIndex+1 < tourSize()){\n destinationCity = getCity(cityIndex+1);\n }\n else{\n destinationCity = getCity(0);\n }\n // Get the distance between the two cities\n tourDistance += fromCity.distanceTo(destinationCity);\n }\n distance = tourDistance;\n }\n return distance;\n }", "public double getDistanceTo(Location location) {\n return LocationDistanceCalculator.calculateDistanceBetween(this, location);\n }", "public float getDistance() {\n shouldUpdateDistance = true;\n if (shouldUpdateDistance) {\n distance = getDistance(createSuggestedWindowFilter());\n shouldUpdateDistance = false;\n }\n return distance;\n }", "public double getDistanceMoyenne() {\n\t\treturn getDistanceTotale () / 12;\n\t}", "public int distance(Coord coord1, Coord coord2);", "double distance() {\r\n\t double dist_total = 0;\r\n\t for (int i = 0; i < index.length - 1; i++) {\r\n\t dist_total += city(i).distance(city(i + 1));\r\n\t }\r\n\t \r\n\t return dist_total;\r\n\t}", "public static int dist(Location loc1, Location loc2)\n\t{\n\t\treturn Math.abs(loc1.x - loc2.x) + Math.abs(loc1.y - loc2.y);\n\t}", "public float getDistance(){\n\t\t\treturn s1.start.supportFinal.dot(normal);\n\t\t}", "public double distance(double x, double y);", "public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}", "public double distance() {\n \tif (dist == -1) {\n \t\tdist = distance(vertex1, vertex2);\n \t}\n \n \treturn dist;\n }", "public double distance(){\n return DistanceTraveled;\n }", "public static double distance(double latitude,double longitude,double latitude2,double longitude2){\n\n \t double deltalat = Math.toRadians(latitude2 - latitude);\n \t double deltalog = Math.toRadians(longitude2 - longitude);\n\n \t double a = Math.pow(Math.sin(deltalat/2),2) +\n \t\t\t\t Math.pow(Math.sin(deltalog/2),2) *\n \t\t\t\t Math.cos(latitude) *\n \t\t\t\t Math.cos(latitude2);\n \t double c = 2 * Math.asin(Math.sqrt(a));\n\n \t return EARTH_RADIUS * c;\n\n }", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "private float getDistance(SXRNode object)\n {\n float x = object.getTransform().getPositionX();\n float y = object.getTransform().getPositionY();\n float z = object.getTransform().getPositionZ();\n return (float) Math.sqrt(x * x + y * y + z * z);\n }", "@Override\r\n public double getOriginDistance()\r\n {\r\n double distance=Math.sqrt(\r\n Math.pow(origin.getYCoordinate(), 2)+Math.pow(origin.getYCoordinate(), 2));\r\n return distance;\r\n }", "public int getTotalDistance() {\n return totalDistance;\n }", "double getDistance(int i, int j){\r\n\tdouble d = (coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0])+ (coord[i][1]-coord[j][1])*(coord[i][1]-coord[j][1]);\r\n\td = Math.sqrt(d);\r\n\treturn d;\r\n}", "public double calculateDistance(LatLng other) {\n return Math.sqrt( (this.x - other.x) * (this.x - other.x) + (this.y - other.y) * (this.y - other.y) );\n }", "public double calcDistance(Planet p){\n double sq_dis = (xxPos - p.xxPos) * (xxPos - p.xxPos) + (yyPos - p.yyPos) * (yyPos - p.yyPos);\n double distance = Math.sqrt(sq_dis);\n return distance;\n }", "public void getDistance() {\n projDistance = 2 * sin(toRadians(launchAngle)) * getVelocity() / 9.8 * cos(toRadians(launchAngle)) * getVelocity();\n }", "public int getDistance(Location otherLocation, Location location) {\n return (Math.abs(location.getX() - otherLocation.getX()) + Math.abs(location.getY() - otherLocation.getY()));\n }", "public double getDistanceFromSource()\n {\n return distanceFromSource;\n }", "public static int distance(Location l1, Location l2) {\r\n\t\treturn (int) (Math.pow((l1.getX() - l2.getX()), 2) + Math.pow((l1.getY() - l2.getY()), 2) + Math.pow((l1.getZ() - l2.getZ()), 2));\r\n\t}", "double findDistance(City city){\n int findX_Distance = Math.abs(getX_coordinate() - city.getX_coordinate());\n int findY_Distance = Math.abs(getY_coordinate() - city.getY_coordinate());\n double result = Math.sqrt( (findX_Distance*findX_Distance) + (findY_Distance*findY_Distance) );\n\n return result;\n }", "public double getDistanceTotale() {\n\t\treturn distanceTotale;\n\t}", "public abstract double distanceFrom(double x, double y);", "double getDistance(Point p);", "public double calcDistance(Planet p){\n\t\treturn(Math.sqrt((this.xxPos-p.xxPos)*(this.xxPos-p.xxPos)\n\t\t\t+(this.yyPos-p.yyPos)*(this.yyPos-p.yyPos)));\n\t}", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public double calcDistance(Planet p){\n\t\tdouble dx = p.xxPos - this.xxPos;\n\t\tdouble dy = p.yyPos - this.yyPos ;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\n\t}", "@JsonIgnore public Distance getFlightDistanceDistance() {\n return (Distance) getValue(\"flightDistance\");\n }", "public double getDistanceToTarget() {\n if (!Config.isVisionInstalled) {\n return 0;\n }\n double distanceToVisionTarget =\n Config.visionDistanceConstant * (Config.fieldVisionTargetHeight-Config.limelightMountingHeight) /\n Math.tan(Math.toRadians(limelight.getTy() + Config.limelightMountingAngle));\n\n //now we can convert the new values into a new distance\n return distanceToVisionTarget;\n }", "long calcDist(int x, int y) {\n\tWeatherDisplay wd = main.getDisplay();\n\tx = wd.getWeatherX(x);\n\ty = wd.getWeatherY(y);\n\tint w = wd.getWeatherWidth();\n\tint h = wd.getWeatherHeight();\n\n\tlong ret = -1;\n\t// Point must be in bounds\n\tif (x >= 0 && y >= 0 && x <= w && y <= h) {\n\t int dy = (front + back) * y / h - back;\n\t int dx = (int)(x - w * (getDate() % main.DAY) / main.DAY);\n\n\t // This may return negative\n\t ret = (long)(dy * main.DAY + dx * main.DAY / w);\n\t}\n\n\t// Show distance\n\tif (ret > 0)\n\t main.bDist.setText(\"Distance: \" + Data.stringTime(ret));\n\telse\n\t main.bDist.setText(\"Distance: --:--\");\n\n\treturn ret;\n }", "public double calcDistance(Planet p){\n\t\tdouble dx=-(xxPos-p.xxPos);\n\t\tdouble dy=-(yyPos-p.yyPos);\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "public float getDistance()\n {\n return distance_slider.getValue() / DISTANCE_SCALE_FACTOR;\n }", "public static double distance(double lat1, double lon1, double lat2, double lon2) {\n\n\n float[] dist = new float[1];\n Location.distanceBetween(lat1, lon1, lat2, lon2, dist);\n //Log.d(\"*******dist\", \":\" + dist[0]);\n return (dist[0]);\n //\n // double theta = lon1 - lon2;\n // double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2))\n // + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n // * Math.cos(deg2rad(theta));\n // dist = Math.acos(dist);\n // dist = rad2deg(dist);\n // dist = dist * 60; // 60 nautical miles per degree of seperation\n // dist = dist * 1852; // 1852 meters per nautical mile\n // return (dist);\n //\n }", "private double distance(double lat1, double lon1, double lat2, double lon2) {\n double theta = lon1 - lon2;\r\n double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));\r\n dist = Math.acos(dist);\r\n dist = rad2deg(dist);\r\n dist = dist * 60 * 1.1515;\r\n dist = dist * 1.609344;\r\n return (dist); // return distance in kilometers\r\n }", "public int getTotDistance(){\r\n\t \treturn this.totDistance;\r\n\t }", "public double calcDistance(Planet p){\n\t\t\tdouble dx = this.xxPos - p.xxPos;\n\t\t\tdouble dy = this.yyPos - p.yyPos;\n\t\treturn Math.sqrt(dx*dx + dy*dy);\n\t}", "private Integer getDistance(double lat1, double lon1, double lat2, double lon2) {\n Location locationA = new Location(\"Source\");\n locationA.setLatitude(lat1);\n locationA.setLongitude(lon1);\n Location locationB = new Location(\"Destination\");\n locationB.setLatitude(lat2);\n locationB.setLongitude(lon2);\n distance = Math.round(locationA.distanceTo(locationB));\n return distance;\n }", "public double calcDistBetweenStops(){\n List<Location> locs = destinations.getLocationList();\r\n double totalDist = 0;\r\n for (int i = 0; i < (locs.size() - 1); i++){\r\n double distance = locs.get(i).DistanceTo(locs.get(i+1));\r\n totalDist += distance;\r\n }\r\n return totalDist;\r\n }", "public static double GetDistance(double lat1, double lon1, double lat2, double lon2) {\n double radLat1 = rad(lat1);\n double radLat2 = rad(lat2);\n double a = radLat1 - radLat2;\n double b = rad(lon1) - rad(lon2);\n double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +\n Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n s = s * EARTH_RADIUS;//km\n// Log.e(\"s\", \"s=\" + s);\n return s;\n }", "@Override\n\tpublic int getDistanceFrom(final SabrePlayer other) {\n\t\tGuard.ArgumentNotNull(other, \"other\");\n\t\t\n\t\tif (!isOnline() || !other.isOnline()) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tLocation myLocation = bukkitPlayer.getLocation();\n\t\tLocation otherLocation = other.getBukkitPlayer().getLocation();\n\t\tint dx = otherLocation.getBlockX() - myLocation.getBlockX();\n\t\tint dz = otherLocation.getBlockZ() - myLocation.getBlockZ();\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow(dx, 2) + Math.pow(dz, 2));\n\t}", "@Override\n\tpublic ArrayList<String> getCityDistance() {\n\t\treturn constantPO.getCityDistance();\n\t}", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "public abstract double GetDistance();", "public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }", "private double getDistFromNadir(double lat, double lng) {\r\n GeoPoint satNadir = new GeoPoint(Math.toRadians(satLat), Math.toRadians(thetaP));\r\n GeoPoint thePoint = new GeoPoint(Math.toRadians(lat), Math.toRadians(lng));\r\n if (gc == null)\r\n gc = new GreatCircle();\r\n gc.setStart(satNadir);\r\n gc.setArrival(thePoint);\r\n gc.calculateGreatCircle(1);\r\n double dist = Math.toDegrees(gc.getDistance()) * 60.0;\r\n\r\n return dist;\r\n }", "public static double getDistance(String location){\n\t\tdouble lng1 = -122.301436; \n\t\tdouble lat1 = 47.605387; \n\t\t\n\t\tint startIndex1 = location.indexOf(\"longitude\");\n\t\tlng = location.substring(startIndex1+11, startIndex1+20);\n\t\tint startIndex2 = location.indexOf(\"latitude\");\n\t\tlat = location.substring(startIndex2+10, startIndex2+17);\n\n\t\tdouble lng2 = Double.parseDouble(lng);\n\t\tdouble lat2 = Double.parseDouble(lat);\n\n\t\tdouble R = 6371; \n\t\tdouble vlat1 = lat1*Math.PI/180; \n\t\tdouble vlat2 = lat2*Math.PI/180;\n\t\tdouble changelat = (lat2-lat1)*Math.PI/180;\n\t\tdouble changelng = (lng2-lng1)*Math.PI/180;\n\t\tdouble a = Math.sin(changelat/2) * Math.sin(changelat/2) +\n\t\t Math.cos(vlat1) * Math.cos(vlat2) *\n\t\t Math.sin(changelng/2) * Math.sin(changelng/2);\n\t\tdouble c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\t\tdouble d = R * c;\n\t\t\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\");\n String dis = df.format(d);\n double dist = Double.parseDouble(dis);\n \n\t\treturn dist;\n\t}", "double distanceSq (double px, double py);", "private double getDistanceBetweenLocationsInMeters(double sourceLat, double sourceLong, double destLat, double destLong) {\n String distanceStr = \"\";\n double R = 6371000f; // Default Radius of the earth in meters\n double dLat = (sourceLat - destLat) * Math.PI / 180f;\n double dLon = (sourceLong - destLong) * Math.PI / 180f;\n double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(dLat) * Math.cos(dLon) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n double c = 2f * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = R * c;\n //System.out.println(\"DISTANCE IN METERS::: \" + Math.round(distance));\n return distance;\n }", "double getLongitude();", "public double getDistanceFrom(Coordinate location) {\n double latDistance = Math.toRadians(location.getLat() - lat);\n double lonDistance = Math.toRadians(location.getLon() - lon);\n double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n + Math.cos(Math.toRadians(lat))\n * Math.cos(Math.toRadians(location.getLat()))\n * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = EARTH_RADIUS * c * 1000;\n distance = Math.pow(distance, 2);\n return Math.sqrt(distance);\n }", "public double calculaDistancia(double latitude, double longitude)\n\t{\n\t\tdouble menorDistancia = Double.MAX_VALUE;\n\t\t\n\t\tif (posicoes.size() < 2)\n\t\t\treturn menorDistancia;\n\t\t\n\t\tPosicaoMapa posicaoAnterior = posicoes.get(0);\n\t\t\n\t\tfor (int i = 1; i < posicoes.size(); i++)\n\t\t{\n\t\t\tPosicaoMapa posicaoAtual = posicoes.get(i);\n\t\t\tdouble distancia = Geodesic.trackDistance(latitude, longitude, posicaoAnterior.getLatitude(), posicaoAnterior.getLongitude(), posicaoAtual.getLatitude(), posicaoAtual.getLongitude());\n\t\t\t\t\t\n\t\t\tif (distancia < menorDistancia)\n\t\t\t\tmenorDistancia = distancia;\n\t\t\t\n\t\t\tposicaoAnterior = posicaoAtual;\n\t\t}\n\t\t\n\t\treturn menorDistancia;\n\t}", "Execution getClosestDistance();", "public double viewportToWorldDistance(int d) {\n return d / Math.abs(xScaleFactor);\n }", "public double distanceTo(GeoPoint that) {\n double lambda1 = this.longitude;\n double phi1 = this.latitude;\n\n double lambda2 = that.longitude;\n double phi2 = that.latitude;\n\n double alpha = 2 * Math\n .asin(Math.sqrt(Math2.haversin(phi1 - phi2) + Math.cos(phi1)\n * Math.cos(phi2) * Math2.haversin(lambda1 - lambda2)));\n return Distance.toMeters(alpha);\n }", "public double calcDistance(GpsCoordinate other)\n\t{\n\t\tdouble lat1 = degToRadian(this.latitude);\n\t\tdouble lng1 = degToRadian(this.longitude);\n\t\tdouble lat2 = degToRadian(other.latitude);\n\t\tdouble lng2 = degToRadian(other.longitude);\n\t\t\n\t\t/*\n\t\t * use haversine Formula to calc the distance\n\t\t * @see: http://en.wikipedia.org/wiki/Haversine_formula\n\t\t */\n\t\tdouble inRootFormula = Math.sqrt(\n\t\t\t\tMath.sin((lat1 - lat2)/2)*Math.sin((lat1 - lat2)/2)+\n\t\t\t\tMath.cos(lat1)*Math.cos(lat2)*Math.sin((lng1-lng2)/2)*Math.sin((lng1-lng2)/2));\n\t\t\n\t\treturn 2* EARTH_RADIUS * Math.asin(inRootFormula);\n\n\t\n\t}", "public int getAdministrativeDistance() {\n\t return this.administrativeDistance;\n\t}", "public Double getDistance(Concept concept) {\n\n return (Double) this.getAdditionalTagValue(\n GeographicErrorTest.DISTANCE_TAG_ID, concept);\n }" ]
[ "0.76236576", "0.7552088", "0.7490198", "0.7374201", "0.72524005", "0.7212323", "0.7211944", "0.7205532", "0.7203357", "0.7164085", "0.714425", "0.7143586", "0.714096", "0.713508", "0.713508", "0.7105602", "0.70625645", "0.70553946", "0.7041178", "0.703151", "0.70195305", "0.70138276", "0.7009782", "0.7009782", "0.7003249", "0.7000832", "0.6996437", "0.6996437", "0.69766176", "0.69748664", "0.696399", "0.6960652", "0.6960652", "0.69558", "0.69296813", "0.692268", "0.6857271", "0.6856066", "0.68336946", "0.6808858", "0.67901206", "0.6760154", "0.6757093", "0.6740589", "0.67397034", "0.6733499", "0.6716559", "0.6707742", "0.6697416", "0.66699004", "0.6635003", "0.66098064", "0.65869904", "0.65665406", "0.6532128", "0.6519055", "0.65012896", "0.6496481", "0.64792323", "0.64785105", "0.64756775", "0.6475552", "0.6468058", "0.64539677", "0.64450485", "0.6437483", "0.64365685", "0.64354897", "0.6427406", "0.6423726", "0.64206374", "0.6416219", "0.64105433", "0.6393102", "0.63832414", "0.637899", "0.6361241", "0.63595396", "0.635945", "0.6350508", "0.63386893", "0.63313425", "0.6327719", "0.6324821", "0.6318305", "0.63158214", "0.6309872", "0.6285501", "0.62625396", "0.6251904", "0.62402344", "0.6239589", "0.6235008", "0.6234194", "0.6228544", "0.62174773", "0.61926615", "0.619192", "0.6191277", "0.6171066", "0.6158601" ]
0.0
-1
returns true on success
public static boolean credit(int uid, double amount) { return BankDB.credit(uid, amount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "public boolean isSuccess();", "public boolean isSuccess();", "@Override\n\t\tpublic boolean isSuccess() {\n\t\t\treturn false;\n\t\t}", "boolean isSuccessful();", "boolean hasIsSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "public boolean performOk() {\r\n\t\treturn super.performOk();\r\n\t}", "public boolean isSuccess()\r\n {\r\n return success;\r\n }", "public boolean lastOpSuccess()\r\n {\r\n \treturn this.stat == VirtualPointer.Serializer.STATUS_SUCCESS;\r\n }", "boolean getIsOk();", "public boolean isSuccess() {\r\n return success;\r\n }", "public boolean isSuccess() {\r\n return success;\r\n }", "public boolean repOk();", "public boolean hasSucceeded() {\n return succeeded;\n }", "public boolean isSuccess() {\n\t\tif (Status.OK == status) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean wasSuccessful() {\n return this.failureCount() == 0 && this.errorCount() == 0;\n }", "@Override\n\tpublic boolean repOk() {\n\t\treturn true;\n\t}", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public abstract boolean repOk();", "public boolean patenteSuccess() {\n return this.success;\n }", "boolean completed();", "public boolean isSuccessful() {\n //loadSettingsFromFile(filePath);\n Login();\n if (EXPECTED_TITLE.equals(driver.getTitle()))\n return true;\n else\n return false;\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "@Override\n\tpublic boolean execute() {\n\t\treturn false;\n\t}", "boolean isComplete();", "boolean isComplete();", "public boolean okReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_OK];\n\t\t}", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean execute();", "protected boolean isValid()\r\n {\r\n \treturn true;\r\n }", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasFinished();", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "private boolean checkBackend() {\n \ttry{\n \t\tif(sendRequest(generateURL(0,\"1\")) == null ||\n \tsendRequest(generateURL(1,\"1\")) == null)\n \t\treturn true;\n \t} catch (Exception ex) {\n \t\tSystem.out.println(\"Exception is \" + ex);\n\t\t\treturn true;\n \t}\n\n \treturn false;\n \t}", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "@Override\n\tpublic boolean isInterestedInSuccess() {\n\t\treturn false;\n\t}", "public static boolean isOK() {return isOK;}", "public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }", "public boolean errorFound()\r\n\t{\r\n\t\t\r\n\t}", "protected boolean isFinished() {\r\n if (state == STATE_SUCCESS) {\r\n // Success\r\n return true;\r\n }\r\n if (state == STATE_FAILURE) {\r\n // Failure\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean OK() {\r\n return in == saves[save-1];\r\n }", "public boolean isOK() {\n\t\treturn adaptee.isOK();\n\t}", "public boolean isOk() {\n\t\treturn ok;\n\t}", "boolean hasIsComplete();", "boolean hasIsComplete();", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "boolean hasPass();", "boolean hasPass();", "Boolean isInvokeSuccess();", "public boolean isIsSuccess() {\r\n return isSuccess;\r\n }", "public boolean verify();", "boolean isFailure();", "public abstract boolean isComplete();", "public Boolean isSuccess()\n\t{\n\t\treturn isSuccess( getSession().getSessionContext() );\n\t}", "boolean hasCollectResult();", "public boolean isIsSuccess() {\n return isSuccess;\n }", "public boolean isValid(){\r\n\t\t\r\n\t\t// TODO\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean execute() {\n return false;\n }", "@Override\n public boolean execute() {\n return false;\n }", "protected boolean isFinished()\n\t{\n\t\treturn true;\n\t}", "public boolean isSuccessful() {\n return this.reason == Reason.NONE;\n }", "boolean complete();", "public boolean getSuccess() {\n return success_;\n }", "public boolean isValid(){\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean run() throws Exception {\n\t\treturn true;\n\t}", "public boolean isSuccess() {\n return mSuccess;\n }", "boolean mo718a() throws RemoteException;", "public boolean isComplete();", "boolean hasRetrieveFile();", "protected boolean checkCache()\n\t{\n\t\ttry {\n\t\t\tStream<String> lines = Files.lines(Paths.get(output.getAbsolutePath(), markerFile));\n\t\t\tString content = lines.collect(Collectors.joining());\n\t\t\t//System.out.println(content);\n\t\t\treturn content.equals(successString);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}" ]
[ "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.7444541", "0.7444541", "0.7409824", "0.7397376", "0.73401713", "0.7107607", "0.7107607", "0.7107607", "0.7107607", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.67822576", "0.677885", "0.67390835", "0.67299783", "0.6637571", "0.6637571", "0.663257", "0.66315305", "0.6614675", "0.6602932", "0.6592477", "0.6579507", "0.6579507", "0.6579507", "0.6565518", "0.65619594", "0.6515329", "0.64953995", "0.64838886", "0.64743745", "0.64678174", "0.64678174", "0.64428276", "0.64274746", "0.64274746", "0.64274746", "0.64274746", "0.6422853", "0.6409862", "0.6409048", "0.6397343", "0.63770217", "0.63770217", "0.63770217", "0.63618326", "0.6354908", "0.6349675", "0.6336142", "0.63281196", "0.63230294", "0.6316526", "0.6299007", "0.6298429", "0.62980783", "0.629412", "0.629412", "0.6286819", "0.6286819", "0.6286819", "0.6280506", "0.6280506", "0.6279333", "0.6273389", "0.62715393", "0.6267328", "0.62650627", "0.62535155", "0.6235323", "0.6234072", "0.62324226", "0.6232312", "0.6232312", "0.6230196", "0.62258625", "0.62222815", "0.62188447", "0.620719", "0.6204076", "0.62040156", "0.61911786", "0.61752284", "0.6164508", "0.6164487" ]
0.0
-1
returns true on success
public static boolean debit(int uid, double amount) { return BankDB.debit(uid, amount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "public boolean isSuccess();", "public boolean isSuccess();", "@Override\n\t\tpublic boolean isSuccess() {\n\t\t\treturn false;\n\t\t}", "boolean isSuccessful();", "boolean hasIsSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "public boolean performOk() {\r\n\t\treturn super.performOk();\r\n\t}", "public boolean isSuccess()\r\n {\r\n return success;\r\n }", "public boolean lastOpSuccess()\r\n {\r\n \treturn this.stat == VirtualPointer.Serializer.STATUS_SUCCESS;\r\n }", "boolean getIsOk();", "public boolean isSuccess() {\r\n return success;\r\n }", "public boolean isSuccess() {\r\n return success;\r\n }", "public boolean repOk();", "public boolean hasSucceeded() {\n return succeeded;\n }", "public boolean isSuccess() {\n\t\tif (Status.OK == status) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean wasSuccessful() {\n return this.failureCount() == 0 && this.errorCount() == 0;\n }", "@Override\n\tpublic boolean repOk() {\n\t\treturn true;\n\t}", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public abstract boolean repOk();", "public boolean patenteSuccess() {\n return this.success;\n }", "boolean completed();", "public boolean isSuccessful() {\n //loadSettingsFromFile(filePath);\n Login();\n if (EXPECTED_TITLE.equals(driver.getTitle()))\n return true;\n else\n return false;\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "@Override\n\tpublic boolean execute() {\n\t\treturn false;\n\t}", "boolean isComplete();", "boolean isComplete();", "public boolean okReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_OK];\n\t\t}", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean execute();", "protected boolean isValid()\r\n {\r\n \treturn true;\r\n }", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasFinished();", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "private boolean checkBackend() {\n \ttry{\n \t\tif(sendRequest(generateURL(0,\"1\")) == null ||\n \tsendRequest(generateURL(1,\"1\")) == null)\n \t\treturn true;\n \t} catch (Exception ex) {\n \t\tSystem.out.println(\"Exception is \" + ex);\n\t\t\treturn true;\n \t}\n\n \treturn false;\n \t}", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "@Override\n\tpublic boolean isInterestedInSuccess() {\n\t\treturn false;\n\t}", "public static boolean isOK() {return isOK;}", "public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }", "public boolean errorFound()\r\n\t{\r\n\t\t\r\n\t}", "protected boolean isFinished() {\r\n if (state == STATE_SUCCESS) {\r\n // Success\r\n return true;\r\n }\r\n if (state == STATE_FAILURE) {\r\n // Failure\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean OK() {\r\n return in == saves[save-1];\r\n }", "public boolean isOK() {\n\t\treturn adaptee.isOK();\n\t}", "public boolean isOk() {\n\t\treturn ok;\n\t}", "boolean hasIsComplete();", "boolean hasIsComplete();", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "boolean hasPass();", "boolean hasPass();", "Boolean isInvokeSuccess();", "public boolean isIsSuccess() {\r\n return isSuccess;\r\n }", "public boolean verify();", "boolean isFailure();", "public abstract boolean isComplete();", "public Boolean isSuccess()\n\t{\n\t\treturn isSuccess( getSession().getSessionContext() );\n\t}", "boolean hasCollectResult();", "public boolean isIsSuccess() {\n return isSuccess;\n }", "public boolean isValid(){\r\n\t\t\r\n\t\t// TODO\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean execute() {\n return false;\n }", "@Override\n public boolean execute() {\n return false;\n }", "protected boolean isFinished()\n\t{\n\t\treturn true;\n\t}", "public boolean isSuccessful() {\n return this.reason == Reason.NONE;\n }", "boolean complete();", "public boolean getSuccess() {\n return success_;\n }", "public boolean isValid(){\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean run() throws Exception {\n\t\treturn true;\n\t}", "public boolean isSuccess() {\n return mSuccess;\n }", "boolean mo718a() throws RemoteException;", "public boolean isComplete();", "boolean hasRetrieveFile();", "protected boolean checkCache()\n\t{\n\t\ttry {\n\t\t\tStream<String> lines = Files.lines(Paths.get(output.getAbsolutePath(), markerFile));\n\t\t\tString content = lines.collect(Collectors.joining());\n\t\t\t//System.out.println(content);\n\t\t\treturn content.equals(successString);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}" ]
[ "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.75245285", "0.7444541", "0.7444541", "0.7409824", "0.7397376", "0.73401713", "0.7107607", "0.7107607", "0.7107607", "0.7107607", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.68842643", "0.67822576", "0.677885", "0.67390835", "0.67299783", "0.6637571", "0.6637571", "0.663257", "0.66315305", "0.6614675", "0.6602932", "0.6592477", "0.6579507", "0.6579507", "0.6579507", "0.6565518", "0.65619594", "0.6515329", "0.64953995", "0.64838886", "0.64743745", "0.64678174", "0.64678174", "0.64428276", "0.64274746", "0.64274746", "0.64274746", "0.64274746", "0.6422853", "0.6409862", "0.6409048", "0.6397343", "0.63770217", "0.63770217", "0.63770217", "0.63618326", "0.6354908", "0.6349675", "0.6336142", "0.63281196", "0.63230294", "0.6316526", "0.6299007", "0.6298429", "0.62980783", "0.629412", "0.629412", "0.6286819", "0.6286819", "0.6286819", "0.6280506", "0.6280506", "0.6279333", "0.6273389", "0.62715393", "0.6267328", "0.62650627", "0.62535155", "0.6235323", "0.6234072", "0.62324226", "0.6232312", "0.6232312", "0.6230196", "0.62258625", "0.62222815", "0.62188447", "0.620719", "0.6204076", "0.62040156", "0.61911786", "0.61752284", "0.6164508", "0.6164487" ]
0.0
-1
Intent intent= new Intent(tutorial3.this,Preference.class);
public void onClick(View v) { Log.d("test", "Hello Dipankar:"+type); // startActivity(intent); switch(type){ case 1: txt.setTypeface(Typeface.MONOSPACE); break; case 2: txt.setTypeface(Typeface.SANS_SERIF); break; case 3: Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Molot.otf"); txt.setTypeface(tf); } type =type%3+1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void preferences() {\n\tstartActivity (new Intent(getApplicationContext(), PushPreferencesActivity.class));\n}", "public void go_to_setting(){\n Intent i=new Intent(LoginSelection.this, Configuration.class);\n startActivity(i);\n }", "@Override\n public void onClick(DialogInterface dialog, int id) {\n startActivity(new Intent(context, Preferences.class));\n }", "private void studentRoleAction(){\n savePreferenceData(\"student\");\n Intent intent = new Intent(this, StudentMainActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent screenChange = new Intent(getApplicationContext(), settings.class);\n //creating a bundle to store the variables that will be passed into the next\n //activity\n //starting our activity for a result\n startActivity(screenChange);\n }", "@Override\n public void onClick(View view) {\n Intent goToPantry = new Intent(VegUser.this, ListPantry.class);\n startActivity(goToPantry); //needs to go to pantry so preference activity refreshes\n }", "private void teacherRoleAction(){\n savePreferenceData(\"teacher\");\n retrieveData();\n\n Intent intent = new Intent(this, TeacherMainActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setClass(AddPlan.this,Favorite_Site.class);\n// Bundle bundle = new Bundle();\n// bundle.putString(\"myChoice\",\"hello\");\n// intent.putExtras(bundle);\n// startActivityForResult(intent,0);\n startActivity(intent);\n// //AddPlan.this.finish();\n finish();\n\n }", "void mChapie(){\n Intent i = new Intent(context,Peminjaman.class);\n context.startActivity(i);\n\n }", "public void openActivity3(){\n Intent intent = new Intent(this, Favoris.class);\n startActivity(intent);\n }", "@Override\r\n \t\t\tpublic void onClick(View arg0) {\n \t\t\t\tIntent intent = new Intent(AppDownloaded.this, SettingActivity.class);\r\n \t\t\t\tstartActivity(intent);\r\n \t\t\t}", "public void verProfesionista(View view){\n Intent siguiente = new Intent(verEmpleos.this,verProfesionista.class);\n startActivity(siguiente);//se inicia\n }", "@Override\n public void onClick(View view) {\n Intent i = new Intent(MainActivity.this,createPoll.class);\n startActivity(i);\n\n }", "public void openSettings(){\n\n Intent startSearch = new Intent(this, Settings.class);\n startActivity(startSearch);\n\n }", "private void openHome(){\n Intent intent2 = new Intent(AddExercises.this, MainActivity.class);\n startActivity(intent2);\n }", "public void showPreferences(View view) {\n Intent intent = new Intent(this, Preferences.class);\n startActivity(intent);\n }", "void mstrange(){\n Intent i = new Intent(context,Pengembalian.class);\n context.startActivity(i);\n }", "@Override\n public void onClick(View v) {\n {\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Intent NextScreen = new Intent(RoundSetting.this, SelectCourse.class);\n // NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n }\n\n\n }", "@Override\r\n public void onClick(View view) {\n\r\n Intent gotoWiFISwitch = new Intent(MainActivity.this, WiFISwitch.class);\r\n startActivity(gotoWiFISwitch);\r\n\r\n\r\n }", "public void clickPolice(View view){\n Intent i = new Intent(this,Police.class);\n startActivity(i);\n }", "public void settingsClick(View view)\r\n {\r\n Intent intent=new Intent(MainActivity.this, SettingsActivity.class);\r\n intent.putExtra(\"toggleButton\" , true);\r\n startActivity(intent);\r\n }", "@Override\n public void onClick(View v) {\n\t \tIntent myIntent = new Intent(MainActivity.this, Profile.class);\n\t \t//myIntent.putExtra(\"key\", value); //Optional parameters\n\t \tMainActivity.this.startActivity(myIntent);\n }", "@Override\n public void onClick(View v) {\n\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"player1name\", player1Name.getText().toString());\n editor.putString(\"player2name\", player2Name.getText().toString());\n editor.commit();\n\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n i.putExtra(\"isPlayerDetsSet\", true);\n getApplicationContext().startActivity(i);\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, SettingsActivity.class);\n startActivity(intent);\n finish();\n }", "public void Volgende(Intent intent){\r\n\r\n startActivity(intent);\r\n\r\n }", "private void homemenu() \n\n{\nstartActivity (new Intent(getApplicationContext(), Home.class));\n\n\t\n}", "@Override\n public void onClick(View v) {\n Intent myIntent = new Intent(ChooseParty.this, HelpActivity.class);\n // myIntent.putExtra(\"key\", value); //Optional parameters\n myIntent.putExtra(\"username\", mUsername);\n startActivity(myIntent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_settings) {\n\n Intent i = new Intent(this,MyPref.class);\n i.putExtra(\"id\",\"1\");\n startActivity(i);\n return true;\n }\n if (id == R.id.action_login) {\n\n Intent i = new Intent(this,User.class);\n startActivity(i);\n return true;\n }\n if (id == R.id.item1) {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setTitle(\"About App\")\n .setMessage(R.string.about_app)\n .create()\n .show();\n }\n if (id == R.id.item2) {\n startActivity(new Intent(getApplicationContext(),Me.class));\n\n }\n if (id == R.id.item3) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void onClick(DialogInterface dialog, int which) {\n Intent i = new Intent(settingsScr.this,accountScr.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n }", "@Override\n public void onClick(View v) {\n {\n saveRoundSetting();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Intent NextScreen = new Intent(RoundSetting.this, SelectCourse.class);\n // NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n }\n\n\n }", "public void buttonToExam(View view) {\n Log.i(\"BOTTOM NAVIGATION\", \"to exam button clicked\");\n Intent intent = new Intent(getApplicationContext(), ExamActivity.class);\n// intent.putExtra(\"extra\", \"extra\");\n startActivity(intent);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.prefinal);\n\t\t\n\t\tButton btn=(Button)findViewById(R.id.btnf);\n\t\tbtn.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent it=new Intent(\"com.example.btp.FinalDecision\");\n\t\t\t\tstartActivity(it);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "public boolean onPreferenceClick(Preference preference) {\n String url = \"https://github.com/ilayaraja97/ManageAccounts\";\n Intent i = new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(url));\n startActivity(i);\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent settingsActivity = new Intent(HomeActivity.this,SettingsActivity.class);\n\t\t\t\tstartActivity(settingsActivity);\n\t\t\t\t//Toast.makeText(getApplicationContext(), \"LIBRARY\",Toast.LENGTH_SHORT).show();\n\t\t\t}", "public void addQuestion(View view) {\n startActivity(new Intent(MainActivity.this, DicebreakerQuestions.class));\n\n }", "public void updatePreferences() {\n\n Toast.makeText(this, \"enter your data\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(this, SipSettingsActivity.class));\n\n }", "@Override\n public void onClick(View view) {\n\n\n Intent i = new Intent(getApplicationContext(),Selection.class);\n startActivity(i);\n }", "public void onClick(View v) {\n\n\n\n startActivity(myIntent);\n }", "void onCreate(Intent intent);", "@Override\n public void onClick(View v) {\n Intent cambioVentana = new Intent(Portada.this, Preferencias.class);\n startActivity(cambioVentana);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(Visa.this,Recepit.class);\n startActivity(intent);\n\n\n }", "public void onLaunchPreferenceActivitySelected(Context context);", "public void catButton(View view){\n Intent intent=new Intent(PM_L1.this,PM_L1_G1.class);\n startActivity(intent);\n\n }", "private void back_home()\n {\n btn_home.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n Intent myintent=new Intent(getApplicationContext(), Dictionary_MainActivity.class);\n\n startActivity(myintent);\n\n }\n });\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n super.onCreate(savedInstanceState);\n\n addPreferencesFromResource(R.xml.preferences);\n\n // Intent intent = getIntent();\n }", "@Override\n public void onClick(View view){\n Intent goToList = new Intent(SPQ7Page.this,SPQuestionList.class );\n\n // Executes Intent object.\n startActivity(goToList);\n\n }", "private void gotoOptions() {\n Intent launchOptions = new Intent(this, Preferences.class);\n startActivity(launchOptions);\n }", "@Override\n public void onClick(View view) {\n\n Intent intent = new Intent(MainActivity.this, TAXActivity.class);\n// Intent intent = new Intent(MainActivity.this, Main3Activity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View view)\n {\n Intent intent = new Intent(BoilerRoom.this, Inspection.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n\n Intent quizIntent = new Intent(getApplicationContext(), QuizActivity.class);\n startActivity(quizIntent);\n }", "public void Inicio (View view){\n Intent inicio = new Intent(this, MainActivity.class);\n startActivity(inicio);\n }", "private void goSomewhere() {\n\n Intent intent = new Intent();\n intent.setClassName(Home.this,this.tip.getTipIntent());\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n // Create a new intent to open the {@link PhrasesActivity}\n Intent intent = new Intent(StartActivity.this, Settings.class);\n\n // Start the new activity\n startActivity(intent);\n }", "public void sendSettings()\n {\n Intent startSettings = new Intent(this, Main3Activity.class);\n startActivity(startSettings);\n }", "public void figura1(View view){\n Intent figura1 = new Intent(this,Figura1.class);\n startActivity(figura1);\n }", "public void settings_clicked(View view) {\n Intent intent = new Intent(this, SettingsActivity.class);\n // EditText editText = (EditText) findViewById(R.id.editText);\n // String message = \"final data\";\n // intent.putExtra(EXTRA_MESSAGE, message);\n startActivity(intent);\n }", "public void buttonHintNext(View view) {\n //using finish to activity\n finish();\n\n //create a new object to start new activity\n Intent intent = new Intent(this, Hint.class);\n //pass object to startActivity\n startActivity(intent);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent myIntent = new Intent();\n myIntent = new Intent(picking.this,home_page.class);\n startActivity(myIntent);\n picking.this.finish();\n }", "@Override\n public void onClick(View view) {\n Intent sleepIntent = new Intent(MainActivity.this, Sleep_Playlist.class);\n // Start the new activity\n startActivity(sleepIntent);\n }", "public void UniversitySelected(View view) {\n\n SharedPreferences storeduniversity = getSharedPreferences(\"universityfile\",Activity.MODE_PRIVATE);\n SharedPreferences.Editor editor=storeduniversity.edit();\n\n EditText editText = (EditText) findViewById(R.id.enterDescription);\n String uni=editText.getText().toString();\n\n editor.putString(\"university\",uni);\n editor.apply();\n\n\n \n\n\n Intent intent = new Intent(this, ClassAdder.class);\n //String message = String.valueOf(id.UniversitySelect);\n //intent.putExtra(EXTRA_MESSAGE, message);\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent teacherQuestions = new Intent(context.getApplicationContext(), TeacherQuestions.class);\n teacherQuestions.putExtra(\"topicsID\", listItem.getID());\n teacherQuestions.putExtra(\"topic\", topic);\n context.getApplicationContext().startActivity(teacherQuestions);\n }", "@Override\n public void onClick(View v) {\n\n saveRoundSetting();\n saveMembers();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Bundle bundle = new Bundle();\n // bundle.putString(\"FROMACTIVITY_WHERE\",\"ROUNDSEETING\");\n bundle.putString(\"MemberNumber\",\"forth\");\n bundle.putString(\"Membername\",\"\"+ youtextt[3].getText());\n Intent NextScreen = new Intent(RoundSetting.this, TeeSelection.class);\n NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n\n }", "@Override\n public void onClick(View v) {\n\n saveRoundSetting();\n saveMembers();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Bundle bundle = new Bundle();\n // bundle.putString(\"FROMACTIVITY_WHERE\",\"ROUNDSEETING\");\n bundle.putString(\"MemberNumber\",\"third\");\n bundle.putString(\"Membername\",\"\"+ youtextt[2].getText());\n Intent NextScreen = new Intent(RoundSetting.this, TeeSelection.class);\n NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n\n }", "@Override\n public void onClick(View view)\n {\n Intent intent=new Intent(PantallaSecundaria.this, MainActivity.class);\n startActivity(intent);\n }", "public void tohome (View view){\n Intent i = new Intent(this,Intro.class);\n startActivity(i);\n }", "@Override\n public void onClick(View v) {\n\n saveRoundSetting();\n saveMembers();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Bundle bundle = new Bundle();\n // bundle.putString(\"FROMACTIVITY_WHERE\",\"ROUNDSEETING\");\n bundle.putString(\"MemberNumber\",\"second\");\n bundle.putString(\"Membername\",\"\"+ youtextt[1].getText());\n Intent NextScreen = new Intent(RoundSetting.this, TeeSelection.class);\n NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n\n }", "@Override\n public void onClick(View view) {\n Intent workoutIntent = new Intent(MainActivity.this, Workout_Playlist.class);\n // Start the new activity\n startActivity(workoutIntent);\n }", "public void onClick(View v) {\n Intent intent = new Intent();\n intent.setClass(memberinfo.this,story.class);\n startActivity(intent);\n\n }", "@Override\n public void onClick(View v) {\n Intent libraryIntent = new Intent(MainActivity.this, LibraryActivity.class);\n startActivity(libraryIntent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(SettingsActivity.this, TemperatureActivity.class);\n startActivity(intent);\n\n // MainActivity.this.startActivity(activityChangeIntent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(SettingsActivity.this, NotifActivity.class);\n startActivity(intent);\n\n // MainActivity.this.startActivity(activityChangeIntent);\n }", "public void proximaTela2(View view) {\n\n Intent intent = new Intent(this, Activity3.class);\n startActivity(intent);\n\n\n }", "public void gotoSettings(View v){\n Intent settings;\n settings = new Intent(getBaseContext(),SettingsActivity.class);\n startActivity(settings);\n }", "@Override\n public void onClick(View v) {\n Intent p1page = new Intent(v.getContext(), AshmoleanMusuem.class);\n startActivity(p1page);\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t super.onCreate(savedInstanceState);\n\t setContentView(R.layout.rules);\n\t \n\t Chkagree = (CheckBox) findViewById(R.id.checkBoxCheckAgree);\n\t buttonStartExam = (Button) findViewById(R.id.buttonStartExam);\n\t buttonStartExam.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\t\n\t\t\tpublic void onClick(final View e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\tif(e == buttonStartExam)\n\t \t{ \n\t\t\t\t\tbuttonStartExam.setBackgroundResource(R.drawable.btn4);\n\t }\n\t\t new Handler().postDelayed(new Runnable() {\n\t\t public void run() {\n\t\t \tif( e == buttonStartExam)\n\t\t \t{\n\t\t \t\tbuttonStartExam.setBackgroundResource(R.drawable.btn2);\n\t\t }\n\t\t }\n\t\t }, 100L); \n\t\t SharedPreferences setting = getSharedPreferences(\"Pref\", 0);\n\t\t String imported= setting.getString(\"imported\", \"\");\n\t\t if(imported.equals(\"Yes\"))\n\t\t {\n\t\t\t\tif(Chkagree.isChecked())\n\t\t\t\t{\n\t\t\tIntent mIntent = new Intent(RulesActivity.this, DispalyQuestion.class);\n\t\t\tstartActivity(mIntent);\n\t\t\tfinish();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(RulesActivity.this, \"Please Agree\",Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t }\n\t\t else\n\t\t {\n\t\t \t Toast.makeText(RulesActivity.this, \"Answers not imported\",Toast.LENGTH_LONG).show();\n\t\t }\n\t\t\t}\n\t\t});\n\t\n\t // TODO Auto-generated method stub\n\t}", "public void onClick(View v){\n EditText et = findViewById(R.id.et_1);\n String n;\n n = et.getText().toString();\n Bundle bundle = new Bundle();\n bundle.putString(\"url\",n);\n Intent intent = new Intent(getBaseContext(),t1.class);\n intent.putExtras(bundle);\n startActivity(intent);\n }", "private void ConfirmToken() {\n Intent i = new Intent(RegisterMe.this, ConfirmToken.class);\n startActivity(i);\n}", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setClass(getApplicationContext(), Atividade2.class);\n //envio do parametro chamado parametro1\n intent.putExtra(\"parametro1\", \"este é um parametro\");\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n startActivity(new Intent(\n HomeScreen.this, AddPoi.class));\n\n }", "public void onClickAbout (View v)\n{\n startActivity (new Intent(getApplicationContext(), AboutActivity.class));\n}", "void startNewActivity(Intent intent);", "@Override\n public void onClick(View view) {\n\n startActivity(getIntent());\n }", "public void repitencia(View view){\n Intent rep = new Intent(this, Repitencia.class);\n startActivity(rep);\n }", "public void mangoButton(View view){\n Intent intent=new Intent(PM_L1.this,PM_L1_G2.class);\n startActivity(intent);\n\n }", "@Override\n public void onClick(View v) {\n Intent account = new Intent(Welcome.this, MyAccount.class);\n startActivity(account);\n\n }", "protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.profile);\n\n TextView coupon = (TextView) findViewById(R.id.view);\n\n coupon.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n Intent intentC = new Intent(\"android.intent.action.COUPONS\");\n startActivity(intentC);\n\n }\n });\n\n }", "@Override\n public void onClick(View view) {\n startActivity(new Intent(MainActivity.this, InputActivity.class));\n }", "@Override\n public void onClick(View v) {\n saveRoundSetting();\n saveMembers();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Bundle bundle = new Bundle();\n // bundle.putString(\"FROMACTIVITY_WHERE\",\"ROUNDSEETING\");\n bundle.putString(\"MemberNumber\",\"first\");\n bundle.putString(\"Membername\",\"\"+ youtextt[0].getText());\n Intent NextScreen = new Intent(RoundSetting.this, TeeSelection.class);\n NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n //m_newRound.setBackgroundResource(R.drawable.buttonselected);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n \n app_preferences = PreferenceManager.getDefaultSharedPreferences(this);\n first_run = app_preferences.getBoolean(\"first_run\", true);\n \n if (first_run) {\n \tnew AlertDialog.Builder(AndroidExamples.this)\n \t\t.setTitle(\"Welcome to Android Developer Examples\")\n \t\t.setMessage(\"This application is a set of advanced examples for http://android.ifies.org.\\nThese examples are available online via the website, where you can download the sourcecode for this application.\")\n \t\t.setNeutralButton(\"Close\", new DialogInterface.OnClickListener() {\n \t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n \t\t\t\tSharedPreferences.Editor editor = app_preferences.edit();\n\t\t\t\t\teditor.putBoolean(\"first_run\", false);\n\t\t\t\t\teditor.commit();\n \t\t\t}\n \t\t})\n \t\t.show();\n }\n \n example_admob = (Button) findViewById(R.id.example_admod);\n example_admob.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_AdMob = new Intent(AndroidExamples.this, AdmobExample.class);\n\t\t\t\tstartActivity(i_AdMob);\n\t\t\t}\n \t\n });\n \n example_gallery = (Button) findViewById(R.id.example_gallery);\n example_gallery.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_Gallery1 = new Intent(AndroidExamples.this, GalleryExample.class);\n\t\t\t\tstartActivity(i_Gallery1);\n\t\t\t}\n \t\n });\n \n example_alerts = (Button) findViewById(R.id.example_alerts);\n example_alerts.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_Alert = new Intent(AndroidExamples.this, AlertExamplesHome.class);\n\t\t\t\tstartActivity(i_Alert);\n\t\t\t}\n \t\n });\n \n example_rss_parser = (Button) findViewById(R.id.example_rss_parser);\n example_rss_parser.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_Alert = new Intent(AndroidExamples.this, RssActivity.class);\n\t\t\t\tstartActivity(i_Alert);\n\t\t\t}\n \t\n });\n \n example_webview = (Button) findViewById(R.id.example_webkit_view);\n example_webview.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_Alert = new Intent(AndroidExamples.this, ExampleWebkit.class);\n\t\t\t\tstartActivity(i_Alert);\n\t\t\t}\n \t\n });\n \n example_location = (Button) findViewById(R.id.example_location);\n example_location.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent i_Alert = new Intent(AndroidExamples.this, Location.class);\n\t\t\t\tstartActivity(i_Alert);\n\t\t\t}\n \t\n });\n \n }", "@Override\n public void onClick(View v) {\n startActivity(new Intent(StartPage.this,MainActivity.class));\n }", "private void startSettingsActivity() {\n Intent intent = new Intent(this, SettingsActivity.class);\n /*start*/\n startActivity(intent);\n }", "public void bookResource(View view)\r\n {\n startActivity(new Intent(this, BookResource.class));\r\n // Intent intent_bookResource = new Intent(this, BookResource.class );\r\n // intent_bookResource.putExtra(\"userName\", userName);\r\n // this.startActivity(intent_bookResource);\r\n\r\n\r\n\r\n\r\n }", "public void LocateClick(View view){\n startActivity(new Intent(this,locateKNUST.class));\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(context,ProfileActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n saveRoundSetting();\n saveMembers();\n SharedPreferences sharedpreferencesRS= getSharedPreferences(\"SCREENNAME\" , MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedpreferencesRS.edit();\n editor.putString(\"screenname\" , \"roundsetting\");\n editor.commit();\n Bundle bundle = new Bundle();\n //bundle.putString(\"FROMACTIVITY_WHERE\",\"ROUNDSEETING\");\n bundle.putString(\"MemberNumber\",\"first\");\n bundle.putString(\"Membername\",\"\"+ youtextt[0].getText());\n Intent NextScreen = new Intent(RoundSetting.this, TeeSelection.class);\n NextScreen.putExtras(bundle);\n startActivity(NextScreen);\n finish();\n //m_newRound.setBackgroundResource(R.drawable.buttonselected);\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(getContext(), ProfileActivity.class);\n startActivity(intent);\n\n }", "public void showAbout(View view){\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(NowPlaying.this, classDestination);\n // starting new activity\n startActivity(intent);\n }" ]
[ "0.75784934", "0.73142534", "0.73055804", "0.71849614", "0.7018242", "0.69326097", "0.68638414", "0.68294495", "0.6697509", "0.66889143", "0.66816425", "0.6631904", "0.66280055", "0.6620668", "0.66117513", "0.66114646", "0.65979177", "0.6577812", "0.6558461", "0.65337163", "0.6486336", "0.64761776", "0.6469639", "0.6464794", "0.6449007", "0.64451766", "0.6441298", "0.6441275", "0.6441275", "0.6441275", "0.6429137", "0.6427004", "0.6403401", "0.6401967", "0.6396223", "0.6390387", "0.6387456", "0.6386831", "0.6385663", "0.6380401", "0.6373965", "0.63718855", "0.63601583", "0.6358413", "0.6352655", "0.63521075", "0.63460344", "0.6344155", "0.6342297", "0.6342075", "0.6330985", "0.6327264", "0.632523", "0.6313609", "0.6302704", "0.62738806", "0.6273742", "0.62644714", "0.62592465", "0.6255154", "0.6250985", "0.62487835", "0.62382", "0.62377036", "0.6235697", "0.6234455", "0.62309957", "0.62307173", "0.6230395", "0.6223616", "0.6220088", "0.6217333", "0.6213002", "0.61912423", "0.61897343", "0.61887", "0.61751825", "0.6174817", "0.61740947", "0.61694884", "0.6169483", "0.6168797", "0.6163277", "0.61609983", "0.6160586", "0.6154598", "0.6149694", "0.61474836", "0.6147472", "0.6141381", "0.61406565", "0.61346257", "0.61261487", "0.6124575", "0.61228466", "0.61197656", "0.61175084", "0.61170363", "0.611637", "0.6114288", "0.6112699" ]
0.0
-1
we read something and perse for unicode...You knwo.
public void afterTextChanged(Editable s) { String d = edit.getText().toString(); Log.d("data","data:::::"+d); txt1.setText(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract char read_wchar();", "public String readUTF() throws IOException;", "@Override\n public boolean isUnicode()\n {\n return true;\n }", "@Test\n\tpublic void test_ReadNextUtf8String() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, -107, -61, -65, 0, -22, -87, -107, 0);\n\t\tassertEquals(\"\\uaa55\\u00ff\", br.readNextUtf8String());\n\t\tassertEquals(\"\\uaa55\", br.readNextUtf8String());\n\t}", "@Test\n\tpublic void test_ReadUtf8String() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, -107, -61, -65, 0);\n\t\tassertEquals(\"\\uaa55\\u00ff\", br.readUtf8String(0));\n\t}", "@Test\n\tpublic void test_ReadUtf8String_bad_data() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, 'A', 0);\n\t\tassertEquals(\"\\ufffdA\" /* unicode replacement char, 'A'*/, br.readUtf8String(0));\n\t}", "private static String loadConvert(String str) {\n\t\tint off = 0;\n\t\tint len = str.length();\n\t\tchar[] in = str.toCharArray();\n\t\tchar[] convtBuf = new char[1024];\n\t\tif (convtBuf.length < len) {\n\t\t\tint newLen = len * 2;\n\t\t\tif (newLen < 0) {\n\t\t\t\tnewLen = Integer.MAX_VALUE;\n\t\t\t}\n\t\t\tconvtBuf = new char[newLen];\n\t\t}\n\t\tchar aChar;\n\t\tchar[] out = convtBuf;\n\t\tint outLen = 0;\n\t\tint end = off + len;\n\n\t\twhile (off < end) {\n\t\t\taChar = in[off++];\n\t\t\tif (aChar == '\\\\') {\n\t\t\t\taChar = in[off++];\n\t\t\t\tif (aChar == 'u') {\n\t\t\t\t\t// Read the xxxx\n\t\t\t\t\tint value = 0;\n\t\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\t\taChar = in[off++];\n\t\t\t\t\t\tswitch (aChar) {\n\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\tcase '5':\n\t\t\t\t\t\tcase '6':\n\t\t\t\t\t\tcase '7':\n\t\t\t\t\t\tcase '8':\n\t\t\t\t\t\tcase '9':\n\t\t\t\t\t\t\tvalue = (value << 4) + aChar - '0';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'a';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'A':\n\t\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tcase 'C':\n\t\t\t\t\t\tcase 'D':\n\t\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tcase 'F':\n\t\t\t\t\t\t\tvalue = (value << 4) + 10 + aChar - 'A';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"Malformed \\\\uxxxx encoding.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tout[outLen++] = (char) value;\n\t\t\t\t} else {\n\t\t\t\t\tif (aChar == 't')\n\t\t\t\t\t\taChar = '\\t';\n\t\t\t\t\telse if (aChar == 'r')\n\t\t\t\t\t\taChar = '\\r';\n\t\t\t\t\telse if (aChar == 'n')\n\t\t\t\t\t\taChar = '\\n';\n\t\t\t\t\telse if (aChar == 'f')\n\t\t\t\t\t\taChar = '\\f';\n\t\t\t\t\tout[outLen++] = aChar;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tout[outLen++] = aChar;\n\t\t\t}\n\t\t}\n\t\treturn new String(out, 0, outLen);\n\t}", "@Test\n public void testunicode32() {\n assertEquals(\"\\uD834\\uDD1E\", JsonReader.read(\"\\\"\\\\uD834\\\\uDD1E\\\"\"));\n }", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n StringReader stringReader0 = new StringReader(\"kE4X 9\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-1), 66, 1279);\n char char0 = javaCharStream0.readChar();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals('k', char0);\n }", "private char readUnicodeChar() throws IOException, DasmError {\n int result = 0;\n for (int i = 0; i < 4; i++) {\n readNextChar();\n if (nextChar == -1) return 0;\n\n int tmp = Character.digit((char) nextChar, 16);\n if (tmp == -1)\n throw new DasmError(\"Invalid '\\\\u' escape sequence\");\n result = (result << 4) | tmp;\n }\n return (char) result;\n }", "private void readEncoding(BufferedReader reader) throws IOException {\n String encoding = reader.readLine();\r\n if ( ! AbstractUtf8Message.UTF8_ENCODING_HEADER_STRING.equals(encoding)) {\r\n throw new IOException(\"Expected UTF-8 header when decoding UTF-8 message\");\r\n }\r\n }", "protected String readUnicodeInputStream(InputStream in) throws IOException {\n\t\tUnicodeReader reader = new UnicodeReader(in, null);\n\t\tString data = FileCopyUtils.copyToString(reader);\n\t\treader.close();\n\t\treturn data;\n\t}", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n StringReader stringReader0 = new StringReader(\"H+\\\"RE_]I95BDm\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n char char0 = javaCharStream0.ReadByte();\n assertEquals('H', char0);\n }", "public abstract String read_wstring();", "String read();", "String read();", "public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }", "@Test\n\tpublic void testUTF8() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(UTF8_FILE), \"UTF-8\")\n\t\t);\n\t\tReadTestCSVFile(reader);\n\t}", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n StringReader stringReader0 = new StringReader(\"1dIHR}';Z<m5\\\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n char char0 = javaCharStream0.ReadByte();\n assertEquals('1', char0);\n }", "@Test(timeout = 4000)\n public void test063() throws Throwable {\n JavaCharStream javaCharStream0 = new JavaCharStream((Reader) null);\n javaCharStream0.maxNextCharInd = 2;\n javaCharStream0.prevCharIsCR = true;\n char char0 = javaCharStream0.readChar();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals('\\u0000', char0);\n }", "public abstract char read_char();", "public static void convertIllegalToUnicode(Reader r, Writer w)\r\n\t throws IOException\r\n\t {\r\n\t\t \r\n\t\t BufferedReader in = new BufferedReader(r);\r\n\t\t PrintWriter out = new PrintWriter(new BufferedWriter(w));\r\n\t\t \r\n\t\t int c;\r\n\t\t while((c = in.read()) != -1) {\r\n\t\t if(!isValidXMLChar(c)) {\r\n\t\t \tString illegalCharacter = EFGProperties.getProperty(ILLEGALCHARACTER_TEXT);\r\n\t\t out.print(illegalCharacter);\r\n\t\t \t/*String hex = Integer.toHexString(c);\r\n\t\t switch (hex.length()) { \r\n\t\t case 1: out.print(\"\\\\u000\" + hex); break;\r\n\t\t case 2: out.print(\"\\\\u00\" + hex); break;\r\n\t\t case 3: out.print(\"\\\\u0\" + hex); break;\r\n\t\t default: out.print(\"\\\\u\" + hex); break;\r\n\t\t }*/\r\n\t\t }\r\n\t\t else {\r\n\t\t \t out.write(c);\r\n\t\t }\r\n\t\t }\r\n\t\t out.flush(); // flush the output buffer we create\r\n\r\n\t }", "private char read() throws SAXException, IOException {\n for (;;) { // the loop is here for the CRLF case\n if (unreadBuffer != -1) {\n char c = (char) unreadBuffer;\n unreadBuffer = -1;\n return c;\n }\n assert (bufLen > -1);\n pos++;\n assert pos <= bufLen;\n linePrev = line;\n colPrevPrev = colPrev;\n colPrev = col;\n col++;\n if (pos == bufLen) {\n boolean charDataContinuation = false;\n if (cstart > -1) {\n flushChars();\n charDataContinuation = true;\n }\n bufLen = reader.read(buf);\n assert bufLen <= buf.length;\n if (bufLen == -1) {\n return '\\u0000';\n } else {\n for (int i = 0; i < characterHandlers.length; i++) {\n CharacterHandler ch = characterHandlers[i];\n ch.characters(buf, 0, bufLen);\n }\n }\n if (charDataContinuation) {\n cstart = 0;\n }\n pos = 0;\n }\n char c = buf[pos];\n if (c > '\\u007F' && nonAsciiProhibited\n && !alreadyComplainedAboutNonAscii) {\n err(\"The character encoding of the document was not explicit but the document contains non-ASCII.\");\n }\n switch (c) {\n case '\\n':\n /*\n * U+000D CARRIAGE RETURN (CR) characters, and U+000A LINE\n * FEED (LF) characters, are treated specially. Any CR\n * characters that are followed by LF characters must be\n * removed, and any CR characters not followed by LF\n * characters must be converted to LF characters.\n */\n if (prev == '\\r') {\n // swallow the LF\n colPrev = colPrevPrev;\n col = 0;\n if (cstart != -1) {\n flushChars();\n cstart = pos + 1;\n }\n prev = c;\n continue;\n } else {\n linePrev = line;\n line++;\n colPrevPrev = colPrev;\n colPrev = col;\n col = 0;\n }\n break;\n case '\\r':\n c = buf[pos] = '\\n';\n linePrev = line;\n line++;\n colPrevPrev = colPrev;\n colPrev = col;\n col = 0;\n prev = '\\r';\n if (contentModelFlag != ContentModelFlag.PCDATA) {\n prevFourPtr++;\n prevFourPtr %= 4;\n prevFour[prevFourPtr] = c;\n }\n return c;\n case '\\u0000':\n /*\n * All U+0000 NULL characters in the input must be replaced\n * by U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such\n * characters is a parse error.\n */\n err(\"Found U+0000 in the character stream.\");\n c = buf[pos] = '\\uFFFD';\n break;\n case '\\u000B':\n case '\\u000C':\n if (inContent) {\n if (contentNonXmlCharPolicy == XmlViolationPolicy.FATAL) {\n fatal(\"This document is not mappable to XML 1.0 without data loss due to a character that is not a legal XML 1.0 character.\");\n } else {\n if (contentNonXmlCharPolicy == XmlViolationPolicy.ALTER_INFOSET) {\n c = buf[pos] = ' ';\n }\n warn(\"This document is not mappable to XML 1.0 without data loss due to a character that is not a legal XML 1.0 character.\");\n }\n }\n break;\n default:\n if ((c & 0xFC00) == 0xDC00) {\n // Got a low surrogate. See if prev was high surrogate\n if ((prev & 0xFC00) == 0xD800) {\n int intVal = (prev << 10) + c + SURROGATE_OFFSET;\n if (isNonCharacter(intVal)) {\n warn(\"Astral non-character.\");\n }\n if (isAstralPrivateUse(intVal)) {\n warnAboutPrivateUseChar();\n }\n } else {\n // XXX figure out what to do about lone high\n // surrogates\n err(\"Found low surrogate without high surrogate.\");\n c = buf[pos] = '\\uFFFD';\n }\n } else if (inContent && (c < ' ' || isNonCharacter(c))\n && (c != '\\t')) {\n if (contentNonXmlCharPolicy == XmlViolationPolicy.FATAL) {\n fatal(\"This document is not mappable to XML 1.0 without data loss due to a character that is not a legal XML 1.0 character.\");\n } else {\n if (contentNonXmlCharPolicy == XmlViolationPolicy.ALTER_INFOSET) {\n c = buf[pos] = '\\uFFFD';\n }\n warn(\"This document is not mappable to XML 1.0 without data loss due to a character that is not a legal XML 1.0 character.\");\n }\n } else if (isPrivateUse(c)) {\n warnAboutPrivateUseChar();\n }\n }\n prev = c;\n if (contentModelFlag != ContentModelFlag.PCDATA) {\n prevFourPtr++;\n prevFourPtr %= 4;\n prevFour[prevFourPtr] = c;\n }\n return c;\n }\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Z[^o)j]BO6Ns,$`3$e\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1, 1, 0);\n char char0 = javaCharStream0.readChar();\n assertEquals(1, javaCharStream0.getBeginColumn());\n assertEquals(1, javaCharStream0.getEndLine());\n assertEquals('Z', char0);\n }", "private String readText(NdefRecord record) throws UnsupportedEncodingException {\n\n byte[] payload = record.getPayload();\n\n // Get the Text Encoding\n String textEncoding = ((payload[0] & 128) == 0) ? \"UTF-8\" : \"UTF-16\";\n\n // Get the Language Code\n int languageCodeLength = payload[0] & 0063;\n\n // String languageCode = new String(payload, 1, languageCodeLength, \"US-ASCII\");\n // e.g. \"en\"\n\n // Get the Text\n return new String(payload, languageCodeLength + 1, payload.length - languageCodeLength - 1, textEncoding);\n }", "String readString();", "public String read();", "public String readUTF() throws IOException {\n\n\t\t// Punt on this one and use DataInputStream routines.\n\t\tDataInputStream d = new DataInputStream(this);\n\t\treturn d.readUTF();\n\n\t}", "public abstract String read_string();", "private static void appendMultibyte(Reader r, StringBuilder s) throws IOException {\n int b = decodeHex(r.read()) << 4 | decodeHex(r.read());\n int u, n;\n if (b < 0x80) { u = b; n = 1; }\n else if (b < 0xe0) { u = b & 0x1f; n = 2; }\n else if (b < 0xf0) { u = b & 0x0f; n = 3; }\n else if (b < 0xf8) { u = b & 0x07; n = 4; }\n else throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 octet in %HH code\");\n for (int i = 1; i < n; ++i) {\n if (r.read() != '%') throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 sequence in %HH codes\");\n b = decodeHex(r.read()) << 4 | decodeHex(r.read());\n if ((b & 0xc0) != 0x80) throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 octet in %HH code\");\n u = u << 6 | b &0x3f;\n }\n if (u < 0x10000) s.append((char) u);\n else {\n s.append((char) (0xd800 + (u >>> 10)));\n s.append((char) (0xdc00 + (u & 0x3ff)));\n }\n }", "@Test(timeout = 4000)\n public void test092() throws Throwable {\n StringReader stringReader0 = new StringReader(\"s15IMZA$C/uXdG]R\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0, 0);\n javaParserTokenManager0.getNextToken();\n javaParserTokenManager0.getNextToken();\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(13, javaCharStream0.bufpos);\n assertEquals(\"uXdG\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n StringReader stringReader0 = new StringReader(\"9F}n S'~C\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(74, token0.kind);\n assertEquals(\"F\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n try { \n javaCharStream0.readChar();\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n StringReader stringReader0 = new StringReader(\"q,rv8PAfKjbSw`H(r\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[8];\n stringReader0.read(charArray0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "public static String readUTF(DataInputStream dis) throws IOException {\r\n\t\tif(dis.readBoolean())\r\n\t\t\treturn dis.readUTF();\r\n\t\treturn null;\r\n\t}", "@Test(timeout = 4000)\n public void test066() throws Throwable {\n StringReader stringReader0 = new StringReader(\"=<D!T!tLp\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 20, 0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[5];\n stringReader0.read(charArray0);\n javaParserTokenManager0.getNextToken();\n javaParserTokenManager0.getNextToken();\n assertEquals(1, javaCharStream0.getBeginColumn());\n assertEquals(3, javaCharStream0.getEndColumn());\n }", "@Test(timeout = 4000)\n public void test016() throws Throwable {\n StringReader stringReader0 = new StringReader(\"7o9?>+o`*qi$\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n char char0 = javaCharStream0.readChar();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals('7', char0);\n }", "@Override\n\tpublic void load() {\n\t\tFileHandle file = Gdx.files.internal(DogRunner.PARENT_DIR + \"charset.txt\");\n\t\tcharset = file.readString();\n\t}", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n StringReader stringReader0 = new StringReader(\"%Jo{\\\"m8'0fuS\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 77, 77);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"%\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test010() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 754, 65, 0);\n javaCharStream0.backup((-1));\n try { \n javaCharStream0.readChar();\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n StringReader stringReader0 = new StringReader(\"oh\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 89, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[1];\n stringReader0.read(charArray0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(74, token0.kind);\n assertEquals(\"h\", token0.toString());\n }", "char readChar();", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n StringReader stringReader0 = new StringReader(\"U3kE.1/hk@Tuvel]`L\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "@Test(timeout = 4000)\n public void test129() throws Throwable {\n StringReader stringReader0 = new StringReader(\"CjTuDS`ey>LBoXB\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(5, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "@Test(timeout = 4000)\n public void test008() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Z[^o)j]BO6Ns,$`3$e\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.BeginToken();\n javaCharStream0.readChar();\n javaCharStream0.GetImage();\n assertEquals(1, javaCharStream0.bufpos);\n }", "private String readIt(InputStream stream) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(stream, \"iso-8859-1\"), 128);\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n return sb.toString();\n }", "void readNextChar() throws ReaderException;", "abstract int read(TextInput ti) throws IOException;", "public boolean hasUnicodeRepresentation();", "@Test(timeout = 4000)\n public void test001() throws Throwable {\n StringReader stringReader0 = new StringReader(\"~\\\"Py BTn?,~tnf\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 15, 15);\n javaCharStream0.bufpos = (-1396);\n javaCharStream0.backup((-1396));\n javaCharStream0.adjustBeginLineColumn((-1396), 76);\n assertEquals(0, javaCharStream0.bufpos);\n }", "public void setNChar()\n/* */ {\n/* 1168 */ this.isNChar = true;\n/* */ }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "char getReadChar();", "protected String readString(DataInput in) throws IOException {\n if (in.readBoolean())\n return (in.readUTF());\n return null;\n }", "public char readChar()\r\n/* 441: */ {\r\n/* 442:454 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 443:455 */ return super.readChar();\r\n/* 444: */ }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n StringReader stringReader0 = new StringReader(\"%WC\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.backup(1);\n javaCharStream0.BeginToken();\n javaCharStream0.AdjustBuffSize();\n javaCharStream0.adjustBeginLineColumn(1, 1);\n assertEquals(0, javaCharStream0.bufpos);\n }", "static void lookUp() throws IOException {\n switch (curr_char) {\n case 124:\n curr_type = TokenType.VERT;\n break;\n case 42:\n curr_type = TokenType.STAR;\n break;\n case 43:\n curr_type = TokenType.PLUS;\n break;\n case 63:\n curr_type = TokenType.QMARK;\n break;\n case 40:\n curr_type = TokenType.LPAREN;\n break;\n case 41:\n curr_type = TokenType.RPAREN;\n break;\n case 46:\n curr_type = TokenType.PERIOD;\n break;\n case 92:\n curr_type = TokenType.BSLASH;\n break;\n case 91:\n int temp = 0;\n temp = pbIn.read();\n if(temp == 94) {\n curr_type = TokenType.LNEGSET;\n }\n else {\n pbIn.unread(temp);\n curr_type = TokenType.LPOSSET;\n }\n break;\n case 93:\n curr_type = TokenType.RSET;\n break;\n case 60:\n curr_type = TokenType.LANGLE;\n break;\n case 62:\n curr_type = TokenType.RANGLE;\n break;\n case 13:\n int checkCRLF;\n curr_type = TokenType.EOL;\n checkCRLF = pbIn.read();\n if(checkCRLF != 10)\n {\n pbIn.unread(checkCRLF);\n }\n break;\n default:\n if(Character.isDigit((char)curr_char) || Character.isLetter((char)curr_char) || curr_char == 94 || curr_char == 47)\n {\n curr_type = TokenType.CHAR;\n }\n else {\n curr_type = TokenType.ERROR;\n }\n }\n }", "@Test(timeout = 4000)\n public void test046() throws Throwable {\n StringReader stringReader0 = new StringReader(\".wa]!^8?,%1IG\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(85, token0.kind);\n }", "@Test(timeout = 4000)\n public void test132() throws Throwable {\n StringReader stringReader0 = new StringReader(\"??S,\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 28, 21, 21);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(91, token0.kind);\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n StringReader stringReader0 = new StringReader(\"ej.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, (-1076), 115);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(1, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "@Override\n protected void onTextData(Reader r) throws IOException {\n\n }", "public abstract void read_wchar_array(char[] value, int offset, int\nlength);", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n StringReader stringReader0 = new StringReader(\"_ofi`~l69>EJdF\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1874, 1874);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(1877, javaCharStream0.getColumn());\n }", "@Test(timeout = 4000)\n public void test136() throws Throwable {\n StringReader stringReader0 = new StringReader(\"~:}LC@A$L'2q+~$ja\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n stringReader0.read();\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\":\", token0.toString());\n }", "@Test\n\tpublic final void testUmlaut() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n\t\t// U - upper case\n\t\tassertSingleResult(\"2797607\", fldName, \"Über\");\n\t\tassertSingleResult(\"2797607\", fldName, \"über\");\n\t\tassertSingleResult(\"2797607\", fldName, \"uber\");\n\t\t// u - lower case\n\t\tassertSingleResult(\"2797607\", fldName, \"Fragwürdigkeit\");\n\t\tassertSingleResult(\"2797607\", fldName, \"Fragwurdigkeit\");\n\t\t// o - lower case\n\t\tassertSingleResult(\"2797607\", fldName, \"Murtomäki\");\n\t\tassertSingleResult(\"2797607\", fldName, \"Murtomaki\");\n\t}", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n StringReader stringReader0 = new StringReader(\"V&H#2E6u%Ql&dI\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 2, 2);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"V\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Cf&9B{tMCu\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n char[] charArray0 = new char[5];\n stringReader0.read(charArray0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(4, javaCharStream0.getColumn());\n }", "@Test(timeout = 4000)\n public void test019() throws Throwable {\n StringReader stringReader0 = new StringReader(\"GD}>zPHIT2VcF.\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 91, 91);\n javaCharStream0.BeginToken();\n javaCharStream0.adjustBeginLineColumn((-366), 1);\n int int0 = javaCharStream0.getLine();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals((-366), int0);\n }", "@Override\n public void setCharacterEncoding(String arg0) {\n\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n StringReader stringReader0 = new StringReader(\"anBz*^T>\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n stringReader0.read();\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(2, javaCharStream0.bufpos);\n assertEquals(3, javaCharStream0.getEndColumn());\n }", "String shortRead();", "@Test(timeout = 4000)\n public void test065() throws Throwable {\n StringReader stringReader0 = new StringReader(\"%WC\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.readChar();\n javaCharStream0.backup(1);\n javaCharStream0.readChar();\n javaCharStream0.backup(1);\n char char0 = javaCharStream0.BeginToken();\n assertEquals(1, javaCharStream0.getBeginColumn());\n assertEquals('%', char0);\n }", "@Test(timeout = 4000)\n public void test054() throws Throwable {\n StringReader stringReader0 = new StringReader(\"ri/eKZUUk8oH\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 66, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(1, javaCharStream0.bufpos);\n assertEquals(\"ri\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test067() throws Throwable {\n StringReader stringReader0 = new StringReader(\"q,rv8PAfKjbSw`H(r\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[6];\n stringReader0.read(charArray0);\n javaParserTokenManager0.getNextToken();\n assertEquals(5, javaCharStream0.bufpos);\n assertEquals(6, javaCharStream0.getEndColumn());\n }", "@Test(timeout = 4000)\n public void test135() throws Throwable {\n StringReader stringReader0 = new StringReader(\"]X%^)tJ\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 0, 0);\n char char0 = javaCharStream0.ReadByte();\n assertEquals((-1), javaCharStream0.bufpos);\n assertEquals(']', char0);\n }", "private int convertUnicodeLiteralToChar(int n) {\n\n final int START_STATE = 1;\n final int MODIFIED_DATA_STATE = START_STATE + 1;\n final int START_OF_ESCAPE = MODIFIED_DATA_STATE + 1;\n final int UNICODE_NIBBLE1 = START_OF_ESCAPE + 1;\n final int UNICODE_NIBBLE2 = UNICODE_NIBBLE1 + 1;\n final int UNICODE_NIBBLE3 = UNICODE_NIBBLE2 + 1;\n final int UNICODE_NIBBLE4 = UNICODE_NIBBLE3 + 1;\n\n int state = START_STATE;\n boolean data_buffer_modified = false;\n\n int ucount = 0;\n\n char u1 = 0, u2 = 0, u3 = 0, c = 0;\n\n int i = 0, j = 0;\n while (i < n) {\n c = data[i++];\n switch (state) {\n case START_STATE:\n if (c == '\\\\') {\n j = i - 1;\n state = START_OF_ESCAPE;\n }\n break;\n case MODIFIED_DATA_STATE:\n if (c != '\\\\') {\n data[j++] = c;\n } else {\n state = START_OF_ESCAPE;\n }\n break;\n case START_OF_ESCAPE:\n if (c != 'u') {\n if (data_buffer_modified) {\n data[j++] = '\\\\';\n data[j++] = c;\n state = MODIFIED_DATA_STATE;\n } else {\n state = START_STATE;\n }\n } else {\n ucount = 1;\n state = UNICODE_NIBBLE1;\n }\n break;\n case UNICODE_NIBBLE1:\n if (isHexadecimalDigit(c)) {\n u1 = c;\n state = UNICODE_NIBBLE2;\n } else if (c == 'u') {\n ucount++;\n } else {\n if (data_buffer_modified) {\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = c;\n state = MODIFIED_DATA_STATE;\n } else {\n state = START_STATE;\n }\n }\n break;\n case UNICODE_NIBBLE2:\n if (isHexadecimalDigit(c)) {\n u2 = c;\n state = UNICODE_NIBBLE3;\n } else {\n if (data_buffer_modified) {\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n data[j++] = c;\n state = MODIFIED_DATA_STATE;\n } else {\n state = START_STATE;\n }\n }\n break;\n case UNICODE_NIBBLE3:\n if (isHexadecimalDigit(c)) {\n u3 = c;\n state = UNICODE_NIBBLE4;\n } else {\n if (data_buffer_modified) {\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n data[j++] = u2;\n data[j++] = c;\n state = MODIFIED_DATA_STATE;\n } else {\n state = START_STATE;\n }\n }\n break;\n case UNICODE_NIBBLE4:\n if (isHexadecimalDigit(c)) {\n if (!data_buffer_modified) {\n data_buffer_modified = true;\n }\n data[j++] = (char) ((((((map[u1] << 4) + map[u2]) << 4) + map[u3]) << 4) + map[c]);\n state = MODIFIED_DATA_STATE;\n } else {\n if (data_buffer_modified) {\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n data[j++] = u2;\n data[j++] = u3;\n data[j++] = c;\n state = MODIFIED_DATA_STATE;\n } else {\n state = START_STATE;\n }\n }\n break;\n }\n }\n // afterthoughts\n if (data_buffer_modified) {\n switch (state) {\n case START_OF_ESCAPE:\n data[j++] = '\\\\';\n break;\n case UNICODE_NIBBLE1:\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n break;\n case UNICODE_NIBBLE2:\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n break;\n case UNICODE_NIBBLE3:\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n data[j++] = u2;\n break;\n case UNICODE_NIBBLE4:\n data[j++] = '\\\\';\n for (int k = 0; k < ucount; k++) {\n data[j++] = 'u';\n }\n data[j++] = u1;\n data[j++] = u2;\n data[j++] = u3;\n break;\n }\n n = j;\n }\n return n;\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n StringReader stringReader0 = new StringReader(\".`BW=S&r<Py\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\".\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.backup(1);\n javaCharStream0.getLine();\n assertEquals(4094, javaCharStream0.bufpos);\n }", "abstract public int get(int codePoint);", "private String readString(InputStream in) throws IOException {\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in, \"iso-8859-1\"));\r\n\t\tString inputLine;\r\n\t\tStringBuffer response = new StringBuffer();\r\n\t\twhile ((inputLine = reader.readLine()) != null) {\r\n\t\t\tresponse.append(inputLine);\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn response.toString();\r\n\t}", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n StringReader stringReader0 = new StringReader(\"~:}LC@A$L'2q+~$ja\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(90, token0.kind);\n }", "@Test(timeout = 4000)\n public void test026() throws Throwable {\n StringReader stringReader0 = new StringReader(\"d{IHR}D';Z<m5\\\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.BeginToken();\n int int0 = javaCharStream0.getColumn();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(1, int0);\n }", "@Test\n\tpublic final void testRussianMacronOverI() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n\t\tassertSingleResult(\"2099904\", fldName, \"istorīi\");\n\t\tassertSingleResult(\"2099904\", fldName, \"istorii\");\n\t\t// i have no idea if these should work, or how it should look here\n//\t\tassertSingleDocWithValue(\"2099904\", fldName, \"istorī\");\n//\t\tassertSingleDocWithValue(\"2099904\", fldName, \"istori\");\n\t}", "public String readString(boolean inc)\r\n {\n switch(vp.types[vp.dataPos])\r\n {\r\n case VirtualPointer.StringAscii:\r\n return readString(inc, false);\r\n case VirtualPointer.StringUnicode:\r\n return readString(inc, true);\r\n }\r\n//#endif\r\n //Need to figure out String type\r\n int len = vp.data.length;\r\n for (int i = vp.dataPos; i < len; i++)\r\n {\r\n if ((vp.data[i] & 0xFF) > 0x7F)\r\n {\r\n \t//Byte has the high-bit set, this means UTF-8\r\n return readString(inc, true);\r\n }\r\n }\r\n //ASCII\r\n return readString(inc, false);\r\n }", "@Test(timeout = 4000)\n public void test110() throws Throwable {\n StringReader stringReader0 = new StringReader(\"RaLz,<NBG_}Q[P4}\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 20, 0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(74, token0.kind);\n }", "char getPreviousReadChar();", "@Test(timeout = 4000)\n public void test078() throws Throwable {\n StringReader stringReader0 = new StringReader(\"q,rv8PAfKjbSw`H(r\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[2];\n stringReader0.read(charArray0);\n javaParserTokenManager0.getNextToken();\n assertEquals(9, javaCharStream0.bufpos);\n assertEquals(10, javaCharStream0.getColumn());\n }", "public void testIsFirstUtf8Byte() {\n checkIsFirstUtf8Byte(\"0\"); // First 2 bits: 00\n checkIsFirstUtf8Byte(\"A\"); // First 2 bits: 01\n \n checkIsFirstUtf8Byte(\"\\u00A2\"); // 2 bytes in UTF-8.\n checkIsFirstUtf8Byte(\"\\u20AC\"); // 3 bytes in UTF-8.\n checkIsFirstUtf8Byte(\"\\uD852\\uDF62\"); // 4 bytes in UTF-8. (surrogate pair)\n }", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n StringReader stringReader0 = new StringReader(\"WA.W2e9@MV5G\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1, 1);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[8];\n stringReader0.read(charArray0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(3, javaCharStream0.bufpos);\n assertEquals(\"MV5G\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test072() throws Throwable {\n StringReader stringReader0 = new StringReader(\"=<D!T!tLp\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n stringReader0.read();\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"<\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\\\"native\\\"\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(5, javaCharStream0.bufpos);\n assertEquals(\"native\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\\\"for\\\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 114, (-473));\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n char[] charArray0 = new char[1];\n stringReader0.read(charArray0);\n javaParserTokenManager0.getNextToken();\n assertEquals(2, javaCharStream0.bufpos);\n assertEquals((-471), javaCharStream0.getColumn());\n }", "static void getNonBlank() throws IOException{\n while(curr_char == 32)\n {\n curr_char = pbIn.read();\n }\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n StringReader stringReader0 = new StringReader(\"+%WC\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.readChar();\n javaCharStream0.readChar();\n try { \n javaCharStream0.FillBuff();\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "String readUTF(byte data[], int off, int len)\n {\n StringBuffer buf = new StringBuffer();\n for (int end = off + len; off < end;)\n {\n int ch = data[off++] & 0xFF;\n switch (ch >> 4)\n {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n break;\n case 12:\n case 13:\n if (off >= len)\n {\n return null;\n }\n // 110x xxxx 10xx xxxx\n ch = ((ch & 0x1F) << 6) | (data[off++] & 0x3F);\n break;\n case 14:\n if (off + 2 >= len)\n {\n return null;\n }\n // 1110 xxxx 10xx xxxx 10xx xxxx\n ch = ((ch & 0x0f) << 12) | ((data[off++] & 0x3F) << 6) | (data[off++] & 0x3F);\n break;\n default:\n if (off + 1 >= len)\n {\n return null;\n }\n // 10xx xxxx, 1111 xxxx\n ch = ((ch & 0x3F) << 4) | (data[off++] & 0x0f);\n break;\n }\n buf.append((char) ch);\n }\n return buf.toString();\n }", "@Test(timeout = 4000)\n public void test061() throws Throwable {\n StringReader stringReader0 = new StringReader(\"anBz*^T>\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n char[] charArray0 = new char[4];\n stringReader0.read(charArray0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(\"^\", token0.toString());\n }", "@Test(timeout = 4000)\n public void test036() throws Throwable {\n StringReader stringReader0 = new StringReader(\"%%WC\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 6, 1, 6);\n javaCharStream0.backup(4073);\n // Undeclared exception!\n try { \n javaCharStream0.readChar();\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -4067\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public void testOneByte () throws IOException\n {\n Stream stream;\n\n stream = new Stream (new ByteArrayInputStream (new byte[] { (byte)0x42 }));\n assertTrue (\"erroneous character\", 0x42 == stream.read ());\n assertTrue (\"erroneous character\", -1 == stream.read ());\n }", "@Test(timeout = 4000)\n public void test165() throws Throwable {\n StringReader stringReader0 = new StringReader(\"%>eQj)Oz[`\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(1, javaCharStream0.getEndLine());\n }", "@Override\n public String getCharacterEncoding() {\n return null;\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n StringReader stringReader0 = new StringReader(\"<?ep_cuW)AS/}\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 0, (-1));\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(88, token0.kind);\n }" ]
[ "0.6876977", "0.68022734", "0.6752044", "0.66546446", "0.6610939", "0.6554332", "0.6377431", "0.63577247", "0.63218707", "0.6246676", "0.62419933", "0.623753", "0.6231884", "0.62308854", "0.6167355", "0.6167355", "0.6162418", "0.6072441", "0.60703945", "0.6037819", "0.6019219", "0.6007459", "0.60072523", "0.599926", "0.597223", "0.59620327", "0.59617835", "0.5942041", "0.5933169", "0.592329", "0.5818747", "0.58187264", "0.58186907", "0.58184886", "0.5818264", "0.5798856", "0.57956254", "0.57913727", "0.5785995", "0.5779946", "0.57778144", "0.57698023", "0.5765019", "0.57507145", "0.5738756", "0.57168347", "0.57147133", "0.5707063", "0.57054913", "0.5699016", "0.5698702", "0.569407", "0.56912655", "0.56909066", "0.5686428", "0.5682882", "0.5681012", "0.5680979", "0.5671948", "0.56713444", "0.56617415", "0.56602013", "0.5660195", "0.56552535", "0.56498563", "0.5647552", "0.5643167", "0.5637101", "0.5635561", "0.56250656", "0.5624216", "0.5615646", "0.5614993", "0.56018823", "0.559706", "0.5590306", "0.558966", "0.5583869", "0.55793524", "0.55786544", "0.55764", "0.55746704", "0.5572989", "0.556675", "0.5561766", "0.5561158", "0.55597264", "0.5557039", "0.5556912", "0.55540746", "0.5547961", "0.5544528", "0.5541481", "0.553952", "0.5539475", "0.55382264", "0.5531785", "0.5531457", "0.5530779", "0.5528402", "0.5512161" ]
0.0
-1