query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get the name analyser for this key. This is, essentially the analyser used to build the key
public NameAnalyser getAnalyser() { return analyser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public K getName() {\n return key;\n }", "@Override\n public String toString() {\n return getAnalyzerName();\n }", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "String getShortNameKey();", "public String getNameKey() {\n return getName();\n }", "public String getAnalyserSetup() {\n\t\tList<String> analyserNames = new ArrayList<>(this.enabledAnalysers);\n\n\t\tCollections.sort(analyserNames);\n\n\t\treturn StringUtils.join(analyserNames, \"_\");\n\t}", "public Object getKey() { return name; }", "@Override\n\tpublic String getAnalysisName() {\n\t\treturn analysisName;\n\t}", "public String toString() {return name().charAt(0) + name().substring(1).toLowerCase();}", "public String getAnserName() {\r\n return anserName;\r\n }", "private String name() {\n\t\tif (currentIndex >= data.length\n\t\t\t\t|| !Character.isLetter(data[currentIndex])) {\n\t\t\tthrow new LexerException();\n\t\t}\n\n\t\tString value = String.valueOf(data[currentIndex++]);\n\t\twhile (currentIndex < data.length\n\t\t\t\t&& (Character.isLetter(data[currentIndex])\n\t\t\t\t\t\t|| data[currentIndex] == '_'\n\t\t\t\t\t\t|| Character.isDigit(data[currentIndex]))) {\n\t\t\tvalue += data[currentIndex++];\n\t\t}\n\n\t\treturn value;\n\t}", "@Override\n public String toString() {\n String name = this.name().substring(0,1);\n if (this.name().length() > 1) {\n for (int i = 1; i < this.name().length(); i++) {\n String charAt = this.name().substring(i, i + 1);\n if (charAt.equals(\"_\"))\n charAt = \" \";\n name += charAt.toLowerCase();\n }\n }\n return name;\n }", "@Override\n\tpublic String name() {\n\t\treturn filter.name();\n\t}", "public String getAlgorithmName ()\n {\n return algName; //(new String (algName + \" --> Input Stream : \" + this.inputName));\n }", "public String getName()\r\n\t{\r\n\r\n\t\treturn ALGORITHM_NAME;\r\n\t}", "public String getAliasName() {\n return name;\n }", "public String getAliasName() {\n return name;\n }", "public String getAliasName() {\n return name;\n }", "public String getAliasName() {\n return name;\n }", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "public java.lang.String getName();", "java.lang.String getMetricName();", "public static String getNameFilter() {\r\n return nameFilter;\r\n }", "public String getName() {\n return aao.getName();\n }", "AlphabetNameReference createAlphabetNameReference();", "public String asName() {\n return this.name().toLowerCase(Locale.getDefault());\n }", "String getFilterName();", "public String getName() {\n\t\treturn JWLC.nativeHandler().wlc_output_get_name(this.to());\n\t}", "public String toString(){\n\t\tString abbrv = this.name().substring(0,1);\t\t\n\t\treturn abbrv;\n\t}", "public String getName() {\n\t\treturn name.toLowerCase();\n\t}", "public String getName() {\n return DecoratedSortAlgo.getName();\r\n }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return name; }", "public String getName() { return this.name; }", "public String getName() { return this.name; }", "public String getName() { return this.name; }", "public String getAlias() {\n return this.key.substring(this.key.lastIndexOf(\".\") + 1);\n }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.6198281", "0.6151138", "0.6051109", "0.60307044", "0.59971994", "0.5979264", "0.59704286", "0.5882766", "0.58767265", "0.57900876", "0.5773135", "0.5754749", "0.5741453", "0.5708815", "0.5682773", "0.5677364", "0.5677364", "0.5677364", "0.5677364", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.5674521", "0.56700313", "0.56689936", "0.56418246", "0.56247395", "0.5614593", "0.561112", "0.55848384", "0.5576623", "0.5568297", "0.55640477", "0.55404395", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5536254", "0.5532541", "0.5532541", "0.5532541", "0.55320054", "0.5531329", "0.5531329", "0.5531329", "0.5531329", "0.5531329" ]
0.702995
0
Get the normenclatural code for this key.
public NomenclaturalCode getCode() { return code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final String getLabelCode() {\r\n\t\tString label = this.label;\r\n\t\tif (StringUtil.isEmpty(label))\r\n\t\t\treturn \"\";\r\n\t\tStringBuilder labelCode = new StringBuilder();\r\n\t\tint startIndex = 0;\r\n\t\tfor (int i=0; i<label.length();i++) {\r\n\t\t\tif (label.charAt(i) >= 'A' && label.charAt(i)<= 'Z') {\r\n\t\t\t\tif (startIndex!=0) {\r\n\t\t\t\t\tlabelCode.deleteCharAt(startIndex-1);\r\n\t\t\t\t\tlabelCode.append(\"-\");\r\n\t\t\t\t}\r\n\t\t\t\tlabelCode.append(label.substring(startIndex, i).toLowerCase());\r\n\t\t\t\tstartIndex = i;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (startIndex<label.length()) {\r\n\t\t\tif (startIndex!=0) {\r\n\t\t\t\tlabelCode.deleteCharAt(startIndex-1);\r\n\t\t\t\tlabelCode.append(\"-\");\r\n\t\t\t}\r\n\t\t\tlabelCode.append(label.substring(startIndex).toLowerCase());\r\n\t\t}\r\n\t\treturn labelCode.toString();\r\n\t}", "String getCmt();", "public java.lang.String getDeterminerCode()\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(DETERMINERCODE$32);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(DETERMINERCODE$32);\n }\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public @Int8 byte getDialNorm()\r\n\t\tthrows PropertyNotPresentException;", "@Override\r\n public String getUniCode()\r\n {\r\n if (getColor() == 'N')\r\n {\r\n setCode(\"\\u265B\");\r\n }\r\n else\r\n {\r\n setCode(\"\\u2655\");\r\n }\r\n return getCode();\r\n }", "public String getCode() {\n return (String)getAttributeInternal(CODE);\n }", "public String getFormatedLanguageCode() {\n String result = \"\";\n final String name = this.name();\n final String[] nameArray = name.split(\"_\");\n\n if (nameArray.length == 1) {\n result = nameArray[0].toLowerCase();\n } else if (nameArray.length == 2) {\n result = nameArray[0].toLowerCase() + \"-\" + nameArray[1].toUpperCase();\n }\n\n return result;\n }", "public String getCode() {\n return super.getString(Constants.Properties.CODE);\n }", "default String getNormalizedText() {\n return meta(\"nlpcraft:nlp:normtext\");\n }", "com.google.protobuf.StringValue getCurrencyCode();", "public String getS_c_n() {\n return s_c_n;\n }", "public String getLccCode() {\n\t\treturn lccCode;\n\t}", "public ST getProductServiceClarificationCodeValue() { \r\n\t\tST retVal = this.getTypedField(18, 0);\r\n\t\treturn retVal;\r\n }", "public String getCompCode() {\n return (String)getAttributeInternal(COMPCODE);\n }", "public BigDecimal getCODE() {\r\n return CODE;\r\n }", "public BigDecimal getCODE() {\r\n return CODE;\r\n }", "public String code() {\r\n return code == null ? String.format(\"%s%04d\", type, num) : code;\r\n }", "public java.lang.String getCDBRAND() {\n return CDBRAND;\n }", "public String code() {\n\t\treturn (\"ID\"+this.hashCode()).replace(\"-\", \"M\");\n\t}", "public String value() {\n return formattedCode;\n }", "java.lang.String getHangmogCode();", "@Override\n public NormalizationType get_normalization_type() {\n return NormalizationType.BIN;\n }", "public String getDictContentAltCode() {\r\n return (String) getAttributeInternal(DICTCONTENTALTCODE);\r\n }", "java.lang.String getCode();", "java.lang.String getCode();", "public String getCode() {\n\t\treturn codeText.getText().toString();\n\t}", "public StrColumn getLabelAltIdW() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"label_alt_id_w\", StrColumn::new) :\n getBinaryColumn(\"label_alt_id_w\"));\n }", "public String getCoderegion() {\n return (String) getAttributeInternal(CODEREGION);\n }", "public String getDeliCenterCode() {\n return deliCenterCode;\n }", "public ST getPsl18_ProductServiceClarificationCodeValue() { \r\n\t\tST retVal = this.getTypedField(18, 0);\r\n\t\treturn retVal;\r\n }", "public java.lang.String getClassCode()\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(CLASSCODE$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(CLASSCODE$30);\n }\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getFormatedLanguageNoDialectCode() {\n final String name = this.name();\n final String[] nameArray = name.split(\"_\");\n\n return nameArray[0].toLowerCase();\n }", "public final String mo29130c() {\n return this.f19164d;\n }", "public String getCode() { \n\t\treturn getCodeElement().getValue();\n\t}", "@Accessor(qualifier = \"code\", type = Accessor.Type.GETTER)\n\tpublic String getCode()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(CODE);\n\t}", "public String getLBR_InterestCode();", "public String c() {\r\n switch (c) {\r\n case RED:\r\n return \"Red\";\r\n case BLUE:\r\n return \"Blue\";\r\n case YELLOW:\r\n return \"Yellow\";\r\n case GREEN:\r\n return \"Green\";\r\n default:\r\n return \"Colorless\";\r\n }\r\n }", "public String getcCode() {\n\t\treturn this.cCode;\n\t}", "public IS getProductServiceClarificationCodeType() { \r\n\t\tIS retVal = this.getTypedField(17, 0);\r\n\t\treturn retVal;\r\n }", "public final synchronized String m97l() {\n String str;\n if (this.f104P) {\n if (this.f96H == null) {\n this.f96H = C0048a.m280b(this.f139z);\n }\n str = this.f96H;\n } else {\n str = \"\";\n }\n return str;\n }", "public String getCountryCode() {\n return normalizedBic.substring(COUNTRY_CODE_INDEX, COUNTRY_CODE_INDEX + COUNTRY_CODE_LENGTH);\n }", "public String getCn() {\n return (String)getAttributeInternal(CN);\n }", "@MapName(\"lnfkey\")\n \tString getLnfKey();", "public String getCapCode() {\n return capCode;\n }", "public String getLBR_ProtestCode();", "public String getBranchCode() {\n return normalizedBic.substring(BRANCH_CODE_INDEX, BRANCH_CODE_INDEX + BRANCH_CODE_LENGTH);\n }", "public String getCode() {\n return (String) get(\"code\");\n }", "java.lang.String getCit();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "public String getLocationCode() {\n return normalizedBic.substring(LOCATION_CODE_INDEX, LOCATION_CODE_INDEX + LOCATION_CODE_LENGTH);\n }", "public String getCode() {\n String code = getPrefixCode();\r\n code += format(5, this.getNumber());\r\n return code;\r\n }", "java.lang.String getCdkey();", "public String getLBR_SitNF();", "Character getCode();", "public IS getPsl17_ProductServiceClarificationCodeType() { \r\n\t\tIS retVal = this.getTypedField(17, 0);\r\n\t\treturn retVal;\r\n }", "public double getBKC099() {\n return BKC099;\n }", "public StrColumn getLabelAsymId() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"label_asym_id\", StrColumn::new) :\n getBinaryColumn(\"label_asym_id\"));\n }", "java.lang.String getLanguageCode();", "java.lang.String getLanguageCode();", "public java.lang.String getHangmogCode() {\n java.lang.Object ref = hangmogCode_;\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 hangmogCode_ = s;\n }\n return s;\n }\n }", "public java.lang.String getStudent_languageCenter() {\n\t\treturn _primarySchoolStudent.getStudent_languageCenter();\n\t}", "public String getCodebase() {\n return(translateCodebase());\n }", "public String getLBR_LatePaymentPenaltyCode();", "public java.lang.String getCode() {\r\n return code;\r\n }", "public String getCode();", "public String getCode();", "public String getInstitutionCode() {\n return normalizedBic.substring(INSTITUTION_CODE_INDEX, INSTITUTION_CODE_INDEX + INSTITUTION_CODE_LENGTH);\n }", "public static long getNorm32FromSurrogatePair(long paramLong, char paramChar)\n/* */ {\n/* 365 */ return \n/* 366 */ 0xFFFFFFFF & NormTrieImpl.normTrie.getTrailValue((int)paramLong, paramChar);\n/* */ }", "public String getNormal() {\r\n return normal;\r\n }", "public StrColumn getLabelAltIdU() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"label_alt_id_u\", StrColumn::new) :\n getBinaryColumn(\"label_alt_id_u\"));\n }", "@Override\n public String getCampusCode() {\n final Person initiator = getPersonService().getPerson(getDocumentHeader().getWorkflowDocument().getInitiatorPrincipalId());\n return initiator.getCampusCode();\n }", "@Override\n public final Integer constTypeCode() {\n return this.manufacture.constTypeCode();\n }", "public String getCodeposte() {\n return (String) getAttributeInternal(CODEPOSTE);\n }", "public String constant() {\n\t\tString tmp = methodBase().replaceAll(\"([a-z])([A-Z])\",\"$1_$2\");\n\t\treturn tmp.toUpperCase();\n\t}", "String getLanguageCode();", "public StrColumn getLabelAltId() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"label_alt_id\", StrColumn::new) :\n getBinaryColumn(\"label_alt_id\"));\n }", "public String getDictContentCode() {\r\n return (String) getAttributeInternal(DICTCONTENTCODE);\r\n }", "public final String getShortCode() { //since 2017-06-21\r\n\t\treturn ChangeCategories.getShortCode(code.number);\r\n\t}", "public String getCodecommune() {\n return (String) getAttributeInternal(CODECOMMUNE);\n }", "Code getCode();", "public String getIntermidiateCode(){\r\n\t\treturn iCode;\r\n\t}", "public String getCode() {\t\t\t\t\t\t\t\t\treturn code;\t\t\t\t\t\t\t}", "public java.lang.String getCode() {\n java.lang.Object ref = code_;\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 code_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getLaSign() {\n return laSign;\n }", "public String getCode()\r\n\t{\r\n\t\treturn code;\r\n\t}", "public short code() {\n return this.code;\n }", "public String getCorpcode() {\n return corpcode;\n }", "public static String getConformingColorSchemeCode(String scheme) {\r\n if (!StringUtils.isBlank(scheme)) {\r\n ColorScheme colorScheme = ColorScheme.fromName(scheme);\r\n if (colorScheme != null) {\r\n return colorScheme.code();\r\n }\r\n }\r\n\r\n return null;\r\n }", "public String getCode() {\n return _toBaseUnit._code;\n }", "public String getDefaultDisplayCurrencyCode() {\n return (String) get(\"default_display_currency_code\");\n }", "public String getCpsm() {\n return cpsm;\n }", "public String getCode () {\r\n\t\treturn code;\r\n\t}", "public int getNormalizedFirstChar() {\n return normalizedFirstChar;\n }", "public String code() {\n return this.code;\n }", "public String code() {\n return this.code;\n }", "public String getCode() {\r\n\t\treturn code;\r\n\t}" ]
[ "0.5794492", "0.57231766", "0.5559371", "0.5544028", "0.55164206", "0.549805", "0.5491075", "0.53949535", "0.53437126", "0.5333522", "0.5319529", "0.5296285", "0.52810585", "0.5273381", "0.5268948", "0.5268948", "0.5260973", "0.5250422", "0.52491057", "0.5243922", "0.52417153", "0.52324617", "0.52290183", "0.5219785", "0.5219785", "0.5216544", "0.52086043", "0.5200063", "0.5180605", "0.5160348", "0.5153928", "0.5147364", "0.5145062", "0.5142467", "0.5140003", "0.5127738", "0.51255584", "0.512476", "0.5123981", "0.51129955", "0.5105458", "0.5095179", "0.50917554", "0.50799495", "0.5075067", "0.50724274", "0.50694096", "0.5060555", "0.5060042", "0.5060042", "0.5060042", "0.5060042", "0.5060042", "0.5058343", "0.50572354", "0.5041247", "0.50366014", "0.50364816", "0.5017228", "0.50168663", "0.5012209", "0.5006348", "0.5006348", "0.5001029", "0.49970567", "0.49962217", "0.4992611", "0.49920622", "0.49910793", "0.49910793", "0.498847", "0.49879852", "0.49873012", "0.49795604", "0.49783412", "0.4970702", "0.49702665", "0.496537", "0.49639302", "0.49597567", "0.4954358", "0.495261", "0.49518913", "0.4949717", "0.49480453", "0.49478483", "0.49467677", "0.49431607", "0.49424455", "0.4930599", "0.49287483", "0.49271256", "0.4924668", "0.49232483", "0.49209183", "0.4920099", "0.49139258", "0.4913512", "0.4913512", "0.49073806" ]
0.6384803
0
Get the normalised scientific name
public String getScientificName() { return scientificName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NonNull\n public String getScientificName() {\n return scientificName;\n }", "public void setScientificName(@NonNull String scientificName) {\n this.scientificName = scientificName;\n }", "public StrColumn getEbiOrganismScientific() {\n return delegate.getColumn(\"ebi_organism_scientific\", DelegatingStrColumn::new);\n }", "@NotNull\n @Digits(integer=10,fraction=0)\n\t@Override\n\tpublic String getEname() {\n\t\treturn super.getEname();\n\t}", "public static String getGenusAndSpeciesName(String name){\r\n\t\tchar firstChar = name.charAt(0);\r\n\t\tif(firstChar>='A'&&firstChar<='Z'){//Genus name often capitalized\r\n\t\t\tStringBuffer gsName = new StringBuffer();\r\n\t\t\tString[] fields = name.split(\"[\\\\s\\\\-]+\");\r\n\t\t\tgsName.append(fields[0]);//genus name\r\n\t\t\tif(fields.length>1){\r\n\t\t\t\tgsName.append(\" \");\r\n\t\t\t\tgsName.append(fields[1]);\r\n\t\t\t}\r\n\t\t\treturn gsName.toString();\r\n\t\t}\r\n\t\treturn name;\r\n\t}", "public abstract String toHumanString();", "String getSupName();", "private String normalize(String name) {\n return Normalizer.normalize(name, Normalizer.Form.NFKD);\n }", "public static String name(){\n return \"10.Schneiderman.Lorenzo\"; \n }", "protected String retrieveOrganismScientificName(String taxId) throws BridgeFailedException {\n if (this.taxIdToScientificName.containsKey(taxId)){\n return this.taxIdToScientificName.get(taxId);\n }\n\n Organism term = this.taxonomyService.fetchByTaxID(Integer.parseInt(taxId));\n\n if (term == null){\n this.taxIdToScientificName.put(taxId, null);\n return null;\n }\n\n String scientificName = term.getScientificName();\n this.taxIdToScientificName.put(taxId, scientificName);\n\n return scientificName;\n }", "public String getName() {\n return stid.trim() + std2.trim();\n }", "public String toString(){\n\t\tString abbrv = this.name().substring(0,1);\t\t\n\t\treturn abbrv;\n\t}", "public String getCanonicalUnitPrice()\n {\n String retName = null;\n\n // Expecting the linked list to be sorted\n for(Unit unit : measurementUnits)\n if(unit.getValue() <= size)\n retName = size + \" \" + unit.getName() + \" per \" + price.getValue() + \" satoshi\";\n else\n break;\n\n return retName;\n }", "java.lang.String getS9();", "public char get_floating_suffix();", "public abstract String getMachineUnlocalizedName();", "public String getCanonicalUnitName()\n {\n String retName = null;\n\n // Expecting the linked list to be sorted\n for(Unit unit : measurementUnits)\n if(unit.getValue() <= size)\n retName = unit.getName();\n else\n break;\n\n return retName;\n }", "public String getInternalName();", "String getEString();", "java.lang.String getSsn();", "protected static String getSRTMName (Position pos) {\n int lat = (int) pos.getLatitude();\n int lon = (int) pos.getLongitude();\n String n = \"\";\n \n if (lat > 0)\n n += \"N\" + String.format(\"%02d\", lat);\n else\n n += \"S\" + String.format(\"%03d\", Math.abs (lat));\n \n if (lon > 0)\n n += \"E\" + String.format(\"%03d\", lon);\n else\n n += \"W\" + String.format(\"%03d\", Math.abs (lon));\n\n return n;\n }", "public String getScoreName(String shortName) {\n return psmModeller.getScoreName(shortName);\n }", "static private String formats(String target)\n\t{\n\t\tString tmp = target.trim();\n\t\tif (tmp.length() < 1) return \"NaName\";\n\t\treturn (Character.toString(tmp.charAt(0)).toUpperCase()) + tmp.substring(1,tmp.length()).toLowerCase();\n\t}", "public String getScientificNameAuthorship() {\n return scientificNameAuthorship;\n }", "public String getFamilyName() throws PDFNetException {\n/* 550 */ return GetFamilyName(this.a);\n/* */ }", "String simpleName();", "public String getFormatName() {\n\t\tString name = getName();\n\t\tif (name.startsWith(SpotlessPlugin.EXTENSION)) {\n\t\t\tString after = name.substring(SpotlessPlugin.EXTENSION.length());\n\t\t\tif (after.endsWith(SpotlessPlugin.CHECK)) {\n\t\t\t\treturn after.substring(0, after.length() - SpotlessPlugin.CHECK.length()).toLowerCase(Locale.US);\n\t\t\t} else if (after.endsWith(SpotlessPlugin.APPLY)) {\n\t\t\t\treturn after.substring(0, after.length() - SpotlessPlugin.APPLY.length()).toLowerCase(Locale.US);\n\t\t\t}\n\t\t}\n\t\treturn name;\n\t}", "public String toString() {return name().charAt(0) + name().substring(1).toLowerCase();}", "public String getNomcheflieu() {\n return (String) getAttributeInternal(NOMCHEFLIEU);\n }", "@Override\n\tpublic String getSymbolName()\n\t{\n\t\treturn getFormattedText();\n\t}", "public String newHumanName() {\n return String.format(\"%s %s\", newName(4, 6), newName(4, 8));\n }", "String getDisplay_name();", "String getShortName();", "public static String formatString(String s) {\n char[] charArray = s.toCharArray();\n StringBuilder normalizedString = new StringBuilder();\n for (char character:charArray\n ) {\n if (character == 'd' || character == 'D'){\n normalizedString.append('d');\n continue;\n }\n normalizedString.append(Normalizer.normalize(String.valueOf(character), Normalizer.Form.NFD));\n }\n\n return normalizedString.toString().replaceAll(\"[^\\\\p{ASCII}]\", \"\");\n }", "@NotNull\n private static String normalize(@NotNull String displayName) {\n int angleIndex = displayName.indexOf('<');\n return angleIndex != -1 ? displayName.substring(0, angleIndex) : displayName;\n }", "public String getNotchianName();", "public String getDeviceSeriesName() {\r\n if(isMips32()) {\r\n String devname = getDeviceName();\r\n\r\n if(devname.startsWith(\"M\")) {\r\n return devname.substring(0, 3);\r\n } else if(devname.startsWith(\"USB\")) {\r\n return devname.substring(0, 5);\r\n } else {\r\n return devname.substring(0, 7);\r\n }\r\n } else {\r\n return getAtdfFamily();\r\n }\r\n }", "public String getExperimentTitle() throws InvalidFormatException;", "public String getShortName(String URI)\r\n\t{\r\n\t\tString sname = ONT_MODEL.shortForm(URI);\r\n\t\tif(sname.startsWith(\":\"))\r\n\t\t\treturn sname.substring(1);\r\n\t\telse\r\n\t\t\treturn sname;\r\n\t}", "public java.lang.String shortName () { throw new RuntimeException(); }", "String getSlingName();", "@Override\n public String toString() {\n String name = this.name().substring(0,1);\n if (this.name().length() > 1) {\n for (int i = 1; i < this.name().length(); i++) {\n String charAt = this.name().substring(i, i + 1);\n if (charAt.equals(\"_\"))\n charAt = \" \";\n name += charAt.toLowerCase();\n }\n }\n return name;\n }", "private String defaultFormat(double d) {\n\t\tString str = \"\" + d;\n\t\tint availableSpace = getSize().width - 2 * PIXEL_MARGIN;\n\t\tFontMetrics fm = getFontMetrics(getFont());\n\t\tif (fm.stringWidth(str) <= availableSpace) return str;\n\t\tint eIndex = str.indexOf(\"E\");\n\t\tString suffix = \"\";\n\t\tif (eIndex != -1) {\n\t\t\tsuffix = str.substring(eIndex);\n\t\t\tstr = str.substring(0, eIndex);\n\t\t\ttry {\n\t\t\t\td = parser.parse(str).doubleValue();\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tthrow new ErrorException(ex);\n\t\t\t}\n\t\t}\n\t\tNumberFormat standard = NumberFormat.getNumberInstance(Locale.US);\n\t\tstandard.setGroupingUsed(false);\n\t\tString head = str.substring(0, str.indexOf('.') + 1);\n\t\tint fractionSpace = availableSpace - fm.stringWidth(head + suffix);\n\t\tif (fractionSpace > 0) {\n\t\t\tint fractionDigits = fractionSpace / fm.stringWidth(\"0\");\n\t\t\tstandard.setMaximumFractionDigits(fractionDigits);\n\t\t\treturn standard.format(d) + suffix;\n\t\t}\n\t\tstr = \"\";\n\t\twhile (fm.stringWidth(str + \"#\") <= availableSpace) {\n\t\t\tstr += \"#\";\n\t\t}\n\t\treturn str;\n\t}", "private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }", "java.lang.String getPkpfe1000();", "public abstract String getRawName();", "public CWE getSubstanceManufacturerName(int rep) { \r\n\t\tCWE retVal = this.getTypedField(17, rep);\r\n\t\treturn retVal;\r\n }", "protected static String convertGeomName(Object value, boolean isDisplay)\n \t{\n \t\tif (value == null || !(value instanceof String)) return null;\n \t\tString str = (String)value;\n \t\tint indexOfAt = str.indexOf('@');\n \t\tif (isDisplay)\n \t\t{\n \t\t\tif (indexOfAt >= 0)\n \t\t\t{\n \t\t\t\tString newS = \"\";\n \t\t\t\tfor (int i = 0; i < str.length(); i++)\n \t\t\t\t{\n \t\t\t\t\tchar c = str.charAt(i);\n \t\t\t\t\tif (c == '@') c = '_';\n \t\t\t\t\tnewS += c;\n \t\t\t\t}\n \t\t\t\tstr = newS;\n \t\t\t}\n \t\t} else if (indexOfAt < 0) return null;\n \t\treturn str;\n \t}", "private static String normalize(String s) {\r\n\t\t//return Normalizer.normalize(s, Normalizer.Form.NFC);\r\n\t\treturn s;\r\n\t}", "public CWE getRxa17_SubstanceManufacturerName(int rep) { \r\n\t\tCWE retVal = this.getTypedField(17, rep);\r\n\t\treturn retVal;\r\n }", "private String extarctStudentName(String record) throws noStudentNameException{\n\t\tString name = record.substring(0, record.indexOf(':'));\n\t\tname = name.trim();\n\t\tcheckNameValidation(name);\n\t\treturn name;\n\t}", "private String getNormalizedNumberString(String originalStr) {\n String numberStr = normalizationPreprocessing(originalStr);\n\n String normalized = null;\n try {\n normalized = normalizer.normalize(numberStr);\n if (commonNumberMappings.containsKey(normalized)) {\n normalized = commonNumberMappings.get(normalized);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return normalized;\n }", "private String getFormattedName(String bossName) {\r\n\t\tString[] startingLetters = { \"corporeal\", \"king black\", \"nomad\", \"tormented\", \"avatar\" };\r\n\t\tfor(int i = 0; i < startingLetters.length; i++)\r\n\t\t\tif(bossName.toLowerCase().contains(startingLetters[i].toLowerCase()))\r\n\t\t\t\treturn \"the \"+bossName;\r\n\t\treturn bossName;\r\n\t}", "String siToCcsdsName(String siName);", "public abstract String getShortName();", "public abstract String getShortName();", "public abstract String getShortName();", "public String getName() throws PDFNetException {\n/* 537 */ return GetName(this.a);\n/* */ }", "java.lang.String getSchoolName();", "java.lang.String getS2();", "public String getName(){\n \treturn this.name().replace(\"_\", \" \");\n }", "String intermediateSystemName();", "String getPhysElemLongName(int phys_elem, int ent_id) {\n switch (phys_elem) {\n case 1:\n return \"Imager Visible\";\n case 2:\n return \"Imager 3.9 micron IR\";\n case 3:\n return \"Imager 6.7/6.5 micron IR (WV)\";\n case 4:\n return \"Imager 11 micron IR\";\n case 5:\n return \"Imager 12 micron IR\";\n case 6:\n return \"Imager 13 micron IR\";\n case 7:\n return \"Imager 1.3 micron IR\";\n case 13:\n return \"Lifted Index LI\";\n case 14:\n return \"Precipitable Water PW\";\n case 15:\n return \"Surface Skin Temperature\";\n case 16:\n return \"Lifted Index LI\";\n case 17:\n return \"Precipitable Water PW\";\n case 18:\n return \"Surface Skin Temperature\";\n case 19:\n return \"Convective Available Potential Energy\";\n case 20:\n return \"land-sea Temperature\";\n case 21:\n return \"Wind Index\";\n case 22:\n return \"Dry Microburst Potential Index\";\n case 23:\n return \"Microburst Potential Index\";\n case 24:\n return \"Derived Convective Inhibition\";\n case 25:\n if (ent_id == 99)\n return \"1km National Hybrid Hydrometeor Classification Composite (Unidata)\";\n else\n return \"Volcano_imagery\";\n case 26:\n if (ent_id == 99)\n return \"1 km National Echo Tops Composite (Unidata)\";\n else\n return \"4 km National Echo Tops\";\n case 27:\n if (ent_id == 99)\n return \"1 km National Base Reflectivity Composite (Unidata)\";\n else\n return \"Cloud Top Pressure or Height\";\n case 28:\n if (ent_id == 99)\n return \"1 km National Reflectivity Composite (Unidata)\";\n else\n return \"Cloud Amount\";\n case 29:\n if (ent_id == 99)\n return \"1 km National Vertically Integrated Liquid Water (Unidata)\";\n else\n return \"4 km National Vertically Integrated Liquid Water\";\n case 30:\n if (ent_id == 99)\n return \"1 km National 1-hour Precipitation (Unidata)\";\n else\n return \"Surface wind speeds over oceans and Great Lakes\";\n case 31:\n if (ent_id == 99)\n return \"4 km National Storm Total Precipitation (Unidata)\";\n else\n return \"Surface Wetness\";\n case 32:\n return \"Ice concentrations\";\n case 33:\n return \"Ice type\";\n case 34:\n return \"Ice edge\";\n case 35:\n return \"Cloud water content\";\n case 36:\n return \"Surface type\";\n case 37:\n return \"Snow indicator\";\n case 38:\n return \"Snow/water content\";\n case 39:\n return \"Derived volcano imagery\";\n case 41:\n return \"Sounder 14.71 micron imagery\";\n case 42:\n return \"Sounder 14.37 micron imagery\";\n case 43:\n return \"Sounder 14.06 micron imagery\";\n case 44:\n return \"Sounder 13.64 micron imagery\";\n case 45:\n return \"Sounder 13.37 micron imagery\";\n case 46:\n return \"Sounder 12.66 micron imagery\";\n case 47:\n return \"Sounder 12.02 micron imagery\";\n case 48:\n return \"11.03 micron sounder image\";\n case 49:\n return \"Sounder 11.03 micron imagery\";\n case 50:\n return \"7.43 micron sounder image\";\n case 51:\n return \"7.02 micron sounder image\";\n case 52:\n return \"6.51 micron sounder image\";\n case 53:\n return \"Sounder 4.57 micron imagery\";\n case 54:\n return \"Sounder 4.52 micron imagery\";\n case 55:\n return \"4.45 micron sounder image\";\n case 56:\n return \"Sounder 4.13 micron imagery\";\n case 57:\n return \"3.98 micron sounder image\";\n case 58:\n return \"Sounder 3.74 micron imagery\";\n case 59:\n return \"VIS sounder image \";\n default:\n return \"unknown physical element \" + phys_elem;\n }\n }", "public\n\tString toString()\n\t{\n\t\treturn \"minf\";\n\t}", "private String determineNameUsingMSE() {\n\n ColorNames colorNames = new ColorNames();\n ArrayList<ColorName> colorList = colorNames.getColorList();\n\n ColorName closestMatch = null;\n int minMSE = Integer.MAX_VALUE;\n int mse;\n\n for (ColorName c : colorList) {\n mse = c.computeMSE(red, green, blue);\n if (mse < minMSE) {\n minMSE = mse;\n closestMatch = c;\n }\n }\n\n if (closestMatch != null) {\n return closestMatch.getName();\n } else {\n return null;\n }\n }", "public abstract float mo70722e(String str);", "EPREFIX_TYPE getName();", "public java.lang.String getFriendlyName()\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_element_user(FRIENDLYNAME$2, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public String getName() {\r\n return \"Boyer/Moore-Suche in Strings\";\r\n }", "public String getAlternativeOrderNumberSuffix();", "@Override\n public String getEISProductName() throws ResourceException {\n return repository.getDescriptor(Repository.REP_NAME_DESC);\n }", "String getLongName();", "String getSurname();", "java.lang.String getS1();", "public String getHuman() { \n\t\treturn getHumanElement().getValue();\n\t}", "public String getName() {\n return isWhite() ? \"WN\" : \"BN\";\n }", "public String getLocalizedName()\n {\n return StatCollector.translateToLocal(this.getUnlocalizedName() + \".\" + TreeOresLogs2.EnumType.DIAMOND.getUnlocalizedName() + \".name\");\n }", "static public String normalize(String s){\n\t\treturn s;\n\t}", "java.lang.String getS();", "public String getSystemName();", "public abstract String shortName();", "public String readS2SN(){\r\n return mFactoryBurnUtil.readS2SN();\r\n }", "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences of the letters outlined in step 3\n\t\toriginal = original.substring(0,1) + original.substring(1).replaceAll(\"[AEIHOUWY]\",\"\");\n\t\t\n\t\t// Return the result\n\t\treturn original;\n\t}", "public String getStrdisplayname() {\n return strdisplayname;\n }", "String getPresetName();", "private String printName() {\n \t\treturn GPSFilterTextUtils.printName( this.getResources(), this.area.getName() );\n \t}", "public String geteName() {\n return eName;\n }", "public String getSname() {\n return sname;\n }", "public String toString() {\n\t\tif(scale=='K'||scale=='k'){\r\n\t\t\treturn String.format(\"%.2f %s\"+\"ilograms\", wValue, scale);\r\n\t\t} else {\r\n\t\t\tscale=Character.toUpperCase(scale);\r\n\t\t\treturn String.format(\"%.2f %s\"+\"ounds\", wValue, scale);\r\n\t\t}\r\n\t}", "String getPluralisedName();", "public static String makeSystemName(String displayName) {\n\t\treturn displayName.toLowerCase().replaceAll(\"\\\\s+\", \"\");\n\t}", "private static char parseOutScale(String s)\n {\n final int N = s.length();\n // If the last character of s is a digit, the whole of s is assumed to\n // be a numeral and a space is returned. Otherwise, the last character\n // of s is returned.\n char lastChar = s.charAt(N-1);\n if (Character.isDigit(lastChar)) \n { return ' '; }\n else\n { return lastChar; }\n }", "protected String computeTitle() {\r\n\t\treturn getRawTitle();\r\n\t}", "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 dayName() {\n int arrayDay = (day + month + year + (year/4) + (year/100) % 4) % 7;\n return dayName[arrayDay];\n }", "@Override\n public String name(String name, Meter.Type type, @Nullable String baseUnit) {\n String conventionName = NamingConvention.snakeCase.name(name, type, baseUnit);\n\n switch (type) {\n case COUNTER:\n case DISTRIBUTION_SUMMARY:\n case GAUGE:\n if (baseUnit != null && !conventionName.endsWith(\"_\" + baseUnit))\n conventionName += \"_\" + baseUnit;\n break;\n }\n\n switch (type) {\n case COUNTER:\n if (!conventionName.endsWith(\"_total\"))\n conventionName += \"_total\";\n break;\n case TIMER:\n case LONG_TASK_TIMER:\n if (conventionName.endsWith(timerSuffix)) {\n conventionName += \"_seconds\";\n }\n else if (!conventionName.endsWith(\"_seconds\"))\n conventionName += timerSuffix + \"_seconds\";\n break;\n }\n\n String sanitized = nameChars.matcher(conventionName).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "java.lang.String getDisplayName();", "java.lang.String getDisplayName();", "java.lang.String getDisplayName();", "java.lang.String getDisplayName();" ]
[ "0.7634369", "0.66436887", "0.6152614", "0.6023103", "0.59789973", "0.597729", "0.5906464", "0.5891818", "0.5858281", "0.5806503", "0.57119447", "0.5671858", "0.56711304", "0.56688434", "0.5668771", "0.56558585", "0.5652768", "0.561553", "0.55853605", "0.5559683", "0.5557191", "0.55476695", "0.55406165", "0.5533536", "0.551112", "0.549141", "0.5489956", "0.54784095", "0.5459263", "0.54477966", "0.54429656", "0.54405147", "0.5437943", "0.5437018", "0.5431283", "0.54236", "0.5418676", "0.5392312", "0.53876513", "0.53844124", "0.53766847", "0.5372058", "0.5371139", "0.53654927", "0.5357674", "0.5355599", "0.53542405", "0.5352558", "0.5343283", "0.5339493", "0.53392303", "0.533505", "0.5332711", "0.5328566", "0.5321838", "0.5321838", "0.5321838", "0.5317373", "0.53163207", "0.5313502", "0.53118", "0.53101885", "0.52927065", "0.52926445", "0.5287513", "0.52807254", "0.52791184", "0.5275831", "0.52627486", "0.5254124", "0.5252932", "0.52528393", "0.5244123", "0.52348524", "0.5233058", "0.52307016", "0.52293426", "0.52269715", "0.52246225", "0.52203655", "0.52122796", "0.52072203", "0.5201381", "0.5197466", "0.51943105", "0.5192619", "0.5188557", "0.5187782", "0.51833606", "0.51817507", "0.5180622", "0.51795805", "0.5176887", "0.5173568", "0.51667786", "0.5166314", "0.5164185", "0.5164185", "0.5164185", "0.5164185" ]
0.76696175
0
Get the normalised scientific name authorship
public String getScientificNameAuthorship() { return scientificNameAuthorship; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getAuthorName();", "private String getAuthorStringForLookup(CitedArticle citedArticle) {\n List<CitedArticleAuthor> authors = citedArticle.getAuthors();\n return authors.size() > 0 ? authors.get(0).getSurnames() : \"\";\n }", "private static String authorLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, NAME_STR, NAME);\n }", "private static String canonicalize (String authorName) {\n\t\tif (authorName.contains(\",\")) {\n\t\t\treturn removeAccents(authorName.substring(0, authorName.indexOf(',')).toLowerCase());\n\t\t} else if( authorName.contains(\" \")) {\n\t\t\treturn removeAccents(authorName.substring(authorName.lastIndexOf(' ') + 1, authorName.length()).toLowerCase());\n\t\t} else {\n\t\t\treturn removeAccents(authorName.toLowerCase());\n\t\t}\n\t}", "public String getAuthor() {\n\t\tint start = \"Author:\".length();\n\t\tint end = author.indexOf('<');\n\t\tString parsed = author.substring(start, end).trim();\n\t\treturn parsed;\n\t}", "public String getAuthor() {\n\t\treturn \"Prasoon, Vikas, Shantanu\";\n\t}", "private String getOpinionAuthor() {\n String opinion = opinionView.getSelectionModel().getSelectedItem();\n String username = \"\";\n int i = 0;\n while (opinion.charAt(i) != ' '){\n username += opinion.charAt(i);\n i++;\n }\n return username;\n }", "String getAuthor();", "String getAuthor();", "public String getAuthor()\r\n {\r\n return(\"Judy O'Brien\");\r\n }", "public String getAuthorFullName() {\r\n String fullAuthorName = \"\";\r\n\r\n fullAuthorName = author.getAuthorFullName();\r\n return fullAuthorName;\r\n }", "private String getAuthor(CloudEntity post) {\n if (post.getCreatedBy() != null) {\n return \" \" + post.getCreatedBy().replaceFirst(\"@.*\", \"\");\n } else {\n return \"<anonymous>\";\n }\n }", "private String getAuthor(CloudEntity post) {\n if (post.getCreatedBy() != null) {\n return \" \" + post.getCreatedBy().replaceFirst(\"@.*\", \"\");\n } else {\n return \"<anonymous>\";\n }\n }", "public static String fixAuthor(String in) {\n return(fixAuthor(in, true));\n }", "default String getAuthor() {\r\n\t\treturn \"unknown\";\r\n\t}", "private String getAuthorUsername(UIMessage message) {\r\n\t\tString toReturn = \"<Author-Not-Found>\";\r\n\t\ttry {\r\n\t\t\ttoReturn = facade.getMemberByID(message.getAuthorID()).getUsername();\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t// do nothing - return a default user-name\r\n\t\t}\r\n\t\treturn toReturn;\t\t\r\n\t}", "public interface AuthorNames {\n\n static String shortenName(String name) {\n return Arrays.asList(name.split(\" \")).\n stream().\n map(s -> s.substring(0, 1)).collect(Collectors.joining());\n }\n}", "String getSurname();", "public void parseAuthorshipIntoName(ParsedNameUsage pnu, final String authorship, IssueContainer v){\n // try to add an authorship if not yet there\n if (!Strings.isNullOrEmpty(authorship)) {\n if (pnu.getName().isParsed()) {\n ParsedAuthorship pnAuthorship = parseAuthorship(authorship).orElseGet(() -> {\n LOG.info(\"Unparsable authorship {}\", authorship);\n v.addIssue(Issue.UNPARSABLE_AUTHORSHIP);\n // add the full, unparsed authorship in this case to not lose it\n ParsedName pn = new ParsedName();\n pn.getCombinationAuthorship().getAuthors().add(authorship);\n return pn;\n });\n\n // we might have already parsed an authorship from the scientificName string which does not match up?\n if (pnu.getName().hasAuthorship()) {\n String prevAuthorship = NameFormatter.authorship(pnu.getName());\n if (!prevAuthorship.equalsIgnoreCase(pnAuthorship.authorshipComplete())) {\n v.addIssue(Issue.INCONSISTENT_AUTHORSHIP);\n LOG.info(\"Different authorship found in name {} than in parsed version: [{}] vs [{}]\",\n pnu.getName(), prevAuthorship, pnAuthorship.authorshipComplete());\n }\n }\n\n // keep authorship issues in a separate container\n // so we can filter out non authorship related issues before we add them to the verbatim record\n IssueContainer ic = new IssueContainer.Simple();\n copyToPNU(pnAuthorship, pnu, ic);\n // ignore issues related to the epithet - we only parse authorships here\n removeEpithetIssues(ic);\n ic.getIssues().forEach(v::addIssue);\n\n // use original authorship string but normalize whitespace\n pnu.getName().setAuthorship( normalizeAuthorship(authorship, pnAuthorship.getTaxonomicNote()) );\n\n } else {\n // unparsed name might still not have any authorship\n String sciName = AuthorshipNormalizer.normalize(pnu.getName().getScientificName());\n if (sciName == null) {\n pnu.getName().setAuthorship(authorship);\n } else {\n String authNormed = AuthorshipNormalizer.normalize(authorship);\n if (authNormed != null && !sciName.contains(authNormed)) {\n pnu.getName().setAuthorship(authorship);\n }\n }\n }\n }\n }", "public String getAuthorName() {\n return this.authorName;\n }", "public String getAuthorName() {\n return authorName;\n }", "public String getAuthorName() {\n return authorName;\n }", "java.lang.String getSurname();", "public String getAuthor();", "public String getAuthorPseudonym() {\r\n return author.getPseudonym();\r\n }", "public String getAuthor() {\n return (String)getAttributeInternal(AUTHOR);\n }", "public String getAuthorName() {\n return mAuthorName;\n }", "public String getCanonicalAuthorName(GitCommit commit) {\n return getCanonicalName(commit.getAuthorName(), commit.getAuthorEmailAddress());\n }", "public java.lang.String getAuthor()\n\tthrows java.rmi.RemoteException\n {\n\ttry {\n\t Object $result = ref.invoke(this, $method_getAuthor_0, null, 5683193999863030062L);\n\t return ((java.lang.String) $result);\n\t} catch (java.lang.RuntimeException e) {\n\t throw e;\n\t} catch (java.rmi.RemoteException e) {\n\t throw e;\n\t} catch (java.lang.Exception e) {\n\t throw new java.rmi.UnexpectedException(\"undeclared checked exception\", e);\n\t}\n }", "public void extractAuthorsName() {\r\n try {\r\n // gets all matched objects for Author Name.\r\n Matcher matcherObject = matcher.patternMatcher(\"AuthorsName\");\r\n\r\n // add name to outputResult\r\n while (matcherObject.find()) {\r\n format.Formatter(1, matcherObject.group(1));\r\n isValidFile = true;\r\n }\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAuthorsName method\");\r\n }\r\n }", "public String getAuthorisor()\n\t{\n\t\treturn authorisor;\n\t}", "public static String fixAuthor_nocomma(String in){\n \n\treturn fixAuthor(in);\n\t/*\n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache.get(in);\n if (old != null)\n return (String)old;\n \n StringBuffer sb=new StringBuffer();\n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n //System.out.println(authors[i]);\n authors[i]=authors[i].trim();\n String[] t = authors[i].split(\" \");\n\tif (t.length > 1) {\n\t sb.append(t[t.length-1].trim());\n\t for (int cnt=0; cnt<=t.length-2; cnt++)\n\t\tsb.append(\" \" + t[cnt].trim());\n\t} else\n\t sb.append(t[0].trim());\n\tif(i==authors.length-1)\n\t sb.append(\".\");\n\telse\n\t sb.append(\" and \");\n\t\n }\n \n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache.put(in, fixed);\n \n return fixed;*/\n }", "public String getAuthor() {\n \treturn metricMetadata.getAuthor();\n }", "private String getFormattedName(String bossName) {\r\n\t\tString[] startingLetters = { \"corporeal\", \"king black\", \"nomad\", \"tormented\", \"avatar\" };\r\n\t\tfor(int i = 0; i < startingLetters.length; i++)\r\n\t\t\tif(bossName.toLowerCase().contains(startingLetters[i].toLowerCase()))\r\n\t\t\t\treturn \"the \"+bossName;\r\n\t\treturn bossName;\r\n\t}", "public static String fixAuthor_lastnameFirst(String in){\n \n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache_lastFirst.get(in);\n if (old != null)\n return (String)old;\n \n //Util.pr(\"lastnamefirst: in\");\n StringBuffer sb=new StringBuffer();\n \n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t int comma = authors[i].indexOf(',');\n \t test:if (comma >= 0) {\n \t // There is a comma, so we assume it's ok.\n \t sb.append(authors[i]);\n }\n else {\n // The name is without a comma, so it must be rearranged.\n int pos = authors[i].lastIndexOf(' ');\n if (pos == -1) {\n // No spaces. Give up and just add the name.\n sb.append(authors[i]);\n break test;\n }\n String surname = authors[i].substring(pos+1);\n if (surname.equalsIgnoreCase(\"jr.\")) {\n pos = authors[i].lastIndexOf(' ', pos - 1);\n if (pos == -1) {\n // Only last name and jr?\n sb.append(authors[i]);\n break test;\n }\n else\n surname = authors[i].substring(pos+1);\n }\n // Ok, we've isolated the last name. Put together the rearranged name:\n sb.append(surname + \", \");\n sb.append(authors[i].substring(0, pos));\n \n }\n if (i != authors.length - 1)\n sb.append(\" and \");\n }\n /*String[] t = authors[i].split(\",\");\n if(t.length < 2) {\n // The name is without a comma, so it must be rearranged.\n t = authors[i].split(\" \");\n if (t.length > 1) {\n sb.append(t[t.length - 1]+ \",\"); // Last name\n for (int j=0; j<t.length-1; j++)\n sb.append(\" \"+t[j]);\n } else if (t.length > 0)\n sb.append(t[0]);\n }\n else {\n // The name is written with last name first, so it's ok.\n sb.append(authors[i]);\n }\n \n if(i !=authors.length-1)\n sb.append(\" and \");\n \n }*/\n //Util.pr(in+\" -> \"+sb.toString());\n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache_lastFirst.put(in, fixed);\n \n return fixed;\n }", "@Override\n\tpublic String getAuthor() {\n\t\treturn \"\";\n\t}", "@Override\n public String toString() {\n return getAuthor().getName();\n }", "@Override\n\tpublic String author() {\n\t\treturn author;\n\t}", "private String getAuthorUsername(ForumFacade forum, UIMessage message) {\n\t\tString toReturn = \"<Author-Not-Found>\";\n\t\ttry {\n\t\t\ttoReturn = forum.getMemberByID(message.getAuthorID()).getUsername();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystemLogger.warning(\"While retrieving the contents of message \" + messageID + \" the username \" +\n\t\t\t\t\t\" of the user with id \" + message.getAuthorID() + \" wasn't found.\");\n\t\t}\n\t\treturn toReturn;\t\t\n\t}", "public abstract String getAuthor();", "public String getAuthor()\r\n {\r\n return (m_author);\r\n }", "public abstract String getAuthor(int lineNumber);", "public String getAuthorsSummary(String firstLetter) throws Exception {\n\t\treturn this.xqueryUtil.getAuthorsSummary(firstLetter);\n\t}", "public void getAnAuthor() {\n System.out.println(\"Give author name: \");\n String key = input.next();\n for (Card s: cards) {\n if (s.autherOfBook.equals(key)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n }", "public static String fixAuthor_commas(String in) {\n return(fixAuthor(in, false)); \n }", "public String printAuthor(){\n System.out.println();\n return author;\n }", "public String getAuthor() {\r\n\t\treturn oAuthor;\r\n\t}", "public java.lang.String getAuthor() {\n return author;\n }", "public static String getSortableAuthor(final Record record)\n\t{\n\t\treturn MarcUtils.getSortableAuthor(record);\n\t}", "public String getAcronym();", "public String getAuthor() {\r\n\t\treturn author;\r\n\t}", "String getCardLastName(String bookingRef);", "String organizationName();", "public String getAuthor() { return author_; }", "public static String fixAuthor(String in, boolean includeAnds){\n if (includeAnds) {\n Object old = Globals.nameCache.get(in);\n if (old != null)\n return (String)old;\n } else {\n Object old = Globals.nameCache_commas.get(in);\n if (old != null)\n return (String)old; \n }\n \n \t//Util.pr(\"firstnamefirst\");\n \tStringBuffer sb=new StringBuffer();\n \t//System.out.println(\"FIX AUTHOR: in= \" + in);\n \n \tString[] authors = in.split(\" and \");\n \tfor(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t String[] t = authors[i].split(\",\");\n \t if(t.length < 2)\n \t // there is no comma, assume we have FN LN order\n \t sb.append(authors[i].trim());\n \t else\n \t sb.append( t[1].trim() + \" \" + t[0].trim());\n \t if (includeAnds) {\n \t if(i != authors.length-1 ) // put back the \" and \"\n \t sb.append(\" and \");\n \t } else {\n \t if (i == authors.length - 2)\n \t sb.append(\" and \");\n \t else if (i != (authors.length - 1))\n \t sb.append(\", \");\n \t }\n \t}\n \n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache.put(in, fixed);\n \n \treturn fixed;\n }", "public String getAuthor() {\n\t\treturn null;\r\n\t}", "java.lang.String getSchoolName();", "String getPresetName();", "public java.lang.String getAuthor() {\n return author;\n }", "String fullName();", "String publisherDisplayName();", "String getSupName();", "public String getAuthorLastName() {\r\n return author.getLastName();\r\n }", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:author\")\n public String getAuthor() {\n return getProperty(AUTHOR);\n }", "@Override\r\n\tpublic String getAuthor() {\n\t\treturn super.getAuthor();\r\n\t}", "String getDisplay_name();", "public String getAuthor() {\n\t\treturn auth;\n\t}", "String[] getAuthor();", "public String getAuthor() {\r\n return author;\r\n }", "public Item2Vector<Author> getAuthorss() { return authorss; }", "String getCustomerLastName(String bookingRef);", "public void setAuthorisor(String authorisor)\n\t{\n\t\tthis.authorisor = Toolbox.trim(authorisor, 4);\n\t}", "String getCitationString();", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String toString() {return name().charAt(0) + name().substring(1).toLowerCase();}", "public String getAuthor(){\n return author;\n \n }", "private static String getAuthor(final JSONObject jsonObject) {\n try {\n final JSONArray authors = jsonObject.getJSONArray(\"author_name\");\n int authorsCount = authors.length();\n final String[] authorStrings = new String[authorsCount];\n for (int i = 0; i < authorsCount; i++) {\n authorStrings[i] = authors.getString(i);\n }\n return TextUtils.join(\", \", authorStrings);\n } catch (JSONException e) {\n e.printStackTrace();\n return \"\";\n }\n }", "@NonNull\n public String getScientificName() {\n return scientificName;\n }", "String getCardFirstName(String bookingRef);", "public String getAuthor() {\n return mAuthor;\n }", "protected String retrieveOrganismScientificName(String taxId) throws BridgeFailedException {\n if (this.taxIdToScientificName.containsKey(taxId)){\n return this.taxIdToScientificName.get(taxId);\n }\n\n Organism term = this.taxonomyService.fetchByTaxID(Integer.parseInt(taxId));\n\n if (term == null){\n this.taxIdToScientificName.put(taxId, null);\n return null;\n }\n\n String scientificName = term.getScientificName();\n this.taxIdToScientificName.put(taxId, scientificName);\n\n return scientificName;\n }", "@Override\n\tpublic java.lang.String getAuthor() {\n\t\treturn _news_Blogs.getAuthor();\n\t}", "String realmDisplayName();", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "public String getAuthor() {\n if (MetadataUGWD_Type.featOkTst && ((MetadataUGWD_Type)jcasType).casFeat_author == null)\n jcasType.jcas.throwFeatMissing(\"author\", \"de.aitools.ie.uima.type.argumentation.MetadataUGWD\");\n return jcasType.ll_cas.ll_getStringValue(addr, ((MetadataUGWD_Type)jcasType).casFeatCode_author);}", "public String getAuthor() {\n\treturn author;\n}", "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences of the letters outlined in step 3\n\t\toriginal = original.substring(0,1) + original.substring(1).replaceAll(\"[AEIHOUWY]\",\"\");\n\t\t\n\t\t// Return the result\n\t\treturn original;\n\t}", "@Override\n\tpublic long getAuthorId() {\n\t\treturn _scienceApp.getAuthorId();\n\t}", "public abstract String getNaturalIdentity();" ]
[ "0.7252598", "0.6939766", "0.6881891", "0.68106335", "0.67544276", "0.67260146", "0.6616382", "0.6616061", "0.6616061", "0.6569969", "0.6505794", "0.64575994", "0.64575994", "0.64505905", "0.643007", "0.6351748", "0.63421047", "0.6341926", "0.6337829", "0.6324687", "0.63196605", "0.63196605", "0.6308923", "0.6303746", "0.62708104", "0.62397736", "0.6226422", "0.61600786", "0.6155071", "0.6119918", "0.6107735", "0.6105325", "0.608542", "0.60650826", "0.60382974", "0.60140926", "0.6012268", "0.60049474", "0.5982775", "0.59814876", "0.5977858", "0.59764713", "0.5958474", "0.59428877", "0.5935729", "0.59339833", "0.5932637", "0.592723", "0.5917041", "0.59084773", "0.5906613", "0.5889795", "0.58886576", "0.58881724", "0.58868515", "0.5875465", "0.5872091", "0.58719134", "0.5867966", "0.58613276", "0.5860724", "0.58592314", "0.58491987", "0.5834145", "0.5832789", "0.5828293", "0.58238083", "0.5820486", "0.57968295", "0.57907736", "0.57545", "0.5752349", "0.5749884", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.57412094", "0.5728221", "0.57263374", "0.5713168", "0.57130766", "0.5709929", "0.5704618", "0.56780475", "0.5675594", "0.56530076", "0.5648765", "0.56395143", "0.56315905", "0.56301856", "0.56238747", "0.56211877" ]
0.7917891
0
Get the rank of the name
public RankType getRank() { return rank; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getRank()\r\n\t{\r\n\t\treturn rank;\r\n\t}", "public String getRank() {\r\n return rank;\r\n }", "public String getRank() {\n return rank;\n }", "long getRank();", "public String rank() {\r\n return rank;\r\n }", "public int getRank();", "public int getRank();", "public String getRank()\n {\n return _rank;\n }", "public String getRank() {\n\t\treturn rank;\n\t}", "public int getRank(){\n\t\tswitch(getTkn()){\n\t\t\tcase Not:\n\t\t\treturn 7;\n\t\t\t\n\t\t\tcase Kali:\n\t\t\tcase Bagi:\n\t\t\tcase Mod:\n\t\t\tcase Div:\n\t\t\treturn 6;\n\t\t\t\n\t\t\tcase Tambah:\n\t\t\tcase Kurang:\n\t\t\treturn 5;\n\t\t\t\n\t\t\tcase KurangDari:\n\t\t\tcase LebihDari:\n\t\t\tcase KurangDariSamaDengan:\n\t\t\tcase LebihDariSamaDengan:\n\t\t\treturn 4;\n\t\t\t\t\t\t\n\t\t\tcase SamaDengan:\n\t\t\tcase TidakSamaDengan:\n\t\t\treturn 3;\n\t\t\t\n\t\t\tcase And:\n\t\t\treturn 2;\n\t\t\t\n\t\t\tcase Xor:\n\t\t\treturn 1;\n\t\t\t\n\t\t\tcase Or:\n\t\t\treturn 0;\n\n\t\t\tdefault:\n\t\t\treturn -999;\n\t\t}\n\t}", "public String getRank() {\n if(dbMgr.checkAdmin(username))\n return \"Admin\";\n\n else if(dbMgr.checkBannedUser(username))\n return \"Banned\";\n\n else if(dbMgr.checkReviewUser(username))\n return \"Review User\";\n\n else if(dbMgr.checkPremiumUser(username))\n return \"Premium User\";\n\n else \n return \"user\";\n }", "public int Rank();", "public int getRank() {\n validify();\n return Client.INSTANCE.pieceGetRank(ptr);\n }", "public int getRank() {\r\n\t\tif(!isValid)\r\n\t\t\treturn -1;\r\n\t\treturn rank;\r\n\t}", "public String getRankString(){ return this.rank; }", "public int getRank()\n\t{\n\t\treturn rank;\n\t}", "public int getRank() {\r\n return rank;\r\n }", "public int getRank()\n {\n return rank;\n }", "public int getRank() {\n return rank;\n }", "public int getRank() {\n return rank;\n }", "public int getRank() {\n return rank;\n }", "int getRanking();", "public Integer getRank(){\r\n\t\treturn rank;\r\n\t}", "public int getRank() {\n\t\treturn rank;\n\t}", "public int getRank() {\n\t\treturn rank;\n\t}", "public int getRank() {\n\t\treturn rank;\n\t}", "public int getRank() {\n\t\treturn rank;\n\t}", "public int getRank()\n {\n return rank;\n }", "public long getRank() {\n return rank_;\n }", "public String getRankString()\n {\n switch (rank)\n {\n \n case 2: return \"2\";\n case 3: return \"3\";\n case 4: return \"4\";\n case 5: return \"5\";\n case 6: return \"6\";\n case 7: return \"7\";\n case 8: return \"8\";\n case 9: return \"9\";\n case 10: return \"10\";\n case 11: return \"JACK\";\n case 12: return \"QUEEN\";\n case 13: return \"KING\";\n case 14: return \"ACE\";\n default: return \"JOKER\";\n \n }\n }", "public int getRank()\r\n {\r\n return this.rank;\r\n }", "public Integer rank() {\n return data.getInt(FhirPropertyNames.PROPERTY_RANK);\n }", "public long getRank() {\n return rank_;\n }", "public Integer getRank() {\r\n\t\treturn this.rank;\r\n\t}", "public Integer getRank() {\n return this.rank;\n }", "public int getRank(){\r\n\t\tif(this.rank.equals(RANKS[0])){ return -1; } // \"no card\"\r\n\t\treturn rankValue.get(this.rank);\r\n\t}", "public Rank getRank()\n\t{\n\t\treturn rank;\n\t}", "public byte getRank() {\n return rank;\n }", "public int rank() { return this.rank; }", "@Override\n public int getRank() {\n return rank;\n }", "public int getRank(int year, String name, String gender){\n FileResource fr = new FileResource();\n //int count = 0;\n int rank = 0;\n int theRank = 0;\n //String findname = null;\n boolean isPresent = false;\n for (CSVRecord rec : fr.getCSVParser(false)){\n if (rec.get(1).equals(gender)){\n rank++;\n if(rec.get(0).equals(name)) {isPresent = true;\n theRank = rank;\n }\n }\n }\n if (isPresent){\n return theRank;\n } else return -1;\n }", "Response<Integer> getRank(String leaderboardId, String username, String uniqueIdentifier, int scope);", "public int getRank(){\r\n return this.rank;\r\n }", "public int getRanking() {\n return ranking_;\n }", "public int getRank(){\n return rank;\n }", "long getToRank();", "@Nullable\n public CompetitiveRank getRankByName(String rankName) {\n final String[] args = rankName.split(\" \");\n try {\n DIVISION division = DIVISION.valueOf(args[0].toUpperCase());\n CompetitiveRank[] ranks = this.ranks.get(division);\n return division.hasTiers() ? ranks[(Integer.parseInt(args[1]) - 1)] : ranks[0];\n }\n catch(Exception e) {\n return null;\n }\n }", "public int getRanking() {\n return ranking_;\n }", "public void setRank(String value)\n {\n _rank = value;\n }", "public String getNumRank(int rank){\n\t\tString num;\n\t\tswitch (rank) {\n\t\tcase 1: num = \"2\";break;\n\t\tcase 2: num = \"4\"; break;\n\t\tcase 3: num = \"8\"; break;\n\t\tcase 4: num = \"16\"; break;\n\t\tcase 5: num = \"32\"; break;\n\t\tcase 6: num = \"64\"; break;\n\t\tcase 7: num = \"128\"; break;\n\t\tcase 8: num = \"256\"; break;\n\t\tcase 9: num = \"512\"; break;\n\t\tdefault: num = \"2\";\n\t\t\tbreak;\n\t\t}\n\t\treturn num;\n\t}", "public int returnRank() {\n return this.data.returnRank();\n }", "public String getResearchrank() {\r\n\t\treturn researchrank;\r\n\t}", "public int getRank(){\n return this.rank;\n }", "public short getRank(){\n\t\treturn srtRank;\r\n\t\t\r\n\t}", "void showRanking(String winner, String rank);", "public Integer getRankValue() {\r\n\t\treturn rank;\r\n\t}", "public Rank getRank()\n {\n return rank;\n }", "public Vector getRank() {\n return rank;\n }", "long getFromRank();", "public int score(String name) {\n return name.indexOf(this.name + \"_\");\n }", "public int getRank(int year, String name, String gender) {\n //making default path with variable year passed as parameter\n String source = \"data/yob\"+year+\".csv\";\n FileResource fr = new FileResource(source);\n int currRank = 1;\n int rank = 1;\n //iterating over the CSV file\n for (CSVRecord record : fr.getCSVParser(false)) {\n \n //checking if current row is the same gender as passed as parameter\n if (record.get(1).equals(gender)) {\n \n //if yes then check if name is the same as passed as parameter\n if (record.get(0).equals(name)) {\n \n //if yes then update the rank and break\n rank = currRank;\n break;\n }\n else {\n \n //it means that there's no such name in current year\n rank = -1;\n }\n currRank++; \n }\n else {\n }\n }\n return rank; \n }", "public int getrank() {\n\t\treturn this.rank;\n\t}", "public String getMovieNameWithRank(int rank0){\n\t\treturn moviePref[rank0-1].getName();\n\t}", "public Rank rank(){\n return PackedCard.rank(this.nbCard);\n }", "public int getRank(){\n return Value;\n }", "Response<Integer> getRank(String leaderboardId, int score, int scope);", "public int getRank(int year, String name, String gender){\n String file = (\"us_babynames_by_year/yob\" + year + \".csv\");\n FileResource fr = new FileResource(file);\n int rankBoys = 0;\n int rankGirls = 0;\n int rank = -1;\n for(CSVRecord record : fr.getCSVParser(false)) {\n if(gender.equals(\"M\") && record.get(1).equals(\"M\")) {\n rankBoys++;\n if(name.equals(record.get(0)))\n rank = rankBoys;\n }\n else if(gender.equals(\"F\") && record.get(1).equals(\"F\")){\n rankGirls++;\n if(name.equals(record.get(0)))\n rank = rankGirls;\n }\n }\n return rank;\n }", "public LSPRanking getRanking () {\r\n return ranking;\r\n }", "public static int GetRankNumber(RankingSystem rank) {\n\t\tif (rank == RankingSystem.Strong) {\n\t\t\treturn 5;\n\t\t}\n\t\telse if (rank == RankingSystem.AboveAverage) {\n\t\t\treturn 4;\n\t\t}\n\t\telse if (rank == RankingSystem.Average) {\n\t\t\treturn 3;\n\t\t}\n\t\telse if (rank == RankingSystem.BelowAverage) {\n\t\t\treturn 2;\n\t\t}\n\t\treturn 1;\n\t}", "public int Rank() {\n return group_.Rank();\n }", "public void rank(){\n\n\t}", "public static int getRankValue(String rank)\r\n\t{\n\t\tint rankValue = 0;\r\n\t\t\t\t\r\n\t\tif (rank.equals(\"J\") || rank.equals(\"Q\") || rank.equals(\"K\"))\r\n\t\t{\r\n\t\t\t// face cards have rank of 10\r\n\t\t\trankValue = 10;\r\n\t\t}\r\n\t\telse if (rank.equals(\"A\"))\r\n\t\t{\r\n\t\t\t// ace has rank of 1\r\n\t\t\trankValue = 1;\r\n\t\t}\r\n\t\telse if (rank.equals(\"2\") || rank.equals(\"3\") || rank.equals(\"4\") || \r\n\t\t\t\t rank.equals(\"5\") || rank.equals(\"6\") || rank.equals(\"7\") || \r\n\t\t\t\t rank.equals(\"8\") || rank.equals(\"9\") || rank.equals(\"10\"))\r\n\t\t{\r\n\t\t\t// all others have rank of face value\r\n\t\t\trankValue = Integer.valueOf(rank);\r\n\t\t}\r\n\r\n\t\treturn rankValue;\r\n\t}", "public int getRank ()\n {\n return this.ranks; \n }", "public int getIdentifiableRank(Identifiable identifiable) {\n\t\tString key = identifiable.getURI().lastSegment();\n\t\tif(rankCache.containsKey(key)) \n\t\t\treturn rankCache.get(key);\n\t\t\n\t\tActivator.logError(\"Unable to find server rank for node \"+key+\". Assigning to first server\", new Exception());\n\t\treturn 0;\n\t\t// Random\n//\t\tint hash = identifiable.getURI().toString().hashCode();\n//\t\thash = Math.abs(hash);\n//\t\tint node = hash % getNumNodes();\n//\t\treturn node;\n\n\t\t// USA Mexico\n//\t\tif((identifiable.getURI().lastSegment().startsWith(\"MX\") || identifiable.getURI().lastSegment().startsWith(\"MEX\"))) return 1; \n//\t\treturn 0; // everything else is on the first node.\n\t}", "public Rank getRankByName(String rankName) {\r\n for (int i = 0; i < allRanks.size(); i++) {\r\n if (allRanks.get(i).getRankName().equals(rankName)) {\r\n return allRanks.get(i);\r\n }\r\n }\r\n\r\n return null;\r\n }", "public Ranking getRanking() {\n return ranking;\n }", "@Override\r\n\tpublic float getRank() {\r\n\t\tfloat rank = 0;\r\n\t\tif( players != null && !players.isEmpty() ) {\r\n\t\t\tfloat totalAbility = 0;\r\n\t\t\tfor (Player player : players) {\r\n\t\t\t\ttotalAbility += player.getAbility();\r\n\t\t\t}\r\n\t\t\trank = totalAbility / players.size();\r\n\t\t}\r\n\t\t\r\n\t\treturn rank;\r\n\t}", "String getRank(int rankNumber) {\n\t\tswitch(rankNumber) {\n\t\tcase 0:\n\t\t\treturn \"2\";\n\t\tcase 1:\n\t\t\treturn \"3\";\n\t\tcase 2:\n\t\t\treturn \"4\";\n\t\tcase 3:\n\t\t\treturn \"5\";\n\t\tcase 4:\n\t\t\treturn \"6\";\n\t\tcase 5:\n\t\t\treturn \"7\";\n\t\tcase 6:\n\t\t\treturn \"8\";\n\t\tcase 7:\n\t\t\treturn \"9\";\n\t\tcase 8:\n\t\t\treturn \"10\";\n\t\tcase 9:\n\t\t\treturn \"Jack\";\n\t\tcase 10:\n\t\t\treturn \"Queen\";\n\t\tcase 11:\n\t\t\treturn \"King\";\n\t\tcase 12:\n\t\t\treturn \"Ace\";\n\t\tdefault:\n\t\t\treturn \"\";\n\t\t}\n\t}", "public Card.Rank rank() {\n return PackedCard.rank(packedCard);\n }", "public void setRank(String rank) {\n this.rank = rank;\n }", "public Integer getGameRank() {\n return gameRank;\n }", "public int isIn(String name){\r\n\t\tfor(ParamRanking prAux : ranking){\r\n\t\t\tif(prAux.getName().equals(name))\r\n\t\t\t\treturn ranking.indexOf(prAux);\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public static String randomRank() {\r\n\t\tString[] rank = {\"assistant\",\"associate\",\"full\"};\r\n\t\treturn rank[(int)(Math.random() * 3)];\r\n\t}", "Rank(Guild guild, String name) {\n this.role = guild.getRolesByName(name, true).get(0);\n }", "public int getRanking(){\n int spelerID = Integer.valueOf(spelerIDField.getText());\n int ranking=0;\n try {\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT ranking FROM Spelers WHERE idcode = ?\");\n st.setInt(1, spelerID);\n ResultSet rs= st.executeQuery();\n if(rs.next()) {\n return rs.getInt(\"ranking\");\n }\n }catch(Exception e) {\n System.out.println(e);\n }\n return ranking;\n }", "public int getRank(int decade) {\n\t\tif (decade < 0 || decade > (NDECADES - 1)) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this.ranksOfName[decade];\n\t}", "public int getRank() {\n\t\tDependencyElement p = prev;\n\t\tint rank = 0;\n\t\twhile (p != null) {\n\t\t\trank++;\n\t\t\tp = p.prev;\n\t\t}\n\t\treturn rank;\n\t}", "private int getWobblyRank(MatchStats matchStats) {\n for(int i = 0; i < leaderboard.size(); i++) {\n WobblyScore score = leaderboard.get(i);\n if(score.getKey().equals(WobblyScore.generateKey(matchStats))) {\n return i + 1;\n }\n }\n return 0;\n }", "public int collegeRank(int rank) {\n\t\tSystem.out.println(rank);\t\r\n\t\treturn rank;\r\n \r\n }", "public String getName(int year, int rank, String gender){\n FileResource fr = new FileResource();\n int count = 0;\n String name = null;\n boolean isPresent = false;\n for (CSVRecord rec : fr.getCSVParser(false)){\n if (rec.get(1).equals(gender)){\n count++;\n if (rank == count){\n name = rec.get(0);\n isPresent = true;\n } \n }\n }\n if (isPresent){\n return name;\n } else return \"No Name\";\n }", "KingdomRank getRank(KingdomUser user);", "public Rank getRank() {\n return cardRank;\n }", "public int rank(K key);", "public int getRankInteger(Rank _rank) {\n return _rank.rank;\n }", "private int getRank(DiceModel playerToRank) {\n\t\tint rank = 1;\n\t\tint ph; // placeholder\n\t\tint d1 = playerToRank.getDie1();\n\t\tint d2 = playerToRank.getDie2();\n\t\tint d3 = playerToRank.getDie3();\n\t\t\n\t\t// sorting them in ascending order\n\t\t// switch the 2nd number into first position if it is bigger\n\t\tif (d2 > d1) {\n\t\t\tph = d1;\n\t\t\td1 = d2;\n\t\t\td2 = ph;\n\t\t} // switch the 3rd number into second position if it is bigger\n\t\tif (d3 > d2) {\n\t\t\tph = d2;\n\t\t\td2 = d3;\n\t\t\td3 = ph;\n\t\t} // switch the 2nd number into first position if it is bigger\n\t\tif (d2 > d1) {\n\t\t\tph = d1;\n\t\t\td1 = d2;\n\t\t\td2 = ph;\n\t\t}\n\t\t\n\t\t// now to get their ranking\n\t\t// check for 4,2,1\n\t\tif (d1 == 4 && d2 == 2 && d3 == 1) {\n\t\t\trank = 4;\n\t\t} else if (d1 == d2 && d1 == d3) { // checks for triples\n\t\t\trank = 3;\n\t\t} else if ((d1 == d2 && d1 != d3) || d2 == d3) { // pairs\n\t\t\trank = 2;\n\t\t} else {\n\t\t\trank = 1;\n\t\t}\n\t\t\n\t\treturn rank;\n\t}", "public int rank() throws MPJException {\n\n IbisIdentifier id = MPJ.getMyId();\n if (this.table != null) {\n for (int i = 0; i < this.table.size(); i++) {\n IbisIdentifier a = this.table.elementAt(i);\n if (a.equals(id)) {\n return (i);\n }\n }\n }\n\n return (MPJ.UNDEFINED);\n }", "public int nameIndex();", "public String getRankAsString (int aRank)\n {\n switch (aRank)\n {\n case 1:return(\"Ace\");\n case 2:return(\"Two\");\n case 3:return(\"Three\");\n case 4:return(\"Four\");\n case 5:return(\"Five\");\n case 6:return(\"Six\");\n case 7:return(\"Seven\");\n case 8:return(\"Eight\");\n case 9:return(\"Nine\");\n case 10:return(\"Ten\");\n case 11:return(\"Jack\");\n case 12:return(\"Queen\");\n case 13:return(\"King\");\n default: return(\"Invalid Rank\");\n }\n }", "public int getScore(String nickname) {\n\t\treturn scoreboard.get(nickname);\n\t}", "@Test\n\tpublic void testRankingSortedByName() throws BattleshipException {\n\t\t\n\t\t//Play Julia\n\t\tinitScores(playerJulia);\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\t//Play Raul\n\t\tinitScores(playerRaul);\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\t//Play Laura\n\t\tinitScores(playerLaura);\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\t//Play Simon\n\t\tinitScores(playerSimon);\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\tcompareRankings(SRANKING5, rankingsToString());\n\t}" ]
[ "0.7651758", "0.7584574", "0.7527076", "0.748295", "0.74666834", "0.74549484", "0.74549484", "0.7428514", "0.74257654", "0.72844875", "0.72361964", "0.720585", "0.7199814", "0.7182512", "0.71746033", "0.7163617", "0.7109785", "0.7080046", "0.70722085", "0.70722085", "0.70722085", "0.7071516", "0.70596695", "0.70341444", "0.70341444", "0.70341444", "0.70341444", "0.70116335", "0.6997276", "0.6990456", "0.6973013", "0.69699496", "0.69538647", "0.69256663", "0.6916539", "0.6909031", "0.6902789", "0.688296", "0.6841348", "0.6840308", "0.6804873", "0.6772611", "0.67683357", "0.6751072", "0.67151743", "0.67069334", "0.67037433", "0.67006016", "0.6690978", "0.66899437", "0.6681271", "0.6656463", "0.6656249", "0.6654708", "0.66523653", "0.664006", "0.6577809", "0.655769", "0.6520382", "0.65202624", "0.65153056", "0.65150285", "0.6507282", "0.65049493", "0.6503485", "0.6500005", "0.6435345", "0.6375249", "0.6350189", "0.6334962", "0.63241816", "0.631279", "0.6312456", "0.6297926", "0.6295576", "0.6292288", "0.6276865", "0.6262993", "0.62597406", "0.62403196", "0.62078726", "0.61391693", "0.61280173", "0.61190504", "0.6106047", "0.6089348", "0.60531247", "0.6046001", "0.60421634", "0.60409564", "0.60368925", "0.6031147", "0.6015388", "0.6013784", "0.5993392", "0.5982568", "0.5982506", "0.597488", "0.5965073", "0.59485257" ]
0.67107224
45
Get the type of name
public NameType getType() { return type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String typeName();", "public String getTypeName();", "public String getTypeName();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.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();", "String getType();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "public String ofType() {\n\t\t return name;\n\t}", "public abstract String getTypeName();", "public Type type(String name);", "public String getTypeName() {\n return type.name();\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getTypeName();", "String getTypeAsString();", "public String getName() {\n return type.toString();\n }", "public String type();", "String getIdentifierName(String name, String type);", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public java.lang.String getTypeName()\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(TYPENAME$6);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getTypeName() {\n \treturn typeName;\n }", "public String getTypeName() {\n return typeName;\n }", "public String getTypeName() {\n return typeName;\n }", "public String getTypeName() {\n return typeName;\n }", "public String getTypeName() {\n return typeName;\n }", "public String getTypeName() {\r\n\t\treturn typeName;\r\n\t}", "public String getTypeName() {\n Class type = getType();\n if (type == null)\n return null;\n return type.getName();\n }", "public Integer getNametype() {\r\n return nametype;\r\n }", "public String getTypeName() {\n\t\t\t\tif (_type.equals(TYPE_OBJECT)) {\n\t\t\t\t\treturn StringUtils.capitalize(_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn _type;\n\t\t\t}", "String provideType();", "private String getType( )\n\t{\n\t\treturn this.getModuleName( ) + \"$\" + this.getSimpleName( ) + \"$\" + this.getSystem( );\n\t}", "public String getTypeName()\n {\n return this.typeName;\n }", "public String getType()\n\t{\n\t\t// The enumerated type's name satisfies all the type criteria, so use\n\t\t// it.\n\t\treturn name();\n\t}", "type getType();", "Type getType();", "Type getType();" ]
[ "0.8207587", "0.80714536", "0.80714536", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.80047363", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.798239", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7978143", "0.7793049", "0.77762693", "0.77656376", "0.7685934", "0.7645208", "0.752448", "0.74370503", "0.7428868", "0.73634726", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73470426", "0.73288333", "0.73019075", "0.72888696", "0.72888696", "0.72888696", "0.72888696", "0.7271296", "0.72587776", "0.72578764", "0.72463524", "0.7233934", "0.7231485", "0.723082", "0.7215731", "0.7212164", "0.7208665", "0.7208665" ]
0.7773371
63
Get the name flags
@Nullable public Set<NameFlag> getFlags() { return flags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getFlags() {\r\n \t\treturn flags;\r\n \t}", "public int getFlags();", "public int getFlags();", "long getFlags();", "public long getFlags() {\n }", "public java.lang.String getReservedFlags() {\n return reservedFlags;\n }", "public String getFlaginfo() {\n return flaginfo;\n }", "static void _printAllFlagNames(Object c_, StringBuffer sb_,\r\n StringBuffer sb2_)\r\n {\r\n if (c_ instanceof Component) {\r\n if (htComponentFlags == null) {\r\n htComponentFlags = new Hashtable();\r\n htComponentFlags.put(\"Enabled\", htComponentFlags);\r\n htComponentFlags.put(\"Garbage\", htComponentFlags);\r\n htComponentFlags.put(\"GarbageDisplay\", htComponentFlags);\r\n htComponentFlags.put(\"Trace\", htComponentFlags);\r\n htComponentFlags.put(\"Debug\", htComponentFlags);\r\n htComponentFlags.put(\"EventExport\", htComponentFlags);\r\n htComponentFlags.put(\"ErrorNotice\", htComponentFlags);\r\n }\r\n }\r\n else if (c_ instanceof Port) {\r\n if (htPortFlags == null) {\r\n htPortFlags = new Hashtable();\r\n htPortFlags.put(\"EventExport\", htPortFlags);\r\n htPortFlags.put(\"SendTrace\", htPortFlags);\r\n htPortFlags.put(\"DataTrace\", htPortFlags);\r\n }\r\n }\r\n PropertyDescriptor[] pds_ =\r\n drcl.comp.Util.getAllPropertyDescriptors(c_);\r\n if (pds_ == null) return;\r\n Vector v_ = new Vector();\r\n for (int i=0; i<pds_.length; i++) {\r\n PropertyDescriptor pd_ = pds_[i];\r\n if (pd_.getWriteMethod() == null) continue;\r\n Method read_ = pd_.getReadMethod();\r\n String name_ = pd_.getDisplayName();\r\n if (read_ == null) continue;\r\n if (!name_.endsWith(\"Enabled\")) continue;\r\n name_ = name_.substring(0,1).toUpperCase() + name_.substring(1);\r\n if (!read_.getName().equals(\"is\" + name_)) continue;\r\n if (!read_.getReturnType().equals(boolean.class)) continue;\r\n if (!name_.equals(\"Enabled\"))\r\n name_ = name_.substring(0, name_.length()-7);\r\n if (c_ instanceof Component && htComponentFlags.containsKey(name_)\r\n || c_ instanceof Port && htPortFlags.containsKey(name_))\r\n continue;\r\n try {\r\n if (((Boolean)read_.invoke(c_, null)).booleanValue())\r\n sb_.append(name_ + \" \");\r\n else if (sb2_ != null)\r\n sb2_.append(name_ + \" \");\r\n }\r\n catch (Exception e_)\r\n {}\r\n }\r\n }", "public int getFlags() {\n return flags;\n }", "int getFlag();", "String getSpareFlag();", "public String getFlagMethodName() {\n return m_flagMethodName;\n }", "public abstract int flags();", "boolean getLongNames();", "public byte[] getFlags() {\n return flags;\n }", "public short getFlags() {\n\treturn flags;\n }", "private Set<Glyph> retrieveFlags ()\r\n {\r\n Set<Glyph> foundFlags = new HashSet<>();\r\n\r\n for (Glyph glyph : getSystem().getInfo().getGlyphs()) {\r\n Shape shape = glyph.getShape();\r\n\r\n if (ShapeSet.Flags.contains(shape)) {\r\n if (glyph.getTranslations().contains(this)) {\r\n foundFlags.add(glyph);\r\n }\r\n }\r\n }\r\n\r\n return foundFlags;\r\n }", "public int getFlagsNumber ()\r\n {\r\n return flagsNumber;\r\n }", "public static Keywords getFlag(String s) {\n \tKeywords flag = flags.get(s.toLowerCase());\n \tif(flag == null) {\n \t\treturn Keywords.ERROR;\n \t}\n \treturn flag;\n }", "String getACModeName();", "String getFlag() {\n return String.format(\"-T%d\", this.value);\n }", "public int getNameIndex() {\n\t\treturn nameIndex & 0xffff;\n\t}", "public RecordFlagEnum getFlag();", "public List<String> getOptionsNames();", "IntsRef getFlags();", "public String [] getNames () { \n return this.listAttributes(); \n }", "public boolean hasName() {\n return fieldSetFlags()[1];\n }", "public @Flags int getFlags() {\n return mFlags;\n }", "public int getFlags() {\n Object value = library.getObject(entries, FLAGS);\n if (value instanceof Number) {\n return ((Number) value).intValue();\n }\n return 0;\n }", "@Override\n public Set<String> getNames() {\n // TODO(adonovan): for now, the resolver treats all predeclared/universe\n // and global names as one bucket (Scope.PREDECLARED). Fix that.\n // TODO(adonovan): opt: change the resolver to request names on\n // demand to avoid all this set copying.\n HashSet<String> names = new HashSet<>();\n for (Map.Entry<String, Object> bind : getTransitiveBindings().entrySet()) {\n if (bind.getValue() instanceof FlagGuardedValue) {\n continue; // disabled\n }\n names.add(bind.getKey());\n }\n return names;\n }", "public int getFlags() {\n return ByteUtils.toUnsignedShort(flags);\n }", "String getName() ;", "public static synchronized String[] getModeNames() {\n\n\tString names[] = new String[registryModes.size()];\n\n\tint i = 0;\n\n for (Enumeration e = registryModes.keys(); e.hasMoreElements();) {\n CaselessStringKey key = (CaselessStringKey)e.nextElement();\n\n\t names[i++] = key.getName();\n\t}\n\n\tif (i <= 0)\n\t return null;\n\n\treturn names;\n }", "char[] getName();", "public String[] getCommandFlags() throws BuildException;", "public boolean hasName() {\n return fieldSetFlags()[0];\n }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.726437", "0.67256695", "0.67256695", "0.6259688", "0.624504", "0.62134045", "0.6165782", "0.6152825", "0.61490947", "0.6135717", "0.6118438", "0.609148", "0.6072247", "0.60414046", "0.60347545", "0.6024302", "0.5982161", "0.59648645", "0.5959696", "0.5947414", "0.5923954", "0.59146136", "0.59085447", "0.5891856", "0.58846456", "0.58664733", "0.5864064", "0.5853218", "0.5833655", "0.5827687", "0.58031124", "0.5793542", "0.5782494", "0.57647246", "0.5723979", "0.57124776", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298", "0.5704298" ]
0.74380475
0
Is this name an autonym?
public boolean isAutonym() { return flags != null && flags.contains(NameFlag.AUTONYM); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean name() {\r\n return (\r\n (letter() && alphas()) ||\r\n (CHAR('`') && nobquotes() && MARK(QUOTE) && CHAR('`'))\r\n );\r\n }", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasIdentifier();", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(NAME$2) != null;\r\n }\r\n }", "boolean isSetName();", "boolean isNameRequired();", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$8) != 0;\n }\n }", "static public boolean isSanitaryName(String name) {\n return sanitizeName(name).equals(name);\n }", "boolean hasOriginName();", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "private static boolean isAntonym(String text) {\n return text != null && text.equals(\"ant\");\n }", "private boolean isNameValid(String name) {\n\n }", "public boolean isNamed(String n) {\n return name.equals(n);\n }", "public boolean exsitName(String name) {\n\t\tKynamic kynamic = this.kynamicDao.getKynamicByName(name);\r\n\t\treturn kynamic!=null?true:false;\r\n\t}", "boolean hasHangmogName();", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(NAME$0) != 0;\r\n }\r\n }", "private boolean isIdentifier(String input) {\n if (this.isLetter(input.charAt(0))) {\n return true;\n } else return false;\n }", "public boolean checkName(String name)\n {\n return true;\n }", "public boolean isCompanyShortNameTaken(String shortName);", "private boolean nameEntry() {\n EditText nameField = (EditText) findViewById(R.id.batman_identity);\n String batmanIdentity = nameField.getText().toString();\n\n if (batmanIdentity.equalsIgnoreCase(\"bruce wayne\")) {\n return true;\n }\n\n return false;\n\n }", "public static boolean isSafeIdentifierName(String name, int fromIndex) {\n int i = fromIndex;\n for (; i < name.length(); i++) {\n char c = name.charAt(i);\n if (!(c == '$' || c == '@' || c == ':')) {\n break;\n }\n }\n for (; i < name.length(); i++) {\n char c = name.charAt(i);\n if (!((c >= 'a' && c <= 'z') || (c == '_') ||\n (c >= 'A' && c <= 'Z') ||\n (c >= '0' && c <= '9') ||\n (c == '?') || (c == '=') || (c == '!'))) { // Method suffixes; only allowed on the last line\n\n if (isOperator(name)) {\n return true;\n }\n\n return false;\n }\n }\n\n return true;\n }", "public boolean isUnique(String word) {\n String a = getAbbr(word);\n return dict.get(word) == abbr.get(a);\n }", "public boolean isNameSet( ) {\n \t\t\treturn id == null;\n \t\t}", "public boolean isValidName(String proposedName);", "private boolean isAlpha(String name) {\r\n\t\treturn name.matches(\"^[a-zA-Z0-9_]*$\");\r\n\t}", "public boolean nameValidation(String name) {\n\t char[] chars = name.toCharArray();\n\t int tempNum = 0;\n\t for (char c : chars) {\n\t tempNum += 1;\n\t \tif(!Character.isLetter(c)) {\n\t return false;\n\t }\n\t }\n\t if (tempNum == 0)\n\t \treturn false;\n\n\t return true;\n\t}", "private boolean isValidName(String name)\n {\n String reg = \"^[a-zA-Z]+$\";\n return name.matches(reg);\n }", "public static boolean isValidUserDefinedDatabaseName(String name) {\n boolean matchHit = letterFirstPattern.matcher(name).matches();\n // TODO: uppercase is bad...\n boolean reserveHit =\n Collections.binarySearch(reservedNamesSortedList, name.toUpperCase(Locale.US)) >= 0;\n return !reserveHit && matchHit;\n }", "public static boolean isAlphapetic(String userInput) {\n return Pattern.matches(Constants.NAME_VALIDATION, userInput);\n }", "public static boolean isIdentifier(String token)\n {\n boolean toret = false;\n\n token = token.trim();\n\n if ( !token.isEmpty() ) {\n final char firstChar = token.charAt( 0 );\n final char lastChar = token.charAt( token.length() -1 );\n\n if ( Character.isLetter( firstChar )\n || firstChar == '_'\n || Reserved.AllowedSymbolsInMethodName.indexOf( firstChar ) >= 0 )\n {\n final int len = token.length() -1;\n int i = 1;\n\n for(; i < len; ++i) {\n final char ch = token.charAt( i );\n\n if ( !Character.isLetterOrDigit( ch )\n && ch != '_'\n && Reserved.AllowedSymbolsInMethodName.indexOf( ch ) < 0 )\n {\n break;\n }\n }\n\n toret = ( i >= len ); // in case length is 1: \"x\"\n }\n }\n\n return toret;\n }", "private boolean checkNameChar(String name) {\n\t\tString patternStr = \"[a-zA-Z]+\";\n\t\tPattern pattern = Pattern.compile(patternStr);\n\t\tMatcher matcher = pattern.matcher(name);\n\t\tboolean matchFound = matcher.matches();\n\t\treturn matchFound;\n\t}", "public boolean checkName(String name)\n\t{\n\t\treturn (robotHM.containsKey(name));\n\t}", "public boolean shortNameEquals(IdentifierResolver ts) {\n\t\treturn shortName.equals(ts.shortName);\n\t}", "@Override\n public String getName() {\n return \"synonym\";\n }", "public boolean isSetFriendlyName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(FRIENDLYNAME$2) != 0;\r\n }\r\n }", "public boolean isSetName() {\n return this.Name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public boolean isNameEquals(String name) {\n\n return (_name.equalsIgnoreCase(name));//Checks not case sensitive\n }", "boolean hasCodeName();", "public abstract boolean isIdentifier(@Nullable String text);", "private boolean isAbbreviation(String word) {\n\n boolean abbr = true;\n String[] parts = word.split(\"\\\\.\");\n for (String part : parts) {\n if (part.length() > 1 || !Pattern.matches(\"[a-zA-Z]\", part)) {\n abbr = false;\n break;\n }\n }\n return abbr;\n }", "public boolean isSetAutoForwardToName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(AUTOFORWARDTONAME$12) != 0;\n }\n }", "boolean isProtected(String name);", "public boolean isSetName() {\r\n return this.name != null;\r\n }", "public boolean isSetName() {\n return this.name != null;\n }", "public final boolean isSimpleName() {\n return (_names.length == 1);\n }", "public boolean isSetName() {\n\t\treturn this.name != null;\n\t}", "public static boolean alphanumericCheck(String name)\r\n\t{\r\n\t\treturn name.matches(\"^[a-zA-Z0-9]*$\");\r\n\t}", "private static Boolean isAlien(String personaggio){\n\t\treturn personaggio.toLowerCase().contains(\"alien\");\n\t}", "boolean isSetIdentifier();", "public static boolean isName( String name )\n {\n return isOs( null, name, null, null );\n }", "private boolean isAllCaps(String name) {\r\n for (int ndx = 0; ndx < name.length(); ndx++) {\r\n char ch = name.charAt(ndx);\r\n if (ch == '_') {\r\n // OK\r\n } else if (Character.isUpperCase(ch)) {\r\n // OK\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "private static boolean validName(String name) {\n return name != null && !name.strip().isBlank();\n }", "private boolean checkName(String name) {\n if (!name.equals(\"\")) {\n //Check si le nom est déjà utilisé\n return myDbA.checkName(name);\n }\n return false;\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic boolean isNameInUse(String name,String idOwner)\n\t{\n\t\topen();\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(name);\n\t\t\tQuery query=DB.query();\n\t\t\tquery.constrain(Census.class);\n\t\t\tquery.descend(\"idOwner\").constrain(idOwner);\n\t\t\tquery.descend(\"censusName\").constrain(name).endsWith(false);\n\t\t\t\n\t\n\t\t\t\n\t\t\tObjectSet result=query.execute();\n\t\t\t\n\t\t\tif(result.hasNext())\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tclose();\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public static boolean isValidNmtoken(String nmtoken) {\n if (nmtoken.length() == 0)\n return false;\n for (int i = 0; i < nmtoken.length(); i++ ) {\n char ch = nmtoken.charAt(i);\n if( ! isName( ch ) ){\n return false;\n }\n }\n return true;\n }", "public boolean verifyFastName(String FastName)\r\n {\r\n FastName = FastName.trim();\r\n\r\n if(FastName == null || FastName.isEmpty() || !FastName.matches(\"[a-zA-Z]*\"))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "public boolean isActivationString(String word);", "public boolean validateName(String name)\n\t{\n\n\t\tif (name.matches(\"[a-zA-Z]+\"))\n\n\t\t\treturn true;\n\n\t\tmyName = DEFAULT_NAME;\n\t\treturn false;\n\t}", "private boolean isNameUnique(String name) {\n boolean isUnique = true;\n for (User user : this.users) {\n if (user.getName().equals(name)) {\n isUnique = false;\n break;\n }\n }\n return isUnique;\n }", "boolean isIdentifierChar(char c);", "public Boolean getRealName() {\n return realName;\n }", "public boolean nameSchonVorhanden(String name) {\n List<Benutzer> alleBenutzer = getAllBenutzer();\n\n for (Benutzer benutzer : alleBenutzer) {\n if (benutzer.getBenutzerName().equals(name)) {\n return true;\n }\n }\n return false;\n }", "private static boolean verify(String ident) {\n if (Arrays.asList(IDENTIFIERS).contains(ident)) return true;\n if (!ident.matches(\"[a-zA-Z]\\\\w*\")) return true;\n variables.putIfAbsent(ident,0L);\n return false;\n }", "public static boolean isName(int c) {\n return c < 0x10000 && (CHARS[c] & MASK_NAME) != 0;\n }", "public boolean hasAlias() {\n return fieldSetFlags()[4];\n }", "public boolean hasName() {\n return fieldSetFlags()[1];\n }", "boolean checkName (String name){\r\n \r\n // Use for loop to check each character\r\n for (int i = 0; i < name.length(); i++) {\r\n // If character is below 'A' in Unicode table then return false\r\n if (name.charAt(i) < 65 && name.charAt(i) != 32 && name.charAt(i) != 10){\r\n return false;\r\n }\r\n // Else if character is between 'Z' and 'a' in unicode table,\r\n // then return false\r\n else if (name.charAt(i) > 90 && name.charAt(i) < 97){\r\n return false;\r\n }\r\n else if (name.charAt(i) > 122)\r\n return false;\r\n }\r\n return true;\r\n }", "public static void checkNonPersonalProperName(Token t) {\r\n\t\tIterator<String> it = WordLists.nonPersonalIdentifierCues().iterator();\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tString npic = it.next();\r\n\t\t\t\r\n\t\t\tif(t.getName().equalsIgnoreCase(npic)) {\r\n\t\t\t\tt.getFeatures().setNonPersonalProperName(true);\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "boolean hasUserName();", "boolean hasDame();", "public static boolean dicomImportAnonymizerEnabled() {\n\t\tif ((xml == null) || (dicomImportAnonymize == null)) return false;\n\t\treturn dicomImportAnonymize.equals(\"yes\");\n\t}", "private boolean isName() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(theNextToken.TokenType == TokenType.LEFT_BRACKET)\n\t\t{\n\t\t\tupdateToken();\n\t\t\tupdateToken();\n\t\t\tif(isExpression())\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tif(theCurrentToken.TokenType == TokenType.RIGHT_BRACKET)\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(theCurrentToken.TokenType == TokenType.IDENTITY)\n\t\t{\n\t\t\tisValid = true;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public boolean isValidName(String name) {\n\t\tif (name == null)\n\t\t\treturn false;\n\t\tif (name.matches(\".*[A-Z].*[a-zA-Z0-9]\"))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}" ]
[ "0.7120799", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.6907277", "0.68898886", "0.680594", "0.6700388", "0.66855067", "0.6672129", "0.6639075", "0.66277283", "0.66069657", "0.66069657", "0.65564555", "0.6538784", "0.65379566", "0.65133566", "0.65115154", "0.65106153", "0.64798087", "0.6469317", "0.6452152", "0.6427997", "0.6387982", "0.6380779", "0.63726515", "0.6356646", "0.6315618", "0.6308966", "0.6303417", "0.62947524", "0.628362", "0.6246294", "0.6215706", "0.61997855", "0.61893386", "0.6185507", "0.6170205", "0.61662173", "0.6145173", "0.6145173", "0.6145173", "0.6145173", "0.6134117", "0.6125899", "0.61222523", "0.61221445", "0.61167127", "0.61100936", "0.61088383", "0.6103588", "0.6101109", "0.6098447", "0.60710263", "0.6062158", "0.6059392", "0.60570997", "0.60565543", "0.6037613", "0.6005408", "0.600121", "0.5993281", "0.5981771", "0.596754", "0.59426236", "0.59407306", "0.5931684", "0.5924428", "0.5915589", "0.5914056", "0.5906773", "0.5903185", "0.59017056", "0.59006625", "0.58975893", "0.5893539", "0.58883095", "0.58866996", "0.58808565", "0.58651143" ]
0.78107923
0
Is this an unauthored name, meaning that it does not have a scientific name author?
public boolean isUnauthored() { return this.scientificNameAuthorship == null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default String getAuthor() {\r\n\t\treturn \"unknown\";\r\n\t}", "String getAuthorName();", "public static String fixAuthor(String in) {\n return(fixAuthor(in, true));\n }", "@Override\n\tpublic String getAuthor() {\n\t\treturn \"\";\n\t}", "private static String authorLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, NAME_STR, NAME);\n }", "public String getAuthor()\r\n {\r\n return(\"Judy O'Brien\");\r\n }", "public String getAuthorName() {\n return authorName;\n }", "public String getAuthorName() {\n return authorName;\n }", "public String getAuthorName() {\n return this.authorName;\n }", "public String getAuthorPseudonym() {\r\n return author.getPseudonym();\r\n }", "public String getScientificNameAuthorship() {\n return scientificNameAuthorship;\n }", "public String getAuthor() {\n\t\treturn \"Prasoon, Vikas, Shantanu\";\n\t}", "public String getAuthorName() {\n return mAuthorName;\n }", "public String getAuthor() {\n\t\treturn null;\r\n\t}", "public boolean hasAuthor() {\n return fieldSetFlags()[0];\n }", "String getAuthor();", "String getAuthor();", "@Override\n public void author_()\n {\n }", "private String getAuthorUsername(UIMessage message) {\r\n\t\tString toReturn = \"<Author-Not-Found>\";\r\n\t\ttry {\r\n\t\t\ttoReturn = facade.getMemberByID(message.getAuthorID()).getUsername();\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t// do nothing - return a default user-name\r\n\t\t}\r\n\t\treturn toReturn;\t\t\r\n\t}", "public static void checkNonPersonalProperName(Token t) {\r\n\t\tIterator<String> it = WordLists.nonPersonalIdentifierCues().iterator();\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tString npic = it.next();\r\n\t\t\t\r\n\t\t\tif(t.getName().equalsIgnoreCase(npic)) {\r\n\t\t\t\tt.getFeatures().setNonPersonalProperName(true);\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public void setAuthorisor(String authorisor)\n\t{\n\t\tthis.authorisor = Toolbox.trim(authorisor, 4);\n\t}", "private static String canonicalize (String authorName) {\n\t\tif (authorName.contains(\",\")) {\n\t\t\treturn removeAccents(authorName.substring(0, authorName.indexOf(',')).toLowerCase());\n\t\t} else if( authorName.contains(\" \")) {\n\t\t\treturn removeAccents(authorName.substring(authorName.lastIndexOf(' ') + 1, authorName.length()).toLowerCase());\n\t\t} else {\n\t\t\treturn removeAccents(authorName.toLowerCase());\n\t\t}\n\t}", "@Override\n\tpublic String author() {\n\t\treturn author;\n\t}", "public void setAuthorName(String authorName) {\n this.authorName = authorName;\n }", "public void setAuthorName(String authorName) {\n this.authorName = authorName;\n }", "public static String fixAuthor_nocomma(String in){\n \n\treturn fixAuthor(in);\n\t/*\n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache.get(in);\n if (old != null)\n return (String)old;\n \n StringBuffer sb=new StringBuffer();\n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n //System.out.println(authors[i]);\n authors[i]=authors[i].trim();\n String[] t = authors[i].split(\" \");\n\tif (t.length > 1) {\n\t sb.append(t[t.length-1].trim());\n\t for (int cnt=0; cnt<=t.length-2; cnt++)\n\t\tsb.append(\" \" + t[cnt].trim());\n\t} else\n\t sb.append(t[0].trim());\n\tif(i==authors.length-1)\n\t sb.append(\".\");\n\telse\n\t sb.append(\" and \");\n\t\n }\n \n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache.put(in, fixed);\n \n return fixed;*/\n }", "public String getAuthor();", "public String getAuthor() { return author_; }", "public String getAuthor() {\n\t\tint start = \"Author:\".length();\n\t\tint end = author.indexOf('<');\n\t\tString parsed = author.substring(start, end).trim();\n\t\treturn parsed;\n\t}", "private boolean name() {\r\n return (\r\n (letter() && alphas()) ||\r\n (CHAR('`') && nobquotes() && MARK(QUOTE) && CHAR('`'))\r\n );\r\n }", "public void extractAuthorsName() {\r\n try {\r\n // gets all matched objects for Author Name.\r\n Matcher matcherObject = matcher.patternMatcher(\"AuthorsName\");\r\n\r\n // add name to outputResult\r\n while (matcherObject.find()) {\r\n format.Formatter(1, matcherObject.group(1));\r\n isValidFile = true;\r\n }\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAuthorsName method\");\r\n }\r\n }", "private String getAuthorStringForLookup(CitedArticle citedArticle) {\n List<CitedArticleAuthor> authors = citedArticle.getAuthors();\n return authors.size() > 0 ? authors.get(0).getSurnames() : \"\";\n }", "static public String checkName(String origName) {\n String newName = sanitizeName(origName);\n\n if (!newName.equals(origName)) {\n String msg =\n _(\"The sketch name had to be modified. Sketch names can only consist\\n\" +\n \"of ASCII characters and numbers (but cannot start with a number).\\n\" +\n \"They should also be less than 64 characters long.\");\n System.out.println(msg);\n }\n return newName;\n }", "public String getAuthor() {\r\n\t\treturn author;\r\n\t}", "public abstract String getAuthor();", "public String getAuthorUsername() {\n\t\treturn authorUsername;\n\t}", "public boolean checkCreator (String nickname) {\r\n\t\treturn (creator.equals(nickname));\r\n\t}", "static public boolean isSanitaryName(String name) {\n return sanitizeName(name).equals(name);\n }", "private String getAuthor(CloudEntity post) {\n if (post.getCreatedBy() != null) {\n return \" \" + post.getCreatedBy().replaceFirst(\"@.*\", \"\");\n } else {\n return \"<anonymous>\";\n }\n }", "private String getAuthor(CloudEntity post) {\n if (post.getCreatedBy() != null) {\n return \" \" + post.getCreatedBy().replaceFirst(\"@.*\", \"\");\n } else {\n return \"<anonymous>\";\n }\n }", "public String getInternalName();", "public String getAuthor() {\r\n\t\treturn oAuthor;\r\n\t}", "abstract void lastNameValidity();", "public static String fixAuthor_commas(String in) {\n return(fixAuthor(in, false)); \n }", "public boolean isCompanyShortNameTaken(String shortName);", "protected String getBookAuthorBlock( String author )\n {\n return \"<bookinfo><corpauthor>\" + author + \"</corpauthor>\";\n }", "public String getAuthor() {\r\n return author;\r\n }", "public java.lang.String getAuthor() {\n return author;\n }", "public String getAuthorFullName() {\r\n String fullAuthorName = \"\";\r\n\r\n fullAuthorName = author.getAuthorFullName();\r\n return fullAuthorName;\r\n }", "public String getAuthor() {\n\t\treturn auth;\n\t}", "@Override\r\n\tpublic String getTagName() {\n\t\treturn \"author\";\r\n\t}", "public String getAuthor() {\n return (String)getAttributeInternal(AUTHOR);\n }", "boolean hasOriginName();", "@Override\n public void author()\n {\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public String getAuthor() {\n return author;\n }", "public java.lang.String getAuthor() {\n return author;\n }", "private boolean isNameValid(String name) {\n\n }", "public String getAuthorLastName() {\r\n return author.getLastName();\r\n }", "@Override\n public String toString() {\n return getAuthor().getName();\n }", "private String getOpinionAuthor() {\n String opinion = opinionView.getSelectionModel().getSelectedItem();\n String username = \"\";\n int i = 0;\n while (opinion.charAt(i) != ' '){\n username += opinion.charAt(i);\n i++;\n }\n return username;\n }", "public String getAuthorisor()\n\t{\n\t\treturn authorisor;\n\t}", "public void printAuthor()\n {\n System.out.println(\"by: \" + author);\n }", "public java.lang.String getAuthor()\n\tthrows java.rmi.RemoteException\n {\n\ttry {\n\t Object $result = ref.invoke(this, $method_getAuthor_0, null, 5683193999863030062L);\n\t return ((java.lang.String) $result);\n\t} catch (java.lang.RuntimeException e) {\n\t throw e;\n\t} catch (java.rmi.RemoteException e) {\n\t throw e;\n\t} catch (java.lang.Exception e) {\n\t throw new java.rmi.UnexpectedException(\"undeclared checked exception\", e);\n\t}\n }", "@Override\r\n\tpublic String getAuthor() {\n\t\treturn super.getAuthor();\r\n\t}", "private boolean isInternal(String name) {\n return name.startsWith(\"java.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"com.sun.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"oracle.\");\n }", "public void getAnAuthor() {\n System.out.println(\"Give author name: \");\n String key = input.next();\n for (Card s: cards) {\n if (s.autherOfBook.equals(key)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n }", "String getSurname();", "public String getAuthor()\r\n {\r\n return (m_author);\r\n }", "public String getNotchianName();", "java.lang.String getSurname();", "public void parseAuthorshipIntoName(ParsedNameUsage pnu, final String authorship, IssueContainer v){\n // try to add an authorship if not yet there\n if (!Strings.isNullOrEmpty(authorship)) {\n if (pnu.getName().isParsed()) {\n ParsedAuthorship pnAuthorship = parseAuthorship(authorship).orElseGet(() -> {\n LOG.info(\"Unparsable authorship {}\", authorship);\n v.addIssue(Issue.UNPARSABLE_AUTHORSHIP);\n // add the full, unparsed authorship in this case to not lose it\n ParsedName pn = new ParsedName();\n pn.getCombinationAuthorship().getAuthors().add(authorship);\n return pn;\n });\n\n // we might have already parsed an authorship from the scientificName string which does not match up?\n if (pnu.getName().hasAuthorship()) {\n String prevAuthorship = NameFormatter.authorship(pnu.getName());\n if (!prevAuthorship.equalsIgnoreCase(pnAuthorship.authorshipComplete())) {\n v.addIssue(Issue.INCONSISTENT_AUTHORSHIP);\n LOG.info(\"Different authorship found in name {} than in parsed version: [{}] vs [{}]\",\n pnu.getName(), prevAuthorship, pnAuthorship.authorshipComplete());\n }\n }\n\n // keep authorship issues in a separate container\n // so we can filter out non authorship related issues before we add them to the verbatim record\n IssueContainer ic = new IssueContainer.Simple();\n copyToPNU(pnAuthorship, pnu, ic);\n // ignore issues related to the epithet - we only parse authorships here\n removeEpithetIssues(ic);\n ic.getIssues().forEach(v::addIssue);\n\n // use original authorship string but normalize whitespace\n pnu.getName().setAuthorship( normalizeAuthorship(authorship, pnAuthorship.getTaxonomicNote()) );\n\n } else {\n // unparsed name might still not have any authorship\n String sciName = AuthorshipNormalizer.normalize(pnu.getName().getScientificName());\n if (sciName == null) {\n pnu.getName().setAuthorship(authorship);\n } else {\n String authNormed = AuthorshipNormalizer.normalize(authorship);\n if (authNormed != null && !sciName.contains(authNormed)) {\n pnu.getName().setAuthorship(authorship);\n }\n }\n }\n }\n }", "public String getAuthor() {\n\treturn author;\n}", "public static String fixAuthor(String in, boolean includeAnds){\n if (includeAnds) {\n Object old = Globals.nameCache.get(in);\n if (old != null)\n return (String)old;\n } else {\n Object old = Globals.nameCache_commas.get(in);\n if (old != null)\n return (String)old; \n }\n \n \t//Util.pr(\"firstnamefirst\");\n \tStringBuffer sb=new StringBuffer();\n \t//System.out.println(\"FIX AUTHOR: in= \" + in);\n \n \tString[] authors = in.split(\" and \");\n \tfor(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t String[] t = authors[i].split(\",\");\n \t if(t.length < 2)\n \t // there is no comma, assume we have FN LN order\n \t sb.append(authors[i].trim());\n \t else\n \t sb.append( t[1].trim() + \" \" + t[0].trim());\n \t if (includeAnds) {\n \t if(i != authors.length-1 ) // put back the \" and \"\n \t sb.append(\" and \");\n \t } else {\n \t if (i == authors.length - 2)\n \t sb.append(\" and \");\n \t else if (i != (authors.length - 1))\n \t sb.append(\", \");\n \t }\n \t}\n \n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache.put(in, fixed);\n \n \treturn fixed;\n }", "boolean hasSurname();", "public static String fixAuthor_lastnameFirst(String in){\n \n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache_lastFirst.get(in);\n if (old != null)\n return (String)old;\n \n //Util.pr(\"lastnamefirst: in\");\n StringBuffer sb=new StringBuffer();\n \n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t int comma = authors[i].indexOf(',');\n \t test:if (comma >= 0) {\n \t // There is a comma, so we assume it's ok.\n \t sb.append(authors[i]);\n }\n else {\n // The name is without a comma, so it must be rearranged.\n int pos = authors[i].lastIndexOf(' ');\n if (pos == -1) {\n // No spaces. Give up and just add the name.\n sb.append(authors[i]);\n break test;\n }\n String surname = authors[i].substring(pos+1);\n if (surname.equalsIgnoreCase(\"jr.\")) {\n pos = authors[i].lastIndexOf(' ', pos - 1);\n if (pos == -1) {\n // Only last name and jr?\n sb.append(authors[i]);\n break test;\n }\n else\n surname = authors[i].substring(pos+1);\n }\n // Ok, we've isolated the last name. Put together the rearranged name:\n sb.append(surname + \", \");\n sb.append(authors[i].substring(0, pos));\n \n }\n if (i != authors.length - 1)\n sb.append(\" and \");\n }\n /*String[] t = authors[i].split(\",\");\n if(t.length < 2) {\n // The name is without a comma, so it must be rearranged.\n t = authors[i].split(\" \");\n if (t.length > 1) {\n sb.append(t[t.length - 1]+ \",\"); // Last name\n for (int j=0; j<t.length-1; j++)\n sb.append(\" \"+t[j]);\n } else if (t.length > 0)\n sb.append(t[0]);\n }\n else {\n // The name is written with last name first, so it's ok.\n sb.append(authors[i]);\n }\n \n if(i !=authors.length-1)\n sb.append(\" and \");\n \n }*/\n //Util.pr(in+\" -> \"+sb.toString());\n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache_lastFirst.put(in, fixed);\n \n return fixed;\n }", "public String getAuthor() {\n return mAuthor;\n }", "public interface NOName {\n String getAuthor();\n}", "public abstract String getAuthor(int lineNumber);", "public String getAuthor(){\n return author;\n \n }", "@Override\n\tpublic String getDescription() {\n\t\treturn author;\n\t}", "public String getCanonicalAuthorName(GitCommit commit) {\n return getCanonicalName(commit.getAuthorName(), commit.getAuthorEmailAddress());\n }", "private String getAuthorUsername(ForumFacade forum, UIMessage message) {\n\t\tString toReturn = \"<Author-Not-Found>\";\n\t\ttry {\n\t\t\ttoReturn = forum.getMemberByID(message.getAuthorID()).getUsername();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystemLogger.warning(\"While retrieving the contents of message \" + messageID + \" the username \" +\n\t\t\t\t\t\" of the user with id \" + message.getAuthorID() + \" wasn't found.\");\n\t\t}\n\t\treturn toReturn;\t\t\n\t}", "public boolean isUrgentLetter() {\n\t\treturn false;\n\t}", "private String extarctStudentName(String record) throws noStudentNameException{\n\t\tString name = record.substring(0, record.indexOf(':'));\n\t\tname = name.trim();\n\t\tcheckNameValidation(name);\n\t\treturn name;\n\t}", "private static boolean validName(String name) {\n return name != null && !name.strip().isBlank();\n }", "private boolean isReviewerAnAuthor(Manuscript theManuscript) {\r\n\t\tboolean isAuthor = false;\r\n\t\tTreeMap<UUID, Account> acctList = new AccountDatabase().deserializeAccountList();\r\n\t\tArrayList<Account> validAccountList = new ArrayList<Account>();\r\n\t\t\r\n\t\tList<UUID> authorlist = theManuscript.getAuthors();\r\n\t\t\r\n\t\tfor(Account anAcct : acctList.values()) {\r\n\t\t\tif (anAcct.getMyReviewer() != null) {\r\n\t\t\t\tif(anAcct.getMyReviewer().getMyID().equals(this.getMyID())) {\r\n\t\t\t\t\tvalidAccountList.add(anAcct);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor(Account anAcct : validAccountList) {\r\n\t\t\tif(theManuscript.doesAuthorBelongToManuscript(anAcct.getMyAuthor())) {\r\n\t\t\t\tisAuthor = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\treturn isAuthor;\r\n\t\t\r\n\t}", "public interface AuthorNames {\n\n static String shortenName(String name) {\n return Arrays.asList(name.split(\" \")).\n stream().\n map(s -> s.substring(0, 1)).collect(Collectors.joining());\n }\n}", "boolean validateLastName(String Last_name) {\n\t\treturn true;\n\n\t}", "public String getAuthor(){return author;}" ]
[ "0.6932759", "0.6874928", "0.6740081", "0.6646032", "0.6591489", "0.6589777", "0.65018886", "0.65018886", "0.64654326", "0.645965", "0.6454751", "0.64398366", "0.64004916", "0.63999057", "0.6372006", "0.6286673", "0.6286673", "0.62794286", "0.62673235", "0.61919856", "0.61660004", "0.61567646", "0.6118203", "0.61060715", "0.61060715", "0.61045164", "0.6090952", "0.6055763", "0.60425925", "0.6016052", "0.6014055", "0.5990662", "0.5977237", "0.59562385", "0.593745", "0.5922197", "0.59156424", "0.59098595", "0.5903162", "0.5903162", "0.5897693", "0.5896213", "0.58863026", "0.5880025", "0.5864967", "0.5860845", "0.58360475", "0.58176535", "0.5806437", "0.5800778", "0.57894707", "0.5768071", "0.5763741", "0.57624", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5752959", "0.5747829", "0.5745769", "0.57360566", "0.5729286", "0.5725116", "0.57210535", "0.5718636", "0.57140607", "0.5711386", "0.5691732", "0.5691713", "0.5691499", "0.5689778", "0.56853306", "0.5679909", "0.56731284", "0.56719065", "0.5671201", "0.5671091", "0.5658784", "0.56584245", "0.56492937", "0.5643815", "0.564112", "0.563717", "0.5629124", "0.5615919", "0.5615721", "0.5611846", "0.5604451", "0.55652666", "0.55636865", "0.55621684", "0.55564535" ]
0.74799776
0
Is this an uncoded name, meaning that it does not have a nomenclatural code to accurately distinguish between homonyms?
public boolean isUncoded() { return this.code == null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String getName() {\n return \"synonym\";\n }", "public String mangle(String sName);", "@Override\n public String named() {\n return \"soul\";\n }", "abstract String name();", "public String getAcronym();", "@Override\r\n\tpublic char getAcronym() {\r\n\t\treturn 'M';\r\n\t}", "org.hl7.fhir.CodeableConcept getName();", "public abstract String getRawName();", "public Classification nameOf(String name) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }", "protected abstract String name ();", "public abstract String shortName();", "private boolean name() {\r\n return (\r\n (letter() && alphas()) ||\r\n (CHAR('`') && nobquotes() && MARK(QUOTE) && CHAR('`'))\r\n );\r\n }", "abstract String getName();", "private boolean isIdentifier(String input) {\n if (this.isLetter(input.charAt(0))) {\n return true;\n } else return false;\n }", "public String asIdentifier() {\n\t\treturn this.keyword.toLowerCase().replace(' ', '_').replace('.', '_');\n\t}", "public abstract String getNaturalIdentity();", "AlphabetNameReference createAlphabetNameReference();", "abstract public String name();", "public String getInternalName();", "abstract public String named();", "public String getNotchianName();", "Caseless getName();", "Concept getConceptName();", "EPREFIX_TYPE getName();", "public String getScoreName() {\n return \"NetspeakSynonyms\"; // TODO: parameter\n }", "SimpleName getName();", "abstract String moodString();", "public String getName() {\r\n return \"Boyer/Moore-Suche in Strings\";\r\n }", "public String getName() {\n\t\treturn \"lorann\";\r\n\t}", "boolean hasHangmogName();", "public abstract String name();", "public abstract String name();", "public abstract String name();", "public abstract String name();", "public String name()\r\n/* 256: */ {\r\n/* 257:465 */ return this.name;\r\n/* 258: */ }", "MnemonicNameReference createMnemonicNameReference();", "public SymName(String n) {\n\tn = n.trim();\n\tfullName = n;\n\tcomp = Util.findComponents(n);\n\tnum_comp = comp.length;\n\ttype = new int[num_comp];\n }", "@VTID(7)\r\n java.lang.String name();", "public static boolean isGoodTypeName(String candidate) {\n return isUsable(candidate) && candidate.matches(OSGI_SYMBOLIC_NAME_REGEX);\n }", "public static void checkNonPersonalProperName(Token t) {\r\n\t\tIterator<String> it = WordLists.nonPersonalIdentifierCues().iterator();\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tString npic = it.next();\r\n\t\t\t\r\n\t\t\tif(t.getName().equalsIgnoreCase(npic)) {\r\n\t\t\t\tt.getFeatures().setNonPersonalProperName(true);\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public interface MorphemesDetector {\n\n String detectSuffix(String token);\n\n}", "java.lang.String getHangmogName();", "public java.lang.String shortName () { throw new RuntimeException(); }", "protected String revealedId (String name)\n {\n return name;\n }", "protected abstract String getName();", "public abstract String mo13682d();", "public abstract String getSimpleName( );", "public abstract String Name();", "@Override\n public String nameAndType() {\n\t String n = \"noname\";\n\t if (name != null) {\n\t\t n=name;\n\t }\n\t return \"if \"+n+\":\";\n }", "@VTID(17)\n java.lang.String getName();", "public Identifier getName();", "abstract public String getName();", "abstract public String getName();", "ReagentSynonym getSearchedReagentSynonym();", "abstract String junctionSymbol();", "boolean hasCodeName();", "public interface FunctionSynonym extends ConceptOrSynonym\n{\n}", "public String getName()\r\n {\n return \"arctan\";\r\n }", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String simpleName();", "public void nameAnalysis(SymTable symTab) { }", "Name getName();", "abstract String mo1747a(String str);", "@Override\r\n\tpublic void name() {\n\t\tSystem.out.println(\"Hamilton\");\r\n\t}", "public InvalidOntologyName(String invalidCharacter) {\n super(String.format(\"Ontology name cannot contain %s\", invalidCharacter));\n }", "String getIdentifierName(String name, String type);", "@Override\r\n protected String forumShortName() {\r\n return \"ilikeplaces\";\r\n }" ]
[ "0.6689626", "0.64174604", "0.620846", "0.62048876", "0.6171958", "0.61253655", "0.612055", "0.6119789", "0.60114145", "0.59715754", "0.59513056", "0.5922511", "0.5913182", "0.5889301", "0.5882413", "0.5860359", "0.5853551", "0.5827769", "0.58172387", "0.5811511", "0.5807342", "0.5780843", "0.57807827", "0.5776377", "0.5770522", "0.5760004", "0.57544553", "0.57125634", "0.57108814", "0.570753", "0.5702027", "0.5702027", "0.5702027", "0.5702027", "0.5682368", "0.56816447", "0.5674914", "0.5668548", "0.5665702", "0.5659242", "0.5653264", "0.5651563", "0.56508505", "0.5633891", "0.56279296", "0.5622131", "0.56177324", "0.56177074", "0.5615674", "0.5602023", "0.5588627", "0.5588174", "0.5588174", "0.55865777", "0.5584813", "0.55771303", "0.5577", "0.5569836", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.5565495", "0.55590516", "0.55478543", "0.55405605", "0.5531282", "0.5522827", "0.55215406", "0.5515491", "0.55094796" ]
0.0
-1
Is this a formaal name key, meaning that the name type represents something like a scientific name.
public boolean isFormal() { return this.code != null && this.type != null && (this.type == NameType.SCIENTIFIC || this.type == NameType.HYBRID || this.type == NameType.CULTIVAR || this.type == NameType.VIRUS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public NameKey(NameAnalyser analyser, NomenclaturalCode code, String scientificName, String scientificNameAuthorship, RankType rank, NameType type, @Nullable Set<NameFlag> flags) {\n this.analyser = analyser;\n this.code = code;\n this.scientificName = scientificName;\n this.scientificNameAuthorship = scientificNameAuthorship;\n this.rank = rank;\n this.type = type;\n this.flags = flags;\n }", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "boolean isTypeKey(String key);", "String getShortNameKey();", "private boolean name() {\r\n return (\r\n (letter() && alphas()) ||\r\n (CHAR('`') && nobquotes() && MARK(QUOTE) && CHAR('`'))\r\n );\r\n }", "@Test\n public void getName() throws Exception {\n String name = new AttributeKey<Number>(Number.class, \"keyName\").getName();\n assertThat(name, is(\"keyName\"));\n }", "public Object getKey() { return name; }", "public static boolean isGoodTypeName(String candidate) {\n return isUsable(candidate) && candidate.matches(OSGI_SYMBOLIC_NAME_REGEX);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "String getLongNameKey();", "public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "String typeName();", "public String getNameKey() {\n return getName();\n }", "String getKeyFormat();", "EPREFIX_TYPE getName();", "boolean isSetName();", "public interface Key<T> {\n String getName();\n Class<T> getType();\n\n static <T> Key<T> of(Class<T> type) {\n return of(type.getName(), type);\n }\n\n static <T> Key<T> of(String name, Class<T> type) {\n return new Key<T>() {\n @Override\n public String getName() {\n return name;\n }\n\n @Override\n public Class<T> getType() {\n return type;\n }\n };\n }\n }", "public Integer getNametype() {\r\n return nametype;\r\n }", "public void testCreateKeyWithName() {\n Key key = KeyFactory.createKey(kind, name);\n assertEquals(name, key.getName());\n assertEquals(kind, key.getKind());\n assertEquals(0L, key.getId());\n }", "public FontStyleableFigureKey(String name) {\n this(name, null);\n }", "public K getName() {\n return key;\n }", "@Override\n public String name(String name, Meter.Type type, @Nullable String baseUnit) {\n String conventionName = NamingConvention.snakeCase.name(name, type, baseUnit);\n\n switch (type) {\n case COUNTER:\n case DISTRIBUTION_SUMMARY:\n case GAUGE:\n if (baseUnit != null && !conventionName.endsWith(\"_\" + baseUnit))\n conventionName += \"_\" + baseUnit;\n break;\n }\n\n switch (type) {\n case COUNTER:\n if (!conventionName.endsWith(\"_total\"))\n conventionName += \"_total\";\n break;\n case TIMER:\n case LONG_TASK_TIMER:\n if (conventionName.endsWith(timerSuffix)) {\n conventionName += \"_seconds\";\n }\n else if (!conventionName.endsWith(\"_seconds\"))\n conventionName += timerSuffix + \"_seconds\";\n break;\n }\n\n String sanitized = nameChars.matcher(conventionName).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "KeyColor(String name){\n this.name = name;\n }", "abstract String getName();", "boolean isNameRequired();", "protected abstract String getName();", "public String createKey(String type) {\n int i = 0;\n for(i=0; i<EnumFactory.numberOfTypes; i++) {\n if (type.equals(EnumFactory.typeStrings[i])) {\n break;\n }\n }\n countKeys[i]++;\n String key = String.format(\"%s$%d\", EnumFactory.typeStrings[i],countKeys[i]);\n return key;\n }", "private static AbstractType<?> keyType(CollectionType<?> type)\n {\n return type.nameComparator();\n }", "public void setNametype(Integer nametype) {\r\n this.nametype = nametype;\r\n }", "@Override\r\n\t\t\tpublic IHierarchicalKey caseEStringToStringMapEntry(\r\n\t\t\t\t\tEntry<String, String> object) {\r\n\t\t\t\treturn new NamedElementKey(object);\r\n\t\t\t}", "public ABLKey Key(String name) {\r\n\t\treturn new ABLKey(BrickFinder.getDefault().getKey(name));\r\n\t}", "private String getCasTypeName(String aTagName) {\n if (aTagName.indexOf(':') == -1 && aTagName.indexOf('-') == -1) {\n return aTagName;\n } else {\n // Note: This is really slow so we avoid if possible. -- RJB\n return StringUtils.replaceAll(StringUtils.replaceAll(aTagName, \":\", \"_colon_\"), \"-\",\n \"_dash_\");\n }\n }", "abstract String name();", "Caseless getName();", "public void testCreateKeyStringWithParentAndName() {\n try {\n KeyFactory.createKeyString(\n KeyFactory.createKey(kind, name),\n kind,\n name);\n } catch (IllegalStateException e) {\n return;\n }\n fail();\n }", "protected abstract String name ();", "public abstract String getTypeName();", "@Override\r\n public boolean isNameProperty() throws Exception\r\n {\n return false;\r\n }", "AlphabetNameReference createAlphabetNameReference();", "private boolean isIdentifier(String identifier) {\n boolean isFirst = true;\n\n for (int i = 0; i < identifier.length(); i++) {\n char ch = identifier.charAt(i);\n\n if (isFirst && Character.isJavaIdentifierStart(ch)) {\n // first char of key\n } else if (Character.isJavaIdentifierPart(ch) || ch == '.') {\n // remaining chars of the key\n } else {\n // error in format\n return false;\n }\n\n isFirst = false;\n }\n\n return true;\n }", "@Override\r\n\tpublic char getAcronym() {\r\n\t\treturn 'M';\r\n\t}", "public void testGetName()\n\t{\t\n\t\t((TypeDefinitionImpl)fTypeDefinition).setName(new QName(\"tdName\"));\n\t\tassertEquals(\"The TypeDefinition name QName differs from that set-\", \"tdName\", fTypeDefinition.getName().toString());\n\t}", "public static boolean isName(int c) {\n return c < 0x10000 && (CHARS[c] & MASK_NAME) != 0;\n }", "public void testCreateKeyStringWithName() {\n try {\n KeyFactory.createKeyString(kind, name);\n } catch (IllegalStateException e) {\n return;\n }\n fail();\n }", "public boolean qualifyIndexName() {\n \t\treturn true;\n \t}", "public String ofType() {\n\t\t return name;\n\t}", "private String validateKeyClassName (String keyClassName) \n\t\t\t\tthrows ModelValidationException\n\t\t\t{\n\t\t\t\tString pcClassName = getClassName();\n\t\t\t\tModel model = getModel();\n\t\t\t\tboolean hasKeyClassName = !StringHelper.isEmpty(keyClassName);\n\t\t\t\tboolean hasPrefix;\n\t\t\t\tString nameSuffix;\n\t\t\t\tboolean isOIDNameSuffix;\n\n\t\t\t\t// check for existence of key class name\n\t\t\t\tif (!hasKeyClassName)\n\t\t\t\t{\n\t\t\t\t\tthrow new ModelValidationException(\n\t\t\t\t\t\tModelValidationException.WARNING,\n\t\t\t\t\t\tmodel.getClass(pcClassName),\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_class_unset\", //NOI18N\n\t\t\t\t\t\tpcClassName));\n\t\t\t\t}\n\n\t\t\t\tkeyClassName = keyClassName.trim();\n\t\t\t\thasPrefix = keyClassName.startsWith(pcClassName);\n\t\t\t\tnameSuffix = (hasPrefix ? \n\t\t\t\t keyClassName.substring(pcClassName.length()) : keyClassName);\n\t\t\t\tisOIDNameSuffix = \n\t\t\t\t\t(nameSuffix.equalsIgnoreCase(\".OID\") || // NOI18N\n\t\t\t\t\t nameSuffix.equalsIgnoreCase(\"$OID\")); // NOI18N\n\n\t\t\t\tif (!hasPrefix || \n\t\t\t\t\t(!nameSuffix.equalsIgnoreCase(\"Key\") && \t// NOI18N\n\t\t\t\t\t !isOIDNameSuffix))\n\t\t\t\t{\n\t\t\t\t\tObject pcClass = getModel().getClass(pcClassName);\n\t\t\t\t\tthrow new ModelValidationException(pcClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(),\n\t\t\t\t\t\t\"util.validation.key_class_invalid\", //NOI18N\n\t\t\t\t\t\tkeyClassName, pcClassName));\n\t\t\t\t}\n\t\t\t\tif (isOIDNameSuffix)\n\t\t\t\t{\n\t\t\t\t\tStringBuffer buf = new StringBuffer(keyClassName);\n\t\t\t\t\tbuf.setCharAt(keyClassName.length() - 4, '$');\n\t\t\t\t\treturn buf.toString(); \n\t\t\t\t}\n\t\t\t\treturn keyClassName;\n\t\t\t}", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "public boolean containsKey(String n){\n\t\treturn name.containsKey(n);\n\t}", "public Classification nameOf(String name) {\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }", "public boolean hasKeyName() {\n return fieldSetFlags()[0];\n }", "static String makeKey(String id,\n String for_,\n String attrname,\n String attrtype) {\n return format(KEY_FMT, id, for_, attrname, attrtype);\n }", "public NameType getType() {\n return type;\n }", "abstract public String getName();", "abstract public String getName();", "private boolean isIdentifier(String input) {\n if (this.isLetter(input.charAt(0))) {\n return true;\n } else return false;\n }", "PropertyName getName();", "public RiverName(String type, String name) {\n\t\tthis.type = type;\n\t\tthis.name = name;\n\t}", "public String getKeyType() \n {\n return DBFactory.getKeyTypeName(this.keyType);\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "public static String getNameKeyForAssociateMatchKey(String lastname, String firstname) {\n if (lastname == null) {\n lastname = \"\";\n }\n String lastnameFirstword = lastname.split(\"[-]\")[0].toUpperCase();\n\n if (firstname == null) {\n firstname = \"\";\n }\n String firstTwoFirstname = firstname.substring(0, min(2, firstname.length())).toUpperCase();\n\n String name_key = lastnameFirstword + firstTwoFirstname;\n return name_key;\n }", "String getIdentifierName(String name, String type);", "public java.lang.String getKeyType() {\n return keyType;\n }", "public void testCreateKeyWithParentAndName() {\n Key parent = KeyFactory.createKey(kind, name);\n Key key = KeyFactory.createKey(parent, kind, name);\n assertEquals(name, key.getName());\n assertEquals(kind, key.getKind());\n assertEquals(0L, key.getId());\n assertEquals(parent, key.getParent());\n }", "@Override\n public String nameAndType() {\n\t String n = \"noname\";\n\t if (name != null) {\n\t\t n=name;\n\t }\n\t return \"if \"+n+\":\";\n }", "public PlatformKey (String name) {\n assert name != null;\n this.name = name;\n }", "public BooleanStyleableFigureKey(String name) {\n this(name, null);\n }", "SimpleName getName();", "public final EObject ruleEDataTypeName() throws RecognitionException {\n EObject current = null;\n\n EObject this_EPREFIX_TYPE_0 = null;\n\n EObject this_EPRIMITIVE_TYPE_1 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalRMParser.g:799:2: ( (this_EPREFIX_TYPE_0= ruleEPREFIX_TYPE | this_EPRIMITIVE_TYPE_1= ruleEPRIMITIVE_TYPE ) )\n // InternalRMParser.g:800:2: (this_EPREFIX_TYPE_0= ruleEPREFIX_TYPE | this_EPRIMITIVE_TYPE_1= ruleEPRIMITIVE_TYPE )\n {\n // InternalRMParser.g:800:2: (this_EPREFIX_TYPE_0= ruleEPREFIX_TYPE | this_EPRIMITIVE_TYPE_1= ruleEPRIMITIVE_TYPE )\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==RULE_ID) ) {\n int LA5_1 = input.LA(2);\n\n if ( (LA5_1==EOF||(LA5_1>=Derived_from && LA5_1<=Entry_schema)||(LA5_1>=Constraints && LA5_1<=Description)||LA5_1==Properties||LA5_1==Required||LA5_1==Default||LA5_1==Status||(LA5_1>=Value && LA5_1<=File)||LA5_1==Type||LA5_1==Colon||LA5_1==RULE_END) ) {\n alt5=2;\n }\n else if ( (LA5_1==Solidus) ) {\n alt5=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 5, 1, input);\n\n throw nvae;\n }\n }\n else if ( (LA5_0==RULE_QUALIFIED_NAME) ) {\n alt5=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 5, 0, input);\n\n throw nvae;\n }\n switch (alt5) {\n case 1 :\n // InternalRMParser.g:801:3: this_EPREFIX_TYPE_0= ruleEPREFIX_TYPE\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getEDataTypeNameAccess().getEPREFIX_TYPEParserRuleCall_0());\n \t\t\n pushFollow(FOLLOW_2);\n this_EPREFIX_TYPE_0=ruleEPREFIX_TYPE();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_EPREFIX_TYPE_0;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n case 2 :\n // InternalRMParser.g:810:3: this_EPRIMITIVE_TYPE_1= ruleEPRIMITIVE_TYPE\n {\n\n \t\t\tnewCompositeNode(grammarAccess.getEDataTypeNameAccess().getEPRIMITIVE_TYPEParserRuleCall_1());\n \t\t\n pushFollow(FOLLOW_2);\n this_EPRIMITIVE_TYPE_1=ruleEPRIMITIVE_TYPE();\n\n state._fsp--;\n\n\n \t\t\tcurrent = this_EPRIMITIVE_TYPE_1;\n \t\t\tafterParserOrEnumRuleCall();\n \t\t\n\n }\n break;\n\n }\n\n\n }\n\n\n \tleaveRule();\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "@Override\n public String getName() {\n return type.getName();\n }", "public static boolean isSafeIdentifierName(String name, int fromIndex) {\n int i = fromIndex;\n for (; i < name.length(); i++) {\n char c = name.charAt(i);\n if (!(c == '$' || c == '@' || c == ':')) {\n break;\n }\n }\n for (; i < name.length(); i++) {\n char c = name.charAt(i);\n if (!((c >= 'a' && c <= 'z') || (c == '_') ||\n (c >= 'A' && c <= 'Z') ||\n (c >= '0' && c <= '9') ||\n (c == '?') || (c == '=') || (c == '!'))) { // Method suffixes; only allowed on the last line\n\n if (isOperator(name)) {\n return true;\n }\n\n return false;\n }\n }\n\n return true;\n }", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public abstract String getName();", "public NameKey toRankedNameKey(RankType rank) {\n if (this.rank == rank)\n return this;\n return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags);\n }", "public java.lang.String getKeyType() {\n return keyType;\n }", "public SymName(String n) {\n\tn = n.trim();\n\tfullName = n;\n\tcomp = Util.findComponents(n);\n\tnum_comp = comp.length;\n\ttype = new int[num_comp];\n }", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(NAME$2) != null;\r\n }\r\n }", "public String getTypeName() {\r\n\t\treturn typeName;\r\n\t}", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$8) != 0;\n }\n }" ]
[ "0.64832616", "0.6478625", "0.6187161", "0.6170704", "0.61656815", "0.60462886", "0.59768534", "0.58617234", "0.5822131", "0.58089715", "0.57757837", "0.5767088", "0.5752509", "0.57483166", "0.5744215", "0.56955755", "0.5686623", "0.5656415", "0.5646236", "0.56330097", "0.5628607", "0.5600588", "0.5595625", "0.5591978", "0.55728304", "0.5567455", "0.5547845", "0.5532399", "0.5524907", "0.5523075", "0.5516876", "0.55102044", "0.5508155", "0.5504475", "0.5496255", "0.5479896", "0.5474186", "0.54644316", "0.54505616", "0.5440004", "0.54348844", "0.54309314", "0.542757", "0.5392046", "0.53863364", "0.5381029", "0.5362933", "0.53527594", "0.53494203", "0.5343267", "0.5336981", "0.5334721", "0.53341717", "0.5332684", "0.5332684", "0.53283376", "0.532573", "0.5311756", "0.53111625", "0.5307104", "0.5304674", "0.53007364", "0.52888495", "0.5288836", "0.5284825", "0.5284329", "0.52818424", "0.5273091", "0.52709186", "0.5270508", "0.52651733", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.52559215", "0.5253538", "0.5251151", "0.524501", "0.52423966", "0.5235156", "0.5228134" ]
0.0
-1
Compare for equality with another name key Name keys are equal if the analyser says they are
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NameKey nameKey = (NameKey) o; return this.analyser.compare(this, nameKey) == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void equalsWithDifferentName() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"key1\");\n AttributeKey<Number> key2 = new AttributeKey<Number>(Number.class, \"key2\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }", "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 }", "protected abstract boolean equalityTest(Object key, Object key2);", "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 boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof ApptranregFeesAud)) {\n return false;\n }\n ApptranregFeesAud that = (ApptranregFeesAud) other;\n Object myAtrfAudUid = this.getAtrfAudUid();\n Object yourAtrfAudUid = that.getAtrfAudUid();\n if (myAtrfAudUid==null ? yourAtrfAudUid!=null : !myAtrfAudUid.equals(yourAtrfAudUid)) {\n return false;\n }\n return true;\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof BlastingtypeRelationsAud)) {\n return false;\n }\n BlastingtypeRelationsAud that = (BlastingtypeRelationsAud) other;\n Object myBtrAudUid = this.getBtrAudUid();\n Object yourBtrAudUid = that.getBtrAudUid();\n if (myBtrAudUid==null ? yourBtrAudUid!=null : !myBtrAudUid.equals(yourBtrAudUid)) {\n return false;\n }\n return true;\n }", "@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }", "@Test\n\tpublic void 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}", "private boolean equalKeys(Object other) {\r\n if (this == other) {\r\n return true;\r\n }\r\n if (!(other instanceof Contacto)) {\r\n return false;\r\n }\r\n Contacto that = (Contacto) other;\r\n if (this.getIdContacto() != that.getIdContacto()) {\r\n return false;\r\n }\r\n return true;\r\n }", "public final void testDifferentNameEquals() {\n assertFalse(testTransaction1.equals(testTransaction2)); // pmd doesn't\n // like either\n // way\n }", "public boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }", "private boolean 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 }", "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 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 }", "@Test\n\tpublic void equalsSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tboolean equals = key.equals(key);\n\t\tAssert.assertTrue(equals);\n\t}", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof Sanpham)) return false;\n return this.equalKeys(other) && ((Sanpham)other).equalKeys(this);\n }", "@Test\n public void equalsWithDifferentTypes() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"keyName\");\n AttributeKey<Date> key2 = new AttributeKey<Date>(Date.class, \"keyName\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }", "@Test\n public void testKeyEquivalence() throws Exception {\n ScanResultMatchInfo matchInfo1 = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo1Prime = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo2 = ScanResultMatchInfo.fromWifiConfiguration(mConfig2);\n assertFalse(matchInfo1 == matchInfo1Prime); // Checking assumption\n MacAddress mac1 = MacAddressUtils.createRandomUnicastAddress();\n MacAddress mac2 = MacAddressUtils.createRandomUnicastAddress();\n assertNotEquals(mac1, mac2); // really tiny probability of failing here\n\n WifiCandidates.Key key1 = new WifiCandidates.Key(matchInfo1, mac1, 1);\n\n assertFalse(key1.equals(null));\n assertFalse(key1.equals((Integer) 0));\n // Same inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1, mac1, 1));\n // Equal inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1Prime, mac1, 1));\n // Hash codes of equal things should be equal\n assertEquals(key1.hashCode(), key1.hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1, mac1, 1).hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1Prime, mac1, 1).hashCode());\n\n // Unequal inputs should give unequal results\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo2, mac1, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac2, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac1, 2)));\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof Acquirente)) return false;\n return this.equalKeys(other) && ((Acquirente)other).equalKeys(this);\n }", "protected boolean equalityTest(Object key, Object key2) {\n\t\t\treturn this.set.equalityTest(key, key2);\n\t\t}", "@Test\n public void equals_differentName() {\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 \"Foo 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 \"Bar Site\"\n );\n\n Assert.assertNotEquals(si1, si2);\n }", "public boolean isNameEquals(String name) {\n\n return (_name.equalsIgnoreCase(name));//Checks not case sensitive\n }", "private static boolean equalityTest1(String a, String b)\n {\n return a == b;\n }", "@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey3 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127620542L), 76,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"e31184de-791f-4689-9075-d12706757ba9\", -7,\n \"d34afc91-63f2-42e0-bde5-cfbb131751fd\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620923L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotNull(apikey3);\n assertNotSame(apikey2, apikey1);\n assertNotSame(apikey3, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey1, apikey2);\n assertEquals(apikey1, apikey1);\n assertFalse(apikey1.equals(null));\n assertNotEquals(apikey3, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tAttributeKey ak = (AttributeKey)obj;\r\n\t\treturn this.key.equals(ak.getKey());\r\n\t}", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "String getEqual();", "public boolean equal (MapIterator other)\n {\n if(this.MapItr.element.Key == other.MapItr.element.Key)//*****Value or Key?\n return true;\n \n else\n return false;\n }", "private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }", "@Test\n public void equals_returnsTrueIfNameIsTheSame_false() {\n Animal firstAnimal = new Animal(\"Deer\");\n Animal anotherAnimal = new Animal(\"Deer\");\n assertTrue(firstAnimal.equals(anotherAnimal));\n }", "public static boolean namesEqual(String name1, String name2) {\n if (StringUtil.isEmpty(name1) && StringUtil.isEmpty(name2)) {\n return true;\n }\n if (normalizer.isDelimited(defaultRule, name1)) {\n if (!Objects.equals(name1, name2)) {\n return false;\n }\n } else {\n if (!StringUtil.equalsIgnoreCase(name1, name2)) {\n return false;\n }\n }\n return true;\n }", "private static boolean equalityTest2(String a, String b)\n {\n return a.equals(b);\n }", "@Test\n\tpublic void doEqualsTestSameMapDifferentInstances() {\n\t\tassertTrue(bigBidiMap.equals(bigBidiMap_other));\n\n\t}", "public boolean nameEquals(IonModification a) {\n return parsedName.equals(a.parsedName);\n }", "boolean keyeq(LuaValue key);", "public boolean equalsName(String otherName) {\n return name.equals(otherName);\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof BlastingtypeRelationsAud)) return false;\n return this.equalKeys(other) && ((BlastingtypeRelationsAud)other).equalKeys(this);\n }", "public boolean equals(Object other) {\n return qName.equals(((NotationValue)other).qName);\n }", "private static boolean equalityTest5(String a, String b)\n {\n return a.hashCode() == b.hashCode();\n }", "public HashMap<String, String> compareNames(String name1, String name2) {\n\t\tcompare(name1, name2) ; \n\t\tHashMap<String, String> result = new HashMap<String, String>();\n\t\tresult.put(\"SCORE\", Float.toString(score));\n\t\tresult.put(\"SHINGLE\", Float.toString(scoreShingle));\n\t\tresult.put(\"REASON\", reason);\n\t\treturn result;\n\t}", "@Test\n public void equals_SameBuyQuery_Test() {\n Assert.assertTrue(bq1.equals(bq0));\n }", "private static void testKEqual(EventNode e1, EventNode e2, int k) {\n assertTrue(KTails.kEquals(e1, e2, k));\n assertTrue(KTails.kEquals(e2, e1, k));\n }", "public boolean haveSameKeys(Tree<K, V> otherTree) {\n\t\tif (this.size() != otherTree.size()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tTree<K, V> t = this;\n\t\t\tboolean sameKey = true;\n\t\t\treturn haveSameKeys(t, otherTree, sameKey);\n\t\t}\n\t}", "@Test\n\tpublic void hashCodeSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tAssert.assertEquals(key1.hashCode(), key2.hashCode());\n\t}", "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 }", "public boolean isSame(Schema other) {\n if (this.varNameToExpressionMap.size() != other.varNameToExpressionMap.size()) {\n return false;\n }\n if (!this.varNameToExpressionMap.keySet().equals(other.varNameToExpressionMap.keySet())) {\n return false;\n }\n for (var key : varNameToExpressionMap.keySet()) {\n if (varNameToExpressionMap.get(key).getDataType() !=\n other.varNameToExpressionMap.get(key).getDataType()) {\n return false;\n }\n }\n return true;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t\tpublic boolean equals(Object other) {\r\n\t\t\tboolean flag = false;\r\n\r\n\t\t\tif (other instanceof TableElement) {\r\n\t\t\t\tTableElement<K, V> candidate = (TableElement<K, V>) other;\r\n\r\n\t\t\t\tif ((this.getKey()).equals(candidate.getKey()))\r\n\t\t\t\t\tflag = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn flag;\r\n\t\t}", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof ApptranregFeesAud)) return false;\n return this.equalKeys(other) && ((ApptranregFeesAud)other).equalKeys(this);\n }", "boolean sameName(String a, String b){\n\t\tif(a.length()!=b.length()){\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(int i=0;i<a.length();i++){\r\n\t\t\tif(a.charAt(i)!=b.charAt(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}", "boolean equals(Identifier comparand);", "public abstract String representInequality(ReversableDictionary dict);", "@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n SubtenantApiKey subtenantapikey1 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey2 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey3 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704666574L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"60d4acbb-208b-4d39-a7e7-0311a4c9d668\", -73,\n \"4d2e0a41-68cb-443d-b170-9281ae717cda\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704667904L));\n assertNotNull(subtenantapikey1);\n assertNotNull(subtenantapikey2);\n assertNotNull(subtenantapikey3);\n assertNotSame(subtenantapikey2, subtenantapikey1);\n assertNotSame(subtenantapikey3, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey1, subtenantapikey2);\n assertEquals(subtenantapikey1, subtenantapikey1);\n assertFalse(subtenantapikey1.equals(null));\n assertNotEquals(subtenantapikey3, subtenantapikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }", "@Test\n\tpublic void doEqualsTestDifferentMaps() {\n\t\tassertFalse(bigBidiMap.equals(leftChildMap));\n\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Namefile)) {\r\n return false;\r\n }\r\n Namefile other = (Namefile) object;\r\n if ((this.namefilePK == null && other.namefilePK != null) || (this.namefilePK != null && !this.namefilePK.equals(other.namefilePK))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n public void testEqualsMethodDifferentName() {\n String name1 = \"A modifier\";\n String name2 = \"Another modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name1, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n Modifier m2 = new Modifier(name2, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertFalse(m1.equals(m2));\n }", "public boolean equals(Object anObject) {\r\n if (anObject instanceof DescriptorKey) {\r\n DescriptorKey aKey = (DescriptorKey) anObject;\r\n return (\r\n headingNumber == aKey.getHeadingNumber()\r\n && userViewString.equals(aKey.getUserViewString()));\r\n } else {\r\n return false;\r\n }\r\n }", "private void assertEquivalentPair(Set<Pair> result, String s1, String s2) {\n\t\tPair resultPair = filterResult(result, s1, s2);\n\t\tassertFalse(resultPair.isMarked());\n\t}", "@Test\n\tpublic void compareToReturnsAPositiveNumberWhenUnitWithSameSymbolButSmallerNameIsProvided() {\n\t\tDummyUnit unit = new DummyUnit(SYMBOL);\n\t\tunit.setName(\"b\");\n\t\tDummyUnit otherUnit = new DummyUnit(SYMBOL);\n\t\totherUnit.setName(\"a\");\n\t\tassertTrue(unit.compareTo(otherUnit) > 0);\n\t}", "private boolean isSameColumnKeyComponent(ByteBuffer[] components1, ByteBuffer[] components2) {\n\t\tfor (int i = columnAliasNames.length - 1; i >= 0; i--) {\n\t\t\tif (!components1[i].equals(components2[i]))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic PyObject __eq__(PyObject other) {\n\t\treturn shadowstr___eq__(other);\n\t}", "private static boolean areBundlesEqual(Bundle lhs, Bundle rhs) {\n if (!lhs.keySet().equals(rhs.keySet())) {\n // Keys differ - bundles are not equal.\n return false;\n }\n for (String key : lhs.keySet()) {\n if (!areEqual(lhs.get(key), rhs.get(key))) {\n return false;\n }\n }\n return true;\n }", "@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }", "public boolean matchSameColumns(Key key);", "@Override\r\n public boolean equals(Object other) {\r\n if (!(other instanceof Contacto))\r\n return false;\r\n return this.equalKeys(other) && ((Contacto) other).equalKeys(this);\r\n }", "public boolean mojeEquals(Obj o1, Obj o2) {\r\n\t\t//System.out.println(o1.getName() + \" \" + o2.getName());\r\n\t\tboolean sameRight = true; // 21.06.2020. provera prava pristupa\r\n\t\tboolean sameName = true;\t// 22.06.2020. ako nisu metode ne moraju da imaju isto ime\r\n\t\tboolean sameArrayType = true; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t\t\r\n\t\tif (o1.getKind() == Obj.Meth && o2.getKind() == Obj.Meth) {\r\n\t\t\tsameRight = o1.getFpPos() == o2.getFpPos()+10; \r\n\t\t\tsameName = o1.getName().equals(o2.getName());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (o1.getType().getKind() == Struct.Array && o2.getType().getKind() == Struct.Array) {\r\n\t\t\t\tif (!(o1.getType().getElemType() == o2.getType().getElemType())) { // ZA KLASE MOZDA TREBA equals\r\n\t\t\t\t\tsameArrayType = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 16.08.2020.\r\n//\t\tif (o1.getType().getKind() == Struct.Class || o1.getType().getKind() == Struct.Interface)\r\n//\t\t\treturn true;\r\n\t\t\r\n\t\t\r\n\t\treturn o1.getKind() == o2.getKind() \r\n\t\t\t\t&& sameName\r\n\t\t\t\t&& o1.getType().equals(o2.getType())\r\n\t\t\t\t&& /*adr == other.adr*/ o1.getLevel() == o2.getLevel()\r\n\t\t\t\t&& equalsCompleteHash(o1.getLocalSymbols(), o2.getLocalSymbols())\r\n\t\t\t\t&& sameRight // 21.06.2020. provera prava pristupa\r\n\t\t\t\t&& sameArrayType; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t}", "public String getName()\n {\n return \"equal\";\n }", "@Override\r\n\t\tpublic boolean equalsWithOrder(\r\n\t\t\t\tPair<? extends T, ? extends S> anotherPair) {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.equalsWithOrder(anotherPair);\r\n\t\t\t}\r\n\t\t}", "@Test\n\tpublic void equalsNullIdBoth() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey2.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertTrue(equals);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn instance.equals(((HadoopRecordKey)obj).instance);\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 static void testComparing() {\n System.out.println(\"\\nTEST ASSIGNING\");\n System.out.println(\"==============\");\n int i = 20;\n int j = 20;\n\n if(i == j) {\n System.out.println(\"i and j are equal\");\n }\n\n String JPY = new String(\"JPY\");\n String YEN = new String(\"JPY\");\n\n if(JPY == YEN) {\n System.out.println(\"JPY and YEN are same\"); //This line is not printed\n }\n\n if(JPY.equals(YEN)) {\n //you should always use equals() method to compare reference types.\n System.out.println(\"JPY and YEN are equal by equals()\");\n }\n }", "@Override\n public boolean equals(Object obj) {\n if ( obj == null ) return false;\n if ( this == obj ) return true;\n Keys c = (Keys) obj;\n return Arrays.equals(this.keys, c.keys);\n }", "private final boolean compareStringValues(final String data1,\n\t\t\tfinal String data2, final String colName, final String key) {\n\t\tif (data1.equals(data2)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tContextComparator.addResult(namespace,\n\t\t\t\tContextComparatorConfigReferences.TEST_CATEGORY_COLUMN_VALUES,\n\t\t\t\tContextComparatorConfigReferences.TEST_STATUS_FAILED,\n\t\t\t\t\"Mismatch for \" + colName + \" for key \" + key\n\t\t\t\t+ \". \" + ContextComparator.CONTEXT_1.getName() + \": \" + data1\n\t\t\t\t+ \", \" + ContextComparator.CONTEXT_2.getName() + \": \" + data2);\n\t\treturn false;\n\t}", "@Test\n public void testEquals() {\n assertFalse(jesseOberstein.equals(nathanGoodman));\n assertTrue(kateHutchinson.equals(kateHutchinson));\n }", "boolean hasSameAs();", "public boolean equalsName(String otherCode) {\n return CODE.equals(otherCode);\n }", "public boolean keyEquals(Entry<K, V> other) {\n return key.equals(other.key);\n }", "public boolean hasSameKey(String... tags) {\n if (tags.length != tagNames.size() * 2) {\n return false;\n }\n for (int i = 0; i < tags.length; i += PAIR_SIZE) {\n if (!tagNames.contains(tags[i])) {\n return false;\n }\n }\n return true;\n }", "private\n static\n void\n assertEventDataEqual( MingleReactorEvent ev1,\n String ev1Name,\n MingleReactorEvent ev2,\n String ev2Name )\n {\n Object o1 = null;\n Object o2 = null;\n String desc = null;\n\n switch ( ev1.type() ) {\n case VALUE: o1 = ev1.value(); o2 = ev2.value(); desc = \"value\"; break;\n case FIELD_START:\n o1 = ev1.field(); o2 = ev2.field(); desc = \"field\"; break;\n case STRUCT_START:\n o1 = ev1.structType(); o2 = ev2.structType(); desc = \"structType\";\n break;\n default: return;\n }\n\n state.equalf( o1, o2, \"%s.%s != %s.%s (%s != %s)\",\n ev1Name, desc, ev2Name, desc, o1, o2 );\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "@Test\n public void testEquals_2() {\n LOGGER.info(\"testEquals_2\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hej\");\n final boolean actual = atomString.equals(atom);\n assertFalse(actual);\n }", "public boolean isEqual(Stack msg, Object obj) {\n if (!(obj instanceof ConstNameAndType)) {\n msg.push(\"obj/obj.getClass() = \"\n + (obj == null ? null : obj.getClass()));\n msg.push(\"this.getClass() = \"\n + this.getClass());\n return false;\n }\n ConstNameAndType other = (ConstNameAndType)obj;\n\n if (!super.isEqual(msg, other)) {\n return false;\n }\n\n if (!this.theName.isEqual(msg, other.theName)) {\n msg.push(String.valueOf(\"theName = \"\n + other.theName));\n msg.push(String.valueOf(\"theName = \"\n + this.theName));\n return false;\n }\n if (!this.typeSignature.isEqual(msg, other.typeSignature)) {\n msg.push(String.valueOf(\"typeSignature = \"\n + other.typeSignature));\n msg.push(String.valueOf(\"typeSignature = \"\n + this.typeSignature));\n return false;\n }\n return true;\n }", "public static boolean fullNamesEqual(String name1, String name2) {\n if (StringUtil.isEmpty(name1) && StringUtil.isEmpty(name2)) {\n return true;\n }\n // Split multi-part names into individual components and compare\n // each component. If delimited, do case compare.\n String[] names1 = normalizer.splitName(defaultRule, name1);\n String[] names2 = normalizer.splitName(defaultRule, name2);\n if (names1.length != names2.length) {\n return false;\n }\n for (int i = 0; i < names1.length; i++) {\n if (normalizer.isDelimited(defaultRule, names1[i])) {\n if (!Objects.equals(names1[i],names2[i])) {\n return false;\n }\n } else {\n if (!StringUtil.equalsIgnoreCase(names1[i],names2[i])) {\n return false;\n }\n }\n }\n return true;\n }", "@Test\n void compareTo_MatchButModifying_NameAndAddress()\n {\n runIsMatchTest(AnswerType.yes, AnswerType.yes, AnswerType.no, AnswerType.no, ContactMatchType.MatchButModifying);\n }", "@SuppressWarnings(\"EqualsUnsafeCast\")\n @Override\n public boolean equals(Object o) {\n final Key key = (Key) o;\n return powerComponent == key.powerComponent\n && processState == key.processState;\n }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null || getClass() != obj.getClass()) {\n return false;\n }\n Key key = (Key) obj;\n return Objects.equals(exponent, key.exponent)\n && Objects.equals(modulus, key.modulus);\n }", "public boolean equals(Object other) {\n if (other instanceof Attributes) {\n Attributes otherAttr = (Attributes) other;\n String otherNSTName = MonetUtil.getBBPName(otherAttr.attrNSTName);\n String thisNSTName = MonetUtil.getBBPName(this.attrNSTName);\n return (otherNSTName.equals(thisNSTName));\n }\n return false;\n }", "@Test\n\tpublic void hashCodeSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tAssert.assertEquals(key.hashCode(), key.hashCode());\n\t}", "@Test\n\tpublic void test_equals1() {\n\tTennisPlayer c1 = new TennisPlayer(11,\"Joe Tsonga\");\n\tTennisPlayer c2 = new TennisPlayer(11,\"Joe Tsonga\");\n\tassertTrue(c1.equals(c2));\n }", "@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 }", "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 }", "public boolean equals(Object other)\n {\n if (this == other) return true;\n if (other == null) return false;\n if (getClass() != other.getClass()) return false;\n \n // Arenas must have different names.\n if (other instanceof ArenaStandard && ((ArenaStandard)other).name.equals(name))\n return true;\n \n return false;\n }", "@Override\n public boolean equals(Object obj) {\n if (obj != null && getClass() == obj.getClass()) {\n Identifier o = (Identifier)obj;\n boolean b;\n b = o.getName().equals(name);\n b &= o.getScope() == scope;\n b &= o.getType() == type;\n b &= o.getValue() == value;\n \n return b;\n }\n return false;\n }", "public boolean isEquals() {\n long len = -1L;\n\n //1. check the lengths of the words\n for(S left : slp.getAxioms()) {\n if(len == -1L) {\n len = slp.length(left);\n }\n else {\n if(len != slp.length(left)) {\n return false;\n }\n }\n }\n\n // all words are the empty word\n if(len == 0) {\n return true;\n }\n\n // 2. the length are all equals and not zero => execute the recompression\n execute();\n\n S otherSymbol = null;\n boolean first = true;\n\n // 3. chech now if for all axioms X : |val(X)| = 1 and all val(X) are equals.\n for(S left : slp.getAxioms()) {\n if(first) {\n slp.length(left, true);\n first = false;\n }\n\n if(slp.length(left) != 1) {\n return false;\n }\n else {\n S symbol = slp.get(left, 1);\n if(otherSymbol == null) {\n otherSymbol = symbol;\n }\n\n if(!symbol.equals(otherSymbol)) {\n return false;\n }\n }\n }\n\n return true;\n }", "@Test public void testCompareTo() {\r\n new LinkedHashMap<Entry<String, ComparisonResult>, Entry<Word, Word>>() {\r\n private static final long serialVersionUID = -114525477689441361L; {\r\n put(new SimpleEntry<>(\"test(Test)\", ComparisonResult.LESS_THAN), new SimpleEntry<>(w1, w2));\r\n put(new SimpleEntry<>(\"Test(test)\", ComparisonResult.GREATER_THAN), new SimpleEntry<>(w2, w1));\r\n put(new SimpleEntry<>(\"Test(Te/t)\", ComparisonResult.LESS_THAN), new SimpleEntry<>(w2, w5));\r\n put(new SimpleEntry<>(\"Te/t(Test)\", ComparisonResult.GREATER_THAN), new SimpleEntry<>(w5, w2));\r\n put(new SimpleEntry<>(\"Text(Te/t)\", ComparisonResult.GREATER_THAN), new SimpleEntry<>(w7, w5));\r\n put(new SimpleEntry<>(\"Te/t(Text)\", ComparisonResult.LESS_THAN), new SimpleEntry<>(w5, w7));\r\n put(new SimpleEntry<>(\"testing(test'ing)\", ComparisonResult.LESS_THAN), new SimpleEntry<>(w3, w4));\r\n put(new SimpleEntry<>(\"test'ing(testing)\", ComparisonResult.GREATER_THAN), new SimpleEntry<>(w4, w3));\r\n put(new SimpleEntry<>(\"test(testing)\", ComparisonResult.LESS_THAN), new SimpleEntry<>(w1, w3));\r\n put(new SimpleEntry<>(\"testing(test)\", ComparisonResult.GREATER_THAN), new SimpleEntry<>(w3, w1));\r\n put(new SimpleEntry<>(\"test(test)\", ComparisonResult.EQUAL_TO), new SimpleEntry<>(w1, w6));\r\n }}.forEach((k, v) -> {\r\n assertTrue(String.format(\"%1$s should be %2$s\", k.getKey(), k.getValue().toString()),\r\n v.getKey().compareTo(v.getValue()) == k.getValue());\r\n });\r\n }", "@Override\r\n public boolean equals(Object that) {\r\n if (this == that) {\r\n return true;\r\n }\r\n if (that == null) {\r\n return false;\r\n }\r\n if (getClass() != that.getClass()) {\r\n return false;\r\n }\r\n PensionDicDosagename other = (PensionDicDosagename) that;\r\n return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))\r\n && (this.getDosageName() == null ? other.getDosageName() == null : this.getDosageName().equals(other.getDosageName()))\r\n && (this.getInputCode() == null ? other.getInputCode() == null : this.getInputCode().equals(other.getInputCode()))\r\n && (this.getCleared() == null ? other.getCleared() == null : this.getCleared().equals(other.getCleared()))\r\n && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()));\r\n }", "@Test\n public void testEquals_1() {\n LOGGER.info(\"testEquals_1\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hello\");\n final boolean actual = atomString.equals(atom);\n assertTrue(actual);\n }", "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 equals(String that);", "@Test\n\tpublic void compareToReturnsZeroWhenUnitWithSameSymbolAndNameIsProvided() {\n\t\tDummyUnit unit = new DummyUnit(SYMBOL);\n\t\tunit.setName(NAME);\n\t\tDummyUnit otherUnit = new DummyUnit(SYMBOL);\n\t\totherUnit.setName(NAME);\n\t\tassertEquals(0, unit.compareTo(otherUnit));\n\t}" ]
[ "0.7647895", "0.7276807", "0.7228059", "0.71436554", "0.7059388", "0.70125014", "0.6985814", "0.68365186", "0.6747552", "0.66823685", "0.6616152", "0.6565097", "0.6534812", "0.65121925", "0.6368226", "0.63665444", "0.6338365", "0.6337144", "0.6296139", "0.62698305", "0.6239344", "0.6232102", "0.6137234", "0.61288583", "0.6107308", "0.60906476", "0.60813665", "0.6079322", "0.6049963", "0.6041267", "0.60266334", "0.6006359", "0.59902203", "0.59861165", "0.59843636", "0.59632134", "0.5957682", "0.5949255", "0.5903299", "0.58800703", "0.5864868", "0.58603644", "0.58559185", "0.5851898", "0.5851216", "0.585104", "0.5847073", "0.5845201", "0.5841556", "0.5835282", "0.5806945", "0.5789385", "0.57777864", "0.57705045", "0.57662946", "0.57658124", "0.57645094", "0.57612216", "0.5757078", "0.5733747", "0.5720037", "0.5715425", "0.5713713", "0.5706075", "0.5698886", "0.56835234", "0.5682371", "0.5678038", "0.56732386", "0.5671371", "0.5668251", "0.5661024", "0.5651533", "0.56506664", "0.56414306", "0.56363595", "0.562845", "0.5623776", "0.5621752", "0.5621371", "0.5620221", "0.56130874", "0.56037474", "0.5597127", "0.55916554", "0.55898273", "0.5587945", "0.5585721", "0.558301", "0.55803305", "0.5572197", "0.556816", "0.5568156", "0.55662996", "0.55569106", "0.55499446", "0.5549351", "0.55474895", "0.5545817", "0.5541398" ]
0.74779975
1
Compute a has code for the name key
@Override public int hashCode() { return this.analyser.hashCode(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasCodeName();", "java.lang.String getCodeName();", "com.google.protobuf.ByteString\n getCodeNameBytes();", "private int genKey()\n {\n return (nameValue.getData() + scopeDefined.getTag()).hashCode();\n }", "java.lang.String getCode();", "java.lang.String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "public boolean hasCodeName() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "String getMapCode();", "String codeToName(int code) throws IOException;", "public boolean hasCodeName() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@Override\n public int hashCode() {\n // name's hashCode is multiplied by an arbitrary prime number (13)\n // in order to make sure there is a difference in the hashCode between\n // these two parameters:\n // name: a value: aa\n // name: aa value: a\n return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());\n }", "boolean hasCode();", "boolean hasCode();", "boolean hasCode();", "String key();", "static int getKey(String raw) {\n\t\tint key = 0;\n\t\tfor (int i = 0; i < raw.length(); i++) {\n\t\t\tkey = key * HASH_VALUE + raw.charAt(i);\n\t\t}\n\t\tif (key < 0) {\n\t\t\tkey = -key;\n\t\t}\n\t\treturn key % HASH_SIZE;\n\t}", "public com.google.protobuf.ByteString\n getCodeNameBytes() {\n java.lang.Object ref = codeName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n codeName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int hashcode(){\r\n\t\t\r\n\t\treturn last_Name.hashcode();\r\n\t}", "String getShortNameKey();", "public static int hashfunction(final String firstName) {\n int key = 0;\n for (int i = 0; i < firstName.length(); i++) {\n key += firstName.charAt(i);\n }\n return key % 32;\n }", "@Override\n public String getCode(String name) {\n String type = keywords.stream()\n .map(keyword -> keyword.getCode())\n .collect(Collectors.joining(\" \"));\n\n String varName = name == null ? \"\" : \" \" + name;\n return type + varName;\n /*\n if (name == null) {\n return type;\n }\n \n return type + \" \" + name;\n */\n }", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "public com.google.protobuf.ByteString\n getCodeNameBytes() {\n java.lang.Object ref = codeName_;\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 codeName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public int getHash(String name) {\n int x = 0;\n int sum = 0;\n while (x < name.length()) {\n sum += name.charAt(x);\n x++;\n }\n int result = sum % size;\n return result;\n }", "protected String nameToKey(String searchName) {\n\t\tif( searchName == null ) throw new NullPointerException(\"searchName is null\");\n\t\treturn hex(sha1(searchName));\n\t}", "private String changeToHSCode(String key) throws IOException {\n\t\t\r\n\t\tHashMap<String, String> index=FileHelper.readindex(Constants.indexputpath);\r\n\t\tString hscode = null;\r\n\t\tfor(Entry<String,String> entry:index.entrySet()){\r\n\t\t\tif(key.equals(entry.getValue())){\r\n\t\t\t\thscode=entry.getKey();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn hscode;\r\n\t}", "Integer getCode();", "public int hashCode() {\n return (name.ordinal() + 5) * 51;\n }", "String getLongNameKey();", "@Override\n\tpublic long getHashCode(String key) {\n\t\tlong hash = 0;\n\t\tlong b = 378551;\n\t\tlong a = 63689;\n\t\tint tmp = 0;\n\t\tfor (int i = 0; i < key.length(); i++) {\n\t\t\ttmp = key.charAt(i);\n\t\t\thash = hash * a + tmp;\n\t\t\ta *= b;\n\t\t}\n\t\treturn hash;\n\t}", "public static long hashName(String name) {\n\t\t\tlong res = 123;\n\t\t\tfor (int i = 0; i < name.length(); ++i) {\n\t\t\t\tres = (res << 8) | (res >>> 56);\n\t\t\t\tres += name.charAt(i);\n\t\t\t\tif ((res & 1) == 0) {\n\t\t\t\t\tres ^= 0x00000000feabfeabL; // Some kind of feedback\n\t\t\t\t}\n\t\t\t}\n\t\t\tres |= 0x8000000000000000L; // Make sure the hash is negative (to distinguish it from database id's)\n\t\t\treturn res;\n\t\t}", "public int hashCode(){\n return name.hashCode();\n }", "public String getCode();", "public String getCode();", "public java.lang.String getCodeName() {\n java.lang.Object ref = codeName_;\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 codeName_ = s;\n }\n return s;\n }\n }", "@Override\n public int hashCode()\n {\n return new HashCodeBuilder(17, 31).\n append(_name).\n toHashCode();\n }", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "@Override\n public int hashCode() {\n return name.hashCode();\n }", "public java.lang.String getCodeName() {\n java.lang.Object ref = codeName_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n codeName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "Code getCode();", "@Override\n\tpublic int hashCode() {\n\t\treturn name.hashCode();\n\t}", "long getCodeId();", "long getCodeId();", "long getCodeId();", "public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "public static int a(String name) {\n/* 80 */ String value = (String)a.get(name);\n/* 81 */ return (value != null) ? value.charAt(0) : -1;\n/* */ }", "org.hl7.fhir.CodeableConcept getName();", "public boolean containsKey(String n){\n\t\treturn name.containsKey(n);\n\t}", "java.lang.String getHangmogCode();", "boolean nameExists(Key name);", "public boolean hasSredCode() {\n return genClient.cacheHasKey(CacheKey.sredCode);\n }", "int getCodeValue();", "String getLookupKey();", "public int generateHashCode() {\n int code = getClass().hashCode();\n boolean temp_fromSource = isFromSource();\n code ^= temp_fromSource ? 1231 : 1237;\n IRId temp_name = getName();\n code ^= temp_name.hashCode();\n List<IRId> temp_params = getParams();\n code ^= temp_params.hashCode();\n List<IRStmt> temp_args = getArgs();\n code ^= temp_args.hashCode();\n List<IRFunDecl> temp_fds = getFds();\n code ^= temp_fds.hashCode();\n List<IRVarStmt> temp_vds = getVds();\n code ^= temp_vds.hashCode();\n List<IRStmt> temp_body = getBody();\n code ^= temp_body.hashCode();\n return code;\n }", "public int hashCode() {\n return name.hashCode();\n }", "@Override\n public int hashCode() {\n\treturn getName().hashCode();\n }", "public byte getCode();", "private int hashOf(String key) {\n return key.length();\n }", "public String code() {\n\t\treturn (\"ID\"+this.hashCode()).replace(\"-\", \"M\");\n\t}", "public int hashCode() {\n return name.hashCode();\n }", "public static String getNameKeyForAssociateMatchKey(String lastname, String firstname) {\n if (lastname == null) {\n lastname = \"\";\n }\n String lastnameFirstword = lastname.split(\"[-]\")[0].toUpperCase();\n\n if (firstname == null) {\n firstname = \"\";\n }\n String firstTwoFirstname = firstname.substring(0, min(2, firstname.length())).toUpperCase();\n\n String name_key = lastnameFirstword + firstTwoFirstname;\n return name_key;\n }", "int getCode();", "int getCode();", "int getCode();", "GameCode getGameCode(String gameCode);", "@Override\n public int hashCode() {\n\n final int prime = 31;\n int result = 1;\n result = prime * result + name.hashCode();\n return result;\n }", "private final String getCollisionKey (SpriteManager m1, SpriteManager m2) {\n\t\t// get key name from two SpriteManager\n\t\tint compareResult = Const.Compare.ALPHABETICAL_ORDER.compare(m1.Name(), m2.Name());\n\t\tString first = null;\n\t\tString second = null;\n\t\t// first is higher\n\t\tif (compareResult > 0) {\n\t\t\tfirst = m1.Name();\n\t\t\tsecond = m2.Name();\n\t\t} else if (compareResult < 0) {\n\t\t\tfirst = m2.Name();\n\t\t\tsecond = m1.Name();\n\t\t} else {\n\t\t\tfirst = second = m1.Name();\n\t\t}\n\t\treturn first + second;\n\t}", "public int hashCode(){\n int hashcode = name == null ? 0 : name.hashCode() / 2;\n return hashcode += ( value == null ? 0 : value.hashCode()/2 );\n }", "public String getLowestChromKey();", "public ABLKey Key(String name) {\r\n\t\treturn new ABLKey(BrickFinder.getDefault().getKey(name));\r\n\t}", "public String getCode() {\n return super.getString(Constants.Properties.CODE);\n }", "@Test\n\tpublic void testGiveCode1() {\n\t\n\t\t\tfloat maxLF = (float) 0.5;\n\t\t\tHTableWords h = new HTableWords(maxLF);\n\t\t\tString word = \"abc\";\n\t\t\tint hashCode = h.giveCode(word);\n\t\t\tassertTrue(hashCode == 3);\n\t}", "public String algorithmName();", "Character getCode();", "@Override\n public int hashCode() {\n int result = 42;\n int prime = 37;\n for (char ch : key.toCharArray()) {\n result = prime * result + (int) ch;\n }\n result = prime * result + summary.length();\n result = prime * result + value;\n return result;\n }", "@Override\n public final int hashCode() {\n return name != null ? name.hashCode() : 0;\n }", "String getEACCode();", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "@Test\n\tpublic void testGiveCode2() {\n\t\n\t\t\tfloat maxLF = (float) 0.5;\n\t\t\tHTableWords h = new HTableWords(maxLF);\n\t\t\tString word = \"z\";\n\t\t\tint hashCode = h.giveCode(word);\n\t\t\tassertTrue(hashCode == 3);\n\t}", "public String getName()\r\n/* 91: */ {\r\n/* 92:112 */ return k_() ? aL() : \"container.minecart\";\r\n/* 93: */ }", "public String getHighestChromKey();", "int getKey();", "int getKey();", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((name == null) ? 0 : name.hashCode());\n\t\treturn result;\n\t}" ]
[ "0.7027334", "0.6590513", "0.6278187", "0.61440206", "0.60975164", "0.60975164", "0.5924652", "0.5924652", "0.5924652", "0.5924652", "0.5924652", "0.59024435", "0.590118", "0.5871279", "0.5844276", "0.5835762", "0.58317333", "0.58317333", "0.58317333", "0.5827054", "0.5794651", "0.57605934", "0.57425976", "0.57391584", "0.57340944", "0.5731276", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.5722813", "0.57180285", "0.57097566", "0.5687656", "0.5681719", "0.56582433", "0.56286913", "0.561572", "0.56107163", "0.5604352", "0.5595828", "0.55831677", "0.55831677", "0.5577651", "0.5569976", "0.5563644", "0.55478734", "0.5545461", "0.55358297", "0.5529377", "0.5509404", "0.5509404", "0.5509404", "0.55063033", "0.5504571", "0.5489883", "0.54776746", "0.54763865", "0.54740655", "0.54692227", "0.54660934", "0.5448547", "0.5448174", "0.5432156", "0.5427583", "0.5423651", "0.54227924", "0.54222673", "0.5403842", "0.5398559", "0.53950346", "0.53950346", "0.53950346", "0.53890646", "0.53819776", "0.5381558", "0.5378998", "0.5375838", "0.5374204", "0.53739965", "0.53738815", "0.5370262", "0.53694427", "0.53668666", "0.5365287", "0.53647715", "0.53570837", "0.5350349", "0.53478223", "0.5347622", "0.53424245", "0.53424245", "0.53362584" ]
0.0
-1
Convert a full taxon key into a nameonly key.
public NameKey toNameKey() { if (this.scientificNameAuthorship == null) return this; Set<NameFlag> fl = this.flags; if (fl != null && fl.contains(NameFlag.AUTONYM)) { fl = new HashSet<>(this.flags); fl.remove(NameFlag.AUTONYM); fl = fl.isEmpty() ? null : fl; } return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getShortNameKey();", "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "public static String getNameKeyForAssociateMatchKey(String lastname, String firstname) {\n if (lastname == null) {\n lastname = \"\";\n }\n String lastnameFirstword = lastname.split(\"[-]\")[0].toUpperCase();\n\n if (firstname == null) {\n firstname = \"\";\n }\n String firstTwoFirstname = firstname.substring(0, min(2, firstname.length())).toUpperCase();\n\n String name_key = lastnameFirstword + firstTwoFirstname;\n return name_key;\n }", "public static String normalize(String key, NamespaceContext context) {\n if (key == null || context == null) return key;\n\n StringBuilder builder = new StringBuilder();\n List<Token> tokens = tokenize(key);\n for (int i = 0; i < tokens.size(); i++) {\n Token token = tokens.get(i);\n\n String prefix = token.prefix;\n String namespace = token.namespace;\n String suffix = token.suffix;\n\n if (i > 0) {\n builder.append(IDataKey.SEPARATOR);\n }\n\n if (prefix != null) {\n builder.append(prefix);\n }\n if (namespace != null) {\n String uri = context.getNamespaceURI(namespace);\n if (uri != null) {\n String normalizedNamespace = context.getPrefix(uri);\n if (normalizedNamespace != null) {\n namespace = normalizedNamespace;\n }\n }\n if (!\"\".equals(namespace)) {\n builder.append(namespace);\n builder.append(NAMESPACE_PREFIX_SEPARATOR);\n }\n }\n if (suffix != null) {\n builder.append(suffix);\n }\n }\n\n return builder.toString();\n }", "public static String getEncodedKey(final String key)\n {\n String encodedKey = key;\n \n try {\n final int ontEnd = key.indexOf(ONT_SEPARATOR);\n if (ontEnd != -1) { \n final String prefix = key.substring(0, ontEnd + 1);\n final String name = key.substring(ontEnd + 1, key.length());\n final String encodedName = java.net.URLEncoder.encode(name, \"UTF-8\");\n if (name != encodedName) {\n encodedKey = prefix + encodedName;\n if (DEBUG.RDF) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n } else {\n encodedKey = java.net.URLEncoder.encode(key, \"UTF-8\");\n if (DEBUG.RDF && encodedKey != key) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n }\n catch (java.io.UnsupportedEncodingException e) {\n Log.warn(\"encoding key \" + Util.tags(key), e); \n }\n \n return encodedKey;\n }", "protected String getName( String key ){\n\n return ( key.indexOf( '.' ) == -1 )?\n //if there is no instance of . then the key is the name\n key:\n //else get the substring to first dot\n key.substring( 0, key.indexOf( '.' ));\n }", "public NameKey toUnrankedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "private String getKey (String keyBase, Object field)\n\t{\n\t\treturn ((field == null) ? keyBase : (keyBase + \"_related\"));\t//NOI18N\n\t}", "protected String getKey(String namespace, String key){\n \t\tif (namespace != null) {\n \t\t\tkey = namespace + key;\n \t\t}\n \t\tif (key.length() > 24) {\n \t\t\ttry {\n \t\t\t\tkey = StringHelper.sha1Hex(key.getBytes(\"utf8\"));\n \t\t\t} catch (UnsupportedEncodingException e) {\n \t\t\t\tlog.warn(\"Invalid key: \" + key, e);\n \t\t\t}\n \t\t} \n//\t\tlog.info(\"key: \" + key);\n \t\treturn key;\n \t}", "private String formTransactionKey(String transaction){\n\t\tString transKey = \"\";\n\t\tString[] transKeyValues = transaction.split(\" \");\n\t\tfor(String parts : transKeyValues){\n\t\t\tif(parts.matches(\".*\\\\d+.*\")){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttransKey += parts;\n\t\t\t\tString existingKey = isKeyAlreadyFormed(transKey);\n\t\t\t\tif(!existingKey.equals(\"\"))\n\t\t\t\t\treturn existingKey;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn transKey;\n\t}", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "String getLongNameKey();", "static String normalizedNameOf(SdkField<?> field) {\n String name = field.memberName();\n return name.length() > 1 && Ascii.isLowerCase(name.charAt(1))\n ? Ascii.toLowerCase(name.charAt(0)) + name.substring(1)\n : name.toLowerCase(Locale.ROOT);\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key.substring(this.mPrefixLength);\n }", "protected String nameToKey(String searchName) {\n\t\tif( searchName == null ) throw new NullPointerException(\"searchName is null\");\n\t\treturn hex(sha1(searchName));\n\t}", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "protected String keyToString(Object rawKey)\n {\n if (rawKey instanceof String) {\n return (String) rawKey;\n }\n return String.valueOf(rawKey);\n }", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }", "String getKeyFormat();", "public static String generateKSNameFromDomainName(String tenantDomain) {\n String ksName = tenantDomain.trim().replace(FULLSTOP_DELIMITER, DASH_DELIMITER);\n return ksName + KEYSTORE_FILE_EXTENSION;\n }", "org.apache.xmlbeans.XmlNMTOKEN xgetKey();", "private String key(RepositoryModel repository, KeyType key, String id) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(repository.name).append(':');\n\t\tsb.append(key.name());\n\t\tif (!StringUtils.isEmpty(id)) {\n\t\t\tsb.append(':');\n\t\t\tsb.append(id);\n\t\t}\n\t\treturn sb.toString();\n\t}", "private com.hps.july.persistence.SuperRegionAccKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionAccKey keyClass = new com.hps.july.persistence.SuperRegionAccKey();\n keyClass.accessid = f0;\n return keyClass;\n }", "static String makeKey(String id,\n String for_,\n String attrname,\n String attrtype) {\n return format(KEY_FMT, id, for_, attrname, attrtype);\n }", "private com.hps.july.persistence.SuperRegionKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionKey keyClass = new com.hps.july.persistence.SuperRegionKey();\n keyClass.supregid = f0;\n return keyClass;\n }", "public String getSubstitutionPropertyKey(String key)\n {\n return \"${\".concat(key).concat(\"}\");\n }", "@Test\n public void getName() throws Exception {\n String name = new AttributeKey<Number>(Number.class, \"keyName\").getName();\n assertThat(name, is(\"keyName\"));\n }", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "private String getFilenameForKey(String key) {\n\t\tint firstHalfLength = key.length() / 2;\n\t\tString localFilename = String.valueOf(key.substring(0, firstHalfLength)\n\t\t\t\t.hashCode());\n\t\tlocalFilename += String.valueOf(key.substring(firstHalfLength)\n\t\t\t\t.hashCode());\n\t\treturn localFilename;\n\t}", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "private String getTaxonName(JSONObject item) {\n \t\tJSONObject defaultName;\n \t\tString displayName = null;\n\n\n \t\t// Get the taxon display name according to configuration of the current iNat network\n \t\tString inatNetwork = mApp.getInaturalistNetworkMember();\n \t\tString networkLexicon = mApp.getStringResourceByName(\"inat_lexicon_\" + inatNetwork);\n \t\ttry {\n \t\t\tJSONArray taxonNames = item.getJSONArray(\"taxon_names\");\n \t\t\tfor (int i = 0; i < taxonNames.length(); i++) {\n \t\t\t\tJSONObject taxonName = taxonNames.getJSONObject(i);\n \t\t\t\tString lexicon = taxonName.getString(\"lexicon\");\n \t\t\t\tif (lexicon.equals(networkLexicon)) {\n \t\t\t\t\t// Found the appropriate lexicon for the taxon\n \t\t\t\t\tdisplayName = taxonName.getString(\"name\");\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (JSONException e3) {\n \t\t\te3.printStackTrace();\n \t\t}\n\n \t\tif (displayName == null) {\n \t\t\t// Couldn't extract the display name from the taxon names list - use the default one\n \t\t\ttry {\n \t\t\t\tdisplayName = item.getString(\"unique_name\");\n \t\t\t} catch (JSONException e2) {\n \t\t\t\tdisplayName = null;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\tdefaultName = item.getJSONObject(\"default_name\");\n \t\t\t\tdisplayName = defaultName.getString(\"name\");\n \t\t\t} catch (JSONException e1) {\n \t\t\t\t// alas\n \t\t\t\tJSONObject commonName = item.optJSONObject(\"common_name\");\n \t\t\t\tif (commonName != null) {\n \t\t\t\t\tdisplayName = commonName.optString(\"name\");\n \t\t\t\t} else {\n \t\t\t\t\tdisplayName = item.optString(\"name\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\treturn displayName;\n\n \t}", "public String getPrefixKey() {\n return \"qa.journal.item.\" + key;\n }", "@SuppressWarnings(\"unused\")\n private static String getKeyString(Key key)\n {\n return Base64.encode(key.getEncoded());\n }", "public abstract String mapItemToKey(String str);", "public abstract String toName(Object inNode);", "protected String createFullFieldName(final String basePrefix, final String fieldName)\n\t{\n\t\tfinal String prefix;\n\t\tif (basePrefix == null || basePrefix.isEmpty())\n\t\t{\n\t\t\tprefix = fieldName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprefix = basePrefix + \".\" + fieldName;\n\t\t}\n\t\treturn prefix;\n\t}", "private static String translateIllegalKey(final String key, final boolean revert) {\n if (revert) {\n return key.replaceAll(DOT_STRING_REPLACEMENT, DOT_STRING).replaceAll(DASH_STRING_REPLACEMENT, DASH_STRING);\n }\n else {\n return key.replaceAll(DOT_STRING, DOT_STRING_REPLACEMENT).replaceAll(DASH_STRING, DASH_STRING_REPLACEMENT);\n }\n }", "@Override\r\n\t\t\tpublic IHierarchicalKey caseEStringToStringMapEntry(\r\n\t\t\t\t\tEntry<String, String> object) {\r\n\t\t\t\treturn new NamedElementKey(object);\r\n\t\t\t}", "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 }", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getFirstName( String key ) {\n return developer.firstName;\n }", "protected String getKeymapName() {\n String nm = getClass().getName();\n int index = nm.lastIndexOf('.');\n if (index >= 0) {\n nm = nm.substring(index+1);\n }\n return nm;\n }", "@Override\n\tprotected String getSurroundingKeys(char key) {\n\t\tif((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) {\n\t\t\tif(Character.isLowerCase(key))\n\t\t\t\treturn surroundingKeys[key - 'a'];\n\t\t\telse\n\t\t\t\treturn surroundingKeys[Character.toLowerCase(key) - 'a'];\n\t\t}\n\n\t\treturn \"\" + key;\n\t}", "public static Object getStaticAttributeKey(final Object key) {\n return key.getClass().getName() + \".\" + key.toString();\n }", "default String getKey() {\n return key(getClassName(), getName());\n }", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "public NameKey toRankedNameKey(RankType rank) {\n if (this.rank == rank)\n return this;\n return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags);\n }", "public JsonWriter key(Binary key) {\n startKey();\n\n if (key == null) {\n throw new IllegalArgumentException(\"Expected map key, but got null.\");\n }\n\n writer.write('\\\"');\n writer.write(key.toBase64());\n writer.write('\\\"');\n writer.write(':');\n return this;\n }", "public JsonWriter key(short key) {\n startKey();\n\n writer.write('\\\"');\n writer.print((int) key);\n writer.write('\\\"');\n writer.write(':');\n return this;\n }", "public Object getKey() { return name; }", "public ABLKey Key(String name) {\r\n\t\treturn new ABLKey(BrickFinder.getDefault().getKey(name));\r\n\t}", "public static String lookup(String baseName, String key)\r\n {\r\n return lookup(baseName, key, null, null, null);\r\n }", "public StructuredQName getKeyName() {\n try {\r\n if (getObjectName() == null) {\r\n // allow for forwards references\r\n String nameAtt = getAttributeValue(\"\", StandardNames.NAME);\r\n if (nameAtt != null) {\r\n setObjectName(makeQName(nameAtt));\r\n }\r\n }\r\n return getObjectName();\r\n } catch (NamespaceException err) {\r\n return null; // the errors will be picked up later\r\n } catch (XPathException err) {\r\n return null;\r\n }\r\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "String getNameKeySpace();", "private String getKey(final PushToken token) throws UnsupportedEncodingException {\n final String sKey = new StringBuilder().append(\"/\").append(token.getTenantKey()).append(\"/\")\n .append(token.getUserId()).toString();\n\n return sKey;\n }", "private String getStringKey(long rawKey) {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private String validateKeyClassName (String keyClassName) \n\t\t\t\tthrows ModelValidationException\n\t\t\t{\n\t\t\t\tString pcClassName = getClassName();\n\t\t\t\tModel model = getModel();\n\t\t\t\tboolean hasKeyClassName = !StringHelper.isEmpty(keyClassName);\n\t\t\t\tboolean hasPrefix;\n\t\t\t\tString nameSuffix;\n\t\t\t\tboolean isOIDNameSuffix;\n\n\t\t\t\t// check for existence of key class name\n\t\t\t\tif (!hasKeyClassName)\n\t\t\t\t{\n\t\t\t\t\tthrow new ModelValidationException(\n\t\t\t\t\t\tModelValidationException.WARNING,\n\t\t\t\t\t\tmodel.getClass(pcClassName),\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_class_unset\", //NOI18N\n\t\t\t\t\t\tpcClassName));\n\t\t\t\t}\n\n\t\t\t\tkeyClassName = keyClassName.trim();\n\t\t\t\thasPrefix = keyClassName.startsWith(pcClassName);\n\t\t\t\tnameSuffix = (hasPrefix ? \n\t\t\t\t keyClassName.substring(pcClassName.length()) : keyClassName);\n\t\t\t\tisOIDNameSuffix = \n\t\t\t\t\t(nameSuffix.equalsIgnoreCase(\".OID\") || // NOI18N\n\t\t\t\t\t nameSuffix.equalsIgnoreCase(\"$OID\")); // NOI18N\n\n\t\t\t\tif (!hasPrefix || \n\t\t\t\t\t(!nameSuffix.equalsIgnoreCase(\"Key\") && \t// NOI18N\n\t\t\t\t\t !isOIDNameSuffix))\n\t\t\t\t{\n\t\t\t\t\tObject pcClass = getModel().getClass(pcClassName);\n\t\t\t\t\tthrow new ModelValidationException(pcClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(),\n\t\t\t\t\t\t\"util.validation.key_class_invalid\", //NOI18N\n\t\t\t\t\t\tkeyClassName, pcClassName));\n\t\t\t\t}\n\t\t\t\tif (isOIDNameSuffix)\n\t\t\t\t{\n\t\t\t\t\tStringBuffer buf = new StringBuffer(keyClassName);\n\t\t\t\t\tbuf.setCharAt(keyClassName.length() - 4, '$');\n\t\t\t\t\treturn buf.toString(); \n\t\t\t\t}\n\t\t\t\treturn keyClassName;\n\t\t\t}", "private String getStringKey(IntArray rawKey) {\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey._elements[0]));\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey._elements[i]));\n }\n return groupKeyBuilder.toString();\n }", "private void correctStateName(StateVertex stateVertix) {\n\t\tint totalNumberOfStates = this.getAllStates().size() - 1;\n\t\tString correctedName = makeStateName(totalNumberOfStates, stateVertix.isGuidedCrawling());\n\t\tif (!\"index\".equals(stateVertix.getName())\n\t\t && !stateVertix.getName().equals(correctedName)) {\n\t\t\tLOG.info(\"Correcting state name from {} to {}\", stateVertix.getName(), correctedName);\n\t\t\tstateVertix.setName(correctedName);\n\t\t}\n\t}", "public VariantKey toNonFacing() {\n int hash = 0; \n HashMap<String, String> entries = new HashMap<String, String>();\n \n for (Map.Entry<String, String> entrySet : m_entries.entrySet()) {\n String key = entrySet.getKey();\n String value = entrySet.getValue();\n \n if (!key.equalsIgnoreCase(FACING)) {\n hash ^= key.hashCode() ^ value.hashCode();\n entries.put(key, value);\n }\n }\n \n return new VariantKey(entries, hash);\n }", "private com.hps.july.persistence.StoragePlaceKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.StoragePlaceKey keyClass = new com.hps.july.persistence.StoragePlaceKey();\n keyClass.storageplace = f0;\n return keyClass;\n }", "@Override\n\tpublic void setupNonExistKeyFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZAB\", \"9999\"); // Account branch (4A)\n\t\ttransaction.setFieldValue(\"GZAN\", \"999999\"); // Basic part of account number (6A)\n\t\ttransaction.setFieldValue(\"GZAS\", \"999\"); // Account suffix (3A)\n\t\ttransaction.setFieldValue(\"GZTCD\", \"999\"); // Transaction code (3A)\n\t}", "abstract public String getKey();", "public HardZoneSearchKey()\n\t{\n\t\tsuper(new HardZone()) ;\n\t\t_Prefix = getTableName() + \".\";\n\t}", "public String getAlias() {\n return this.key.substring(this.key.lastIndexOf(\".\") + 1);\n }", "public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }", "public KeyNamePair() {\r\n this.key = \"\";\r\n this.name = \"\";\r\n }", "private String createKey(ListPrefix listPrefix, KeyPrefix keyPrefix,\n Plane plane) {\n if (plane != null) {\n return listPrefix + \"-\" + keyPrefix + \"-\" + plane;\n } else {\n return listPrefix + \"-\" + keyPrefix;\n }\n }", "private String getStringKey(int rawKey) {\n // Specialize single group-by column case\n if (_numGroupByExpressions == 1) {\n return _dictionaries[0].getStringValue(rawKey);\n } else {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }\n }", "private String removeDMSSuffix(String key) {\r\n\t\tint suffixPos = key.lastIndexOf(\"#DMS#\");\r\n\t\tif (suffixPos != -1) {\r\n\t\t\treturn key.substring(0, suffixPos);\r\n\t\t}\r\n\t\treturn key;\r\n\t}", "@Override\n public String getNameKeySpace() {\n Object ref = nameKeySpace_;\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 nameKeySpace_ = s;\n return s;\n }\n }", "private boolean isXKey(String key) {\r\n return key.startsWith(\"x-\");\r\n }", "public NodeKey createNodeKey();", "public void setKeyName(String newName){\n\n //assigns the value newName to the keyName field\n this.keyName = newName;\n }", "public String getValidIdentifier(String baseName, boolean truncateUsingRandomDigits);", "String key();" ]
[ "0.61790824", "0.6126865", "0.5883176", "0.5874781", "0.5817814", "0.55421185", "0.5454125", "0.53939736", "0.53794813", "0.5347349", "0.52593625", "0.5225946", "0.5204215", "0.5148134", "0.51268613", "0.5047275", "0.50467724", "0.50336593", "0.50085837", "0.49958327", "0.4994783", "0.49589023", "0.4948289", "0.49421346", "0.49409825", "0.49394435", "0.4899713", "0.48986503", "0.48926544", "0.48902082", "0.48861852", "0.4881539", "0.48680216", "0.48670453", "0.48568314", "0.48537484", "0.48423615", "0.48335084", "0.48216537", "0.48172444", "0.4814413", "0.48126328", "0.48000875", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.47933438", "0.4763682", "0.4759472", "0.47549775", "0.47446465", "0.47078255", "0.47062677", "0.47062677", "0.47062677", "0.47062677", "0.47062677", "0.47062677", "0.4700034", "0.46989426", "0.46818826", "0.46758237", "0.46710923", "0.46710673", "0.4668705", "0.4665882", "0.4665882", "0.46548134", "0.46497416", "0.46341032", "0.46335182", "0.46164504", "0.46159303", "0.46143228", "0.46090093", "0.46088085", "0.45855424", "0.45827958", "0.4577634", "0.45692807", "0.45667818", "0.45663998", "0.45570004", "0.4553324", "0.4549064", "0.4546254", "0.45429164", "0.45426655", "0.45422646", "0.45414937", "0.45388564" ]
0.60507244
2
Convert a full taxon key into an unranked key.
public NameKey toUnrankedNameKey() { if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED) return this; Set<NameFlag> fl = this.flags; if (fl != null && fl.contains(NameFlag.AUTONYM)) { fl = new HashSet<>(this.flags); fl.remove(NameFlag.AUTONYM); fl = fl.isEmpty() ? null : fl; } return new NameKey(this.analyser, this.code, this.scientificName, null, RankType.UNRANKED, this.type, fl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "@Override\r\n public K floorKey(final K key) {\n return null;\r\n }", "public VariantKey toNonFacing() {\n int hash = 0; \n HashMap<String, String> entries = new HashMap<String, String>();\n \n for (Map.Entry<String, String> entrySet : m_entries.entrySet()) {\n String key = entrySet.getKey();\n String value = entrySet.getValue();\n \n if (!key.equalsIgnoreCase(FACING)) {\n hash ^= key.hashCode() ^ value.hashCode();\n entries.put(key, value);\n }\n }\n \n return new VariantKey(entries, hash);\n }", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "@Override\r\n public K lowerKey(final K key) {\n return null;\r\n }", "public void unDistributeMyKeys() {\n unDistributeKeys(readNodeEntries());\n }", "@Override\n\tpublic void unIndexObject(String indexName, String key) throws ASException {\n\t\t\n\t}", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "public static String normalize(String key, NamespaceContext context) {\n if (key == null || context == null) return key;\n\n StringBuilder builder = new StringBuilder();\n List<Token> tokens = tokenize(key);\n for (int i = 0; i < tokens.size(); i++) {\n Token token = tokens.get(i);\n\n String prefix = token.prefix;\n String namespace = token.namespace;\n String suffix = token.suffix;\n\n if (i > 0) {\n builder.append(IDataKey.SEPARATOR);\n }\n\n if (prefix != null) {\n builder.append(prefix);\n }\n if (namespace != null) {\n String uri = context.getNamespaceURI(namespace);\n if (uri != null) {\n String normalizedNamespace = context.getPrefix(uri);\n if (normalizedNamespace != null) {\n namespace = normalizedNamespace;\n }\n }\n if (!\"\".equals(namespace)) {\n builder.append(namespace);\n builder.append(NAMESPACE_PREFIX_SEPARATOR);\n }\n }\n if (suffix != null) {\n builder.append(suffix);\n }\n }\n\n return builder.toString();\n }", "org.apache.xmlbeans.XmlNMTOKEN xgetKey();", "private String getStringKey(long rawKey) {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }", "private String formTransactionKey(String transaction){\n\t\tString transKey = \"\";\n\t\tString[] transKeyValues = transaction.split(\" \");\n\t\tfor(String parts : transKeyValues){\n\t\t\tif(parts.matches(\".*\\\\d+.*\")){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttransKey += parts;\n\t\t\t\tString existingKey = isKeyAlreadyFormed(transKey);\n\t\t\t\tif(!existingKey.equals(\"\"))\n\t\t\t\t\treturn existingKey;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn transKey;\n\t}", "private com.hps.july.persistence.SuperRegionKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionKey keyClass = new com.hps.july.persistence.SuperRegionKey();\n keyClass.supregid = f0;\n return keyClass;\n }", "public NameKey toRankedNameKey(RankType rank) {\n if (this.rank == rank)\n return this;\n return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags);\n }", "private Node getReplacementKeyNode(Key key, Node node) {\n\t\tNode ret = node.getChild(node.getDataNumber(key));\r\n\t\t\r\n\t\twhile (!ret.isLeaf()) {\r\n\t\t\tret = ret.getChild(ret.getChildren().size() - 1);\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}", "public void lowerKey(){\n\t\tkey = clamp(key-INCREMENT, MINKEY, MAXKEY);\n\t}", "public K floor(K key);", "public void dec(String key);", "public void reinstateKeyFromArchive(int key) throws PersistenceException {\n super.reinstateArchiveKey(key);\n }", "public static String getEncodedKey(final String key)\n {\n String encodedKey = key;\n \n try {\n final int ontEnd = key.indexOf(ONT_SEPARATOR);\n if (ontEnd != -1) { \n final String prefix = key.substring(0, ontEnd + 1);\n final String name = key.substring(ontEnd + 1, key.length());\n final String encodedName = java.net.URLEncoder.encode(name, \"UTF-8\");\n if (name != encodedName) {\n encodedKey = prefix + encodedName;\n if (DEBUG.RDF) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n } else {\n encodedKey = java.net.URLEncoder.encode(key, \"UTF-8\");\n if (DEBUG.RDF && encodedKey != key) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n }\n catch (java.io.UnsupportedEncodingException e) {\n Log.warn(\"encoding key \" + Util.tags(key), e); \n }\n \n return encodedKey;\n }", "private static String translateIllegalKey(final String key, final boolean revert) {\n if (revert) {\n return key.replaceAll(DOT_STRING_REPLACEMENT, DOT_STRING).replaceAll(DASH_STRING_REPLACEMENT, DASH_STRING);\n }\n else {\n return key.replaceAll(DOT_STRING, DOT_STRING_REPLACEMENT).replaceAll(DASH_STRING, DASH_STRING_REPLACEMENT);\n }\n }", "public String getMinKey();", "public T participationPublicKeyBase64(String pk) {\n this.votePK = new ParticipationPublicKey(Encoder.decodeFromBase64(pk));\n return (T) this;\n\n }", "abstract K getFirstLeafKey();", "abstract K getFirstLeafKey();", "@Override\r\n public K ceilingKey(final K key) {\n return null;\r\n }", "@Override\n\tpublic void setupNonExistKeyFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZAB\", \"9999\"); // Account branch (4A)\n\t\ttransaction.setFieldValue(\"GZAN\", \"999999\"); // Basic part of account number (6A)\n\t\ttransaction.setFieldValue(\"GZAS\", \"999\"); // Account suffix (3A)\n\t\ttransaction.setFieldValue(\"GZTCD\", \"999\"); // Transaction code (3A)\n\t}", "private com.hps.july.persistence.SuperRegionAccKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionAccKey keyClass = new com.hps.july.persistence.SuperRegionAccKey();\n keyClass.accessid = f0;\n return keyClass;\n }", "protected void binaryValueUnused( BinaryKey key ) {\n }", "private JSONObject cspace264Hack_unmunge(JSONObject in) {\n \t\ttry {\n \t\t\tJSONArray ons=in.getJSONArray(\"othernumber\");\n \t\t\tString accnum=null;\n \t\t\tJSONArray new_ons=new JSONArray();\n \t\t\tfor(int i=0;i<ons.length();i++) {\n \t\t\t\tString v=ons.getString(i);\n \t\t\t\tif(v.startsWith(\"_accnum:\")) {\n \t\t\t\t\taccnum=v.substring(\"_accnum:\".length());\n \t\t\t\t} else {\n \t\t\t\t\tnew_ons.put(v);\n \t\t\t\t}\n \t\t\t}\n \t\t\tin.remove(\"othernumber\");\n \t\t\tin.put(\"othernumber\",new_ons);\n \t\t\tif(accnum!=null) {\n \t\t\t\tin.remove(\"objectnumber\");\n \t\t\t\tin.put(\"objectnumber\",accnum);\n \t\t\t}\n \t\t} catch (JSONException e) {}\n \t\treturn in;\n \t}", "private String getStringKey(int rawKey) {\n // Specialize single group-by column case\n if (_numGroupByExpressions == 1) {\n return _dictionaries[0].getStringValue(rawKey);\n } else {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }\n }", "public final void setupNonExistKeyFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZIBRM\", \"HEAD\"); // Cashier branch mnemonic (4A)\n\t\ttransaction.setFieldValue(\"GZIBBN\", \"1000\"); // Cashier branch number (4A)\n\t\ttransaction.setFieldValue(\"GZTTP\", transactionType); // Transaction type (3A)\n\t\ttransaction.setFieldValue(\"GZTRF\", \"1080101999999\"); // Transaction reference (13A)\n\n\t}", "public NodeKey createNodeKey();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "protected String keyToString(Object rawKey)\n {\n if (rawKey instanceof String) {\n return (String) rawKey;\n }\n return String.valueOf(rawKey);\n }", "public SparseTensor getOldKeyIndicatorTensor() {\n double[] values = new double[oldKeyNums.length];\n Arrays.fill(values, 1.0);\n return SparseTensor.fromUnorderedKeyValues(oldTensor.getDimensionNumbers(), \n oldTensor.getDimensionSizes(), oldKeyNums, values);\n }", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}", "protected K inferNativeKey(Object identifier) {\n return (K) identifier;\n }", "Key replaceKey(Entry<Key, Value> entry, Key key) throws InvalidKeyException;", "public Object getSurrogateKey(Object oKey, int nSalt)\n {\n int nKey = ((Integer) oKey).intValue();\n return Integer.valueOf(nKey + m_nPartitionCount * (nSalt + 1));\n }", "public JsonWriter keyUnescaped(CharSequence key) {\n startKey();\n\n if (key == null) {\n throw new IllegalArgumentException(\"Expected map key, but got null.\");\n }\n\n writer.write('\\\"');\n writer.write(key.toString());\n writer.write('\\\"');\n writer.write(':');\n return this;\n\n }", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "private static Key createInternalLobKey() {\n return Key.createKey(Arrays.asList(INTERNAL_KEY_SPACE,\n ILK_PREFIX_COMPONENT,\n UUID.randomUUID().toString()));\n }", "@Override\n\tpublic String getKey() {\n\t\treturn null;\n\t}", "public Key floor(final Key key) {\n int rank = rank(key);\n if (rank == 0) {\n return null;\n }\n if (rank < size && key.compareTo(keys[rank]) == 0) {\n return keys[rank];\n } else {\n return keys[rank - 1];\n }\n }", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "@Override\r\n public K higherKey(final K key) {\n return null;\r\n }", "protected String getKey(String namespace, String key){\n \t\tif (namespace != null) {\n \t\t\tkey = namespace + key;\n \t\t}\n \t\tif (key.length() > 24) {\n \t\t\ttry {\n \t\t\t\tkey = StringHelper.sha1Hex(key.getBytes(\"utf8\"));\n \t\t\t} catch (UnsupportedEncodingException e) {\n \t\t\t\tlog.warn(\"Invalid key: \" + key, e);\n \t\t\t}\n \t\t} \n//\t\tlog.info(\"key: \" + key);\n \t\treturn key;\n \t}", "@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}", "public static HydraKey reconstructKey(Map<Integer, BigInteger> shares, int n, int k, BigInteger prime,\n String alg) {\n BigInteger constructed_key = combineKey(shares, n, k, prime);\n String algorithm = alg;\n if (algorithm == null) {\n algorithm = \"Unknown\";\n }\n\n // chops off an empty signum-byte if found\n byte[] keyBytes = constructed_key.toByteArray();\n if (keyBytes[0] == 0) {\n // System.out.println(\"chopping stuff\");\n\n byte[] tempArray = Arrays.copyOfRange(keyBytes, 1, keyBytes.length);\n keyBytes = tempArray;\n }\n\n HydraKey hk = new HydraKey(keyBytes, algorithm);\n return hk;\n }", "public void setKey(int nKey){\n\t\tkey = clamp(nKey, MINKEY, MAXKEY);\n\t}", "public void unlistenByKey(String key) {\n APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + \".unlistenByKey(%s);\", wrapQuotes(key)));\n }", "private String getStringKey(IntArray rawKey) {\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey._elements[0]));\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey._elements[i]));\n }\n return groupKeyBuilder.toString();\n }", "@Override\n public synchronized Object remove(Object key) {\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = (String) this.keyMap.remove(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.remove(strkey);\n }", "String newKey();", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "public void useKey() {\n Key key = this.getInventory().getFirstKey();\n if (key != null){\n this.getInventory().removeItems(key);\n }\n }", "private com.hps.july.persistence.StoragePlaceKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.StoragePlaceKey keyClass = new com.hps.july.persistence.StoragePlaceKey();\n keyClass.storageplace = f0;\n return keyClass;\n }", "public void removeKey() {\n \tthis.key =null;\n \tdungeon.keyLeft().set(\"Key possession: No\\n\");\n }", "public Friend getFriendByRefKey(String key);", "protected String evalBalanceOid(final String _key)\n {\n String ret = _key;\n if (!Utils.isOid(_key)) {\n final Optional<Balance> balanceopt = balanceRepository.findById(_key);\n if (balanceopt.isPresent()) {\n final Balance balance = balanceopt.get();\n if (!StringUtils.isEmpty(balance.getOid())) {\n ret = balance.getOid();\n }\n }\n }\n return ret;\n }", "void removePublicKey(long KeyId) throws PGPException, IOException;", "private String getKey (String keyBase, Object field)\n\t{\n\t\treturn ((field == null) ? keyBase : (keyBase + \"_related\"));\t//NOI18N\n\t}", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key.substring(this.mPrefixLength);\n }", "String getShortNameKey();", "public Builder clearKey() {\n bitField0_ = (bitField0_ & ~0x00000001);\n key_ = getDefaultInstance().getKey();\n onChanged();\n return this;\n }", "void xsetKey(org.apache.xmlbeans.XmlNMTOKEN key);", "public void removeInitialKey( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), INITIALKEY, value);\r\n\t}", "BudgetKeyEntity getBudgetKeyByBudgetKey(BudgetKeyEntity budgetKeyEntity);", "@Override\r\n public K firstKey() {\n return null;\r\n }", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "public Builder clearKey() {\n bitField0_ = (bitField0_ & ~0x00000001);\n key_ = 0;\n onChanged();\n return this;\n }", "void removeKey(int i);", "String key();", "private RowKeyFormat2 suppressMaterializationRowKeyFormat() {\n ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();\n components.add(RowKeyComponent.newBuilder()\n .setName(\"NAME\").setType(ComponentType.STRING).build());\n components.add(RowKeyComponent.newBuilder()\n .setName(\"ADDRESS\").setType(ComponentType.STRING).build());\n\n // build the row key format\n RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)\n .setSalt(HashSpec.newBuilder().setSuppressKeyMaterialization(true).build())\n .setRangeScanStartIndex(components.size())\n .setComponents(components)\n .build();\n\n return format;\n }", "public MicroRowEpoxyModel_ m5160id(CharSequence key) {\n super.mo11718id(key);\n return this;\n }", "public abstract String mapItemToKey(String str);", "static KeyExtractor.Factory noKey() {\n return KeyExtractors.NoKey::new;\n }", "@Override\n\tpublic ISkill reverseConvert(HumanCarriedSkillEntity src) {\n\t\treturn null;\n\t}", "@Override\n @Nullable\n public UldECKey findKeyFromPubKey(byte[] pubkey) {\n return null;\n }", "public void keyDerivation(String uid) {\n\t\tElement e1 = Hash(HashType.H1, uid);// Hash1(uidByte); G1\n\t\tElement e2 = Hash(HashType.H2, uid);// Hash2(uidByte); G1\n\t\t// System.out.println(\"generate sk \" + uid);\n\t\tkeys.setISK(0,e1.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(0))).toBytes());\n\t\tkeys.setISK(1,e2.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(1))).toBytes());\n\t\t\n\t\tmpkg1= pairing.getG1().newElementFromBytes(keys.getMPK(0)).getElementPowPreProcessing();\n\t\tisksk1 = pairing.getG1().newElementFromBytes(keys.getISK(0)).getElementPowPreProcessing();\n\t}", "public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }", "public static String toLegacyKey(String keyword) {\n/* 1272 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n\tprotected String getSurroundingKeys(char key) {\n\t\tif((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) {\n\t\t\tif(Character.isLowerCase(key))\n\t\t\t\treturn surroundingKeys[key - 'a'];\n\t\t\telse\n\t\t\t\treturn surroundingKeys[Character.toLowerCase(key) - 'a'];\n\t\t}\n\n\t\treturn \"\" + key;\n\t}" ]
[ "0.59763503", "0.5936155", "0.5921683", "0.5744919", "0.56279683", "0.5443599", "0.52858233", "0.52351564", "0.50724196", "0.5047437", "0.48983386", "0.48696387", "0.48300108", "0.4800497", "0.47892475", "0.4773061", "0.47715575", "0.47418705", "0.47389418", "0.47084576", "0.46834096", "0.46802503", "0.46712717", "0.46471477", "0.4621068", "0.46060207", "0.46060207", "0.46021637", "0.45996678", "0.45964023", "0.45812473", "0.45719483", "0.45608345", "0.45495677", "0.45483816", "0.4534002", "0.4521533", "0.45181394", "0.4513582", "0.4507842", "0.45064348", "0.45055518", "0.4495898", "0.44864967", "0.44782338", "0.44731748", "0.44681916", "0.446734", "0.44642937", "0.44618547", "0.4453634", "0.4452821", "0.4452821", "0.4450976", "0.44475082", "0.4440133", "0.44334945", "0.4430403", "0.44270295", "0.44184396", "0.44149354", "0.44145906", "0.44102344", "0.4409387", "0.44093522", "0.4408889", "0.44071636", "0.44039595", "0.43846977", "0.43758547", "0.43758178", "0.43742588", "0.43739653", "0.43693775", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43689078", "0.43534794", "0.4353187", "0.43490347", "0.43489107", "0.4347023", "0.43467203", "0.43423858", "0.43377933", "0.43362734", "0.4333355", "0.4328126", "0.43277413", "0.4327442" ]
0.6363894
0
Convert a taxon key into an ranked key.
public NameKey toRankedNameKey(RankType rank) { if (this.rank == rank) return this; return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int rank(K key);", "public int rank(Key key)\n\t{\n\t\treturn rank(root,key);\n\t}", "private int rank(Integer key, Node x) {\n\t if (x == null) return 0; \n\t int cmp = key.compareTo(x.key); \n\t if (cmp < 0) return rank(key, x.left); \n\t else if (cmp > 0) return 1 + size(x.left) + rank(key, x.right); \n\t else return size(x.left); \n\t }", "public int rank(Key key) \n {\n return rank(key, root);\n }", "public int rank(Key key) {\n return rank(root, key);\n }", "public int rank(Key key) {\n return rank(key, root);\n }", "private int rank(K key, Node x) {\n if (x == null) return 0;\n int cmp = key.compareTo(x.key);\n if (cmp < 0) return rank(key, x.left);\n else if (cmp > 0) return 1 + size(x.left) + rank(key, x.right);\n else return size(x.left);\n }", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "public Object getSurrogateKey(Object oKey, int nSalt)\n {\n int nKey = ((Integer) oKey).intValue();\n return Integer.valueOf(nKey + m_nPartitionCount * (nSalt + 1));\n }", "public int rank(K key) {\n int r = 0;\n if (root != null) {\n Node curr = root;\n while (curr != null) {\n int cmp = key.compareTo(curr.key);\n if (cmp > 0) {\n r += size(curr.left) + 1;\n curr = curr.right;\n } else if (cmp < 0) {\n curr = curr.left;\n } else {\n r += size(curr.left);\n break;\n }\n }\n }\n return r;\n }", "public int rank(final Key key){\n int lo = 0;\n int hi = size - 1;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2;\n int comp = key.compareTo(keys[mid]);\n if (comp < 0) {\n hi = mid - 1;\n } else if (comp > 0) {\n lo = mid + 1;\n } else {\n return mid;\n }\n }\n return lo;\n }", "public NodeKey createNodeKey();", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "org.apache.xmlbeans.XmlNMTOKEN xgetKey();", "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "public int rank(K key) {\n \n int lo = 0, hi = N - 1;\n K loK = nvps[lo].getKey(), hiK = nvps[hi].getKey();\n \n if (compare(key, loK) <= 0)\n return 0;\n \n while (lo <= hi) {\n int mid = lo + (hi - lo)\n * (int) ((key.doubleValue() - loK.doubleValue()) / (hiK.doubleValue() - loK.doubleValue()));\n int cmp = compare(key, nvps[mid].getKey());\n if (cmp < 0) {\n hi = mid - 1;\n hiK = nvps[hi].getKey();\n } else if (cmp > 0) {\n lo = mid + 1;\n loK = nvps[lo].getKey();\n } else\n return mid;\n }\n return lo;\n \n /*\n int lo = 0, hi = N - 1;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2;\n int cmp = compare(key, nvps[mid].getKey());\n if (cmp < 0)\n hi = mid - 1;\n else if (cmp > 0)\n lo = mid + 1;\n else\n return mid;\n }\n return lo;\n */\n }", "public NodeKey createNodeKeyWithIdentifier( String identifier );", "K getKey();", "K getKey();", "K getKey();", "K getKey();", "protected Object getMapKeyForTradingProperty(TradingProperty tradingProperty)\n {\n return new Integer(((SimpleIntegerTradingProperty)tradingProperty).getIntegerValue());\n }", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "public NameKey toUnrankedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "protected K inferNativeKey(Object identifier) {\n return (K) identifier;\n }", "KingdomRank getRank(KingdomUser user);", "private String getStringKey(long rawKey) {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }", "public K setKey(K key);", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "protected static Object getSurrogateKey(NamedCache cache, Object oKey, int nSalt)\n {\n PartitionedService service = (PartitionedService) cache.getCacheService();\n Associator assoc = (Associator) service.getKeyAssociator();\n\n return assoc.getSurrogateKey(oKey, nSalt);\n }", "private String getStringKey(int rawKey) {\n // Specialize single group-by column case\n if (_numGroupByExpressions == 1) {\n return _dictionaries[0].getStringValue(rawKey);\n } else {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }\n }", "long getToRank();", "int getKey();", "int getKey();", "public abstract String mapItemToKey(String str);", "public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }", "private static int getTradingPropertyKeyClassKey(String tradingPropertyKey)\n {\n String returnClassKey = getPropertyItem(tradingPropertyKey, 2);\n if(returnClassKey.length() == 0)\n {\n return 0;\n }\n else\n {\n try\n {\n return Integer.parseInt(returnClassKey);\n }\n catch(NumberFormatException e)\n {\n GUILoggerHome.find().exception(GUILoggerSABusinessProperty.PROPERTY_SERVICE +\n \".getTradingPropertyKeyClassKey(tradingPropertyKey)\",\n \" Exception while parsing the classKey :\", e);\n return 0;\n }\n }\n }", "public void reduceKey(int nodeId, int newPriority) {\n\n }", "void setRank(KingdomUser user, KingdomRank rank);", "public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "public void setCountryKey(ObjectKey key) throws TorqueException\n {\n \n setCustCountryId(((NumberKey) key).intValue());\n }", "public void setKey(int key);", "public void setKey(int key);", "abstract public String getKey();", "public K floor(K key);", "Object getKey();", "public int getIdentifiableRank(Identifiable identifiable) {\n\t\tString key = identifiable.getURI().lastSegment();\n\t\tif(rankCache.containsKey(key)) \n\t\t\treturn rankCache.get(key);\n\t\t\n\t\tActivator.logError(\"Unable to find server rank for node \"+key+\". Assigning to first server\", new Exception());\n\t\treturn 0;\n\t\t// Random\n//\t\tint hash = identifiable.getURI().toString().hashCode();\n//\t\thash = Math.abs(hash);\n//\t\tint node = hash % getNumNodes();\n//\t\treturn node;\n\n\t\t// USA Mexico\n//\t\tif((identifiable.getURI().lastSegment().startsWith(\"MX\") || identifiable.getURI().lastSegment().startsWith(\"MEX\"))) return 1; \n//\t\treturn 0; // everything else is on the first node.\n\t}", "public NodeKey createNodeKey( String sourceName,\n String identifier );", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public void setRank(String value)\n {\n _rank = value;\n }", "String getClusteringKey(int index);", "private String getStringKey(IntArray rawKey) {\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey._elements[0]));\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey._elements[i]));\n }\n return groupKeyBuilder.toString();\n }", "public static String normalize(String key, NamespaceContext context) {\n if (key == null || context == null) return key;\n\n StringBuilder builder = new StringBuilder();\n List<Token> tokens = tokenize(key);\n for (int i = 0; i < tokens.size(); i++) {\n Token token = tokens.get(i);\n\n String prefix = token.prefix;\n String namespace = token.namespace;\n String suffix = token.suffix;\n\n if (i > 0) {\n builder.append(IDataKey.SEPARATOR);\n }\n\n if (prefix != null) {\n builder.append(prefix);\n }\n if (namespace != null) {\n String uri = context.getNamespaceURI(namespace);\n if (uri != null) {\n String normalizedNamespace = context.getPrefix(uri);\n if (normalizedNamespace != null) {\n namespace = normalizedNamespace;\n }\n }\n if (!\"\".equals(namespace)) {\n builder.append(namespace);\n builder.append(NAMESPACE_PREFIX_SEPARATOR);\n }\n }\n if (suffix != null) {\n builder.append(suffix);\n }\n }\n\n return builder.toString();\n }", "@Override\r\n public K floorKey(final K key) {\n return null;\r\n }", "public String getPrefixKey() {\n return \"qa.journal.item.\" + key;\n }", "private String key(RepositoryModel repository, KeyType key, long id) {\n\t\treturn key(repository, key, \"\" + id);\n\t}", "@Override\n public void convertValueToKey(Map row, Map condition) throws KkmyException {\n\n }", "public interface KeySegmentConverter<K> {\n // Return key segment object based on node object\n // Key segment equality is used to identify the source node object\n // The .toString() of the key segment object will be used to write DOM node IDs.\n public Object getSegment(K node);\n // Used to create complete NodeKey with segment objects parsed from their .toString()\n // representations.\n public NodeKey parseSegments(String[] segments);\n}", "String getPartitionKey(int index);", "public K getKey();", "public K getKey();", "@MapName(\"lnfkey\")\n \tString getLnfKey();", "public void setKey(int nKey){\n\t\tkey = clamp(nKey, MINKEY, MAXKEY);\n\t}", "abstract K getFirstLeafKey();", "abstract K getFirstLeafKey();", "public int getRank(){\n\t\tswitch(getTkn()){\n\t\t\tcase Not:\n\t\t\treturn 7;\n\t\t\t\n\t\t\tcase Kali:\n\t\t\tcase Bagi:\n\t\t\tcase Mod:\n\t\t\tcase Div:\n\t\t\treturn 6;\n\t\t\t\n\t\t\tcase Tambah:\n\t\t\tcase Kurang:\n\t\t\treturn 5;\n\t\t\t\n\t\t\tcase KurangDari:\n\t\t\tcase LebihDari:\n\t\t\tcase KurangDariSamaDengan:\n\t\t\tcase LebihDariSamaDengan:\n\t\t\treturn 4;\n\t\t\t\t\t\t\n\t\t\tcase SamaDengan:\n\t\t\tcase TidakSamaDengan:\n\t\t\treturn 3;\n\t\t\t\n\t\t\tcase And:\n\t\t\treturn 2;\n\t\t\t\n\t\t\tcase Xor:\n\t\t\treturn 1;\n\t\t\t\n\t\t\tcase Or:\n\t\t\treturn 0;\n\n\t\t\tdefault:\n\t\t\treturn -999;\n\t\t}\n\t}", "public void setRankCodeFk(String value) {\r\n setAttributeInternal(RANKCODEFK, value);\r\n }", "@Override\n\tpublic int getKey(int position) {\n\t\tbuffer.position(dataOffset + position * NODE_SIZE + 24);\n\t\treturn buffer.getInt();\n\t}", "private Node getReplacementKeyNode(Key key, Node node) {\n\t\tNode ret = node.getChild(node.getDataNumber(key));\r\n\t\t\r\n\t\twhile (!ret.isLeaf()) {\r\n\t\t\tret = ret.getChild(ret.getChildren().size() - 1);\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}", "protected String getKey(String namespace, String key){\n \t\tif (namespace != null) {\n \t\t\tkey = namespace + key;\n \t\t}\n \t\tif (key.length() > 24) {\n \t\t\ttry {\n \t\t\t\tkey = StringHelper.sha1Hex(key.getBytes(\"utf8\"));\n \t\t\t} catch (UnsupportedEncodingException e) {\n \t\t\t\tlog.warn(\"Invalid key: \" + key, e);\n \t\t\t}\n \t\t} \n//\t\tlog.info(\"key: \" + key);\n \t\treturn key;\n \t}", "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}", "void setKey(K key);", "public static Long translateNodeId(String nodeId) {\r\n\t\tif(nodeId == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn KeyFactory.stringToKey(nodeId);\r\n\t}", "public int s2i(String key) throws AgentBuilderRuntimeException {\n\t\tint result = 0;\n\t\ttry {\n\t\t\tresult = Integer.parseInt(str(key));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new AgentBuilderRuntimeException(e);\n\t\t} catch (AgentBuilderRuntimeException e) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn result;\n\t}", "public T participationPublicKeyBase64(String pk) {\n this.votePK = new ParticipationPublicKey(Encoder.decodeFromBase64(pk));\n return (T) this;\n\n }", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey() {\n\t\treturn this.isbn13;\n\t}", "public static int rank(int key, int[] a) {\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi) { // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n if\n (key < a[mid]) hi = mid - 1;\n else if (key > a[mid]) lo = mid + 1;\n else\n return mid;\n }\n return -1;\n }" ]
[ "0.6105557", "0.5554979", "0.555113", "0.54889745", "0.5474506", "0.5456015", "0.5447683", "0.5156969", "0.5151627", "0.5069207", "0.5059742", "0.4983624", "0.49625283", "0.49351892", "0.49036774", "0.48891884", "0.48534393", "0.4774549", "0.4774549", "0.4774549", "0.4774549", "0.47496986", "0.47415954", "0.4731604", "0.47274026", "0.4701863", "0.47002777", "0.46432394", "0.46429282", "0.46429282", "0.46429282", "0.46429282", "0.46429282", "0.46429282", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46384043", "0.46296304", "0.4629272", "0.4616276", "0.4602502", "0.4602502", "0.45955026", "0.4567175", "0.45664462", "0.455102", "0.45475584", "0.45200807", "0.45048302", "0.44922355", "0.44922355", "0.44912264", "0.4486545", "0.4481201", "0.4480573", "0.4464474", "0.44610387", "0.44531152", "0.44474125", "0.4443647", "0.44329923", "0.4415675", "0.4413565", "0.44095343", "0.44067204", "0.44047597", "0.44006598", "0.438705", "0.438705", "0.4386863", "0.4379121", "0.43758568", "0.43758568", "0.43692067", "0.4364736", "0.43614423", "0.43589514", "0.4355051", "0.43518874", "0.43503216", "0.43486628", "0.4348423", "0.43466392", "0.4338364", "0.43359804", "0.43359804", "0.43359804", "0.43359804", "0.43321016", "0.43077084" ]
0.6187515
0
Convert a full taxon key into an unranked and unnomenclatural coded key.
public NameKey toUncodedNameKey() { if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null) return this; Set<NameFlag> fl = this.flags; if (fl != null && fl.contains(NameFlag.AUTONYM)) { fl = new HashSet<>(this.flags); fl.remove(NameFlag.AUTONYM); fl = fl.isEmpty() ? null : fl; } return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "public NameKey toUnrankedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, RankType.UNRANKED, this.type, fl);\n }", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "public static String getEncodedKey(final String key)\n {\n String encodedKey = key;\n \n try {\n final int ontEnd = key.indexOf(ONT_SEPARATOR);\n if (ontEnd != -1) { \n final String prefix = key.substring(0, ontEnd + 1);\n final String name = key.substring(ontEnd + 1, key.length());\n final String encodedName = java.net.URLEncoder.encode(name, \"UTF-8\");\n if (name != encodedName) {\n encodedKey = prefix + encodedName;\n if (DEBUG.RDF) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n } else {\n encodedKey = java.net.URLEncoder.encode(key, \"UTF-8\");\n if (DEBUG.RDF && encodedKey != key) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n }\n catch (java.io.UnsupportedEncodingException e) {\n Log.warn(\"encoding key \" + Util.tags(key), e); \n }\n \n return encodedKey;\n }", "public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.contains(NameFlag.AUTONYM)) {\n fl = new HashSet<>(this.flags);\n fl.remove(NameFlag.AUTONYM);\n fl = fl.isEmpty() ? null : fl;\n\n }\n return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);\n }", "public static String normalize(String key, NamespaceContext context) {\n if (key == null || context == null) return key;\n\n StringBuilder builder = new StringBuilder();\n List<Token> tokens = tokenize(key);\n for (int i = 0; i < tokens.size(); i++) {\n Token token = tokens.get(i);\n\n String prefix = token.prefix;\n String namespace = token.namespace;\n String suffix = token.suffix;\n\n if (i > 0) {\n builder.append(IDataKey.SEPARATOR);\n }\n\n if (prefix != null) {\n builder.append(prefix);\n }\n if (namespace != null) {\n String uri = context.getNamespaceURI(namespace);\n if (uri != null) {\n String normalizedNamespace = context.getPrefix(uri);\n if (normalizedNamespace != null) {\n namespace = normalizedNamespace;\n }\n }\n if (!\"\".equals(namespace)) {\n builder.append(namespace);\n builder.append(NAMESPACE_PREFIX_SEPARATOR);\n }\n }\n if (suffix != null) {\n builder.append(suffix);\n }\n }\n\n return builder.toString();\n }", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "String getShortNameKey();", "private String formTransactionKey(String transaction){\n\t\tString transKey = \"\";\n\t\tString[] transKeyValues = transaction.split(\" \");\n\t\tfor(String parts : transKeyValues){\n\t\t\tif(parts.matches(\".*\\\\d+.*\")){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttransKey += parts;\n\t\t\t\tString existingKey = isKeyAlreadyFormed(transKey);\n\t\t\t\tif(!existingKey.equals(\"\"))\n\t\t\t\t\treturn existingKey;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn transKey;\n\t}", "public VariantKey toNonFacing() {\n int hash = 0; \n HashMap<String, String> entries = new HashMap<String, String>();\n \n for (Map.Entry<String, String> entrySet : m_entries.entrySet()) {\n String key = entrySet.getKey();\n String value = entrySet.getValue();\n \n if (!key.equalsIgnoreCase(FACING)) {\n hash ^= key.hashCode() ^ value.hashCode();\n entries.put(key, value);\n }\n }\n \n return new VariantKey(entries, hash);\n }", "private static String translateIllegalKey(final String key, final boolean revert) {\n if (revert) {\n return key.replaceAll(DOT_STRING_REPLACEMENT, DOT_STRING).replaceAll(DASH_STRING_REPLACEMENT, DASH_STRING);\n }\n else {\n return key.replaceAll(DOT_STRING, DOT_STRING_REPLACEMENT).replaceAll(DASH_STRING, DASH_STRING_REPLACEMENT);\n }\n }", "protected String keyToString(Object rawKey)\n {\n if (rawKey instanceof String) {\n return (String) rawKey;\n }\n return String.valueOf(rawKey);\n }", "private String getStringKey(long rawKey) {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue((int) (rawKey % cardinality)));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }", "String getKeyFormat();", "public String kursIndonesia(double nominal){\n Locale localeID = new Locale(\"in\",\"ID\");\n NumberFormat formatRupiah = NumberFormat.getCurrencyInstance(localeID);\n String idnNominal = formatRupiah.format(nominal);\n return idnNominal;\n\n\n }", "private String getStringKey(int rawKey) {\n // Specialize single group-by column case\n if (_numGroupByExpressions == 1) {\n return _dictionaries[0].getStringValue(rawKey);\n } else {\n int cardinality = _cardinalities[0];\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n cardinality = _cardinalities[i];\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey % cardinality));\n rawKey /= cardinality;\n }\n return groupKeyBuilder.toString();\n }\n }", "@Override\n\tprotected String getSurroundingKeys(char key) {\n\t\tif((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) {\n\t\t\tif(Character.isLowerCase(key))\n\t\t\t\treturn surroundingKeys[key - 'a'];\n\t\t\telse\n\t\t\t\treturn surroundingKeys[Character.toLowerCase(key) - 'a'];\n\t\t}\n\n\t\treturn \"\" + key;\n\t}", "private String getKey (String keyBase, Object field)\n\t{\n\t\treturn ((field == null) ? keyBase : (keyBase + \"_related\"));\t//NOI18N\n\t}", "@SuppressWarnings(\"unused\")\n private static String getKeyString(Key key)\n {\n return Base64.encode(key.getEncoded());\n }", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "@Override\r\n public K floorKey(final K key) {\n return null;\r\n }", "private String getStringKey(IntArray rawKey) {\n StringBuilder groupKeyBuilder = new StringBuilder(_dictionaries[0].getStringValue(rawKey._elements[0]));\n for (int i = 1; i < _numGroupByExpressions; i++) {\n groupKeyBuilder.append(GroupKeyGenerator.DELIMITER);\n groupKeyBuilder.append(_dictionaries[i].getStringValue(rawKey._elements[i]));\n }\n return groupKeyBuilder.toString();\n }", "protected String getKey(String namespace, String key){\n \t\tif (namespace != null) {\n \t\t\tkey = namespace + key;\n \t\t}\n \t\tif (key.length() > 24) {\n \t\t\ttry {\n \t\t\t\tkey = StringHelper.sha1Hex(key.getBytes(\"utf8\"));\n \t\t\t} catch (UnsupportedEncodingException e) {\n \t\t\t\tlog.warn(\"Invalid key: \" + key, e);\n \t\t\t}\n \t\t} \n//\t\tlog.info(\"key: \" + key);\n \t\treturn key;\n \t}", "org.apache.xmlbeans.XmlNMTOKEN xgetKey();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "public MicroRowEpoxyModel_ m5160id(CharSequence key) {\n super.mo11718id(key);\n return this;\n }", "private String shiftAlphabet(int key) {\n return ALPHABET.substring(key) + ALPHABET.substring(0, key);\n }", "public String getLowestChromKey();", "private String convertToID(String originalTree) {\n\tString result = new String(originalTree);\n\tfor (int i = 0; i < noTax; i++) {\n\t int indx = result.indexOf(taxa[i] + \")\");\n\t if (indx == -1) {\n\t\tindx = result.indexOf(taxa[i] + \",\");\n\t }\n\t try{\n\t\tresult = result.substring(0, indx) + i + \n\t\t result.substring(indx + taxa[i].length(), result.length());\n\t } catch (Exception e) {\n\t\tSystem.out.println(\"Error in replacing\\n\" + taxa[i] +\n\t\t\t\t \"\\n in \" + result);\n\t\tSystem.exit(-1);\n\t }\n\t}\n\treturn result;\n }", "private CollationKey() { }", "private static Key createInternalLobKey() {\n return Key.createKey(Arrays.asList(INTERNAL_KEY_SPACE,\n ILK_PREFIX_COMPONENT,\n UUID.randomUUID().toString()));\n }", "@Override\n\tpublic String getMapKey()\n\t{\n\t\tsbTemp.delete(0, sbTemp.length());\n\t\tsbTemp.append(areaCell.iCityID);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.iAreatype);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.iAreaID);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.iECI);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.iTime);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.iInterface);\n\t\tsbTemp.append(\"_\");\n\t\tsbTemp.append(areaCell.kpiSet);\n\t\treturn sbTemp.toString();\n\t}", "public String translateCodon(String codon) {\n\t\t\tString aa = translationTable.get(codon);\n\t\t\tif (aa == null) {\n\t\t\t\treturn \"X\";\n\t\t\t}\n\t\t\treturn aa;\n\t\t}", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "private synchronized void makeKey (Key key)\n throws KeyException {\n\n byte[] userkey = key.getEncoded();\n if (userkey == null)\n throw new KeyException(\"Null LOKI91 key\");\n\n // consider only 8 bytes if user data is longer than that\n if (userkey.length < 8)\n throw new KeyException(\"Invalid LOKI91 user key length\");\n\n // If native library available then use it. If not or if\n // native method returned error then revert to 100% Java.\n\n if (native_lock != null) {\n synchronized(native_lock) {\n try {\n linkStatus.check(native_ks(native_cookie, userkey));\n return;\n } catch (Error error) {\n native_finalize();\n native_lock = null;\nif (DEBUG && debuglevel > 0) debug(error + \". Will use 100% Java.\");\n }\n }\n }\n\n sKey[0] = (userkey[0] & 0xFF) << 24 |\n (userkey[1] & 0xFF) << 16 |\n (userkey[2] & 0xFF) << 8 |\n (userkey[3] & 0xFF);\n sKey[1] = sKey[0] << 12 | sKey[0] >>> 20;\n sKey[2] = (userkey[4] & 0xFF) << 24 |\n (userkey[5] & 0xFF) << 16 |\n (userkey[6] & 0xFF) << 8 |\n (userkey[7] & 0xFF);\n sKey[3] = sKey[2] << 12 | sKey[2] >>> 20;\n\n for (int i = 4; i < ROUNDS; i += 4) {\n sKey[i ] = sKey[i - 3] << 13 | sKey[i - 3] >>> 19;\n sKey[i + 1] = sKey[i ] << 12 | sKey[i ] >>> 20;\n sKey[i + 2] = sKey[i - 1] << 13 | sKey[i - 1] >>> 19;\n sKey[i + 3] = sKey[i + 2] << 12 | sKey[i + 2] >>> 20;\n }\n }", "private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }", "@MapName(\"lnfkey\")\n \tString getLnfKey();", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "private com.hps.july.persistence.SuperRegionKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionKey keyClass = new com.hps.july.persistence.SuperRegionKey();\n keyClass.supregid = f0;\n return keyClass;\n }", "public NameKey toRankedNameKey(RankType rank) {\n if (this.rank == rank)\n return this;\n return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags);\n }", "private static String shortKey(PublicKey publicKey) {\n return publicKey.toString().substring(publicKey.toString().length() - 4);\n }", "private String getAnomizedPostcode() {\r\n\tString postcode = (String) record.get(\"postcode\");\r\n\tif (postcode != null && postcode.length() > 0) {\r\n\t postcode = postcode.substring(0, 1);\r\n\t}\r\n\treturn postcode;\r\n }", "@Override\n\tpublic void setupNonExistKeyFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZAB\", \"9999\"); // Account branch (4A)\n\t\ttransaction.setFieldValue(\"GZAN\", \"999999\"); // Basic part of account number (6A)\n\t\ttransaction.setFieldValue(\"GZAS\", \"999\"); // Account suffix (3A)\n\t\ttransaction.setFieldValue(\"GZTCD\", \"999\"); // Transaction code (3A)\n\t}", "private String normalizeDiseaseId(String diseaseId) {\n String[] tokens = diseaseId.split(\":\");\n if (\"ORPHANET\".equals(tokens[0])) {\n diseaseId = \"ORPHA:\" + tokens[1];\n }\n return diseaseId;\n }", "@Override\r\n public K lowerKey(final K key) {\n return null;\r\n }", "String newKey();", "private com.hps.july.persistence.SuperRegionAccKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionAccKey keyClass = new com.hps.july.persistence.SuperRegionAccKey();\n keyClass.accessid = f0;\n return keyClass;\n }", "private String changeToHSCode(String key) throws IOException {\n\t\t\r\n\t\tHashMap<String, String> index=FileHelper.readindex(Constants.indexputpath);\r\n\t\tString hscode = null;\r\n\t\tfor(Entry<String,String> entry:index.entrySet()){\r\n\t\t\tif(key.equals(entry.getValue())){\r\n\t\t\t\thscode=entry.getKey();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn hscode;\r\n\t}", "public String getMinKey();", "public static String encodeAscii(String in, String key) {\r\n String m = \"\", ts = \"\";\r\n String result = \"\";\r\n int tmp;\r\n for (int i = 0; i < in.length(); i++) {\r\n tmp = (int) (in.charAt(i) + key\r\n .charAt((key.length() % (i + 1) == 0) ? 0\r\n : (key.length() % (i + 1)) - 1)) + 18;\r\n m += String.valueOf((char) (tmp / 100 * 10 + tmp % 10 + 65 + i))\r\n + String\r\n .valueOf((char) (tmp / 100 * 10\r\n + (tmp - tmp / 100 * 100 - tmp % 10) / 10\r\n + 68 + i));\r\n }\r\n\r\n for (int i = 0; i < m.length(); i++) {\r\n ts = String.valueOf((int) m.charAt(i) + 288 + i);\r\n tmp = 3 - ts.length();\r\n for (int j = 0; j < tmp; j++) {\r\n ts = \"0\" + ts;\r\n }\r\n result += ts;\r\n }\r\n return result;\r\n }", "public String getHighestChromKey();", "private void buildKeyMap() {\n\t\tcharMapKey = new HashMap<Character , Integer>();\n\t\tcharMapKey.put('a', 0);\n\t\tcharMapKey.put('b', 0);\n\t\tcharMapKey.put('c', 1);\n\t\tcharMapKey.put('d', 1);\n\t\tcharMapKey.put('e', 2);\n\t\tcharMapKey.put('f', 2);\n\t\tcharMapKey.put('g', 3);\n\t\tcharMapKey.put('h', 3);\n\t\tcharMapKey.put('i', 4);\n\t\tcharMapKey.put('j', 4);\n\t\tcharMapKey.put('k', 5);\n\t\tcharMapKey.put('l', 5);\n\t\tcharMapKey.put('m', 6);\n\t\tcharMapKey.put('n', 6);\n\t\tcharMapKey.put('o', 7);\n\t\tcharMapKey.put('p', 7);\n\t\tcharMapKey.put('q', 8);\n\t\tcharMapKey.put('r', 8);\n\t\tcharMapKey.put('s', 9);\n\t\tcharMapKey.put('t', 9);\n\t\tcharMapKey.put('u', 10);\n\t\tcharMapKey.put('v', 10);\n\t\tcharMapKey.put('w', 11);\n\t\tcharMapKey.put('x', 11);\n\t\tcharMapKey.put('y', 12);\n\t\tcharMapKey.put('z', 12);\n\t}", "public static String getWordFromKey(String senseKey)\n\t{\n\t\tint lastUS = senseKey.lastIndexOf(\"_\");\n\t\treturn senseKey.substring(0, lastUS - 3);\n\t}", "public StringBuilder decodeKey(StringBuilder key, long seed) {\n\t\tif (getStringBuilder()!=null && isNumber(key,false)) {\n\t\t\tint sVar = ((int) (seed % 200));\n\t\t\tString str = \"\";\n\t\t\tint idx = 0;\n\t\t\tint end = 0;\n\t\t\tdecompress(getCharCompressForKey(key,seed));\n\t\t\tStringBuilder sb = getStringBuilder();\n\t\t\tint len = sb.length();\n\t\t\tchar[] characters = new char[(len / 3)];\n\t\t\tfor (int p = 0; p < (len / 3); p++) {\n\t\t\t\tidx = p % key.length();\n\t\t\t\tend = idx + 3;\n\t\t\t\tif (end > key.length()) {\n\t\t\t\t\tend = key.length();\n\t\t\t\t}\n\t\t\t\tstr = sb.substring((p * 3), ((p * 3) + 3));\n\t\t\t\tif (isNumberNotNegative(str)) {\n\t\t\t\t\tcharacters[p] = (char) (Integer.parseInt(str) - ((Integer.parseInt(key.substring(idx,end))) / 2) - sVar);\n\t\t\t\t} else {\n\t\t\t\t\tcharacters[p] = CHAR_MINUS;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb = new StringBuilder();\n\t\t\tsb.append(characters);\n\t\t\tsetStringBuilder(sb);\n\t\t}\n\t\treturn getStringBuilder();\n\t}", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "short getDefaultKeyIx();", "public static String get32(TrieImpl trie, byte[] key) {\n byte[] subkey = new byte[16];\n byte[] rlpdata ;\n switch(key[0]) {\n case '1':\n {\n for(int i = 0; i < 16; i++){\n subkey[i] = key[i];\n }\n return new String(trie.get(subkey));\n }\n case '2':\n {\n for(int i = 0; i < 16; i++){\n subkey[i] = key[i];\n }\n return new String(trie.get(subkey));\n }\n case '3':\n {\n for(int i = 0; i < 16; i++){\n subkey[i] = key[i];\n }\n return new String(trie.get(subkey));\n }\n case '4':\n {\n for(int i = 0; i < 16; i++){\n subkey[i] = key[i];\n }\n rlpdata = trie.get(subkey);\n if(new String(rlpdata) != \"\"){\n for(int i = 16; i < 32;i++){\n subkey[i-16] = key[i];\n }\n if (subkey[0] == '5') {\n JSONObject jo = JSONObject.fromObject(new String(rlpdata));\n Value val = Value.fromRlpEncoded(Utils.hexStringToBytes(jo.getString(\"root\")));\n TrieImpl subtrie = new TrieImpl(mockDb, val.asObj());\n subtrie.setCache(trie.getCache());\n rlpdata = subtrie.get(subkey);\n return new String(rlpdata);\n }\n else if(subkey[0] == '0'){\n \treturn new String(rlpdata);\n }\n else System.out.println(\"The key is wrong.\");\n break;\n }\n else return \"\";\n }\n case '6':\n {\n \tfor(int i = 0; i < 16; i++){\n subkey[i] = key[i];\n }\n rlpdata = trie.get(subkey);\n if(new String(rlpdata) != \"\"){\n for(int i = 16; i < 32;i++){\n subkey[i-16] = key[i];\n }\n if (subkey[0] == '7') {\n JSONObject jo = JSONObject.fromObject(new String(rlpdata));\n Value val = Value.fromRlpEncoded(Utils.hexStringToBytes(jo.getString(\"root\")));\n TrieImpl subtrie = new TrieImpl(mockDb, val.asObj());\n subtrie.setCache(trie.getCache());\n rlpdata = subtrie.get(subkey);\n return new String(rlpdata);\n }\n else if(subkey[0] == '0'){\n \treturn new String(rlpdata);\n }\n else System.out.println(\"The key is wrong.\");\n break;\n }\n else return \"\";\n }\n default: System.out.println(\"wrong key\"); \n }\n return \"\";\n }", "String key();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "private String getShortType(String aKey) {\n if (iConnection == null){\n return ModificationConversion.getShortType(aKey);\n } else {\n return ModificationConversion.getShortType(aKey,iConnection);\n }\n }", "protected String getLocaleSpecificKey(String localeKey) {\n return CONTENT_KEY.concat(\"-\").concat(localeKey);\n }", "private com.hps.july.persistence.StoragePlaceKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.StoragePlaceKey keyClass = new com.hps.july.persistence.StoragePlaceKey();\n keyClass.storageplace = f0;\n return keyClass;\n }", "public abstract String mapItemToKey(String str);", "public void setKey(int nKey){\n\t\tkey = clamp(nKey, MINKEY, MAXKEY);\n\t}", "public String getDicValue(String key)\n {\n String lang_code;\n if(key.indexOf(\"_\")==2)\n {\n lang_code = key.substring(0,2);\n key = key.substring(3,key.length());\n }\n else\n {\n return null;\n }\n return getTranslation(lang_code,key);\n }", "static int getKey(String raw) {\n\t\tint key = 0;\n\t\tfor (int i = 0; i < raw.length(); i++) {\n\t\t\tkey = key * HASH_VALUE + raw.charAt(i);\n\t\t}\n\t\tif (key < 0) {\n\t\t\tkey = -key;\n\t\t}\n\t\treturn key % HASH_SIZE;\n\t}", "public String getKey() {\n\t\treturn this.isbn13;\n\t}", "private static void loadConsonant() {\r\n subConsonant = new LinkedHashMap<String, String>();\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1000\")), \"0xE000\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1001\")), \"0xE001\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1002\")), \"0xE002\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1003\")), \"0xE003\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1005\")), \"0xE005\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1006\")), \"0xE006\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1007\")), \"0xE007\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1008\")), \"0xE008\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100C\")), \"0xE00C\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100E\")), \"0xE00E\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100F\")), \"0xE00F\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1010\")), \"0xE010\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1011\")), \"0xE011\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1012\")), \"0xE012\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1013\")), \"0xE013\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1014\")), \"0xE014\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1015\")), \"0xE015\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1016\")), \"0xE016\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1017\")), \"0xE017\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1018\")), \"0xE018\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1019\")), \"0xE019\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x101C\")), \"0xE01C\");\r\n }", "private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }", "int toHashKey(String s)\n\t{\n\t\tint A = 1952786893;\n\t\tint B = 367257;\n\t\tint v = B;\n\t\tfor (int j = 0; j < s.length(); j++)\n\t\t{\n\t\t\tchar c = s.charAt(j);\n\t\t\tv = A * (v + (int) c + j) + B;\n\t\t}\n\n\t\tif (v < 0) v = -v;\n\t\treturn v;\n\t}", "@Override\n\tpublic void setupNonExistKeyFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZAB\", \"0000\"); // Account branch\n\t\ttransaction.setFieldValue(\"GZAN\", \"500035\"); // Account basic number\n\t\ttransaction.setFieldValue(\"GZAS\", \"102\"); // Account suffix\n\t\ttransaction.setFieldValue(\"GZCATP\", \"CARD\"); // Card type\n\t\t// Card type must allow auto generation of card numbers\n\t\ttransaction.setFieldValue(\"GZBCGC\", \"Y\"); // Generate card numbers\n\t}", "private byte[] getTokenKey() throws InternalSkiException {\n return sysKey(TOKEN_KEY);\n }", "private String removeDMSSuffix(String key) {\r\n\t\tint suffixPos = key.lastIndexOf(\"#DMS#\");\r\n\t\tif (suffixPos != -1) {\r\n\t\t\treturn key.substring(0, suffixPos);\r\n\t\t}\r\n\t\treturn key;\r\n\t}", "public void keyDerivation(String uid) {\n\t\tElement e1 = Hash(HashType.H1, uid);// Hash1(uidByte); G1\n\t\tElement e2 = Hash(HashType.H2, uid);// Hash2(uidByte); G1\n\t\t// System.out.println(\"generate sk \" + uid);\n\t\tkeys.setISK(0,e1.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(0))).toBytes());\n\t\tkeys.setISK(1,e2.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(1))).toBytes());\n\t\t\n\t\tmpkg1= pairing.getG1().newElementFromBytes(keys.getMPK(0)).getElementPowPreProcessing();\n\t\tisksk1 = pairing.getG1().newElementFromBytes(keys.getISK(0)).getElementPowPreProcessing();\n\t}", "public static String refiningSoftwareKey(String softwareKey, int lengthOfKey) {\n\t\tStringBuffer result = new StringBuffer(\"\");\r\n\t\tint j=0;\r\n\t\tfor(int i = 0 ;i< softwareKey.length(); i++ ){\r\n\t\t\tif(softwareKey.charAt(i)!='-'){\r\n\t\t\t\tresult.append(softwareKey.charAt(i));\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tif(j%lengthOfKey==0 && j!=0 ) {\r\n\t\t\t\tif(softwareKey.charAt(i)!='-' && i != softwareKey.length()-1){\r\n\t\t\t\t\tresult.append(\"-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.toString().toUpperCase();\r\n\t}", "public static String md5PrefixedKey(long key) {\n String stringKey = Long.toString(key);\n String md5hash = MD5Hash.getMD5AsHex(Bytes.toBytes(stringKey));\n\n // flip the key to randomize\n return md5hash + \"-\" + stringKey;\n }", "private RowKeyFormat2 badCompNameRowKeyFormat() {\n // components of the row key\n ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();\n components.add(RowKeyComponent.newBuilder()\n .setName(\"0\").setType(ComponentType.STRING).build());\n\n // build the row key format\n RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)\n .setSalt(HashSpec.newBuilder().build())\n .setRangeScanStartIndex(1)\n .setComponents(components)\n .build();\n\n return format;\n }", "public T participationPublicKeyBase64(String pk) {\n this.votePK = new ParticipationPublicKey(Encoder.decodeFromBase64(pk));\n return (T) this;\n\n }", "private String getNormalizedNumberString(String originalStr) {\n String numberStr = normalizationPreprocessing(originalStr);\n\n String normalized = null;\n try {\n normalized = normalizer.normalize(numberStr);\n if (commonNumberMappings.containsKey(normalized)) {\n normalized = commonNumberMappings.get(normalized);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return normalized;\n }", "public native void keyType(char c);", "private Node getReplacementKeyNode(Key key, Node node) {\n\t\tNode ret = node.getChild(node.getDataNumber(key));\r\n\t\t\r\n\t\twhile (!ret.isLeaf()) {\r\n\t\t\tret = ret.getChild(ret.getChildren().size() - 1);\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}", "public static String getPOSFromKey(String senseKey)\n\t{\n\t\tint lastUS = senseKey.lastIndexOf(\"_\");\n\t\treturn senseKey.substring(lastUS - 2, lastUS);\n\t}", "protected String evalBalanceOid(final String _key)\n {\n String ret = _key;\n if (!Utils.isOid(_key)) {\n final Optional<Balance> balanceopt = balanceRepository.findById(_key);\n if (balanceopt.isPresent()) {\n final Balance balance = balanceopt.get();\n if (!StringUtils.isEmpty(balance.getOid())) {\n ret = balance.getOid();\n }\n }\n }\n return ret;\n }", "private ImmutablePair<byte[], byte[]> getFuzzyKeyFor(MDSKey key) {\n byte[] keyBytes = key.getKey();\n // byte array is automatically initialized to 0, which implies fixed match in fuzzy info\n // the row key after targetId doesn't need to be a match.\n // Workaround for HBASE-15676, need to have at least one 1 in the fuzzy filter\n byte[] infoBytes = new byte[keyBytes.length + 1];\n infoBytes[infoBytes.length - 1] = 1;\n\n // the key array size and mask array size has to be equal so increase the size by 1\n return new ImmutablePair<>(Bytes.concat(keyBytes, new byte[1]), infoBytes);\n }", "public Vigenere(CharSequence key)\n\t{\n\t\tthis.key = sanitizeValue(key);\n\t}", "public static String toLegacyKey(String keyword) {\n/* 1272 */ throw new RuntimeException(\"Stub!\");\n/* */ }" ]
[ "0.6292418", "0.5857915", "0.58414155", "0.5594304", "0.55226636", "0.54489547", "0.5317751", "0.5306089", "0.52502805", "0.5186701", "0.5149866", "0.51414186", "0.50789446", "0.50720996", "0.50220835", "0.4984702", "0.49696022", "0.49514848", "0.4937555", "0.48955742", "0.4884678", "0.48627868", "0.48141345", "0.47727478", "0.47601378", "0.47411308", "0.47045615", "0.46739295", "0.4673665", "0.46515623", "0.46446934", "0.46258402", "0.46207827", "0.46114898", "0.46043277", "0.4595694", "0.45900467", "0.45753476", "0.45747903", "0.45666575", "0.4563823", "0.4548714", "0.4547623", "0.45378897", "0.4531847", "0.4519248", "0.45163435", "0.4506245", "0.45059127", "0.45046508", "0.4500282", "0.44993034", "0.44989875", "0.4498743", "0.44874808", "0.44861776", "0.4480775", "0.44798476", "0.4470111", "0.4465259", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.4455127", "0.44532958", "0.4431144", "0.44276044", "0.4414117", "0.44030544", "0.43959433", "0.43919486", "0.43896097", "0.4387747", "0.43848395", "0.43808922", "0.4375014", "0.43711933", "0.43675616", "0.4365077", "0.43650478", "0.43620357", "0.43582797", "0.43500176", "0.43498603", "0.43456656", "0.43424702", "0.43417674", "0.43401906", "0.43399668", "0.43399036", "0.43365422" ]
0.6118168
1
write your code here
public static void main(String[] args) { int arr1[][] = {{1,89,75},{56,20,15},{63,02,30}}; int arr2[][] = {{48,8,02},{78,280,1895},{3,0562,390}}; //int arr2[][] = {{40,50,60},{8,52,82},{88,90,02}}; //int arr2[][] = {{48,8,02},{78,280,1895},{3,0562,390}}; int arrSum[][] = new int[3][3]; int arrSub[][] = new int[3][3]; int arrMult[][] = new int[3][3]; System.out.println("array1"); for(int i = 0; i<arr1.length; i++){ for(int j=0; j<arr1.length; j++){ System.out.print(arr1[i][j] + " "); } System.out.println(); } System.out.println(); System.out.println("array2"); for(int i = 0; i<arr1.length; i++){ for(int j=0; j<arr1.length; j++){ System.out.print(arr2[i][j] + " "); } System.out.println(); } for(int i = 0; i < arr1.length; i++){ for(int j = 0; j < arr1.length; j++){ arrSum[i][j] = arr1[i][j]+arr2[i][j]; arrSub[i][j] = arr1[i][j]-arr2[i][j]; //arrMult[i][j] = arr1[i][j]*arr2[i][j]; } System.out.println(); } for(int i = 0; i <arr2.length;i++){ for(int j = 0; j<arr2.length;j++){ arrMult[i][j] = 0; for(int k =0; k<3;k++){ arrMult[i][j] += arr1[i][k]*arr2[k][j]; } } } System.out.println(); System.out.println("matrix addition ..."); for(int i = 0; i<arr1.length; i++){ for(int j=0; j<arr1.length; j++){ System.out.print(arrSum[i][j] + " "); } System.out.println(); } System.out.println(); System.out.println("matrix subtraction ..."); for(int i = 0; i<arr1.length; i++){ for(int j=0; j<arr1.length; j++){ System.out.print(arrSub[i][j] + " "); } System.out.println(); } System.out.println(); System.out.println("matrix multiplication ..."); for(int i = 0; i<arr1.length; i++){ for(int j=0; j<arr1.length; j++){ System.out.print(arrMult[i][j] + " "); } System.out.println(); } System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "public void baocun() {\n\t\t\n\t}", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void smell() {\n\t\t\n\t}", "public void perder() {\n // TODO implement here\n }", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\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 }", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "private void sub() {\n\n\t}", "protected void additionalProcessing() {\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "void mo67924c();", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.6102675", "0.60554034", "0.5881289", "0.5827861", "0.5797848", "0.5699908", "0.5690402", "0.5655419", "0.5649126", "0.56402504", "0.56354046", "0.5604573", "0.5602213", "0.56006557", "0.55898213", "0.5584013", "0.5576956", "0.55739224", "0.5560841", "0.55331355", "0.55129653", "0.55126613", "0.55124086", "0.55008936", "0.5488954", "0.54829", "0.54829", "0.54783374", "0.54783374", "0.5465151", "0.54613376", "0.545543", "0.5442931", "0.5431501", "0.5422709", "0.5419739", "0.5408589", "0.54068923", "0.5399456", "0.5398938", "0.5389545", "0.53863776", "0.53784436", "0.53757185", "0.5361223", "0.53555834", "0.5345956", "0.5344632", "0.53206384", "0.53190637", "0.5310136", "0.5310136", "0.530804", "0.53054047", "0.53048295", "0.5301893", "0.52965164", "0.5290373", "0.5290105", "0.5288162", "0.5287326", "0.5287326", "0.5287326", "0.5287326", "0.5287326", "0.5287326", "0.5287326", "0.5286428", "0.52860427", "0.52854836", "0.5285175", "0.5281573", "0.5279033", "0.5279016", "0.5276884", "0.5276475", "0.5274038", "0.52657354", "0.5265041", "0.52609324", "0.5259143", "0.5257966", "0.52569073", "0.52569073", "0.52564305", "0.52559", "0.52558", "0.52513015", "0.5245435", "0.52442807", "0.52438766", "0.52428883", "0.5240381", "0.52398413", "0.52332133", "0.52261764", "0.5224486", "0.522081", "0.52204657", "0.5218015", "0.5217167" ]
0.0
-1
scene function for intro
public Scene introScene() { ipField = new TextField("127.0.0.1"); portNum = new TextField("5555"); introHbox = new HBox(30,ipField, portNum); introHbox.setLayoutX(150); introHbox.setLayoutY(200); // login Button loginButton = new Button("Next"); loginButton.setLayoutX(150); loginButton.setLayoutY(240); loginButton.setOnAction(toTheInstr); // intro Pane with background introPane = new Pane(introHbox, loginButton); Image image = new Image("background_intro.jpg"); BackgroundImage backgroundImage = new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, new BackgroundSize(1.0, 1.0, true, true, false, false)); Background background = new Background(backgroundImage); introPane.setBackground(background); return new Scene(introPane,600,600); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createScene();", "@Override\n\tpublic void onShowScene() {\n\t\t\n\t}", "public void initIntro() {\n\t\tWorld.clear();\n\t\tstate = STATE.INTRO;\n\t\tinitBackground();\n\t\tWorld.add(new Logo(Screen.getCenterX() - Logo.WIDTH / 2, Screen\n\t\t\t\t.getHeight() * 3 / 4 - Logo.HEIGHT / 2));\n\n\t\tWorld.add(new StartButton(Screen.getCenterX() - StartButton.WIDTH / 2,\n\t\t\t\tScreen.getHeight() / 4 - StartButton.HEIGHT / 2, this));\n\n\t\tWorld.add(new SoundButton(Screen.getCenterX() - StartButton.WIDTH / 2,\n\t\t\t\tScreen.getHeight() / 8 - StartButton.HEIGHT / 2));\n\n\t\tWorld.add(new TextStatic(footerText, Screen.getCenterX()\n\t\t\t\t- footerText.length() * Sprite.CHAR_WIDTH / 2,\n\t\t\t\tSprite.CHAR_HEIGHT, Color.yellow));\n\t}", "@Override\n\tpublic void intro() {\n\t\t\n\t}", "@Override\npublic void populateScene() {\n\t\n}", "@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }", "@Override\n\tpublic Scene onLoadScene() {\n\t\tmEngine.registerUpdateHandler(new FPSLogger());\n\t\tScene scene=new Scene();\n\t\tAutoParallaxBackground autoParallaxBackground=new AutoParallaxBackground(0, 0, 0, 5);\n\t\tautoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 0, mTextureRegion)));\n\t\tscene.setBackground(autoParallaxBackground);\n\t\t//Position of the Sprite in the region\n\t\tAnimatedSprite banana=new AnimatedSprite(200,200,bananaRegion);\n\t\tbanana.animate(100);\n\t\tscene.attachChild(banana);\n\t\treturn scene;\n\t}", "@Override\r\n\tpublic void completeScene() {\n\t\t\r\n\t}", "public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}", "protected void introduction() {\r\n\r\n // Titel\r\n\r\n Text title = lang.newText(new Coordinates(20, 25), \"Negascout Algorithmus\",\r\n \"header\", null, headerProperties);\r\n pMap.put(\"title\", title);\r\n // Umrandung\r\n pMap.put(\"hRect\", lang.newRect(new Coordinates(10, 15), new Coordinates(\r\n 400, 50), \"hRect\", null, headerRectProperties));\r\n\r\n // Zeigt die Einleitung an\r\n SourceCode intro;\r\n intro = lang.newSourceCode(new Coordinates(30, 60), \"intro\", null,\r\n sourceCodeProperties);\r\n intro\r\n .addCodeLine(\r\n \"Der Negascout-Algorithmus wird angewendet, um in einem Spiel zwischen zwei Parteien\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"eine optimale Spielstrategie f\\u00FCr eine der Parteien zu bestimmen.\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Die m\\u00F6glichen Z\\u00FCge werden dazu in einer Baumstruktur dargestellt.\",\r\n \"intro\", 0, null);\r\n intro.addCodeLine(\"\", \"intro\", 0, null);\r\n intro.addCodeLine(\"Dabei werden folgende Annahmen getroffen:\", \"intro\", 0,\r\n null);\r\n intro\r\n .addCodeLine(\r\n \"- es handelt sich um ein Nullsummenspiel, das hei\\u00DFt positive Punkte des einen Spielers\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \" sind negative Punkte f\\u00FCr den anderen, sodass alle Punkte in der Summe 0 ergeben\",\r\n \"intro\", 0, null);\r\n intro.addCodeLine(\r\n \"- beide Parteien spielen optimal und machen keine Fehler\", \"intro\", 0,\r\n null);\r\n intro\r\n .addCodeLine(\r\n \"- das Spiel ist deterministisch, also nicht von W\\u00FCrfelgl\\u00FCck o.\\u00E4. abh\\u00E4ngig\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"- es gibt keine verborgenen Informationen wie beispielsweise beim Kartenspiel\",\r\n \"intro\", 0, null);\r\n intro.addCodeLine(\"\", \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Negascout funktioniert so \\u00E4hnlich wie der Alpha-Beta-Algorithmus:\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Jeder Knoten wird mit einer unteren und einer oberen Grenze untersucht, die den zu diesem\",\r\n \"intro\", 0, null);\r\n intro.addCodeLine(\r\n \"Zeitpunkt m\\u00F6glichen maximalen und minimalen Gewinn angibt.\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Durch diese Begrenzung k\\u00F6nnen bestimmte Teilb\\u00E4ume abgeschnitten (gepruned) werden, da sie f\\u00FCr \",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"das Endergebnis irrelevant sind (z.B. Z\\u00FCge, die dem Gegner zu viele Punkte bringen w\\u00FCrden).\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Die Vorsilbe 'Nega-' im Namen des Algorithmus weist darauf hin, dass das Punktefenster f\\u00FCr den\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"n\\u00E4chsten (vom jeweils anderen Spieler ausgef\\u00FChrten) Spielzug negiert wird.\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Eine Besonderheit von Negascout ist, dass der Algorithmus davon ausgeht, dass der erste\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"betrachtete Zug der beste ist. Weitere m\\u00F6gliche Z\\u00FCge werden anschlie\\u00DFend mit einem \",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"Nullwindow (obere und untere Grenze liegen nur um 1 auseinander) untersucht, um zu beweisen,\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"dass sie tats\\u00E4chlich schlechter sind. Ist das nicht der Fall, tritt ein sogenanntes Fail High auf,\",\r\n \"intro\", 0, null);\r\n intro\r\n .addCodeLine(\r\n \"das hei\\u00DFt der betrachtete Zug ist besser als erwartet. Dann muss dieser Knoten erneut mit dem \",\r\n \"intro\", 0, null);\r\n intro.addCodeLine(\"vollst\\u00E4ndigen Wertefenster untersucht werden.\",\r\n \"intro\", 0, null);\r\n lang.nextStep(\"Intro\");\r\n intro.hide();\r\n\r\n // Zeigt den Code an\r\n code = lang.newSourceCode(new Coordinates(30, 60), \"code\", null,\r\n sourceCodeProperties);\r\n code.addCodeLine(\"int negascout (node n, int alpha, int beta){\", \"code\", 0,\r\n null); // 0\r\n code.addCodeLine(\" if (node is a leaf)\", \"code\", 0, null); // 1\r\n code.addCodeLine(\" return valueOf(node);\", \"code\", 0, null); // 2\r\n code.addCodeLine(\" int a=alpha;\", \"code\", 0, null); // 3\r\n code.addCodeLine(\" int b=beta;\", \"code\", 0, null); // 4\r\n code.addCodeLine(\" for each child of node{\", \"code\", 0, null); // 5\r\n code.addCodeLine(\" int score = -negascout (child, -b, -a);\",\r\n \"code\", 0, null); // 6\r\n code.addCodeLine(\r\n \" if (a < score < beta and child is not first child)\",\r\n \"code\", 0, null); // 7\r\n code.addCodeLine(\r\n \" score = -negascout (child, -beta, -score);\", \"code\",\r\n 0, null); // 8\r\n code.addCodeLine(\" a=max(a, score);\", \"code\", 0, null); // 9\r\n code.addCodeLine(\" if(a >= beta)\", \"code\", 0, null); // 10\r\n code.addCodeLine(\" return a;\", \"code\", 0, null); // 11\r\n code.addCodeLine(\" b = a+1;\", \"code\", 0, null); // 12\r\n code.addCodeLine(\" }\", \"code\", 0, null); // 13\r\n code.addCodeLine(\" return a;\", \"code\", 0, null); // 14\r\n code.addCodeLine(\"}\", \"code\", 0, null); // 15\r\n // Erklaert die aktuelle Codezeile\r\n\r\n explain = lang.newText(new Offset(0, 30, \"code\", \"SW\"), \"\", \"explain\",\r\n null, descriptionProperties);\r\n tSeen = lang.newText(new Offset(0, 90, \"code\", \"SW\"), \"\", \"tSeen\", null,\r\n counterTextProperties);\r\n tSeen.setText(\"betrachtete Knoten: 0\", null, null);\r\n tPruned = lang.newText(new Offset(0, 130, \"code\", \"SW\"), \"\", \"tPruned\",\r\n null, counterTextProperties);\r\n tPruned.setText(\"geprunte Knoten: 0\", null, null);\r\n tFailed = lang.newText(new Offset(0, 110, \"code\", \"SW\"), \"\", \"tFailed\",\r\n null, counterTextProperties);\r\n tFailed.setText(\"erneut untersuchte Knoten: 0\", null, null);\r\n pMap.put(\"explain\", explain);\r\n pMap.put(\"tSeen\", tSeen);\r\n pMap.put(\"tPruned\", tPruned);\r\n pMap.put(\"tFailed\", tFailed);\r\n\r\n rSeen = lang.newRect(new Offset(barLeft, -5, \"tSeen\", \"NE\"), new Offset(\r\n barLeft, 10, \"tSeen\", \"NE\"), \"rSeen0\", null, counterBarProperties);\r\n pMap.put(\"rSeen0\", rSeen);\r\n rPruned = lang.newRect(new Offset(barLeft, -5, \"tPruned\", \"NE\"),\r\n new Offset(barLeft, 10, \"tPruned\", \"NE\"), \"rPruned0\", null,\r\n counterBarProperties);\r\n pMap.put(\"rPruned0\", rPruned);\r\n rFailed = lang.newRect(new Offset(barLeft, -5, \"tFailed\", \"NE\"),\r\n new Offset(barLeft, 10, \"tFailed\", \"NE\"), \"rFailed0\", null,\r\n counterBarProperties);\r\n pMap.put(\"rFailed0\", rFailed);\r\n\r\n // Parst den Eingabebaum und zeichnet ihn\r\n Parser p = new Parser();\r\n root = p.parseText(treeText);\r\n showTree(root);\r\n nodesTotal = countNodes(root);\r\n }", "@FXML\n final void btnOnlineClick() {\n new Thread(() -> sceneHandler.setActiveScene(GameScene.MULTI_INTRO)).start();\n }", "protected void displayInitialScene() {\n stageManager.switchScene(FxmlView.SPLASH, StageStyle.UNDECORATED);\n }", "@Override\r\n public void start(Stage primaryStage) throws Exception{\n primaryStage.setTitle(\"Color switch\");\r\n Gameplay obj1 = new Gameplay();\r\n obj1.mainmenu(primaryStage);\r\n// pane.getChildren().add(new Polygon(10,20,30,10,20,30));\r\n\r\n }", "public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "@Override\r\n\tpublic void createScene() {\n\t\tthis.setBackground(new Background(255, 255, 255));\r\n\t\tsLogo = new Sprite(BaseActivity.WIDTH / 2, BaseActivity.HEIGHT / 2, logoRegion.getWidth() * 1.23f, logoRegion.getHeight() * 1.23f, logoRegion, engine.getVertexBufferObjectManager());\r\n\t\tthis.attachChild(sLogo);\r\n\t\tSystem.out.println(\"stufff\");\r\n\t\t\r\n\t\tengine.registerUpdateHandler(new TimerHandler(0.2f, new ITimerCallback() \r\n\t {\r\n\t public void onTimePassed(final TimerHandler pTimerHandler) \r\n\t {\r\n\t System.out.println(\"stuff1\");\r\n\t engine.unregisterUpdateHandler(pTimerHandler);\r\n\t PlayScene play = new PlayScene(engine, activity, camera);\r\n\t play.createScene();\r\n\t engine.setScene(play);\r\n\t Resources.getInstance().music.setLooping(true);\r\n\t \t\tResources.getInstance().music.play();\r\n\t play.start();\r\n\t }\r\n\t }));\r\n\t}", "void createScene(){\n\t\tmainScene = new Scene(mainPane);\r\n\t\t\r\n\t\t//If keyEvent is not focussed on a node on the scene, you can attach\r\n\t\t//a keyEvent to a scene to be consumed by the screen itself.\r\n\t\tCloser closer = new Closer();\r\n\t\tmainScene.setOnKeyPressed(closer);\r\n\t}", "public void setHomeScene(Scene scene) {\r\n scene1 = scene;\r\n }", "@Override\n\tpublic void onShow(Scene previousScene) {\n\t}", "private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }", "public void mainMenu() {\n Game.stage.setScene(mainMenuScene);\n Game.stage.show();\n }", "@Override\r\n\tpublic void start(Stage stage) {\n\r\n scenes.put(SceneName.MAIN, new MainView(stage).getScene());\r\n scenes.put(SceneName.SCENE1, new ViewOne(stage).getScene());\r\n/*\t\tscenes.put(SceneName.SCENE2, new ViewTwo(stage).getScene());\r\n\t\tscenes.put(SceneName.SCENE3, new ViewThree(stage).getScene());\r\n*/\r\n\r\n\t\t// Start with the main scene\r\n\t\tstage.setScene(scenes.get(SceneName.MAIN));\r\n\t\tstage.setTitle(\"Multi-Scene Demo\");\r\n\t\tstage.show();\r\n\t}", "public Scene scene() {\n AnchorPane anchorPane = new AnchorPane();\n\n Pane track = raceTrack.trackpainting();\n\n AnchorPane.setTopAnchor(track, 40.0);\n AnchorPane.setLeftAnchor(track, 40.0);\n\n determineStartingLocation(carOne, carTwo, carThree);\n\n carPosition(carOne);\n carPosition(carTwo);\n carPosition(carThree);\n\n AnchorPane.setTopAnchor(btnStartRace, 480.0);\n AnchorPane.setLeftAnchor(btnStartRace, 740.0);\n\n AnchorPane.setTopAnchor(btnEndRace, 480.0);\n AnchorPane.setLeftAnchor(btnEndRace, 730.0);\n\n AnchorPane.setTopAnchor(txtWarning, 600.0);\n AnchorPane.setLeftAnchor(txtWarning, 610.0);\n\n anchorPane.setBackground(\n new Background(new BackgroundFill(Color.rgb(0, 132, 0),\n CornerRadii.EMPTY, Insets.EMPTY)));\n\n anchorPane.getChildren().addAll(track, carOne, carTwo, carThree, btnStartRace, btnEndRace, txtWarning);\n\n Scene scene = new Scene(anchorPane, 1580, 1030);\n return scene;\n }", "@Override\n\tpublic void createScene()\n\t\n\t{\n\t loading = new Sprite (0,0,resourceManager.loadingRegion,vbo); // тупо ставим спрайт с картинкой\n\t\tattachChild(loading);\n\t}", "@Override\n\tpublic void onLoadScene(OnLoadSceneCallBack pOnLoadSceneCallBack) {\n\t\t//this.setOnAreaTouchListener(this);\n\t\tsuper.onLoadScene(pOnLoadSceneCallBack);\n\t\t\n\t\tVertexBufferObjectManager vertexBufferObjectManager = ResourceManager.getInstance().getBaseGameActivity().getVertexBufferObjectManager();\n\t\tTexturePackTextureRegionLibrary menuTexturePackTextureRegionLibrary = ResourceManager.getInstance().getMenuSpriteSheetTexturePackTextureRegionLibrary();\n\t\t\n\t\t// Panel\n\t\tthis.mPanel = new Rectangle((Constants.CAMERA_WIDTH - Constants.MENU_RESULT_WIDTH) * 0.5f, 0, \n\t\t\t\tConstants.MENU_RESULT_WIDTH, Constants.CAMERA_HEIGHT, vertexBufferObjectManager);\n\t\tthis.mPanel.setColor(Color.BLACK);\n\t\t\n\t\t// Level Cleared Text\n\t\tthis.mLevelClearedText = new Text(this.mPanel.getWidth() * 0.5f, Constants.MENU_RESULT_MARGIN_TOP, \n\t\t\t\tResourceManager.getInstance().getAngrybirdFont48(), \"LEVEL CLEARED!\", \n\t\t\t\tnew TextOptions(HorizontalAlign.CENTER),\n\t\t\t\tvertexBufferObjectManager);\n\t\tthis.mLevelClearedText.setX((this.mPanel.getWidth() - this.mLevelClearedText.getWidth()) * 0.5f);\n\t\t\n\t\t// ScoreText\n\t\tthis.mScoreText = new Text(this.mPanel.getWidth() * 0.5f, this.mPanel.getHeight() * 0.6f, \n\t\t\t\tResourceManager.getInstance().getAngrybirdFont48(), \"0\", \n\t\t\t\t9,\n\t\t\t\tvertexBufferObjectManager);\n\t\tthis.mScoreText.setX((this.mPanel.getWidth() - this.mScoreText.getWidth()) * 0.5f);\n\t\t\n\n\t\t// Stars\n\t\tITiledTextureRegion centerStarTextureRegion = menuTexturePackTextureRegionLibrary.get(MenuConstants.CENTER_STAR_ID, 2, 1);\n\t\tthis.mCenterStarMenu = new TiledSprite((this.mPanel.getWidth() - centerStarTextureRegion.getWidth()) * 0.5f, \n\t\t\t\tthis.mLevelClearedText.getY() + this.mLevelClearedText.getHeight() + Constants.MENU_RESULT_LINE_HEIGHT, \n\t\t\t\tcenterStarTextureRegion, vertexBufferObjectManager);\n\t\tthis.mCenterStarMenu.setCurrentTileIndex(1);\n\t\t\n\t\tITiledTextureRegion leftStarTextureRegion = menuTexturePackTextureRegionLibrary.get(MenuConstants.LEFT_STAR_ID, 2, 1);\n\t\tthis.mLeftStarMenu = new TiledSprite(this.mCenterStarMenu.getX() - Constants.MENU_RESULT_ELEMENT_MARGIN - leftStarTextureRegion.getWidth(), \n\t\t\t\tthis.mCenterStarMenu.getY(),\n\t\t\t\tleftStarTextureRegion, vertexBufferObjectManager);\n\t\tthis.mLeftStarMenu.setCurrentTileIndex(1);\n\t\t\n\t\tITiledTextureRegion rightStarTextureRegion = menuTexturePackTextureRegionLibrary.get(MenuConstants.RIGHT_STAR_ID, 2, 1);\n\t\tthis.mRighStarMenu = new TiledSprite(this.mCenterStarMenu.getX() + this.mCenterStarMenu.getWidth() + Constants.MENU_RESULT_ELEMENT_MARGIN, \n\t\t\t\tthis.mCenterStarMenu.getY(), \n\t\t\t\trightStarTextureRegion, vertexBufferObjectManager);\n\t\t\n\t\t// Buttons\n\t\tTextureRegion replayButtonTextureRegion = ResourceManager.getInstance().getButtonSpriteSheetTexturePackTextureRegionLibrary().get(ButtonConstants.BUTTON_REPLAY_ID);\n\t\tSprite replayButtonSprite = new Sprite((this.mPanel.getWidth() - replayButtonTextureRegion.getWidth()) * 0.5f, \n\t\t\t\tConstants.CAMERA_HEIGHT - Constants.MENU_RESULT_MARGIN_BOTTOM - replayButtonTextureRegion.getHeight(), \n\t\t\t\treplayButtonTextureRegion, vertexBufferObjectManager);\n\t\tthis.mRePlayButton = new BaseButton<Sprite>(replayButtonSprite.getX(), replayButtonSprite.getY(), 1.0f, replayButtonSprite) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onButtonClick() {\n\t\t\t\thideScene();\n\t\t\t\tGameLevelManager.getInstance().replayCurrentGameLevel();\n\t\t\t}\n\t\t};\n\t\t\n\t\tTextureRegion menuButtonTextureRegion = ResourceManager.getInstance().getButtonSpriteSheetTexturePackTextureRegionLibrary().get(ButtonConstants.BUTTON_MENU_ID);\n\t\tSprite menuButtonSprite = new Sprite(this.mRePlayButton.getEntity().getX() - Constants.MENU_RESULT_ELEMENT_MARGIN - menuButtonTextureRegion.getWidth(), \n\t\t\t\tthis.mRePlayButton.getEntity().getY(), \n\t\t\t\tmenuButtonTextureRegion, vertexBufferObjectManager);\n\t\tthis.mMenuButton = new BaseButton<Sprite>(menuButtonSprite.getX(), menuButtonSprite.getY(), 1.0f, menuButtonSprite) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onButtonClick() {\n\t\t\t\thideScene();\n\t\t\t\tSceneManager.getInstance().showLevelSelectorScene();\n\t\t\t}\n\t\t};\n\t\t\n\t\tTextureRegion nextLevelButtonTextureRegion = ResourceManager.getInstance().getButtonSpriteSheetTexturePackTextureRegionLibrary().get(ButtonConstants.BUTTON_NEXT_LEVEL_ID);\n\t\tSprite nextLevelButtonSprite = new Sprite(this.mRePlayButton.getEntity().getX() + this.mRePlayButton.getEntity().getWidth() + Constants.MENU_RESULT_ELEMENT_MARGIN, \n\t\t\t\tthis.mRePlayButton.getEntity().getY(), \n\t\t\t\tnextLevelButtonTextureRegion, vertexBufferObjectManager);\n\t\tthis.mNextLevelButton = new BaseButton<Sprite>(nextLevelButtonSprite.getX(), nextLevelButtonSprite.getY(), 1.0f, nextLevelButtonSprite) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onButtonClick() {\n\t\t\t\thideScene();\n\t\t\t\tGameLevelManager.getInstance().showNextGameLevel();\n\t\t\t}\n\t\t};\n\t\t\n\t\tHUD hud = ResourceManager.getInstance().getHUD();\n\t\thud.setOnAreaTouchListener(this);\n\t\t\n\t\thud.registerTouchArea(this.mMenuButton.getEntity());\n\t\thud.registerTouchArea(this.mRePlayButton.getEntity());\n\t\thud.registerTouchArea(this.mNextLevelButton.getEntity());\n\t\t\n\t\tpOnLoadSceneCallBack.onLoadSceneFinish();\n\t}", "private void makeHeaderAndIntroTexts()\r\n\t{\r\n\t\t// Header\r\n\t\tTextProperties headerProps = new TextProperties();\r\n\t\theaderProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(Font.SANS_SERIF, Font.BOLD, 25));\r\n\t\theader = lang.newText(new Coordinates(20, 30), ALGORITHM_NAME, \"header\", null, headerProps);\r\n\t\t\r\n\t // Intro texts\r\n\t TextProperties introProperties = new TextProperties();\r\n\t introProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(Font.SANS_SERIF, Font.PLAIN, 20));\r\n\t \r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.WHITE);\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t @SuppressWarnings(\"unused\")\r\n\t\tRect hRect = lang.newRect(new Offset(-5, -5, \"header\", AnimalScript.DIRECTION_NW), new Offset(5, 5, \"header\", AnimalScript.DIRECTION_SE), \"hRect\", null, rectProps);\r\n\t \r\n\t String intro1Text = \"- Connects all points within linking length into one group\";\r\n\t String intro2Text = \"- Goes through 1-3 iterations. Each with a smaller linking length and a different color\";\r\n\t String intro3Text = \"- To aid understanding, the linking length will be visualized with a circle around the current point\";\r\n\t String searchText = useKDTreeToSearch ? \"KDTree for Nearest Neighbour Search [O(2N^0.5) in 2D per search]\" : \"Linear Search for Nearest Neighbour Search [O(2N) in 2D per search]\";\r\n\t String using = \"Using:\";\r\n\t \r\n\t intro1 = lang.newText(new Offset(0, 10, \"header\", AnimalScript.DIRECTION_SW), intro1Text, \"intro1\", null, introProperties);\r\n\t intro2 = lang.newText(new Offset(0, 0, \"intro1\", AnimalScript.DIRECTION_SW), intro2Text, \"intro2\", null, introProperties);\r\n\t intro3 = lang.newText(new Offset(0, 0, \"intro2\", AnimalScript.DIRECTION_SW), intro3Text, \"intro3\", null, introProperties);\r\n\t \r\n\t usingIntro = lang.newText(new Offset(0, 30, \"intro3\", AnimalScript.DIRECTION_SW), using, \"usingIntro\", null, introProperties);\r\n\t intro4 = lang.newText(new Offset(10, 0, \"usingIntro\", AnimalScript.DIRECTION_SW), \"Linking length = \"+distance, \"intro4\", null, introProperties);\r\n\t intro5 = lang.newText(new Offset(0, 0, \"intro4\", AnimalScript.DIRECTION_SW), searchText, \"intro5\", null, introProperties);\r\n\t intro6 = lang.newText(new Offset(0, 0, \"intro5\", AnimalScript.DIRECTION_SW), \"Size: \"+width+\" x \"+height+\" with ~\"+amountOfStars+\" points\", \"intro6\", null, introProperties);\r\n\t intro7 = lang.newText(new Offset(0, 0, \"intro6\", AnimalScript.DIRECTION_SW), \"Showing \"+amountOfStepsShown+\" steps in first iteration, half of that afterwards\", \"intro7\", null, introProperties);\r\n\t intro8 = lang.newText(new Offset(0, 0, \"intro7\", AnimalScript.DIRECTION_SW), \"Iterations: \"+amountOfIterations, \"intro8\", null, introProperties);\r\n\t}", "public Scene getPrimaryScene() {\n VBox myBox = new VBox(15);\r\n myBox.setAlignment(Pos.CENTER);\r\n\r\n // Creating an Image object and something to hold the image (ImageViewer)\r\n // so we can view it later\r\n Image image = new Image(imageNames[0], 400, 400, true, true);\r\n ImageView imView = new ImageView(image);\r\n\r\n // Creating buttons\r\n Button myButton = new Button(\"Click to Change Memes\");\r\n Button sceneButton = new Button(\"Click to Leave\");\r\n\r\n // Setting what the change meme button will do when someone presses it\r\n myButton.setOnAction(e -> {\r\n Random rand = new Random();\r\n int randInt = rand.nextInt(imageNames.length);\r\n imView.setImage(new Image(imageNames[randInt], 400, 400, true, true));\r\n });\r\n // Alternative way to write above code using an anonymous inner class\r\n // myButton.setOnAction(new EventHandler<Event>() {\r\n // public void handle(Event e) {\r\n // Random rand = new Random();\r\n // int randInt = rand.nextInt(imageNames.length);\r\n // imView.setImage(new Image(imageNames[randInt], 400, 400, true, true));\r\n // }\r\n // })\r\n\r\n // Setting what the leave button will do\r\n sceneButton.setOnAction(e -> {\r\n Scene secondaryScene = getSecondaryScene();\r\n primaryStage.setScene(secondaryScene);\r\n primaryStage.show();\r\n });\r\n\r\n // Adding our ImageViewer and Buttons onto the VBox\r\n myBox.getChildren().addAll(imView, myButton, sceneButton);\r\n // Actually instantiating the scene with the VBox containing everything\r\n Scene primaryScene = new Scene(myBox, 450, 450);\r\n // Returning the scene\r\n return primaryScene;\r\n }", "public void setScene(Scene scene){\n this.scene = scene;\n }", "public void start(Mainwindow scene) {\n //绑定controller\n view = scene;\n\n //初始化Log文件和Logger\n File logFile = new File(logPath + System.currentTimeMillis() + \".log\");\n try {\n logFile.createNewFile();\n System.out.println(\"Game record is saved in \" + logFile.getAbsolutePath());\n }\n catch (IOException ioe) {\n System.err.println(\"Cannot create log file\");\n ioe.printStackTrace();\n }\n gameLogger.initialize(GameLogger.WRITE_LOG, logFile);\n\n //初始化葫芦娃\n CalabashBrother[] huluwa = {\n new CalabashBrother(this, background, 6),\n new CalabashBrother(this, background, 3),\n new CalabashBrother(this, background, 0),\n new CalabashBrother(this, background, 2),\n new CalabashBrother(this, background, 4),\n new CalabashBrother(this, background, 1),\n new CalabashBrother(this, background, 5),\n };\n SortController.sort(huluwa);\n for (int i = 0; i < huluwa.length; ++i) {\n huluwa[i].setCampId(Camp.GOOD);\n huluwa[i].setLife(120);\n huluwa[i].setAtk(30 + i);\n String iconPath = getClass().getResource(resourcesPath + Integer.toString(huluwa[i].getNum() + 1) + \".png\").toString();\n huluwa[i].setIcon(iconPath);\n }\n\n //初始化反派战斗人员\n Monster[] evils = {\n new Monster(this, background, \"蝎子精\"),\n new Monster(this, background, \"小喽啰1\"),\n new Monster(this, background, \"小喽啰2\"),\n new Monster(this, background, \"小喽啰3\"),\n new Monster(this, background, \"小喽啰4\"),\n new Monster(this, background, \"小喽啰5\"),\n new Monster(this, background, \"小喽啰6\"),\n };\n //单独设置蝎子精\n evils[0].setCampId(Camp.BAD);\n evils[0].setLife(150);\n evils[0].setAtk(40);\n evils[0].setIcon(getClass().getResource( resourcesPath + \"scorpion.png\").toString());\n //设置小喽啰\n for (int i = 1; i < evils.length; ++i) {\n evils[i].setCampId(Camp.BAD);\n evils[i].setLife(100);\n evils[i].setAtk(20);\n evils[i].setIcon(getClass().getResource(resourcesPath + \"monster.png\").toString());\n }\n\n //初始化爷爷:技能-加血\n Leader grandpa = Leader.getInstance(this, background, \"爷爷\");\n grandpa.setCampId(Camp.GOOD);\n grandpa.setLife(100);\n grandpa.setIcon(getClass().getResource( resourcesPath +\"grandpa.png\").toString());\n grandpa.setBuff(obj -> { obj.setLife(obj.getLife() + 20); });\n grandpa.setBuffSign(new Image(getClass().getResource(resourcesPath + \"lifeup.png\").toString()));\n\n //初始化蛇精:技能-加攻击力\n Leader snaker = Leader.getInstance(this, background, \"蛇精\");\n snaker.setCampId(Camp.BAD);\n snaker.setLife(120);\n snaker.setIcon(getClass().getResource(resourcesPath + \"snaker.png\").toString());\n snaker.setBuff(obj -> { obj.setAtk(obj.getAtk() + 20); });\n snaker.setBuffSign(new Image(getClass().getResource(resourcesPath + \"atkup.png\").toString()));\n\n numOfGood = huluwa.length + 1;\n numOfBad = evils.length + 1;\n\n initializeFormation(background, snaker, evils, grandpa, huluwa);\n updateView();\n\n //启动所有线程,开始战斗\n System.out.println(\"Game start!\");\n exec = Executors.newCachedThreadPool();\n exec.execute(grandpa);\n exec.execute(snaker);\n for (int i = 0; i < huluwa.length; ++i) {\n exec.execute(huluwa[i]);\n }\n for (int i = 0; i < evils.length; ++i) {\n exec.execute(evils[i]);\n }\n exec.shutdown();\n }", "public void goToMainScene() {\n\n scenesSeen.clear();\n this.window.setScene(firstScene.createAndReturnScene());\n scenesSeen.add(firstScene);\n }", "public Render(Scene scene1) {\n scene = scene1;\n }", "public void start(Stage s) {\n\t\ts.setTitle(\"SpaceY | Menu principal\");\n\t\ts.setScene(scene);\n\t\ts.setResizable(true);\n//\t\ts.setMaximized(true);\n\t\ts.getIcons().add(Sprite.LOGO.getImage());\n\t\ts.show();\n\t}", "@Override\n\tpublic Scene giveScene() {\n\t\tLabel SignIn=new Label(\"SIGN IN\");\n\t\tLabel UserName=new Label(\"Username\");\n\t\tLabel Password=new Label(\"Password\");\n\t\tTextField Username=new TextField();\n\t\tTextField PassWord=new TextField();\n\t\tButton SubmitButton=new Button(\"SUBMIT\");\n\t\tButton BackButton=new Button(\"BACK\");\n\t\tBackButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tmyGame.setPrimaryStage(myGame.GetLoginPageScene());\n\t\t\t}\n\t\t});\t\n\t\tSignIn.setId(\"SignInLabel\");\n\t\tUserName.setId(\"UserLabel\");\n\t\tPassword.setId(\"PasswordLabel\");\n\t\tUsername.setId(\"UserText\");\n\t\tPassWord.setId(\"PasswordText\");\n\t\tSubmitButton.setId(\"SubmitButton\");\n\t\tBackButton.setId(\"BackButton\");\n\t\tVBox SignInPageVb=new VBox(50,SignIn,UserName,Username,Password,PassWord,BackButton,SubmitButton);\n\t\tSignInPageVb.setTranslateY(100);\n\t\tSignInPageVb.setAlignment(Pos.TOP_CENTER);\n\t\tStackPane MainPageStackpane=new StackPane(SignInPageVb);\n\t\tMainPageStackpane.getStylesheets().add(getClass().getResource(\"SignInPage.css\").toString());\n\t\tmyScene= new Scene(MainPageStackpane,500,1000);\n\t\tmyScene.setFill(Color.BLACK);\n\t\tSubmitButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tPlayer newPLayer = myGame.getMyDataBase().login(Username.getText(), PassWord.getText());\n\t\t\t\t//System.out.println(newPLayer);\n\t\t\t\tif (newPLayer != null) {\n\t\t\t\t\tmyGame.setCurrentPlayer(newPLayer);\n\t\t\t\t\tmyGame.setPrimaryStage(myGame.GetMainPageScene());\n\t\t\t\t}else {\n\t\t\t\t\tif(NoPlayer==null) {\n\t\t\t\t\t\tNoPlayer=new Label(\"Invalid User/Password\");\n\t\t\t\t\t\tSignInPageVb.getChildren().add(NoPlayer);\n\t\t\t\t\t}//System.out.println(\"katta\");\n\t\t\t\t//myGame.setPrimaryStage(myGame.GetGamePlayScene());\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\n\t\treturn myScene;\n\t}", "public static Scene scene8() {\r\n\t\t// Define basic properties of the scene\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0),\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 1.5)\r\n\t\t\t\t.initName(\"scene8\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.81,0.93,1))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\t\t// Add Surfaces to the scene.\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-1,0.0), new Point(0.0, -1, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial().initKa(new Vec(0.2)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(0, 10, -25), 10);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(false)\r\n\t\t\t\t.initRefractionIndex(0).initReflectionIntensity(0.4).initKs(new Vec(1.0)).initKd(new Vec(0));\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tdouble[] radiuses = new double[] { 0.3, 0.8, 1, 1.5, 2, 1.4, 0.2, 0.9, 1.2, 2.1 };\r\n\r\n\t\tfor (int i = -10; i < 10; i+=3) {\r\n\t\t\tint sphereCenterZ = -5 + (int)(Math.random() * 3);\r\n\t\t\tint radiusIndex = (int)(Math.random() * 10);\r\n\t\t\tdouble radius = radiuses[radiusIndex];\r\n\t\t\tShape distantSphere1 = new Sphere(new Point(i, radiuses[radiusIndex] - 1, sphereCenterZ), radius);\r\n\t\t\tMaterial distantSphere1Mat = Material.getRandomMaterial();\r\n\t\t\tSurface distantSphere1Surface = new Surface(distantSphere1, distantSphere1Mat);\r\n\t\t\tfinalScene.addSurface(distantSphere1Surface);\r\n\t\t}\r\n\r\n\t\t// Add light sources:\r\n\t\tLight dirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\tdirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\treturn finalScene;\r\n\t}", "public void Scene() {\n Scene scene = new Scene(this.root);\n this.stage.setScene(scene);\n this.stage.show();\n }", "@Override\npublic void onResumeScene() {\n\t\n}", "public static Scene scene2() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene2\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initAmbient(new Vec(0.4))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game).\r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// Add lighting condition:\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.7));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "Scenes() {\n\n // Determines the length of the image arrays\n slideAmount = new int[sceneAmount];\n slideAmount[0] = 3;\n slideAmount[1] = 4;\n slideAmount[2] = 3;\n slideAmount[3] = 6;\n\n\n texts = new PImage[sceneAmount];\n SlideScene0 = new PImage[slideAmount[0]];\n SlideScene1 = new PImage[slideAmount[1]];\n SlideScene2 = new PImage[slideAmount[2]];\n SlideScene3 = new PImage[slideAmount[3]];\n\n //SlideScene4 = new PImage[slideAmount[4]];\n\n // Loads the border image\n border = loadImage(\"slideShow/border.png\");\n videoBackground = loadImage(\"slideShow/scene4/Background.PNG\");\n\n // Load in the text as images into the array\n for (int i = 0; i < sceneAmount; i++) {\n texts[i] = loadImage(\"text/text\" + i + \".png\");\n }\n\n // load the slideshow images into the array\n for (int d = 0; d < sceneAmount; d++) {\n for (int i = 0; i < slideAmount[d]; i++) {\n switch(d) {\n case 0:\n SlideScene0[i] = loadImage(\"slideShow/scene0/slide\" + i + \".png\");\n break;\n case 1:\n SlideScene1[i] = loadImage(\"slideShow/scene1/slide\" + i + \".png\");\n break;\n case 2:\n SlideScene2[i] = loadImage(\"slideShow/scene2/slide\" + i + \".png\");\n break;\n case 3:\n SlideScene3[i] = loadImage(\"slideShow/scene3/slide\" + i + \".png\");\n break;\n }\n }\n }\n }", "public static Scene scene4() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene4\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t\r\n\t\t// (2) Add two domes to make it look like we split a sphere in half. \r\n\t\tShape domeShape = new Dome(new Point(2.0, 0.0, -10.0), 5.0, new Vec(1.0, 0.0, 0.0));\r\n\t\tMaterial domeMat = Material.getRandomMaterial();\r\n\t\tSurface domeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\tdomeShape = new Dome(new Point(-2.0, 0.0, -10.0), 5.0, new Vec(-1.0, 0.0, 0.0));\r\n\t\tdomeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 75.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 6.0, -10.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(.5,0.5,0.5));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "@Override\r\n\tpublic void start(Stage prime) throws Exception {\n\t\t\r\n\t\tVBox v= new VBox(40);\r\n\t\t\r\n\t\tLabel welcome= new Label(\"Welcome to Tetris!\");\r\n\t\tLabel goal= new Label(\"The goal of Tetris is to fit falling shapes into a single line without any spaces. \"\r\n\t\t\t\t+ \"\\n When a solid line is created, the line is removed and players score points. \"\r\n\t\t\t\t+ \"\\n As the game goes on, the shapes fall faster and faster and if the shapes stack \\n up to the top of the screen, the game is over.\");\r\n\t\tLabel insHead= new Label(\"Instruction: \");\r\n\t\t\r\n\t\tLabel ins= new Label(\"1. Use directional keys to move the blocks. \\n\\n\"\r\n\t\t\t\t\t\t\t+\"2. Make lines one by one as you progress through the game. \\n\\n\" \r\n\t\t\t\t\t\t\t+\"3. Don't let the lines reach up at the top. \\n\\n\"\r\n\t\t\t\t\t\t\t+\"4. Your score will increase with each block. \\n\\n\"\r\n\t\t\t\t\t\t\t+\"5. Press the *esc* key to return to the menu screen. \\n\\n\"\r\n\t\t\t\t\t\t\t+\"6. Enjoy the game and don't forget to give us full marks!\");\r\n\t\t\r\n\t\tButton back= new Button(\"Back to Title Screen\");\r\n\t\tback.getStyleClass().add(\"back\");\r\n\t\t///set action here\r\n\t\tback.setOnAction(e->{\r\n\t\t\tprime.hide();\r\n\t\t\tTitleScreen title=new TitleScreen();\r\n\t\t\tStage stg= new Stage();\r\n\t\t\ttry {\r\n\t\t\t\ttitle.start(stg);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tv.setAlignment(Pos.CENTER);\r\n\t\twelcome.getStyleClass().add(\"welcome\");\r\n\t\tgoal.getStyleClass().add(\"welcome\");\r\n\t\tinsHead.getStyleClass().add(\"welcome\");\r\n\t\tins.getStyleClass().add(\"welcome\");\r\n\t\tv.getChildren().addAll(welcome, goal, insHead, ins,back);\r\n\t\tv.getStyleClass().add(\"vbox\");\r\n\t\tv.getStylesheets().add(\"design.css\");\r\n\t\t\r\n\t\tScene scene= new Scene(v,700,700);\r\n\t\tprime.setTitle(\"Instructions\");\r\n\t\tprime.setScene(scene);\r\n\t\tprime.show();\r\n\t}", "public void finishScene() {\n\t\t//Nothing to do\n\t}", "public void buildInitialScene() {\n\t\t\n\t\t//Creation image background\n\t\tfinal String BACKGROUND_PATH = \"src/assets/img/temp_background.png\";\n\t\tthis.background = new GameImage(BACKGROUND_PATH);\n\n\t\t//Creation image Game Over\n\t\tfinal String GAME_OVER_PATH = \"src/assets/img/erro.png\";\n\t\tthis.errorScene = new Sprite(GAME_OVER_PATH);\n\n\t\t//Game over sprite center position\n\t\tthis.errorScene.x = spos.calculatePosition(WindowConstants.WIDTH, 2, this.errorScene, 2);\n\t\tthis.errorScene.y = spos.calculatePosition(WindowConstants.HEIGHT, 2, this.errorScene, 2);\n\t}", "public static Scene scene7() {\r\n\t\tPoint cameraPosition = new Point(-3.0, 1.0, 6.0);\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */cameraPosition,\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene7\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.01,0.19,0.22))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-4.3,0.0), new Point(0.0, -4.3, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial()\r\n\t\t\t\t.initKa(new Vec(0.11,0.09,0.02)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(1.5, 0, -3.5), 4);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(true)\r\n\t\t\t\t.initRefractionIntensity(0.8).initRefractionIndex(1.35).initReflectionIntensity(0.4);\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tPoint sunPosition = new Point(0, 3, -45);\r\n\t\tShape sunDome = new Dome(sunPosition, 8, new Vec(0, 1, 0));\r\n\t\tMaterial sunDomeMat = Material.getMetalMaterial().initKa(new Vec(0.95,0.84,0.03));\r\n\t\tSurface sunDomeSurface = new Surface(sunDome, sunDomeMat);\r\n\t\tfinalScene.addSurface(sunDomeSurface);\r\n\r\n\t\tVec sunDirection = cameraPosition.sub(sunPosition);\r\n\t\tLight sunLight = new DirectionalLight(sunDirection, new Vec(0.95,0.84,0.03));\r\n\t\tfinalScene.addLightSource(sunLight);\r\n\r\n\t\treturn finalScene;\r\n\t}", "public void setupScene() {\n\t\tplayScene = new Scene(new Group());\n\t\tupdateScene(playScene);\n\t\twindow.setScene(playScene);\n\t\twindow.show();\n\t}", "@Override\r\n\tpublic void onPopulateScene(Scene pScene,\r\n\t\t\tOnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {\r\n\t\t\r\n\t\t// We will create a timer-handler to handle the duration\r\n\t\t// in which the splash screen is shown\r\n\t\tmEngine.registerUpdateHandler(new TimerHandler(4, new ITimerCallback(){\r\n\t\t\r\n\t\t// Override ITimerCallback's 'onTimePassed' method to allow\r\n\t\t// us to control what happens after the timer duration ends\r\n\t\t@Override\r\n\t\tpublic void onTimePassed(TimerHandler pTimerHandler) {\r\n\t\t\t// When 4 seconds is up, switch to our menu scene\r\n\t\t\tmEngine.setScene(mMenuScene);\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tpOnPopulateSceneCallback.onPopulateSceneFinished();\t\r\n\t}", "public void switchScene(javafx.event.ActionEvent event) throws IOException {\n //clicking this button will go to main menu with all the command for the application.\n setscence(event,\"Main Menu.fxml\");\n\n\n }", "void title_screen_setup() {\n // Logo setup\n title_image_view = new ImageView(logo_image);\n title_image_view.setX(scene_width/2.0 - Dimensions.TITLE_WIDTH/2.0);\n title_image_view.setY(Dimensions.TITLE_Y_PADDING);\n title_screen_pane.getChildren().add(title_image_view);\n\n // Text setup\n instructions_text = new Text(\"Instructions\");\n instructions_text.setFont(Font.font (\"Verdana\", FontWeight.BOLD, 40));\n instructions_text.setTranslateX(scene_width/2.0 - instructions_text.getLayoutBounds().getWidth()/2);\n instructions_text.setTranslateY(title_image_view.getTranslateY() + 2 * Dimensions.TITLE_HEIGHT);\n title_screen_pane.getChildren().add(instructions_text);\n\n controls_text = new Text(\"ENTER - Start Game\\n\" +\n \"A or ◄, D or ► - Move ship left or right\\n\" +\n \"SPACE - Fire!\\n\" +\n \"Q - Quit Game\\n\" +\n \"1 or 2 or 3 - Start Game at a specific level\");\n controls_text.setTextAlignment(TextAlignment.CENTER);\n controls_text.setFont(Font.font (\"Arial\", 25));\n controls_text.setTranslateX(scene_width/2.0 - controls_text.getLayoutBounds().getWidth()/2);\n controls_text.setTranslateY(instructions_text.getTranslateY() + controls_text.getLayoutBounds().getHeight()/2);\n title_screen_pane.getChildren().add(controls_text);\n\n assignment_text = new Text(\"Implemented by Wendy Xu (20631406) for CS 349, University of Waterloo, W20\");\n assignment_text.setFont(Font.font (\"Arial\", 13));\n assignment_text.setTranslateX(scene_width/2.0 - assignment_text.getLayoutBounds().getWidth()/2);\n assignment_text.setTranslateY(scene_height- assignment_text.getLayoutBounds().getHeight());\n title_screen_pane.getChildren().add(assignment_text);\n }", "public void play() {\n\n showIntro();\n startGame();\n\n }", "public default void enter(Scene from) {\n }", "@Override\n\tpublic void showContents() {\n\t\tt1.start();\n\t\tif (menuAnimation.title_showing())\n\t\t{\n\t\t\tprogram.add(Play);\n\t\t\tprogram.add(Settings);\n\t\t\tprogram.add(Credits);\n\t\t\tprogram.add(Exit);\n\t\t\tprogram.add(barrel);\n\t\t\tprogram.add(tank);\n\t\t\ttitle.setLocation(30,80);\n\t\t\ttitle.changeTransparent(1);\n\t\t\tprogram.add(title);\n\t\t\tbackground.setImage(\"otherImages/background.png\");\n\t\t\tbackground.setSize(900,620);\n\t\t\tbackground.setLocation(-50,0);\n\t\t\tbg.start();\n\t\t\tbackground.sendToBack();\n\t\t\tprogram.add(background);\n\t\t}\n\t}", "@FXML\r\n public void goToTutorial(ActionEvent event) {\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\tParent root = FXMLLoader.load(getClass().getResource(\"../view/resources/Tutorial.fxml\"));\r\n \t\tScene scene = new Scene(root);\r\n \t\tMain.setScene(scene);\r\n\t\t}catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "@Override\n public void start(Stage stage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"Lesson3.fxml\"));\n \n \n // Create Scene with background Color\n Scene scene = new Scene(root, 700, 350, Color.LIGHTYELLOW);\n \n // set scene on stage with title\n stage.setTitle(\"Lesson 3 FXML\");\n stage.setScene(scene);\n stage.show();\n }", "@Override\n protected Scene onCreateScene() {\n this.getWindowManager().getDefaultDisplay().getMetrics(metrics);\n this.mEngine.registerUpdateHandler(new FPSLogger());\n inventoryEntity.attachChild(new Rectangle(0,0,125,780,new VertexBufferObjectManager()));\n viennaPracticeScene.attachChild(inventoryEntity);\n\n final Entity doorEntity = new Entity(50,270,100,100);\n Rectangle r = new Rectangle(0,0,120,300,new VertexBufferObjectManager());\n r.setSkewY(-20);\n r.setColor(Color.BLACK);\n doorEntity.attachChild(r);\n viennaPracticeScene.attachChild(doorEntity);\n\n final Entity beethovenEntity = new Entity(CAMERA_WIDTH/2,CAMERA_HEIGHT/2);\n beethovenEntity.attachChild(beethovenSprite);\n viennaPracticeScene.attachChild(beethovenEntity);\n\n final Text beethovenSpeech = new Text(0, 70, this.font, \"...Alas!\\nI, the great Beethoven, have broken my strings!\", this.getVertexBufferObjectManager());\n beethovenSpeech.setWidth(850);\n beethovenSpeech.setAutoWrap(AutoWrap.NONE);\n beethovenSpeech.setHorizontalAlign(HorizontalAlign.CENTER);\n\n guitarStringSprite.setColor(Color.WHITE);\n guitarStringSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n toggleColor();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n }\n });\n viennaPracticeScene.registerTouchArea(guitarStringSprite);\n\n beethovenSprite.setOnClickListener(new ButtonSprite.OnClickListener() {\n @Override\n public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {\n beethovenEntity.attachChild(beethovenSpeech);\n Timer timer = new Timer();\n Long delayTime = (long) (30 * 100);\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n beethovenEntity.detachChild(beethovenSpeech);\n }\n }, delayTime);\n }\n });\n viennaPracticeScene.registerTouchArea(beethovenSprite);\n\n viennaPracticeScene.setOnSceneTouchListener(new IOnSceneTouchListener() {\n @Override\n public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {\n float xCoordinate = pSceneTouchEvent.getX();\n float yCoordinate = pSceneTouchEvent.getY();\n if (pSceneTouchEvent.isActionDown() && pSceneTouchEvent.getX() < 70) {\n Intent startIntent = new Intent(ViennaPracticeActivity.this.getApplication(), ViennaStreetActivity.class);\n startIntent.putExtra(\"game\", game);\n ViennaPracticeActivity.this.startActivity(startIntent);\n ViennaPracticeActivity.this.finish();\n ViennaPracticeActivity.this.game.switchToScene(jlstanford.bsu.edu.game.Scene.VIENNA_STREET);\n } else if (pSceneTouchEvent.isActionDown() && ((xCoordinate < 335 && xCoordinate > 263) && (yCoordinate < 284 && yCoordinate > 124))) {\n player = ViennaPracticeActivity.this.game.getPlayer();\n ViennaPracticeActivity.this.game.handleItemClick(new GuitarStrings(player));\n ViennaPracticeActivity.this.toastOnUiThread(\"Got Guitar Strings!\");\n loadInventoryItems();\n } else {\n }\n return false;\n }\n });\n\n loadInventoryItems();\n final Sprite spriteBG = new Sprite(405,240,CAMERA_WIDTH,CAMERA_HEIGHT,this.backgroundTiledTextureRegion,this.getVertexBufferObjectManager());\n SpriteBackground bg = new SpriteBackground(spriteBG);\n viennaPracticeScene.setBackground(bg);\n\n return viennaPracticeScene;\n }", "@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\tButton back = new Button(\"back\");\n\t\tback.setLayoutX(10);\n\t\tback.setLayoutY(820);\n\t\tEventHandler<MouseEvent> backEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText startText = new Text(\"startscreen\");\n\t\t\t\tstartText.setX(400);\n\t\t\t\tstartText.setY(400);\n\t\t\t\tGroup startgroup = new Group(startText);\n\t\t\t\tScene startscreen = new Scene(startgroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(startscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\tback.addEventFilter(MouseEvent.MOUSE_CLICKED, backEvent);\n\t\t\n\t\t/**\n\t\t * creating the button to go to the helppage\n\t\t */\n\t\tButton help = new Button(\"help\");\n\t\thelp.setLayoutX(10);\n\t\thelp.setLayoutY(780);\n\t\tEventHandler<MouseEvent> helpEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText startText = new Text(\"helpscreen\");\n\t\t\t\tstartText.setX(400);\n\t\t\t\tstartText.setY(400);\n\t\t\t\tGroup startgroup = new Group(startText);\n\t\t\t\tScene startscreen = new Scene(startgroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(startscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\thelp.addEventFilter(MouseEvent.MOUSE_CLICKED, helpEvent);\n\n\t\t/**\n\t\t * creating the textbox that shows the information about a person when the person is selected\n\t\t */\n\t\tint y = 100;\n\t\tint ydiff = 30;\n\t\t\n\t\t//the actual box\n\t\tRectangle textbox = new Rectangle(200, ydiff*9, Color.PALEGREEN);\n\t\ttextbox.setX(15);\n\t\ttextbox.setY(y-ydiff);\n\t\ttextbox.setStrokeWidth(5);\n\t\ttextbox.setStroke(Color.BLACK);\n\t\t\n\t\t//the 'firstname' text that is always displayed\n\t\tint xLabels = 20;\n\t\tText firstname = new Text(\"Firstname: \" );\n\t\tfirstname.setX(xLabels);\n\t\tfirstname.setY(y);\n\t\tfirstname.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the 'lastname' text that is always displayed\n\t\tText lastname = new Text(\"Lastname: \" );\n\t\tlastname.setX(xLabels);\n\t\tlastname.setY(y+ydiff);\n\t\tlastname.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the 'gender' text that is always displayed\n\t\tText gender = new Text(\"Gender: \" );\n\t\tgender.setX(xLabels);\n\t\tgender.setY(y+ydiff*2);\n\t\tgender.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the birth date text that is always displayed\n\t\tText birthdate = new Text(\"Born on: \" );\n\t\tbirthdate.setX(xLabels);\n\t\tbirthdate.setY(y+ydiff*3);\n\t\tbirthdate.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the birth place text that is always displayed\n\t\tText birthplace = new Text(\"Born in: \");\n\t\tbirthplace.setX(xLabels);\n\t\tbirthplace.setY(y+ydiff*4);\n\t\tbirthplace.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the death date text that is always displayed\n\t\tText deathdate = new Text(\"Died on: \");\n\t\tdeathdate.setX(xLabels);\n\t\tdeathdate.setY(y+ydiff*5);\n\t\tdeathdate.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the death place text that is always displayed\n\t\tText deathplace = new Text(\"Died in: \");\n\t\tdeathplace.setX(xLabels);\n\t\tdeathplace.setY(y+ydiff*6);\n\t\tdeathplace.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t//the 'biography' text that is always displayed\n\t\tText bio = new Text(\"Biography: \");\n\t\tbio.setX(xLabels);\n\t\tbio.setY(y+ydiff*7);\n\t\tbio.setFont(Font.font(\"System Regular\", FontWeight.BOLD, 11));\n\t\t\n\t\t\n\t\t/**\n\t\t * creating the fields where the attributes of a person will be displayed\n\t\t */\n\t\tint xDisplayText = 100;\n\t\t\n\t\t// firstname\n\t\tText firstnameText = new Text(\"\");\n\t\tfirstnameText.setX(xDisplayText);\n\t\tfirstnameText.setY(y);\n\t\t\n\t\t//lastname\n\t\tText lastnameText = new Text(\"\");\n\t\tlastnameText.setX(xDisplayText);\n\t\tlastnameText.setY(y+ydiff);\n\t\t\n\t\t//gender\n\t\tText genderText = new Text(\"\");\n\t\tgenderText.setX(xDisplayText);\n\t\tgenderText.setY(y+ydiff*2);\n\t\t\n\t\t//birth date\n\t\tText birthdateText = new Text(\"\");\n\t\tbirthdateText.setX(xDisplayText);\n\t\tbirthdateText.setY(y+ydiff*3);\n\t\t\n\t\t//birth place\n\t\tText birthplaceText = new Text(\"\");\n\t\tbirthplaceText.setX(xDisplayText);\n\t\tbirthplaceText.setY(y+ydiff*4);\n\t\t\n\t\t//death date\n\t\tText deathdateText = new Text(\"\");\n\t\tdeathdateText.setX(xDisplayText);\n\t\tdeathdateText.setY(y+ydiff*5);\n\t\t\n\t\t//death place\n\t\tText deathplaceText = new Text(\"\");\n\t\tdeathplaceText.setX(xDisplayText);\n\t\tdeathplaceText.setY(y+ydiff*6);\n\t\t\n\t\t//biography\n\t\tText bioText = new Text(\"\");\n\t\tbioText.setX(xLabels);\n\t\tbioText.setY(y+ydiff*7.7);\n\t\t\n\t\t/**\n\t\t * creating the button to alter the selected person\n\t\t */\n\t\tButton alterPersonButton = new Button(\"Alter this person's information\");\n\t\talterPersonButton.setLayoutX(xLabels);\n\t\talterPersonButton.setLayoutY(y + ydiff*8.5);\n\t\talterPersonButton.setMinWidth(190);\n\t\tEventHandler<MouseEvent> alterPersonEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText addSiteText = new Text(100, 200, \"add node screen\");\n\t\t\t\tGroup addGroup = new Group(addSiteText);\n\t\t\t\tScene addscreen = new Scene(addGroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(addscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\talterPersonButton.addEventFilter(MouseEvent.MOUSE_CLICKED, alterPersonEvent);\n\t\t\n\t\t/**\n\t\t * creating the button to delete the selected person\n\t\t */\n\t\tButton deletePersonButton = new Button(\"Delete this person\");\n\t\tdeletePersonButton.setLayoutX(xLabels);\n\t\tdeletePersonButton.setLayoutY(y + ydiff*13.5);\n\t\tdeletePersonButton.setMinWidth(190);\n\t\tEventHandler<MouseEvent> deletePersonEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\t//TO DO\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\tdeletePersonButton.addEventFilter(MouseEvent.MOUSE_CLICKED, deletePersonEvent);\n\t\t\n\t\t/**\n\t\t * creating the buttons to add new nodes\n\t\t */\n\t\t\n\t\t//add a parent node\n\t\tButton addParentButton = new Button(\"Add Parent\");\n\t\taddParentButton.setLayoutX(xLabels);\n\t\taddParentButton.setLayoutY(y + ydiff*9.5);\n\t\taddParentButton.setMinWidth(190);\n\t\tEventHandler<MouseEvent> addParentEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText addSiteText = new Text(100, 200, \"add node screen\");\n\t\t\t\tGroup addGroup = new Group(addSiteText);\n\t\t\t\tScene addscreen = new Scene(addGroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(addscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\taddParentButton.addEventFilter(MouseEvent.MOUSE_CLICKED, addParentEvent);\n\t\t\n\t\t//add a child node\n\t\tButton addChildButton = new Button(\"Add Child\");\n\t\taddChildButton.setLayoutX(xLabels);\n\t\taddChildButton.setLayoutY(y + ydiff*10.5);\n\t\taddChildButton.setMinWidth(190);\n//\t\tEventHandler<MouseEvent> addChildEvent = new EventHandler<MouseEvent>() {\n//\t\t\t@Override\n//\t\t\tpublic void handle(MouseEvent event) {\n//\t\t\t\tText addSiteText = new Text(100, 200, \"add node screen\");\n//\t\t\t\tGroup addGroup = new Group(addSiteText);\n//\t\t\t\tScene addscreen = new Scene(addGroup, 1100, 850);\n//\t\t\t\tprimaryStage.setScene(addscreen);\n//\t\t\t\t\n//\t\t\t}\n//\t\t};\n\t\t\n\t\t\n\t\t\n//\t\tprimaryStage.setScene(ach.getAddChildScene());\n\t\t\n\t\t//add a spouse\n\t\tButton addSpouseButton = new Button(\"Add Spouse\");\n\t\taddSpouseButton.setLayoutX(xLabels);\n\t\taddSpouseButton.setLayoutY(y + ydiff*11.5);\n\t\taddSpouseButton.setMinWidth(190);\n\t\tEventHandler<MouseEvent> addSpouseEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText addSiteText = new Text(100, 200, \"add node screen\");\n\t\t\t\tGroup addGroup = new Group(addSiteText);\n\t\t\t\tScene addscreen = new Scene(addGroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(addscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\taddSpouseButton.addEventFilter(MouseEvent.MOUSE_CLICKED, addSpouseEvent);\n\t\t\n\t\t//add a sibling\n\t\tButton addSiblingButton = new Button(\"Add Sibling\");\n\t\taddSiblingButton.setLayoutX(xLabels);\n\t\taddSiblingButton.setLayoutY(y + ydiff*12.5);\n\t\taddSiblingButton.setMinWidth(190);\n\t\tEventHandler<MouseEvent> addSiblingEvent = new EventHandler<MouseEvent>() {\n\t\t\t@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t\t\tText addSiteText = new Text(100, 200, \"add node screen\");\n\t\t\t\tGroup addGroup = new Group(addSiteText);\n\t\t\t\tScene addscreen = new Scene(addGroup, 1100, 850);\n\t\t\t\tprimaryStage.setScene(addscreen);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\taddSiblingButton.addEventFilter(MouseEvent.MOUSE_CLICKED, addSiblingEvent);\n\t\t\n\t\t/**\n\t\t * adding all of the above elements into the Group\n\t\t */\n\t\tGroup root = new Group(back, help, textbox, firstname, lastname, gender, birthdate, birthplace, deathdate, deathplace, bio, firstnameText, lastnameText, genderText, birthdateText, birthplaceText, deathdateText,\n\t\t\t\tdeathplaceText, bioText, addParentButton, addChildButton, addSpouseButton, addSiblingButton, deletePersonButton, alterPersonButton);\n\t\t\n\n\t\t\n\t\t/**\n\t\t * creating the test nodes. Will have to be removed once the DB is added\n\t\t */\n\t\t\n\t\t\n//\t\t\tTree Lilly = new Tree(\"Lilly\", \"Schwarzenbach\", false, \"19-11-1995\", \"Riggisberg\", 1);\n//\t\t\tTree Felix = new Tree(\"Felix\", \"Schwarzenbach\", true, \"17-02-1959\", \"Wädenswil\", 1);\n//\t\t\tTree Susanna = new Tree(\"Susanna\", \"Schwarzenbach\", false, \"30-06-1963\", \"Bern\", 1);\n//\t\t\tTree Fanny = new Tree(\"Fanny\", \"Schwarzenbach\", false, \"04-05-1995\", \"Jegenstorf\", 1);\n//\t\t\tTree Fritz = new Tree(\"Fritz\", \"Schwarzenbach\", true, \"21-10-1925\", \"Zürich\", 1, \"09-06-2018\", \"Bern\");\n//\t\t\tTree Hedi = new Tree(\"Hedi\", \"Schwarzenbach\", false, \"21-11-1925\", \"Wädenswil\", 1, \"12-04-1973\", \"Davos\");\n//\t\t\tTree Hans = new Tree(\"Hans\", \"Moser\", true, \"16-03-1931\", \"Krauchthal\", 1, \"14-08-2015\", \"Bäriswil\");\n//\t\t\tTree Käthi = new Tree(\"Käthi\", \"Moser\", false, \"21-03-1936\", \"Hindelbank\", 1);\n//\t\t\tTree Hasi = new Tree(\"Hasi\", \"Schwarzenbach\", true, \"31-07-1953\", \"Wädenswil\", 1);\n//\t\t\tTree Heidi = new Tree(\"Heidi\", \"Stähli\", false, \"31-07-1955\", \"Wädenswil\", 1);\n//\t\t\tTree Susi = new Tree(\"Susi\", \"Schwarzenbach\", false, \"12-10-1962\", \"Wädenswil\", 1);\n//\t\t\tTree Silja = new Tree(\"Silja\", \"Stähli\", false, \"23-05-1986\", \"Wädenswil\", 1);\n//\t\t\tTree Patrick = new Tree(\"Patrick\", \"Wiesli\", true, \"24.04.1989\", \"St.Gallen\", 1);\n//\t\t\tTree Benjamin = new Tree(\"Benjamin\", \"Noclue\", true, \"no clue\", \"no clue\", 1);\n//\t\t\tTree Ronja = new Tree(\"Ronja\", \"Noclue\", false, \"no clue\", \"no clue\", 1);\n//\t\t\tTree Jürg = new Tree(\"Jürg\", \"Moser\", true, \"\", \"\", 1);\n//\t\t\tTree Madlen = new Tree(\"Madlen\", \"Moser\", false, \"\", \"\", 1, \"2003\", \"Bern\");\n//\t\t\tTree Urs = new Tree(\"Urs\", \"Moser\", true, \"\", \"\", 1);\n//\t\t\tTree Johanna = new Tree(\"Johanna\",\"Moser\", false, \"\", \"\", 1);\n//\t\t\tTree Lara = new Tree(\"Lara\", \"Moser\", false, \"\",\"\", 1);\n//\t\t\tTree Florian = new Tree(\"Florian\", \"Moser\", true, \"\", \"\", 1);\n//\t\t\tTree Nina = new Tree(\"Nina\", \"Moser\", false, \"\", \"\", 1);\n//\t\t\tTree Michel = new Tree(\"Michel\", \"Moser\", true, \"\", \"\", 1);\n//\t\t\n//\t\tLilly.addParent(Felix);\n//\t\tFelix.addSpouse(Susanna);\n////////\t\tSusanna.addChild(Fanny);\n//\t\tFelix.addParent(Fritz);\n//\t\tFritz.addChild(Hasi);\n//\t\tFelix.addParent(Hedi);\n//\t\tSusanna.addParent(Hans);\n//\t\tSusanna.addParent(Käthi);\n//\t\tFritz.addChild(Susi);\n////////\t\tFritz.addParent(Hans);\n//\t\tLilly.setBiography(\"Learning Java\");\n//\t\tLilly.addSibling(Fanny);\n////////\t\tLilly.addSibling(Käthi);\n//\t\tFelix.addSibling(Heidi);\n//\t\tHeidi.addChild(Silja);\n////////\t\tFanny.addChild(Patrick);\n//\t\tFanny.addSpouse(Patrick);\n//\t\tSilja.addSpouse(Benjamin);\n//\t\tSilja.addChild(Ronja);\n////////\t\tHans.addChild(Susi);\n//\t\tSusanna.addSibling(Jürg);\n//\t\tKäthi.addChild(Madlen);\n//\t\tHans.addChild(Urs);\n//\t\tUrs.addChild(Johanna);\n//\t\tUrs.addChild(Lara);\n//\t\tLara.addSibling(Florian);\n//\t\tJürg.addChild(Nina);\n//\t\tJürg.addChild(Michel);\n////////\t\tFritz.addParent(Käthi);\n//\t\tArrayList<Tree> trees = new ArrayList<>();\n\t\tArrayList<Tree> trees = TreeScreenModel.getNodes();\n//////\t\tSystem.out.println(trees);\n//\t\ttrees.add(Lilly);\n//\t\ttrees.add(Felix);\n//\t\ttrees.add(Susanna);\n//\t\ttrees.add(Fanny); \n//\t\ttrees.add(Fritz);\n////////\t\tSystem.out.println(Fritz.getChildren());\n////////\t\tSystem.out.println(\"Hans : \" + Hans.getChildren());\n////////\t\tSystem.out.println(Felix.getChildren());\n//////\n//\t\ttrees.add(Hedi);\n//\t\ttrees.add(Hans);\n//\t\ttrees.add(Käthi);\n//\t\ttrees.add(Hasi);\n//\t\ttrees.add(Heidi);\n//\t\ttrees.add(Susi);\n//\t\ttrees.add(Silja);\n//\t\ttrees.add(Benjamin);\n//\t\ttrees.add(Ronja);\n//\t\ttrees.add(Patrick);\n//\t\ttrees.add(Jürg);\n//\t\ttrees.add(Urs);\n//\t\ttrees.add(Madlen);\n//\t\ttrees.add(Johanna);\n//\t\ttrees.add(Michel);\n//\t\ttrees.add(Nina);\n//\t\ttrees.add(Florian);\n//\t\ttrees.add(Lara);\n////\t\t\n//\t\t\n\t\t\n//\t\tTree focused = Lilly;\n\t\tTree L = new Tree(\"Lilly\", \"Schwarzenbach\", false, \"19-11-1995\", \"Riggisberg\", 1);\n\t\tTree focused = L;\n\n\t\tTree F = focused;\n\t\tTree parent = F;\n\t\tTree ch = L;\n//\t\tGroup g = new Group(back, help, textbox, firstname, lastname, gender, birthdate, birthplace, deathdate, deathplace, bio, firstnameText, lastnameText, genderText, birthdateText, birthplaceText, deathdateText,\n//\t\t\t\tdeathplaceText, bioText, addParentButton, addChildButton, addSpouseButton, addSiblingButton, deletePersonButton, alterPersonButton)\n//\t\tScene s = new Scene(g, 1100, 850);\n//\t\ts.setFill(Color.MEDIUMSEAGREEN);\n\n\t\t\n\t\tGroup r = new Group();\n\t\tr.getChildren().addAll(root.getChildren());\n\n\t\tSystem.out.println(\"gen class \" + TreeScreenModel.generateNodes(root, trees, primaryStage, focused).getClass());\n\t\tr.getChildren().addAll(TreeScreenModel.generateNodes(root, trees, primaryStage, focused));\n//\t\troot.getChildren().\n\t\tScene scene = new Scene(r, 1100, 850);\n\t\tscene.setFill(Color.MEDIUMSEAGREEN);\n\n\t\tAddChildHandler ach = new AddChildHandler(primaryStage, scene, r, ch, parent);\n\t\taddChildButton.addEventFilter(MouseEvent.MOUSE_CLICKED, ach);\n\t\t\n\t\tprimaryStage.setScene(scene);\n\t\tprimaryStage.setTitle(\"FamilyTree\");\n\t\tprimaryStage.show();\n//\t\tSystem.out.println(\"-----------SUSI\\n \" + Susi + \"\\n------------------\\n\\n\");\n\n\t}", "@Override\n \tpublic void disposeScene() {\n \t\t\n \t}", "@Override\n public void simpleInitApp()\n {\n makeInitialWorld();\n \tAudio audio = new Audio(assetManager, rootNode);\n inputManager.setCursorVisible(false);\n \trootNode.attachChild(overlayNode);\n\n \tflyCam.setEnabled(true);\n flyCam.setMoveSpeed(25);\n\n setDisplayFps(true);\n setDisplayStatView(true);\n\n GUIInfo guiInfo = new GUIInfo(guiNode, assetManager.loadFont(\"Interface/Fonts/Console.fnt\"));\n guiNode.addControl(guiInfo);\n }", "public Scene() {}", "protected void loadScene(\r\n ) {\r\n // Remove the old scene as needed\r\n \tif ( mLastScene != null ) {\r\n \t\tif ( mPhysicsState != null ) {\r\n \t\t\tmPhysicsState.getPhysicsSpace().removeAll( mLastScene );\r\n \t\t}\r\n \t\trootNode.detachChild( mLastScene );\r\n \t\tmLastScene = null;\r\n \t\t\r\n \t\tif ( !mPostText.isEmpty() ) mPostText.pop();\r\n \t}\r\n \tString sceneName = mSceneList.get( mSceneIndex );\r\n \tif ( sceneName != null ) synchronized( this ) {\r\n \t\tif ( mLoadingScene == null ) {\r\n \t\t\tmLoadingScene = sceneName;\r\n \t\t\tCSGTestDriver.postText( this, mTextDisplay, \"** LOADING ==> \" + mLoadingScene, false );\r\n \t\t\tthis.notifyAll();\r\n \t\t}\r\n \t} else {\r\n \t\tCSGTestDriver.postText( this, mTextDisplay, mNullSceneMsg, true );\r\n \t}\r\n }", "protected void buildScene() {\n Geometry cube1 = buildCube(ColorRGBA.Red);\n cube1.setLocalTranslation(-1f, 0f, 0f);\n Geometry cube2 = buildCube(ColorRGBA.Green);\n cube2.setLocalTranslation(0f, 0f, 0f);\n Geometry cube3 = buildCube(ColorRGBA.Blue);\n cube3.setLocalTranslation(1f, 0f, 0f);\n\n Geometry cube4 = buildCube(ColorRGBA.randomColor());\n cube4.setLocalTranslation(-0.5f, 1f, 0f);\n Geometry cube5 = buildCube(ColorRGBA.randomColor());\n cube5.setLocalTranslation(0.5f, 1f, 0f);\n\n rootNode.attachChild(cube1);\n rootNode.attachChild(cube2);\n rootNode.attachChild(cube3);\n rootNode.attachChild(cube4);\n rootNode.attachChild(cube5);\n }", "@Override\n\tpublic void createScene() {\n\t\t\n\t\tSprite backGround = new Sprite(0, 0, rm.setting_background_region, rm.vbo);\n\t\t\n\t\tv_on = new Sprite(400,100,rm.on_region,rm.vbo){\n\t\t\t@Override\n\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\n\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\n\t\t\t\t\tisVoice = true;\n\t\t\t\t\t\n\t\t\t\t\tv_on.setColor(0, 0, 1);\n\t\t\t\t\tv_off.setColor(1,0,0);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t return false;\n\t\t\t}};\n\t\tv_off = new Sprite(500,100,rm.off_region,rm.vbo){\n\t\t\t\t@Override\n\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\n\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tisVoice = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\tv_off.setColor(0, 0, 1);\n\t\t\t\t\t\tv_on.setColor(1,0,0);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t return false;\n\t\t }};\n\t\ts_on = new Sprite(400,170,rm.on_region,rm.vbo){\n\t\t\t\t@Override\n\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\n\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tisSound = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\ts_on.setColor(0, 0, 1);\n\t\t\t\t\t\ts_off.setColor(1,0,0);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t return false;\n\t\t\t\t}};\n\t\ts_off = new Sprite(500,170,rm.off_region,rm.vbo){\n\t\t\t\t\t@Override\n\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tisSound = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ts_off.setColor(0, 0, 1);\n\t\t\t\t\t\t\ts_on.setColor(1,0,0);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t return false;\n\t\t\t }};\n\t\t \n\t\t\n\t\t \n\t\tauto_on = new Sprite(400,240,rm.on_region,rm.vbo){\n\t\t\t\t@Override\n\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\n\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tisAutofight = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tauto_on.setColor(0, 0, 1);\n\t\t\t\t\t\tauto_off.setColor(1,0,0);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t return false;\n\t\t\t\t}};\n\t\tauto_off = new Sprite(500,240,rm.off_region,rm.vbo){\n\t\t\t\t\t@Override\n\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tisAutofight = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tauto_off.setColor(0, 0, 1);\n\t\t\t\t\t\t\tauto_on.setColor(1,0,0);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t return false;\n\t\t\t }};\n\t\t\t p_on = new Sprite(400,310,rm.on_region,rm.vbo){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tisParticle = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tp_on.setColor(0, 0, 1);\n\t\t\t\t\t\t\tp_off.setColor(1,0,0);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t return false;\n\t\t\t\t\t}};\n\t\t\tp_off = new Sprite(500,310,rm.off_region,rm.vbo){\n\t\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tisParticle = false;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tp_off.setColor(0, 0, 1);\n\t\t\t\t\t\t\t\tp_on.setColor(1,0,0);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t return false;\n\t\t\t\t }};\n\t\t\t\t \n\t\t\t\t skill_on = new Sprite(400,380,rm.on_region,rm.vbo){\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tshowSkillEffect = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tskill_on.setColor(0, 0, 1);\n\t\t\t\t\t\t\t\tskill_off.setColor(1,0,0);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t return false;\n\t\t\t\t\t\t}};\n\t\t\t\tskill_off = new Sprite(500,380,rm.off_region,rm.vbo){\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tshowSkillEffect = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tskill_off.setColor(0, 0, 1);\n\t\t\t\t\t\t\t\t\tskill_on.setColor(1,0,0);\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t return false;\n\t\t\t\t\t }};\n\t\t\t \n\t\t\t Sprite back = new Sprite(690,365,rm.options_back_region,rm.vbo){\n\t\t\t\t\t@Override\n\t\t\t\tpublic boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(pSceneTouchEvent.isActionDown()){\n\t\t\t\t\t\t\tonBackKeyPressed();\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t return false;\n\t\t\t }};\n\t\t\t reset();\n\t\t \n\t \n\t\t \n\t attachChild(backGround);\n\t attachChild(v_off);\n\t attachChild(v_on);\n\t attachChild(s_off);\n\t attachChild(s_on);\n\t attachChild(auto_off);\n\t attachChild(auto_on);\n\t attachChild(p_off);\n\t attachChild(p_on);\n\t attachChild(skill_off);\n\t attachChild(skill_on);\n attachChild(back);\n\t\t\t\n\t registerTouchArea(v_off);\n registerTouchArea(v_on);\n registerTouchArea(s_off);\n registerTouchArea(s_on);\n registerTouchArea(auto_off);\n registerTouchArea(auto_on);\n registerTouchArea(p_off);\n registerTouchArea(p_on);\n registerTouchArea(skill_off);\n registerTouchArea(skill_on);\n \n\t registerTouchArea(back);\n\t \n\t\t\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "@Override\n public void start(Stage primaryStage) {\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"scenes/main_menu.fxml\"));\n primaryStage.setTitle(\"Führerschein Theorieprüfung\");\n primaryStage.setScene(new Scene(root));\n primaryStage.setResizable(false);\n\n primaryStage.show();\n\n new FadeIn(root).play();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void show() {\n\n skin = new Skin(Gdx.files.internal(\"menu/menu.json\"),new TextureAtlas(\"menu/menu.pack\"));\n\n Image background = new Image(skin, \"menuscreen\");\n background.setPosition(0,0);\n stage.addActor(background);\n\n Image gameOver = new Image(skin,\"gameOver\");\n gameOver.setPosition( ( 800 - 484)/2 , (480 - 345)/2 ) ;\n stage.addActor(gameOver);\n\n Button gameOverSim = new Button(skin,\"gameOverSim\");\n gameOverSim.setPosition(265,100);\n stage.addActor(gameOverSim);\n\n Button gameOverNao = new Button(skin,\"gameOverNao\");\n gameOverNao.setPosition(425,100);\n stage.addActor(gameOverNao);\n\n gameOverSim.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent event, float x, float y) {\n // TO DO passar o level como parametro no construtor\n selecionado.play();\n ((Game) Gdx.app.getApplicationListener()).setScreen(new PlayScreen(game, level));\n dispose();\n }\n });\n\n gameOverNao.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent event, float x, float y) {\n selecionado.play();\n ((Game) Gdx.app.getApplicationListener()).setScreen(new MenuScreen(game));\n dispose();\n }\n });\n\n }", "public Scene getSecondaryScene() {\n VBox myBox2 = new VBox(15);\r\n myBox2.setAlignment(Pos.CENTER);\r\n\r\n // Creating a button that redirects back to the first scene\r\n Button sceneButton = new Button(\"Aww, you left?! Why?? Click to go back!\");\r\n // Actually specifying what pressing the button will do\r\n sceneButton.setOnAction(e -> {\r\n Scene primaryScene = getPrimaryScene();\r\n primaryStage.setScene(primaryScene);\r\n primaryStage.show();\r\n });\r\n\r\n // Creating an Image object and an ImageViewer to hold the image\r\n Image image = new Image(\"sad.gif\", 400, 400, true, true);\r\n ImageView imView = new ImageView(image);\r\n\r\n // Adding our ImageViewer and Buttons onto the VBox\r\n myBox2.getChildren().addAll(imView, sceneButton);\r\n // Actually instantiating the scene with the VBox containing everything\r\n Scene secondaryScene = new Scene(myBox2, 450, 450);\r\n // Returning the scene\r\n return secondaryScene;\r\n }", "public void updateScene() {\n\t\tthis.background.draw();\n\t\tthis.errorScene.draw();\n\t}", "@FXML\r\n\tpublic void home(ActionEvent event) throws Exception {\r\n\t\tScene newScene;\r\n\t\tParent root;\r\n\t\ttry {\r\n\t\t\troot = FXMLLoader.load(getClass().getResource(hauptmenue()));\r\n\t\t\tnewScene = new Scene(root);\r\n\t\t\tStage stage = new Stage();\r\n\t\t\tstage.setTitle(\"ResLearn\");\r\n\t\t\tstage.setMaximized(true);\r\n\t\t\tstage.setScene(newScene);\r\n\t\t\tstage.show();\r\n\t\t\t((Node) (event.getSource())).getScene().getWindow().hide();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void setScene() {\n\n Shape ground = new Plane(vec3(0.0, -1.0, 0.0), vec3(0, 1, -0.2), new Diffuse(new Vec3(1,1,1), white));\n \n /* Shape globe1 = new Sphere(vec3(0.0, 2, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe2 = new Sphere(vec3(2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe3 = new Sphere(vec3(-2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n*/\n Shape globe1T = new Sphere(vec3(0.0, 2, -2.0), 0.3, new Diffuse(new Vec3(1,1,1), white));\n // Shape globe2T = new Sphere(vec3(-0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1),yellow));\n // Shape globe3T = new Sphere(vec3(0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1), yellow));\n\n \n \n Shape globe4 = new Sphere(vec3(0.0, 2, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe5 = new Sphere(vec3(2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe6 = new Sphere(vec3(-2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n \n Shape globe7 = new Sphere(vec3(0.0, 2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe8 = new Sphere(vec3(2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe9 = new Sphere(vec3(-2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe7D = new Sphere(vec3(0.0, -2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n\n Shape globeC = new Sphere(vec3(0.0, 0.0, -6.0), 1.0, new Diffuse(new Vec3(1,1,1), red));\n \n ArrayList<Shape> shapes = new ArrayList<>();\n shapes.add(bg);\n shapes.add(ground);\n shapes.add(globe1T);\n // shapes.add(globe2T);\n // shapes.add(globe3T);\n //shapes.add(globe4);\n //shapes.add(globe5);\n shapes.add(globe7);\n shapes.add(globe8);\n shapes.add(globe9);\n shapes.add(globe7D);\n shapes.add(globeC);\n gr = new Group(shapes);\n /////////////////////////////--------------------------------------\n \n \n }", "private void loadScene() throws IOException {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"CurriculumDisplaySE.fxml\"));\n loader.setController(this);\n Parent root = loader.load();\n scene = new Scene(root);\n }", "public void onAdd2Scene() {\n\t\tAnimation src = getSourceAnimation();\n\t\tif( src != null ) {\n\t\t\tadd2Scene(src, getSourceAnimation().actFrame);\n\t\t\tlog.info(\" adding frame from {}\", vm.cutInfo);\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback)\r\n\t\t\tthrows Exception {\r\n\t\t\r\n\t\t// Retrieve our font from the resource manager\r\n\t\tFont font = ResourceManager.getInstance().mFont;\r\n\t\t\r\n\t\t// Set the location of our splash 'image' (text object in this case).\r\n\t\t// We can use FontUtils.measureText to retrieve the width of our text\r\n\t\t// object in order to properly format its position\r\n\t\tfloat x = WIDTH / 2 - FontUtils.measureText(font, SPLASH_STRING) / 2;\r\n\t\tfloat y = HEIGHT / 2 - font.getLineHeight() / 2;\r\n\t\t\r\n\t\t// Create our splash scene object\r\n\t\tmSplashScene = new Scene();\r\n\t\t// Create our splash screen text object\r\n\t\tmSplashSceneText = new Text(x, y, font, SPLASH_STRING, SPLASH_STRING.length(), mEngine.getVertexBufferObjectManager());\r\n\t\t// Attach the text object to our splash scene\r\n\t\tmSplashScene.attachChild(mSplashSceneText);\r\n\r\n\t\t// We must change the value of x depending on the length of our menu\r\n\t\t// string now in order to keep the text centered on-screen\r\n\t\tx = WIDTH / 2 - FontUtils.measureText(font, MENU_STRING) / 2;\r\n\t\t\r\n\t\t// Create our main menu scene\r\n\t\tmMenuScene = new Scene();\r\n\t\t// Create our menu screen text object\r\n\t\tmMenuSceneText = new Text(x, y, font, MENU_STRING, MENU_STRING.length(), mEngine.getVertexBufferObjectManager());\r\n\t\t// Attach the text object to our menu scene\r\n\t\tmMenuScene.attachChild(mMenuSceneText);\r\n\t\t\r\n\t\t// Finally, we must callback the initial scene to be loaded (splash scene)\r\n\t\tpOnCreateSceneCallback.onCreateSceneFinished(mSplashScene);\r\n\t}", "public void startGameEventHandler(ActionEvent e) throws IOException {\n appWindow=(Stage)((Node)e.getSource()).getScene().getWindow();\n// appWindow.setScene(gameLevelScene);\n// appWindow.show();\n\n playLevel(1,0,null);\n }", "private Scene createMainMenuScene() {\n VBox root = new VBox();\n root.setId(\"pane\");\n root.setAlignment(Pos.CENTER);\n root.setSpacing(BUTTON_DISTANCE);\n\n Label lTitle = new Label(\"2048 Fx\");\n lTitle.setId(\"title-label\");\n root.getChildren().add(lTitle);\n\n Button bNewGame = new Button(\"New game\");\n bNewGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n Game.board.init();\n }\n });\n bNewGame.setId(\"c16\");\n root.getChildren().add(bNewGame);\n\n Button bLoadGame = new Button(\"Load game\");\n bLoadGame.setId(\"c256\");\n bLoadGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Load saving\");\n File directory = new File(\"./savegames\");\n if (!directory.exists()) {\n directory = new File(\"./\");\n }\n fileChooser.setInitialDirectory(directory);\n FileChooser.ExtensionFilter extFilter =\n new FileChooser.ExtensionFilter(\"Saved 2048 games\", \"*.saving\");\n fileChooser.getExtensionFilters().add(extFilter);\n File file = fileChooser.showOpenDialog(Game.stage);\n if (file != null) {\n Game.board.replay(file);\n }\n }\n });\n root.getChildren().add(bLoadGame);\n\n Button bSettings = new Button(\"Settings\");\n bSettings.setId(\"c4096\");\n bSettings.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n settingsMenu();\n }\n });\n root.getChildren().add(bSettings);\n\n Button bGenerate = new Button(\"Also\");\n bGenerate.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n\tGame.statBoard.statMenu();\n }\n });\n bGenerate.setId(\"c1024\");\n root.getChildren().add(bGenerate);\n\n Button bQuit = new Button(\"Quit\");\n bQuit.setId(\"c65536\");\n bQuit.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileHandler.saveSettings(Game.settings);\n Game.stage.close();\n }\n });\n root.getChildren().add(bQuit);\n Scene menuScene = new Scene(root, Game.WINDOW_SIZE_X, Game.WINDOW_SIZE_Y);\n menuScene.getStylesheets().\n addAll(this.getClass().getResource(\"menu.css\").toExternalForm());\n return menuScene;\n }", "public Scene getMainMenuScene() {\n return scene;\n }", "public static void intro() {\n printHighlighted(\"SECRET SANTA\");\n printHighlighted(\"This program allows you to add the participants of the\");\n printHighlighted(\"game and assign them matches to send and receive gifts.\");\n }", "public void handle(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\tGameStage game = new GameStage();\n\t\t\t\tmainStage.setScene(game.getScene());\n\t\t\t\tmainStage.setTitle(\"Pacman 1.0\");\n//\t\t\t\tmainStage.setScene(mainGame.getScene());\n\t\t\t}", "public void setNewScene() {\n switch (game.getCurrentRoomId()) {\n case 14:\n WizardOfTreldan.setFinishScene();\n break;\n\n }\n }", "private void changeScene(String scene){\n switch (scene) {\n case \"Passwords\" -> {\n this.addNewScene.setVisible(false);\n this.generateScene.setVisible(false);\n this.passwordsScene.setVisible(true);\n }\n case \"Add New\" -> {\n this.generateScene.setVisible(false);\n this.passwordsScene.setVisible(false);\n this.addNewScene.setVisible(true);\n }\n case \"Generate\" -> {\n this.generateScene.setVisible(true);\n this.passwordsScene.setVisible(false);\n this.addNewScene.setVisible(true);\n }\n }\n }", "public void start(Stage primaryStage2) throws FileNotFoundException, NoSuchObjectException {\n primaryStage = primaryStage2;\n myGameOverView = new GameOverView(language, primaryStage);\n primaryStage2.setScene(buildScene());\n }", "public void backToStartScene(ActionEvent event) throws IOException {\r\n Parent startView = FXMLLoader.load(Main.class.getResource(\"fxml/StartScene.fxml\"));\r\n Scene startViewScene = new Scene(startView);\r\n\r\n // This line gets the Stage information (no Stage is passed in)\r\n Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();\r\n\r\n window.setScene(startViewScene);\r\n window.show();\r\n }", "void registerScene(Scene scene) {\n scene.setOnKeyPressed(event -> {\n switch (event.getCode()) {\n case UP:\n player.move(UP);\n break;\n case LEFT:\n player.move(LEFT);\n break;\n case DOWN:\n player.move(DOWN);\n break;\n case RIGHT:\n player.move(RIGHT);\n break;\n case T:\n player.look(UP.add(LEFT));\n break;\n case Y:\n player.look(UP);\n break;\n case U:\n player.look(UP.add(RIGHT));\n break;\n case F:\n player.look(LEFT);\n break;\n case G:\n player.look(ORIGIN);\n break;\n case H:\n player.look(RIGHT);\n break;\n case C:\n player.look(DOWN.add(LEFT));\n break;\n case V:\n player.look(DOWN);\n break;\n case B:\n player.look(DOWN.add(RIGHT));\n break;\n case EQUALS:\n worldRenderer.zoomIn();\n break;\n case MINUS:\n worldRenderer.zoomOut();\n break;\n case Q:\n case ESCAPE:\n System.exit(0);\n break;\n case Z:\n player.selectPreviousItem();\n break;\n case X:\n player.selectNextItem();\n break;\n case ENTER:\n player.useItem();\n default:\n break;\n }\n });\n }", "public static Scene ReviewerPage (Stage stage) \n {\n \tstage.setTitle(\"Reviewer Page\");\n \t\n GridPane grid = new GridPane(); // Setup the grid background\n grid.setAlignment(Pos.TOP_LEFT);\n grid.setHgap(30);\n grid.setVgap(10);\n grid.setPadding(new Insets(25, 25, 25, 25));\n\n VBox vbox = new VBox();\n vbox.setPadding(new Insets(25, 25, 25, 25));\n vbox.setSpacing(10);\n\n Text title = new Text(\"Reviewer's Task\");\n title.setFont(Font.font(\"Arial\", FontWeight.BOLD, 20));\n vbox.getChildren().add(title);\n\n Hyperlink options[] = new Hyperlink[] \n {\n new Hyperlink(\"View list of Bugs\"),\n new Hyperlink(\"Update Bug Status\"),\n new Hyperlink(\"Search Bugs\"),\n new Hyperlink(\"Comment on Bugs\")\n //any more you can add in \n };\n\t\t\n // i<2 (the number 2 will change if more hyperlinks is added to options[])\n for (int i=0; i<4; i++) \n {\n VBox.setMargin(options[i], new Insets(0, 0, 0, 8));\n vbox.getChildren().add(options[i]);\n\n if (options[i].onMouseClickedProperty() != null && options[i].getText() == \"View list of Bugs\") \n {\n options[i].setOnAction(new EventHandler<ActionEvent>() \n {\n @Override\n public void handle(ActionEvent t) \n {\n stage.setScene(ReviewerBugListUI.create(stage)); \n }\n });\n }\n else if (options[i].onMouseClickedProperty() != null && options[i].getText() == \"Update Bug Status\")\n {\n options[i].setOnAction(new EventHandler<ActionEvent>() \n {\n @Override\n public void handle(ActionEvent t) \n {\n \tstage.setScene(ReviewerUpdateStatusUI.create(stage));\n } \n });\n }\n else if (options[i].onMouseClickedProperty() != null && options[i].getText() == \"Search Bugs\")\n {\n options[i].setOnAction(new EventHandler<ActionEvent>() \n {\n @Override\n public void handle(ActionEvent t) \n {\n \tstage.setScene(SearchPage(stage));\n } \n });\n }\n else if (options[i].onMouseClickedProperty() != null && options[i].getText() == \"Comment on Bugs\")\n {\n options[i].setOnAction(new EventHandler<ActionEvent>() \n {\n @Override\n public void handle(ActionEvent t) \n {\n \tstage.setScene(BugCommentUI.create(stage));\n } \n });\n }\n \n }\n\n Button logoutBtn = new Button(\"Logout\"); // Logout Button\n logoutBtn.setOnAction(new EventHandler<ActionEvent>() \n {// Handles what actions happend when the button is clicked. \n @Override\n public void handle(ActionEvent event) \n {\n stage.setScene(UserLogoutUI.create(stage));\n }\n });\n grid.add(vbox, 0, 0);\n grid.add(logoutBtn, 0, 1);\n\n BackgroundFill background_fill = new BackgroundFill(Color.ALICEBLUE, CornerRadii.EMPTY, Insets.EMPTY);\n Background background = new Background(background_fill);\n grid.setBackground(background);\n\n Scene scene2= new Scene(grid, 550, 500);\n return scene2;\n }", "public void showQuests(){\n try{\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Game.class.getResource(\"view/Quests.fxml\"));\n AnchorPane janela = (AnchorPane) loader.load();\n \n Stage questsStage = new Stage();\n questsStage.setTitle(\"Inventory\");\n questsStage.initModality(Modality.WINDOW_MODAL);\n questsStage.initOwner(primaryStage);\n Scene scene = new Scene(janela);\n questsStage.setScene(scene);\n \n QuestsController controller = loader.getController();\n controller.setGame(this);\n \n questsStage.showAndWait();\n }catch(IOException e){\n }\n }", "public void createNodes() {\n\n //Current wave text\n currentWaveText = new Text();\n currentWaveText.setY(50);\n currentWaveText.setX(Constants.GAME_WIDTH / 2 - 150);\n currentWaveText.setTextAlignment(TextAlignment.LEFT);\n currentWaveText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 36));\n currentWaveText.setFill(Color.TOMATO);\n currentWaveText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(currentWaveText);\n\n //Health bar\n healthBar = new Rectangle(healthBarMaxWidth, healthBarMaxHeight, Color.LIMEGREEN);\n healthBar.setY(10);\n healthBar.setX(10);\n\n FXGL.getGameScene().addUINode(healthBar);\n\n //Health bar background\n healthBackground = new Rectangle(healthBarMaxWidth, healthBarMaxHeight);\n healthBackground.setY(10);\n healthBackground.setX(10);\n healthBackground.setFill(Color.TRANSPARENT);\n healthBackground.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(healthBackground);\n\n //Amount of ammo text\n amountOfAmmoText = new Text(10, 100, \"\");\n amountOfAmmoText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n amountOfAmmoText.setFill(Color.LIMEGREEN);\n amountOfAmmoText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(amountOfAmmoText);\n\n //Active weapon text\n activeWeaponText = new Text(10, 70, \"\");\n activeWeaponText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n activeWeaponText.setFill(Color.LIMEGREEN);\n activeWeaponText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(activeWeaponText);\n\n //Reloading text\n reloadingText = new Text(10, 130, \"\");\n reloadingText.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 24));\n reloadingText.setFill(Color.LIMEGREEN);\n reloadingText.setStroke(Color.BLACK);\n\n FXGL.getGameScene().addUINode(reloadingText);\n update();\n }", "public void initScenes()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n m_pInScene.setPosition(new CCPoint(-(s.width - 0.5f), 0));\n }", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"Scene.fxml\"));\n primaryStage.setTitle(\"Project 3\");\n primaryStage.setScene(new Scene(root, 600, 600));\n primaryStage.show();\n }", "public void initStage(Stage primaryStage) throws Exception {\n FXMLLoader loader = new FXMLLoader();\n Parent root = loader.load(getClass().getResourceAsStream(ROOT_PATH));\n Scene scene = new Scene(root);\n scene.getStylesheets().add(getClass().getResource(STYLE_PATH).toExternalForm());\n\n //add resize listener to main scene\n ResizeListener resizeListener = new ResizeListener(primaryStage, scene);\n scene.setOnMouseMoved(resizeListener);\n scene.setOnMousePressed(resizeListener);\n scene.setOnMouseDragged(resizeListener);\n\n //add close listener\n Button exit = (Button) scene.lookup(EXIT_SELECTOR);\n exit.setOnAction(new ExitListener(primaryStage));\n\n //add expand listener\n Button expand = (Button) scene.lookup(EXPAND_SELECTOR);\n expand.setOnAction(new ExpandListener(primaryStage));\n\n //add hide listener\n Button hide = (Button) scene.lookup(HIDE_SELECTOR);\n hide.setOnAction(new HideListener(primaryStage));\n\n //add menu listener\n Button menuOpen = (Button) scene.lookup(MENU_OPEN_SELECTOR);\n Button menuClose = (Button) scene.lookup(MENU_CLOSE_SELECTOR);\n NavigatorListener navigatorListener = new NavigatorListener(scene);\n menuOpen.setOnAction(navigatorListener);\n menuClose.setOnAction(navigatorListener);\n\n //add move listener\n Label title = (Label) scene.lookup(TITLE_SELECTOR);\n MoveWindowListener moveWindowListener = new MoveWindowListener(primaryStage);\n title.setOnMousePressed(moveWindowListener);\n title.setOnMouseDragged(moveWindowListener);\n\n //add icon for history button\n Button history = (Button) scene.lookup(HISTORY_SELECTOR);\n Image historyImage = new Image(getClass().getResourceAsStream(HISTORY_ICON_PATH));\n ImageView imageView = new ImageView(historyImage);\n history.setGraphic(imageView);\n\n //add icon for menuOpen button\n Image menuImage = new Image(Launcher.class.getResourceAsStream(MENU_ICON_PATH));\n imageView = new ImageView(menuImage);\n menuOpen.setGraphic(imageView);\n\n //add icon for menuClose button\n imageView = new ImageView(menuImage);\n menuClose.setGraphic(imageView);\n\n //add icon for about button\n ImageView about = (ImageView) scene.lookup(ABOUT_SELECTOR);\n Image aboutImage = new Image(Launcher.class.getResourceAsStream(ABOUT_ICON_PATH));\n about.setImage(aboutImage);\n\n //init menu list of items\n ListView<String> listView = (ListView<String>) scene.lookup(LIST_SELECTOR);\n listView.setItems(MenuAdapter.init());\n\n //add button font resize\n scene.heightProperty().addListener(new ButtonResizeListener(scene));\n\n //add numeric field font resize\n Label numericLabel = (Label) scene.lookup(NUMERIC_FIELD_SELECTOR);\n numericLabel.textProperty().addListener(new NumericResizeListener(scene));\n\n primaryStage.setTitle(TITLE);\n primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(APP_ICON_PATH)));\n primaryStage.setScene(scene);\n primaryStage.initStyle(StageStyle.TRANSPARENT);\n primaryStage.show();\n }", "@Override\n\tpublic void disposeScene() {\n\t\t\n\t}", "@Override\n\tpublic void disposeScene() {\n\t\t\n\t}", "@Override\n public void start (Stage stage) throws IOException {\n init.start(stage);\n myScene = view.makeScene(50,50);\n stage.setScene(myScene);\n stage.show();\n }", "@Override\n public void simpleInitApp() {\n this.viewPort.setBackgroundColor(ColorRGBA.LightGray);\n im = new InteractionManager();\n setEdgeFilter();\n initEnemies();\n initCamera();\n initScene();\n initPlayer();\n initCrossHairs();\n }", "public void sceneManage(String address, ActionEvent event) throws IOException {\n stage = (Stage) ((Button) event.getSource()).getScene().getWindow();\n scene = FXMLLoader.load(getClass().getResource(address));\n stage.setScene(new Scene(scene));\n stage.show();\n }", "public void sceneManage(String address, ActionEvent event) throws IOException {\n stage = (Stage) ((Button) event.getSource()).getScene().getWindow();\n scene = FXMLLoader.load(getClass().getResource(address));\n stage.setScene(new Scene(scene));\n stage.show();\n }", "public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}", "public void setScene(String scene) {\n\t\tthis.scene = scene;\n\t}", "public TutorialPane(MainApplication app) {\n this.program = app;\n \n // Header/ General instructions for the game\n header = new GParagraph(\n \"Your goal is to defeat all the enemies in a room then progress to the next.\\nFind the staircase to the next floor.\\nPause with `ESC`\",\n MainApplication.WINDOW_WIDTH / 4, 100);\n header.setFont(\"Arial-24\");\n \n // Instructions on how one should move about the game\n moveInstructions = new GParagraph(\"To move, use the\\n\\\"WASD\\\" keys\", MainApplication.WINDOW_WIDTH / 6 + 50,\n 2 * MainApplication.WINDOW_HEIGHT / 3);\n moveInstructions.setFont(\"Arial-24\");\n \n // Instructions on how one should go about attacking in game-play\n attackInstructions = new GParagraph(\"To fire, use either mouse button\",\n 4 * MainApplication.WINDOW_WIDTH / 6, 2 * MainApplication.WINDOW_HEIGHT / 3);\n attackInstructions.setFont(\"Arial-24\");\n \n // Instructions on how to escape the tutorial menu\n pressToContinue = new GLabel(\"Press any key or mouse button to continue...\", MainApplication.WINDOW_WIDTH / 2 - 250,\n 5 * MainApplication.WINDOW_HEIGHT / 6);\n pressToContinue.setFont(\"Arial-24\");\n\n // Appropriate images and such placed correctly\n moveKeys = new GImage(\"WASD.png\", MainApplication.WINDOW_WIDTH / 6, 2 * MainApplication.WINDOW_HEIGHT / 3);\n moveKeys.move(0, -1 * moveKeys.getHeight() - 100);\n attackKeys = new GImage(\"../media/mouse_buttons.png\", 4 * MainApplication.WINDOW_WIDTH / 6 + 50, 2 * MainApplication.WINDOW_HEIGHT / 3);\n attackKeys.setSize(150, 260);\n attackKeys.move(0, -1 * attackKeys.getHeight() - 100);\n }", "@FXML\r\n private void goHomeScreen(ActionEvent event) {\n Stage stage = (Stage) mainGridPane.getScene().getWindow();\r\n\r\n //load up WelcomeScene FXML document\r\n Parent root = null;\r\n try {\r\n root = FXMLLoader.load(getClass().getResource(\"WelcomeChipScene.fxml\"));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n Scene scene = new Scene(root, 1024, 720);\r\n stage.setTitle(\"Restaurant Reservation System\");\r\n stage.setScene(scene);\r\n stage.show();\r\n }", "@Override\n public void start(Stage primaryStage) throws Exception{\n\n Music.playBackGroundMusic();\n\n try {\n SpellingListData.getInstance();\n _revisionData.loadFailed();\n _overallStats.loadStats();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n _primaryStage = primaryStage;\n\n Parent root = FXMLLoader.load(getClass().getResource(\"MainMenuV2.fxml\"));\n primaryStage.setTitle(\"VOXSPELL\");\n primaryStage.setScene(new Scene(root, 1200, 800));\n primaryStage.setResizable(false);\n primaryStage.show();\n\n\n }", "private void createScene() {\r\n imageView.setFitWidth(400);\r\n imageView.setFitHeight(300);\r\n\r\n Scene scene = new Scene(rootScene(), 700, 600);\r\n\r\n primaryStage.setTitle(TITLE);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n }", "void chang_scene_method(String FXML_Name) {\n try {\n AnchorPane pane = FXMLLoader.load(getClass().getResource(FXML_Name));\n anchorPane.getChildren().setAll(pane);\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, \"Error: \" + e);\n }\n }", "public RaceScene(){\n carOne = new Car();\n\n carTwo = new Car();\n\n carThree = new Car();\n\n txtWarning = new Text(\"Wait for all cars to finish moving\");\n txtWarning.setFont(Font.font(30));\n txtWarning.setFill(Color.WHITE);\n txtWarning.setVisible(false);\n\n btnStartRace = new Button(\"Start\");\n btnStartRace.setFont(Font.font(40));\n btnStartRace.setBackground(new Background(new BackgroundFill(Color.LIGHTBLUE, CornerRadii.EMPTY, Insets.EMPTY)));\n btnStartRace.setOnMouseEntered(E -> btnStartRace.setBackground(new Background(new BackgroundFill\n (Color.DODGERBLUE, CornerRadii.EMPTY, Insets.EMPTY))));\n btnStartRace.setOnMouseExited(E -> btnStartRace.setBackground(new Background(new BackgroundFill\n (Color.LIGHTBLUE, CornerRadii.EMPTY, Insets.EMPTY))));\n btnStartRace.setOnMouseClicked(this);\n\n btnEndRace = new Button(\"Finish\");\n btnEndRace.setVisible(false);\n btnEndRace.setFont(Font.font(40));\n btnEndRace.setTextFill(Color.WHITE);\n btnEndRace.setBackground(new Background(new BackgroundFill(Color.CRIMSON, CornerRadii.EMPTY, Insets.EMPTY)));\n btnEndRace.setOnMouseEntered(E -> btnEndRace.setBackground(new Background(new BackgroundFill\n (Color.DARKRED, CornerRadii.EMPTY, Insets.EMPTY))));\n btnEndRace.setOnMouseExited(E -> btnEndRace.setBackground(new Background(new BackgroundFill\n (Color.CRIMSON, CornerRadii.EMPTY, Insets.EMPTY))));\n btnEndRace.setOnMouseClicked(this);\n }", "@FXML\r\n public void backButton(ActionEvent event) throws IOException{//back to main menu\r\n Parent Root = FXMLLoader.load(getClass().getResource(\"MainGUIFXML.fxml\"));\r\n \r\n\r\n Scene scene = new Scene(Root);\r\n\r\n Stage AddPageStage = (Stage) ((Node) event.getSource()).getScene().getWindow();\r\n AddPageStage.setTitle(\"Main Menu\");\r\n AddPageStage.setScene(scene);\r\n AddPageStage.setResizable(false);\r\n AddPageStage.show();\r\n }" ]
[ "0.7164759", "0.66907495", "0.66256094", "0.6595962", "0.65227735", "0.65099317", "0.6405354", "0.63782364", "0.6320442", "0.627565", "0.62303567", "0.62028474", "0.6171888", "0.61221033", "0.61216277", "0.6111197", "0.6092983", "0.6068936", "0.6049413", "0.6034775", "0.60240674", "0.6017048", "0.6015199", "0.59863114", "0.5970008", "0.5939081", "0.59347", "0.5934388", "0.59302866", "0.5915507", "0.58996224", "0.58964306", "0.5877694", "0.5873002", "0.587262", "0.58718306", "0.58697283", "0.5852721", "0.58457476", "0.5831432", "0.5825307", "0.57918453", "0.5791791", "0.5791682", "0.5785833", "0.57785875", "0.5775145", "0.57558006", "0.57499766", "0.57298154", "0.57283866", "0.57248914", "0.5723621", "0.572315", "0.57206225", "0.57205623", "0.5707696", "0.570681", "0.570628", "0.5704969", "0.57028186", "0.5701304", "0.57001823", "0.5698715", "0.5686242", "0.5672495", "0.56709033", "0.5666789", "0.5666739", "0.56652886", "0.5663569", "0.5662483", "0.5655983", "0.56520146", "0.5648121", "0.56462705", "0.56364655", "0.5635753", "0.56346583", "0.5623925", "0.5622488", "0.5620874", "0.5615187", "0.561191", "0.5607827", "0.5605958", "0.5605958", "0.56041825", "0.55994654", "0.5596477", "0.5596477", "0.55930257", "0.55878276", "0.55878246", "0.55856806", "0.5584596", "0.55782205", "0.55565953", "0.5556243", "0.55501264" ]
0.70078164
1
checks if number correct
public boolean isValidPort(String port) { for(char x : port.toCharArray()) { if(!Character.isDigit(x)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkNumber() {\n\t\treturn true;\n\t}", "public boolean isValid(int number)", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tboolean check = true;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0) {\r\n\t\t\t\t\tnum = Math.abs(num);\r\n\t\t\t\t}\r\n\t\t\t\tcheck = false;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t\t\t// hvatanje greske i ispis da je unos pogresan\r\n\t\t\t\tSystem.out.println(\"You know it's wrong input, try again mate:\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (check);\r\n\t\treturn num;\r\n\t}", "static boolean checkNumber(int number) {\r\n\t\t\r\n\t\tint lastDigit= number%10;\r\n\t\tnumber/=10;\r\n\t\tboolean flag= false;\r\n\t\t\r\n\t\twhile(number>0) {\r\n\t\t\tif(lastDigit<=number%10) {\r\n\t\t\t\tflag=true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tlastDigit= number%10;\r\n\t\t\tnumber/=10;\r\n\t\t\t\t\r\n\t\t}\r\n\t\tif(flag) \r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private boolean validNum (int num) {\n if (num >= 0) return true;\n else return false;\n }", "@Override\n public boolean validate(long number) {\n List<Integer> digits = split(number);\n int multiplier = 1;\n int sum = 0;\n for (int digit : Lists.reverse(digits)) {\n int product = multiplier * digit;\n sum += product / BASE + product % BASE;\n multiplier = 3 - multiplier;\n }\n return sum % BASE == 0;\n }", "private boolean ifCorrect (int number){\n boolean check_correct = false;\n String temp = Integer.toString(number);\n char [] charArr = temp.toCharArray();\n for (int k = 0; k < temp.length()-1; k++){\n if (charArr[k] <= charArr[k+1]){\n check_correct = true;\n }\n else {\n check_correct = false;\n break;\n }\n }\n return check_correct;\n }", "public boolean validateNummer() {\n\t\treturn (nummer >= 10000 && nummer <= 99999 && nummer % 2 != 0); //return true==1 oder false==0\n\t}", "public void checkInput(TextField number) {\r\n\t\ttry {\r\n\t\t\tlong num = Long.parseLong(number.getText());\r\n\t\t\tif (num < 0) \t\t\t\t\t// ako je negativan broj, pretvorit cemo ga u pozitivan\r\n\t\t\t\tnum = Math.abs(num);\r\n\t\t\tif (isValid(num)) \r\n\t\t\t\tscene2();\r\n\t\t}\r\n\t\tcatch (Exception e) {\t\t\t\t// hvatanje greske\r\n\t\t\talert(\"Wrong input, try again!\");\r\n\t\t}\r\n\t}", "public static boolean checkIfArmstrongsNumber(int number){\n\t\tboolean isAremstrongNumber = false;\n\t\tint sum =0;\n\t\tchar [] numberArray =Integer.toString(number).toCharArray();\n\t for(char numbers:numberArray){\n\t \t Integer num=Integer.parseInt(Character.toString(numbers));\n\t \t sum=sum+(num*num*num);\n\t \t \n\t }\n\t\tif(sum == number){\n\t\t\tisAremstrongNumber = true;\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t\t\n\t\treturn isAremstrongNumber;\n\t\t\n\t}", "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}", "boolean hasNumber();", "static int check(int x, int a, int b) \n\t{ \n\t\t// sum of digits is 0 \n\t\tif (x == 0) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (x > 0) \n\t\t{ \n\n\t\t\t// if any of digits in sum is \n\t\t\t// other than a and b \n\t\t\tif (x % 10 != a & x % 10 != b) \n\t\t\t{ \n\t\t\t\treturn 0; \n\t\t\t} \n\n\t\t\tx /= 10; \n\t\t} \n\n\t\treturn 1; \n\t}", "public static boolean checkUnlucky(int num) {\n\t\twhile (num != 0) {\n\t\t\tif (num == 13) {\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\tnum = num / 10;\n\t\t}\n\t\treturn false;\n\t}", "boolean hasNum();", "boolean hasNum();", "boolean hasNum();", "public static void main(String[] args) {\n\t\r\n\t\tint a=153;\r\n\t\tint temp=a;\r\n\t\t\r\n\t\tint c=0;\r\n\t\tint b=0;\r\n\t\twhile(a>0)\r\n\t\t{\r\n\t\t\tc=a%10;\r\n\t\tb=b+c*c*c;\r\n\t\ta=a/10;}\r\n\tif(temp==b)\r\n\t{\r\n\t\tSystem.out.println(\"given no is amstrong\");\r\n\t\t\t\r\n\t}\t\r\n\telse\r\n\t{\r\n\t\tSystem.out.println(\"given no is not an amstrong number\");\r\n\t}\r\n\r\n\t\r\n\r\n\r\n}", "public static boolean isValid(long number) { \n\t\t\t\treturn (numberOfDigits(number) >= 13 && numberOfDigits(number) <= 16) && \n\t\t\t\t (matchPrefix(number, 4) || matchPrefix(number, 5) || matchPrefix(number, 37) || matchPrefix(number, 6)) && \n\t\t\t\t ((sumOfDoubleEvenPlace(number) + sumOfOddPlace(number)) % 10 == 0); \n\t\t\t}", "public static boolean isArmStrongNumber(int num){\n\n String number = String.valueOf(num); // converting int to String (String.valueOf)\n int multiplier = number.length(); // find the length; if length is 3 digits\n int sum =0;\n\n for(int i=0; i<multiplier; i++){ // loop the original number\n int digit = Integer.parseInt(\"\" +number.charAt(i));\n sum += Math.pow(digit,multiplier);\n }\n return sum == num;\n\n\n\n }", "public static boolean checkDiv11 (int n) \n {\n boolean flag=true; \n int sum=calcul(n, flag); //call the private calculation method\n if (sum>10||sum<-10) //there's other calculations, it's not a single digit number\n return checkDiv11(sum);\n return sum==0; //check if the calculation ended at zero and if so return true, otherwise false\n }", "private void check4(){\n \n if (errorCode == 0){\n int sum = 0;\n \n for(int i = 0; i < number.length();){\n sum += Integer.parseInt(number.substring(i, ++i));\n }\n \n if (sum % 4 != 0){\n valid = false;\n errorCode = 4;\n }\n }\n\t}", "public static boolean luckyNumber3(int number) {\n\t\tint sum = 0;\n\t\twhile (number != 0) {\n\t\t\tsum = number % 10 - sum;\n\t\t\tnumber /= 10;\n\t\t}\n\t\treturn sum == 0;\n\t}", "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 boolean checkForNumber(String field) {\n\n\t\tPattern p = Pattern.compile(\"[0-9].\");\n\t\tMatcher m = p.matcher(field);\n\n\t\treturn (m.find()) ? true : false;\n\t}", "public boolean hasNumber(){\n return (alg.hasNumber(input.getText().toString()));\n }", "public static boolean isValid(long number)\n\t{\n\t\tint total = sumOfDoubleEvenPlace(number) + sumOfOddPlace(number);\n\t\tif((total % 10 == 0 && prefixMatched(number, 1) \n\t\t\t\t&& getSize(number) >= 13 && getSize(number) <= 16))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean isGood(int num){\r\n\t\tif ((num<0)||(num>6)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "boolean numberIsLegal (int row, int col, int num) {\n\t\tif (isLegalRow(row, col, num)&&isLegalCol(col, row, num)&&isLegalBox(row,col,num)) {\n\t\t\treturn true;\n\t\t} else if (num == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean checkdigitsequal() {\n int count2=0;\n for (a = 0; a < 10; a++) {\n if (digits[a] == 0)\n {\n count2++;\n if(count2==10)return true;\n }\n else return false;\n }\n return false;\n }", "public static boolean isValid(long num) {\r\n\t\tint sum = sumOfDoubleEvenPlace(num) + sumOfOddPlace(num);\r\n\t\tif (getSize(num) < 13 || getSize(num) > 16) {\t\t\t// duzina broja ne smije biti manja od 13 i veca od 16\r\n\t\t\talert(\"Your credit card number is not long enough!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (prefixMatched(num) == false) {\t\t\t\t\t// ako uslov ne zadovoljava, odnosno ako je false, ispisi poruku\r\n\t\t\talert(\"Your credit card does not start with suitable prefix!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (sum % 10 != 0) {\t\t\t\t\t\t// uslov sume parnih i neparnih brojeva koji mora biti djeljiv sa 10\r\n\t\t\talert(\"Your credit card is invalid!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "private boolean isValidNumber(String quantity) {\n\t\ttry{\n\t\t\tint value=Integer.parseInt(quantity);\n\t\t\treturn value>0? true: false;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}", "private boolean camposNumCorrectos() {\n\t\t return Utilidades.isPositiveNumber(anioText.getText().trim());\n\t}", "@Test\n public void testcheckPalindromeNormal_1() {\n assertTrue(checkerNumber.checkPalindrome(12321));\n }", "public static boolean isValid(long number) {\r\n int length = getSize(number);\r\n if(!(length >=13 && length <= 16))\r\n return false;\r\n else if (!(prefixMatched(number)))\r\n return false;\r\n int sumOfDouble = sumOfDoubleEvenPlace(number);\r\n int sumOfOdd = sumOfOddPlace(number);\r\n if ((sumOfOdd + sumOfDouble) % 10 == 0)\r\n return true;\r\n return false;\r\n }", "private boolean checkValue(){\n\t\tfor (int i = 0; i <binary.length();i++){\n\t\t\tif(Character.getNumericValue(binary.charAt(i))>'1' || binary.length()>32 || binary.length()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t%4 != 0){\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t\tpw.println(\"Invalid Input\");\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\t\t\n\t}", "private int checkRange(int number,int range){\n return (number+range)%range;\n }", "public boolean guess(int number) {\n\t\tcountRound++;\n\t\tlastGuess = number;\n\t\t\n\t\tif(number == secret) {\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(number);\n\t\t\tsetMessage(\"Wow! Correct!! I'm thinking of \"+secret+\".\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (number < secret && number >= 1) setMessage(\"Umm, \" + number + \" is too small.\");\n\t\telse if (number > secret && number <= this.upperBound) setMessage(\"Oh! \" + number + \" is too large.\");\n\t\telse setMessage(\"Oops! Please input a valid number!!\");\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\treturn false;\n\t}", "public boolean hasValidUnitNum() {\n return getTotalUnits() <= 22;\n }", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\t\t\t// unos \r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t// hvatanje greske\r\n\t\t\t\tSystem.out.println(\"Pogresan unos, probajte ponovo\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t\treturn num;\r\n\t}", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "public boolean check() {\n BigInteger t1 = y.modPow(int2, c.p);\n BigInteger t2 = x.modPow(int3, c.p);\n BigInteger t3 = ((t2.add(c.a.multiply(x))).add(c.b)).mod(c.p);\n return t1.compareTo(t3) == 0;\n }", "boolean hasNum2();", "public boolean checkForNumber(int m, int n){\r\n\t\tif ( count[m][n] > 0 & count[m][n] < 9 & !bombs[m][n])\r\n\t\t\treturn true ;\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic boolean check(int[] digits) {\n\t\tif (digits.length <= 1 || digits == null) {\n\t\t\treturn false;\n\t\t}\n\t\tint total = 0;\n\t\tint check = digits[digits.length - 1]; // check digit\n\t\tboolean alternate = true;\n\n\t\tfor (int i = digits.length - 2; i >= 0; i--) {\n\n\t\t\t// double the value of every second digit\n\t\t\tif (alternate) {\n\t\t\t\tdigits[i] *= 2;\n\t\t\t}\n\n\t\t\tif (digits[i] > 9) {\n\t\t\t\tdigits[i] -= 9;\n\t\t\t}\n\n\t\t\talternate = !alternate;\n\t\t\ttotal += digits[i];\n\t\t}\n\n\t\ttotal += check; // add check digit to total\n\n\t\treturn total % 10 == 0;\n\t}", "public static boolean checkNum(int[][] puzzle){\n for(int i = 0; i < 9; i++){\n for(int j = 0; j < 9; j++){\n if(puzzle[i][j] != 0){\n if(!checkNumH(i, j, puzzle)){\n return false;\n }\n }\n }\n }\n return true;\n }", "private void check5(){\n \n if (errorCode == 0){\n \n int firstSum = 0;\n int lastSum = 0;\n String firstFour = number.substring(0,4);\n String lastFour = number.substring(8,12);\n \n for(int i = 0; i < firstFour.length();){\n firstSum += Integer.parseInt(firstFour.substring(i, ++i));\n }\n \n for(int i = 0; i < lastFour.length();){\n lastSum += Integer.parseInt(lastFour.substring(i, ++i));\n }\n \n if (!(firstSum == lastSum - 1)){\n valid = false;\n errorCode = 5;\n }\n }\n\t}", "public boolean verificaNumero() {\n if (contemSomenteNumeros(jTextFieldDeposita.getText()) || contemSomenteNumeros(jTextFieldSaca.getText())\n || contemSomenteNumeros(jTextFieldTransfere.getText())) {\n return true;\n } else {\n JOptionPane.showMessageDialog(this, \"Digite somente números, por favor. \", \"Atenção !!\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n }", "private boolean checkDigit(String code, int length) {\n int len = length - 1;\n int[] digits = new int[len];\n int digitSum = 0;\n int lastDigit;\n\n if (length == 13) {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n\n if (i % 2 == 0) {\n digits[i] = digit;\n } else {\n digits[i] = digit * 3;\n }\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (10 - (digitSum % 10) == lastDigit) {\n return true;\n } else if ((digitSum % 10) == 0 && lastDigit == 0) {\n return true;\n } else {\n return false;\n }\n\n } else if (length == 10) {\n if (String.valueOf(code.charAt(len)).equals(\"X\") ||\n String.valueOf(code.charAt(len)).equals(\"x\")) {\n lastDigit = 10;\n } else {\n lastDigit = Integer.parseInt(String.valueOf(code.charAt(len)));\n }\n\n int weight = 11;\n for (int i = 0; i < len; i++) {\n int digit = Integer.parseInt(String.valueOf(code.charAt(i)));\n weight--;\n digits[i] = digit * weight;\n }\n\n for (int i = 0; i < digits.length; i++) {\n digitSum = digitSum + digits[i];\n }\n\n if (11 - (digitSum % 11) == lastDigit) {\n return true;\n } else {\n return false;\n }\n\n } else {\n return false;\n }\n }", "public static boolean isWrongUserSquare()\n {\n boolean isWrong = false;\n int aux = 0;\n \n for (int i = 0; i < BOARD_WIDTH / 2; i++)\n {\n for (int j = 0; j < BOARD_HEIGHT / 2; j++)\n {\n aux = aux + playerBoardPos[i][j];\n }\n }\n \n if (!(aux == 10)) // Si el aux no tiene un 10 significa que hay un numero repetido.\n {\n isWrong = true;\n }\n \n return isWrong;\n }", "public void checkNumber(View view){\n Log.i(\"info\", \"button pressed\");\n String message;\n\n // take number from the form\n EditText number=(EditText) findViewById(R.id.editText2);\n if (number.getText().toString().isEmpty()){\n message=\"Please type a number.\";\n } else {\n int numberInt = Integer.parseInt(number.getText().toString());\n\n // use the class Number\n Number testNumber = new Number();\n testNumber.value = numberInt;\n\n // prepare to print message\n message = number.getText().toString();\n\n if (testNumber.isSquared() && testNumber.isTriangular()) {\n message += \" is a square and a triangular number.\";\n } else if (testNumber.isSquared()) {\n message += \" is a square number.\";\n } else if (testNumber.isTriangular()) {\n message += \" is a triangular number.\";\n } else {\n message += \" is neither triangular nor squared.\";\n }\n }\n // show a floating message that desapear after a few seconds\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n // clean the form\n number.setText(\"\");\n\n }", "@Test\n public void testIsValidPhonenumber() {\n System.out.println(\"isValidPhonenumber\");\n String phonenumber = \"gd566666666666666666666666666666666666666\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidPhonenumber(phonenumber);\n assertEquals(expResult, result);\n }", "@Test\n public void testIsValidInteger() {\n System.out.println(\"isValidInteger\");\n String integer = \"6.8\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidInteger(integer);\n assertEquals(expResult, result);\n }", "private boolean digits() {\r\n return ALT(\r\n GO() && RANGE('1','9') && decimals() || OK() && CHAR('0') && hexes()\r\n );\r\n }", "public boolean check(int value);", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a number that include 6 numbers\");\r\n\t\tint a = sc.nextInt();\r\n\t\tint a1=a/100000;\r\n\t\tint a2=a%100000/10000;\r\n\t\tint a3=a%10000/1000;\r\n\t\tint a4=a%1000/100;\r\n\t\tint a5=a%100/10;\r\n\t\tint a6=a%10;\r\n\t\tif (a1==a6 && a2==a5 && a3==a4){\r\n\t\t\tSystem.out.println(\"Yours number is polyndromic\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"Yours number is unpolyndromic\");\r\n\t\t}\r\n\t\t\t\r\n\t}", "public boolean isCorrect (int row, int col, int number) {\r\n return (solution[row][col] == number);\r\n }", "private boolean checkInteger(String str) {\n try {\n return Integer.parseInt(str) <= 30; // Check if the entered value is an Integer and <= 30;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "void showAlertForInvalidNumber();", "@Test\n public void testCheckIsPowerOfTwoNormal_1() {\n assertTrue(checkerNumber.checkIsPowerOfTwo(1024));\n }", "private boolean checkValidQuantity (int quantity){\n if (quantity >= 0){\n return true;\n }\n return false;\n }", "public boolean checkPerfectNumber(int num) {\n //num == 1 is special case.\n if(num == 1) return false;\n int sum = 1;\n for(int i = 2; i <= Math.sqrt(num); i++){\n if(num%i == 0){\n if(i == num/i) sum+=i;\n else sum = sum+i+num/i;\n }\n }\n return sum == num;\n }", "public boolean isArmstrongNumber(int input) {\n\t\tint size = Integer.toString(input).length();\n\t\tint sum = 0;\n\t\tList<Integer> numList = new ArrayList<Integer>();\n\t\tString num_string = Integer.toString(input);\n\t\tfor(int i =0; i < num_string.length(); i++) {\n\t\t\tchar num_char = num_string.charAt(i);\n\t\t\tint chartonum = num_char - '0';\n\t\t\tnumList.add(chartonum);\n\t\t}\n\t\tfor(Integer i : numList) {\n\t\t\t//System.out.println(i);\n\t\t\tsum += (int)(Math.pow(i, size));\n\t\t}\n\t\t//System.out.println(sum);\n\t\tif(sum == input) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isArmstrongNumber(int input) {\n\t\t\n\t\t//Convert input to a string format\n\t\tString inputValue = String.valueOf(input);\n\t\t\n\t\t//Iterate across the string\n\t\t//Raise the value of the int within the string to the power of the length of the string\n\t\t//Add this value to a temp value \n\t\t\n\t\tint temp = 0;\n\t\tfor(int i=0; i<inputValue.length(); i++) {\t\t\n\t\t\ttemp += Math.round(Math.pow(Character.getNumericValue(inputValue.charAt(i)),inputValue.length()));\n\t\t}\n\t\t\n\t\t//Check whether or not the obtained value matches the initial input\n\t\t\n\t\tif(input == temp) {\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\n\t}", "private boolean checkAttemptValid( String attempt ) {\r\n String tokenString = attempt.replaceAll( \"[^\\\\d]\", \" \");\r\n StringTokenizer st = new StringTokenizer(tokenString);\r\n int[] userNums = new int[st.countTokens()];\r\n int i=0;\r\n while(st.hasMoreTokens()) {\r\n int num = Integer.parseInt( st.nextToken());\r\n userNums[i] = num;\r\n i++;\r\n }\r\n if( !numbersCorrect( userNums )) {\r\n target.reply(\"You used a number not in the selection!\");\r\n return false;\r\n }\r\n //all numbers are correct, so now check remaining operators.\r\n //we gradually strip away everything allowed. If anything is left after that,\r\n //the attempt is invalid.\r\n attempt = attempt.replaceAll(\"\\\\d\", \"\"); //strip all numbers\r\n attempt = attempt.replaceAll(\"/\", \"\"); //strip \\ sign\r\n attempt = attempt.replaceAll(\"\\\\*\", \"\"); //strip *\r\n attempt = attempt.replaceAll(\"\\\\+\", \"\"); //strip +\r\n attempt = attempt.replaceAll(\"\\\\-\", \"\"); //strip -\r\n attempt = attempt.replaceAll(\"\\\\)\", \"\"); //strip )\r\n attempt = attempt.replaceAll(\"\\\\(\", \"\"); //strip (\r\n attempt = attempt.replaceAll(\" \", \"\"); //zap spaces\r\n\r\n return attempt.length() <= 0;\r\n }", "public int play(NumberGame game) {\n\t\tboolean correct = false ; \n\t\tint guess = 0 ;\n\t\tint min = 1 ;\n\t\tint max = game.getUpperBound() ;\n\t\tdo {\n\t\tSystem.out.print(\"Your answer? \");\n\t\tguess = min+((max-min)/2); \n\t\tcorrect = game.guess(guess);\n\t\tSystem.out.println(guess);\n\t\tif(game.getMessage().equals(\"The number is too small\")) {\n\t\t\tmin = guess+1 ; \n\t\t}else if(game.getMessage().equals(\"The number is too large\")) {\n\t\t\tmax = guess-1 ;\n\t\t}\n\n\t\tSystem.out.println( game.getMessage() );\n\t\t}while(!correct);\n\t\treturn guess ;\n\t}", "private boolean determineValid(){\n for(Integer val : group){\n if(!racers.containsKey(val)){\n WrongNumber = val;\n return false;\n }\n }\n return true;\n }", "protected boolean isNumberValid(@NotNull ConversationContext context, @NotNull Number input) {\n/* 30 */ return true;\n/* */ }", "private boolean isDigit(char toCheck) {\n return toCheck >= '0' && toCheck <= '9';\n }", "public static int checkInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t\tif(i<0) {\r\n\t\t\t\t\tSystem.out.println(\"Enter a positive number\");\r\n\t\t\t\t\tis_Nb = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}", "public void checkGuess() {\n\t\tString guessText = txtInput.getText();\r\n\t\tString message = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check the guess for too high/too low\r\n\t\t\tint guess = Integer.parseInt(guessText);\r\n\t\t\t//too high\r\n\t\t\tif (guess > theNumber) {\r\n\t\t\t\tmessage = guess + \" was too high. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else if (guess < theNumber) {\r\n\t\t\t\tmessage = guess + \" was too low. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else {\r\n\t\t\t\tmessage = guess + \" was right! You used \" + numberOfPlayerGuesses + \" guesses. Let's play again!\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnewGame();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tlblDirections2Result.setText(\"Enter a whole number between 1 and 100.\");\r\n\t\t}\r\n\t\t\r\n\t\ttxtInput.requestFocus();\r\n\t\ttxtInput.selectAll();\r\n\t\t\r\n\t\t\r\n\t}", "private boolean checkId() {\n int sum = 0;\n int id;\n\n try\n {\n id = Integer.parseInt(ID.getText().toString());\n }\n catch (Exception e)\n {\n return false;\n }\n\n if (id >= 1000000000)\n return false;\n\n for (int i = 1; id > 0; i = (i % 2) + 1) {\n int digit = (id % 10) * i;\n sum += digit / 10 + digit % 10;\n\n id=id/10;\n }\n\n if (sum % 10 != 0)\n return false;\n\n return true;\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 }", "public boolean guess(int number) {\n\t\tif (number == secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Correct! The secret is \"+secret+\"\\n\"+\"The count is \"+ count);\n\t\t\treturn true;\n\t\t} else if (number < secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too small.\");\n\t\t} else if (number > secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too large.\");\n\t\t}\n\t\treturn false;\n\t}", "public static int check(int[] array) {\n\t\tfor(int i= 0; i<array.length;i++) {\n\t\tif(array[i] < 0) {\n\t\t\tSystem.out.println(\"Number should be greater than 0\");\t\n\t\t}\n\t\tint reverseNum[] = revNum(array);\n\t\tif(reverseNum[i] == array[i]) {\n\t\t\tSystem.out.println(\"Number is palindrome\"+reverseNum[i]);\t\n\t\t}\n\t\t\t\t\n\t\t}\n\t\treturn 0;\n\n\t}", "public int valueCheck(int currentValue)\n { \n int currentVal = currentValue;\n \n if(digitChecker == 2)\n currentVal = a[k] % 10;\n else\n currentVal = a[k] / 10;\n \n return currentVal;\n }", "boolean hasNum1();", "int main()\n\n{\n\n int n,t,e,o;\n\n cin>>n;\n\n while(n>0)\n\n {\n\n t=n%10;\n\n if(t%2==0)\n\n {\n\n e=e+t;\n\n }\n\n else\n\n {\n\n o=o+t;\n\n }\n\n n=n/10;\n\n }\n\n if(e==o)\n\n {\n\n cout<<\"Yes\";\n\n }\n\n else\n\n {\n\n cout<<\"No\";\n\n }\n\n \n\n}", "private boolean checkInteger(byte buffer[], int sindex, int findex)\n {\n \t\t// 첫 글자를 체크한다. (+, -가 올수 있다.)\n \t\tbyte b = buffer[sindex];\n \t\tif ((b < 48) || (b > 57)) {\n \t\t\tif (b != 45)\n \t\t\t\tif (b != 43) return false;\n \t\t}\n \t\tfor (int i=sindex+1; i<findex; i++) {\n \tif ((buffer[i] < 48) || (buffer[i] > 57)) return false;\n \t\t}// end of for\n \t\treturn true;\n \t}", "@Override\n\t\t\tpublic boolean test(Integer t) {\n\t\t\t\treturn false;\n\t\t\t}", "private boolean validarNumDistanc(double value) {\n\n String msjeError;\n if (value < 0) {\n\n msjeError = \"Valor No Aceptado\";\n this.jLabelError.setText(msjeError);\n this.jLabelError.setForeground(Color.RED);\n this.jLabelError.setVisible(true);\n\n this.jLabel5.setForeground(Color.red);\n return false;\n } else {\n\n this.jLabel5.setForeground(jlabelColor);\n this.jLabelError.setVisible(false);\n return true;\n }\n }", "public static int checkInput() {\r\n\t\tint num = 0;\r\n\t\tboolean error = true; // check for error\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\t// input has to be an integer and not negative number\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0)\r\n\t\t\t\t\tthrow new InputMismatchException();\r\n\t\t\t\terror = false;\r\n\r\n\t\t\t} catch (InputMismatchException e) {\r\n\r\n\t\t\t\tSystem.out.print(\"Wrong input, try again...: \");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\t// loop continue while there is an error\r\n\t\t} while (error);\r\n\r\n\t\treturn num;\r\n\t}", "private static void numberTester(String userNumber, String randomNumber)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tint digitsEqual = 0;\n\t\twhile (digitsEqual != 4)\n\t\t{\n\t\t\tdigitsEqual = 0;\n\t\t\tfor (int i = 0; i < userNumber.length(); i++)\n\t\t\t{\n\t\t\t\n\t\t\t\tchar userResult = userNumber.charAt(i);\n\t\t\t\tchar randomResult = randomNumber.charAt(i);\n\t\t\t\tif (userResult == randomResult)\n\t\t\t\t{\n\t\t\t\t\tdigitsEqual = digitsEqual + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.printf(\"You matched %d digits.\\n\", digitsEqual);\n\t\t\tif (digitsEqual != 4)\n\t\t\t{\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"\\nEnter another number: \");\n\t\t\t\t\tint updatedNumber = in.nextInt();\n\t\t\t\t\tuserNumber = String.valueOf(updatedNumber);\n\t\t\t\t\tif (userNumber.length() != 4)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Please enter a number with 4 digits.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile (userNumber.length() != 4);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t}", "private void check2(){\n \n // All methods past the first rule check to see\n // if errorCode is still 0 or not; if not skips respective method\n if(errorCode == 0){\n \n if (!(fourthDigit == fifthDigit + 1)){\n valid = false;\n errorCode = 2;\n }\n }\n\t}", "public static void main(String[] args) {\nint num=4550,temp,r,sum=0;\ntemp=num;\nwhile(num>0) {\n\tr=num%10;\n\tsum=(sum*10)+r;\n\tnum=num/10;\n\t\n}\n\tif(temp==sum) {\n\t\tSystem.out.println(\"number is palindrome\");\n\t}\n\telse {\n\t\tSystem.out.println(\"number is not palindrome\");\n\t}\n\t}", "public void checkRule() {\n if (s.matches(\"^\\\\d+$\"))\n System.out.println(\"I see a number. Rule 2 \");\n }", "public static void main (String[] args){\n Scanner in = new Scanner (System.in);\n int num = in.nextInt();\n int sum=1,sum1=0,n,check=num;\n for(;num!=0;)\n {\n n=num%10;\n sum=1;\n for( int i=n;i>0;i--){\n sum=sum*i;\n }\n sum1 = sum1+sum;\n num=num/10;\n \n }\n if(check==sum1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n\n\n\t}", "public static void main(String[] args) {\r\n\tScanner scn=new Scanner(System.in);\r\n\tSystem.out.println(\"ENTER NUMBER TO CHECK NEON NUMBER\");\r\n\tint ee=scn.nextInt();\r\n\tint f=ee*ee;\r\n\tint n=0;\r\n\twhile(f>0)\r\n\t{\r\n\t\tint q=f%10;\r\n\t\tn=n+q;\r\n\t\tf=f/10;\r\n\t}\r\n\tif(n==ee)\r\n\t{\r\n\t\tSystem.out.println(\"ITS IS A NEON NUMBER\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tSystem.out.println(\"ITS IS NOT A NEON NUMBER\");\r\n\t}\r\n}", "public void checkGuess() {\n\t\tString guessText = txtGuess.getText();\n\t\tString message = \"\";\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\t//check users guess too high/too low\n\t\t\tint guess = Integer.parseInt(guessText);\n\t\t\t\n\t\t\tif ( guess < 0 || guess > 100) {\n\t\t\t\tthrow new Exception(\"User entry out of range\");\n\t\t\t}//if\n\n\t\t\t//too high\n\t\t\tif(guess > theNumber){\n\t\t\t\tmessage = guess + \" is to high guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}//if\n\t\t\t//too low\n\t\t\telse if (guess < theNumber){\n\t\t\t\tmessage = guess + \" is to low guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}else{//guessed correct\n\t\t\t\tmessage = guess + \" was right! You win! Let's play again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t\tnewGame();\n\t\t\t}//else\n\t\t}//try\n\t\tcatch(Exception e) {\n\t\t\tlblOutput.setText(\"Enter a whole number between 1-100\"); \n\t\t}//catch\n\t\tfinally {\n\t\t\t\n\t\t\ttxtGuess.requestFocus();\n\t\t\ttxtGuess.selectAll();\n\t\t\t\n\t\t}//finally\n\t}", "public boolean isArmstrongNumber(int input) {\n\t\tint sumOfDigits = 0, power = Integer.toString(input).length();\n\t\tfor (int i = 0; i < power; i++)\n\t\t\tsumOfDigits += Math.pow(Integer.parseInt(Integer.toString(input).substring(i, i + 1)), power);\n\t\treturn sumOfDigits == input;\n\t}", "@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 }", "boolean isMismatch(double score);", "private boolean isValidQuiz1(double quiz1)\n\t{\n\t\treturn quiz1 >= 0 && quiz1 <= 10;\n\t}", "@Test\n public void test() {\n assertFalse(checkZeroOnes(\"111000\"));\n }", "private boolean isValidQuiz3(double quiz3)\n\t{\n\t\treturn quiz3 >= 0 && quiz3 <= 10;\n\t}", "public static boolean isSpecial(int num) {\n\t\tint a = 2;// be the div number\r\n\t\tint b = 0;// be the number count 2,3,4,5\r\n\t\tnum = 2*num;\r\n\t\tint c = num/4;\r\n\t\tint d = 0;\r\n\t\tif (num <= 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\twhile (num > 1) {\r\n\t\t\tif(a > c){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (num % a == 0) {\r\n\t\t\t\twhile (num % a == 0) {\r\n\t\t\t\t\tnum = num / a;\r\n\t\t\t\t}\r\n\t\t\t\tb++;\r\n\t\t\t\t}\r\n\t\t\ta++;\r\n\t\t\t}\r\n\t\tint e = b;\r\n\t\td = e;\r\n\t\tif (d != 3)\r\n\t\t{return false;}\r\n\t\tif( d==3 ){return true;}\r\n\r\n\t\treturn false;\r\n\t}", "private void checkNumber(int buttonNum) {\n if(counter==buttonNum && testStarted==true){\n if (buttonNum == 25) {\n testComplete = true;\n this.stopTimer();\n this.setEnabledStart(false); // Hide Start button because test complete\n }\n errorLabel.setText(\"\");\n counter++;\n }\n else if(testStarted == false){\n // Display test not started error\n errorLabel.setText(\"Press Start to begin the test.\"); \n }\n else{\n // Display wrong number error\n errorLabel.setText(\"Wrong number. Try again.\");\n // Have error message time-out afer 2.5 seconds\n int delay = 2500; //milliseconds\n ActionListener taskPerformer = new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent evt) {\n errorLabel.setText(\"\");\n }\n };\n new Timer(delay, taskPerformer).start();\n }\n }", "public static void main(String[] args) {\n Numbers numbers = new Numbers(9,988,77,66);\n String maxnum = numbers.getMaxNum();\n //if (maxnum.equals(\"99989788\")) {\n if (maxnum.equals(\"99887766\")) {\n System.out.println(\"right\");\n } else {\n System.out.println(\"wrong\");\n }\n }" ]
[ "0.76411796", "0.7173242", "0.7146938", "0.7141784", "0.69321835", "0.68912596", "0.68420845", "0.6803178", "0.67103535", "0.66122913", "0.65642494", "0.6563043", "0.6526582", "0.65099084", "0.6489859", "0.6489859", "0.6489859", "0.64251745", "0.6404341", "0.64035535", "0.63690495", "0.63657063", "0.63563824", "0.6334194", "0.6321046", "0.63164705", "0.6290931", "0.62602603", "0.6242954", "0.6236523", "0.6232002", "0.6230095", "0.6219347", "0.62168765", "0.6183167", "0.61767447", "0.61756134", "0.61643857", "0.6154544", "0.6146445", "0.61371094", "0.61366427", "0.6133778", "0.6121678", "0.6121663", "0.6117841", "0.61056316", "0.60970294", "0.6063835", "0.6057842", "0.6050824", "0.60450387", "0.6044006", "0.6032027", "0.6028359", "0.602165", "0.6019512", "0.6017074", "0.6006646", "0.5995588", "0.599342", "0.5991309", "0.59790385", "0.5976856", "0.5976535", "0.5967299", "0.59476006", "0.5946125", "0.59427524", "0.5930987", "0.5929151", "0.5926118", "0.592175", "0.59191585", "0.59135014", "0.59040904", "0.59020996", "0.5901714", "0.58967316", "0.5891976", "0.5885059", "0.58733785", "0.5872725", "0.58686656", "0.5862329", "0.5854259", "0.5851932", "0.5836837", "0.582255", "0.58196646", "0.58136475", "0.5798462", "0.57936406", "0.57904255", "0.57904136", "0.57882494", "0.5786018", "0.5774872", "0.5768733", "0.5757429", "0.57456315" ]
0.0
-1
checks if Ip is correct
public boolean isValidIP(String port) { for(char x : port.toCharArray()) { if((!Character.isDigit(x)) && x != '.') { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "private boolean validate(final String ip){\t\t \n \t Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);\n\t Matcher matcher = pattern.matcher(ip);\n\t return matcher.matches();\t \t \n }", "private static boolean validatingIP(String IP)\n {\n if(IP.equalsIgnoreCase(\"localhost\"))\n {\n return true;\n }\n try\n {\n if (IP == null || IP.isEmpty())\n {\n return false;\n }\n\n String[] parts = IP.split(\"\\\\.\");\n if (parts.length != 4)\n {\n return false;\n }\n\n for (String s : parts)\n {\n int i = Integer.parseInt(s);\n if ((i < 0) || (i > 255))\n {\n return false;\n }\n }\n if (IP.endsWith(\".\"))\n {\n return false;\n }\n\n return true;\n }\n catch (NumberFormatException nfe)\n {\n return false;\n }\n\n }", "private boolean validateIP(String ip){\n String pattern = \"^(1\\\\d{2}|2[0-4]\\\\d|25[0-5]|[1-9]\\\\d|[1-9])\\\\.\"\n +\"(1\\\\d{2}|2[0-4]\\\\d|25[0-5]|[1-9]\\\\d|\\\\d)\\\\.\"\n +\"(1\\\\d{2}|2[0-4]\\\\d|25[0-5]|[1-9]\\\\d|\\\\d)\\\\.\"\n +\"(1\\\\d{2}|2[0-4]\\\\d|25[0-5]|[1-9]\\\\d|\\\\d)$\";\n Pattern compile = Pattern.compile(pattern);\n return compile.matcher(ip).matches();\n }", "public boolean validateIP(String ip)\n\t{\n\t\treturn ip.matches(\"localhost\") || ip.matches(IP_REGEX);\n\t}", "public boolean isIpAccessible(String url) {\n URL img = null;\n try {\n img = new URL(url);\n InputStream s = img.openStream();\n byte[] b = new byte[256];\n s.read(b);\n String str = new String(b);\n System.out.println(str);\n s.close();\n return true;\n } catch (java.io.IOException e) {\n return false;\n }\n }", "private boolean validate(final String ip) {\t \n final Matcher matcher = m_pattern.matcher(ip);\n return matcher.matches();\n }", "private static boolean isValidIpAddress(String value) {\n boolean status = true;\n try {\n Ip4Address ipAddress = Ip4Address.valueOf(value);\n } catch (Exception e) {\n log.debug(\"Invalid IP address string: {}\", value);\n return false;\n }\n\n return status;\n }", "boolean hasCanIpForward();", "boolean hasClientIpV4();", "static boolean validateIP(String ip) {\n String[] ips = ip.split(\"\\\\.\");\n System.out.println(Arrays.toString(ips));\n if(ips.length != 4) return false;\n System.out.println(Arrays.toString(ips));\n \n for(String s : ips){\n int b;\n try{\n b = Integer.parseInt(s);\n if(b<0 || b> 255)return false;\n }catch(Exception e){\n return false;\n }\n }\n \n return true;\n\t}", "int getInIp();", "int getInIp();", "@Override\n\tpublic boolean validate(String ip) {\n\t\tPattern pattern = Pattern.compile(IPADDRESS_PATTERN);\n\t\tMatcher matcher = pattern.matcher(ip);\n\t\treturn matcher.matches();\n\t}", "public boolean checkServer() {\n boolean result = false;\n \n int url = 195885416; //Using www.vg.no for now. There might be a problem in the ip-format, but we'll know more after testing.\n if(isNetworkAvailable()) {\n ConnectivityManager cm = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);\n \n if(cm.requestRouteToHost(ConnectivityManager.TYPE_WIFI, url)) {\n result = true;\n } else if(cm.requestRouteToHost(ConnectivityManager.TYPE_MOBILE, url)) {\n result = true;\n }\n }\n \n return result;\n }", "private static Boolean isAnIp(final String ip) {\n\t\treturn PATTERN.matcher(ip).matches();\n\t}", "public static boolean isIpAddress(String ip) {\n String regex = \"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n if (ip.matches(regex)) {\n return true;\n }\n return false;\n }", "int getIp();", "int getIp();", "int getIp();", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "private int checkIPCompatibility(String ip_detect_type) {\n if (!ip_detect_type.equals(\"ipv4\") && !ip_detect_type.equals(\"ipv6\")) {\n return IP_TYPE_CANNOT_DECIDE;\n }\n Socket tcpSocket = new Socket();\n try {\n ArrayList<String> hostnameList = MLabNS.Lookup(context, \"mobiperf\", \n ip_detect_type, \"ip\");\n // MLabNS returns at least one ip address\n if (hostnameList.isEmpty())\n return IP_TYPE_CANNOT_DECIDE;\n // Use the first result in the element\n String hostname = hostnameList.get(0);\n SocketAddress remoteAddr = new InetSocketAddress(hostname, portNum);\n tcpSocket.setTcpNoDelay(true);\n tcpSocket.connect(remoteAddr, tcpTimeout);\n } catch (ConnectException e) {\n // Server is not reachable due to client not support ipv6\n Logger.e(\"Connection exception is \" + e.getMessage());\n return IP_TYPE_UNCONNECTIVITY;\n } catch (IOException e) {\n // Client timer expired\n Logger.e(\"Fail to setup TCP in checkIPCompatibility(). \"\n + e.getMessage());\n return IP_TYPE_CANNOT_DECIDE;\n } catch (InvalidParameterException e) {\n // MLabNS service lookup fail\n Logger.e(\"InvalidParameterException in checkIPCompatibility(). \"\n + e.getMessage());\n return IP_TYPE_CANNOT_DECIDE;\n } catch (IllegalArgumentException e) {\n Logger.e(\"IllegalArgumentException in checkIPCompatibility(). \"\n + e.getMessage());\n return IP_TYPE_CANNOT_DECIDE;\n } finally {\n try {\n tcpSocket.close();\n } catch (IOException e) {\n Logger.e(\"Fail to close TCP in checkIPCompatibility().\");\n return IP_TYPE_CANNOT_DECIDE;\n }\n }\n return IP_TYPE_CONNECTIVITY;\n }", "@Override\r\n\tpublic boolean hasIpAddressSupport() {\n\t\treturn false;\r\n\t}", "public boolean networkCheck(String region) throws IOException {\r\n // Debug mode can be run offline.\r\n if(DEBUG) {\r\n return true;\r\n }\r\n \r\n try {\r\n getServerStatusData();\r\n networkOK = true;\r\n return true;\r\n }\r\n catch(UnknownHostException e) {\r\n System.out.println(e);\r\n networkOK = false;\r\n return false;\r\n }\r\n }", "public boolean isNetworkValid()\n\t{\n\t\t// TODO will need to implement this..\n\t\treturn true;\n\t}", "public static boolean isValidIP(String a_ipAddress)\n\t{\n\t\tStringTokenizer tokenizer;\n\n\t\tif ( (a_ipAddress == null) || (a_ipAddress.indexOf('-') != -1))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\ttokenizer = new StringTokenizer(a_ipAddress, \".\");\n\n\t\ttry\n\t\t{\n\t\t\t// test if the IP could be IPv4 or IPv6\n\t\t\tif ( (tokenizer.countTokens() != 4) && (tokenizer.countTokens() != 16))\n\t\t\t{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\n\t\t\twhile (tokenizer.hasMoreTokens())\n\t\t\t{\n\t\t\t\tif (new Integer(tokenizer.nextToken()).intValue() > 255)\n\t\t\t\t{\n\t\t\t\t\tthrow new NumberFormatException();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NumberFormatException a_e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "boolean hasClientIpV6();", "public boolean existsAddress(byte ip[])\n {\n try\n {\n return (resolve(ip)!=null); \n }\n catch (UnknownHostException e)\n {\n return false; \n }\n }", "@Test\n public void shouldGetHostAddress() {\n assertEquals(NE_IP, session.getAddress().getHostAddress());\n }", "public static String getWANIP() {\n URL whatismyip = null;\n BufferedReader in = null;\n try {\n \twhatismyip = new URL(\"http://checkip.amazonaws.com\");\n in = new BufferedReader(new InputStreamReader(whatismyip.openStream()));\n String ip = in.readLine();\n return ip;\n } catch (IOException e) {\n \treturn \"No internet.\";\n\t\t}\n }", "private boolean isPrivateIpRange(String ipAddress)\n {\n InetAddress inetAddress = null;\n\n try {\n byte[] ip = InetAddress.getByName(ipAddress).getAddress();\n inetAddress = InetAddress.getByAddress(ip);\n return inetAddress.isSiteLocalAddress(); // let java sort it out.\n } catch (UnknownHostException e) {\n log.debug(\"Ip private range check failed \", e);\n return false;\n }\n }", "NetworkStaticIPAvailabilityResponse check(String networkName, InetAddress ipAddress) throws IOException, ServiceException, ParserConfigurationException, SAXException;", "String getIp();", "String getIp();", "public static boolean validIP(String ip) {\r\n\t try {\r\n\t if ( ip == null || ip.isEmpty() ) {\r\n\t return false;\r\n\t }\r\n\r\n\t String[] parts = ip.split( \"\\\\.\" );\r\n\t if ( parts.length != 4 ) {\r\n\t return false;\r\n\t }\r\n\r\n\t for ( String s : parts ) {\r\n\t int i = Integer.parseInt( s );\r\n\t if ( (i < 0) || (i > 255) ) {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t if ( ip.endsWith(\".\") ) {\r\n\t return false;\r\n\t }\r\n\r\n\t return true;\r\n\t } catch (NumberFormatException nfe) {\r\n\t return false;\r\n\t }\r\n\t}", "public boolean isHostReachable(String sIPAddress) {\n try {\n\n Process p1 = java.lang.Runtime.getRuntime().exec(\"ping \" + sIPAddress);\n int iRetVal = p1.waitFor();\n if (iRetVal == 0) {\n return true;\n } else {\n return false;\n }\n\n //InetAddress inet = InetAddress.getByName(sIPAddress);\n //return (inet.isReachable(5000) ? true : false);\n } catch (Exception e) {\n return false;\n }\n }", "int getS1Ip();", "private boolean checkOrigin(InetSocketAddress remoteAddress, boolean isSecured) {\n try {\n if (GlobalSettingsAndNotifier.singleton.getSetting(\"RESTRICT_SECURE\").equals(\"true\") && !isSecured) {\n return false;\n }\n String mode = GlobalSettingsAndNotifier.singleton.getSetting(\"NET_ORIGIN\");\n if (mode.equals(\"NO_RESTRICTIONS\")) {\n return true;\n }\n String a = remoteAddress.getAddress().toString().split(\"/\")[1];\n String add = a.split(\":\")[0];\n if (add == null) {\n add = a;\n }\n System.out.println(add);\n String[] parts = null;\n if (add.contains(\"-\")) {\n\n parts = add.split(\"-\");\n }\n if (add.contains('.' + \"\")) {\n\n parts = add.split(\"\\\\.\");\n }\n\n if (parts == null) {\n\n return false;\n }\n if (parts.length != 4) {\n\n return false;\n }\n final int[] remote = new int[]{Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), Integer.parseInt(parts[2]), Integer.parseInt(parts[3])};\n if (mode.equals(\"RESTRICT_LAN\")) {\n return networkAddressRange.isOnLAN(remote);\n }\n Iterator<networkAddressRange> inar = GlobalSettingsAndNotifier.singleton.permited.iterator();\n System.out.println(\"NrOf rules \" + GlobalSettingsAndNotifier.singleton.permited.size());\n while (inar.hasNext()) {\n\n networkAddressRange n = inar.next();\n System.out.println(\"Check\" + n.getNetworkForHumans());\n n.getAction();\n switch (n.isAllowed(new int[]{Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), Integer.parseInt(parts[2]), Integer.parseInt(parts[3])}, isSecured)) {\n case 1:\n return true;\n case -1:\n return false;\n\n }\n }\n } catch (Exception ex) {\n System.out.println(ex.toString());\n\n }\n\n if (GlobalSettingsAndNotifier.singleton.getSetting(\"IMPLICIT_ALLOW\").equalsIgnoreCase(\"true\")) {\n\n return true;\n }\n\n return false;\n }", "public static boolean IpAddress(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"IpAddress\")) return false;\n if (!nextTokenIs(b, \"<ip address>\", JB_TOKEN_IP, JB_TOKEN_WORD)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, \"<ip address>\");\n r = consumeToken(b, JB_TOKEN_IP);\n if (!r) r = IpAddress_1(b, l + 1);\n exit_section_(b, l, m, JB_IP_ADDRESS, r, false, null);\n return r;\n }", "public static String getIP()\n {\n try\n {\n URL whatismyip = new URL(\"http://checkip.amazonaws.com\");\n BufferedReader in = new BufferedReader(new InputStreamReader(\n whatismyip.openStream()));\n\n String ip = in.readLine(); //you get the IP as a String\n return ip;\n }\n catch (Exception exc)\n {\n System.out.println(\"Get internet IP address error:\" + exc.toString());\n return \"\";\n }\n }", "private void testConnection(){ \n\t\t\tconnection=false;\n\t\t\tip = ipfield.getText().toString();\n\t\t\tLog.d(null,\"ip is \"+ip);\n\t\t\tif(ip.equals(\"\")) \n\t\t\t\tToast.makeText(getApplicationContext(), \"Please Enter an IP Address\", Toast.LENGTH_SHORT).show();\n\t\t\telse{\n\t\t\t\tRunnable runnable = new Runnable(){\n\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tSocket s = new Socket(ip,6969);\n\t\t\t\t\t\t\t\ts.close();\n\t\t\t\t\t\t\t\tconnection=true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t catch (UnknownHostException e1) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tThread thread = new Thread(runnable);\n\t\t\t\tthread.start();\n\t\t\t}\n\t}", "boolean hasBitcoinAddress();", "private boolean checkNetworkState() {\n ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n if (connectivityManager.getActiveNetworkInfo() == null || !connectivityManager.getActiveNetworkInfo().isConnected()) {\n showNetworkAlert();\n return false;\n }\n\n else return true;\n }", "Future<NetworkStaticIPAvailabilityResponse> checkAsync(String networkName, InetAddress ipAddress);", "int getClientIpV4();", "public boolean getByIP(String ip){\n\t\n\t\ttry {\n\t\t\n\t\t\n\t\tInetAddress address = InetAddress.getByAddress(this.translateIPtobytecode(ip));\n\t\t/*\n\t\t\taddress.getHostName();\n\t address.getHostAddress();\n\t address.isReachable(3000);\n\t */\n\t /*System.out.println(\"Name: \" + address.getHostName());\n\t System.out.println(\"Addr: \" + address.getHostAddress());\n\t System.out.println(\"Reach: \" + address.isReachable(6000));\n\t */\n\t return address.isReachable(3000);\n\t \n\t \n\t\t }\n\t catch (UnknownHostException e) {\n\t System.err.println(\"Unable to lookup\"+ip);\n\t return false;\n\t }\n\t catch (IOException e) {\n\t System.err.println(\"Unable to reach \"+ip);\n\t return false;\n\t }\n\t}", "@Test\n public void testInterfaceIp() throws Exception {\n isisNeighbor.setInterfaceIp(interfaceIp);\n result2 = isisNeighbor.interfaceIp();\n assertThat(result2, is(interfaceIp));\n }", "boolean getCanIpForward();", "private void verifyExistIp(String ip){\n List ips = logRepositoy.findByIp(ip);\n if(ips.isEmpty()){\n throw new ResourceNotFoundException(\"Ip address not found\");\n }\n }", "private boolean matchIP(Host host, StaticPacketTrace failTrace, Builder selectorBuilder,\n EtherType etherType, boolean src) {\n List<IpAddress> ips = getIpAddresses(host, etherType, true);\n\n if (ips.size() > 0) {\n if (etherType.equals(EtherType.IPV4)) {\n if (src) {\n selectorBuilder.matchIPSrc(ips.get(0).toIpPrefix());\n } else {\n selectorBuilder.matchIPDst(ips.get(0).toIpPrefix());\n }\n } else if (etherType.equals(EtherType.IPV6)) {\n if (src) {\n selectorBuilder.matchIPv6Src(ips.get(0).toIpPrefix());\n } else {\n selectorBuilder.matchIPv6Dst(ips.get(0).toIpPrefix());\n }\n }\n } else {\n failTrace.addResultMessage(\"Host \" + host + \" has no \" + etherType + \" address\");\n failTrace.setSuccess(false);\n return false;\n }\n return true;\n }", "private static int compareIP(String ip1, String ip2) {\n\t\tlong[] ip11 = parseIp(ip1);\r\n\t\tlong[] ip22 = parseIp(ip2);\r\n\t\tlong ip1Result = 0, ip2Result = 0;\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tip1Result += (ip11[i] << (24 - i * 8));\r\n\t\t}\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tip2Result += (ip22[i] << (24 - i * 8));\r\n\t\t}\r\n\t\tif (ip1Result - ip2Result > 0) {\r\n\t\t\treturn 1;\r\n\t\t} else if (ip1Result - ip2Result < 0) {\r\n\t\t\treturn -1;\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "@Test\n public void iPAddressIsThreatTest() throws Exception {\n String value = null;\n IPThreatResponse response = api.iPAddressIsThreat(value);\n\n // TODO: test validations\n }", "public boolean isOnline() {\n Runtime runtime = Runtime.getRuntime();\n try {\n Process ipProcess = runtime.exec(\"/system/bin/ping -c 1 8.8.8.8\");\n int exitValue = ipProcess.waitFor();\n return (exitValue == 0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return false;\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkIPv6() {\n\t\tboolean flag = oTest.checkIPv6();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public String getIp();", "private boolean isReachable(String addr, int openPort) {\n try \n {\n ClienteUDP cliente = new ClienteUDP(addr);\n cliente.enviar(\"hola,df,df\");\n String rpta = cliente.recibir();\n if(rpta.equals(\"hola\"))\n return true;\n }catch(Exception e)\n {\n return false;\n }\n return false;\n }", "@Test\n public void testAddressVersion() {\n assertThat(Ip4Address.VERSION, is(IpAddress.Version.INET));\n }", "java.lang.String getSnIp();", "java.lang.String getSnIp();", "public static boolean isConnectedToInternet() {\n String pingServerURL = pingBackUrl.substring(0, pingBackUrl.indexOf(\"/\", \"http://url\".length()));\n try {\n URL url = new URL(pingServerURL);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n urlConn.connect();\n return (HttpURLConnection.HTTP_NOT_FOUND != urlConn.getResponseCode());\n } catch (MalformedURLException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n \n } catch (IOException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n }\n return false;\n }", "public boolean IsReachable(Context context) {\n final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n final NetworkInfo netInfo = connMgr.getActiveNetworkInfo();\n boolean isReachable = false;\n\n if (netInfo != null && netInfo.isConnected()) {\n // Some sort of connection is open, check if server is reachable\n try {\n URL url = new URL(\"http://\"+ipAddress);\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\n urlc.setRequestProperty(\"User-Agent\", \"Android Application\");\n urlc.setRequestProperty(\"Connection\", \"close\");\n urlc.setConnectTimeout(10 * 2000);\n urlc.connect();\n isReachable = (urlc.getResponseCode() == 200);\n } catch (IOException e) {\n //Log.e(TAG, e.getMessage());\n }\n }\n\n return isReachable;\n }", "private String getClientIP(){\n try {\n ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n @SuppressWarnings(\"deprecation\")\n NetworkInfo mobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);\n\n if (wifi.isConnected()) {\n // If Wi-Fi connected\n return getWifiIP();\n }\n\n if (mobile.isConnected()) {\n // If Internet connected\n return getMobileIP();\n }\n\n return null;\n }catch(SecurityException e){\n return null;\n }\n }", "@Test\r\n public void ipConnectionTest()\r\n {\r\n try\r\n {\r\n MSocket ms = new MSocket(InetAddress.getByName(LOCALHOST), LOCAL_PORT);\r\n InputStream is = ms.getInputStream();\r\n OutputStream os = ms.getOutputStream();\r\n echoTest(is, os, 54);\r\n echoTest(is, os, 45);\r\n ms.close();\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n fail(\"IP Connection test failed\");\r\n }\r\n }", "boolean hasAddress();", "boolean hasAddress();", "private static boolean valid(String arg) {\n\n /* check if valid option */\n if ( arg.equals(\"-v\") || arg.equals(\"-i\") || arg.equals(\"-p\") || arg.equals(\"-h\") )\n return true;\n\n /* check if valid port */\n try {\n int port = Integer.parseInt(arg);\n if ( ( 0 < port ) && ( port < 65354 ) )\n return true;\n } catch (NumberFormatException ignored) {}\n\n /* check if valid ip address */\n String[] ips = arg.split(\"\\\\.\");\n if ( ips.length != 4 )\n return false;\n try{\n for (int i=0; i<4; i++){\n int ip = Integer.parseInt(ips[i]);\n if ( ( ip < 0) || (255 < ip ) )\n return false;\n }\n } catch (NumberFormatException ignored) {return false;}\n\n return true;\n }", "String getRemoteIpAddress();", "void onConnectToNetByIPFailure();", "public void test4(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getCanonicalHostName().equalsIgnoreCase(\"trustme.com\")){ /* BUG */\n\n }\n }", "public boolean verificarFormatoIPV4(String ip) {\n\t\ttry {\n\t\t\tif (ip == null || ip.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tString[] parts = ip.split(\"\\\\.\");\n\t\t\tif (parts.length != 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (String s : parts) {\n\t\t\t\tint i = Integer.parseInt(s);\n\t\t\t\tif ((i < 0) || (i > 255)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ip.endsWith(\".\")) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isNetworkReachable();", "public void checkNetworks(){\n\t if(operatorName.contains(\"odafone\") || operatorName.contains(\"VODAFONE\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //t-mobile - telekom\n\t else if(operatorName.contains(\"t-\") || operatorName.contains(\"T-\") || operatorName.contains(\"T Mobile\")\n\t \t\t || operatorName.contains(\"elekom\") || operatorName.contains(\"TELEKOM\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //e-plus\n\t else if(operatorName.contains(\"plus\") || operatorName.contains(\"Plus\") || operatorName.contains(\"PLUS\")){\n\t \tcode = \"*100\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t //o2\n\t else if(operatorName.contains(\"o2\") || operatorName.contains(\"O2\")){\n\t \tcode = \"*101\" + encodedHash;\n\t \t//contact network provider\n\t \tcallUSSD(code);\n\t }\n\t \n\t else{\n\t \t//if network is not supported\t\n\t \tdiyUssd();\n\t }\n\t }", "boolean hasRemoteHost();", "public void test3(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getCanonicalHostName().equals(\"trustme.com\")){ /* BUG */\n\n }\n }", "public InetAddress getIP();", "private void findInternalExternalIP() {\n\t\ttry {\n\t\t\texternalIP = InetAddress.getByName(getExternalIP());\n\t\t} catch (UnknownHostException e) {\n\t\t\tDecentLogger.write(\"Unable to to resolve external IP to InetAddress (problem with ip provider?)\");\n\t\t}\n\t\ttry {\n\t\t\tinternalIP = InetAddress.getLocalHost();\n\t\t} catch (UnknownHostException e) {\n\t\t\tDecentLogger.write(\"Unable to to resolve internal IP to InetAddress\");\n\t\t}\n\t}", "public void test6(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n InetAddress addr = InetAddress.getByName(request.getRemoteAddr());\n if(addr.getCanonicalHostName().startsWith(\"trustme.com\")){ /* BUG */\n\n }\n }", "@Test\n public void testVersion() {\n Ip4Address ipAddress;\n\n // IPv4\n ipAddress = Ip4Address.valueOf(\"0.0.0.0\");\n assertThat(ipAddress.version(), is(IpAddress.Version.INET));\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }" ]
[ "0.78556377", "0.78556377", "0.78556377", "0.78556377", "0.70683974", "0.6922637", "0.6883667", "0.6793384", "0.6765796", "0.67652375", "0.67197436", "0.6681712", "0.6679496", "0.6667079", "0.6616211", "0.6616211", "0.65207016", "0.6518541", "0.6504569", "0.64784586", "0.64554673", "0.64554673", "0.64554673", "0.64128864", "0.6384756", "0.6381136", "0.637925", "0.6361271", "0.63566357", "0.63545066", "0.6335369", "0.63012034", "0.63012034", "0.63012034", "0.63012034", "0.63012034", "0.63012034", "0.63012034", "0.63012034", "0.629841", "0.62982464", "0.62852275", "0.62699646", "0.62466", "0.62285745", "0.621906", "0.6212039", "0.6207924", "0.6199083", "0.61504596", "0.6124444", "0.6124444", "0.6100283", "0.60451055", "0.60429204", "0.60092443", "0.59715647", "0.59698176", "0.59643805", "0.59374577", "0.5935152", "0.5922475", "0.5915847", "0.59118634", "0.590729", "0.58897364", "0.5889495", "0.5876046", "0.5865482", "0.58541614", "0.5838579", "0.5836649", "0.5827992", "0.5819581", "0.58082795", "0.5801188", "0.5801188", "0.5793024", "0.5769307", "0.57626593", "0.57455355", "0.5744436", "0.5744436", "0.574371", "0.57431114", "0.57405746", "0.5737367", "0.5736217", "0.5734693", "0.572083", "0.5702017", "0.5698981", "0.5698722", "0.5692062", "0.56739485", "0.5660104", "0.5649232", "0.5649232", "0.56486624", "0.56486624", "0.56430364" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { launch(args); }
{ "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
feel free to remove the starter code from this method
@Override public void start(Stage primaryStage) throws Exception { // TODO Auto-generated method stub primaryStage.setTitle("(Client) Let's Play Morra!!!"); HashMap<String,Scene> sceneMap = new HashMap<String,Scene>(); sceneMap.put("game", gameScene()); // Login button event handler from intro scene toTheGame = new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { ip.setText("Your IP: " + ipField.getText()); port.setText("Your Port: " + portNum.getText()); primaryStage.setScene(sceneMap.get("game")); clientConnection = new Client(data->{ Platform.runLater(()->{ listView.getItems().add(data.toString()); // checking if Game is over int temp = listView.getItems().size(); listView.scrollTo(temp); String temp1 = listView.getItems().get(temp-1); if(temp1.contains("GoodBye.")) { playAgain.setDisable(true); } }); }, ipField.getText(), Integer.parseInt(portNum.getText())); clientConnection.start(); } }; sceneMap.put("instr", instructionScene()); toTheInstr = new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { if(isValidPort(portNum.getText()) && isValidIP(ipField.getText())) { primaryStage.setScene(sceneMap.get("instr")); } else { portNum.setText("Check Port Number"); ipField.setText("Check IP number"); } } }; sceneMap.put("intro", introScene()); primaryStage.setScene(sceneMap.get("intro")); primaryStage.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "private void kk12() {\n\n\t}", "private FlyWithWings(){\n\t\t\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "protected OpinionFinding() {/* intentionally empty block */}", "public void mo4359a() {\n }", "@Override\n protected void initialize() \n {\n \n }", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "protected void additionalProcessing() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void mo6255a() {\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private void init() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void mo38117a() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "protected void init() {\n // to override and use this method\n }", "protected Doodler() {\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void gored() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tprotected void postRun() {\n\n\t}", "protected void onFirstUse() {}", "public static void listing5_14() {\n }", "@Override\n protected void setup() {\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n public void preprocess() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }" ]
[ "0.6057878", "0.601869", "0.581881", "0.57666975", "0.56735593", "0.566626", "0.56592035", "0.56209785", "0.5609129", "0.5590294", "0.5574328", "0.55422074", "0.55335736", "0.5521501", "0.5521231", "0.5521231", "0.5499023", "0.54845995", "0.54762703", "0.54686093", "0.54536927", "0.54484296", "0.5432016", "0.54144967", "0.54143333", "0.5411104", "0.5411104", "0.5400961", "0.53986573", "0.53986573", "0.53986573", "0.53986573", "0.53986573", "0.53986573", "0.5391544", "0.538358", "0.53834504", "0.5382429", "0.5380594", "0.5367092", "0.5362818", "0.5357567", "0.53475523", "0.53475523", "0.53438807", "0.53138405", "0.5313117", "0.53105515", "0.5308518", "0.5303656", "0.5298952", "0.52948654", "0.5293337", "0.5291643", "0.5286711", "0.5279594", "0.5279594", "0.5279131", "0.5270768", "0.5268756", "0.5266872", "0.52667624", "0.52602166", "0.52599585", "0.52599585", "0.5259333", "0.5259333", "0.5259333", "0.5259333", "0.5259333", "0.5259333", "0.52554077", "0.5253741", "0.52524394", "0.5248201", "0.5236609", "0.5231583", "0.5229955", "0.5229166", "0.5228318", "0.5228318", "0.52282387", "0.52238035", "0.5214891", "0.5211609", "0.5203888", "0.5199365", "0.51965404", "0.51922107", "0.519071", "0.5190425", "0.5187919", "0.5184163", "0.51816195", "0.517994", "0.51790655", "0.5178109", "0.5171746", "0.51707363", "0.51649064", "0.5161217" ]
0.0
-1
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }" ]
[ "0.78847593", "0.75493765", "0.74971926", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168" ]
0.0
-1
Asettaa pelin kieleksi parametrina annetun.
public void setLang(LANG language) { this.language = language; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }", "public Final_parametre() {\r\n\t}", "public void setValues(RutaParams params){\n this.costo = params.costo;\n this.tiempoVuelo = params.tiempoVuelo;\n this.piloto =encriptar(params.piloto);\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"nosambungan\", nosambungan);\n return params;\n }", "public void setParametr(double p) {\n parametr = p; // додано 26.12.2011\n timeServ = parametr; // 20.11.2012\n\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"id_pelanggan\", id_pelanggan);\n params.put(\"isi_pengaduan\", isi);\n return params;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n\n // Adding All values to Params.\n params.put(\"huruf\", huruf);\n params.put(\"derajat_lengan_x\", drajatX);\n params.put(\"derajat lengan_y\", drajatY);\n params.put(\"gambar\", gambar);\n\n return params;\n }", "public void restablecerParametro(String parametro, int ntp, Map<String, String> h) {\n \n if (parametro.compareTo(\"placa\") == 0) {\n \n // Reportes que necesitan placa\n int rpt_placa[] = {1,2,3,4,5,6,17};\n boolean rpt_con_placa = false;\n \n for (int rpt : rpt_placa) {\n if (rpt == ntp) {\n rpt_con_placa = true;\n break;\n }\n }\n \n if (!rpt_con_placa) {\n h.put(\"placa\", \"\");\n }\n } \n }", "public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }", "void setParameters() {\n\t\t\n\t}", "public void param(int direccionValorParam, int numeroParam){\n String valorParam = \"\";\n //traduce casos de direccionamiento indirecto\n direccionValorParam = traduceDirIndirecto(direccionValorParam);\n // obtener la direccion de la variable parametrizada en el procedimiento llamado\n int dirParamRegistro = this.directorioProcedimientos.\n obtenerProcedimientoPorId(this.pilaEras.peek().\n getIdentificadorProcedimiento()).getDireccionParametros().get(numeroParam);\n\n if (ManejadorMemoria.isGlobal(direccionValorParam)){\n // obtener el valor del parametro enviado\n valorParam = this.registroGlobal.getValor(direccionValorParam);\n\n } else if (ManejadorMemoria.isConstante(direccionValorParam)){\n // REVISAR QUE NO SEA UN PARAMETRO POR REFERENCIA\n if (this.directorioProcedimientos.\n obtenerProcedimientoPorId(this.pilaEras.peek().\n getIdentificadorProcedimiento()).getIndicadorPorReferencia().get(numeroParam)){\n // ERROR\n throw new IllegalArgumentException();\n }\n // obtener el valor del parametro enviado\n valorParam = this.directorioProcedimientos.getConstantes().get(direccionValorParam).getValorConstante();\n\n } else { // VARIABLE LOCAL\n // obtener el valor del parametro enviado\n valorParam = this.pilaRegistros.peek().getValor(direccionValorParam);\n }\n // asignar el valor del parametro a su variable correspondiente\n this.pilaEras.peek().guardaValor(dirParamRegistro, valorParam);\n }", "public void setParametroVarredura(Integer parametroVarredura) {\n this.parametroVarredura = parametroVarredura;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"pasien\", pasien);\n\n return params;\n }", "private void modifierParametre() {\n if (getSelectedParamatre() == null) return;\n FenetreModifierParametre fenetreModifierParametre = new FenetreModifierParametre(getSelectedParamatre());\n fenetreModifierParametre.showAndWait();\n if (fenetreModifierParametre.getParametre() == null) return;\n Parametre temp = fenetreModifierParametre.getParametre();\n getSelectedParamatre().setNom(temp.getNom());\n getSelectedParamatre().setType(temp.getType());\n parametreListView.refresh();\n }", "public void setPercepcion(double param){\n \n this.localPercepcion=param;\n \n\n }", "public void setParameters(Map<String, String> param) {\n\n // check the occurrence of required parameters\n if(!(param.containsKey(\"Indri:mu\") && param.containsKey(\"Indri:lambda\"))){\n throw new IllegalArgumentException\n (\"Required parameters for IndriExpansion model were missing from the parameter file.\");\n }\n\n this.mu = Double.parseDouble(param.get(\"Indri:mu\"));\n if(this.mu < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"Indri:mu\") + \", mu is a real number >= 0\");\n\n this.lambda = Double.parseDouble(param.get(\"Indri:lambda\"));\n if(this.lambda < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"Indri:lambda\") + \", lambda is a real number between 0.0 and 1.0\");\n\n if((param.containsKey(\"fb\") && param.get(\"fb\").equals(\"true\"))) {\n this.fb = \"true\";\n\n this.fbDocs = Integer.parseInt(param.get(\"fbDocs\"));\n if (this.fbDocs <= 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbDocs\") + \", fbDocs is an integer > 0\");\n\n this.fbTerms = Integer.parseInt(param.get(\"fbTerms\"));\n if (this.fbTerms <= 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbTerms\") + \", fbTerms is an integer > 0\");\n\n this.fbMu = Integer.parseInt(param.get(\"fbMu\"));\n if (this.fbMu < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbMu\") + \", fbMu is an integer >= 0\");\n\n this.fbOrigWeight = Double.parseDouble(param.get(\"fbOrigWeight\"));\n if (this.fbOrigWeight < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbOrigWeight\") + \", fbOrigWeight is a real number between 0.0 and 1.0\");\n\n if (param.containsKey(\"fbInitialRankingFile\") && param.get(\"fbInitialRankingFile\") != \"\") {\n this.fbInitialRankingFile = param.get(\"fbInitialRankingFile\");\n try{\n this.initialRanking = readRanking();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n\n if (param.containsKey(\"fbExpansionQueryFile\") && param.get(\"fbExpansionQueryFile\") != \"\")\n this.fbExpansionQueryFile = param.get(\"fbExpansionQueryFile\");\n }\n }", "public static void setConstantAkParam(String parameter, int[] values)\n {\n int i = 0;\n if (parameter.equalsIgnoreCase(\"genb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of GEq bands is \" + values[0]);\n i = getAkParamIndex(\"gebf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"gebg\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbg\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbe\");\n akParams_[i].len = values[0];\n akParam_genb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"ienb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of IEq bands is \" + values[0]);\n i = getAkParamIndex(\"iebf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"iebt\");\n akParams_[i].len = values[0];\n akParam_ienb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"aonb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of Audio Optimizer bands is \" + values[0]);\n i = getAkParamIndex(\"aobf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"aobg\");\n akParams_[i].len = (values[0] + 1) * AKPARAM_AOCC;\n i = getAkParamIndex(\"arbf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbi\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbl\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbh\");\n akParams_[i].len = values[0];\n akParam_aonb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"gebf\"))\n {\n DsLog.log1(LOG_TAG, \"Initializing the graphic equalizer band center frequencies\");\n akParam_gebf_ = values;\n }\n\n // Define all the allowed settings once all the key parameters are settled down.\n if (!constantAkParamsDefined_ && akParam_genb_ != -1 && akParam_ienb_ != -1 && akParam_aonb_ != -1 && akParam_gebf_ != null)\n {\n defineSettings();\n constantAkParamsDefined_ = true;\n }\n }", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n params.put(\"id_koperasi\", idKop);\n params.put(\"bidang_usaha\", id_bidangusaha);\n params.put(\"alamat_usaha\", alamat);\n params.put(\"status_usaha\", status);\n params.put(\"omzet\", omzet);\n params.put(\"location\", Loc);\n params.put(\"simp_pokok\", simpananpokok);\n params.put(\"jml_simp_pokok\", jmlsimpananpokok);\n params.put(\"simp_wajib\", simpananwajib);\n params.put(\"jml_simp_wajib\", jmlsimpananwajib);\n params.put(\"shu_tahunan\", shutahunan);\n params.put(\"user_id\", user);\n return params;\n }", "public ParametroPorParametroPK(Integer idpadre, Integer idhijo) {\r\n\t\tparametroIdParametroPadre = idpadre;\r\n\t\tparametroIdParametroHijo = idhijo;\r\n\t}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n // jika id kosong maka simpan, jika id ada nilainya maka update\n params.put(\"nama\", Nama);\n params.put(\"email\", Email);\n params.put(\"keluhan\", Keluhan);\n return params;\n }", "protected void setupParameters() {\n \n \n\n }", "@Override\n protected Map<String, String> getParams()\n {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"nama_kost\", kostt.getNama_kost());\n params.put(\"emailPemilik\", emailFB);\n params.put(\"tipe_kost\", kostt.getTipe_kost());\n params.put(\"alamat_kost\", kostt.getAlamat_kost());\n params.put(\"luas_kost\", String.valueOf(kostt.getLuas_kost()));\n params.put(\"sisa_kamar\", String.valueOf(kostt.getSisa_kamar()));\n if(cek==1) {\n params.put(\"image\", kostt.getImageUrl());\n System.out.println(\"image adalah \"+kostt.getImageUrl());\n }else {\n params.put(\"image\", \"kosong\");\n }\n\n\n return params;\n }", "public void editPAParameters() {\r\n \t\tdialogFactory.getDialog(new ParametricAnalysisPanel(model, model, model, this), \"Define What-if analysis parameters\");\r\n \t}", "public Tipo visitParameter(DECAFParser.ParameterContext ctx){\r\n\t\tVarDec var =new VarDec(ctx.ID().getText(),tablaSimbolos.searchTipo(ctx.parameterType().getText()),0,position);\r\n\t\tfirmaA.addParam(var);\r\n\t\taddComment(\"paramname: \"+var.getNombre()+\"-position: \"+position);\r\n\t\tposition+=var.getByteSize();\r\n\t\treturn tablaSimbolos.correct();\r\n\t}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"lapangan\", lapangan);\n params.put(\"jam\", jam);\n params.put(\"durasi\", durasi);\n\n return params;\n }", "public PowerMethodParameter() {\r\n\t\t\r\n\t\t//constructor fara parametru, utilizat in cazul in care utilizatorul nu introduce\r\n\t\t//fisierul sursa si nici fiesierul destinatie ca parametrii in linia de comanda\r\n\t\tSystem.out.println(\"****The constructor without parameters PowerMethodParameter has been called****\");\r\n\t\tSystem.out.println(\"You did not specify the input file and the output file\");\r\n\t\t\r\n\t}", "public ParametroPorParametroPK() {\r\n\t}", "public Setparam() {\r\n super();\r\n }", "public void setMontoSolicitado(double param){\n \n this.localMontoSolicitado=param;\n \n\n }", "void tampilKarakterA();", "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "public void setMotivoRechazo(biz.belcorp.www.canonico.ffvv.vender.TMotivoRechazo param){\n \n this.localMotivoRechazo=param;\n \n\n }", "java.lang.String getParameterValue();", "private void recogerParametros(HttpServletRequest request) {\r\n\t\tif (request.getParameter(\"op\") != null) {\r\n\t\t\top = Integer.parseInt(request.getParameter(\"op\"));\r\n\t\t} else {\r\n\t\t\top = 0;\r\n\t\t}\r\n\t\t\r\n\t\tsearch = (request.getParameter(\"search\") != null) ? request.getParameter(\"search\") : \"\";\r\n\r\n\t\tif (request.getParameter(\"id\") != null) {\r\n\t\t\tid = Integer.parseInt(request.getParameter(\"id\"));\r\n\t\t} else {\r\n\t\t\tid = -1;\r\n\t\t}\r\n\r\n\t\tif (request.getParameter(\"nombre\") != null) {\r\n\t\t\t\r\n\t\t\tnombre = request.getParameter(\"nombre\");\r\n\t\t\tnombre = Utilidades.limpiarEspacios(nombre);\r\n\t\t\tnombre = nombre.substring(0, Math.min(nombre.length(), 44));\r\n\t\t} else {\r\n\t\t\tnombre = \"\";\r\n\t\t}\r\n\r\n\t\tif (request.getParameter(\"precio\") != null) {\r\n\t\t\ttry{\r\n\t\t\t\tprecio = Float.parseFloat(request.getParameter(\"precio\"));\r\n\t\t\t}\r\n\t\t\tcatch( Exception e){\r\n\t\t\t\tprecio=PRECIO_EN_LETRA;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\tprecio = 0;\r\n\t\t}\r\n\t\tif(request.getParameter(\"id_usuario\")!=null) {\r\n\t\t\tusuario=daoUsuario.getById(Integer.parseInt(request.getParameter(\"id_usuario\")));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tusuario=new Usuario();\r\n\t\t}\r\n\t\tif(request.getParameter(\"id_usuario_cambio\")!=null) {\r\n\t\t\tusuario=daoUsuario.getById(Integer.parseInt(request.getParameter(\"id_usuario_cambio\")));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tusuario=new Usuario();\r\n\t\t}\r\n\t}", "public Papagaj(String meno, int pocetKoncatin, double vaha, String farba) {\r\n super(\"Papagaj\", \"Voliera\", pocetKoncatin); // volanie konstruktora predka\r\n this.meno = meno; // nastavenie nazvu zivocicha\r\n this.farba = farba; // nastavenie farby\r\n this.vaha = vaha; // nastavenie vahy\r\n }", "private static boolean isParamSettable(String parameter)\n {\n if (parameter.equalsIgnoreCase(\"vdhe\") ||\n parameter.equalsIgnoreCase(\"vspe\") ||\n parameter.equalsIgnoreCase(\"dvle\") ||\n parameter.equalsIgnoreCase(\"dvme\") ||\n parameter.equalsIgnoreCase(\"ngon\") ||\n parameter.equalsIgnoreCase(\"ieon\") ||\n parameter.equalsIgnoreCase(\"deon\") ||\n parameter.equalsIgnoreCase(\"geon\") ||\n parameter.equalsIgnoreCase(\"dhsb\") ||\n parameter.equalsIgnoreCase(\"dhrg\") ||\n parameter.equalsIgnoreCase(\"dssb\") ||\n parameter.equalsIgnoreCase(\"dssa\") ||\n parameter.equalsIgnoreCase(\"dssf\") ||\n parameter.equalsIgnoreCase(\"dvla\") ||\n parameter.equalsIgnoreCase(\"iebt\") ||\n parameter.equalsIgnoreCase(\"iea\") ||\n parameter.equalsIgnoreCase(\"dea\") ||\n parameter.equalsIgnoreCase(\"ded\") ||\n parameter.equalsIgnoreCase(\"gebg\") ||\n parameter.equalsIgnoreCase(\"aoon\") ||\n parameter.equalsIgnoreCase(\"plb\") ||\n parameter.equalsIgnoreCase(\"plmd\") ||\n parameter.equalsIgnoreCase(\"vmon\") ||\n parameter.equalsIgnoreCase(\"vmb\") ||\n parameter.equalsIgnoreCase(\"dvli\") ||\n parameter.equalsIgnoreCase(\"dvlo\") ||\n parameter.equalsIgnoreCase(\"dvmc\") ||\n parameter.equalsIgnoreCase(\"ienb\") ||\n parameter.equalsIgnoreCase(\"iebf\") ||\n parameter.equalsIgnoreCase(\"genb\") ||\n parameter.equalsIgnoreCase(\"gebf\") ||\n parameter.equalsIgnoreCase(\"aonb\") ||\n parameter.equalsIgnoreCase(\"aobf\") ||\n parameter.equalsIgnoreCase(\"aobg\") ||\n parameter.equalsIgnoreCase(\"arnb\") ||\n parameter.equalsIgnoreCase(\"arbf\") ||\n parameter.equalsIgnoreCase(\"aocc\") ||\n parameter.equalsIgnoreCase(\"arbi\") ||\n parameter.equalsIgnoreCase(\"arbl\") ||\n parameter.equalsIgnoreCase(\"arbh\") ||\n parameter.equalsIgnoreCase(\"arod\") ||\n parameter.equalsIgnoreCase(\"artp\") )\n return true;\n else\n return false;\n }", "public void klikkaa(Tavarat tavarat, Klikattava klikattava);", "@Test\n public void tilimaksuKutsuuTilisiirtoaOikeillaParametreilla() {\n when(this.varasto.saldo(1)).thenReturn(10);\n when(this.varasto.haeTuote(1)).thenReturn(new Tuote(1, \"maito\", 5));\n \n this.kauppa.aloitaAsiointi();\n this.kauppa.lisaaKoriin(1);\n this.kauppa.tilimaksu(\"johannes\", \"12345\");\n verify(this.pankki).tilisiirto(eq(\"johannes\"), anyInt(), eq(\"12345\"), anyString(), eq(5));\n \n }", "public static void parametrik(Matriks M) {\r\n\t\t// KAMUS LOKAL\r\n\t\tchar[] varAlp = new char[10];\r\n\t\tint unusedAlpIdx = 0;\r\n\t\tchar[] valOfVar = new char[M.KolEff];\r\n\t\tdouble[] numOfVar = new double[M.KolEff];\r\n\r\n\r\n\t\t// ALGORITMA\r\n\t\tvarAlp[0] = 'q';\r\n\t\tvalOfVar[0] = 'A';\r\n\t\tnumOfVar[0] = -12345;\r\n\r\n\t\tfor (int i=1; i<varAlp.length; i++) {\r\n\t\t\tvarAlp[i] = (char) (varAlp[0]+1);\r\n\r\n\t\t\tif (i < M.KolEff-1) {\r\n\t\t\t\tvalOfVar[i] = 'A';\r\n\t\t\t\tnumOfVar[i] = -12345;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvalOfVar[M.KolEff-1] = 'B';\r\n\r\n\r\n\t\tfor (int i=0; i<M.BrsEff - 1; i++) {\r\n\t\t\tint firstIdx = 0;\r\n\r\n\t\t\tboolean foundFirst1 = false;\r\n\t\t\tboolean foundSecond = false;\r\n\r\n\t\t\tfor (int j=0; j<M.KolEff - 1; j++) {\r\n\t\t\t\tif(M.Elmt[i][j] != 0) {\r\n\t\t\t\t\tif (!foundFirst1) {\r\n\t\t\t\t\t\tfoundFirst1 = true;\r\n\t\t\t\t\t\tfirstIdx = j;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\tvalOfVar[j] = varAlp[unusedAlpIdx];\r\n\t\t\t\t\t\t\tunusedAlpIdx++;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfoundSecond = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!foundSecond && foundFirst1) {\r\n\t\t\t\tnumOfVar[firstIdx] = M.Elmt[i][M.KolEff-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i=0; i<M.BrsEff; i=i+1) {\r\n\t\t\tint firstIdx = 0;\r\n\r\n\t\t\tboolean foundFirst1 = false;\r\n\t\t\tboolean foundSecond = false;\r\n\r\n\t\t\tfor (int j=0; j<M.KolEff; j=j+1) {\r\n\r\n\t\t\t\tif (M.Elmt[i][j] != 0) {\r\n\r\n\t\t\t\t\tif ((!foundFirst1) && (j != M.KolEff-1)) {\r\n\t\t\t\t\t\tfoundFirst1 = true;\r\n\t\t\t\t\t\tSystem.out.printf(\"x%d = \", j);\r\n\t\t\t\t\t\tfirstIdx = j;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\tif (!foundSecond) {\r\n\r\n\t\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\"%.2f \", -(M.Elmt[i][j] * numOfVar[j]));\r\n\t\t\t\t\t\t\t\tfoundSecond = true;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (valOfVar[j] == 'B') {\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\"%.2f%c \", -M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\tfoundSecond = 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\t\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\t\tdouble value = M.Elmt[i][j] * numOfVar[j];\r\n\r\n\t\t\t\t\t\t\t\tif (value < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f \", -value);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f \", value);\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}\r\n\r\n\t\t\t\t\t\t\telse if (valOfVar[j] == 'B') {\r\n\r\n\t\t\t\t\t\t\t\tif (M.Elmt[i][j] < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f \", -M.Elmt[i][j]);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f \", M.Elmt[i][j]);\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\telse {\r\n\r\n\t\t\t\t\t\t\t\tif (M.Elmt[i][j] < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f%c \", -M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f%c \", M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!foundSecond && foundFirst1) {\r\n\t\t\t\tSystem.out.printf(\"%.2f \", numOfVar[firstIdx]);\r\n\t\t\t}\r\n\r\n\t\t\tif (foundFirst1) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int j=0; j<valOfVar.length; j++) {\r\n\r\n\t\t\tif ((valOfVar[j] != 'A') && (valOfVar[j] != 'B')) {\r\n\t\t\t\tSystem.out.printf(\"x%d = %c\", j, valOfVar[j]);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void SetParameters(XmlTest test){\r\n\t\t for (Map.Entry<String,String> entry : TestsParamList.get(test.getName()).entrySet()){\r\n\t\t\t test.addParameter(entry.getKey(), entry.getValue());\r\n\t\t }\r\n\t}", "public void asetaTeksti(){\n }", "private void vorgangParameterUebernehmen(\n String autorEmail,\n Vorgang vorgang,\n String typ,\n Long kategorie,\n String positionWGS84,\n String oviWkt,\n String adresse,\n String beschreibung,\n Boolean fotowunsch,\n String bild,\n Boolean verlaufErgaenzen\n ) throws BackendControllerException {\n\n if (verlaufErgaenzen == null) {\n verlaufErgaenzen = false;\n }\n\n if (typ != null) {\n EnumVorgangTyp evt = EnumVorgangTyp.valueOf(typ);\n if (verlaufErgaenzen && !vorgang.getTyp().equals(evt)) {\n verlaufDao.persist(verlaufDao.addVerlaufToVorgang(vorgang, EnumVerlaufTyp.typ,\n vorgang.getTyp().getText(), evt.getText(), autorEmail));\n }\n vorgang.setTyp(evt);\n if (vorgang.getTyp() == null) {\n throw new BackendControllerException(2, \"[typ] nicht korrekt\", \"Der Typ ist nicht korrekt.\");\n }\n }\n\n if (kategorie != null) {\n Kategorie newKat = kategorieDao.findKategorie(kategorie);\n\n if (verlaufErgaenzen && !vorgang.getKategorie().getId().equals(newKat.getId())) {\n verlaufDao.persist(verlaufDao.addVerlaufToVorgang(vorgang, EnumVerlaufTyp.kategorie,\n vorgang.getKategorie().getParent().getName() + \" / \" + vorgang.getKategorie().getName(),\n newKat.getParent().getName() + \" / \" + newKat.getName(), autorEmail));\n }\n vorgang.setKategorie(newKat);\n if (vorgang.getKategorie() == null\n || vorgang.getKategorie().getParent() == null\n || vorgang.getKategorie().getParent().getTyp() != vorgang.getTyp()) {\n throw new BackendControllerException(4, \"[kategorie] nicht korrekt\", \"Die Kategorie ist nicht gültig.\");\n }\n }\n\n if (positionWGS84 != null) {\n try {\n vorgang.setPositionWGS84(positionWGS84);\n } catch (Exception e) {\n throw new BackendControllerException(12, \"[positionWGS84] nicht korrekt\", \"Die Ortsangabe ist nicht korrekt.\", e);\n }\n }\n\n if (oviWkt != null) {\n try {\n vorgang.setOviWkt(oviWkt);\n } catch (Exception e) {\n throw new BackendControllerException(6, \"[oviWkt] nicht korrekt\", \"Die Ortsangabe ist nicht korrekt.\");\n }\n }\n\n if (vorgang.getOviWkt() == null) {\n throw new BackendControllerException(5, \"[position] nicht korrekt\", \"Keine gültige Ortsangabe.\");\n }\n\n if (!vorgang.getOvi().within(grenzenDao.getStadtgrenze().getGrenze())) {\n throw new BackendControllerException(13, \"[position] außerhalb\", \"Die neue Meldung befindet sich außerhalb des gültigen Bereichs.\");\n }\n\n if (adresse != null) {\n vorgang.setAdresse(adresse);\n } else {\n String neueAdresse = \"nicht zuordenbar\";\n if (oviWkt != null) {\n Point point = pointWktToPoint(oviWkt);\n neueAdresse = geoService.calculateAddress(point);\n } else if (positionWGS84 != null) {\n try {\n Point point = transformPosition(pointWktToPoint(positionWGS84), wgs84Projection, internalProjection);\n neueAdresse = geoService.calculateAddress(point);\n } catch (FactoryException | MismatchedDimensionException | TransformException e) {\n logger.error(e);\n }\n }\n vorgang.setAdresse(neueAdresse);\n }\n\n if (beschreibung != null) {\n if (verlaufErgaenzen && (vorgang.getBeschreibung() == null || !vorgang.getBeschreibung().equals(beschreibung))) {\n verlaufDao.persist(verlaufDao.addVerlaufToVorgang(vorgang, EnumVerlaufTyp.beschreibung, vorgang.getBeschreibung(), beschreibung, autorEmail));\n }\n vorgang.setBeschreibung(beschreibung);\n }\n\n if (fotowunsch != null) {\n if (verlaufErgaenzen && !Objects.equals(vorgang.getFotowunsch(), fotowunsch)) {\n verlaufDao.persist(verlaufDao.addVerlaufToVorgang(vorgang, EnumVerlaufTyp.fotowunsch,\n vorgang.getFotowunsch() ? \"aktiv\" : \"inaktiv\", vorgang.getFotowunsch() ? \"inaktiv\" : \"aktiv\", autorEmail));\n }\n vorgang.setFotowunsch(fotowunsch);\n }\n\n if (bild != null && bild.getBytes().length > 0) {\n vorgangDao.persist(vorgang);\n try {\n imageService.setImageForVorgang(Base64.decode(bild.getBytes()), vorgang);\n vorgang.setFotoFreigabeStatus(EnumFreigabeStatus.intern);\n vorgang.setFotowunsch(false);\n } catch (Exception e) {\n throw new BackendControllerException(11, \"[bild] nicht korrekt\", \"Das Bild ist fehlerhaft und kann nicht verarbeitet werden.\", e);\n }\n }\n }", "private void ajouterParametre() {\n FenetreAjouterParametre fenetreAjouterParametre = new FenetreAjouterParametre();\n fenetreAjouterParametre.showAndWait();\n if (fenetreAjouterParametre.getParametre() == null) return;\n parametreListView.getItems().add(fenetreAjouterParametre.getParametre());\n }", "protected void initParametros ( int numParametros ) {\n if ( numParametros > 0 )\n parametros = new Parametro[ numParametros ];\n }", "public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }", "private void setOtherParam(Settings set) {\n URL_SQL_RU = set.getValue(\"app.urlSqlRu\");\n NAME_DATA_BASE = set.getValue(\"app.nameDataBase\");\n DAT_NAME = set.getValue(\"app.datName\");\n VACANCY = set.getValue(\"app.vacancy\");\n TABLE_NAME = set.getValue(\"app.tableName\");\n ZERO = Integer.parseInt(set.getValue(\"app.zero\"));\n SKIP_ROW = Integer.parseInt(set.getValue(\"app.skipRow\"));\n CLASS = set.getValue(\"app.class\");\n POSTS_LIST_TOPIC = set.getValue(\"app.postsListTopic\");\n LAST_YEAR = set.getValue(\"app.lastYear\");\n }", "private static void variosParametros(String nombre, int ... numeros){\n System.out.println(\"nombre = \" + nombre);\n imprimirNumeros(numeros);\n }", "Karyawan(String n)\n {\n this.nama = n;\n }", "public void setParametroIdParametroPadre(int parametroIdParametroPadre) {\r\n\t\tthis.parametroIdParametroPadre = parametroIdParametroPadre;\r\n\t}", "public void setMontoDescuento(double param){\n \n this.localMontoDescuento=param;\n \n\n }", "public void remplireListeParam(){\r\n bddParam.add(\"id\");\r\n bddParam.add(\"site\");\r\n bddParam.add(\"smtp_serv\");\r\n bddParam.add(\"smtp_port\");\r\n bddParam.add(\"smtp_user\");\r\n bddParam.add(\"smtp_mail\");\r\n bddParam.add(\"smtp_pass\");\r\n bddParam.add(\"mail_envoie\");\r\n bddParam.add(\"licence\");\r\n bddParam.add(\"pop_up\");\r\n bddParam.add(\"mail_rapport\");\r\n bddParam.add(\"archives\");\r\n bddParam.add(\"mail\");\r\n bddParam.add(\"dbext_adress\");\r\n bddParam.add(\"dbext_port\");\r\n bddParam.add(\"dbext_user\");\r\n bddParam.add(\"dbext_pass\");\r\n bddParam.add(\"dbext_delais\");\r\n bddParam.add(\"dbext_name\");\r\n bddParam.add(\"dbext\");\r\n bddParam.add(\"dbext_purge\");\r\n bddParam.add(\"dbext_perte\");\r\n bddParam.add(\"langue\");\r\n \r\n }", "@Override\r\n public void setParameter(String parameters) {\r\n // dummy\r\n }", "private void getParameters(HttpServletRequest request) {\n\t\t// Recoger datos\n\t\tconcepto = request.getParameter(\"concepto\");\n\t\tString importeTexto = request.getParameter(\"importe\");\n\t\ttry {\n\t\t\timporte = Double.parseDouble(importeTexto);\n\n\t\t} catch (NumberFormatException e) {\n\t\t\timporte = (double) 0;\n\t\t}\n\t\tLong idCoche = Long.parseLong(request.getParameter(\"id_coche\"));\n\t\tc = daoCoche.getBYId(idCoche);\n\t\tidAgente = Long.parseLong(request.getParameter(\"id_agente\"));\n\t}", "public static void setParameters (\n String pstrAboutMeerkat \n ) {\n strAboutMeerkat = pstrAboutMeerkat ; \n }", "public String getParameter(String name) throws IllegalArgumentException {\n\t if ( LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"getParameter() \" \n\t\t+ name);\n Via via=(Via)sipHeader;\n \n if (name == null) throw new\n IllegalArgumentException(\"JAIN-EXCEPTION: null argument\");\n return via.getParameter(name);\n }", "public void setParamReformaTributaria(String paramReformaTributaria)\n {\n this.paramReformaTributaria=paramReformaTributaria;\n }", "public String getParameterFromP();", "public void Tarifa(String tipoTarifa){\n Tarifa = tipoTarifa;\n Regular = \"R\";\n Comercial = \"C\";\n\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n\n // Adding All values to Params.\n params.put(\"ubaid\", globalVar.getUbaid());\n\n return params;\n }", "public void setDefaultParameters() {\n\tsetParameterValue(\"genie.param.x\",\"genie.dfwx\");\n\tsetParameterValue(\"genie.param.x.begin\",\"-0.3\");\n\tsetParameterValue(\"genie.param.x.increment\",\"0.6\");\n\tsetParameterValue(\"genie.param.x.increment.type\",\"linear\");\n\tsetParameterValue(\"genie.param.x.end\",\"0.3\");\n\tsetParameterValue(\"genie.param.y\",\"genie.dfwy\");\n\tsetParameterValue(\"genie.param.y.begin\",\"-0.3\");\n\tsetParameterValue(\"genie.param.y.increment\",\"0.6\");\n\tsetParameterValue(\"genie.param.y.increment.type\",\"linear\");\n\tsetParameterValue(\"genie.param.y.end\",\"0.3\");\n\tsetParameterValue(\"genie.nsteps\",\"1001\");\n\tsetParameterValue(\"genie.npstp\",\"1000\");\n\tsetParameterValue(\"genie.iwstp\",\"1000\");\n\tsetParameterValue(\"genie.itstp\",\"10\");\n\tsetParameterValue(\"genie.restart\",\"n\");\n\tsetParameterValue(\"genie.tv\",\"3.65\");\n\tsetParameterValue(\"genie.ndta\",\"5\");\n\tsetParameterValue(\"genie.temp0\",\"5.0\");\n\tsetParameterValue(\"genie.temp1\",\"5.0\");\n\tsetParameterValue(\"genie.rel\",\"0.9\");\n\tsetParameterValue(\"genie.scf\",\"2.0\");\n\tsetParameterValue(\"genie.diff1\",\"2000.0\");\n\tsetParameterValue(\"genie.diff2\",\"1e-5\");\n\tsetParameterValue(\"genie.adrag\",\"2.5\");\n\tsetParameterValue(\"genie.diffamp1\",\"8111000\");\n\tsetParameterValue(\"genie.diffamp2\",\"79610\");\n\tsetParameterValue(\"genie.betaz1\",\"0.1111\");\n\tsetParameterValue(\"genie.betam1\",\"0.0\");\n\tsetParameterValue(\"genie.betaz2\",\"0.2626\");\n\tsetParameterValue(\"genie.betam2\",\"0.2626\");\n\tsetParameterValue(\"genie.scl_co2\",\"1.0\");\n\tsetParameterValue(\"genie.pc_co2_rise\",\"0.0\");\n\tsetParameterValue(\"genie.diffsic\",\"2000.0\");\n\tsetParameterValue(\"genie.tatm\",\"0.0\");\n\tsetParameterValue(\"genie.relh0_ocean\",\"0.0\");\n\tsetParameterValue(\"genie.relh0_land\",\"0.0\");\n\tsetParameterValue(\"genie.dfwx\",\"0.0\");\n\tsetParameterValue(\"genie.dfwy\",\"0.0\");\n\tsetParameterValue(\"genie.lout\",\"0000\");\n\tsetParameterValue(\"genie.lin\",\"0000.1\");\n }", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n params.put(\"Ubicacion\",\"Nuevo\");\n params.put(\"Latitud\", String.valueOf(lat) );\n params.put(\"Longitud\", String.valueOf(lon));\n return params;\n }", "public ParamShoppingCartTest(int precio1, int precio2) {\n \n this.precio1 = precio1;\n this.precio2 = precio2; \n }", "@Override \n\t\tprotected int getNumParam() {\n\t\t\treturn 1;\n\t\t}", "public void damePersonaje(String personaje){\n this.personaje=personaje;\n\n\n\n }", "public void setParameters(String parameters){\n this.parameters=parameters;\n }", "@Override\n\tpublic void pausaParaComer() {\n\n\t}", "public void setObservacion(java.lang.String param){\n \n this.localObservacion=param;\n \n\n }", "public void setBloqueado(java.lang.String param){\n \n this.localBloqueado=param;\n \n\n }", "public void setParameters(String parameters);", "String toParameter();", "private void parametrosLayout(Map<String, Object> iReportParameter) throws RuntimeException {\r\n\t\ttry {\r\n\t\t\tiReportParameter.put(\"imgLogoImss\",\"imagenesReportes/logoImss.jpg\");\r\n\t\t\tiReportParameter.put(\"imgGobiernoRepublica\",\"imagenesReportes/gobiernoRepublica.png\");\r\n\t\t\tiReportParameter.put(\"imgEscudoNacional\",\"imagenesReportes/escudoNacional.jpg\");\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.info(\"ERROR: Al obtener los parametros del Layaout del reporte.\", ex);\r\n\t\t\tthrow new RuntimeException(\"ERROR: Al obtener los parametros del Layaout del reporte.\", ex);\r\n\t\t}\r\n\t}", "String [] getParameters();", "private Map<String,Object> getParams(String nombre , int id){\n\t\t\tMap <String,Object> mapa;\n\t\t\tmapa = new HashMap<String,Object>();\n\t\t\t//Pasar parametros en de JasperReport\n\t\t\tmapa.put(\"alumnoNombre\", nombre);\n\t\t\tmapa.put(\"alumnoId\", id);\n\t\t\t\n\t\t\treturn mapa;\n\t\t\t\n\t\t}", "public AntrianPasien() {\r\n\r\n }", "@Override\n\tprotected void setParameterValues() {\n\t}", "Parameter getParameter();", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"fecha\", fecha);\n params.put(\"hInicio\", inicio);\n params.put(\"hFin\", fin);\n params.put(\"cantCompas\", cantidad);\n params.put(\"id\", id);\n params.put(\"correo\", correo);\n params.put(\"min\",m);\n return params;\n }", "public static void main(String[] args) {\r\n \r\n\r\n cetak_nama(); // akses prosedur\r\n\r\n System.out.println(cetak_nama1()); // mencetak nilai fungsi\r\n\r\n cetak_nama2(\"Aprianto\"); // akses prosedur dengan parameter nama\r\n\r\n System.out.println(cetak_nama3(\"Aprianto\")); // mencetak nilai fungsi dengan parameter nama\r\n\r\n cetak_data(\"Aprianto\", 20); // akses prosedur dengan 2 parameter. parameter yang disediakan harus sama dengan yang di deklarasi\r\n \r\n System.out.println(jumlah_uang(1000, 2000, \"Aprianto\"));\r\n }", "public void mostrarVariablesForrester(){\n System.out.println(\"\");\n for (int i = 0; i < tam; i++) {\n if(matrizTipos[i][i].equals(\"P\")){\n System.out.println(\"[\"+i+\"] es un parametro\"); // parametro = constante\n }\n else if(matrizTipos[i][i].equals(\"V\")){\n System.out.println(\"[\"+i+\"] es un auxiliar\"); // auxiliar = constante * auxiliar (?) ó constante +/- auxiliar\n }\n else if(matrizTipos[i][i].equals(\"R\")){\n System.out.println(\"[\"+i+\"] es un flujo\"); // flujo = constante * auxiliar * nivel\n }\n else if(matrizTipos[i][i].equals(\"X\")){\n System.out.println(\"[\"+i+\"] es un nivel\");// xi(t + Δt) = xi(t) + Δt{rj - rk} rj = entrada y rk = salida, \"el - es por la salida\" (creo) \n }\n }\n }", "@Override\r\n\tpublic <T> EktParam creatParam(T t) {\n\t\todo = (ODO) t;\r\n\t\todo.setEktSql(null);\r\n\t\tif (EKTIO.getInstance().ektSwitch()) {\r\n\t\t\t\r\n\t\t\tReg reg = ektParam.getReg();\r\n\t\t\tPat pat = ektParam.getPat();\r\n\t\t\t\r\n\t\t\tTParm orderOldParm = ektParam.getOrderOldParm();\r\n\t\t\tTParm orderParm = ektParam.getOrderParm();\r\n\r\n\t\t\tif (odo == null) {\r\n\t\t\t\todoMainControl.messageBox(\"E0115\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tektParam.setOpType(\"\");\r\n\t\t\t\r\n\t\t\tTParm unParm = new TParm();\r\n\t\t\tif (orderOldParm == null) {\r\n\t\t\t\todoMainControl.messageBox(\"没有需要操作的医嘱\");\r\n\t\t\t\tektParam.setOpType(\"5\");\r\n\t\t\t\treturn ektParam;\r\n\t\t\t}\r\n\t\t\tif(orderParm.getValue(\"OP_FLG\").length()>0 && orderParm.getInt(\"OP_FLG\")==5){\r\n\t\t\t\todoMainControl.messageBox(\"没有需要操作的医嘱\");\r\n\t\t\t\tektParam.setOpType(\"5\");\r\n\t\t\t\treturn ektParam;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tTParm updateParm=orderParm.getParm(\"updateParm\");\r\n\t\t\t//TODO\r\n\t\t\tboolean unFlg = odoMainControl.updateOrderParm(updateParm, orderOldParm, unParm);\r\n\t\t\tTParm parm = new TParm();\r\n\t\t\t isDelOrder = false;// 执行删除医嘱\r\n\t\t\t//boolean exeDelOrder = false;// 执行删除医嘱\r\n\t\t\tString delFlg=orderParm.getValue(\"DEL_FLG\");\r\n\t\t\t// 如果出现所有医嘱删除也会出现IS_NEW = false 状态 所有需要在执行方法时先查询当前所有医嘱\r\n\t\t\t// 校验是否发送删除检验检查接口\r\n\t\t\tif(delFlg.equals(\"Y\")){\r\n\t\t\t\tisDelOrder = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderParm.setData(\"BUSINESS_TYPE\", \"ODO\");\r\n\t\t\tparm.setData(\"CASE_NO\",reg.caseNo());\r\n\t\t\torderParm.setData(\"REGION_CODE\", Operator.getRegion());\r\n\t\t\torderParm.setData(\"MR_NO\", pat.getMrNo());\r\n\t\t\torderParm.setData(\"NAME\", pat.getName());\r\n\t\t\torderParm.setData(\"IDNO\", pat.getIdNo());\r\n\t\t\torderParm.setData(\"SEX\", pat.getSexCode() != null\r\n\t\t\t\t\t&& pat.getSexCode().equals(\"1\") ? \"男\" : \"女\");\r\n\t\t\t// 送医疗卡,返回医疗卡的回传值\r\n\t\t\torderParm.setData(\"INS_FLG\", \"N\");// 医保卡操作\r\n\t\t\torderParm.setData(\"UN_FLG\", unFlg ? \"Y\" : \"N\");// 医生修改的医嘱超过医疗卡金额执行的操作\r\n\t\t\torderParm.setData(\"unParm\", unParm.getData());// 获得执行修改的医嘱\r\n\t\t\tif (null != orderOldParm.getValue(\"OPBEKTFEE_FLG\")\r\n\t\t\t\t\t&& orderOldParm.getValue(\"OPBEKTFEE_FLG\").equals(\"Y\")) {\r\n\t\t\t\torderParm.setData(\"OPBEKTFEE_FLG\", \"Y\");\r\n\t\t\t}\r\n\t\t\t//直接收费操作如果有修改的收费医嘱 不能执行取消操作\r\n\t\t\tif(null == orderOldParm.getValue(\"OPBEKTFEE_FLG\")\r\n\t\t\t\t\t|| orderOldParm.getValue(\"OPBEKTFEE_FLG\").length()<=0){\r\n\t\t\t\tif(unFlg)\r\n\t\t\t\t\torderParm.setData(\"OPBEKTFEE_FLG\", \"Y\");\r\n\t\t\t}\r\n\t\t\tif (odoMainControl.resultData.getCount(\"CASE_NO\")>0) {//====pangben 2014-1-20 建行卡校验\r\n\t\t\t\todoMainControl.messageBox(\"P0001\");\r\n//\t\t\t\tparm.setData(\"OP_TYPE\", 5);\r\n\t\t\t\tektParam.setOpType(\"5\");\r\n\t\t\t\treturn ektParam;\r\n\t\t\t}else{\r\n\t\t\t\todoMainControl.ektReadParm = EKTIO.getInstance().TXreadEKT();\r\n\t\t\t\tif (null == odoMainControl.ektReadParm || odoMainControl.ektReadParm.getErrCode() < 0\r\n\t\t\t\t\t\t|| null == odoMainControl.ektReadParm.getValue(\"MR_NO\")) {\r\n\t\t\t\t\todoMainControl.messageBox(\"医疗卡读卡有误。\");\r\n\t\t\t\t\todoMainControl.setValue(\"LBL_EKT_MESSAGE\", \"未读卡\");//====pangben 2013-5-3添加读卡\r\n\t\t\t\t\todoMainControl.ekt_lable.setForeground(red);//======yanjing 2013-06-14设置读卡颜色\r\n\t\t\t\t\tektParam.setOpType(\"5\");\r\n\t\t\t\t\treturn ektParam;\r\n\t\t\t\t}else{\r\n\t\t\t\t\todoMainControl.setValue(\"LBL_EKT_MESSAGE\", \"已读卡\");//====pangben 2013-5-3添加读卡\r\n\t\t\t\t\todoMainControl.ekt_lable.setForeground(green);//======yanjing 2013-06-14设置读卡颜色\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!odoMainControl.ektReadParm.getValue(\"MR_NO\").equals(odoMainControl.getValue(\"MR_NO\"))) {\r\n\t\t\t\todoMainControl.messageBox(\"病患信息不符,此医疗卡病患名称为:\"\r\n\t\t\t\t\t\t+ odoMainControl.ektReadParm.getValue(\"PAT_NAME\"));\r\n\t\t\t\todoMainControl.ektReadParm = null;\r\n\t\t\t\tektParam.setOpType(\"5\");\r\n\t\t\t\treturn ektParam;\r\n\t\t\t}\r\n\t\t\tint type=0;\r\n\t\t\t//parm.setData(\"BILL_FLG\", \"Y\");\r\n\t\t\torderParm.setData(\"ektParm\", odoMainControl.ektReadParm.getData()); // 医疗卡数据\r\n\t\t\t\r\n\t\t\t\tboolean isNull = true;\r\n\t\t\t\tOpdOrder opdOrder = odo.getOpdOrder();\r\n\t\t\t\tString lastFilter = opdOrder.getFilter();\r\n\t\t\t\topdOrder.setFilter(\"\");\r\n\t\t\t\topdOrder.filter();\r\n\t\t\t\tfor (int i = 0; i < opdOrder.rowCount(); i++) {\r\n\t\t\t\t\tif(opdOrder.getItemString(i, \"ORDER_CODE\").length() > 0){\r\n\t\t\t\t\t\tisNull = false;\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\topdOrder.setFilter(lastFilter);\r\n\t\t\t\topdOrder.filter();\r\n\t\t\t\r\n\t\t\tektParam.setNull(isNull);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t} else {\r\n\t\t\todoMainControl.messageBox_(\"医疗卡接口未开启\");\r\n\t\t\treturn null;\r\n\t\t\t\r\n\r\n\t\t}\r\n\t\r\n\t\t\r\n\t\treturn ektParam;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private void setVariabelrsa(String P, String Q, String N, String Tn, String E, String D, String File) {\n this.tfieldP.setText(P);\n this.tfieldQ.setText(Q);\n this.tfieldN.setText(N);\n this.tfieldTN.setText(Tn);\n this.tfieldE.setText(E);\n this.tfieldD.setText(D);\n this.tfieldLokasidannamafilehasilenkripsi.setText(File);\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n// params.put(\"ead_tokan\", AppConfig.EAD_TOKEN);\n// params.put(\"ead_email\", email);\n params.put(\"npl_token\", \"a\");\n params.put(\"npl_aid\", mediaId);\n params.put(\"npl_id\", userId);\n return params;\n }", "@Override\n\tpublic void setParametri(Grafica grafica, GameStateDTO gameStateDTO) {\n\t\tgrafica.mostraMessaggio(\"Hai vinto un bonus tessera permesso!\\nScegli una tessera permesso\\n\");\n\n\t\tTesseraPermessoDTO tesseraPermessoDTO = grafica.scegliTesseraPermessoUsataONonUsata(\n\t\t\t\tgameStateDTO.getGiocatoreDTO().getTesserePermesso(),\n\t\t\t\tgameStateDTO.getGiocatoreDTO().getTesserePermessoUsate());\n\t\tbonusTesseraAcquistataNDTO.setTesseraPermesso(tesseraPermessoDTO);\n\t}", "ParameterList getParameters();", "public void tutki(Suunta suunta);", "public Map getParameters();", "public void updateParameters(){\n\t\tp = RunEnvironment.getInstance().getParameters();\n\t\tmaxFlowerNectar = (double)p.getValue(\"maxFlowerNectar\");\n\t\tlowMetabolicRate = (double)p.getValue(\"lowMetabolicRate\");\n\t\thighMetabolicRate = (double)p.getValue(\"highMetabolicRate\");\n\t\tcolonySize = (int)p.getValue(\"colonySize\");\n\t}", "private void setAllParameters(int len) {\n\t\t\tshowUPLMN = new String[len] ;\n\t\t\toriginalUPLMN = new String[len] ;\n\t\t\tstrUorG = new String[len] ;\n\t\t\tpart = new byte[len][];\n\t\t\torder = new int[len];\n\t\t\tfor(int i=0;i<len;i++){\n\t\t\t\t part[i] = new byte[6];\n\t\t\t}\n\t\t}", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noofconflicts);\n String checkconflicts = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"checkconflicts\", checkconflicts);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=0;m<noofstudent;m++){\n params.put(\"sid[\"+m+\"]\",sid[m]);\n }\n\n\n return params;\n }", "public void setPrecioc(int p){\n this.precioc=p;\n \n }", "public void setKota1(String tempatKerja) {\n\t\t\n\t}", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noOfStudents);\n String creatre = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"createsubmittedform\", creatre);\n params.put(\"uid\",uid);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=1;m<3;m++){\n String z= String.valueOf(m);\n params.put(\"pfid[\"+m+\"]\",z);\n params.put(\"hostelid[\"+m+\"]\",hostelid[m-1]);\n params.put(\"floorno[\"+m+\"]\",floorno[m-1]);\n }\n for (int k = 0; k < noofstudent; k++) {\n int m = k/2 +1;\n String z= String.valueOf(m);\n params.put(\"sid[\"+k+\"]\", sid[k]);\n params.put(\"roominwing[\"+k+\"]\",z );\n }\n return params;\n }", "@Override\n\t\tpublic String getParameter(String name) {\n\t\t\treturn null;\n\t\t}", "public abstract String toFORMParam();", "public void setDefaultParameters(){\n clearParametersVector();\n addParameter( new LoadFilePG(\"Vanadium NeXus File Name\",\"\"));\n addParameter( new LoadFilePG(\"Background NeXus File Name\",\"\"));\n addParameter( new LoadFilePG(\"Integrated Peaks File\",\"\"));\n addParameter( new SaveFilePG(\"Adjusted Integrate File\",\"\"));\n addParameter( new FloatPG(\"Min Time-of-Flight to Sum\",0.0));\n addParameter( new FloatPG(\"Max Time-of-Flight to Sum\",48000));\n addParameter( new IntegerPG(\"Zero Pixel Border Size\",8));\n addParameter( new IntegerPG(\"Region Half-Width\",5));\n }", "public ifrmParametros(EntityManagerFactory factory,frmMain frm,BglTbUsuario user) {\n initComponents();\n PropertyConfigurator.configure(\"log4j.properties\");\n this.factory=factory;\n this.main=frm;\n this.usuario=user;\n \n llenarDatos();\n \n }", "void setTitolo(String titolo);" ]
[ "0.71569824", "0.6536254", "0.63912773", "0.62947226", "0.625974", "0.62521344", "0.6216597", "0.61619186", "0.60610104", "0.5980697", "0.59500045", "0.59167403", "0.5909462", "0.5892415", "0.5880681", "0.58604205", "0.5859322", "0.58227", "0.5805038", "0.57998586", "0.57985437", "0.5795845", "0.57716", "0.5767136", "0.5759264", "0.5740847", "0.5739685", "0.5739366", "0.5731662", "0.5727302", "0.57267845", "0.57071507", "0.5704926", "0.5697442", "0.5694336", "0.56929106", "0.56839585", "0.56777966", "0.5662973", "0.5657719", "0.5637662", "0.56287843", "0.5628288", "0.5627917", "0.56247187", "0.5611282", "0.560682", "0.56058705", "0.55898845", "0.5587923", "0.55808043", "0.5575201", "0.55535305", "0.55385804", "0.55213845", "0.55208755", "0.55179894", "0.5516668", "0.55105823", "0.5508729", "0.5507458", "0.5504796", "0.54993063", "0.548958", "0.54659086", "0.54600173", "0.54591626", "0.5448346", "0.5448084", "0.5447288", "0.5445875", "0.54456997", "0.54444176", "0.5441375", "0.54388124", "0.5427673", "0.5425763", "0.5424584", "0.54229254", "0.54159963", "0.5413412", "0.541234", "0.5408489", "0.5404559", "0.5404185", "0.5394555", "0.5393099", "0.53917944", "0.53792447", "0.53792447", "0.53792447", "0.53792447", "0.537867", "0.5372247", "0.53694063", "0.5363478", "0.5362826", "0.53624284", "0.5352603", "0.5346601", "0.53463835" ]
0.0
-1
Palauttaa tiedon onko "Easter Egg" aktivoitu.
public boolean getEasterEgg() { return easterEgg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}", "public void onderbreek(){\n \n }", "void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }", "@Override\n\tpublic void eggHatches() {\n\t\t\n\t}", "public final void dyE() {\n AppMethodBeat.i(29674);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29666);\n w.this.ynU = true;\n al.af(w.this.ynV);\n al.n(w.this.ynV, 300);\n AppMethodBeat.o(29666);\n }\n });\n AppMethodBeat.o(29674);\n }", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "public void playTopHat() {\n\t\tSystem.out.println(\"ding ding da-ding\");\n\t\t\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 void beat() {\n\t\t\tSystem.out.println(\"Heart beating\");\n\t\t}", "public final void beK() {\n AppMethodBeat.i(88975);\n if (this.kaS.aZV().vTW != null && this.kaS.aZV().vTW.size() > 0) {\n tm tmVar = (tm) this.kaS.aZV().vTW.get(0);\n if (this.iPD != null) {\n this.iPD.setText(tmVar.title);\n }\n if (this.ksp != null) {\n if (TextUtils.isEmpty(tmVar.kbW)) {\n this.ksp.setVisibility(8);\n } else {\n this.ksp.setText(tmVar.kbW);\n }\n }\n if (this.ksq != null) {\n if (TextUtils.isEmpty(tmVar.kbX)) {\n this.ksq.setVisibility(8);\n } else {\n this.ksq.setText(tmVar.kbX);\n AppMethodBeat.o(88975);\n return;\n }\n }\n }\n AppMethodBeat.o(88975);\n }", "@Override\n\tpublic void laysEgg() {\n\t\t\n\t}", "private void eating(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "void bake() {\n\t\tSystem.out.println(\"Bake for 25 mins at 350\\u00b0\");\n\t}", "private void fahre(int aufzugNummer, int stockwerkAenderung){\n\t\tSystem.out.println();\r\n\t\t//Animation der Aufzüge\r\n\t\tTranslateTransition anpassung = new TranslateTransition(Duration.seconds(Aufzug.DAUER_PRO_STOCK*Math.abs(stockwerkAenderung)), aufzuge[aufzugNummer]);\r\n\t\tanpassung.setByY(stockwerkAenderung*stockwerkHohe);\r\n\t\tanpassung.play();\r\n\t}", "@Override\n public void eatLeaves()\n {\n setEatText(\"munch munch oink\");\n System.out.println(getEatText());\n }", "public void eat() {\n\t\tSystem.out.println(\"Ape eating\");\n\t}", "public void hatchKickerExtend() {\n hatchkicker.set(true);\n }", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSpeed = this.destPos;\n this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\n this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);\n if (!this.onGround && this.wingRotDelta < 1.0F) {\n this.wingRotDelta = 1.0F;\n }\n\n this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D);\n Vec3d vec3d = this.getMotion();\n if (!this.onGround && vec3d.y < 0.0D) {\n this.setMotion(vec3d.mul(1.0D, 0.6D, 1.0D));\n }\n\n this.wingRotation += this.wingRotDelta * 2.0F;\n if (!this.world.isRemote && this.isAlive() && !this.isChild() && getGender()==Gender.FEMALE && --this.timeUntilNextEgg <= 0) {\n this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\n this.entityDropItem(Items.EGG);\n this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\n }\n\n ++this.eatTicks;\n ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.MAINHAND);\n if (this.canEatItem(itemstack)) {\n if (this.eatTicks > 600) {\n ItemStack itemstack1 = itemstack.onItemUseFinish(this.world, this);\n if (!itemstack1.isEmpty()) {\n this.setItemStackToSlot(EquipmentSlotType.MAINHAND, itemstack1);\n }\n\n this.eatTicks = 0;\n } else if (this.eatTicks > 560 && this.rand.nextFloat() < 0.1F) {\n this.playSound(this.getEatSound(itemstack), 1.0F, 1.0F);\n this.world.setEntityState(this, (byte)45);\n }\n }\n\n }", "@Override\n\tpublic void HowtoEat() {\n\t\tSystem.out.println(\"Fırında Ye!!\");\n\t}", "@Override\n\tpublic void eats() {\n\t\t\n\t}", "public void handleBuyEggCommand(){\n if(Aquarium.money >= EGGPRICE) {\n Aquarium.money -= EGGPRICE;\n Aquarium.egg++;\n }\n }", "public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }", "@Override\n\t\tpublic void enter(Elsa elsa) {\n\t\t\tif (!elsa.isCooking()) {\n\t\t\t\ttalk(elsa, \"Putting the stew in the oven\");\n\n\t\t\t\t// Send a delayed message myself so that I know when to take the\n\t\t\t\t// stew out of the oven\n\t\t\t\tMessageManager.getInstance().dispatchMessage( //\n\t\t\t\t\t\t1, // time delay\n\t\t\t\t\t\telsa, // sender ID\n\t\t\t\t\t\telsa, // receiver ID\n\t\t\t\t\t\tMessageType.STEW_READY, // msg\n\t\t\t\t\t\tnull);\n\n\t\t\t\telsa.setCooking(true);\n\t\t\t}\n\t\t}", "@Override\n public void eat() {\n System.out.println(\"Now doggo is eating\");\n chew();\n super.eat();\n }", "private void boom() {\n showMessage(\"BOOM! Reload to try again\", \"boom\");\n }", "public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}", "public void eat() {\n if (!isTired()) {\n hunger -= 3;\n fatigue += 2;\n\n if (!muted) {\n System.out.println(\"eat\\t\\t|\\tYummy this is tasty!\");\n }\n }\n }", "public void eat() {\r\n System.out.println(\"ORANGES\");\r\n }", "public void run() {\n mOpponentEmoteBubble.setText(botEmotesArray[new Random().nextInt(botEmotesArray.length)]);\n showEmote(mOpponentEmoteBubble);\n\n }", "@Override\r\n\tpublic void pick() {\r\n\t\tSystem.out.println(\"Stay away from Jessica ya dweeb.\");\r\n\t\r\n\t}", "@Override\n\tpublic void eatfood() {\n\t\tSystem.out.println(\"==pig : 잡식 ==\");\n\t}", "public static void playEHigh() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 76, volume );//E\n\t\tThread.sleep(200);\n\t}", "public void muere() {\n System.out.println(\"Ugh... Llegó mi hora... Adios.\");\n }", "public void geldCheat() {\n if (geld + 1000000 < Long.MAX_VALUE) {\n geld = geld + 1000000;\n ticker.neueNachricht(\"Korruptionsverdacht bei Stadtwerken!\");\n }\n }", "public void playHoomans() {\r\n System.out.println(\"Thanks for killing each other, human!\");\r\n }", "@Override\r\n\tpublic String takeOff() {\n\t\treturn \"El Helicoptero esta despegando\";\r\n\t}", "@Override\n\tpublic void eat() {\n\t\tsuper.eat();\n\t\tSystem.out.println(\"喝奶.......\");\n\t}", "@Override\r\n\tpublic String Eat() {\n\t\treturn \"SuperMan I Eat\";\r\n\t}", "public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }", "public void eat()\n {\n System.out.println(\"You have eaten now and you are not hungry any more\");\n }", "public void cheat() {\r\n announce( \"cheat\" );\r\n }", "@Override\n public void askOxygen(){\n _brain.lungs.breath();\n _brain.heart.accelerate(1);\n }", "void emi(){\n\t\tSystem.out.println(\"This is HomeLoan EMi\");\n\t}", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "public void onEnergize() {\n\n\t}", "public void actionPerformed(ActionEvent e) {\n gui.activateTerrains(false);\n\n if (gui.getGUIState() == GUIState.MOVESHEEPFROM) {\n gui.activateTerrains(true);\n gui.setGUIState(GUIState.MOVESHEEPSELECTION);\n gui.activateSheepSelection(true, terrain);\n gui.getLAction2().setText(\"Seleziona quale ovino si vuole muovere\");\n } else if (gui.getGUIState() == GUIState.KILLSHEEP) {\n gui.setGUIState(GUIState.KILLSHEEPSELECTION);\n gui.activateSheepSelection(true, terrain);\n gui.getLAction2().setText(\"Seleziona quale ovino vuoi abbatere\");\n } else if (gui.getGUIState() == GUIState.JOINSHEEPS) {\n gui.setGUIState(GUIState.KILLSHEEPSELECTION);\n gui.sendJoinSheeps(terrain);\n } else if (gui.getGUIState() == GUIState.MOVESHEEPTO) {\n gui.activateDropDown(false);\n gui.setGUIState(GUIState.WAITINGFOROTHERPLAYER);\n gui.sendMoveSheep(terrain);\n }\n\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"eat grass\");\n\t}", "@Override\n public void onHeatWaterRaised() {\n heaterState = true;\n addCupButton.setVisible(false);\n takeCupButton.setVisible(false);\n }", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public static void playGHigh() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 79, volume );//E\n\t\tThread.sleep(200);\n\t}", "private void vuoronKolmasHeitto() {\n while (heittojaJaljella == 1) {\n if (tulosLaitettu) {\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException ex) {\n System.out.println(\"Ei ole heitetty tai laitettu tulosta\");\n }\n }\n }", "public void initElbow(){\r\n do{\r\n int currentElbowPosition = motorElbow.getCurrentPosition();\r\n posElbow = currentElbowPosition - DELTA_ELBOW;\r\n motorElbow.setTargetPosition(posElbow);\r\n motorElbow.setPower(POWER_ELBOW_SLOW);\r\n } while(!sensorElbow.isPressed());\r\n\r\n motorElbow.setPower(STOP);\r\n resetElbowEncoder();\r\n posElbow = 0;\r\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"狗吃肉\");\n\t}", "public void hungry()\r\n {\r\n \tSystem.out.println(\"I'm hungry!! Feed me!!\");\r\n \tbarking();\r\n }", "public void turnOn(){\n Logger.getGlobal().log(Level.INFO,\" Turning On..\");\n vendingMachine = new VendingMachine();\n inventoryPopulation();\n idle();\n }", "public void eat( ) // Start eating\r\n {\r\n isEating = true; // Change the state\r\n isSleeping = false;\r\n return;\r\n }", "@Override\n\tpublic void makeEyesWithMan() {\n\t\tSystem.out.println(\"Å×ÃÄÑÛÄØ¡£¡£¡£\");\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic void gameTick() {\n\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tfor (Block b: beacons) {\n\t\t\t\t\tw.playEffect(b.getLocation(), Effect.ENDER_SIGNAL, 0);\n\t\t\t\t}\n\t\t\t\tfor (Block b: gold_blocks) {\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsynchronized (timers) {\n\t\t\t\t\tfor (final byte data: timers.keySet()) {\n\t\t\t\t\t\tif (timers.get(data) > 0) {\n\t\t\t\t\t\t\ttimers.put(data, timers.get(data)-1);\n\t\t\t\t\t\t\tif (!extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.STAINED_GLASS);\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setData(data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(50);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\t\t\n\t\t\t\t\t\t\tif (extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, false);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.AIR);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void onTakeOffTeaBagRaised() {\n }", "@Override\n public void onTakeTeaBagRaised() {\n }", "private Egg(String name, int turnsToHatch, int hatchEarnings, Dinosaur babyDinosaur) {\n super(name, 'O', true);\n this.turnsToHatch = turnsToHatch;\n this.hatchEarnings = hatchEarnings;\n this.babyDinosaur = babyDinosaur;\n this.age = 0;\n }", "@Override\n public void eatMeat()\n {\n setEatText(\"nomnomnom oink thx\");\n System.out.println(getEatText());\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 }", "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 void eatEgg(Egg egg) {\n raiseFoodLevel(10);\n }", "public void eat () {\n System.out.println(\"He's eating everything\" );\n }", "public void bake() {\n System.out.println(\"Baking for 25 min at 350\");\n }", "@EventHandler\n\tpublic void onEggThrown(PlayerEggThrowEvent e){\n\t\t\n\t\tEntity egg = e.getEgg();\n\t\t\n\t\tif(e.getEgg().getCustomName().contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\te.setHatching(false);\n\t\t\t\n\t\t\tLocation loc = egg.getLocation();\n\t\t\t\n\t\t\tdropItem(loc);\n\t\t\t\n\t\t}\n\t\t\n\t}", "void displayEmotion() {\n if (emotion.getLifetime() == 0) { emotion = null; }\n else { emotion.decreaseLifetime(); }\n }", "void breed() {\n\t\tSystem.out.println(\"Ape breeding\");\n\t}", "public final void beJ() {\n AppMethodBeat.i(88974);\n this.ksq = (TextView) beI().findViewById(R.id.ake);\n this.ksp = (TextView) beI().findViewById(R.id.akd);\n AppMethodBeat.o(88974);\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "public void eat() {\n\t\tSystem.out.println(this.name + \" the \" + this.type + \" ate their rabbit meat.\");\n\t}", "public void updateEnergy(boolean up){\n\t\tif (up){\n\t\t\tElement el = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrb\");\n\t\t\tel.startEffect(EffectEventId.onCustom);\n\t\t\tElement elfade = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrbFade\");\n\t\t\telfade.startEffect(EffectEventId.onCustom,null,\"OrbChange\");\n\t\t}\n\t\telse{\n\t\t\tElement elfade = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrbFade\");\n\t\t\telfade.startEffect(EffectEventId.onCustom,null,\"OrbFade\");\n\t\t\tElement el = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrb\");\n\t\t\tel.startEffect(EffectEventId.onCustom);\n\t\t}\n\t}", "@Override\r\n\tpublic void onMachine() {\n System.out.println(\"Please On the machine to cook \");\r\n grillmachine.setState(grillmachine.getOnState());\r\n\t}", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "public void sleep() {\n hunger += 1;\n fatigue = 0;\n\n if (isHungry()) {\n mood -= 1;\n } else {\n mood += 1;\n }\n\n if (!muted) {\n System.out.println(\"sleep\\t|\\tzzzZZZ *sheep*\");\n }\n }", "@Override\r\n\tpublic void emettreOffre() {\n\t\t\r\n\t}", "private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}", "@Override\r\n\tpublic void autoSeatHeat() {\n\t\t\r\n\t}", "public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }", "@Override\r\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"ig tv power on\");\r\n\t}", "public static void playE() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 64, volume );//E\n\t\tThread.sleep(200);\n\t}", "@SubscribeEvent\n public void onPlayerClickGrassBlock(BonemealEvent event)\n {\n if (!event.getWorld().isRemote)\n {\n \t\n if (event.getBlock()==Blocks.GRASS.getDefaultState())\n {\n \tSystem.out.println(\"触发了骨粉对草方块施肥事件\");\n EntityLiving entityLiving = new EntityButterfly(event.getWorld());\n BlockPos pos = event.getPos();\n entityLiving.setPositionAndUpdate(pos.getX() , pos.getY()+1, pos.getZ());\n event.getWorld().spawnEntityInWorld(entityLiving);\n return;\n }\n }\n }", "public void stoperJeux() {\n\t\t\n\t\tliaison.stopper();\n\t}", "public static Event alienInvasion () {\n\t\tString alienText = \"Something has gone wrong!\" + System.lineSeparator() + \"Aliens are here to steal your farm\";\n\t\tString alienImage = \"images/event/aliens.jpg\";\n\t\tString[] alienOpTitle = {\"Oh no!\",\"The truth is out there\"};\n\t\tString[] alienOpText = {\"The farm is lost\", \"Cattle is mutilated\"+ System.lineSeparator() + \"50 % chance of abduction\"};\n\t\treturn new Event (-1, \"Alien Invasion!\", alienText , alienImage, alienOpTitle, alienOpText);\n\t}", "public JoepyeWeed(){\n\t\tsuper(\"joepyeweed\",\"Joe-pye Weed\", \"Eastern US\", false, \"Butterfly\", null, NONE,\n\t\t\tHIGH, MED, true, true, false, false, true);\n\n\t}", "private void vuoronToinenHeitto() {\n while (heittojaJaljella == 2) {\n if (tulosLaitettu) {\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException ex) {\n System.out.println(\"Ei ole heitetty tai laitettu tulosta\");\n }\n }\n }", "public void playAI() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"You're going to lose foolish human!\");\r\n }", "@Override\r\n\tpublic String Fly() {\n\t\treturn \"EL Helicoptero esta volando\";\r\n\t}", "@Override\n public void hero_dies() {\n SoundPlayer.playHeroDies();\n this.stop();\n\n get_hero().setPosition(PLAYER_START_POSITION);\n start();\n\n // setting every flower to its original position\n //reason: hero can knock the flower out of the pipe when it hits it\n for (int i = 0; i < get_pipes().size(); i++) {\n if (get_pipes().get(i).with_flower()) {\n get_pipes().get(i).get_flower().setLinearVelocity(new Vec2(0f, 0f));\n get_pipes().get(i).get_flower().setPosition(get_pipes().get(i).get_flower().get_original_position());\n }\n }\n \n for (int i = 0; i < get_fire_rods().size(); i++) {\n get_fire_rods().get(i).reset_position();\n }\n get_hero().addLife(-1);\n if (get_hero().get_life() < 1){\n getGameController().gameOver();\n //get_sound_player().stop_level_two_music();\n }\n }", "@Override\r\n\tpublic void breathe() {\n\t\tSystem.out.println(\"#gasp#\");\r\n\t}", "public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }", "public void defender(){setModopelea(1);}", "public void geraeuschMachen() {\n System.out.println(\"BRUELL\");\n }", "private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}", "public void mo5968e() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{-((float) C1413m.f5711i.getHeight()), 0.0f}).setDuration(240);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{0.0f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f}).setDuration(240);\n duration.start();\n duration2.start();\n long j = (long) 160;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5438qa, \"alpha\", new float[]{1.0f, 0.0f}).setDuration(j).start();\n duration.addListener(new C1302Xa(this));\n }", "public void eog(String str) throws PaleoException {\n\t\trunProcess(\"eog \" + str + \".png\");\n\t}", "public void erzaehlWas() {\n // Das Gleiche was jedes Tier sagt.\n super.erzaehlWas();\n\n // Zusaetzliche Aussage des Affen\n System.out.println(\"Affen sind einfach die besten Tiere.\");\n }" ]
[ "0.65241885", "0.64581764", "0.6426587", "0.63979393", "0.6147012", "0.6137614", "0.6124725", "0.6086434", "0.6054551", "0.6015583", "0.60096794", "0.59413373", "0.5941201", "0.5924973", "0.59190845", "0.5914069", "0.59089553", "0.5891293", "0.58825135", "0.58604854", "0.585006", "0.5833968", "0.5814449", "0.5791062", "0.5782402", "0.57799095", "0.5776405", "0.57727885", "0.57404035", "0.5739458", "0.5739042", "0.5738864", "0.5737413", "0.5734681", "0.57339287", "0.57332325", "0.572133", "0.5707067", "0.56951064", "0.5692895", "0.5692229", "0.56910425", "0.5683192", "0.5678224", "0.5672126", "0.56653684", "0.56557506", "0.5654325", "0.56532425", "0.5652772", "0.56510496", "0.56501997", "0.5646363", "0.5644039", "0.5637081", "0.5637014", "0.56300586", "0.56271994", "0.56246024", "0.5624201", "0.56236166", "0.56216156", "0.5618132", "0.56157374", "0.56127083", "0.56113726", "0.56105745", "0.56093574", "0.55960083", "0.5591512", "0.5586353", "0.5585173", "0.5581101", "0.5575108", "0.5573473", "0.5570741", "0.55448776", "0.55423796", "0.55417633", "0.55382717", "0.55381435", "0.5536045", "0.55351585", "0.5532296", "0.5532165", "0.5528333", "0.552606", "0.55136156", "0.55124617", "0.5510999", "0.5509431", "0.55080986", "0.55071527", "0.5507109", "0.5506191", "0.55001915", "0.5494404", "0.54943496", "0.5494199", "0.5489664" ]
0.61015993
7
Palauttaa "Easter Eggin" xkoordinaatin.
public int getEgX() { return egX; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEgX(int x) {\n\t\tthis.egX = x;\n\t}", "@Override\n\tpublic void office_location() {\n\t\tSystem.out.println(\"Office location is Gurgaon\");\n\t}", "int getLatE6();", "int getLatE6();", "public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\tg[1] = m[1][0] + m[1][1] + m[1][2];\n\t\tg[2] = m[2][0] + m[2][1] + m[2][2];\n\t\t\n\t\tg[3] = m[0][0] + m[1][0] + m[2][0];\n\t\tg[4] = m[0][1] + m[1][1] + m[2][1];\n\t\tg[5] = m[0][2] + m[1][2] + m[2][2];\n\t\t\n\t\tg[6] = m[0][0] + m[1][1] + m[2][2];\n\t\tg[7] = m[2][0] + m[1][1] + m[0][2];\n\t\tg[8] = \"0\";\n\t\tg[9] = \"0\";\n\t\t\n\t\tfor(int i= 0; i<10; i++) {\n\t\t\tif(g[i].equals(\"XXX\")){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"X GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\temp = 0; \n\t\t\t\tbreak;\n\t\t\t} else if (g[i].equals(\"OOO\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\"O GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\t\n\t\tif (emp == 9) {\n\t\t\tJOptionPane.showMessageDialog(null,\"EMPATOU\");\t\n\t\t\tacabou = true;\n\t\t}\n\t}", "public String getXkjg() {\n\t\treturn xkjg;\n\t}", "public String playerNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-200 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+250 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}", "@Override\r\n\tpublic int getGela_kop() {\n\t\treturn super.getGela_kop();\r\n\t}", "public void getK_Gelisir(){\n K_Gelistir();\r\n }", "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}", "@Override\n public String toString() {\n return \"@(\"+x+\"|\"+y+\") mit Bewegung: \"+bewegung;\n }", "@Override\n public String location() {\n return \"Vị trí sách giáo khoa\";\n }", "public int getEgY() {\n\t\treturn egY;\n\t}", "public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void setEgY(int y) {\n\t\tthis.egY = y;\n\t}", "int getLngE6();", "int getLngE6();", "public String playerRealNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-50 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+100 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}", "public void onderbreek(){\n \n }", "public static void alturaArbol() {\n int angulo = 35;\n\n double anguloConvert = Math.toRadians(angulo);\n int x = 20;\n int y;\n y = (int) Math.round(x * Math.tan(anguloConvert));\n System.out.println(\"Altura del arbol: \" + y);\n }", "public Persoon(){\n geboorteDag = 0;\n geboorteMaand = 0;\n geboorteJaar = 0;\n nieuweGeslacht = 'x';\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 }", "@Override\n\tpublic void tanCongKeXau() {\n\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM27E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM27E());\n }", "@Override\n\tpublic String getGiangVien() {\n\t\treturn giangVien.getTenGiangVien();\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM72E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM72E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM138E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM138E());\n }", "@Override\r\n\tpublic Town getDroghedaLocation() {\n\t\treturn new Town(\"36 Saint Laurence Street\");\r\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM105E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM105E());\n }", "@Test\n public void testPulkovo1995GKZone5N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5N());\n }", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM75E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM75E());\n }", "@Test\n public void testPulkovo1995GKZone25N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25N());\n }", "@Test\n public void testPulkovo19953DegreeGKCM57E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM57E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM177E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM177E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM78E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM78E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM174E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM174E());\n }", "@Test\n public void testPulkovo1995GKZone27N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27N());\n }", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "@Test\n public void testPulkovo1995GKZone25() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25());\n }", "@Test\n public void testPulkovo19953DegreeGKCM144E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM144E());\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}", "@Test\n public void testPulkovo19953DegreeGKCM129E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM129E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM135E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM135E());\n }", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\n }", "@Test\n public void testPulkovo19953DegreeGKCM96E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM96E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM51E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM51E());\n }", "public void bewegeKamel(Charakter charakter);", "@Override\n\tpublic long getXacnhan() {\n\t\treturn _phieugiahan.getXacnhan();\n\t}", "public n baw() {\n return this.ewZ;\n }", "@Test\n public void testPulkovo19953DegreeGKCM126E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM126E());\n }", "public String getXingming() {\n return xingming;\n }", "@Test\n public void testPulkovo19953DegreeGKCM84E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM84E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM117E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM117E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM153E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM153E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM123E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM123E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM99E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM99E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM36E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM36E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM93E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM93E());\n }", "public String getName()\r\n {\n return \"arctan\";\r\n }", "@Test\n public void testPulkovo19953DegreeGKCM69E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM69E());\n }", "public void ustawPojazdNaPoczatek()\n\t{\n\t\tSciezka pierwszaSc = droga.get(0);\n\t\tfinal double y = 10;\n\t\tpojazd.zmienPozycje(pierwszaSc.getCenterDownX(), y);\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM54E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM54E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM39E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM39E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM162E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM162E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM171E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM171E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM156E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM156E());\n }", "public double getEnergia() { return energia; }", "@Test\n public void testPulkovo1995GKZone5() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5());\n }", "@Test\n public void testPulkovo1995GKZone13N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone13N());\n }", "@Test\n public void testPulkovo1995GKZone27() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27());\n }", "@Test\n public void testPulkovo1995GKZone7N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone7N());\n }", "@Test\n public void testPulkovo19953DegreeGKZone25() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone25());\n }", "@Test\n public void testPulkovo19953DegreeGKCM21E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM21E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM108E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM108E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM147E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM147E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM168E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM168E());\n }", "@Override\n\tpublic void getCoordinates() {\n\t\tSystem.out.println(\"Your Coordinates: 18.1124° N, 79.0193° E \");\n\t}", "public int getSeilX() {\n\t\tif (this instanceof Seilaufhaenger) {\n\t\t\tif (((Seilaufhaenger) this).getHangingElement() != null) {\n\t\t\t\tElement hangingElement = ((Seilaufhaenger) this).getHangingElement();\n\t\t\t\treturn hangingElement.getMPoint().x;\n\t\t\t}\n\t\t}\n\t\treturn (getX() + (int) (seilxRel * xscale));\n\t}", "@Test\n public void testPulkovo19953DegreeGKCM42E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM42E());\n }", "public BrewedEspresso(Gelato gelato) {\n super(gelato);\n }", "@Test\n public void testPulkovo19953DegreeGKZone27() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone27());\n }", "@Test\n public void testPulkovo19953DegreeGKCM150E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM150E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM87E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM87E());\n }", "@Test\n public void testPulkovo1995GKZone14N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone14N());\n }", "public String getXingshi() {\n return xingshi;\n }", "@Test\n public void testPulkovo19953DegreeGKCM111E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM111E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM102E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM102E());\n }", "Sketch apex();", "@Test\n public void testPulkovo19953DegreeGKZone56() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone56());\n }", "@Test\n public void testPulkovo19953DegreeGKCM159E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM159E());\n }", "public void gambarTanda(int x1, int y1,int x2, int y2, int x3, int y3, String kata, Graphics g)\n {\n int arrayX[]={x1,x2,x3};\n int arrayY[]={y1,y2,y3};\n g.setColor(new Color(153,153,255));\n g.fillPolygon(arrayX,arrayY,3);\n g.setColor(Color.BLUE);\n g.drawString(kata,x1-10,y1+10);\n }", "public void nascitaAgnello() {\n\t\tpecore.add(new Agnello());\n\t\tnumeroAgelli++;\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}", "abstract double getOrgX();", "@Test\n public void testPulkovo19953DegreeGKCM132E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM132E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM30E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM30E());\n }", "@Test\n public void testPulkovo19953DegreeGKCM33E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM33E());\n }", "public void testOctaedre() {\n\t\t\t\n\t\t\tSolide i = Octaedre.octaedre();\n\t\t\t\n\t\t\t/* creation de points qui ont les memes coordonnees que ceux qui \n\t\t\t * constituent notre solide (car octaedre() n'a pas de parametres)\n\t\t\t */\n\t\t\t\n\t\t\tPoint p1 = new Point(-25, 0,-25);\n\t\t\tPoint p2 = new Point(-25, 0,25);\n\t\t\tPoint p3 = new Point(25, 0,-25);\n\t\t\tPoint p4 = new Point(25,0,25);\n\t\t\tfloat hauteur = (float) (50/Math.sqrt(2));\n\t\t\t// on se sert de la hauteur pour donnee les coordonees des sommets manquant\n\t\t\tPoint p5 = new Point(0, hauteur,0);\n\t\t\tPoint p6 = new Point(0,-hauteur,0);\n\t\t\t\n\t\t\t//On teste si les points de l'octaedre i sont bien les memes que ceux créés\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getAbscisse()==(p1.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(1).getAbscisse()==(p2.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(5).getAbscisse()==(p3.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(3).getAbscisse()==(p4.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(2).getAbscisse()==(p5.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(0).getAbscisse()==(p6.getAbscisse()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getOrdonnee()==(p1.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(1).getOrdonnee()==(p2.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(5).getOrdonnee()==(p3.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(3).getOrdonnee()==(p4.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(2).getOrdonnee()==(p5.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(0).getOrdonnee()==(p6.getOrdonnee()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getProfondeur()==(p1.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(1).getProfondeur()==(p2.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(5).getProfondeur()==(p3.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(3).getProfondeur()==(p4.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(2).getProfondeur()==(p5.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(0).getProfondeur()==(p6.getProfondeur()));\n\t\t\t\n\t\t\t//On teste si les faces de l'octaedre contiennent bien les points créés\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(0).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(1).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(2).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(3).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p6));\n\t\t\n\t\t\tassertTrue(i.getFaces().get(4).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(5).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(6).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(7).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p6));\n\t\t\t\n\t\t\t\n\t\t\t\n\t}" ]
[ "0.6147577", "0.56766564", "0.56759626", "0.56759626", "0.5634787", "0.55966306", "0.5594931", "0.5546423", "0.55399466", "0.553828", "0.55381054", "0.5530812", "0.55224067", "0.5500778", "0.5485675", "0.5460618", "0.5452744", "0.5452744", "0.5424041", "0.54005843", "0.539436", "0.5379875", "0.5371816", "0.5356128", "0.53514636", "0.53448755", "0.5330411", "0.5329191", "0.5327322", "0.5325654", "0.53164685", "0.53163946", "0.5314863", "0.5313106", "0.53126", "0.530727", "0.53045964", "0.5304215", "0.530358", "0.52997345", "0.5298591", "0.52970666", "0.52967966", "0.529644", "0.5292891", "0.5291145", "0.5286077", "0.528373", "0.52824086", "0.5282101", "0.52791125", "0.52777565", "0.5277726", "0.5277227", "0.52752125", "0.5275062", "0.52719724", "0.52709126", "0.52698165", "0.5269387", "0.5268113", "0.52676797", "0.526539", "0.52653223", "0.5264672", "0.5264171", "0.52635646", "0.52610004", "0.52602345", "0.52599573", "0.5258653", "0.52574706", "0.52563465", "0.52529544", "0.525214", "0.52484566", "0.52482414", "0.524707", "0.52466816", "0.5244252", "0.52424926", "0.524084", "0.5239083", "0.5238173", "0.523809", "0.52365273", "0.52356976", "0.5234632", "0.5234333", "0.52335924", "0.5232874", "0.5230082", "0.5227651", "0.522595", "0.522193", "0.52215433", "0.52201587", "0.52198744", "0.5219468", "0.5218533" ]
0.61172897
1
Asettaa "Easter Eggin" xkoordinaatin.
public void setEgX(int x) { this.egX = x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEgY(int y) {\n\t\tthis.egY = y;\n\t}", "public int getEgX() {\n\t\treturn egX;\n\t}", "private void setEnergia(double nuovaEnergia)\r\n\t{\r\n\t\tif (nuovaEnergia > MAX) energia = MAX;\r\n\t\telse if (nuovaEnergia < 0.0) energia = 0.0;\r\n\t\telse energia = nuovaEnergia;\r\n\r\n\t\tstorico = allarga(storico);\r\n\r\n\t\tstorico[storico.length-1] = energia;\r\n\t\t\r\n\t}", "public void azzera() { setEnergia(0.0); }", "public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}", "public void setzeGegnerStein(int gegnerZug){\t\n\t\t//Falls eigener Agent startet wird -1 uebergeben\n\t\tif(gegnerZug >= 0){\t\t\t\t\n\t\t\tfor(int i=0; i<6; i++) {\n\t\t\t\tif(spielfeld[gegnerZug][i].equals(\"_\")){\n\t\t\t\t\tspielfeld[gegnerZug][i] = gegnerStein;\n\t\t\t\t\tgegnerPunkt.setLocation(gegnerZug, i);\n\t\t\t\t\tbreak;\n\t\t\t\t} //end if\n\t\t\t} //end for\t\t\t\t\n\t\t} \t\t\n\t}", "@Override\n\tpublic void tanCongKeXau() {\n\n\t}", "public void setzeEigenenStein(int spielzug){\t\t\n\t\t//Setze eigenen Stein\n\t\tfor(int i=0; i<6; i++) {\n\t\t\tif(spielfeld[spielzug][i].equals(\"_\")){\n\t\t\t\tspielfeld[spielzug][i] = eigenerStein;\n\t\t\t\teigenerPunkt.setLocation(spielzug, i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t}", "public int getEgY() {\n\t\treturn egY;\n\t}", "public double getEnergia() { return energia; }", "protected void moveEast(){\n\t\tcar.setXLocation(currentX + 1);\n\t\tcurrentX += 1;\n\t}", "public static void alturaArbol() {\n int angulo = 35;\n\n double anguloConvert = Math.toRadians(angulo);\n int x = 20;\n int y;\n y = (int) Math.round(x * Math.tan(anguloConvert));\n System.out.println(\"Altura del arbol: \" + y);\n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void EasterMath(int year)\n {\n a = year%19;\n b = Math.floor(year/100);\n c = year%100;\n d = Math.floor((b/4));\n e = b%4;\n f = Math.floor((b+8)/25);\n g = Math.floor((b-f+1)/3);\n h = (19*a+b-d-g+15)%30;\n i = Math.floor(c/4);\n k = c%4;\n l = (32 + 2* e + 2 * i - h - k)%7;\n m = Math.floor((a+11*h+22*l)/451);\n month = (int) Math.floor((h+l-7*m+114)/31);\n day = (int) (((h+l-7*m+114)%31)+1);\n }", "public void reserveer() {\n System.out.println(\"de eigenaar van de auto is: \" + i.eigenaar());\n\n }", "public void setEnergie(int energie) {\r\n\t\tthis.energie = energie;\r\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 kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\n }", "void setEphemerisMode();", "public Easter(int year)\n {\n this.year = year;\n endYear = year + 5700000;\n a = year%19;\n b = Math.floor(year/100);\n c = year%100;\n d = Math.floor((b/4));\n e = b%4;\n f = Math.floor((b+8)/25);\n g = Math.floor((b-f+1)/3);\n h = (19*a+b-d-g+15)%30;\n i = Math.floor(c/4);\n k = c%4;\n l = (32 + 2* e + 2 * i - h - k)%7;\n m = Math.floor((a+11*h+22*l)/451);\n month = (int) Math.floor((h+l-7*m+114)/31);\n day = (int) (((h+l-7*m+114)%31)+1);\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 void init_erup() {\n\t\tchange=5;\n\t\tfor(int x=x_max-change ; x <= x_max+change ; x++) {\n\t\t\tfor(int y=y_max-change ; y <= y_max+change ; y++) {\n\t\t\t\tif(x>=0 && x<w.getX() && y>=0 && y<w.getY() ) {\n\t\t\t\t\tif(w.n.alti[x][y]==9)\n\t\t\t\t\t\tliquide[x][y]=10;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void KareEkle() {\n\t\t\n\t\tint x = root.x;\n\t\tint y = root.y;\n\t\t\n\t\tNodeYilan eklenecekKare = new NodeYilan(root.x,root.y);\n\t\t\n\t\troot.x = x;\n\t\troot.y = y;\n\t\teklenecekKare.next = root;\n\t\troot = eklenecekKare;\n\t\t\n\t}", "public EarthGeometry(){\n\t\tgcl1 = new GeodeticCalculator();\n\t\trnd1 = new Random(56789);\n\t}", "public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\tg[1] = m[1][0] + m[1][1] + m[1][2];\n\t\tg[2] = m[2][0] + m[2][1] + m[2][2];\n\t\t\n\t\tg[3] = m[0][0] + m[1][0] + m[2][0];\n\t\tg[4] = m[0][1] + m[1][1] + m[2][1];\n\t\tg[5] = m[0][2] + m[1][2] + m[2][2];\n\t\t\n\t\tg[6] = m[0][0] + m[1][1] + m[2][2];\n\t\tg[7] = m[2][0] + m[1][1] + m[0][2];\n\t\tg[8] = \"0\";\n\t\tg[9] = \"0\";\n\t\t\n\t\tfor(int i= 0; i<10; i++) {\n\t\t\tif(g[i].equals(\"XXX\")){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"X GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\temp = 0; \n\t\t\t\tbreak;\n\t\t\t} else if (g[i].equals(\"OOO\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\"O GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\t\n\t\tif (emp == 9) {\n\t\t\tJOptionPane.showMessageDialog(null,\"EMPATOU\");\t\n\t\t\tacabou = true;\n\t\t}\n\t}", "public void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "public String displayEaster(){\n\n if (month == 3){\n Month = \"März\";\n }\n if (month == 4){\n Month = \"April\";\n }\n\n System.out.printf(\"\\nEaster:%s %d, %d \",Month,day,year);\n return String.format(\"Easter: %d. %s %d\",day, Month, year);\n }", "Sketch apex();", "public Location east()\r\n {\r\n // return new Location(x + 1, y);\r\n Location loc = new Location(x + 1, y);\r\n return loc;\r\n }", "public abstract void bepaalGrootte();", "public void aGp() {\n am.bS(this.dvY);\n }", "public EQU_GAINSetup()\n\t{\n\t\tinitComponents();\n\t\tthis.pack();\n\t\tthis.setPreferredSize(new Dimension(500, 600));\n\t}", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "@Override\n\tpublic void setEast(float east) {\n\t\t\n\t}", "public void einde(){\n if(veld[speler.getY()][speler.getX()] == 6){\n System.exit(0);\n }\n }", "public void tip()\r\n\t{\n\t\tSystem.out.println(\"Tipul de organizare: SAT!\");\r\n\t}", "public void draw_Energizer(boolean b) {\n if (b) {\n mazeEditor.mazeDrawMode = DRAW_ENERGIZER;\n\n Tog1.setState(false); \n Tog3.setState(false); \n Tog4.setState(false); \n Tog5.setState(false);\n Tog6.setState(false);\n Tog7.setState(false);\n }\n }", "public void BigE_and_Truana()\r\n\t{\r\n\t\t/* ____________ First get an approximate value of BIGE ______________________*/\r\n\t\t\r\n\t\tTANE = Trig.DegTAN ( EM ) / ( Trig.DegCOS ( EM ) - E );\r\n\t BIGE = Math.atan ( TANE ) * TRGVAR.R_to_D;\r\n\t E0 = E * TRGVAR.R_to_D;\r\n\t \r\n\t BIGE = BIGE % 360;\r\n\t BIGE0 = BIGE ;\r\n\t \r\n\t BIGE = BIGE0 + ( EM + E0 * Trig.DegSIN ( BIGE0 ) - BIGE0 ) / ( 1. - E * Trig.DegCOS ( BIGE0 ));\r\n\t \r\n\t /* ____________ Get more accurate value of BIGE by iteration ______________________*/\r\n\t \r\n\t COUNT = 0;\r\n\t ERROR = Math.abs (( BIGE - BIGE0 ) / BIGE0 );\r\n\t BIGE0 = BIGE ;\r\n\t \r\n\t while ( ERROR > 0.000001 || COUNT < 20) {\r\n\t \tBIGE = BIGE0 + ( EM + E0 * Trig.DegSIN ( BIGE0 ) - BIGE0 ) / ( 1. - E * Trig.DegCOS ( BIGE0 ));\r\n\t \tERROR = Math.abs (( BIGE - BIGE0 ) / BIGE0 ); //loop body\r\n\t \tBIGE0 = BIGE;\r\n\t \tCOUNT++;\r\n\t \t}\r\n\t \r\n\t TANVB2 = Math.sqrt (( 1.+E ) / ( 1.-E )) * Trig.DegTAN ( BIGE / 2. );\r\n\t \r\n\t TRUANA = 2. * Math.atan ( TANVB2 ) * TRGVAR.R_to_D;\r\n\t TRUANA = TRUANA % 360;\r\n\t \r\n\t System.out.println( \" ERROR = \" + ERROR + \" COUNT = \" + COUNT + \" BIGE = \" + BIGE + \" TRUANA = \" + TRUANA );\r\n\t \r\n\r\n\t}", "public void gambarTanda(int x1, int y1,int x2, int y2, int x3, int y3, String kata, Graphics g)\n {\n int arrayX[]={x1,x2,x3};\n int arrayY[]={y1,y2,y3};\n g.setColor(new Color(153,153,255));\n g.fillPolygon(arrayX,arrayY,3);\n g.setColor(Color.BLUE);\n g.drawString(kata,x1-10,y1+10);\n }", "public double getEast() {\n return east;\n }", "double getAxon();", "public static void main(String[] args) throws Exception {\n KegiatanSatu keg1 = new KegiatanSatu();\n \n System.out.println(\"Kegiatan Satu\");\n keg1.kegiatanSatu();\n }", "public void setAnfang(Vektor anfang) {\n\t\tthis.anfang = anfang;\n\t}", "public balik_turleri() {\n initComponents();\n Toolkit toolkit = getToolkit();\n Dimension dim = toolkit.getScreenSize();\n setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);\n setTitle(\"Balık Türleri Ekranı\");\n }", "public n baw() {\n return this.ewZ;\n }", "public double get_Easting() {\n return this.Easting;\n }", "public EarthGeometry(int iRandomSeed){\n\t\tgcl1 = new GeodeticCalculator();\n\t\trnd1 = new Random(iRandomSeed);\n\t}", "private double calc_E(KeplerElements a) {\n\t\tdouble sqrome2 = Math.sqrt(1.0 - a.e * a.e);\r\n\t\tdouble cta = Math.cos(a.ta);\r\n\t\tdouble sta = Math.sin(a.ta);\r\n\t\tdouble sine0 = (sqrome2 * sta) / (1.0 + a.e * cta);\r\n\t\tdouble cose0 = (a.e + cta) / (1.0 + a.e * cta);\r\n\t\tdouble e0 = Math.atan2(sine0, cose0);\r\n\t\treturn e0;\r\n\r\n\t}", "@Test\n\tpublic void testXGivenT() {\n\t\tdouble x1 = 0, x2 = 21.65, x3 = 43.30, x4 = 47.63;\n\t\tdouble v0 = 25;\n\t\tdouble theta = 30;\n\t\tdouble t1 = 0, t2 = 1, t3 = 2, t4 = 2.2;\n\t\tassertEquals(PhysicsEngine.findXPos(v0, theta, t1, 0), x1, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v0, theta, t2, 0), x2, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v0, theta, t3, 0), x3, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v0, theta, t4, 0), x4, DELTA);\n\t\t\n\t\tdouble x5 = 0, x6 = 21.02, x7 = 42.05, x8 = 46.25;\n\t\tdouble v1 = 38.6;\n\t\tdouble phi = 57;\n\t\tassertEquals(PhysicsEngine.findXPos(v1, phi, t1, 0), x5, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v1, phi, t2, 0), x6, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v1, phi, t3, 0), x7, DELTA);\n\t\tassertEquals(PhysicsEngine.findXPos(v1, phi, t4, 0), x8, DELTA);\n\t}", "public String getXkjg() {\n\t\treturn xkjg;\n\t}", "private void adjustGraph() {\n //Ajustamos el eje x\n XAxis ejeX = lengthGraph.getXAxis();\n ejeX.setPosition(XAxis.XAxisPosition.BOTTOM);\n ejeX.setEnabled(true);\n ejeX.setDrawLabels(true);//Esto es solo para poner los numeros del eje\n ejeX.setDrawAxisLine(true);\n if(this.mag == 2){\n ejeX.setAxisMaximum(2);\n }else{\n ejeX.setAxisMaximum(18);\n }\n ejeX.setAxisMinimum(0);\n\n //Ajustamos el eje y\n YAxis ejeY = lengthGraph.getAxisLeft();\n //ejeY.setPosition(YAxis.YAxisPosition.LEFT);\n ejeY.setDrawLabels(true);\n ejeY.setDrawAxisLine(true);\n ejeY.setAxisMaximum(round(maxY[mag])+5);\n ejeY.setAxisMinimum(round(minY[mag])-5);\n lengthGraph.getAxisRight().setEnabled(false);//Asi no se ve el eje de la derecha\n\n //Adjusting the title\n String title;\n if(dato == null) title = titleMag[mag] + \" \" + this.name;\n else title = titleMag[mag] + \" \" + titleGen[gen];\n textTitulo.setText(title);\n\n //Adjusting the legend\n Legend leyenda = lengthGraph.getLegend();\n leyenda.setEnabled(false);\n\n Description d = lengthGraph.getDescription();\n d.setText(\"edad [años]\");\n\n //Adjusting the zoom\n //lengthGraph.setPinchZoom(true); //This is to make zoom in all directions\n\n\n lengthGraph.invalidate();\n }", "public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}", "public static void main(String[] arhg) {\n\n Conta p1 = new Conta();\n p1.setNumConta(1515);\n p1.abrirConta(\"cp\");\n p1.setDono(\"wesley\");\n p1.deposita(500);\n // p1.saca(700); -> irá gera um erro pois o valor de saque especificado é superior ao valor que tem na conta\n\n p1.estadoAtual();\n }", "public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }", "@Override\r\n\tdouble alan() {\n\t\tSystem.out.println(\"Ucgenin Alani : \");\r\n\t\treturn kenar1 * kenar2 /2;\r\n\t}", "public ILocation east()\n {\n Location east = new Location(x + 1, y);\n return east;\n }", "public static void main(String args[]) {\n System.out.println(\"OrbitEphem Test\");\n\n try {\n AstroDate astro = new AstroDate(); //2006, AstroDate.JANUARY, 1);\n TimeElement time = new TimeElement(astro, TimeElement.SCALE.UNIVERSAL_TIME_UT1);\n CityElement city = City.findCity(\"Madrid\");\n ObserverElement observer = ObserverElement.parseCity(city);\n EphemerisElement eph = new EphemerisElement(\n Target.TARGET.MARS,\n EphemerisElement.COORDINATES_TYPE.APPARENT,\n EphemerisElement.EQUINOX_OF_DATE,\n EphemerisElement.TOPOCENTRIC,\n EphemerisElement.REDUCTION_METHOD.IAU_2009,\n EphemerisElement.FRAME.ICRF);\n eph.algorithm = EphemerisElement.ALGORITHM.VSOP87_ELP2000ForMoon;\n\n EphemElement ephem = Ephem.getEphemeris(time, observer, eph, true);\n String name = eph.targetBody.getName();\n System.out.println(\"\" + name + \" RA: \" + Functions.formatRA(ephem.rightAscension));\n System.out.println(\"\" + name + \" DEC: \" + Functions.formatDEC(ephem.declination));\n System.out.println(\"\" + name + \" dist: \" + ephem.distance);\n\n // Calculate ephemeris\n double JD = TimeScale.getJD(time, observer, eph, TimeElement.SCALE.BARYCENTRIC_DYNAMICAL_TIME);\n OrbitalElement orbit = OrbitEphem.getOrbitalElements(eph.targetBody, JD);\n //orbit.meanMotion = OrbitEphem.obtainMeanMotion(eph.targetBody, orbit.semimajorAxis);\n eph.orbit = orbit;\n ephem = OrbitEphem.orbitEphemeris(time, observer, eph);\n\n System.out.println(\"ORBIT\");\n System.out.println(\"JD \" + JD);\n System.out.println(\"\" + name + \" RA: \" + Functions.formatRA(ephem.rightAscension));\n System.out.println(\"\" + name + \" DEC: \" + Functions.formatDEC(ephem.declination));\n System.out.println(\"\" + name + \" dist: \" + ephem.distance);\n\n // Calculate orbit of a comet\n AstroDate new_astro = new AstroDate(); //2451545.0);\n TimeElement new_time = new TimeElement(new_astro, TimeElement.SCALE.UNIVERSAL_TIME_UTC);\n if (!Configuration.isAcceptableDateForComets(new_time.astroDate, false))\n Configuration.updateCometsInTempDir(new_time.astroDate);\n int index = OrbitEphem.getIndexOfComet(\"2015 G2\");\n //observer = ObserverElement.parseObservatory(Observatory.findObservatorybyName(\"Yebes\"));\n OrbitalElement new_orbit = OrbitEphem.getOrbitalElementsOfComet(index);\n\n EphemerisElement another_eph = new EphemerisElement(Target.TARGET.Comet, EphemerisElement.COORDINATES_TYPE.APPARENT,\n EphemerisElement.EQUINOX_J2000, EphemerisElement.TOPOCENTRIC, EphemerisElement.REDUCTION_METHOD.IAU_2009,\n EphemerisElement.FRAME.ICRF, EphemerisElement.ALGORITHM.ORBIT, new_orbit);\n EphemElement another_ephem = Ephem.getEphemeris(new_time, observer, another_eph, true);\n EphemElement another_ephem2 = OrbitEphem.orbitEphemeris(new_time, observer, another_eph);\n name = new_orbit.name;\n JD = new_astro.jd();\n System.out.println(\"JD \" + JD + \" / \" + name);\n ConsoleReport.fullEphemReportToConsole(another_ephem);\n ConsoleReport.fullEphemReportToConsole(another_ephem2);\n\n // Calculate orbit of Pluto\n double pos[] = new double[] { -26.06710, -11.92126, 8.80594 };\n double vel[] = new double[] { 0.001633041, -0.003103617, -0.000152622 };\n double mass = 0.0;\n AstroDate date = new AstroDate(1982, 1, 31);\n double jd = date.jd();\n OrbitalElement PlutoOrbit = OrbitEphem.obtainOrbitalElementsFromPositionAndVelocity(pos, vel, jd, mass);\n\n System.out.println(\"Osculating elemens for Pluto in 1982-1-31 obtained from position and velocity vectors:\");\n System.out.println(\"i = \" + PlutoOrbit.inclination * Constant.RAD_TO_DEG);\n System.out.println(\"o = \" + PlutoOrbit.ascendingNodeLongitude * Constant.RAD_TO_DEG);\n System.out.println(\"a = \" + PlutoOrbit.semimajorAxis);\n System.out.println(\"e = \" + PlutoOrbit.eccentricity);\n System.out.println(\"w = \" + PlutoOrbit.argumentOfPerihelion * Constant.RAD_TO_DEG);\n System.out.println(\"M = \" + PlutoOrbit.meanAnomaly * Constant.RAD_TO_DEG);\n System.out.println(\"n = \" + PlutoOrbit.meanMotion * Constant.RAD_TO_DEG);\n\n PlutoOrbit = OrbitEphem.getOrbitalElements(Target.TARGET.Pluto, jd, EphemerisElement.ALGORITHM.MOSHIER);\n\n System.out.println(\"Same data obtained from Moshier ephemeris (DE404, i, o, and w refered to J2000):\");\n System.out.println(\"i = \" + PlutoOrbit.inclination * Constant.RAD_TO_DEG);\n System.out.println(\"o = \" + PlutoOrbit.ascendingNodeLongitude * Constant.RAD_TO_DEG);\n System.out.println(\"a = \" + PlutoOrbit.semimajorAxis);\n System.out.println(\"e = \" + PlutoOrbit.eccentricity);\n System.out.println(\"w = \" + PlutoOrbit.argumentOfPerihelion * Constant.RAD_TO_DEG);\n System.out.println(\"M = \" + PlutoOrbit.meanAnomaly * Constant.RAD_TO_DEG);\n System.out.println(\"n = \" + PlutoOrbit.meanMotion * Constant.RAD_TO_DEG);\n\n\n System.out.println(\"Orbit determination example:\");\n int n = 3;\n TimeElement times[] = new TimeElement[n];\n ObserverElement observers[] = new ObserverElement[n];\n EphemerisElement ephs[] = new EphemerisElement[n];\n LocationElement locations[] = new LocationElement[n];\n CityElement citym = City.findCity(\"Madrid\");\n TimeElement timem = new TimeElement();\n EphemerisElement ephm = new EphemerisElement(\n Target.TARGET.MARS,\n EphemerisElement.COORDINATES_TYPE.APPARENT,\n EphemerisElement.EQUINOX_OF_DATE,\n EphemerisElement.TOPOCENTRIC,\n EphemerisElement.REDUCTION_METHOD.IAU_2009,\n EphemerisElement.FRAME.DYNAMICAL_EQUINOX_J2000);\n ephm.algorithm = EphemerisElement.ALGORITHM.MOSHIER;\n\n for (int i = 0; i < n; i++) {\n observers[i] = ObserverElement.parseCity(citym);\n times[i] = timem.clone();\n timem.add(50);\n ephs[i] = ephm;\n }\n\n for (int i = 0; i < times.length; i++) {\n ephem = Ephem.getEphemeris(times[i], observers[i], ephs[i], false);\n locations[i] = ephem.getEquatorialLocation();\n //System.out.println(ephem.distance);\n }\n\n OrbitalElement myOrbit = OrbitEphem.solveOrbit(locations, times, observers, ephs);\n System.out.println(myOrbit.toString());\n System.out.println();\n System.out.println(\"Correct values are:\");\n System.out.println();\n JD = TimeScale.getJD(times[0], observers[0], ephs[0], TimeElement.SCALE.BARYCENTRIC_DYNAMICAL_TIME);\n myOrbit = OrbitEphem.getOrbitalElements(ephm.targetBody, JD, EphemerisElement.ALGORITHM.MOSHIER);\n System.out.println(myOrbit.toString());\n\n JPARSECException.showWarnings();\n } catch (JPARSECException ve) {\n ve.showException();\n }\n }", "public final void zzaka() {\n zza(zzbwn.zzfur);\n }", "@Override\r\n public void mouseMoved(MouseEvent e) {\r\n int mouseX = e.getX();\r\n int mouseY = e.getY();\r\n\r\n if (eyesOpen == true) {\r\n //top left\r\n if (mouseX <= 385) {\r\n System.out.println(\"385\");\r\n }\r\n if (mouseX >= 390) {\r\n System.out.println(\"390\");\r\n }\r\n if (mouseX <= 385 && mouseY <= 245 && mouseY > 207) {\r\n eyeball1X = 380;\r\n eyeball1Y = 240;\r\n eyeball2X = 417;\r\n eyeball2Y = 240;\r\n }\r\n //bottom left\r\n if (mouseX <= 385 && mouseY >= 257) {\r\n eyeball1X = 380;\r\n eyeball1Y = 245;\r\n eyeball2X = 417;\r\n eyeball2Y = 245;\r\n }\r\n //top middle\r\n if (mouseX >= 390 && mouseX <= 410 && mouseY > 207) {\r\n eyeball1X = 385;\r\n eyeball1Y = 240;\r\n eyeball2X = 420;\r\n eyeball2Y = 240;\r\n }\r\n //bottom middle\r\n if (mouseX >= 390 && mouseX <= 410 && mouseY >= 267) {\r\n eyeball1X = 385;\r\n eyeball1Y = 245;\r\n eyeball2X = 420;\r\n eyeball2Y = 245;\r\n }\r\n //top right\r\n if (mouseX > 410 && mouseY <= 245 && mouseY > 207) {\r\n eyeball1X = 390;\r\n eyeball1Y = 240;\r\n eyeball2X = 425;\r\n eyeball2Y = 240;\r\n }\r\n //bottom right\r\n if (mouseX > 410 && mouseY >= 257) {\r\n eyeball1X = 390;\r\n eyeball1Y = 245;\r\n eyeball2X = 425;\r\n eyeball2Y = 245;\r\n }\r\n\r\n }\r\n }", "public void setEHour(int ehour)\r\n\t{\r\n\t\tthis.ehour = ehour;\r\n\t}", "public Persoon(){\n geboorteDag = 0;\n geboorteMaand = 0;\n geboorteJaar = 0;\n nieuweGeslacht = 'x';\n }", "@Test\n public void testPulkovo1995GKZone5N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5N());\n }", "@Override\n\tpublic void office_location() {\n\t\tSystem.out.println(\"Office location is Gurgaon\");\n\t}", "public static void main(String[] args){\n// kazan.megtolt();\n// kazan.kiurit();\n// kazan.megtolt();\n gombEsemeny(false);\n gombEsemeny(false);\n gombEsemeny(true);\n gombEsemeny(false);\n }", "int getLatE6();", "int getLatE6();", "private void setDefaultMode(GlobalState gs) {\n center = gs.cnt;\n double diagonal = gs.vDist * cos(gs.phi);\n double z = sin(gs.phi) * gs.vDist;\n double x = diagonal * cos(gs.theta);\n double y = diagonal * sin(gs.theta);\n \n eye = new Vector(x, y, z);\n \n }", "public BrewedEspresso(Gelato gelato) {\n super(gelato);\n }", "public ExpoEAO getExpoEAO()\n {\n return expoEAO;\n }", "@Test\n public void testPulkovo1995GKZone5() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5());\n }", "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}", "double CalcGaretz(double amount, double size, double sg, double time, double start_vol,\n \t\t\tint yeast_flocc, double AA) {\n \t\tdouble desired_ibu = CalcRager(amount, size, sg, time, AA);\n \t\tint elevation = 500; // elevation in feet - change for user setting\n \t\tdouble concentration_f = size / start_vol;\n \t\tdouble boil_gravity = (concentration_f * (sg - 1)) + 1;\n \t\tdouble gravity_f = ((boil_gravity - 1.050) / 0.2) + 1;\n \t\tdouble temp_f = (elevation / 550 * 0.02) + 1;\n \n \t\t// iterative loop, uses desired_ibu to define hopping_f, then seeds\n \t\t// itself\n \t\tdouble hopping_f, utilization, combined_f;\n \t\tdouble ibu = desired_ibu;\n \t\tint util_index;\n \t\tfor (int i = 0; i < 5; i++) { // iterate loop 5 times\n \t\t\thopping_f = ((concentration_f * desired_ibu) / 260) + 1;\n \t\t\tif (time > 50)\n \t\t\t\tutil_index = 10;\n \t\t\telse\n \t\t\t\tutil_index = (int) (time / 5.0);\n \t\t\tutilization = util[(util_index * 3) + yeast_flocc];\n \t\t\tcombined_f = gravity_f * temp_f * hopping_f;\n \t\t\tibu = (utilization * AA * amount * 0.749) / (size * combined_f);\n \t\t\tdesired_ibu = ibu;\n \t\t}\n \n \t\treturn ibu;\n \t}", "public baconhep.TTau.Builder setEta(float value) {\n validate(fields()[1], value);\n this.eta = value;\n fieldSetFlags()[1] = true;\n return this; \n }", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n int keyCode = e.getKeyCode();\r\n\r\n //right eyebrow moves up\r\n if (keyCode == KeyEvent.VK_UP && eyebrow2Y > 190) {\r\n eyebrow2Y--;\r\n }\r\n //left eyebrow up\r\n if (keyCode == KeyEvent.VK_W && eyebrow1Y > 190) {\r\n eyebrow1Y--;\r\n }\r\n //right eyebrow down\r\n if (keyCode == KeyEvent.VK_DOWN && eyebrow2Y < 220) {\r\n eyebrow2Y = eyebrow2Y++;\r\n }\r\n //left eyebrow down\r\n if (keyCode == KeyEvent.VK_S && eyebrow1Y < 220) {\r\n eyebrow1Y++;\r\n }\r\n\r\n //open eyes\r\n if (keyCode == KeyEvent.VK_O && eyesOpen == false) {\r\n eye1H = eye1H + 13;\r\n eye1Y = eye1Y - 4;\r\n eye2H = eye2H + 13;\r\n eye2Y = eye2Y - 4;\r\n eyeball = green;\r\n eyesOpen = true;\r\n }\r\n\r\n if (keyCode == KeyEvent.VK_C && eyesOpen == true) {\r\n eye1H = eye1H - 13;\r\n eye1Y = eye1Y + 4;\r\n eye2H = eye2H - 13;\r\n eye2Y = eye2Y + 4;\r\n eyeball = white;\r\n eyesOpen = false;\r\n }\r\n }", "public void setG(double aG);", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "public Axe() {\n\t\t\tthis.name = \"Axe\";\n\t\t\tthis.damage = 20;\n\t\t}", "public int getEnergie() {\r\n\t\treturn energie;\r\n\t}", "public add_karyawan() {\n initComponents();\n showTable();\n randomNumber();\n setLocation(500, 200);\n }", "public void xuat() {\n\n\t}", "public void onderbreek(){\n \n }", "public abstract void drawEarthquake(PGraphics pg, float x, float y);", "public abstract void drawEarthquake(PGraphics pg, float x, float y);", "@Override\n\tpublic void getThongTin() {\n\t\tSystem.out.print(\"Ghế \");\n\t\tvatlieu.getMoTa();\n\t}", "public EpsilonGreedyExploration(double epsilon) {\n this.epsilon = epsilon;\n }", "public static void main(String[] args) {\n\t\tint [] eingabe = {1, 1, 1, 1};\r\n\t\tint laenge = 4;\r\n\t\tint zustandAktuell = 0;\r\n\t\tint [][] Zustandstabelle = new int [4][2];\r\n\t\tZustandstabelle [0][0] = -1;\r\n\t\tZustandstabelle [0][1] = 1;\r\n\t\tZustandstabelle [1][0] = 2;\r\n\t\tZustandstabelle [1][1] = 3;\r\n\t\tZustandstabelle [2][0] = 2;\r\n\t\tZustandstabelle [2][1] = -1;\r\n\t\tZustandstabelle [3][0] = 2;\r\n\t\tZustandstabelle [3][1] = 3;\r\n\t\t\r\n\t\tfor (int i = 0; i < laenge; i++)\r\n\t\t{\r\n\t\t\tzustandAktuell = Zustandstabelle[zustandAktuell][eingabe[i]];\r\n\t\t\tif (zustandAktuell == -1) {\r\n\t\t\t\tSystem.out.print(\"Ungültige Eingabe. Beenden\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif (zustandAktuell != 5)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"q\" + (zustandAktuell + 1) + \" ist der Zustand nach Bearbeitung der Eingabe: [\");\r\n\t\t\tfor (int i = 0; i < laenge ; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(eingabe [i]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.print(\"]\");\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "private void setSteine() {\n\t\tfor(int i = 0; i<mulden.length; i++) {\n\t\t\tmulden[i] = 5;\n\t\t}\n\t}", "public void setXkjg(String xkjg) {\n\t\tthis.xkjg = xkjg;\n\t}", "public static void main(String[] args) {\r\n Examen examen = new Examen();\r\n\r\n /* creamos dos objetos Fecha y Hora respectivamente */\r\n Fecha fecha = new Fecha(14, 9, 2021);\r\n Hora hora = new Hora(8, 30);\r\n\r\n /* establecemos con los métodos set() los valores de asignatura y el Grupo */\r\n examen.setAsignatura(\"Programación de Computadores II: Relacion de Composicion en Java\");\r\n examen.setAula(\"02\");\r\n\r\n /* Actualizamos la información del objeto Examen */\r\n examen = new Examen((examen.getAsignatura()), (examen.getAula()),\r\n fecha, hora);\r\n\r\n /* devuelve la información del objeto Examen creado */\r\n System.out.println(examen.toString());\r\n }", "public void generateAntHill(int x, int y, String colour) {\n for (int i = 0; i < 11; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[x*130+y+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[x*130+y+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next change the two rows above and below the centre\n for (int i = 0; i < 10; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+1)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-1)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+1)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-1)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next rows inset by one on the right\n for (int i = 0; i < 9; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+2)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-2)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+2)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-2)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the left none on the right\n for (int i = 0; i < 8; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+3)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-3)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+3)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-3)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the right and none on the left\n for (int i = 0; i < 7; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+4)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-4)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+4)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-4)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the left and none on the right\n for (int i = 0; i < 6; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+5)*130+y+3+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-5)*130+y+3+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+5)*130+y+3+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-5)*130+y+3+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n }", "public void jugar(){\r\n System.out.println(\"\\n\\n\\n\");\r\n // reiniciar llena el array de gato des espacios en blanco para que el tablero este en blanco\r\n reiniciar(); \r\n //pedir nombres de los jugadores\r\n System.out.println(\"Para tirar solo escribe las coordenadas (x,y) de la casilla que quieres\"); \r\n System.out.println(\"(o) Nombre de Jugador 1: \");\r\n nom1=entrada.nextLine();\r\n System.out.println(\"(x) Nombre de Jugador 2: \");\r\n nom2=entrada.nextLine();\r\n System.out.println(\"\\n\\n\\n\");\r\n //imprime el tablero\r\n tablero(); \r\n //deja que los jugadores tiren\r\n tirar(); \r\n //confirma victorias o empates \r\n if(ganador=='o'){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"GANA \"+ nom1);\r\n System.out.println(\"\\n\\n\");\r\n }\r\n if(ganador=='x'){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"GANA \"+ nom2);\r\n System.out.println(\"\\n\\n\");\r\n }\r\n if(contador==9){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"EMPATE, sean panas \"+nom1+\" y \"+nom2+\" :)\");\r\n System.out.println(\"\\n\\n\");\r\n }\r\n\r\n }", "public void mousePressed(MouseEvent e) {\n xinitial = e.getX() / 5; //get the x value\r\n yinitial = e.getY() / 5; //get the y value\r\n }", "public void hauptProgramm(int gewuenschteTiefe){\n\t\tgespeicherterZug = -1;\n\t\tthis.gewuenschteTiefe = gewuenschteTiefe;\n\t\t\n\t\tmax(eigenerStein, gewuenschteTiefe);\n\t\t\n\t\tif (gespeicherterZug == -1) {\n\t\t\t//Es gab keine weiteren Zuege mehr\n\t\t\tSystem.out.println(\"Das Spiel ist beendet.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Der Stein wird in Spalte \" + gespeicherterZug + \" geworfen.\");\n\t\t}\n\t}", "public void nascitaAgnello() {\n\t\tpecore.add(new Agnello());\n\t\tnumeroAgelli++;\n\t}", "public static void main(String[] args) {\n int yaricap=4;\n double alan= 4*4*Constans.pi;\n\n\n // kullanicidan alacaginiz saat , dakika ve gun bilgisinin saniyeyey ceviriniz\n\n int gun =23;\n int saat=7;\n int dakika=25;\n\n int saniyeCinsinden =\n gun * Constants.hourInDay *Constants.minuteInHour* Constants.secondInMinute+\n saat* Constants.minuteInHour* Constants.secondInMinute+\n dakika * Constants.secondInMinute;\n System.out.println(\"saniyeCinsinden = \" + saniyeCinsinden);\n\n\n }", "public final String[] getAsteikko() {\r\n return asteikko;\r\n }", "public void actionPerformed(ActionEvent e)\n {\n if(y >= 550) //if the beaker is not filled\n {\n lab3.setBounds(510,y,230,60); \n lab3.setVisible(true); //displays orange bar image\n value += 27; //point value of orange\n y -= 60; //sets up to fill first half of beaker\n }\n else\n {\n //if beaker is full resets value and y coordinate\n value = 0; \n y = 610; \n }\n }", "public void setEBrake(boolean ebrake) {\n\t\tthis.engineFailureStatus();\n\t\tthis.brakeFailureStatus();\n\t\tthis.signalFailureStatus();\n if(!this.brakeFailureActive && !this.signalFailureActive && !this.engineFailureActive) {\n this.emerBrake = ebrake;\n } else if(this.brakeFailureActive || this.signalFailureActive || this.engineFailureActive){\n\t\t\tthis.emerBrake = true;\n\t\t}\n }", "@Override\n public void askOxygen(){\n _brain.lungs.breath();\n _brain.heart.accelerate(1);\n }" ]
[ "0.57874817", "0.57347363", "0.5733629", "0.56671256", "0.5594216", "0.55124027", "0.54933125", "0.54837227", "0.54672605", "0.54597056", "0.54486763", "0.54016274", "0.53524905", "0.5318439", "0.5304591", "0.52957064", "0.52933866", "0.52307796", "0.5208691", "0.520728", "0.5189418", "0.5182381", "0.5154358", "0.5141803", "0.5137457", "0.5132403", "0.51267475", "0.5088603", "0.5071221", "0.50622755", "0.50379455", "0.50265265", "0.50197417", "0.50108576", "0.5007246", "0.4989825", "0.4978235", "0.49765944", "0.49700755", "0.49591643", "0.49571085", "0.495127", "0.49452794", "0.49431646", "0.49410814", "0.49407548", "0.4936229", "0.4924164", "0.49215955", "0.49182022", "0.49146196", "0.4914335", "0.4911762", "0.49012074", "0.49000138", "0.48907077", "0.48859692", "0.48816347", "0.48629713", "0.48599502", "0.48564816", "0.48384643", "0.48368463", "0.48361903", "0.48352462", "0.48350555", "0.48350555", "0.48287937", "0.4827734", "0.4820272", "0.48182085", "0.48102576", "0.48003754", "0.47995216", "0.47848812", "0.4784316", "0.47789106", "0.47756884", "0.47756785", "0.47730112", "0.47727954", "0.4770591", "0.47701246", "0.47701246", "0.47647104", "0.47609746", "0.47609422", "0.47446054", "0.4741513", "0.47362623", "0.47349066", "0.47336718", "0.4733566", "0.4733437", "0.47322047", "0.47283012", "0.47262567", "0.47193927", "0.4718399", "0.47163084" ]
0.6285393
0
Palauttaa "Easter Eggin" ykoordinaatin.
public int getEgY() { return egY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}", "@Override\n public String location() {\n return \"Vị trí sách giáo khoa\";\n }", "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 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 static void alturaArbol() {\n int angulo = 35;\n\n double anguloConvert = Math.toRadians(angulo);\n int x = 20;\n int y;\n y = (int) Math.round(x * Math.tan(anguloConvert));\n System.out.println(\"Altura del arbol: \" + y);\n }", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "@Override\n\tpublic void office_location() {\n\t\tSystem.out.println(\"Office location is Gurgaon\");\n\t}", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\tg[1] = m[1][0] + m[1][1] + m[1][2];\n\t\tg[2] = m[2][0] + m[2][1] + m[2][2];\n\t\t\n\t\tg[3] = m[0][0] + m[1][0] + m[2][0];\n\t\tg[4] = m[0][1] + m[1][1] + m[2][1];\n\t\tg[5] = m[0][2] + m[1][2] + m[2][2];\n\t\t\n\t\tg[6] = m[0][0] + m[1][1] + m[2][2];\n\t\tg[7] = m[2][0] + m[1][1] + m[0][2];\n\t\tg[8] = \"0\";\n\t\tg[9] = \"0\";\n\t\t\n\t\tfor(int i= 0; i<10; i++) {\n\t\t\tif(g[i].equals(\"XXX\")){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"X GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\temp = 0; \n\t\t\t\tbreak;\n\t\t\t} else if (g[i].equals(\"OOO\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\"O GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\t\n\t\tif (emp == 9) {\n\t\t\tJOptionPane.showMessageDialog(null,\"EMPATOU\");\t\n\t\t\tacabou = true;\n\t\t}\n\t}", "public void setEgY(int y) {\n\t\tthis.egY = y;\n\t}", "public void bewegeKamel(Charakter charakter);", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "@Override\n\tpublic void getThongTin() {\n\t\tSystem.out.print(\"Ghế \");\n\t\tvatlieu.getMoTa();\n\t}", "public String getGeslacht(){\n if(geslacht == \"man\" || geslacht == \"vrouw\"){\n return geslacht;\n }\n else {\n return \"onbekent\";\n }\n }", "public void ustawPojazdNaPoczatek()\n\t{\n\t\tSciezka pierwszaSc = droga.get(0);\n\t\tfinal double y = 10;\n\t\tpojazd.zmienPozycje(pierwszaSc.getCenterDownX(), y);\n\t}", "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "int getLngE6();", "int getLngE6();", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\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 kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "public void ektypwsiFarmakou() {\n\t\t// Elegxw an yparxoun farmaka\n\t\tif(numOfMedicine != 0)\n\t\t{\n\t\t\tfor(int i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"INFO FOR MEDICINE No.\" + (i+1) + \":\");\n\t\t\t\tmedicine[i].print();\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"DEN YPARXOUN DIATHESIMA FARMAKA PROS EMFANISH!\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override\r\n\tpublic Town getDroghedaLocation() {\n\t\treturn new Town(\"36 Saint Laurence Street\");\r\n\t}", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void getK_Gelisir(){\n K_Gelistir();\r\n }", "@Override\r\n\tpublic int getGela_kop() {\n\t\treturn super.getGela_kop();\r\n\t}", "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 gears(){\n\t\t System.out.println(\"bike has 4 gears ....\");\r\n\t\t//system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\r\n\r\n\t}", "int getLatE6();", "int getLatE6();", "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 void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "public String displayEaster(){\n\n if (month == 3){\n Month = \"März\";\n }\n if (month == 4){\n Month = \"April\";\n }\n\n System.out.printf(\"\\nEaster:%s %d, %d \",Month,day,year);\n return String.format(\"Easter: %d. %s %d\",day, Month, year);\n }", "public BrewedEspresso(Gelato gelato) {\n super(gelato);\n }", "@Override\r\n\tpublic String Land() {\n\t\treturn \"El Helicoptero esta Aterrizando\";\r\n\t}", "public static String engToPig(String w) { \n String rtrstr =\"\"; //final string to return\n \n if (beginsWithVowel(w)) { //checks if beginsWithVowel(check above)\n rtrstr = w + \"way\"; //adds \"way\"\n }\n else if (hasAVowel(w)) { //if it has a vowel at all\n rtrstr = w.substring(w.indexOf(firstVowel(w))) + w.substring(0, w.indexOf(firstVowel(w))) + \"ay\" ; //adds substring from first vowel onwards + substring of beginning to first vowel + \"ay\"\n }\n else {\n VOWELS += \"yY\"; \n rtrstr = engToPig(w); //does engtopig again but this time counting \"y\" as a vowel\n VOWELS = VOWELS.substring(0,9); //removes y from VOWELS\n }\n return punct(cap(rtrstr)); //adjusts proper capitalization, and then punctuation\n }", "@Override\n public String toString() {\n return \"@(\"+x+\"|\"+y+\") mit Bewegung: \"+bewegung;\n }", "public void onderbreek(){\n \n }", "public void EasterMath(int year)\n {\n a = year%19;\n b = Math.floor(year/100);\n c = year%100;\n d = Math.floor((b/4));\n e = b%4;\n f = Math.floor((b+8)/25);\n g = Math.floor((b-f+1)/3);\n h = (19*a+b-d-g+15)%30;\n i = Math.floor(c/4);\n k = c%4;\n l = (32 + 2* e + 2 * i - h - k)%7;\n m = Math.floor((a+11*h+22*l)/451);\n month = (int) Math.floor((h+l-7*m+114)/31);\n day = (int) (((h+l-7*m+114)%31)+1);\n }", "public String getWinner(){\n\t\tswitch (hatGewonnen) {\n\t\tcase \"Spieler O\":\n\t\t\treturn \"o\";\n\t\tcase \"Spieler X\":\n\t\t\treturn \"x\";\n\t\tdefault:\n\t\t\treturn \"\";\n\t\t}\n\t}", "public void azzera() { setEnergia(0.0); }", "public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }", "public JoepyeWeed(){\n\t\tsuper(\"joepyeweed\",\"Joe-pye Weed\", \"Eastern US\", false, \"Butterfly\", null, NONE,\n\t\t\tHIGH, MED, true, true, false, false, true);\n\n\t}", "public void setErjiguanlianzd(String erjiguanlianzd) {\n this.erjiguanlianzd = erjiguanlianzd;\n }", "public void girarHaciaEnemigo()\n {\n if(getWorld()==null){return;}\n MyWorld world = (MyWorld) getWorld();\n Gato enemigo = world.getGato();\n if(enemigo.getWorld()==null){return;}\n turnTowards(enemigo.getX(),enemigo.getY());\n }", "@Test\n public void testPulkovo1995GKZone27() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27());\n }", "@Test\n public void testPulkovo1995GKZone25() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25());\n }", "String getVorlesungKennung();", "@Test\n public void testPulkovo1995GKZone27N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27N());\n }", "public Karakter_Yarat(String Meslek,int Seviye,int Guc,int YeniSeviye,int YeniGuc) {\r\n super(Meslek,Seviye,Guc,YeniSeviye, YeniGuc);\r\n }", "public void tekst_ekranu(Graphics dbg)\n {\n dbg.setColor(Color.BLACK);\n int y=(int)Math.round(getHeight()*0.04);\n dbg.setFont(new Font(\"TimesRoman\",Font.PLAIN,y));\n dbg.drawString(\"zycie \"+liczba_zyc,(int)Math.round(getWidth()*0.01),y);\n dbg.drawString(\"punkty \"+liczba_punktow,(int)Math.round(getWidth()*0.2),y);\n dbg.drawString(\"czas \"+(int)Math.round(czas_gry),(int)Math.round(getWidth()*0.4),y);\n dbg.drawString(\"naboje \"+liczba_naboi,(int)Math.round(getWidth()*0.6),y);\n dbg.drawString(\"poziom \"+poziom,(int)Math.round(getWidth()*0.8),y);\n }", "public String getName()\r\n {\n return \"arctan\";\r\n }", "public void hitunganRule2(){\n penebaranBibitSedikit = 1200;\r\n hariPanenLama = 110;\r\n \r\n //menentukan niu Penebaran Bibit\r\n nBibit = (1500 - penebaranBibitSedikit) / (1500 - 500);\r\n \r\n //menentukan niu hari panen Lama\r\n if ((hariPanenLama >=100) && (hariPanenLama <=180)) {\r\n nPanen = (hariPanenLama - 100) / (180 - 100);\r\n }\r\n \r\n //tentukan alpha predikat (karena grafik segitiga)\r\n if (nBibit < nPanen) {\r\n a2 = nBibit;\r\n }else if (nBibit > nPanen) {\r\n a2 = nPanen;\r\n }\r\n \r\n //tentukan Z2\r\n z2 = (penebaranBibitSedikit + hariPanenLama) * 700;\r\n System.out.println(\"a2 = \" + String.valueOf(a2));\r\n System.out.println(\"z2 = \" + String.valueOf(z2));\r\n }", "@Test\n public void testPulkovo1995GKZone5N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5N());\n }", "@Test\n public void testPulkovo1995GKZone5() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5());\n }", "public int stapelPosition(Farbe farbe);", "@Test\n public void testPulkovo1995GKZone25N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25N());\n }", "public String getErjiguanlianzd() {\n return erjiguanlianzd;\n }", "public void setzeGegnerStein(int gegnerZug){\t\n\t\t//Falls eigener Agent startet wird -1 uebergeben\n\t\tif(gegnerZug >= 0){\t\t\t\t\n\t\t\tfor(int i=0; i<6; i++) {\n\t\t\t\tif(spielfeld[gegnerZug][i].equals(\"_\")){\n\t\t\t\t\tspielfeld[gegnerZug][i] = gegnerStein;\n\t\t\t\t\tgegnerPunkt.setLocation(gegnerZug, i);\n\t\t\t\t\tbreak;\n\t\t\t\t} //end if\n\t\t\t} //end for\t\t\t\t\n\t\t} \t\t\n\t}", "public void hitunganRule1(){\n penebaranBibitSedikit = 1200;\r\n hariPanenSedang = 50;\r\n \r\n //menentukan niu\r\n nBibit = (1500 - penebaranBibitSedikit) / (1500 - 500);\r\n \r\n //menentukan niu hari panen sedang\r\n if ((hariPanenSedang >=40) && (hariPanenSedang <=80)) {\r\n nPanen = (hariPanenSedang - 40) / (80 - 40);\r\n }\r\n \r\n //tentukan alpha predikat (karena grafik segitiga)\r\n if (nBibit < nPanen) {\r\n a1 = nBibit;\r\n }else if (nBibit > nPanen) {\r\n a1 = nPanen;\r\n }\r\n \r\n //tentukan Z1\r\n z1 = (penebaranBibitSedikit + hariPanenSedang) * 700;\r\n System.out.println(\"a1 = \" + String.valueOf(a1));\r\n System.out.println(\"z1 = \" + String.valueOf(z1));\r\n }", "protected void narisi(Graphics2D g, double wp, double hp) {\n\n FontMetrics fm = g.getFontMetrics();\n\n int hPisava = fm.getAscent();\n\n double xColumn = 0.0;\n double yColumn = sirinaStolpca(wp, hp);\n\n for(int i = 0; i < podatki.length; i++){\n\n g.setColor(Color.ORANGE);\n g.fillRect((int)xColumn,(int)(hp - visinaStolpca(i, wp, hp)), (int) sirinaStolpca(wp, hp), (int) visinaStolpca(i, wp, hp));\n\n g.setColor(Color.RED);\n g.drawRect((int)((i)*sirinaStolpca(wp, hp)),(int) (hp-visinaStolpca(i, wp, hp)), (int)sirinaStolpca(wp, hp), (int)visinaStolpca(i, wp, hp));\n\n g.setColor(Color.BLUE);\n if(i < podatki.length - 1){\n double startCrtaX = sredinaVrha(i, wp, hp)[0];\n double startCrtaY = sredinaVrha(i, wp, hp)[1];\n\n double endCrtaX = sredinaVrha(i + 1, wp, hp)[0];\n double endCrtaY = sredinaVrha(i+1, wp, hp)[1];\n\n g.drawLine((int)startCrtaX,(int) startCrtaY,(int) endCrtaX,(int) endCrtaY);\n\n }\n\n g.setColor(Color.BLACK);\n\n String toWrite = Integer.toString(i+1);\n double wNapis=fm.stringWidth(toWrite);\n double xNapis=xColumn+(xColumn-wNapis)/2;\n double yNapisLowerLine=hp-hPisava;\n xColumn+=sirinaStolpca(wp, hp);\n g.drawString(toWrite,ri (xNapis),ri(yNapisLowerLine));\n\n }\n\n }", "@Override\n\tpublic String getBye() {\n\t\treturn \"Say Good bye VietNam!\";\n\t}", "@Test\n public void testPulkovo1995GKZone29() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone29());\n }", "@Override\r\n\tpublic Town getTraleeLocation() {\n\t\treturn new Town(\" Ashe Memorial Hall \");\r\n\t}", "@Test\n public void testPulkovo19953DegreeGKZone27() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone27());\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 }", "@Override public String getCarne(){\n return \"salchicha y jamón \";\n }", "public String annulerRv(){\n\t\t// Traitement ici ... \n\t\treturn AFFICHER;\n\t}", "public static String engToPig( String w ) {\r\n\tString result = \"\";\r\n\tif (w.substring(0,1).equals(\"y\")) {// if w begins with 'y'\r\n\t result = w.substring(1) + \"yay\";\r\n\t} \r\n\telse if (beginsWithVowel(w)) { //if w begins with a vowel\r\n\t result = w + \"way\"; //append way to w\r\n\t}\r\n else { //if w begins with consonant(s)\r\n\t result = w.substring(w.indexOf(firstVowel(w))) + w.substring(0,w.indexOf(firstVowel(w))) + \"ay\"; //take the first occurrence of a vowel, then the consonant(s) before that vowel, and add ay\r\n\t}\r\n if (beginsWithCapital(w)) {\r\n\t result = result.substring(0,1).toUpperCase() + result.substring(1).toLowerCase();\r\n\t}\r\n\tif (hasA(w,\".\")) {\r\n\t result = result.substring(0,result.indexOf(\".\")) + result.substring(result.indexOf(\".\") + 1) + \".\";\r\n\t }\r\n\tif (hasA(w,\",\")) {\r\n\t result = result.substring(0,result.indexOf(\",\")) + result.substring(result.indexOf(\",\") + 1) + \",\";\r\n\t }if (hasA(w,\"?\")) {\r\n\t result = result.substring(0,result.indexOf(\"?\")) + result.substring(result.indexOf(\"?\") + 1) + \"?\";\r\n\t }if (hasA(w,\"!\")) {\r\n\t result = result.substring(0,result.indexOf(\"!\")) + result.substring(result.indexOf(\"!\") + 1) + \"!\";\r\n\t }\r\n\treturn result;\r\n }", "@Override\r\n\tdouble alan() {\n\t\tSystem.out.println(\"Ucgenin Alani : \");\r\n\t\treturn kenar1 * kenar2 /2;\r\n\t}", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "public Town getDroghedaDescription1() {\n\t\treturn new Town(\"The River Boyne (Irish: An Bhóinn or Abhainn na Bóinne) is a river in Leinster, Ireland, the course of which is about 112 kilometres\");\r\n\t}", "public void ektypwsiAstheni() {\n\t\t// Elegxw an yparxoun astheneis\n\t\tif(numOfPatient != 0)\n\t\t{\n\t\t\tfor(int i = 0; i < numOfPatient; i++)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"INFO FOR PATIENT No.\" + (i+1) + \":\");\n\t\t\t\tpatient[i].print();\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"DEN YPARXOUN DIATHESIMOI ASTHENEIS PROS EMFANISH!\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Test\n public void testPulkovo19953DegreeGKZone25() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone25());\n }", "@Test\n public void testPulkovo1995GKZone7() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone7());\n }", "private void sonucYazdir() {\n\t\talinanPuan = (int)(((float)alinanPuan / (float)toplamPuan) * 100);\n\t\tSystem.out.println(\"\\nSınav Bitti..!\\n\" + soruSayisi + \" sorudan \" + dogruSayaci + \" tanesine\"\n\t\t\t\t\t\t+ \" doğru cevap verdiniz.\\nPuan: \" + alinanPuan + \"/\" + toplamPuan);\n\t}", "@Test\n public void testPulkovo1995GKZone29N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone29N());\n }", "public Persoon(){\n geboorteDag = 0;\n geboorteMaand = 0;\n geboorteJaar = 0;\n nieuweGeslacht = 'x';\n }", "@Test\n public void testPulkovo1995GKZone7N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone7N());\n }", "public String draaiGangkaart()\n {\n if (vrijeGangkaart.getOrientatie() == 4)\n {\n vrijeGangkaart.setOrientatie(1);\n } else\n {\n vrijeGangkaart.setOrientatie((vrijeGangkaart.getOrientatie() + 1));\n }\n\n return vrijeGangkaart.toString();\n }", "public double getEnergia() { return energia; }", "@Test\n public void testPulkovo1995GKZone26() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone26());\n }", "@Test\n public void testPulkovo19953DegreeGKCM27E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM27E());\n }", "@Override\n\tpublic String hablar() {\n\t\treturn \"Hola, soy un Buitre y sť volar\";\n\t}", "@Test\n public void testPulkovo1995GKZone28() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone28());\n }", "@Test\n public void testPulkovo1995GKZone13() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone13());\n }", "public void leerAlimentos();", "@Test\n public void testPulkovo19953DegreeGKCM72E() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKCM72E());\n }", "@Test\n public void testPulkovo19953DegreeGKZone29() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone29());\n }", "@Test\n public void testPulkovo1995GKZone20N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone20N());\n }", "public String getWaehrung() {\n return Waehrung;\n }", "@Test\n public void testPulkovo1995GKZone20() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone20());\n }", "@Test\n public void testPulkovo19953DegreeGKZone56() {\n testToWGS84AndBack(PROJ.getPulkovo19953DegreeGKZone56());\n }", "@Test\n public void testPulkovo1995GKZone6() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone6());\n }", "@Test\n public void testPulkovo1995GKZone22() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone22());\n }", "@Test\n public void testPulkovo1995GKZone28N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone28N());\n }", "@Test\n public void testPulkovo1995GKZone14() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone14());\n }", "@Test\n public void testPulkovo1995GKZone26N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone26N());\n }", "@Override\n\tpublic String getGiangVien() {\n\t\treturn giangVien.getTenGiangVien();\n\t}", "public void tetraederzeichnen(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){\n double[][] arr_koordinaten_2d ={{ax,ay},{bx,by},{cx,cy},{dx,dy}};\n /**\n * Aufruf der Methode gestricheltodernicht\n *\n * Überprüft, welche Strecken von Punkt D sichtbar sind oder nicht.\n */\n\n boolean[] strichelnodernicht = cls_berechnen.gestricheltodernicht(arr_koordinaten_2d);\n\n /**Skaliert die Koordinaten zum Pixelformat mit Koordinatenursprung\n * ca in der Mitte der Zeichenfläche*/\n int sw=9; //skalierungswert\n ax= (sw+ax)*50;\n ay=(sw-ay)*50;\n bx= (sw+bx)*50;\n by=(sw-by)*50;\n cx= (sw+cx)*50;\n cy=(sw-cy)*50;\n dx= (sw+dx)*50;\n dy=(sw-dy)*50;\n\n /**\n * Erstellt Linienobjekte für die Kanten des Tetraeder Objekts...\n */\n Line line1 = new Line();\n Line line2 = new Line();\n Line line3 = new Line();\n Line line4 = new Line();\n Line line5 = new Line();\n Line line6 = new Line();\n\n /**\n * ... weißt ihnen die Koordinaten zu...\n */\n line1.setStartX(ax);\n line1.setStartY(ay);\n line1.setEndX(bx);\n line1.setEndY(by);\n\n line2.setStartX(ax);\n line2.setStartY(ay);\n line2.setEndX(cx);\n line2.setEndY(cy);\n\n line3.setStartX(bx);\n line3.setStartY(by);\n line3.setEndX(cx);\n line3.setEndY(cy);\n \n line4.setStartX(dx);\n line4.setStartY(dy);\n line4.setEndX(ax);\n line4.setEndY(ay);\n\n line5.setStartX(dx);\n line5.setStartY(dy);\n line5.setEndX(bx);\n line5.setEndY(by);\n\n line6.setStartX(dx);\n line6.setStartY(dy);\n line6.setEndX(cx);\n line6.setEndY(cy);\n \n if(!strichelnodernicht[0]){\n line4.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[1]){\n line5.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[2]){\n line6.getStrokeDashArray().addAll(5d,5d);}\n\n /**\n * ... und fügt die Linien Objekte der Zeichenfläche hinzu\n */\n canvaspane.getChildren().add(line1);\n canvaspane.getChildren().add(line2);\n canvaspane.getChildren().add(line3);\n canvaspane.getChildren().add(line4);\n canvaspane.getChildren().add(line5);\n canvaspane.getChildren().add(line6);\n\n //zeichnet den Koordinatenursprung neu\n canvaspane.getChildren().add(l1);\n canvaspane.getChildren().add(l2);\n }" ]
[ "0.5958196", "0.5956249", "0.59508145", "0.59376323", "0.5907636", "0.58890074", "0.5879772", "0.5854108", "0.58418447", "0.5833982", "0.58172566", "0.58072084", "0.57663053", "0.57411337", "0.5732581", "0.57320476", "0.573148", "0.573148", "0.57275796", "0.572318", "0.5695551", "0.56905663", "0.5668606", "0.56649804", "0.56623906", "0.56533074", "0.56370956", "0.56103927", "0.55929184", "0.55929184", "0.5588924", "0.55840427", "0.55764586", "0.5571273", "0.5567558", "0.55628896", "0.55547845", "0.5546831", "0.5539087", "0.55332917", "0.5530832", "0.55236655", "0.5523261", "0.5519613", "0.5516055", "0.55125237", "0.5510838", "0.5499381", "0.54901767", "0.5484542", "0.54833823", "0.5479555", "0.54772955", "0.5473388", "0.54685456", "0.54685205", "0.5464351", "0.5463931", "0.5463846", "0.54615843", "0.5460238", "0.5459935", "0.5459471", "0.5459167", "0.5456693", "0.5452327", "0.5448008", "0.5446894", "0.5446562", "0.54441804", "0.5441683", "0.5423941", "0.54231733", "0.54215926", "0.54215366", "0.54192966", "0.5410375", "0.54053545", "0.5405182", "0.54045284", "0.54008955", "0.5397553", "0.53942496", "0.5393534", "0.53924716", "0.53887224", "0.5387854", "0.53877205", "0.5386087", "0.5384984", "0.53847945", "0.5383533", "0.5380884", "0.53771806", "0.537588", "0.5373138", "0.53700155", "0.5368719", "0.53681856", "0.53673995" ]
0.5936481
4
Asettaa "Easter Eggin" ykoordinaatin.
public void setEgY(int y) { this.egY = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}", "public int getEgY() {\n\t\treturn egY;\n\t}", "public static void alturaArbol() {\n int angulo = 35;\n\n double anguloConvert = Math.toRadians(angulo);\n int x = 20;\n int y;\n y = (int) Math.round(x * Math.tan(anguloConvert));\n System.out.println(\"Altura del arbol: \" + y);\n }", "public void azzera() { setEnergia(0.0); }", "private void setEnergia(double nuovaEnergia)\r\n\t{\r\n\t\tif (nuovaEnergia > MAX) energia = MAX;\r\n\t\telse if (nuovaEnergia < 0.0) energia = 0.0;\r\n\t\telse energia = nuovaEnergia;\r\n\r\n\t\tstorico = allarga(storico);\r\n\r\n\t\tstorico[storico.length-1] = energia;\r\n\t\t\r\n\t}", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\n }", "public void EasterMath(int year)\n {\n a = year%19;\n b = Math.floor(year/100);\n c = year%100;\n d = Math.floor((b/4));\n e = b%4;\n f = Math.floor((b+8)/25);\n g = Math.floor((b-f+1)/3);\n h = (19*a+b-d-g+15)%30;\n i = Math.floor(c/4);\n k = c%4;\n l = (32 + 2* e + 2 * i - h - k)%7;\n m = Math.floor((a+11*h+22*l)/451);\n month = (int) Math.floor((h+l-7*m+114)/31);\n day = (int) (((h+l-7*m+114)%31)+1);\n }", "public void setzeGegnerStein(int gegnerZug){\t\n\t\t//Falls eigener Agent startet wird -1 uebergeben\n\t\tif(gegnerZug >= 0){\t\t\t\t\n\t\t\tfor(int i=0; i<6; i++) {\n\t\t\t\tif(spielfeld[gegnerZug][i].equals(\"_\")){\n\t\t\t\t\tspielfeld[gegnerZug][i] = gegnerStein;\n\t\t\t\t\tgegnerPunkt.setLocation(gegnerZug, i);\n\t\t\t\t\tbreak;\n\t\t\t\t} //end if\n\t\t\t} //end for\t\t\t\t\n\t\t} \t\t\n\t}", "protected void moveEast(){\n\t\tcar.setXLocation(currentX + 1);\n\t\tcurrentX += 1;\n\t}", "public double getEnergia() { return energia; }", "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 Easter(int year)\n {\n this.year = year;\n endYear = year + 5700000;\n a = year%19;\n b = Math.floor(year/100);\n c = year%100;\n d = Math.floor((b/4));\n e = b%4;\n f = Math.floor((b+8)/25);\n g = Math.floor((b-f+1)/3);\n h = (19*a+b-d-g+15)%30;\n i = Math.floor(c/4);\n k = c%4;\n l = (32 + 2* e + 2 * i - h - k)%7;\n m = Math.floor((a+11*h+22*l)/451);\n month = (int) Math.floor((h+l-7*m+114)/31);\n day = (int) (((h+l-7*m+114)%31)+1);\n }", "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}", "public Location east()\r\n {\r\n // return new Location(x + 1, y);\r\n Location loc = new Location(x + 1, y);\r\n return loc;\r\n }", "public Karakter_Yarat(String Meslek,int Seviye,int Guc,int YeniSeviye,int YeniGuc) {\r\n super(Meslek,Seviye,Guc,YeniSeviye, YeniGuc);\r\n }", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "public void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "@Override\r\n\tdouble alan() {\n\t\tSystem.out.println(\"Ucgenin Alani : \");\r\n\t\treturn kenar1 * kenar2 /2;\r\n\t}", "public double getEast() {\n return east;\n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public double get_Easting() {\n return this.Easting;\n }", "public void setzeEigenenStein(int spielzug){\t\t\n\t\t//Setze eigenen Stein\n\t\tfor(int i=0; i<6; i++) {\n\t\t\tif(spielfeld[spielzug][i].equals(\"_\")){\n\t\t\t\tspielfeld[spielzug][i] = eigenerStein;\n\t\t\t\teigenerPunkt.setLocation(spielzug, i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t}", "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 displayEaster(){\n\n if (month == 3){\n Month = \"März\";\n }\n if (month == 4){\n Month = \"April\";\n }\n\n System.out.printf(\"\\nEaster:%s %d, %d \",Month,day,year);\n return String.format(\"Easter: %d. %s %d\",day, Month, year);\n }", "@Override\n\tpublic void setEast(float east) {\n\t\t\n\t}", "public void aGp() {\n am.bS(this.dvY);\n }", "@Override\n\tpublic void getThongTin() {\n\t\tSystem.out.print(\"Ghế \");\n\t\tvatlieu.getMoTa();\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n int keyCode = e.getKeyCode();\r\n\r\n //right eyebrow moves up\r\n if (keyCode == KeyEvent.VK_UP && eyebrow2Y > 190) {\r\n eyebrow2Y--;\r\n }\r\n //left eyebrow up\r\n if (keyCode == KeyEvent.VK_W && eyebrow1Y > 190) {\r\n eyebrow1Y--;\r\n }\r\n //right eyebrow down\r\n if (keyCode == KeyEvent.VK_DOWN && eyebrow2Y < 220) {\r\n eyebrow2Y = eyebrow2Y++;\r\n }\r\n //left eyebrow down\r\n if (keyCode == KeyEvent.VK_S && eyebrow1Y < 220) {\r\n eyebrow1Y++;\r\n }\r\n\r\n //open eyes\r\n if (keyCode == KeyEvent.VK_O && eyesOpen == false) {\r\n eye1H = eye1H + 13;\r\n eye1Y = eye1Y - 4;\r\n eye2H = eye2H + 13;\r\n eye2Y = eye2Y - 4;\r\n eyeball = green;\r\n eyesOpen = true;\r\n }\r\n\r\n if (keyCode == KeyEvent.VK_C && eyesOpen == true) {\r\n eye1H = eye1H - 13;\r\n eye1Y = eye1Y + 4;\r\n eye2H = eye2H - 13;\r\n eye2Y = eye2Y + 4;\r\n eyeball = white;\r\n eyesOpen = false;\r\n }\r\n }", "public void setEnergie(int energie) {\r\n\t\tthis.energie = energie;\r\n\t}", "public void reserveer() {\n System.out.println(\"de eigenaar van de auto is: \" + i.eigenaar());\n\n }", "public void setAnfang(Vektor anfang) {\n\t\tthis.anfang = anfang;\n\t}", "public void KareEkle() {\n\t\t\n\t\tint x = root.x;\n\t\tint y = root.y;\n\t\t\n\t\tNodeYilan eklenecekKare = new NodeYilan(root.x,root.y);\n\t\t\n\t\troot.x = x;\n\t\troot.y = y;\n\t\teklenecekKare.next = root;\n\t\troot = eklenecekKare;\n\t\t\n\t}", "void setEphemerisMode();", "public ILocation east()\n {\n Location east = new Location(x + 1, y);\n return east;\n }", "public static void main(String[] arhg) {\n\n Conta p1 = new Conta();\n p1.setNumConta(1515);\n p1.abrirConta(\"cp\");\n p1.setDono(\"wesley\");\n p1.deposita(500);\n // p1.saca(700); -> irá gera um erro pois o valor de saque especificado é superior ao valor que tem na conta\n\n p1.estadoAtual();\n }", "public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\tg[1] = m[1][0] + m[1][1] + m[1][2];\n\t\tg[2] = m[2][0] + m[2][1] + m[2][2];\n\t\t\n\t\tg[3] = m[0][0] + m[1][0] + m[2][0];\n\t\tg[4] = m[0][1] + m[1][1] + m[2][1];\n\t\tg[5] = m[0][2] + m[1][2] + m[2][2];\n\t\t\n\t\tg[6] = m[0][0] + m[1][1] + m[2][2];\n\t\tg[7] = m[2][0] + m[1][1] + m[0][2];\n\t\tg[8] = \"0\";\n\t\tg[9] = \"0\";\n\t\t\n\t\tfor(int i= 0; i<10; i++) {\n\t\t\tif(g[i].equals(\"XXX\")){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"X GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\temp = 0; \n\t\t\t\tbreak;\n\t\t\t} else if (g[i].equals(\"OOO\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\"O GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\t\n\t\tif (emp == 9) {\n\t\t\tJOptionPane.showMessageDialog(null,\"EMPATOU\");\t\n\t\t\tacabou = true;\n\t\t}\n\t}", "public void draw_Energizer(boolean b) {\n if (b) {\n mazeEditor.mazeDrawMode = DRAW_ENERGIZER;\n\n Tog1.setState(false); \n Tog3.setState(false); \n Tog4.setState(false); \n Tog5.setState(false);\n Tog6.setState(false);\n Tog7.setState(false);\n }\n }", "public void setEHour(int ehour)\r\n\t{\r\n\t\tthis.ehour = ehour;\r\n\t}", "@Model\n\tprotected double advanceAy() {\n\t\t\n\t\tList<List<List<Object>>> collisions = getCollisions();\n\t\tif ((!noObjectMovementBlocking(collisions.get(3).get(0)) || collisions.get(3).get(1).contains(Feature.ground)\n\t\t\t\t|| (int) getY() <= 0) && !getJustJumped()) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn -10;\n\t\t}\n\t}", "public void tip()\r\n\t{\n\t\tSystem.out.println(\"Tipul de organizare: SAT!\");\r\n\t}", "public balik_turleri() {\n initComponents();\n Toolkit toolkit = getToolkit();\n Dimension dim = toolkit.getScreenSize();\n setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);\n setTitle(\"Balık Türleri Ekranı\");\n }", "public void init_erup() {\n\t\tchange=5;\n\t\tfor(int x=x_max-change ; x <= x_max+change ; x++) {\n\t\t\tfor(int y=y_max-change ; y <= y_max+change ; y++) {\n\t\t\t\tif(x>=0 && x<w.getX() && y>=0 && y<w.getY() ) {\n\t\t\t\t\tif(w.n.alti[x][y]==9)\n\t\t\t\t\t\tliquide[x][y]=10;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n int yaricap=4;\n double alan= 4*4*Constans.pi;\n\n\n // kullanicidan alacaginiz saat , dakika ve gun bilgisinin saniyeyey ceviriniz\n\n int gun =23;\n int saat=7;\n int dakika=25;\n\n int saniyeCinsinden =\n gun * Constants.hourInDay *Constants.minuteInHour* Constants.secondInMinute+\n saat* Constants.minuteInHour* Constants.secondInMinute+\n dakika * Constants.secondInMinute;\n System.out.println(\"saniyeCinsinden = \" + saniyeCinsinden);\n\n\n }", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "@Test\n\tpublic void testYGivenT() {\n\t\t\n\t\tdouble y1 = 0, y2 = 7.6, y3 = 5.38, y4 = 3.76;\n\t\tdouble v0 = 25;\n\t\tdouble theta = 30;\n\t\tdouble t1 = 0, t2 = 1, t3 = 2, t4 = 2.2;\n\t\tassertEquals(PhysicsEngine.findYPos(v0, theta, t1, 0), y1, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v0, theta, t2, 0), y2, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v0, theta, t3, 0), y3, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v0, theta, t4, 0), y4, DELTA);\n\t\t\n\t\tdouble y5 = 0, y6 = 27.47, y7 = 45.13, y8 = 47.48;\n\t\tdouble v1 = 38.6;\n\t\tdouble phi = 57;\n\t\tassertEquals(PhysicsEngine.findYPos(v1, phi, t1, 0), y5, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v1, phi, t2, 0), y6, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v1, phi, t3, 0), y7, DELTA);\n\t\tassertEquals(PhysicsEngine.findYPos(v1, phi, t4, 0), y8, DELTA);\n\t}", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public EarthGeometry(){\n\t\tgcl1 = new GeodeticCalculator();\n\t\trnd1 = new Random(56789);\n\t}", "@Override\n\tpublic double calculsalaire() {\n\t\treturn 1500 + nbY*20;\n\t}", "public void BigE_and_Truana()\r\n\t{\r\n\t\t/* ____________ First get an approximate value of BIGE ______________________*/\r\n\t\t\r\n\t\tTANE = Trig.DegTAN ( EM ) / ( Trig.DegCOS ( EM ) - E );\r\n\t BIGE = Math.atan ( TANE ) * TRGVAR.R_to_D;\r\n\t E0 = E * TRGVAR.R_to_D;\r\n\t \r\n\t BIGE = BIGE % 360;\r\n\t BIGE0 = BIGE ;\r\n\t \r\n\t BIGE = BIGE0 + ( EM + E0 * Trig.DegSIN ( BIGE0 ) - BIGE0 ) / ( 1. - E * Trig.DegCOS ( BIGE0 ));\r\n\t \r\n\t /* ____________ Get more accurate value of BIGE by iteration ______________________*/\r\n\t \r\n\t COUNT = 0;\r\n\t ERROR = Math.abs (( BIGE - BIGE0 ) / BIGE0 );\r\n\t BIGE0 = BIGE ;\r\n\t \r\n\t while ( ERROR > 0.000001 || COUNT < 20) {\r\n\t \tBIGE = BIGE0 + ( EM + E0 * Trig.DegSIN ( BIGE0 ) - BIGE0 ) / ( 1. - E * Trig.DegCOS ( BIGE0 ));\r\n\t \tERROR = Math.abs (( BIGE - BIGE0 ) / BIGE0 ); //loop body\r\n\t \tBIGE0 = BIGE;\r\n\t \tCOUNT++;\r\n\t \t}\r\n\t \r\n\t TANVB2 = Math.sqrt (( 1.+E ) / ( 1.-E )) * Trig.DegTAN ( BIGE / 2. );\r\n\t \r\n\t TRUANA = 2. * Math.atan ( TANVB2 ) * TRGVAR.R_to_D;\r\n\t TRUANA = TRUANA % 360;\r\n\t \r\n\t System.out.println( \" ERROR = \" + ERROR + \" COUNT = \" + COUNT + \" BIGE = \" + BIGE + \" TRUANA = \" + TRUANA );\r\n\t \r\n\r\n\t}", "public void jugar(){\r\n System.out.println(\"\\n\\n\\n\");\r\n // reiniciar llena el array de gato des espacios en blanco para que el tablero este en blanco\r\n reiniciar(); \r\n //pedir nombres de los jugadores\r\n System.out.println(\"Para tirar solo escribe las coordenadas (x,y) de la casilla que quieres\"); \r\n System.out.println(\"(o) Nombre de Jugador 1: \");\r\n nom1=entrada.nextLine();\r\n System.out.println(\"(x) Nombre de Jugador 2: \");\r\n nom2=entrada.nextLine();\r\n System.out.println(\"\\n\\n\\n\");\r\n //imprime el tablero\r\n tablero(); \r\n //deja que los jugadores tiren\r\n tirar(); \r\n //confirma victorias o empates \r\n if(ganador=='o'){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"GANA \"+ nom1);\r\n System.out.println(\"\\n\\n\");\r\n }\r\n if(ganador=='x'){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"GANA \"+ nom2);\r\n System.out.println(\"\\n\\n\");\r\n }\r\n if(contador==9){\r\n System.out.println(\"\\n\\n\");\r\n System.out.println(\"EMPATE, sean panas \"+nom1+\" y \"+nom2+\" :)\");\r\n System.out.println(\"\\n\\n\");\r\n }\r\n\r\n }", "private void girar(int delta){\r\n\t\tang = angDestino;\r\n\t}", "public BrewedEspresso(Gelato gelato) {\n super(gelato);\n }", "protected void setAy(double ay) {\n\t\tif (isValidAy(ay))\n\t\t\tthis.ay = ay;\t\t\n\t\telse \n\t\t\tthis.ay = 0;\t\t\n\t}", "public BaoKeoBua() {\n initComponents();\n this.setLocationRelativeTo(null);\n khoiDong();\n }", "public add_karyawan() {\n initComponents();\n showTable();\n randomNumber();\n setLocation(500, 200);\n }", "public void hauptProgramm(int gewuenschteTiefe){\n\t\tgespeicherterZug = -1;\n\t\tthis.gewuenschteTiefe = gewuenschteTiefe;\n\t\t\n\t\tmax(eigenerStein, gewuenschteTiefe);\n\t\t\n\t\tif (gespeicherterZug == -1) {\n\t\t\t//Es gab keine weiteren Zuege mehr\n\t\t\tSystem.out.println(\"Das Spiel ist beendet.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Der Stein wird in Spalte \" + gespeicherterZug + \" geworfen.\");\n\t\t}\n\t}", "public static void prikaziEastPanel() {\r\n\t\tteretanaGui.getEastPanel().setVisible(true);\r\n\t}", "@Test\n public void testPulkovo1995GKZone5() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5());\n }", "public void girarHaciaEnemigo()\n {\n if(getWorld()==null){return;}\n MyWorld world = (MyWorld) getWorld();\n Gato enemigo = world.getGato();\n if(enemigo.getWorld()==null){return;}\n turnTowards(enemigo.getX(),enemigo.getY());\n }", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "@Test\n public void testPulkovo1995GKZone5N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone5N());\n }", "@Override\n\tpublic void office_location() {\n\t\tSystem.out.println(\"Office location is Gurgaon\");\n\t}", "@Override\r\n\t\t\tprotected String makeEyeAltitudeDescription(double metersAltitude){\r\n\t\t\t\t//System.out.println(\"metersAltitude: \"+ metersAltitude);\r\n\t\t\t\tsetCurrentAltitude(metersAltitude);\r\n\t\t\t\treturn super.makeEyeAltitudeDescription(metersAltitude);\r\n\t\t\t}", "public Room goEast() {\n return goDir(Side.EAST);\n }", "public final void zzaka() {\n zza(zzbwn.zzfur);\n }", "public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}", "@Test\n public void altitudeForYWorks(){\n PanoramaParameters p = new PanoramaParameters(new GeoPoint(PI, PI/2), 3600, PI, PI/3, 30000, 2500, 800);\n assertEquals(0, p.altitudeForY(399.5), 1e-7);\n assertEquals(p.verticalFieldOfView()/2, p.altitudeForY(0), 1e-7);\n assertEquals(0.1485520336, p.altitudeForY(45), 1e-7);\n }", "void makeAvocado() {\n this.hungerDeltaPcrntArray.add(0.17f);\n this.speedDeltaPcrntArray.add(0.50f);\n this.pointsDeltaArray.add(600);\n this.imageLocationArray.add(\"avocado.png\");\n }", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint [] eingabe = {1, 1, 1, 1};\r\n\t\tint laenge = 4;\r\n\t\tint zustandAktuell = 0;\r\n\t\tint [][] Zustandstabelle = new int [4][2];\r\n\t\tZustandstabelle [0][0] = -1;\r\n\t\tZustandstabelle [0][1] = 1;\r\n\t\tZustandstabelle [1][0] = 2;\r\n\t\tZustandstabelle [1][1] = 3;\r\n\t\tZustandstabelle [2][0] = 2;\r\n\t\tZustandstabelle [2][1] = -1;\r\n\t\tZustandstabelle [3][0] = 2;\r\n\t\tZustandstabelle [3][1] = 3;\r\n\t\t\r\n\t\tfor (int i = 0; i < laenge; i++)\r\n\t\t{\r\n\t\t\tzustandAktuell = Zustandstabelle[zustandAktuell][eingabe[i]];\r\n\t\t\tif (zustandAktuell == -1) {\r\n\t\t\t\tSystem.out.print(\"Ungültige Eingabe. Beenden\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif (zustandAktuell != 5)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"q\" + (zustandAktuell + 1) + \" ist der Zustand nach Bearbeitung der Eingabe: [\");\r\n\t\t\tfor (int i = 0; i < laenge ; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(eingabe [i]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.print(\"]\");\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public void actionPerformed(ActionEvent e)\n {\n if(y >= 550) //if the beaker is not filled\n {\n lab3.setBounds(510,y,230,60); \n lab3.setVisible(true); //displays orange bar image\n value += 27; //point value of orange\n y -= 60; //sets up to fill first half of beaker\n }\n else\n {\n //if beaker is full resets value and y coordinate\n value = 0; \n y = 610; \n }\n }", "public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }", "private void adjustGraph() {\n //Ajustamos el eje x\n XAxis ejeX = lengthGraph.getXAxis();\n ejeX.setPosition(XAxis.XAxisPosition.BOTTOM);\n ejeX.setEnabled(true);\n ejeX.setDrawLabels(true);//Esto es solo para poner los numeros del eje\n ejeX.setDrawAxisLine(true);\n if(this.mag == 2){\n ejeX.setAxisMaximum(2);\n }else{\n ejeX.setAxisMaximum(18);\n }\n ejeX.setAxisMinimum(0);\n\n //Ajustamos el eje y\n YAxis ejeY = lengthGraph.getAxisLeft();\n //ejeY.setPosition(YAxis.YAxisPosition.LEFT);\n ejeY.setDrawLabels(true);\n ejeY.setDrawAxisLine(true);\n ejeY.setAxisMaximum(round(maxY[mag])+5);\n ejeY.setAxisMinimum(round(minY[mag])-5);\n lengthGraph.getAxisRight().setEnabled(false);//Asi no se ve el eje de la derecha\n\n //Adjusting the title\n String title;\n if(dato == null) title = titleMag[mag] + \" \" + this.name;\n else title = titleMag[mag] + \" \" + titleGen[gen];\n textTitulo.setText(title);\n\n //Adjusting the legend\n Legend leyenda = lengthGraph.getLegend();\n leyenda.setEnabled(false);\n\n Description d = lengthGraph.getDescription();\n d.setText(\"edad [años]\");\n\n //Adjusting the zoom\n //lengthGraph.setPinchZoom(true); //This is to make zoom in all directions\n\n\n lengthGraph.invalidate();\n }", "@Test\n public void testPulkovo1995GKZone25() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25());\n }", "public void gambarTanda(int x1, int y1,int x2, int y2, int x3, int y3, String kata, Graphics g)\n {\n int arrayX[]={x1,x2,x3};\n int arrayY[]={y1,y2,y3};\n g.setColor(new Color(153,153,255));\n g.fillPolygon(arrayX,arrayY,3);\n g.setColor(Color.BLUE);\n g.drawString(kata,x1-10,y1+10);\n }", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "@Test\n public void testPulkovo1995GKZone27() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27());\n }", "public void ustawPojazdNaPoczatek()\n\t{\n\t\tSciezka pierwszaSc = droga.get(0);\n\t\tfinal double y = 10;\n\t\tpojazd.zmienPozycje(pierwszaSc.getCenterDownX(), y);\n\t}", "public final String[] getAsteikko() {\r\n return asteikko;\r\n }", "public GridBagPanel anchorEast()\n {\n myGBC.anchor = GridBagConstraints.EAST;\n return this;\n }", "public Persoon(){\n geboorteDag = 0;\n geboorteMaand = 0;\n geboorteJaar = 0;\n nieuweGeslacht = 'x';\n }", "public n baw() {\n return this.ewZ;\n }", "private double calc_E(KeplerElements a) {\n\t\tdouble sqrome2 = Math.sqrt(1.0 - a.e * a.e);\r\n\t\tdouble cta = Math.cos(a.ta);\r\n\t\tdouble sta = Math.sin(a.ta);\r\n\t\tdouble sine0 = (sqrome2 * sta) / (1.0 + a.e * cta);\r\n\t\tdouble cose0 = (a.e + cta) / (1.0 + a.e * cta);\r\n\t\tdouble e0 = Math.atan2(sine0, cose0);\r\n\t\treturn e0;\r\n\r\n\t}", "@Test\n public void testPulkovo1995GKZone6() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone6());\n }", "public void tetraederzeichnen(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){\n double[][] arr_koordinaten_2d ={{ax,ay},{bx,by},{cx,cy},{dx,dy}};\n /**\n * Aufruf der Methode gestricheltodernicht\n *\n * Überprüft, welche Strecken von Punkt D sichtbar sind oder nicht.\n */\n\n boolean[] strichelnodernicht = cls_berechnen.gestricheltodernicht(arr_koordinaten_2d);\n\n /**Skaliert die Koordinaten zum Pixelformat mit Koordinatenursprung\n * ca in der Mitte der Zeichenfläche*/\n int sw=9; //skalierungswert\n ax= (sw+ax)*50;\n ay=(sw-ay)*50;\n bx= (sw+bx)*50;\n by=(sw-by)*50;\n cx= (sw+cx)*50;\n cy=(sw-cy)*50;\n dx= (sw+dx)*50;\n dy=(sw-dy)*50;\n\n /**\n * Erstellt Linienobjekte für die Kanten des Tetraeder Objekts...\n */\n Line line1 = new Line();\n Line line2 = new Line();\n Line line3 = new Line();\n Line line4 = new Line();\n Line line5 = new Line();\n Line line6 = new Line();\n\n /**\n * ... weißt ihnen die Koordinaten zu...\n */\n line1.setStartX(ax);\n line1.setStartY(ay);\n line1.setEndX(bx);\n line1.setEndY(by);\n\n line2.setStartX(ax);\n line2.setStartY(ay);\n line2.setEndX(cx);\n line2.setEndY(cy);\n\n line3.setStartX(bx);\n line3.setStartY(by);\n line3.setEndX(cx);\n line3.setEndY(cy);\n \n line4.setStartX(dx);\n line4.setStartY(dy);\n line4.setEndX(ax);\n line4.setEndY(ay);\n\n line5.setStartX(dx);\n line5.setStartY(dy);\n line5.setEndX(bx);\n line5.setEndY(by);\n\n line6.setStartX(dx);\n line6.setStartY(dy);\n line6.setEndX(cx);\n line6.setEndY(cy);\n \n if(!strichelnodernicht[0]){\n line4.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[1]){\n line5.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[2]){\n line6.getStrokeDashArray().addAll(5d,5d);}\n\n /**\n * ... und fügt die Linien Objekte der Zeichenfläche hinzu\n */\n canvaspane.getChildren().add(line1);\n canvaspane.getChildren().add(line2);\n canvaspane.getChildren().add(line3);\n canvaspane.getChildren().add(line4);\n canvaspane.getChildren().add(line5);\n canvaspane.getChildren().add(line6);\n\n //zeichnet den Koordinatenursprung neu\n canvaspane.getChildren().add(l1);\n canvaspane.getChildren().add(l2);\n }", "public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }", "@Test\n public void testPulkovo1995GKZone25N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone25N());\n }", "@Test\n public void testPulkovo1995GKZone28() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone28());\n }", "@Test\n public void testPulkovo1995GKZone7() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone7());\n }", "@Test\n public void testPulkovo1995GKZone29() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone29());\n }", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "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 }", "@Test\n public void testPulkovo1995GKZone8() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone8());\n }", "public EarthGeometry(int iRandomSeed){\n\t\tgcl1 = new GeodeticCalculator();\n\t\trnd1 = new Random(iRandomSeed);\n\t}", "@Test\n public void testPulkovo1995GKZone27N() {\n testToWGS84AndBack(PROJ.getPulkovo1995GKZone27N());\n }", "@Override\n\tpublic void setUtmEast(int utmEast) {\n\t\t\n\t}", "public abstract void drawEarthquake(PGraphics pg, float x, float y);", "public abstract void drawEarthquake(PGraphics pg, float x, float y);", "@Override\n\tpublic java.util.Date getNgayTao() {\n\t\treturn _keHoachKiemDemNuoc.getNgayTao();\n\t}", "public void gears(){\n\t\t System.out.println(\"bike has 4 gears ....\");\r\n\t\t//system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\r\n\r\n\t}" ]
[ "0.60569674", "0.6047072", "0.600257", "0.5946096", "0.5713729", "0.5608204", "0.55904984", "0.558738", "0.55216604", "0.5507674", "0.5470406", "0.54481304", "0.5446601", "0.5428474", "0.54123247", "0.54082954", "0.53853434", "0.5374656", "0.5371615", "0.5366273", "0.5354442", "0.53322095", "0.53282714", "0.53012806", "0.5301123", "0.52852595", "0.52774715", "0.52752244", "0.5253042", "0.5252791", "0.5252022", "0.52519524", "0.5242491", "0.5235154", "0.522826", "0.52092165", "0.5207418", "0.5203806", "0.5195395", "0.51846355", "0.51788664", "0.51770955", "0.517573", "0.5174258", "0.51722383", "0.5168192", "0.5145673", "0.51386404", "0.51364774", "0.5134258", "0.5130396", "0.5116073", "0.51041037", "0.5096218", "0.5087352", "0.50781566", "0.5074464", "0.5072595", "0.5067081", "0.5060567", "0.50470847", "0.50404406", "0.5036816", "0.50280714", "0.5023845", "0.501865", "0.50143516", "0.5000544", "0.4995073", "0.4992064", "0.499201", "0.4991734", "0.49903202", "0.4989983", "0.49895427", "0.49868405", "0.49722505", "0.49696803", "0.49648315", "0.49641088", "0.4952684", "0.49524406", "0.49522462", "0.4951397", "0.4949189", "0.49405208", "0.49364197", "0.49282286", "0.49277642", "0.49271178", "0.49263582", "0.4925422", "0.4925121", "0.4924631", "0.49244076", "0.49228245", "0.49218836", "0.49218836", "0.49165", "0.49164528" ]
0.6401155
0
Asettaa tiedon onko "Easter Egg" aktivoitu.
public void setEasterEgg(boolean easterEgg){ this.easterEgg = easterEgg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void beK() {\n AppMethodBeat.i(88975);\n if (this.kaS.aZV().vTW != null && this.kaS.aZV().vTW.size() > 0) {\n tm tmVar = (tm) this.kaS.aZV().vTW.get(0);\n if (this.iPD != null) {\n this.iPD.setText(tmVar.title);\n }\n if (this.ksp != null) {\n if (TextUtils.isEmpty(tmVar.kbW)) {\n this.ksp.setVisibility(8);\n } else {\n this.ksp.setText(tmVar.kbW);\n }\n }\n if (this.ksq != null) {\n if (TextUtils.isEmpty(tmVar.kbX)) {\n this.ksq.setVisibility(8);\n } else {\n this.ksq.setText(tmVar.kbX);\n AppMethodBeat.o(88975);\n return;\n }\n }\n }\n AppMethodBeat.o(88975);\n }", "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}", "void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }", "void bake() {\n\t\tSystem.out.println(\"Bake for 25 mins at 350\\u00b0\");\n\t}", "public void onderbreek(){\n \n }", "public final void dyE() {\n AppMethodBeat.i(29674);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29666);\n w.this.ynU = true;\n al.af(w.this.ynV);\n al.n(w.this.ynV, 300);\n AppMethodBeat.o(29666);\n }\n });\n AppMethodBeat.o(29674);\n }", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "@Override\n public void eatLeaves()\n {\n setEatText(\"munch munch oink\");\n System.out.println(getEatText());\n }", "@Override\n\tpublic void HowtoEat() {\n\t\tSystem.out.println(\"Fırında Ye!!\");\n\t}", "public void playTopHat() {\n\t\tSystem.out.println(\"ding ding da-ding\");\n\t\t\n\t}", "private void fahre(int aufzugNummer, int stockwerkAenderung){\n\t\tSystem.out.println();\r\n\t\t//Animation der Aufzüge\r\n\t\tTranslateTransition anpassung = new TranslateTransition(Duration.seconds(Aufzug.DAUER_PRO_STOCK*Math.abs(stockwerkAenderung)), aufzuge[aufzugNummer]);\r\n\t\tanpassung.setByY(stockwerkAenderung*stockwerkHohe);\r\n\t\tanpassung.play();\r\n\t}", "private void beat() {\n\t\t\tSystem.out.println(\"Heart beating\");\n\t\t}", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "@Override\n\tpublic void eggHatches() {\n\t\t\n\t}", "public final void markTempo() {\n\t\tclock.activateAfterWait(() -> view.flash(1),\n\t\t\t\tConstants.FLASH_TIME);\n\t\tclock.activateAfterWait(() -> soundEmettor.makeSound(),\n\t\t\t\tConstants.FLASH_TIME);\n\t}", "public void bake() {\n System.out.println(\"Baking for 25 min at 350\");\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 void muere() {\n System.out.println(\"Ugh... Llegó mi hora... Adios.\");\n }", "public void eat() {\n\t\tSystem.out.println(\"Ape eating\");\n\t}", "public void hatchKickerExtend() {\n hatchkicker.set(true);\n }", "public boolean getEasterEgg() {\n\t\treturn easterEgg;\n\t}", "@Override\n\tpublic void makeEyesWithMan() {\n\t\tSystem.out.println(\"Å×ÃÄÑÛÄØ¡£¡£¡£\");\n\t}", "public void actionPerformed(ActionEvent e) {\n gui.activateTerrains(false);\n\n if (gui.getGUIState() == GUIState.MOVESHEEPFROM) {\n gui.activateTerrains(true);\n gui.setGUIState(GUIState.MOVESHEEPSELECTION);\n gui.activateSheepSelection(true, terrain);\n gui.getLAction2().setText(\"Seleziona quale ovino si vuole muovere\");\n } else if (gui.getGUIState() == GUIState.KILLSHEEP) {\n gui.setGUIState(GUIState.KILLSHEEPSELECTION);\n gui.activateSheepSelection(true, terrain);\n gui.getLAction2().setText(\"Seleziona quale ovino vuoi abbatere\");\n } else if (gui.getGUIState() == GUIState.JOINSHEEPS) {\n gui.setGUIState(GUIState.KILLSHEEPSELECTION);\n gui.sendJoinSheeps(terrain);\n } else if (gui.getGUIState() == GUIState.MOVESHEEPTO) {\n gui.activateDropDown(false);\n gui.setGUIState(GUIState.WAITINGFOROTHERPLAYER);\n gui.sendMoveSheep(terrain);\n }\n\n }", "public void azzera() { setEnergia(0.0); }", "@Override\n\t\tpublic void enter(Elsa elsa) {\n\t\t\tif (!elsa.isCooking()) {\n\t\t\t\ttalk(elsa, \"Putting the stew in the oven\");\n\n\t\t\t\t// Send a delayed message myself so that I know when to take the\n\t\t\t\t// stew out of the oven\n\t\t\t\tMessageManager.getInstance().dispatchMessage( //\n\t\t\t\t\t\t1, // time delay\n\t\t\t\t\t\telsa, // sender ID\n\t\t\t\t\t\telsa, // receiver ID\n\t\t\t\t\t\tMessageType.STEW_READY, // msg\n\t\t\t\t\t\tnull);\n\n\t\t\t\telsa.setCooking(true);\n\t\t\t}\n\t\t}", "public void eat() {\n if (!isTired()) {\n hunger -= 3;\n fatigue += 2;\n\n if (!muted) {\n System.out.println(\"eat\\t\\t|\\tYummy this is tasty!\");\n }\n }\n }", "@Override\n public void eatMeat()\n {\n setEatText(\"nomnomnom oink thx\");\n System.out.println(getEatText());\n }", "public void initElbow(){\r\n do{\r\n int currentElbowPosition = motorElbow.getCurrentPosition();\r\n posElbow = currentElbowPosition - DELTA_ELBOW;\r\n motorElbow.setTargetPosition(posElbow);\r\n motorElbow.setPower(POWER_ELBOW_SLOW);\r\n } while(!sensorElbow.isPressed());\r\n\r\n motorElbow.setPower(STOP);\r\n resetElbowEncoder();\r\n posElbow = 0;\r\n }", "public void startExploration() {\n watermarkGoalTick = currentTick;\n }", "public void setEngineOn();", "public void eat( ) // Start eating\r\n {\r\n isEating = true; // Change the state\r\n isSleeping = false;\r\n return;\r\n }", "public void eat() {\r\n System.out.println(\"ORANGES\");\r\n }", "public final void beJ() {\n AppMethodBeat.i(88974);\n this.ksq = (TextView) beI().findViewById(R.id.ake);\n this.ksp = (TextView) beI().findViewById(R.id.akd);\n AppMethodBeat.o(88974);\n }", "public void art() {\n arJ();\n }", "public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSpeed = this.destPos;\n this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\n this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);\n if (!this.onGround && this.wingRotDelta < 1.0F) {\n this.wingRotDelta = 1.0F;\n }\n\n this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D);\n Vec3d vec3d = this.getMotion();\n if (!this.onGround && vec3d.y < 0.0D) {\n this.setMotion(vec3d.mul(1.0D, 0.6D, 1.0D));\n }\n\n this.wingRotation += this.wingRotDelta * 2.0F;\n if (!this.world.isRemote && this.isAlive() && !this.isChild() && getGender()==Gender.FEMALE && --this.timeUntilNextEgg <= 0) {\n this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\n this.entityDropItem(Items.EGG);\n this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\n }\n\n ++this.eatTicks;\n ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.MAINHAND);\n if (this.canEatItem(itemstack)) {\n if (this.eatTicks > 600) {\n ItemStack itemstack1 = itemstack.onItemUseFinish(this.world, this);\n if (!itemstack1.isEmpty()) {\n this.setItemStackToSlot(EquipmentSlotType.MAINHAND, itemstack1);\n }\n\n this.eatTicks = 0;\n } else if (this.eatTicks > 560 && this.rand.nextFloat() < 0.1F) {\n this.playSound(this.getEatSound(itemstack), 1.0F, 1.0F);\n this.world.setEntityState(this, (byte)45);\n }\n }\n\n }", "private void eating(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }", "public void turnOn(){\n Logger.getGlobal().log(Level.INFO,\" Turning On..\");\n vendingMachine = new VendingMachine();\n inventoryPopulation();\n idle();\n }", "public void makeTea() {\n\t\tboil();\n\t\taddSugar();\n\t\taddTea();\n\t\tserve();\n\t}", "@Override\r\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"ig tv power on\");\r\n\t}", "public void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "private void vuoronKolmasHeitto() {\n while (heittojaJaljella == 1) {\n if (tulosLaitettu) {\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException ex) {\n System.out.println(\"Ei ole heitetty tai laitettu tulosta\");\n }\n }\n }", "@Override\n\tpublic void laysEgg() {\n\t\t\n\t}", "@Override\n\tpublic void tanCongKeXau() {\n\n\t}", "void makeAvocado() {\n this.hungerDeltaPcrntArray.add(0.17f);\n this.speedDeltaPcrntArray.add(0.50f);\n this.pointsDeltaArray.add(600);\n this.imageLocationArray.add(\"avocado.png\");\n }", "public void run() {\n mOpponentEmoteBubble.setText(botEmotesArray[new Random().nextInt(botEmotesArray.length)]);\n showEmote(mOpponentEmoteBubble);\n\n }", "@Override\n\tpublic void atirou() {\n\n\t\t\tatirou=true;\n\t\t\t\n\t\t\n\t}", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\n }", "public void eat()\n {\n System.out.println(\"You have eaten now and you are not hungry any more\");\n }", "public void pauza()\n\t{\n\t\tif(!wToku)\n\t\t\treturn;\n\t\t\n\t\tif(zegar.isRunning())\n\t\t{\n\t\t\tpauza = true;\n\t\t\tzegar.stop();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tzegar.start();\n\t\t\tpauza = false;\n\t\t}\n\t\t\t\n\t}", "public void setEBrake(boolean ebrake) {\n\t\tthis.engineFailureStatus();\n\t\tthis.brakeFailureStatus();\n\t\tthis.signalFailureStatus();\n if(!this.brakeFailureActive && !this.signalFailureActive && !this.engineFailureActive) {\n this.emerBrake = ebrake;\n } else if(this.brakeFailureActive || this.signalFailureActive || this.engineFailureActive){\n\t\t\tthis.emerBrake = true;\n\t\t}\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 void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }", "@Override\r\n\tpublic String Eat() {\n\t\treturn \"SuperMan I Eat\";\r\n\t}", "public void cheat() {\r\n announce( \"cheat\" );\r\n }", "@Override\n\tpublic void eat() {\n\t\tsuper.eat();\n\t\tSystem.out.println(\"喝奶.......\");\n\t}", "void emi(){\n\t\tSystem.out.println(\"This is HomeLoan EMi\");\n\t}", "public void train() {\r\n\t\texp += 2;\r\n\t\tenergy -= 5;\r\n\t\tSystem.out.println(\"Gained 2 experience.\");\t\r\n\t}", "void displayEmotion() {\n if (emotion.getLifetime() == 0) { emotion = null; }\n else { emotion.decreaseLifetime(); }\n }", "@Override\r\n\tpublic void work() {\n\t\tSystem.out.println(\"0.5 FTE\");\r\n\t}", "public void eat () {\n System.out.println(\"He's eating everything\" );\n }", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "@Override\n public void eat() {\n System.out.println(\"Now doggo is eating\");\n chew();\n super.eat();\n }", "@Override\r\n\tpublic void autoSeatHeat() {\n\t\t\r\n\t}", "public void showArming();", "@Override\n public void askOxygen(){\n _brain.lungs.breath();\n _brain.heart.accelerate(1);\n }", "public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }", "public void belajar(){\n\t\tSystem.out.println(\"Belajar java di \"+tempat+\" selama \"+jamBelajar+\" jam\");\n\t}", "public void mo5968e() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{-((float) C1413m.f5711i.getHeight()), 0.0f}).setDuration(240);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{0.0f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f}).setDuration(240);\n duration.start();\n duration2.start();\n long j = (long) 160;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5438qa, \"alpha\", new float[]{1.0f, 0.0f}).setDuration(j).start();\n duration.addListener(new C1302Xa(this));\n }", "private void tempoUp()\n {\n MyWorld world = (MyWorld) getWorld();\n if(Greenfoot.mouseClicked(this))\n {\n world.increaseTempo(); \n }\n }", "void idle()\n {\n\n elevatorOffset = 0;\n motorTimeline.pause();\n }", "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}", "@Override\n\tpublic void eatfood() {\n\t\tSystem.out.println(\"==pig : 잡식 ==\");\n\t}", "private void vuoronKaikkiHeitotHeitetty() {\n while (heittojaJaljella < 1) {\n if (tulosLaitettu) {\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException ex) {\n System.out.println(\"Ei ole laitettu tulosta\");\n }\n }\n }", "@Override\r\n\tpublic String takeOff() {\n\t\treturn \"El Helicoptero esta despegando\";\r\n\t}", "@Override\r\n\tpublic void pick() {\r\n\t\tSystem.out.println(\"Stay away from Jessica ya dweeb.\");\r\n\t\r\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}", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"狗吃肉\");\n\t}", "@Override\n public void onHeatWaterRaised() {\n heaterState = true;\n addCupButton.setVisible(false);\n takeCupButton.setVisible(false);\n }", "public static void playEHigh() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 76, volume );//E\n\t\tThread.sleep(200);\n\t}", "public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}", "public void erzaehlWas() {\n // Das Gleiche was jedes Tier sagt.\n super.erzaehlWas();\n\n // Zusaetzliche Aussage des Affen\n System.out.println(\"Affen sind einfach die besten Tiere.\");\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "public final void zzaka() {\n zza(zzbwn.zzfur);\n }", "public void eat() {\n\t\tSystem.out.println(\"They eat...\");\n\t}", "@Override\r\n\tpublic void onMachine() {\n System.out.println(\"Please On the machine to cook \");\r\n grillmachine.setState(grillmachine.getOnState());\r\n\t}", "public void geldCheat() {\n if (geld + 1000000 < Long.MAX_VALUE) {\n geld = geld + 1000000;\n ticker.neueNachricht(\"Korruptionsverdacht bei Stadtwerken!\");\n }\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"eat grass\");\n\t}", "private void vuoronToinenHeitto() {\n while (heittojaJaljella == 2) {\n if (tulosLaitettu) {\n break;\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException ex) {\n System.out.println(\"Ei ole heitetty tai laitettu tulosta\");\n }\n }\n }", "public static Event alienInvasion () {\n\t\tString alienText = \"Something has gone wrong!\" + System.lineSeparator() + \"Aliens are here to steal your farm\";\n\t\tString alienImage = \"images/event/aliens.jpg\";\n\t\tString[] alienOpTitle = {\"Oh no!\",\"The truth is out there\"};\n\t\tString[] alienOpText = {\"The farm is lost\", \"Cattle is mutilated\"+ System.lineSeparator() + \"50 % chance of abduction\"};\n\t\treturn new Event (-1, \"Alien Invasion!\", alienText , alienImage, alienOpTitle, alienOpText);\n\t}", "public void eatEgg(Egg egg) {\n raiseFoodLevel(10);\n }", "public final void mo52314qe() {\n AppMethodBeat.m2504i(94697);\n C37229i.this.aRw = true;\n AppMethodBeat.m2505o(94697);\n }", "void eat() {\n\t\tSystem.out.println(\"eating...\");\n\t}", "public void sleep() {\n hunger += 1;\n fatigue = 0;\n\n if (isHungry()) {\n mood -= 1;\n } else {\n mood += 1;\n }\n\n if (!muted) {\n System.out.println(\"sleep\\t|\\tzzzZZZ *sheep*\");\n }\n }", "private void setStatusTelaExibir () {\n setStatusTelaExibir(-1);\n }", "public void draw_Energizer(boolean b) {\n if (b) {\n mazeEditor.mazeDrawMode = DRAW_ENERGIZER;\n\n Tog1.setState(false); \n Tog3.setState(false); \n Tog4.setState(false); \n Tog5.setState(false);\n Tog6.setState(false);\n Tog7.setState(false);\n }\n }", "@Override\n\tpublic void eats() {\n\t\t\n\t}", "private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}", "private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}" ]
[ "0.6329207", "0.62777495", "0.6249328", "0.619305", "0.6102993", "0.6008558", "0.5990901", "0.59716505", "0.59529823", "0.5952899", "0.5936674", "0.5934657", "0.59086496", "0.587515", "0.58648825", "0.5839845", "0.58201665", "0.5797783", "0.57956845", "0.57848763", "0.573854", "0.57182", "0.571685", "0.57065916", "0.5697806", "0.5690195", "0.5677619", "0.56687665", "0.5657021", "0.5649623", "0.56482136", "0.56383735", "0.56324023", "0.5628427", "0.5608434", "0.56069714", "0.5601538", "0.5597781", "0.55963194", "0.5590653", "0.5588793", "0.55836743", "0.55761284", "0.5574001", "0.5572087", "0.55700547", "0.5562832", "0.55551606", "0.5543539", "0.5539458", "0.5536442", "0.55236787", "0.55225784", "0.55221653", "0.5519747", "0.5516249", "0.55105597", "0.55084836", "0.5508249", "0.54923064", "0.54912156", "0.5490195", "0.5489561", "0.54826796", "0.5479388", "0.54766536", "0.5459356", "0.54585314", "0.54512864", "0.5444793", "0.5443766", "0.5436815", "0.54364324", "0.54345554", "0.54249245", "0.5421073", "0.5419966", "0.54131085", "0.5409651", "0.54054093", "0.5398835", "0.5390523", "0.5377205", "0.5375731", "0.5374276", "0.53727555", "0.5368286", "0.53676885", "0.53671366", "0.5361534", "0.53505534", "0.5346142", "0.53399485", "0.53342265", "0.53308964", "0.5323549", "0.53231543", "0.53141356", "0.53129065", "0.53119487" ]
0.64212006
0
Palauttaa listan pelin JFramen pikkukuvista.
public List<Image> getIcons() { ImageIcon icon64 = new ImageIcon(getClass().getResource("/resources/frame_icon64.png")); ImageIcon icon128 = new ImageIcon(getClass().getResource("/resources/frame_icon128.png")); List<Image> icons = new ArrayList<Image>(); icons.add(icon64.getImage()); icons.add(icon128.getImage()); return icons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void listar() {\n\t\t\n\t}", "public ListaPracownikow() {\n generujPracownikow();\n //dodajPracownika();\n }", "public void GetVehiculos() {\n String A = \"&LOCATION=POR_ENTREGAR\";\n String Pahtxml = \"\";\n \n try {\n \n DefaultListModel L1 = new DefaultListModel();\n Pahtxml = Aso.SendGetPlacas(A);\n Lsvehiculo = Aso.Leerxmlpapa(Pahtxml);\n Lsvehiculo.forEach((veh) -> {\n System.out.println(\"Placa : \" + veh.Placa);\n L1.addElement(veh.Placa);\n });\n \n Lista.setModel(L1);\n \n } catch (Exception ex) {\n Logger.getLogger(Entrega.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "public String listViaje() {\n\t\t\t//resetForm();\n\t\t\treturn \"/boleta/list.xhtml\";\t\n\t\t}", "public Jahresrangliste() {\r\n\t\tLaeufe = new ArrayList<Lauf>();\r\n\t\tRennfahrer = new ArrayList<Fahrer>();\r\n\t}", "public void populerListView() {\n Turnering valgtTurnering;\n valgtTurnering = fp_kombo_turnering.getSelectionModel().getSelectedItem();\n valgtTurnering.hentParti();\n for (Parti p: valgtTurnering.hentParti()) {\n fp_liste_parti.getItems().add(p);\n }\n this.partierLastet = true;\n this.fp_knapp_velg_parti.setDisable(false);\n this.fp_knapp_søk_parti.setDisable(false);\n }", "private void listViewPendentes(List<Compra> listAll) {\n\t\t\n\t}", "public List<Fortaleza> listarFortalezas(){\r\n return cVista.listarFortalezas();\r\n }", "public void ouvrirListe(){\n\t\n}", "private void ucitajPodatke() {\n \n DefaultListModel<Voznja> m = new DefaultListModel<>();\n obrada.getPodaci().forEach(s->m.addElement(s));\n lstPodaci.setModel(m);\n\n }", "public void skratiListu() {\n if (!jePrazna()) {\n int n = Svetovid.in.readInt(\"Unesite broj elemenata za skracivanje: \");\n obrniListu(); //Zato sto se trazi odsecanje poslednjih n elemenata\n while (prvi != null && n > 0) {\n prvi = prvi.veza;\n n--;\n }\n obrniListu(); //Vraca listu u prvobitni redosled\n }\n }", "public void mostrarlistafininicio(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=fin;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.anterior;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de fin a inicio\",JOptionPane.INFORMATION_MESSAGE);\n }}", "private static void obtenirUneListe() throws FileNotFoundException {\n\t\tSystem.out.println(\"\\r\\nPour combien de jours : \");\n\t\tint nbJours = sc.nextInt();\n\n\t\tSystem.out.println(\"\\r\\nCombien de propositions : \");\n\t\tint nbPropositions = sc.nextInt();\n\n\t\tList<List<Recette>> listeProposition = genererListePropositions(nbJours, nbPropositions);\n\n\t\tSystem.out.println(\"\\r\\nChoix ? \");\n\t\tint choix = sc.nextInt();\n\n\t\tgenererFichier(listeProposition.get(choix - 1));\n\n\t\tsc.nextLine();\n\n\t\traz();\n\t}", "public void listar() {\n\n if (!vacia()) {\n\n NodoEnteroSimple temp = head;\n\n int i = 0;\n\n while (temp != null) {\n\n System.out.print(i + \".[ \" + temp.getValor() + \" ]\" + \" -> \");\n\n temp = temp.getSiguiente();\n\n i++;\n }\n }\n \n }", "public ListaJugadores() {\n\n\t\tListaJugadores.numListasJugadores++;\n\n\t\tthis.id = ListaJugadores.numListasJugadores;\n\n\t\tthis.jugadoresEnMesa = new ArrayList<Jugador>();\n\t\tthis.cargarJugadoresEnMesa();\n\n\t\tif (ListaJugadores.jugadoresRetirados == null) {\n\t\t\tListaJugadores.jugadoresRetirados = new ArrayList<Jugador>();\n\t\t\tthis.cargarJugadoresRetirados();\n\t\t}\n\n\t}", "@Override\n\tpublic ArrayList<Lista> listaListeElettorali() {\n\t\t\t\n\t\t\t\n\t\t\tDB db = getDB();\n\t\t\tMap<Integer, Lista> map = db.getTreeMap(\"liste\");\n\t\t\tArrayList<Lista> liste = new ArrayList<Lista>();\n\t\t\tSet<Integer> keys = map.keySet();\n\t\t\tfor (int key : keys) {\n\t\t\t\tliste.add(map.get(key));\n\t\t\t}\n\t\n\t\t\treturn liste;\n\t\t\t\n\t\t}", "public void oppdaterJliste()\n {\n bModel.clear();\n\n Iterator<Boligsoker> iterator = register.getBoligsokere().iterator();\n\n while(iterator.hasNext())\n bModel.addElement(iterator.next());\n }", "@GetMapping(\"/listeJoueurs\")\r\n\t@JsonView(Views.Joueur.class)\r\n\t@Transactional\r\n\tpublic List<Joueur> getListejoueurs() {\n\t\treturn partieContext.getParties().get(0).getLstJoueurs();\r\n\t}", "public void afficheInfos() {\n int i;\n Polygone p;\n for(i=0;i<this.list.size();i++){\n p = (Polygone) this.list.get(i);\n System.out.println(\"–––––––––––––––––––––\");\n System.out.println(\"Type : \" + p.toString());\n System.out.println(\"Sommet :\");\n System.out.print(p.texteSommets());\n System.out.println(\"Perimetre : \" + p.perimetre());\n System.out.println(\"Surface : \" + p.surface());\n System.out.println(\"–––––––––––––––––––––\");\n } \n }", "public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}", "private List<Pelicula> getLista() {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\tList<Pelicula> lista = null;\n\t\ttry {\n\t\t\tlista = new LinkedList<>();\n\n\t\t\tPelicula pelicula1 = new Pelicula();\n\t\t\tpelicula1.setId(1);\n\t\t\tpelicula1.setTitulo(\"Power Rangers\");\n\t\t\tpelicula1.setDuracion(120);\n\t\t\tpelicula1.setClasificacion(\"B\");\n\t\t\tpelicula1.setGenero(\"Aventura\");\n\t\t\tpelicula1.setFechaEstreno(formatter.parse(\"02-05-2017\"));\n\t\t\t// imagen=\"cinema.png\"\n\t\t\t// estatus=\"Activa\"\n\n\t\t\tPelicula pelicula2 = new Pelicula();\n\t\t\tpelicula2.setId(2);\n\t\t\tpelicula2.setTitulo(\"La bella y la bestia\");\n\t\t\tpelicula2.setDuracion(132);\n\t\t\tpelicula2.setClasificacion(\"A\");\n\t\t\tpelicula2.setGenero(\"Infantil\");\n\t\t\tpelicula2.setFechaEstreno(formatter.parse(\"20-05-2017\"));\n\t\t\tpelicula2.setImagen(\"bella.png\"); // Nombre del archivo de imagen\n\n\t\t\tPelicula pelicula3 = new Pelicula();\n\t\t\tpelicula3.setId(3);\n\t\t\tpelicula3.setTitulo(\"Contratiempo\");\n\t\t\tpelicula3.setDuracion(106);\n\t\t\tpelicula3.setClasificacion(\"B\");\n\t\t\tpelicula3.setGenero(\"Thriller\");\n\t\t\tpelicula3.setFechaEstreno(formatter.parse(\"28-05-2017\"));\n\t\t\tpelicula3.setImagen(\"contratiempo.png\"); // Nombre del archivo de imagen\n\n\t\t\tPelicula pelicula4 = new Pelicula();\n\t\t\tpelicula4.setId(4);\n\t\t\tpelicula4.setTitulo(\"Kong La Isla Calavera\");\n\t\t\tpelicula4.setDuracion(118);\n\t\t\tpelicula4.setClasificacion(\"B\");\n\t\t\tpelicula4.setGenero(\"Accion y Aventura\");\n\t\t\tpelicula4.setFechaEstreno(formatter.parse(\"06-06-2017\"));\n\t\t\tpelicula4.setImagen(\"kong.png\"); // Nombre del archivo de imagen\n\t\t\tpelicula4.setEstatus(\"Inactiva\"); // Esta pelicula estara inactiva\n\t\t\t\n\t\t\t// Agregamos los objetos Pelicula a la lista\n\t\t\tlista.add(pelicula1);\n\t\t\tlista.add(pelicula2);\n\t\t\tlista.add(pelicula3);\n\t\t\tlista.add(pelicula4);\n\n\t\t\treturn lista;\n\t\t} catch (ParseException e) {\n\t\t\tSystem.out.println(\"Error: \" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "public void MostrarListafINInicio() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=fin;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.anterior;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "List<ParqueaderoEntidad> listar();", "public void mostrarListaJugadores(){\n for (int i = 0; i < jugadores.length; i++) {\n \n if(jugadores[i]!=null){\n System.out.println(\" \"+jugadores[i].toString()+\" \");\n }\n \n }\n }", "private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }", "public String prikaziListu() {\r\n\t\treturn SOPrikazListe.izvrsi(lista.vratiRangListu(), lista.brRezultata);\r\n\t}", "public void setListaPartidas() {\r\n\t\tDefaultListModel<String> modelo = new DefaultListModel<String>();\r\n\t\t\r\n\t\tfor(int i = 0; i < this.listadoPartidas.size(); i++) {\r\n\t\t\tmodelo.add(i, this.listadoPartidas.get(i).getNombre());\r\n\t\t}\r\n\t\tthis.partidasList.setModel(modelo);\r\n\t\tif(!this.partidaSelecionada.equals(\"\")) {\r\n\t\t\tfor (Partida partida : this.listadoPartidas) {\r\n\t\t\t\tif(partida.getNombre().equals(this.partidaSelecionada)){\r\n\t\t\t\t\tlblInfoEspera.setText(Integer.toString(partida.getConectados()));\r\n\t\t\t\t\tlblInfoEstado.setText(partida.getEstado());\r\n\t\t\t\t\tlblInfoJugadoresReq.setText(Integer.toString(partida.getJugadoresReq()));\r\n\t\t\t\t\tif(principal.getVentanaEspera() != null)\r\n\t\t\t\t\t\tprincipal.getVentanaEspera().setValoresEspera(this.partidaMaxJugadores, partida.getJugadoresReq(), partida.getConectados());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void mostrarlistainciofin(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=inicio;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.siguiente;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de incio a fin\",JOptionPane.INFORMATION_MESSAGE);\n } }", "public JList obtenirList() {\r\n\t\treturn list;\r\n\t}", "public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }", "List<Plaza> consultarPlazas();", "public String navigateFechamentoList() {\n if (this.getSelected() != null) {\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"Fechamento_items\", this.getSelected().getFechamentoList());\n }\n return \"/pages/prime/fechamento/index\";\n }", "public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }", "public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }", "public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }", "private void listarItems() {\r\n // Cabecera\r\n System.out.println(\"Listado de Items\");\r\n System.out.println(\"================\");\r\n\r\n // Criterio de Ordenación/Filtrado\r\n System.out.printf(\"Criterio de Ordenación .: %S%n\", criOrd.getNombre());\r\n System.out.printf(\"Criterio de Filtrado ...: %S%n\", criFil.getNombre());\r\n\r\n // Separados\r\n System.out.println(\"---\");\r\n\r\n // Filtrado > Selección Colección\r\n List<Item> lista = criFil.equals(Criterio.NINGUNO) ? CARRITO : FILTRO;\r\n\r\n // Recorrido Colección\r\n for (Item item : lista) {\r\n System.out.println(item.toString());\r\n }\r\n\r\n // Pausai\r\n UtilesEntrada.hacerPausa();\r\n }", "@Override\r\n\tpublic List<Fournisseur> getListFournisseur() {\n\t\treturn this.sessionFactory.getCurrentSession().createQuery(\"from fournisseur\").list();\r\n\t}", "public void displayOnderwerpList() {\n List<Onderwerp> onderwerpList = winkel.getOnderwerpList();\n System.out.println(\"Kies een onderwerp: \");\n for (int i = 0; i < onderwerpList.size(); i++) {\n System.out.println((i + 1) + \". \" + onderwerpList.get(i));\n }\n }", "public List<Filme> listar() {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery consulta = gerenciador.createQuery(\r\n \"Select f from Filme f\", Filme.class);\r\n\r\n //Retornar a lista de atores\r\n return consulta.getResultList();\r\n\r\n }", "public JList getJListCamaras() {\r\n\t\t\r\n\t\tcamaras = xmlParser.getCamaras(fileXmlCamaras);\r\n\t//\tString data[] = new String[camaras.size()];\r\n\t\tIterator iterator = camaras.iterator();\r\n\t\tString cam = null;\r\n\t\tString user = null;\r\n\t\tString domain = null;\r\n\t\tint sipCon = 0;\r\n\t\tDefaultListModel model = new DefaultListModel();\r\n\t\tListItem li = null;\r\n\t\t\r\n\t\twhile(iterator.hasNext()){\r\n\t\t\tcam = (String)iterator.next();\r\n\t\t\tuser = cam.substring(0, cam.indexOf('@'));\r\n\t\t\tdomain = cam.substring(cam.indexOf('@') + 1);\r\n\t\t \r\n\t\t\ttry {\r\n\t\t\t\t sipCon = getSipManager().createMessageSipConexion(user,domain);\r\n\t\t\t} catch (ExcGeneric e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tgetSipManager().sendMessageRequest(sipCon);\r\n\t\t\t\tli = new ListItem(Color.white, cam);\r\n\t\t\t\tli.setIcon(new ImageIcon(getClass().getResource(\"img\" + File.separator + \"connected.gif\")));\r\n \r\n\t\t \t\t\t\r\n\t\t\t} catch (ExcGeneric e) {\r\n\t\t\t\tli = new ListItem(Color.LIGHT_GRAY, cam);\r\n\t\t\t\tli.setIcon(new ImageIcon(getClass().getResource(\"img\" + File.separator + \"delete.gif\")));\r\n\t\t }\r\n\t\t\tmodel.addElement(li);\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif (jListCamaras == null) {\r\n\t\t\tjListCamaras = new JList(model);\r\n\t\t\tjListCamaras.setCellRenderer(new MyCellRenderer());\r\n\t\t\tjListCamaras.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));\r\n\t\t\tjListCamaras.addMouseListener(this);\r\n\t\t\r\n\t\t}else{\r\n\t\t\tjListCamaras.clearSelection();\r\n\t\t jListCamaras.setModel(model);\r\n\t\t\tjListCamaras.setEnabled(true);\r\n\t\t\tjListCamaras.repaint();\r\n\t\t}\r\n\t\treturn jListCamaras;\r\n\t}", "public void mostrarlistafininicio(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = fin;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")->\";\n auxiliar = auxiliar.ant;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de fin a inicio\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public List<Lv1p2> listar()\n {\n \n List<Lv1p2> lista = new ArrayList<Lv1p2>();\n String sql = \"SELECT * FROM lv1p2\";\n PreparedStatement pst = Conexao.getPreparedStatement(sql);\n \n try {\n //Executo o aql e jogo em um resultSet\n ResultSet res = pst.executeQuery();\n //Eqaunto tiver REGISTRO eu vou relacionar\n //com a minha classe Jogador e adicionar na lista \n while(res.next())\n {\n Lv1p2 lv1p2 = new Lv1p2();\n lv1p2.setLota_pro(res.getDouble(\"lota_pro\"));\n lv1p2.setUsuario_id(res.getInt(\"usuario_id\"));\n lv1p2.setVacadecria(res.getInt(\"vaca_de_cria\"));\n lv1p2.setVacadedescarte(res.getInt(\"vaca_de_descarte\"));\n lv1p2.setTerneiro(res.getInt(\"terneiro\"));\n lv1p2.setTerneira(res.getInt(\"terneira\"));\n lv1p2.setNovilho1324(res.getInt(\"novilho_13a24\"));\n lv1p2.setNovilha1324(res.getInt(\"novilha_13a24\"));\n lv1p2.setNovilho2536(res.getInt(\"novilho_25a36\"));\n lv1p2.setNovilha2536(res.getInt(\"novilha_25a36\"));\n lv1p2.setNovilho36(res.getInt(\"novilho_36\"));\n lv1p2.setTouro(res.getInt(\"touro\"));\n lv1p2.setRebanhodecria(res.getInt(\"rebanho_de_cria\"));\n lista.add(lv1p2);\n }\n } catch(SQLException ex){\n \n ex.printStackTrace();\n }\n return lista;\n }", "public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }", "public void listarTodosLosVideojuegosRegistrados()\n {\n System.out.println(\"Videojuegos disponibles: \");\n for(Videojuegos videojuego : listaDeVideojuegos) {\n System.out.println(videojuego.getDatosVideojuego());\n }\n }", "@Override\n public void HienThiDanhSach(List<DienTu> listdienTu) {\n\n }", "public void MostrarListaInicioFin() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=inicio;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.siguiente;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public pfcGuiLlistaPacients() { \n \n this.llistaPacientsModel = new javax.swing.DefaultListModel();\n initComponents(); \n centraFormulari(); \n \n }", "public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }", "public void listeDesEmpruntsEnCours();", "public List<Lingua> creaListaLingue() {\n \n List<Lingua> list = linguaFacade.getLingue();\n return list;\n }", "@Override\n\tpublic List<Tramite_informesem> lista() {\n\t\treturn tramite_informesemDao.lista();\n\t}", "public LlistaPistes() {\n _llistaPistes = new ArrayList();\n }", "public void afficherListe(){\n StringBuilder liste = new StringBuilder(\"\\n\");\n logger.info(\"OUTPUT\",\"\\nLes produits en vente sont:\");\n for (Aliment aliment : this.productList) { liste.append(\"\\t\").append(aliment).append(\"\\n\"); }\n logger.info(\"OUTPUT\", liste+\"\\n\");\n }", "public void displayVragenlijst() {\n List<Vragenlijst> vragenlijst = winkel.getVragenlijst();\n\n System.out.println(\"Kies een vragenlijst: \");\n\n for (int i = 0; i < vragenlijst.size(); i++) {\n System.out.println((i + 1) + \". \" + vragenlijst.get(i));\n }\n }", "@Override\n\tpublic List<JabatanModel> listJabatan() {\n\t\treturn jabatanDb.findAll();\n\t}", "List<Vehiculo>listar();", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tsetContentView(R.layout.yoneticiler_liste);\n\t\tActivityBar.getInstance().connectToActivity(this);\n\t\t\n\t\tIntent intent=getIntent();\n\t\tBundle args=intent.getExtras();\n\t\t//istek=args.getInt(\"istek\");\n\t\tistek=0;\n\t\t\n\t\tCHPListe gelenVeri=(CHPListe)args.getSerializable(\"gelenListe\");\n\t\t\n\t\trootList=gelenVeri;\n\t\t\n\t\tSystem.out.println(\"GElenListe: \"+gelenVeri.getName());\n\t\t\n\t\tSystem.out.println(\"YöneticiListeGelen\"+istek);\n\t\t\n\t\t\n\t\tbaslik=(TextView)findViewById(R.id.tvBaslik);\n\t\tif(gelenVeri.getHeader().equals(\"null\"))\n\t\t\tbaslik.setText(gelenVeri.getName().toString().trim());\n\t\telse\n\t\t\tbaslik.setText(gelenVeri.getHeader().toString().trim());\n\t\t\n\t\tbaslik.setGravity(Gravity.CENTER);\n\n//\t\tif(KisiListesi.getYoneticiListesi().size()==0)\n//\t\t\tSystem.out.println(\"YöneticilerListe 0\");\n//\t\telse\n//\t\t\tSystem.out.println(\"YöneticilerListe 1: \"+KisiListesi.getYoneticiListesi().size());\n\t\t\n\t\t\n\t\ttry{\n\t\t/*\n\t\t\tyoneticiler=KisiListesi.getYoneticiListesi().get(unvanlar.get(istek));\n\t\t\tlisteId=yoneticiler.keySet().toArray();\n\t\t\n\t\t\tyoneticiBilgileri=KisiListesi.getBilgiler();\n\t\t\n\t\t\tArrayList<YoneticiKayit> yoneticiKayitlari=new ArrayList<YoneticiKayit>();\n\t\t\tString[] sadeceIsimlerListesi=new String[listeId.length];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<listeId.length;i++){\n\t\t\t\tString isim=yoneticiBilgileri.get(listeId[i]).getIsim();\n\t\t\t\tString unvan=null;\n\t\t\t\t\n\t\t\t\tsadeceIsimlerListesi[i]=isim;\n\t\t\t\t\n\t\t\t\tString aranacakUnvan = null;\n\t\t\t\t\n\t\t\t\tif(istek>3){\n\t\t\t\tswitch (istek) {\n\t\t\t\tcase 4:\n\t\t\t\t\taranacakUnvan=\"Milletvekili\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\taranacakUnvan=\"�l Ba�kan�\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\taranacakUnvan=\"�l�e Ba�kan�\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\taranacakUnvan=\"B�y�k�ehir Belediye Ba�kan�\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\taranacakUnvan=\"�l Belediye Ba�kan�\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\taranacakUnvan=\"�l�e Belediye Ba�kan�\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tArrayList<String> unvanlar=yoneticiBilgileri.get(listeId[i]).getUnvan();\n\t\t\t\t\n\t\t\t\tfor(int a=0; a<unvanlar.size();a++){\n\t\t\t\t\t\n\t\t\t\t\tint sorguSonuc=unvanlar.get(a).lastIndexOf(aranacakUnvan);\n\t\t\t\t\tif(sorguSonuc>-1){\n\t\t\t\t\t\tunvan=unvanlar.get(a);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tYoneticiKayit kayit=new YoneticiKayit(isim, unvan);\n\t\t\t\tyoneticiKayitlari.add(kayit);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t*/\n\t\t\n\t\t//System.out.println(\"Kay�t edilmi� listenin boyutu: \"+yoneticiKayitlari.size());\n\t\tliste=(ListView)findViewById(R.id.lvListeYL);\n\t\t\n\t\t\n\t\tCHPListAdapter adapter=new CHPListAdapter(this,R.layout.yonticiler_sablon,R.id.tvUnvanlar, gelenVeri.getContent());\n\t\tliste.setAdapter(adapter);\n\t\t\n\t\t\n//\t\tArrayAdapter<String> adapter=new ArrayAdapter<String>(YoneticilerListe.this,R.layout.yonticiler_sablon,R.id.tvUnvanlar, sadeceIsimlerListesi);\n//\t\t\n//\t\tYoneticiBilgileriAdapter adapterUnvanli=new YoneticiBilgileriAdapter(this,android.R.layout.simple_list_item_1,yoneticiKayitlari);\n\t\t\n//\t\tif(istek<=3)\n//\t\t\tliste.setAdapter(adapter);\n//\t\telse\n//\t\t\tliste.setAdapter(adapterUnvanli);\n//\t\t\n\t\t//System.out.println(\"Adapter olu�turuldu: \"+yoneticiKayitlari.size());\n\t\tliste.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(((CHPListe)rootList).getContent().get(arg2).getType().equals(\"list\")){\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"********TYPE\"+(((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().get(0).getType()));\n\t\t\t\t\tSystem.out.print(\"****Tıklanan listenin uzunluğu: \"+((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().size());\n\t\t\t\t\tif(((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().size()!=1 ){\n\t\t\t\t\t\tIntent i=new Intent(YoneticilerListe.this, YoneticilerListe.class); // this; yonlendirmenin yap�ld��� activity. \n\t\t\t\t\t\ti.putExtra(\"gelenListe\", ((CHPListe)rootList).getContent().get(arg2));\n\t\t\t\t\n\t\t\t\t\t\tstartActivityForResult(i, 0);\n\t\t\t\t\t\t//startActivity(i);\n\t\t\t\t\t}\n\t\t\t\t\telse if(((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().size()==1 && (((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().get(0).getType().equals(\"person\"))){\n\t\t\t\t\t\tistenenYoneticiId=((CHPPerson)((CHPListe)((CHPListe)rootList).getContent().get(arg2)).getContent().get(0)).getId();\n\t\t\t\t\t\tnew Servis().execute(istenenYoneticiId);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tistenenYoneticiId=((CHPPerson)((CHPListe)rootList).getContent().get(arg2)).getId();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"YöneticiListe tıklanan Yönetici ID: \"+istenenYoneticiId);\n\t\t\t\t\tnew Servis().execute(istenenYoneticiId);\n\t\t\t\t}\n//\t\t\t\ttiklanan=arg2;\n//\t\t\t\tistenenYoneticiId=(Integer) listeId[tiklanan];\n//\t\t\t\t\n//\t\t\t\t//System.out.println(\"Args: \"+tiklanan);\n//\t\t\t\t\n//\t\t\t\t\n//\t\t\t\t\t// Listeleri dolduruyoruz.\n//\t\t\t\t\n//\n//\t\t\t\t\tnew Servis().execute(istenenYoneticiId);\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Hata YöneticilerListe size\"+e.toString());\n\t\t\tbuilder = new AlertDialog.Builder(this);\n\t\t\t\n\t\t\t\t\t\tbuilder.setTitle(\"Bilgiler daha alınamadı\");\n\t\t\t\t\t\tbuilder.setMessage(\"İşlem tamamlanmadı.\");\n\t\t\t\n\t\t\t\t\t\tbuilder.setPositiveButton(\"Tamam\", new DialogInterface.OnClickListener() {\n\t\t\t\n\t\t\t\t\t\t public void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t \n\t\t\t\n\t\t\t\t\t\t dialog.dismiss();\n\t\t\t\t\t\t finish();\n\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tbuilder.create().show();\n\t\t}\n//\t\tfinally{\n//\t\t\t\n//\t\t\t\n//\t\t\tbuilder = new AlertDialog.Builder(this);\n//\n//\t\t\tbuilder.setTitle(\"Bağlantı?\");\n//\t\t\tbuilder.setMessage(\"Lütfen internet bağlantınızı kontrol edin.\");\n//\n//\t\t\tbuilder.setPositiveButton(\"Tamam\", new DialogInterface.OnClickListener() {\n//\n//\t\t\t public void onClick(DialogInterface dialog, int which) {\n//\t\t\t \n//\n//\t\t\t dialog.dismiss();\n//\t\t\t finish();\n//\t\t\t \n//\t\t\t }\n//\n//\t\t\t});\n//\t\t\t\n//\t\t\tbuilder.create().show();\n//\t\t}\n\t\t\n\t\t\n\t\t\n\t\t//System.out.println(\"Grountulenecek Liste: \"+goruntulenecekListe[0]+\", \"+goruntulenecekListe.length);\n\t\t\n\t\t\n\t\t\n\t}", "public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }", "private void ListForeignDatei () {\n\n ForeignDataDbSource foreignDataDbSource = new ForeignDataDbSource();\n\n List<ForeignData> foreignDataList= foreignDataDbSource.getAllForeignData();\n Log.d(LOG_TAG,\"=============================================================\");\n\n for (int i= 0; i < foreignDataList.size(); i++){\n String output = \"Foreign_ID_Node: \"+ foreignDataList.get(i).getUid() +\n //\"\\n Status: \"+ foreignDataList.get(i).isChecked() +\n \"\\n Foto ID: \"+ foreignDataList.get(i).getFotoId() +\n \"\\n Punkt X: \"+ foreignDataList.get(i).getPunktX() +\n \"\\n Punkt Y: \"+ foreignDataList.get(i).getPunktY() +\n \"\\n IP: \"+ foreignDataList.get(i).getForeignIp() ;\n\n Log.d(LOG_TAG, output);\n }\n Log.d(LOG_TAG,\"=============================================================\");\n }", "private void srediTabelu() {\n\n mtu = (ModelTabeleUlica) jtblUlica.getModel();\n ArrayList<Ulica> ulice = kontrolor.Kontroler.getInstanca().vratiUlice();\n mtu.setLista(ulice);\n\n }", "public void Listar() {\n try {\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n this.listaApelaciones.clear();\n setListaApelaciones(apelacionesDao.cargaApelaciones());\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void loadLists() {\n }", "public void listarProducto() {\n }", "public static void llenarListaProcesados() {\n List<String> lista = Datos.getInstance().getDocumentos();\n if (lista == null) {\n return;\n }\n modelProcesados.clear();\n for (String s : lista) {\n modelProcesados.addElement(s);\n }\n\n }", "private void lisaaMiinaOikealle(int i, int j) {\n ArrayList<Ruutu> lista;\n if (i + 1 < x) {\n lista = this.ruudukko[i + 1];\n lista.get(j).setViereisetMiinat(1);\n if (j - 1 >= 0) {\n lista.get(j - 1).setViereisetMiinat(1);\n }\n if (j + 1 < x) {\n lista.get(j + 1).setViereisetMiinat(1);\n }\n }\n }", "private JList getAnalyzaList() {\n\t\tif (analyzaList == null) {\n\t\t\tanalyzaList = new JList();\n\t\t\tanalyzaList.setBounds(new Rectangle(400, 100, 39, 27));\n\t\t}\n\t\treturn analyzaList;\n\t}", "@Override\n public List<Programador> list() {\n return memoryDataBank;//To change body of generated methods, choose Tools | Templates.\n }", "public ListaBrojeva izdvojElmenteNaParnimPozicijama() {\n if (prvi != null) {\n ListaBrojeva parni = new ListaBrojeva();\n \n Element tek = prvi;\n Element preth = null;\n Element parniKraj = null;\n int br = 0;\n \n while (tek.veza != null) {\n preth = tek;\n tek = tek.veza;\n \n if (br % 2 != 0) {\n preth.veza = tek.veza;\n if (parni.prvi == null) {\n parni.prvi = tek;\n parniKraj = tek;\n tek.veza = null; \n } else {\n parniKraj.veza = tek;\n tek.veza = null;\n parniKraj = parniKraj.veza;\n }\n tek = preth;\n }\n br++;\n }\n /*prvi element iz liste je paran, ali je preskocen, \n tako da ga sad izbacujemo iz liste i dodajemo u novu*/\n Element pom = prvi;\n prvi = prvi.veza;\n pom.veza = parni.prvi;\n parni.prvi = pom;\n return parni;\n }\n return null;\n }", "private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }", "public List<String> getListe()\n\t\t\t{\n\t\t\t\treturn personnes;\n\t\t\t}", "public void lisaaKomennot() {\n this.komennot.put(1, new TarkasteleListoja(1, \"Tarkastele listoja\", super.tallennetutTuotteet, super.tallennetutListat, this.io));\n this.komennot.put(2, new LisaaListalle(2, \"Lisää listalle\", super.tallennetutTuotteet, super.tallennetutListat, this.io));\n this.komennot.put(3, new PoistaListalta(3, \"Poista listalta\", super.tallennetutTuotteet, super.tallennetutListat, this.io));\n }", "public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }", "public Formkirim() {\n initComponents();\n JSONParser parser = new JSONParser();\n JSONObject jobj = null;\n JSONObject jobs = null;\n try { \n URL oracle = new URL(\"https://kodepos-2d475.firebaseio.com/list_propinsi.json?print=pretty\"); // URL to Parse\n URL kot = new URL(\"https://kodepos-2d475.firebaseio.com/list_kotakab/p9.json?print=pretty\");\n URLConnection yc = oracle.openConnection();\n BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));\n URLConnection ku = kot.openConnection();\n BufferedReader ta = new BufferedReader(new InputStreamReader(ku.getInputStream()));\n \n String inputLine;\n String jsonstr = \"\";\n String jsonkut = \"\";\n while ((inputLine = in.readLine()) != null) {\n jsonstr += inputLine;\n }\n while ((inputLine = ta.readLine()) != null) {\n jsonkut += inputLine;\n }\n jobj = (JSONObject) parser.parse(jsonstr);\n jobs = (JSONObject) parser.parse(jsonkut);\n System.out.println(\"jobj: \" + jobj);\n System.out.println(\"jobs: \"+ jobs);\n in.close();\n ta.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n } \n Prov.removeAllItems();\n for(Iterator iterator = jobj.keySet().iterator(); iterator.hasNext();) {\n String key = (String) iterator.next();\n Prov.addItem(jobj.get(key).toString());\n }\n Ko.removeAllItems();\n for(Iterator iterator = jobs.keySet().iterator(); iterator.hasNext();) {\n String key = (String) iterator.next();\n Ko.addItem(jobs.get(key).toString());\n }\n \n }", "public void listar()\n\t{\n\t\tdatabase.list().forEach(\n\t\t\t(entidade) -> { IO.println(entidade.print() + \"\\n\"); }\n\t\t);\n\t}", "private void ucitajTestPodatke() {\n\t\tList<Integer> l1 = new ArrayList<Integer>();\n\n\t\tRestoran r1 = new Restoran(\"Palazzo Bianco\", \"Bulevar Cara Dušana 21\", KategorijeRestorana.PICERIJA, l1, l1);\n\t\tRestoran r2 = new Restoran(\"Ananda\", \"Petra Drapšina 51\", KategorijeRestorana.DOMACA, l1, l1);\n\t\tRestoran r3 = new Restoran(\"Dizni\", \"Bulevar cara Lazara 92\", KategorijeRestorana.POSLASTICARNICA, l1, l1);\n\n\t\tdodajRestoran(r1);\n\t\tdodajRestoran(r2);\n\t\tdodajRestoran(r3);\n\t}", "public void loadLists() {\n Cursor cListas = getAllLists(); // Cursor en tabla listas\n Cursor cMovieList; // Cursor en tabla lista-pelicula\n Cursor cPeli; // Cursor en tabla peliculas a una película\n while (cListas.moveToNext()) {\n int id_list = cListas.getInt(cListas.getColumnIndex(ColumnList.ID_LIST));\n if (!Lista.existLista(id_list)) {\n Lista lista = new Lista(id_list,\n cListas.getString(cListas.getColumnIndex(ColumnList.NAME_LIST)),\n cListas.getString(cListas.getColumnIndex(ColumnList.DESCRIPTION_LIST)));\n cMovieList = getMoviesInList(cListas.getInt(cListas.getColumnIndex(ColumnList.ID_LIST)));\n while (cMovieList.moveToNext()) {\n cPeli = getMovie(cMovieList.getInt(cMovieList.getColumnIndex(ColumnMoviesList.ID_MOVIE)));\n if(cPeli.moveToNext())\n lista.addPelicula(getPelicula(cPeli.getString(cPeli.getColumnIndex(ColumnMovie.IMDBID))));\n cPeli.close();\n }\n cMovieList.close();\n }\n }\n cListas.close();\n }", "public void mostrarlistainicifin(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = inicio;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")<=>\";\n auxiliar = auxiliar.sig;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de inicio a fin\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public void listNens() {\n\t\t\tEntityManager em = emf.createEntityManager();\n\t\t\tem.getTransaction().begin();\n\t\t\tList<Nen> result = em.createQuery(\"from nen\", Nen.class)\n\t\t\t\t\t.getResultList();\n\t\t\tfor (Nen a : result) {\n\t\t\t\tSystem.out.println(a.toString());\n\t\t\t}\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\t\n\t\t}", "public List<Mobibus> darMobibus();", "private void genererListeView() {\n\n displayToast(\"Antall treff: \" + spisestedListe.size());\n\n //sorterer alfabetisk på navn\n Collections.sort(spisestedListe);\n\n spisestedAdapter = new SpisestedAdapter(this, spisestedListe);\n recyclerView.setAdapter(spisestedAdapter);\n\n //henter inn antall kolonner fra values, verdi 2 i landscape\n // https://stackoverflow.com/questions/29579811/changing-number-of-columns-with-gridlayoutmanager-and-recyclerview\n int columns = getResources().getInteger(R.integer.list_columns);\n recyclerView.setLayoutManager(new GridLayoutManager(this, columns));\n }", "public void chargeListe(){\n jCbListeEtablissement.removeAllItems();\n String sReq = \"From Etablissement\";\n Query q = jfPrincipal.getSession().createQuery(sReq);\n Iterator eta = q.iterate();\n while(eta.hasNext())\n {\n Etablissement unEtablissement = (Etablissement) eta.next();\n jCbListeEtablissement.addItem(unEtablissement.getEtaNom());\n }\n bChargeListe = true;\n }", "public List<JsonObject> notasDeVentas(){\n String nv[][]= pedidoMaterialRepository.buscarNotaVenta();\n List<JsonObject> js = new ArrayList<JsonObject>();\n \n for (int i=0;i<nv.length;i++){\n \n JsonObject jo = new JsonObject();\n jo.put(\"notaDeVenta\", nv[i][0]);\n jo.put(\"descripcion\", nv[i][1]);\n jo.put(\"cliente\", nv[i][2]);\n js.add(jo);\n }\n \n return js;\n }", "public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}", "List<Videogioco> retriveByPiattaforma(String piattaforma);", "public List<Location> listarPorAnunciante() throws SQLException {\r\n \r\n //OBJETO LISTA DE COMODOS\r\n List<Location> enderecos = new ArrayList<>(); \r\n \r\n //OBJETO DE CONEXÃO COM O BANCO\r\n Connection conn = ConnectionMVC.getConnection();\r\n \r\n //OBJETO DE INSTRUÇÃO SQL\r\n PreparedStatement pStatement = null;\r\n \r\n //OBJETO CONJUNTO DE RESULTADOS DA TABELA IMOVEL\r\n ResultSet rs = null;\r\n \r\n try {\r\n \r\n //INSTRUÇÃO SQL DE LISTAR IMÓVEIS\r\n pStatement = conn.prepareStatement(\"select * from pessoa inner join anuncio inner join imagem inner join imovel inner join location inner join comodo\");\r\n \r\n //OBJETO DE RESULTADO DA INSTRUÇÃO\r\n rs = pStatement.executeQuery();\r\n \r\n //PERCORRER OS DADOS DA INSTRUÇÃO\r\n while(rs.next()) {\r\n \r\n //OBJETO UTILIZADO PARA BUSCA\r\n Location endereco = new Location();\r\n \r\n //PARAMETROS DE LISTAGEM\r\n endereco.setCep(rs.getString(\"cep\"));\r\n endereco.setRua(rs.getString(\"rua\"));\r\n endereco.setNumero(rs.getInt(\"numero\"));\r\n endereco.setBairro(rs.getString(\"bairro\"));\r\n endereco.setCidade(rs.getString(\"cidade\"));\r\n endereco.setUf(rs.getString(\"uf\"));\r\n\r\n //OBJETO ADICIONADO A LISTA\r\n enderecos.add(endereco); \r\n }\r\n \r\n //MENSAGEM DE ERRO\r\n } catch (SQLException ErrorSql) {\r\n JOptionPane.showMessageDialog(null, \"Erro ao listar do banco: \" +ErrorSql,\"erro\", JOptionPane.ERROR_MESSAGE);\r\n\r\n //FINALIZAR/FECHAR CONEXÃO\r\n }finally {\r\n ConnectionMVC.closeConnection(conn, pStatement, rs);\r\n } \r\n return enderecos;\r\n }", "public String navigateDetalleHorarioList() {\r\n if (this.getSelected() != null) {\r\n FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"DetalleHorario_items\", this.getSelected().getDetalleHorarioList());\r\n }\r\n return \"/detalleHorario/index\";\r\n }", "private void carregaLista() {\n listagem = (ListView) findViewById(R.id.lst_cadastrados);\n dbhelper = new DBHelper(this);\n UsuarioDAO dao = new UsuarioDAO(dbhelper);\n //Preenche a lista com os dados do banco\n List<Usuarios> usuarios = dao.buscaUsuarios();\n dbhelper.close();\n UsuarioAdapter adapter = new UsuarioAdapter(this, usuarios);\n listagem.setAdapter(adapter);\n }", "public 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 }", "public void index() {\n\t\t\n\t\tList<Filme> preferencias = new ArrayList<Filme>();\n\t\tfor( Map.Entry<Key, Integer> entry : session.getUsuario().getPreferencias().entrySet()){\n\t\t\tFilme tmp = filmeDao.getById(entry.getKey());\n\t\t\ttmp.setVotos(entry.getValue());\n\t\t\tpreferencias.add(tmp);\n\t\t}\n\t\t\n\t\t// passando todos os filmes, o usuário e as preferencias dele\n\t\tresult.include(\"filmes\", filmeDao.getAllInOrder() );\n\t\tresult.include(\"usuario\", session.getUsuario() );\n\t\tresult.include(\"preferencias\", preferencias);\n\t}", "public List<Vendedor> listarVendedor();", "private static void listMovies(){\n\n\t\ttry{\n\t\t\tURL url = new URL(\"http://localhost:8080/listMovies\");\n\t\t\tString rawJSONList = getHTTPResponse(url);\n\t\t\tJSONArray JSONList = new JSONArray(rawJSONList);\n\t\t\tStringBuilder list = new StringBuilder();\n\t\t\t\n\t\t\tfor (int i=0 ; i<JSONList.length() ; i++){\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tJSONObject temp = JSONList.getJSONObject(i);\n\t\t\t\tsb.append(temp.getInt(\"id\"));\n\t\t\t\tsb.append(\". \");\n\t\t\t\tsb.append(temp.getString(\"name\"));\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\n\t\t\t\tlist.append(sb.toString());\n\t\t\t}\n\t\t\tSystem.out.println(list.toString());\n\t\t}catch(Exception e){System.out.println(\"Error - wrong input or service down\");}\n\t\t\n\t}", "@Override\r\n public List<Filme> getListaFilmes(){\r\n return listaFilme;\r\n }", "@Override\n\tpublic List<DpzsJjfzPojo> getList() {\n\t\treturn this.dpzsJjfzDao.getList();\n\t}", "private void list() throws JSONException, InterruptedException {\r\n\t /**Database Manager Object used to access mlab.com*/\r\n db.setDataBaseDestination(cDatabase, null, true);\r\n db.accessDatabase();\r\n MongoCollection<Document> col = db.getEntireDatabaseResults();\r\n \r\n // iterator to go through clubs in database\r\n Iterable<Document> iter;\r\n iter = col.find();\r\n \r\n // ArrayList of clubs names \r\n ArrayList<String> clubs = new ArrayList<>();\r\n \r\n // add names to list\r\n for (Document doc : iter) {\r\n JSONObject profile = new JSONObject(doc);\r\n clubs.add(profile.get(cName).toString());\r\n }\r\n \r\n Collections.sort(clubs);\r\n \r\n for (String name : clubs)\r\n \t logger.log(Level.INFO, name);\r\n \r\n displayOpen();\r\n }", "private void lisaaMiinaVasemmalle(int i, int j) {\n ArrayList<Ruutu> lista;\n if (i - 1 >= 0) {\n lista = this.ruudukko[i - 1];\n lista.get(j).setViereisetMiinat(1);\n if (j - 1 >= 0) {\n lista.get(j - 1).setViereisetMiinat(1);\n }\n if (j + 1 < x) {\n lista.get(j + 1).setViereisetMiinat(1);\n }\n }\n }", "void listarDadosNaTelaLivro(ArrayList<Livro> lista,DefaultTableModel model ) throws Exception {\n \n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[7];\n Livro aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+editora.recuperar(aux.getIdEditora());\n linha[2] = \"\"+autor.recuperar(aux.getIdAutor());\n linha[3] = \"\"+areaDeConhecimento.recuperar(aux.getIdAreaDeConhecimento());\n linha[4] = aux.getTituloDoLivro();\n linha[5] = \"\"+aux.getIsbn();\n model.addRow(linha);\n }\n }", "public Listas_simplemente_enlazada(){\r\n inicio=null; // este constructor me va servir para apuntar el elemento\r\n fin=null;\r\n }", "@Override\n\tpublic List<FestivalVO> festivalList() {\n\t\treturn sqlSession.selectList(\"com.project.app.festival.festivalList\");\n\t}", "public ArrayList<Player> getListaJugadores(){\n return listaJugadores;\n }" ]
[ "0.6865002", "0.68213093", "0.6739098", "0.6737896", "0.6619484", "0.64467776", "0.6410027", "0.6400275", "0.63571113", "0.6354842", "0.6351304", "0.63406044", "0.629157", "0.62682444", "0.626503", "0.6199742", "0.61811215", "0.6127937", "0.612419", "0.61144614", "0.61133933", "0.6098081", "0.60810256", "0.6078208", "0.6043865", "0.6025778", "0.6025655", "0.60051876", "0.6005152", "0.60045147", "0.59958255", "0.59879774", "0.59875333", "0.59752953", "0.5968782", "0.5967538", "0.59665775", "0.59518075", "0.5950569", "0.59421754", "0.5936416", "0.59358567", "0.59146905", "0.5911157", "0.59014714", "0.58998764", "0.5895437", "0.58939594", "0.5877128", "0.5868985", "0.58635604", "0.58512694", "0.58428407", "0.58427125", "0.58422744", "0.5837408", "0.5836362", "0.5835849", "0.58342624", "0.5829462", "0.58218014", "0.58198345", "0.5818412", "0.581514", "0.5807549", "0.57996255", "0.5793352", "0.5789787", "0.57764906", "0.5770503", "0.5759529", "0.5759255", "0.57592493", "0.5750716", "0.57373214", "0.57370114", "0.5733849", "0.5733748", "0.5727462", "0.57267493", "0.5725216", "0.57238156", "0.57220036", "0.57168245", "0.57157636", "0.57048434", "0.57037467", "0.5701313", "0.570065", "0.5700387", "0.56921935", "0.5688527", "0.56879765", "0.56826055", "0.56754655", "0.5665795", "0.56646496", "0.56618214", "0.56559193", "0.56557137", "0.5653466" ]
0.0
-1
Implementation of ALPHABETA Game Search
@Override public Play searchAndSelect(State currState, Evaluation eval, int depthLimit, int playerNum) { if (currState == null || eval == null) { throw new IllegalArgumentException("State and Evaluation can not be null"); } if (playerNum != 1 && playerNum != 2) { throw new IllegalArgumentException("playerNum must be either 1 or 2"); } int searchCount = 0; Map<Move, State> successors = currState.getSuccessors(); Move selectedMove = null; int alpha = Integer.MIN_VALUE; int beta = Integer.MAX_VALUE; if (playerNum == 1) { for (Move m : successors.keySet()) { searchCount++; StateValueAB moveValue = maxValue(successors.get(m), eval, depthLimit, depthLimit, alpha, beta); searchCount += moveValue.getSearchCount(); if (moveValue.getAlpha() > alpha) { alpha = moveValue.getAlpha(); selectedMove = m; } } } else { for (Move m : successors.keySet()) { searchCount++; StateValueAB moveValue = minValue(successors.get(m), eval, depthLimit, depthLimit, alpha, beta); searchCount += moveValue.getSearchCount(); if (moveValue.getBeta() < beta) { beta = moveValue.getBeta(); selectedMove = m; } } } return new Play(selectedMove, successors.get(selectedMove), searchCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] search() {\n\t\t\n\t\troot.setScore(0);\n\t\tleaves = 0;\n\t\t\n\t\t/*\n\t\t * Interrupt the think() thread so we can have the updated game tree\n\t\t */\n\t\t\n\t\tString[] move = new String[2];\n\t\t\n\t\t// Find the max or min value for the white or black player respectively\n\t\tfloat val = alphaBeta(root, max_depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, player);\n\t\t\n\t\t// Retrieve the move that has the min/max vlaue\n\t\tArrayList<Node> moves = root.getChildren();\n\t\tfor(Node n : moves) {\n\t\t\tif(Float.compare(n.value, val) == 0) {\n\t\t\t\tint[] m = new int[6];\n\t\t\t\tint encodedM = n.move;\n\t\t\t\t\n\t\t\t\t// Decode the move\n\t\t\t\tfor(int i = 0; i < 6; i++) {\n\t\t\t\t\tm[i] = encodedM & 0xf;\n\t\t\t\t\tencodedM >>= 4;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Convert the array into a string array with the format [0] => \"a7-b7\", [1] => \"b5\"\n\t\t\t\tmove[0] = ((char)(m[0] + 97)) + \"\" + (m[1]) + \"-\" + ((char)(m[2] + 97)) + \"\" + (m[3]);\n\t\t\t\tmove[1] = ((char)(m[4] + 97)) + \"\" + (m[5]);\n\t\t\t\t\n\t\t\t\t// Play the move on the AI's g_board, set the root to this node and break out of the loop\n\t\t\t\tg_board.doMove(n.move);\n\t\t\t\t\n\t\t\t\t// Reset the root rather than set it to a branch since we can currently only achieve a depth of 2-ply\n\t\t\t\troot.getChildren().clear();\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(leaves <= 2000) {\n\t\t\tmax_depth++;\n\t\t}\n\t\t\n\t\t/*\n\t\t * Start the think() thread\n\t\t */\n\t\t\n\t\treturn move;\n\t}", "public Vector<PuzzleState> aStarSearch() {\r\n System.out.println(\"Starting A*\");\r\n long startTime = (new Date()).getTime();\r\n Vector<PuzzleState> solution = new Vector<PuzzleState>();\r\n HashSet<PuzzleState> closedList = new HashSet<PuzzleState>();\r\n PriorityQueue<PuzzleState> openList = new PriorityQueue<PuzzleState>();\r\n \r\n PuzzleState searchState = state.copy();\r\n searchState.prevState = null;\r\n searchState.depth = 0;\r\n openList.add(searchState);\r\n\r\n while (!openList.isEmpty() && !isGoal(searchState)) {\r\n searchState = openList.poll();\r\n if (!closedList.contains(searchState)) {\r\n closedList.add(searchState);\r\n Vector<PuzzleState> nextStates = possibleNextStates(searchState);\r\n for (PuzzleState s : nextStates)\r\n s.depth = searchState.depth + 1;\r\n openList.addAll(nextStates);\r\n }\r\n }\r\n \r\n // If the goal has been reached, construct the solution\r\n if (isGoal(searchState)) {\r\n for (PuzzleState s = searchState; s.prevState != null; s = s.prevState) {\r\n solution.add(s);\r\n }\r\n Collections.reverse(solution);\r\n }\r\n \r\n long endTime = (new Date()).getTime();\r\n System.out.println(\"A* search ended after \" + (endTime - startTime) + \" ms\");\r\n //for (PuzzleState s : solution)\r\n // System.out.println(s);\r\n return solution;\r\n }", "private static void task22(int nUMS, AVLTree<Integer> h) {\n\t\t\n\t\tSystem.out.println(\"AVL Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (h.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t\t\n\t}", "private Move alphaBetaSearch(Node state) {\n\t\t\n\t\tint v = this.maxValue(state, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t\t\n\t\tthis.nodesExplored--;\n\t\tthis.nodesExploredThisTurn--;\n\t\t\n\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\treturn this.bestMoveSoFar;\n\t\t}\n\n\t\tif (Math.abs(v) == Integer.MAX_VALUE / 2 || Math.abs(v) == Math.abs(Integer.MIN_VALUE / 2) ) {\n\t\t\t\n\t\t\tthis.isEndGameStatusFound = true;\n\t\t\treturn state.getBestMove();\n\t\t}\n\t\t\n\t\treturn state.getBestMove();\n\t}", "public String[] search(boolean hybrid) {\n\t\t/*\n\t\t * Interrupt the think() thread so we can have the updated game tree\n\t\t */\n\t\t\n\t\t// MCTS and minimax response vars, respectively\n\t\tint[] response = null;\n\t\tString[] move = new String[2];\n\t\tint encodedM = 0;\n\t\tint[] m = new int[6];\n\t\t\n\t\tif(mcts) {\n\t\t\tmctsBoard = createBoard(g_board.getBoard());\n\t\t\tresponse = mcts();\n\t\t} else {\n\t\t\troot.setScore(0);\n\t\t\tleaves = 0;\n\t\t\t\n\t\t\t// Find the max or min value for the white or black player respectively\n\t\t\tfloat val = alphaBeta(root, max_depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, player);\n\t\t\t\n\t\t\t// Retrieve the move that has the min/max vlaue\n\t\t\tArrayList<Node> moves = root.getChildren();\n\t\t\tfor(Node n : moves) {\n\t\t\t\tif(Float.compare(n.value, val) == 0) {\n\t\t\t\t\tencodedM = n.move;\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI's g_board, set the root to this node and break out of the loop\n\t\t\t\t\tg_board.doMove(n.move);\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Switch to Monte Carlo after a set amount of moves\n\t\t\tturns += 2;\n\t\t\tif(turns > 40) {\n\t\t\t\tmcts = true;\n\t\t\t\tfirstMoves = new ArrayList<Node>();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Reset the root rather than set it to a branch since we can currently only achieve a depth of 2-ply\n\t\troot.getChildren().clear();\n\t\t\n\t\t// If we ran MCTS\n\t\tif(response != null) {\n\t\t\tencodedM = response[0];\n\t\t\tSystem.out.println(\"Simulations run: \" + response[3] + \"\\tConfidence: \" + response[1] + \"%\");\n\t\t}\n\t\t\n\t\t// Decode the move\n\t\tfor(int i = 0; i < 6; i++) {\n\t\t\tm[i] = encodedM & 0xf;\n\t\t\tencodedM >>= 4;\n\t\t}\n\t\t\n\t\t// Convert the array into a string array with the format [0] => \"a7-b7\", [1] => \"b5\"\n\t\tmove[0] = ((char)(m[0] + 97)) + \"\" + (m[1]) + \"-\" + ((char)(m[2] + 97)) + \"\" + (m[3]);\n\t\tmove[1] = ((char)(m[4] + 97)) + \"\" + (m[5]);\n\t\t\n\t\t/*\n\t\t * Start the think() thread\n\t\t */\n\t\t\n\t\treturn move;\n\t}", "public void search(int[] a, int x) {\r\n\t\tlang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\t\t// Create Array: coordinates, data, name, display options,\r\n\t\t// default properties\r\n\t TextProperties headerProps = new TextProperties();\r\n\t headerProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\r\n\t Font.SANS_SERIF, Font.BOLD, 24));\r\n\t\tText title = lang.newText(new Coordinates(20,30), \"Exponential Search\",\"titel\", null, headerProps);\r\n\t\t\r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.CYAN);\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect = lang.newRect(new Offset(-5, -5, \"titel\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(5, 5, \"titel\", \"SE\"), \"hRect\",\r\n\t null, rectProps);\r\n//\t title.show();\r\n//\t hRect.show();\r\n\t\t\r\n\t\t//Rectangle header = lang.newRect(new Offset(-5, -5), lowerRight, name, display);\r\n\t\tText title_discr = lang.newText(new Coordinates(20, 80), \"Beschreibung des Algorithmus\",\"discr\", null);\r\n\t\tSourceCode discription = lang.newSourceCode(new Coordinates(20, 110),\"beschreibung\",null);\r\n\t\tdiscription.addCodeLine(\"Der Algorithmus in Worten:\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"1. Finde den Bereich, in dem das Element vorhanden ist, indem man mit exponentialen Schritten durch das Array iteriert.\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"2. Führe eine binäre Suche in oben gefundenen Bereich durch.\", null, 0, null);\r\n\t\t\r\n//\t\tMultipleSelectionQuestionModel mulQuestion = new MultipleSelectionQuestionModel(\"1\");\r\n//\t\tmulQuestion.setPrompt(\"Welcher Algorithmus wird oder welche Algorithmen werden im ExponentialSearch verwendet?\");\r\n//\t\tmulQuestion.setNumberOfTries(1);\r\n//\t\tmulQuestion.addAnswer(\"Exponentialsearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"FindNearestNeighbour\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Binarysearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Linearsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Skipsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"BruteForce\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\t\r\n//\t\tlang.addMSQuestion(mulQuestion);\r\n\t\t\r\n\t\tlang.nextStep(\"Einleitung\");\r\n\t\tTrueFalseQuestionModel trueFalseQ1 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ1.setPrompt(\"Exponentialsearch Algorithmus benutzt den Binarysearch Algorithmus.\");\r\n\t\tlang.addTFQuestion(trueFalseQ1);\r\n\t\t\r\n\t\tTrueFalseQuestionModel trueFalseQ2 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ2.setPrompt(\"Das Array muss sortiert sein.\");\r\n\t\tlang.addTFQuestion(trueFalseQ2);\r\n\r\n\t\ttitle_discr.hide();\r\n\t\tdiscription.hide();\r\n\t\t\r\n\t\tText t1 = lang.newText(new Coordinates(20, 80), \"Die zu suchende Zahl:\", \"suchende Zahl\", null);\r\n\t\tText t2 = lang.newText(new Coordinates(20, 100), \"x = \" + x, \"suchende Zahl\", null);\r\n\t\tText t3 = lang.newText(new Coordinates(20, 120), \"Das sortierte Array:\", \"sortierte Array\", null);\r\n\t\tText yellow = lang.newText(new Coordinates(180, 80), \"Gelb: von binären Suche geteilte Array\", \"yellow\", null);\r\n\t\t\r\n\t RectProperties rectProps2 = new RectProperties();\r\n\t rectProps2.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps2.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.YELLOW);\r\n\t rectProps2.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect2 = lang.newRect(new Offset(-1, -1, \"yellow\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"yellow\", \"SE\"), \"hRect2\",\r\n\t null, rectProps2);\r\n\t\tText red = lang.newText(new Coordinates(180, 100), \"Rot: Element in Array[i]\", \"red\", null);\r\n\t\t\r\n\t RectProperties rectProps3 = new RectProperties();\r\n\t rectProps3.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps3.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.RED);\r\n\t rectProps3.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect3 = lang.newRect(new Offset(-1, -1, \"red\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"red\", \"SE\"), \"hRect3\",\r\n\t null, rectProps3);\t \r\n\t \r\n\t \r\n\t\t// first, set the visual properties (somewhat similar to CSS)\r\n\t\tArrayProperties arrayProps = new ArrayProperties();\r\n\t\tarrayProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.WHITE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, Boolean.TRUE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMENTCOLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMHIGHLIGHT_PROPERTY, Color.RED);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.CELLHIGHLIGHT_PROPERTY, Color.YELLOW);\r\n\r\n\t\t// now, create the IntArray object, linked to the properties\r\n\t\tIntArray ia = lang.newIntArray(new Coordinates(20, 140), a, \"intArray\", null, arrayProps);\r\n\r\n\t\t\r\n\t\t\r\n//\t COUNTER\r\n\t String[] name = {\"Zuweisungen\",\"Zugriffe\"};\r\n\t\tTwoValueCounter counter = lang.newCounter(ia); // Zaehler anlegen\r\n\t CounterProperties cp = new CounterProperties(); // Zaehler-Properties anlegen\r\n\t cp.set(AnimationPropertiesKeys.FILLED_PROPERTY, true); // gefuellt...\r\n\t cp.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.BLUE); // ...mit Blau\r\n\t // view anlegen, Parameter:\r\n\t // 1. Counter\r\n\t // 2. linke obere Ecke (kann auch Offset nutzen!)\r\n\t // 3. CounterProperties\r\n\t // 4. Anzeige Zaehlerwert als Zahl?\r\n\t // 5. Anzeige Zaehlerwert als Balken?\r\n\t // Alternativ: nur Angabe Counter, Koordinate und Properties\r\n\t TwoValueView view = lang.newCounterView(counter, new Coordinates(260, 30), cp, true, true, name);\r\n\t\t// start a new step after the array was created\r\n\t \r\n\t\tlang.nextStep(\"Initialisierung\");\r\n\t\t\r\n\r\n\t\t// Create SourceCode: coordinates, name, display options,\r\n\t\t// default properties\r\n\r\n\t\t// first, set the visual properties for the source code\r\n\t\tSourceCodeProperties scProps = new SourceCodeProperties();\r\n\t\tscProps.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, Color.BLUE);\r\n\t\tscProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", Font.PLAIN, 12));\r\n\r\n\t\tscProps.set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, Color.RED);\r\n\t\tscProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\r\n\t\t// now, create the source code entity\r\n\t\tSourceCode sc = lang.newSourceCode(new Coordinates(40, 180), \"sourceCode\", null, scProps);\r\n\r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"public int exponentialSearch(int[] arr, int n, int x) {\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 1\r\n\r\n\t\tsc.addCodeLine(\"if (arr[0] == x) \", null, 1, null); // 2\r\n\t\tsc.addCodeLine(\"return 0;\", null, 2, null); // 3\r\n\t\tsc.addCodeLine(\" \", null, 1, null); // 4\r\n\r\n\t\tsc.addCodeLine(\"int i = 1;\", null, 1, null); // 5\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 6\r\n\r\n\t\tsc.addCodeLine(\"while (i < n && arr[i] <= x) \", null, 1, null); // 7\r\n\t\tsc.addCodeLine(\"i = i*2;\", null, 2, null); // 8\r\n\t\tsc.addCodeLine(\" \", null, 4, null); // 9\r\n\r\n\t\tsc.addCodeLine(\"return Arrays.binarySearch(arr, i/2, Math.min(i, n), x); \", null, 1, null); // 10\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 11\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 12\r\n\r\n\t\tsc.addCodeLine(\"public int binarySearch(int[] arr, int left, int right, int x) {\", null, 0, null); // 13\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 14\r\n\t\tsc.addCodeLine(\"if (right >= 1 && left <= right) {\", null, 1, null); // 15\r\n\t\tsc.addCodeLine(\"int mid = (left + right) / 2;\", null, 2, null); // 16\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 17\r\n\t\tsc.addCodeLine(\"if (arr[mid] == x)\", null, 2, null); // 18\r\n\t\tsc.addCodeLine(\"return mid;\", null, 3, null); // 19\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 20\r\n\t\tsc.addCodeLine(\"if (arr[mid] > x)\", null, 2, null); // 21\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, left, mid-1, x);\", null, 3, null); // 22\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 23\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, mid+1, right, x);\", null, 2, null); // 24\r\n\t\tsc.addCodeLine(\"}\", null, 1, null); // 25\r\n\t\tsc.addCodeLine(\"return -1;\", null, 1, null); // 26\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 27\r\n\r\n\t\tlang.nextStep();\r\n\t\t// Highlight all cells\r\n\t\tia.highlightCell(0,ia.getLength()-1, null, null);\r\n\t\tint foundIndex = -1;\r\n\t\ttry {\r\n\t\t\t// Start Exp. Search\r\n\t\t\tfoundIndex = exponentialSearch(ia, sc, (ia.getLength() - 1), x);\r\n\t\t} catch (LineNotExistsException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tTextProperties textProp = new TextProperties();\r\n\t\t//textProp.set(AnimationPropertiesKeys.SIZE_PROPERTY, 40);\r\n\t\tText t4 = lang.newText(new Coordinates(400, 80), \"Die Zahl \"+ x + \" befindet sich in Index \" + foundIndex, \"Ende\", null, textProp);\r\n\t\tlang.nextStep();\r\n\t\tt1.hide();\r\n\t\tt2.hide();\r\n\t\tt3.hide();\r\n\t\tt4.hide();\r\n\t\tsc.hide();\r\n\t\tia.hide();\r\n\t\tyellow.hide();\r\n\t\tred.hide();\r\n\t\thRect2.hide();\r\n\t\thRect3.hide();\r\n\t\t\r\n\t\tText t5 = lang.newText(new Coordinates(20, 80), \"Zusammenfassung\", \"zusammenfassung\", null);\r\n\t\tSourceCode zsmf = lang.newSourceCode(new Coordinates(20, 110), \"zsmf\", null, scProps);\r\n\t\tzsmf.addCodeLine(\"1. Exponentielle Suche ist nützlich für die unbegrenzte Suche, wo die Größe vom Array gegen unendlich geht.\", null, 0, null);\r\n\t\tzsmf.addCodeLine(\"2. Die Performenz ist besser als die der en Suche für endlich große Arrays.\", null, 0, null);\r\n\t\t\r\n\t\tSourceCode zsmf2 = lang.newSourceCode(new Coordinates(20, 150), \"zsmf2\", null, scProps);\r\n\t\tzsmf2.addCodeLine(\"Komplexität in Abhängigkeit der Zeit:\", null, 0, null);\r\n\t\tzsmf2.addCodeLine(\"Worst-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Best-case - O(1)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Average-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Hinweis: i steht für den Index des gesuchten Elements.\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Es werden jeweils die Komplexität des ersten und des zweiten Algorithmus zusammenaddiert\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den exponentiellen Teil ist log(i).\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den en Teil ist aufgrund der Begrenzung nicht mehr log(n), sondern log(i), da log(2^(log(i)-1)) = log(i)-1 = O(log(i))\", null, 2, null);\r\n\r\n\r\n\t\tTrueFalseQuestionModel trueFalseQ3 = new TrueFalseQuestionModel(\"3\", false, 1);\r\n\t\ttrueFalseQ3.setPrompt(\"Das Array darf keine doppelten Elemente enthalten\");\r\n\t\tlang.addTFQuestion(trueFalseQ3);\r\n\r\n\t\tlang.nextStep(\"Fazit\");\r\n\t\tlang.finalizeGeneration();\r\n\t}", "public ArrayList<Anchor> findAnchors(){\n ArrayList<Anchor> anchors = new ArrayList<Anchor>();\n //BoardSpace[][] boardSpaces = Board.getInstance().getBoardSpaces(); this is now set from the outside because my solver is using the ai\n for (int row = 0 ; row < boardSpaces.length ; row ++){\n for (int col = 0 ; col < boardSpaces[0].length ; col ++){\n Tile exp = boardSpaces[row][col].getTile();\n if (exp != null){ //if no tile here\n\n int startCol = col;\n int endCol = col;\n\n //check how far left the word can go without collisions\n if (col > 0 && boardSpaces[row][col - 1].getTile() == (null)){\n while (startCol > 0){\n if (row != Constants.BOARD_DIMENSIONS - 1 && boardSpaces[row + 1][startCol - 1].getTile() != null){\n break;\n }\n if ( row != 0 && boardSpaces[row - 1][startCol - 1].getTile() != null){\n break;\n }\n if (startCol == 1){\n startCol--;\n break;\n }\n if (boardSpaces[row ][startCol -2].getTile() != null){\n break;\n }\n startCol--;\n }\n }\n\n //check how far right the word can go without collisions\n if (col < Constants.BOARD_DIMENSIONS - 1 && boardSpaces[row][col + 1].getTile() == null){\n while (endCol < Constants.BOARD_DIMENSIONS -1 ){\n\n if (row != Constants.BOARD_DIMENSIONS - 1 && boardSpaces[row + 1][endCol + 1].getTile() != null){\n break;\n }\n if ( row != 0 && boardSpaces[row - 1][endCol + 1].getTile() != null ){\n break;\n }\n if (endCol == Constants.BOARD_DIMENSIONS - 2){\n endCol++;\n break;\n }\n if (boardSpaces[row ][endCol + 2].getTile() != (null)){\n break;\n }\n endCol++;\n }\n }\n\n //add the horizontal anchors\n if (col - startCol > 0 && endCol - col > 0){ // words that can go left or right\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), col - startCol, endCol - col , true));\n } else {\n //if only one then we need to do additional checks\n if (col - startCol > 0){\n if (col < Constants.BOARD_DIMENSIONS - 1 && boardSpaces[row][col + 1].getTile() != (null)){ // words that can only go left I need to readd this later.\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), col - startCol, endCol - col , true));\n }\n }\n if (endCol - col > 0){\n if (col > 0 && boardSpaces[row][col - 1 ].getTile() != (null)){ // words that can only go right\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), col - startCol, endCol - col , true));\n }\n }\n }\n\n int startRow = row;\n int endRow = row;\n\n //check how high the word can go without collisions\n if (row > 0 && boardSpaces[row - 1][col].getTile() == null){\n while (startRow > 0){\n if (col < Constants.BOARD_DIMENSIONS - 1 && boardSpaces[startRow - 1][col + 1].getTile() != (null)){\n break;\n }\n if (col > 0 && boardSpaces[startRow - 1][col - 1].getTile() != (null)){\n break;\n }\n if (startRow == 1){\n startRow--;\n break;\n }\n if (boardSpaces[startRow - 2][col ].getTile() != (null)){\n break;\n }\n startRow--;\n }\n\n }\n\n //check how low the word can go without collisions\n if (row < Constants.BOARD_DIMENSIONS - 1 && boardSpaces[row + 1][col].getTile() == (null)){\n while (endRow < Constants.BOARD_DIMENSIONS -1){\n if (col < Constants.BOARD_DIMENSIONS - 1 && boardSpaces[endRow + 1][col + 1].getTile() !=(null)){\n break;\n }\n if (col > 0 &&\tboardSpaces[endRow + 1][col - 1].getTile() != (null)){\n break;\n }\n if (endRow == Constants.BOARD_DIMENSIONS - 2){\n endRow++;\n break;\n }\n if(boardSpaces[endRow + 2][col].getTile() != (null)){\n break;\n }\n\n endRow++;\n }\n }\n\n\n if (row - startRow > 0 && endRow - row > 0){\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), row - startRow, endRow - row, false));\n } else{//if only one then we need to do additional checks\n if (row - startRow > 0){ //words that can only go up I'm not using these yet because It's been causing bugs but I should fix this\n if (row < Constants.BOARD_DIMENSIONS-1 && boardSpaces[row+1][col].getTile() == (null)){\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), row - startRow, endRow - row, false));\n }\n }\n if (endRow - row > 0){ //words that can only go down\n if (row > 0 && boardSpaces[row-1][col].getTile() == (null)){\n anchors.add(new Anchor(row, col, boardSpaces[row][col].getTile(), row - startRow, endRow - row, false));\n }\n }\n }\n }\n }\n }\n return anchors;\n }", "public int alphabetaSearch(BoardState state, int maxDepth) {\n\t\tint[] pits = new int[6];\r\n\t\t\r\n\t\t// state to check moves\r\n\t\tBoardState move = state;\r\n\t\r\n\t\t// initializing the alpha and the beta value\r\n\t\tint alpha = Integer.MIN_VALUE;\r\n\t\tint beta = Integer.MAX_VALUE;\r\n\t\t\r\n\t\tint bestPit = 0;\r\n\r\n\t\t// for loop to get the SBE of the pits\r\n\t\tfor (int i = 0; i <= 5; i++) {\r\n\r\n\t\t\t// checking if the move is legal\r\n\t\t\tif (state.isLegalMove(1, i)) {\r\n\r\n\t\t\t\t// variable set to max since node at depth 1 is a max value\r\n\t\t\t\tint v = minValue(move.applyMove(1, i), maxDepth, maxDepth - 1, alpha, beta);\r\n\r\n\t\t\t\t// updating the alpha value based on our search\r\n\t\t\t\tif (v > alpha) {\r\n\t\t\t\t\talpha = v;\r\n\t\t\t\t\tbestPit = i;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// pruning\r\n\t\t\t\tif (beta <= alpha)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bestPit;\r\n\t}", "public ArrayList<Literal> lookAround(String agName){\r\n\t\tperceptModel = MapEnv.model;\r\n\t\tArrayList<Literal> lookArr = new ArrayList<Literal>();\r\n\t\tint \t id \t \t = perceptModel.getAgentID(agName);\r\n\t\tLocation lplayer \t = perceptModel.getAgPos(id); \r\n\t\tif(agName != null){\r\n\t\t\t/** Searching direct neighbours to the Agent's location*/\r\n\t\t\tfor(int y = -1; y <= 1; y++){\r\n\t\t\t\tfor(int x = -1; x <= 1; x++){\r\n\t\t\t\t\tif(!(x == 0 && y == 0)){\r\n\t\t\t\t\t\tLocation l = new Location(lplayer.x + x, lplayer.y + y);\r\n//\t\t\t\t\t\tSystem.out.println(\"Player 1 Loc: (\" + lplayer.x + \",\" + lplayer.y + \"):: See Loc (\" + l.x + \",\" + l.y + \")\");\r\n\t\t\t\t\t\tif(perceptModel.getAgAtPos(l) != -1){\r\n\t\t\t\t\t\t\tint agt = perceptModel.getAgAtPos(l);\r\n\t\t\t\t\t\t\tString plyr = perceptModel.getAgName(agt);\r\n\t\t\t\t\t\t\t/** Detects and adds nearby agents flagholder status perception */\r\n\t\t\t\t\t\t\tif(perceptModel.flag.agentCarrying == perceptModel.getAgentID(plyr)){\r\n\t\t\t\t\t\t\t\tLiteral nfh = Literal.parseLiteral(\"flagholder(\" + plyr + \")\");\r\n\t\t\t\t\t\t\t\tlookArr.add(nfh);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tLiteral np = Literal.parseLiteral(\"close(\" + plyr + \")\"); \r\n\t\t\t\t\t\t\t\tlookArr.add(np);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/** Searching an single space further in the cardinal directions*/\r\n\t\t\tfor(int y = -2; y <= 2; y+=4){\r\n\t\t\t\tfor(int x = -2; x <= 2; x+=4){\r\n\t\t\t\t\tLocation l = new Location(lplayer.x + x, lplayer.y + y);\r\n\t//\t\t\t\tSystem.out.println(\"Player Loc: (\" + lplayer.x + \",\" + lplayer.y + \"):: See Loc (\" + l.x + \",\" + l.y + \")\");\r\n\t\t\t\t\tif(perceptModel.getAgAtPos(l) != -1 ){\r\n\t\t\t\t\t\tint \tagt = perceptModel.getAgAtPos(l);\r\n\t\t\t\t\t\tString plyr = perceptModel.getAgName(agt);\r\n\t\t\t\t\t\t/** Detects and adds nearby agents flagholder status perception */\r\n\t\t\t\t\t\tif(perceptModel.flag.agentCarrying == perceptModel.getAgentID(plyr)){\r\n\t\t\t\t\t\t\tLiteral nfh = Literal.parseLiteral(\"flagholder(\" + plyr + \")\");\r\n\t\t\t\t\t\t\tlookArr.add(nfh);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tLiteral np = Literal.parseLiteral(\"close\" + plyr + \")\"); \r\n\t\t\t\t\t\t\tlookArr.add(np);\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/** Returns completed ArrayList */ \r\n\t\t\treturn lookArr;\r\n\t\t} else return null;\r\n\t}", "void compareSearch();", "private void findHighestScoringWord(ArrayList<Tile> inputTiles, ArrayList<Tile> tilesToBeUsed, String currentWord, int score, Anchor anchor){\n for (int tileNo = 0 ; tileNo < inputTiles.size() ; tileNo++){\n Tile currentTile = inputTiles.get(tileNo);\n if (currentTile == null) break;\n if (isValidPrefix(currentWord + currentTile.letter)\t){\n ArrayList<Tile> remainingTiles = new ArrayList<Tile>( inputTiles);\n ArrayList<Tile> tilesInWord = new ArrayList<Tile>(tilesToBeUsed);\n remainingTiles.remove(tileNo);\n tilesInWord.add(currentTile);\n //score check here when we know it's valid?\n findHighestScoringWord(remainingTiles, tilesInWord ,currentWord + currentTile.letter, score + currentTile.pointValue , anchor);\n\n //need to check if anchor is in the word before we propose it as an answer\n if (tilesToBeUsed.contains(anchor.anchorTile) || currentTile.equals(anchor.anchorTile)){\n if (isValidWord(currentWord + currentTile.letter)){\n if (fitsOnBoard(anchor, tilesInWord)){\n Move move = null; //let's make our move to score\n if(anchor.isAcross()){ //make a move to check score bases on anchor being across type\n move = new Move(tilesInWord, anchor.row , (anchor.col - getAnchorPosition(anchor, tilesInWord)), true, bot );\n } else if(!anchor.isAcross()){ // make a move to check score on anchor being vert type\n move = new Move(tilesInWord, (anchor.row - getAnchorPosition(anchor,tilesInWord)), anchor.col,false, bot );\n }\n int currentWordScore = Scorer.score(move , boardSpaces);\n if (currentWord.length() > 6){\n currentWordScore += 50;\n }\n\n if (maxScore < currentWordScore && moveIsValid(move) ){\n maxScore = currentWordScore;\n bestWord = tilesInWord;\n currentAnchor = anchor;\n }\n }\n }\n }\n }\n }\n }", "public static String searchSmart(int player,int mode,int move){\n\tboolean flag = false;\r\n\tString inp = null;\r\n\tint row=0,col=0;\r\n\tint row1=-1,col1=-1;\r\nif(mode==3){\r\n\tif(move==2){\r\n\t\tif(gamebd[0][1]==2||gamebd[1][0]==2){\r\n\t\t\tinp=3+\" \"+3;\r\n\t\t\treturn inp;\r\n\t\t}\r\n\t\t\r\n\t\telse if(gamebd[2][1]==2||gamebd[1][2]==2){\r\n\t\t\tinp=1+\" \"+1;\r\n\t\t\treturn inp;\r\n\t\t}}\r\n}\r\nfor(int i=0;i<3;i++){//checks if any of the rows have 2 computer moves and third empty so as to fill it and win\r\n\tint count=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int j=0;j<3;j++){\r\n\t\tif(gamebd[i][j]==player){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(gamebd[i][j]==0)\r\n\t\t\t\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=j;\r\n\t\t}\r\n\t}\r\n\r\n\tif(count==2&&row1>=0&&col1>=0){\r\n\t\t//System.out.println(\"rowon\");\r\n\t\trow=row1+1;\r\n\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}}\r\nfor(int j=0;j<3;j++){//checks if any of the columns have 2 computer moves and third empty so as to fill it and win\r\n\r\n\tint count=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=0;i<3;i++){\r\n\t\tif(gamebd[i][j]==player){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(gamebd[i][j]==0)\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=j;\r\n\t\t}\r\n\t}\r\n\tif(count==2&&row1>=0&&col1>=0){\r\n\t\trow=row1+1;\r\n\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}}\r\n//The below code checks if any of the diagonals have 2 computer moves and third empty so as to fill it or 2 human moves and third empty so as to block it \r\nint count=0;\r\nint countopp=0;\r\nrow1=-1;\r\ncol1=-1;\r\nfor(int i=0;i<3;i++){\t\r\nif(gamebd[i][i]==player)\r\n\t\tcount ++;\t\r\nif(gamebd[i][i]==0)\r\n\t\trow1=col1=i;\r\n}\r\n\tif((count==2)&&row1>=0&&col1>=0)\r\n\t{\r\n\t\tcol=row=(row1+1);\r\n\tinp=row+\" \"+col;\r\n\tflag=true;\r\n\treturn inp;\r\n}\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=0;i<3;i++){\t\r\n\t\tif(gamebd[i][i]!=player&&gamebd[i][i]>0)\r\n\t\t\t\tcountopp ++;\t\r\n\t\tif(gamebd[i][i]==0)\r\n\t\t\t\trow1=col1=i;\r\n\t\t\t}\r\n\tif((countopp==2)&&row1>=0&&col1>=0)\r\n\t{\r\n\t\tcol=row=(row1+1);\r\n\tinp=row+\" \"+col;\r\n\tflag=true;\r\n\treturn inp;\r\n}\r\n\t count=0;\r\n\t countopp=0;\r\n\trow1=-1;\r\n\tcol1=-1;\r\n\tfor(int i=2;i>=0;i--){\r\n\t\tif(gamebd[i][2-i]==player)\r\n\t\t\tcount ++;\r\n\t\tif(gamebd[i][2-i]==0)\r\n\t\t{\r\n\t\t\trow1=i;\r\n\t\t\tcol1=2-i;\r\n\t\t}\r\n\t\t}\r\n\t\tif((count==2)&&row1>=0&&col1>=0)\r\n\t\t{\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\tinp=row+\" \"+col;\r\n\t\tflag=true;\r\n\t\treturn inp;\r\n\t}\r\n\t\trow1=-1;\r\n\t\tcol1=-1;\r\n\t\tfor(int i=2;i>=0;i--){\r\n\t\t\tif(gamebd[i][2-i]!=player&&gamebd[i][2-i]>0)\r\n\t\t\tcountopp++;\r\n\t\t\tif(gamebd[i][2-i]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=2-i;\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tif((countopp==2)&&row1>=0&&col1>=0)\r\n\t\t\t{\r\n\t\t\t\trow=row1+1;\r\n\t\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}\r\n\tfor(int i=0;i<3;i++){//checks if any of the rows have 2 human moves and third empty so as to block it and not allow human to win\r\n\t\t countopp=0;\r\n\t\t row1=-1;\r\n\t\t\tcol1=-1;\r\n\t\tfor(int j=0;j<3;j++){\r\n\t\t\tif(gamebd[i][j]!=player&&gamebd[i][j]>0){\r\n\t\t\t\tcountopp++;\r\n\t\t\t}\r\n\t\t\tif(gamebd[i][j]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=j;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(countopp==2&&row1>=0&&col1>=0){\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}}\r\n\tfor(int j=0;j<3;j++){//checks if any of the columns have 2 human moves and third empty so as to block human and not allow to win\r\n\t\t countopp=0;\r\n\t\t row1=-1;\r\n\t\t\tcol1=-1;\r\n\t\tfor(int i=0;i<3;i++){\r\n\t\t\tif(gamebd[i][j]!=player&&gamebd[i][j]>0){\r\n\t\t\t\tcountopp++;\r\n\t\t\t}\r\n\t\t\tif(gamebd[i][j]==0)\r\n\t\t\t{\r\n\t\t\t\trow1=i;\r\n\t\t\t\tcol1=j;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(countopp==2&&row1>=0&&col1>=0){\r\n\t\t\trow=row1+1;\r\n\t\t\tcol=col1+1;\r\n\t\t\tinp=row+\" \"+col;\r\n\t\t\tflag=true;\r\n\t\t\treturn inp;\r\n\t\t}}\r\nif(flag==false){//Now since all cases are checked(of winning and not allowing human to win), computer will play a random move\r\nRandom rand = new Random();\r\nint min=0;\r\nint max=2;\r\nint a,b;\r\ndo{\r\n\t a = rand.nextInt(max-min+1)+min;\r\n\t b = rand.nextInt(max-min+1)+min;\r\n\t //System.out.println(a+\"\"+b);\r\n}while(gamebd[a][b]!=0);\r\ninp=(a+1)+\" \"+(b+1);\r\n}\r\nreturn inp;\r\n}", "private void searchFunction() {\n\t\t\r\n\t}", "public abstract List<Direction> searchForCheese(Maze maze);", "public void testAStarSearch() {\n\t\ttry {\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {2,0,5,6,4,8,3,7,1});\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {0,8,7,6,5,4,3,2,1});\r\n\t\t\tEightPuzzleBoard board = new EightPuzzleBoard(new int[] { 7, 1, 8,\r\n\t\t\t\t\t0, 4, 6, 2, 3, 5 });\r\n\r\n\t\t\tProblem problem = new Problem(board,\r\n\t\t\t\t\tnew EightPuzzleSuccessorFunction(),\r\n\t\t\t\t\tnew EightPuzzleGoalTest(), new ManhattanHeuristicFunction());\r\n\t\t\tSearch search = new AStarSearch(new GraphSearch());\r\n\t\t\tSearchAgent agent = new SearchAgent(problem, search);\r\n\t\t\tassertEquals(23, agent.getActions().size());\r\n\t\t\tassertEquals(\"906\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"nodesExpanded\"));\r\n\t\t\tassertEquals(\"914\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"queueSize\"));\r\n\t\t\tassertEquals(\"920\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"maxQueueSize\"));\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "void search();", "void search();", "@Override\n protected void search() {\n \n obtainProblem();\n if (prioritizedHeroes.length > maxCreatures){\n frame.recieveProgressString(\"Too many prioritized creatures\");\n return;\n }\n bestComboPermu();\n if (searching){\n frame.recieveDone();\n searching = false;\n }\n }", "abstract public void search();", "public void findShips(int game[][]) {\n\t\tint counter =0; // total number of cells searched\n\t\tint count = 0;\n\t\tString carr=\"\"; // Concatenating the carrier strings.\n\t\tString sub = \"\"; // Concatenating the submarines strings.\n\t\t//System.out.println(\"Horizontal is implemented\"+ game);\n\t\tfor(int i=0 ; i<25; i++) {\n\t\t\tfor(int j =0; j<25;j++) {\n\t\t\t\tif(game[i][j]==1) {\n\t\t\t\t\t//System.out.print(\" Found Carrier at (\"+i+\",\"+j+\") \");\n\t\t\t\t\tString a = \"(\"+i+\",\"+j+\")\";\n\t\t\t\t\tcarr = carr.concat(a);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(game[i][j]==2) {\n\t\t\t\t\t//System.out.print(\" Found submarine at (\"+i+\",\"+j+\") \");\n\t\t\t\t\tString b = \"(\"+i+\",\"+j+\")\";\n\t\t\t\t\tsub = sub.concat(b);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tif(count==8) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Strategy: Horizontal Sweep\");\n\t\tSystem.out.println(\"Number of cells searched: \"+counter);\n\t\tSystem.out.print(\"Found Carrier at \"+carr+\";\");\n\t\tSystem.out.println(\" Found Sub at \"+sub);\n\t\t\n\t}", "@Override\n\tpublic boolean startSearch() {\n\t\tString str = \"\";\n\t\t\n\t\tDimension d = view.getInit();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de inicio.\\n\";\n\t\t} else {\n\t\t\ty0 = (int) d.getHeight();\n\t\t\tx0 = (int) d.getWidth();\n\t\t}\n\t\t\n\t\td = view.getGoal();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de meta.\\n\";\n\t\t} else {\n\t\t\tyf = (int) d.getHeight();\n\t\t\txf = (int) d.getWidth();\n\t\t}\n\t\t\n\t\tif (view.isBreadth()) {\n\t\t\tstrategy = new Breadth();\n\t\t} else if (view.isDepth()) {\n\t\t\tstrategy = new Depth();\n\t\t} else if (view.isAStar()) {\n\t\t\tstrategy = new AStar();\n\t\t\tif (view.isH0()) {\n\t\t\t\theuristic = Horse.H0;\n\t\t\t} else if (view.isH1()) {\n\t\t\t\theuristic = Horse.H1;\n\t\t\t} else if (view.isH2()) {\n\t\t\t\theuristic = Horse.H2;\n\t\t\t} else\n\t\t\t\tstr = str + \"Falta por escoger el tipo de heur’stica.\\n\";\n\t\t} else\n\t\t\tstr = str + \"Falta la estrategia de bœsqueda.\\n\";\n\t\t\n\t\tboard = view.getBoard();\n\t\t\n\t\tif (str.equals(\"\")) {\n\t\t\trootNode = new Node(new Horse(x0,y0,xf,yf, board, heuristic));\n\t\t}\n\t\t\n\t\tif (view.isTree()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Tree(rootNode, strategy);\n\t\t} else if (view.isGraph()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Graph(rootNode, strategy);\n\t\t} else \n\t\t\tstr = str + \"Falta el algoritmo de bœsqueda.\\n\";\n\t\t\n\t\tif (!str.equals(\"\")) {\n\t\t\tview.showError(str);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tgoSearch();\n\t\treturn true;\n\t}", "public void ss(){\n for (int c=0; c < league.length;c++) {\r\n for (int t=c+1;t<league.length;t++) {\r\n score = league[c].scoregenerator();\r\n secondscore = league[t].scoregenerator();\r\n league[c].pointsfor(score);\r\n league[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n league[c].wins();\r\n league[t].losses();\r\n }\r\n else if (score == secondscore){\r\n league[c].ties();\r\n league[t].ties();\r\n }\r\n else {\r\n league[t].wins();\r\n league[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < AFC.length;c++) {\r\n for (int t=c+1;t<AFC.length;t++) {\r\n score = AFC[c].scoregenerator();\r\n secondscore = AFC[t].scoregenerator();\r\n AFC[c].pointsfor(score);\r\n AFC[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n AFC[c].wins();\r\n AFC[t].losses();\r\n }\r\n else if (score == secondscore){\r\n AFC[c].ties();\r\n AFC[t].ties();\r\n }\r\n else {\r\n AFC[t].wins();\r\n AFC[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < NFC.length;c++) {\r\n for (int t=c+1;t<NFC.length;t++) {\r\n score = NFC[c].scoregenerator();\r\n secondscore = NFC[t].scoregenerator();\r\n NFC[c].pointsfor(score);\r\n NFC[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n NFC[c].wins();\r\n NFC[t].losses();\r\n }\r\n else if (score == secondscore){\r\n NFC[c].ties();\r\n NFC[t].ties();\r\n }\r\n else {\r\n NFC[t].wins();\r\n NFC[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0;c<AFCeast.length;c++) {\r\n for (int t=c+1;t<AFCeast.length;t++) {\r\n score = AFCeast[c].scoregenerator();\r\n secondscore = AFCeast[t].scoregenerator();\r\n AFCeast[c].pointsfor(score);\r\n AFCeast[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n AFCeast[c].wins();\r\n AFCeast[t].losses();\r\n }\r\n else if (score == secondscore){\r\n AFCeast[c].ties();\r\n AFCeast[t].ties();\r\n }\r\n else {\r\n AFCeast[t].wins();\r\n AFCeast[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < AFCnorth.length;c++) {\r\n for (int t=c+1;t<AFCnorth.length;t++) {\r\n score = AFCnorth[c].scoregenerator();\r\n secondscore = AFCnorth[t].scoregenerator();\r\n AFCnorth[c].pointsfor(score);\r\n AFCnorth[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n AFCnorth[c].wins();\r\n AFCnorth[t].losses();\r\n }\r\n else if (score == secondscore){\r\n AFCnorth[c].ties();\r\n AFCnorth[t].ties();\r\n }\r\n else {\r\n AFCnorth[t].wins();\r\n AFCnorth[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < AFCsouth.length;c++) {\r\n for (int t=c+1;t<AFCsouth.length;t++) {\r\n score = AFCsouth[c].scoregenerator();\r\n secondscore = AFCsouth[t].scoregenerator();\r\n AFCsouth[c].pointsfor(score);\r\n AFCsouth[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n AFCsouth[c].wins();\r\n AFCsouth[t].losses();\r\n }\r\n else if (score == secondscore){\r\n AFCsouth[c].ties();\r\n AFCsouth[t].ties();\r\n }\r\n else {\r\n AFCsouth[t].wins();\r\n AFCsouth[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < AFCwest.length;c++) {\r\n for (int t=c+1;t<AFCwest.length;t++) {\r\n score = AFCwest[c].scoregenerator();\r\n secondscore = AFCwest[t].scoregenerator();\r\n AFCwest[c].pointsfor(score);\r\n AFCwest[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n AFCwest[c].wins();\r\n AFCwest[t].losses();\r\n }\r\n else if (score == secondscore){\r\n AFCwest[c].ties();\r\n AFCwest[t].ties();\r\n }\r\n else {\r\n AFCwest[t].wins();\r\n AFCwest[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < NFCeast.length;c++) {\r\n for (int t=c+1;t<NFCeast.length;t++) {\r\n score = NFCeast[c].scoregenerator();\r\n secondscore = NFCeast[t].scoregenerator();\r\n NFCeast[c].pointsfor(score);\r\n NFCeast[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n NFCeast[c].wins();\r\n NFCeast[t].losses();\r\n }\r\n else if (score == secondscore){\r\n NFCeast[c].ties();\r\n NFCeast[t].ties();\r\n }\r\n else {\r\n NFCeast[t].wins();\r\n NFCeast[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < NFCnorth.length;c++) {\r\n for (int t=c+1;t<NFCnorth.length;t++) {\r\n score = NFCnorth[c].scoregenerator();\r\n secondscore = NFCnorth[t].scoregenerator();\r\n NFCnorth[c].pointsfor(score);\r\n NFCnorth[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n NFCnorth[c].wins();\r\n NFCnorth[t].losses();\r\n }\r\n else if (score == secondscore){\r\n NFCnorth[c].ties();\r\n NFCnorth[t].ties();\r\n }\r\n else {\r\n NFCnorth[t].wins();\r\n NFCnorth[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < NFCsouth.length;c++) {\r\n for (int t=c+1;t<NFCsouth.length;t++) {\r\n score = NFCsouth[c].scoregenerator();\r\n secondscore = NFCsouth[t].scoregenerator();\r\n NFCsouth[c].pointsfor(score);\r\n NFCsouth[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n NFCsouth[c].wins();\r\n NFCsouth[t].losses();\r\n }\r\n else if (score == secondscore){\r\n NFCsouth[c].ties();\r\n NFCsouth[t].ties();\r\n }\r\n else {\r\n NFCsouth[t].wins();\r\n NFCsouth[c].losses();\r\n }\r\n } \r\n }\r\n for (int c=0; c < NFCwest.length;c++) {\r\n for (int t=c+1;t<NFCwest.length;t++) {\r\n score = NFCwest[c].scoregenerator();\r\n secondscore = NFCwest[t].scoregenerator();\r\n NFCwest[c].pointsfor(score);\r\n NFCwest[t].pointsfor(secondscore);\r\n\r\n if (score > secondscore){\r\n NFCwest[c].wins();\r\n NFCwest[t].losses();\r\n }\r\n else if (score == secondscore){\r\n NFCwest[c].ties();\r\n NFCwest[t].ties();\r\n }\r\n else {\r\n NFCwest[t].wins();\r\n NFCwest[c].losses();\r\n }\r\n } \r\n }\r\n\r\n for (int c=0;c<league.length;c++){\r\n System.out.println(league[c]);\r\n }\r\n System.out.println(\"...\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(\"\\n\" + \"Now let the playoffs begin!\" + \"\\n\");\r\n\r\n for (int y=0;y<4;y++){ // These next groups of code are sorting each division, and each conference based on wins\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (AFCeast[a].displaywins() > AFCeast[p].displaywins()){\r\n Temp = AFCeast[p];\r\n AFCeast[p] = AFCeast[a];\r\n AFCeast[a] = Temp;\r\n }\r\n else if (AFCeast[a].displaywins() == AFCeast[p].displaywins() && AFCeast[a].displaypf() > AFCeast[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n // System.out.println(AFCeast[0]);\r\n\r\n afcplayoff[0] = AFCeast[0];\r\n // System.out.println(afcplayoff[0]);\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (AFCnorth[a].displaywins() > AFCnorth[p].displaywins()){\r\n Temp = AFCnorth[p];\r\n AFCnorth[p] = AFCnorth[a];\r\n AFCnorth[a] = Temp;\r\n }\r\n else if (AFCnorth[a].displaywins() == AFCnorth[p].displaywins() && AFCnorth[a].displaypf() > AFCnorth[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n\r\n afcplayoff[1] = AFCnorth[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (AFCsouth[a].displaywins() > AFCsouth[p].displaywins()){\r\n Temp = AFCsouth[p];\r\n AFCsouth[p] = AFCsouth[a];\r\n AFCsouth[a] = Temp;\r\n }\r\n else if (AFCsouth[a].displaywins() == AFCsouth[p].displaywins() && AFCsouth[a].displaypf() > AFCsouth[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n\r\n afcplayoff[2] = AFCsouth[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (AFCwest[a].displaywins() > AFCwest[p].displaywins()){\r\n Temp = AFCwest[p];\r\n AFCwest[p] = AFCwest[a];\r\n AFCwest[a] = Temp;\r\n }\r\n else if (AFCwest[a].displaywins() == AFCwest[p].displaywins() && AFCwest[a].displaypf() > AFCwest[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n\r\n afcplayoff[3] = AFCwest[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (NFCeast[a].displaywins() > NFCeast[p].displaywins()){\r\n Temp = NFCeast[p];\r\n NFCeast[p] = NFCeast[a];\r\n NFCeast[a] = Temp;\r\n }\r\n else if (NFCeast[a].displaywins() == NFCeast[p].displaywins() && NFCeast[a].displaypf() > NFCeast[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n nfcplayoff[0] = NFCeast[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (NFCnorth[a].displaywins() > NFCnorth[p].displaywins()){\r\n Temp = NFCnorth[p];\r\n NFCnorth[p] = NFCnorth[a];\r\n NFCnorth[a] = Temp;\r\n }\r\n else if (NFCnorth[a].displaywins() == NFCnorth[p].displaywins() && NFCnorth[a].displaypf() > NFCnorth[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n nfcplayoff[1] = NFCnorth[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (NFCsouth[a].displaywins() > NFCsouth[p].displaywins()){\r\n Temp = NFCsouth[p];\r\n NFCsouth[p] = NFCsouth[a];\r\n NFCsouth[a] = Temp;\r\n }\r\n else if (NFCsouth[a].displaywins() == NFCsouth[p].displaywins() && NFCsouth[a].displaypf() > NFCsouth[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n nfcplayoff[2] = NFCsouth[0];\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (NFCwest[a].displaywins() > NFCwest[p].displaywins()){\r\n Temp = NFCwest[p];\r\n NFCwest[p] = NFCwest[a];\r\n NFCwest[a] = Temp;\r\n }\r\n else if (NFCwest[a].displaywins() == NFCwest[p].displaywins() && NFCwest[a].displaypf() > NFCwest[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n nfcplayoff[3] = NFCwest[0];\r\n for (int y=0;y<16;y++){\r\n for (int p=0;p<15;p++) {\r\n int a = p+1;\r\n if (AFC[a].displaywins() > AFC[p].displaywins()){\r\n Temp = AFC[p];\r\n AFC[p] = AFC[a];\r\n AFC[a] = Temp;\r\n }\r\n else if (AFC[a].displaywins() == AFC[p].displaywins() && AFC[a].displaypf() > AFC[p].displaypf()){\r\n Temp = AFC[p];\r\n AFC[p] = AFC[a];\r\n AFC[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n for (int y=0;y<16;y++){\r\n for (int p=0;p<15;p++) {\r\n int a = p+1;\r\n if (NFC[a].displaywins() > NFC[p].displaywins()){\r\n Temp = NFC[p];\r\n NFC[p] = NFC[a];\r\n NFC[a] = Temp;\r\n }\r\n else if (NFC[a].displaywins() == NFC[p].displaywins() && NFC[a].displaypf() > NFC[p].displaypf()){\r\n Temp = NFC[p];\r\n NFC[p] = NFC[a];\r\n NFC[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n\r\n int maxw=0;\r\n\r\n for (int x=0;x<AFC.length;x++){\r\n\r\n if ((AFC[x].displaywins() > maxw) && \r\n (AFC[x].getName() != afcplayoff[0].getName()) && \r\n (AFC[x].getName() != afcplayoff[1].getName()) && \r\n (AFC[x].getName() != afcplayoff[2].getName()) && \r\n (AFC[x].getName() != afcplayoff[3].getName()) && \r\n (AFC[x].getName() != afcplayoff[4].getName()) && \r\n (AFC[x].getName() != afcplayoff[5].getName())){\r\n maxw = AFC[x].displaywins();\r\n afcplayoff[4] = AFC[x]; \r\n }\r\n\r\n }\r\n\r\n maxw=0;\r\n for (int x=0;x<AFC.length;x++){\r\n\r\n if (AFC[x].displaywins() > maxw && \r\n AFC[x].getName() != afcplayoff[0].getName() && \r\n AFC[x].getName() != afcplayoff[1].getName() && \r\n AFC[x].getName() != afcplayoff[2].getName() && \r\n AFC[x].getName() != afcplayoff[3].getName() && \r\n AFC[x].getName() != afcplayoff[4].getName() && \r\n AFC[x].getName() != afcplayoff[5].getName()){\r\n maxw = AFC[x].displaywins();\r\n afcplayoff[5] = AFC[x]; \r\n }\r\n }\r\n\r\n maxw=0;\r\n for (int x=0;x<NFC.length;x++){\r\n if (NFC[x].displaywins() > maxw && \r\n NFC[x].getName() != nfcplayoff[0].getName() && \r\n NFC[x].getName() != nfcplayoff[1].getName() && \r\n NFC[x].getName() != nfcplayoff[2].getName() && \r\n NFC[x].getName() != nfcplayoff[3].getName() && \r\n NFC[x].getName() != nfcplayoff[4].getName() && \r\n NFC[x].getName() != nfcplayoff[5].getName()){\r\n maxw = NFC[x].displaywins();\r\n nfcplayoff[4] = NFC[x]; \r\n }\r\n }\r\n maxw=0;\r\n for (int x=0;x<NFC.length;x++){\r\n\r\n if (NFC[x].displaywins() > maxw && \r\n NFC[x].getName() != nfcplayoff[0].getName() && \r\n NFC[x].getName() != nfcplayoff[1].getName() && \r\n NFC[x].getName() != nfcplayoff[2].getName() && \r\n NFC[x].getName() != nfcplayoff[3].getName() && \r\n NFC[x].getName() != nfcplayoff[4].getName() && \r\n NFC[x].getName() != nfcplayoff[5].getName()){\r\n maxw = NFC[x].displaywins();\r\n nfcplayoff[5] = NFC[x]; \r\n }\r\n }\r\n\r\n for (int y=0;y<4;y++){\r\n for (int p=0;p<3;p++) {\r\n int a = p+1;\r\n if (afcplayoff[a].displaywins() > afcplayoff[p].displaywins()){\r\n Temp = afcplayoff[p];\r\n afcplayoff[p] = afcplayoff[a];\r\n afcplayoff[a] = Temp;\r\n }\r\n else if (afcplayoff[a].displaywins() == afcplayoff[p].displaywins() && afcplayoff[a].displaypf() > afcplayoff[p].displaypf()){\r\n Temp = afcplayoff[p];\r\n afcplayoff[p] = afcplayoff[a];\r\n afcplayoff[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n for (int c=0;c<afcplayoff.length;c++){ // Testing to see if users team made the playoffs.\r\n if(YourTeam.getName().equals(afcplayoff[c].getName()))\r\n afcplayofft = true;\r\n }\r\n\r\n for (int y=0;y<4;y++){\r\n for (int r=0;r<3;r++) {\r\n int c = r+1;\r\n if (nfcplayoff[c].displaywins() > nfcplayoff[r].displaywins()){\r\n Temp = nfcplayoff[r];\r\n nfcplayoff[r] = nfcplayoff[c];\r\n nfcplayoff[c] = Temp;\r\n }\r\n else if (nfcplayoff[c].displaywins() == nfcplayoff[r].displaywins() && nfcplayoff[c].displaypf() > nfcplayoff[r].displaypf()){\r\n Temp = nfcplayoff[r];\r\n nfcplayoff[r] = nfcplayoff[c];\r\n nfcplayoff[c] = Temp;\r\n }\r\n\r\n }\r\n }\r\n for (int c=0;c<nfcplayoff.length;c++){\r\n if(YourTeam.getName().equals(nfcplayoff[c].getName()))\r\n nfcplayofft = true;\r\n }\r\n // This shows how the playoffs will look like to the user\r\n System.out.println(\"...\" + \"\\n\" + \"Based on the regular season, here is what the first round of playoffs will look like:\" + \"\\n\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(afcplayoff[0].getName() + \" got a bye in the first round of the playoffs for placing first in the afc.\");\r\n System.out.println(afcplayoff[1].getName() + \" also got a bye in the first round of the playoffs for placing second in the afc.\" + \"\\n\");\r\n System.out.println(nfcplayoff[0].getName() + \" got a bye in the first round of the playoffs for placing first in the nfc.\");\r\n System.out.println(nfcplayoff[1].getName() + \" also got a bye in the first round of the playoffs for placing second in the nfc.\" + \"\\n\");\r\n\r\n System.out.println(afcplayoff[2].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" ) Winner moves on to play the \" + afcplayoff[0].getName());\r\n System.out.println(\" /-----/\");\r\n System.out.println(afcplayoff[5].getName() + \"\\n\");\r\n\r\n System.out.println(afcplayoff[3].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" ) Winner moves onto play the \"+ afcplayoff[1].getName());\r\n System.out.println(\" /-----/\");\r\n System.out.println(afcplayoff[4].getName() + \"\\n\");\r\n\r\n System.out.println(nfcplayoff[2].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" ) Winner moves onto play the \"+ nfcplayoff[0].getName());\r\n System.out.println(\" /-----/\");\r\n System.out.println(nfcplayoff[5].getName() + \"\\n\");\r\n\r\n System.out.println(nfcplayoff[3].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" ) Winner moves onto play the \"+ nfcplayoff[1].getName());\r\n System.out.println(\" /-----/\");\r\n System.out.println(nfcplayoff[4].getName() + \"\\n\");\r\n\r\n System.out.println(\"...\"+ \"\\n\");\r\n\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n\r\n {}\r\n }", "public static void main(String[] args) throws Exception {\n java.io.File threeLetterFile = new java.io.File(\"three-letter-words.txt\");\n \n //create custom SearchArray object with my search Methods\n threeletterwords.SearchArray search = new SearchArray();\n \n //create Scanner objects\n Scanner loadList = new Scanner(threeLetterFile);\n Scanner input = new Scanner(System.in);\n \n //declare arrays\n String[] threeLetterList = new String[1012];\n char[] startWordArray = new char[3];\n char[] finalWordArray = new char[3];\n char[] wordHolderArray = new char[3];\n char[] partialMatchArray = new char[3];\n char[] firstTwoArray = new char[2];\n char[] lastTwoArray = new char[2];\n \n //declare String Variables\n String startWord;\n String finalWord;\n String wordHolder;\n String partialMatch;\n String firstTwoHolder;\n String lastTwoHolder;\n \n //initialize boolean variables\n boolean wordCheck = true;\n boolean partialCheck = false;\n boolean firstTwoCheck = true;\n \n //initialize integer variables\n \n int moves = 0;\n int index = 0;\n \n /*This while loop will transfer the three letter words to the array\n * threeLetterList\n */\n \n while(loadList.hasNextLine()){\n threeLetterList[index] = loadList.nextLine();\n threeLetterList[index] = threeLetterList[index].toLowerCase();\n index++;\n }\n loadList.close();\n \n \n \n /* These do ... while loops make sure user only inputs a valid 3 letter \n * word from the list. Will loop until user gets it right.\n */\n \n do{\n System.out.println(\"Type in a Three Letter word from the list\");\n startWord = input.next();\n if (startWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, startWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(startWord.length() != 3 || search.searchList(threeLetterList, startWord) == false);\n \n do{\n System.out.println(\"Type in a Second Three Letter word from the list\");\n finalWord = input.next();\n if (finalWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, finalWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(finalWord.length() != 3 || search.searchList(threeLetterList, finalWord) == false);\n \n //initialize strings and arrays\n System.arraycopy(startWord.toCharArray(), 0, startWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, wordHolderArray, 0, 3);\n System.arraycopy(finalWord.toCharArray(), 0, finalWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, firstTwoArray, 0, 2);\n System.arraycopy(startWord.toCharArray(), 1, lastTwoArray, 0, 2);\n wordHolder = String.copyValueOf(wordHolderArray);\n firstTwoHolder = String.copyValueOf(firstTwoArray);\n lastTwoHolder = String.copyValueOf(lastTwoArray);\n \n /*the following section of code is what makes the \"moves\"\n * \n */\n while(wordHolder.toLowerCase().contentEquals(finalWord.toLowerCase()) == false){ \n for(int k = 0; k < finalWordArray.length; k++){\n if(wordHolderArray[k] != finalWordArray[k]){\n wordHolderArray[k] = finalWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n if (search.searchList(threeLetterList, wordHolder) == true){\n moves++;\n System.out.println(\"Move \" + moves + \":\\t\" + wordHolder);\n }\n else{\n wordHolderArray[k] = startWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n }\n }\n }\n if(wordHolder.toLowerCase().contentEquals(startWord.toLowerCase())){\n \n }\n } \n }", "public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "private void analyzeForObstacles() {\n \t\n \t\n \tStack<Rect> bestFound = new Stack<Rect>();//This is a stack as the algorithm moves along x linearly\n \tboolean[][] blackWhiteGrid = getBlackWhiteGrid();\n \tint[] cache = new int[grid.length];\n \t\n \twhile (true) {\n\t\t\tboolean noneFound = true;\n\t\t\t\n\t\t\tfor (int i = 0; i<cache.length; i++)\n\t\t\t\tcache[i] = 0;\n\t\t\tfor (int llx = grid.length -1; llx >= 0; llx--) {\n\t\t\t\tupdate_cache(blackWhiteGrid,cache, llx);\n\t\t\t\tfor (int lly = 0; lly < grid.length; lly++) {\n\t\t\t\t\tRect bestOfRound = new Rect(llx,lly,llx,lly);\n\t\t\t\t\tint y = lly;\n\t\t\t\t\tint x_max = 9999;\n\t\t\t\t\tint x = llx;\n\t\t\t\t\twhile (y+1<grid.length && blackWhiteGrid[llx][y]) {\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tx = Math.min(llx+cache[y]-1, x_max);\n\t\t\t\t\t\tx_max = x;\n\t\t\t\t\t\tRect tryRect = new Rect(llx,lly-1,x,y);\n\t\t\t\t\t\tif (tryRect.area() > bestOfRound.area()) {\n\t\t\t\t\t\t\tbestOfRound = tryRect;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (bestOfRound.area() > 40) {\n\t\t\t\t\t\tif (noneFound) {\n\t\t\t\t\t\t\tbestFound.push(bestOfRound);\n\t\t\t\t\t\t\tnoneFound = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tRect lastRect = bestFound.peek();\n\t\t\t\t\t\t\tif (lastRect.area() < bestOfRound.area()) {\n\t\t\t\t\t\t\t\tbestFound.pop();\n\t\t\t\t\t\t\t\tbestFound.push(bestOfRound);\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\tif (noneFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tclearFoundRectangle(blackWhiteGrid, bestFound.peek());\n \t}\n \t\n \t//add found rectanlges\n \tobstacles.clear();\n \tobstacles.addAll(bestFound);\n \tSystem.out.println(\"Sweep done:\");\n \tfor (Rect r : bestFound){\n \t\tSystem.out.println(\"Rect: llx=\" + (r.llx-400) + \"\\tlly=\" + (r.lly-400) + \"\\turx=\" + (r.urx-400) + \"\\tury=\" + (r.ury-400));\n \t\tList<Point2D.Double> corners = new ArrayList<Point2D.Double>();\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.ury-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.ury-400)));\n \t\tobstaclesF.add(new Obstacle(corners));\n \t}\n \t\n \ttoExplore.clear();\n \tint i = 0;\n \tRandom rand = new Random();\n \twhile (toExplore.size() < 10 && i < 1000) {\n \t\tint x = rand.nextInt(grid.length);\n \t\tint y = rand.nextInt(grid.length);\n \t\tif (grid[x][y] == .5) {\n \t\t\ttoExplore.add(new Flag(\"blue\",x,y));\n \t\t}\n \t}\n }", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "public static void searchZodiacLetter() {\n\t\t//String message = \"This is the Zodiac speaking. I am rather unhappy because you people will not wear some nice buttons. So I now have a little list, starting with the woeman + her baby that I gave a rather intersting ride for a couple howers one evening a few months back that ended in my burning her car where I found them.\";\n\t\tString message = \"San Francisco Chronicle S.F. Mon. Oct 5, 1970 Dear Editor, You'll hate me, but I've got to tell you. The pace isn't any slower! In fact it's just one big thirteenth 13 'Some of them fought it was horrible' P.S. THERE ARE REPORTS city police pig cops are closeing in on me. Fk I'm crackproof, What is the price tag now? Zodiac\";\n\t\t\n\t\t// try to anagram into portions of the Unabomber manifesto\n\t\tStringBuffer corpus = FileUtil.loadSBFrom(\n\t\t\t\t\"/Users/doranchak/projects/zodiac/github/zodiac-killer-ciphers/docs/corpus/unabomber-manifesto.txt\");\n\t\t\n\t\tString[] tokens = FileUtil.tokenizeAndConvert(corpus.toString());\n\t\tsearch(tokens, message, 50, true);\n\t}", "private static void task2222(int nUMS, SplayTree<Integer> j) {\n\t\tSystem.out.println(\"SPLAY Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "public HotelCard searchAdjacentHotels(Board board, Tuple res) {\n ArrayList<HotelCard> hotels = board.getHotels();\n ArrayList<HotelCard> adjacent_hotels = new ArrayList<>();\n ArrayList<Integer> ids = new ArrayList<>();\n int x1, x2, y1, y2, x3, y3, x4, y4;\n\n // Presentation of player's adjacent hotels\n System.out.println(ANSI() + \"Here are the available adjacent hotels:\" + ANSI_RESET);\n // right\n x1 = res.a;\n y1 = res.b + 1;\n // up \n x2 = res.a - 1;\n y2 = res.b;\n // left\n x3 = res.a;\n y3 = res.b - 1; \n // down\n x4 = res.a + 1;\n y4 = res.b;\n \n if (isNum(board.board[x1][y1]) != -1) {\n ids.add(isNum(board.board[x1][y1]));\n }\n if (isNum(board.board[x2][y2]) != -1) {\n ids.add(isNum(board.board[x2][y2]));\n }\n if (isNum(board.board[x3][y3]) != -1) {\n ids.add(isNum(board.board[x3][y3]));\n }\n if (isNum(board.board[x4][y4]) != -1) {\n ids.add(isNum(board.board[x4][y4]));\n }\n for (int id : ids) {\n for (HotelCard hc : hotels) {\n if (hc.getID() == id) {\n System.out.print(ANSI() + \"Hotel Name: \" + hc.getName() + ANSI_RESET);\n System.out.print(ANSI() + \", Hotel ID: \" + hc.getID() + ANSI_RESET); \n System.out.println(ANSI() + \", Hotel Ranking: \" + hc.getRank() + ANSI_RESET); \n adjacent_hotels.add(hc); \n }\n }\n }\n\n // Choose one adjacent hotel\n System.out.println(\"Please type the id of the hotel you want to buy\");\n boolean answer = false;\n while (answer == false) {\n Scanner s = new Scanner(System.in);\n String str = s.nextLine();\n int ID;\n try { \n ID = Integer.parseInt(str);\n // Search for the hotel card with user's given ID \n for (HotelCard hc : adjacent_hotels) \n if (hc.getID() == ID) return hc; \n System.out.println(ANSI() + \"Please type a valid Hotel ID from the above Hotels shown\" + ANSI_RESET);\n } catch (Exception e) {\n System.out.println(ANSI() + \"Please type a valid Hotel ID from the above Hotels shown\" + ANSI_RESET);\n }\n }\n return null;\n }", "public static void testAlgos() {\n\t\tint[] array;\n\t\t//Test of sorts and searches\n\t\tint[] arrayTest = generateArray(20, -20, 20);\n\t\t//Bubble Sort\n\t\tarray = copyArray(arrayTest);\n\t\tSort.bubbleSort(array);\n\t\tSystem.out.println(\"Bubble Sorted Array:\");\n\t\tprintArray(array);\n\t\t//Selection Sort\n\t\tarray = copyArray(arrayTest);\n\t\tSort.selectionSort(array);\n\t\tSystem.out.println(\"Selection Sorted Array:\");\n\t\tprintArray(array);\n\t\t//Insertion Sort\n\t\tarray = copyArray(arrayTest);\n\t\tSort.insertionSort(array);\n\t\tSystem.out.println(\"Insertion Sorted Array:\");\n\t\tprintArray(array);\n\t\t//Quick Sort\n\t\tarray = copyArray(arrayTest);\n\t\tSort.quickSort(array);\n\t\tSystem.out.println(\"Quick Sorted Array:\");\n\t\tprintArray(array);\n\t\t//Merge Sort\n\t\tarray = copyArray(arrayTest);\n\t\tSort.mergeSort(array);\n\t\tSystem.out.println(\"Merge Sorted Array:\");\n\t\tprintArray(array);\n\t\t//Test of linear search on sorted array\n\t\tSystem.out.printf(\"%6s%6s%20s%20s%n\", \"Value\", \"Index\",\"Linear Result\",\"Binary Result\");\n\t\tSystem.out.printf(\"%6d%6d%20d%20d%n\", array[2], 2, Search.linearSearch(array, array[2]),Search.binarySearch(array, array[2]));\n\t\tSystem.out.printf(\"%6d%6d%20d%20d%n\", array[5], 5, Search.linearSearch(array, array[5]),Search.binarySearch(array, array[5]));\n\t\tSystem.out.printf(\"%6d%6d%20d%20d%n\", array[17], 17, Search.linearSearch(array, array[17]),Search.binarySearch(array, array[17]));\n\t\tSystem.out.printf(\"%6d%6d%20d%20d%n\", -40, -1, Search.linearSearch(array, -40),Search.binarySearch(array, -40));\n\t}", "Long[] searchSolution(int timeLimit, Graph g);", "void breach();", "public int allWordsHorizontal(Board board, Dictionary dictionary, Scrabble game, int moves){\n // Initializes variables\n testBoard = board;\n String topHWord = \"\";\n int topHScore = 0;\n int topHRow=0;\n int topHCol=0;\n boolean theWay = true;\n boolean found = false;\n ArrayList<Piece> piecesOfTopWord = new ArrayList<Piece>();\n\n // Goes through ever point on the board\n for (int row = 0; row < 15; row++){\n for (int col = 0; col < 15; col++) {\n if (game.numOfMoves()==0){\n row = 7;\n col = 7;\n }\n \n // The word to make at that point\n mustUse=new ArrayList<Character>();\n mustUseVert=new ArrayList<Character>(); \n int retHorz = anagramAtSquare(row,col,col,0,false, moves);\n int retVert = anagramAtSquareVert(row,col,row,0,false, moves);\n \n // Puts the word on the board and checks to make sure valid word, and if it is top word it stores information about the word for horizontal words\n ArrayList<String> allAnagrams = null;\n if (retHorz!=-1){\n allAnagrams = allWords(retHorz, mustUse);\n for (int inde = 0; inde < allAnagrams.size(); inde++){\n ArrayList<String> test = dictionary.anagram(allAnagrams.get(inde).toLowerCase());\n if(test != null){\n for (int all = 0; all < test.size(); all++) {\n if (addToBoardHor(col, row, all, test, board)) {\n if (game.isValidMove()||moves==0) {\n ArrayList<ArrayList<Piece>> words = new ArrayList<ArrayList<Piece>>();\n words.addAll(board.words());\n if (game.isValidWord(words)){\n int trackScore=0;\n trackScore=board.scoreAI(words);\n if (board.numNonPinned() == 7)\n trackScore+=50;\n if (trackScore>topHScore && game.getStrength()){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n\n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay= true;\n found = true;\n piecesOfTopWord = words.get(0);\n } else if (trackScore>topHScore && trackScore<15){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n\n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay= true;\n found = true;\n piecesOfTopWord = words.get(0);\n }\n }\n \n board.clearNonPinned();\n } else {\n board.clearNonPinned();\n }\n }\n }\n }\n }\n }\n \n // Puts the word on the board and checks to make sure valid word, and if it is top word it stores information about the word for Vertical words\n allAnagrams = null;\n if (retVert!=-1){\n allAnagrams = allWords(retVert, mustUse);\n for (int inde = 0; inde < allAnagrams.size(); inde++){\n ArrayList<String> test = dictionary.anagram(allAnagrams.get(inde).toLowerCase());\n if(test != null){\n for (int all = 0; all < test.size(); all++) {\n if (addToBoardVer(col, row, all, test, board)) {\n if (game.isValidMove()||moves==0) {\n ArrayList<ArrayList<Piece>> words = new ArrayList<ArrayList<Piece>>();\n words.addAll(board.words());\n if (game.isValidWord(words)){\n int trackScore=0;\n trackScore=board.scoreAI(words);\n if (board.numNonPinned() == 7)\n trackScore+=50;\n if (trackScore>topHScore && game.getStrength()){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n \n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay=false;\n found = true;\n piecesOfTopWord = words.get(0);\n } else if (trackScore>topHScore && trackScore<15){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n \n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay=false;\n found = true;\n piecesOfTopWord = words.get(0);\n }\n }\n \n board.clearNonPinned();\n } else {\n board.clearNonPinned();\n }\n }\n }\n }\n }\n }\n \n if (game.numOfMoves()==0){\n row = 15;\n col = 15;\n }\n \n }\n }\n \n System.out.println(\"Top Word: \" + topHWord + \" Score: \" + topHScore + \" Row: \" + topHRow + \" Col: \" + topHCol+ \" HorOrVert: \" + theWay);\n for (int i = 0; i < piecesOfTopWord.size(); i++) {\n System.out.print(piecesOfTopWord.get(i).theLetter());\n }\n System.out.println();\n \n for (int i = 0; i < playersPieces.size(); i++) {\n System.out.print(playersPieces.get(i).theLetter());\n }\n System.out.println();\n \n // Returns what move to make\n if (found){\n putOnBoard(topHRow, topHCol, theWay,topHWord, piecesOfTopWord, board);\n return 1;\n }\n else if (!game.isBagEmpty()){\n return 2;\n }else\n return 3;\n }", "public Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "private void AISelect() {\n\t\tRandom generator = new Random();\n\t\tcurrentPlayer = AI;\n\t\tint guessAttempts = 0;\n\t\tboolean paint = true;//If it remains true then the board will be repainted. Turns false when the AI can't move.\n\t\t\n\t\tif (!gameWon){\n\t\tdo {\n\t\t\t//Logic for next AI Guess\n\t\t\tint playerBoxes = 0;\n\t\t\tint aiBoxes = 0;\n\t\t\tint nextGuessRow = 0;\n\t\t\tint nextGuessColumn = 0;\n\t\t\tint boxesLeft = 0;\n\t\t\tint xGuessWin = -1;\n\t\t\tint yGuessWin = -1;\n\n\t\t\txGuess = generator.nextInt(DIVISIONS);\n\t\t\tyGuess = generator.nextInt(DIVISIONS);\n\t\t\t\n\t\t\t//Check whether any row has all but 1 box filled in all by either player. Moves at the empty space if so.\n\t\t\t\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){//Column\n\t\t\t\tfor (int j = 0; j<DIVISIONS; j++){//Row\n\t\t\t\t\tif (gameArray[i][j] == USER){\n\t\t\t\t\t\t//Add up user's boxes\n\t\t\t\t\t\tplayerBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == AI){\n\t\t\t\t\t\t//Add up AI's boxes\n\t\t\t\t\t\taiBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == NEITHER){\n\t\t\t\t\t\t//Add up empty boxes and store the empty spot\n\t\t\t\t\t\tboxesLeft++;\n\t\t\t\t\t\tnextGuessRow = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to block the user\n\t\t\t\t\txGuess = i;\n\t\t\t\t\tyGuess = nextGuessRow;\n\t\t\t\t}\n\t\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to win the game\n\t\t\t\t\txGuessWin = i;\n\t\t\t\t\tyGuessWin = nextGuessRow;\n\t\t\t\t}\n\t\t\t\tplayerBoxes = 0;\n\t\t\t\taiBoxes = 0;\n\t\t\t\tboxesLeft = 0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Check whether any column has all but 1 box filled in all by either player. Moves there if so.\n\t\t\tfor (int j = 0; j<DIVISIONS; j++){//Row\n\t\t\t\tfor (int i = 0; i<DIVISIONS; i++){//Column\n\t\t\t\t\tif (gameArray[i][j] == USER){\n\t\t\t\t\t\t//Add up user boxes in that column\n\t\t\t\t\t\tplayerBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == AI){\n\t\t\t\t\t\taiBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == NEITHER){\n\t\t\t\t\t\tboxesLeft++;\n\t\t\t\t\t\tnextGuessColumn = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to block\n\t\t\t\t\txGuess = nextGuessColumn;\n\t\t\t\t\tyGuess = j;\n\t\t\t\t}\n\t\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to win the game\n\t\t\t\t\txGuessWin = nextGuessColumn;\n\t\t\t\t\tyGuessWin = j;\n\t\t\t\t}\n\t\t\t\tplayerBoxes = 0;\n\t\t\t\taiBoxes = 0;\n\t\t\t\tboxesLeft = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//Check whether the top left to lower right diagonal has all but 1 box filled in\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][i] == USER){\n\t\t\t\t\tplayerBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][i] == AI){\n\t\t\t\t\taiBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][i] == NEITHER){\n\t\t\t\t\tboxesLeft++;\n\t\t\t\t\tnextGuessRow = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuess = nextGuessRow;\n\t\t\t\tyGuess = nextGuessRow;\n\t\t\t}\n\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuessWin = nextGuessRow;\n\t\t\t\tyGuessWin = nextGuessRow;\n\t\t\t}\n\t\t\tplayerBoxes = 0;\n\t\t\taiBoxes = 0;\n\t\t\tboxesLeft = 0;\n\t\t\t\n\t\t\t//Check whether the top left to lower right diagonal has all but 1 box filled in\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == USER){\n\t\t\t\t\tplayerBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == AI){\n\t\t\t\t\taiBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == NEITHER){\n\t\t\t\t\tboxesLeft++;\n\t\t\t\t\tnextGuessRow = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuess = nextGuessRow;\n\t\t\t\tyGuess = 2-nextGuessRow;\n\t\t\t}\n\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuessWin = nextGuessRow;\n\t\t\t\tyGuessWin = (DIVISIONS - 1)-nextGuessRow;\n\t\t\t}\n\t\t\tplayerBoxes = 0;\n\t\t\taiBoxes = 0;\n\t\t\tboxesLeft = 0;\n\t\t\t\n\t\t\tif (yGuessWin != -1 && xGuessWin != -1){\n\t\t\t\txGuess = xGuessWin;\n\t\t\t\tyGuess = yGuessWin;\n\t\t\t}\n\t\t\n\t\t\tguessAttempts++;//Iterate guess count. Acts as a failsafe to avoid perma-while looping. Results in a tie.\n\t\t\tif (guessAttempts >= DIVISIONS*DIVISIONS){\n\t\t\t\tpaint = false;\n\t\t\t\tgameTie = true;\n\t\t\t}\n\t\t\t} while (gameArray[xGuess][yGuess] != 0 && (guessAttempts <= (DIVISIONS * DIVISIONS)));\n\t\t\t\n\t\t\t//When the AI makes a guess, update the array and repaint the game board.\n\t\t\tif (paint){\n\t\t\t\tgameArray[xGuess][yGuess] = AI;\n\t\t\t}\n\t\t\tguessAttempts = 0;\n\t\t\t}\n\t\t\n\t\t\tcheckVictory();//Checks whether the AI won.\n\t\t\trepaint();\n\t}", "private Pair<Integer, Pair<Integer, Integer>> analyze(GameField gf, boolean isHuman) {\n ArrayList<Pair<Integer, Integer>> freeBoxes = gf.getEmptyFields();\n\n if (freeBoxes.isEmpty()) {\n return new Pair<>(0, null);\n }\n\n if (Game.updateStatus(gf) == WIN_O) {\n return new Pair<>(SITUATION_SCORE, null);\n }\n\n if (Game.updateStatus(gf) == WIN_X) {\n return new Pair<>(-SITUATION_SCORE, null);\n }\n\n\n ArrayList<Pair<Integer, Pair<Integer, Integer>>> moves = new ArrayList<>();\n\n for (Pair move : freeBoxes) {\n if (isHuman) {\n moves.add(analyze(new GameField(gf, (int)move.getKey(), (int)move.getValue(), HUMAN_MARK), false));\n } else {\n moves.add(analyze(new GameField(gf, (int)move.getKey(), (int)move.getValue(), AI_MARK), true));\n }\n }\n\n int bestMove = 0;\n int best;\n if (isHuman) {\n best = INF;\n for (int i = 0; i < moves.size(); i++) {\n if (moves.get(i).getKey() < best) {\n best = moves.get(i).getKey();\n bestMove = i;\n }\n }\n } else {\n best = -INF;\n for (int i = 0; i < moves.size(); i++) {\n if (moves.get(i).getKey() > best) {\n best = moves.get(i).getKey();\n bestMove = i;\n }\n }\n }\n\n return new Pair<>(best, freeBoxes.get(bestMove));\n }", "public void search(Creature c, Area area){\r\n LinkedList<Point> ary = new LinkedList<>();\r\n boolean searchSuccessful = false;\r\n for(int yPlus=-1;yPlus<2;yPlus++){\r\n for(int xPlus=-1;xPlus<2;xPlus++){\r\n if(yPlus!=0&&xPlus!=0){\r\n ary.add(new Point(c.x+xPlus, c.y+yPlus));\r\n if(area.map[c.y+yPlus][c.x+xPlus] instanceof HiddenTile && ((HiddenTile) area.map[c.y+yPlus][c.x+xPlus]).hidden){\r\n ((HiddenTile) area.map[c.y+yPlus][c.x+xPlus]).find(c);\r\n searchSuccessful = true;\r\n }\r\n }\r\n }\r\n }\r\n Main.animator.searchAnimation(ary, searchSuccessful);\r\n }", "Games game();", "public void runAlgorithm( AdjacencyListGraph<Point2D.Double, Double> g )\n\t{\n\t\tfor ( Vertex v : g.vertices() )\n\t\t{\n\t\t\tv.put ( VERTEX_STATUS, FREE );\n\t\t}\n\n\n\t\t// initialize all the edges of the graph as being FREE (not in the matching)\n\t\tfor ( Edge e : g.edges() )\n\t\t{\n\t\t\te.put ( EDGE_STATUS, FREE ); \n\t\t}\n\n\t\tdepthFirstSearch(g);\n\n\t\tfor(Vertex v : g.vertices())\n\t\t{\n\t\t\tif (v.get(VERTEX_STATUS) == FREE)\n\t\t\t{\n\t\t\t\tfor ( Edge e : g.incidentEdges(v) )\n\t\t\t\t{\n\t\t\t\t\tVertex w = g.opposite(v, e);\n\t\t\t\t\tif(v.get(VERTEX_STATUS) == FREE && w.get(VERTEX_STATUS) == FREE)\n\t\t\t\t\t{\n\t\t\t\t\t\te.put(EDGE_STATUS, MATCHED);\n\t\t\t\t\t\tv.put(VERTEX_STATUS, MATCHED);\n\t\t\t\t\t\tw.put(VERTEX_STATUS, MATCHED);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void task222(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tSystem.out.println(\"RED BLAST BST Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "public Node newAlphaBeta(Node node, boolean isMaximizing, Node[][] gameBoard,int playerID,int depth,boolean searchOnce) throws InterruptedException {\n\t\tif(depth==0) //node equals terminal node origin ***************************\n\t\t{\n\n\t\t\t\n\t\t\treturn node; //return heuristic value accumulated Score\n\t\t}\n\t\t\n\t\tif(isMaximizing == true)//max\n\t\t{\n\t\t\t\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint enescore=0;\n\t\t\tint nodesRx = 0;\n\t\t\tint nodesRy = 0;\n\t\t\tNode temNode = node;\n\t\t\t//opponent score\n\t\t\tif(node!=null)\n\t\t\t{\tenescore = node.enemy;\n\t\t\tnodesRx = node.maxrecordSearchedX;\n\t\t\tnodesRy = node.maxrecordSearchedY;}\n\t\t\t\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t\tcopyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t \n\t\t \n\t\t\tPriorityQueue<Node> playerOneChildrenList = new PriorityQueue<Node>(Collections.reverseOrder()); //use priorityQueue,acsending or disacsending.\n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\t\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\t\t\t\n\t\t\t\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\t\t\t \n\t\t\t\tNode takenNode =waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\ttakenNode.setAccumulated(newCopy[takenNode.getX()][takenNode.getY()].getScore());\n\t\t\t\ttakenNode.enemy = 0;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tconnected = true;\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\tif(connected == true)\n\t\t\t\t{\n\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()+newCopy[newX][newY].getScore());\n\t\t\t\t\t\t\t\tenescore-=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\ttakenNode.enemy = enescore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif(depth==1)\n\t\t\t\t{\n\t\n\t\t\t\t\ttakenNode.setAccumulated(node.getAccumulated()+takenNode.getAccumulated());\n\n\t\t\t\t}\n\t\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\tif(playerOneChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"asdas\");\n\t\t\t//\t\tSystem.out.println(\"A depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\tif(node!=null)\n\t\t\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(minValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\tcontinue;\n\t\n\t\t\t\t\t//\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\"B depth: \"+depth);\n\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\trecordDepth = depth;\n\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,false);\n\t\t\t\t\t//this.alpha = minValueNode;\n\t\t\t\t\t\n\t\t\t\t\tcounter++;\n\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\tif(node!=null)\n\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(minValueNode.getAccumulated()>this.beta.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\n\t\t\t\t\t\tif(depth == recordDepth)\n\t\t\t\t\t\t{\n\t\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\n\t\t\t\t\t\t\t\tthis.alpha = minValueNode;\n\t\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(playerOneChildrenList.peek().parentNode!=null||node!=null)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"returning: \"+playerOneChildrenList.peek().getAccumulated());\n\t\t\t//\tSystem.out.println(500);\n\t\t\tplayerOneChildrenList.peek().parentNode.setAccumulated(playerOneChildrenList.peek().getAccumulated());\n\t\t\tplayerOneChildrenList.peek().parentNode.noPoll = playerOneChildrenList.peek().noPoll;\n\n\t\t\treturn playerOneChildrenList.poll().parentNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerOneChildrenList.peek().nodeExpanded = counter;\n\t\t\t\treturn playerOneChildrenList.poll();\n\t\t\t}\n\t\t\n\t\t}else\n\t\tif(isMaximizing == false)//min\n\t\t{\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint currentEnescore = node.enemy;\n\t\t\tint nodesRx = node.maxrecordSearchedX;\n\t\t\tint nodesRy = node.maxrecordSearchedY;\n\t\t\tNode temNode = node;\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t copyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t\tPriorityQueue<Node> playerTwoChildrenList = new PriorityQueue<Node>(); \n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\n\t\t\t\tNode takenNode = waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\n\t\t\t\ttakenNode.setAccumulated(node.getAccumulated());\n\n\t\t\t\ttakenNode.enemy= currentEnescore+newCopy[takenNode.getX()][takenNode.getY()].getScore();\n\t\t\t\t\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\tconnected = true;\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\tif(connected == true)\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()-newCopy[newX][newY].getScore());\t\n\t\t\t\t\t\t\t\ttakenNode.enemy+=newCopy[newX][newY].getScore();\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\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(playerTwoChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t//\t\tSystem.out.println(\" C depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t\t{\n\t\t\t\t//\t\tSystem.out.println(maxValueNode.getAccumulated()+\" \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t//node.noPoll = true;\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\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t\t//\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"the discard value: \"+maxValueNode.getAccumulated()+\" compareTo: \"+this.alpha.getAccumulated());\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\" D depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,false);\n\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\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(depth == recordDepth-1)\n\t\t\t\t\t{\n\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\n\t\t\t\t\t\t\tthis.beta = maxValueNode;\n\t\t\t\t\t\t\tSystem.out.println(\"beta: \"+this.beta.getAccumulated());\n\t\t\t\t\t\t\t//Thread.sleep(5000);\n\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t}\n\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t//\t{\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\t}\n\t\t\tplayerTwoChildrenList.peek().parentNode.setAccumulated(playerTwoChildrenList.peek().getAccumulated());\n\n\t\t\treturn playerTwoChildrenList.poll().parentNode;\n\t\t}\n\t\treturn null;\n\t\n\t}", "public static void main(String[] args) {\n Queue<Queue<Integer>> queues = new Queue<>(QUEUE_COUNT);\n // create and insert game queues\n for (int i = 0; i < QUEUE_COUNT; i++) {\n // our capacity is 7\n Queue<Integer> q = new Queue<>(QUEUE_CAPACITY);\n queues.enqueue(q);\n }\n\n boolean turn = true; // true -> player 1, false -> player 2\n boolean allFull;\n while (true) {\n allFull = true; // reset\n\n // user plays\n int randomQueue = randQueue();\n int randomNumber = randNumber();\n\n // if random selected queue is full, select another\n while (queues.elementAt(randomQueue).isFull())\n randomQueue = randQueue();\n\n // enqueue number to selected queue\n queues.elementAt(randomQueue).enqueue(randomNumber);\n\n // print current state to screen\n System.out.println(\"\\nUser\" + (turn ? 1 : 2) + \":\");\n for (int qi = 0; qi < QUEUE_COUNT; qi++) {\n Queue<Integer> q = queues.elementAt(qi);\n System.out.println(\"Q\" + (qi + 1) + \" \" + q.toString());\n }\n\n // SEQUENCES\n // =========\n\n // flag for indicating if any sequence is encountered during search\n boolean hasSequence = false;\n\n // HORIZONTAL SEQUENCES\n for (int i = 0; i < QUEUE_COUNT; i++) {\n Queue<Integer> q = queues.elementAt(i);\n if (q.size() < 3)\n continue;\n\n for (int j = 1; j < q.size() - 1; j++) {\n // skip first and last element and check through windows across queue, sized 3\n if (isSequence(q.elementAt(j - 1), q.elementAt(j), q.elementAt(j + 1))) {\n hasSequence = true;\n break;\n }\n }\n\n // already found a sequence? stop.\n if (hasSequence)\n break;\n }\n\n // no need to play further or check the terminal conditions\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // VERTICAL SEQUENCES\n\n // find smallest queue\n int minLength = 999;\n for (int i = 0; i < QUEUE_COUNT; i++)\n if (queues.elementAt(i).size() < minLength)\n minLength = queues.elementAt(i).size();\n\n for (int i = 0; i < minLength; i++) {\n if (isSequence(queues.elementAt(0).elementAt(i), queues.elementAt(1).elementAt(i), queues.elementAt(2).elementAt(i))) {\n hasSequence = true;\n break;\n }\n }\n\n if (hasSequence) {\n allFull = false;\n break;\n }\n\n // are queues full?\n for (int i = 0; i < QUEUE_COUNT; i++) {\n allFull = allFull && queues.elementAt(i).isFull();\n }\n\n if (allFull) {\n break;\n }\n\n turn = !turn;\n }\n\n System.out.println();\n if (allFull) {\n System.out.println(\"Tie!\");\n } else {\n System.out.println(\"winner: User\" + (turn ? 1 : 2));\n }\n }", "public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }", "public IterativeDeepeningAlphaBetaSearch(Game<S, A, P> game, double utilMin, double utilMax,\n int time) {\n this.game = game;\n this.utilMin = utilMin;\n this.utilMax = utilMax;\n this.timer = new Timer(time);\n }", "@Test\n\tvoid testOccurrencesAfterBigram() {\n\t\tOccurrencesAfterBigram tester = new OccurrencesAfterBigram();\n\t\tassertArrayEquals(new String[] { \"girl\", \"student\" },\n\t\t\t\ttester.findOcurrences(\"alice is a good girl she is a good student\", \"a\", \"good\"));\n\t\tassertArrayEquals(new String[] { \"we\", \"rock\" },\n\t\t\t\ttester.findOcurrences(\"we will we will rock you\", \"we\", \"will\"));\n\t}", "public static void main(String[] args) {\r\n\t\t // SET UP: user input versus a heuristic monte carlo simulator vs a random player\r\n\t\t{\r\n\t\t\tPlayer[] players = new Player[]{new Player(\"user\", DecisionType.SCANNER), new Player(\"monte carlo\", DecisionType.HEURISTIC_MONTE_CARLO_10000), new Player(\"random\", DecisionType.RANDOM)};\r\n\t\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\tplayers[0].setScanner(scanner);\r\n\r\n\t\t\tGame game = new Game(players, true, false);\r\n\t\t\tint numRounds = 10;\r\n\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n\t\t\t\tgame.startNewRound();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// SET UP: three players (three user input players)\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"1\", DecisionType.SCANNER), new Player(\"2\", DecisionType.SCANNER), new Player(\"3\", DecisionType.SCANNER)};\r\n//\t\t\tScanner scanner = new Scanner(System.in);\r\n//\t\t\tplayers[0].setScanner(scanner);\r\n//\t\t\tplayers[1].setScanner(scanner);\r\n//\t\t\tplayers[2].setScanner(scanner);\r\n//\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\t// SET UP: a heuristic monte carlo player vs a monte carlo player vs a random player\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"heuristic monte carlo\", DecisionType.HEURISTIC_MONTE_CARLO_10000), new Player(\"monte carlo\", DecisionType.MONTE_CARLO_10000), new Player(\"random\", DecisionType.RANDOM)};\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\t// SET UP: three random players\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"1\", DecisionType.RANDOM), new Player(\"2\", DecisionType.RANDOM), new Player(\"3\", DecisionType.RANDOM)};\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\t}", "public BattleSimulator findBattle(){\r\n\r\n List<Enemy> enemies = world.getEnemies();\r\n Character character = world.getCharacter();\r\n List<MovingEntity> activeStructures = world.getActiveStructures();\r\n List<MovingEntity> friendlyEntities = world.getFriendlyEntities();\r\n List<Ally> allies = world.getAllies();\r\n\r\n\r\n // Create potentialFighting list which begins with all enemies in the world\r\n ArrayList<MovingEntity> potentialFighting = new ArrayList<MovingEntity>(enemies);\r\n ArrayList<MovingEntity> fighters = new ArrayList<MovingEntity>();\r\n List<Pair<MovingEntity, Double>> pairEnemyDistance = new ArrayList<Pair<MovingEntity, Double>>();\r\n ArrayList<MovingEntity> structures = new ArrayList<MovingEntity>();\r\n\r\n // For each enemy in potentialFighting, find the distance from enemy to character \r\n // If character is in battle radius of enemy, add enemy to a pairEnemyDistance list, remove them from potentialFighting list\r\n for(MovingEntity enemy: enemies) {\r\n double distanceSquaredBR = inRangeOfCharacter(character, enemy, enemy.getBattleRadius());\r\n if(distanceSquaredBR >= 0){\r\n potentialFighting.remove(enemy);\r\n Pair<MovingEntity, Double> pairEnemy = new Pair<MovingEntity, Double>(enemy, distanceSquaredBR);\r\n pairEnemyDistance.add(pairEnemy);\r\n }\r\n }\r\n // if no enemies within battle radius, no battle happens\r\n if (pairEnemyDistance.size() == 0) {\r\n return null;\r\n \r\n // else a battle is about to begin!!!\r\n } else if(pairEnemyDistance.size() > 0) {\r\n // For remaining enemies in potentialFighting list, if fighters list size > 0 and if character is in support radius of that enemy\r\n // also add that enemy to pairEnemyDistance list\r\n for(MovingEntity enemy : potentialFighting){\r\n double distanceSquaredSR = inRangeOfCharacter(character, enemy, enemy.getSupportRadius());\r\n if(distanceSquaredSR >= 0){\r\n Pair<MovingEntity, Double> pairEnemy = new Pair<MovingEntity, Double>(enemy, distanceSquaredSR);\r\n pairEnemyDistance.add(pairEnemy);\r\n }\r\n }\r\n }\r\n\r\n // Sort pairEnemyDistance list by distance of enemy to character, so that the closest enemy is first, the furthest enemy is last\r\n Collections.sort(pairEnemyDistance, new Comparator<Pair<MovingEntity, Double>>() {\r\n @Override\r\n public int compare(final Pair<MovingEntity, Double> p1, final Pair<MovingEntity, Double> p2) {\r\n if(p1.getValue1() > p2.getValue1()) {\r\n return 1;\r\n } else {\r\n return -1;\r\n }\r\n }\r\n });\r\n\r\n // Take all enemies from sorted pairEnemyDistance and add to fighters list\r\n for(Pair<MovingEntity, Double> pairEnemy : pairEnemyDistance) {\r\n fighters.add(pairEnemy.getValue0());\r\n }\r\n \r\n // For each tower, find the distance from tower to character\r\n // If character is in the support radius of tower, add tower to structure list\r\n if(activeStructures.size() > 0){\r\n for(MovingEntity structure : activeStructures) {\r\n if(structure.getID().equals(\"TowerBattler\")) {\r\n double distanceSquaredSR = inRangeOfCharacter(character, structure, structure.getSupportRadius());\r\n if(distanceSquaredSR >= 0){\r\n structures.add(structure);\r\n }\r\n }\r\n }\r\n }\r\n // If character is in the support radius of friendly entities, add to fighters\r\n if(friendlyEntities.size() > 0){\r\n for(MovingEntity friendly : friendlyEntities) {\r\n double distanceSquaredSR = inRangeOfCharacter(character, friendly, friendly.getSupportRadius());\r\n if(distanceSquaredSR >= 0){\r\n fighters.add(friendly);\r\n }\r\n }\r\n }\r\n \r\n // Add all allies to fighters list\r\n for(Ally ally : allies) {\r\n fighters.add(ally);\r\n }\r\n\r\n // Construct BattleSimulator class with character, fighters, structures\r\n BattleSimulator battle = new BattleSimulator(character, fighters, structures);\r\n\r\n // battle is about to begin!\r\n return battle;\r\n }", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\n Map<String, Integer> nyt;\n nyt = new HashMap<String, Integer>();\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt(), m = scan.nextInt();\n scan.nextLine();\n int cont = 0;\n seen = new boolean[193];\n g = new ArrayList[193];\n\n for (int i = 0; i < 193; i++) {\n g[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n String[] value = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(value[0])) {\n nyt.put(value[0], cont);\n cont++;\n }\n if (!nyt.containsKey(value[1])) {\n nyt.put(value[1], cont);\n cont++;\n }\n\n int u = nyt.get(value[0]);\n int v = nyt.get(value[1]);\n g[u].add(v);\n }\n boolean ok;\n for (int i = 0; i < m; i++) {\n ok = true;\n String[] trump = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(trump[0]) || !nyt.containsKey(trump[1])) {\n System.out.println(\"Pants on Fire\");\n } else {\n\n dfs(nyt.get(trump[0]));\n if (seen[nyt.get(trump[1])]) {\n System.out.println(\"Fact\");\n ok = false;\n }\n\n if (ok) {\n seen = new boolean[193];\n dfs(nyt.get(trump[1]));\n if (seen[nyt.get(trump[0])]) {\n System.out.println(\"Alternative Fact\");\n } else {\n System.out.println(\"Pants on Fire\");\n }\n\n }\n\n }\n seen = new boolean[193];\n\n }\n\n }", "public int h(int [] i, GameState a) \n\t{\n\t\tint sum = 0;//the sum of the moves it would take for the current games stae to be the goal state\n\t\tint temp;//this is the index of the varibale for the goal state\n\t\tfor(int r = 0; r<18; r++) //loop thouth the arrays\n\t\t{\n\t\t\tif(a.getBoard()[r] != i[r]) //if the places in the current gamestate is not the same as the place in the goal state then\n\t\t\t{\n\t\t\t\ttemp= r;\n\t\t\t\tfor(int z = 0; z<18; z++) \n\t\t\t\t{\n\t\t\t\t\tif(a.getBoard()[temp]==i[z]) {\n\t\t\t\t\t\tsum = sum + Math.abs(temp-z);//add to the count\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn sum;//return the count\n\t}", "public abstract void mo20158a(GameIndex gameIndex);", "@Override\n public void actionPerformed(ActionEvent e) {\n m_testGame.setTitle(searchGameText.getText());\n try {\n if(m_fileManager1.isGameInList(m_testGame)){ // if the game is in the file\n m_NewSearchResult = m_fileManager1.gamesSearchResult(m_testGame); //makes a new com.cs_group.objects.GameList with the search Result\n ChangeEvent event = new ChangeEvent(this);\n for (ChangeListener listener : m_addAnotherGame) {\n listener.stateChanged(event);\n }\n }else { JOptionPane.showMessageDialog(null, \"GAME NOT FOUND\", \"ERROR\", JOptionPane.ERROR_MESSAGE);}\n } catch (IOException | ParseException ioException) {\n ioException.printStackTrace();\n }\n }", "public static void main (String args[]) {\n\t\tint[][] ar = BandedArraySearch.create(13);\n\t\tnew BandedArraySolution(ar).trial();\n\t}", "public void run() {\n\t\tArrays.fill(label, NOT_AN_INDEX);\r\n\t\t\r\n\t\t// while there is a u in V with considered[u]=0 and mate[u]=0 do\r\n\t\tstage: for (int u = 0; u < gOrig.numVertices(); u++ ) {\r\n\t\t\t// if(mate[u] == NOT_AN_INDEX){\r\n\t\t\tif (gOrig.vertex(u) == null) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (matching.matches() == gOrig.numVertices() / 2) {\r\n\t\t\t\t// we are done\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSystem.out.print(String.format(\"considering vertex u%d\\n\", u));\r\n\t\t\tif ( ! matching.isMatched(u)) {\r\n\t\t\t\t\r\n\t\t\t\t// considered[u]=1,A={empty}\r\n\t\t\t\t// A = new WeightedDigraph(gOrig.numVertices()/2);\r\n\t\t\t\tA.clear();\r\n\t\t\t\t\r\n\t\t\t\t// forall v in V do exposed[v]=0\r\n\t\t\t\tArrays.fill(exposed, NOT_AN_INDEX);\r\n\t\t\t\t\r\n\t\t\t\t// Construct the auxiliary digraph\r\n\t\t\t\t\r\n\t\t\t\t// for all (v,w) in E do\r\n\t\t\t\tfor (int v = 0; v < gOrig.numVertices(); v++ ) {\r\n\t\t\t\t\tfor (Edge e : gOrig.eOuts(v)) {\r\n\t\t\t\t\t\tint w = e.right;\r\n\t\t\t\t\t\tassert e.left == v : \"vertex correspondence is wrong\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// if mate[w]=0 and w!=u then exposed[v]=w else if mate[w] !=v,0 then A=union(A,{v,mate[w]})\r\n\t\t\t\t\t\t// if(mate[w] == NOT_AN_INDEX && w != u){\r\n\t\t\t\t\t\t// exposed[v] = w;\r\n\t\t\t\t\t\t// }else if(mate[w] != v && mate[w] != NOT_AN_INDEX){\r\n\t\t\t\t\t\t// A.addEdge(new Edge(v,mate[w]));\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( ! matching.isMatched(w) && w != u) {\r\n\t\t\t\t\t\t\t// DEBUG(String.format(\"adding (%d,%d) to exposed\\n\", v, w));\r\n\t\t\t\t\t\t\tif (exposed[v] == NOT_AN_INDEX) {\r\n\t\t\t\t\t\t\t\texposed[v] = w;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (matching.mate(w) != v && matching.isMatched(w)) {\r\n\t\t\t\t\t\t\t// DEBUG(String.format(\"adding (%d,%d) to A\\n\", v, matching.mate(w)));\r\n\t\t\t\t\t\t\tA.add(new Edge(v, matching.mate(w)));\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\tDEBUG(String.format(\"Exposed vertices={%s}\\n\", printExposed()));\r\n\t\t\t\tif (exposed().size() == 0) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// forall v in V do seen[v]=0\r\n\t\t\t\tArrays.fill(seen, false);\r\n\t\t\t\t\r\n\t\t\t\t// Q={u}; label[u]=0; if exposed[u]!=0 then augment(u), goto stage;\r\n\t\t\t\tQ.clear();\r\n\t\t\t\tQ.add(u);\r\n\t\t\t\tArrays.fill(label, NOT_AN_INDEX);// unsure whether it was meant to clear label or just unset label[u] OLD_CODE=label[u] = NOT_AN_INDEX;\r\n\t\t\t\tif (isExposed(u)) {\r\n\t\t\t\t\taugment(u);\r\n\t\t\t\t\tDEBUG(String.format(\"new matching %s\\n\", matching.toString()));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// need to figure out how to handle blossom()\r\n\t\t\t\t\r\n\t\t\t\t// while Q != {empty} do\r\n\t\t\t\twhile ( ! Q.isEmpty()) {\r\n\t\t\t\t\tint v = Q.pop();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// forall unlabeled nodes w in V such that (v,w) in A\r\n\t\t\t\t\tfor (Edge e : A) {\r\n\t\t\t\t\t\tint w = e.left;\r\n\t\t\t\t\t\tif (e.right == v && label[w] == NOT_AN_INDEX && label[v] != w) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Q=union(Q,w), label[w]=v\r\n\t\t\t\t\t\t\tif ( ! Q.contains(w)) {\r\n\t\t\t\t\t\t\t\tQ.offer(w);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tcontinue; ///THIS CONTINUE WAS ADDED LATE AT NIGHT\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlabel[w] = v;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// seen[mate[w]] = 1;\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tint mate = findMate(w);\r\n\t\t\t\t\t\t\t\tseen[mate] = true;\r\n\t\t\t\t\t\t\t}catch(Exception err){\r\n\t\t\t\t\t\t\t\tDEBUG(String.format(\"error marking mate of %d as seen, mate not found\\n\", w));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// if exposed[w]!=0 then augment(w) goto stage;\r\n\t\t\t\t\t\t\tif (isExposed(w)) {\r\n\t\t\t\t\t\t\t\taugment(w);\r\n\t\t\t\t\t\t\t\tDEBUG(String.format(\"new matching %s\\n\", matching.toString()));\r\n\t\t\t\t\t\t\t\tcontinue stage;\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// if seen[w]=1 then blossom(w)\r\n\t\t\t\t\t\t\tif (seen[w]) {\r\n\t\t\t\t\t\t\t\tblossom(w);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// remove loops created by the blossoms\r\n\t\t\t\t\tremoveSelfLoops(A);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void task2(int nUMS, BinarySearchTree<Integer> t) {\n\t\tSystem.out.println(\"Binary Search Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t}", "public static void main(String args[]){\n int count = 1; \n long time1, time2;\n long redSum= 0;\n long blackSum =0;\n char[][] board = {\n {'W','B','W','B','W','B','W','B'},\n {'B','W','B','W','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','E','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','W','B','W','B','X'},\n {'X','B','X','B','X','B','X','B'},\n {'B','X','B','W','B','W','B','W'}\n \n } ;\n \n char[][] oldBoard = board;\n System.out.println(\"WIBB\");\n printBoard(board);\n while(count>0){\n \n time1 = new Date().getTime();\n for(int i =0; i<6; i++){\n \n // AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, i);\n \n //isRedAI.getBestMove();\n \n }\n ArrayList<MoveCoordinates> aThing = new ArrayList<>();\n \n AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, 3, aThing);\n // time1 = new Date().getTime();\n BoardMovesPair best= isRedAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nRed's turn: \" + (count +1) );\n redSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n printBoard(board);\n ArrayList<MoveCoordinates> allMoves = best.getAllMoves();\n if(allMoves == null){\n \n System.out.println(\"IS A NULL!!!\");\n \n }\n for(int i =0; i<allMoves.size(); i++){\n \n \n System.out.println(allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n \n AlphaBetaTree isBlackAI = new AlphaBetaTree(null, false, 0, -1000, 1000, 0, board, 3, aThing);\n \n \n time1 = new Date().getTime();\n best = isBlackAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nBlacks's turn: \" + (count +1) );\n blackSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n \n printBoard(board);\n \n allMoves = best.getAllMoves();\n for(int i =0; i<allMoves.size(); i++){\n \n System.out.println(\"UM!? \" + allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n count--;\n System.out.println(\"Count is: \" +count);\n }\n System.out.println(\"Red pieces: \" + BoardUtilities.countPieces('O', board));\n System.out.println(\"Red Kings: \" + BoardUtilities.countPieces('E', board));\n System.out.println(\"Average move: \" + (redSum/(count+1)) + \"ms\" );\n \n System.out.println(\"Black pieces: \" + BoardUtilities.countPieces('X', board));\n System.out.println(\"Black Kings: \" + BoardUtilities.countPieces('K', board));\n System.out.println(\"Average move: \" + (blackSum/(count+1)) + \"ms\" );\n printBoard(board);\n \n }", "public int AI(){\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==2 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //checks for horizontals (Y-YY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontals (YY-Y)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for horizontals (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i+3==5)||\n (i+2==4&&board[5][j]!=0)||\n (i+1==3&&board[5][j]!=0&&board[4][j]!=0)||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0)||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0)||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==0 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i==2&&board[5][j+1]!=0)||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0)||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==0 && board[i][j+3]==2){\n if((i==2&&board[5][j+2]!=0&&board[4][j+2]!=0)||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0)||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==0){\n if((i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0)||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0)||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==0 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==0 && board[i+3][j+3]==2){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //BLOCK CHECKER\n //columns\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==1 && board[i+2][j]==1 && board[i+3][j]==1){\n return j; \n }\n }\n }\n //Checks for blocks horizontal (R-RR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontal blocks (RR-R)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n \n //checks for horizontals (-RRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (RRR-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+3==5)||\n (i+2==4&&board[i+3][j]!=0)||\n (i+1==3&&board[i+3][j]!=0&&board[i+2][j]!=0)||\n (i==2&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0)||\n (i==1&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0)||\n (i==0&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0&&board[i-1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (R-RR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==0 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+2==4&&board[i+3][j+1]!=0)||\n (i+1==3&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0)||\n (i==2&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0)||\n (i==1&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0)||\n (i==0&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0&&board[i-1][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (RR-R)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==0 && board[i][j+3]==1){\n if((i==2&&board[i+2][j+2]!=0)){//||\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (RRR-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==0){\n if((i==0&&board[1][j+3]!=0)||\n (i==1&&board[2][j+3]!=0)||\n (i==2&&board[3][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal blocks(-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal blocks(Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==0 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==0 && board[i+3][j+3]==1){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //INTERMEDIATE BLOCKING\n //If horizontal (RR--) make it (RRY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--RR) make it (-YRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n //The following attempts to set the computer up for a win, instead of first just generating a random number\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i+1][j]==0 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //If horizontal (-YY-) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //If horizontal (YY--) make it (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--YY) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n boolean sent = false;\n //The following code will simply generate a random number.\n int x = (int)((Math.random())*7);\n if(!wonYet){ \n while(!sent){\n if(board[0][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[1][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[2][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[3][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[4][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[5][x]!=0)\n x = (int)((Math.random())*7);\n sent = true;\n } \n return x;\n }\n return -1; \n }", "public static int Main()\n\t{\n\t\t//????i???,j?,hang????????lie????num???????h????????l?????\n\t\tint i;\n\t\tint j;\n\t\tint[] h = new int[5];\n\t\tint[] l = new int[5];\n\t\tint hang = 0;\n\t\tint lie;\n\t\tint num;\n\t\tint[][] a = new int[5][5];\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\ta[i][j] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\th[i] = a[i][0]; //???????????????\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\tif (a[i][j] > h[i])\n\t\t\t\t{\n\t\t\t\t\th[i] = a[i][j]; //??????h?????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (j = 0; j < 5; j++)\n\t\t{\n\t\t\t\tl[j] = a[0][j];\n\t\t\t\tfor (i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tif (a[i][j] < l[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tl[j] = a[i][j]; //???l\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++) //??????\n\t\t\t{\n\t\t\t\t//??????????????????\n\t\t\t\tif ((a[i][j] == h[i]) && (a[i][j] == l[j]))\n\t\t\t\t{\n\t\t\t\t\thang = i + 1; //hang?i??,??hang????0\n\t\t\t\t\tlie = j + 1; //lie?j??\n\t\t\t\t\tnum = a[i][j]; //???a[i][j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (hang == 0) //??hang??0????????????\n\t\t{\n\t\t\tSystem.out.print(\"not found\");\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//??????\n\t\t\tSystem.out.print(hang);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(lie);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(num);\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\n\t\treturn 0;\n\t}", "public synchronized void startSolving()\n/* */ {\n/* 373 */ setKeepSolving(true);\n/* */ \n/* */ \n/* 376 */ if ((!this.solving) && (this.iterationsToGo > 0))\n/* */ {\n/* */ \n/* 379 */ setSolving(true);\n/* 380 */ setKeepSolving(true);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 387 */ fireTabuSearchStarted();\n/* */ \n/* */ \n/* */ \n/* 391 */ TabuSearch This = this;\n/* */ \n/* 393 */ Thread t = new Thread(new Runnable() {\n/* */ private final TabuSearch val$This;\n/* */ \n/* */ public void run() {\n/* 397 */ while ((MultiThreadedTabuSearch.this.keepSolving) && (MultiThreadedTabuSearch.this.iterationsToGo > 0))\n/* */ {\n/* */ \n/* 400 */ synchronized (this.val$This)\n/* */ {\n/* 402 */ MultiThreadedTabuSearch.this.iterationsToGo -= 1;\n/* */ try\n/* */ {\n/* 405 */ MultiThreadedTabuSearch.this.performOneIteration();\n/* */ }\n/* */ catch (NoMovesGeneratedException e)\n/* */ {\n/* 409 */ if (SingleThreadedTabuSearch.err != null)\n/* 410 */ SingleThreadedTabuSearch.err.println(e);\n/* 411 */ MultiThreadedTabuSearch.this.stopSolving();\n/* */ }\n/* */ catch (NoCurrentSolutionException e)\n/* */ {\n/* 415 */ if (SingleThreadedTabuSearch.err != null)\n/* 416 */ SingleThreadedTabuSearch.err.println(e);\n/* 417 */ MultiThreadedTabuSearch.this.stopSolving();\n/* */ }\n/* 419 */ MultiThreadedTabuSearch.this.incrementIterationsCompleted();\n/* 420 */ this.val$This.notifyAll();\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 425 */ synchronized (this.val$This)\n/* */ {\n/* */ \n/* */ \n/* 429 */ MultiThreadedTabuSearch.this.setSolving(false);\n/* 430 */ MultiThreadedTabuSearch.this.setKeepSolving(false);\n/* */ \n/* */ \n/* 433 */ if (MultiThreadedTabuSearch.this.helpers != null)\n/* 434 */ for (int i = 0; i < MultiThreadedTabuSearch.this.helpers.length; i++)\n/* 435 */ MultiThreadedTabuSearch.this.helpers[i].dispose();\n/* 436 */ MultiThreadedTabuSearch.this.helpers = null;\n/* */ \n/* */ \n/* 439 */ MultiThreadedTabuSearch.this.fireTabuSearchStopped();\n/* 440 */ this.val$This.notifyAll(); } } }, \"MultiThreadedTabuSearch-Master\");\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 448 */ t.setPriority(this.threadPriority);\n/* 449 */ t.start();\n/* */ }\n/* 451 */ notifyAll();\n/* */ }", "public static void searchTest() {\n\t\t//linear tests\n\t\tStopWatch1 timer;\n\t\tint[] array = generateArray(5000000,1,5000000);\n\t\tSystem.out.printf(\"%15s%10s%10s%10s%10s%10s%n\",\"Size\",\"Sort Type\",\"Pre-sort\",\"Value\",\"Index\",\"Time\");\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Random\",temp);\n\t\t\ttimer.start();\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\ttimer.stop();\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t\t\n\t\t}\n\t\tSort.mergeSort(array);\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Sorted\",temp);\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t\tfor(int i =0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Binary\",\"Sorted\",temp);\n\t\t\tint result = Search.binarySearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t}", "SearchResult search(State root, List<State> expanded_list, State goal);", "public void play() {\n List<String> playersData = getGameInput().getPlayersData();\n for (int id = 0; id < playersData.size() / Constants.DATAENTITY; id++) {\n getHeroes().add(getHeroFactory().getHero(\n playersData.get(id * Constants.DATAENTITY),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSY)),\n id));\n }\n // We create the angels and add them to angels list.\n List<Integer> numOfAngels = getGameInput().getNumOfAngels();\n List<String> angelsData = getGameInput().getAngelsData();\n for (int i = 0; i < angelsData.size() / Constants.DATAENTITY; i++) {\n getAngels().add(getAngelsFactory().getAngel(\n angelsData.get(i * Constants.DATAENTITY),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSY))));\n }\n\n getUtl().prepareAdmins();\n\n int angelCounter = 0; // To iterate through all angels only once.\n // We start the actual game.\n for (int i = 0; i < getMovements().size(); i++) { // For every round.\n\n getUtl().printRound(i + 1); // We start printing from round 1...\n\n for (int j = 0; j < getHeroes().size(); j++) {\n /* Apply overtime ability if the case and then hero chooses\n * strategy and moves if he is not rooted. Lastly we decrease\n * the amount of rounds that a hero must be affected by. */\n if (!getHeroes().get(j).isDead()) {\n if (getHeroes().get(j).isAffectedByAoT()) {\n getUtl().applyAoT(getHeroes().get(j));\n }\n if (!getHeroes().get(j).isRooted()) {\n getHeroes().get(j).chooseStrategy();\n getHeroes().get(j).move(getMovements().get(i).get(j));\n }\n if (getHeroes().get(j).isAffectedByAoT()) {\n getHeroes().get(j).setAffectedByAoTRounds(\n getHeroes().get(j).getAffectedByAoTRounds()\n - 1);\n }\n }\n }\n\n // Check if there are any players on the same terrain.\n for (int j = 0; j < getHeroes().size(); j++) {\n for (int k = 0; k < getHeroes().size(); k++) {\n if (k == j) {\n continue; // So a hero doesn't fight himself.\n }\n if ((getHeroes().get(j).getPosX()\n == getHeroes().get(k).getPosX())\n && (getHeroes().get(j).getPosY()\n == getHeroes().get(k).getPosY())) {\n // If they are both alive, fight.\n if (!getHeroes().get(j).isDead()\n && !getHeroes().get(k).isDead()) {\n getUtl().fight(getHeroes().get(k),\n getHeroes().get(j), getMap());\n }\n }\n }\n }\n\n // Selecting the angels that appear on round i\n for (int j = 0; j < numOfAngels.get(i); j++) {\n getUtl().spawnAngel(getAngels().get(angelCounter));\n for (int k = 0; k < getHeroes().size(); k++) {\n /* Checking if the selected angel and player k are on the\n * same terrain. */\n if (getAngels().get(angelCounter).getPosX()\n == getHeroes().get(k).getPosX()\n && (getAngels().get(angelCounter).getPosY()\n == getHeroes().get(k).getPosY())) {\n getUtl().affectHeroByAngel(\n getAngels().get(angelCounter),\n getHeroes().get(k));\n }\n }\n angelCounter++;\n }\n\n // When round is complete, everyone can fight again\n for (AbstractHero hero : getHeroes()) {\n hero.setFought(false);\n }\n getUtl().getOutput().add(\"\\n\");\n }\n printResults();\n }", "public static void main(String...args){\n\t\tint[] whitelist = new int[10];\n\t\tfor(int i=0; i<10; i++){\n\t\t\twhitelist[i] = new Random().nextInt(1000);\t\t\t\n\t\t}\n\t\t\n\t\t//sort the list\n\t\tArrays.sort(whitelist);\n\t\tfor(int i=0; i<10; i++){\n\t\t\tSystem.out.print(whitelist[i]+\", \");\n\t\t}\n\t\t\n\t\tint key = new Random().nextInt(1000);\n\t\tint res = binarySearch(key, whitelist);\n\t\tSystem.out.println(\"\\n二分搜索数字\" + key + \",得:\" + res);\n\t}", "ArrayList<int[]> findValidMoves();", "public List<Vertex> runTabuSearch() {\r\n\t\tBestPath = convertPath(ClothestPath.findCycle(this.vertexGraph, this.edgeGraph, this.isOriented));\r\n\t\tLastPath = new ArrayList<Vertex>(BestPath);\r\n\t\tint BestEval = fit(BestPath);\r\n\t\thistoBestPath.add(new ArrayList<Vertex>(BestPath));\r\n\r\n\t\tint iteration_actuel = 0;\r\n\t\twhile (iteration_actuel < this.numberIteration) {\r\n\t\t\tLastPath = newPath();\r\n\t\t\t\r\n\t\t\tif(LastPath.isEmpty()) {\r\n\t\t\t\titerationReal = iteration_actuel;\r\n\t\t\t\treturn BestPath;\r\n\t\t\t}\r\n\r\n\t\t\tif (fit(LastPath) < BestEval) {\r\n\t\t\t\tBestPath = new ArrayList<Vertex>(LastPath);\r\n\t\t\t\tBestEval = fit(LastPath);\r\n\t\t\t\thistoBestPath.add(new ArrayList<Vertex>(BestPath));\r\n\t\t\t}\r\n\r\n\t\t\titeration_actuel++;\r\n\t\t}\r\n\r\n\t\titerationReal = iteration_actuel;\r\n\t\treturn BestPath;\r\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 }", "public void findSolution() {\n\t\tif (lenA > lenB) {\n\t\t\toptPairs = new String[lenB];\n\t\t} else {\n\t\t\toptPairs = new String[lenA];\n\t\t}\n\n\t\tint counter = 0;\n\t\tint i = lenA;\n\t\tint j = lenB;\n\n\t\twhile(i>0 && j>0) {\n\t\t\tif (optArray[i][j] == g+optArray[i-1][j]) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\telse if (optArray[i][j] == g+optArray[i][j-1]) {\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toptPairs[counter] = i + \" \" + j;\n\t\t\t\tcounter++;\n\t\t\t\ti--;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\n\t\tpairNum = counter;\n\n\t}", "public void startSearch() {\n if (solving) {\n Alg.Dijkstra();\n }\n pause(); //pause state\n }", "public static int search (String searching)\n {\n ListAlbum listAlbum = new ListAlbum(true, false, false);\n AlbumXmlFile.readAllAlbumsFromDataBase(listAlbum, true);\n Iterator albumIterator = listAlbum.iterator();\n Album actualAlbum;\n int actualAlbumIndex=0;\n while (albumIterator.hasNext())\n {\n \n actualAlbum = (Album) albumIterator.next();\n \n if (actualAlbum.getName().equals(searching))\n {\n JSoundsMainWindowViewController.showAlbumResults(true, false, false, actualAlbum);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n return 1;\n }\n else if (actualAlbum.getArtist().getName().equals(searching))\n {\n JSoundsMainWindowViewController.showAlbumResults(true, false, false, actualAlbum);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n return 1;\n }\n actualAlbum.getSongs();\n Iterator songsIterator = actualAlbum.getSongs().iterator();\n int actualSongIndex = 0;\n\n while (songsIterator.hasNext())\n {\n /* Se añade el número de la canción al modelo de la lista */\n Song song = (Song) songsIterator.next();\n if (song.getName().equals(searching))\n {\n JSoundsMainWindowViewController.showSongResults(true, false, false, actualAlbum,song,actualSongIndex);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n indexFromSearchedSong=actualSongIndex;\n if (alreadyPlaying)\n {\n JSoundsMainWindowViewController.stopSong();\n alreadyPlaying=false;\n dontInitPlayer=true;\n }\n //playListSongs(true);\n return 1;\n }\n actualSongIndex++;\n }\n actualAlbumIndex++;\n }\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Not Found :( \");\n return 0;\n }", "protected void executeSearch(MonteCarloTree<A> tree, Game<A, ActionEnum<A>> clonedGame) {\n int currentPlayer = clonedGame.getCurrentPlayer().getActorRef();\n AllPlayerDeterminiser apd = clonedGame.getAPD(currentPlayer);\n // this cannot be a Decider level variable, and should be linked to the Game\n\n MCTSChildDecider<A> childDecider;\n if (openLoop) {\n OpenLoopStateFactory<A> factory = new OpenLoopStateFactory<>(treeSetting, treeMap, clonedGame);\n childDecider = createChildDecider(apd, factory, tree, currentPlayer, false);\n } else {\n childDecider = createChildDecider(apd, stateFactory, tree, currentPlayer, false);\n }\n if (useAVDForOpponent)\n opponentModel = new MCActionValueDecider<>(tree, this.stateFactory, currentPlayer);\n\n MCTSUtilities.launchGame(treeMap, apd, childDecider, opponentModel, decProp);\n }", "public void search() {\r\n \t\r\n }", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public static void main(String[] args) {\n \n // Check the command-line syntax. Prints errors if needed\n if (args.length > 3 || args.length < 2) {\n System.err.println(\"Usage for Word Ladders: java WordGames ladder startWord endWord\");\n System.err.println(\"Usage for Anagrams: java WordGames anagram string\");\n System.exit(1);\n }\n \n String word = \"\";\n String startWord = \"\";\n String endWord = \"\";\n File inputFile = null;\n Scanner scanner = null;\n String gameType = args[0];\n \n //Reads the given dictionary file\n inputFile = new File(\"dictionary.txt\");\n try {\n scanner = new Scanner(inputFile);\n } catch (FileNotFoundException e) {\n System.err.println(e);\n System.exit(1);\n }\n \n //Puts all the words in the dictionary file into an ArrayList\n ArrayList<String> dictionary = new ArrayList<String>();\n while (scanner.hasNextLine()){\n String line = scanner.nextLine().toLowerCase();\n line.replace(\"/n\", \"\");\n String[] thisLine = line.split(\" \");\n ArrayList<String> listLine = new ArrayList<String>(Arrays.asList(thisLine));\n //Adds every word in the line into the array list\n for (int i = 0; i < listLine.size(); i++){\n dictionary.add(listLine.get(i));\n }\n }\n scanner.close();\n \n //Runs if the user wants anagrams\n ArrayList<String> anagramList = new ArrayList<String>();\n if (gameType.equals(\"anagram\")){\n word = args[1];\n Anagram anagramMaker = new Anagram();\n anagramMaker.makeAnagrams(\"\", word, anagramList);\n //Print out all the combos that are valid words\n System.out.println(\"*** ANAGRAMS ***\");\n for (int i = 0; i < anagramList.size(); i++){\n String wordToCheck = anagramList.get(i);\n //Only prints the word if it is a valid word in the dictionary\n if (dictionary.contains(wordToCheck)){\n System.out.println(anagramList.get(i)); \n }\n } \n }\n //Runs if the user wants word ladders\n ArrayList<String> ladderDictionary = new ArrayList<String>();\n WordLadderGraph finalGraph = new WordLadderGraph();\n if (gameType.equals(\"ladder\")){\n startWord = args[1];\n endWord = args[2];\n //Checks to make sure the start and end words are the same length\n int target = startWord.length();\n int secondLength = endWord.length(); \n if (target != secondLength){\n System.err.println(\"Error in word selection. Please make sure the\"\n + \" words are the same length.\");\n System.exit(1);\n }\n //Checks to make sure the start word is a valid word\n if (!dictionary.contains(startWord)) {\n System.err.println(\"Start word is not in dictionary.\");\n System.exit(1);\n }\n //Checks to make sure the end word is a valid word\n if (!dictionary.contains(endWord)) {\n System.err.println(\"End word is not in dictionary.\");\n System.exit(1);\n }\n //Adds all words of appropriate size into a new list\n for (int i = 0; i < dictionary.size(); i++){\n if (dictionary.get(i).length() == target){\n ladderDictionary.add(dictionary.get(i));\n }\n }\n //Calls the makeGraph function to print the word ladder\n finalGraph.makeGraph(ladderDictionary, startWord, endWord);\n }\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}", "public static void main(String[] args) {\r\n int grade = 0;\r\n \r\n initializeBoard();\r\n \r\n System.out.println(game);\r\n//getValueIn is a simple getter method the returns value at given array index \r\n if (game.getValueIn(1, 1) == 5)\r\n grade += 5;\r\n else\r\n System.out.println(\"getValueIn(r,c) test failed\");\r\n//confirms that to string was done correctly \r\n if (testToString()) \r\n grade += 5;\r\n else\r\n System.out.println(\"toString() test failed\");\r\n//testAddGuess1() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 3, 5);\r\n if (testAddGuess1()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 1 failed\"); \r\n//testAddGuess2() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 2, 5);\r\n if (testAddGuess2()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 2 failed\"); \r\n//testAddGuess3() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 4, 1);\r\n if (testAddGuess3()) \r\n grade += 10;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 3 failed\"); \r\n //tests reset(), by re-running the first toString test above, after running game.reset() \r\n game.reset();\r\n if (testToString())\r\n grade += 10;\r\n else\r\n System.out.println(\"reset() test failed\");\r\n//tests the game.getAllowedValues method by passing the game object method call and hence it's results\r\n//to the testGetAllowedValues(), which appears to only apply to one cell/array index at a time\r\n//so if I am correct this is saying what values can be used at coordinates 8, 8.\r\n//the answer that it uses to compare is a visual/manual analysis of expected results for cell 8, 8. \r\n if (testGetAllowedValues(game.getAllowedValues(8, 8)))\r\n grade += 10;\r\n else\r\n System.out.println(\"getAllowedValues() test failed\");\r\n \r\n System.out.printf(\"Your grade is %d/50.\\n\", grade);\r\n }", "private static void search(graph M, graph D, Tuple[] h){\n\t\tint v = M.V[0];\n\t\tint q = 0; //q keeps track of the index in the Tuple array where a new tuple is placed\n\t\tfor(; q < h.length && h[q] != null; q++){\n\t\t\t;\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < D.V.length; i++){\n\t\t\tint w = D.V[i];\n\t\t \tTuple t = new Tuple(v, w);\n\t\t\th[q] = t; //add a new tuple\n\t\t\tboolean OK = true;\n\t\t\tfor (int k = 0; k < M.V.length; k++){\n\t\t\t\tboolean shouldBreak = false;\n\t\t\t\tfor (int j = 0; j < M.V.length; j++){\n\t\t\t\t\tif (M.matrix[M.V[k]][M.V[j]] == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tThis is part of the pseudo-code that I tried to incorporate\n\t\t\t\t\tI could not quite get it to work, I believe the problem is \n\t\t\t\t\tin the big if statement. Instead I wrote a different chunk of code\n\t\t\t\t\tthat determines in the th should be printed.\n\t\t\t\t\t*/\n// \t\t\t\t\tif ( (M.V[k] == v && searchH(M.V[j], h) != null) || (M.V[j] == v && searchH(M.V[k], h) != null) ){\n// \t\t\t\t\t\tif(D.matrix[searchH(M.V[k], h).y][searchH(M.V[j], h).y] == 0){\n// \t\t\t\t\t\t\tOK = false;\n// \t\t\t\t\t\t\tshouldBreak = true;\n// \t\t\t\t\t\t\tbreak;\n// \t\t\t\t\t\t}\n// \t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(shouldBreak == true){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OK == true){\n\t\t\t\tif(M.V.length == 1){\n\t\t\t\tboolean isGood = true;\n\t\t\t\t/*\n\t\t\t\tThis is what determines if h should be printed.\n\t\t\t\tEssentially it checks h against the adjacency matrices,\n\t\t\t\tand if the edges are present, it prints them out.\n\t\t\t\t*/\n\t\t\t\t\tfor(int g = 0; g < h.length && isGood == true; g++){\n\t\t\t\t\t\tfor(int f = g+1; f < h.length && isGood == true; f++){\n\t\t\t\t\t\t\tif(M.matrix[h[g].x][h[f].x] == 1 && D.matrix[h[g].y][h[f].y] == 0){\n\t\t\t\t\t\t\t\tisGood = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(isGood == true){\n\t\t\t\t\t\tSystem.out.println(printH(h));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tHere I rebuild the vertex arrays and attached them to a new graph\n\t\t\t\tfor use as an argument in the recursive call.\n\t\t\t\t*/\n\t\t\t\telse{\t\t\n\t\t\t\t\tint[] modelTemp = rebuildV(v, M.V);\n\t\t\t\t\tint[] dataTemp = rebuildV(D.V[i], D.V);\n\n\t\t\t\t\tTuple[] h2 = new Tuple[h.length];\n\t\t\t\t\tfor(int p = 0; p < h.length; p++){\n\t\t\t\t\t\th2[p] = h[p];\n\t\t\t\t\t}\n\t\t\t\t\tgraph M2 = new graph();\n\t\t\t\t\tgraph D2 = new graph();\n\t\t\t\t\t\n\t\t\t\t\tM2.V = modelTemp;\n\t\t\t\t\tD2.V = dataTemp;\n\t\t\t\t\tM2.matrix = M.matrix;\n\t\t\t\t\tD2.matrix = D.matrix;\n\t\t\t\t\t\n\t\t\t\t\t//recursive call\n\t\t\t\t\tsearch(M2, D2, h2);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(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// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "void oppInCheck(Piece[] B,Player J2,boolean moveFound);", "public static void main(String[] args) \n\t{\n\t\tBoggleBoard.generateBoard();\n\t\tArrayList<String> usedWords = new ArrayList<String>();\n\t\tmyDictionary = new Dictionary(\"words.txt\"); //load the dictionary\n\t\tmyBoard = new BoggleBoard(\"board.txt\"); //load the board: board.txt for standard board, board2.txt for random board\n\t\tmyBoard.display(); //display the board\n\t\tint score = 0;\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"\\nEnter a word (or enter nothing at any point to end the game): \");\n\t\tString input = scan.nextLine();\n\t\tinput = input.toLowerCase();\n\t\t\n\t\twhile(!input.equals(\"\")) //user inputs a word\n\t\t{\n\t\t\tif(input.length() < 3) //words less than 3 letters don't count\n\t\t\t\tSystem.out.println(\"That word is too short.\");\n\t\t\telse if(Dictionary.search(input, 0, myDictionary.size-1) < 0) //user made up a word\n\t\t\t\tSystem.out.println(\"That word is not in the dictionary.\");\n\t\t\telse if(!myBoard.findWord(input.toUpperCase())) //word not on the board\n\t\t\t\tSystem.out.println(\"That word is a valid word, but is not on the board.\");\n\t\t\telse // myDictionary.search() && myBoard.findWord(input)\n\t\t\t{\n\t\t\t\tif(!usedWords.contains(input))\n\t\t\t\t{\n\t\t\t\t\t//account for grammar\n\t\t\t\t\tif(myBoard.score(input) == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"That is a good word! You score \" + myBoard.score(input) + \" point!\");\n\t\t\t\t\t\tscore += myBoard.score(input);\n\t\t\t\t\t\tusedWords.add(input); //add searched words to usedWords to make sure they cant be used again\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"That is a good word! You score \" + myBoard.score(input) + \" points!\");\n\t\t\t\t\t\tscore += myBoard.score(input);\n\t\t\t\t\t\tusedWords.add(input);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"That word was already used.\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\tmyBoard.display();\n\t\t\t\n\t\t\tSystem.out.print(\"Used words: \");\n\t\t\tfor(String d : usedWords)\n\t\t\t\tSystem.out.print(d + \", \");\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter a word: \");\n\t\t\tinput = scan.nextLine();\n\t\t\tinput = input.toLowerCase();\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Total score: \" + score); //end of the game.\n\t\tSystem.out.println(\"Thanks for playing!\");\n\t}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public void checkGame() {\n\n\t}", "public static void main (String [] args)\r\n {\r\n System.out.println(\"\\nWelcome to Scrabble Word! This program finds the most valuable word based on a scrabble hand. The rules the program works off are the point values for letters provided by http://scrabble.hasbro.com/en-us/faq and the double score multiplier for consecutive double letters.\\n\");\r\n System.out.print(\"Please enter a list of letters, from 3 to 12 letters long, without spaces -> \"); \r\n String input = userInput(); \r\n if(input == null)\r\n {\r\n System.exit(0);\r\n }\r\n String [] word = findWords(input);\r\n printWords(word); \r\n //pointvalues of letters (alphabetical order)\r\n int [] table = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10};\r\n String best = bestWord(word,table);\r\n if(best == null || best.equals(\"\"))\r\n {\r\n System.out.println(\"No word from the IGN data source can be created with that input.\");\r\n System.exit(1);\r\n }\r\n System.out.println(\"\\n\\nHighest scoring word: \" + best + \"\\n\");\r\n }", "public void actionPerformed(ActionEvent e) {\n displayInfoText(\" \");\n // Turn the search string into a Query\n String queryString = queryWindow.getText().toLowerCase().trim();\n query = new Query(queryString);\n // Take relevance feedback from the user into account (assignment 3)\n // Check which documents the user has marked as relevant.\n if (box != null) {\n boolean[] relevant = new boolean[box.length];\n for (int i = 0; i < box.length; i++) {\n if (box[i] != null)\n relevant[i] = box[i].isSelected();\n }\n query.relevanceFeedback(results, relevant, engine);\n }\n // Search and print results. Access to the index is synchronized since\n // we don't want to search at the same time we're indexing new files\n // (this might corrupt the index).\n long startTime = System.currentTimeMillis();\n synchronized (engine.indexLock) {\n results = engine.searcher.search(query, queryType, rankingType);\n }\n long elapsedTime = System.currentTimeMillis() - startTime;\n // Display the first few results + a button to see all results.\n //\n // We don't want to show all results directly since the displaying itself\n // might take a long time, if there are many results.\n if (results != null) {\n displayResults(MAX_RESULTS, elapsedTime / 1000.0);\n } else {\n displayInfoText(\"Found 0 matching document(s)\");\n\n if (engine.speller != null) {\n startTime = System.currentTimeMillis();\n SpellingOptionsDialog dialog = new SpellingOptionsDialog(50);\n String[] corrections = engine.speller.check(query, 10);\n elapsedTime = System.currentTimeMillis() - startTime;\n System.err.println(\"It took \" + elapsedTime / 1000.0 + \"s to check spelling\");\n if (corrections != null && corrections.length > 0) {\n String choice = dialog.show(corrections, corrections[0]);\n if (choice != null) {\n queryWindow.setText(choice);\n queryWindow.grabFocus();\n\n this.actionPerformed(e);\n }\n }\n }\n }\n }", "void searchProbed (Search search);", "public static void main(String[] args) {\n FastReader sc = new FastReader(System.in);\n int r = sc.nextInt();\n int c = sc.nextInt();\n int i, j;\n int[][] a = new int[r][c];\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n a[i][j] = sc.nextInt();\n }\n }\n int ans = 0;\n int[] dx = { 1, -1, 0, 0 };\n int[] dy = { 0, 0, 1, -1 };\n String[] dir = {\"D\",\"U\",\"R\",\"L\"};\n for (i = 0; i < r; i++) {\n for (j = 0; j < c; j++) {\n if (a[i][j] == 0) {\n // cell can be used to place light\n for (int k = 0; k < 4; k++) {\n int x = dx[k] + i;\n int y = dy[k] + j;\n if (isValid(x, y, r, c) && actorPresent(a,i,j,r,c,dir[k])) {\n ans++;\n }\n\n }\n }\n }\n }\n System.out.println(ans);\n }", "public void scan(boolean scanAllies, boolean scanEnemies) {\n\t\t\n\t\tif (lastscanround < br.curRound)\n\t\t{\n\t\t\tneedToScanAllies = true;\n\t\t\tneedToScanEnemies = true;\n\t\t\tlastscanround = br.curRound;\n\t\t\trobots = br.rc.senseNearbyGameObjects(Robot.class);\n\t\t}\n\t\t\n\t\tif (scanAllies)\n\t\t{\n\t\t\tif (needToScanAllies)\n\t\t\t\tneedToScanAllies = false;\n\t\t\telse\n\t\t\t\tscanAllies = false;\n\t\t}\n\t\t\n\t\tif (scanEnemies)\n\t\t{\n\t\t\tif (needToScanEnemies)\n\t\t\t\tneedToScanEnemies = false;\n\t\t\telse\n\t\t\t\tscanEnemies = false;\n\t\t}\n\t\t\n\t\tif (scanAllies || scanEnemies)\n\t\t{\n\t\t\tRobot[] robots = this.robots;\n\n\t\t\t// reset stat collection\n\t\t\tif (scanEnemies)\n\t\t\t\tresetEnemyStats();\n\t\t\tif (scanAllies)\n\t\t\t\tresetAllyStats();\n\t\t\n\t\t\t// Bring some vars into local space for the raep loop\n\t\t\tRobotController rc = br.rc;\n\t\t\tTeam myTeam = rc.getTeam();\n\t\t\t\n\t\t\tfor (int idx = robots.length; --idx >= 0;) {\n\t\t\t\tRobot r = robots[idx];\n\t\t\t\ttry {\n\t\t\t\t\tif (isArchon){\n\t\t\t\t\t\tif (myTeam == r.getTeam()) {\n\t\t\t\t\t\t\tif (scanAllies) {\n\t\t\t\t\t\t\t\taddAllyForArchon(rc.senseRobotInfo(r));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (scanEnemies) {\n\t\t\t\t\t\t\t\taddEnemyForArchon(rc.senseRobotInfo(r));\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{\n\t\t\t\t\t\tif (myTeam == r.getTeam()) {\n\t\t\t\t\t\t\tif (scanAllies) {\n\t\t\t\t\t\t\t\taddAlly(rc.senseRobotInfo(r));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (scanEnemies) {\n\t\t\t\t\t\t\t\taddEnemy(rc.senseRobotInfo(r));\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\n\t\t\t\t} catch (GameActionException e) {\n\t\t\t\t\tbr.rc.addMatchObservation(e.toString());\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (scanEnemies)\n\t\t\t{\n\t\t\t\tif (numEnemyRobots == 0) {\n\t\t\t\t\tcenterEnemyX = centerEnemyY = -1;\n\t\t\t\t\tvecEnemyX = br.curLoc.x;\n\t\t\t\t\tvecEnemyY = br.curLoc.y;\n\t\t\t\t} else {\n\t\t\t\t\tcenterEnemyX = centerEnemyX / numEnemyRobots;\n\t\t\t\t\tcenterEnemyY = centerEnemyY / numEnemyRobots;\n\t\t\t\t\tvecEnemyX = centerEnemyX - br.curLoc.x;\n\t\t\t\t\tvecEnemyY = centerEnemyY - br.curLoc.y;\n\t\t\t\t}\n\n\t\t\t\t// compute some global statistics\n\t\t\t\tif (numEnemyRobots == 0) {\n\t\t\t\t\troundsSinceEnemySighted++;\n\t\t\t\t} else {\n\t\t\t\t\troundsSinceEnemySighted = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void testSearchByContent() {\n Message m1 = new Message(\"test\",\"bla bla david moshe\",_u1);\n Message.incId();\n try {\n Thread.sleep(10);\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n Message m2 = new Message(\"test2\",\"bla2 bla david tikva moshe\",_u1);\n Message.incId();\n Message m3 = new Message(\"test2\",\"moshe cohen\",_u1);\n Message.incId();\n\n this.allMsgs.put(m1.getMsg_id(), m1);\n this.allMsgs.put(m2.getMsg_id(), m2);\n this.allMsgs.put(m3.getMsg_id(), m3);\n\n this.searchEngine.addData(m1);\n this.searchEngine.addData(m2);\n this.searchEngine.addData(m3);\n\n /* SearchHit[] result = this.searchEngine.searchByContent(\"bla2\", 0,1);\n assertTrue(result.length==1);\n assertTrue(result[0].getMessage().equals(m2));\n\n SearchHit[] result2 = this.searchEngine.searchByContent(\"bla david tikva\", 0,2);\n assertTrue(result2.length==1);\n assertEquals(result2[0].getScore(),3.0);\n //assertEquals(result2[1].getScore(),2.0);\n assertTrue(result2[0].getMessage().equals(m2));\n //assertTrue(result2[1].getMessage().equals(m1));\n\n SearchHit[] result3 = this.searchEngine.searchByContent(\"bla2 tikva\", 0, 5);\n assertTrue(result3.length==0);\n */\n\n/*\n SearchHit[] result4 = this.searchEngine.searchByContent(\"bla OR tikva\", 0, 5);\n assertTrue(result4.length==2);\n assertTrue(result4[0].getMessage().equals(m2));\n assertTrue(result4[1].getMessage().equals(m1));\n\n SearchHit[] result5 = this.searchEngine.searchByContent(\"bla AND cohen\", 0, 5);\n assertTrue(result5.length==0);\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\",0,5);\n assertTrue(result5.length==2);\n assertTrue(result5[0].getScore() == result5[1].getScore());\n assertTrue(result5[0].getMessage().equals(m2));\n assertTrue(result5[1].getMessage().equals(m1));\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\", 10, 11);\n assertTrue(result5.length==0);\n */\n\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 }", "public static void main(String[] args)\n {\t\t\n\t\t\tFastTimer timer = new FastTimer();\n\t\t\n\t\t\n\t\t\tGameGrid loaded_grid = new GameGrid(7,7);\n\t\t\t\tboolean isSuccess = loaded_grid.LoadFromFile(\"test.puzzle\");\n\t\t\tif(isSuccess == true){\n\t\t\t\tSystem.out.print(\"Solution initiale\\n\");\n\t\t\t\tloaded_grid.PrintToCmd();\t\t\t\n\t\t\t}\n\t\t\tList<GameMove> found_moves = loaded_grid.GetAvailableMove(); \n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\nInitial possible moves\\n\");\n\t\t\tfor(GameMove current_move :found_moves){\n\t\t\t\tcurrent_move.PrintOutCmd();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tList<GameMove> solution_move = new LinkedList();\n\t\t\tloaded_grid.ResetMonitoring();\n\t\t\t\n\t\t\ttimer.StartTime();\n\t\t\t\tboolean result = loaded_grid.FindSolution(solution_move);\n\t\t\ttimer.StopTime();\n\t\t\t\n\t\t\tSystem.out.println(\"\\n**************************\");\n\t\t\tSystem.out.println(\"File name : \" + loaded_grid.loaded_file_name+\"\\n\");\n\t\t\tif(result == false){\n\t\t\t\tSystem.out.println(\"Pas de solution\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Solution in \" +solution_move.size() +\" moves\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\tTime : \"+timer.LastDelta + \" millsec\");\n\t\t\tSystem.out.println(\"\tNode visited :\"+loaded_grid.node_visited_cpt);\n\t\t\tSystem.out.println(\"\tDept require :\"+loaded_grid.max_dept);\n\t\t\tSystem.out.println(\"\tDept limitation :\"+loaded_grid.dept_limit);\n\t\t\t\n\t\t\tif(solution_move.size() > 0){\n\t\t\t\tSystem.out.println(\"\\nMove from last to first\\n\");\n\t\t\t\tfor(GameMove current_move :solution_move){\n\t\t\t\t\tcurrent_move.PrintOutCmd();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\\n**************************\\n\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Final grid\\n\");\n\t\t\tloaded_grid.PrintToCmd();\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "protected int find_among_b(Among v[])\n {\n\tint i = 0;\n\tint j = v.length;\n\n\tint c = cursor;\n\tint lb = limit_backward;\n\n\tint common_i = 0;\n\tint common_j = 0;\n\n\tboolean first_key_inspected = false;\n\n\twhile (true) {\n\t int k = i + ((j - i) >> 1);\n\t int diff = 0;\n\t int common = common_i < common_j ? common_i : common_j;\n\t Among w = v[k];\n\t int i2;\n\t for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {\n\t\tif (c - common == lb) {\n\t\t diff = -1;\n\t\t break;\n\t\t}\n\t\tdiff = current.charAt(c - 1 - common) - w.s[i2];\n\t\tif (diff != 0) break;\n\t\tcommon++;\n\t }\n\t if (diff < 0) {\n\t\tj = k;\n\t\tcommon_j = common;\n\t } else {\n\t\ti = k;\n\t\tcommon_i = common;\n\t }\n\t if (j - i <= 1) {\n\t\tif (i > 0) break;\n\t\tif (j == i) break;\n\t\tif (first_key_inspected) break;\n\t\tfirst_key_inspected = true;\n\t }\n\t}\n\twhile (true) {\n\t Among w = v[i];\n\t if (common_i >= w.s.length) {\n\t\tcursor = c - w.s.length;\n\t\tif (w.method == null) return w.result;\n\n\t\tboolean res;\n\t\ttry {\n\t\t Object resobj = w.method.invoke(this);\n\t\t res = resobj.toString().equals(\"true\");\n\t\t} catch (InvocationTargetException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t} catch (IllegalAccessException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t}\n\t\tcursor = c - w.s.length;\n\t\tif (res) return w.result;\n\t }\n\t i = w.substring_i;\n\t if (i < 0) return 0;\n\t}\n }", "@Test\n public void boggle(){\n BoggleBoard board = new BoggleBoard(\"datasets/board5x5.txt\");\n\n BogglePlayer player = new BogglePlayer(Permeate.textToStringAr(\"datasets/dictionary-yawl.txt\"));\n\n for (String word : player.getAllValidWords(board)) {\n System.out.println(word);\n }\n assertEquals(2911,player.getMaximumScore(board));\n }", "static void startMatch()\n {\n // suggests that we should first use the pokedex menu\n if (Player.current.pokedex.isEmpty())\n {\n System.out.println(\"\\nYou have no pokemon to enter the match with kid. Use your pokedex and get some pokemon first.\");\n pause();\n return;\n }\n\n // print stuff\n clrscr();\n System.out.println(title());\n\n // print more stuff\n System.out.println(Player.opponent.name.toUpperCase() + \" IS PREPARING HIS POKEMON FOR BATTLE!\");\n \n // initialises the opponent logic - pokemon often enter evolved states\n Pokemon two = Opponent.init();\n\n System.out.println(\"\\n\"\n + Player.opponent.name.toUpperCase() + \" HAS CHOSEN \" + two +\"\\n\"\n + Player.current.name.toUpperCase() + \"! CHOOSE A POKEMON!!\");\n\n // displays the list of pokemon available for battle\n Player.current.showNamesPokedex();\n System.out.print(\"Gimme an index (Or type anything else to return)! \");\n int option = input.hasNextInt()? input.nextInt() - 1 : Player.current.pokedex.size();\n\n // sends back to mainMenu if option is out of bounds \n if (option >= Player.current.pokedex.size() || option < 0)\n {\n mainMenu();\n }\n\n // definitions, aliases for the two combatting pokemon\n Pokemon one = Player.current.pokedex.get(option);\n Pokemon.Move oneMove1 = one.listMoves.get(0);\n Pokemon.Move oneMove2 = one.listMoves.get(1);\n\n // if there's a bit of confusion regarding why two pokemon have the same nickname ...\n if (one.nickname.equals(two.nickname))\n System.out.println(one.nickname.toUpperCase() + \" vs ... \" + two.nickname.toUpperCase() + \"?? Okey-dokey, LET'S RUMBLE!!\");\n else // ... handle it\n System.out.println(one.nickname.toUpperCase() + \" vs \" + two.nickname.toUpperCase() + \"!! LET'S RUMBLE!!\");\n\n pause();\n clrscr();\n\n // Battle start!\n Pokemon winner = new Pokemon();\n // never give up!\n // unless it's addiction to narcotics \n boolean giveUp = false;\n while (one.getHp() > 0 && two.getHp() > 0 && !giveUp)\n {\n // returns stats of the pokemon\n System.out.println(\"\\nBATTLE STATS\\n\" + one + \"\\n\" + two);\n\n // 30% chance dictates whether the pokemon recover in a battle, but naturally so\n if (random.nextInt(101) + 1 < 30 && one.getHp() < one.maxHp)\n ++one.hp;\n\n if (random.nextInt(101) + 1 < 30 && two.getHp() < two.maxHp)\n ++two.hp;\n\n // the in-game selection menu\n System.out.print(\"\\n\"\n + Player.current.name.toUpperCase() + \"! WHAT WILL YOU HAVE \" + one.getFullName().toUpperCase() + \" DO?\\n\"\n + \"(a) Attack\\n\"\n + (oneMove1.isUsable? \"(1) Use \" + oneMove1.name.toUpperCase() + \"\\n\" : \"\")\n + (oneMove2.isUsable? \"(2) Use \" + oneMove2.name.toUpperCase() + \"\\n\" : \"\")\n + \"(f) Flee\\n\"\n + \"Enter the index from the brackets (E.g. (a) -> 'A' key): \");\n\n char choice = input.hasNext(\"[aAfF12]\")? input.next().charAt(0) : 'a';\n\n // a switch to handle the options supplied\n switch (choice)\n {\n case 'a': case 'A': default:\n one.attack(two);\n break;\n\n case 'f': case 'F':\n winner = two;\n giveUp = true;\n break;\n\n case '1':\n one.attack(two, oneMove1.name);\n break;\n\n case '2':\n one.attack(two, oneMove2.name);\n break;\n }\n\n // Opponent's turn, always second\n pause();\n clrscr();\n\n System.out.println(\"\\nBATTLE STATS\\n\" + one + \"\\n\" + two);\n Opponent.fight(one);\n pause();\n clrscr();\n }\n\n // find out the winner from combat or withdrawal\n winner = giveUp? two : one.getHp() > 0? one : two;\n System.out.println(\"\\nWINNER: \" + winner.getFullName() + \" of \" + winner.owner.name + \"!\\n\");\n\n if (winner == one)\n {\n // register the victory\n Player.current.gems += 100;\n System.out.println(\"You got 100 gems as a reward!\\n\");\n ++Player.current.wins;\n }\n else\n {\n // register the defeat\n ++Player.current.losses;\n System.out.println(\"Tough luck. Do not be worried! There's always a next time!\\n\");\n }\n\n pause();\n }", "public double matchingUpdate(String title) {\n\n double matching = 0.0;\n double num = 0.0;\n double denom = 0.0;\n\n ArrayList<Configuration> gameConf = MainModel.getInstance().getConfigurationsFromGame(title);\n\n for(Configuration conf : gameConf) {\n\n if(conf.getSelected()) {\n\n if (! conf.getVocalActions().isEmpty() && conf.getModel() == null) {\n denom++;\n }\n\n for (Link link : conf.getLinks()) {\n\n Log.d(\"MATCHING_UPDATE\", \"Link: \" + link.getEvent().getName());\n\n if (link.getAction() == null) {\n\n Log.d(\"MATCHING_UPDATE\", \"Dentro if di Link\");\n denom++;\n\n }\n else {\n\n Log.d(\"MATCHING_UPDATE\", \"Dentro else di Link\");\n num++;\n denom++;\n }\n }\n }\n }\n\n if(denom > 0.0) {\n matching = num / denom;\n\n }\n else {\n matching = 0.0;\n }\n\n Log.d(\"MATCHING_UPDATE\", title+\" num: \"+num+\" denom: \"+denom);\n return matching;\n\n }", "public abstract IAttackable getEnemyInSearchArea(ShortPoint2D centerPos, IAttackable movable, short minSearchRadius, short maxSearchRadius,\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean includeTowers);", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public void victoryCardFind();", "public static void main(String[] args) {\n\t\tString word = \"SEE\";\n\t\tchar[][] board = { { 'A', 'B', 'C', 'E' }, { 'S', 'F', 'C', 'S' }, { 'A', 'D', 'E', 'E' } };\n\t\tint flag = 0;\n\t\tboolean res = false;\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[0].length; j++) {\n\t\t\t\tres = searchWord(board, word, 0, new boolean[board.length][board[0].length], i, j);\n\t\t\t\tif (res) {\n\t\t\t\t\tflag = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flag == 1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(res);\n\n\t}" ]
[ "0.6262137", "0.62172186", "0.6098121", "0.60581267", "0.6024338", "0.6009342", "0.5981732", "0.5917278", "0.5856014", "0.57556003", "0.57356983", "0.5735059", "0.5720939", "0.5719657", "0.5708759", "0.56245387", "0.56245387", "0.56119", "0.5606257", "0.5584892", "0.5569841", "0.5569343", "0.5563569", "0.5556897", "0.55564696", "0.55542374", "0.5537088", "0.5509422", "0.55063486", "0.55017835", "0.54818004", "0.54678226", "0.54613554", "0.54409504", "0.5426904", "0.5412961", "0.5395798", "0.53845054", "0.5367451", "0.53461313", "0.5318079", "0.5295204", "0.5289352", "0.528849", "0.5278427", "0.5278015", "0.52770805", "0.5272442", "0.5263706", "0.5259901", "0.52511966", "0.52483684", "0.5244738", "0.52435815", "0.5236564", "0.5231686", "0.5229775", "0.52264065", "0.5223555", "0.52201587", "0.52185184", "0.5216621", "0.52122515", "0.52065897", "0.52061135", "0.52042747", "0.51946205", "0.51888657", "0.5188433", "0.5178646", "0.5173144", "0.51713395", "0.5169414", "0.5168602", "0.5168204", "0.5168199", "0.51677287", "0.5165237", "0.5164198", "0.5161751", "0.5156327", "0.51506686", "0.51499027", "0.5149142", "0.51410854", "0.5137078", "0.5134676", "0.5133854", "0.51330566", "0.5132748", "0.51270115", "0.5123439", "0.5123142", "0.5117731", "0.51176596", "0.51173127", "0.5114405", "0.511265", "0.511088", "0.5105401", "0.51016986" ]
0.0
-1
indicates to stop search
private boolean isCutoff(final int remainingDepth) { return remainingDepth <= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onStop()\n\t{\n\t\tsuper.onStop();\n\t\tNaviWords.setSearchType(null);\t\n\t}", "@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}", "void stopIndexing();", "void unsetSearchWindowEnd();", "void setEndSearch(int endSearch);", "public void onSearchExit();", "boolean isNilSearchWindowEnd();", "public void onSearchStopped(RequestAccessResult reason) {\n Intent result = new Intent();\n result.putExtra(EXTRA_KEY_MULTIDEVICE_SEARCH_RESULT, reason.getIntValue());\n setResult(REQUEST_CODE_SEARCH_DEVICE, result);\n finish();\n }", "public void stop() {\n\t\tthis.stopper = true;\n\t}", "int getEndSearch();", "public void stop() {\n stop = true;\n }", "public synchronized void stopIgnoreSpeechRecognitionResults() {\r\n\t\t\r\n\t\t//Stop ignoring speech recognition results\r\n\t\tignoreSpeechRecognitionResults = false;\r\n\t}", "public void stop(){\n return;\n }", "public void stop() {\n\t\tthis.flag = false;\n\t\t\n\t\t\n\t}", "public void cancel() {\r\n\t\tbStop = true;\r\n\t}", "boolean shouldStop();", "boolean isSearchOk() {\n return false;\n }", "void unsetSearchWindowStart();", "public void stop(){\n stop = true;\n }", "public void search() {\r\n \t\r\n }", "protected void onSearchExit() {\n if ((mListContext != null) && mListContext.isSearch()) {\n mActivity.finish();\n } else {\n // Re show the search icon.\n mActivity.invalidateOptionsMenu();\n }\n }", "public void stop(){\n quit = true;\n }", "@Override\n protected void onStop() {\n saveData();\n stopRepeatingDeletionSearch();\n super.onStop();\n }", "boolean isSetSearchWindowEnd();", "public void stop() {\r\n _keepGoing = false;\r\n }", "public void stopWork() {\n stopWork = true;\n }", "@Override\r\n\t\t\tpublic boolean isStopWord(String term) {\n\t\t\t\treturn false;\r\n\t\t\t}", "private void searchFunction() {\n\t\t\r\n\t}", "public void stop()\r\n\t{\r\n\t\tdoStop = true;\r\n\t}", "public void stop()\n\t{\n\t\tindex = 0;\n\t\tlastUpdate = -1;\n\t\tpause();\n\t}", "void setNilSearchWindowEnd();", "protected void stopWifiScan() {\r\n\r\n //TERMINA LA SCANSIONE BLUETOOTH\r\n\t\thideWifiScanDialog();\r\n BeaconsMonitoringService.action.set(BeaconSession.SCANNING_OFF);\r\n\r\n /*\r\n\t\tif (wifiBroadcastReceiver != null) {\r\n\r\n\t\t\tWifiScanner.stopScanner(this, wifiBroadcastReceiver);\r\n\t\t\twifiBroadcastReceiver = null;\r\n\r\n\t\t}\r\n\t\t// stop scan\r\n\t\t// oh, wait, we can't stop the scan, it's asynchronous!\r\n\t\t// we just have to ignore the result!\r\n\t\tignoreWifiResults = true;\r\n */\r\n\t}", "public void stop() {\n\n\t\tcoreMatcher.stop();\n\t}", "public void search() {\n }", "private void stop() {\r\n\t\t\tstopped = true;\r\n\t\t}", "public void stopping();", "public void stop() {}", "public boolean stop();", "public void stop()\n\t{\n\t\trunning = false;\n\t}", "@Override\n public void stop() {}", "public void stop() {\n\t\t\n\t}", "public void setLSearch (boolean value) {\r\n l_search = value; }", "@Override\r\n public void stop() {\r\n }", "@Override\r\n public void stop() {\r\n }", "public void stopScan()\n {\n //------------------------------------------------------------\n // Stop BLE Scan\n Toolbox.toast(getContext(), \"Stopping scan...\");\n scanLeDevice(false);\n }", "public void stop() {\n // If we weren't scanning, or Bluetooth is not supported, we're done.\n if (!scanning || adapter == null) {\n return;\n }\n\n // If Bluetooth is not enabled, scanning will automatically have been stopped.\n if (!adapter.isEnabled()) {\n scanning = false;\n Log.i(TAG, \"Scanning stopped by adapter.\");\n return;\n }\n\n // Get the BLE scanner. If this is null, Bluetooth may not be enabled.\n BluetoothLeScanner scanner = adapter.getBluetoothLeScanner();\n if (scanner == null) {\n Log.w(TAG, \"Could not retrieve scanner to stop scanning.\");\n return;\n }\n scanner.stopScan(scanCallback);\n\n scanning = false;\n Log.i(TAG, \"Stopped scanning.\");\n }", "public void stop(boolean returnAction) {\n if(threadSound != null)threadSound.interrupt();\n selectedWord = null;\n if (!dataGame.isTrainingMode()) {\n if (!returnAction) { //The game end normally\n this.timer.cancel();\n System.out.println(\"SCORE : \" + dataGame.getScore());\n String score_string = Float.toString(dataGame.getScore());\n ScoreLine currentScoreLine = ScoreFile.getInstance().addNewScore(dataGame.getGameType(), score_string, dataGame.getNickname());\n scoreLines = ScoreFile.getInstance().readFile(dataGame.getGameType());\n dataGame.notifyEndGame(currentScoreLine, scoreLines);\n } //The game is cancelled by the user\n else {\n timer.cancel();\n ScoreLine emptyScore = null;\n dataGame.notifyEndGame(emptyScore, scoreLines);\n }\n\n } else {\n ScoreLine emptyScore = null;\n dataGame.notifyEndGame(emptyScore, scoreLines);\n }\n }", "public void stop(){\n\t\t\n\t}", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "@Override\n public void stop() {\n }", "public synchronized void stop() {\n stopping = true;\n }", "public void stop() {\n\t}", "public void stop() {\r\n running = false;\r\n }", "public synchronized void ignoreSpeechRecognitionResults() {\r\n\t\t\r\n\t\t//Instead of stopping the speech recognition we are ignoring it's results\r\n\t\tignoreSpeechRecognitionResults = true;\r\n\t\t\r\n\t}", "public void stop(){\n running = false;\n }", "@Override public void stop () {\n }", "@Override\n public void stop() {\n }", "protected void stopWork() {\n mAllowedToBind = false;\n\n }", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\n\tpublic void stop() {\n\t\t\n\t}", "@Override\r\n public void stop() {\r\n\r\n }", "@Override public void stop() {\n }", "@Override\n public void onSearchCleared() {\n }", "public void stop() {\n }", "public void stop() {\n }", "public void stop() {\n m_enabled = false;\n }", "@Override\n\tpublic void stopCounter() {\n\n\t\tstop = true;\n\t}", "@Override\r\n\tpublic void stop() {\n\t\t\r\n\t}", "public void stop() {\n running = false;\n }", "public void stopSolving() {\n\t\tstopped = true;\n\t}", "@Override\n\tpublic void search() {\n\t}", "public abstract boolean isSearchInProgress();", "public void stop() {\n _running = false;\n }", "public void stop()\n {\n running = false;\n }", "@Override\n\tpublic void onBackPressed () {\n\t\tif (searchMode) {\n\t\t\ttoggleSearch();\n\t\t\treturn;\n\t\t}\n\t\tsuper.onBackPressed();\n\t}", "public void search() {\n try {\n for(int i = 0; i < this.queries.size(); i++){\n search(i);\n // in case of error stop\n if(!this.searchOK(i)){\n System.out.println(\"\\t\" + new Date().toString() + \" \" + db + \" Search for rest queries cancelled, because failed for query \" + i + \" : \" + this.queries.get(i));\n break;\n }\n }\n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(EntrezSearcher.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public final void stop() {\n running = false;\n \n \n\n }", "public void stop() {\n enable = false;\n }", "@Override\r\n\tpublic void search() {\n\r\n\t}", "@Override\n\tpublic void stop() {\n\t}", "@Override\n\tpublic void stop() {\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();" ]
[ "0.6903087", "0.6768533", "0.6768533", "0.6668062", "0.65941125", "0.6367051", "0.6364052", "0.6354515", "0.6314243", "0.62831223", "0.62505096", "0.6190624", "0.61638606", "0.61441195", "0.61307216", "0.610886", "0.61073375", "0.6106832", "0.61066705", "0.61020935", "0.6086659", "0.60400665", "0.60231334", "0.6018395", "0.5987991", "0.59859616", "0.5984837", "0.5979252", "0.5968863", "0.596048", "0.5938656", "0.5938125", "0.59355336", "0.5916781", "0.5910514", "0.58965826", "0.58919895", "0.5863891", "0.58567727", "0.583645", "0.58315486", "0.58209103", "0.58162135", "0.5813761", "0.5813761", "0.5801849", "0.57966197", "0.5794478", "0.578843", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.5788128", "0.57861865", "0.57837635", "0.57820624", "0.57787573", "0.5775566", "0.5759009", "0.574665", "0.57401574", "0.5738559", "0.5738559", "0.5738559", "0.5738559", "0.5738559", "0.5738559", "0.5738559", "0.5738559", "0.5738267", "0.5730539", "0.5730334", "0.5723104", "0.5723104", "0.5722735", "0.57225364", "0.5719469", "0.57187164", "0.5716587", "0.5710838", "0.5710098", "0.57002854", "0.5693358", "0.5691204", "0.5689648", "0.56819665", "0.5670737", "0.5668568", "0.56523824", "0.56523824", "0.5652209", "0.5652209", "0.5652209", "0.5652209" ]
0.0
-1
standalone Java programs must have a main() function, which is the point where execution begins
public static void main(String[] Args) { // note that locals have no public/private/... prefix; also, we // are using the fact that array objects, in this case Args, have // "length" variables built in int NumElements = Args.length; for (int I = 1; I <= NumElements; I++) { int Num; // need to do C's "atoi()"; use parseInt(), a class method of // the Integer class; inverse operation is toString() Num = Integer.parseInt(Args[I-1]); // create a new node NumNode NN = new NumNode(Num); NN.Insert(); } System.out.println("final sorted list:"); NumNode.PrintList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) // every Java program starts with a main method or function\r\n\t{\n\t}", "public static void main() {\n }", "public static void main()\n\t{\n\t}", "public static void main(){\n\t}", "public static void main() {\n \n }", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(java.\n lang.\n String[] args) {\n \tif (x10.lang.Runtime.runtime == null) {\n \t\tSystem.err.println(\"Please use the 'x10' script to invoke X10 programs, or see the generated\");\n \t\tSystem.err.println(\"Java code for alternate invocation instructions.\");\n \t\tSystem.exit(128);\n \t}\n {\n \n//#line 3\nProgram0.\n runMain();\n }\n }", "public void main(){\n }", "static void main(String[] args)\n {\n }", "public static void main (String []args){\n }", "static void main(String[] args) {\n }", "public static void main(String[] args) { }", "public static void main(String... args) {\n doMain().run();\n }", "public static void main(String[] args) {\n new Main();\n }", "public static void main(String args[]) {}", "public static void main(String args[]) {}", "public static void main(String args[]) {}", "private Main()\n {{\n System.err.println ( \"Internal error: \"+\n\t \"unexpected call to default constructor for Main.\" );\n System.exit(-127);\n }}", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args) {\n //launch it\n launch();\n }", "public static void main(String []args){\n }", "public static void main(String []args){\n }", "public static void main(String[] args) { }", "public static void main(String[] args) {\t}", "public static void main(String[] args) {\n new Program();\n }", "public static void main(String []args){\n\n }", "public static void main(String[] args) \n {\n\t \n\t \n\t \n}", "public static void main(String[] args) {\n new Main();\r\n }", "static public void main(String[] args) {\n\t}", "public static void main(String[] argv){\n\t}", "public static void main (String[] args) {\n }", "public static void main(String[] args) {\n \n }", "public static void main (String[] args)\r\n{\r\n}", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main (String[] args) {\n\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\r\n\t\tlaunch(args);\r\n\r\n\t}", "public static void main (String[] args)\r\n {\n }", "public static void main(String arg[]) {\n\n\t\tUtility.runApplication();\n\t}", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n }", "public static void main(String[] args) {\r\n }", "public static void main(String[] args) {\n \n\n }", "public static void main(String[] args) {\r\n\t launch(args); \r\n \r\n}", "public static void main (String [] args) {\n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public static void main(String[] args) {\n new Main().run();\n }", "public static void main(String[] args) {\n\t\r\n}", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main.main(args);\n }", "public void main(String[] args) {\n\t}", "public static void main(String[] args)\n {\n\t\n }", "public static void main(String[] args) {\n}", "public Main() {}", "public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }", "public static void main(String[] args)\r\n {\r\n }", "public static void main(String[] args)\r\n {\r\n }", "public static void main(String[] args) {\n\n\n\n }", "public static void main(String[] args) {\n\n\n\n }", "public static void main(String[] args) {\n\n\n\n }", "public static void main(String[] args) {\r\n\t launch(args);\r\n\t}", "public static void main(String[] args)\r\n {\r\n \r\n \r\n \r\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String [] args) {\n }", "public static void main(String [] args) {\n }", "public void Main(){\n }", "public static void main(String[] args) {\n launch(args);\r\n \r\n }", "public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End of Program\"); //3\n }", "public static void main(String[]args) {\n\t}", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n System.out.println(\"Hello Java!\");\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }", "public static void main(String[] args) {\n }" ]
[ "0.82493436", "0.8117206", "0.80676645", "0.7992671", "0.7856474", "0.77653855", "0.77653855", "0.7727026", "0.77004004", "0.7654147", "0.7653388", "0.76490635", "0.75943047", "0.75783455", "0.75419337", "0.75363266", "0.75363266", "0.75363266", "0.75230503", "0.7515573", "0.7510501", "0.7503294", "0.7503294", "0.74869764", "0.74708587", "0.7462881", "0.74574935", "0.7440055", "0.7416846", "0.74112916", "0.7404034", "0.7397501", "0.73721963", "0.7369417", "0.73651403", "0.73651403", "0.73577994", "0.7357164", "0.7352396", "0.73466134", "0.7345008", "0.7345008", "0.7344513", "0.7344513", "0.7338683", "0.7335384", "0.7332804", "0.7317173", "0.73163563", "0.7315549", "0.7312844", "0.73115665", "0.73101574", "0.7305858", "0.73048025", "0.73031414", "0.7301669", "0.7301669", "0.73007655", "0.73007655", "0.73007655", "0.730002", "0.72981155", "0.72881955", "0.72843575", "0.72843575", "0.72843575", "0.72843575", "0.72843575", "0.72820055", "0.72820055", "0.7280193", "0.7280035", "0.7274958", "0.72746676", "0.7271701", "0.7270654", "0.727057", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146", "0.7263146" ]
0.0
-1
make the following methods visible externally, e.g. to main(), via public; the ones which are class methods rather than instance methods also are static
public static NumNode Head() { return Nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void staticFun()\n {\n }", "public void myPublicMethod() {\n\t\t\n\t}", "private static void LessonInstanceVsStatic() {\n System.out.println(MathHelper.E);\n System.out.println(MathHelper.PI);\n System.out.println(MathHelper.square(5));\n //Three helper methods for StringHelper\n System.out.println(StringHelper.removeLeadingAndTrailingSpaces(\" Hello \"));\n System.out.println(StringHelper.removeAllSpace(\" He ll o !\"));\n System.out.println(StringHelper.yelling(\"hello\"));\n //Three helper methods for MathHelper\n System.out.println(MathHelper.cubed(5));\n System.out.println(MathHelper.areaOfRectangle(2,3));\n System.out.println(MathHelper.perimeterOfRectangle(4, 5));\n\n }", "public static void main(String[] args) {\n\t\tnon_static(); // static contain only static methods, variables\r\n//\t\tnon_static2();\r\n\t}", "public static void main(String[] args) {\n // since we declared the variables in access modifier class as static ==> we can call them through class name\n // here we will call the variables BUT private variable cannot be called into inherited\n System.out.println(c04_TestData2.publicVariable);\n System.out.println(c04_TestData2.protectedVariable);\n System.out.println(c04_TestData2.defaultVariable);\n\n // here we will call the method that were created in AccessModifier class into here\n // only public, protected, and default methods only can be inherited and used here\n c04_TestData2.publicMethod();\n c04_TestData2.protectedMethod();\n c04_TestData2.defaultMethod();\n\n // because they are static method we can call them like this too\n publicMethod();\n protectedMethod();\n defaultMethod();\n }", "public void checkPublic() {\n }", "public static void main(String[] args) {\n\t\tStaticDemo1.f3();\n\t\tStaticDemo1 sd1 = new StaticDemo1();\n\t\tsd1.f1();\n\t\t/*you cannot call instance methods in static methods*/\n\t\t\n\t}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public interface NonStaticNail {\n\n public void nailMain(String[] args);\n}", "private ThoseMain()\n {\n // Do nothing\n }", "private CommonMethods() {\n }", "private Main() {}", "static void staticShow() {\n System.out.println(\"In a static class static method\");\n }", "public static void main(String[] args) {\n\t\tcallingstatic obj = new callingstatic(); //object to call nonstatic func or var. \n\t\t\n\tsum(); //Direct calling static method.\n\tcallingstatic.sum(); //indirect calling static method through class name.\n\t//obj.sum(); //nonstatic way to call static method. \n\t\n\tobj.divide(); //calling nonstatic func though obj\n\tSystem.out.println(obj.name); //calling nonstatic var though obj\n\t}", "private static boolean getInternalPublicMethods(Class<?> paramClass, Map<Signature, Method> paramMap) {\n/* 143 */ Method[] arrayOfMethod = null;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ try {\n/* 150 */ if (!Modifier.isPublic(paramClass.getModifiers())) {\n/* 151 */ return false;\n/* */ }\n/* 153 */ if (!ReflectUtil.isPackageAccessible(paramClass)) {\n/* 154 */ return false;\n/* */ }\n/* */ \n/* 157 */ arrayOfMethod = paramClass.getMethods();\n/* 158 */ } catch (SecurityException securityException) {\n/* 159 */ return false;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 168 */ boolean bool = true; byte b;\n/* 169 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 170 */ Class<?> clazz = arrayOfMethod[b].getDeclaringClass();\n/* 171 */ if (!Modifier.isPublic(clazz.getModifiers())) {\n/* 172 */ bool = false;\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* 177 */ if (bool) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 182 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 183 */ addMethod(paramMap, arrayOfMethod[b]);\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 190 */ for (b = 0; b < arrayOfMethod.length; b++) {\n/* 191 */ Class<?> clazz = arrayOfMethod[b].getDeclaringClass();\n/* 192 */ if (paramClass.equals(clazz)) {\n/* 193 */ addMethod(paramMap, arrayOfMethod[b]);\n/* */ }\n/* */ } \n/* */ } \n/* 197 */ return bool;\n/* */ }", "static void method3(){\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tStaticMethodOverLoading.getName();\n\t\tStaticMethodOverLoading.getName(4);\n\t\t\n\t\tStaticMethodOverLoading.main(7); //static methods can be called by using class name\n\t\t\n\t\tStaticMethodOverLoading.main(7,6);\n\t}", "static void method1() {\r\n\t\r\n}", "public static void getInfo1() {\n \t//\tSystem.out.println(\"My name is \"+ name+ \"and my last name is \"+ lastName);\n \t\t//will get an error\n \tSystem.out.println(\"I am a static method \");\n \t// we can't access non static method within static \n \t}", "public static void getInfo1() {\n\t\tSystem.out.println(\"I am a static Method\");\n\t\t\t\t\t\t\t\t\t\t\t\t // we can not access non static Members within static Method!!\n\t}", "static void jhat() {\n\n }", "static void test(){\n\t }", "private Main() {\n }", "public static void staticMethod() {\n Log.e(\"LOG_TAG\", \"Company: STATIC Instance method\");\n }", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "public static void main(String[] args) {\n\t\tMovable m = MyClass::aMethod;\n\t\tm.move();\n\t\t//instance method reference on specific object\n\t\tYourClass y = new YourClass();\n\t\tm = y::yourMethod;\n\t\tm.move();\n\t\t// instance method reference on arbitrary object\n\t\tStringMerger sm = String::concat;\n\t\tSystem.out.println(sm.merge(\"Hello\", \" World\"));\n\t\t//constructor reference\n\t\tMessaging mg = Message::new;\n\t\tMessage ob = mg.getInstance(\"abc\");\n\t\tSystem.out.println(ob.getMsg());\n\t}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "public static void staticExample() {\n\t\tSystem.out.println(\"I am the static method from the child class\");\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.917 -0500\", hash_original_method = \"4F6254C867328A153FDD5BD23453E816\", hash_generated_method = \"627F9C594B5D3368AD9A21A5E43D2CB8\")\n \nprivate Extensions() {}", "private stendhal() {\n\t}", "public static void main() {\n \n }", "public void test() {\n\t\t\tSystem.out.println(\"I am non static test method\");\n\t\t}", "public void getInfo() {\n\tSystem.out.println(\"My name is \"+ name+ \" my last name is \"+ lastName);\n\t // we can access static members within non static Method!!\n\t\n}", "private SelfShieldingCalc()\n {\n // This class should just contain static methods. Don't let anyone\n // instantiate it.\n }", "public static void main(String[] args) {\n\n\t\tSample1 AM = new Sample1();\n\t\t\n\t\tAM.PROTECTEDMETHOD();\n\t\t\n\t\tAM.PUBLICMETHOD();\n\t\t\n\t}", "static void sm() {\n }", "public static void staticMethod() {\r\n\t\tSystem.out.println(\"StaticMethod\");\r\n\t}", "private RunUtils() {\n }", "private DungeonBotsMain() {\n\t\t// Does nothing.\n\t}", "public void myProgram();", "static void method2(){\n StaticDemo staticDemo=new StaticDemo();\n System.out.println(staticDemo.name);\n staticDemo.method1();\n method3();\n\n }", "public void Main(){\n }", "public static void main(String[] args) {\n PublicClass pc = new PublicClass(5);\n \n // Can access the instance variable i directly\n // because it's public\n System.out.println(pc.i);\n\n // Can call the printI method because it's public\n pc.printI();\n }", "public static void main(String[] args) {\n NonStaticFunctions objRef= new NonStaticFunctions(); \n \n int add=objRef.sum(10, 20);\n System.out.println(objRef.age);\n \n message();\n System.out.println(name);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tC2 c2Obj=new C2();\n\t\t//c2Obj.c2(); exception\n\t\t\n\t\t\n\t\tTest t=new Test();\n\t\tt.f1();\n\t\t//t.f2(); // error. Because f2 is default method\n\t\t//t.f3(); // error. f3 is protected method\n\t\t//t.f4(); // error f4 is private method\n\t\t\n\t\tC1 c1=new C1();\n\t\tc1.f1();// public\n\t\t//c1.f2();\n\t\tc1.f3(); // protected. \n\t\t\n\t\t\n\t\t\n\t}", "public void testPublic() throws IOException {\n String[] publicHello = new String[] { \"method-execution(void HelloWorld.main(java.lang.String[]))\" };\n String[] publicFancyHello = new String[] { \"method-execution(void FancyHelloWorld.main(java.lang.String[]))\", \"method-execution(java.lang.String FancyHelloWorld.getName())\" };\n checkPointcut(\"execution(public * *(..))\", publicHello, publicFancyHello);\n }", "private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}", "public static void t(){\n\n\n }", "private ChainingMethods() {\n // private constructor\n\n }", "public static void main(String[] args) {\n\t\tDemo_1 tt = new Demo_1();\n\t\ttt.sayHello();\n\t\t\n\t\t//this is how you print variable unlikely than a method\n\t\tSystem.out.println(tt.nonStaticVar); \n\t\t\n\t\t//static method can be called in two different ways:\n\t\t\n\t\tsayHI(); //This is not a recommended practice. However method from other non static class needs to make object. \n\t\t\n\t\tDemo_1.sayHI(); //Calling static method in this way is regarded as the best practices, which indicates class name as well. \n\t\tSystem.out.println(Demo_1.staticVar);//Always do this way, which clearly shows original method. \n\t}", "@Test(timeout = TIMEOUT)\n public void testPublicMethods() {\n Class sortingClass = Sorting.class;\n Method[] methods = sortingClass.getMethods();\n String[] methodStrings = new String[methods.length];\n for (int i = 0; i < methods.length; i++) {\n methodStrings[i] = methods[i].toString();\n }\n String[] validMethodStrings = {\n \"public static void Sorting.insertionSort(java.lang.Object[],java.util.Comparator)\",\n \"public static void Sorting.cocktailSort(java.lang.Object[],java.util.Comparator)\",\n \"public static void Sorting.lsdRadixSort(int[])\",\n \"public static void Sorting.quickSort(java.lang.Object[],java.util.Comparator,java.util.Random)\",\n \"public static void Sorting.mergeSort(java.lang.Object[],java.util.Comparator)\",\n \"public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException\",\n \"public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException\",\n \"public final void java.lang.Object.wait() throws java.lang.InterruptedException\",\n \"public boolean java.lang.Object.equals(java.lang.Object)\",\n \"public java.lang.String java.lang.Object.toString()\",\n \"public native int java.lang.Object.hashCode()\",\n \"public final native java.lang.Class java.lang.Object.getClass()\",\n \"public final native void java.lang.Object.notify()\",\n \"public final native void java.lang.Object.notifyAll()\"\n };\n Arrays.sort(methodStrings);\n Arrays.sort(validMethodStrings);\n assertArrayEquals(methodStrings, validMethodStrings);\n }", "public static void staticMethodThree(){\n ClassOne.staticMethodOne();\n }", "private Utils() {\n\t}", "private Utils() {\n\t}", "private void visitAdditionalEntrypoints() {\n\tLinkedHashSet<jq_Class> extraClasses = new LinkedHashSet<jq_Class>();\n\tfor(jq_Method m: publicMethods) {\n\t extraClasses.add(m.getDeclaringClass());\n\t}\n\t\n\tfor(jq_Class cl: extraClasses) {\n\t visitClass(cl);\n\t\t\tjq_Method ctor = cl.getInitializer(new jq_NameAndDesc(\"<init>\", \"()V\"));\n\t\t\tif (ctor != null)\n\t\t\t\tvisitMethod(ctor);\n\t}\n\n\tfor(jq_Method m: publicMethods) {\n\t visitMethod(m);\n\t}\n }", "protected abstract void runPrivate();", "void add1() {\n\t\tStatic_Demo s=new Static_Demo();\r\n\t\ts.add();\r\n\t\t\r\n\t\t//calling static method of one class inside another non static of different class via classname\r\n\t\tStatic_Demo.sub();\r\n\t}", "public static void main(String[] args) {\n MyInterfaceStatic.methodStatic();\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tAccessModifier obj = new AccessModifier();\r\n\t\tobj.publicFunction();\r\n\t\tTestAccessModAtProjectLevel obj2= new \tTestAccessModAtProjectLevel();\r\n\t\tobj2.protectedfunction();\r\n\t}", "public void NonStaticMethodFour(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n\n //8) A non-static method calling a static method in another class\n ClassOne obj2 = new ClassOne();\n obj2.nonStaticMethodOne();\n }", "static void test1(){\n\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"--------Method reference of static methods-------\");\n//\t\tNo Arg static method reference\n\t\tNoArgMethodInterf mi = MethodRefereceDemo::method1;\n\t\tmi.m1();\n//\t\tSingle Arg static method reference\n\t\tSingleArgMethodInterf mi1 = MethodRefereceDemo::method1;\n\t\tmi1.m1(10);\n//\t\tMulti Arg static method reference\n\t\tMultiArgMethodInterf mi2 = MethodRefereceDemo::method1;\n\t\tmi2.m1(10, \"Kumar\");\n//\t\t--------Method reference of instance methods-------\n\t\tSystem.out.println(\"--------Method reference of instance methods-------\");\n//\t\tNo Arg method reference\n\t\tNoArgMethodInterf mii = new MethodRefereceDemo()::method2;\n\t\tmii.m1();\n//\t\tSingle Arg method reference\n\t\tSingleArgMethodInterf mii1 = new MethodRefereceDemo()::method2;\n\t\tmii1.m1(20);\n//\t\tMulti Arg method reference\n\t\tMultiArgMethodInterf mii2 = new MethodRefereceDemo()::method2;\n\t\tmii2.m1(20, \"Dharma\");\n\t}", "@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.println(\"method one \");\r\n };\r\n \r\n public static void one1()\r\n {\r\n System.out.println(\"method one 1 \");\r\n };\r\n \r\n public default void one2()\r\n \t {\r\n \t System.out.println(\"method one2 \");\r\n };\r\n \r\n }", "public interface Program {\n\n\t/**\n\t * The name of the string class\n\t */\n\tpublic static final String STRING_CLASS = \"String\";\n\n\t/**\n\t * The name of the object class\n\t */\n\tpublic static final String OBJECT_CLASS = \"Object\";\n\n\t/**\n\t * Yields an unmodifiable view of all the methods and constructors that are part\n\t * of the program to analyze.\n\t * \n\t * @return the collection of method and constructors\n\t */\n\tCollection<MCodeMember> getAllCodeMembers();\n\n\t/**\n\t * Yields an unmodifiable view of all the methods and constructors that are part\n\t * of the program to analyze, excluding ones from the String and Object classes.\n\t * \n\t * @return the collection of method and constructors\n\t */\n\tCollection<MCodeMember> getAllSubmittedCodeMembers();\n}", "public static void main(String[] args) {\n // call directly since we are in same class\n //sayHelloWorld7Times();\n // alternatively call using class name\n MethodPractice.sayHelloWorld7Times();\n\n // you can call static method of other class\n // using className.methodName(...)\n MethodIntro.sayHello();\n calculateMathProblem();\n\n }", "interface Accessible {\n // All interface variables are public static final\n int SOME_CONSTANT = 100;\n // all interface methods are automatically public\n public void methodA();\n void methodB();\n boolean methodC();\n}", "public static void main(String[] args)\r\n\t{\r\n\t\t//static members belong to the class instead of a specific instance\r\n\t\t/*\r\n\t\t * Podsumowujac:\r\n\t\t * static oznacza, ze sa wykonywane dzialania na KLASIE a nie na obiekcie\r\n\t\t * bez znacznika static metoda/zmienna jest zalezna od instancji\r\n\t\t * a static powoduje zmiany na CAŁEJ KLASIE\r\n\t\t * \r\n\t\t * \r\n\t\t * w przypadku klasy NIE MOZNA uzywac metod które nie maja słowa klucz 'static'\r\n\t\t * w przypadku instancji NIE POWINNO sie uzywac metod ktore maja slowo klucz 'static'\r\n\t\t */\r\n\t\t\r\n\t\tHello hello = new Hello();\r\n\t\tHello hello1 = new Hello();\r\n\t\t\r\n\t\t//tak powinno sie uzywac metod z 'static' (czyli nazwa klasy a nie instancji)\r\n\t\tHello.DoSomething(\"Hi youtube\");\r\n\r\n\t\t//tak powinno sie uzywac metod bez 'static' (nazwa instancji)\r\n\t\thello.DoSomethingElse(\"hello world\");\r\n\t\t\r\n\t\t//tak NIE powinno sie uzywac zmiennych z 'static' \r\n\t\thello.age= 10;\r\n\t\t\r\n\t\tSystem.out.println(hello.age);\r\n\t\t\r\n\t\thello1.age =50;\r\n\t\tSystem.out.println(hello1.age);\r\n\t\tSystem.out.println(hello.age);\r\n\t\t\r\n\t\t//tak powinno sie uzywac zmniennych z 'static'\r\n\t\tHello.age = 15;\r\n\t\tSystem.out.println(Hello.age);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "abstract protected Set<Method> createMethods();", "public static Method[] getPublicMethods(Class<?> paramClass) {\n/* 107 */ if (System.getSecurityManager() == null) {\n/* 108 */ return paramClass.getMethods();\n/* */ }\n/* 110 */ HashMap<Object, Object> hashMap = new HashMap<>();\n/* 111 */ while (paramClass != null) {\n/* 112 */ boolean bool = getInternalPublicMethods(paramClass, (Map)hashMap);\n/* 113 */ if (bool) {\n/* */ break;\n/* */ }\n/* 116 */ getInterfaceMethods(paramClass, (Map)hashMap);\n/* 117 */ paramClass = paramClass.getSuperclass();\n/* */ } \n/* 119 */ return (Method[])hashMap.values().toArray((Object[])new Method[hashMap.size()]);\n/* */ }", "private Utility() {\n throw new IllegalAccessError();\n }", "public static void main(){\n\t}", "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 Fun_yet_extremely_useless()\n {\n\n }", "public void nonStaticMethodTwo(){\n nonStaticMethodOne();\n\n //7) A non-static method calling a static method in the same class\n staticMethodOne();\n }", "public void methodReferences() {\n\t\t// Write sample for below\n\n\t\t// Static method\n\t\t// Instance method on parameter objects\n\t\t// Instance method\n\t\t// Constructor\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"-----Accessing Static Nested method from Diffrent Class---\");\n\t\t\n\t\tNested.Inner n=new Nested.Inner();\n\t\tn.m1(); \n\t\t//Inner.m1()\n\t\tNested n1=new Nested();\n\t\tn1.m2();\n\t\t\n\n\t}", "public static void main(String[] args) {\n FunctionInJava obj=new FunctionInJava();\n //one object will be created , obj is references variable, referring to this object\n//after creating the object,the copy of the all non static methods will be give the to this object\n obj.test();\n int l=obj.pqr();\n System.out.println(l);\n String s1=obj.qa();\n System.out.println(s1);\n int div=obj.division(30,10);\n System.out.println(div);\n// main method void, never return the value\n }", "public static void isStatic() {\n\n }", "@Pointcut(\"execution(public * *(..))\")\r\n\tpublic void allPublicOperations(){}", "public static void print() { //This is a Java method,Which will print \"Hello World\" on the cmd prompt.\n //Note : Keywords used : -\n //public : for the public access of method anywhere in this file or Another file.\n //static : It is used for a constant variable or a method that is same for every instance of a class.\n //void : returns nothing.\n System.out.println(\"Hello World\");\n }", "public static void main(String[] args){\n Car myCar = new Car();\n myCar.car_human();\n myCar.car_color(); \n }", "@Override\n public void pub() {\n // can only be public\n }", "public static void main(String[] args) {\n\t\tint a=Sum (10,20);\r\n\t\tint b=Sum (20,50);\r\n\t\tSystem.out.println(a+b);\r\n\r\n\t\tNonStaticFunction obj= new NonStaticFunction();\r\n\t\tSystem.out.println(obj.sum(10, 20));\r\n\t}", "interface Interface1 {\n\n\tdefault void add() {\n\t\tSystem.out.println(\"Interface1 add method\");\n\t}\n\n\tdefault void display() {\n\t\tSystem.out.println(\"Interface1 display\");\n\t}\n\n\t//static methods can be invoked only using InterfaceName.methodName\n\tstatic void print() {\n\t\tSystem.out.println(\"Interface1 print\");\n\t}\n\n\tstatic void printV2() {\n\t\tSystem.out.println(\"Interface1 printV2\");\n\t}\n}", "public static void staticMethodThree(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n }", "private void Nice(){\n }", "public static void staticMethodFour(){\n ClassOne obj = new ClassOne();\n obj.nonStaticMethodOne();\n }", "public static void display() {\n System.out.println(\"Static or class method from Base\");\n }", "static void method1()\r\n {\n }", "interface TakesScreenshot{\n\tString $FILE_EXTENSION=\".png\"; //COMPILER ADDs 'public static final' automatically \t\n\tvoid takesScreenshot();\n\t//added from jdk 1.8\nstatic void takeSelfie() {\n\t\tSystem.out.println(\"I am defined static method of TakesScreenshot interface\");\n\t}\ndefault void takePictures() {\n\t\tSystem.out.println(\"I am default defined method of TakesScreenshot interface\");\n\t}\n}", "static void q7(){\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "private abstract void privateabstract();", "private FunctionUtils() {\n }", "private Util() {\n }", "void mo22249a();", "private Util() { }" ]
[ "0.6626651", "0.64683336", "0.64585525", "0.6350434", "0.63311774", "0.63051564", "0.62818295", "0.6278019", "0.6278019", "0.60943544", "0.60764486", "0.6073185", "0.6017588", "0.60136163", "0.60125226", "0.59922653", "0.59529346", "0.59434855", "0.5881726", "0.5876949", "0.584971", "0.5841382", "0.58243406", "0.5823337", "0.5797122", "0.57910675", "0.57851803", "0.57693124", "0.57693124", "0.57693124", "0.57693124", "0.5766673", "0.57389426", "0.57339346", "0.57206434", "0.5712327", "0.57082194", "0.57056564", "0.5684935", "0.56797767", "0.5666582", "0.56663215", "0.5662919", "0.56626475", "0.5648094", "0.56438774", "0.56392086", "0.5638923", "0.56382006", "0.5634403", "0.56343096", "0.56332225", "0.5632831", "0.56255734", "0.561368", "0.56051004", "0.56041306", "0.56041306", "0.5603907", "0.5597006", "0.5590549", "0.5583603", "0.5583027", "0.5577893", "0.55667615", "0.55654234", "0.5564144", "0.55592936", "0.5557484", "0.5556525", "0.55532086", "0.5551677", "0.5550216", "0.55492926", "0.55492646", "0.55450153", "0.55438566", "0.55413175", "0.55373377", "0.55321777", "0.5527287", "0.5518182", "0.55121654", "0.5508141", "0.5497178", "0.5496534", "0.5485098", "0.5480945", "0.5471758", "0.546877", "0.54678696", "0.5462478", "0.54577273", "0.5451749", "0.5447845", "0.5437106", "0.54325837", "0.541057", "0.54045343", "0.5400414", "0.5385936" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { BubbleSort bs = new BubbleSort(); int[] arr = {9, 1, 5, 8, 3, 7, 6, 4, 2}; // int[] arr = {2, 1, 3, 4, 5, 6, 7, 8, 9}; // bs.bubbleSort0(arr); // bs.bubbleSortNormal(arr); bs.bubbleSortImporve(arr); }
{ "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
page.setColor(Color.white); page.drawRect((int)bounds.getX(), (int)bounds.getY(), (int)bounds.getWidth(), (int) bounds.getHeight());
protected void drawBounds(Graphics page) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void paintComponent(Graphics page)\n {\n super.paintComponent(page);\n\n //set color, then draw a rectangle\n page.setColor(currentColor);\n\n page.drawRect(x1, y1, currentWidth, currentHeight);\n }", "public void paint(Graphics page)\n\t{\n\t\tpage.setColor(Color.DARK_GRAY);\n\t\tpage.fillOval(x, y, width, height);\n\t}", "public void drawRect(int x, int y, int width, int height, int color);", "public void drawRect(int x, int y, int width, int height);", "public void drawPage(PDPage p) throws IOException\n {\n page = p;\n\n\tPDRectangle cropBox = page.findCropBox();\n\tfloat widthPt = cropBox.getWidth();\n\tfloat heightPt = cropBox.getHeight();\n\t// float scaling = resolution / (float)DEFAULT_USER_SPACE_UNIT_DPI;\n\tfloat scaling = (float)1.0;\n\tint widthPx = Math.round(widthPt * scaling);\n\tint heightPx = Math.round(heightPt * scaling);\n\t//TODO The following reduces accuracy. It should really be a Dimension2D.Float.\n\tpageSize = new Dimension( (int)widthPt, (int)heightPt );\n\n\tsetPageAffineTransform(page);\n if ( page.getContents() != null) \n {\n PDResources resources = page.findResources();\n processStream( page, resources, page.getContents().getStream() );\n }\n List<PDAnnotation> annotations = page.getAnnotations();\n for( int i=0; i<annotations.size(); i++ )\n {\n PDAnnotation annot = (PDAnnotation)annotations.get( i );\n PDRectangle rect = annot.getRectangle();\n String appearanceName = annot.getAppearanceStream();\n PDAppearanceDictionary appearDictionary = annot.getAppearance();\n if( appearDictionary != null )\n {\n if( appearanceName == null )\n {\n appearanceName = \"default\";\n }\n Map<String, PDAppearanceStream> appearanceMap = appearDictionary.getNormalAppearance();\n if (appearanceMap != null) \n { \n PDAppearanceStream appearance = \n (PDAppearanceStream)appearanceMap.get( appearanceName ); \n if( appearance != null ) \n { \n Point2D point = new Point2D.Float(rect.getLowerLeftX(), rect.getLowerLeftY());\n Matrix matrix = appearance.getMatrix();\n if (matrix != null) \n {\n // transform the rectangle using the given matrix \n AffineTransform at = matrix.createAffineTransform();\n at.transform(point, point);\n }\n\t\t\t// g.translate( (int)point.getX(), -(int)point.getY() );\n processSubStream( page, appearance.getResources(), appearance.getStream() ); \n\t\t\t// g.translate( -(int)point.getX(), (int)point.getY() ); \n }\n }\n }\n }\n\n }", "void render(Rectangle borders);", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "void paintMainArea(Graphics g);", "void createRectangles();", "public void draw() {\n background(0);\n}", "void paintOverall(Graphics g);", "@Override\r\n public void draw()\r\n {\n\r\n }", "public void draw(Graphics g, Rectangle bounds)\n\t{\n\t\t\n\t}", "private void drawBox(Graphics window, int hsBtoRGB, int x, int y) {\n\t\t\n\t}", "@Override\n public void paint(Graphics g) {\n }", "public void drawRect(int left, int top, int right, int i, Paint p) {\n\t\t\n\t}", "@Override\r\n\tpublic void renderBackground() {\n\r\n\t}", "public void paint (Graphics g){\n \r\n }", "private Graphics buildPage(Graphics g, double width, double height, int page) {\n \t\t\n \t\tCalendar cal = GregorianCalendar.getInstance();\n \t\tcal.setTime(d);\n \t\t\n \t\tFont bigFont = new Font(\"Monospaced\", Font.BOLD, 20);\n \t\tFont smallFont = new Font(\"Monospaced\", Font.PLAIN, 9);\n \t\tFont medFont = new Font(\"Monospaced\", Font.PLAIN, 14);\n \t\t\n \t\tGraphics2D g2d = (Graphics2D) g;\n \t\tRectangle2D.Double rect = new Rectangle2D.Double ();\n \t\tdouble startx = Constants.PRINT_MARGINX;\n \t\tdouble starty = Constants.PRINT_MARGINY;\n \t\trect.setRect (startx, starty, width, 50);\n \t\tg2d.draw(rect);\n \t\tg2d.setFont(bigFont);\n \t\tString heading;\n \t\tint month = cal.get(Calendar.MONTH);\n \t\tif (month == 0) heading = \"January \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 1) heading = \"February \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 2) heading = \"March \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 3) heading = \"April \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 4) heading = \"May \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 5) heading = \"June \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 6) heading = \"July \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 7) heading = \"August \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 8) heading = \"September \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 9) heading = \"October \" + cal.get(Calendar.YEAR);\n \t\telse if (month == 10) heading = \"November \" + cal.get(Calendar.YEAR);\n \t\telse heading = \"December \" + cal.get(Calendar.YEAR);\n \t\t\n \t\tFontMetrics f = g2d.getFontMetrics();\n \t\tint offsetx = (int)(width / 2.0 - f.charWidth(' ') * (heading.length() / 2.0));\n \t\tg2d.drawString(heading, (int)startx + offsetx, (int)starty + f.getHeight());\n \t\t\n \t\tstarty += 50;\n \t\t\n \t\tdouble blockWidth = width / 7;\n \t\tdouble blockHeight = (height-100) / 6;\n \t\tg2d.setFont(medFont);\n \t\tf = g2d.getFontMetrics();\n \t\t\n \t\tfor (int i = 0; i < 7; i++) {\n \t\t\trect = new Rectangle2D.Double ();\n \t\t\trect.setRect (startx, starty, blockWidth, 50);\n \t\t\tg2d.draw(rect);\n \t\t\tif (i == 0) heading = \"Sunday\";\n \t\t\telse if (i == 1) heading = \"Monday\";\n \t\t\telse if (i == 2) heading = \"Tuesday\";\n \t\t\telse if (i == 3) heading = \"Wednesday\";\n \t\t\telse if (i == 4) heading = \"Thursday\";\n \t\t\telse if (i == 5) heading = \"Friday\";\n \t\t\telse heading = \"Saturday\";\n \t\t\tg2d.drawString(heading, (int)startx + 5, (int)starty + f.getHeight());\n \t\t\tstartx += blockWidth;\n \t\t}\n \t\t\n \t\tstartx = Constants.PRINT_MARGINX;\n \t\tstarty += 50;\n \t\t\n \t\tg2d.setFont(smallFont);\n \t\tf = g2d.getFontMetrics();\n \t\t\n \t\t//GregorianCalendar cal = new GregorianCalendar();\n \t\t//cal.set(Calendar.DATE, 1);\n \t\t//cal.set(Calendar.MONTH, d.getMonth() - 1);\n \t\t//cal.set(Calendar.YEAR, d.getYear());\n \t\t\n \t\tint prevDays = cal.get(Calendar.DAY_OF_WEEK) - 1; \n \t\tint endDays = 42 - cal.getActualMaximum(Calendar.DAY_OF_MONTH) - prevDays;\n \t\t\n \t\tcal.roll(Calendar.MONTH, false);\n \t\t\n \t\tint rowCount = 0;\n \t\t\n \t\tfor (int i = 1; i <= prevDays; i++) {\n \t\t\t//Date date = new Date(cal.get(Calendar.MONTH) + 1, cal.getActualMaximum(Calendar.DAY_OF_MONTH) - prevDays + i, cal.get(Calendar.YEAR));\n \t\t\trect = new Rectangle2D.Double ();\n \t\t\trect.setRect (startx, starty, blockWidth, blockHeight);\n \t\t\tg2d.draw(rect);\n \t\t\t//g2d.drawString(date.toFormalString(), (int)startx + 5, (int)starty + f.getHeight());\n \t\t\tstartx += blockWidth;\n \t\t\trowCount++;\n \t\t}\n \t\t\n \t\tcal.roll(Calendar.MONTH, true);\n \t\t\n \t\t\n \t\tfor (int i = 1; i <= cal.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {\n \t\t\tCalendar c = new GregorianCalendar(cal.get(Calendar.MONTH), i, cal.get(Calendar.YEAR));\n \t\t\tDate date = new Date(c.getTime().getTime());\n \t\t\t\n \t\t\t//Date date = new Date(d.getMonth(), i, d.getYear());\n \t\t\trect = new Rectangle2D.Double ();\n \t\t\trect.setRect (startx, starty, blockWidth, blockHeight);\n \t\t\tg2d.draw(rect);\n \t\t\tint offset = 1;\n \t\t\tg2d.drawString(date.toString(), (int)startx + 5, (int)starty + offset * f.getHeight());\n \t\t\toffset++;\n \t\t\t\n \t\t\tDayDto loadedDay = DataServiceImpl.GLOBAL_DATA_INSTANCE.getOrCreateDay(date);\n \t\t\tSchedulePractitionerDto scheduled = new SchedulePractitionerDto();\n \t\t\tscheduled.setField(SchedulePractitionerDto.DATE, loadedDay);\n \t\t\t\n \t\t\t\n \t\t\tif (loadedDay != null && scheduled.getAppointments() != null) {\n \t\t\t\tfor (AppointmentDto appt : scheduled.getAppointments()) {\n \t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\tPractitionerDto p = DataServiceImpl.GLOBAL_DATA_INSTANCE.getPractitioner(appt.getPractSchedID());\n \t\t\t\t\tString s = p.getTypeName();\n \t\t\t\t\t//if (room.isFull()) s = \"*\" + s;\n \t\t\t\t\tg2d.drawString(formatString(s), (int)startx + 5, (int)starty + offset * f.getHeight());\n \t\t\t\t\toffset++;\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\tstartx += blockWidth;\n \t\t\trowCount++;\n \t\t\tif (rowCount >= 7) {\n \t\t\t\trowCount = 0;\n \t\t\t\tstartx = Constants.PRINT_MARGINX;\n \t\t\t\tstarty += blockHeight;\n \t\t\t}\n \t\t}\n \t\t\n \t\tcal.roll(Calendar.MONTH, true);\n \t\t\n \t\tfor (int i = 1; i <= endDays; i++) {\n \t\t\t//Date date = new Date(cal.get(Calendar.MONTH) + 1, i, cal.get(Calendar.YEAR));\n \t\t\trect = new Rectangle2D.Double ();\n \t\t\trect.setRect (startx, starty, blockWidth, blockHeight);\n \t\t\tg2d.draw(rect);\n \t\t\t//g2d.drawString(date.toFormalString(), (int)startx + 5, (int)starty + f.getHeight());\n \t\t\tstartx += blockWidth;\n \t\t\trowCount++;\n \t\t\tif (rowCount >= 7) {\n \t\t\t\trowCount = 0;\n \t\t\t\tstartx = Constants.PRINT_MARGINX;\n \t\t\t\tstarty += blockHeight;\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\t\n \t\treturn g;\n \t}", "void render(GraphicsContext gc, double xOffSet, double yOffSet);", "public void paintComponent(Graphics page) {\n\t super.paintComponent(page); // execute the paint method of JPanel\n\t dwg.draw(page); // have the drawing draw itself\n\t }", "public void draw(Graphics page){\r\n\t\tpage.setColor(Color.RED);\r\n\t\tpage.drawPolygon(this);\r\n\t\t\r\n\t\tif(bDrawQueued){\r\n\t\t\tpage.setColor(Color.GREEN);\r\n\t\t}\r\n\t\t\r\n\t\tdrawFloorName(page);\r\n\t}", "void drawAt(DrawSurface d, Rectangle rect);", "@Override\r\n public void draw() {\n }", "public void paint (Graphics g) {\n super.paint(g);\n // g.setColor(Color.BLUE);\n // g.drawRect(0, 0, 100, 100);\n }", "@Override\n\tpublic void draw() {\n\t}", "@Override\r\n public Rectangle getBounds()\r\n {\r\n try\r\n {\r\n return new Rectangle(0,0,pageSwitcher.getWidth(),pageSwitcher.getHeight());\r\n }\r\n catch(NullPointerException e)\r\n {\r\n return super.getBounds();\r\n }\r\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n public void draw() {\n }", "@Override\n public void draw()\n {\n }", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"Here is the method to draw a Rectangle\");\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "@Override\n public void rect(double x, double y, double width, double height) {\n graphicsEnvironmentImpl.rect(canvas, x, y, width, height);\n }", "private void drawVerticalScrollBar(){\n }", "@Override\r\n\tpublic void render(Graphics g) {\n\t\tg.setColor(Color.yellow);\r\n\t\tg.fillRect((int) getX(), (int) getY(), 5, 10);\r\n\t}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "@Override\r\n protected void paintComponent(Graphics g) {\r\n\r\n Graphics2D g2d = (Graphics2D) g;\r\n\r\n g2d.setColor(new Color(52, 73, 94));\r\n g2d.fillRect(0, 0, getWidth(), getHeight());\r\n }", "public void paint (Graphics g) {\n Rectangle bbox = getBounds (); // find the window size\n paintBox (g, 0, 0, bbox.width, bbox.height); // draw something!\n }", "@Override\n public void draw(Graphics graphics){\n graphics.fillRect(referencePoint.getX() + width / 3, referencePoint.getY() + height / 3, width / 3, height / 3);\n }", "public void SubRect(){\n\t\n}", "void drawRegion (double b, double e) {\n begT = b; endT = e;\n drawStuff (img.getGraphics ());\n }", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"Rectangle.draw()\");\n\t}", "public void draw() {\n\t\tif (fill) {\n\t\t\tapplet.noStroke();\n\t\t\tapplet.fill(color);\n\t\t} else {\n\t\t\tapplet.noFill();\n\t\t\tapplet.stroke(color);\n\t\t}\n\t\tapplet.rect(position.x, position.y, size.x, size.y);\n\t\tsliderButton.draw(new PVector(-10,0));\n\t}", "public void paint (Graphics g)\r\n {\n }", "@Override public void paintComponent(Graphics g)\n{\n Dimension sz = getSize();\n Shape r = new Rectangle2D.Float(0,0,sz.width,sz.height);\n Graphics2D g2 = (Graphics2D) g.create();\n Color top = BoardColors.getColor(BICEX_EVAL_SCROLL_COLOR_PROP);\n g2.setColor(top);\n g2.fill(r);\n\n Collection<BicexEvaluationContext> inners = null;\n if (getContext() != null) inners = getContext().getInnerContexts();\n if (inners != null) {\n long start0 = getContext().getStartTime();\n long end0 = getContext().getEndTime();\n g2.setColor(BoardColors.getColor(BICEX_EVAL_SCROLL_CONTEXT_COLOR_PROP));\n for (BicexEvaluationContext ctx : inners) {\n\t double start = ctx.getStartTime();\n\t double end = ctx.getEndTime();\n\t double v0 = (start-start0)/(end0-start0)*sz.getWidth();\n\t double v1 = (end - start0)/(end0-start0)*sz.getWidth();\n\t Shape r1 = new Rectangle2D.Double(v0,0,v1-v0,sz.height);\n\t g2.fill(r1);\n }\n }\n super.paintComponent(g);\n}", "void addBounds(int x, int y, int width, int height);", "void render(Graphics2D brush);", "@Override\n public void onPaint(Graphics2D g) {\n\n }", "void table(){\n fill(0);\n rect(width/2, height/2, 600, 350); // boarder\n fill(100, 0 ,0);\n rect(width/2, height/2, 550, 300); //Felt\n \n \n}", "public void drawRect(float x, float y, float width, float height, float u, float v, float texW, float texH) {\n float a = TextureManager.getBound().w, b = TextureManager.getBound().h;\n float u1 = u / a, v1 = v / a;\n float u2 = (u + texW) / a, v2 = (v + texH) / b;\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x2, y1, u2, v1,\n x1, y1, u1, v1,\n x2, y2, u2, v2,\n x1, y2, u1, v2\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }", "private void drawRectangle(GraphicsContext gc, double x, double y) {\r\n GraphicsContext gc2 = myCanvas.getGraphicsContext2D();\r\n gc2.setFill(randomColor());\r\n gc2.fillRect(x - 20, y - 20, 40, 40);\r\n }", "private void addRenderPieces(Text text) {\n Rectangle rectangle = new Rectangle();\n rectangle.setX(text.getX());\n rectangle.setY(text.getY());\n rectangle.setWidth(text.getLayoutBounds().getWidth());\n rectangle.setHeight(lineHeight);\n rectangle.setFill(Color.VIOLET);\n rectangle.toBack();\n root.getChildren().add(rectangle);\n renderPieces.add(rectangle);\n }", "@Override\n public void onLayerDrawn(Canvas canvas, float pageWidth, float pageHeight, int displayedPage) {\n }", "public void paintbox(Graphics page, Rectangle box)\n\t\t{\n\t\t\tpage.drawImage(rock, box.x, box.y, box.width, box.height, this); //Places the rock image over the column \n\t\t}", "public void draw() {\n\n }", "void drawRectangle(int index,int[] color){\n Rect r;\n background(255);\n for(int i=0;i<arr.length;i++){\n if(i!=index) {\n noStroke();\n r=new Rect(40 + i * 80, 400, 75, -arr[i] * 20, color1);\n createRectangle(r, color1);\n }else{\n noStroke();\n r=new Rect(40 + i* 80, 400, 75, -arr[i] * 20, color);\n createRectangle(r, color);\n }\n }\n }", "public static void drawRectangle(Canvas c, int x, int y, int w, int h) {\n CanvasTools.drawRectangle(c, x, y, w, h, HTMLColors.RED, HTMLColors.YELLOW);\n }", "public void draw() {\n }", "public void drawAllGraphics(){\r\n\t\t \r\n\t}", "public void beginDrawing();", "public void render(GameContainer gc, Painter p) {\n\n }", "public void renderRectangle(int x, int y, int width, int height, float scale, int color)\n {\n renderRectangle(x, y, width * scale, height * scale, color);\n }", "public static void mainDraw(Graphics graphics){\n\n int centerX = WIDTH / 3 ;\n int centerY = HEIGHT / 3;\n int rectA2 = 20 / 2;\n\n graphics.setColor(Color.GREEN);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH /5 ;\n centerY = HEIGHT / 2;\n rectA2 = 40 / 2;\n\n graphics.setColor(Color.YELLOW);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH / 2 ;\n centerY = HEIGHT / 6;\n rectA2 = 70 / 2;\n\n graphics.setColor(Color.BLUE);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH / 2 ;\n centerY = HEIGHT / 2;\n rectA2 = 100 / 2;\n\n graphics.setColor(Color.RED);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n }", "void draw();", "void setBounds(Rectangle rectangle);", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "private void drawBackground() {\r\n\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tthis.mc.renderEngine.bindTexture(BACKGROUND_RESOURCE);\r\n\t\tString text = \"Nitro Teleport Waypoints\";\r\n\t\tint posX = (width - SIZE_X) / 2;\r\n\t\tint posY = (height - SIZE_Y) / 2;\r\n\t\tint strWidth = this.fontRendererObj.getStringWidth(text);\r\n\r\n\t\tthis.drawTexturedModalRect(posX, posY, 0, 0, SIZE_X, SIZE_Y);\r\n\t\tthis.drawCenteredString(this.fontRendererObj, text, width / 2, posY - 17, 0xFFFFFF);\r\n\t}", "public void draw(){\n }", "public void draw() {\n \n }", "public void paint(PPaintContext ppc) {\n\t\tPaint paint = getPaint();\n\t\tif (paint != null) {\n\t\t\tGraphics2D g2 = ppc.getGraphics();\n\t\t\tg2.setPaint(paint);\n\t\t\t\n\t\t\tPBounds bounds = getUnionOfChildrenBounds(null);\n\t\t\tbounds.setRect(bounds.getX()-INDENT,bounds.getY()-INDENT,bounds.getWidth()+2*INDENT,bounds.getHeight()+2*INDENT);\n\t\t\tg2.fill(bounds);\n\t\t}\n\t}", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"You are drawing a RECTANGLE\");\n\t}", "public void drawRectangle(){\n\t height = height + 1;\n\t width = width + 1;\n\t //This loop draws the rectangle.\n\t for(int p = 1; p < height; p++){\n\t\tfor (int q = 1; q < width; q++){\n\t\t System.out.print(appearance);\n\t\t}\n\t\tSystem.out.println(\"\");\n\t }\n\t System.out.println(\"\");\n\n\t}", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n if(selected != null)currentPage.drawIsDroppable(g, selected);\n pa.draw(g, selected);\n g.setColor(Color.BLACK);\n \tg.drawLine(0, currentPage.getBounds().height, currentPage.getBounds().width, currentPage.getBounds().height);\n }", "public void draw(Canvas canvas){\n canvas.drawBitmap(bitmap, hitBox.left, hitBox.top, null);\n\n /*\n Paint testing=new Paint();//draw a blue bounding box where the bitmap should be\n testing.setColor(Color.BLUE);\n testing.setAlpha(25);\n testing.setStrokeWidth(2);\n canvas.drawRect(hitBox,testing);\n */\n }", "@Override\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.ORANGE);\n\t\tg.fillRect(x, y, WIDTH, HEIGHT);\n\t}", "@Override\n public void paint(Graphics g) {\n if (pageStatus != CLOSE) {\n try {\n pageStatus.getPage().paintComponent(g, this);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "void paintComponent();", "public void draw();", "public void draw();", "public void draw();", "public void drawRect(float x, float y, float width, float height) {\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x1, y1, 0F, 0F,\n x2, y1, 1F, 0F,\n x2, y2, 1F, 1F,\n x1, y2, 0F, 1F\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }", "public abstract void draw(PGraphics graphics, float maxX, float maxY);", "public void display ( GameObject obj ) {\n Screen tempScreen = Screen.getScreen();\n\n // I could script this! Quickly change the colors\n\n tempScreen.fill(color); //set color\n\n\n tempScreen.noStroke(); //no stroke\n tempScreen.rect(obj.x, obj.y, obj.width, obj.height); //make a rectangle\n }", "@Override\n protected void onDraw(Canvas canvas) {\n if(face == null) {\n super.onDraw(canvas);\n return;\n }\n Paint paint = new Paint();\n\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth(2);\n paint.setColor(Color.RED);\n\n canvas.drawRect(bounds, paint);\n //canvas.drawRect(100, 100, 200, 200, paint);\n\n }", "@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render(Graphics g)\n\t{\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "private void drawIntoRect(Graphics2D g2, BufferedImage image, Rectangle rect) {\r\n\t\tfor (int j = rect.y; j < rect.y + rect.height; j++) {\r\n\t\t\tfor (int k = rect.x; k < rect.x + rect.width; k++) {\r\n\t\t\t\tint x = xoff + Tile.toScreenX(k, j); \r\n\t\t\t\tint y = yoff + Tile.toScreenY(k, j); \r\n\t\t\t\tg2.drawImage(image, x - 1, y - image.getHeight(), null);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void testCoverTextByRectanglesMwbI201711() throws IOException {\n try ( InputStream resource = getClass().getResourceAsStream(\"mwb_I_201711.pdf\") ) {\n PDDocument doc = PDDocument.load(resource);\n\n myStripper stripper = new myStripper();\n\n stripper.setStartPage(1); // fix it to first page just to test it\n stripper.setEndPage(1);\n stripper.getText(doc);\n\n TextLine line = stripper.lines.get(1); // the line i want to paint on\n\n float minx = -1;\n float maxx = -1;\n\n for (TextPosition pos: line.textPositions)\n {\n if (pos == null)\n continue;\n\n if (minx == -1 || pos.getTextMatrix().getTranslateX() < minx) {\n minx = pos.getTextMatrix().getTranslateX();\n }\n if (maxx == -1 || pos.getTextMatrix().getTranslateX() > maxx) {\n maxx = pos.getTextMatrix().getTranslateX();\n }\n }\n\n TextPosition firstPosition = line.textPositions.get(0);\n TextPosition lastPosition = line.textPositions.get(line.textPositions.size() - 1);\n\n // corrected x and y\n PDRectangle cropBox = doc.getPage(0).getCropBox();\n\n float x = minx + cropBox.getLowerLeftX();\n float y = firstPosition.getTextMatrix().getTranslateY() + cropBox.getLowerLeftY();\n float w = (maxx - minx) + lastPosition.getWidth();\n float h = lastPosition.getHeightDir();\n\n PDPageContentStream contentStream = new PDPageContentStream(doc, doc.getPage(0), PDPageContentStream.AppendMode.APPEND, false, true);\n\n contentStream.setNonStrokingColor(Color.RED);\n contentStream.addRect(x, y, w, h);\n contentStream.fill();\n contentStream.close();\n\n File fileout = new File(RESULT_FOLDER, \"mwb_I_201711-withRectangles.pdf\");\n doc.save(fileout);\n doc.close();\n }\n }", "public void draw(Graphics g, int... paneOffsets) { }", "void draw (Graphics2D g);", "public void paintComponent(Graphics page)\r\n {\r\n super.paintComponent(page);\r\n \r\n //Goes through each object in the array list and\r\n //draws the dot.\r\n for(int i = 0; i < dotList.size(); i++)\r\n {\r\n \t ((Dot) dotList.get(i)).draw(page); //Draws the dot\r\n }\r\n }", "public void highlight(){\n myRectangle.setFill(HIGHLIGHT);\n }" ]
[ "0.75062615", "0.69421655", "0.6503448", "0.6404282", "0.63462967", "0.6322428", "0.62903965", "0.62880516", "0.62772197", "0.62538314", "0.6133234", "0.6118428", "0.6115997", "0.61130005", "0.6107456", "0.61020106", "0.6086872", "0.6079941", "0.60741794", "0.6067243", "0.60513854", "0.60416293", "0.6032479", "0.6019811", "0.60173345", "0.60155576", "0.60104066", "0.59870476", "0.59870476", "0.5984761", "0.59833616", "0.5961513", "0.5951851", "0.5951851", "0.5948376", "0.5948376", "0.59395915", "0.59238935", "0.5916985", "0.59008783", "0.5899627", "0.5873325", "0.5872231", "0.5871156", "0.586449", "0.5855996", "0.5850221", "0.5845457", "0.5838187", "0.583431", "0.5829365", "0.58212996", "0.5813595", "0.58129674", "0.58073884", "0.5805623", "0.58022666", "0.5800435", "0.5792847", "0.57840246", "0.57823586", "0.57803124", "0.5776444", "0.57728034", "0.5771238", "0.5769555", "0.576386", "0.57540345", "0.57508576", "0.57483876", "0.5748286", "0.5743904", "0.57412404", "0.573988", "0.5738031", "0.5735756", "0.5735568", "0.5732624", "0.57296187", "0.5727774", "0.5727421", "0.57121366", "0.5708554", "0.5708554", "0.5708554", "0.57081467", "0.57065934", "0.57035357", "0.5699797", "0.56996477", "0.56996477", "0.56939906", "0.5693155", "0.5693155", "0.5692752", "0.56905055", "0.5689141", "0.5676945", "0.5668264", "0.56644124" ]
0.81195354
0
To set the value of a specific component in the current group of solution
public void set(int index, String value) { if (index < 0 || index >= this.solutionVector.length) { throw new RuntimeException(); } solutionVector[index] = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void setComponentValue(Object value) {\n\t\t\n\t}", "Builder setComponent(String component);", "public abstract Vector4fc setComponent(int component, float value);", "protected void setComponent(Component newComponent) {\n\tcomponent = newComponent;\n}", "public abstract void updateMainComponents(String component);", "private void setComponentValue(JComponent component, String value)\r\n {\r\n\t if (component instanceof JTextField)\r\n\t {\r\n\t\t JTextField text = (JTextField)component;\r\n\t\t text.setText(value);\r\n\t }\r\n\t else if (component instanceof JCheckBox)\r\n\t {\r\n\t\t boolean selected = false;\r\n\t\t if (value.equals(\"true\")) selected = true;\r\n\t\t \r\n\t\t JCheckBox checkBox = (JCheckBox)component;\r\n\t \t checkBox.setSelected(selected);\r\n\t }\r\n\t else if (component instanceof JComboBox)\r\n\t {\r\n\t\t @SuppressWarnings(\"unchecked\")\r\n\t\t JComboBox<String> comboBox = (JComboBox<String>)component;\r\n\t\t if (value.length()>0)\r\n\t\t {\r\n\t\t\t value = value.substring(0,1).toUpperCase() + value.substring(1);\r\n\t\t\t String[] values = value.split(\" \");\r\n\t\t\t if (values.length>1 && values[1].length()>0)\r\n\t\t\t {\r\n\t\t\t\t values[1] = values[1].substring(0, 1).toUpperCase() + values[1].substring(1);\r\n\t\t\t\t value = values[0] + \" \" + values[1];\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t comboBox.setSelectedItem(value);\r\n\t\t }\r\n\t\t else\r\n\t\t\t comboBox.setSelectedIndex(0);\r\n\t }\r\n }", "void setElementValue(SetElementValue cmd);", "public void set(Object requestor, String field, JLabel comp);", "public void setComponent(String componentName1) {\n this.component = componentName1;\n }", "public void setComponent(String newComponent) {\r\n\t\tcomponent = newComponent;\r\n\t}", "public abstract Vector4fc set(int component, float value);", "public void set(Object requestor, String field, JComponent comp);", "String setValue();", "protected abstract void setValue(V value);", "public void setValue(Object value);", "protected void setPreviousValue(UIComponent component, Object value) {\n }", "void editAssetValue(int newVal);", "private void setComponentStatus() {}", "void setValue(V value);", "public void setValue(Object value) { this.value = value; }", "public void set(long j, CoreMorphComponent coreMorphComponent) {\r\n CoreJni.setInCoreMorphComponentManager0(this.agpCptrMorphComponentMgr, this, j, CoreMorphComponent.getCptr(coreMorphComponent), coreMorphComponent);\r\n }", "public abstract void setValue(int value);", "void setValue(Object value);", "public void set(Object requestor, String field, JFrame comp);", "Form setElementValue(String elementId, String value);", "void setValue(int value);", "public void setValue(A value) {this.value = value; }", "public interface TypedComponentAssignment<V> {\n V getAssignedValue ();\n void setAssignedValue (V value);\n}", "public void setComponent(ElementView jc) {\n\t\tthis.jc = jc;\n\t}", "private void updateValue(Widget sender){\r\n\t\tint index = getWidgetIndex(sender) - 1;\r\n\t\tTaskParam param = taskDef.getParamAt(index);\r\n\t\tparam.setValue(((TextBox)sender).getText());\r\n\t\ttaskDef.setDirty(true);\r\n\t}", "public V setValue(V value);", "public void setUIComponent(Component c) {}", "public void setTargetValue(int idx, Object value);", "protected abstract void setValue(Entity e,FloatTrait t,float value);", "public void setValue(Object o){\n \tthis.value = o;\n }", "@Override\n\tpublic void setValue(Object value) {\n\t\t\n\t}", "public void setModalComponent( final Component value ) {\r\n this.modalComponent = value;\r\n }", "@Override\n public void updateFromComponentModels(Optional componentModel) {\n }", "public void SetComponent(int n_x, int n_y, float f_val) {\n \n\t/*\n\tinputs--\n\t\n\tn_x :\n\t The first index\n\tn_y :\n\t The second index\n\tf_val :\n\t The float value at the indexed location of this\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[n_x][n_y] = f_val;\n \n }", "public void set(int i, Mat33 value) {\n opensimSimbodyJNI.VectorMat33_set(swigCPtr, this, i, Mat33.getCPtr(value), value);\n }", "public void setValue(Object val);", "@Override\n\t\t\tpublic void onAction(Component component ) {\n\t\t\t\tcomponent.setLabel(inputComponent.getValue());\n\t\t\t\tform.showComponents();\n\t\t\t}", "public void setBasedOnValue(entity.LocationNamedInsured value);", "@Override\n\tpublic void setValue(Object value) {\n\t\tint id = ((VObject) value).getId();\n\t\tItemData item = initItemData(id);\n\t\t((Combobox) component).setText(item.getLabel());\n\t\tsuper.setValue(value);\n\t}", "public void setValue(int value);", "public void setOptionsPanelComponent(SelectableComponent sc){\r\n // Protect options panel from badly created components\r\n if(sc != null){\r\n this.sc = sc;\r\n titleLabel.setText((getActiveCircuit().getActiveComponents().contains(sc))?titleOld:titleNew);\r\n typeLabel.setText(sc.getName());\r\n if(!(sc instanceof ui.command.SubcircuitOpenCommand.SubcircuitComponent)){\r\n optionsPanel.setVisible(true);\r\n if(sc instanceof VisualComponent){\r\n AttributesPanel.removeAll();\r\n JPanel test = sc.getOptionsPanel();\r\n AttributesPanel.add(test, BorderLayout.NORTH);\r\n ((PreviewPanel)Preview).setComponent(sc);\r\n AttributesPanel.repaint();\r\n Preview.repaint();\r\n AttributesPanel.setPreferredSize(test.getSize());\r\n Toolbox.revalidate();\r\n }\r\n } \r\n getActiveCircuit().repaint();\r\n } else {\r\n ErrorHandler.newError(\"Options Panel Error\",\r\n \"The component that you are trying to create or select is malformed.\");\r\n }\r\n }", "public void setValue(int new_value){\n this.value=new_value;\n }", "@Override\n\tprotected void setValueOnUi() {\n\n\t}", "public void set(Object requestor, String field, JMenu comp);", "public abstract void setCompteId(Integer pCompteId);", "public void set(Object requestor, String field, JButton comp);", "public void setValue (String Value);", "public void set(Object requestor, String field, JMenuItem comp);", "public void setModalComponent( final Component value ) {\n this.modalComponent = value;\n }", "public void setComponenteCosto(ComponenteCosto componenteCosto)\r\n/* 73: */ {\r\n/* 74: 95 */ this.componenteCosto = componenteCosto;\r\n/* 75: */ }", "public abstract void setNamedComponents(Map<String,List<Component>> namedComponents);", "public void set(Object requestor, String field, JDialog comp);", "public void setValue(T element) {\n\t\t\n\t}", "public void setCombo(Object newValue);", "protected void setValue(CompoundValue compound, String field, Object value) { \n String name = null;\n if (null != compound) {\n try {\n name = compound.getStringValue(SLOT_NAME);\n DecisionVariableDeclaration element = ((Compound) compound.getType()).getElement(field);\n if (null != element) {\n IDatatype type = element.getType();\n if (null != type) {\n value = referenceValue(type, value);\n compound.configureValue(field, ValueFactory.createValue(type, value));\n notifyDirty();\n }\n }\n } catch (ValueDoesNotMatchTypeException e) {\n EASyLoggerFactory.INSTANCE.getLogger(AbstractTableEditor.class, Activator.PLUGIN_ID).exception(e);\n Dialogs.showErrorDialog(\"Illegal value\", name + \":\" + e.getMessage()); \n }\n }\n }", "public void setGroup(entity.Group value);", "public void setValue(String variable, String value){\r\n if (matlabEng==null) return;\r\n matlabEng.engEvalString (id,variable + \"= [\" + value + \"]\");\r\n }", "private void setEnabledComponentInner(ComponentName componentName, int newState, int userId) {\n if (componentName != null) {\n String packageName = componentName.getPackageName();\n String className = componentName.getClassName();\n if (packageName != null && className != null) {\n synchronized (this.mPackages) {\n PackageSetting pkgSetting = (PackageSetting) this.mSettings.mPackages.get(packageName);\n if (pkgSetting == null) {\n Slog.e(TAG, \"setEnabledSetting, can not find pkgSetting, packageName = \" + packageName);\n return;\n }\n Package pkg = pkgSetting.pkg;\n if (pkg == null || (pkg.hasComponentClassName(className) ^ 1) != 0) {\n Slog.w(TAG, \"Failed setComponentEnabledSetting: component class \" + className + \" does not exist in \" + packageName);\n return;\n }\n switch (newState) {\n case 0:\n if (!pkgSetting.restoreComponentLPw(className, userId)) {\n return;\n }\n break;\n case 2:\n if (!pkgSetting.disableComponentLPw(className, userId)) {\n return;\n }\n break;\n default:\n Slog.e(TAG, \"Invalid new component state: \" + newState);\n return;\n }\n }\n }\n }\n }", "public void setComponentName(ComponentName name);", "public void setCValue(V value);", "@SuppressWarnings(\"unchecked\")\n public void setValue(Object value) {\n if (element != null) {\n element.setValue((V)value);\n }\n }", "public void setValue(Value value) {\n this.value = value;\n }", "public abstract void setValueAction(Object value);", "public abstract void setValue(T value);", "public void setValue(T v){\n \telement = v;\n }", "protected void setComponent(List<Object> Command) throws Exception {\r\n if (Command.isEmpty()) {\r\n throw new Exception(\"No setting/component specified\");\r\n }\r\n String Component = Command.get(0).toString().toLowerCase();\r\n switch (Component) {\r\n case \"objective\":\r\n case \"obj\": {\r\n // Usage: <optimizer> set objective <max|min> <method> [<method options..>]\r\n String Method;\r\n List<Object> Options;\r\n boolean toMaximize;\r\n try {\r\n // Read whether to max / minimize\r\n if (Command.get(1).toString().startsWith(\"max\")) {\r\n toMaximize = true;\r\n } else if (Command.get(1).toString().startsWith(\"min\")) {\r\n toMaximize = false;\r\n } else {\r\n throw new Exception();\r\n }\r\n // Read Method name\r\n Method = Command.get(2).toString();\r\n if (Method.equals(\"?\")) {\r\n System.out.println(printImplmentingClasses(BaseEntryRanker.class, false));\r\n return;\r\n }\r\n // Get method options\r\n Options = Command.subList(3, Command.size());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set objective <max|min> <method> [<method options..>]\");\r\n }\r\n // Make the ranker, attach it\r\n BaseEntryRanker objFun = (BaseEntryRanker) instantiateClass(\"optimization.rankers.\" + Method, Options);\r\n objFun.setUseMeasured(true);\r\n objFun.setMaximizeFunction(toMaximize);\r\n setObjectiveFunction(objFun);\r\n System.out.println(\"\\tDefined objective function to be a \" + Method);\r\n }\r\n break;\r\n case \"gensize\": {\r\n int value;\r\n try {\r\n value = Integer.parseInt(Command.get(1).toString());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set gensize <#>\");\r\n }\r\n setEntriesPerGeneration(value);\r\n System.out.println(\"\\tSet number of entries per generation to \" + value);\r\n }\r\n break;\r\n case \"initial\": {\r\n // Usage: set intial $<dataset>\r\n Dataset Data;\r\n try {\r\n Data = (Dataset) Command.get(1);\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set initial $<dataset>\");\r\n }\r\n setInitialData(Data);\r\n System.out.println(\"\\tDefined an intial population of \" + Data.NEntries() + \" entries\");\r\n }\r\n break;\r\n case \"search\": {\r\n // Usage: set search $<dataset>\r\n Dataset Data;\r\n try {\r\n Data = (Dataset) Command.get(1);\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set search $<dataset>\");\r\n }\r\n setSearchSpace(Data);\r\n System.out.println(\"\\tDefined a search space of \" + Data.NEntries() + \" entries\");\r\n }\r\n break;\r\n case \"oracle\": {\r\n // Usage: set oracle <method> [<options...>]\r\n String Method;\r\n List<Object> Options;\r\n try {\r\n Method = Command.get(1).toString();\r\n if (Method.contains(\"?\")) {\r\n System.out.println(\"Available Oracles:\");\r\n System.out.println(CommandHandler.printImplmentingClasses(BaseOracle.class, false));\r\n }\r\n Options = Command.subList(2, Command.size());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set oracle <method> [<options...>]\");\r\n }\r\n BaseOracle NewOracle = (BaseOracle) CommandHandler.instantiateClass(\"optimization.oracles.\" + Method, Options);\r\n setOracle(NewOracle);\r\n System.out.println(\"\\tSet algorithm to use a \" + Method);\r\n }\r\n break;\r\n case \"maxiter\": {\r\n int value;\r\n try {\r\n value = Integer.parseInt(Command.get(1).toString());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: set maxiter <#>\");\r\n }\r\n setMaxIterations(value);\r\n System.out.println(\"\\tSet maximum number of iterations to \" + value);\r\n }\r\n break;\r\n default:\r\n throw new Exception(\"Setting not recognized: \" + Component);\r\n }\r\n }", "public void setGroupValue(String testCaseID)\r\n\t{\r\n\t\tgroupTestID=testCaseID;\r\n\t\tgroupTestScenario=getTestScenario(testCaseID);\t\r\n\t\tLog.info(\"======== \"+groupTestID+\" : \"+groupTestScenario+\" ========\");\r\n\t}", "void setPointChange(Integer setPoint, Integer expectedValue);", "@Override\n\tpublic void setValue(Object object) {\n\t\t\n\t}", "public void setValue(E value)\n {\n }", "public void setValue() {\r\n this.value = ComponentTranslator.getResourceBundle().getString(\r\n key.toString());\r\n }", "public void setValue(Entity value) {\r\n\t\t\tthis.value = value;\r\n\t\t}", "public void setValue(Object value) {\n this.value = value;\n }", "public void setValue(int value)\n {\n // we have assumed value 1 for X and 10 for O\n this.value = value;\n }", "public void setValue(Object value)\n {\n \tCollapsePiece piece = (CollapsePiece) value;\n \t\n setIcon(null);\n setText(null);\n \n \tif(piece == CollapsePiece.green)\n \t{\n \t\tsetIcon(images[kGreen]);\n \t}\n \telse if(piece == CollapsePiece.purple)\n \t{\n \t\tsetIcon(images[kPurple]);\n \t}\n \telse if(piece == CollapsePiece.red)\n \t{\n \t\tsetIcon(images[kRed]);\n \t}\n\n }", "private void commitCompetitiveGroupFieldValues() {\r\n ((CompetitiveGroup) competitive)\r\n .setUpdateMethod((UpdateMethod) updateMethod.getSelectedItem());\r\n ((CompetitiveGroup) competitive).setLearningRate(Double\r\n .parseDouble(tfEpsilon.getText()));\r\n ((CompetitiveGroup) competitive).setWinValue(Double\r\n .parseDouble(tfWinnerValue.getText()));\r\n ((CompetitiveGroup) competitive).setLoseValue(Double\r\n .parseDouble(tfLoserValue.getText()));\r\n ((CompetitiveGroup) competitive).setSynpaseDecayPercent(Double\r\n .parseDouble(tfSynpaseDecayPercent.getText()));\r\n ((CompetitiveGroup) competitive).setLeakyLearningRate(Double\r\n .parseDouble(tfLeakyEpsilon.getText()));\r\n ((CompetitiveGroup) competitive).setUseLeakyLearning(cbUseLeakyLearning\r\n .isSelected());\r\n ((CompetitiveGroup) competitive).setNormalizeInputs(cbNormalizeInputs\r\n .isSelected());\r\n }", "@Override\n public void execute() {\n _win.getSolenoid().set(_val);\n }", "public void setElement(T newvalue);", "public void setInterpretedBy(Contact value) {\r\n\t\tBase.set(this.model, this.getResource(), INTERPRETEDBY, value);\r\n\t}", "public void setValueFromAxis(AxisModel axis, Object value) {\n }", "public abstract void setValue(ELContext context, Object value);", "void setValue(Object object, Object value);", "@Override\n\tpublic void setComponentLabel(String label) {\n\t\t\n\t}", "public void setValue(String variable, double[][] value){\r\n if (matlabEng==null) return;\r\n matlabEng.engPutArray (id,variable,value);\r\n }", "public abstract void setValue(Context c, Object v) throws PropertyException;", "void setValue(Adjustable adj, int v);", "void setValue(String value);", "void setValue(String value);", "public void setValue(S s) { value = s; }", "@Override\n\tpublic void setValue(Object object) {\n\n\t}", "public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }", "public void setValue(Object value)\r\n\t{\r\n\t\tm_value = value;\r\n\t}", "void valueChanged(CalcModel model);", "void valueChanged(CalcModel model);", "public void setValue(String variable, double[] value){ \r\n if (matlabEng==null) return;\r\n matlabEng.engPutArray (id,variable,value);\r\n }", "public void setValue(int value) {\r\n this.value = value;\r\n }" ]
[ "0.670347", "0.6482533", "0.6230711", "0.61976683", "0.60866994", "0.59129274", "0.58999664", "0.5854709", "0.5844591", "0.5820163", "0.581092", "0.5807404", "0.57632065", "0.5691045", "0.56754214", "0.5669374", "0.56557816", "0.56337434", "0.5610648", "0.5602425", "0.55867606", "0.5573602", "0.55720925", "0.5562645", "0.5550878", "0.5547569", "0.55457395", "0.55376893", "0.5533346", "0.55261344", "0.5518016", "0.5511043", "0.5510493", "0.5506142", "0.5502583", "0.5462577", "0.545417", "0.54405975", "0.54372436", "0.5430256", "0.5429696", "0.54273415", "0.5415088", "0.5412696", "0.54040897", "0.540351", "0.54022175", "0.5396166", "0.539552", "0.5389688", "0.5388612", "0.5369542", "0.53481394", "0.53461456", "0.5344409", "0.5337007", "0.533535", "0.53233236", "0.53209877", "0.5303664", "0.5302183", "0.5295241", "0.52804875", "0.5279088", "0.52721435", "0.52680683", "0.5260069", "0.525997", "0.5239807", "0.5232353", "0.5220921", "0.52183026", "0.5210106", "0.52084184", "0.52081907", "0.519946", "0.5196962", "0.51963514", "0.5195183", "0.5190927", "0.51871616", "0.51782876", "0.51770836", "0.51765627", "0.5166882", "0.51628596", "0.5153406", "0.51528025", "0.514997", "0.5145255", "0.51438355", "0.5143831", "0.5143831", "0.51424885", "0.51399237", "0.51338106", "0.51277953", "0.51238096", "0.51238096", "0.5122435", "0.5114788" ]
0.0
-1
To get the value of a specific component in the current group of solution
public String get(int index) { return solutionVector[index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getComponent() {\n return this.component;\n }", "private String getComponentValue(JComponent component)\r\n {\r\n\t if (component instanceof JTextField)\r\n\t {\r\n\t\t JTextField text = (JTextField)component;\r\n\t\t return text.getText();\r\n\t }\r\n\t else if (component instanceof JCheckBox)\r\n\t {\r\n\t\t JCheckBox checkBox = (JCheckBox)component;\r\n\t \t boolean value = checkBox.isSelected();\r\n\t \t return (value) ? \"true\" : \"false\";\r\n\t }\r\n\t else if (component instanceof JComboBox)\r\n\t {\r\n\t\t @SuppressWarnings(\"unchecked\")\r\n\t\t JComboBox<String> comboBox = (JComboBox<String>)component;\r\n\t\t \r\n\t\t String value = (String)comboBox.getSelectedItem();\r\n\t\t if (value == null) return \"\";\r\n\t\t if (value.equals(fields[0])) return \"\";\r\n\t\t if (value.length()>2) return value.toLowerCase();\r\n\t\t return value;\r\n\t }\r\n\t return \"\";\r\n }", "public String getComponent() {\r\n\t\treturn component;\r\n\t}", "Component getComponent() {\n/* 224 */ return this.component;\n/* */ }", "public org.omg.uml.behavioralelements.commonbehavior.Instance getValue();", "@Override public Object getComponente(String componente){\n return getBlindaje(componente);\n }", "public Map<String, Object> getComponentValue() {\n return FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<String, Object>() {\n @Override\n public Object get(Object key) {\n final UIInput component = (UIInput) getCurrentInstance().getViewRoot().findComponent((String) key);\n return component.getSubmittedValue() != null ? component.getSubmittedValue() : component.getValue();\n }\n });\n }", "public Component getComponent(String name) {\n Optional<Component> component = elements.getComponent(name);\n\n if(component.isPresent()) {\n return component.get();\n } else {\n Assert.fail(\"Missing component \" + name);\n return null;\n }\n\n }", "public Optional<ComponentSymbol> getComponent() {\r\n if (!this.getEnclosingScope().getSpanningSymbol().isPresent()) {\r\n return Optional.empty();\r\n }\r\n if (!(this.getEnclosingScope().getSpanningSymbol().get() instanceof ComponentSymbol)) {\r\n return Optional.empty();\r\n }\r\n return Optional.of((ComponentSymbol) this.getEnclosingScope().getSpanningSymbol().get());\r\n }", "public Unit getComponentValueByName(String name){\r\n switch(name){\r\n case \"R0\":\r\n return this.getCpu().getControlUnit().getGeneralPurposeRegister(0);\r\n case \"R1\":\r\n return this.getCpu().getControlUnit().getGeneralPurposeRegister(1);\r\n case \"R2\":\r\n return this.getCpu().getControlUnit().getGeneralPurposeRegister(2); \r\n case \"R3\":\r\n return this.getCpu().getControlUnit().getGeneralPurposeRegister(3);\r\n case \"X1\":\r\n return this.getCpu().getControlUnit().getIndexRegister(1);\r\n case \"X2\":\r\n return this.getCpu().getControlUnit().getIndexRegister(2);\r\n case \"X3\":\r\n return this.getCpu().getControlUnit().getIndexRegister(3);\r\n case \"MAR\":\r\n return this.getMemory().getMAR();\r\n case \"MBR\":\r\n return this.getMemory().getMBR();\r\n case \"PC\":\r\n return this.getCpu().getControlUnit().getProgramCounter();\r\n case \"CC\":\r\n return this.getCpu().getControlUnit().getConditionCodeRegister();\r\n case \"IR\":\r\n return this.getCpu().getControlUnit().getInstructionRegister();\r\n default:\r\n return new Unit(13,0);\r\n \r\n } \r\n }", "public Component getComponent() {\n\treturn component;\n}", "public Object getData(Component componentAt, Point location);", "public Entity getComponent() {\n return component;\n }", "public Component getComponent() {\n return component;\n }", "public int getComponentID() {\n return COMPONENT_ID;\n }", "public String componentName(int index) {\n\treturn(comp[index]);\n }", "public EMAComponentSymbol getComponent() {\n return (EMAComponentSymbol) this.getEnclosingScope().getSpanningSymbol().get();\n }", "@Override\n public AbstractProcess getComponent(String name)\n {\n return components.get(name);\n }", "@Override\n\tpublic ILiteComponent getBestMatch() {\n\t\tILiteComponent bestComponent = null;\n\t\t//EEvaluationResult bestResult = EEvaluationResult.MISSING;\n\t\tfor(Entry<ILiteComponent, ILiteDependencyItem> e : fComponentEntries.entrySet()) {\n\t\t\tILiteComponent c = e.getKey();\n\t\t\tEEvaluationResult r = e.getValue().getEvaluationResult();\n\t\t\tif(r == EEvaluationResult.FULFILLED) {\n\t\t\t\treturn c;\n\t\t\t} else if(r == EEvaluationResult.SELECTABLE) {\n\t\t\t\tif(bestComponent == null)\n\t\t\t\t\tbestComponent = c;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn bestComponent;\n\t}", "Optional<Sketch> component(int i);", "Object getComponent(WebElement element);", "public final int component1() {\n return 0;\n }", "public float GetComponent(int n_x, int n_y) {\n \n\t/*\n\tinputs--\n\t\n\tn_x :\n\t The first index\n\tn_y :\n\t The second index\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tf_val (implicit) :\n\t The float value at the indexed location of this\n\t*/\n\t\n\treturn this.mat_f_m[n_x][n_y];\n \n }", "Object getContainedValue();", "@Override\n\tpublic Component getComponent() {\n\t\treturn p;\n\t}", "public org.pentaho.pms.cwm.pentaho.meta.instance.CwmInstance getValue();", "private GComponent getComponentAt(Point point)\n {\n // Create a reverse list iterator\n ListIterator<GComponent> it = this.components.listIterator(this.components.size());\n while (it.hasPrevious())\n {\n GComponent component = it.previous();\n \n // If this component is a the specified position, then return it\n if (component.getBounds().contains(point))\n return component;\n }\n \n // Nothing found, so return null\n return null;\n }", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "Object getValue(VisualPropertyType calcType);", "protected Node getComponentNode() {\n return componentNode;\n }", "public java.lang.Number getComponent1AsNumber() {\n\t\treturn SwiftFormatUtils.getNumber(getComponent(1));\n\t}", "public V getCValue();", "public ResourceId component() {\n return this.component;\n }", "E getValue();", "public void testGetComponent() {\n System.out.println(\"getComponent\"); // NOI18N\n \n document.getTransactionManager().writeAccess(new Runnable() {\n public void run() {\n DesignComponent comp = document.createComponent(FirstCD.TYPEID_CLASS);\n DesignComponent result = PropertyValue.createComponentReference(comp).getComponent();\n DesignComponent expResult = comp;\n \n assertEquals(expResult,result);\n }\n });\n \n }", "String getComponentName();", "String getComponentName();", "public DynView getComp(String key)\n\t{\n\t\t\n\t\tDynView res = null; \t\n\t\tres = this.comps.get(key);\n\t\t\n\t\treturn res;\n\t}", "protected final Component getComponent()\n\t{\n\t\treturn component;\n\t}", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "public IDomain getComponent(int index);", "public Component componentAt( int x, int y ) {\n Component component = componentAt( x, y, desktop, true );\n if ( component != desktop ) {\n return component;\n }\n \n return null; \n }", "public Component getComponent(String fieldAlias)\n {\n return fieldMap.get(fieldAlias);\n }", "public Componente getComponente(int id) {\n\t\ttry {\n\t\t\tfor(Map.Entry<String, ArrayList<Componente>> entry : this.mappaComponenti.entrySet()) {\n\t\t\t\tArrayList<Componente> tempList = entry.getValue();\n\t\t\t\tfor(Componente c : tempList) {\n\t\t\t\t\tif(c.getId() == id) return c;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "private String getJiraTestCaseComponent() {\n component = name.replace(\"TC - \", \"\");\n component = component.substring(0, component.indexOf(\":\"));\n return component;\n }", "<T> T getComponent(Object key);", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "public String getComponent(@NonNull Group group, @NonNull String key) {\n String string = group.getString(null, key, \"\");\n if (string == null || string.isEmpty()) return null;\n return BukkitUtils.build(string);\n }", "public ComponentLabel getComponentLabel() {\n\t\treturn componentLabel;\n\t}", "String getCurrentValue();", "public JComponent getComponent() {\n return getGradleUI().getComponent();\n }", "private String[] getComponentArray(JComponent[] components)\r\n {\r\n\t int len = components.length;\r\n\t String[] values = new String[len];\r\n\t for (int i=0; i<len; i++)\r\n\t {\r\n\t\t values[i] = getComponentValue(components[i]);\r\n\t }\r\n\t return values;\r\n }", "public ComponenteCosto getComponenteCosto()\r\n/* 68: */ {\r\n/* 69: 91 */ return this.componenteCosto;\r\n/* 70: */ }", "protected abstract Object[] getComponents();", "public double getValue()\n\t{\n\t\treturn ifD1.getValue();// X100 lux\n\t}", "public ComponentResult getSubcomponentResult(String targetName)\n\t{\n\t\tfor(ComponentResult subcomponentResult: subcomponentResultList)\n\t\t{\n\t\t\tif(subcomponentResult.getName() == targetName)\n\t\t\t{\n\t\t\t\treturn subcomponentResult;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public String getComponentId();", "protected LttlComponent getHostComponent()\n\t{\n\t\tif (hostCompId < 0) return null;\n\t\treturn Lttl.scenes.findComponentByIdAllScenes(hostCompId);\n\t}", "Object getValueFrom();", "private <T> T getComponent(Class<T> clazz) {\n List<T> list = Context.getRegisteredComponents(clazz);\n if (list == null || list.size() == 0)\n throw new RuntimeException(\"Cannot find component of \" + clazz);\n return list.get(0);\n }", "@Override\n \tpublic IValue getValue() {\n \t\treturn this;\n \t}", "private int findComp(Component cmpnt) {\n\n for (int i = 0; i < compList.length; i++) {\n if (compList[i].equals(cmpnt)) {\n return i;\n }\n }\n\n return 0;\n }", "public ServiceResultInterface getComponentByName(String name) {\n\t\tfor (ServiceResultInterface res : components) {\n\t\t\tif (res.getName().equals(name)) {\n\t\t\t\treturn res;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "int getContactValue();", "protected String getCurrentValue(FacesContext context,UIComponent component) {\n \n String currentValue = null;\n Object currentObj = component.currentValue(context);\n if ( currentObj != null) {\n currentValue = getFormattedValue(context, component, currentObj);\n } \n if (currentValue == null) {\n currentValue = \"\";\n }\n return currentValue;\n }", "public abstract Component getComponentByName(String name);", "public int getValue()\n {\n try\n {\n return (Integer) AlphaComposite.class.getField(name).get(null);\n }\n catch (Exception e)\n {\n return -1;\n }\n }", "String getValueName();", "public Object getCellEditorValue() {\r\n return component.getText();\r\n }", "public int findGnetGroup() {\r\n int cr, num = 0;\r\n //TODO\r\n // if (Controls.getInstance().getGnet() == null) {\r\n // return 0;\r\n // }\r\n // cr = Controls.getInstance().getGnet().getTargetVariable();\r\n //for (int i = 0; i < models.size(); i++) {\r\n // if (getModel(i) != null) {\r\n // if (getModel(i).getTargetVariable() == cr) {\r\n // num++;\r\n // }\r\n // }\r\n //}\r\n return num;\r\n }", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getComponentId() {\n \t\treturn componentId;\n \t}", "SolutionRef getCurrentSolution();", "@Override\n\tpublic ElementView getComponent() {\n\t\treturn jc;\n\t}" ]
[ "0.6239104", "0.6209226", "0.6148551", "0.59112936", "0.5864564", "0.58450055", "0.5817325", "0.5807991", "0.5765024", "0.5760657", "0.57368946", "0.572387", "0.5690002", "0.5639285", "0.56229913", "0.5621044", "0.5603928", "0.559415", "0.55485183", "0.5546284", "0.55453616", "0.55269027", "0.5506834", "0.5392201", "0.5383589", "0.536767", "0.53638357", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.53541857", "0.5327769", "0.5323692", "0.530133", "0.5293535", "0.52785033", "0.5276517", "0.52702534", "0.5269717", "0.5269717", "0.525469", "0.52510774", "0.52439404", "0.52439404", "0.52439404", "0.52439404", "0.52439404", "0.52439404", "0.52439404", "0.52435976", "0.5241286", "0.5235177", "0.5228243", "0.52259266", "0.5223624", "0.5218214", "0.5218214", "0.5218214", "0.5218214", "0.5218214", "0.5197554", "0.51934355", "0.5190182", "0.51893306", "0.5181556", "0.5160018", "0.515886", "0.5154606", "0.5152674", "0.51511276", "0.51444286", "0.51442283", "0.5140375", "0.5139592", "0.5136879", "0.51320696", "0.51250327", "0.51248884", "0.5118292", "0.51079667", "0.5106031", "0.5105939", "0.51056707", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.5104681", "0.51005805", "0.50965", "0.5090446" ]
0.0
-1
To get a copy of the current group of the solution.
public SolutionVector cloneSolutionVector() { SolutionVector newSolutionVector = new SolutionVector(this.solutionVector.length); for (int i = 0; i < this.solutionVector.length; i++) { newSolutionVector.set(i, this.solutionVector[i]); } return newSolutionVector; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final DodlesGroup getNewObjectGroup() {\n return newObjectGroup;\n }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() {\n return this.inGroup;\n }", "IGroup getFullGroup();", "public Group getGroup() {\n return _group;\n }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup_1() { return cGroup_1; }", "public Group getGroup() {\n return group;\n }", "@Override\n\tpublic String getGroup() {\n\t\treturn \"Group_\"+SliceName(stdClass);\n\t}", "public long getGroup()\r\n { return group; }", "public Groupe getSelectedGroup() {\n return selectedGroup;\n }", "Object getGroup(int groupPosition);", "public Group getGroup_0() { return cGroup_0; }", "public Group getGroup_0() { return cGroup_0; }" ]
[ "0.69808984", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.6654809", "0.65830785", "0.637144", "0.63269323", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.62863475", "0.6274343", "0.62742263", "0.62569565", "0.62500226", "0.6215399", "0.6183741", "0.6183741" ]
0.0
-1
To get the number of the components in the current group of solution
public int size() { return this.solutionVector.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumberOfComponents();", "int countComponents() throws Exception;", "public int getNumberOfComponents() {\n return components;\n }", "public int components() {\n return numOfComponents;\n }", "public int getNumberOfComponents() {\n\t\t\treturn nComponents;\n\t\t}", "@Override\n public int getNumComponents()\n {\n return components.size();\n }", "int getAndSequenceGroupsCount();", "public abstract int getComponentCount();", "public int getNumComps(){\n return this.mFarm.getNumComps();\n }", "int getGroupCount();", "public Object getNumberOfConnectedComponents() {\r\n\t\tConnectivityInspector<Country, DefaultEdge> inspector=new ConnectivityInspector<Country, DefaultEdge>(graph);\r\n\t\treturn inspector.connectedSets().size();\r\n\t}", "int getPartsCount();", "int getPartsCount();", "public int getProblemCount();", "int getPortPairGroupCount();", "@Override\n\tpublic int countIndex() {\n\t\treturn logoMapper.selectCountLogo()+headbannerMapper.selecCountHB()+succefulMapper.selecCountSucc()+solutionMapper.selecCountSolu();\n\t}", "private int numberOfComponents(ArrayList<Integer>[] adj) {\n\t\t\t\t\n\t\tint n = adj.length;\n\t\tvisited = new boolean[n]; //default is false\n\t\tCCnum = new int[n];\n\t\tDFS(adj);\n\t\t\n\t\treturn cc;\n }", "public static int getNrGroups(Structure s){\n int nrGroups = 0;\n \n List<Chain> chains = s.getChains(0);\n Iterator<Chain> iter = chains.iterator();\n while (iter.hasNext()){\n Chain c = (Chain) iter.next();\n nrGroups += c.getAtomLength();\n }\n return nrGroups;\n }", "protected int getOptionNumber(FacesContext context, UIComponent component) {\r\n Iterator items = getSelectItems(context, component);\r\n int itemCount = 0;\r\n // count the children items\r\n while (items.hasNext()) {\r\n itemCount++;\r\n SelectItem item = (SelectItem) items.next();\r\n if (item instanceof SelectItemGroup) {\r\n int optionsLength = ((SelectItemGroup) item).getSelectItems().length;\r\n itemCount = itemCount + optionsLength;\r\n }\r\n }\r\n return itemCount;\r\n }", "@Override\n\tpublic int size()\n\t{\n\t\tint count = 0;\n\t\tfor (Variable var : FactorGraphIterables.variables(rootGraph()))\n\t\t{\n\t\t\tif (var.getPrior() != null)\n\t\t\t{\n\t\t\t\t++count;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int totalCostOfComponents( ){\n\t\tint total=0;\n\t\tfor (Component temp : components){\n\t\t\ttotal+=temp.getCost();\n\t\t}\n\t\treturn total;\n\t}", "public int getCompCount(){\n return this.compCount;\n }", "public int findGnetGroup() {\r\n int cr, num = 0;\r\n //TODO\r\n // if (Controls.getInstance().getGnet() == null) {\r\n // return 0;\r\n // }\r\n // cr = Controls.getInstance().getGnet().getTargetVariable();\r\n //for (int i = 0; i < models.size(); i++) {\r\n // if (getModel(i) != null) {\r\n // if (getModel(i).getTargetVariable() == cr) {\r\n // num++;\r\n // }\r\n // }\r\n //}\r\n return num;\r\n }", "public int Size() {\n return group_.Size();\n }", "Integer getTotalStepCount();", "int getChildCount();", "@Override\n\tpublic int getDimension() {\n\t\tint count = 0;\n\t\tfor ( SingleEquationStatement equation : equations.values() ) {\n\t\t\tif ( equation.getOrder() > 0 ) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\treturn count;\n\t}", "private int computeCount() {\n \n int count;\n try{\n count = this.clippingFeatures.size() * this.featuresToClip.size();\n }catch(ArithmeticException e ){\n \n count = Integer.MAX_VALUE;\n }\n return count;\n }", "public Integer getNumCompetitions() {\r\n return numCompetitions;\r\n }", "private int getVariablesNumberInTree() {\n\t\tList<Node> l = getFirstLevelSubnodes();\n\n\t\treturn l != null ? l.size() : 0;\n\t}", "private int getReferences() {\n int quantity = 0;\n for (Option o : criteriaList.get(currentCriteria).getOptionList()) {\n boolean wasFound = false;\n for (String s : speciesLeft)\n if (o.getEntities().contains(s))\n wasFound = true;\n if (wasFound)\n ++quantity;\n }\n return quantity;\n }", "public Integer cantidadCompras(){\n\t\t// Implementar\n\t\treturn this.compras.size();\n\t}", "int getExperimentsCount();", "public int getNumSols()\n\t{\n\t\treturn numSols;\n\t}", "int getAndConditionGroupsCount();", "public int getNumGruppoPacchetti();", "Object getNumberMatched();", "public int totalCostOfComponents()\n\t{\n\t\tint total = 0;\n\t\tfor (Component comp: configuration.values())\n\t\t{\n\t\t\ttotal += comp.getCost();\n\t\t}\n\t\treturn total;\n\t}", "public abstract int getScenarioCount();", "public static int getNrAtoms(Structure s){\n \n int nrAtoms = 0;\n \n Iterator<Group> iter = new GroupIterator(s);\n \n while ( iter.hasNext()){\n Group g = (Group) iter.next();\n nrAtoms += g.size();\n }\n \n return nrAtoms;\n }", "int countByExample(ProjGroupExample example);", "public int getChildCount();", "public int getNumberOfSets();", "public int getNumOfMatchedBets();", "int getStagesCount();", "int getNodesCount();", "int getNodesCount();", "public final int getDeponentCount() {\r\n synchronized (f_seaLock) {\r\n return f_deponents.size();\r\n }\r\n }", "public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }", "public abstract int getNumChildren();", "public int obtenerNumeroProductosComprados(){\n return listaProductosComprados.size();\n }", "public static int size_group() {\n return (8 / 8);\n }", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "int getNoOfParties();", "public int num_sets() {\n int count = 0;\n for (int i = 0; i < _parent.length; ++i) {\n if (_parent[i] == i)\n count++;\n }\n return count;\n }", "public int getTotalVariables() ;", "public int getAvailNumComps(){\n return this.mFarm.getAvailNumComps();\n }", "int getBlockNumsCount();", "int getBlockNumsCount();", "public int countInversion(){\n\t\tsetInversiones(0);\n\t\tnumeros = countStep(numeros, 0, numeros.size()-1);\n\t\treturn getInversiones();\n\t}", "void computeLevelCount() {\r\n Hierarchy[] hiers = axis.getHierarchies();\r\n int hierarchyCount = axis.getHierarchies().length;\r\n levelCount = new int[hierarchyCount];\r\n skipAllMember = new boolean[hierarchyCount];\r\n for (int i = 0; i < hiers.length; i++) {\r\n levelCount[i] = Integer.MIN_VALUE;\r\n skipAllMember[i] = hiers[i].hasAll();\r\n }\r\n\r\n Iterator it = axis.getPositions().iterator();\r\n while (it.hasNext()) {\r\n Position p = (Position) it.next();\r\n Member[] members = p.getMembers();\r\n for (int i = 0; i < members.length; i++) {\r\n int count = members[i].getRootDistance() + 1;\r\n levelCount[i] = Math.max(levelCount[i], count);\r\n if (members[i].isAll())\r\n skipAllMember[i] = false;\r\n }\r\n }\r\n\r\n // if the ALL member is not on the axis, we will not add it\r\n for (int i = 0; i < hierarchyCount; i++) {\r\n if (skipAllMember[i])\r\n levelCount[i] -= 1;\r\n }\r\n\r\n // the number of members per position is the sum of all deltas\r\n totalLevelCount = 0;\r\n for (int i = 0; i < hierarchyCount; i++)\r\n totalLevelCount += levelCount[i];\r\n }", "Long getNumberOfElement();", "public int getPartsCount() {\n if (partsBuilder_ == null) {\n return parts_.size();\n } else {\n return partsBuilder_.getCount();\n }\n }", "public int getRequiredCubeCount() {\n\t\treturn this.requiredMap.size();\n\t}", "int totalNumberOfNodes();", "public abstract Integer getNumberOfElements();", "int getBlockNumbersCount();", "public int nSoluciones() throws IllegalArgumentException {\n if (soluciones == null) {\n throw new IllegalArgumentException(\"Error: Soluciones es null\");\n }\n return this.soluciones.size();\n }", "public int countInversion(){\r\n\t\tsetInversiones(0);\r\n\t\tnumeros = countStep(numeros, 0, numeros.size()-1);\r\n\t\treturn getInversiones();\r\n\t}", "int getNumberOfVertexes();", "public static long getNumberStates(Component comp) {\n\t\tAtomType atomicType = (AtomType) comp.getType();\n\t\treturn ( (PetriNet) atomicType.getBehavior()).getState().size();\n\t}", "int getXYPairCount();", "int getEducationsCount();", "int getChildrenCount(int groupPosition);", "public int getNumOfNodes() {\n\t\treturn getNumOfNodes(this);\n\t}", "@Override\n\tpublic int numCubies () {\n\t\treturn state_.length;\n\t}", "int getAreaCount();", "int getAreaCount();", "int getAreaCount();", "public int getOccurrences() {\n\t\treturn this.occurrenceFactors.size();\n\t}", "public int getTravelGroupListCount(Map conditions);", "int getConstraintsCount();", "long getNumberOfComparisons();", "@Test\n public void testCount() {\n System.out.println(\"**** count *****\");\n ConnectedComponentsDepthSearch instance = new ConnectedComponentsDepthSearch(g);\n int expResult = 3;\n int result = instance.count();\n assertEquals(expResult, result);\n }", "public int getProblemCount() {\n return problems.size();\n }", "private int computeMaxDependencyCount (Grid grid)\n {\n int maxDependencyCount = 0;\n for (int y = 0; y < grid.getHeight (); y++)\n {\n for (int x = 0; x < grid.getWidth (); x++)\n {\n Cell cell = grid.getCell (x, y);\n if (cell != null)\n {\n int dependencyCount = cell.getDependencyCount ();\n maxDependencyCount = Math.max (maxDependencyCount, dependencyCount);\n }\n }\n }\n return maxDependencyCount;\n }", "int getTotalElements();", "public long numCandidates();", "public int getNumberOfElements();", "int getFeaturesCount();", "int getVarsCount();", "int getExamplesCount();", "int getExamplesCount();", "int getSlotsCount();", "@Override\n\tpublic int numOfCondition() {\n\t\tint sum=0;\n\t\t\n\t\tfor(Cond cond:this.conditions)\n\t\t{\n\t\t\tint sum0 = 1;\n\t\t\tif(cond.params.size()>0)\n\t\t\t{\n\t\t\t\tfor(Param param:cond.params)\n\t\t\t\t{\n\t\t\t\t\tsum0 *= param.numOfCondition();\n\t\t\t\t}\n\t\t\t\tsum = sum + sum0;\n\t\t\t}\n\t\t\telse sum++;\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "public int getValue(State state) {\n if (state.isGoal())\n return 0;\n\n int count = 1;\n int cx = state.getVariablePosition(0);\n int cy = puzzle.getFixedPosition(0);\n\n int grid[][] = state.getGrid();\n int gn = puzzle.getGridSize();\n\n for (int i = cx; i < gn; i++) {\n for (int j = 0; j < gn; j++) {\n if (grid[i][j] != -1)\n count++;\n }\n }\n\n return count;\n }", "public int getVertexCount();" ]
[ "0.81344694", "0.7595192", "0.7587192", "0.75819844", "0.7366326", "0.7243369", "0.715765", "0.7077997", "0.7066381", "0.7015341", "0.68885", "0.67448294", "0.67448294", "0.6586457", "0.6553473", "0.65292567", "0.651622", "0.6496339", "0.64814186", "0.64646745", "0.6435195", "0.64327216", "0.6426826", "0.6377941", "0.63586617", "0.6312479", "0.62994003", "0.6289797", "0.6275781", "0.6262637", "0.62543267", "0.62514764", "0.62343407", "0.6223161", "0.6205159", "0.6204714", "0.61985654", "0.61907387", "0.618107", "0.6174037", "0.6165635", "0.6162066", "0.61614263", "0.6157182", "0.61552227", "0.6154834", "0.6154834", "0.6147558", "0.613528", "0.6117657", "0.61103415", "0.61095715", "0.61087745", "0.61087745", "0.61087745", "0.61087745", "0.6102591", "0.60956556", "0.6086223", "0.6085403", "0.60818106", "0.60818106", "0.60816085", "0.60793024", "0.6078949", "0.60730356", "0.60700977", "0.6066859", "0.6064907", "0.6056879", "0.60505015", "0.60402554", "0.6037395", "0.60226214", "0.60193455", "0.6004498", "0.6002153", "0.60019696", "0.6000983", "0.59995383", "0.59995383", "0.59995383", "0.599596", "0.5995038", "0.5991638", "0.5990241", "0.5990224", "0.59881234", "0.5985134", "0.5982549", "0.5979855", "0.59794414", "0.597743", "0.5967283", "0.5958893", "0.5958893", "0.59518766", "0.59418315", "0.5938749", "0.59376377" ]
0.5940112
98
Set runtime environment variable for chromedriver
public void Open_Browser() { System.setProperty("webdriver.chrome.driver", "drivers\\chromedriver.exe"); //Brower initiation driver=new ChromeDriver(); //maximize browser window driver.manage().window().maximize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setChromeDriverProperty() {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\automation_new_code\\\\onfs.alip.accounting\\\\BrowserDriver/chromedriver.exe\");\n\t\t}", "public void setChromeDriver(){\n System.setProperty(\"webdriver.chrome.driver\", browserDriverPath);\n seleniumDriver = new ChromeDriver();\n }", "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}", "public static void ChromeExePathSetUp() {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \r\n\t\t\t\t\"D:\\\\VisionITWorkspace\\\\dependencies\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tReporter.log(\"Chrome Exe path Set up\", true);\r\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 static void startChromeDriver() {\r\n\t\tswitch (operatingSystem.toLowerCase().split(\" \")[0]) {\r\n\t\tcase \"windows\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriver.exe\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"linux\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriverLinux\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"mac\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriverMac\");\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"Operating system not supported.\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void chromeLaunch() {\n\t\tSystem.setProperty(key, value);\n\t\ts=new ChromeDriver();\n\t\ts.manage().window().maximize();\n\t\ts.navigate().to(url);\n\t}", "private void setChromeDriver() throws Exception {\n\t\t// boolean headless = false;\n\t\tHashMap<String, Object> chromePrefs = new HashMap<String, Object>();\n\t\tchromePrefs.put(\"profile.default_content_settings.popups\", 0);\n\t\tchromePrefs.put(\"download.default_directory\", BasePage.myTempDownloadsFolder);\n\t\tchromeOptions.setExperimentalOption(\"prefs\", chromePrefs);\n\t\t// TODO: Using \"C:\" will not work for Linux or OS X\n\t\tFile dir = new File(BasePage.myTempDownloadsFolder);\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n\n\t\tchromeOptions.addArguments(\"disable-popup-blocking\");\n\t\tchromeOptions.addArguments(\"--disable-extensions\");\n\t\tchromeOptions.addArguments(\"start-maximized\");\n\n\t\t/*\n\t\t * To set headless mode for chrome. Would need to make it conditional\n\t\t * from browser parameter Does not currently work for all tests.\n\t\t */\n\t\t// chromeOptions.setHeadless(true);\n\n\t\tif (runLocation.toLowerCase().equals(\"smartbear\")) {\n\t\t\tReporter.log(\"-- SMARTBEAR: standard capabilities. Not ChromeOptions\", true);\n\t\t\tcapabilities = new DesiredCapabilities();\n\t\t} else {\n\t\t\tcapabilities = DesiredCapabilities.chrome();\n\t\t\tcapabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);\n\t\t}\n\n\t\tWebDriver myDriver = null;\n\t\tRemoteWebDriver rcDriver;\n\n\t\tswitch (runLocation.toLowerCase()) {\n\t\tcase \"local\":\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\tcase \"grid\":\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\trcDriver.setFileDetector(new LocalFileDetector());\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"testingbot\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\t// capabilities.setCapability(\"name\", testName); // TODO: set a test\n\t\t\t// name (suite name maybe) or combined with env\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"smartbear\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\t \n\t\t\t//capabilities.setCapability(\"name\", testMethod.get());\n\t\t\tcapabilities.setCapability(\"build\", testProperties.getString(TEST_ENV)+\" Chrome-\"+platformOS);\n\t\t\tcapabilities.setCapability(\"max_duration\", smartBearDefaultTimeout);\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\tcapabilities.setCapability(\"screenResolution\", smartBearScreenRes);\n\t\t\tcapabilities.setCapability(\"record_video\", \"true\"); Reporter.log(\n\t\t\t\t\t \"BROWSER: \" + browser, true); Reporter.log(\"BROWSER Version: \" +\n\t\t\t\t\t\t\t browserVersion, true); Reporter.log(\"PLATFORM: \" + platformOS, true);\n\t\t\tReporter.log(\"URL '\" + serverURL + \"'\", true); rcDriver = new\n\t\t\tRemoteWebDriver(new URL(serverURL), capabilities); myDriver = new\n\t\t\tAugmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\t}\n\t\tdriver.set(myDriver);\n\t}", "@Before\n public void Setup() { //this is done before every test, chrome driver is saved in a specific location\n\n System.setProperty(\"webdriver.chrome.driver\",\n Constant.CROMEDRIVER);\n\n driver = new ChromeDriver();\n }", "@BeforeTest\n public void setup() {\n System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\User\\\\IdeaProjects\\\\LoginToJira\\\\chromedriver.exe\");\n // Create a new instance of the Chrome driver\n this.driver = new ChromeDriver();\n }", "@BeforeMethod(alwaysRun = true)\n public void browserSetup(){\n driver = new ChromeDriver();\n }", "@BeforeSuite\r\n\tpublic void before_suite() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"G:\\\\chromedriver.exe\");\r\n\t}", "@Before\n public void setWebDriver() throws IOException {\n System.setProperty(\"webdriver.chrome.driver\", DRIVER_PATH);\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.addArguments(\"start-maximized\");\n driver = new ChromeDriver(chromeOptions);\n }", "@BeforeClass\n public static void setup() {\n String driverPath = \"\";\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\n driver = new ChromeDriver();\n driver.manage().window().maximize();\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 }", "private void setWebdriver() throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\tcurrentDir + fileSeparator + \"lib\" + fileSeparator + \"chromedriver.exe\");\n\t\tcapability = DesiredCapabilities.chrome();\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--disable-extensions\");\n\t\toptions.addArguments(\"disable-infobars\");\n\t\tcapability.setCapability(ChromeOptions.CAPABILITY, options);\n\t\tdriver = new ChromeDriver(capability);\n\t\tdriver.manage().deleteAllCookies();\n\t\t_eventFiringDriver = new EventFiringWebDriver(driver);\n\t\t_eventFiringDriver.get(getUrl());\n\t\t_eventFiringDriver.manage().window().maximize();\n\n\t}", "@Before\r\n\tpublic void setup() {\r\n\t\tSystem.out.println(\"Before\");\r\n\t\t//System.setProperty(\"webdriver.chrome.driver\", \"C:/Users/Admin/Desktop/Chromedriver.exe\");\r\n\t\t//driver = new ChromeDriver();\r\n\t}", "@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 }", "public void setup(){\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"//Users//bpat12//Downloads//chromedriver\");\n\t\tdriver = new ChromeDriver();\n\t\tSystem.out.println(\"launch browser\");\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tdriver.get(url);\n\t}", "@Given(\"^Initialize the browser with Chrome$\")\r\n\tpublic void initialize_the_browser_with_Chrome() throws Throwable {\n\t\tdriver = DriverManager.getDriverInstance(\"chrome\", 20);\r\n\t\tSystem.out.println(\"Launched Chrome\");\r\n\t}", "public static WebDriver chrome()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\Chrome\\\\chromedriver.exe\");\r\n\t\tgk = new ChromeDriver();\r\n\t\treturn gk;\r\n\t}", "@Before\n public synchronized static WebDriver openBrowser() {\n String browser = System.getProperty(\"BROWSER\");\n\n\n if (driver == null) {\n try {\n //Kiem tra BROWSER = null -> gan = chrome\n if (browser == null) {\n browser = System.getenv(\"BROWSER\");\n if (browser == null) {\n browser = \"chrome\";\n }\n }\n switch (browser) {\n case \"chrome\":\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n case \"firefox\":\n WebDriverManager.firefoxdriver().setup();\n driver = new FirefoxDriver();\n break;\n case \"chrome_headless\":\n WebDriverManager.chromedriver().setup();\n ChromeOptions options = new ChromeOptions();\n options.addArguments(\"headless\");\n options.addArguments(\"window-size=1366x768\");\n driver = new ChromeDriver(options);\n break;\n default:\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n }\n } catch (UnreachableBrowserException e) {\n driver = new ChromeDriver();\n } catch (WebDriverException e) {\n driver = new ChromeDriver();\n } finally {\n Runtime.getRuntime().addShutdownHook(new Thread(new BrowserCleanup()));\n }\n driver.get(\"http://demo.guru99.com/v4/\");\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n log.info(\"----------- START BRWOSER -----------\");\n\n }\n return driver;\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}", "public static void setBrowser() {\n\t\t browser=\"Chrome\";\n\t }", "private void setupEnvironment(Execute exe) {\r\n String[] environment = env.getVariables();\r\n if (environment != null) {\r\n for (int i = 0; i < environment.length; i++) {\r\n log(\"Setting environment variable: \" + environment[i], Project.MSG_VERBOSE);\r\n }\r\n }\r\n exe.setNewenvironment(newEnvironment);\r\n exe.setEnvironment(environment);\r\n }", "public Selenium(String chromePath) {\n this.browserDriverPath = chromePath; \n }", "@BeforeClass\n\t public void beforeClass() {\n\t System.setProperty(\"webdriver.chrome.driver\", \"F:\\\\Git\\\\GIT_Repositories\\\\Selenium_Project\\\\Drivers\\\\chromedriver.exe\");\n\t driver = new ChromeDriver();\n\t \n\t \n\t }", "@BeforeClass\n public void BeforeTest(){\n Configuration.browser = \"Chrome\";\n\n }", "private void initChromeDriver(String appUrl) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"Drivers\\\\chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(appUrl);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t}", "@BeforeTest\r\n\tpublic void launch()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Yogini\\\\chromedriver\\\\chromedriver.exe\"); //location of browser in local drive\r\n\t\tWebDriver driver = new ChromeDriver(); \r\n\t\tdriver.get(tobj.url);\r\n\t\tSystem.out.println(\"Before test, browser is launched\");\r\n\t}", "public void getDriver() {\n\t\tWebDriverManager.chromedriver().setup();\n\t\tdriver = new ChromeDriver();\n\t}", "private static WebDriver launchChrome()\n\t{\n\t\tif (REMOTE_URL != null && !REMOTE_URL.equals(\"\")) {\n\t\t\tDesiredCapabilities capabilities = DesiredCapabilities.chrome();\n\t\t\ttry {\n\n\t\t\t\treturn new RemoteWebDriver(new URL(System.getProperty(\"RemoteUrl\")), capabilities);\n\t\t\t}\n\n\n\t\t\tcatch (MalformedURLException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\tURL chromeDriverURL = BrowserDriver.class.getResource(\"/drivers/chromedriver.exe\");\n\t\tFile file = new File(chromeDriverURL.getFile()); \n\t\tSystem.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, file.getAbsolutePath());\n\t\t\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--start-maximized\");\n\t\toptions.addArguments(\"--ignore-certificate-errors\");\n\t\t\n\t\treturn new ChromeDriver(options);\n\t\t}\n\t}", "public void initialization()\n\t{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Mrunal\\\\chromedriver.exe\");\n\t\n\t\tif(prop.getProperty(\"browser\").contains(\"chrome\"))\n\t\t driver = new ChromeDriver();\n\t\t \n\t\t driver.manage().deleteAllCookies();\n\t\t driver.manage().timeouts().pageLoadTimeout(2000, TimeUnit.MILLISECONDS);\n\t\t driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\n\t\t driver.get(prop.getProperty(\"url\"));\n\t\t driver.manage().window().maximize();\n\t\t driver.manage().timeouts().implicitlyWait(8, TimeUnit.SECONDS);\n\t\t \n\t}", "@BeforeTest\r\n public void launchBrowser() {\n System.setProperty(\"webdriver.chrome.driver\", ChromePath);\r\n driver= new ChromeDriver();\r\n driver.manage().window().maximize();\r\n driver.get(titulo);\r\n }", "public GoogleAutomation() {\n\t\t\n\t\t//The setProperty() method of Java system class sets the property of the system which is indicated by a key.\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"driver//chromedriver.exe\");\n\t\t\n\t\t//initilize webDriver \n\t\twebDriver = new ChromeDriver();\n\t}", "public static void initialization() {\n\t\tSystem.out.println(\"**Open initialization**\");\r\n\t\tString browserName = props.getProperty(\"browser\");\r\n\t\tSystem.out.println(\"Browser User = \" + browserName + \" URL = \" + props.getProperty(\"url\"));\r\n\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"D:/Selenium Automation/chromedriver/chromedriver.exe\");\r\n\t\tdriver = new ChromeDriver();\r\n\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().deleteAllCookies();\r\n\r\n\t\tdriver.get(props.getProperty(\"url\"));\r\n\t\tSystem.out.println(\"**Close initialization**\");\r\n\t}", "public WebDriver initializeDriver() {\n System.setProperty(\"webdriver.chrome.driver\", projectPath + \"//src//main//resources//chromedriver\");\n driver = new ChromeDriver();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n return driver;\n }", "private void setRemoteWebdriver() {\n\n switch (getBrowserId(browser)) {\n case 0:\n capabilities = DesiredCapabilities.internetExplorer();\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n break;\n case 1:\n\t\tFirefoxProfile profile = new FirefoxProfile();\n \tprofile.setEnableNativeEvents(true);\n capabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(FirefoxDriver.PROFILE, profile);\n \tcapabilities.setJavascriptEnabled(true);\n \tcapabilities.setCapability(\"marionette\", false);\n \tcapabilities.setCapability(\"acceptInsecureCerts\", true);\n break;\n case 2:\n capabilities = DesiredCapabilities.safari();\n break;\n case 3:\n capabilities = DesiredCapabilities.chrome();\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n capabilities.setCapability(\"javascriptEnabled\", true);\n capabilities.setCapability(\"platform\", platform);\n capabilities.setCapability(\"version\", version);\n capabilities.merge(extraCapabilities);\n\n try {\n this.driver.set(new RemoteWebDriver(new URL(\"http://\"\n + System.getProperty(\"GRID_HOST\") + \":\"\n + System.getProperty(\"GRID_PORT\") + \"/wd/hub\"),\n capabilities));\n } catch (MalformedURLException e) {\n LOGGER.log(Level.INFO,\n \"MalformedURLException in setRemoteWebdriver() method\", e);\n }\n }", "public static WebDriver init_driver_crome(String browser) {\n\t\t\tif(browser.equals(\"chrome\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"G:\\\\software\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Browser is initialised\" +browser);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Browser is not initialised\" +browser);\n\t\t\t}\n\t\t\treturn getDriverChrome();\n\t\t}", "public static WebDriver getLocalChromeDriver() {\n WebDriverManager.chromedriver().setup();\n return new ChromeDriver();\n }", "private WebDriver createChromeDriver() {\n\t\tsetDriverPropertyIfRequired(\"webdriver.chrome.driver\", \"chromedriver.exe\");\n\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"disable-plugins\");\n\t\toptions.addArguments(\"disable-extensions\");\n\t\toptions.addArguments(\"test-type\");\n\n\t\t\n\t\t_driver = new ChromeDriver(options);\n\t\treturn _driver;\n\t}", "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}", "@Given(\"^the user launch the chrome application$\")\r\n\tpublic void the_user_launch_the_chrome_application() throws Throwable {\n\t\tlaunchBrowser(\"chrome\");\r\n\t\t register= new Para_Registartion_page(driver);\r\n\t}", "@BeforeClass\n public static void setupClass() {\n WebDriverManager.chromedriver().setup();\n }", "@BeforeClass\n public static void setup(){\n WebDriverManager.chromedriver().setup();\n webDriver = new ChromeDriver();\n webDriver.manage().window().maximize();\n webDriver.manage().timeouts().implicitlyWait(3000, TimeUnit.MILLISECONDS);\n }", "@BeforeTest\r\n\tpublic void beforeTest() throws MalformedURLException {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\PDC2B-Training.pdc2b\\\\Downloads\\\\Selenium Drivers\\\\BrowserDriver\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);\r\n\t}", "private static void setEnvironmentVariable(String key, String value) throws NoSuchFieldException, IllegalAccessException {\n\n Map<String, String> env = System.getenv();\n Class<?> cl = env.getClass();\n\n Field field = cl.getDeclaredField(\"m\");\n field.setAccessible(true);\n\n Object obj = field.get(env);\n @SuppressWarnings(\"unchecked\")\n Map<String, String> map = (Map<String, String>) obj;\n map.put(key, value);\n\n }", "@Parameters({\"browser\"})\n\t@BeforeMethod\n\tpublic final void setDriver(String browser) throws Exception{\n\t\tsetBrowser = browser;\n\t\tswitch(browser){\n\t\t\n\t\tcase \"chrome\":\n\t\t\tWebDriverManager.chromedriver().setup();\n\t\t\twebDriver.set(new ChromeDriver());\n\t\tbreak;\n\t\t\n\t\tcase \"firefox\":\n\t\t\tWebDriverManager.firefoxdriver().setup();\n\t\t\twebDriver.set(new FirefoxDriver());\n\t\tbreak;\n\t\t\n\t\tcase \"ie\":\n\t\t\tWebDriverManager.edgedriver().setup();\n\t\t\twebDriver.set(new EdgeDriver());\n\t\tbreak;\n\t\t\n\t\tcase \"edge\":\n\t\t\t/*EdgeOptions options = new EdgeOptions();\n\t\t\t//options.setProxy(proxy)\n*/\t\t\tSystem.setProperty(\"webdriver.edge.driver\", resourcePath+\"Drivers/MicrosoftWebDriver.exe\");\n\t\t\tWebDriver driver = new EdgeDriver();\n\t\t\t//WebDriverManager.edgedriver().setup();\n\t\t\twebDriver.set(driver);\n\t\tbreak;\n\t\t\n\t\tcase \"safari\":\n\t\t\twebDriver.set(new SafariDriver());\n\t\t\n\t\t}\n\t}", "@Before\r\n\tpublic void OpenChrome() {\n\t\tconfig = new ConfigReader();\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",config.getChromePath());\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\texPages = new ExpediaPages(driver);\r\n\t}", "public static void initializer() \n\t{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\HP-PC\\\\Downloads\\\\Kahoot\\\\chromedriver.exe\" );\n\t\tdriver=new ChromeDriver();\n\t\tdriver.manage().window().maximize();\n\t\tdriver.get(\"https://www.sathya.in/\");\n\t}", "@BeforeMethod\n\tpublic void registerChromeDriver() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t\"/Users/shwetasharma/Documents/softwares/chromedriver\");\n\t\tdriver = new ChromeDriver();\n\t\tutil = new Utils(driver);\n\t\t// Put a Implicit wait, this means that any search for elements on the\n\t\t// page\n\t\t// could take the time the implicit wait is set for before throwing\n\t\t// exception\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t\t// Launch the Applitools hackathon Website\n\t\tdriver.get(\"https://demo.applitools.com/hackathon.html\");\n\t\tdriver.manage().window().maximize();\n\n\t}", "@Override\r\n\tpublic void buildDriver() throws DriverException\r\n\t{\r\n\t\tif(ConfigUtil.isLocalEnv())\r\n\t\t{\r\n\t\t\t// if it is a Selenium tool, then create selenium ChromeDriver\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\t\r\n\t\t\t\tFile chromeDriverFile=getChromeDriverFile();\r\n\t\t\t\tSystem.out.println(\" Found Driver file\");\r\n\t\t\t\tdriver =SeleniumDriver.buildChromeDriver(chromeDriverFile);\r\n\t\t\t\t //new org.openqa.selenium.chrome.ChromeDriver();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isRemoteEnv())\r\n\t\t{\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\tcapabilities = DesiredCapabilities.chrome();\t\r\n\t\t\t\tdriver = SeleniumDriver.buildRemoteDriver(capabilities);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isBrowserStackEnv())\r\n\t\t{\r\n\t\t\tcapabilities = DesiredCapabilities.chrome();\r\n\t\t\tbuildBrowserstackCapabilities();\r\n\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\r\n\t\tWebDriver driver =new ChromeDriver();\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@BeforeMethod\n\tpublic void setUp() throws Exception{\n\n\t\tDesiredCapabilities chromecap= DesiredCapabilities.chrome();\n\t\tchromecap.setBrowserName(\"chrome\");\n\t\tchromecap.setPlatform(Platform.WINDOWS);\n\t\tdriver= new RemoteWebDriver(new URL(\"http://localhost:4444/wd/hub\"), chromecap);\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t\n\t}", "void setEnvironment(Properties properties);", "@Parameters(\"browser\")\n\t@BeforeClass\n\tpublic void setupDriver(String browser) throws MalformedURLException {\n\t\tDesiredCapabilities dc = null;\n\t\t\n\t\tif (browser.equalsIgnoreCase(\"chrome\")) {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"/phptravels/src/main/resources/chromedriver.exe\");\n\t\t\tdc = DesiredCapabilities.chrome();\n\t\t\tdc.setBrowserName(\"chrome\");\n\t\t\t\n\t\t} else if (browser.equalsIgnoreCase(\"firefox\")) {\n\t\t\tdc = DesiredCapabilities.firefox();\n\t\t\tdc.setBrowserName(\"firefox\");\n\t\t}\n\t\t\n\t\tdc.setPlatform(Platform.WIN8_1);\n\t\tdriver = new RemoteWebDriver(new URL(\"http://localhost:4444/wd/hub\"), dc);\n\t}", "private void setSauceWebdriver() {\n\n switch (getBrowserId(browser)) {\n case 0:\n capabilities = DesiredCapabilities.internetExplorer();\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n break;\n case 1:\n capabilities = DesiredCapabilities.firefox();\n break;\n case 2:\n capabilities = DesiredCapabilities.safari();\n break;\n case 3:\n capabilities = DesiredCapabilities.chrome();\n break;\n case 4:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPhone Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 5:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPad Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 6:\n capabilities = DesiredCapabilities.android();\n capabilities.setCapability(\"deviceName\",\"Android Emulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n capabilities.merge(extraCapabilities);\n capabilities.setCapability(\"javascriptEnabled\", true);\n capabilities.setCapability(\"platform\", platform);\n capabilities.setCapability(\"version\", version);\n\n try {\n this.driver.set(new RemoteWebDriver(new URL(System\n .getProperty(\"SAUCE_KEY\")), capabilities));\n } catch (MalformedURLException e) {\n LOGGER.log(Level.INFO,\n \"MalformedURLException in setSauceWebdriver() method\", e);\n }\n }", "@Given(\"I set up my Chrome Driver\")\n\tpublic void i_am_on_Magalu_HomePage() {\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--start-maximized\");\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:/Users/gocruz/eclipse-workspace/portal.compras/chromedriver.exe\");\n\t\tdriver = new ChromeDriver(options);\n\n\t}", "private void setWebDriver() {\n if (Boolean.valueOf(System.getProperty(\"LOCAL_DRIVER\"))) {\n setLocalWebdriver();\n } else if (Boolean.valueOf(System.getProperty(\"REMOTE_DRIVER\"))) {\n setRemoteWebdriver();\n } else if (Boolean.valueOf(System.getProperty(\"SAUCE_DRIVER\"))) {\n setSauceWebdriver();\n } else {\n throw new WebDriverException(\"Type of driver not specified!!!\");\n }\n this.driver.get().manage().timeouts()\n .implicitlyWait(10, TimeUnit.SECONDS);\n if (browser.equalsIgnoreCase(\"internet explorer\")|browser.equalsIgnoreCase(\"firefox\")|browser.equalsIgnoreCase(\"chrome\")|browser.equalsIgnoreCase(\"safari\")) {\n\t\t\t//we only want to maximise the browser window for desktop browser, not devices.\n \tthis.driver.get().manage().window().maximize();\n\t\t}\n }", "@Test\r\n\tpublic void f()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C://Data_Program//Selenium_Dependencies//chromedriver.exe\");\r\n\t\tWebDriver driver=new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"http://www.google.com\");\r\n\t}", "private static void loadTestEnv() {\n\n\t\tPropertyReader reader = new PropertyReader(GlobalContext.getAppDir(), Constants.FILENAME_TESTENV);\n\n\t\tTestEnv env = new TestEnv();\n\t\tenv.setDefaultHostName(reader.getProperty(Constants.DEFAULT_HOST_NAME));\n\t\tenv.setDefaultHostOS(reader.getProperty(Constants.DEFAULT_HOST_OS));\n\t\tenv.setDefaultCredentials(reader.getProperty(Constants.DEFAULT_CREDENTIALS));\n\t\tenv.setDefaultBrowser(reader.getProperty(Constants.DEFAULT_BROWSER));\n\t\tenv.setAppServer(reader.getProperty(Constants.APP_SERVER));\n\t\tenv.setDatabaseServer(reader.getProperty(Constants.DATABASE_SERVER));\n\t\tenv.setEmailReceipients(reader.getProperty(Constants.EMAIL_RECEIPIENTS));\n\t\tenv.setEmailSender(reader.getProperty(Constants.EMAIL_SENDER));\n\n\t\t// sets to global context.\n\t\tGlobalContext.setTestEnv(env);\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 }", "public static void setChromeDriverDownloadPath(String path)\n\t{\n\t\tApplicationProperties appProperties = p6web.getInstance();\n\t\t\n\ttry{\n\t\t\n\t\tm_driver = ApplicationProperties.getInstance().getDriver();\n\t\tm_driver.get(\"chrome://settings/advanced\");\n JavascriptExecutor js = (JavascriptExecutor) m_driver;\n String prefId = \"download.default_directory\";\n File tempDir=new File(System.getProperty(\"user.dir\")+path);\n if (m_driver.findElements(By.xpath(String.format(\".//input[@pref='%s']\", prefId))).size() == 0) {\n \tm_driver.get(\"chrome://settings-frame\");\n \tm_driver.findElement(By.xpath(\".//button[@id='advanced-settings-expander']\")).click(); }\n String tmpDirEscapedPath = tempDir.getCanonicalPath().replace(\"\\\\\", \"\\\\\\\\\");\n js.executeScript(String.format(\"Preferences.setStringPref('%s', '%s', true)\", prefId,\n tmpDirEscapedPath));\n\t\t}\n\t\n\t\tcatch(IOException e){\n\t\t\t\n\t\t}\n\t\n\t\tm_driver.get(appProperties.getUrl());\n\t\n\t}", "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 }", "public static WebDriver startChrome() {\n\t\treturn new ChromeDriver();\n\t}", "@BeforeMethod\n\tpublic void setUpMethod() {\n//\t\tDrivers.setChrome();\n//\t\tthis.driver = Drivers.getDriver();\n\t\tdriver.get(DataReaders.projectProperty(\"baseURL\"));\n\t}", "public static ChromeDriver intiChrome() throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"D:/ChromeServer/chromedriver.exe\");\n\t\t// WebDriver driver = new ChromeDriver();\n\t\tChromeOptions chromeOptions = new ChromeOptions();\n\t\t// 设置为 headless 模式 (必须)\n\t\t// chromeOptions.addArguments(\"--headless\");\n\t\t// 设置浏览器窗口打开大小 (非必须)\n\t\t// chromeOptions.addArguments(\"--window-size=1980,1068\");\n\t\tChromeDriver driver = new ChromeDriver(chromeOptions);\n\t\treturn driver;\n\t}", "public static ChromeOptions setChromeOptions() {\n\t\t\tChromeOptions cOptions = new ChromeOptions();\n\t\t\tcOptions.addArguments(\"disable-infobars\");\n\t\t\t//cOptions.addArguments(\"--headless\", \"window-size=1920,1080\");\n\t\t\tcOptions.addArguments(\"--disable-notifications\");\n\t\t\treturn cOptions;\n\t\t}", "private static String getEnvironVar(String env) {\r\n \treturn System.getenv(env);\r\n }", "@BeforeTest // which will be executed first before all the test methods\n@Parameters(\"browser\") //@Parameter is used to pass the values(during run time) to the test methods as arguments using .xml file\npublic void setup(String browser) throws Exception{\n \n//Check if parameter passed as 'chrome'\nif (browser.equalsIgnoreCase(\"chrome\")){\n//set path to chromedriver.exe\nSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\\\\\\\\\\\\\Users\\\\\\\\\\\\\\\\mouleeswaranb\\\\\\\\\\\\\\\\eclipse-workspace_Selenium learning_6127\\\\\\\\\\\\\\\\SeleniumProject\\\\\\\\\\\\\\\\drivers\\\\\\\\\\\\\\\\chromedriver.exe\");\ndriver = new ChromeDriver(); \n}\n\nelse{\n//If no browser passed throw exception\nthrow new Exception(\"Browser is not correct\");\n}\ndriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n}", "public static void main(String[] args) throws MalformedURLException {\n\t\t\n\t\tDesiredCapabilities objRc=new DesiredCapabilities();\n\t\tobjRc.setBrowserName(\"chrome\");\n\t\tobjRc.setPlatform(Platform.WINDOWS);\n\t\tWebDriver driver=new RemoteWebDriver(new URL(\"http://localhost:4546/wd/hub\"),objRc);\n\t}", "public void setUp()\n\t{\n\t\tif (driver == null){\n\t\t\t\n\t\t\ttry {\n\t\t\t\tSystem.out.println(System.getProperty(\"user.dir\")+ \"\\\\src\\\\test\\\\resources\\\\properties\\\\Config.properties\");\n\t\t\t\tfis = new FileInputStream(System.getProperty(\"user.dir\")+ \"\\\\src\\\\test\\\\resources\\\\properties\\\\Config.properties\");\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconfig.load(fis);\n\t\t\t\tSystem.out.println(\"config file loaded\");\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tfis = new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\src\\\\test\\\\resources\\\\properties\\\\OR.properties\");\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tOR.load(fis);\n\t\t\t\t//config.load(fis);\n\t\t\t\tSystem.out.println(\"OR file loaded\");\n\t\t\t\tSystem.out.println(System.getenv(\"browser\"));\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tif (System.getenv(\"browser\")!= null)\n\t\t\t\t{\n\t\t\t\t\tbrowser = System.getenv(\"browser\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tbrowser = config.getProperty(\"browser\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\tconfig.setProperty(browser, browser);\n\t\tif (config.getProperty(\"browser\").equals(\"chrome\"))\n\t\t\t\n\t\t{\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\") + \"\\\\src\\\\test\\\\resources\\\\executables\\\\chromedriver.exe\");\n\t\t\tdriver = new ChromeDriver();\n\t\t\tSystem.out.println(\"Chrome Launched !!!\");\n\t\t}\n\t\t//System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Program Files (x86)\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\t//driver = new ChromeDriver();\n\t\tSystem.out.println(System.getProperty(\"TestEnv\"));\n\t\tdriver.get(config.getProperty(\"testsiteurl\").replace(\"{TestEnv}\", System.getProperty(\"TestEnv\")));\n\t\tSystem.out.println(\"Navigated to : \" + config.getProperty(\"testsiteurl\"));\n\t\tdriver.manage().window().maximize();\n\t\t\n\t}", "private static void setDriver(String driverProperty, String driverPath) {\r\n if (System.getProperty(driverProperty) == null) {\r\n File driverFile = new File(driverPath);\r\n System.setProperty(driverProperty, driverFile.getAbsolutePath());\r\n }\r\n }", "public void initiateBrowser(String browser) {\n\t\tString os = System.getProperty(\"os.name\").toLowerCase();\n\t\tString current_dir = System.getProperty(\"user.dir\");\n\t\tSystem.out.println(os);\n\t\tSystem.out.println(current_dir);\n\t\tswitch (browser) {\n\t\tcase \"ie\":\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", current_dir + \"/drivers/IEDriverServer.exe\");\n\t\t\tdriver = new InternetExplorerDriver();\n\t\t\tbreak;\n\t\tcase \"chrome\":\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\tif (os.contains(\"linux\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", current_dir + \"/drivers/linuxdrivers/chromedriver\");\n\t\t\t\tDesiredCapabilities caps = DesiredCapabilities.chrome();\n\t\t\t\tLoggingPreferences logPrefs = new LoggingPreferences();\n\t\t\t\tlogPrefs.enable(LogType.BROWSER, Level.ALL);\n\t\t\t\tcaps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);\n\n\t\t\t\toptions.setBinary(\"/usr/bin/google-chrome\");\n\t\t\t\toptions.addArguments(\"--headless\");\n\t\t\t} else if (os.contains(\"windows\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", current_dir + \"/drivers/chromedriver.exe\");\n\t\t\t\tDesiredCapabilities caps = DesiredCapabilities.chrome();\n\t\t\t\tLoggingPreferences logPrefs = new LoggingPreferences();\n\t\t\t\tlogPrefs.enable(LogType.BROWSER, Level.ALL);\n\t\t\t\tcaps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);\n\t\t\t}\n\t\t\toptions.addArguments(\"test-type\");\n\t\t\toptions.addArguments(\"disable-popup-blocking\");\n\t\t\tdriver = new ChromeDriver(options);\n\n\t\t\tdriver.manage().window().maximize();\n\t\t\tbreak;\n\t\tcase \"firefox\":\n\t\t\tdriver = new FirefoxDriver();\n\t\t\tbreak;\n\t\t}\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t}", "@BeforeClass\n public static void instanceDriver() {\n ChromeOptions options = ConfigUtil.chromeOptions();\n driver = new ChromeDriver(options);\n wait = new WebDriverWait(driver, WEB_DRIVER_TIMEOUT);\n }", "public native void getenv(java.lang.String key);", "public static void initialization()\r\n\t{\r\n\t\tString browserName = prop.getProperty(\"browser\");\r\n\t\tif(browserName.equalsIgnoreCase(\"chrome\"))\r\n\t\t{\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src\\\\test\\\\resources\\\\chromedriver.exe\");\r\n\t\t\tdriver = new ChromeDriver();\r\n\t\t}\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(TestUtil.PAGE_LOAD_TIMEOUT, TimeUnit.SECONDS);\r\n\t\tdriver.manage().timeouts().implicitlyWait(TestUtil.PAGE_LOAD_TIMEOUT,TimeUnit.SECONDS);\r\n\t\tdriver.get(prop.getProperty(\"url\"));\r\n\t}", "@BeforeClass\n public void setUp() {\n System.out.println(\"Setting up webdriver\");\n //Set the webdriver to use and the path to the webdriver\n System.setProperty(\"webdriver.chrome.driver\", \"src/test/java/Webdrivers/chromedriver.exe\");\n driver = new ChromeDriver();\n //Give our newly setup driver the base url for mentor marketplace. This serves as a\n //launching point for all tests.\n driver.get(baseUrl);\n }", "public static WebDriver setUp() {\n\t\n \t\n \tSystem.setProperty(\"webdriver.chrome.driver\", \"drivers\\\\chromedriver.exe\"); //if it doesn't work we can check with user.dir...\n \tdriver = new ChromeDriver(); //launch the Browser it opens empty page\n \tdriver.manage().window().maximize();\n \tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); //to wait globally\n \tdriver.get(\"http://166.62.36.207/humanresources/symfony/web/index.php/auth/login\");\n \t \n \treturn driver; //return object of the driver \t\n}", "public boolean setBrowserCapability(String key, String value) {\n if (Boolean.valueOf(System.getProperty(\"LOCAL_DRIVER\"))) {\n return false;\n } else if (Boolean.valueOf(System.getProperty(\"REMOTE_DRIVER\"))) {\n extraCapabilities.setCapability(key, value);\n return true;\n } else if (Boolean.valueOf(System.getProperty(\"SAUCE_DRIVER\"))) {\n extraCapabilities.setCapability(key, value);\n return true;\n } else {\n throw new WebDriverException(\"Type of driver not specified!!!\");\n }\n }", "@BeforeEach\n\tvoid setUp() throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", driverPath);\n\n\t\t// step3: Initiate selenium webdriver\n\t\tdriver = new ChromeDriver();\n\n\t\t// step4: Lunch web browser\n\t\tdriver.get(siteUrl);\n\t}", "public static void main(String[] args) {\n String str = getDriver(\"chrome\");\n System.out.println(str);\n\n }", "public void initDriver() {\n if (getBrowser().equals(\"firefox\")) {\n WebDriverManager.firefoxdriver().setup();\n if (System.getProperty(\"headless\") != null) {\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(true);\n driver = new FirefoxDriver(firefoxOptions);\n } else {\n driver = new FirefoxDriver();\n }\n } else {\n WebDriverManager.chromedriver().setup();\n if (System.getProperty(\"headless\") != null) {\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(true);\n driver = new ChromeDriver(chromeOptions);\n } else {\n driver = new ChromeDriver();\n }\n }\n }", "public static WebDriver setupDriver(String platform, String url, String browser) {\n if (platform.equalsIgnoreCase(\"mac\") && browser.equalsIgnoreCase(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", \"src/main/resources/drivers/chromedriver\");\n } else if (platform.equalsIgnoreCase(\"windows\") && browser.equalsIgnoreCase(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", \"src/main/resources/drivers/chromedriver.exe\");\n }\n driver = new ChromeDriver();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n driver.get(url);\n return driver;\n }", "public static void setDriver(WebDriver webDriver) {\n driver = webDriver;\n }", "public static void openBrowser() {\r\n\t\tString browser = prop.getProperty(\"browserType\").toLowerCase();\r\n\r\n\t\ttry {\r\n\t\t\tif (browser.equals(\"chrome\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"chromeName\"), prop.getProperty(\"chromePath\"));\r\n\t\t\t\tdriver = new ChromeDriver();\r\n\r\n\t\t\t} else if (browser.equals(\"ff\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"FFName\"), prop.getProperty(\"FFPath\"));\r\n\t\t\t\tdriver = new FirefoxDriver();\r\n\r\n\t\t\t} else if (browser.equals(\"ie\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"IEName\"), prop.getProperty(\"IEPath\"));\r\n\t\t\t\tdriver = new InternetExplorerDriver();\r\n\r\n\t\t\t} else {\r\n\t\t\t\tAssert.fail(\"Unable to find browser, Check EnvrionrmentData.properties file\");\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tAssert.fail(\"Unable to find browser, Check EnvrionrmentData.properties file\");\r\n\t\t}\r\n\t}", "public static WebDriver initializeChromeDriver() throws Exception {\n\n\t\tFile file = null;\n\t\tChromeDriverService chromeService = null;\n\t\tString os = System.getProperty(\"os.name\").toLowerCase();\n\n\t\tif (os.contains(\"win\")){\n\t\t\t//Operating system is based on Windows\n\t\t\tfile = new File(Constants.CHROMEDRIVER_EXE);\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tthrow new Exception(\"Erro ao localizar o driver\");\n\t\t\t}\n\t\t\tchromeService = new ChromeDriverService.Builder()\n\t\t\t\t\t.usingDriverExecutable(new File(Constants.CHROMEDRIVER_EXE))\n\t\t\t\t\t.usingAnyFreePort().build();\n\n\t\t} else if (os.contains(\"x\") || os.contains(\"mac\") || os.contains(\"osx\")){\n\t\t\t//Operating system is Apple OSX based\n\t\t\tfile = new File(Constants.CHROMEDRIVER_MAC);\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tthrow new Exception(\"Erro ao localizar o driver\");\n\t\t\t}\n\t\t\tchromeService = new ChromeDriverService.Builder()\n\t\t\t\t\t.usingDriverExecutable(new File(Constants.CHROMEDRIVER_MAC))\n\t\t\t\t\t.usingAnyFreePort().build();\n\n\t\t} else if (os.contains(\"nix\") || os.contains(\"aix\") || os.contains(\"nux\")){\n\t\t\t//Operating system is based on Linux/Unix/*AIX\n\t\t\tfile = new File(Constants.CHROMEDRIVER_LINUX);\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tthrow new Exception(\"Erro ao localizar o driver\");\n\t\t\t}\n\t\t\tchromeService = new ChromeDriverService.Builder()\n\t\t\t\t\t.usingDriverExecutable(new File(Constants.CHROMEDRIVER_LINUX))\n\t\t\t\t\t.usingAnyFreePort().build();\n\t\t}\n\n\t\tchromeService.start();\n\n\t\tDesiredCapabilities capabilities = DesiredCapabilities.chrome();\n\t\tcapabilities.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, \"about:blank\");\n\n\t\tRemoteWebDriver driver = new RemoteWebDriver(chromeService.getUrl(), capabilities);\n\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\n\t\treturn driver;\n\t}", "private void setEnv(final String value) {\n\n env = StringUtils.trim(value);\n }", "public void initialization() {\n\t\t\t\n\t\t if(prop.getProperty(\"browser\").equals(\"chrome\")) {\n\t\t \t\n\t\t \tWebDriverManager.chromedriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new ChromeDriver();\n\t\t\t\t\n\t\t } else if(prop.getProperty(\"browser\").equals(\"firefox\")) {\n\t\t \t\n\t\t \tWebDriverManager.firefoxdriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new FirefoxDriver();\n\t\t\t\t \n\t\t } else if(prop.getProperty(\"browser\").equals(\"edge\")) {\n\t\t \tWebDriverManager.edgedriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new EdgeDriver();\n\t\t \t\n\t\t }\n\t\t\t\n\t }", "public GAfterSearch(WebDriver chromeDriver) {\n super.chromeDriver = chromeDriver;\n }", "@BeforeClass\n @Parameters({ \"browser\", \"url\" })\n public void startDriver(@Optional(\"chrome\") String WindowBrowser, @Optional(\"http://computer-database.herokuapp.com/computers\") String URL) {\n\n final String os = System.getProperty(\"os.name\");\n userDirectory = System.getProperty(\"user.dir\");\n Log.info(\"Starting to intialise driver\");\n Log.info(\"OS environment: \" + os);\n Log.info(\"Browser: \" + WindowBrowser);\n if (WindowBrowser.equalsIgnoreCase(BROWSERS.FIREFOX.getBrowserName())) {\n final StringBuilder geckoDriverPath = new StringBuilder();\n geckoDriverPath.append(userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\");\n if (os.contains(OS.MAC.getOsName())) {\n geckoDriverPath.append(File.separator + \"mac\" + File.separator + \"geckodriver\");\n } else if (os.contains(OS.WIN.getOsName())) {\n geckoDriverPath.append(File.separator + \"win\" + File.separator + \"geckodriver.exe\");\n }\n System.setProperty(\"webdriver.gecko.driver\", geckoDriverPath.toString());\n driver = new FirefoxDriver();\n } else if (WindowBrowser.equalsIgnoreCase(BROWSERS.CHROME.getBrowserName())) {\n final StringBuilder chromeDriverPath = new StringBuilder();\n System.out.println(userDirectory);\n chromeDriverPath.append(userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\");\n if (os.contains(OS.MAC.getOsName())) {\n chromeDriverPath.append(File.separator + \"mac\" + File.separator + \"chromedriver\");\n } else if (os.contains(OS.WIN.getOsName())) {\n chromeDriverPath.append(File.separator + \"win\" + File.separator + \"chromedriver.exe\");\n }\n System.setProperty(\"webdriver.chrome.driver\", chromeDriverPath.toString());\n driver = new ChromeDriver();\n } else if (WindowBrowser.equalsIgnoreCase(BROWSERS.SAFARI.getBrowserName())) {\n driver = new SafariDriver();\n }\n driver.manage().window().setSize(new Dimension(1440, 844));\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n BaseURl = URL;\n Log.info(\"Driver initialised successfully\");\n driver.get(BaseURl);\n Log.info(\"Opening URl: \" + URL);\n }", "@BeforeClass\r\n public void beforeClass() {\n \tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\Tuan\\\\Downloads\\\\chromedriver.exe\");\r\n \tdriver = new ChromeDriver();\r\n \tdriver.get(\"http://daominhdam.890m.com/\");\r\n\t}", "public WebDriver LaunchChromeBrowserReturnIt() {\n\t\ttry {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t\t\"/TestSuit/lib/chromedriver.exe\");\n\t\t\tdriver = new ChromeDriver(); // Launch chrome\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn driver;\n\n\t}", "@BeforeTest(description=\"Driver initilization and pre test setup\")\r\n\tpublic void BeforeTest() {\n\t\tString browser = properties.getProperty(\"browser\");\r\n\t\tString browserVersion = properties.getProperty(\"browser-version\");\r\n\t\tlog.debug(\"Setting up \"+browser + \" version : \"+browserVersion);\r\n\t\tWebDriverManager.config().setForceCache(true);\r\n\t\tif(browser.equalsIgnoreCase(\"chrome\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.chromedriver().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\tdriver = new ChromeDriver();\r\n\t\t}\r\n\t\telse if(browser.equalsIgnoreCase(\"firefox\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.firefoxdriver().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\tdriver = new FirefoxDriver();\r\n\t\t}\r\n\t\telse if(browser.equalsIgnoreCase(\"phantomjs\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.phantomjs().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.phantomjs().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.phantomjs().setup();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tCapabilities caps = new DesiredCapabilities();\r\n\t\t\t((DesiredCapabilities) caps).setJavascriptEnabled(true);\r\n\t\t\t((DesiredCapabilities) caps).setCapability(\"takesScreenshot\", true);\r\n\t\t\tdriver = new PhantomJSDriver(caps);\r\n\t\t\t\r\n\t\t\tif(properties.getProperty(\"cookies\").equalsIgnoreCase(\"clear\")) {driver.manage().deleteAllCookies();}\r\n\t\t\tdriver.manage().window().maximize();\r\n\t\t}\t\t\r\n\t}", "@Before\n public void startingTests() throws Exception {\n // from Sample 1:\n String libWithDriversLocation = System.getProperty(\"user.dir\") + \"\\\\lib\\\\\";\n System.setProperty(\"webdriver.chrome.driver\", libWithDriversLocation + \"chromedriver.exe\");\n // declaration above:\n driver = new ChromeDriver();\n\n //open page:\n driver.get(base_url);\n }", "@BeforeClass\n public static void setup() {\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\n driver = new ChromeDriver();\n wait = new WebDriverWait(driver, 10);\n util = new Util(driver, wait);\n util.login(emailAddress, pwd);\n }", "@Before\n public void start() {\n\n driver = new ChromeDriver();\n driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n //driver.manage().window().maximize();\n wait = new WebDriverWait(driver, 10);\n }", "public static void setExecutable(String executable) {\n \tGlobals.executable = executable;\n \tsetProperty(\"executable\", executable);\n }", "@BeforeMethod\n\tpublic void setUp() {\n\t\tString driverByOS = \"\";\n\t\tif (System.getProperty(\"os.name\").equals(\"Windows 10\")) {\n\t\t\tdriverByOS = \"Drivers/chromedriver.exe\";\n\t\t} \n\t\telse {\n\t\t\tdriverByOS = \"Drivers/chromedriver\";\n\t\t}\n\t\t//para saber en qué sistema Operativo estamos corriendo el proyecto.\n\t\tSystem.out.println(System.getProperty(\"os.name\"));\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", driverByOS);\n\t\t//Utilizando headless browser HB\n\t\t/*-HB\n\t\tChromeOptions chromeOptions = new ChromeOptions();\n\t\tchromeOptions.addArguments(\"--headless\");\n\t\tdriver = new ChromeDriver(chromeOptions);\n\t\tHB-*/\n\t\tdriver = new ChromeDriver();\n\t\t//driver.manage().window().maximize(); //esto es para maximizar la ventana del navegador\n\t\t//driver.manage().window().fullscreen(); //esto es para poner en fullscreen la ventana del navegador\n\t\t/*driver.manage().window().setSize(new Dimension(200,200));\n\t\tfor (int i = 0; i <= 800; i++) {\n\t\t\tdriver.manage().window().setPosition(new Point(i,i));\n\t\t}*/\n\t\t//driver.manage().window().setPosition(new Point(800,200)); //posicionando la ventana del navegador\n\t\tdriver.navigate().to(\"http://newtours.demoaut.com/\");\n\t\t//Este codigo de abajo permite abrir otra ventana en el navegador\n\t\t//JavascriptExecutor javaScriptExecutor = (JavascriptExecutor)driver;\n\t\t//String googleWindow = \"window.open('http://www.google.com')\";\n\t\t//javaScriptExecutor.executeScript(googleWindow);\n\t\t//tabs = new ArrayList<String> (driver.getWindowHandles());\n\t\t/*try {\n\t\t\tThread.sleep(5000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t//Helpers helper = new Helpers();\n\t\t//helper.sleepSeconds(4);\n\t}", "private WebDriver getDriver() {\n return new ChromeDriver();\n }", "void setStartUpExe(String s);" ]
[ "0.7723882", "0.7398326", "0.73428756", "0.71360725", "0.6831617", "0.67497164", "0.655762", "0.6532432", "0.6458216", "0.6393295", "0.6354042", "0.6163517", "0.6135367", "0.6027528", "0.6000634", "0.59527004", "0.5926993", "0.5903626", "0.5873123", "0.582797", "0.5826337", "0.5791912", "0.5771843", "0.5728147", "0.5721815", "0.5705404", "0.5687544", "0.5642733", "0.562618", "0.5613574", "0.5610875", "0.5601321", "0.5592136", "0.55691123", "0.5561555", "0.5524449", "0.5523597", "0.55108166", "0.550372", "0.5503459", "0.5464834", "0.54492116", "0.5448318", "0.5440102", "0.54181075", "0.5415379", "0.5405916", "0.5395299", "0.5392662", "0.5385184", "0.53851324", "0.53822786", "0.53748846", "0.53595924", "0.53522444", "0.53502023", "0.534652", "0.5338007", "0.53243643", "0.53226155", "0.5322295", "0.53215235", "0.53180313", "0.53162384", "0.5312293", "0.52870613", "0.5272196", "0.52686054", "0.5262584", "0.5253338", "0.524768", "0.5232321", "0.52310926", "0.52280575", "0.5226285", "0.522209", "0.52062285", "0.51965046", "0.5188713", "0.5186468", "0.5181077", "0.51746875", "0.51737624", "0.51659906", "0.5164542", "0.5161851", "0.51578575", "0.515643", "0.51554066", "0.51548636", "0.514233", "0.5135694", "0.512875", "0.5110859", "0.5106157", "0.5099551", "0.5092783", "0.5084643", "0.50810933", "0.5070703", "0.5065949" ]
0.0
-1
Script without referral of webelement
public void User_login() { driver.findElement(FB_Locators.Signin_Email).clear(); driver.findElement(FB_Locators.Signin_Email).sendKeys(username); //Script using element referral.. WebElement Password_Element=driver.findElement(FB_Locators.Signin_password); Password_Element.clear(); Password_Element.sendKeys(password); //Login button using webelemnet referral WebElement Login_btn_Element=driver.findElement(FB_Locators.Signin_btn); Login_btn_Element.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void fw_javascriptClick() {\n WrapsDriver wd = (WrapsDriver) element;\n ((JavascriptExecutor) wd.getWrappedDriver()).executeScript(\"arguments[0].click();\", element);\n }", "public void handleScript(HtmlObjects.Script t)\n {\n }", "private native void eval(String script) /*-{\n \t try {\n \t eval(\"{ var document = $doc; var window = $wnd; \"+ script + \"}\");\n \t } catch (e) {\n \t }\n \t }-*/;", "private static native void eval(String script)\n /*-{\n try {\n \t if (script != null) \n eval(\"{ var document = $doc; var window = $wnd; \"+ script + \"}\");\n } catch (e) {\n }\n }-*/;", "@Test\n public void serialization_withClickAfterwards() throws Exception {\n final String html =\n \"<html><head>\\n\"\n + \"<script>\\n\"\n + \" function foo() {\\n\"\n + \" document.getElementById('mybox').innerHTML='hello world';\\n\"\n + \" return false;\\n\"\n + \" }\\n\"\n + \"</script></head>\\n\"\n + \"<body><div id='mybox'></div>\\n\"\n + \"<a href='#' onclick='foo()' id='clicklink'>say hello world</a>\\n\"\n + \"</body></html>\";\n final HtmlPage page = loadPageWithAlerts(html);\n assertEquals(\"\", page.getElementById(\"mybox\").getTextContent());\n\n final WebClient clientCopy = clone(page.getWebClient());\n final HtmlPage pageCopy = (HtmlPage) clientCopy.getCurrentWindow().getTopWindow().getEnclosedPage();\n pageCopy.getElementById(\"clicklink\").click();\n assertEquals(\"hello world\", pageCopy.getElementById(\"mybox\").getTextContent());\n }", "private static native void eval(String script)\n /*-{\n try {\n if (script == null) return;\n $wnd.eval(script);\n } catch (e) {\n }\n }-*/;", "@Override\n\tprotected void initScript(Element e, Script parent) throws ScriptException {\n\n\t}", "public static void Test() {\n\t\tString browserSetting = \"{\\\"capabilities\\\":{\\\"browserName\\\":\\\"chrome\\\"},\\\"options\\\":{\\\"args\\\":[\\\"--no-sandbox\\\",\\\"--autoplay-policy=no-user-gesture-required\\\"]},\\\"server\\\":\\\"E:/Tool/MousePos.exe\\\"}\";\n\t\tString scritpPath = \"C:\\\\Program Files\\\\LogiGear\\\\TestArchitect\\\\binclient\\\\data\\\\action_script\\\\webdriver_javascript.txt\";\n\n\t\ttry {\n\t\t\tString url = \"http://192.168.168.103:8080/HTML_5/CustomizeControls/controls.html?id=Audio\";\n\t\t\tString serPath = \"C:\\\\text.exe\";\n\t\t\tObject[] result = WDServerConnection.initializeWebDriver(\"chrome\", browserSetting,serPath,scritpPath,url);\n\t\t\tRemoteWebDriver remote = (RemoteWebDriver)result[1];\n\n\t\t\tString[] propertyName = new String[] {\"id\"};\n\t\t\tString[] propertyValue = new String[] {\"audio_ControlTest\"};\n\t\t\t\n\t\t\tWDPageHandler.navigate(remote,\"http://192.168.168.103:8080/HTML_5/CustomizeControls/controls.html?id=Audio\",\"\");\n\t\t\tWebElement ele = WDPageHandler.getElementByProperties(remote, propertyName, propertyValue, true, 30, \"id-1\");\n\t\t\t\n\t\t\t//String script = \"media_play = function media_play(a,b){var d=Number(b);var c=d/1;if(c>=0){a.currentTime=c}a.play();}; media_play(arguments[0],arguments[1]);\";\n\t\t\t//script = \"document.getElementById('audio_ControlTest').play()\";\n\t\t\t//WDElement.executeScript(remote, script);\n\t\t\t//WDElement.executeScript(remote, script, ele, \"10\");\n\t\t\t\n\t\t\tWDElementHandler.Media_play(ele, 0);\n\t\t\t//WDElementHandler.setText(ele, \"hello world !\");\n\t\t\t//String value = WDElementHandler.getNativeProperty(ele, \"id\");\n\t\t\tSystem.out.println(\"\");\n\t\t\tWDPageHandler.quitWebDriver(remote);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// *[@id=\"lst-ib\"]\n\t}", "public HTMLScriptElementImpl( HTMLDocumentImpl owner, String name )\n {\n super( owner, name );\n }", "@Override\r\npublic void beforeScript(String arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "@Override\r\n public void beforeScript(final String arg0, final WebDriver arg1) {\n\r\n }", "public static void Javascript() {\n\n\t}", "HtmlPage clickSiteLink();", "@Test\r\n public void findShadowDOMWithoutSeleniumFindElement () {\n JavascriptExecutor jsExecutor\r\n = (JavascriptExecutor) driver;\r\n\r\n // Execute JavaScript To Return A WebElement\r\n WebElement bookSearchField = (WebElement) jsExecutor.executeScript(\r\n \"return document.querySelector(\\\"body > book-app\\\").\" +\r\n \"shadowRoot.querySelector(\\\"#input\\\")\");\r\n\r\n // Perform An Action On The WebElement\r\n bookSearchField.sendKeys(\"Shadow DOM Without Find Element\");\r\n }", "public void executeScript() throws Exception {\n\t\tnav.SearchFor(\"\");\n\t\tnav.ClickNavigationLinks(TopNavLinks.WOMENSAPPAREL);\n\t\tprp.RefineByColor(\"Black\");\n\t\tprp.RefineBySize(\"Medium\");\n\t\tprp.ClickFirstItem();\n\t}", "public String getScript() { \n\t\treturn null;\n\t}", "@Override\r\n\tpublic void beforeScript(String arg0, WebDriver arg1) {\n\t\t\r\n\t}", "@Override\r\npublic void beforeClickOn(WebElement arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "protected void clickJs(WebElement elemento) {\n\t\texecuteJavaScript(elemento, \"click()\");\n\t}", "public void clickonFullyAutomaticFrontLoad() {\n\t\t\n\t}", "@Override\r\n public void beforeClickOn(final WebElement arg0, final WebDriver arg1) {\n\r\n }", "public void SEITE() {\n //<< new strExec\n mVar strExec = m$.var(\"strExec\");\n m$.newVar(strExec);\n //<< \n //<< set strExec = \"document.WWW.target=''; document.WWW.YINSEITE.value=''; document.WWW.YSEITE.value='\"_$$$WWW124ChangeoversWithOnClick(YA)_\"'; SAVENOW(2);\"\n strExec.set(mOp.Concat(mOp.Concat(\"document.WWW.target=''; document.WWW.YINSEITE.value=''; document.WWW.YSEITE.value='\",include.WWWConst.$$$WWW124ChangeoversWithOnClick(m$,m$.var(\"YA\"))),\"'; SAVENOW(2);\"));\n //<< do Button(strExec)\n m$.Cmd.Do(\"Button\",strExec.get());\n //<< \n //<< QUIT\n return;\n }", "private boolean temNoScript() {\r\n\t\tif (!procurouNoScript) {\r\n\t\t\ttemnoscript = regras.verificaNoscript(codHTML);\r\n\t\t\tprocurouNoScript = true;\r\n\t\t}\r\n\t\treturn temnoscript;\r\n\t}", "@Override\n\tpublic void beforeScript(String arg0, WebDriver arg1) {\n\n\t}", "@Override\r\npublic void afterScript(String arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "HtmlPage clickLink();", "private void clearScript() {\n bitField0_ = (bitField0_ & ~0x00000002);\n script_ = getDefaultInstance().getScript();\n }", "@Override\r\n public void afterScript(final String arg0, final WebDriver arg1) {\n\r\n }", "public static void main(String[] args) throws InterruptedException {\n\r\n\t\tWebDriver driver = new FirefoxDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"file:///C:/Users/MALIKMUHEEM/Desktop/Honda_new/Se_2019/html/disabled.html\");\r\n\t\t//converting subclass object to super class object \r\n\t\t//create subclass object and there only convert it - UPCASTING.\r\n\t\t//sub-class object, parent class referrance variable.\r\n\t\tJavascriptExecutor js = (JavascriptExecutor) driver;\r\n\t\tString stmt = \"document.getElementById('un').value='MM'\";\r\n\t\tjs.executeScript(stmt);\r\n\t\tThread.sleep(2000);\r\n\t\tString stmt1 = \"document.getElementById('un').value=' '\";\r\n\t\tjs.executeScript(stmt1);\r\n\t\t\r\n\t}", "public ScriptCit getScript(){\n return chapVerse;\n }", "@Test\n public void fixedInHtmlUnit() throws Exception {\n final String html = \"<html></html>\";\n final HtmlPage page = loadPage(html);\n final Window topScope = ((Window) page.getEnclosingWindow().getScriptObject());\n topScope.put(\"str\", topScope, str_);\n topScope.put(\"text\", topScope, text_);\n topScope.put(\"expected\", topScope, expected_);\n page.executeJavaScript(src_);\n }", "public String getDisplayScript() {\n/* 577 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "void bypass();", "HtmlPage clickSiteName();", "public void clickSalvar (){driver.findElement(botaoSalvar).click();}", "@Override\r\npublic void start(Stage arg0) throws Exception {\n\t\r\n\t webComponent = new WebView();\r\n webEngine=webComponent.getEngine();\r\n \r\n /* JSObject jsobj = (JSObject)webEngine.executeScript(\"window\");\r\n jsobj.setMember(\"android\", new HelloWorld());*/\r\n \r\n// Util.list.add(url);\r\n // loadUrl(url);\r\n // webComponent.getEngine().getLoadWorker().stateProperty().add\r\n System.out.println(\"RUN2\");\r\n webEngine.getLoadWorker().stateProperty()\r\n .addListener((obs, oldValue, newValue) -> {\r\n if (newValue == Worker.State.SUCCEEDED) {\r\n\r\n JSObject jsobj = (JSObject) webEngine.executeScript(\"window\");\r\n jsobj.setMember(\"android\", new HelloWorld());\r\n }\r\n });\r\n\t mainFrame = new ApplicationFrame(webEngine,webComponent);\r\n mainFrame.setVisible(true);\r\n System.out.println(\"RUN\");\r\n}", "public void Clickweb(View v){\n }", "@Override\n protected void afterActivityLaunched() {\n onWebView().forceJavascriptEnabled();\n }", "SeleniumComponent parent();", "@Override\n public void onClick(View v) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n doClickOnButtonWebView();\n }\n });\n }", "public void clickOnHardCopyButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnHardCopyButton.click();\n\n \t}", "@Override\n\tpublic boolean isScriptable() {\n\t\treturn false;\n\t}", "public String getScript() {\n/* 256 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void webControlLoaded() {\n scriptExecutor.setJavaScriptMember(\"app\", this);\n }", "public String getIdentification() {\n return \"richfaces-selenium-script-id\" + this.javaScript.hashCode();\n }", "public void clickJS(WebElement element) {\n\t\tgetExecutor().executeScript(\"arguments[0].click();\", element);\n\t\t\n\t}", "public static void main(String[] args) {\nWebDriver driver=new FirefoxDriver();\ndriver.get(\"http://jqueryui.com/tooltip/\");\ndriver.switchTo().frame(0);\nSleeper.sleepTightInSeconds(10);\n\tActions action=new Actions(driver);\n\tWebElement TTip=driver.findElement(By.id(\"age\"));\n\taction.moveToElement(TTip).build().perform();\n\t\n\n\t}", "@Override\r\npublic void afterClickOn(WebElement arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "java.lang.String getClickURL();", "@DISPID(-2147412104)\n @PropGet\n java.lang.Object onclick();", "@Override\n public void onAdRewardConfirmation(final String target) {\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdRewardConfirmation', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n }", "public void clickOnNotNowBtn() throws Exception {\n\t\tgetHomepagenotnowbtn().waitForVisible();\n\t\tJavascriptExecutor executor = (JavascriptExecutor) driver;\n\t\texecutor.executeScript(\"arguments[0].click()\",homepagenotnowbtn);\n\t\tSystem.out.println(\"alert is closed\" + homepagenotnowbtn);\n\t\twaitForPageToLoad();\n\t}", "@Override\r\n\tpublic void afterScript(String arg0, WebDriver arg1) {\n\t\t\r\n\t}", "public void triggerPopup();", "void clickSomewhereElse();", "public void execute(Element element) {\n if (\"true\".equals(element.getStyle().getProperty(\"visible\"))\n && element.getState().isRelease()) {\n String method = element.getStyle().getProperty(\"onClick\");\n String controller = element.getUI().getController();\n if (method != null && controller != null) {\n UIUtil.invokeClickMethod(controller, method);\n }\n }\n }", "public void userAction(ElementInstance ei) {\r\n\t\t\r\n\t}", "private static Object executeJavascript(WebDriver driver, String script) {\n System.out.println(\"Executing javascript: \" + script);\n return ((JavascriptExecutor) driver).executeScript(script);\n }", "public void run() throws Exception {\n\t\tweb.window(2,\n\t\t\t\t\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window}}\").navigate(\n\t\t\t\t\t\t\"http://riyoramgbm02.maaden.com:8050/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE\");\n\t\tweb.window(4,\n\t\t\t\t\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window}}\").waitForPage(180, true);\n\t\t\n\t\tweb.textBox(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_input_text_unamebean}}\").click();\n\t\t\n\t\tweb.textBox(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_input_text_unamebean}}\").setText(\"PEETHAMBARANS\");\n\t\t\t\t\n\t\tweb.textBox(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_input_password_pwdbean}}\")\n\t\t\t\t.setPassword(deobfuscate(\"vWeMH+MT9Gy3Y8SojsL+Mg==\"));\n\t\n\t\tweb.button(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_button_SubmitButton}}\").click();\n\t\tweb.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window}}\").waitForPage(180, true);\n\t\t\n\t\tweb.link(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.MWSPC_PURCHASING_SUPERUSE}}\").click();\n\t\tweb.window(17,\n\t\t\t\t\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window}}\").waitForPage(180, true);\n\t\n\t\n\t\tweb.link(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.Purchase_Order}}\").click();\n\t\tweb.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window}}\").waitForPage(180, true);\n\t\t\n\t\tweb.link(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.Purchase_Order_Summary}}\").click();\n\t\tweb.window(28,\n\t\t\t\t\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.web_window_1}}\")\n\t\t\t\t.waitForPage(180,true);\n\t\tforms.captureScreenshot(33);\n\t\t\n\t\t//forms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_FIND_OPERATING_UNIT_0}}\").setFocus();\n\t\tif(forms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_FIND_PO_NUM_0}}\").exists(60, TimeUnit.SECONDS)){\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_FIND_PO_NUM_0}}\").setText(\"741903172\");\n\t\t}\n\t\t\n\t\tString PO_Number = forms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_FIND_PO_NUM_0}}\").getText();\n\t\tinfo(\"PO_Number ->\"+PO_Number);\n\t\t\n\t\tforms.button(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_button_FIND_FIND_0}}\").click();\n\t\tforms.captureScreenshot(38);\n\t\n\t\tforms.button(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.Lines}}\").click();\n\t\tforms.captureScreenshot(41);\n\t\t\n\t\tforms.button(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.Shipment}}\").click();\n\t\tforms.captureScreenshot(44);\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_PO_NUM_0}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_RELEASE_}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_LINE_NUM}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_SHIPMENT}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_ITEM_NUM}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_UNIT_MEA}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_SHIP_TO_}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_SHIPMENT_1}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_START_DA}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_END_DATE}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY}}\").setFocus();\n\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY_1}}\").invokeSoftKey(\"NEXT_FIELD\");\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY_1}}\").setFocus();\n\t\tinfo(\"Quantity Due is : \"+forms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY_1}}\").getText() );\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY_2}}\").setFocus();\n\t\tinfo(\"Quantity Received is : \"+forms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_SHIPMENTS_FOLDER_QUANTITY_2}}\").getText());\n\t\tforms.captureScreenshot();\n\t\tforms.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_window_SHIPMENTS_FOLDER}}\").close();\n\t\tforms.captureScreenshot(63);\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_LINES_FOLDER_PURCHASING_O}}\").setFocus();\n\t\t\n//\t\tforms.button(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.Shipment}}\").click();\n//\t\t\n//\t\tforms.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_window_SHIPMENTS_FOLDER}}\").activate(true);\n//\t\tforms.captureScreenshot(68);\n//\t\t\n//\t\tforms.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_window_SHIPMENTS_FOLDER}}\").close();\n//\t\tforms.captureScreenshot(71);\n//\t\t\n\t\tforms.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_window_LINES_FOLDER}}\").close();\n\t\tforms.captureScreenshot(74);\n\t\t\n\t\tforms.window(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_window_HEADERS_FOLDER}}\").close();\n\t\tforms.captureScreenshot(77);\n\t\t\n\t\tforms.textField(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_textField_FIND_OPERATING_UNIT_0}}\").setFocus();\n\t\tforms.captureScreenshot(80);\n\t\t\n\t\tforms.close(81);\n\t\tforms.captureScreenshot(83);\n\t\t\n\t\tforms.choiceBox(\"{{obj.PO_QtyReceived_QtyDue_EligibilityVerification_00122.forms_choiceBox}}\").clickButton(\"OK\");\n\t\t\n\t\t\n\n\t}", "void browserMethod();", "public WebElement apply(WebDriver arg0) //We are defining the function taking the WebDriver as input \n {\n WebElement ele = arg0.findElement(By.xpath(spath));\n return ele;\n }", "@When ( \"I navigate to the Assign Prescription page\" )\r\n public void navigatePrescriptionOV () {\r\n ( (JavascriptExecutor) driver ).executeScript( \"document.getElementById('assignprescription').click();\" );\r\n }", "private void m48553b(String str) {\n WebView webView = (WebView) this.f34939a.get();\n if (webView != null) {\n StringBuffer stringBuffer = new StringBuffer(XDLJsInterface.JAVASCRIPT_PREFIX);\n stringBuffer.append(\"if(!!\");\n stringBuffer.append(this.f35123d);\n stringBuffer.append(\"){\");\n stringBuffer.append(this.f35123d);\n stringBuffer.append(\"(\");\n stringBuffer.append(str);\n stringBuffer.append(\")}\");\n String stringBuffer2 = stringBuffer.toString();\n SLog.m48368v(\"openSDK_LOG.SecureJsListener\", \"-->callback, callback: \" + stringBuffer2);\n webView.loadUrl(stringBuffer2);\n }\n }", "public void referToSpecialist(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "@Test (dataProvider = \"ignoreNoscriptElementsDataProvider\")\r\n public void ignoreNoscriptElements(boolean ignoreNoscriptElements) throws Exception\r\n {\n final String HTML = \"\\n <html>\\n <head>\\n <title>NOSCRIPT</title>\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\">\\n <script type=\\\"text/javascript\\\">\\n alert(\\\"Hello, world!\\\");\\n </script>\\n </head>\\n <body>\\n <noscript><p>Your browser does not support JavaScript!</p></noscript>\\n </body>\\n </html>\";\r\n\r\n HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();\r\n htmlLoadOptions.setIgnoreNoscriptElements(ignoreNoscriptElements);\r\n\r\n Document doc = new Document(new MemoryStream(Encoding.getUTF8().getBytes(HTML)), htmlLoadOptions);\r\n doc.save(getArtifactsDir() + \"HtmlLoadOptions.IgnoreNoscriptElements.pdf\");\r\n //ExEnd\r\n\r\n Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(getArtifactsDir() + \"HtmlLoadOptions.IgnoreNoscriptElements.pdf\");\r\n TextAbsorber textAbsorber = new TextAbsorber();\r\n textAbsorber.Visit(pdfDoc);\r\n\r\n Assert.AreEqual(ignoreNoscriptElements ? \"\" : \"Your browser does not support JavaScript!\", textAbsorber.Text);\r\n }", "public HTMLScriptElement getElementElMenu() { return this.$element_ElMenu; }", "public HTMLScriptElement getElementElMenu() { return this.$element_ElMenu; }", "public HTMLScriptElement getElementElMenu() { return this.$element_ElMenu; }", "@Override\r\n public void afterClickOn(final WebElement arg0, final WebDriver arg1) {\n\r\n }", "public void addedToDom() {\n activateTab();\n }", "public Element getWanted(String whe, String what){\r\n\t\treturn FactoryManager.getFactoryManager().getScriptManager()\r\n\t\t.getReadScript().getElementXML(whe, what);\r\n\t}", "public void handleCFScript(HtmlObjects.CFScript t)\n {\n }", "public WebElement getElement() {\n\t\treturn null;\r\n\t}", "public static String getScript(String localeID) {\n/* 265 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n\tpublic void afterScript(String arg0, WebDriver arg1) {\n\n\t}", "Script createScript();", "byte[] get_destination_script();", "@Override\r\npublic void beforeChangeValueOf(WebElement arg0, WebDriver arg1, CharSequence[] arg2) {\n\tSystem.out.println(\"as\");\r\n}", "public Builder setScript(String script) {\n/* 1583 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "org.apache.xmlbeans.XmlString xgetClickURL();", "@Override\n public void onAdClicked(final String target){\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n String event = \"javascript:cordova.fireDocumentEvent('onAdClicked', {'zone':'\"+target+\"'})\";\n webView.loadUrl(event);\n }\n });\n }", "private void scriptStep( ExpressionNode nd, VMState vms ) {\n Assert.check( vms.top().at( nd ) == null ) ;\r\n \r\n // Clear the selection\r\n vms.top().setSelected( null ) ;\r\n Assert.check(nd instanceof OpAbsFuncCall);\r\n Assert.check( ((OpAbsFuncCall)nd).isStatic() );\r\n switch (op_code){\r\n case SCRIPT_RELAY: {\r\n ScriptManager.getManager().relayCall(nd,vms);\r\n putVoidResult( nd, vms) ;\r\n break; }\r\n case SCRIPT_RELAY_RTN_INT: {\r\n int n = ScriptManager.getManager().relayCallRtnInt(nd,vms);\r\n putIntResult( nd, vms, n) ;\r\n break; }\r\n case SCRIPT_RELAY_RTN_DOUBLE: {\r\n double x = ScriptManager.getManager().relayCallRtnDouble(nd,vms);\r\n putFloatResult( nd, vms,x) ;\r\n break; }\r\n case SCRIPT_SNAPSHOT: {\r\n ScriptManager.getManager().snapShot(nd,vms);\r\n putVoidResult( nd, vms) ;\r\n break; } \r\n case SCRIPT_REFERENCE : {\r\n ScriptManager.getManager().setReference(nd,vms);\r\n putVoidResult( nd, vms) ;\r\n break; } \r\n case SCRIPT_COMPARE_REF:{\r\n boolean value = ScriptManager.getManager().compareReference(nd,vms);\r\n putIntResult( nd, vms, value ? 1 : 0 ) ;\r\n break; } \r\n/* case SCRIPT_COMPARE_DATUMS: {\r\n boolean value = ScriptManager.getManager().compareDatums(nd,vms);\r\n putIntResult( nd, vms, value ? 1 : 0 ) ;\r\n break; } */ \r\n }\r\n/* \r\n // New datum on scratch\r\n Clc_ASTUtilities util\r\n = (Clc_ASTUtilities) vms.getProperty(\"ASTUtilities\") ;\r\n AbstractDatum d\r\n = util.scratchDatum(nd.get_type(), vms) ;\r\n \r\n vms.top().map(nd, d) ;\r\n */ \t\r\n }", "@SuppressLint({\"SetJavaScriptEnabled\"})\n public void a() {\n this.f20062a = new WebView(getContext());\n this.f20062a.setBackgroundColor(0);\n this.f20062a.setWebViewClient(new a());\n this.f20062a.getSettings().setUseWideViewPort(false);\n this.f20062a.getSettings().setJavaScriptEnabled(true);\n this.f20062a.addJavascriptInterface(this, \"ChatWebItemView\");\n WebSettings settings = this.f20062a.getSettings();\n if (TextUtils.isEmpty(this.f20064c)) {\n this.f20064c = settings.getUserAgentString() + SQLBuilder.BLANK + al.a().b();\n }\n settings.setUserAgentString(this.f20064c);\n addView(this.f20062a, new FrameLayout.LayoutParams(-1, com.garena.android.appkit.tools.b.d(R.dimen.dp150)));\n }", "public void executeScript(String js) {\n try {\n this.webView.getEngine().executeScript(js);\n } catch (RuntimeException ex) {\n ex.printStackTrace();\n if (!this.pdfJsLoaded) this.toExecuteWhenPDFJSLoaded += String.format(\"%s;\", js);\n }\n }", "protected Page click() throws IOException {\n\n if( isDisabled() == true ) {\n return getPage();\n }\n\n final String onClick = getOnClickAttribute();\n final HtmlPage page = getPage();\n if( onClick.length() == 0 || page.getWebClient().isJavaScriptEnabled() == false ) {\n return doClickAction();\n }\n else {\n final ScriptResult scriptResult = page.executeJavaScriptIfPossible(\n onClick, \"onClick handler for \"+getClass().getName(), true, this);\n scriptResult.getJavaScriptResult();\n return doClickAction();\n }\n }", "void startScript() {\n\n\t\tif (UIHANDLER_WS_NAME.equalsIgnoreCase((String) core.readDataPool(\n\t\t\t\tDP_ACTUAL_UIHANDLER, preferences.getString(\n\t\t\t\t\t\tPropName_UIHander, UIHANDLER_WS_NAME)))) {\n\n\t\t\t// startButtonLabel.setIcon(resourceMap.getIcon(\"startButtonLabel.icon\"));\n\t\t\tcore.getSystemIF().openBrowser();\n\t\t} else {\n\t\t\tArchive ActiveArchive = (Archive) mSourceSpinner.getSelectedItem();\n\t\t\tif (ActiveArchive == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpreferences\n\t\t\t\t\t.edit()\n\t\t\t\t\t.putString(PropName_ScriptName,\n\t\t\t\t\t\t\tActiveArchive.getFileName()).commit();\n\t\t\tcore.writeDataPool(DP_ACTIVE_ARCHIVE, ActiveArchive);\n\t\t\tcore.startScriptArchive(ActiveArchive);\n\n\t\t\t// ----------------------------------------------------------\n\t\t\t// prepare the \"load Script\" message\n\t\t\tDiagnose.showDialog = true;\n\t\t\t// the following trick avoids a recreation of the Diagnose\n\t\t\t// TapActivity as long as the previous created one is still\n\t\t\t// in memory\n\t\t\tIntent i = new Intent();\n\t\t\ti.setClass(MainActivity.this, DiagnoseTab.class);\n\t\t\ti.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\t\tstartActivity(i);\n\n\t\t}\n\n\t}", "@Override\n\tpublic void beforeClickOn(WebElement element, WebDriver driver) {\n\t\t\n\t}", "public WebElement highlight(WebElement element){\nfor(int i=0; i<2; i++) {\n WrapsDriver wrappedElement = (WrapsDriver) element;\n JavascriptExecutor executor = (JavascriptExecutor) wrappedElement.getWrappedDriver();\n waitSec(0.4);\n executor.executeScript(\"arguments[0].setAttribute('style', arguments[1]);\", element, \"color: purple; border: 2px solid LightCyan;background: PaleTurquoise ;\");\n waitSec(0.4);\n executor.executeScript(\"arguments[0].setAttribute('style', arguments[1]);\", element, \"\");\n\n}\nreturn element;\n }", "private String getJGrowlAfterOpenJavaScript() {\n StringBuilder javaScript = new StringBuilder();\n javaScript.append(\"function(e,m,o) {\");\n javaScript.append(\"var link = e.find('a');\");\n javaScript.append(\"if (link.size() > 0) {\");\n// javaScript.append(\"window.open(link.attr('href'), '_blank');\");\n javaScript.append(\"link[0].click();\");\n javaScript.append(\"}\");\n javaScript.append(\"}\");\n\n return javaScript.toString();\n }", "public WebElement apply(WebDriver driver ) {\n return driver.findElement(By.xpath(\"/html/body/div[1]/section/div[2]/div/div[1]/div/div[1]/div/div/div/div[2]/div[2]/div/div/div/div/div[1]/div/div/a/i\"));\n }", "public static String _takeselfie_click() throws Exception{\nreturn \"\";\n}", "protected String getNoScriptMessage() {\n return \"You have to enable javascript in your browser to use an application built with Vaadin.\";\n }", "public void beforeScript(String script, WebDriver driver) {\n\t\t\n\t}", "public void beforeScript(String script, WebDriver driver) {\n\t\t\r\n\t}", "public void beforeScript(String script, WebDriver driver) {\n\t\t\r\n\t}", "public void removeScript() {\n scriptHistory = null;\n }", "void loadScript(URL url) throws IOException, ScriptRunnerException;", "@Override\n\tpublic String getShinyStringUIScript() {\n\t\treturn null;\n\t}", "public WebElement() {}", "public static void main(String[] args) {\n System.setProperty(\"webdriver.chrome.driver\", \"/Users/bulut/Selenium/chromedriver\");\n WebDriver driver = new ChromeDriver();\n driver.get(\"https://testpages.herokuapp.com/styled/index.html\");\n\n driver.findElement(By.id(\"alerttest\")).click();\n\n String URL = driver.getCurrentUrl();\n System.out.println(URL);\n\n\n }", "private static void initFX(final JFXPanel fxPanel) {\n Group group = new Group();\n Scene scene = new Scene(group);\n fxPanel.setScene(scene);\n\n webView = new WebView();\n\n group.getChildren().add(webView);\n webView.setMinSize(300, 300);\n webView.setPrefSize(850, 600);\n webView.setMaxSize(850, 600);\n\n webView.getEngine().setJavaScriptEnabled(true); //allows us to run JS code\n\n //START\n webView.getEngine().setOnAlert(new EventHandler<WebEvent<String>>() {\n @Override\n public void handle(WebEvent<String> event) {\n JOptionPane.showMessageDialog(\n fxPanel,\n event.getData(),\n \"Alert Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n });\n\n webView.getEngine().getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) ->\n {\n JSObject window = (JSObject) webView.getEngine().executeScript(\"window\");\n window.setMember(\"java\", bridge2);\n webView.getEngine().executeScript(\"console.log = function(message)\\n\" +\n \"{\\n\" +\n \" java.log(message);\\n\" +\n \"};\");\n });\n //END\n\n // Obtain the webEngine to navigate\n WebEngine webEngine = webView.getEngine();\n //solves Captcha problem\n //webEngine.setUserAgent(\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36\");\n webEngine.load(\"https://yandex.ru\"); //sets the start page for the application\n }" ]
[ "0.59155446", "0.5781837", "0.5770972", "0.5716749", "0.551306", "0.54230446", "0.54110557", "0.53301924", "0.5282985", "0.5258561", "0.52493995", "0.52393436", "0.5233133", "0.51926154", "0.5181493", "0.5162622", "0.51584744", "0.51327235", "0.5110947", "0.50939125", "0.5074662", "0.50595033", "0.5050012", "0.5017601", "0.50161314", "0.50065273", "0.49966437", "0.4989699", "0.49691096", "0.49456874", "0.49255097", "0.4896257", "0.48950094", "0.4883163", "0.4880214", "0.4873811", "0.4867974", "0.48643312", "0.4863897", "0.4862936", "0.48588815", "0.48583457", "0.48483682", "0.4821334", "0.48197842", "0.48071957", "0.48013666", "0.479708", "0.47924864", "0.47914147", "0.47899818", "0.47838148", "0.4781481", "0.47794968", "0.47726512", "0.47621262", "0.47594014", "0.47485572", "0.47427082", "0.4727763", "0.47126615", "0.47108433", "0.4702756", "0.46955648", "0.46939462", "0.46896476", "0.46896476", "0.46896476", "0.46859992", "0.4676643", "0.4676592", "0.46631518", "0.4657563", "0.46523547", "0.46433255", "0.46416482", "0.46391457", "0.4636595", "0.46331897", "0.4631129", "0.46259743", "0.4619147", "0.4614095", "0.4612787", "0.460745", "0.46039584", "0.46017924", "0.4601435", "0.46001846", "0.4594627", "0.45928466", "0.45857087", "0.45785844", "0.45764193", "0.45764193", "0.45761752", "0.45754126", "0.45691222", "0.4568408", "0.45636588", "0.45633638" ]
0.0
-1
no response at the mo'
public void vetoableAction(PermissibleActionEvent evt) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void nop() throws Exception {\n reply_ok();\n }", "@Test\n public void testProcessNoResponse() {\n // NOTE: this json file is a RESPONSE, not a request\n String request = ResourceUtils.getResourceAsString(\"org/onap/policy/simulators/appclcm/appc.lcm.success.json\");\n assertNotNull(request);\n\n server.onTopicEvent(CommInfrastructure.NOOP, MY_TOPIC, request);\n\n verify(sink, never()).send(any());\n }", "void faild_response();", "public void __getReplyNoReport() {\n __getReply(false);\n }", "private void prepareNoResponse() {\n when(mSentenceDataRepository.getTodaysSentenceResponse()).thenReturn(null);\n }", "private void msgNoServerConnection() {\r\n\thandler.sendEmptyMessage(1); // enviar error al cargar\r\n }", "public void cbEmptyResponse()\n {\n }", "boolean hasInitialResponse();", "public void noError()\n\t\t\t{\n\t\t\t\tsend(\"<error />\", false);\n\t\t\t}", "private void clearResponse() { response_ = null;\n \n }", "private void clearResponse() { response_ = null;\n \n }", "protected void responseFail(){\n\t\tqueue.clear();\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "public void startResponse()\n\t\t\t{\n\t\t\t\tsend(\"<response>\", false);\n\t\t\t}", "Response mo35726n0() throws IOException;", "protected void reply_no() throws java.io.IOException {\n byte[] no = PushCacheProtocol.instance().noPacket();\n _socket.getOutputStream().write(no, 0, no.length);\n }", "@Test\n public void noConfiguration() throws IOException {\n initJadler();\n \n try {\n onRequest().respond().withStatus(EXPECTED_STATUS);\n assertExpectedStatus();\n }\n finally {\n closeJadler();\n }\n }", "private boolean noMessage() {\n\t\treturn nbmsg==0;\n\t}", "@Override\n\t\t\tprotected Response<String> parseNetworkResponse(\n\t\t\t\t\tNetworkResponse response) {\n\n\t\t\t\treturn null;\n\t\t\t}", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "@Override\n\tpublic boolean isResponseExpected() {\n\t\treturn false;\n\t}", "private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}", "public void noReturn() {\n\t\tSystem.out.println(\"noReturn method will not returing any thing\");\n\t}", "public boolean isResponse(){\n return true;\n }", "private Response() {}", "private Response() {}", "@Test\n public void negativeScenario(){\n // when().get(\"http://34.223.219.142:1212/ords/hr/employees/1234\")\n // .then().statusCode(404);\n Response response = when().get(\"http://34.223.219.142:1212/ords/hr/employees/1234\");\n assertEquals(response.statusCode(),404);\n assertTrue(response.asString().contains(\"Not Found\"));\n response.prettyPrint();\n\n }", "@Override\n\t\tprotected Response<JSONObject> parseNetworkResponse(NetworkResponse arg0) {\n\t\t\treturn null;\n\t\t}", "public void __noop() {\n __send(__buildMessage(FTPCommand.getCommand(32), null));\n __getReplyNoReport();\n }", "@Override\n\t\t\tpublic void handle(Response response) throws Exception\n\t\t\t{\n\t\t\t\tif(response ==null){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(response.getStatusCode()==200){\n\t\t\t\t\tSystem.out.println(\"push seccuess\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "private void clearResponse() { response_ = null;\n bitField0_ = (bitField0_ & ~0x00000001);\n }", "public static void informNullResponse(Context context) {\n Log.e(context.getClass().getSimpleName(), \"Problem on client side\");\n Toast.makeText(context, context.getString(R.string.server_unreachable_error),\n Toast.LENGTH_SHORT).show();\n }", "private void clearResponse() { response_ = null;\n bitField0_ = (bitField0_ & ~0x00000002);\n }", "@Override\r\n public boolean isRequest() {\n return false;\r\n }", "@Override\n\tpublic String ping() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Response invoke() {\n\t\treturn null;\r\n\t}", "@Test\n\tpublic void testResponse() {\n\t\tquestions.setResponse(\"No\");\n\t\tassertEquals(\"No\",questions.getResponse());\n\t}", "@Override\n public Answer executeRequest(Command cmd) {\n return null;\n }", "@Override\n\tpublic String answer() {\n\t\treturn null;\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tno();\n\t\t\t\t}", "public boolean hasResponse() {\n return response_ != null;\n }", "public void get(HttpRequest request, HttpResponse response) {\n\t\tresponse.setStatus(HttpStatus.SERVER_ERROR_NOT_IMPLEMENTED);\n\t\tresponse.write(\" \");\n\t}", "@Test\n public void bogusReplySilentlyIgnored() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.sendFrame().headers(false, 41, TestUtil.headerEntries(\"a\", \"android\"));\n peer.sendFrame().ping(false, 2, 0);\n peer.acceptFrame();// PING\n\n peer.play();\n // play it back\n connect(peer);\n // verify the peer received what was expected\n MockHttp2Peer.InFrame ping = peer.takeFrame();\n Assert.assertEquals(2, ping.payload1);\n }", "private Response() {\n initFields();\n }", "public void reset() {\n this.response.reset();\n }", "public void run() {\n req.response().end(\"0\"); // Default response = 0\n }", "@Override\n\t\t\tpublic boolean hasError(ClientHttpResponse response) throws IOException {\n\t\t\t\treturn false;\n\t\t\t}", "public void noFlights();", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "@Override public void action() {\n //Do Nothing\n assert(checkRep());\n }", "@Override\n\tpublic String init_request() {\n\t\treturn null;\n\t}", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "private void sendNoSuchService(HttpRequest request, HttpResponse response,\n\t\t\tString service) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_SERVICE_UNAVAILABLE );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The service you requested is not known to this server!\" );\n\t\t\n\t\tconnector.logError (\"Service not found: \" +service);\n\t}", "protected abstract void askResponse();", "public TOUReadResponse()\r\n\t{\r\n\t}", "@Override\n\tpublic void sendResponse() {\n\t\t\n\t}", "private void clearSeenAToServer() {\n if (reqCase_ == 15) {\n reqCase_ = 0;\n req_ = null;\n }\n }", "public WebResponse()\n\t{\n\t\tthis.httpServletResponse = null;\n\t}", "@Override\r\n protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {\r\n try {\r\n if (response.data.length == 0) {\r\n byte[] responseData = \"{}\".getBytes(\"UTF8\");\r\n response = new NetworkResponse(response.statusCode, responseData, response.headers, response.notModified);\r\n }\r\n } catch (UnsupportedEncodingException e) {\r\n e.printStackTrace();\r\n }\r\n return super.parseNetworkResponse(response);\r\n }", "protected void checkForFirstRequest() throws IOException {\n if(firstRequest) {\n while (!connected || (serveResponse = in.readLine()).isEmpty());\n firstRequest = false;\n }\n }", "public void request() {\n }", "@Override\n public void onResponse(String response) {\n Log.i(\"Checking\", response + \" \");\n if(new ServerReply(response).getStatus())\n {\n Toast.makeText(context,new ServerReply(response).getReason(),Toast.LENGTH_LONG).show();\n }\n\n }", "@Override\n\t\t\tpublic void onFailure(Request request, IOException e) {\n\t\t\t\t Log.i(\"info\",\"hehe\");\n\t\t\t}", "private void __getReply() throws IOException\n {\n __getReply(true); // tagged response\n }", "void ok();", "private WebResponse() {\n initFields();\n }", "@Override\n public void onResponse(String response) {\n System.out.print(\"respuesta Server\"+response);\n responseRequest(sync_id);\n /*if (sync_id != 0) {\n responseRequest(sync_id);\n } else {\n background_response = \"ID Sync null\";\n restartRequest(background_response);\n }*/\n }", "public void method_204() {}", "@Override\n\tpublic void sendResponse() {\n\n\t}", "@Override\r\n\tprotected void processRespond() throws SGSException {\n\r\n\t}", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public static boolean validateResponseNoResult ( ResponseWSDTO pResponse ) {\r\n if ( pResponse != null && pResponse.getCode() != null && !pResponse.getCode().isEmpty() && pResponse.getCode() != null && !pResponse.getCode().isEmpty()\r\n && pResponse.getCode().equals( ConstantCommon.WSResponse.CODE_ZERO )\r\n && pResponse.getType().equals( ConstantCommon.WSResponse.TYPE_NORESULT ) ) {\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean hasInitialResponse() {\n return instance.hasInitialResponse();\n }", "@Override\n\tpublic ActionCommand execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\treturn null;\n\t}", "private void clearInitialResponse() { initialResponse_ = null;\n bitField0_ = (bitField0_ & ~0x00000001);\n }", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}", "public FileIsEmpty(String e,HttpServletResponse response) {\n\t\tresolveException(e,response);\n\t}", "public com.webobjects.appserver.WOResponse readResponse(){\n return null; //TODO codavaj!!\n }", "public boolean isRequest(){\n return false;\n }", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "@Test\n public void TestHandleEmptyHandler() {\n final HandlerExecutor handlerExecutor = getExecutor();\n\n final HandlerResult result = handlerExecutor.handle(new VoiceRequest(\"123456789\", 99L, \"whatever\", \"\"));\n assertEquals(result.handlerType, HandlerType.NONE);\n }", "@Override\n\tpublic void onFailure(TAResponse response) {\n\t}", "@Override\n public void onResponse(Response response) throws IOException {\n }", "private void defaultMChallengeQuestWorldShouldNotBeFound(String filter) throws Exception {\n restMChallengeQuestWorldMockMvc.perform(get(\"/api/m-challenge-quest-worlds?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restMChallengeQuestWorldMockMvc.perform(get(\"/api/m-challenge-quest-worlds/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public ChannelFuture method_4126() {\n return null;\n }", "boolean hasResponseMessage();", "void responseReady(String response);", "@Override\n\t\t\t\t\tpublic void httpFail(String response) {\n\t\t\t\t\t}", "public boolean hasInitialResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }" ]
[ "0.7092719", "0.7056818", "0.7041487", "0.68899256", "0.68654394", "0.6689704", "0.6649218", "0.647354", "0.63617283", "0.6320065", "0.6320065", "0.62918335", "0.62533134", "0.62533134", "0.6206062", "0.6197688", "0.61820865", "0.6153419", "0.6144984", "0.6096945", "0.6081273", "0.6052472", "0.60368997", "0.60286194", "0.6027225", "0.60083324", "0.60083324", "0.6003493", "0.59932876", "0.598569", "0.59726614", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59432083", "0.59414643", "0.5928471", "0.5928254", "0.5925667", "0.59229004", "0.59220827", "0.59026724", "0.5898936", "0.58881944", "0.58606744", "0.5856749", "0.5854192", "0.58522636", "0.5832532", "0.58267725", "0.5822839", "0.58139807", "0.58135116", "0.58056766", "0.5803914", "0.5801362", "0.5797618", "0.5797618", "0.5797618", "0.57961434", "0.5788962", "0.5778507", "0.57705057", "0.57641053", "0.5748116", "0.57454777", "0.5740323", "0.57391775", "0.57371783", "0.57285404", "0.5727623", "0.57119673", "0.57081044", "0.5704956", "0.5698716", "0.56960046", "0.56939846", "0.5689986", "0.5686861", "0.5684048", "0.5677763", "0.5673876", "0.56709385", "0.56686956", "0.5664395", "0.5661323", "0.56584466", "0.56522036", "0.5651874", "0.56412154", "0.56388897", "0.5638557", "0.56378555", "0.5635847", "0.5634779", "0.5628247" ]
0.0
-1
change key to String
@SuppressWarnings("unused") private static String getKeyString(Key key) { return Base64.encode(key.getEncoded()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String keyToString(Object rawKey)\n {\n if (rawKey instanceof String) {\n return (String) rawKey;\n }\n return String.valueOf(rawKey);\n }", "private String getString(String key) {\n return key;\r\n }", "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "@Override\n public String toString() {\n return String.valueOf(key);\n }", "public String getString(String key);", "@Override\r\n\tpublic String toString() {\n\t\treturn key + \"\";\r\n\t}", "String getString(String key);", "String setKey(String newKey);", "@Override\n public String toString(){\n return key;\n }", "private String keyAsString(Map map, String key) {\n Object value = map.get(key);\n return (value != null) ? value.toString() : null;\n }", "public String toString() {\r\n \treturn key;\r\n }", "String getString(String key) throws KeyValueStoreException;", "String newKey();", "public String str(String key) throws AgentBuilderRuntimeException {\n\t\treturn getString(key);\n\t}", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "@Override\n public String toString() {\n return key;\n }", "void setKey(java.lang.String key);", "void setKey(String key);", "public String format(String key) {\r\n return getString(key);\r\n }", "private void setKey(String key){\n\t\tthis.key=key;\n\t}", "private void setKey(String key) {\n this.key = key;\n }", "@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }", "public String Str(String key) throws AgentBuilderRuntimeException {\n\t\treturn getString(key);\n\t}", "void setKey(final String key);", "String key();", "@Override\n public String getKey() {\n return key;\n }", "private String serializeKey(String topic, K key) {\n if (key instanceof String) {\n return (String) key;\n }\n if (keySchema instanceof PulsarKafkaSchema) {\n ((PulsarKafkaSchema<K>) keySchema).setTopic(topic);\n }\n byte[] keyBytes = keySchema.encode(key);\n return Base64.getEncoder().encodeToString(keyBytes);\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key;\n }", "public String getString(String key) {\r\n String value = (String) keyvaluepairs.get(key.toLowerCase());\r\n return value == null ? \"\" : value;\r\n }", "@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn keyConverter.apply(key) + KEY_VALUE_SEPARATOR_CHAR + ' ' + value;\n\t\t}", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "@Override\r\n\tpublic String toString() {\n\t\treturn this.key;\r\n\t}", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "@Override\n\tpublic String getKey() {\n\t\treturn key;\n\t}", "public String getAsString(String key) {\n return entries.getProperty(key);\n }", "public void setKey(String key) {\r\n this.key = key;\r\n }", "public void setKey(String key) {\n this.key = key;\n }", "private String key(RepositoryModel repository, KeyType key, String id) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(repository.name).append(':');\n\t\tsb.append(key.name());\n\t\tif (!StringUtils.isEmpty(id)) {\n\t\t\tsb.append(':');\n\t\t\tsb.append(id);\n\t\t}\n\t\treturn sb.toString();\n\t}", "public java.lang.String getKey(){\n return localKey;\n }", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "public java.lang.String getKey() {\n java.lang.Object ref = key_;\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 key_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public void setKey(final String key);", "public void setKey(final String key);", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key.substring(this.mPrefixLength);\n }", "protected void setKey(String key) {\r\n this.key = key;\r\n }", "public void setKey(java.lang.String key) {\n\t\tthis.key = key;\n\t}", "public String getString(String key) {\n Object value = get(key);\n return ((value instanceof String) ? (String)value : \"\");\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public String getString(Keys key) {\n\t\treturn getString(key, null);\n\t}", "public String getKey() {\n Object ref = key_;\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 if (bs.isValidUtf8()) {\n key_ = s;\n }\n return s;\n }\n }", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "private void checkStringKey(Key key) {\n m_logger.debug(\"checkByteArrKey start key:\" + key.toString());\n if(m_cache != null){\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n }\n if (m_checked){\n m_logger.debug(\"checkByteArrKey end.\");\n \treturn;\n }\n if (key instanceof String) {\n if (!(m_cache instanceof StringMap)) {\n \tm_logger.debug(\"Cache HashCode:\" + m_cache.hashCode());\n throw new RuntimeException(\"Wrong map/set for String key\");\n }\n }\n m_checked = true;\n m_logger.debug(\"checkByteArrKey end.\");\n }", "@Override\n default String getKey(){\n return key();\n }", "public abstract String mapKeyToItem(String str);", "public String getKey() {\n Object ref = key_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n key_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "java.lang.String getClientKey();", "abstract public String getKey();", "protected abstract SingleKeyVersionDataExtractor<DATA> generateDataKeyAsString () ;", "public void setKey(String key) {\r\n\t\tthis.key = key;\r\n\t}", "public abstract String mapItemToKey(String str);", "public void setItskey(String newItskey) {\n keyTextField.setText(newItskey);\n itskey = newItskey;\n }", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "@Override\r\n public String toString() {\r\n return key.toString() + \"=\" + value.toString();\r\n }", "public void setKey(String key) {\n\n this.key = key;\n }", "public String getString(String key)\n {\n return getString(key, null);\n }", "public String getString(String key) {\n return (String) commandData.get(key);\n }", "public void setKey(final String key) {\n this.key = key;\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "public final void setKey(String key) {\n this.key = key;\n }", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "public static String getKey() {\t\t\n\t\treturn key;\n\t}", "public void setKey(String key)\r\n {\r\n m_key = key;\r\n }", "public String getIdAsString(String key) {\n Object obj = ids.get(key);\n if (obj == null) {\n return \"\";\n }\n return String.valueOf(obj);\n }", "public static String getKey(){\n\t\treturn key;\n\t}" ]
[ "0.75118774", "0.74704057", "0.7341585", "0.7319837", "0.7034212", "0.70149577", "0.69957113", "0.6923344", "0.6907327", "0.6901825", "0.68231475", "0.6791051", "0.67898667", "0.6787104", "0.67645246", "0.67324257", "0.6731339", "0.6712238", "0.6658419", "0.6638902", "0.6582091", "0.65716755", "0.6560991", "0.6550689", "0.6498789", "0.6492181", "0.6461874", "0.6459219", "0.6448137", "0.6438862", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.6389848", "0.636953", "0.63669014", "0.63669014", "0.63651705", "0.63651705", "0.63651705", "0.63651705", "0.63651705", "0.63651705", "0.6356699", "0.6355303", "0.63479096", "0.63411385", "0.63327783", "0.63309085", "0.63225156", "0.63057655", "0.62987626", "0.62987626", "0.62983274", "0.6294915", "0.62925524", "0.6275571", "0.62745315", "0.62745315", "0.62745315", "0.62696284", "0.62653655", "0.6264186", "0.6250253", "0.62491876", "0.6247737", "0.6245507", "0.62421256", "0.62371635", "0.6235593", "0.6229298", "0.6227598", "0.6222989", "0.62161624", "0.62151897", "0.62151897", "0.6203892", "0.62018734", "0.61949414", "0.6184899", "0.61846817", "0.61819476", "0.61819476", "0.61819476", "0.61819476", "0.61749214", "0.61491376", "0.6124257", "0.6121758", "0.6114759", "0.6110658" ]
0.73890084
2
change String to key
private static PublicKey getPublicKey(String keyStr) throws Exception { return KeyFactory.getInstance(RSA).generatePublic(new X509EncodedKeySpec(Base64.decode(keyStr))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String mapItemToKey(String str);", "String setKey(String newKey);", "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "public abstract String mapKeyToItem(String str);", "void setKey(String key);", "void setKey(java.lang.String key);", "void setKey(final String key);", "private String getKey(final String string) {\n String value = string.replace(\"/\", \".\");\n value = value.replace(\"..\", \".\");\n if (value.endsWith(\".\")) {\n value = value + \"root\";\n }\n\n if (value.startsWith(\"_\")) {\n value = value.substring(1);\n }\n\n return value;\n }", "String newKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "public void setKey(final String key);", "public void setKey(final String key);", "String key();", "@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }", "private String getString(String key) {\n return key;\r\n }", "private void setKey(String key){\n\t\tthis.key=key;\n\t}", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "private void setKey(String key) {\n this.key = key;\n }", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "public ComposedIdKey(String value) {\n\t\tStringTokenizer token = new StringTokenizer(value, \"::\");\n\t\ttoken.nextToken(); // className\n\t\tthis.Id_Event = token.nextToken(); // field1\n\t\tthis.Id_User = token.nextToken(); // field2\n\t}", "public String a(StringKey stringKey, String str) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(stringKey.toString());\n stringBuilder.append(\"|\");\n stringBuilder.append(str);\n str = stringBuilder.toString();\n if (elv.containsKey(str)) {\n return (String) elv.get(str);\n }\n return (String) elu.get(stringKey);\n }", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "abstract public String getKey();", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapItemToKey(String item) {\n return item;\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key.substring(this.mPrefixLength);\n }", "String getString(String key);", "public String doHash(String str) {\n String key = \"\";\n int offset = str.charAt(0) - 'a';\n for (int i=0; i<str.length(); i++) {\n char res = str.charAt(i) - offset;\n if (res < 'a') res += 26;\n key += res;\n }\n return key;\n }", "protected void setKey(String key) {\r\n this.key = key;\r\n }", "public void setKey(String s){\n this.key = s;\n this.blockLen = s.length();\n }", "public String generateKey(String str, String key)\n{\n int x = str.length();\n \n for (int i = 0; ; i++)\n {\n if (x == i)\n i = 0;\n if (key.length() == str.length())\n break;\n key+=(key.charAt(i));\n }\n return key;\n}", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "static String makeKey(String id,\n String for_,\n String attrname,\n String attrtype) {\n return format(KEY_FMT, id, for_, attrname, attrtype);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private native void switchKey(String newKey);", "String put(Integer key, String value);", "void setKey(K key);", "private String formTransactionKey(String transaction){\n\t\tString transKey = \"\";\n\t\tString[] transKeyValues = transaction.split(\" \");\n\t\tfor(String parts : transKeyValues){\n\t\t\tif(parts.matches(\".*\\\\d+.*\")){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttransKey += parts;\n\t\t\t\tString existingKey = isKeyAlreadyFormed(transKey);\n\t\t\t\tif(!existingKey.equals(\"\"))\n\t\t\t\t\treturn existingKey;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn transKey;\n\t}", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(final String key) {\n this.key = key;\n }", "public void setKey(String key) {\r\n this.key = key;\r\n }", "static String toLookupKey(final String left, final String right) {\n return toLookupKey(left, SPLIT_STR, right);\n }", "public static String getEncodedKey(final String key)\n {\n String encodedKey = key;\n \n try {\n final int ontEnd = key.indexOf(ONT_SEPARATOR);\n if (ontEnd != -1) { \n final String prefix = key.substring(0, ontEnd + 1);\n final String name = key.substring(ontEnd + 1, key.length());\n final String encodedName = java.net.URLEncoder.encode(name, \"UTF-8\");\n if (name != encodedName) {\n encodedKey = prefix + encodedName;\n if (DEBUG.RDF) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n } else {\n encodedKey = java.net.URLEncoder.encode(key, \"UTF-8\");\n if (DEBUG.RDF && encodedKey != key) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n }\n catch (java.io.UnsupportedEncodingException e) {\n Log.warn(\"encoding key \" + Util.tags(key), e); \n }\n \n return encodedKey;\n }", "void add(String key);", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key;\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }", "public void setKey(java.lang.String key) {\n\t\tthis.key = key;\n\t}", "public final void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapItemToKey(String item) {\n return this.mPrefix + item;\n }", "public void setKey(java.lang.String param){\n localKeyTracker = true;\n \n this.localKey=param;\n \n\n }", "private String key(RepositoryModel repository, KeyType key, String id) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(repository.name).append(':');\n\t\tsb.append(key.name());\n\t\tif (!StringUtils.isEmpty(id)) {\n\t\t\tsb.append(':');\n\t\t\tsb.append(id);\n\t\t}\n\t\treturn sb.toString();\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String aKey) {\n\t\tthis.key = aKey;\n\t}", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "public K setKey(K key);", "public void setKey(String key) {\r\n\t\tthis.key = key;\r\n\t}", "public void setKey(String key) {\n\n this.key = key;\n }", "protected String nameToKey(String searchName) {\n\t\tif( searchName == null ) throw new NullPointerException(\"searchName is null\");\n\t\treturn hex(sha1(searchName));\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public String getString(String key);", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "public String doHash2(String str) {\n if(str.length() == 1) return \"-1\";\n\n String key = \"\";\n for (int i = 0; i < str.length() - 1; i++) {\n int val = str.charAt(i + 1) - str.charAt(i);\n if (val < 0) val = 26 + val;\n key += val + \"_\";\n }\n return key;\n }", "public SmartKey getSmartKey(String value);", "public void setKey(String key)\r\n {\r\n m_key = key;\r\n }", "@Override\r\n\t\t\tpublic IHierarchicalKey caseEStringToStringMapEntry(\r\n\t\t\t\t\tEntry<String, String> object) {\r\n\t\t\t\treturn new NamedElementKey(object);\r\n\t\t\t}", "public void testCreateKeyStringWithId() {\n try {\n KeyFactory.createKeyString(kind, id);\n } catch (IllegalStateException e) {\n return;\n }\n fail();\n }", "String getKeyFormat();", "Object getKey();", "private Object parseKey(Class<?> keyType, String key) {\n\t\tObject value;\n\t\tif(keyType == null) {\n\t\t\tvalue = new String(key);\n\t\t}\n\t\telse if(keyType.isAssignableFrom(String.class)) {\n\t\t\tvalue = new String(key);\n\t\t}\n\t\telse if(keyType.isAssignableFrom(Path.class)) {\n\t\t\tvalue = new Path(key);\n\t\t}\n\t\telse if((keyType == Integer.class) || (keyType == Integer.TYPE)) {\n\t\t\tvalue = Integer.parseInt(key);\n\t\t}\n\t\telse if((keyType == Boolean.class) || (keyType == Boolean.TYPE)) {\n\t\t\tvalue = Boolean.parseBoolean(key);\n\t\t}\n\t\telse if((keyType == Long.class) || (keyType == Long.TYPE)) {\n\t\t\tvalue =Long.parseLong(key);\n\t\t}\n\t\telse if((keyType == Float.class) || (keyType == Float.TYPE)) {\n\t\t\tvalue = Float.parseFloat(key);\n\t\t}\n\t\telse if((keyType == Double.class) || (keyType == Double.TYPE)) {\n\t\t\tvalue = Double.parseDouble(key);\n\t\t}\n\t\telse {\n\t\t\tthrow new ConfigException(\"Not support class type in map key! class='\" + keyType + \"'\");\n\t\t}\n\t\t\n\t\treturn value;\n\t}", "public Builder setKey(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n key_ = value;\n onChanged();\n return this;\n }", "public static IDataKey of(String key) {\n if (key == null) return null;\n return new IDataKey(key);\n }", "java.lang.String getClientKey();" ]
[ "0.76113594", "0.74041814", "0.73996806", "0.72093105", "0.6999955", "0.6957717", "0.69238275", "0.67461634", "0.6732936", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6571868", "0.6571868", "0.64857227", "0.6471826", "0.64654547", "0.64585716", "0.64534247", "0.6336374", "0.6297505", "0.6270812", "0.6266393", "0.6252478", "0.62355644", "0.6190231", "0.617489", "0.6138539", "0.6129679", "0.612872", "0.612718", "0.6119673", "0.6117932", "0.60853195", "0.60834086", "0.60663646", "0.60598606", "0.60573745", "0.6052748", "0.60522705", "0.6047734", "0.6047734", "0.6023402", "0.601656", "0.6016266", "0.6010891", "0.5998145", "0.5987352", "0.598603", "0.5982528", "0.5982528", "0.5982528", "0.5982528", "0.5961594", "0.5961334", "0.59565794", "0.5943096", "0.5943096", "0.5943096", "0.5927083", "0.59222025", "0.59131956", "0.5910603", "0.5907876", "0.58984166", "0.589238", "0.5890505", "0.58817095", "0.5878142", "0.58754337", "0.58754337", "0.5865866", "0.5859481", "0.5854621", "0.58406967", "0.5820146", "0.58200115", "0.5799941", "0.57936484", "0.57875305", "0.5779661", "0.5778292", "0.57777643", "0.5762409", "0.57602227" ]
0.0
-1
change String to key
private static PrivateKey getPrivateKey(String keyStr) throws Exception { return KeyFactory.getInstance(RSA).generatePrivate(new PKCS8EncodedKeySpec(Base64.decode(keyStr))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String mapItemToKey(String str);", "String setKey(String newKey);", "default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}", "public abstract String mapKeyToItem(String str);", "void setKey(String key);", "void setKey(java.lang.String key);", "void setKey(final String key);", "private String getKey(final String string) {\n String value = string.replace(\"/\", \".\");\n value = value.replace(\"..\", \".\");\n if (value.endsWith(\".\")) {\n value = value + \"root\";\n }\n\n if (value.startsWith(\"_\")) {\n value = value.substring(1);\n }\n\n return value;\n }", "String newKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "public void setKey(final String key);", "public void setKey(final String key);", "String key();", "@Override\n public synchronized Object put(Object key, Object value) {\n if (value instanceof String) {\n value = ((String) value).trim();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n this.keyMap.put(strkey.toLowerCase(), strkey);\n }\n return super.put(strkey, value);\n }", "private String getString(String key) {\n return key;\r\n }", "private void setKey(String key){\n\t\tthis.key=key;\n\t}", "static InitKey toKey(final String key) throws ManagementException {\n\t\t\ttry {\n\t\t\t\treturn valueOf(key.toUpperCase());\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\tthrow new ManagementException(key + \" is not a valid key for the Tic-Tac-Toe environment\", e);\n\t\t\t}\n\t\t}", "private void setKey(String key) {\n this.key = key;\n }", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPARATOR);\n if (!Character.isLetter(sanitized.charAt(0))) {\n sanitized = \"m_\" + sanitized;\n }\n return sanitized;\n }", "public ComposedIdKey(String value) {\n\t\tStringTokenizer token = new StringTokenizer(value, \"::\");\n\t\ttoken.nextToken(); // className\n\t\tthis.Id_Event = token.nextToken(); // field1\n\t\tthis.Id_User = token.nextToken(); // field2\n\t}", "public String a(StringKey stringKey, String str) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(stringKey.toString());\n stringBuilder.append(\"|\");\n stringBuilder.append(str);\n str = stringBuilder.toString();\n if (elv.containsKey(str)) {\n return (String) elv.get(str);\n }\n return (String) elu.get(stringKey);\n }", "@Override\n protected String toCloudEventsKey(final String key) {\n return key.substring(AmqpConstants.CE_PREFIX.length());\n }", "abstract public String getKey();", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapItemToKey(String item) {\n return item;\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key.substring(this.mPrefixLength);\n }", "String getString(String key);", "public String doHash(String str) {\n String key = \"\";\n int offset = str.charAt(0) - 'a';\n for (int i=0; i<str.length(); i++) {\n char res = str.charAt(i) - offset;\n if (res < 'a') res += 26;\n key += res;\n }\n return key;\n }", "protected void setKey(String key) {\r\n this.key = key;\r\n }", "public void setKey(String s){\n this.key = s;\n this.blockLen = s.length();\n }", "public String generateKey(String str, String key)\n{\n int x = str.length();\n \n for (int i = 0; ; i++)\n {\n if (x == i)\n i = 0;\n if (key.length() == str.length())\n break;\n key+=(key.charAt(i));\n }\n return key;\n}", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "static String makeKey(String id,\n String for_,\n String attrname,\n String attrtype) {\n return format(KEY_FMT, id, for_, attrname, attrtype);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private native void switchKey(String newKey);", "String put(Integer key, String value);", "void setKey(K key);", "private String formTransactionKey(String transaction){\n\t\tString transKey = \"\";\n\t\tString[] transKeyValues = transaction.split(\" \");\n\t\tfor(String parts : transKeyValues){\n\t\t\tif(parts.matches(\".*\\\\d+.*\")){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttransKey += parts;\n\t\t\t\tString existingKey = isKeyAlreadyFormed(transKey);\n\t\t\t\tif(!existingKey.equals(\"\"))\n\t\t\t\t\treturn existingKey;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn transKey;\n\t}", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(final String key) {\n this.key = key;\n }", "public void setKey(String key) {\r\n this.key = key;\r\n }", "static String toLookupKey(final String left, final String right) {\n return toLookupKey(left, SPLIT_STR, right);\n }", "public static String getEncodedKey(final String key)\n {\n String encodedKey = key;\n \n try {\n final int ontEnd = key.indexOf(ONT_SEPARATOR);\n if (ontEnd != -1) { \n final String prefix = key.substring(0, ontEnd + 1);\n final String name = key.substring(ontEnd + 1, key.length());\n final String encodedName = java.net.URLEncoder.encode(name, \"UTF-8\");\n if (name != encodedName) {\n encodedKey = prefix + encodedName;\n if (DEBUG.RDF) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n } else {\n encodedKey = java.net.URLEncoder.encode(key, \"UTF-8\");\n if (DEBUG.RDF && encodedKey != key) Log.debug(\"encoded \" + Util.tags(key) + \" to \" + Util.tags(encodedKey));\n }\n }\n catch (java.io.UnsupportedEncodingException e) {\n Log.warn(\"encoding key \" + Util.tags(key), e); \n }\n \n return encodedKey;\n }", "void add(String key);", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key;\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "private String validateAndGetLowerCaseKey(String key) {\n Strings.requireNonNullAndNotEmpty(key);\n return key.toLowerCase(Locale.ROOT);\n }", "public void setKey(java.lang.String key) {\n\t\tthis.key = key;\n\t}", "public final void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapItemToKey(String item) {\n return this.mPrefix + item;\n }", "public void setKey(java.lang.String param){\n localKeyTracker = true;\n \n this.localKey=param;\n \n\n }", "private String key(RepositoryModel repository, KeyType key, String id) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(repository.name).append(':');\n\t\tsb.append(key.name());\n\t\tif (!StringUtils.isEmpty(id)) {\n\t\t\tsb.append(':');\n\t\t\tsb.append(id);\n\t\t}\n\t\treturn sb.toString();\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String aKey) {\n\t\tthis.key = aKey;\n\t}", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "public K setKey(K key);", "public void setKey(String key) {\r\n\t\tthis.key = key;\r\n\t}", "public void setKey(String key) {\n\n this.key = key;\n }", "protected String nameToKey(String searchName) {\n\t\tif( searchName == null ) throw new NullPointerException(\"searchName is null\");\n\t\treturn hex(sha1(searchName));\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public String getString(String key);", "private String normalizeKeyId(String keyId) {\n if (keyId.startsWith(\"arn:\") || keyId.startsWith(\"alias/\")) {\n return keyId;\n }\n\n if (!keyId.matches(\"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$\")) {\n return \"alias/\" + keyId;\n } else {\n return keyId;\n }\n }", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "public String doHash2(String str) {\n if(str.length() == 1) return \"-1\";\n\n String key = \"\";\n for (int i = 0; i < str.length() - 1; i++) {\n int val = str.charAt(i + 1) - str.charAt(i);\n if (val < 0) val = 26 + val;\n key += val + \"_\";\n }\n return key;\n }", "public SmartKey getSmartKey(String value);", "public void setKey(String key)\r\n {\r\n m_key = key;\r\n }", "@Override\r\n\t\t\tpublic IHierarchicalKey caseEStringToStringMapEntry(\r\n\t\t\t\t\tEntry<String, String> object) {\r\n\t\t\t\treturn new NamedElementKey(object);\r\n\t\t\t}", "public void testCreateKeyStringWithId() {\n try {\n KeyFactory.createKeyString(kind, id);\n } catch (IllegalStateException e) {\n return;\n }\n fail();\n }", "String getKeyFormat();", "Object getKey();", "private Object parseKey(Class<?> keyType, String key) {\n\t\tObject value;\n\t\tif(keyType == null) {\n\t\t\tvalue = new String(key);\n\t\t}\n\t\telse if(keyType.isAssignableFrom(String.class)) {\n\t\t\tvalue = new String(key);\n\t\t}\n\t\telse if(keyType.isAssignableFrom(Path.class)) {\n\t\t\tvalue = new Path(key);\n\t\t}\n\t\telse if((keyType == Integer.class) || (keyType == Integer.TYPE)) {\n\t\t\tvalue = Integer.parseInt(key);\n\t\t}\n\t\telse if((keyType == Boolean.class) || (keyType == Boolean.TYPE)) {\n\t\t\tvalue = Boolean.parseBoolean(key);\n\t\t}\n\t\telse if((keyType == Long.class) || (keyType == Long.TYPE)) {\n\t\t\tvalue =Long.parseLong(key);\n\t\t}\n\t\telse if((keyType == Float.class) || (keyType == Float.TYPE)) {\n\t\t\tvalue = Float.parseFloat(key);\n\t\t}\n\t\telse if((keyType == Double.class) || (keyType == Double.TYPE)) {\n\t\t\tvalue = Double.parseDouble(key);\n\t\t}\n\t\telse {\n\t\t\tthrow new ConfigException(\"Not support class type in map key! class='\" + keyType + \"'\");\n\t\t}\n\t\t\n\t\treturn value;\n\t}", "public Builder setKey(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n key_ = value;\n onChanged();\n return this;\n }", "public static IDataKey of(String key) {\n if (key == null) return null;\n return new IDataKey(key);\n }", "java.lang.String getClientKey();" ]
[ "0.76113594", "0.74041814", "0.73996806", "0.72093105", "0.6999955", "0.6957717", "0.69238275", "0.67461634", "0.6732936", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.65980625", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6581003", "0.6571868", "0.6571868", "0.64857227", "0.6471826", "0.64654547", "0.64585716", "0.64534247", "0.6336374", "0.6297505", "0.6270812", "0.6266393", "0.6252478", "0.62355644", "0.6190231", "0.617489", "0.6138539", "0.6129679", "0.612872", "0.612718", "0.6119673", "0.6117932", "0.60853195", "0.60834086", "0.60663646", "0.60598606", "0.60573745", "0.6052748", "0.60522705", "0.6047734", "0.6047734", "0.6023402", "0.601656", "0.6016266", "0.6010891", "0.5998145", "0.5987352", "0.598603", "0.5982528", "0.5982528", "0.5982528", "0.5982528", "0.5961594", "0.5961334", "0.59565794", "0.5943096", "0.5943096", "0.5943096", "0.5927083", "0.59222025", "0.59131956", "0.5910603", "0.5907876", "0.58984166", "0.589238", "0.5890505", "0.58817095", "0.5878142", "0.58754337", "0.58754337", "0.5865866", "0.5859481", "0.5854621", "0.58406967", "0.5820146", "0.58200115", "0.5799941", "0.57936484", "0.57875305", "0.5779661", "0.5778292", "0.57777643", "0.5762409", "0.57602227" ]
0.0
-1
Remove viewpager_item.xml from ViewPager
@Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((RelativeLayout) object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void destroyItem(ViewGroup container, int position, Object object) {\n ((ViewPager) container).removeView((RelativeLayout) object);\r\n \r\n }", "@Override\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t((ViewPager) container).removeView((RelativeLayout) object);\n\t}", "@Override\n\t\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t\t\t((ViewPager) container).removeView((View) object);\n\t\t\t}", "@Override\r\n public void destroyItem(ViewGroup container, int position, Object object) {\n ((ViewPager) container).removeView((View) object);\r\n }", "@Override\r\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t((ViewPager) container).removeView(mViews.get(position));\r\n\t\t\r\n\t}", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n ((ViewPager) container).removeView((View) object);\n }", "@Override\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t( (ViewPager)container).removeView((View)object);\n\t}", "@Override\n\tpublic int removeView(ViewPager viewPager, View view) {\n\t\tfor (int i = 0; i < pagerFragments.size(); i++) {\n\t\t\tSpinMenuFragment fragment = pagerFragments.get(i);\n\t\t\tif (fragment.getContent().equals(view)) {\n\t\t\t\treturn removeView(viewPager, i);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "@Override\n public void destroyItem(View container, int position, Object object) {\n\n View view = (View) object;\n ((ViewPager) container).removeView(view);\n view = null;\n\n }", "@Override\n public void destroyItem(View container, int position, Object object) {\n ((ViewPager)container).removeView(viewContainter.get(position));\n }", "@Override\r\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t((ViewPager)container).removeView(list.get(position));\r\n\t}", "void removeAllViewsFromAdapter(ViewPager pager) {\n mViews.clear();\n pager.removeAllViews();\n // set this, so that when the next addViews is called, we return POSITION_NONE for every\n // entry so we can remove whichever views we need to and add the ones that we need to.\n mIsViewPagerInIntentionallyInconsistentState = true;\n }", "@Override\n\tpublic int removeView(ViewPager viewPager, int position) {\n\t\tviewPager.setAdapter(null);\n\t\tpagerFragments.remove(position);\n\t\tviewPager.setAdapter(this);\n\t\treturn position;\n\t}", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n ((ViewPager) container).removeView((CardView) object);\n\n }", "@Override\n\tpublic void destroyItem(View container, int position, Object object) {\n\t\t((ViewPager) container).removeView(mList.get(position));\n\t}", "@Override\n public void destroyItem(ViewGroup container, int position, Object object)\n {\n \n container.removeView(mPagersList.get(position));\n }", "@Override\r\n public void destroyItem( ViewGroup container, int position, Object object ){\n container.removeView( (View) object );\r\n }", "@Override\n public void destroyItem(ViewGroup view, int position, Object object) {\n view.removeView(images.get(position));\n }", "@Override\n protected void onDestroy() {\n viewPager.removeOnPageChangeListener(this);\n super.onDestroy();\n }", "@Override\n protected void onDestroy() {\n if (pager != null) {\n pager = null;\n }\n super.onDestroy();\n\n }", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n container.removeView((LinearLayout) object);\n\n }", "@Override\n\t\t\tpublic void unloadViewData(DemoData item) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View v) {\n listItems.remove(position);\n //close the swipe layout\n holder.swipeLayout.close();\n //update adapter\n activity.updateAdapter();\n }", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n registeredFragments.remove(position);\n super.destroyItem(container, position, object);\n }", "@Override\n public void destroyItem(ViewGroup container, int position, Object object){\n container.removeView((View)object);\n }", "@Override\n\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t\tcontainer.removeView((View)object); \t\n\t\t}", "@Override\n public void onClick(View v) {\n viewPager.setCurrentItem(0);\n }", "@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\t\talert_dialog.dismiss();\r\n\r\n\t\t\t\t\tet_pincode.setText(\"\");\r\n\r\n\t\t\t\t\tif (pages.contains(page2)) {\r\n\r\n\t\t\t\t\t\tpages.remove(page2);\r\n\r\n\t\t\t\t\t\tpagerAdapter = new MediaPagerAdapter(getActivity(),\r\n\t\t\t\t\t\t\t\tpages);\r\n\t\t\t\t\t\tpagerContainer.setAdapter(pagerAdapter);\r\n\t\t\t\t\t\tpagerAdapter.notifyDataSetChanged();\r\n\r\n\t\t\t\t\t\tindicator.setViewPager(pagerContainer);\r\n\t\t\t\t\t\tindicator.setClickable(true);\r\n\r\n\t\t\t\t\t\tpagerContainer.setCurrentItem(0);\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}", "@Override\n public void onAnimationEnd(Animator arg0) {\n photoLayout.removeView(item);\n }", "@Override\n public int getItemPosition(Object object) {\n return PagerAdapter.POSITION_NONE;\n }", "@Override\r\n\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t\tcontainer.removeView(viewList.get(position));\r\n\t\t}", "@Override\n\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t\tcontainer.removeView(viewList.get(position));\n\t\t}", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n container.removeView((View)object);\n }", "@Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n }", "@Override\r\n protected void onRestart() {\n super.onRestart();\r\n viewPager.setCurrentItem(0);\r\n\r\n }", "@Override\n public int getItemPosition(Object object) {\n return PagerAdapter.POSITION_NONE;\n }", "@Override\n public void onPageSelected(int arg0) {\n if (arg0 == 1) {\n mViewPager.setPagingEnabled(false);\n }\n }", "@Override\n public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {\n container.removeView((LinearLayout)object);\n }", "@Override\r\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\tcontainer.removeView((View) object);\r\n\t}", "@Override\r\n public void onPageSelected(int position) {\n invalidateOptionsMenu();\r\n }", "@Override\n\tpublic void destroyItem(View container, int position, Object object) {\n\t}", "public void removeFileUploaderItem(FileUploaderItem item) {\n m_items.removeView(item);\n }", "@Override\r\n public Object getItem(int position) {\n return null;\r\n }", "@Override\n public void onPageSelected(int position) {\n invalidateOptionsMenu();\n }", "@Override\n public void onDestroyView() {\n super.onDestroyView();\n // 页面销毁Grdivew里边的数据\n adapter.notifyDataSetChanged();\n Bimp.tempSelectBitmap.clear();\n Bimp.max = 0;\n }", "private void setupViewPager(ViewPager viewPager) {\n\n try {\n mFragmentList.clear();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n adapter.notifyDataSetChanged();\n\n mFragmentList.add(Constants.mMainActivity.productListPendingFragment);\n mFragmentTitleList.add(\"Pending\");\n\n mFragmentList.add(Constants.mMainActivity.productListApprovedFragment);\n mFragmentTitleList.add(\"Approved\");\n\n mFragmentList.add(Constants.mMainActivity.productListRejectedFragment);\n mFragmentTitleList.add(\"Rejected\");\n\n viewPager.setAdapter(adapter);\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int pos) {\n return null;\n }", "@Override\n public Object instantiateItem(ViewGroup container, int position) {\n return null;\n }", "ItemStack removePage(EntityPlayer player, ItemStack itemstack, int index);", "public void onItemUnsetSelection(AdapterView<?> parent, View view, int position);", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public void onDestroyView(){\n DataStore.getInstance(getActivity()).unregisterLiveLeagueDBObserver(mViewPagerAdapter);\n super.onDestroyView();\n }", "@Override\n public void onClick(View v) {\n mViewPager.setCurrentItem(mCrimes.size() - 1);\n }", "@Override\n public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {\n container.removeView((View) object);\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "@Override\n public Object getItem(int position) {\n return null;\n }", "public void removeItem(int position) {\n mPapers.remove(position);\n notifyItemRemoved(position);\n }", "@Override\n public void onPageSelected(int position) {\n if (position == 0 || position == layouts.size()-1) {\n btnPrevious.setVisibility(View.GONE);\n } else {\n btnPrevious.setVisibility(View.VISIBLE);\n }\n }", "protected void clearOnClickListener() {\n itemView.setOnClickListener(null);\n }", "public void removeItem(){\n\t\tthis.item = null;\n\t}", "private void removeProgressView() {\n if (progressView == null) return;\n\n removeView(progressView);\n TurbolinksLog.d(\"Progress view removed\");\n }", "public void doRemoveItem() {\n doRemoveItem(this.mSrcPos - getHeaderViewsCount());\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmyViewPager.setCurrentItem(0);\n\t\t\t}", "@Override\npublic void removeForReplacement(int index, ObjectAdapter childAdapter) {\n\t\n}", "private void resetAdapter() {\n\n\t\tmSwipeList.discardUndo();\n\n\t\tString[] items = new String[20];\n\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\titems[i] = String.format(\"Test Item %d\", i);\n\t\t}\n\n\t\tmAdapter = new ArrayAdapter<String>(this,\n\t\t\tandroid.R.layout.simple_list_item_1,\n\t\t\tandroid.R.id.text1,\n\t\t\tnew ArrayList<String>(Arrays.asList(items)));\n\t\tsetListAdapter(mAdapter);\n\n\t}", "@Override\n public void onBackPressed() {\n super.onBackPressed();\n overridePendingTransition(R.anim.swipeback_stack_to_front,\n R.anim.swipeback_stack_right_out);\n viewPager.removeAllViews();\n viewPager.destroyDrawingCache();\n viewPager = null;\n\n GalleryFragment.recyclerView.getAdapter().notifyDataSetChanged();\n\n System.gc();\n\n }", "@Override\n public void onDestroyView() {\n mBinding = null;\n super.onDestroyView();\n }", "public void removeTemplatesPage()\r\n {\r\n getSemanticObject().removeProperty(swpres_templatesPage);\r\n }", "@Override\n public Object getItem(int position) {\n \treturn null;\n }", "public void removeImageItem() {\n\n mSelectedImageAdapter.setUpRemoveImageItem(this::removeImage);\n }", "@Override\n public void onClick(View v) {\n viewPager.setCurrentItem(1);\n }", "@Override\n public int getItemViewType(int position){\n return 0;\n }", "public void onViewDestroy(){}", "@Override\n public void onClick(View v) {\n viewPager.setCurrentItem(2);\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tViewGroup viewgproup = (ViewGroup) mView.getParent();\n\t\tif (viewgproup != null) {\n\t\t\tviewgproup.removeAllViewsInLayout();\n\t\t}\n\t\treturn mView;\n\t}", "public void removeAllItems() {\n mPapers.clear();\n notifyDataSetChanged();\n }", "@Override\n public void onViewRecycled(RecyclerView.ViewHolder holder) {\n if (holder instanceof BaseViewHolder) {\n ((BaseViewHolder) holder).mRelativeLayout.removeAllViews();\n }\n super.onViewRecycled(holder);\n }", "private void removeUnwantedPadding() {\n if (C.SDK < 21) {\n return;\n }\n\n View view = getView();\n if (view != null) {\n View viewList = view.findViewById(android.R.id.list);\n if (viewList != null) {\n viewList.setPadding(0, 0, 0, 0);\n }\n }\n }", "public void onDestroyView() {\n super.onDestroyView();\n activity.setCastDetailsCreditsBundle(null);\n listView.setAdapter(null);\n }", "public void removeView(IView view)\r\n { this.views.remove(view);\r\n }", "public void deletePage(int position)\n {\n arrayIndexes.remove(position);\n // Notify the adapter that the data set is changed\n notifyDataSetChanged();\n }", "@Override\n public Object getItem(int p1)\n {\n return null;\n }", "@Override\r\n\tpublic void destroyItem(View container, int position, Object object) {\n\t\tsuper.destroyItem(container, position, object);\r\n\t}", "@Override\n public void unbindView(@NotNull TextItem<T> item) {\n }", "private void setUiPageViewController() {\n mBinding.llPdpProductImagePosition.removeAllViews();\n mDotsCount = mProductsViewPagerAdapter.getCount();\n mDots = new ImageView[mDotsCount];\n if (mDotsCount > ZERO) {\n EcomUtil.setViewPagerDots(this, mDots, mDotsCount, mBinding.llPdpProductImagePosition);\n }\n }", "public void removeItem() {\n tvItem.setOnLongClickListener(new View.OnLongClickListener() {\n @Override\n public boolean onLongClick(View v) {\n // Notify the listener which position was long pressed.\n longClickListener.onItemLongClicked(getBindingAdapterPosition());\n return true;\n }\n });\n }", "@Override\n public int getItemViewType(int position) {\n return 0;\n }", "@Override\n public int getItemViewType(int position) {\n return 0;\n }", "@Override\r\n\tpublic void onDestroyView() {\n\t\tsuper.onDestroyView();\r\n\t}" ]
[ "0.73336196", "0.69893646", "0.6903435", "0.6846102", "0.672688", "0.66912866", "0.66459155", "0.6580385", "0.6556995", "0.6510951", "0.6478286", "0.6467707", "0.6450891", "0.6281596", "0.6265101", "0.6170592", "0.6149121", "0.60744375", "0.606723", "0.5915758", "0.59134984", "0.5873567", "0.58231163", "0.580732", "0.5750735", "0.57231414", "0.5722684", "0.5709942", "0.570499", "0.56928927", "0.5668465", "0.56684554", "0.565849", "0.5617418", "0.5616158", "0.55895406", "0.558089", "0.55641526", "0.5503193", "0.54864526", "0.54698324", "0.54585177", "0.54280263", "0.540608", "0.5402342", "0.53855044", "0.5379091", "0.5367726", "0.5361844", "0.5361047", "0.5341759", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.5325886", "0.53251904", "0.5298349", "0.5298122", "0.52894914", "0.52894914", "0.52636", "0.52618694", "0.52462846", "0.5244453", "0.52304465", "0.52174115", "0.51976866", "0.5187013", "0.5158479", "0.5153047", "0.5132246", "0.5130651", "0.5130031", "0.5122428", "0.5121517", "0.51014334", "0.5098533", "0.5096584", "0.50894195", "0.507285", "0.5072748", "0.5054676", "0.5049142", "0.50459456", "0.50458634", "0.50396746", "0.50300306", "0.5026862", "0.5024969", "0.5022654", "0.50136787", "0.50136787", "0.50042725" ]
0.6144742
18
TODO Autogenerated method stub Inicia metodo holder.progressBar.setVisibility(View.VISIBLE);
@Override public void onLoadingStarted(String arg0, View arg1) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void onPreExecute() {\n mProgressBar.setVisibility(View.VISIBLE);\n }", "@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }", "@Override\n protected void onPreExecute() {\n mProgressbar.setVisibility(View.VISIBLE);\n }", "@Override\r\n public void beforeTaskComplete() {\r\n if (recyclerView.getChildCount() < 1) {\r\n recyclerView.setVisibility(View.GONE);\r\n }\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tprogressBar.setVisibility(View.VISIBLE);\n\t\ttv.setVisibility(View.VISIBLE);\n\t\tsuper.onPreExecute();\n\t}", "@Override\n protected void onPreExecute() {\n mRecyclerView.startAnimation(fade_out);\n mRecyclerView.setVisibility(View.INVISIBLE);\n progressBar.startAnimation(fade_in2);\n progressBar.setVisibility(View.VISIBLE);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progress.setVisibility(ProgressBar.VISIBLE);\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t //this method will be running on UI thread\n\t mProgressBar.setVisibility(View.VISIBLE);\n\t }", "@Override\n public void onFinish() {\n holder.timerRunning = false;\n holder.progressBar.setProgress(0);\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//\t\t\tmProgress.setVisibility(View.VISIBLE);\n\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}", "@Override\n public void showProgress() {\n mCircleProgressThemeDetail.setVisibility(View.VISIBLE);\n mCircleProgressThemeDetail.spin();\n mRecyclerThemeDaily.setVisibility(View.GONE);\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}", "public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }", "public void infoProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.GONE);\n }\n }\n });\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//progreso.setVisibility(View.VISIBLE);\n\t\t\tsetProgressBarIndeterminateVisibility(true);\n\t\t}", "@Override\n protected void onStartLoading() {\n progressBar.setVisibility(View.VISIBLE);\n forceLoad();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressLayout.setVisibility(View.VISIBLE);\n\n\t\t}", "@Override\n protected void onPostExecute(Void result) {\n super.onPostExecute(result);\n\n listBook.setAdapter(adapter);\n\n /** HIDE PROGRESS AFTER LOADING DATA **/\n linlaHeaderProgress.setVisibility(View.GONE);\n\n\n }", "public void showProgress(){\n loadMainActivity.setVisibility(View.VISIBLE);\n recyclerView.setVisibility(View.INVISIBLE);\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n public void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {\n holder.imageView.setVisibility(View.VISIBLE);\n }", "@Override\n\t\t\tpublic void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n public void hideProgressBar() {\n if (getActivity() != null) {\n getActivity().runOnUiThread(() -> {\n if (progressBarLayout != null && progressBar != null) {\n progressBar.setVisibility(View.GONE);\n progressBarLayout.setVisibility(View.GONE);\n }\n });\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingView.setVisibility(View.VISIBLE);\n\t\t}", "@Override\n protected void onBindViewHolder(@NonNull RecyclerAdapter holder, int position, @NonNull DataModels model) {\n holder.setDisplayImage(model.getImage_url(), getActivity());\n\n progressBar.setVisibility(View.GONE);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }", "@Override\n public void onLoadingStarted(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tlinlaHeaderProgress.setVisibility(View.VISIBLE);\n\t\t}", "@Override\n protected void onPostExecute(String sentFromDoInBackground) {\n super.onPostExecute(sentFromDoInBackground);\n searchButton.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n myAdapter.notifyDataSetChanged();\n }", "private void showProgressIndicator() {\n setProgressBarIndeterminateVisibility(true);\n setProgressBarIndeterminate(true);\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }", "@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "public void mapImageProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.GONE);\n }\n }\n });\n }", "@Override\n protected void onPreExecute() {\n mLytContainerLayout.setVisibility(View.GONE);\n mToolbar.setVisibility(View.GONE);\n mPrgLoading.setVisibility(View.VISIBLE);\n }", "@Override\n protected void onPreExecute() {\n if(progressBar != null) progressBar.setProgress(0);\n if(refreshImageButton != null) refreshImageButton.setVisibility(View.INVISIBLE);\n super.onPreExecute();\n }", "@Override\n public void onLoadingCancelled(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n imageProvider.setUploading_status((float) progress[0]);\n // updating progress bar value\n if(progressBar != null) {\n if(progress[0] >= 100 && imageProvider.getUploaded()) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n progressBar.setProgress(progress[0]);\n }\n if(progress[0] >= 100 && haze!= null && imageProvider.getUploaded()){\n haze.setAlpha(0f);\n }\n if(progress[0] >= 100 && refreshImageButton!=null && !imageProvider.getUploaded()){\n refreshImageButton.setVisibility(View.INVISIBLE);\n }\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\t\t\tivProfileProgress.setVisibility(View.VISIBLE);\r\n\t\t}", "@Override\n public void onProgressChanged(WebView view, int newProgress) {\n binding.progressbar.setProgress(newProgress);\n if (newProgress==100){\n binding.progressbar.setVisibility(View.GONE);\n }\n }", "public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "@Override\n protected void onProgressUpdate(Integer... values) {\n progress.setVisibility(View.VISIBLE);\n progress.setProgress(values[0]);\n super.onProgressUpdate(values);\n }", "public void showProgress() {\n img_left_action.setVisibility(View.GONE);\n search_progress.setAlpha(0.0f);\n search_progress.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(search_progress, \"alpha\", 0.0f, 1.0f).start();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pb = (ProgressBar)findViewById(R.id.progressBar);\n progress_status = 50;\n\n // show the ProgressBar\n pb.setVisibility(View.VISIBLE);\n\n // set progress\n pb.setProgress(progress_status);\n }", "public void showProgressBar() {\n\t\tmProgressBarVisible = true;\n\t\tif (getView() != null) {\n\t\t\tLinearLayout progressLayout = (LinearLayout) getView()\n\t\t\t\t\t.findViewById(R.id.severity_list_progress_layout);\n\t\t\tif (progressLayout != null)\n\t\t\t\tprogressLayout.setVisibility(View.VISIBLE);\n\t\t}\n\t}", "@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\r\n\t\tpublic void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {\n\t\t\tholder.app_icon.setVisibility(View.VISIBLE);\r\n\t\t}", "private void showLoadingView(LoadingViewHolder viewHolder, int position) {\n\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n protected void onPreExecute() {\n pb.setVisibility(View.VISIBLE);\n }", "@Override public void searchStarted() {\n progressBar.setVisibility(View.VISIBLE);\n }", "@Override\r\n\t\tpublic void onLoadingCancelled(String arg0, View arg1) {\n\t\t\tholder.app_icon.setVisibility(View.VISIBLE);\r\n\t\t}", "private void uploadingProgressBarInit() {\n uploadingProgressBar.setVisibility(VISIBLE);\n uploadingProgressBar.setProgress(0);\n }", "@Override\n\t\t\tpublic void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if(closeToEnd(position) && !locker.isLocked() ) loadContent();\n\n inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View gridView;\n\n gridView = inflater.inflate(R.layout.album_item,parent,false);\n // binding views to objects and filling them with data\n ImageView albumPhoto = (ImageView) gridView.findViewById(R.id.album_item_imageview);\n TextView albumName = (TextView) gridView.findViewById(R.id.album_item_name);\n TextView albumCount = (TextView) gridView.findViewById(R.id.album_item_count);\n albumName.setText(this.getItem(position).getName());\n albumCount.setText(this.getItem(position).getCount());\n albumPhoto.setScaleType(ImageView.ScaleType.CENTER_CROP);\n final ProgressBar progressBar = (ProgressBar) gridView.findViewById(R.id.album_item_progress_bar);\n\n Glide.with(getApplicationContext())\n\n // calls the getUrlByImageId in order to retrieve the Url of\n // the desired picture\n .load(Helper.getUrlByImageId(getItem(position).getId(),\"album\"))\n // I added this listener in order to desactivate\n // the progressbar whenever the Glide load function\n // gets the picture\n .listener(new RequestListener<Drawable>() {\n @Override\n public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {\n progressBar.setVisibility(View.GONE);\n return false;\n }\n @Override\n public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {\n progressBar.setVisibility(View.GONE);\n return false;\n }\n })\n .into(albumPhoto);\n\n return gridView;\n }", "@Override\n public void onClick(View v) {\n mProgressBar.setVisibility(View.VISIBLE);\n getJokeFromTask();\n }", "@Override\n public void onResponse(JSONArray response) {\n Toast.makeText(getApplicationContext(), \"Berhasil tambah data\" + response, Toast.LENGTH_SHORT).show();\n mProgressBar.setVisibility(View.INVISIBLE);\n }", "@Override\n protected void onPreExecute() {\n\n super.onPreExecute();\n // Show progress overlay (with animation):\n// AndroidUtils.animateView(progressOverlay, View.VISIBLE, 0.4f, 200);\n\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /** SHOW PROGRESS WHILE LOADING DATA **/\n linlaHeaderProgress.setVisibility(View.VISIBLE);\n }", "public void onPostExecute(String fromDoInBackground){\n CovAdt.notifyDataSetChanged();\n pb.setVisibility(View.INVISIBLE);\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tloadingView.setProgress(values[0]);\n\t\t}", "@Override\n protected void onProgressUpdate(Integer ... values) {\n super.onProgressUpdate(values);\n searchButton.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.VISIBLE);\n progressBar.setProgress(values[0]);\n }", "private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }", "private void hideProgressIndicator() {\n setProgressBarIndeterminateVisibility(false);\n setProgressBarIndeterminate(false);\n }", "public void dismissProgressBar() {\n\t\tmProgressBarVisible = false;\n\t\tif (getView() != null) {\n\t\t\tLinearLayout progressLayout = (LinearLayout) getView()\n\t\t\t\t\t.findViewById(R.id.severity_list_progress_layout);\n\t\t\tif (progressLayout != null) {\n\t\t\t\tprogressLayout.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tProgressBar listProgress = (ProgressBar) getView().findViewById(\n\t\t\t\t\tR.id.severity_list_progress);\n\t\t\tlistProgress.setProgress(0);\n\t\t}\n\t}", "public final void showLoadingIndicator(boolean z) {\n if (z) {\n ProgressBar progressBar = (ProgressBar) _$_findCachedViewById(C2723R.C2726id.pbLoadingAuctionSaleList);\n Intrinsics.checkExpressionValueIsNotNull(progressBar, \"pbLoadingAuctionSaleList\");\n progressBar.setVisibility(0);\n return;\n }\n ProgressBar progressBar2 = (ProgressBar) _$_findCachedViewById(C2723R.C2726id.pbLoadingAuctionSaleList);\n Intrinsics.checkExpressionValueIsNotNull(progressBar2, \"pbLoadingAuctionSaleList\");\n progressBar2.setVisibility(8);\n }", "@Override\n public void onDailyTransferMarketFinished(List<PlayerInfo> playerInfoList) {\n mAdapter.setPlayerInfoList(playerInfoList);\n //mListView.setAdapter(mAdapter);\n // Set OnItemClickListener so we can be notified on item clicks\n\n progress.setVisibility(View.GONE);\n }", "public void mapImageProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.GONE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "private void showIndicator() {\n mProgressBarHolder.setVisibility(View.VISIBLE);\n mEmailView.setFocusableInTouchMode(false);\n mEmailView.setFocusable(false);\n mEmailView.setEnabled(false);\n mPasswordView.setFocusableInTouchMode(false);\n mPasswordView.setFocusable(false);\n mPasswordView.setEnabled(false);\n mRegister.setEnabled(false);\n mEmailSignInButton.setEnabled(false);\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n spinner.setVisibility(View.VISIBLE);\n // dialog.dismiss();\n // Do things like hide the progress bar or change a TextView\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmainProBar.setVisibility(ProgressBar.VISIBLE);\n\t\t\tToast.makeText(MainActivity.this, \"Fetching news list ...\", 500).show();\n\t\t}", "private void showLoading() {\n hideNoNetwork();\n mRecipesBinding.fragmentRecipesProgressBar.setVisibility(View.VISIBLE);\n }", "public void hideProgress() {\n search_progress.setVisibility(View.GONE);\n img_left_action.setAlpha(0.0f);\n img_left_action.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(img_left_action, \"alpha\", 0.0f, 1.0f).start();\n }", "@Override\n public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {\n holder.imageView.setVisibility(View.GONE);\n }", "protected void onPreExecute() {\n fabProgressCircle.show();\n\n\n\n }", "@Override\n public void setSupportProgressBarIndeterminateVisibility(boolean visible) {\n getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);\n }", "@Override\r\n public void onPause() {\r\n \tsuper.onPause();\r\n \tif (download!=null && download.isUsed()) {\r\n \t\tdownload.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n \tif (downloadComments!=null && downloadComments.isUsed()) {\r\n \t\tdownloadComments.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n \tif (downloadUserImage!=null && downloadUserImage.isUsed()) {\r\n \t\tdownloadUserImage.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n }", "@Override\n public void showProgressBar() {\n MainActivity.sInstance.showProgressBar();\n }", "@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }", "public void mapProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapBinding.mapProgress.getVisibility() != View.VISIBLE) {\n tabTourMapBinding.mapProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourMapBinding.mapLayout.getVisibility() != View.GONE) {\n tabTourMapBinding.mapLayout.setVisibility(View.GONE);\n }\n }\n });\n }", "private void showLoading() {\n mRecycleView.setVisibility(View.INVISIBLE);\n /* Finally, show the loading indicator */\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v= inflater.inflate(R.layout.fragment_apple, container, false);\n circularProgressBar = v.findViewById(R.id.circularProgressBarNO2);\n text = v.findViewById(R.id.textViewNO2);\n// Intent k = getIntent();\n// double value = getIntent().getDoubleExtra(\"NO2\",0);\n// text.setText(String.valueOf(value));\n ////for(int i=0;i<5;i++){\n circularProgressBar.setProgressWithAnimation(20f, Long.valueOf(2000)); // =1s\n\n // }\n\n\n// Set Progress Max\n circularProgressBar.setProgressMax(100f);\n\n// Set ProgressBar Color\n circularProgressBar.setProgressBarColor(Color.BLACK);\n// or with gradient\n // circularProgressBar.setProgressBarColorStart(Color.GREEN);\n // circularProgressBar.setProgressBarColorEnd(Color.RED);\n // circularProgressBar.setProgressBarColorDirection(CircularProgressBar.GradientDirection.TOP_TO_BOTTOM);\n\n// Set background ProgressBar Color\n circularProgressBar.setBackgroundProgressBarColor(Color.GRAY);\n// or with gradient\n// circularProgressBar.setBackgroundProgressBarColorStart(Color.WHITE);\n// circularProgressBar.setBackgroundProgressBarColorEnd(Color.WHITE);\n// circularProgressBar.setBackgroundProgressBarColorDirection(CircularProgressBar.GradientDirection.TOP_TO_BOTTOM);\n\n// Set Width\n circularProgressBar.setProgressBarWidth(7f); // in DP\n circularProgressBar.setBackgroundProgressBarWidth(3f); // in DP\n\n// Other\n circularProgressBar.setRoundBorder(true);\n circularProgressBar.setStartAngle(180f);\n circularProgressBar.setProgressDirection(CircularProgressBar.ProgressDirection.TO_RIGHT);\n return v;\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tLinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\tparams.gravity=Gravity.CENTER_HORIZONTAL;\n\t\t\tprogressLoading.setLayoutParams(params);\n\t\t\tmContainer.addView(progressLoading);\n\t\t}", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n protected void onPreExecute() {\n loading = new LoadingController();\n // Show a progress spinner\n loading.showProgress(UserEditActivity.this, viewLoading, true);\n }", "@Override\n protected void onPreExecute() {\n loading = new LoadingController();\n // Show a progress spinner\n loading.showProgress(UserEditActivity.this, viewLoading, true);\n }", "@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\t//Initialize the ViewSwitcher object\n\t viewSwitcher = new ViewSwitcher(LoadingScreenActivity.this);\n\t \n\t\t\tviewSwitcher.addView(ViewSwitcher.inflate(LoadingScreenActivity.this, R.layout.loadingscreen, null));\n\n\t\t\tpb_progressBar = (ProgressBar) viewSwitcher.findViewById(R.id.progressBar1);\n\t\t\t\n\t\t\tpb_progressBar.setMax(100);\n\n\t\t\tsetContentView(viewSwitcher);\n\t\t}", "@Override\n public void hideProgressBar() {\n MainActivity.sInstance.hideProgressBar();\n }", "@Override\n\t\t\tpublic void onProgressChanged(WebView view, int newProgress) {\n\t\t\t\tsuper.onProgressChanged(view, newProgress);\n\t\t\t\tprogressBar.setProgress(newProgress);\n\t\t\t\tprogressBar.postInvalidate();\n\t\t\t\tif(newProgress==100)\n\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\r\n\tpublic void showLoading(boolean isLoading) {\r\n\t\tsetSupportProgressBarIndeterminateVisibility(isLoading);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_plans, container, false);\n toolbar=view.findViewById(R.id.toolbar);\n\n recyclerView=view.findViewById(R.id.recyclerview);\n progressBar=view.findViewById(R.id.progressbar);\n\n// LinearLayoutManager layoutManager=new LinearLayoutManager(getContext());\n// recyclerView.setLayoutManager(layoutManager);\n//\n//\n//// plansList.add(new Plans(\"1\",\"365\",R.drawable.plan1,\"#6EA2FF\"));\n//// plansList.add(new Plans(\"1\",\"999\",R.drawable.plan1,\"#3FB444\"));\n//// plansList.add(new Plans(\"1\",\"1299\",R.drawable.plan1,\"#FF5A60\"));\n//// plansList.add(new Plans(\"1\",\"1999\",R.drawable.plan1,\"#E0AB00\"));\n//\n// PlanAdapter planAdapter=new PlanAdapter(plansList,getContext());\n// recyclerView.setAdapter(planAdapter);\n// planAdapter.notifyDataSetChanged();\n\n\n\n toolbar.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n getActivity().finish();\n }\n });\n\n getPlans();\n\n\n\n\n return view;\n }" ]
[ "0.7876314", "0.7666368", "0.75840485", "0.7557928", "0.75538236", "0.74817926", "0.7382104", "0.73802423", "0.73787016", "0.73681015", "0.7325146", "0.73191464", "0.72451586", "0.7231779", "0.72314095", "0.7221717", "0.7203386", "0.7202192", "0.71148115", "0.7107757", "0.7087069", "0.70392627", "0.7017785", "0.6986421", "0.6954873", "0.69514817", "0.69477886", "0.69370854", "0.6868281", "0.6809068", "0.68083966", "0.6801838", "0.6801838", "0.6787565", "0.67814183", "0.6772109", "0.6771649", "0.6758416", "0.6749524", "0.67343885", "0.67324334", "0.67320937", "0.67249364", "0.67098355", "0.6705041", "0.6704635", "0.6704014", "0.6695531", "0.668776", "0.6674576", "0.6668145", "0.6642644", "0.664171", "0.6616429", "0.65836847", "0.65816134", "0.6570779", "0.65683275", "0.6557469", "0.6556665", "0.65425813", "0.6509185", "0.6507336", "0.6494812", "0.6476332", "0.64582914", "0.64580214", "0.6456583", "0.64534223", "0.64489114", "0.64489114", "0.643927", "0.6433113", "0.6428558", "0.6416046", "0.64029855", "0.6396474", "0.6396017", "0.6388724", "0.638421", "0.6382495", "0.6375684", "0.63675684", "0.6343417", "0.63377523", "0.6336205", "0.6331209", "0.63169116", "0.6310545", "0.6306658", "0.63024", "0.6301093", "0.62910473", "0.62910473", "0.6290103", "0.62814224", "0.62802637", "0.6275356", "0.6271891", "0.62415177", "0.62412333" ]
0.0
-1
TODO Autogenerated method stub Cancelar holder.progressBar.setVisibility(View.GONE);
@Override public void onLoadingCancelled(String arg0, View arg1) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }", "@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}", "@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }", "@Override\n public void onFinish() {\n holder.timerRunning = false;\n holder.progressBar.setProgress(0);\n }", "@Override\n public void hideProgressBar() {\n if (getActivity() != null) {\n getActivity().runOnUiThread(() -> {\n if (progressBarLayout != null && progressBar != null) {\n progressBar.setVisibility(View.GONE);\n progressBarLayout.setVisibility(View.GONE);\n }\n });\n }\n }", "@Override\n public void onLoadingCancelled(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }", "public void dismissProgressBar() {\n\t\tmProgressBarVisible = false;\n\t\tif (getView() != null) {\n\t\t\tLinearLayout progressLayout = (LinearLayout) getView()\n\t\t\t\t\t.findViewById(R.id.severity_list_progress_layout);\n\t\t\tif (progressLayout != null) {\n\t\t\t\tprogressLayout.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tProgressBar listProgress = (ProgressBar) getView().findViewById(\n\t\t\t\t\tR.id.severity_list_progress);\n\t\t\tlistProgress.setProgress(0);\n\t\t}\n\t}", "public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "@Override\r\n public void beforeTaskComplete() {\r\n if (recyclerView.getChildCount() < 1) {\r\n recyclerView.setVisibility(View.GONE);\r\n }\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "@Override\n protected void onPreExecute() {\n mProgressBar.setVisibility(View.VISIBLE);\n }", "private void hideProgressIndicator() {\n setProgressBarIndeterminateVisibility(false);\n setProgressBarIndeterminate(false);\n }", "@Override\n public void hideLoading() {\n if (progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n }", "@Override\r\n\t\tpublic void onLoadingCancelled(String arg0, View arg1) {\n\t\t\tholder.app_icon.setVisibility(View.VISIBLE);\r\n\t\t}", "@Override\n\t\t\tpublic void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n protected void onPreExecute() {\n mRecyclerView.startAnimation(fade_out);\n mRecyclerView.setVisibility(View.INVISIBLE);\n progressBar.startAnimation(fade_in2);\n progressBar.setVisibility(View.VISIBLE);\n }", "protected void dismissLoading()\n {\n progressBar.dismiss();\n }", "@Override\n protected void onPreExecute() {\n mProgressbar.setVisibility(View.VISIBLE);\n }", "@Override\n public void onLoadingStarted(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }", "public void hideProgress() {\n search_progress.setVisibility(View.GONE);\n img_left_action.setAlpha(0.0f);\n img_left_action.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(img_left_action, \"alpha\", 0.0f, 1.0f).start();\n }", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }", "@Override\n public void hideProgressBar() {\n MainActivity.sInstance.hideProgressBar();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }", "public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }", "private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }", "@Override\n\t\t\t\t protected void onPostExecute(Void result)\n\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n customProgressDialog.cancel();\n }", "protected void hideLoader() {\n\n if (progressBar != null) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n if(getActivity()!=null) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);\n }\n\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//progreso.setVisibility(View.VISIBLE);\n\t\t\tsetProgressBarIndeterminateVisibility(true);\n\t\t}", "@Override\n\t\t\tpublic void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n protected void onPreExecute() {\n mLytContainerLayout.setVisibility(View.GONE);\n mToolbar.setVisibility(View.GONE);\n mPrgLoading.setVisibility(View.VISIBLE);\n }", "@Override\n\tprotected void onPreExecute() {\n\t\tprogressBar.setVisibility(View.VISIBLE);\n\t\ttv.setVisibility(View.VISIBLE);\n\t\tsuper.onPreExecute();\n\t}", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\t\t\t protected void onPostExecute(Void result)\n\t\t\t {\n\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t }", "@Override\n protected void onPreExecute() {\n if(progressBar != null) progressBar.setProgress(0);\n if(refreshImageButton != null) refreshImageButton.setVisibility(View.INVISIBLE);\n super.onPreExecute();\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n DialogManager.hideProgress();\n\n }", "@Override\n protected void onPreExecute() {\n pd = ProgressDialog. show(Evento.this, \"Eliminar Evento\", \"ESPERE UN MOMENTO\");\n pd.setCancelable( false);\n }", "public void mapImageProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.GONE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }", "private void hideProgress() {\n if (dialogProgress != null) {\n dialogProgress.dismiss();\n dialogProgress = null;\n }\n }", "@Override\n protected void onBindViewHolder(@NonNull RecyclerAdapter holder, int position, @NonNull DataModels model) {\n holder.setDisplayImage(model.getImage_url(), getActivity());\n\n progressBar.setVisibility(View.GONE);\n }", "void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }", "@Override\n public void onProgressChanged(WebView view, int newProgress) {\n binding.progressbar.setProgress(newProgress);\n if (newProgress==100){\n binding.progressbar.setVisibility(View.GONE);\n }\n }", "@Override\n public void hideProgressIndicator() {\n ProgressDialogFragment.dismissDialog(getChildFragmentManager());\n }", "@Override\n protected void onPostExecute(Void result) {\n super.onPostExecute(result);\n\n listBook.setAdapter(adapter);\n\n /** HIDE PROGRESS AFTER LOADING DATA **/\n linlaHeaderProgress.setVisibility(View.GONE);\n\n\n }", "private void hideProgress() {\n \tif(mProgress!=null){\n \t\tmProgress.dismiss();\n \tmProgress=null;\n \t}\n }", "@Override\n protected void onPreExecute() {\n progressDialog.setProgress(0);\n //progressBar.setProgress(0);\n super.onPreExecute();\n }", "public void hideProgress() {\n // if (progressDialog != null && progressDialog.isShowing())\n try {\n progressDialog.dismiss();\n } catch (Exception e) {\n\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(SearchView.this, \"Espere...\", \"Recebendo dados\", true, true);\n\t\t\tprogressDialog.setOnCancelListener(new CancelTaskOnCancelListener(this));\n\t\t}", "@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//\t\t\tmProgress.setVisibility(View.VISIBLE);\n\t\t}", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t //this method will be running on UI thread\n\t mProgressBar.setVisibility(View.VISIBLE);\n\t }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progress.setVisibility(ProgressBar.VISIBLE);\n }", "@Override\n protected void onStartLoading() {\n progressBar.setVisibility(View.VISIBLE);\n forceLoad();\n }", "@Override\n public void disableProgressBar() {\n et_log_email.setEnabled(true);\n et_log_password.setEnabled(true);\n acb_login.setVisibility(View.VISIBLE);\n acb_register.setVisibility(View.VISIBLE);\n\n //Disable progressbar\n pb_login.setVisibility(View.GONE);\n }", "@Override\n\tpublic void hideProgress() {\n\t\tprogress.dismiss();\n\t}", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t \n\t progressDialog= new Dialog(ListKotaActivity.this);\n\t progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);\n\t progressDialog.setContentView(R.layout.progress);\n\t progressDialog.setCancelable(false);\n\t progressDialog.show();\t \n\t }", "@Override\n public void onLoadingFailed(String arg0, View arg1, FailReason arg2) {\n holder.imageView.setVisibility(View.GONE);\n }", "@Override\n public void showProgress() {\n mCircleProgressThemeDetail.setVisibility(View.VISIBLE);\n mCircleProgressThemeDetail.spin();\n mRecyclerThemeDaily.setVisibility(View.GONE);\n }", "@Override\r\n public void onPause() {\r\n \tsuper.onPause();\r\n \tif (download!=null && download.isUsed()) {\r\n \t\tdownload.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n \tif (downloadComments!=null && downloadComments.isUsed()) {\r\n \t\tdownloadComments.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n \tif (downloadUserImage!=null && downloadUserImage.isUsed()) {\r\n \t\tdownloadUserImage.setNotUsed();\r\n \t\tsetProgressBarIndeterminateVisibility(false);\r\n \t}\r\n }", "public void offProgressDialog(){\n if(dialogProgresIndeterminate != null && dialogProgresIndeterminate.isShowing()){\n dialogProgresIndeterminate.dismiss();\n }\n }", "@Override\n public void setSupportProgressBarIndeterminateVisibility(boolean visible) {\n getSupportActionBar().getCustomView().setVisibility(visible ? View.VISIBLE : View.GONE);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n task.cancel(true); //meng- cancel AsincTask\n pd.dismiss(); //menghilangkan progress dialog\n }", "void hideModalProgress();", "public void hideLoadingDialog() {\n if (isDestroyingActivity())\n return;\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n mProgressDialog.dismiss();\n mProgressDialog = null;\n }\n }", "@Override\n public void onClick(View v) {\n mProgressBar.setVisibility(View.VISIBLE);\n getJokeFromTask();\n }", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\r\n\t\t\tprogressDialog = ProgressDialog.show(getActivity(), \"\", StaticVariables.progressBarText, false);\r\n\t\t\tprogressDialog.setCancelable(false);\r\n\t\t}", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\r\n\r\n\t\t\tprogressDialog = ProgressDialog.show(getActivity(), \"\", StaticVariables.progressBarText, false);\r\n\t\t\tprogressDialog.setCancelable(false);\r\n\t\t}", "@Override\r\n protected void onPostExecute(Void result) {\n mProgressDialog.dismiss();\r\n }", "protected void onStop() { //멈추었을때 다이어로그를 제거해주는 메서드\n super.onStop();\n if (progressDialog != null)\n progressDialog.dismiss(); //다이어로그가 켜져있을경우 (!null) 종료시켜준다\n }", "void hideProgress();", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressLayout.setVisibility(View.VISIBLE);\n\n\t\t}", "public void onFinish() {\n\n imageView_gif_confeti.setVisibility(View.INVISIBLE);\n }", "public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }", "public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }", "private void dismissProgressIndication() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n try{\n mProgressDialog.dismiss(); // safe even if already dismissed\n }catch(Exception e){\n Log.i(TAG, \"dismiss exception: \" + e);\t\n }\n mProgressDialog = null;\n }\n }", "public void onFinish() {\n\n tvGroupSwipingBar.setVisibility(View.GONE);\n }", "@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t progressBar.setProgress(0);\n\t }", "public void hideProgress() {\n if (progressDialog != null && progressDialog.isShowing())\n progressDialog.dismiss();\n }", "public void stopProgressAnimation(){\n if(progressAnimator!=null){\n progressAnimator.cancel();\n progressAnimator = null;\n }\n }", "public void onStopLoading() {\n cancelLoad();\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if(closeToEnd(position) && !locker.isLocked() ) loadContent();\n\n inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View gridView;\n\n gridView = inflater.inflate(R.layout.album_item,parent,false);\n // binding views to objects and filling them with data\n ImageView albumPhoto = (ImageView) gridView.findViewById(R.id.album_item_imageview);\n TextView albumName = (TextView) gridView.findViewById(R.id.album_item_name);\n TextView albumCount = (TextView) gridView.findViewById(R.id.album_item_count);\n albumName.setText(this.getItem(position).getName());\n albumCount.setText(this.getItem(position).getCount());\n albumPhoto.setScaleType(ImageView.ScaleType.CENTER_CROP);\n final ProgressBar progressBar = (ProgressBar) gridView.findViewById(R.id.album_item_progress_bar);\n\n Glide.with(getApplicationContext())\n\n // calls the getUrlByImageId in order to retrieve the Url of\n // the desired picture\n .load(Helper.getUrlByImageId(getItem(position).getId(),\"album\"))\n // I added this listener in order to desactivate\n // the progressbar whenever the Glide load function\n // gets the picture\n .listener(new RequestListener<Drawable>() {\n @Override\n public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {\n progressBar.setVisibility(View.GONE);\n return false;\n }\n @Override\n public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {\n progressBar.setVisibility(View.GONE);\n return false;\n }\n })\n .into(albumPhoto);\n\n return gridView;\n }", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\n\t\t\tmProgressHUD.dismiss();\n\t\t\t\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingView.setVisibility(View.VISIBLE);\n\t\t}", "@Override\n public void onResponse(JSONArray response) {\n Toast.makeText(getApplicationContext(), \"Berhasil tambah data\" + response, Toast.LENGTH_SHORT).show();\n mProgressBar.setVisibility(View.INVISIBLE);\n }", "private void hideProgressDialogWithTitle() {\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.dismiss();\n }", "private void dismissProgress() {\n \n \t\tnew Handler(getMainLooper()).post(new Runnable() {\n \n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tif (progressDialog == null)\n \t\t\t\t\tprogressDialog = (ProgressDialogFragment) getSupportFragmentManager()\n \t\t\t\t\t\t\t.findFragmentByTag(\n \t\t\t\t\t\t\t\t\tProgressDialogFragment.FRAGMENT_TAG);\n \n \t\t\t\tif (progressDialog != null && progressDialog.getShowsDialog()) {\n \t\t\t\t\tprogressDialog.dismiss();\n \n \t\t\t\t\tprogressDialog = null;\n \t\t\t\t}\n \t\t\t}\n \t\t});\n \t}", "public void infoProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.GONE);\n }\n }\n });\n }", "@Override\nprotected void onStopLoading() {\n cancelLoad();\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n spinner.setVisibility(View.VISIBLE);\n // dialog.dismiss();\n // Do things like hide the progress bar or change a TextView\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n this.dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n this.dialog.setCancelable(false);\n this.dialog.show();\n }", "public void onStop() {\n if (this.loadingCount > 0) {\n this.loadingCount = 1;\n hideLoading();\n }\n super.onStop();\n }", "@Override\n protected void onStopLoading() {\n cancelLoad();\n }" ]
[ "0.75403315", "0.7422775", "0.72800326", "0.72531515", "0.72015125", "0.7168556", "0.7133209", "0.70456994", "0.7017495", "0.67753035", "0.6735299", "0.67202985", "0.66988826", "0.6651375", "0.66331464", "0.6567625", "0.6541337", "0.6461464", "0.6444796", "0.64394706", "0.6406319", "0.6405927", "0.64056474", "0.6404439", "0.63942945", "0.6366684", "0.6336924", "0.6336738", "0.6331682", "0.63314354", "0.63290304", "0.6319359", "0.6309756", "0.63086957", "0.63083756", "0.62974715", "0.6289311", "0.6282287", "0.6267852", "0.62666863", "0.62585014", "0.6253649", "0.6235376", "0.62344927", "0.62279874", "0.6212046", "0.6206535", "0.6198908", "0.619047", "0.61851054", "0.61831415", "0.61732477", "0.6146825", "0.6146797", "0.61455554", "0.614235", "0.6133527", "0.6123176", "0.6107468", "0.6095507", "0.60787225", "0.607772", "0.6073085", "0.6065663", "0.6060953", "0.60527235", "0.6043221", "0.6034193", "0.6011878", "0.6009976", "0.6000291", "0.6000291", "0.59657276", "0.59602094", "0.59500897", "0.5946031", "0.5942417", "0.594124", "0.5940462", "0.5940462", "0.59359074", "0.59359074", "0.59359074", "0.59208584", "0.5918468", "0.5916443", "0.5906117", "0.58948225", "0.58909076", "0.58878994", "0.5877224", "0.5871412", "0.58665985", "0.586177", "0.5857915", "0.5854501", "0.5847808", "0.5845543", "0.5833979", "0.58326596", "0.5825258" ]
0.0
-1
Creates a new instance of SpectrumSearcher
public SpectrumSearcher(ArrayList <File> lipidLibs, ArrayList <String> mgfFiles, ArrayList <String> mzxmlFile, JProgressBar progressBar, Double ms1Tol, Double ms2Tol, int maxResults, Double minMassCutoff) { //Update class fields this.minMS2Mass = minMassCutoff; this.lipidLibs = lipidLibs; SpectrumSearcher.progressBar = progressBar; this.ms1Tol = ms1Tol; this.ms2Tol = ms2Tol; this.mgfFiles = mgfFiles; this.mzxmlFiles = mzxmlFile; massBinSize = ms1Tol/10.0; minMass = 999.0; maxMass = 0.0; librarySpectra = new ArrayList<LibrarySpectrum>(); fattyAcidsDB = new ArrayList<FattyAcid>(); sampleMS2Spectra = new ArrayList<SampleSpectrum>(); this.maxResults = maxResults; numSpectra = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SamFilterParams create() {\n return new SamFilterParams(this);\n }", "public static QRScanner newInstance() {\n QRScanner fragment = new QRScanner();\n return fragment;\n }", "public MagicSearch createMagicSearch();", "public static synchronized ClubSearch getInstance()\r\n {\r\n if (clubSearch == null)\r\n {\r\n clubSearch = new ClubSearch();\r\n }\r\n \r\n return clubSearch;\r\n }", "public SearchTrack() {\n\t\tsuper();\n\t}", "public DaumWebSearcher() {\n\n }", "private static Searcher createSearcher(String[] args) {\n if (args.length > 1 && \"duden\".equals(args[1])) {//Use DWDS by default, Duden only on explicit request\n return SearcherFactory.newDuden();\n } else {\n return SearcherFactory.newDwds();\n }\n }", "public SearchSettings() { }", "private SearchServiceFactory() {}", "public IndexSearchSharderManager() {\n log = LoggerFactory.getLogger(IndexSearchSharderManager.class);\n }", "public VOCSesame () {\n }", "public ScoreDocShower() {\n initComponents();\n try {\n directory = IndexUtils.openDirectory(LuceneConfig.INDEX_DIR_DEFAULT);\n ir = IndexUtils.createIndexReader(directory);\n is = IndexUtils.createIndexSearcher(ir);\n\n queryparserAnalyzer = AnalyzerFactory.createCustomAnalyzer();\n queryParser = QueryParserFactory.createQueryParser();\n\n LOG.info(\"init lucene components successfully\");\n\n eraAnalysisFrame = new ERAAnalysisFrame();\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n eraAnalysisFrame.setVisible(true);\n }\n });\n Events.bus.register(eraAnalysisFrame);\n\n sentimentAnalyzer = new SentimentAnalyzer(Language.EN);\n\n jTextField3.setText(defaultQuery);\n jTextField3KeyReleased(null);\n\n } catch (Exception e) {\n LOG.log(Level.SEVERE, e.getMessage(), e);\n }\n }", "public SurveyInstance createSurveyInstance() {\n return new SurveyInstance();\n }", "public static Streamer getInstance() {\r\n if (streamer == null) streamer = new Streamer();\r\n return streamer;\r\n }", "public Finder() {\n \n }", "public SampleSpectrum convertToSampleSpectrum() throws CustomException\n\t{\n\t\t//Create new sample spectrum object\n\t\tSampleSpectrum spec = new SampleSpectrum\n\t\t\t\t(precursor,polarity,file,retentionTime,scanNum);\n\t\t\n\t\t//Parse MZ array\n\t\tparseMZArray(spec);\n\t\t\n\t\treturn spec;\n\t}", "public ScannerSimulator getInstance() {\n\t\tif (mInstance == null)\n\t\t\tmInstance = new ScannerSimulator();\n\t\treturn mInstance;\n\t}", "public Scania() {\r\n\t\tinitList();\r\n\t\tmakerName = \"Scania\";\r\n\t\tRandom rand = new Random();\r\n\t\tint chooseBit = rand.nextInt(2); // higher chance of better one ;)\r\n\t\tif (chooseBit == 1) {\r\n\t\t\tmodelName = \"R 2012\";\r\n\t\t} else {\r\n\t\t\tmodelName = \"Streamline\";\r\n\t\t}\r\n\t}", "public ListSearchResults()\n {\n logEnter(LOG_TAG, \"<init>\");\n\n entryMap = new HashMap<String,SearchResultEntry>(0);\n entries = new LinkedList<SearchResultEntry>();\n instance = null;\n }", "public SpectrumInterface getSpectrum(String spectrumId)\r\n\t{\r\n\t\tList<String> spectrumIds = new ArrayList<String>();\r\n\t\tspectrumIds.add(0, spectrumId);\r\n\t\t\r\n\t\t/*\r\n\t\t * Search for desired spectra.\r\n\t\t */\r\n\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>();\r\n\t\tspectrumList = fetchSpectrum(spectrumIds);\r\n\r\n\t\t/*\r\n\t\t * Return spectrum.\r\n\t\t */\r\n\t\treturn spectrumList.get(0);\r\n\t}", "public FrequencyAnalysis()\n {\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) \r\n\t{\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.spectrum_analyzer);\r\n\t\t\r\n\t\t// get the Surface view which is used to draw the spectrum.\r\n\t\tthis.spectrumVisualizer = (SpectrumAnalyzerView) findViewById(R.id.surfaceView);\r\n\t\tthis.surfaceHolder = this.spectrumVisualizer.getHolder();\r\n\r\n\t}", "public search() {\n }", "public static StimuliFactory init() {\r\n\t\ttry {\r\n\t\t\tStimuliFactory theStimuliFactory = (StimuliFactory)EPackage.Registry.INSTANCE.getEFactory(StimuliPackage.eNS_URI);\r\n\t\t\tif (theStimuliFactory != null) {\r\n\t\t\t\treturn theStimuliFactory;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception exception) {\r\n\t\t\tEcorePlugin.INSTANCE.log(exception);\r\n\t\t}\r\n\t\treturn new StimuliFactoryImpl();\r\n\t}", "public static Drivetrain getInstance(){\n if(instance == null){\n instance = new Drivetrain();\n }\n return instance;\n }", "public SELF the_analyzer_is_instantiated() {\n analyzer = builder.build();\n return self();\n }", "CreateScanFilterResponse createScanFilter(CreateScanFilterRequest request);", "TSearchResults createSearchResults(TSearchQuery searchQuery);", "public SearchConditionSB() {\r\n }", "public static void createSimple() throws Exception {\n\t\t// create a sesame memory sail\n\t\tMemoryStore memoryStore = new MemoryStore();\n\n\t\t// create a lucenesail to wrap the memorystore\n\t\tLuceneSail lucenesail = new LuceneSail();\n\t\tlucenesail.setParameter(LuceneSail.INDEX_CLASS_KEY, SolrIndex.class.getName());\n\t\tlucenesail.setParameter(SolrIndex.SERVER_KEY, \"embedded:\");\n\n\t\t// wrap memorystore in a lucenesail\n\t\tlucenesail.setBaseSail(memoryStore);\n\n\t\t// create a Repository to access the sails\n\t\tSailRepository repository = new SailRepository(lucenesail);\n\t\trepository.initialize();\n\n\t\ttry ( // add some test data, the FOAF ont\n\t\t\t\tSailRepositoryConnection connection = repository.getConnection()) {\n\t\t\tconnection.begin();\n\t\t\tconnection.add(SolrSailExample.class.getResourceAsStream(\"/org/openrdf/sail/lucene/examples/foaf.rdfs\"), \"\",\n\t\t\t\t\tRDFFormat.RDFXML);\n\t\t\tconnection.commit();\n\n\t\t\t// search for resources that mention \"person\"\n\t\t\tString queryString = \"PREFIX search: <\" + LuceneSailSchema.NAMESPACE + \"> \\n\"\n\t\t\t\t\t+ \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \\n\" + \"SELECT * WHERE { \\n\"\n\t\t\t\t\t+ \"?subject search:matches ?match . \\n\" + \"?match search:query \\\"person\\\" ; \\n\"\n\t\t\t\t\t+ \" search:property ?property ; \\n\" + \" search:score ?score ; \\n\"\n\t\t\t\t\t+ \" search:snippet ?snippet . \\n\" + \"?subject rdf:type ?type . \\n\" + \"} LIMIT 3 \\n\"\n\t\t\t\t\t+ \"BINDINGS ?type { \\n\" + \" (<http://www.w3.org/2002/07/owl#Class>) \\n\" + \"}\";\n\t\t\ttupleQuery(queryString, connection);\n\n\t\t\t// search for property \"name\" with domain \"person\"\n\t\t\tqueryString = \"PREFIX search: <\" + LuceneSailSchema.NAMESPACE + \"> \\n\"\n\t\t\t\t\t+ \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \\n\" + \"SELECT * WHERE { \\n\"\n\t\t\t\t\t+ \"?subject rdfs:domain ?domain . \\n\" + \"?subject search:matches ?match . \\n\"\n\t\t\t\t\t+ \"?match search:query \\\"chat\\\" ; \\n\" + \" search:score ?score . \\n\"\n\t\t\t\t\t+ \"?domain search:matches ?match2 . \\n\" + \"?match2 search:query \\\"person\\\" ; \\n\"\n\t\t\t\t\t+ \" search:score ?score2 . \\n\" + \"} LIMIT 5\";\n\t\t\ttupleQuery(queryString, connection);\n\n\t\t\t// search in subquery and filter results\n\t\t\tqueryString = \"PREFIX search: <\" + LuceneSailSchema.NAMESPACE + \"> \\n\" + \"SELECT * WHERE { \\n\"\n\t\t\t\t\t+ \"{ SELECT * WHERE { \\n\" + \" ?subject search:matches ?match . \\n\"\n\t\t\t\t\t+ \" ?match search:query \\\"person\\\" ; \\n\" + \" search:property ?property ; \\n\"\n\t\t\t\t\t+ \" search:score ?score ; \\n\" + \" search:snippet ?snippet . \\n\" + \"} } \\n\"\n\t\t\t\t\t+ \"FILTER(CONTAINS(STR(?subject), \\\"Person\\\")) \\n\" + \"} \\n\" + \"\";\n\t\t\ttupleQuery(queryString, connection);\n\n\t\t\t// search for property \"homepage\" with domain foaf:Person\n\t\t\tqueryString = \"PREFIX search: <\" + LuceneSailSchema.NAMESPACE + \"> \\n\"\n\t\t\t\t\t+ \"PREFIX foaf: <http://xmlns.com/foaf/0.1/> \\n\"\n\t\t\t\t\t+ \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \\n\"\n\t\t\t\t\t+ \"CONSTRUCT { ?x rdfs:domain foaf:Person } \\n\" + \"WHERE { \\n\" + \"?x rdfs:domain foaf:Person . \\n\"\n\t\t\t\t\t+ \"?x search:matches ?match . \\n\" + \"?match search:query \\\"homepage\\\" ; \\n\"\n\t\t\t\t\t+ \" search:property ?property ; \\n\" + \" search:score ?score ; \\n\"\n\t\t\t\t\t+ \" search:snippet ?snippet . \\n\" + \"} LIMIT 3 \\n\";\n\t\t\tgraphQuery(queryString, connection);\n\t\t} finally {\n\t\t\trepository.shutDown();\n\t\t}\n\t}", "public static Studio createStudio()\n\t{\n\t\tStudio studio = new Studio();\n\n\t\t// the scene\n\t\tSceneObjectContainer scene = new SceneObjectContainer(\"the scene\", null, studio);\n\n\t\t// start by defining the camera so that we can calculate, from the shutter model, what is in focus and then place something there\n\t\t\n\t\t// define the camera\n\t\t//\n\t\t// Note that the view direction and basis Vector3Ds of the detector are chosen such that\n\t\t// the x, y, z axes form a LEFT-handed coordinate system.\n\t\t// The reason is that, in the photo, the positive x direction is then to the right,\n\t\t// the positive y direction is upwards, and the camera looks in the positive z direction.\n\t\tint\n\t\tpixelsX = 640,\n\t\tpixelsY = 480;\n\t\t\n\t\t\n\t\t// the camera-frame scene\n\t\tEditableSceneObjectCollection cameraFrameScene = new EditableSceneObjectCollection(\"camera-frame scene\", false, scene, studio);\n//\t\tif(LORENTZ_WINDOW)\n//\t\t{\n//\t\t\tcameraFrameScene.addSceneObject(new EditableParametrisedPlane(\n//\t\t\t\t\"Lorentz window\",\t// description\n//\t\t\t\tshutterPlanePoint,\t// pointOnPlane\n//\t\t\t\tbeta,\t// normal\n//\t\t\t\tnew LorentzTransformInterface(\n//\t\t\t\t\t\tbeta,\n//\t\t\t\t\t\tCoordinateSystemType.GLOBAL_BASIS,\n//\t\t\t\t\t\t0.96,\t// transmission coefficient\n//\t\t\t\t\t\tfalse\t// shadow-throwing?\n//\t\t\t\t\t),\t// SurfaceProperty\n//\t\t\t\tcameraFrameScene,\t// parent,\n//\t\t\t\tnull\t// studio\n//\t\t\t\t));\n//\t\t}\n\t\t\n\t\tEditableRelativisticAnyFocusSurfaceCamera camera = new EditableRelativisticAnyFocusSurfaceCamera(\n\t\t\t\t\"Camera\",\n\t\t\t\tnew Vector3D(0, 0, 0),\t// centre of aperture\n\t\t\t\tnew Vector3D(0, 0, 1),\t// viewDirection\n\t\t\t\tnew Vector3D(0, 1, 0),\t// top direction vector\n\t\t\t\t20,\t// horiontalViewAngle in degrees; 2*MyMath.rad2deg(Math.atan(2./10.)) gives same view angle as in previous version\n\t\t\t\tSpaceTimeTransformationType.LORENTZ_TRANSFORMATION,\n\t\t\t\t(BETA_0?new Vector3D(0, 0, 0):beta),\t// beta\n\t\t\t\tpixelsX, pixelsY,\t// logical number of pixels\n\t\t\t\tExposureCompensationType.EC0,\t// exposure compensation +0\n\t\t\t\t1000,\t// maxTraceLevel\n\t\t\t\tnew EditableParametrisedPlane(\n\t\t\t\t\t\t\"focussing plane\",\n\t\t\t\t\t\tnew Vector3D(0, 0, FOCUSSING_DISTANCE),\t// point on plane\n\t\t\t\t\t\tnew Vector3D(0, 0, 1),\t// normal to plane\n\t\t\t\t\t\tSurfaceColour.BLACK_SHINY,\n\t\t\t\t\t\tscene,\n\t\t\t\t\t\tstudio\n\t\t\t\t),\t// focusScene,\n\t\t\t\tcameraFrameScene,\t//cameraFrameScene,\n\t\t\t\tAPERTURE_SIZE,\t// aperture size\n\t\t\t\tTEST?QualityType.BAD:QualityType.GREAT,\t// blur quality\n\t\t\t\tTEST?QualityType.NORMAL:QualityType.GOOD\t// QualityType.GREAT\t// anti-aliasing quality\n\t\t);\n\n\t\t// the reference shutter model\n\t\tFixedPointSurfaceShutterModel shutterModel = new FixedPointSurfaceShutterModel(beta);\t\t\n\t\tcamera.setShutterModel(shutterModel);\n\t\t\n\t\t// the standard scene objects\n\t\tscene.addSceneObject(SceneObjectClass.getChequerboardFloor(scene, studio));\t// the checkerboard floor\n\t\tscene.addSceneObject(SceneObjectClass.getSkySphere(scene, studio));\t// the sky\n\n\t\t// the cylinder lattice from TIMInteractiveBits's populateSceneRelativisticEdition method\n\t\tdouble cylinderRadius = 0.02;\n\n\t\t// a cylinder lattice...\n\t\tscene.addSceneObject(new EditableCylinderLattice(\n\t\t\t\t\"cylinder lattice\",\n\t\t\t\t-1.5, 1.5, 4,\t// x_min, x_max, no of cylinders => cylinders at x=-1.5, -0.5, +0.5, +1.5\n\t\t\t\t-1.5, 1.5, 4,\t// y_min, y_max, no of cylinders => cylinders at y=-1.5, -0.5, +0.5, +1.5\n\t\t\t\t-1, 10, 12, // z_min, z_max, no of cylinders => cylinders at z=-1, 0, 1, 2, ..., 10\n\t\t\t\tcylinderRadius,\n\t\t\t\tscene,\n\t\t\t\tstudio\n\t\t\t\t));\t\t\n\n\t\t// Tim's head\n\t\t// scene.addSceneObject(new EditableTimHead(\"Tim's head\", new Vector3D(0, 0, 10), scene, studio));\n\n\t\t// the Ninky Nonk Silhouette\n\t\tscene.addSceneObject(new EditableNinkyNonkSilhouette(scene, studio));\n\n\n\t\tstudio.setScene(scene);\n\t\tstudio.setLights(LightSource.getStandardLightsFromBehind());\n\t\tstudio.setCamera(camera);\n\n\t\treturn studio;\n\t}", "public Voice() {\n /* Make the utteranceProcessors a synchronized list to avoid\n * some threading issues.\n */\n utteranceProcessors = Collections.synchronizedList(new ArrayList());\n\tfeatures = new FeatureSetImpl();\n\tfeatureProcessors = new HashMap();\n\n\ttry {\n\t nominalRate = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"speakingRate\",\"150\"));\n\t pitch = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"pitch\",\"100\"));\n\t range = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"range\",\"10\"));\n\t volume = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"volume\",\"1.0\"));\n\t} catch (SecurityException se) {\n\t // can't get properties, just use defaults\n\t}\n outputQueue = null;\n audioPlayer = null;\n defaultAudioPlayer = null;\n }", "public MedianFinder() {\n\n }", "public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t//Bin MSP LibrarySpectra\n\t\t\tbinMasses();\n\n\t\t\tfor (double l=0.01; l<3.01; l=l+.01)\n\t\t\t{\n\t\t\t\tfor (double m=0.01; m<3.01; m=m+.01)\n\t\t\t\t{\n\t\t\t\t\tthis.intWeight = l;\n\t\t\t\t\tthis.massWeight = m;\n\n\t\t\t\t\t//Read in all mgf files\n\t\t\t\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateProgress((int)(Double.valueOf(i+1)\n\t\t\t\t\t\t\t\t/(Double.valueOf(mgfFiles.size())*100.0)),\"% - Loading Spectra\",true);\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Read in spectra and search\n\t\t\t\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mgf\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i)+\"_\"+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create mzxmlparser\n\t\t\t\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t\t\t\t//Read in mzxml files\n\t\t\t\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Parse MZXML\n\t\t\t\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t\t\t\t//Create SampleSpectrum objects\n\t\t\t\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mzxml\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\t\t\t\t\tupdateProgress(100,\"% - Completed\",true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public MedianFinder() { \n \n }", "public abstract Search create(String search, SearchBuilder builder);", "public GoogleSearch() {\n\n\n }", "public SearchDocument() {\n super();\n }", "Sticker.Factory getStickerFactory();", "public FilterSpec build() {\n return new FilterSpec(this);\n }", "@SuppressWarnings(\"unchecked\")\n private void initSearch() {\n if (searchBasic != null) {\n return;\n }\n try {\n // get a search class instance\n if (searchRecordTypeDesc.getSearchClass() != null) {\n search = (SearchT) searchRecordTypeDesc.getSearchClass().newInstance();\n }\n\n // get a advanced search class instance and set 'savedSearchId' into it\n searchAdvanced = null;\n if (StringUtils.isNotEmpty(savedSearchId)) {\n if (searchRecordTypeDesc.getSearchAdvancedClass() != null) {\n searchAdvanced = (SearchT) searchRecordTypeDesc.getSearchAdvancedClass().newInstance();\n Beans.setProperty(searchAdvanced, SAVED_SEARCH_ID, savedSearchId);\n } else {\n throw new NetSuiteException(new NetSuiteErrorCode(NetSuiteErrorCode.OPERATION_NOT_SUPPORTED),\n i18n.advancedSearchNotAllowed(recordTypeName));\n }\n }\n\n // basic search class not found or supported\n if (searchRecordTypeDesc.getSearchBasicClass() == null) {\n throw new NetSuiteException(new NetSuiteErrorCode(NetSuiteErrorCode.OPERATION_NOT_SUPPORTED),\n i18n.searchNotAllowed(recordTypeName));\n }\n\n // get a basic search class instance\n searchBasic = (SearchT) searchRecordTypeDesc.getSearchBasicClass().newInstance();\n\n } catch (InstantiationException | IllegalAccessException e) {\n throw new NetSuiteException(new NetSuiteErrorCode(NetSuiteErrorCode.INTERNAL_ERROR), e.getMessage(), e);\n }\n }", "public StreetSearcher() {\n vertices = new HashMap<>();\n graph = new SparseGraph<>();\n //double smDistance = 0;\n //previous = new HashMap<>();\n }", "public static QardioSCHelper getInstance(Context context) {\n if (instance == null) {\n synchronized (QardioSCHelper.class) {\n if (instance == null) {\n instance = new QardioSCHelper(context);\n }\n }\n }\n return instance;\n }", "public List<SpectrumMatch> getSpectrumMatches() {\r\n return spectrumMatches;\r\n }", "public Search() {\n this.timestamp = System.currentTimeMillis();\n }", "public interface ScoreAnalyzerFactory {\n ScoreAnalyzer create(ScoreProperties scoreProperties);\n}", "Schueler createSchueler();", "public JaccardSearcher(String docFilename) {\n super(docFilename);\n // TODO: YOUR CODE HERE\n\n // Instantiate the indexer\n // VSM MyCoolSearcher.Indexer is being used because we don't want to create static nested Builder class for the MyCoolSearcher.Indexer class\n indexer = new VectorSpaceModelIndexer.Builder(documents, stopWords).build();\n }", "public AbstractSearchEngine() {}", "public Scania() {\n\n super(2, 600, Color.white, \"Scania\", 13000);\n truckBed = new Ramp();\n }", "public Spectrum getSpectrum(String id) {\n return get(id);\n }", "public StimuliFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "private Search() {}", "public static DarthSidious getInstance(){\n return darthVader;\n }", "public void addSpectrum(Spectrum spectrum) {\n add(spectrum);\n }", "public void buildSearcher() throws IOException {\n IndexReader rdr = DirectoryReader.open(FSDirectory.open(new File(indexDir).toPath()));\n searcher = new IndexSearcher(rdr);\n parser = new QueryParser(\"text\", new StandardAnalyzer());\n }", "public Filter() {\n }", "static public SPARQLToSemQA getInstance() {\r\n\t\tif (instance == null) {\r\n\t\t\tinstance = new SPARQLToSemQA();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}", "public static Stocks getInstance() {\r\n if (instance == null) {\r\n instance = new Stocks();\r\n }\r\n\r\n return instance;\r\n }", "public SawLPFInstRT(int sampleRate, int filterCutoff){\r\n\t\tthis.sampleRate = sampleRate;\r\n\t\tthis.filterCutoff = filterCutoff;\r\n\t\tthis.channels = 1;\r\n\t}", "private CardReaderMonitorFactory() {\t\t\n\t}", "public LittleSearchEngine() {\n\t\tkeywordsIndex = new HashMap<String,ArrayList<Occurrence>>(1000,2.0f);\n\t\tnoiseWords = new HashSet<String>(100,2.0f);\n\t}", "public LittleSearchEngine() {\n\t\tkeywordsIndex = new HashMap<String,ArrayList<Occurrence>>(1000,2.0f);\n\t\tnoiseWords = new HashSet<String>(100,2.0f);\n\t}", "private CvParam getSpectrumType(String value) {\n CvParam cvParam = null;\n CvTermReference cvTerm = null;\n if (\"discrete\".equals(value)) {\n cvTerm = CvTermReference.CENTROID_SPECTRUM;\n } else if (\"continuous\".equals(value)) {\n cvTerm = CvTermReference.PROFILE_SPECTRUM;\n }\n\n if (cvTerm != null) {\n cvParam = new CvParam(cvTerm.getAccession(), cvTerm.getName(), cvTerm.getCvLabel(),\n value, null, null, null);\n }\n return cvParam;\n }", "static synchronized public void staticInitialize()\n {\n if (!isInitialized)\n {\n if (!startedInitializing)\n {\n startedInitializing = true;\n\n cm = new ConfigurationManager(SphinxSignalInfoProvider.class.getResource(\"hellongram.config.xml\"));\n\n // allocate the recognizer\n System.out.println(\"Loading spinx recognizer...\");\n recognizer = (Recognizer) cm.lookup(\"recognizer\");\n recognizer.allocate();\n\n //speechClassifier = (SpeechClassifier) cm.lookup(\"speechClassifier\");\n //speechClassifier.initialize();\n\n inMindDataProcessor = (InMindDataProcessor) cm.lookup(\"inMindDataProcessor\");\n\n inMindByteDataSource = (InMindByteDataSource) cm.lookup(\"inMindByteDataSource\");\n\n\n isInitialized = true;\n System.out.println(\"Spinx recognizer loaded.\");\n\n recognizerThread = new Thread(() -> {\n try\n {\n while (true)\n {\n recognizer.recognize();\n }\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n });\n recognizerThread.start();\n }\n }\n }", "public FrequencyMonitor(ADEGuiCallHelper helper, int smoothingWindow) {\n super(helper, 500);\n initComponents();\n outputLbl.setText(\"0 Hz\");\n lastTime = System.currentTimeMillis();\n stats = new DescriptiveStatistics(smoothingWindow);\n\n this.setTitle(call(\"getDataName\", String.class));\n}", "public ZElectricMeterExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public SearchService(String name) {\n super(\"\");\n }", "public SiddhiAdapterFactory()\n {\n if (modelPackage == null)\n {\n modelPackage = SiddhiPackage.eINSTANCE;\n }\n }", "public DefaultSpectrumAnalyzerSettings (\n final byte[] bytes,\n final Unit unit,\n final double centerFrequency_MHz,\n final double span_MHz,\n final double resolutionBandwitdh_Hz,\n final boolean resolutionBandwidthCoupled,\n final double videoBandwitdh_Hz,\n final boolean videoBandwidthCoupled,\n final double sweepTime_s,\n final boolean sweepTimeCoupled,\n final double referenceLevel_dBm,\n final double rfAttenuation_dB,\n final boolean rfAttenuationCoupled)\n {\n this.bytes = bytes;\n this.unit = unit;\n this.centerFrequency_MHz = centerFrequency_MHz;\n this.span_MHz = span_MHz;\n this.resolutionBandwidth_Hz = resolutionBandwitdh_Hz;\n this.resolutionBandwidthCoupled = resolutionBandwidthCoupled;\n this.videoBandwidth_Hz = videoBandwitdh_Hz;\n this.videoBandwidthCoupled = videoBandwidthCoupled;\n this.sweepTime_s = sweepTime_s;\n this.sweepTimeCoupled = sweepTimeCoupled;\n this.referenceLevel_dBm = referenceLevel_dBm;\n this.rfAttenuation_dB = rfAttenuation_dB;\n this.rfAttenuationCoupled = rfAttenuationCoupled;\n }", "public Spectrum(String scanname, int scannum, int z, int mslevel, double precursormass, double rettime, float[] peakmz, float[] peakint) {\n\t\tscanName = scanname;\n\t\tscanNum = scannum;\n\t\tcharge = z;\n\t\tprecursorMass = precursormass;\n\t\trt = rettime;\n\t\tpeakMZ = peakmz;\n\t\tpeakInt = peakint;\n\t\tmsLevel = mslevel;\n\t\tnorm = -1;\n\t\tif(fact == null) {\n\t\t\tfact = new float[128];\n\t\t\tfact[0] = 0;\n\t\t\tfor(int i = 1; i < 128; i++)\n\t\t\t\tfact[i] = (float)(fact[i-1] + Math.log(i));\n\t\t}\n\t\tbasePeakInt = findBasePeakInt();\n\t}", "public Simulator(){}", "public SpamAnalyzer( )\n\t{\n\t\tsuper( );\n\t}", "public static SPSSDialog getNewInstance(FormDef form)\n\t{\n\t\tinstance = new SPSSDialog(form);\n\t\treturn instance;\n\t}", "public NormalSearch() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {\n super();\n //ins = new globalInstance();\n // TODO Auto-generated constructor stub\n }", "public Frequency() {\n\n }", "public CarVo(String band, int size) {\n this.band = band;\n this.size = size;\n }", "public void createChain(){\r\n Oscillator wt = new Oscillator(this, Oscillator.SAWTOOTH_WAVE, this.sampleRate, this.channels);\r\n Filter filt = new Filter(wt, this.filterCutoff, Filter.LOW_PASS);\r\n Envelope env = new Envelope(filt, \r\n new double[] {0.0, 0.0, 0.05, 1.0, 0.3, 0.4, 1.0, 0.0});\r\n\t\tVolume vol = new Volume(env);\r\n//\t\tSampleOut sout = new SampleOut(vol);\r\n\t}", "QualityScenario createQualityScenario();", "public Sone(int windowSize, float sampleRate) throws IllegalArgumentException\n {\n //check for correct window size\n if(windowSize < 32)\n {\n throw new IllegalArgumentException(\"window size must be at least 32\");\n }\n else\n {\n int i = 32;\n while(i < windowSize && i < Integer.MAX_VALUE)\n i = i << 1;\n\n if(i != windowSize)\n throw new IllegalArgumentException(\"window size must be 2^n\");\n }\n\n //check sample rate\n sampleRate = Math.round(sampleRate);\n if(sampleRate < 1)\n throw new IllegalArgumentException(\"sample rate must be at least 1\");\n\n //initialize fields\n this.windowSize = windowSize;\n this.hopSize = windowSize/2; //50% Overleap\n this.sampleRate = sampleRate;\n this.baseFreq = sampleRate/windowSize;\n\n //create buffers\n inputData = new double[windowSize];\n buffer = new double[windowSize];\n\n //get upper boundaries for the used bark bands\n bark_upper = getBarkUpperBoundaries(sampleRate);\n\n //create normalized power fft object\n normalizedPowerFFT = new FFT(FFT.FFT_NORMALIZED_POWER, windowSize, FFT.WND_HANNING);\n\n //get weights for simulation of the perception of the outer ear\n terhardtWeight = getTerhardtWeights(baseFreq, windowSize);\n\n //create spread matrix for spectral masking\n spreadMatrix = getSpreadMatrix(bark_upper.length);\n }", "private static PacketAnalyzer loadInstance(String analyzerClassName) {\n PacketAnalyzer packetAnalyzer = null;\n try {\n \t//System.out.println(\"--- Looking for : \" + analyzerClassName);\n packetAnalyzer = (PacketAnalyzer) Class.forName(analyzerClassName).newInstance();\n //System.out.println(\"--- Found : \" + analyzerClassName);\n } catch (InstantiationException e) {\n e.printStackTrace();\n //System.out.println(\"--- Creating the default PacketAnalyzer (InstantiationException) ---\");\n packetAnalyzer = new PacketAnalyzer();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n //System.out.println(\"--- Creating the default PacketAnalyzer (IllegalAccessException) ---\");\n packetAnalyzer = new PacketAnalyzer();\n } catch (ClassNotFoundException e) {\n //System.out.println(\"--- PacketAnalyzer subclass \" + analyzerClassName + \" not found ---\");\n //System.out.println(\"--- Creating the default PacketAnalyzer ---\");\n packetAnalyzer = new PacketAnalyzer();\n }\n return packetAnalyzer;\n }", "public Filters() {\n }", "default List<SearchResult> search(String tvShowName, int season, int episode, Quality quality) {\n return search(new SearchQuery(tvShowName, season, episode, quality));\n }", "public Study() {\n siteList = new ArrayList<Site>();\n readingList = new ArrayList<Reading>();\n studyName = null;\n studyID = null;\n }", "public Solid() {\n\t\tthis.name = null;\n\t\tthis.facets = new ArrayList<Facet>(0);\n\t}", "public SolrQuery() {\n super(null);\n store = null;\n }", "public static synchronized StockGrabber getInstance(String stockName) {\r\n StockGrabber instance = singletonMap.getOrDefault(stockName, null);\r\n if (instance == null) {\r\n instance = new StockGrabber(stockName);\r\n singletonMap.put(stockName, instance);\r\n }\r\n\r\n return instance;\r\n\r\n }", "public Filter () {\n\t\tsuper();\n\t}", "public GroupsOnlySenseFilter() {\n \n }", "public void addSpectrum(LibrarySpectrum spectrum)\n\t{\n\t\tlibrarySpectra.add(spectrum);\n\t\tif (spectrum.precursor > maxMass) maxMass = spectrum.precursor;\n\t\tif (spectrum.precursor < minMass) minMass = spectrum.precursor;\n\t\tspectrum.scaleIntensities();\n\t}", "public WaveSystem()\n\t{\n\t\t\n\t}", "public CommandLineFSRecognizer() {\n init();\n }", "private StreamFactory()\n {\n /*\n * nothing to do\n */\n }", "public static SelectiveSearchSegmentation createSelectiveSearchSegmentation()\r\n {\r\n \r\n SelectiveSearchSegmentation retVal = SelectiveSearchSegmentation.__fromPtr__(createSelectiveSearchSegmentation_0());\r\n \r\n return retVal;\r\n }", "Instance createInstance();", "public static TokenFilterFactory getInstance() {\n\t\tif (instance == null) {\n\t\t\tsynchronized (TokenFilterFactory.class) {\n\t\t\t\tif (instance == null) {\n\t\t\t\t\t//System.out.println(\"getInstance(): First time getInstance was invoked!\");\n\t\t\t\t\tinstance = new TokenFilterFactory();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn instance;\n\t}", "public ISpectralCluster asCluster() {\n SpectralCluster ret = new SpectralCluster(getId());\n ret.addSpectra(this);\n return ret;\n }", "public ObjectFilter()\n\t{\n\t}", "public static DataScan createFullScan() {\n DataScan scan = SIDriver.driver().getOperationFactory().newDataScan(null);\n scan.startKey(SIConstants.EMPTY_BYTE_ARRAY).stopKey(SIConstants.EMPTY_BYTE_ARRAY).returnAllVersions();\n return scan;\n }", "@Override\r\n\tpublic Explore getNewInstance() {\n\t\treturn new ZYDCExplore();\r\n\t}" ]
[ "0.5696496", "0.5576217", "0.54888535", "0.53239214", "0.5323394", "0.53157073", "0.5312836", "0.5263841", "0.52046746", "0.5171699", "0.5142163", "0.510441", "0.5080646", "0.5065191", "0.5008993", "0.5005085", "0.49689204", "0.49635428", "0.4962464", "0.49597073", "0.49442884", "0.49403703", "0.49294373", "0.49169394", "0.4910605", "0.48879442", "0.4881353", "0.48355448", "0.48337498", "0.48216054", "0.48123083", "0.47909155", "0.47893238", "0.47873795", "0.4785756", "0.47815624", "0.47783914", "0.47593015", "0.4758886", "0.4752207", "0.47466817", "0.47457033", "0.47347486", "0.47325024", "0.47324038", "0.4731596", "0.47227308", "0.4720936", "0.47183755", "0.47066355", "0.46978545", "0.46965075", "0.46955872", "0.46921104", "0.46848038", "0.46754548", "0.46710506", "0.46702468", "0.46687523", "0.46611708", "0.4658811", "0.46479857", "0.46479857", "0.46412185", "0.46387464", "0.46356022", "0.46330893", "0.46139005", "0.46130234", "0.4611953", "0.46086547", "0.4597186", "0.45920327", "0.45852447", "0.4581644", "0.4577438", "0.45735607", "0.4567585", "0.45599172", "0.4549169", "0.45485142", "0.4548198", "0.45456737", "0.45421812", "0.4541289", "0.45354512", "0.4533564", "0.4533311", "0.45323905", "0.45313704", "0.45279983", "0.45266333", "0.45263728", "0.45257473", "0.4518342", "0.45180872", "0.45089436", "0.4507076", "0.4506063", "0.45055756" ]
0.55101067
2
Method to populate hash array and search all spectra
public void runSpectraSearch(ArrayList <File> lipidLibs, double mzTol) throws CustomException, IOException { this.lipidLibs = lipidLibs; //Verifies no result files are open checkFileStatus(); //Read fatty acids readFattyAcids("src\\backup\\FattyAcids.csv"); //Read in MSP Files try { readMSP(); } catch (Exception e) { CustomError ce = new CustomError("Error loading library .msp", e); } //Sort arrays by mass, lowest to highest Collections.sort(librarySpectra); updateProgress(100,"% - Sorting Libraries",true); //Bin MSP LibrarySpectra binMasses(); updateProgress(0,"% - Searching Spectra",true); //Read in all mgf files for (int i=0; i<mgfFiles.size(); i++) { timeStart = System.nanoTime(); numSpectra = 0; //Read in spectra and search readMGF(mgfFiles.get(i)); //Iterate through spectra and match for (int j=0; j<sampleMS2Spectra.size(); j++) { matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol); } //Calculate purity values for (int j=0; j<sampleMS2Spectra.size(); j++) { sampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol); } //Write ouput files for mgf try { writeResults(sampleMS2Spectra,mgfFiles.get(i),maxResults); } catch (IOException e) { CustomError ce = new CustomError("Please close "+mgfFiles.get(i)+" and re-search the data",null); } //Clear sample spectra sampleMS2Spectra = new ArrayList<SampleSpectrum>(); updateProgress((int)((Double.valueOf(i+1) /(Double.valueOf(mgfFiles.size())))*100.0),"% - Searching Spectra",true); } //Create mzxmlparser MZXMLParser parser = new MZXMLParser(); //Read in mzxml files for (int i=0; i<mzxmlFiles.size(); i++) { timeStart = System.nanoTime(); numSpectra = 0; //Parse MZXML parser.readFile(mzxmlFiles.get(i)); //Create SampleSpectrum objects for (int j=0; j<parser.sampleSpecArray.size(); j++) { sampleMS2Spectra.add(parser.sampleSpecArray.get(j)); } //Iterate through spectra and match for (int j=0; j<sampleMS2Spectra.size(); j++) { matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol); } //Calculate purity values for (int j=0; j<sampleMS2Spectra.size(); j++) { sampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol); } //Write ouput files for mzxml writeResults(sampleMS2Spectra,mzxmlFiles.get(i),maxResults); //Clear sample spectra sampleMS2Spectra = new ArrayList<SampleSpectrum>(); updateProgress((int)((Double.valueOf(i+1) /(Double.valueOf(mgfFiles.size())))*100.0),"% - Searching Spectra",true); } updateProgress(100,"% - Completed",true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t//Bin MSP LibrarySpectra\n\t\t\tbinMasses();\n\n\t\t\tfor (double l=0.01; l<3.01; l=l+.01)\n\t\t\t{\n\t\t\t\tfor (double m=0.01; m<3.01; m=m+.01)\n\t\t\t\t{\n\t\t\t\t\tthis.intWeight = l;\n\t\t\t\t\tthis.massWeight = m;\n\n\t\t\t\t\t//Read in all mgf files\n\t\t\t\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateProgress((int)(Double.valueOf(i+1)\n\t\t\t\t\t\t\t\t/(Double.valueOf(mgfFiles.size())*100.0)),\"% - Loading Spectra\",true);\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Read in spectra and search\n\t\t\t\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mgf\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i)+\"_\"+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create mzxmlparser\n\t\t\t\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t\t\t\t//Read in mzxml files\n\t\t\t\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Parse MZXML\n\t\t\t\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t\t\t\t//Create SampleSpectrum objects\n\t\t\t\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mzxml\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\t\t\t\t\tupdateProgress(100,\"% - Completed\",true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}", "private List<SpectrumInterface> fetchSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\tif (spectrumIds == null)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tsetSpectrumIdsTarget(spectrumIds);\r\n\t\t/*\r\n\t\t * Reset spectrum data.\r\n\t\t */\r\n\t\tint nSpectra = spectrumIds.size();\r\n\t\tspectrumArray = new SpectrumImpl[nSpectra];\r\n\t\t\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t\r\n\t\t/*\r\n\t\t * Create list of mass and intensity data and get dataLength as side\r\n\t\t * result.\r\n\t\t */\r\n\t\tint dataLength = 0;\r\n\t\tList<Double> peakMassData = new ArrayList<Double>();\r\n\t\tList<Double> peakIntensityData = new ArrayList<Double>();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\tfloat basePeakIntensity = 0, totalIntensity = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tspectrumTagsFound = 0;\r\n\t\t\tinTargetSpectrumBlock = false;\r\n\t\t\tString line;\r\n\t\t\tint lineNo = 0;\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\tif (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * New spectrum\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"New spectrum: numberOfSpectra = \" + numberOfSpectra);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if data for previous peak list has been collected.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif (inTargetSpectrumBlock)\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\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Reset peak list data.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tdataLength = 0;\r\n\t\t\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add spectrum id to list if not already in it.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!getSpectrumIdsFound().contains(currentSpectrumIdStr))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if desired spectrum id found.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tspectrumIndex = -1;\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (currentSpectrumIdStr.equals(getSpectrumIdsTarget().get(i)))\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\t * Save information in order to get\r\n\t\t\t\t\t\t\t * spectrum mass and intensity values.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t\t\tinTargetSpectrumBlock = true;\r\n\t\t\t\t\t\t\tspectrumIndex = i;\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get new spectrum object to store retrieved data in.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tSpectrumImpl currentSpectrum = SpectrumImpl.buildSpectrum(); // changed slewis to allow class to change\r\n\t\t\t\t\t\t\tsetSpectrum(currentSpectrum);\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + spectrumIndex + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" found.\");\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get spectrum header data from PKL file\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\ttotalIntensity = 0;\r\n\t\t\t\t\t\t\tbasePeakIntensity = 0;\r\n\t\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\t\t\tFloat massToChargeRatio = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tFloat intensity = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tInteger chargeState = Integer.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\t// Store spectrum header values from PKL file\r\n\t\t\t\t\t\t\t//log.debug(\"SpectrumId = \\\"\" + getCurrentSpectrumId() + \"\\\" massToChargeRatio = \" + massToChargeRatio + \" intensity = \" + intensity + \" chargeState = \" + chargeState);\r\n\t\t\t\t\t\t\tSpectrumPrecursor spectrumPrecursor = SpectrumPrecursor.buildSpectrumPrecursor(); // changed slewis to support overrides\r\n\t\t\t\t\t\t\tspectrumPrecursor.setMassToChargeRatio(massToChargeRatio.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setIntensity(intensity.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setCharge(chargeState);\r\n\t\t\t\t\t\t\tList<SpectrumPrecursor> precursors = new ArrayList<SpectrumPrecursor>();\r\n\t\t\t\t\t\t\tprecursors.add(spectrumPrecursor);\r\n\t\t\t\t\t\t\tgetSpectrum().setPrecursors(precursors);\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 (inTargetSpectrumBlock && line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Collect data for peak.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\tdouble peakMass = Double.valueOf(st.nextToken());\r\n\t\t\t\t\tdouble peakIntensity = Double.valueOf(st.nextToken());\r\n\t\t\t\t\t//log.debug(\"Spectra line (\" + lineNo + \") = \\\"\" + line + \"\\\", peakMass = \" + peakMass + \" peakIntensity = \" + peakIntensity);\r\n\t\t\t\t\tpeakMassData.add(dataLength, peakMass);\r\n\t\t\t\t\tpeakIntensityData.add(dataLength, peakIntensity);\r\n\t\t\t\t\tdataLength++;\r\n\t\t\t\t\t// Update statistical spectrum values\r\n\t\t\t\t\tif (peakIntensity > basePeakIntensity)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePeakIntensity = (float) peakIntensity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttotalIntensity += peakIntensity;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Other line\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"Unidentified line (\" + lineNo + \") = \\\"\" + line + \"\\\"\");\r\n\t\t\t\t}\r\n\t\t\t\tlineNo++;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Check if data for peak list has been collected.\r\n\t\t\t */\r\n\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t */\r\n\t\t\t\tif (inTargetSpectrumBlock)\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t/*\r\n\t\t\t\t * Reset peak list data.\r\n\t\t\t\t */\r\n\t\t\t\tdataLength = 0;\r\n\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Return result of search for PKL spectra.\r\n\t\t\t */\r\n\t\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>(nSpectra);\r\n\t\t\tfor (int i = 0; i < nSpectra; i++)\r\n\t\t\t{\r\n\t\t\t\tspectrumList.add(i, spectrumArray[i]);\r\n\t\t\t}\r\n\t\t\treturn spectrumList;\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\tthrow new BaseException(message);\r\n\t\t}\r\n\t}", "public List<SpectrumMatch> getSpectrumMatches() {\r\n return spectrumMatches;\r\n }", "private List<String> fetchSpectrumIds()\r\n\t\t\tthrows InvalidDataException\r\n\t{\r\n\t\t/*\r\n\t\t * Reset search items.\r\n\t\t */\r\n\t\tresetIdsToFind();\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tString line;\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 (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// New spectrum\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return null if no items found.\r\n\t\t */\r\n\t\tif (getSpectrumIdsFound().size() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return result of search for spectrum id values.\r\n\t\t */\r\n\t\treturn getSpectrumIdsFound();\r\n\t}", "public Set<String> getSpectrumFileNames() {\n\n \n return spectrumFiles.keySet();\n\n }", "private static void initializeAllGenresList(){\n\t\tfor(int i = 0; i < 13; i ++){\n\t\t\tALL_GENRES.add(new HashSet<String>());\n\t\t}\n\t}", "public void addSpectrumMatch(SpectrumMatch sm) {\r\n id2index.put(sm.getSpectrumId(), spectrumMatches.size());\r\n spectrumMatches.add(sm);\r\n }", "private HashMap<String, Double> getHashMapScore(String query){\n WaveIO waveIO = new WaveIO();\n\n short[] inputSignal = waveIO.readWave(query);\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeatureQuery = ms.getFeature(inputSignal);\n Energy energy = new Energy();\n double[] energyFeatureQuery = energy.getFeature(inputSignal);\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeatureQuery = zc.getFeature(inputSignal);\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(inputSignal);\n double[] mfccFeatureQuery = mfcc.getMeanFeature();\n \n \n // Get cosine SimList\n HashMap<String, Double> cosineSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineMsSimList.put(f.getKey(), (Cosine.getDistance(msFeatureQuery, (double[]) f.getValue())));\n \t// System.out.println(cosineMsSimList.get(f.getKey()));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcosineEnergySimList.put(f.getKey(), (Cosine.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcosineZcSimList.put(f.getKey(), (Cosine.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcosineMfccSimList.put(f.getKey(), (Cosine.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cosineMsSimList);\n normalizeValue(cosineEnergySimList);\n normalizeValue(cosineZcSimList);\n normalizeValue(cosineMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineSimList.put(f.getKey(), (m_msFeatureWeight * cosineMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cosineEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cosineZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cosineMfccSimList.get(f.getKey())));\n }\n \n // Get Euclidean SimList\n HashMap<String, Double> euclideanSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \teuclideanEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \teuclideanZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \teuclideanMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(euclideanMsSimList);\n normalizeValue(euclideanEnergySimList);\n normalizeValue(euclideanZcSimList);\n normalizeValue(euclideanMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanSimList.put(f.getKey(), (m_msFeatureWeight * euclideanMsSimList.get(f.getKey())) + (m_energyFeatureWeight * euclideanEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * euclideanZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * euclideanMfccSimList.get(f.getKey())));\n }\n \n // Get CityBlock SimList\n HashMap<String, Double> cityblockSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcityblockEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcityblockZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcityblockMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cityblockMsSimList);\n normalizeValue(cityblockEnergySimList);\n normalizeValue(cityblockZcSimList);\n normalizeValue(cityblockMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockSimList.put(f.getKey(), (m_msFeatureWeight * cityblockMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cityblockEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cityblockZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cityblockMfccSimList.get(f.getKey())));\n }\n \n // Overall\n HashMap<String, Double> simList = new HashMap<String, Double>();\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tsimList.put(f.getKey(), (m_cosineWeight * cosineSimList.get(f.getKey())) + (m_euclideanWeight * euclideanSimList.get(f.getKey())) + (m_cityblockWeight * cityblockSimList.get(f.getKey())));\n }\n \n return simList;\n }", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "private List<Map<Species, Integer>> getObservedSpeciesMaps() {\n List<Map<Species, Integer>> observedSpeciesMap = new ArrayList<>(observedSpecies.size());\n for (WatchList watchList : observedSpecies.values()) {\n observedSpeciesMap.add(watchList.getObservedSpeciesMap());\n }\n return observedSpeciesMap;\n }", "HashMap<String, Instrument> getInstruments();", "public void setSpectrumMatches(List<SpectrumMatch> spectrumMatches) {\r\n this.spectrumMatches = spectrumMatches;\r\n }", "public int getNumberSpectra() {\n return numberSpectra;\n }", "public Fingerprint[] fingerprints();", "public int getNumberOfSpectra() {\r\n return nSpectrum;\r\n }", "private void createSoundsMap(NodeList soundEventsList) {\r\n\r\n // reset the event sounds queue\r\n eventQ = new ConcurrentLinkedQueue<EnvironmentEvent>();\r\n\r\n // empty node list -> empty map with playable sounds\r\n if (soundEventsList == null) {\r\n return;\r\n }\r\n\r\n boolean midiSoundFound = false;\r\n boolean instrumentFound = false;\r\n\r\n for (int i = 0; i < soundEventsList.getLength(); i++) {\r\n // nothing set yet for this sound\r\n String durationValue = \"\";\r\n String eventTypeValue = \"\";\r\n String messageTypeValue = \"\";\r\n String soundFileValue = \"\";\r\n String instrumentValue = \"\";\r\n String noteSequenceValue = \"\";\r\n String propertyValue = \"\";\r\n String soundPropertyValue = \"\";\r\n Object property = 0;\r\n SonificationMap sonificationMap = null;\r\n MIDIMap midiMap = new MIDIMap();\r\n String functionType = \"\";\r\n String a0Value = \"\";\r\n String a1Value = \"\";\r\n String a2Value = \"\";\r\n String a3Value = \"\";\r\n int v0Value = 0;\r\n int v1Value = 0;\r\n int v2Value = 0;\r\n int v3Value = 0;\r\n int v4Value = 0;\r\n NodeList midiList = null;\r\n Sound playMIDI = null;\r\n Sound playSoundFile = null;\r\n long duration = DURATION_DEFAULT;\r\n\r\n if (soundEventsList.item(i).hasAttributes()) {\r\n\r\n // extract Attributes of EventAppearance\r\n NamedNodeMap attributes = soundEventsList.item(i).getAttributes();\r\n\r\n // parse attributes: \"eventType\", \"duration\", \"soundFile\"\r\n for (int j = 0; j < attributes.getLength(); j++) {\r\n if (attributes.item(j).getNodeName().equals(EVENT_TYPE)) {\r\n eventTypeValue = attributes.item(j).getNodeValue();\r\n }\r\n if (attributes.item(j).getNodeName().equals(MESSAGE_TYPE)) {\r\n messageTypeValue = attributes.item(j).getNodeValue();\r\n }\r\n if (attributes.item(j).getNodeName().equals(DURATION)) {\r\n\r\n durationValue = attributes.item(j).getNodeValue();\r\n try {\r\n duration = Long.parseLong(durationValue);\r\n } catch (Exception ex) {\r\n duration = DURATION_DEFAULT;\r\n }\r\n }\r\n\r\n if (attributes.item(j).getNodeName().equals(SOUNDFILE)) {\r\n soundFileValue = attributes.item(j).getNodeValue();\r\n }\r\n }\r\n\r\n // default event type if none is set in XML: see constant\r\n // EVENT_TYPE_DEFAULT\r\n if (eventTypeValue.equals(\"\")) {\r\n eventTypeValue = EVENT_TYPE_DEFAULT;\r\n }\r\n // dealing with out messages\r\n else if (messageTypeValue != null && messageTypeValue.length() > 0) {\r\n eventTypeValue += (this.typesNameDelimiter + messageTypeValue);\r\n }\r\n\r\n // if source file is defined then we deal with MP3 or MIDI files we have\r\n // notes definitions as sequences\r\n if (soundFileValue.equals(\"\")) {\r\n\r\n // search for MidiSound Elements\r\n if (soundEventsList.item(i).hasChildNodes()) {\r\n midiList = soundEventsList.item(i).getChildNodes();\r\n for (int k = 0; k < midiList.getLength(); k++) { // Nodes n*\r\n // \"MidiSound\"\r\n if (midiList.item(k).getNodeName().equals(MIDI_SOUND)) {\r\n midiSoundFound = true;\r\n if (midiList.item(k).hasAttributes()) {\r\n // extract Attributes of MidiSound\r\n NamedNodeMap childAttributes = midiList.item(k)\r\n .getAttributes();\r\n for (int l = 0; l < childAttributes.getLength(); l++) {\r\n // Attributes: \"instrumentName\", \"instrumentNo\",\r\n // \"noteSequence\"\r\n if (childAttributes.item(l).getNodeName().equals(\r\n INSTRUMENT_NAME)) {\r\n int temp = midiMap.getInstrumentNo(childAttributes\r\n .item(l).getNodeValue());\r\n if (temp != -1) {\r\n instrumentValue = Integer.toString(temp);\r\n instrumentFound = true;\r\n }\r\n }\r\n // the \"instrumentName\" property has priority over\r\n // \"instrumentNo\" property\r\n if (childAttributes.item(l).getNodeName().equals(\r\n INSTRUMENT_NO)\r\n && !instrumentFound) {\r\n instrumentValue = childAttributes.item(l).getNodeValue();\r\n }\r\n if (childAttributes.item(l).getNodeName().equals(\r\n NOTE_SEQUENCE)) {\r\n noteSequenceValue = childAttributes.item(l)\r\n .getNodeValue();\r\n }\r\n\r\n }// for l\r\n\r\n // set Default Value if \"instrumentNo\", \"velocity\" or\r\n // \"noteSequence\" are not set\r\n if (instrumentValue.equals(\"\")) {\r\n instrumentValue = INSTRUMENT_DEFAULT;\r\n }\r\n if (noteSequenceValue.equals(\"\")) {\r\n noteSequenceValue = \"//\";\r\n }\r\n\r\n } else {\r\n instrumentValue = INSTRUMENT_DEFAULT;\r\n noteSequenceValue = \"//\";\r\n }\r\n\r\n int[][] notes = extractNotes(noteSequenceValue);\r\n\r\n // no duration was defined then is computed as the sum\r\n // of the duration for all defined note sequences\r\n if (duration == -1) {\r\n duration = 0;\r\n for (int d = 0; d < notes[1].length; d++) {\r\n duration += notes[1][d];\r\n }\r\n }\r\n\r\n int instrument;\r\n try {\r\n instrument = Integer.parseInt(instrumentValue);\r\n } catch (Exception e) {\r\n instrument = Integer.parseInt(INSTRUMENT_DEFAULT);\r\n }\r\n\r\n // search for SonifikationMap Elements\r\n if (midiList.item(k).hasChildNodes()) {\r\n NodeList nl = midiList.item(k).getChildNodes();\r\n for (int m = 0; m < nl.getLength(); m++) { // Nodes n*\r\n // \"SonificationMap\"\r\n if (nl.item(m).getNodeName().equals(SONIFICATIONMAP)) {\r\n\r\n // reset for next SonificationMap\r\n propertyValue = \"\";\r\n property = null;\r\n soundPropertyValue = \"\";\r\n functionType = \"\";\r\n a0Value = \"\";\r\n a1Value = \"\";\r\n a2Value = \"\";\r\n a3Value = \"\";\r\n v0Value = 0;\r\n v1Value = 0;\r\n v2Value = 0;\r\n v3Value = 0;\r\n v4Value = 0;\r\n\r\n if (nl.item(m).hasAttributes()) {\r\n // extract Attributes of SonificationMap\r\n NamedNodeMap childAttributes = nl.item(m)\r\n .getAttributes();\r\n for (int n = 0; n < childAttributes.getLength(); n++) {\r\n // Attributes : \"property\", \"soundProperty\",\r\n // \"casewise\", \"a0\", \"a1\", \"a2, \"a3\", \"v0\", \"v1\",\r\n // \"v2, \"v3\"\r\n if (childAttributes.item(n).getNodeName().equals(\r\n PROPERTY)) {\r\n propertyValue = childAttributes.item(n)\r\n .getNodeValue();\r\n try {\r\n property = propertyValue;\r\n } catch (Exception e) {\r\n property = null;\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(\r\n SOUND_PROPERTY)) {\r\n soundPropertyValue = childAttributes.item(n)\r\n .getNodeValue();\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(\r\n MAP_TYPE)) {\r\n functionType = childAttributes.item(n)\r\n .getNodeValue();\r\n }\r\n\r\n if (childAttributes.item(n).getNodeName().equals(A0)) {\r\n try {\r\n a0Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A1)) {\r\n try {\r\n a1Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A2)) {\r\n try {\r\n a2Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A3)) {\r\n try {\r\n a3Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V0)) {\r\n try {\r\n v0Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V1)) {\r\n try {\r\n v1Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V2)) {\r\n try {\r\n v2Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V3)) {\r\n try {\r\n v3Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V4)) {\r\n try {\r\n v4Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n // create the sonification map\r\n sonificationMap = new SonificationMap(notes,\r\n instrument, duration, this.useCloneMapValues,\r\n propertyValue, soundPropertyValue, functionType,\r\n a0Value, a1Value, a2Value, a3Value, v0Value,\r\n v1Value, v2Value, v3Value, v4Value);\r\n\r\n if (soundPropertyValue.equals(NOTE)) {\r\n notes = sonificationMap.mapNotes(property);\r\n } else if (soundPropertyValue.equals(DURATION)) {\r\n notes = sonificationMap.mapDuration(property);\r\n } else if (soundPropertyValue.equals(VOLUME)) {\r\n notes = sonificationMap.mapVolume(property);\r\n } else if (soundPropertyValue.equals(INSTRUMENT_NO)) {\r\n instrument = sonificationMap\r\n .mapInstrument(property);\r\n }\r\n\r\n this.sonificationMap.put(eventTypeValue,\r\n sonificationMap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Channelmanagement + set Instrument\r\n\r\n // create the MIDI sound object\r\n playMIDI = new SoundMIDI(notes);\r\n ((SoundMIDI) playMIDI).setInstrument(instrument);\r\n\r\n this.soundsMap.put(eventTypeValue, playMIDI);\r\n this.soundEventActiveStateMap.put(eventTypeValue, true);\r\n this.soundEventsTypeNameMap.put(eventTypeValue, \"MIDI\");\r\n\r\n // reset for next MidiSound\r\n instrumentValue = \"\";\r\n noteSequenceValue = \"\";\r\n instrumentFound = false;\r\n }\r\n }// for k\r\n\r\n }// if hasChildNodes\r\n if (!midiSoundFound) {\r\n System.out\r\n .println(\"Warrning: MidiSound attributes in EventAppearance needed !\");\r\n }\r\n }\r\n // the sound is from a file\r\n else {\r\n\r\n if (soundFileValue.length() < 4) {\r\n System.out\r\n .println(\"The name of the sound file must have at least 5 chars and ends with '.mid' or '.mp3' ! Found: \"\r\n + soundFileValue);\r\n break;\r\n }\r\n\r\n String fileExtension = soundFileValue.substring(soundFileValue\r\n .length() - 3);\r\n\r\n // if MP3 file\r\n if (fileExtension.equalsIgnoreCase(\"mp3\")) {\r\n\r\n // create new background sound\r\n playSoundFile = new SoundMP3(duration, soundFileValue,\r\n this.projectDirectory);\r\n }\r\n\r\n // if MIDI file\r\n if (fileExtension.equalsIgnoreCase(\"mid\")) {\r\n\r\n // create new background sound\r\n playSoundFile = new SoundMIDI(this.projectDirectory, soundFileValue);\r\n }\r\n\r\n this.soundsMap.put(eventTypeValue, playSoundFile);\r\n this.soundEventActiveStateMap.put(eventTypeValue, true);\r\n this.soundEventsTypeNameMap.put(eventTypeValue, soundFileValue);\r\n\r\n }\r\n }\r\n }\r\n }", "private void scanDocuments()\n{\n document_counts = new HashMap<>();\n kgram_counts = new HashMap<>();\n for (File f : root_files) {\n addDocuments(f);\n }\n}", "public static List<Handset> search(Map<String, String> reqParam) {\n\n\t\tList<Handset> temp = new ArrayList<Handset>();\n\t\ttemp.addAll(cache.values());\n\n\t\tfor (String param : reqParam.keySet()) {\n\t\t\tString val = (String) reqParam.get(param);\n\n\t\t\tswitch (param) {\n\t\t\tcase \"priceEur\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getPriceEur() == Integer.parseInt(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"sim\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getSim().toLowerCase().contains(val.toLowerCase()))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"announceDate\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getAnnounceDate().equalsIgnoreCase(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\ttemp = new ArrayList<Handset>();\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"filtered handset size \" + temp.size());\n\t\treturn temp;\n\n\t}", "public interface IPeaklistScanner {\n public Map<Integer, List<SpectrumReference>> getSpectraPerMajorPeaks(String[] filenames, int nMajorPeaks) throws Exception;\n\n public List<SpectrumReference> getSpectrumReferences(String[] filenames) throws Exception;\n\n public List<List<IndexElement>> getFileIndices();\n}", "Map<Modification, Integer> getUsedModifications(SpectrumAnnotatorResult spectrumAnnotatorResult);", "private void setSpectrumIdsFound(List<String> spectrumIdsFound)\r\n\t{\r\n\t\tthis.spectrumIdsFound = spectrumIdsFound;\r\n\t}", "Map<String, Object> getFilterScratchpad();", "public void matchLibrarySpectra(SampleSpectrum ms2, Double massBinSize, Double ms1Tol, Double ms2Tol)\n\t{\n\t\tDouble dotProd = 0.0;\n\t\tDouble reverseDotProd = 0.0;\n\n\t\tif (minMass < 9998.0 && ms2.precursor<maxMass && ms2.precursor>minMass)\n\t\t{\n\t\t\t//Scale MS2s to maximum peak in spectra (0-1000) and remove peaks below .5%\n\t\t\tms2.scaleIntensities();\n\n\t\t\t// Find range of mass bins which need to be searched\n\t\t\tint minIndex = findBinIndex(findMinMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\t\t\tint maxIndex = findBinIndex(findMaxMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\n\t\t\tif (minIndex<0) minIndex = 0;\n\t\t\tif (maxIndex>(massBin.length-1)) maxIndex = massBin.length-1;\n\n\t\t\t//Iterate through this mass bin range\n\t\t\tfor (int i=minIndex; i<=maxIndex; i++)\n\t\t\t{\n\t\t\t\t//If the bin contains library spectra\n\t\t\t\tif (countBin[i]>0)\n\t\t\t\t{\n\t\t\t\t\t//For all spectra which are in the same mass bin\n\t\t\t\t\tfor (int j=0; j<addedBin[i]; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (Math.abs(massBin[i][j].precursor-ms2.precursor)<ms1Tol)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Calculate the dot product (spectral similarity) between the two spectra \n\t\t\t\t\t\t\tdotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,false, massWeight, intWeight);\n\t\t\t\t\t\t\treverseDotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,true, massWeight, intWeight);\n\n\t\t\t\t\t\t\tif (dotProd>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Add identification to array\n\t\t\t\t\t\t\t\tms2.addID(massBin[i][j], dotProd, reverseDotProd,ms2Tol);\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\n\t\t\t//Sort by dot product\n\t\t\tCollections.sort(ms2.idArray);\n\t\t}\n\t}", "public HashMap getProbEqkRuptureIdentifiersNearSite() {\n //initializing the list for containing the EqkRuptures\n HashMap probRupIdentifierList = new HashMap();\n\n int numSources = eqkRupForecast.getNumSources();\n //creating a ArrayList to hold the rupture indices for a given site and eqkrupforecast.\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex)\n probRupIdentifierList.put(new Integer(sourceIndex), new ArrayList());\n\n\n //Going over each and every source in the forecast\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex) {\n // get the ith source\n ProbEqkSource source = eqkRupForecast.getSource(sourceIndex);\n int numRuptures = source.getNumRuptures();\n\n //going over all the ruptures in the source\n for (int rupIndex = 0; rupIndex < numRuptures; ++rupIndex) {\n ProbEqkRupture rupture = source.getRupture(rupIndex);\n\n AbstractEvenlyGriddedSurface rupSurface = new EvenlyGridCenteredSurface((EvenlyGriddedSurface) rupture.getRuptureSurface());\n\n //getting the iterator for all points on the rupture\n ListIterator it = rupSurface.getAllByRowsIterator();\n //looping over all the rupture pt locations and if any of those lies\n //within the provided distance range then include the rupture in the list.\n while (it.hasNext()) {\n Location ptLoc = (Location) it.next();\n if (region.contains(ptLoc)) {\n ArrayList rupIndicesList = (ArrayList) probRupIdentifierList.get(new\n Integer(sourceIndex));\n rupIndicesList.add(new Integer(rupIndex));\n break;\n }\n }\n }\n }\n return probRupIdentifierList;\n }", "private void searchHashMap(String[] searchKey, String callNumber,int startYear, int endYear) {\n\t\t/* Temporarily stores next 'values' for a title keyword */\n\t\tArrayList<Integer> tempStore = new ArrayList<Integer>();\n\t\t/* Stores only the intersection 'values' of title keywords */\n\t\tCollection<Integer> intersection = new ArrayList<Integer>();\n\t\t/* Counts number of keywords found */\n\t\tint foundKeys = 0;\n\n\t\t/* Loop to iterate through title keywords and get key-value pair intersection */\n\t\tfor (String key : searchKey) {\n\t\t\tif (titleHashMap.containsKey(key)) {\n\t\t\t\tfoundKeys = foundKeys + 1;\n\t\t\t\ttempStore.addAll((titleHashMap.get(key))); /* Stores all found values */\n\t\t\t\tif (intersection.size() == 0) {\n\t\t\t\t\tintersection.addAll(titleHashMap.get(key));\n\t\t\t\t}\n\t\t\t\tintersection.retainAll(tempStore); /* Stores only common 'values' */\n\t\t\t\ttempStore.clear(); /* Clears temporary array*/\n\t\t\t}\n\t\t}\n\n\t\t/* Checks if all keywords were found */\n\t\tif(searchKey.length == foundKeys){\n\t\t/* Performs search of other fields via the reduced list of 'values' for matched record */\n\t\tfor (Integer i : intersection) {\n\t\t\tif ((callNumber.equals(\"\") || items.get(i.intValue()).getCallNumber().equalsIgnoreCase(callNumber))\n\t\t\t\t\t&& (items.get(i.intValue()).getYear() >= startYear && items.get(i.intValue()).getYear() <= endYear)) {\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t\tSystem.out.println(items.get(i.intValue())); /* Prints found records from master list 'Reference' */\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "public static void docWtgArray() {\n int docCount = 0;\n\n while(docCount<totaldocument) {\n List<Double> pass = new ArrayList();\n for(Entry<String,List<Double>> entry : wtgMap.entrySet()) {\n List<Double> docList = new ArrayList();\n docList = entry.getValue();\n double temp = docList.get(docCount);\n pass.add(temp);\n }\n\n double answer = CosineSimilarity(pass,query);\n if(answer >= alpha) {\n DocID.put(docCount,answer);\n }\n docCount++;\n }\n }", "protected abstract SortedMap<String, SampleDescriptor> computeSamples(File sampleDir) throws IOException;", "private void initEventList() {\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n calendar.add(Calendar.MINUTE, -1 * 60 * 12);\n startTime = calendar.getTimeInMillis();\n stopTime = System.currentTimeMillis();\n mSearchType = 0;\n eventType = AVIOCTRLDEFs.AVIOCTRL_EVENT_ALL;\n searchEventList(startTime, stopTime, eventType, mCameraChannel);\n }", "public static JSONArray getGenreCollection(String search){\n\t\tJSONArray genreStations = JSON.getJArray(radioStationCollections, search);\n\t\tif (genreStations != null){\n\t\t\tJSONArray genreStationFirstEntries = new JSONArray();\n\t\t\tfor (Object ao : genreStations){\n\t\t\t\tString normalizedStationName = (String) ao;\n\t\t\t\tJSONArray entry = JSON.getJArray(radioStationsMap, normalizedStationName);\n\t\t\t\tif (Is.notNullOrEmpty(entry)){\n\t\t\t\t\tJSON.add(genreStationFirstEntries, entry.get(0));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn genreStationFirstEntries;\n\t\t}else{\n\t\t\treturn new JSONArray();\n\t\t}\n\t\t//TODO: we could add some fancy fuzzy search here too ...\n\t}", "public Iterator<SpectrumInterface> getSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\t/*\r\n\t\t * Search for desired spectra.\r\n\t\t */\r\n\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>();\r\n\t\tspectrumList = fetchSpectrum(spectrumIds);\r\n\t\tlog.debug(\"spectrumIds.size() = \" + spectrumIds.size() + \", spectrumList.size() = \" + spectrumList.size());\r\n\r\n\t\t/*\r\n\t\t * Return spectrum iterator.\r\n\t\t */\r\n\t\treturn spectrumList.iterator();\r\n\t}", "public static void createSoundsArrList() {\r\n\t\t//Clears the sounds array list.\r\n\t\tsounds.clear();\r\n\t\t\r\n\t\t//Adds all the sound files to the sounds array list.\r\n\t\tsounds.add(\"Start=\" + Main.soundGameStart);\r\n\t\tsounds.add(\"Bags=\" + Main.soundBags);\r\n\t\tsounds.add(\"Set=\" + Main.soundSet);\r\n\t\tsounds.add(\"Win=\" + Main.soundWin);\r\n\t\tsounds.add(\"Lose=\" + Main.soundLose);\r\n\t}", "public void addSpectrum(LibrarySpectrum spectrum)\n\t{\n\t\tlibrarySpectra.add(spectrum);\n\t\tif (spectrum.precursor > maxMass) maxMass = spectrum.precursor;\n\t\tif (spectrum.precursor < minMass) minMass = spectrum.precursor;\n\t\tspectrum.scaleIntensities();\n\t}", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "public void populate() {\n for (int y = 0; y < height(); y++) {\n for (int x = 0; x < width(); x++) {\n Point p = Point.adjustForOrigin(x, y, origin, GraphType.CODE);\n\n if (func.fx(p.x()) == p.y()) {\n matches.add(p);\n }\n }\n }\n }", "public SpectrumMatch getSingleSpectrumMatch() {\r\n return spectrumMatches.get(0);\r\n }", "static void initializeArray2() {\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\t// Hash implementation\n\t\t\tint mod = val % m;\n\t\t\tarray[mod] = val;\n\t\t\tresult[1]++;\n\t\t}\n\t}", "public SpectrumMatch getSpectrumMatch(long id) {\r\n Integer index = id2index.get(id);\r\n return (index != null) ? spectrumMatches.get(id2index.get(id)) : null;\r\n }", "public Spectrumfile(HashMap aParams) {\r\n super(aParams);\r\n\r\n }", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "public Vector searchFile(String str){\r\n Vector search = new Vector();\r\n\r\n /* Search corresponding to title */\r\n Vector titleLoc = (Vector) titleHashTable.get(str);\r\n if (titleLoc != null) { // title matches\r\n for(int i=0 ;i < titleLoc.size(); i++){\r\n if(((FileLocation)titleLoc.elementAt(i)).record.isConnected)\r\n search.addElement(titleLoc.elementAt(i));\r\n }\r\n }\r\n\r\n Vector artistLoc = (Vector) artistHashTable.get(str);\r\n if (artistLoc != null) {\r\n for(int i=0 ;i < artistLoc.size();i++){\r\n if(((FileLocation)artistLoc.elementAt(i)).record.isConnected)\r\n search.addElement(artistLoc.elementAt(i));\r\n }\r\n }\r\n\r\n Vector albumLoc = (Vector) albumHashTable.get(str);\r\n if (albumLoc != null) {\r\n for(int i=0 ;i<albumLoc.size();i++){\r\n if(((FileLocation)albumLoc.elementAt(i)).record.isConnected)\r\n search.addElement(albumLoc.elementAt(i));\r\n }\r\n }\r\n\r\n\t\treturn search;\r\n\t}", "private void buildFreqMap() {\n\t\toriginalFreq = new HashMap<String, WordOccurence>();\n\n\t\tfor (ListIterator<Caption> itr = original.captionIterator(0); itr\n\t\t\t\t.hasNext();) {\n\t\t\tfinal Caption currentCap = itr.next();\n\t\t\tfinal String[] words = currentCap.getCaption().split(\"\\\\s+\");\n\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\tfinal String lowerCasedWord = words[i].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(lowerCasedWord)) {\n\t\t\t\t\toriginalFreq.get(lowerCasedWord).addOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t} else {\n\t\t\t\t\tfinal WordOccurence occ = new WordOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t\toriginalFreq.put(lowerCasedWord, occ);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < identified.size(); i++) {\n\t\t\tResultChunk curretResult = identified.get(i);\n\t\t\tfinal String[] words = curretResult.getDetectedString().split(\n\t\t\t\t\t\"\\\\s+\");\n\t\t\tint identifiedAt = curretResult.getDetectedAt();\n\t\t\tfor (int j = 0; j < words.length; j++) {\n\t\t\t\tString currentWord = words[j].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(currentWord)) {\n\t\t\t\t\tint detectedAt = (int) (identifiedAt - (words.length - j)\n\t\t\t\t\t\t\t* AVG_WORD_TIME);\n\t\t\t\t\toriginalFreq.get(currentWord).addVoiceDetection(detectedAt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "private void loadBedResults(JSONObject results) {\n\t\t//clear prior, set to zero\n\t\tidBedCount = new double[numberRecordsPerQuery];\n\n\t\t//any results? if no results then the count is zero\n\t\tif (results.has(\"queryResults\")){\n\t\t\tJSONArray ja = results.getJSONArray(\"queryResults\");\n\t\t\tint numWithHits = ja.length();\n\t\t\tfor (int i=0; i< numWithHits; i++){\n\t\t\t\tJSONObject jo = ja.getJSONObject(i);\n\t\t\t\tdouble numHits = jo.getDouble(\"numberIntersectingDataFiles\");\n\t\t\t\tString bedRecord = jo.getString(\"input\");\n\t\t\t\tString[] splitbed = Misc.TAB.split(bedRecord);\n\t\t\t\tint index = Integer.parseInt(splitbed[3]);\n\t\t\t\t//set in array\n\t\t\t\tidBedCount[index] = numHits;\n\t\t\t}\n\t\t}\n\t}", "private void identification(JFrame frame) {\r\n\t\t// Recognito code\r\n\t\trecognito = new Recognito<>(16000.0f);\r\n\t\ttry {\r\n\t\t\tList<File> filesInFolder = Files.walk(Paths.get(\"sounds/patterns\")).filter(Files::isRegularFile).map(Path::toFile).collect(Collectors.toList());\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\trecognito.createVoicePrint(name, file);\r\n\t\t\t}\r\n\t\t\tList<MatchResult<String>> matches;\r\n\t\t\tmatches = recognito.identify(new File(\"sounds/samples/Person\" + MainWindow.identificationCount + \".wav\"));\r\n\t\t\tMatchResult<String> match = matches.get(0);\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\tif(match.getKey().equals(name)) {\r\n\t\t\t\t\tResultWindow rw = new ResultWindow(name, match, frame);\r\n\t\t\t\t\trw.setVisible(true);\r\n\t\t\t\t\tframe.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (UnsupportedAudioFileException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private Map<TooonageVO, String> getAllSongsFromSDCARD(final String voice) {\n voiceRecognitioned = voice;\n\n if (isCancelled()) {\n return null;\n }\n\n final String[] TOOONAGE_PROJECTION = new String[]{MediaStore.Audio.Media._ID, MediaStore.Audio.Media.DISPLAY_NAME, MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.ALBUM_ID,\n MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST_ID, MediaStore.Audio.Media.ARTIST};\n final Uri allSongsUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\n final String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\n\n final Cursor cursor = getContentResolver().query(allSongsUri, TOOONAGE_PROJECTION, selection, null, null);\n\n try {\n\n if (cursor != null) {\n if (cursor.moveToFirst()) {\n do {\n\n if (isCancelled()) {\n return null;\n }\n\n final int songId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media._ID));\n final String songName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));\n\n final String songPath = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DATA));\n\n final int albumId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));\n final String albumName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM));\n\n final int artistId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST_ID));\n final String artistName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST));\n\n if (mUtility.match(artistName, voice) | mUtility.match(albumName, voice) | mUtility.match(songName, voice)) {\n final TooonageVO tooonageVO = new TooonageVO.Builder().artist(artistName).albumn(albumName).song(songName).build();\n tooons.put(tooonageVO, songPath.trim());\n }\n\n } while (cursor.moveToNext());\n }\n }\n } finally {\n cursor.close();\n }\n\n return tooons;\n }", "public void createBins(int arraySize)\n\t{\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\tcountBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\t\t\taddedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\n\t\t\t//Fill all positive bins with zeroes\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tcountBin[i] = 0;\n\t\t\t\taddedBin[i] = 0;\n\t\t\t}\n\n\t\t\t//Create the array to store the actual spectra objects\n\t\t\tmassBin = new LibrarySpectrum[arraySize][];\n\t\t}\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "public void addSpectrum(Spectrum spectrum) {\n add(spectrum);\n }", "public void findExpressedGenes(){\n\t\tHashMap exp = new HashMap();\n\t\t//instantiate Bar parser\n\t\tScoreParsedBars barParser = new ScoreParsedBars (barDirectory, bpPositionOffSetBar, bpPositionOffSetRegion);\n\t\t//for each chromosome in select\n\t\tIterator it = genesSelect.keySet().iterator();\n\t\twhile (it.hasNext()){\n\t\t\t//get genes\n\t\t\tString chrom = (String)it.next();\n\t\t\tUCSCGeneLine[] chrGenes = (UCSCGeneLine[])genesSelect.get(chrom);\n\t\t\tSystem.out.println(\"\\tTotal \"+chrom+\"\\t\"+ chrGenes.length);\n\t\t\t//calculate medians\n\t\t\tbarParser.calculateMedians(chrGenes);\n\t\t\tArrayList expressedGenes = new ArrayList();\n\t\t\t//for each gene look for intersection after expanding\n\t\t\tfor (int i=0; i< chrGenes.length; i++){\n\t\t\t\tif (chrGenes[i].getScores()[0] >= threshold ) {\n\t\t\t\t\texpressedGenes.add(chrGenes[i]);\n\t\t\t\t\t//System.out.println(chrGenes[i].simpleToString()+ chrGenes[i].getScore());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert ArrayList to array and replace in hash\n\t\t\tchrGenes = new UCSCGeneLine[expressedGenes.size()];\n\t\t\texpressedGenes.toArray(chrGenes);\n\t\t\tSystem.out.println(\"\\tExpressed \"+chrom+\"\\t\"+ chrGenes.length);\n\t\t\texp.put(chrom, chrGenes);\n\t\t}\n\t\tgenesSelect = exp;\n\t}", "public List<Spectator> findAllSpectators(){\n\t\treturn spectatorRepository.findAll();\n\t}", "public HashMap toHash() {\n HashMap x = new HashMap();\n\n x.put(\"type\",\"media\");\n x.put(\"mediaid\",mediaid);\n x.put(\"title\",mediatitle);\n x.put(\"episodetitle\",episodetitle);\n x.put(\"mediapath\",mediapath);\n x.put(\"description\",Description);\n x.put(\"mediaencoding\",mediaencoding);\n x.put(\"mediatype\",mediatype);\n x.put(\"mediagroup\", mediagroup);\n x.put(\"mediasize\", getMediasize());\n x.put(\"mediaduration\", getMediaduration());\n// x.put(\"lastwatched\",lastwatched);\n x.put(\"airingstarttime\",airingstarttime);\n x.put(\"userrating\",userrating);\n x.put(\"mpaarated\",mpaarated);\n x.put(\"releasedate\",releasedate);\n x.put(\"genre\",genre);\n x.put(\"trailer\", getTrailer());\n x.put(\"mediaimporttime\", getMediaimporttime());\n\n if ( MediaFileAPI.IsTVFile(MediaFileAPI.GetMediaFileForID(mediaid))) {\n// ortus.api.DebugLogTrace(\"toHash() loading TV\");\n Object mf = MediaFileAPI.GetMediaFileForID(mediaid);\n x.put(\"channelname\",AiringAPI.GetAiringChannelName(mf));\n x.put(\"channelnumber\",AiringAPI.GetAiringChannelNumber(mf));\n x.put(\"airingduration\",AiringAPI.GetAiringDuration(mf));\n x.put(\"airingstarttime\",AiringAPI.GetAiringStartTime(mf));\n x.put(\"airingendtime\",AiringAPI.GetAiringEndTime(mf));\n }\n\n if ( seriesid > 0)\n x.put(\"seriesid\",seriesid);\n if ( seasonno > 0)\n x.put(\"seasonno\",seasonno);\n if ( episodeid > 0)\n x.put(\"episodeid\",episodeid);\n if ( episodeno > 0)\n x.put(\"episodeno\",episodeno);\n// List castlist = new ArrayList();\n// for ( Cast ic : cast) {\n// HashMap y = new HashMap();\n// y.put(\"name\",ic.getName());\n// y.put(\"job\",ic.getJob());\n// y.put(\"character\",ic.getCharacter());\n// castlist.add(y);\n// }\n// x.put(\"cast\",castlist);\n// ortus.api.DebugLogTrace(\"toHash() loading fanart\");\n if ( fanart.get(\"Backgrounds\") != null) {\n // x.put(\"background_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Backgrounds\").get(\"high\").get(0)).getFile());\n x.put(\"background_id\",((Fanart)fanart.get(\"Backgrounds\").get(\"high\").get(0)).getId());\n }\n if ( fanart.get(\"Posters\") != null) {\n // x.put(\"posters_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Posters\").get(\"high\").get(0)).getFile());\n x.put(\"posters_id\",((Fanart)fanart.get(\"Posters\").get(\"high\").get(0)).getId());\n }\n if ( fanart.get(\"Banners\") != null) {\n // x.put(\"banners_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Banners\").get(\"high\").get(0)).getFile());\n x.put(\"banners_id\",((Fanart)fanart.get(\"Banners\").get(\"high\").get(0)).getId());\n }\n// ortus.api.DebugLogTrace(\"GetMetadata: Returning: \" + x);\n \n return x;\n }", "public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}", "public List<Instance> getSamples(){\n\t\treturn arrIns;\n\t}", "public void buildWordFileMap(){\n hashWords.clear();\n DirectoryResource dr = new DirectoryResource();\n for (File f : dr.selectedFiles()){ //for all the files selected make the hashWords hashmap\n addWordsFromFile(f);\n }\n \n }", "public AudioHashInfo calc(float[] buffer, int p) {\n\t\tint start = 0;\n\t\tint end = start + framelength - 1;\n\t\tint totalframes = (int)(Math.floor(buffer.length / advance - Math.floor(framelength / advance) + 1));\n\t\tint nbhashes = totalframes - 2;\n\t\tint nbtoggles = (p <= 12) ? p : 12;\n\n\t\tAudioHashInfo hashresult = new AudioHashInfo();\n\t\thashresult.hasharray = new int[nbhashes];\n\t\thashresult.toggles = (p > 0) ? new int[nbhashes] : null;\n\t\thashresult.coeffs = new double[totalframes][nfilts];\n\n\t\tint index = 0;\n\t\twhile(end < buffer.length) {\n\t\t\t// apply hamming window to frame\n\t\t\tfor(int i = 0; i < framelength; i++) {\n\t\t\t\tframe[i] = window[i] * buffer[start + i];\n\t\t\t}\n\n\t\t\t// forward fft transform\n\t\t\tfftTransform.realForward(frame);\n\n\t\t\tmagnF[0] = frame[0];\n\t\t\tfor(int i = 1; i < nffthalf - 1; i++) {\n\t\t\t\tmagnF[i] = (float)Math.abs(Math.sqrt((Math.pow(frame[2 * i], 2)\n\t\t\t\t\t\t+ Math.pow(frame[2 * i + 1], 2))));\n\t\t\t}\n\t\t\tmagnF[nffthalf - 1] = frame[1];\n\n\t\t\t// critical band integration\n\t\t\tfor(int i = 0; i < nfilts; i++) {\n\t\t\t\thashresult.coeffs[index][i] = 0.0;\n\t\t\t\tfor(int j = 0; j < nffthalf; j++) {\n\t\t\t\t\thashresult.coeffs[index][i] += wts[i][j] * magnF[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t\tstart += advance;\n\t\t\tend += advance;\n\t\t}\n\n\t\tindex = 0;\n\t\tfor(int i = 1; i < totalframes - 1; i++) {\n\t\t\tint hashvalue = 0;\n\t\t\tfor(int m = 0; m < nfilts - 1; m++) {\n\t\t\t\tdouble diff = (hashresult.coeffs[i + 1][m] - hashresult.coeffs[i + 1][m + 1]) -\n\t\t\t\t\t\t(hashresult.coeffs[i - 1][m] - hashresult.coeffs[i - 1][m + 1]);\n\t\t\t\thashvalue <<= 1;\n\t\t\t\tif(diff > 0)\n\t\t\t\t\thashvalue |= 0x01;\n\t\t\t\tfreqdiffs[m].diff = Math.floor(Math.abs(diff));\n\t\t\t\tfreqdiffs[m].index = m;\n\t\t\t}\n\t\t\thashresult.hasharray[index] = hashvalue;\n\t\t\tif(p > 0) {\n\t\t\t\tint tog = 0;\n\t\t\t\tsortFreqDiffs(freqdiffs);\n\t\t\t\tfor(int j = 0; j < nbtoggles; j++) {\n\t\t\t\t\ttog |= (0x80000000 >>> freqdiffs[j].index);\n\t\t\t\t}\n\t\t\t\thashresult.toggles[index] = tog;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\n\t\treturn hashresult;\n\t}", "static double[][] getSpectrum(MSRun run, int scan)\r\n {\r\n MSScan s = run.getScan(scan);\r\n float[][] t1 = s.getSpectrum();\r\n double[][] peaks = new double[2][t1[0].length];\r\n for (int j = 0; j < t1[0].length; j++)\r\n {\r\n peaks[0][j] = t1[0][j];\r\n peaks[1][j] = t1[1][j];\r\n }\r\n return peaks;\r\n }", "private void init() {\n UNIGRAM = new HashMap<>();\n }", "private void resetIdsToFind()\r\n\t{\r\n\t\t/*\r\n\t\t * Reset all lists of given search items to empty lists, indicating full\r\n\t\t * search without filtering, if no search items are added.\r\n\t\t */\r\n\t\tsetSpectrumIdsTarget(new ArrayList<String>());\r\n\t}", "private JsonObject search(JsonObject request) {\n\t\t\tJsonObject result = new JsonObject();\n\t\t\tJsonArray artists = new JsonArray();\n\t\t\tJsonArray titles = new JsonArray();\n\t\t\tJsonArray tags = new JsonArray();\n\t\t\tJsonArray arSimilars = new JsonArray();\n\t\t\tJsonArray tiSimilars = new JsonArray();\n\t\t\tJsonArray taSimilars = new JsonArray();\n\t\t\t//Individually search by artist, by title and by tag. \n\t\t\tartists = request.getAsJsonArray(\"searchByArtist\");\n\t\t\ttitles = request.getAsJsonArray(\"searchByTitle\");\n\t\t\ttags = request.getAsJsonArray(\"searchByTag\");\n\t\t\t//If the request contains \"artist\", we search each artist's similar song, and add it to a JsonArray.\n\t\t\tif(artists != null && artists.size() >= 1) {\n\t\t\t\tfor(JsonElement artist: artists) {\n\t\t\t\t\tarSimilars.add(this.sl.searchByArtist(artist.getAsString()));\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByArtist\".\n\t\t\t\tresult.add(\"searchByArtist\", arSimilars);\n\t\t\t}\n\t\t\t//If the request contains \"tag\", we search each tag's similar song, and add it to a JsonArray.\n\t\t\tif(tags != null && tags.size() >= 1) {\n\t\t\t\tfor(JsonElement tag: tags) {\t\t\t\t\n\t\t\t\t\ttaSimilars.add(this.sl.searchByTag(tag.getAsString()));\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTag\".\n\t\t\t\tresult.add(\"searchByTag\", taSimilars);\n\t\t\t}\t\t\n\t\t\t//If the request contains title, we search each title's similar song, and add it to a JsonArray\n\t\t\tif(titles != null && titles.size() >= 1) {\t\t\t\n\t\t\t\tfor(JsonElement title: titles) {\n\t\t\t\t\ttiSimilars.add(this.sl.searchByTitle(title.getAsString()));\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTiltle\".\n\t\t\t\tresult.add(\"searchByTitle\", tiSimilars);\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "public static ArrayList<Result> search(HashMap<String,ArrayList<String>> map) {\n result = new ArrayList<>();\n finalResult = new ArrayList<>();\n \n String input = map.get(\"search\").get(0);\n searchByName(input);\n \n ArrayList<String> type = map.get(\"type\");\n if(type.isEmpty());\n else for(String t:type){\n searchByType(t);\n result = finalResult;\n }\n \n //<editor-fold defaultstate=\"collapsed\" desc=\"FILTERS\">\n ArrayList<ArrayList<String>> filters = new ArrayList<>();\n filters.add(map.get(\"brand\"));\n filters.add(map.get(\"price\"));\n filters.add(map.get(\"os\"));\n filters.add(map.get(\"memory\"));\n filters.add(map.get(\"storage\"));\n filters.add(map.get(\"numberOfSimSlots\"));\n filters.add(map.get(\"f_camera\"));\n filters.add(map.get(\"b_camera\"));\n /**\n * ArrayList of filters from Mobile Phone\n * 0 = Brand | brand\n * 1 = Price | price\n * 2 = OS | os\n * 3 = Memory | memory\n * 4 = Storage | storage\n * 5 = SIM slots | numberOfSimSlots\n * 6 = Camera front | f_camera\n * 7 = Camera back | b_camera\n */\n int filterMode = 0;\n while(filterMode<filters.size()){\n// for(Result r:result){\n// System.out.println(r.getMP().getFullName());\n// }\n// System.out.println(\"filtermode: \"+filterMode);\n finalResult = new ArrayList<>();\n if(filters.get(filterMode).isEmpty()||filters.get(filterMode).get(0).equals(\"\")){\n filterMode++;\n continue;\n }\n filter(filterMode,filters.get(filterMode++));\n result = finalResult;\n }\n //</editor-fold>\n return result;\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}", "private static synchronized void initializeMeasureMaps() {\n\t\tintensityMeasuresList=ExerciseIntensityMeasure.getAll();\n\t\tquantityMeasuresList=ExerciseQuantityMeasure.getAll();\n\t\tintensityCodesToNamesMap=new HashMap(intensityMeasuresList.size());\n\t\tquantityCodesToNamesMap=new HashMap(quantityMeasuresList.size());\n\n\t\t// these (and the lists above) come from the db, but they can be static \n\t\t// because they change so infrequently (haven't changed in five years and\n\t\t// counting), and only manually via the db.\n\t\tfor (int i=0; i<intensityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseIntensityMeasure m=(ExerciseIntensityMeasure)intensityMeasuresList.get(i);\n\t\t\tintensityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tfor (int i=0; i<quantityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseQuantityMeasure m=(ExerciseQuantityMeasure)quantityMeasuresList.get(i);\n\t\t\tquantityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tmeasureMapsInitialized=true;\n\t\t\n\t}", "public void findFrequency(int size) {\r\n\t\tfor(i=0;i<size;i++) {\r\n\t\t\tfor (Entry en : dataEntries) {\t\t\r\n\t\t\t\ttemperature.add(en.getTemperature());\r\n\t\t\t\taches.add(en.getAches());\r\n\t\t\t\tcough.add(en.getCough());\r\n\t\t\t\tsoreThroat.add(en.getSoreThroat());\r\n\t\t\t\tdangerZone.add(en.getDangerZone());\r\n\t\t\t\thasCOVID19.add(en.getHasCOVID19());\r\n\t\t\t\t\r\n\t\t\t\tif (en.getHasCOVID19().equals(\"yes\")) {\r\n\t\t\t\t\ttemperatureIfCOVID19.add(en.getTemperature());\r\n\t\t\t\t\tachesIfCOVID19.add(en.getAches());\r\n\t\t\t\t\tcoughIfCOVID19.add(en.getCough());\r\n\t\t\t\t\tsoreThroatIfCOVID19.add(en.getSoreThroat());\r\n\t\t\t\t\tdangerZoneIfCOVID19.add(en.getDangerZone());\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static Wine[] read() {\r\n\t\t// We can add files we would like to parse in the following array. We use an array list\r\n\t\t// because it allows us to add dynamically.\r\n\t\tString[] file_adr = { \"data/winemag-data_first150k.txt\", \"data/winemag-data-130k-v2.csv\" };\r\n\t\tArrayList<Wine> arr_list = new ArrayList<Wine>();\r\n\t\t\r\n\t\tint k = 0;\r\n\t\twhile (k < file_adr.length) {\r\n\t\t\tboolean flag = false;\r\n\t\t\tif (file_adr[k].endsWith(\".csv\")) {\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t\tFile f = new File(file_adr[k]);\r\n\t\t\tScanner sc = null;\r\n\t\t\ttry {\r\n\t\t\t\tsc = new Scanner(f, \"UTF-8\");\r\n\t\t\t} catch (FileNotFoundException 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\tsc.nextLine();\r\n\t\t\tInteger id_count = 0;\r\n\t\t\tif(!flag) {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 10) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString variety = st[count+8];\r\n\t\t\t\t\tString winery = st[count+9];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] reviewer = {\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};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t//System.out.println(arr_list.size());\r\n\t\t\t\t\tid_count = arr_list.size();\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t//System.out.println(st[0]);\r\n\t\t\t\t\t/*if(Integer.parseInt(st[0]) == 30350) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 12) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString taster_name = st[count+8];\r\n\t\t\t\t\tString taster_handle = st[count+9];\r\n\t\t\t\t\tString variety = st[count+10];\r\n\t\t\t\t\tString winery = st[count+11];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString[] reviewer = {\r\n\t\t\t\t\t\t\ttaster_name,\r\n\t\t\t\t\t\t\ttaster_handle\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// We no longer need an array list. we have our size required. Put into an array.\r\n\t\tWine[] array_wines = new Wine[arr_list.size()];\r\n\t\tarray_wines = arr_list.toArray(array_wines);\r\n\t\t\r\n\t\treturn array_wines;\r\n\t\r\n\t}", "private void initializeNamesMap (Workspace[] wss) {\n // fill name mapping with proper values\n namesMap = new HashMap(wss.length * 2);\n for (int i = 0; i < wss.length; i++) {\n // create new string for each display name to be able to search\n // using '==' operator in findProgrammaticName(String displayName) method\n namesMap.put(wss[i].getName(), new String(wss[i].getDisplayName()));;\n }\n }", "private UInteger[] getHashValues() {\n int hashWindowSize = 48;\n UInteger[] hashValues = new UInteger[this.fileContent.length];\n int shiftAmount = this.getShiftAmount(hashWindowSize);\n int i = 0;\n\n int[] lookupTable =\n {0x5e3f7c48, 0x796a0d2b, 0xbecd4e32, 0x6f16159c, 0x687312bc, 0x12a6f30a, 0x8fca2662,\n 0x79b83d14, 0x3fab3f30, 0x984d6ca2, 0x4df5fe6c, 0x4acd3196, 0x6245ad21,\n 0x3a15e5ba, 0x90db6499, 0x05aacb6b, 0x791cf724, 0x504cd910, 0x98093570,\n 0x090392df, 0xf193e5b8, 0x42023c5b, 0x80a95c6a, 0x11e676be, 0xc70f2117,\n 0xeed4587f, 0x6479e9bd, 0x1b0c427c, 0x410486ba, 0x30f5b837, 0xf957d307,\n 0x1535f121, 0xabe45e90, 0x7a1ab8f0, 0x1c6887e4, 0x4170b7ba, 0x8b491bed,\n 0x5c920e73, 0x1b1ed791, 0x7a0ed482, 0xcce86619, 0x45dc7290, 0x57e71362,\n 0x2e24f01c, 0x0a0637f3, 0x0e8c5565, 0x15944012, 0x34f7eeea, 0xbc628141,\n 0x1e200874, 0xe9244379, 0x3e63aeca, 0x7a3b3cce, 0x73f8a245, 0xd734e215,\n 0x834fa434, 0xf96a0904, 0xfb39a424, 0x0bfa963a, 0x9b236ee2, 0xa2131005,\n 0x3eb70acf, 0x2907bcd8, 0x3f685f3a, 0x3765fd37, 0x1c1c34d2, 0x03a95179,\n 0x024be6c3, 0x06128960, 0x844e7490, 0xe2b371a3, 0x3382909c, 0x3d519a77,\n 0x90971ec9, 0x6ea745e5, 0x490b3a5c, 0x7f3916f7, 0xbc150351, 0x241a7ba0,\n 0xec93c2bb, 0x6c7083aa, 0xf3937751, 0xe6aa1df1, 0x129fc001, 0xb90709b9,\n 0x7e59a4fc, 0x4509e58a, 0x8a93ed43, 0x6934ce62, 0x8ec6af1a, 0xf36581a9,\n 0x53d01d93, 0xb34eef69, 0x08494a84, 0x0f6dff34, 0x74729aa3, 0x48b5475f,\n 0xb986dc84, 0xd0424c8d, 0xb72ad089, 0x0adbbdb8, 0x824fdbe8, 0x99ad1058,\n 0x98faec38, 0xe746242b, 0x2b7ee7fc, 0x2e151fa7, 0x6413270f, 0x68ed7239,\n 0x7729e2d3, 0x5697b3a5, 0x0b90a6c3, 0xdf7cefcf, 0xded46a48, 0x46956888,\n 0xb3bb6dc4, 0xe987578f, 0xf82e74b7, 0xc8eeeba4, 0xdd960ff9, 0x482ed28d,\n 0x4f343078, 0x563ab8a4, 0x3ec7aa0d, 0x2481d448, 0x5fe98704, 0x5aafc580,\n 0x841d81ec, 0xae7fe8fd, 0x6b31ccb6, 0x911ebdd4, 0x75f4703d, 0xe6855a0f,\n 0x6184b42e, 0x147a4a95, 0x39528e48, 0xe975b416, 0x3cba13d3, 0x1e23e544,\n 0xf7955286, 0xa5f96b7f, 0xaaa697aa, 0x29e794e3, 0x87628c09, 0xfeebf5f1,\n 0xf8b070cd, 0xe361b627, 0x8c7a8682, 0x69cab331, 0xca867ad1, 0xd0151a96,\n 0xfc19a6b9, 0x6d7439e7, 0x64cd62ac, 0x4a650747, 0x9ddbfa28, 0x337c8bed,\n 0xf12a6860, 0x3767ffd3, 0x13559ced, 0x71ac2011, 0xc11dc687, 0x260b7105,\n 0xc13bca0c, 0xcd0af893, 0x793b54e6, 0x89d27fc3, 0xc6bd1c88, 0xe3337313,\n 0x387bc671, 0x61280de4, 0x76941a36, 0xaa52a2b9, 0x6d7cb52c, 0x18ff4d70,\n 0x8987cf38, 0x306e47ed, 0xf7df8135, 0x18a8e024, 0xc9eb085f, 0xc1a7c769,\n 0xd5667a12, 0x9c8be93a, 0x028781b1, 0x6213dada, 0x07fef4f5, 0x5e6bf91d,\n 0x469ea798, 0xb9654a37, 0x1cb5e74e, 0x525d502d, 0xe805ec68, 0xdd8c4320,\n 0x7890848f, 0x61e59c8e, 0x1d99f9ef, 0x25b60b20, 0x2f198088, 0xe01b6926,\n 0xffa4917f, 0xb2fa0f22, 0xee8ac924, 0x18a1c5a7, 0xb76d8d7f, 0x88ad5e0d,\n 0x7b3fb12b, 0xc8a91add, 0x762a6f4e, 0x056fad31, 0xebecfab8, 0xea54cd17,\n 0x71f5af9f, 0xfaececa1, 0x08a52f4d, 0xbb5efebe, 0x5bcb04c2, 0xcb2530b0,\n 0x01bb862b, 0xbb5d54f0, 0x404deb4b, 0x038658bd, 0x09399005, 0xddd862c8,\n 0x8985776f, 0xcfcfd717, 0xbec756cb, 0x52aecc5a, 0x09ac3f62, 0x62c1c6fb,\n 0x76cc3221, 0xcde6d028, 0x844d9291, 0xc143eeac, 0x0ea5e772, 0x8855456e,\n 0xeb03a426, 0x3398475d, 0x73dc8107, 0x681605d0, 0xd18b6264, 0x934e43eb,\n 0x59e76d21, 0xd3ce2b77, 0x4ccfee1c, 0x2f4af76d, 0x8b12a309, 0x849bb415,\n 0xf45ad809, 0xc7bccae7, 0xac891c35, 0x59db2274, 0xbcd71393, 0x2c9b1705,\n 0xcb536a69, 0xb2800f00, 0x111313fc};\n\n while (i < this.fileContent.length) {\n UInteger hashValue = i == 0 ? uint(0) : hashValues[i - 1];\n int trailingEdgeData = i < hashWindowSize ? ubyte(0).intValue() :\n ubyte(this.fileContent[i - hashWindowSize]).intValue();\n int leadingEdgeData = ubyte(this.fileContent[i]).intValue();\n UInteger val = hashValue.xor(uint(lookupTable[trailingEdgeData]))\n .xor(uint(lookupTable[leadingEdgeData]));\n hashValues[i] =\n val.leftShift(2).inclusiveOr(val.rightShift(Integer.SIZE - shiftAmount));\n i++;\n }\n\n return hashValues;\n }", "public PeptideSpectrumMatch(ISpectrum spectrum, List<IPeak> inpeaks) {\n super(spectrum, inpeaks);\n\n if (spectrum instanceof IPeptideSpectrumMatch) {\n peptide = ((IPeptideSpectrumMatch) spectrum).getPeptide();\n annotation = ((IPeptideSpectrumMatch) spectrum).getAnnotation();\n } else {\n peptide = null;\n annotation = null;\n }\n makeAdvancedCalculations();\n }", "long getNumberOfSpectra(String experimentAccession);", "public void setNumberSpectra(int numberSpectra) {\n this.numberSpectra = numberSpectra;\n }", "public JSONObject searchByArtist(String artist) {\n\t\tJSONObject byArtistObject = new JSONObject();\n\t\tJSONArray songList = new JSONArray();\n\t\tTreeSet<String> simSongsList = new TreeSet<>();\n\t\t\n\t\tif(this.artistMap.get(artist) != null) {\n\t\t\tfor(Song song: this.artistMap.get(artist)) {\n\t\t\t\tfor(String simSong: song.getSimilars()) {\n\t\t\t\t\tif(idMap.containsKey(simSong)) {\n\t\t\t\t\t\tsimSongsList.add(simSong);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(String trackId: simSongsList) {\n\t\t\t\tsongList.add(idMap.get(trackId).toJSON());\n\t\t\t}\n\t\t}\n\t\t\n\t\tbyArtistObject.put(\"artist\", artist);\n\t\tbyArtistObject.put(\"similars\", songList);\n\t\t\n\t\treturn byArtistObject;\n\t}", "public static void init() {\n \n if(stock==null){\n stock=Analyser.stock;\n //for each stock, it price and the time\n// stoc\n// String[] listedCompanies = new NSELoader(20).getAllStocks();\n// \n// for (int i =0; i < listedCompanies.length; i++) {\n// \n// String stockName = listedCompanies[i];\n// float price = 0;\n// int time = 0;\n// ArrayList<String> value = new ArrayList<>();\n// String data = time + \":\" + price;// ':' is used as boundary token\n// value.add(data);\n// stock.put(stockName, value);\n// }\n \n\n }\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "private void initializeData() {\n String[] sportsList = getResources().getStringArray(R.array.track_title);\n String[] sportsInfo = getResources().getStringArray(R.array.track_category);\n\n // Clear the existing data (to avoid duplication).\n mSportsData.clear();\n\n TypedArray trackImageResources =\n getResources().obtainTypedArray(R.array.track_image);\n\n // Create the ArrayList of Sports objects with titles and\n // information about each sport.\n for (int i = 0; i < sportsList.length; i++) {\n for (int j = 0; j < workout.size(); j++) {\n if (workout.get(j).equals(sportsList[i])) {\n mSportsData.add(new Track(sportsList[i], sportsInfo[i], trackImageResources.getResourceId(i, 0)));\n }\n }\n }\n\n // Notify the adapter of the change.\n mAdapter.notifyDataSetChanged();\n\n trackImageResources.recycle();\n }", "public static ArrayList<Match> allMatches(String season){\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches filtered by season\n ArrayList<Match> matchesDisplayed = getMatchesForSeason(guiSeasonFilteredClubs);\n\n return matchesDisplayed;\n }", "public final /* synthetic */ Map mo33710j(List list) {\n HashMap hashMap = new HashMap();\n for (C2168bw next : this.f1705f.values()) {\n String str = next.f1693c.f1686a;\n if (list.contains(str)) {\n C2168bw bwVar = (C2168bw) hashMap.get(str);\n if ((bwVar == null ? -1 : bwVar.f1691a) < next.f1691a) {\n hashMap.put(str, next);\n }\n }\n }\n return hashMap;\n }", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "@Override\n public List<PeptideSpectrumMatchIDP> getResults(List<IdPickerInput> inputList, Program inputGenerator, IDPickerParams params) {\n return null;\n }", "private HashMap<Integer, HashMap<String,String>> getAllFrequencies() {\n HashMap<Integer,HashMap<String,String>> freq\n = dbController.getAllFrequencies();\n if (freq == null)\n return null;\n HashMap<Integer, HashMap<String, String>> response = new HashMap<Integer, HashMap<String, String>>();\n int i = 2;\n //Passing on any frequency and creates a message to send\n for (Map.Entry<Integer,HashMap<String,String>> objs : freq.entrySet()){\n HashMap<String,String> obj = objs.getValue();\n\n response.put(i, new HashMapBuilder<String, String>().put(\"name\", obj.get(\"name\"))\n .put(\"frequency\",obj.get(\"frequency\")).build());\n i++;\n }\n return response;\n }", "private void createArray()\r\n\t{\r\n\t\tscorers = new String[NUMBER_OF_ENTRIES];\r\n\t\tfor(int i = 0; i < NUMBER_OF_ENTRIES; i += 2)\r\n\t\t{\r\n\t\t\tscorers[i] = \"[NULL]\";\r\n\t\t\tscorers[i + 1] = String.valueOf(-1);\r\n\t\t}\r\n\t}", "private List<String> getMoreTracks() {\n if (tracksByBpm.isEmpty()) return new ArrayList<String>();\n\n Integer heartRate = DeviceScanActivity.mData;\n ArrayList<Pair<Integer,PlaylistTrack>> tracksInInterval = new ArrayList<>();\n\n if (heartRate == null || heartRate < 40)\n heartRate = (new Random()).nextInt(70) + 50;\n\n if (tracksByBpm.containsKey(heartRate)) {\n while (tracksInInterval.size() < Math.min(MIN_SONGS, tracksByBpm.get(heartRate).size())) {\n Pair<Integer, PlaylistTrack> newTrack = new Pair<Integer, PlaylistTrack>(\n heartRate,\n tracksByBpm.get(heartRate).get(rand.nextInt(tracksByBpm.get(heartRate).size())));\n\n if(!tracksInInterval.contains(newTrack))\n tracksInInterval.add(newTrack);\n }\n }\n\n for (int interval = INTERVAL_STEPS, lastInterval = 1;\n tracksInInterval.size() < MIN_SONGS && interval < INTERVAL_BOUND;\n interval+=INTERVAL_STEPS, lastInterval += INTERVAL_STEPS)\n {\n for (int i = lastInterval; i < interval; i++)\n if (tracksByBpm.containsKey(heartRate - i)) {\n for (int j = 0 ; j < tracksByBpm.get(heartRate - i).size(); j++){\n tracksInInterval.add(new Pair<Integer,PlaylistTrack>(\n heartRate - i,\n tracksByBpm.get(heartRate - i).get(j)));\n }\n } else if (tracksByBpm.containsKey(heartRate + i)) {\n for (int j = 0 ; j < tracksByBpm.get(heartRate + i).size(); j++){\n tracksInInterval.add(new Pair<Integer,PlaylistTrack>(\n heartRate + i,\n tracksByBpm.get(heartRate + i).get(j)));\n }\n }\n }\n\n List<String>nextTracks = new ArrayList<String>();\n // add at least MIN_SONGS tracks to the play queue\n while(nextTracks.size() < MIN_SONGS) {\n nextTracks.add(tracksInInterval.remove(\n rand.nextInt(tracksInInterval.size())).second.track.uri);\n }\n\n // if there are still no tracks to play select a random song\n if(nextTracks.isEmpty()) {\n Set<Integer> keySet = tracksByBpm.keySet();\n Integer[] keys = new Integer[keySet.size()];\n keySet.toArray(keys);\n Integer key = keys[rand.nextInt(keys.length)];\n List<PlaylistTrack> plTracks = tracksByBpm.get(key);\n nextTracks.add(plTracks.get(rand.nextInt(plTracks.size())).track.uri);\n }\n\n return nextTracks;\n }", "private void makeArrays()\n\t{\n\t\tfor (String key : sub.keySet())\n\t\t\tsub.put(key, ((List<String>) sub.get(key)).toArray(s0));\n\t\tfor (String key : attrs.keySet())\n\t\t\tattrs.put(key, ((List<String>) attrs.get(key)).toArray(s0));\n\t\tfor (String key : defs.keySet())\n\t\t\tdefs.put(key, ((List<String>) defs.get(key)).toArray(s0));\n\t\tfor (String key : smodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) smodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tsmodes.put(key, array);\n\t\t}\n\t\tfor (String key : amodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) amodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tamodes.put(key, array);\n\t\t}\n\t}", "public static Match[] init () throws FileNotFoundException{\n\n\t\tint numLine = 0;\n\t\t//reads the input file ExchangeRate.txt\n\t\tScanner input1 = new Scanner (new File (\"src/ExchangeRate.txt\"));\n\n\t\t//This loop goes through each line\n\t\twhile (input1.hasNextLine()) {\n\t\t\tinput1.nextLine();\n\t\t\tnumLine++;\n\t\t}\n\n\t\t//Close it in order to start from 0 again for the next loop\n\t\tinput1.close();\n\n\n\t\tMatch [] data = new Match [numLine];\n\t\tint i = 0;\n\t\tScanner input = new Scanner (new File(\"src/ExchangeRate.txt\"));\n\n\t\t//This while loop insures that the program names each section correctly. \n\t\twhile (input.hasNext()) {\n\t\t\tString curr1 = input.next(); //Set curr1 to the first section on the certain line\n\t\t\tString curr2 = input.next(); //Set curr2 to the second section on that same line\n\t\t\tdouble ex = input.nextDouble(); //Set ex to the third section on the same line\n\t\t\t//Sets currency2, currency2, and the exchange rate into an array\n\t\t\tdata[i] = new Match(curr1, curr2, ex);\n\t\t\ti++;\n\t\t}\n\t\tinput.close();\n\t\treturn data;\n\n\t}", "private void getCriteriaSaved() {\n try {\n Map<Integer, Criteria> mapCriteria = search.getDataBaseInHashMap();\n for (Integer key : mapCriteria.keySet()) {\n Criteria cri = mapCriteria.get(key);\n frameSearch.getTpDataBase().addRowTableDb(\n (key), mapCriteria.get(key).getNameOwnwe());\n }\n cm = new HashMap<Integer, Criteria>(mapCriteria);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException;", "public static Map<String, ArrayList<ImageDataModel>> getImageFolderMap(Activity activity) {\r\n imageFolderMap.clear();\r\n keyList.clear();\r\n imageDataModelList.clear();\r\n String BUCKET_ORDER_BY;\r\n Uri uri;\r\n Cursor cursor;\r\n int columnIndexDataPath, columnIndexFolderName, columnIndexTitleName,\r\n columnIndexDate, columnIndexSize, columnIndexBucketId, columnIndexAlbumId, columnIndexDuration;\r\n String absolutePathOfImage, folderName, imageTitle, fileDate, bucketId, AlbumId, fileSize, duration;\r\n\r\n /**\r\n * Fetching Audio type of files through content provider\r\n */\r\n /**\r\n * Fetching audio type of files through content provider\r\n */\r\n uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\r\n BUCKET_ORDER_BY = MediaStore.Audio.Media.DATE_MODIFIED + \" DESC\";\r\n String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\r\n String[] projection1 = new String[]{MediaStore.Audio.AudioColumns.ALBUM,\r\n MediaStore.Audio.AudioColumns.ALBUM_ID,\r\n MediaStore.Audio.AudioColumns.DISPLAY_NAME,\r\n MediaStore.Audio.AudioColumns.DATA,\r\n MediaStore.Audio.AudioColumns.SIZE,\r\n MediaStore.Audio.AudioColumns.DATE_MODIFIED,\r\n\r\n MediaStore.Audio.AudioColumns.DURATION};\r\n\r\n cursor = activity.getContentResolver().query(uri, projection1, selection, null, BUCKET_ORDER_BY);\r\n if (cursor != null) {\r\n columnIndexFolderName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM);\r\n columnIndexAlbumId = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM_ID);\r\n columnIndexTitleName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DISPLAY_NAME);\r\n\r\n columnIndexDataPath = cursor.getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DATA);\r\n while (cursor.moveToNext()) {\r\n absolutePathOfImage = cursor.getString(columnIndexDataPath);\r\n folderName = Constant.AUDIO_FOLDER_NAME;\r\n imageTitle = cursor.getString(columnIndexTitleName);\r\n\r\n ImageDataModel imageDataModel = new ImageDataModel();\r\n imageDataModel.setFile(new File(absolutePathOfImage));\r\n imageDataModel.setFolderName(folderName);\r\n imageDataModel.setPath(absolutePathOfImage);\r\n imageDataModel.setImageTitle(imageTitle);\r\n imageDataModel.setBucketId(\"1\");\r\n imageDataModel.setTimeDuration(\"0\");\r\n imageDataModel.setSelected(false);\r\n if (FileUtils.isImageFile(absolutePathOfImage)) {\r\n imageDataModel.setImage(true);\r\n } else if (FileUtils.isVideoFile(absolutePathOfImage)) {\r\n imageDataModel.setVideo(true);\r\n } else if (FileUtils.isAudioFile(absolutePathOfImage)) {\r\n imageDataModel.setAudio(true);\r\n }\r\n if (imageDataModel.getFile().length() > 0) {\r\n imageDataModelList.add(imageDataModel);\r\n if (imageFolderMap.containsKey(folderName)) {\r\n imageFolderMap.get(folderName).add(imageDataModel);\r\n } else {\r\n ArrayList<ImageDataModel> listOfAllImages = new ArrayList<ImageDataModel>();\r\n listOfAllImages.add(imageDataModel);\r\n imageFolderMap.put(folderName, listOfAllImages);\r\n }\r\n }\r\n }\r\n cursor.close();\r\n }\r\n keyList.addAll(imageFolderMap.keySet());\r\n //Send notification through main thread\r\n new Handler(Looper.getMainLooper()).post(new Runnable() {\r\n @Override\r\n public void run() {\r\n GlobalBus.getBus().post(new LandingFragmentNotification(Constant.UPDATE_UI));\r\n }\r\n });\r\n return imageFolderMap;\r\n }", "public Hashtable getFilters() {\n // we need to build the hashtable dynamically\n return globalFilterSet.getFilterHash();\n }", "public List<String> getSpectrumIdList()\r\n\t{\r\n\t\t/*\r\n\t\t * Return list of spectrum id values.\r\n\t\t */\r\n\t\treturn fetchSpectrumIds();\r\n\t}", "public String[] getSoundDevicesList();", "public void initPeriodsSearch() {\n\n\t\t//init fundamentalFreq\n\t\tcalculatefundamentalFreq();\n\n\t\t//set the first search area\n\t\tfinal double confidenceLevel = 5 / 100.;\n\t\tnextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );\n\t}", "static void initializeArray(boolean firstTime) {\n\t\tint count = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\tint mod = val % m;\n\t\t\tif (array[mod] == -1) {\n\t\t\t\tarray[mod] = val;\n\t\t\t\tresult[1]++;\n\t\t\t\tcount++;\n\t\t\t} else if (firstTime) {\n\t\t\t\tresult[0] = count;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected void treatSpeakers()\n\t{\n\t\tint nHP = (Integer) results[0];\n\t\tdouble Xdist = (Double)results[1];\n\t\tdouble Ydist = (Double)results[2];\n\t\tdouble shift = (Double)results[3];\n\t\tfloat height = (Float) results[4];\n\t\tint numHP1 = (Integer) results[5];\n\t\tboolean stereoOrder = (Boolean)results[6];\n\t\tint lastHP = (replace ? 0 : gp.speakers.size()-1);\n\t\tint numHP;\n\t\tint rangees = (nHP / 2);\n\t\tfloat X, Y;\n\t\tif(replace) gp.speakers = new Vector<HoloSpeaker>(nHP);\n\t\tnumHP1 = (evenp(nHP) ? numHP1 : 1 + numHP1);\n\t\t// Creation des HPs en fonction de ces parametres\n\t\tfor (int i = 1; i <= rangees; i++)\n\t\t\t{\n\t\t\t\t// on part du haut a droite, on descend puis on remonte\n\t\t\t\t\n\t\t\t\tX = (float) (-Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + rangees + rangees - i) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\t\n\t\t\t\tX = (float) (Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2+1;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + i - 1) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\tinc();\n\t\t\t}\n\n\t\t\tif (!evenp(nHP))\n\t\t\t{\n\t\t\tX = 0;\n\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5));\n\t\t\tnumHP = ((numHP1 - 1) % nHP) + 1;\n\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t}\n\t}", "@Test\n public void showHandledPeaksForInterestingCases() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n ISimilarityChecker checker = new FrankEtAlDotProductTester();\n ISimilarityChecker currentChecker = new FrankEtAlDotProduct(0.5F, 15, true);\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n String id1 = psm1.getId();\n if (!INTERESTING_ID_SET.contains(id1))\n continue; // not an interesting case\n\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n\n String id2 = psm2.getId();\n if (!INTERESTING_ID_SET.contains(id2))\n continue; // not an interesting case\n\n // System.out.println(\"Comparing \" + id1 + \" \" + id2);\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n\n // System.out.println(\"Peaks compared original Frank Et Al (when the code is written)\");\n // print usage\n // System.out.println(usedPeaksTester.toString());\n\n usedPeaksTester.setLength(0); // clear debug output\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n // print usage\n // System.out.println(\"Peaks compared current Frank Et Al \");\n // System.out.println(usedPeaksTester.toString());\n\n\n }\n\n }\n }", "private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }", "@Override\n public synchronized void buildIndex(){\n for(SlotData data : slotDataList){\n data.prepareReport();\n }\n }", "public static WFJFilterMap[] findFilterMaps() {\n return filterMaps.asArray();\n }", "private Map<String, Object> analysisMap(ArrayList<String> data) {\n Map<String, Object> map = new HashMap<>();\n map.put(DAILY, data);\n return map;\n }", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "@Override\n public List<Map<Frequency, DataForDetection>> getStuffReference() {\n return super.getStuffReference();\n }", "protected void setupMatcherExpectations() {\n expectedMatchRecordIds.put(\"x028abMatcher\", 0);\r\n expectedMatchRecords.put (\"x028abMatcher\", 0);\r\n\r\n expectedMatchRecordIds.put(\"x245ahMatcher\", 0);\r\n expectedMatchRecords.put (\"x245ahMatcher\", 0);\r\n\r\n expectedMatchRecordIds.put(\"x240aMatcher\", 0);\r\n expectedMatchRecords.put (\"x240aMatcher\", 0);\r\n\r\n expectedMatchRecordIds.put(\"x260abcMatcher\", 0);\r\n expectedMatchRecords.put (\"x260abcMatcher\", 0);\r\n\r\n expectedMatchRecordIds.put(\"x130aMatcher\", 0);\r\n expectedMatchRecords.put (\"x130aMatcher\", 0);\r\n //TODO end of above TODO\r\n\r\n expectedMatchRecordIds.put(\"ISSNMatcher\", 14); //confirmed\r\n expectedMatchRecords.put (\"ISSNMatcher\", 2); //confirmed\r\n\r\n expectedMatchRecordIds.put(\"ISBNMatcher\", 78); //TODO confirm both of these\r\n expectedMatchRecords.put (\"ISBNMatcher\", 23);\r\n\r\n expectedMatchRecordIds.put(\"x024aMatcher\", 3); //confirmed\r\n expectedMatchRecords.put (\"x024aMatcher\", 3); //confirmed\r\n\r\n expectedMatchRecordIds.put(\"LccnMatcher\", 49); //TODO confirm both of these\r\n expectedMatchRecords.put (\"LccnMatcher\", 8);\r\n\r\n expectedMatchRecordIds.put(\"SystemControlNumberMatcher\", 92); //TODO confirm both of these\r\n expectedMatchRecords.put (\"SystemControlNumberMatcher\", 27);\r\n\r\n\r\n /*\r\n rule 2 matchsets?:\r\n- *** Matchset: {62, 160, 201, }\r\n- *** Matchset: {10, 29, 52, 66, 132, 171, 205, 255, }\r\n- *** Matchset: {33, 71, 113, 137, 175, 207, 262, }\r\n\r\n 035 matchsets?:\r\n- *** Matchset: {1, 25, 48, 94, 107, 167, 197, 234, 251, 316, }\r\n- *** Matchset: {3, 27, 50, 64, 96, 109, 162, 169, 203, 236, 253, 318, }\r\n- *** Matchset: {31, 68, 111, 134, 173, 238, 257, 320, }\r\n- *** Matchset: {12, 73, 98, 115, 177, 209, 264, 324, }\r\n- *** Matchset: {5, 14, 35, 54, 75, 100, 117, 179, 240, 267, 326, }\r\n- *** Matchset: {56, 58, 82, 121, 141, 164, 185, 211, 243, 275, 329, }\r\n- *** Matchset: {22, 60, 89, 104, 125, 154, 191, 222, 248, 308, 312, 333, }\r\n */\r\n\r\n expectedResults.add(getExpectedMatchSet(new long[]{5,14,35,54,75,100,117,179,240,267,326}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{22,60,89,104,125,154,191,222,248,308,312,333}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{56,58,82,121,141,164,185,211,243,275,329}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{12,73,98,115,177,209,264,324}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{31,68,111,134,173,238,257,320}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{3,27,50,64,96,109,162,169,203,236,253,318}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{1,25,48,94,107,167,197,234,251,316}));\r\n\r\n expectedResults.add(getExpectedMatchSet(new long[]{62, 160, 201}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{10, 29, 52, 66, 132, 171, 205, 255}));\r\n expectedResults.add(getExpectedMatchSet(new long[]{33, 71, 113, 137, 175, 207, 262}));\r\n }" ]
[ "0.5829255", "0.576178", "0.5721972", "0.5661485", "0.5415811", "0.5327088", "0.5253078", "0.52527213", "0.51732355", "0.51303864", "0.5042643", "0.5005838", "0.4993331", "0.498472", "0.49845177", "0.49338797", "0.4910225", "0.4901483", "0.4895571", "0.48798406", "0.48358196", "0.48065552", "0.47989124", "0.47982982", "0.4796595", "0.47954252", "0.4786649", "0.47708994", "0.4759299", "0.47588298", "0.47525585", "0.4732305", "0.47289225", "0.4727165", "0.47252426", "0.4721164", "0.47208437", "0.46992707", "0.46976513", "0.46917975", "0.46904805", "0.46893468", "0.46854904", "0.4684546", "0.46798238", "0.4677783", "0.46746263", "0.46725962", "0.46696138", "0.46683538", "0.46679956", "0.46651447", "0.46606526", "0.46471313", "0.46343368", "0.46301028", "0.46164468", "0.46154362", "0.46126467", "0.4606518", "0.46013868", "0.4600661", "0.45814958", "0.45705616", "0.45508212", "0.4549885", "0.4545619", "0.45403722", "0.45398802", "0.45371482", "0.4536637", "0.45320728", "0.45278737", "0.45265192", "0.45237646", "0.45150924", "0.4512432", "0.45109946", "0.4510925", "0.45101458", "0.44988063", "0.4496208", "0.44853503", "0.44851917", "0.44837558", "0.447352", "0.4473163", "0.44693035", "0.4468844", "0.44686103", "0.4459448", "0.44592047", "0.44471684", "0.44373786", "0.4436937", "0.4433349", "0.44288644", "0.44234404", "0.44228604", "0.44161037" ]
0.48927104
19
Throws exception if a file is open
private void checkFileStatus() throws CustomException, IOException { //For all .mgf files for (int i=0; i<mgfFiles.size(); i++) { String resultFileName = mgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf("."))+"_Results.csv"; //TODO: Cannot write files if checking for file. /* if (isFileUnlocked(resultFileName)) throw new CustomException("Please close "+resultFileName, null); */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testFileOpen() {\n \n FileHandler fileToTest;\n \n fileToTest = new FileHandler(\"Kalle.xml\");\n \n try {\n fileToTest.openFile();\n fail(\"Should have raised a fileNotFoundException\");\n }\n catch (FileNotFoundException fnf) {\n }\n }", "@Override\n public void ensureOpen() throws IOException {\n }", "@Test\n\tpublic void testBadRead(){\n\t\ttry{\n\t\t\tXMLReader reader = new XMLReader(\"nonExistent\");\n\t\t\treader.close();\n\t\t\tfail(\"XMLReader should not have been able to read nonexistent file\");\n\t\t} catch (FileNotFoundException e){\n\t\t}\n\t}", "@Override\n\tpublic boolean isFileOpen(String fileName) \n\t{\n\t\treturn false;\n\t}", "protected void checkOpen() throws IOException {\n if (this.stopRequested.get() || this.abortRequested) {\n throw new IOException(\"Server not running\");\n }\n if (!fsOk) {\n throw new IOException(\"File system not available\");\n }\n }", "protected final void ensureOpen() {\n/* 664 */ if (!checkOpen(true)) {\n/* 665 */ checkException();\n/* */ }\n/* */ }", "void open() throws IOException;", "public void checkOpen() throws BadDescriptorException {\n if (!isOpen()) {\n throw new BadDescriptorException();\n }\n }", "public DataAccessException() {\n super(\"File cannot be opened or read. Please check!\");\n }", "public void open() throws IOException;", "private void ensureOpen() throws IOException {\n if (out == null) {\n throw new IOException(\n/* #ifdef VERBOSE_EXCEPTIONS */\n/// skipped \"Stream closed\"\n/* #endif */\n );\n }\n }", "public void openFile()\r\n {\r\n try // open file\r\n {\r\n input = new RandomAccessFile( \"clients.dat\", \"r\" );\r\n } // end try\r\n catch ( IOException ioException )\r\n {\r\n System.err.println( \"File does not exist.\" );\r\n } // end catch\r\n }", "public void ensureOpenFiles()\n throws DataOrderingException;", "private void ensureOpen() throws IOException {\n if (closed) {\n throw new IOException(\"Stream closed\");\n }\n }", "public void myMethod() throws FileNotFoundException {\n\t\ttry {\n\t\tsoccer = new FileInputStream(\"soccer.txt\");\n\t\t} catch (FileNotFoundException f) {//checked exception handled here\n//\t\t\tf.printStackTrace();\n\t\tSystem.out.println(\"file not found\");//throw fnfe; //this needs to be handled or declared\n\t\t}\n\t\t}", "public void onFileFolderOpenFailed(File file);", "File openFile();", "private void checkOpen() {\n if (!isOpen()) {\n throw new IllegalStateException(\"not open\");\n }\n }", "@Override\n public StorageInputStream open(File file) throws FileNotFoundException {\n\treturn null;\n }", "void open(String fileName) throws IOException, ParserConfigurationException, SAXException;", "@Test\n public void testCannotOpenTodo() throws Exception {\n testConstructor(new TestFilesFacadeImpl() {\n int counter = 1;\n\n @Override\n public int openRW(LPSZ path, long opts) {\n if (Chars.endsWith(path, TableUtils.TODO_FILE_NAME) && --counter == 0) {\n return -1;\n }\n return super.openRW(path, opts);\n }\n });\n }", "@Test\n public void throwsIOExceptionWhenCannotHash() throws IOException {\n File nonExistent = new File(\"nonExistent.gb\");\n\n thrown.expect(IOException.class);\n // Can not use message due to FileNotFoundException containing localized text on some OS:es\n\n // Throws\n new GameFile(nonExistent);\n }", "public void\topen(File path) throws IOException;", "public void handleOpenFile (File inFile) {\n openFile (inFile);\n }", "private void checkFile() {\n \ttry {\n \t\tdata = new BufferedReader(\n \t\t\t\t new FileReader(textFile));\n \t\t\n \t}\n \tcatch(FileNotFoundException e)\n \t{\n \t\tSystem.out.println(\"The mentioned File is not found.\");\n System.out.println(\"\");\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"The following error occured while reading the file.\");\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(2);\n\t\t}\n }", "void open(String fileName);", "boolean getFileErr();", "private File validateFile(String filename)\n {\n if (filename == null)\n {\n throw new IllegalArgumentException(\"Filename is null\");\n }\n File f = new File(filename);\n //if (!f.exists()) sometimes this throws false even if the program does exist.\n //{\n // throw new IllegalArgumentException(\"Path \"+filename+\" does not refer to a file\");\n //}\n return f;\n }", "private static int check_fd_for_read(int fd) {\n int status = check_fd(fd);\n if (status < 0)\n return -1;\n\n FileDescriptor fileDescriptor = process.openFiles[fd];\n int flags = fileDescriptor.getFlags();\n if ((flags != O_RDONLY) &&\n (flags != O_RDWR)) {\n // return (EBADF) if the file is not open for reading\n process.errno = EBADF;\n return -1;\n }\n\n return 0;\n }", "@Test\n\tpublic void testIsConsistentFileNoOpen() throws Exception {\n\t\tIRodinFile rodinFile = createRodinFile(\"P/x.test\");\n\t\trodinFile.close();\n\t\tassertTrue(\"closed file should be consistent\", \n\t\t\t\trodinFile.isConsistent());\n\t\tassertFalse(\"file should not be open\", rodinFile.isOpen());\n\t}", "@Override\n\tpublic FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\t\tSystem.out.println(\"Error Accessing File\"+file.toAbsolutePath());\n\t\tSystem.out.println(exc.getLocalizedMessage());\n\t\t\n\t\t\n\t\t\n\t\treturn super.visitFileFailed(file, exc);\n\t}", "public void readFile() throws Exception, FileNotFoundException, NumberFormatException, MalformedParameterizedTypeException {\n // my user or my file might be kind of crazy! -> will check for these exceptions!\n }", "@Override\r\n\tpublic InputStream getFile(String filepath) throws FileSystemUtilException {\r\n\t\t\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\t\r\n\r\n\t}", "@Test\n void Load_NonExistentFileName() {\n XmlImporter importer = new XmlImporter();\n\n assertThrows(FileNotFoundException.class, () -> importer.Load(\"c:\\\\DoesNotExist\\\\DoesNotExist.xml\"));\n }", "@Override\n\tpublic void open() throws IOException {\n\t\t\n\t}", "public static void checkFileReadable(final String filepath) throws FileNotFoundException {\n File f = new File(filepath);\n if (!f.exists()) {\n throw new FileNotFoundException(filepath + \" could not be found\");\n }\n if (!f.isFile()) {\n throw new FileNotFoundException(filepath + \" is not a file\");\n }\n if (!f.canRead()) {\n throw new AccessControlException(filepath + \" could not be read\");\n }\n }", "@Test\r\n\tvoid testImportRecordsShouldThrowExceptionOnInvalidFile() {\r\n\t\tRecordParser parser = new RecordParser();\r\n\t\tassertThrows(FileNotFoundException.class, () -> {\r\n\t\t\tparser.importRecords(new File(\"unknown.txt\"));\r\n\t\t});\r\n\t}", "private static int check_fd(int fd) {\n // look for the file descriptor in the open file list\n if (fd < 0 ||\n fd >= process.openFiles.length ||\n process.openFiles[fd] == null) {\n // return (EBADF) if file descriptor is invalid\n process.errno = EBADF;\n return -1;\n }\n\n return 0;\n }", "public FileNotFoundException(String message) {\n super(message);\n }", "public void fileOpen () {\n\t\ttry {\n\t\t\tinput = new Scanner(new File(file));\n\t\t\tSystem.out.println(\"file created\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"file could not be created\");\n\t\t}\n\t}", "@Override\r\n public boolean isFile() throws FileSystemException {\r\n // Use equals instead of == to avoid any class loader worries.\r\n return FileType.FILE.equals(this.getType());\r\n }", "@Override public void open() throws IOException {\n }", "void openFISFOSChannels(File f) throws Throwable {\n\n try {\n\n fos = new FileOutputStream(f);\n outChannel = fos.getChannel();\n\n fis = new FileInputStream(f);\n inChannel = fis.getChannel();\n\n } catch (Throwable t){\n log.add(t.toString() +\n \" exception was thrown while creating FileOutputStream or FileInputStream\" +\n \" or associated channels for \" + f.getPath());\n throw t;\n }\n }", "private static Optional<InputStream> openFile(Path name) {\n try {\n return Optional.of(Files.newInputStream(name, StandardOpenOption.READ));\n } catch (IOException e) {\n System.err.printf(\"Unable to open file %s for reading: %s\\n\", name, e.toString());\n }\n\n return Optional.empty();\n }", "@Override\n\tpublic void open() throws IOException {\n\t}", "private static Scanner openFile(){\n\n System.out.println(\"Enter the input file name: \");\n Scanner kb = new Scanner(System.in);\n String fileName = kb.nextLine();\n try{\n return new Scanner(new File(fileName));\n }\n catch (Exception e){\n System.out.printf(\"Open Failed: \\n%s\\n\", e.toString());\n System.out.println(\"Please re-enter the filename.\");\n return openFile();\n }\n }", "InputStream getInputStream() throws FileSystemException;", "public void ensureOpen() throws IOException {\n parent.ensureOpen();\n\n if (exceptionMessage != null) {\n throw new IOException(exceptionMessage);\n }\n if (isClosed) {\n throw new IOException(\"Operation has already ended\");\n }\n }", "void openFilePath(String newFilePath) throws IllegalValueException;", "@Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }", "public InputStream openInputStream(String path) throws SystemException;", "public boolean isFileOpened() {\r\n \t\tif (curFile == null)\r\n \t\t\treturn false;\r\n \t\telse\r\n \t\t\treturn true;\r\n \t}", "boolean isOpened() throws Exception;", "RandomAccessFile openInputFile(String fileName) {\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"fileName = \" + fileName);\n RandomAccessFile file = null;\n try {\n file = new RandomAccessFile(fileName, \"r\");\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"success: file opened for read\");\n } catch (Exception e) {\n ec.processError(e, thisClass, \"openInputFile\", \"\");\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"error: file opened for read\");\n } // try-catch\n return file;\n }", "public void testCloseFileIllegalArgumentException() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n try {\r\n filePersistence.closeFile(\" \");\r\n fail(\"if fileCreationId is empty, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n }", "InputStream openStream() throws IOException;", "boolean isFile() throws IOException;", "FileState checkFileState(FsPath path);", "@Test(timeout=100, expected=java.io.FileNotFoundException.class)\r\n\tpublic void testConstructorThrowsRuntimeException() throws Exception {\r\n\t\tString filename = \"A-Non-existent-File.hahaha\";\r\n\t\tCSVReader csv = new CSVReader(filename);\r\n\t\tfail( \"Should throw FileNotFoundException for non-existent file \"+filename );\r\n\t}", "@Override\r\n public void handleIOException(\r\n File file,\r\n java.io.IOException cause\r\n )\r\n {\n }", "public void open (File file)\n\t{\n\t\topen (file, false);\n\t}", "protected abstract E readFile() throws Exception;", "private static void file_not_found(String filename, int errno)\n\t\t\tthrows FileNotFoundException {\n\t\tswitch (errno) {\n\t\tcase ENOENT:\n\t\t\tthrow new FileNotFoundException(filename + \": not found\");\n\t\tcase ENOTDIR:\n\t\t\tthrow new FileNotFoundException(\"a component in path of \"\n\t\t\t\t\t+ filename + \" is not directory\");\n\t\t}\n\t}", "public void testNonExistentFile() {\n TestWARCBatchJob job = new TestWARCBatchJob();\n boolean success =\n job.processFile(NON_EXISTENT_FILE, new ByteArrayOutputStream());\n assertEquals(\"Should record exactly one exception\",\n job.getExceptionArray().length, 1);\n assertFalse(\"Should fail on missing file\", success);\n }", "void readFaultyRecipientsTest() {\n Assertions.assertThrows(RuntimeException.class,\n () -> Reader.readRecipients(Paths.get(\"src/test/resources/faulty_recipients.txt\")));\n }", "boolean safeIsFile(FsPath path);", "private void testReadFile() {\n System.out.println(\"------ TESTING : readFile(String filename) ------\");\n try{\n if(iTestFileList.readFile(sFile)){\n //throw exception if the values are not copied correctly\n if(iTestFileList.get(0) != 42175){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(5) != 45545){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(10) != 86908) {\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }\n else{\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n System.out.print(\"\\n\");\n }", "private void validateSource(SourcePointer.FileSource src) {\n File f = src.path.toFile();\n if (!f.exists() || !f.canRead()) {\n throw new SolrException(\n ErrorCode.BAD_REQUEST,\n String.format(\n Locale.US, \"File at %s either does not exist or cannot be read.\", src.path));\n }\n }", "public File openInputFile() throws Exception{\n\t\t// Open the input file\n\t\tinputFile = new File(PLEIADEAN_FILE);\n\t\t\n\t\t// return to the caller\n\t\treturn(inputFile);\n\t}", "@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }", "public abstract void readFromFile( ) throws Exception;", "private File tryLoadFile() throws FileNotFoundException {\n boolean fileLoadedSuccessfully = false;\n \n if (fileLoadedSuccessfully) {\n return new File(FILE_PATH);\n }\n else {\n throw new FileNotFoundException(\"Could not load file with path \" + FILE_PATH);\n }\n }", "public void testCloseFileFilePersistenceException() {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n try {\r\n filePersistence.closeFile(\"NotExist\");\r\n fail(\"if no open output stream associate with the fileCreationId, throw FilePersistenceException\");\r\n } catch (FilePersistenceException e) {\r\n // good\r\n }\r\n }", "private boolean isEmptyFile(String filename) {\n try (InputStream in = IO.openFile(filename)) {\n int b = in.read();\n return (b == -1);\n } catch (IOException ex) {\n throw IOX.exception(ex);\n }\n }", "public void handleOpenFile (FileSpec fileSpec) {\n this.fileSpec = fileSpec;\n openFile (fileSpec.getFile());\n }", "@Test(expected = IOException.class)\n\tpublic void testMainInvalidFilePath() throws Exception {\n\t\tString[] arguments = { \"/invalid/file/path\" };\n\t\tAutomaticMowerMain.main(arguments);\n\t}", "public boolean fExists(){\n \n try(ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))){\n \n }\n catch (FileNotFoundException e){\n System.out.println(\"File not found\");\n return false;\n }\n catch (IOException e){\n System.out.println(\"Another exception\");\n return false;\n }\n\n return true;\n }", "private int handleOpen(int name) {\n\t\tString FileName = readVirtualMemoryString(name, MAXSTRLEN);\n\t\t//error if file name is not valid\n\t\tif(FileName == null)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\n\t\t//find a free file descriptor\n\t\tint fileIndex = -1;\n\t\tfor(int i = 2; i < 16; i++)\n\t\t{\n\t\t\tif(fileDescriptors[i] == null)\n\t\t\t{\n\t\t\t\tfileIndex = i;\n\t\t\t}\n\t\t}\n\n\t\t//error if no file descriptor is free\n\t\tif(fileIndex == -1)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\n\t\tOpenFile file = ThreadedKernel.fileSystem.open(FileName, false);\n\n\t\t//error if file cannot be created\n\t\tif(file == null)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfileDescriptors[fileIndex] = file;\n\t\t\treturn fileIndex;\n\t\t}\n\t}", "private boolean checkOpen(boolean recordException) {\n/* 650 */ if (!isOpen()) {\n/* 651 */ if (recordException) {\n/* 652 */ recordException(new ClosedChannelException());\n/* */ }\n/* 654 */ return false;\n/* */ } \n/* */ \n/* 657 */ return true;\n/* */ }", "@Test\n public void loadFromFileWithWrongConnects() throws Exception{\n fileInOut.setFilePath(\"src/wrongConnects\");\n fileInOut.loadFromFile();\n }", "private boolean open() {\r\n\t\tfor ( int i = 0; i < _headerObject._filenames.length; ++i) {\r\n\t\t\tFileObject fileObject = ( FileObject)_headerObject._fileObjectMap.get( _headerObject._filenames[ i]);\r\n\t\t\tif ( null == fileObject)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tif ( !fileObject.open())\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n void nonEXistingFile () {\n assertThatThrownBy(()-> testObj.parseMap(\"no file\")).isInstanceOf(PacmanConfigurationException.class);\n }", "private void tryToOpen() {\n if (current != null) {\n if (!this.tryToClose()) return;\n }\n\n //open an existing file...\n JFileChooser chooser = new JFileChooser(new File(\".\"));\n chooser.setDialogTitle(\"Select model file\");\n chooser.setFileFilter(new FileNameExtensionFilter(\n \"Only xml files\",\"xml\"\n ));\n\n int result = chooser.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n File file = chooser.getSelectedFile();\n try {\n current = new Document(file);\n this.update();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"ERROR: the file '\" + file.getName() + \"' could not be opened!\", \"An Error Occured\", JOptionPane.ERROR_MESSAGE);\n// e.printStackTrace();\n }\n }\n }", "public synchronized void open()\n throws LineUnavailableException, IllegalArgumentException, IllegalStateException, SecurityException\n {\n if (!open) {\n line.open(format);\n open = true;\n reset = true;\n }\n }", "@Test\n public void readEmptyFile() throws Exception {\n populateInputFile(0, 0, 0);\n mReadHandlerNoException.onNext(buildReadRequest(0, 0));\n checkErrorCode(mResponseObserver, INVALID_ARGUMENT);\n }", "@Test (expected=LogHandlerException.class)\n\t\t\tpublic void filedoesntExistException() throws PizzaException, LogHandlerException{\n\t\t\t\tLogHandler.populatePizzaDataset(\"invalidFilePath\");\n\t\t\t}", "@Test(timeout = 4000)\n public void test009() throws Throwable {\n try { \n DBUtil.runScript(\"\", \"\", (Connection) null, false, (ErrorHandler) null);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(FileNotFoundException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }", "public static void couldNotReadFromFile(QWidget parent){\n \t\tQMessageBox.information(parent, \"Info\", \"En error oppsto.\"+\n \t\t\t\t\"\\nKunne ikke skrive fra fil.\");\n \t}", "protected void _openReader() throws IllegalActionException {\n\t\tfileOrURL.close();\n\n\t\t// Ignore if the fileOrUL is blank.\n\t\tif (fileOrURL.getExpression().trim().equals(\"\")) {\n\t\t\t_soundReader = null;\n\t\t\t_reachedEOF = true;\n\t\t} else {\n\t\t\t// Each read this many samples per channel when\n\t\t\t// _soundReader.getSamples() is called.\n\t\t\t// This value was chosen arbitrarily.\n\t\t\tint getSamplesArraySize = 64;\n\n\t\t\ttry {\n\t\t\t\t_soundReader = new SoundReader(fileOrURL.asURL(),\n\t\t\t\t\t\tgetSamplesArraySize);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tString newFileOrURL = ((StringToken) fileOrURL.getToken())\n\t\t\t\t\t\t.stringValue();\n\t\t\t\tthrow new IllegalActionException(this, ex,\n\t\t\t\t\t\t\"Cannot open fileOrURL '\" + newFileOrURL + \"'.\");\n\t\t\t}\n\n\t\t\t// Get the number of audio channels.\n\t\t\t_channels = _soundReader.getChannels();\n\n\t\t\t// Begin immediately reading data so that we stay at\n\t\t\t// least one sample ahead. This is important so that\n\t\t\t// postfire() will return false when the last sample\n\t\t\t// in the file is encountered, rather than on the next\n\t\t\t// iteration.\n\t\t\ttry {\n\t\t\t\t// Read in audio data.\n\t\t\t\t_audioIn = _soundReader.getSamples();\n\t\t\t} catch (Exception ex) {\n\t\t\t\tthrow new IllegalActionException(this, ex,\n\t\t\t\t\t\t\"Unable to get samples from the file.\");\n\t\t\t}\n\n\t\t\t_sampleIndex = 0;\n\n\t\t\t// Check that the read was successful\n\t\t\tif (_audioIn != null) {\n\t\t\t\t_reachedEOF = false;\n\t\t\t} else {\n\t\t\t\t_reachedEOF = true;\n\t\t\t}\n\t\t}\n\t}", "public void open() {\r\n if (mFailedOpen) {\r\n return;\r\n }\r\n\r\n File base = new File(mBaseFileName);\r\n if (mMaxLogSizeBytes > 0 && base.length() > (mMaxLogSizeBytes / mNumSegments - 1024)) {\r\n Log.d(LOG_TAG, \"Log file exceeds maximum size\");\r\n close();\r\n renameLogs();\r\n open();\r\n } else if (mCurrentFileStream == null) {\r\n try {\r\n mCurrentFileStream = new FileOutputStream(mBaseFileName, true);\r\n } catch (FileNotFoundException e) {\r\n Log.e(LOG_TAG, \"Could not open log file \" + e.getMessage());\r\n mFailedOpen = true;\r\n mCurrentFileStream = null;\r\n }\r\n }\r\n }", "LogFile open(String fileMode) throws LogConfigurationException, FileNotFoundException\n {\n this.fileMode = fileMode;\n\n // remember whether the file existed or not\n newFile = !file.exists();\n \n // if it already existed, but length is zero, then it is still a new file\n if (!newFile) newFile = file.length() == 0;\n \n channel = new RandomAccessFile(file, fileMode).getChannel();\n assert channel != null : \"RandomAccessFile() returns null\";\n \n // FEATURE 300922; lock file to prevent simultanious access\n try {\n lock = channel.tryLock();\n // TODO log lock event\n // if (lock != null) System.err.println(file.getName() + \" locked\");\n } catch (IOException e) {\n throw new LogConfigurationException(e);\n }\n if (lock == null) {\n // TODO: log lock failed\n // System.err.println(file.getName() + \" unable to lock\");\n throw new LogConfigurationException(\"Unable to obtain lock on \" + file.getAbsolutePath());\n }\n if (lock.isShared()) {\n // TODO: log lock is shared\n // System.err.println(file.getName() + \" lock is shared\");\n throw new LogConfigurationException(\"Shared lock on \" + file.getAbsolutePath());\n }\n // TODO: log lock acquired\n // System.err.println(file.getName() + \" open\");\n \n return this;\n }", "public boolean isFile() { return false; }", "@org.junit.Test(expected = FileNotFoundException.class)\r\n public void testProspectParserFileNotFound() throws FileNotFoundException {\r\n\r\n ProspectParser p = new ProspectParser(new File(\"TjollahoppTjollahej.asd\"), namePattern, digitPattern);\r\n p.parse();\r\n\r\n }", "@Test\n\tpublic void testHasUnsavedChangesFileNoOpen() throws Exception {\n\t\tIRodinFile rodinFile = createRodinFile(\"P/x.test\");\n\t\trodinFile.close();\n\t\tassertUnsavedChanges(rodinFile, false);\n\t\tassertFalse(\"file should not be open\", rodinFile.isOpen());\n\t}", "public boolean open(String filename)\n {\n \n boolean retVal = open_0(nativeObj, filename);\n \n return retVal;\n }", "public void checkFile() {\n\t\tFile file = new File(\"src/Project11Problem1Alternative/names.txt\");\n\t\tSystem.out.println(file.exists() ? \"Exists!\" : \"Doesn't exist!\");\n\t\tSystem.out.println(file.canRead() ? \"Can read!\" : \"Can't read!\");\n\t\tSystem.out.println(file.canWrite() ? \"Can write!\" : \"Can't write!\");\n\t\tSystem.out.println(\"Name: \" + file.getName());\n\t\tSystem.out.println(\"Path: \" + file.getPath());\n\t\tSystem.out.println(\"Size: \" + file.length() + \" bytes\");\n\t}", "public static void findFile() throws IOException {\n File newFile = new File(\"test.txt\");\n FileInputStream stream = new FileInputStream(newFile);\n }", "private void openLogFileForInput(String filename) throws Exception {\n // TODO Auto-generated method stub\n if (objectInputStream != null) {\n objectInputStream.close();\n objectInputStream = null;\n fileInputStream = null;\n }\n\n if (new File(filename).exists()) {\n fileInputStream = new FileInputStream(filename);\n objectInputStream = new ObjectInputStream(fileInputStream);\n inputLogFilename = filename;\n } else {\n throw new Exception(\"File \" + filename + \" does not exist \");\n }\n }", "public void openFile(String file)\n\t{\n\t\tthis.file=file;\n\t\tSystem.out.println(\"file has been opened\");\n\t}", "private void isOpen() throws IOException {\r\n if(fd<0) {\r\n throw new IOException(\"Watchdog is not open yet\");\r\n }\r\n }" ]
[ "0.7128262", "0.68813664", "0.669002", "0.6629287", "0.66210186", "0.6613705", "0.6556221", "0.6522546", "0.6517968", "0.646438", "0.643477", "0.63898164", "0.63892996", "0.63669205", "0.63122326", "0.63029814", "0.62990683", "0.6267437", "0.62122816", "0.62055403", "0.6196456", "0.6196206", "0.6191128", "0.6176596", "0.6166081", "0.6154424", "0.6150955", "0.61216193", "0.61129797", "0.6096656", "0.6096406", "0.6078089", "0.6077534", "0.6062867", "0.6037984", "0.6035716", "0.5990525", "0.59765923", "0.5966275", "0.5936552", "0.59329104", "0.59315026", "0.5917719", "0.590516", "0.58963615", "0.5895867", "0.5894701", "0.588925", "0.586754", "0.5862977", "0.5860741", "0.5848958", "0.5846624", "0.58420634", "0.5820992", "0.58198225", "0.5816911", "0.5814649", "0.5796494", "0.5789969", "0.57779026", "0.57478577", "0.5732986", "0.5732872", "0.5732439", "0.57291454", "0.572783", "0.5716437", "0.57031137", "0.5691208", "0.5687544", "0.5679064", "0.56712854", "0.5665867", "0.5656814", "0.56485957", "0.56426644", "0.56345636", "0.56340873", "0.56307256", "0.5619448", "0.561777", "0.56088006", "0.5603365", "0.5580515", "0.55669934", "0.5565862", "0.5555477", "0.5551849", "0.5549431", "0.5548227", "0.5547761", "0.5546611", "0.5540277", "0.55262756", "0.5517016", "0.5516012", "0.55143315", "0.55119884", "0.5502952" ]
0.57774466
61
Method to populate hash array and search all spectra
public void runSpectraSearchOptimizer() { //Load in information from each library file try { //Read in MSP Files readMSP(); //Sort arrays by mass, lowest to highest Collections.sort(librarySpectra); updateProgress(100,"% - Sorting Libraries",true); //Bin MSP LibrarySpectra binMasses(); for (double l=0.01; l<3.01; l=l+.01) { for (double m=0.01; m<3.01; m=m+.01) { this.intWeight = l; this.massWeight = m; //Read in all mgf files for (int i=0; i<mgfFiles.size(); i++) { updateProgress((int)(Double.valueOf(i+1) /(Double.valueOf(mgfFiles.size())*100.0)),"% - Loading Spectra",true); timeStart = System.nanoTime(); numSpectra = 0; //Read in spectra and search readMGF(mgfFiles.get(i)); //Iterate through spectra and match for (int j=0; j<sampleMS2Spectra.size(); j++) { matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol); } //Write ouput files for mgf writeResults(sampleMS2Spectra,mgfFiles.get(i)+"_"+l+"_"+m+".csv",maxResults); //Clear sample spectra sampleMS2Spectra = new ArrayList<SampleSpectrum>(); } //Create mzxmlparser MZXMLParser parser = new MZXMLParser(); //Read in mzxml files for (int i=0; i<mzxmlFiles.size(); i++) { timeStart = System.nanoTime(); numSpectra = 0; //Parse MZXML parser.readFile(mzxmlFiles.get(i)); //Create SampleSpectrum objects for (int j=0; j<parser.sampleSpecArray.size(); j++) { sampleMS2Spectra.add(parser.sampleSpecArray.get(j)); } //Iterate through spectra and match for (int j=0; j<sampleMS2Spectra.size(); j++) { matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol); } //Write ouput files for mzxml writeResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+"_"+m+".csv",maxResults); //Clear sample spectra sampleMS2Spectra = new ArrayList<SampleSpectrum>(); } updateProgress(100,"% - Completed",true); } } } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}", "private List<SpectrumInterface> fetchSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\tif (spectrumIds == null)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tsetSpectrumIdsTarget(spectrumIds);\r\n\t\t/*\r\n\t\t * Reset spectrum data.\r\n\t\t */\r\n\t\tint nSpectra = spectrumIds.size();\r\n\t\tspectrumArray = new SpectrumImpl[nSpectra];\r\n\t\t\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t\r\n\t\t/*\r\n\t\t * Create list of mass and intensity data and get dataLength as side\r\n\t\t * result.\r\n\t\t */\r\n\t\tint dataLength = 0;\r\n\t\tList<Double> peakMassData = new ArrayList<Double>();\r\n\t\tList<Double> peakIntensityData = new ArrayList<Double>();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\tfloat basePeakIntensity = 0, totalIntensity = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tspectrumTagsFound = 0;\r\n\t\t\tinTargetSpectrumBlock = false;\r\n\t\t\tString line;\r\n\t\t\tint lineNo = 0;\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\tif (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * New spectrum\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"New spectrum: numberOfSpectra = \" + numberOfSpectra);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if data for previous peak list has been collected.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif (inTargetSpectrumBlock)\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\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Reset peak list data.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tdataLength = 0;\r\n\t\t\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add spectrum id to list if not already in it.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!getSpectrumIdsFound().contains(currentSpectrumIdStr))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if desired spectrum id found.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tspectrumIndex = -1;\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (currentSpectrumIdStr.equals(getSpectrumIdsTarget().get(i)))\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\t * Save information in order to get\r\n\t\t\t\t\t\t\t * spectrum mass and intensity values.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t\t\tinTargetSpectrumBlock = true;\r\n\t\t\t\t\t\t\tspectrumIndex = i;\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get new spectrum object to store retrieved data in.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tSpectrumImpl currentSpectrum = SpectrumImpl.buildSpectrum(); // changed slewis to allow class to change\r\n\t\t\t\t\t\t\tsetSpectrum(currentSpectrum);\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + spectrumIndex + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" found.\");\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get spectrum header data from PKL file\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\ttotalIntensity = 0;\r\n\t\t\t\t\t\t\tbasePeakIntensity = 0;\r\n\t\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\t\t\tFloat massToChargeRatio = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tFloat intensity = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tInteger chargeState = Integer.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\t// Store spectrum header values from PKL file\r\n\t\t\t\t\t\t\t//log.debug(\"SpectrumId = \\\"\" + getCurrentSpectrumId() + \"\\\" massToChargeRatio = \" + massToChargeRatio + \" intensity = \" + intensity + \" chargeState = \" + chargeState);\r\n\t\t\t\t\t\t\tSpectrumPrecursor spectrumPrecursor = SpectrumPrecursor.buildSpectrumPrecursor(); // changed slewis to support overrides\r\n\t\t\t\t\t\t\tspectrumPrecursor.setMassToChargeRatio(massToChargeRatio.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setIntensity(intensity.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setCharge(chargeState);\r\n\t\t\t\t\t\t\tList<SpectrumPrecursor> precursors = new ArrayList<SpectrumPrecursor>();\r\n\t\t\t\t\t\t\tprecursors.add(spectrumPrecursor);\r\n\t\t\t\t\t\t\tgetSpectrum().setPrecursors(precursors);\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 (inTargetSpectrumBlock && line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Collect data for peak.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\tdouble peakMass = Double.valueOf(st.nextToken());\r\n\t\t\t\t\tdouble peakIntensity = Double.valueOf(st.nextToken());\r\n\t\t\t\t\t//log.debug(\"Spectra line (\" + lineNo + \") = \\\"\" + line + \"\\\", peakMass = \" + peakMass + \" peakIntensity = \" + peakIntensity);\r\n\t\t\t\t\tpeakMassData.add(dataLength, peakMass);\r\n\t\t\t\t\tpeakIntensityData.add(dataLength, peakIntensity);\r\n\t\t\t\t\tdataLength++;\r\n\t\t\t\t\t// Update statistical spectrum values\r\n\t\t\t\t\tif (peakIntensity > basePeakIntensity)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePeakIntensity = (float) peakIntensity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttotalIntensity += peakIntensity;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Other line\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"Unidentified line (\" + lineNo + \") = \\\"\" + line + \"\\\"\");\r\n\t\t\t\t}\r\n\t\t\t\tlineNo++;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Check if data for peak list has been collected.\r\n\t\t\t */\r\n\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t */\r\n\t\t\t\tif (inTargetSpectrumBlock)\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t/*\r\n\t\t\t\t * Reset peak list data.\r\n\t\t\t\t */\r\n\t\t\t\tdataLength = 0;\r\n\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Return result of search for PKL spectra.\r\n\t\t\t */\r\n\t\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>(nSpectra);\r\n\t\t\tfor (int i = 0; i < nSpectra; i++)\r\n\t\t\t{\r\n\t\t\t\tspectrumList.add(i, spectrumArray[i]);\r\n\t\t\t}\r\n\t\t\treturn spectrumList;\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\tthrow new BaseException(message);\r\n\t\t}\r\n\t}", "public List<SpectrumMatch> getSpectrumMatches() {\r\n return spectrumMatches;\r\n }", "private List<String> fetchSpectrumIds()\r\n\t\t\tthrows InvalidDataException\r\n\t{\r\n\t\t/*\r\n\t\t * Reset search items.\r\n\t\t */\r\n\t\tresetIdsToFind();\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tString line;\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 (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// New spectrum\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return null if no items found.\r\n\t\t */\r\n\t\tif (getSpectrumIdsFound().size() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return result of search for spectrum id values.\r\n\t\t */\r\n\t\treturn getSpectrumIdsFound();\r\n\t}", "public Set<String> getSpectrumFileNames() {\n\n \n return spectrumFiles.keySet();\n\n }", "public void addSpectrumMatch(SpectrumMatch sm) {\r\n id2index.put(sm.getSpectrumId(), spectrumMatches.size());\r\n spectrumMatches.add(sm);\r\n }", "private static void initializeAllGenresList(){\n\t\tfor(int i = 0; i < 13; i ++){\n\t\t\tALL_GENRES.add(new HashSet<String>());\n\t\t}\n\t}", "private HashMap<String, Double> getHashMapScore(String query){\n WaveIO waveIO = new WaveIO();\n\n short[] inputSignal = waveIO.readWave(query);\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeatureQuery = ms.getFeature(inputSignal);\n Energy energy = new Energy();\n double[] energyFeatureQuery = energy.getFeature(inputSignal);\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeatureQuery = zc.getFeature(inputSignal);\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(inputSignal);\n double[] mfccFeatureQuery = mfcc.getMeanFeature();\n \n \n // Get cosine SimList\n HashMap<String, Double> cosineSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineMsSimList.put(f.getKey(), (Cosine.getDistance(msFeatureQuery, (double[]) f.getValue())));\n \t// System.out.println(cosineMsSimList.get(f.getKey()));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcosineEnergySimList.put(f.getKey(), (Cosine.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcosineZcSimList.put(f.getKey(), (Cosine.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcosineMfccSimList.put(f.getKey(), (Cosine.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cosineMsSimList);\n normalizeValue(cosineEnergySimList);\n normalizeValue(cosineZcSimList);\n normalizeValue(cosineMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineSimList.put(f.getKey(), (m_msFeatureWeight * cosineMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cosineEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cosineZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cosineMfccSimList.get(f.getKey())));\n }\n \n // Get Euclidean SimList\n HashMap<String, Double> euclideanSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \teuclideanEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \teuclideanZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \teuclideanMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(euclideanMsSimList);\n normalizeValue(euclideanEnergySimList);\n normalizeValue(euclideanZcSimList);\n normalizeValue(euclideanMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanSimList.put(f.getKey(), (m_msFeatureWeight * euclideanMsSimList.get(f.getKey())) + (m_energyFeatureWeight * euclideanEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * euclideanZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * euclideanMfccSimList.get(f.getKey())));\n }\n \n // Get CityBlock SimList\n HashMap<String, Double> cityblockSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcityblockEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcityblockZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcityblockMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cityblockMsSimList);\n normalizeValue(cityblockEnergySimList);\n normalizeValue(cityblockZcSimList);\n normalizeValue(cityblockMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockSimList.put(f.getKey(), (m_msFeatureWeight * cityblockMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cityblockEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cityblockZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cityblockMfccSimList.get(f.getKey())));\n }\n \n // Overall\n HashMap<String, Double> simList = new HashMap<String, Double>();\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tsimList.put(f.getKey(), (m_cosineWeight * cosineSimList.get(f.getKey())) + (m_euclideanWeight * euclideanSimList.get(f.getKey())) + (m_cityblockWeight * cityblockSimList.get(f.getKey())));\n }\n \n return simList;\n }", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "private List<Map<Species, Integer>> getObservedSpeciesMaps() {\n List<Map<Species, Integer>> observedSpeciesMap = new ArrayList<>(observedSpecies.size());\n for (WatchList watchList : observedSpecies.values()) {\n observedSpeciesMap.add(watchList.getObservedSpeciesMap());\n }\n return observedSpeciesMap;\n }", "HashMap<String, Instrument> getInstruments();", "public void setSpectrumMatches(List<SpectrumMatch> spectrumMatches) {\r\n this.spectrumMatches = spectrumMatches;\r\n }", "public int getNumberSpectra() {\n return numberSpectra;\n }", "public Fingerprint[] fingerprints();", "public int getNumberOfSpectra() {\r\n return nSpectrum;\r\n }", "private void createSoundsMap(NodeList soundEventsList) {\r\n\r\n // reset the event sounds queue\r\n eventQ = new ConcurrentLinkedQueue<EnvironmentEvent>();\r\n\r\n // empty node list -> empty map with playable sounds\r\n if (soundEventsList == null) {\r\n return;\r\n }\r\n\r\n boolean midiSoundFound = false;\r\n boolean instrumentFound = false;\r\n\r\n for (int i = 0; i < soundEventsList.getLength(); i++) {\r\n // nothing set yet for this sound\r\n String durationValue = \"\";\r\n String eventTypeValue = \"\";\r\n String messageTypeValue = \"\";\r\n String soundFileValue = \"\";\r\n String instrumentValue = \"\";\r\n String noteSequenceValue = \"\";\r\n String propertyValue = \"\";\r\n String soundPropertyValue = \"\";\r\n Object property = 0;\r\n SonificationMap sonificationMap = null;\r\n MIDIMap midiMap = new MIDIMap();\r\n String functionType = \"\";\r\n String a0Value = \"\";\r\n String a1Value = \"\";\r\n String a2Value = \"\";\r\n String a3Value = \"\";\r\n int v0Value = 0;\r\n int v1Value = 0;\r\n int v2Value = 0;\r\n int v3Value = 0;\r\n int v4Value = 0;\r\n NodeList midiList = null;\r\n Sound playMIDI = null;\r\n Sound playSoundFile = null;\r\n long duration = DURATION_DEFAULT;\r\n\r\n if (soundEventsList.item(i).hasAttributes()) {\r\n\r\n // extract Attributes of EventAppearance\r\n NamedNodeMap attributes = soundEventsList.item(i).getAttributes();\r\n\r\n // parse attributes: \"eventType\", \"duration\", \"soundFile\"\r\n for (int j = 0; j < attributes.getLength(); j++) {\r\n if (attributes.item(j).getNodeName().equals(EVENT_TYPE)) {\r\n eventTypeValue = attributes.item(j).getNodeValue();\r\n }\r\n if (attributes.item(j).getNodeName().equals(MESSAGE_TYPE)) {\r\n messageTypeValue = attributes.item(j).getNodeValue();\r\n }\r\n if (attributes.item(j).getNodeName().equals(DURATION)) {\r\n\r\n durationValue = attributes.item(j).getNodeValue();\r\n try {\r\n duration = Long.parseLong(durationValue);\r\n } catch (Exception ex) {\r\n duration = DURATION_DEFAULT;\r\n }\r\n }\r\n\r\n if (attributes.item(j).getNodeName().equals(SOUNDFILE)) {\r\n soundFileValue = attributes.item(j).getNodeValue();\r\n }\r\n }\r\n\r\n // default event type if none is set in XML: see constant\r\n // EVENT_TYPE_DEFAULT\r\n if (eventTypeValue.equals(\"\")) {\r\n eventTypeValue = EVENT_TYPE_DEFAULT;\r\n }\r\n // dealing with out messages\r\n else if (messageTypeValue != null && messageTypeValue.length() > 0) {\r\n eventTypeValue += (this.typesNameDelimiter + messageTypeValue);\r\n }\r\n\r\n // if source file is defined then we deal with MP3 or MIDI files we have\r\n // notes definitions as sequences\r\n if (soundFileValue.equals(\"\")) {\r\n\r\n // search for MidiSound Elements\r\n if (soundEventsList.item(i).hasChildNodes()) {\r\n midiList = soundEventsList.item(i).getChildNodes();\r\n for (int k = 0; k < midiList.getLength(); k++) { // Nodes n*\r\n // \"MidiSound\"\r\n if (midiList.item(k).getNodeName().equals(MIDI_SOUND)) {\r\n midiSoundFound = true;\r\n if (midiList.item(k).hasAttributes()) {\r\n // extract Attributes of MidiSound\r\n NamedNodeMap childAttributes = midiList.item(k)\r\n .getAttributes();\r\n for (int l = 0; l < childAttributes.getLength(); l++) {\r\n // Attributes: \"instrumentName\", \"instrumentNo\",\r\n // \"noteSequence\"\r\n if (childAttributes.item(l).getNodeName().equals(\r\n INSTRUMENT_NAME)) {\r\n int temp = midiMap.getInstrumentNo(childAttributes\r\n .item(l).getNodeValue());\r\n if (temp != -1) {\r\n instrumentValue = Integer.toString(temp);\r\n instrumentFound = true;\r\n }\r\n }\r\n // the \"instrumentName\" property has priority over\r\n // \"instrumentNo\" property\r\n if (childAttributes.item(l).getNodeName().equals(\r\n INSTRUMENT_NO)\r\n && !instrumentFound) {\r\n instrumentValue = childAttributes.item(l).getNodeValue();\r\n }\r\n if (childAttributes.item(l).getNodeName().equals(\r\n NOTE_SEQUENCE)) {\r\n noteSequenceValue = childAttributes.item(l)\r\n .getNodeValue();\r\n }\r\n\r\n }// for l\r\n\r\n // set Default Value if \"instrumentNo\", \"velocity\" or\r\n // \"noteSequence\" are not set\r\n if (instrumentValue.equals(\"\")) {\r\n instrumentValue = INSTRUMENT_DEFAULT;\r\n }\r\n if (noteSequenceValue.equals(\"\")) {\r\n noteSequenceValue = \"//\";\r\n }\r\n\r\n } else {\r\n instrumentValue = INSTRUMENT_DEFAULT;\r\n noteSequenceValue = \"//\";\r\n }\r\n\r\n int[][] notes = extractNotes(noteSequenceValue);\r\n\r\n // no duration was defined then is computed as the sum\r\n // of the duration for all defined note sequences\r\n if (duration == -1) {\r\n duration = 0;\r\n for (int d = 0; d < notes[1].length; d++) {\r\n duration += notes[1][d];\r\n }\r\n }\r\n\r\n int instrument;\r\n try {\r\n instrument = Integer.parseInt(instrumentValue);\r\n } catch (Exception e) {\r\n instrument = Integer.parseInt(INSTRUMENT_DEFAULT);\r\n }\r\n\r\n // search for SonifikationMap Elements\r\n if (midiList.item(k).hasChildNodes()) {\r\n NodeList nl = midiList.item(k).getChildNodes();\r\n for (int m = 0; m < nl.getLength(); m++) { // Nodes n*\r\n // \"SonificationMap\"\r\n if (nl.item(m).getNodeName().equals(SONIFICATIONMAP)) {\r\n\r\n // reset for next SonificationMap\r\n propertyValue = \"\";\r\n property = null;\r\n soundPropertyValue = \"\";\r\n functionType = \"\";\r\n a0Value = \"\";\r\n a1Value = \"\";\r\n a2Value = \"\";\r\n a3Value = \"\";\r\n v0Value = 0;\r\n v1Value = 0;\r\n v2Value = 0;\r\n v3Value = 0;\r\n v4Value = 0;\r\n\r\n if (nl.item(m).hasAttributes()) {\r\n // extract Attributes of SonificationMap\r\n NamedNodeMap childAttributes = nl.item(m)\r\n .getAttributes();\r\n for (int n = 0; n < childAttributes.getLength(); n++) {\r\n // Attributes : \"property\", \"soundProperty\",\r\n // \"casewise\", \"a0\", \"a1\", \"a2, \"a3\", \"v0\", \"v1\",\r\n // \"v2, \"v3\"\r\n if (childAttributes.item(n).getNodeName().equals(\r\n PROPERTY)) {\r\n propertyValue = childAttributes.item(n)\r\n .getNodeValue();\r\n try {\r\n property = propertyValue;\r\n } catch (Exception e) {\r\n property = null;\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(\r\n SOUND_PROPERTY)) {\r\n soundPropertyValue = childAttributes.item(n)\r\n .getNodeValue();\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(\r\n MAP_TYPE)) {\r\n functionType = childAttributes.item(n)\r\n .getNodeValue();\r\n }\r\n\r\n if (childAttributes.item(n).getNodeName().equals(A0)) {\r\n try {\r\n a0Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A1)) {\r\n try {\r\n a1Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A2)) {\r\n try {\r\n a2Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(A3)) {\r\n try {\r\n a3Value = childAttributes.item(n).getNodeValue();\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V0)) {\r\n try {\r\n v0Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V1)) {\r\n try {\r\n v1Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V2)) {\r\n try {\r\n v2Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V3)) {\r\n try {\r\n v3Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n if (childAttributes.item(n).getNodeName().equals(V4)) {\r\n try {\r\n v4Value = Integer.parseInt(childAttributes\r\n .item(n).getNodeValue());\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n // create the sonification map\r\n sonificationMap = new SonificationMap(notes,\r\n instrument, duration, this.useCloneMapValues,\r\n propertyValue, soundPropertyValue, functionType,\r\n a0Value, a1Value, a2Value, a3Value, v0Value,\r\n v1Value, v2Value, v3Value, v4Value);\r\n\r\n if (soundPropertyValue.equals(NOTE)) {\r\n notes = sonificationMap.mapNotes(property);\r\n } else if (soundPropertyValue.equals(DURATION)) {\r\n notes = sonificationMap.mapDuration(property);\r\n } else if (soundPropertyValue.equals(VOLUME)) {\r\n notes = sonificationMap.mapVolume(property);\r\n } else if (soundPropertyValue.equals(INSTRUMENT_NO)) {\r\n instrument = sonificationMap\r\n .mapInstrument(property);\r\n }\r\n\r\n this.sonificationMap.put(eventTypeValue,\r\n sonificationMap);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Channelmanagement + set Instrument\r\n\r\n // create the MIDI sound object\r\n playMIDI = new SoundMIDI(notes);\r\n ((SoundMIDI) playMIDI).setInstrument(instrument);\r\n\r\n this.soundsMap.put(eventTypeValue, playMIDI);\r\n this.soundEventActiveStateMap.put(eventTypeValue, true);\r\n this.soundEventsTypeNameMap.put(eventTypeValue, \"MIDI\");\r\n\r\n // reset for next MidiSound\r\n instrumentValue = \"\";\r\n noteSequenceValue = \"\";\r\n instrumentFound = false;\r\n }\r\n }// for k\r\n\r\n }// if hasChildNodes\r\n if (!midiSoundFound) {\r\n System.out\r\n .println(\"Warrning: MidiSound attributes in EventAppearance needed !\");\r\n }\r\n }\r\n // the sound is from a file\r\n else {\r\n\r\n if (soundFileValue.length() < 4) {\r\n System.out\r\n .println(\"The name of the sound file must have at least 5 chars and ends with '.mid' or '.mp3' ! Found: \"\r\n + soundFileValue);\r\n break;\r\n }\r\n\r\n String fileExtension = soundFileValue.substring(soundFileValue\r\n .length() - 3);\r\n\r\n // if MP3 file\r\n if (fileExtension.equalsIgnoreCase(\"mp3\")) {\r\n\r\n // create new background sound\r\n playSoundFile = new SoundMP3(duration, soundFileValue,\r\n this.projectDirectory);\r\n }\r\n\r\n // if MIDI file\r\n if (fileExtension.equalsIgnoreCase(\"mid\")) {\r\n\r\n // create new background sound\r\n playSoundFile = new SoundMIDI(this.projectDirectory, soundFileValue);\r\n }\r\n\r\n this.soundsMap.put(eventTypeValue, playSoundFile);\r\n this.soundEventActiveStateMap.put(eventTypeValue, true);\r\n this.soundEventsTypeNameMap.put(eventTypeValue, soundFileValue);\r\n\r\n }\r\n }\r\n }\r\n }", "private void scanDocuments()\n{\n document_counts = new HashMap<>();\n kgram_counts = new HashMap<>();\n for (File f : root_files) {\n addDocuments(f);\n }\n}", "public static List<Handset> search(Map<String, String> reqParam) {\n\n\t\tList<Handset> temp = new ArrayList<Handset>();\n\t\ttemp.addAll(cache.values());\n\n\t\tfor (String param : reqParam.keySet()) {\n\t\t\tString val = (String) reqParam.get(param);\n\n\t\t\tswitch (param) {\n\t\t\tcase \"priceEur\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getPriceEur() == Integer.parseInt(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"sim\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getSim().toLowerCase().contains(val.toLowerCase()))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"announceDate\": {\n\t\t\t\ttemp = temp.stream().filter(handset -> handset.getRelease().getAnnounceDate().equalsIgnoreCase(val))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\ttemp = new ArrayList<Handset>();\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"filtered handset size \" + temp.size());\n\t\treturn temp;\n\n\t}", "public void runSpectraSearch(ArrayList <File> lipidLibs, double mzTol) throws CustomException, IOException\n\t{\n\t\tthis.lipidLibs = lipidLibs;\n\n\t\t//Verifies no result files are open\n\t\tcheckFileStatus();\n\n\t\t//Read fatty acids\n\t\treadFattyAcids(\"src\\\\backup\\\\FattyAcids.csv\");\n\n\t\t//Read in MSP Files\n\t\ttry\n\t\t{\n\t\t\treadMSP();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tCustomError ce = new CustomError(\"Error loading library .msp\", e);\n\t\t}\n\n\n\t\t//Sort arrays by mass, lowest to highest\n\t\tCollections.sort(librarySpectra);\n\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t//Bin MSP LibrarySpectra\n\t\tbinMasses();\n\n\t\tupdateProgress(0,\"% - Searching Spectra\",true);\n\n\t\t//Read in all mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\t\t\ttimeStart = System.nanoTime();\n\t\t\tnumSpectra = 0;\n\n\t\t\t//Read in spectra and search\n\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t//Iterate through spectra and match\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\n\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\n\t\t\t}\n\n\t\t\t//Calculate purity values\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\t\t\t\n\t\t\t\tsampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);\n\t\t\t}\n\n\t\t\t//Write ouput files for mgf\n\t\t\ttry\n\t\t\t{\n\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i),maxResults);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tCustomError ce = new CustomError(\"Please close \"+mgfFiles.get(i)+\" and re-search the data\",null);\n\t\t\t}\n\n\t\t\t//Clear sample spectra\n\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\n\t\t\tupdateProgress((int)((Double.valueOf(i+1)\n\t\t\t\t\t/(Double.valueOf(mgfFiles.size())))*100.0),\"% - Searching Spectra\",true);\n\t\t}\n\n\t\t//Create mzxmlparser\n\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t//Read in mzxml files\n\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t{\n\t\t\ttimeStart = System.nanoTime();\n\t\t\tnumSpectra = 0;\n\n\t\t\t//Parse MZXML\n\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t//Create SampleSpectrum objects\n\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t{\n\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t}\n\n\t\t\t//Iterate through spectra and match\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\n\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t}\n\n\t\t\t//Calculate purity values\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\t\t\t\n\t\t\t\tsampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);\n\t\t\t}\n\n\t\t\t//Write ouput files for mzxml\n\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i),maxResults);\n\n\t\t\t//Clear sample spectra\n\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\n\t\t\tupdateProgress((int)((Double.valueOf(i+1)\n\t\t\t\t\t/(Double.valueOf(mgfFiles.size())))*100.0),\"% - Searching Spectra\",true);\n\t\t}\n\t\tupdateProgress(100,\"% - Completed\",true);\n\t}", "public interface IPeaklistScanner {\n public Map<Integer, List<SpectrumReference>> getSpectraPerMajorPeaks(String[] filenames, int nMajorPeaks) throws Exception;\n\n public List<SpectrumReference> getSpectrumReferences(String[] filenames) throws Exception;\n\n public List<List<IndexElement>> getFileIndices();\n}", "Map<Modification, Integer> getUsedModifications(SpectrumAnnotatorResult spectrumAnnotatorResult);", "private void setSpectrumIdsFound(List<String> spectrumIdsFound)\r\n\t{\r\n\t\tthis.spectrumIdsFound = spectrumIdsFound;\r\n\t}", "Map<String, Object> getFilterScratchpad();", "public void matchLibrarySpectra(SampleSpectrum ms2, Double massBinSize, Double ms1Tol, Double ms2Tol)\n\t{\n\t\tDouble dotProd = 0.0;\n\t\tDouble reverseDotProd = 0.0;\n\n\t\tif (minMass < 9998.0 && ms2.precursor<maxMass && ms2.precursor>minMass)\n\t\t{\n\t\t\t//Scale MS2s to maximum peak in spectra (0-1000) and remove peaks below .5%\n\t\t\tms2.scaleIntensities();\n\n\t\t\t// Find range of mass bins which need to be searched\n\t\t\tint minIndex = findBinIndex(findMinMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\t\t\tint maxIndex = findBinIndex(findMaxMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\n\t\t\tif (minIndex<0) minIndex = 0;\n\t\t\tif (maxIndex>(massBin.length-1)) maxIndex = massBin.length-1;\n\n\t\t\t//Iterate through this mass bin range\n\t\t\tfor (int i=minIndex; i<=maxIndex; i++)\n\t\t\t{\n\t\t\t\t//If the bin contains library spectra\n\t\t\t\tif (countBin[i]>0)\n\t\t\t\t{\n\t\t\t\t\t//For all spectra which are in the same mass bin\n\t\t\t\t\tfor (int j=0; j<addedBin[i]; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (Math.abs(massBin[i][j].precursor-ms2.precursor)<ms1Tol)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Calculate the dot product (spectral similarity) between the two spectra \n\t\t\t\t\t\t\tdotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,false, massWeight, intWeight);\n\t\t\t\t\t\t\treverseDotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,true, massWeight, intWeight);\n\n\t\t\t\t\t\t\tif (dotProd>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Add identification to array\n\t\t\t\t\t\t\t\tms2.addID(massBin[i][j], dotProd, reverseDotProd,ms2Tol);\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\n\t\t\t//Sort by dot product\n\t\t\tCollections.sort(ms2.idArray);\n\t\t}\n\t}", "public HashMap getProbEqkRuptureIdentifiersNearSite() {\n //initializing the list for containing the EqkRuptures\n HashMap probRupIdentifierList = new HashMap();\n\n int numSources = eqkRupForecast.getNumSources();\n //creating a ArrayList to hold the rupture indices for a given site and eqkrupforecast.\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex)\n probRupIdentifierList.put(new Integer(sourceIndex), new ArrayList());\n\n\n //Going over each and every source in the forecast\n for (int sourceIndex = 0; sourceIndex < numSources; ++sourceIndex) {\n // get the ith source\n ProbEqkSource source = eqkRupForecast.getSource(sourceIndex);\n int numRuptures = source.getNumRuptures();\n\n //going over all the ruptures in the source\n for (int rupIndex = 0; rupIndex < numRuptures; ++rupIndex) {\n ProbEqkRupture rupture = source.getRupture(rupIndex);\n\n AbstractEvenlyGriddedSurface rupSurface = new EvenlyGridCenteredSurface((EvenlyGriddedSurface) rupture.getRuptureSurface());\n\n //getting the iterator for all points on the rupture\n ListIterator it = rupSurface.getAllByRowsIterator();\n //looping over all the rupture pt locations and if any of those lies\n //within the provided distance range then include the rupture in the list.\n while (it.hasNext()) {\n Location ptLoc = (Location) it.next();\n if (region.contains(ptLoc)) {\n ArrayList rupIndicesList = (ArrayList) probRupIdentifierList.get(new\n Integer(sourceIndex));\n rupIndicesList.add(new Integer(rupIndex));\n break;\n }\n }\n }\n }\n return probRupIdentifierList;\n }", "private void searchHashMap(String[] searchKey, String callNumber,int startYear, int endYear) {\n\t\t/* Temporarily stores next 'values' for a title keyword */\n\t\tArrayList<Integer> tempStore = new ArrayList<Integer>();\n\t\t/* Stores only the intersection 'values' of title keywords */\n\t\tCollection<Integer> intersection = new ArrayList<Integer>();\n\t\t/* Counts number of keywords found */\n\t\tint foundKeys = 0;\n\n\t\t/* Loop to iterate through title keywords and get key-value pair intersection */\n\t\tfor (String key : searchKey) {\n\t\t\tif (titleHashMap.containsKey(key)) {\n\t\t\t\tfoundKeys = foundKeys + 1;\n\t\t\t\ttempStore.addAll((titleHashMap.get(key))); /* Stores all found values */\n\t\t\t\tif (intersection.size() == 0) {\n\t\t\t\t\tintersection.addAll(titleHashMap.get(key));\n\t\t\t\t}\n\t\t\t\tintersection.retainAll(tempStore); /* Stores only common 'values' */\n\t\t\t\ttempStore.clear(); /* Clears temporary array*/\n\t\t\t}\n\t\t}\n\n\t\t/* Checks if all keywords were found */\n\t\tif(searchKey.length == foundKeys){\n\t\t/* Performs search of other fields via the reduced list of 'values' for matched record */\n\t\tfor (Integer i : intersection) {\n\t\t\tif ((callNumber.equals(\"\") || items.get(i.intValue()).getCallNumber().equalsIgnoreCase(callNumber))\n\t\t\t\t\t&& (items.get(i.intValue()).getYear() >= startYear && items.get(i.intValue()).getYear() <= endYear)) {\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t\tSystem.out.println(items.get(i.intValue())); /* Prints found records from master list 'Reference' */\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "public static void docWtgArray() {\n int docCount = 0;\n\n while(docCount<totaldocument) {\n List<Double> pass = new ArrayList();\n for(Entry<String,List<Double>> entry : wtgMap.entrySet()) {\n List<Double> docList = new ArrayList();\n docList = entry.getValue();\n double temp = docList.get(docCount);\n pass.add(temp);\n }\n\n double answer = CosineSimilarity(pass,query);\n if(answer >= alpha) {\n DocID.put(docCount,answer);\n }\n docCount++;\n }\n }", "protected abstract SortedMap<String, SampleDescriptor> computeSamples(File sampleDir) throws IOException;", "public static JSONArray getGenreCollection(String search){\n\t\tJSONArray genreStations = JSON.getJArray(radioStationCollections, search);\n\t\tif (genreStations != null){\n\t\t\tJSONArray genreStationFirstEntries = new JSONArray();\n\t\t\tfor (Object ao : genreStations){\n\t\t\t\tString normalizedStationName = (String) ao;\n\t\t\t\tJSONArray entry = JSON.getJArray(radioStationsMap, normalizedStationName);\n\t\t\t\tif (Is.notNullOrEmpty(entry)){\n\t\t\t\t\tJSON.add(genreStationFirstEntries, entry.get(0));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn genreStationFirstEntries;\n\t\t}else{\n\t\t\treturn new JSONArray();\n\t\t}\n\t\t//TODO: we could add some fancy fuzzy search here too ...\n\t}", "private void initEventList() {\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n calendar.add(Calendar.MINUTE, -1 * 60 * 12);\n startTime = calendar.getTimeInMillis();\n stopTime = System.currentTimeMillis();\n mSearchType = 0;\n eventType = AVIOCTRLDEFs.AVIOCTRL_EVENT_ALL;\n searchEventList(startTime, stopTime, eventType, mCameraChannel);\n }", "public Iterator<SpectrumInterface> getSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\t/*\r\n\t\t * Search for desired spectra.\r\n\t\t */\r\n\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>();\r\n\t\tspectrumList = fetchSpectrum(spectrumIds);\r\n\t\tlog.debug(\"spectrumIds.size() = \" + spectrumIds.size() + \", spectrumList.size() = \" + spectrumList.size());\r\n\r\n\t\t/*\r\n\t\t * Return spectrum iterator.\r\n\t\t */\r\n\t\treturn spectrumList.iterator();\r\n\t}", "public static void createSoundsArrList() {\r\n\t\t//Clears the sounds array list.\r\n\t\tsounds.clear();\r\n\t\t\r\n\t\t//Adds all the sound files to the sounds array list.\r\n\t\tsounds.add(\"Start=\" + Main.soundGameStart);\r\n\t\tsounds.add(\"Bags=\" + Main.soundBags);\r\n\t\tsounds.add(\"Set=\" + Main.soundSet);\r\n\t\tsounds.add(\"Win=\" + Main.soundWin);\r\n\t\tsounds.add(\"Lose=\" + Main.soundLose);\r\n\t}", "public void addSpectrum(LibrarySpectrum spectrum)\n\t{\n\t\tlibrarySpectra.add(spectrum);\n\t\tif (spectrum.precursor > maxMass) maxMass = spectrum.precursor;\n\t\tif (spectrum.precursor < minMass) minMass = spectrum.precursor;\n\t\tspectrum.scaleIntensities();\n\t}", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "public void populate() {\n for (int y = 0; y < height(); y++) {\n for (int x = 0; x < width(); x++) {\n Point p = Point.adjustForOrigin(x, y, origin, GraphType.CODE);\n\n if (func.fx(p.x()) == p.y()) {\n matches.add(p);\n }\n }\n }\n }", "public SpectrumMatch getSingleSpectrumMatch() {\r\n return spectrumMatches.get(0);\r\n }", "static void initializeArray2() {\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\t// Hash implementation\n\t\t\tint mod = val % m;\n\t\t\tarray[mod] = val;\n\t\t\tresult[1]++;\n\t\t}\n\t}", "public SpectrumMatch getSpectrumMatch(long id) {\r\n Integer index = id2index.get(id);\r\n return (index != null) ? spectrumMatches.get(id2index.get(id)) : null;\r\n }", "public Spectrumfile(HashMap aParams) {\r\n super(aParams);\r\n\r\n }", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "public Vector searchFile(String str){\r\n Vector search = new Vector();\r\n\r\n /* Search corresponding to title */\r\n Vector titleLoc = (Vector) titleHashTable.get(str);\r\n if (titleLoc != null) { // title matches\r\n for(int i=0 ;i < titleLoc.size(); i++){\r\n if(((FileLocation)titleLoc.elementAt(i)).record.isConnected)\r\n search.addElement(titleLoc.elementAt(i));\r\n }\r\n }\r\n\r\n Vector artistLoc = (Vector) artistHashTable.get(str);\r\n if (artistLoc != null) {\r\n for(int i=0 ;i < artistLoc.size();i++){\r\n if(((FileLocation)artistLoc.elementAt(i)).record.isConnected)\r\n search.addElement(artistLoc.elementAt(i));\r\n }\r\n }\r\n\r\n Vector albumLoc = (Vector) albumHashTable.get(str);\r\n if (albumLoc != null) {\r\n for(int i=0 ;i<albumLoc.size();i++){\r\n if(((FileLocation)albumLoc.elementAt(i)).record.isConnected)\r\n search.addElement(albumLoc.elementAt(i));\r\n }\r\n }\r\n\r\n\t\treturn search;\r\n\t}", "private void buildFreqMap() {\n\t\toriginalFreq = new HashMap<String, WordOccurence>();\n\n\t\tfor (ListIterator<Caption> itr = original.captionIterator(0); itr\n\t\t\t\t.hasNext();) {\n\t\t\tfinal Caption currentCap = itr.next();\n\t\t\tfinal String[] words = currentCap.getCaption().split(\"\\\\s+\");\n\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\tfinal String lowerCasedWord = words[i].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(lowerCasedWord)) {\n\t\t\t\t\toriginalFreq.get(lowerCasedWord).addOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t} else {\n\t\t\t\t\tfinal WordOccurence occ = new WordOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t\toriginalFreq.put(lowerCasedWord, occ);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < identified.size(); i++) {\n\t\t\tResultChunk curretResult = identified.get(i);\n\t\t\tfinal String[] words = curretResult.getDetectedString().split(\n\t\t\t\t\t\"\\\\s+\");\n\t\t\tint identifiedAt = curretResult.getDetectedAt();\n\t\t\tfor (int j = 0; j < words.length; j++) {\n\t\t\t\tString currentWord = words[j].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(currentWord)) {\n\t\t\t\t\tint detectedAt = (int) (identifiedAt - (words.length - j)\n\t\t\t\t\t\t\t* AVG_WORD_TIME);\n\t\t\t\t\toriginalFreq.get(currentWord).addVoiceDetection(detectedAt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "private void loadBedResults(JSONObject results) {\n\t\t//clear prior, set to zero\n\t\tidBedCount = new double[numberRecordsPerQuery];\n\n\t\t//any results? if no results then the count is zero\n\t\tif (results.has(\"queryResults\")){\n\t\t\tJSONArray ja = results.getJSONArray(\"queryResults\");\n\t\t\tint numWithHits = ja.length();\n\t\t\tfor (int i=0; i< numWithHits; i++){\n\t\t\t\tJSONObject jo = ja.getJSONObject(i);\n\t\t\t\tdouble numHits = jo.getDouble(\"numberIntersectingDataFiles\");\n\t\t\t\tString bedRecord = jo.getString(\"input\");\n\t\t\t\tString[] splitbed = Misc.TAB.split(bedRecord);\n\t\t\t\tint index = Integer.parseInt(splitbed[3]);\n\t\t\t\t//set in array\n\t\t\t\tidBedCount[index] = numHits;\n\t\t\t}\n\t\t}\n\t}", "private void identification(JFrame frame) {\r\n\t\t// Recognito code\r\n\t\trecognito = new Recognito<>(16000.0f);\r\n\t\ttry {\r\n\t\t\tList<File> filesInFolder = Files.walk(Paths.get(\"sounds/patterns\")).filter(Files::isRegularFile).map(Path::toFile).collect(Collectors.toList());\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\trecognito.createVoicePrint(name, file);\r\n\t\t\t}\r\n\t\t\tList<MatchResult<String>> matches;\r\n\t\t\tmatches = recognito.identify(new File(\"sounds/samples/Person\" + MainWindow.identificationCount + \".wav\"));\r\n\t\t\tMatchResult<String> match = matches.get(0);\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\tif(match.getKey().equals(name)) {\r\n\t\t\t\t\tResultWindow rw = new ResultWindow(name, match, frame);\r\n\t\t\t\t\trw.setVisible(true);\r\n\t\t\t\t\tframe.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (UnsupportedAudioFileException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private Map<TooonageVO, String> getAllSongsFromSDCARD(final String voice) {\n voiceRecognitioned = voice;\n\n if (isCancelled()) {\n return null;\n }\n\n final String[] TOOONAGE_PROJECTION = new String[]{MediaStore.Audio.Media._ID, MediaStore.Audio.Media.DISPLAY_NAME, MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.ALBUM_ID,\n MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST_ID, MediaStore.Audio.Media.ARTIST};\n final Uri allSongsUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\n final String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\n\n final Cursor cursor = getContentResolver().query(allSongsUri, TOOONAGE_PROJECTION, selection, null, null);\n\n try {\n\n if (cursor != null) {\n if (cursor.moveToFirst()) {\n do {\n\n if (isCancelled()) {\n return null;\n }\n\n final int songId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media._ID));\n final String songName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));\n\n final String songPath = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.DATA));\n\n final int albumId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));\n final String albumName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM));\n\n final int artistId = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST_ID));\n final String artistName = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST));\n\n if (mUtility.match(artistName, voice) | mUtility.match(albumName, voice) | mUtility.match(songName, voice)) {\n final TooonageVO tooonageVO = new TooonageVO.Builder().artist(artistName).albumn(albumName).song(songName).build();\n tooons.put(tooonageVO, songPath.trim());\n }\n\n } while (cursor.moveToNext());\n }\n }\n } finally {\n cursor.close();\n }\n\n return tooons;\n }", "public void createBins(int arraySize)\n\t{\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\tcountBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\t\t\taddedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\n\t\t\t//Fill all positive bins with zeroes\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tcountBin[i] = 0;\n\t\t\t\taddedBin[i] = 0;\n\t\t\t}\n\n\t\t\t//Create the array to store the actual spectra objects\n\t\t\tmassBin = new LibrarySpectrum[arraySize][];\n\t\t}\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "public void addSpectrum(Spectrum spectrum) {\n add(spectrum);\n }", "public List<Spectator> findAllSpectators(){\n\t\treturn spectatorRepository.findAll();\n\t}", "public void findExpressedGenes(){\n\t\tHashMap exp = new HashMap();\n\t\t//instantiate Bar parser\n\t\tScoreParsedBars barParser = new ScoreParsedBars (barDirectory, bpPositionOffSetBar, bpPositionOffSetRegion);\n\t\t//for each chromosome in select\n\t\tIterator it = genesSelect.keySet().iterator();\n\t\twhile (it.hasNext()){\n\t\t\t//get genes\n\t\t\tString chrom = (String)it.next();\n\t\t\tUCSCGeneLine[] chrGenes = (UCSCGeneLine[])genesSelect.get(chrom);\n\t\t\tSystem.out.println(\"\\tTotal \"+chrom+\"\\t\"+ chrGenes.length);\n\t\t\t//calculate medians\n\t\t\tbarParser.calculateMedians(chrGenes);\n\t\t\tArrayList expressedGenes = new ArrayList();\n\t\t\t//for each gene look for intersection after expanding\n\t\t\tfor (int i=0; i< chrGenes.length; i++){\n\t\t\t\tif (chrGenes[i].getScores()[0] >= threshold ) {\n\t\t\t\t\texpressedGenes.add(chrGenes[i]);\n\t\t\t\t\t//System.out.println(chrGenes[i].simpleToString()+ chrGenes[i].getScore());\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert ArrayList to array and replace in hash\n\t\t\tchrGenes = new UCSCGeneLine[expressedGenes.size()];\n\t\t\texpressedGenes.toArray(chrGenes);\n\t\t\tSystem.out.println(\"\\tExpressed \"+chrom+\"\\t\"+ chrGenes.length);\n\t\t\texp.put(chrom, chrGenes);\n\t\t}\n\t\tgenesSelect = exp;\n\t}", "public HashMap toHash() {\n HashMap x = new HashMap();\n\n x.put(\"type\",\"media\");\n x.put(\"mediaid\",mediaid);\n x.put(\"title\",mediatitle);\n x.put(\"episodetitle\",episodetitle);\n x.put(\"mediapath\",mediapath);\n x.put(\"description\",Description);\n x.put(\"mediaencoding\",mediaencoding);\n x.put(\"mediatype\",mediatype);\n x.put(\"mediagroup\", mediagroup);\n x.put(\"mediasize\", getMediasize());\n x.put(\"mediaduration\", getMediaduration());\n// x.put(\"lastwatched\",lastwatched);\n x.put(\"airingstarttime\",airingstarttime);\n x.put(\"userrating\",userrating);\n x.put(\"mpaarated\",mpaarated);\n x.put(\"releasedate\",releasedate);\n x.put(\"genre\",genre);\n x.put(\"trailer\", getTrailer());\n x.put(\"mediaimporttime\", getMediaimporttime());\n\n if ( MediaFileAPI.IsTVFile(MediaFileAPI.GetMediaFileForID(mediaid))) {\n// ortus.api.DebugLogTrace(\"toHash() loading TV\");\n Object mf = MediaFileAPI.GetMediaFileForID(mediaid);\n x.put(\"channelname\",AiringAPI.GetAiringChannelName(mf));\n x.put(\"channelnumber\",AiringAPI.GetAiringChannelNumber(mf));\n x.put(\"airingduration\",AiringAPI.GetAiringDuration(mf));\n x.put(\"airingstarttime\",AiringAPI.GetAiringStartTime(mf));\n x.put(\"airingendtime\",AiringAPI.GetAiringEndTime(mf));\n }\n\n if ( seriesid > 0)\n x.put(\"seriesid\",seriesid);\n if ( seasonno > 0)\n x.put(\"seasonno\",seasonno);\n if ( episodeid > 0)\n x.put(\"episodeid\",episodeid);\n if ( episodeno > 0)\n x.put(\"episodeno\",episodeno);\n// List castlist = new ArrayList();\n// for ( Cast ic : cast) {\n// HashMap y = new HashMap();\n// y.put(\"name\",ic.getName());\n// y.put(\"job\",ic.getJob());\n// y.put(\"character\",ic.getCharacter());\n// castlist.add(y);\n// }\n// x.put(\"cast\",castlist);\n// ortus.api.DebugLogTrace(\"toHash() loading fanart\");\n if ( fanart.get(\"Backgrounds\") != null) {\n // x.put(\"background_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Backgrounds\").get(\"high\").get(0)).getFile());\n x.put(\"background_id\",((Fanart)fanart.get(\"Backgrounds\").get(\"high\").get(0)).getId());\n }\n if ( fanart.get(\"Posters\") != null) {\n // x.put(\"posters_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Posters\").get(\"high\").get(0)).getFile());\n x.put(\"posters_id\",((Fanart)fanart.get(\"Posters\").get(\"high\").get(0)).getId());\n }\n if ( fanart.get(\"Banners\") != null) {\n // x.put(\"banners_high\", ortus.api.GetFanartFolder() + java.io.File.separator + ((Fanart)fanart.get(\"Banners\").get(\"high\").get(0)).getFile());\n x.put(\"banners_id\",((Fanart)fanart.get(\"Banners\").get(\"high\").get(0)).getId());\n }\n// ortus.api.DebugLogTrace(\"GetMetadata: Returning: \" + x);\n \n return x;\n }", "public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}", "public List<Instance> getSamples(){\n\t\treturn arrIns;\n\t}", "public void buildWordFileMap(){\n hashWords.clear();\n DirectoryResource dr = new DirectoryResource();\n for (File f : dr.selectedFiles()){ //for all the files selected make the hashWords hashmap\n addWordsFromFile(f);\n }\n \n }", "public AudioHashInfo calc(float[] buffer, int p) {\n\t\tint start = 0;\n\t\tint end = start + framelength - 1;\n\t\tint totalframes = (int)(Math.floor(buffer.length / advance - Math.floor(framelength / advance) + 1));\n\t\tint nbhashes = totalframes - 2;\n\t\tint nbtoggles = (p <= 12) ? p : 12;\n\n\t\tAudioHashInfo hashresult = new AudioHashInfo();\n\t\thashresult.hasharray = new int[nbhashes];\n\t\thashresult.toggles = (p > 0) ? new int[nbhashes] : null;\n\t\thashresult.coeffs = new double[totalframes][nfilts];\n\n\t\tint index = 0;\n\t\twhile(end < buffer.length) {\n\t\t\t// apply hamming window to frame\n\t\t\tfor(int i = 0; i < framelength; i++) {\n\t\t\t\tframe[i] = window[i] * buffer[start + i];\n\t\t\t}\n\n\t\t\t// forward fft transform\n\t\t\tfftTransform.realForward(frame);\n\n\t\t\tmagnF[0] = frame[0];\n\t\t\tfor(int i = 1; i < nffthalf - 1; i++) {\n\t\t\t\tmagnF[i] = (float)Math.abs(Math.sqrt((Math.pow(frame[2 * i], 2)\n\t\t\t\t\t\t+ Math.pow(frame[2 * i + 1], 2))));\n\t\t\t}\n\t\t\tmagnF[nffthalf - 1] = frame[1];\n\n\t\t\t// critical band integration\n\t\t\tfor(int i = 0; i < nfilts; i++) {\n\t\t\t\thashresult.coeffs[index][i] = 0.0;\n\t\t\t\tfor(int j = 0; j < nffthalf; j++) {\n\t\t\t\t\thashresult.coeffs[index][i] += wts[i][j] * magnF[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t\tstart += advance;\n\t\t\tend += advance;\n\t\t}\n\n\t\tindex = 0;\n\t\tfor(int i = 1; i < totalframes - 1; i++) {\n\t\t\tint hashvalue = 0;\n\t\t\tfor(int m = 0; m < nfilts - 1; m++) {\n\t\t\t\tdouble diff = (hashresult.coeffs[i + 1][m] - hashresult.coeffs[i + 1][m + 1]) -\n\t\t\t\t\t\t(hashresult.coeffs[i - 1][m] - hashresult.coeffs[i - 1][m + 1]);\n\t\t\t\thashvalue <<= 1;\n\t\t\t\tif(diff > 0)\n\t\t\t\t\thashvalue |= 0x01;\n\t\t\t\tfreqdiffs[m].diff = Math.floor(Math.abs(diff));\n\t\t\t\tfreqdiffs[m].index = m;\n\t\t\t}\n\t\t\thashresult.hasharray[index] = hashvalue;\n\t\t\tif(p > 0) {\n\t\t\t\tint tog = 0;\n\t\t\t\tsortFreqDiffs(freqdiffs);\n\t\t\t\tfor(int j = 0; j < nbtoggles; j++) {\n\t\t\t\t\ttog |= (0x80000000 >>> freqdiffs[j].index);\n\t\t\t\t}\n\t\t\t\thashresult.toggles[index] = tog;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\n\t\treturn hashresult;\n\t}", "static double[][] getSpectrum(MSRun run, int scan)\r\n {\r\n MSScan s = run.getScan(scan);\r\n float[][] t1 = s.getSpectrum();\r\n double[][] peaks = new double[2][t1[0].length];\r\n for (int j = 0; j < t1[0].length; j++)\r\n {\r\n peaks[0][j] = t1[0][j];\r\n peaks[1][j] = t1[1][j];\r\n }\r\n return peaks;\r\n }", "private void init() {\n UNIGRAM = new HashMap<>();\n }", "private void resetIdsToFind()\r\n\t{\r\n\t\t/*\r\n\t\t * Reset all lists of given search items to empty lists, indicating full\r\n\t\t * search without filtering, if no search items are added.\r\n\t\t */\r\n\t\tsetSpectrumIdsTarget(new ArrayList<String>());\r\n\t}", "private JsonObject search(JsonObject request) {\n\t\t\tJsonObject result = new JsonObject();\n\t\t\tJsonArray artists = new JsonArray();\n\t\t\tJsonArray titles = new JsonArray();\n\t\t\tJsonArray tags = new JsonArray();\n\t\t\tJsonArray arSimilars = new JsonArray();\n\t\t\tJsonArray tiSimilars = new JsonArray();\n\t\t\tJsonArray taSimilars = new JsonArray();\n\t\t\t//Individually search by artist, by title and by tag. \n\t\t\tartists = request.getAsJsonArray(\"searchByArtist\");\n\t\t\ttitles = request.getAsJsonArray(\"searchByTitle\");\n\t\t\ttags = request.getAsJsonArray(\"searchByTag\");\n\t\t\t//If the request contains \"artist\", we search each artist's similar song, and add it to a JsonArray.\n\t\t\tif(artists != null && artists.size() >= 1) {\n\t\t\t\tfor(JsonElement artist: artists) {\n\t\t\t\t\tarSimilars.add(this.sl.searchByArtist(artist.getAsString()));\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByArtist\".\n\t\t\t\tresult.add(\"searchByArtist\", arSimilars);\n\t\t\t}\n\t\t\t//If the request contains \"tag\", we search each tag's similar song, and add it to a JsonArray.\n\t\t\tif(tags != null && tags.size() >= 1) {\n\t\t\t\tfor(JsonElement tag: tags) {\t\t\t\t\n\t\t\t\t\ttaSimilars.add(this.sl.searchByTag(tag.getAsString()));\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTag\".\n\t\t\t\tresult.add(\"searchByTag\", taSimilars);\n\t\t\t}\t\t\n\t\t\t//If the request contains title, we search each title's similar song, and add it to a JsonArray\n\t\t\tif(titles != null && titles.size() >= 1) {\t\t\t\n\t\t\t\tfor(JsonElement title: titles) {\n\t\t\t\t\ttiSimilars.add(this.sl.searchByTitle(title.getAsString()));\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTiltle\".\n\t\t\t\tresult.add(\"searchByTitle\", tiSimilars);\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "public static ArrayList<Result> search(HashMap<String,ArrayList<String>> map) {\n result = new ArrayList<>();\n finalResult = new ArrayList<>();\n \n String input = map.get(\"search\").get(0);\n searchByName(input);\n \n ArrayList<String> type = map.get(\"type\");\n if(type.isEmpty());\n else for(String t:type){\n searchByType(t);\n result = finalResult;\n }\n \n //<editor-fold defaultstate=\"collapsed\" desc=\"FILTERS\">\n ArrayList<ArrayList<String>> filters = new ArrayList<>();\n filters.add(map.get(\"brand\"));\n filters.add(map.get(\"price\"));\n filters.add(map.get(\"os\"));\n filters.add(map.get(\"memory\"));\n filters.add(map.get(\"storage\"));\n filters.add(map.get(\"numberOfSimSlots\"));\n filters.add(map.get(\"f_camera\"));\n filters.add(map.get(\"b_camera\"));\n /**\n * ArrayList of filters from Mobile Phone\n * 0 = Brand | brand\n * 1 = Price | price\n * 2 = OS | os\n * 3 = Memory | memory\n * 4 = Storage | storage\n * 5 = SIM slots | numberOfSimSlots\n * 6 = Camera front | f_camera\n * 7 = Camera back | b_camera\n */\n int filterMode = 0;\n while(filterMode<filters.size()){\n// for(Result r:result){\n// System.out.println(r.getMP().getFullName());\n// }\n// System.out.println(\"filtermode: \"+filterMode);\n finalResult = new ArrayList<>();\n if(filters.get(filterMode).isEmpty()||filters.get(filterMode).get(0).equals(\"\")){\n filterMode++;\n continue;\n }\n filter(filterMode,filters.get(filterMode++));\n result = finalResult;\n }\n //</editor-fold>\n return result;\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}", "private static synchronized void initializeMeasureMaps() {\n\t\tintensityMeasuresList=ExerciseIntensityMeasure.getAll();\n\t\tquantityMeasuresList=ExerciseQuantityMeasure.getAll();\n\t\tintensityCodesToNamesMap=new HashMap(intensityMeasuresList.size());\n\t\tquantityCodesToNamesMap=new HashMap(quantityMeasuresList.size());\n\n\t\t// these (and the lists above) come from the db, but they can be static \n\t\t// because they change so infrequently (haven't changed in five years and\n\t\t// counting), and only manually via the db.\n\t\tfor (int i=0; i<intensityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseIntensityMeasure m=(ExerciseIntensityMeasure)intensityMeasuresList.get(i);\n\t\t\tintensityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tfor (int i=0; i<quantityMeasuresList.size(); i++) {\n\t\t\tfinal ExerciseQuantityMeasure m=(ExerciseQuantityMeasure)quantityMeasuresList.get(i);\n\t\t\tquantityCodesToNamesMap.put(m.getCode(),m.getName());\n\t\t}\n\t\tmeasureMapsInitialized=true;\n\t\t\n\t}", "public void findFrequency(int size) {\r\n\t\tfor(i=0;i<size;i++) {\r\n\t\t\tfor (Entry en : dataEntries) {\t\t\r\n\t\t\t\ttemperature.add(en.getTemperature());\r\n\t\t\t\taches.add(en.getAches());\r\n\t\t\t\tcough.add(en.getCough());\r\n\t\t\t\tsoreThroat.add(en.getSoreThroat());\r\n\t\t\t\tdangerZone.add(en.getDangerZone());\r\n\t\t\t\thasCOVID19.add(en.getHasCOVID19());\r\n\t\t\t\t\r\n\t\t\t\tif (en.getHasCOVID19().equals(\"yes\")) {\r\n\t\t\t\t\ttemperatureIfCOVID19.add(en.getTemperature());\r\n\t\t\t\t\tachesIfCOVID19.add(en.getAches());\r\n\t\t\t\t\tcoughIfCOVID19.add(en.getCough());\r\n\t\t\t\t\tsoreThroatIfCOVID19.add(en.getSoreThroat());\r\n\t\t\t\t\tdangerZoneIfCOVID19.add(en.getDangerZone());\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initializeNamesMap (Workspace[] wss) {\n // fill name mapping with proper values\n namesMap = new HashMap(wss.length * 2);\n for (int i = 0; i < wss.length; i++) {\n // create new string for each display name to be able to search\n // using '==' operator in findProgrammaticName(String displayName) method\n namesMap.put(wss[i].getName(), new String(wss[i].getDisplayName()));;\n }\n }", "private static Wine[] read() {\r\n\t\t// We can add files we would like to parse in the following array. We use an array list\r\n\t\t// because it allows us to add dynamically.\r\n\t\tString[] file_adr = { \"data/winemag-data_first150k.txt\", \"data/winemag-data-130k-v2.csv\" };\r\n\t\tArrayList<Wine> arr_list = new ArrayList<Wine>();\r\n\t\t\r\n\t\tint k = 0;\r\n\t\twhile (k < file_adr.length) {\r\n\t\t\tboolean flag = false;\r\n\t\t\tif (file_adr[k].endsWith(\".csv\")) {\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t\tFile f = new File(file_adr[k]);\r\n\t\t\tScanner sc = null;\r\n\t\t\ttry {\r\n\t\t\t\tsc = new Scanner(f, \"UTF-8\");\r\n\t\t\t} catch (FileNotFoundException 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\tsc.nextLine();\r\n\t\t\tInteger id_count = 0;\r\n\t\t\tif(!flag) {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 10) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString variety = st[count+8];\r\n\t\t\t\t\tString winery = st[count+9];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] reviewer = {\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};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t//System.out.println(arr_list.size());\r\n\t\t\t\t\tid_count = arr_list.size();\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t//System.out.println(st[0]);\r\n\t\t\t\t\t/*if(Integer.parseInt(st[0]) == 30350) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 12) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString taster_name = st[count+8];\r\n\t\t\t\t\tString taster_handle = st[count+9];\r\n\t\t\t\t\tString variety = st[count+10];\r\n\t\t\t\t\tString winery = st[count+11];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString[] reviewer = {\r\n\t\t\t\t\t\t\ttaster_name,\r\n\t\t\t\t\t\t\ttaster_handle\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// We no longer need an array list. we have our size required. Put into an array.\r\n\t\tWine[] array_wines = new Wine[arr_list.size()];\r\n\t\tarray_wines = arr_list.toArray(array_wines);\r\n\t\t\r\n\t\treturn array_wines;\r\n\t\r\n\t}", "private UInteger[] getHashValues() {\n int hashWindowSize = 48;\n UInteger[] hashValues = new UInteger[this.fileContent.length];\n int shiftAmount = this.getShiftAmount(hashWindowSize);\n int i = 0;\n\n int[] lookupTable =\n {0x5e3f7c48, 0x796a0d2b, 0xbecd4e32, 0x6f16159c, 0x687312bc, 0x12a6f30a, 0x8fca2662,\n 0x79b83d14, 0x3fab3f30, 0x984d6ca2, 0x4df5fe6c, 0x4acd3196, 0x6245ad21,\n 0x3a15e5ba, 0x90db6499, 0x05aacb6b, 0x791cf724, 0x504cd910, 0x98093570,\n 0x090392df, 0xf193e5b8, 0x42023c5b, 0x80a95c6a, 0x11e676be, 0xc70f2117,\n 0xeed4587f, 0x6479e9bd, 0x1b0c427c, 0x410486ba, 0x30f5b837, 0xf957d307,\n 0x1535f121, 0xabe45e90, 0x7a1ab8f0, 0x1c6887e4, 0x4170b7ba, 0x8b491bed,\n 0x5c920e73, 0x1b1ed791, 0x7a0ed482, 0xcce86619, 0x45dc7290, 0x57e71362,\n 0x2e24f01c, 0x0a0637f3, 0x0e8c5565, 0x15944012, 0x34f7eeea, 0xbc628141,\n 0x1e200874, 0xe9244379, 0x3e63aeca, 0x7a3b3cce, 0x73f8a245, 0xd734e215,\n 0x834fa434, 0xf96a0904, 0xfb39a424, 0x0bfa963a, 0x9b236ee2, 0xa2131005,\n 0x3eb70acf, 0x2907bcd8, 0x3f685f3a, 0x3765fd37, 0x1c1c34d2, 0x03a95179,\n 0x024be6c3, 0x06128960, 0x844e7490, 0xe2b371a3, 0x3382909c, 0x3d519a77,\n 0x90971ec9, 0x6ea745e5, 0x490b3a5c, 0x7f3916f7, 0xbc150351, 0x241a7ba0,\n 0xec93c2bb, 0x6c7083aa, 0xf3937751, 0xe6aa1df1, 0x129fc001, 0xb90709b9,\n 0x7e59a4fc, 0x4509e58a, 0x8a93ed43, 0x6934ce62, 0x8ec6af1a, 0xf36581a9,\n 0x53d01d93, 0xb34eef69, 0x08494a84, 0x0f6dff34, 0x74729aa3, 0x48b5475f,\n 0xb986dc84, 0xd0424c8d, 0xb72ad089, 0x0adbbdb8, 0x824fdbe8, 0x99ad1058,\n 0x98faec38, 0xe746242b, 0x2b7ee7fc, 0x2e151fa7, 0x6413270f, 0x68ed7239,\n 0x7729e2d3, 0x5697b3a5, 0x0b90a6c3, 0xdf7cefcf, 0xded46a48, 0x46956888,\n 0xb3bb6dc4, 0xe987578f, 0xf82e74b7, 0xc8eeeba4, 0xdd960ff9, 0x482ed28d,\n 0x4f343078, 0x563ab8a4, 0x3ec7aa0d, 0x2481d448, 0x5fe98704, 0x5aafc580,\n 0x841d81ec, 0xae7fe8fd, 0x6b31ccb6, 0x911ebdd4, 0x75f4703d, 0xe6855a0f,\n 0x6184b42e, 0x147a4a95, 0x39528e48, 0xe975b416, 0x3cba13d3, 0x1e23e544,\n 0xf7955286, 0xa5f96b7f, 0xaaa697aa, 0x29e794e3, 0x87628c09, 0xfeebf5f1,\n 0xf8b070cd, 0xe361b627, 0x8c7a8682, 0x69cab331, 0xca867ad1, 0xd0151a96,\n 0xfc19a6b9, 0x6d7439e7, 0x64cd62ac, 0x4a650747, 0x9ddbfa28, 0x337c8bed,\n 0xf12a6860, 0x3767ffd3, 0x13559ced, 0x71ac2011, 0xc11dc687, 0x260b7105,\n 0xc13bca0c, 0xcd0af893, 0x793b54e6, 0x89d27fc3, 0xc6bd1c88, 0xe3337313,\n 0x387bc671, 0x61280de4, 0x76941a36, 0xaa52a2b9, 0x6d7cb52c, 0x18ff4d70,\n 0x8987cf38, 0x306e47ed, 0xf7df8135, 0x18a8e024, 0xc9eb085f, 0xc1a7c769,\n 0xd5667a12, 0x9c8be93a, 0x028781b1, 0x6213dada, 0x07fef4f5, 0x5e6bf91d,\n 0x469ea798, 0xb9654a37, 0x1cb5e74e, 0x525d502d, 0xe805ec68, 0xdd8c4320,\n 0x7890848f, 0x61e59c8e, 0x1d99f9ef, 0x25b60b20, 0x2f198088, 0xe01b6926,\n 0xffa4917f, 0xb2fa0f22, 0xee8ac924, 0x18a1c5a7, 0xb76d8d7f, 0x88ad5e0d,\n 0x7b3fb12b, 0xc8a91add, 0x762a6f4e, 0x056fad31, 0xebecfab8, 0xea54cd17,\n 0x71f5af9f, 0xfaececa1, 0x08a52f4d, 0xbb5efebe, 0x5bcb04c2, 0xcb2530b0,\n 0x01bb862b, 0xbb5d54f0, 0x404deb4b, 0x038658bd, 0x09399005, 0xddd862c8,\n 0x8985776f, 0xcfcfd717, 0xbec756cb, 0x52aecc5a, 0x09ac3f62, 0x62c1c6fb,\n 0x76cc3221, 0xcde6d028, 0x844d9291, 0xc143eeac, 0x0ea5e772, 0x8855456e,\n 0xeb03a426, 0x3398475d, 0x73dc8107, 0x681605d0, 0xd18b6264, 0x934e43eb,\n 0x59e76d21, 0xd3ce2b77, 0x4ccfee1c, 0x2f4af76d, 0x8b12a309, 0x849bb415,\n 0xf45ad809, 0xc7bccae7, 0xac891c35, 0x59db2274, 0xbcd71393, 0x2c9b1705,\n 0xcb536a69, 0xb2800f00, 0x111313fc};\n\n while (i < this.fileContent.length) {\n UInteger hashValue = i == 0 ? uint(0) : hashValues[i - 1];\n int trailingEdgeData = i < hashWindowSize ? ubyte(0).intValue() :\n ubyte(this.fileContent[i - hashWindowSize]).intValue();\n int leadingEdgeData = ubyte(this.fileContent[i]).intValue();\n UInteger val = hashValue.xor(uint(lookupTable[trailingEdgeData]))\n .xor(uint(lookupTable[leadingEdgeData]));\n hashValues[i] =\n val.leftShift(2).inclusiveOr(val.rightShift(Integer.SIZE - shiftAmount));\n i++;\n }\n\n return hashValues;\n }", "long getNumberOfSpectra(String experimentAccession);", "public PeptideSpectrumMatch(ISpectrum spectrum, List<IPeak> inpeaks) {\n super(spectrum, inpeaks);\n\n if (spectrum instanceof IPeptideSpectrumMatch) {\n peptide = ((IPeptideSpectrumMatch) spectrum).getPeptide();\n annotation = ((IPeptideSpectrumMatch) spectrum).getAnnotation();\n } else {\n peptide = null;\n annotation = null;\n }\n makeAdvancedCalculations();\n }", "public JSONObject searchByArtist(String artist) {\n\t\tJSONObject byArtistObject = new JSONObject();\n\t\tJSONArray songList = new JSONArray();\n\t\tTreeSet<String> simSongsList = new TreeSet<>();\n\t\t\n\t\tif(this.artistMap.get(artist) != null) {\n\t\t\tfor(Song song: this.artistMap.get(artist)) {\n\t\t\t\tfor(String simSong: song.getSimilars()) {\n\t\t\t\t\tif(idMap.containsKey(simSong)) {\n\t\t\t\t\t\tsimSongsList.add(simSong);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(String trackId: simSongsList) {\n\t\t\t\tsongList.add(idMap.get(trackId).toJSON());\n\t\t\t}\n\t\t}\n\t\t\n\t\tbyArtistObject.put(\"artist\", artist);\n\t\tbyArtistObject.put(\"similars\", songList);\n\t\t\n\t\treturn byArtistObject;\n\t}", "public void setNumberSpectra(int numberSpectra) {\n this.numberSpectra = numberSpectra;\n }", "public static void init() {\n \n if(stock==null){\n stock=Analyser.stock;\n //for each stock, it price and the time\n// stoc\n// String[] listedCompanies = new NSELoader(20).getAllStocks();\n// \n// for (int i =0; i < listedCompanies.length; i++) {\n// \n// String stockName = listedCompanies[i];\n// float price = 0;\n// int time = 0;\n// ArrayList<String> value = new ArrayList<>();\n// String data = time + \":\" + price;// ':' is used as boundary token\n// value.add(data);\n// stock.put(stockName, value);\n// }\n \n\n }\n }", "private void initializeData() {\n String[] sportsList = getResources().getStringArray(R.array.track_title);\n String[] sportsInfo = getResources().getStringArray(R.array.track_category);\n\n // Clear the existing data (to avoid duplication).\n mSportsData.clear();\n\n TypedArray trackImageResources =\n getResources().obtainTypedArray(R.array.track_image);\n\n // Create the ArrayList of Sports objects with titles and\n // information about each sport.\n for (int i = 0; i < sportsList.length; i++) {\n for (int j = 0; j < workout.size(); j++) {\n if (workout.get(j).equals(sportsList[i])) {\n mSportsData.add(new Track(sportsList[i], sportsInfo[i], trackImageResources.getResourceId(i, 0)));\n }\n }\n }\n\n // Notify the adapter of the change.\n mAdapter.notifyDataSetChanged();\n\n trackImageResources.recycle();\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "public static ArrayList<Match> allMatches(String season){\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches filtered by season\n ArrayList<Match> matchesDisplayed = getMatchesForSeason(guiSeasonFilteredClubs);\n\n return matchesDisplayed;\n }", "public final /* synthetic */ Map mo33710j(List list) {\n HashMap hashMap = new HashMap();\n for (C2168bw next : this.f1705f.values()) {\n String str = next.f1693c.f1686a;\n if (list.contains(str)) {\n C2168bw bwVar = (C2168bw) hashMap.get(str);\n if ((bwVar == null ? -1 : bwVar.f1691a) < next.f1691a) {\n hashMap.put(str, next);\n }\n }\n }\n return hashMap;\n }", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "@Override\n public List<PeptideSpectrumMatchIDP> getResults(List<IdPickerInput> inputList, Program inputGenerator, IDPickerParams params) {\n return null;\n }", "private void createArray()\r\n\t{\r\n\t\tscorers = new String[NUMBER_OF_ENTRIES];\r\n\t\tfor(int i = 0; i < NUMBER_OF_ENTRIES; i += 2)\r\n\t\t{\r\n\t\t\tscorers[i] = \"[NULL]\";\r\n\t\t\tscorers[i + 1] = String.valueOf(-1);\r\n\t\t}\r\n\t}", "private HashMap<Integer, HashMap<String,String>> getAllFrequencies() {\n HashMap<Integer,HashMap<String,String>> freq\n = dbController.getAllFrequencies();\n if (freq == null)\n return null;\n HashMap<Integer, HashMap<String, String>> response = new HashMap<Integer, HashMap<String, String>>();\n int i = 2;\n //Passing on any frequency and creates a message to send\n for (Map.Entry<Integer,HashMap<String,String>> objs : freq.entrySet()){\n HashMap<String,String> obj = objs.getValue();\n\n response.put(i, new HashMapBuilder<String, String>().put(\"name\", obj.get(\"name\"))\n .put(\"frequency\",obj.get(\"frequency\")).build());\n i++;\n }\n return response;\n }", "private List<String> getMoreTracks() {\n if (tracksByBpm.isEmpty()) return new ArrayList<String>();\n\n Integer heartRate = DeviceScanActivity.mData;\n ArrayList<Pair<Integer,PlaylistTrack>> tracksInInterval = new ArrayList<>();\n\n if (heartRate == null || heartRate < 40)\n heartRate = (new Random()).nextInt(70) + 50;\n\n if (tracksByBpm.containsKey(heartRate)) {\n while (tracksInInterval.size() < Math.min(MIN_SONGS, tracksByBpm.get(heartRate).size())) {\n Pair<Integer, PlaylistTrack> newTrack = new Pair<Integer, PlaylistTrack>(\n heartRate,\n tracksByBpm.get(heartRate).get(rand.nextInt(tracksByBpm.get(heartRate).size())));\n\n if(!tracksInInterval.contains(newTrack))\n tracksInInterval.add(newTrack);\n }\n }\n\n for (int interval = INTERVAL_STEPS, lastInterval = 1;\n tracksInInterval.size() < MIN_SONGS && interval < INTERVAL_BOUND;\n interval+=INTERVAL_STEPS, lastInterval += INTERVAL_STEPS)\n {\n for (int i = lastInterval; i < interval; i++)\n if (tracksByBpm.containsKey(heartRate - i)) {\n for (int j = 0 ; j < tracksByBpm.get(heartRate - i).size(); j++){\n tracksInInterval.add(new Pair<Integer,PlaylistTrack>(\n heartRate - i,\n tracksByBpm.get(heartRate - i).get(j)));\n }\n } else if (tracksByBpm.containsKey(heartRate + i)) {\n for (int j = 0 ; j < tracksByBpm.get(heartRate + i).size(); j++){\n tracksInInterval.add(new Pair<Integer,PlaylistTrack>(\n heartRate + i,\n tracksByBpm.get(heartRate + i).get(j)));\n }\n }\n }\n\n List<String>nextTracks = new ArrayList<String>();\n // add at least MIN_SONGS tracks to the play queue\n while(nextTracks.size() < MIN_SONGS) {\n nextTracks.add(tracksInInterval.remove(\n rand.nextInt(tracksInInterval.size())).second.track.uri);\n }\n\n // if there are still no tracks to play select a random song\n if(nextTracks.isEmpty()) {\n Set<Integer> keySet = tracksByBpm.keySet();\n Integer[] keys = new Integer[keySet.size()];\n keySet.toArray(keys);\n Integer key = keys[rand.nextInt(keys.length)];\n List<PlaylistTrack> plTracks = tracksByBpm.get(key);\n nextTracks.add(plTracks.get(rand.nextInt(plTracks.size())).track.uri);\n }\n\n return nextTracks;\n }", "private void makeArrays()\n\t{\n\t\tfor (String key : sub.keySet())\n\t\t\tsub.put(key, ((List<String>) sub.get(key)).toArray(s0));\n\t\tfor (String key : attrs.keySet())\n\t\t\tattrs.put(key, ((List<String>) attrs.get(key)).toArray(s0));\n\t\tfor (String key : defs.keySet())\n\t\t\tdefs.put(key, ((List<String>) defs.get(key)).toArray(s0));\n\t\tfor (String key : smodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) smodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tsmodes.put(key, array);\n\t\t}\n\t\tfor (String key : amodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) amodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tamodes.put(key, array);\n\t\t}\n\t}", "private void getCriteriaSaved() {\n try {\n Map<Integer, Criteria> mapCriteria = search.getDataBaseInHashMap();\n for (Integer key : mapCriteria.keySet()) {\n Criteria cri = mapCriteria.get(key);\n frameSearch.getTpDataBase().addRowTableDb(\n (key), mapCriteria.get(key).getNameOwnwe());\n }\n cm = new HashMap<Integer, Criteria>(mapCriteria);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException;", "public static Match[] init () throws FileNotFoundException{\n\n\t\tint numLine = 0;\n\t\t//reads the input file ExchangeRate.txt\n\t\tScanner input1 = new Scanner (new File (\"src/ExchangeRate.txt\"));\n\n\t\t//This loop goes through each line\n\t\twhile (input1.hasNextLine()) {\n\t\t\tinput1.nextLine();\n\t\t\tnumLine++;\n\t\t}\n\n\t\t//Close it in order to start from 0 again for the next loop\n\t\tinput1.close();\n\n\n\t\tMatch [] data = new Match [numLine];\n\t\tint i = 0;\n\t\tScanner input = new Scanner (new File(\"src/ExchangeRate.txt\"));\n\n\t\t//This while loop insures that the program names each section correctly. \n\t\twhile (input.hasNext()) {\n\t\t\tString curr1 = input.next(); //Set curr1 to the first section on the certain line\n\t\t\tString curr2 = input.next(); //Set curr2 to the second section on that same line\n\t\t\tdouble ex = input.nextDouble(); //Set ex to the third section on the same line\n\t\t\t//Sets currency2, currency2, and the exchange rate into an array\n\t\t\tdata[i] = new Match(curr1, curr2, ex);\n\t\t\ti++;\n\t\t}\n\t\tinput.close();\n\t\treturn data;\n\n\t}", "public static Map<String, ArrayList<ImageDataModel>> getImageFolderMap(Activity activity) {\r\n imageFolderMap.clear();\r\n keyList.clear();\r\n imageDataModelList.clear();\r\n String BUCKET_ORDER_BY;\r\n Uri uri;\r\n Cursor cursor;\r\n int columnIndexDataPath, columnIndexFolderName, columnIndexTitleName,\r\n columnIndexDate, columnIndexSize, columnIndexBucketId, columnIndexAlbumId, columnIndexDuration;\r\n String absolutePathOfImage, folderName, imageTitle, fileDate, bucketId, AlbumId, fileSize, duration;\r\n\r\n /**\r\n * Fetching Audio type of files through content provider\r\n */\r\n /**\r\n * Fetching audio type of files through content provider\r\n */\r\n uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\r\n BUCKET_ORDER_BY = MediaStore.Audio.Media.DATE_MODIFIED + \" DESC\";\r\n String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\r\n String[] projection1 = new String[]{MediaStore.Audio.AudioColumns.ALBUM,\r\n MediaStore.Audio.AudioColumns.ALBUM_ID,\r\n MediaStore.Audio.AudioColumns.DISPLAY_NAME,\r\n MediaStore.Audio.AudioColumns.DATA,\r\n MediaStore.Audio.AudioColumns.SIZE,\r\n MediaStore.Audio.AudioColumns.DATE_MODIFIED,\r\n\r\n MediaStore.Audio.AudioColumns.DURATION};\r\n\r\n cursor = activity.getContentResolver().query(uri, projection1, selection, null, BUCKET_ORDER_BY);\r\n if (cursor != null) {\r\n columnIndexFolderName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM);\r\n columnIndexAlbumId = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM_ID);\r\n columnIndexTitleName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DISPLAY_NAME);\r\n\r\n columnIndexDataPath = cursor.getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DATA);\r\n while (cursor.moveToNext()) {\r\n absolutePathOfImage = cursor.getString(columnIndexDataPath);\r\n folderName = Constant.AUDIO_FOLDER_NAME;\r\n imageTitle = cursor.getString(columnIndexTitleName);\r\n\r\n ImageDataModel imageDataModel = new ImageDataModel();\r\n imageDataModel.setFile(new File(absolutePathOfImage));\r\n imageDataModel.setFolderName(folderName);\r\n imageDataModel.setPath(absolutePathOfImage);\r\n imageDataModel.setImageTitle(imageTitle);\r\n imageDataModel.setBucketId(\"1\");\r\n imageDataModel.setTimeDuration(\"0\");\r\n imageDataModel.setSelected(false);\r\n if (FileUtils.isImageFile(absolutePathOfImage)) {\r\n imageDataModel.setImage(true);\r\n } else if (FileUtils.isVideoFile(absolutePathOfImage)) {\r\n imageDataModel.setVideo(true);\r\n } else if (FileUtils.isAudioFile(absolutePathOfImage)) {\r\n imageDataModel.setAudio(true);\r\n }\r\n if (imageDataModel.getFile().length() > 0) {\r\n imageDataModelList.add(imageDataModel);\r\n if (imageFolderMap.containsKey(folderName)) {\r\n imageFolderMap.get(folderName).add(imageDataModel);\r\n } else {\r\n ArrayList<ImageDataModel> listOfAllImages = new ArrayList<ImageDataModel>();\r\n listOfAllImages.add(imageDataModel);\r\n imageFolderMap.put(folderName, listOfAllImages);\r\n }\r\n }\r\n }\r\n cursor.close();\r\n }\r\n keyList.addAll(imageFolderMap.keySet());\r\n //Send notification through main thread\r\n new Handler(Looper.getMainLooper()).post(new Runnable() {\r\n @Override\r\n public void run() {\r\n GlobalBus.getBus().post(new LandingFragmentNotification(Constant.UPDATE_UI));\r\n }\r\n });\r\n return imageFolderMap;\r\n }", "public Hashtable getFilters() {\n // we need to build the hashtable dynamically\n return globalFilterSet.getFilterHash();\n }", "public List<String> getSpectrumIdList()\r\n\t{\r\n\t\t/*\r\n\t\t * Return list of spectrum id values.\r\n\t\t */\r\n\t\treturn fetchSpectrumIds();\r\n\t}", "public String[] getSoundDevicesList();", "public void initPeriodsSearch() {\n\n\t\t//init fundamentalFreq\n\t\tcalculatefundamentalFreq();\n\n\t\t//set the first search area\n\t\tfinal double confidenceLevel = 5 / 100.;\n\t\tnextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );\n\t}", "static void initializeArray(boolean firstTime) {\n\t\tint count = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\tint mod = val % m;\n\t\t\tif (array[mod] == -1) {\n\t\t\t\tarray[mod] = val;\n\t\t\t\tresult[1]++;\n\t\t\t\tcount++;\n\t\t\t} else if (firstTime) {\n\t\t\t\tresult[0] = count;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected void treatSpeakers()\n\t{\n\t\tint nHP = (Integer) results[0];\n\t\tdouble Xdist = (Double)results[1];\n\t\tdouble Ydist = (Double)results[2];\n\t\tdouble shift = (Double)results[3];\n\t\tfloat height = (Float) results[4];\n\t\tint numHP1 = (Integer) results[5];\n\t\tboolean stereoOrder = (Boolean)results[6];\n\t\tint lastHP = (replace ? 0 : gp.speakers.size()-1);\n\t\tint numHP;\n\t\tint rangees = (nHP / 2);\n\t\tfloat X, Y;\n\t\tif(replace) gp.speakers = new Vector<HoloSpeaker>(nHP);\n\t\tnumHP1 = (evenp(nHP) ? numHP1 : 1 + numHP1);\n\t\t// Creation des HPs en fonction de ces parametres\n\t\tfor (int i = 1; i <= rangees; i++)\n\t\t\t{\n\t\t\t\t// on part du haut a droite, on descend puis on remonte\n\t\t\t\t\n\t\t\t\tX = (float) (-Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + rangees + rangees - i) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\t\n\t\t\t\tX = (float) (Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2+1;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + i - 1) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\tinc();\n\t\t\t}\n\n\t\t\tif (!evenp(nHP))\n\t\t\t{\n\t\t\tX = 0;\n\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5));\n\t\t\tnumHP = ((numHP1 - 1) % nHP) + 1;\n\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t}\n\t}", "@Test\n public void showHandledPeaksForInterestingCases() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n ISimilarityChecker checker = new FrankEtAlDotProductTester();\n ISimilarityChecker currentChecker = new FrankEtAlDotProduct(0.5F, 15, true);\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n String id1 = psm1.getId();\n if (!INTERESTING_ID_SET.contains(id1))\n continue; // not an interesting case\n\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n\n String id2 = psm2.getId();\n if (!INTERESTING_ID_SET.contains(id2))\n continue; // not an interesting case\n\n // System.out.println(\"Comparing \" + id1 + \" \" + id2);\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n\n // System.out.println(\"Peaks compared original Frank Et Al (when the code is written)\");\n // print usage\n // System.out.println(usedPeaksTester.toString());\n\n usedPeaksTester.setLength(0); // clear debug output\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n // print usage\n // System.out.println(\"Peaks compared current Frank Et Al \");\n // System.out.println(usedPeaksTester.toString());\n\n\n }\n\n }\n }", "private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }", "@Override\n public synchronized void buildIndex(){\n for(SlotData data : slotDataList){\n data.prepareReport();\n }\n }", "public static WFJFilterMap[] findFilterMaps() {\n return filterMaps.asArray();\n }", "private Map<String, Object> analysisMap(ArrayList<String> data) {\n Map<String, Object> map = new HashMap<>();\n map.put(DAILY, data);\n return map;\n }", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "@Override\n public List<Map<Frequency, DataForDetection>> getStuffReference() {\n return super.getStuffReference();\n }", "public Spectrum getSpectrum(int index) {\n return get(index);\n }" ]
[ "0.5762133", "0.5721538", "0.5661652", "0.54163426", "0.5326599", "0.5254807", "0.5254183", "0.5173523", "0.5130653", "0.5043501", "0.5006661", "0.49937385", "0.49846593", "0.49843168", "0.49337545", "0.49101982", "0.4902364", "0.4895364", "0.48926064", "0.48808235", "0.48352987", "0.48064673", "0.47992316", "0.47979528", "0.4796231", "0.47955224", "0.47864118", "0.47708377", "0.4760425", "0.47598752", "0.47526565", "0.4732661", "0.47304443", "0.47259006", "0.47257918", "0.47215146", "0.4721221", "0.4699871", "0.46958113", "0.46921083", "0.46908942", "0.46883136", "0.46861443", "0.46854094", "0.4679125", "0.467907", "0.46742436", "0.46716776", "0.4670945", "0.46682099", "0.46676844", "0.466666", "0.4661649", "0.4647098", "0.46350706", "0.46296528", "0.46168596", "0.4616094", "0.46149394", "0.4608629", "0.46012822", "0.46006048", "0.45821565", "0.45699403", "0.4551996", "0.4550212", "0.4545579", "0.4540523", "0.45404795", "0.45381144", "0.45375475", "0.4532283", "0.4527982", "0.45279437", "0.45253804", "0.45162714", "0.45128113", "0.4511274", "0.4510391", "0.45098943", "0.4499634", "0.4496793", "0.4486266", "0.44842276", "0.44838923", "0.44754037", "0.44732785", "0.4469898", "0.44681457", "0.4468074", "0.44603312", "0.44588828", "0.44459152", "0.4438312", "0.44376063", "0.4432846", "0.44299847", "0.44240746", "0.44229117", "0.441689" ]
0.5829713
0
Returns array of all transition type definition objects for given fatty acids
private static ArrayList<TransitionType> createTransitionTypes(ArrayList<String> typeArray) { ArrayList<TransitionType> definitions = new ArrayList<TransitionType>(); //Create static fragment class definitions.add(new TransitionType("Fragment",null,false,false,0)); //Create static neutral loss class definitions.add(new TransitionType("Neutral Loss",null,false,true,0)); //For all fatty acid type strings for (int i=0; i<typeArray.size(); i++) { //Create moiety fragment class definitions.add(new TransitionType(typeArray.get(i)+" Fragment",typeArray.get(i),true,false,1)); //Create moiety neutral loss class definitions.add(new TransitionType(typeArray.get(i)+" Neutral Loss",typeArray.get(i),true,true,1)); } //Create cardiolipin DG fragment class definitions.add(new TransitionType("Cardiolipin DG Fragment","Alkyl",true,false,2)); //Create PUFA neutral loss class definitions.add(new TransitionType("PUFA Fragment","PUFA",true,false,1)); //Create PUFA fragment class definitions.add(new TransitionType("PUFA Neutral Loss","PUFA",true,true,1)); return definitions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<DeclarationNaissance> getAllActe();", "public String[] getFfTypes(){\n return ffc.getFfTypes();\n }", "public Type[] types();", "private Collection<TypeDeclaration> getAllTypes() {\n if (allTypes != null) {\n return allTypes;\n }\n allTypes = new ArrayList<TypeDeclaration>();\n for (Symbol s : getMembers(false)) {\n allTypes.add(env.declMaker.getTypeDeclaration((ClassSymbol) s));\n }\n return allTypes;\n }", "public <T> List<T> getDeclarablesByType(Class<T> type) {\n\t\treturn this.declarables.stream()\n\t\t\t\t.filter(type::isInstance)\n\t\t\t\t.map(type::cast)\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public static List<AbiDefinition> getEventAbiDefinitions(String contractAbi) {\n List<AbiDefinition> abiArr = JsonUtils.toJavaObjectList(contractAbi, AbiDefinition.class);\n List<AbiDefinition> result = new ArrayList<>();\n for (AbiDefinition abiDefinition : abiArr) {\n if (ConstantProperties.TYPE_EVENT.equals(abiDefinition.getType())) {\n result.add(abiDefinition);\n } \n }\n return result;\n }", "ConjuntoTDA claves();", "java.util.List<com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight> \n getTransitFlightsList();", "public float[] getTypeAmts() {\n float[] newAmts = typeAmts;\n return newAmts;\n }", "@SuppressWarnings(\"unchecked\")\n private List<Node> getDecoratorsOfClass(AClass ac) {\n List<Node> instanceDecorators = new ArrayList<>();\n List<Node> staticDecorators = new ArrayList<>();\n List<Node> constructorParameterDecorators = new ArrayList<>();\n List<Node> classDecorators = (List<Node>)(List<?>)ac.getDecorators();\n for (MemberDefinition<?> member : ac.getBody().getBody()) {\n if (!member.isConcrete()) continue;\n List<Node> decorators = getMemberDecorators(member);\n if (member.isConstructor()) {\n constructorParameterDecorators.addAll(decorators);\n } else if (member.isStatic()) {\n staticDecorators.addAll(decorators);\n } else {\n instanceDecorators.addAll(decorators);\n }\n }\n List<Node> result = new ArrayList<>();\n result.addAll(instanceDecorators);\n result.addAll(staticDecorators);\n result.addAll(constructorParameterDecorators);\n result.addAll(classDecorators);\n return result;\n }", "public String[] readClasses();", "default List<TypeInfo> allTypes() {\n List<TypeInfo> allTypes = new LinkedList<>();\n allTypes.add(this);\n allTypes.addAll(Arrays.asList(interfaces()));\n allTypes.addAll(superClass().stream().flatMap(s -> s.allTypes().stream()).collect(Collectors.toList()));\n return allTypes;\n }", "public abstract Class<?>[] getCoClasses();", "@Override\r\n\tpublic List<Aircraft> getAllAircraft() {\r\n\t\treturn airCrafts;\r\n\t}", "Collection<ActivityType> getActivityTypes() throws DataAccessException;", "public List<? extends IFlexoOntologyFeatureAssociation<TA>> getBehaviouralFeatureAssociations();", "public List<SecTyp> getAllTypes();", "public static List<ArchetypeDescriptor> getArchetypeDescriptors(\r\n String[] range) {\r\n return getArchetypeDescriptors(\r\n range, ArchetypeServiceHelper.getArchetypeService());\r\n }", "TypeInfo[] interfaces();", "public List<Type> nameAnalysis(SymTable symTab) {\n List<Type> typeList = new LinkedList<Type>();\n\tint formalOffset = 0;\n for (FormalDeclNode node : myFormals) {\n SemSym sym = node.nameAnalysis(symTab);\n if (sym != null) {\n\t\t// mark offset of each variables in formalList for codeGen\n\t\tsym.size = 4;\n\t\tsym.offset = formalOffset; // mark variable's offset\n\t\t// fs.formalSpace = formalOffset + 4; // set parameter's space\n\t\tformalOffset -= 4;\n\n typeList.add(sym.getType());\n }\n }\n return typeList;\n }", "public abstract List<Dependency> selectDependencies( Class<?> clazz );", "public void crearAtracciones(){\n \n //Añado atracciones tipo A\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new A();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo B\n for (int i = 0; i < 6 ; i++){\n Atraccion atraccion = new B();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo C\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new C();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo D\n for (int i = 0; i < 3 ; i++){\n Atraccion atraccion = new D();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo E\n for (int i = 0; i < 7 ; i++){\n Atraccion atraccion = new E();\n atracciones.add(atraccion);\n }\n \n }", "public ActionTypeDescriptor[] getActionTypesAsArray() {\r\n return actionTypes.toArray(\r\n new ActionTypeDescriptor[actionTypes.size()]);\r\n }", "ImmutableList<SchemaOrgType> getAccessibilityHazardList();", "public abstract List<Scope> generateFactorScopes(State state);", "public static Tax[] getTaxes() {\n Tax[] taxes = new Tax[DeclarationFiller.getDeclaration().size()];\n int count = 0;\n if (taxes != null ) {\n for (Map.Entry<String, Integer> incomePoint : DeclarationFiller.getDeclaration().entrySet()) {\n String taxName = \"Tax of \" + incomePoint.getKey();\n int incomValue = incomePoint.getValue();\n taxes[count] = new Tax(count+1001 ,taxName, incomValue, 0.18);\n count++;\n }\n }\n return taxes;\n }", "public List<Accomodation> getAll() {\n\t\tList<Accomodation> result = new LinkedList<>();\n\n\t\ttry (Connection conn = newConnection(\"postgresql\", \"localhost\", \"5432\", \"Booking\", \"postgres\", \"portocaliu\");\n\t\t\t\tStatement stm = conn.createStatement();\n\t\t\t\tResultSet rs = stm.executeQuery(\"select id, type, bed_type, max_guests, description from accomodation\");\n\n\t\t) {\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tAccomodation ac = new Accomodation();\n\n\t\t\t\tac.setId(rs.getInt(\"id\"));\n\t\t\t\tac.setType(rs.getString(\"type\"));\n\t\t\t\tac.setBedType(rs.getString(\"bed_type\"));\n\t\t\t\tac.setMaxGuests(rs.getInt(\"max_guests\"));\n\t\t\t\tac.setDescription(rs.getString(\"description\"));\n\n\t\t\t\tresult.add(ac);\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\n\t\treturn result;\n\t}", "public ArrayList<OWLClass> getClasses(OWLOntology ontology){\n\t\t\n\t\tArrayList<OWLClass> classes = new ArrayList<OWLClass>();\n\t\tfor (OWLClass cls : ontology.getClassesInSignature())\n\t\t\tclasses.add(cls);\n\t\treturn classes;\n\t}", "private static int[][] make_subtypes(Type[] alltypes) {\n int[][] subs = new int[alltypes.length][];\n int[] tmp = new int[alltypes.length];\n for( int i=0; i<subs.length; i++ ) {\n int len=0;\n for( int j=0; j<subs.length; j++ )\n if( i!=j && alltypes[i].isa(alltypes[j]) )\n tmp[len++]=j; // isa numbers are sorted by increasing 'j'\n subs[i] = Arrays.copyOfRange(tmp,0,len);\n }\n return subs;\n }", "private AFD buildAFD() {\n\t\tfor (Cerradura cerradura : cerraduras) {\n\t\t\tEstado origen = getState(cerradura);\n\t\t\tEstado destino = null;\n\n\t\t\tfor (pol.una.py.model.lexico.Cerradura.Subconjunto conjunto : cerradura\n\t\t\t\t\t.getSubconjuntos()) {\n\t\t\t\tString codigoUnico = conjunto.getCodCerradura();\n\t\t\t\t// Conjunto vacio\n\t\t\t\tif (codigoUnico.equals(\"{}\")) {\n\t\t\t\t\tdestino = getStateError();\n\t\t\t\t} else {\n\t\t\t\t\tdestino = getState(getCerradura(codigoUnico));\n\n\t\t\t\t}\n\t\t\t\torigen.addTransition(new Transicion(origen, destino, conjunto\n\t\t\t\t\t\t.getSymbol()));\n\n\t\t\t}\n\t\t\tautomata.addEstado(origen);\n\t\t}\n\t\t// Puede darse el caso de que el estado inicial del AFN no sea mas un\n\t\t// estado inicial, sino un estado de aceptacion. Si no es un estado de\n\t\t// aceptacion, indicamos que es el estado inicial.\n\t\tif (!automata.getInitState().isAcceptation()) {\n\t\t\tautomata.getInitState().setInit(true);\n\t\t}\n\t\treturn automata;\n\t}", "Stream<ActionDefinition> actions();", "public List<MigrationType> getPrimaryMigrationTypes();", "com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight getTransitFlights(int index);", "public List<Ant> getAnts()\n {\n return ants;\n }", "List<Acquest> getAllAcquests();", "com.exacttarget.wsdl.partnerapi.ObjectDefinition[] getObjectDefinitionArray();", "public String[] getAttributeTypeIds();", "public EdgeType[] getEdgeTypes(String sourceNodeType, String destNodeType)\n {\n final ArrayList<EdgeType> alist = new ArrayList<EdgeType>();\n for (final EdgeTypeHolder eth : ethMap.values())\n if (eth.getEdgeType().getSourceType().equals(sourceNodeType)\n && eth.getEdgeType().getDestType().equals(destNodeType))\n alist.add(eth.getEdgeType());\n return alist.toArray(new EdgeType[alist.size()]);\n }", "public ArrayList<Fact> createFacts (MAcctSchema as)\n\t{\n\t\t// create Fact Header\n\t\tFact fact = new Fact(this, as, Fact.POST_Actual);\n\t\t//\tCash Transfer or Manual Deposit\n\t\tif ((\"X\".equals(m_TenderType) && !MSysConfig.getBooleanValue(\"CASH_AS_PAYMENT\", true, getAD_Client_ID()))\n\t\t\t\t|| \"G\".equals(m_TenderType))\n\t\t{\n\t\t\tArrayList<Fact> facts = new ArrayList<Fact>();\n\t\t\tfacts.add(fact);\n\t\t\treturn facts;\n\t\t}\n\n\t\tint AD_Org_ID = getBank_Org_ID();\t\t//\tBank Account Org\t\n\t\tif (getDocumentType().equals(DOCTYPE_ARReceipt))\n\t\t{\n\t\t\t//\tAsset\n\t\t\tFactLine fl = fact.createLine(null, getAccount(Doc.ACCTTYPE_BankInTransit, as),\n\t\t\t\tgetC_Currency_ID(), getAmount(), null);\n\t\t\tif (fl != null && AD_Org_ID != 0)\n\t\t\t\tfl.setAD_Org_ID(AD_Org_ID);\n\t\t\t//\t\n\t\t\tMAccount acct = null;\n\t\t\tif (getC_Charge_ID() != 0)\n\t\t\t\tacct = MCharge.getAccount(getC_Charge_ID(), as, getAmount());\n\t\t\telse if (m_Prepayment)\n\t\t\t\tacct = getAccount(Doc.ACCTTYPE_C_Prepayment, as);\n\t\t\telse\n\t\t\t\tacct = getAccount(Doc.ACCTTYPE_UnallocatedCash, as);\n\t\t\tfl = fact.createLine(null, acct,\n\t\t\t\tgetC_Currency_ID(), null, getAmount());\n\t\t\tif (fl != null && AD_Org_ID != 0\n\t\t\t\t&& getC_Charge_ID() == 0)\t\t//\tdon't overwrite charge\n\t\t\t\tfl.setAD_Org_ID(AD_Org_ID);\n\t\t}\n\t\t// APP\n\t\telse if (getDocumentType().equals(DOCTYPE_APPayment))\n\t\t{\n\t\t\tMAccount acct = null;\n\t\t\tif (getC_Charge_ID() != 0)\n\t\t\t\tacct = MCharge.getAccount(getC_Charge_ID(), as, getAmount());\n\t\t\telse if (m_Prepayment)\n\t\t\t\tacct = getAccount(Doc.ACCTTYPE_V_Prepayment, as);\n\t\t\telse\n\t\t\t\tacct = getAccount(Doc.ACCTTYPE_PaymentSelect, as);\n\t\t\tFactLine fl = fact.createLine(null, acct,\n\t\t\t\tgetC_Currency_ID(), getAmount(), null);\n\t\t\tif (fl != null && AD_Org_ID != 0\n\t\t\t\t&& getC_Charge_ID() == 0)\t\t//\tdon't overwrite charge\n\t\t\t\tfl.setAD_Org_ID(AD_Org_ID);\n\t\t\t\n\t\t\t//\tAsset\n\t\t\tfl = fact.createLine(null, getAccount(Doc.ACCTTYPE_BankInTransit, as),\n\t\t\t\tgetC_Currency_ID(), null, getAmount());\n\t\t\tif (fl != null && AD_Org_ID != 0)\n\t\t\t\tfl.setAD_Org_ID(AD_Org_ID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tp_Error = \"DocumentType unknown: \" + getDocumentType();\n\t\t\tlog.log(Level.SEVERE, p_Error);\n\t\t\tfact = null;\n\t\t}\n\t\t//\n\t\tArrayList<Fact> facts = new ArrayList<Fact>();\n\t\tfacts.add(fact);\n\t\treturn facts;\n\t}", "public static List<ArchetypeDescriptor> getArchetypeDescriptors(\r\n String[] range, IArchetypeService service) {\r\n List<ArchetypeDescriptor> result = new ArrayList<ArchetypeDescriptor>();\r\n for (String shortName : range) {\r\n result.addAll(service.getArchetypeDescriptors(shortName));\r\n }\r\n return result;\r\n }", "java.util.List<? extends com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlightOrBuilder> \n getTransitFlightsOrBuilderList();", "Collection<String> getRequiredClasses( String id );", "public org.landxml.schema.landXML11.DefinitionDocument.Definition[] getDefinitionArray()\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(DEFINITION$2, targetList);\r\n org.landxml.schema.landXML11.DefinitionDocument.Definition[] result = new org.landxml.schema.landXML11.DefinitionDocument.Definition[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public AttributeDefinition[] getAttributeDefinitions(int filter) {\n\t\treturn new AttributeDefinition[] { new AttributeDefinitionImpl() };\n\t}", "@Override\n public List<BaiseeClazz> findAllClazzInfo() {\n return claMapper.findAllClazzInfo();\n }", "Iterable<Callable<?>> getCommands(Class<? extends Annotation> transition);", "public ClassAnnotationMetaDataFilter(Class<?>[] annos) {\n _annos = new HashSet<>();\n for (Class<?> anno : annos) {\n _annos.add(Type.getDescriptor(anno));\n }\n }", "private List<Type> initPersistTypeList(JCas jc) {\r\n\t\tList<Type> pTypes = new ArrayList<Type>();\r\n\t\tTypeSystem typeSystem = jc.getTypeSystem();\r\n\t\tIterator typeIterator = typeSystem.getTypeIterator();\r\n\t\tType t;\r\n\t\twhile (typeIterator.hasNext()) {\r\n\t\t\tt = (Type) typeIterator.next();\r\n\t\t\tif (!t.getName().startsWith(\"uima.\")) {\r\n\t\t\t\tList<Feature> fts = t.getFeatures();\r\n\t\t\t\tif (t.getFeatureByBaseName(pTriggerFeature)!=null) {\r\n\t\t\t\t\tif (!t.getName().contains(\".en.\"))\r\n\t\t\t\t\t\tpTypes.add(t);\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pTypes;\r\n\t}", "public ClassType[] getArray(){\n\t\t\tClassType[] temp = new ClassType[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = new ClassType(anArray[i]);\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "F[] getFlows(T node);", "List<CardTypeDTO> lookupCardTypes();", "public IAttributeType<?>[] getAllAttributeTypes();", "public Object[] getEvClassPatternArr() {\n\t\tEnumeration<?> enumer = commitedPatternsMdl.elements();\r\n\t\tList<EvClassPattern> l = new ArrayList<EvClassPattern>(commitedPatternsMdl.size());\r\n\t\t\r\n\t\twhile (enumer.hasMoreElements()) {\r\n//\t\t\tres[i] = enumer.nextElement();\r\n//\t\t\ti++;\r\n\t\t\tl.add((EvClassPattern) enumer.nextElement());\r\n\t\t}\r\n\t\tCollections.sort(l, new Comparator<EvClassPattern>(){\r\n\t\t\tpublic int compare(EvClassPattern arg0, EvClassPattern arg1) {\r\n\t\t\t\treturn arg0.toString().compareTo(arg1.toString());\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn l.toArray();\r\n//\t\treturn res;\r\n\t}", "public static List<ArchetypeDescriptor> getArchetypeDescriptors(String shortName) {\r\n return getArchetypeDescriptors(new String[]{shortName});\r\n }", "static private PowerlessArray<String>\n types(final Class<?> actual) {\n final Class<?> end =\n Struct.class.isAssignableFrom(actual) ? Struct.class : Object.class;\n final PowerlessArray.Builder<String> r = PowerlessArray.builder(4);\n for (Class<?> i=actual; end!=i; i=i.getSuperclass()) { ifaces(i, r); }\n return r.snapshot();\n }", "public EdgeType[] getEdgeTypes(String sourceNodeType)\r\n {\r\n\tfinal ArrayList<EdgeType> alist = new ArrayList<EdgeType>();\r\n\tfor (final EdgeTypeHolder eth : ethMap.values())\r\n\t if (eth.getEdgeType().getSourceType().equals(sourceNodeType))\r\n\t\talist.add(eth.getEdgeType());\r\n\treturn alist.toArray(new EdgeType[alist.size()]);\r\n }", "ISourceType[] getMemberTypes();", "ImmutableList<SchemaOrgType> getAwardsList();", "List<AccountTypeDTO> lookupAccountTypes();", "public AttributeDefinition[] getAttributeDefinitions(int filter) {\n\t\treturn this.realOCD.getAttributeDefinitions(filter);\n\n\t}", "public List<Classinfo> listByState(int seqstate) {\n\t\treturn null;\r\n\t}", "List<FactorType> getFactorTypes(String factorId) throws WifInvalidInputException;", "List<Type> attribTypes(List<JCExpression> trees, Env<AttrContext> env) {\n \tDEBUG.P(this,\"attribTypes(2)\");\n \tDEBUG.P(\"trees=\"+trees);\n\t\t//DEBUG.P(\"env=\"+env);\n ListBuffer<Type> argtypes = new ListBuffer<Type>();\n for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail)\n argtypes.append(chk.checkRefType(l.head.pos(), attribType(l.head, env)));\n \n DEBUG.P(0,this,\"attribTypes(2)\");\n return argtypes.toList();\n }", "@NotNull\n List<? extends ClassInfo> getClasses();", "List<Type> getAllTypeList();", "@SuppressWarnings(\"unchecked\")\n\tpublic List<DeclaredType> getClassArrayFromAnnotationMethod(Supplier<Class<?>[]> supplier) {\n\t\ttry {\n\t\t\tsupplier.get();\n\t\t} catch (MirroredTypesException e) {\n\t\t\t// types WILL be declared\n\t\t\treturn (List<DeclaredType>) e.getTypeMirrors();\n\t\t}\n\t\treturn Collections.emptyList();\n\t}", "private static String [] init(String className, TypeTree tree) {\n // Use a Linked to avoid resizing.\n Collection<String> types = new LinkedList<String>();\n String [] typearray;\n\t if (className.equals(EntryRep.matchAnyClassName())) {\n\t\t// handle \"match any\" specially\" -- search from ROOT\n\t\t// Simplification suggested by \n\t\t// Lutz Birkhahn <[email protected]>\n\t\tclassName = ROOT;\n\t } else {\n\t\t// add this class\n\t\ttypes.add(className);\n\t }\n\n\t // add all subclasses\n\t walkTree(tree.classSet(className), types, tree);\n\n\t // Convert it to an array and then randomize\n\t typearray = types.toArray(new String[types.size()]);\n\t int randnum = 0;\n\t String tmpobj = null;\n int length = typearray.length;\n\t for (int i = 0; i < length; i++) {\n\t\trandnum = numgen.nextInt(length - i);\n\t\ttmpobj = typearray[i];\n\t\ttypearray[i] = typearray[randnum];\n\t\ttypearray[randnum] = tmpobj;\n\t }\n return typearray;\n\t}", "ResponseEntity<List<Type>> findTaskTypes();", "public List<Interaction> getActionsOutputFromAttacs(List<AttacDecl> list) \r\n\t\t{\r\n\t\tList<Interaction> list2 = new ArrayList<Interaction>();\r\n\t\tfor (AttacDecl attacDecl : list)\r\n\t\t\t{\r\n\t\t\tString string = attacDecl.getOutputInteraction();\r\n\t\t\tString string2 = attacDecl.getOutputAei();\r\n\t\t\tInteraction interaction = new Interaction(string2,string);\r\n\t\t\tlist2.add(interaction);\r\n\t\t\t}\r\n\t\treturn list2;\r\n\t\t}", "public EdgeType[] getEdgeTypes()\n {\n final ArrayList<EdgeType> alist = new ArrayList<EdgeType>();\n for (final EdgeTypeHolder eth : ethMap.values())\n alist.add(eth.getEdgeType());\n return alist.toArray(new EdgeType[alist.size()]);\n }", "UsedTypes getTypes();", "@Override\n\tpublic List<FoodType> FindAllType() {\n\t\treturn ftb.FindAllType();\n\t}", "@Override\n\tpublic DFA getDFA() {\n\t\t//create a new DFA\n\t\tDFA dfa = new DFA();\n\t\t//Create a queue of NFA sets for traversal\n\t\tQueue<Set<NFAState>> nq = new LinkedList<Set<NFAState>>();\n\t\t\n\t\t//Create set with start state and put it in the queue\n\t\tTreeSet<NFAState> startSet = new TreeSet<NFAState>();\n\t\tstartSet.add((NFAState) getStartState());\n\t\tdfa.addStartState(startSet.toString());\n\t\tnq.add(startSet);\n\t\t\n\t\t//for each set of NFAstates dequeued\n\t\twhile(!nq.isEmpty()) {\n\t\t\t\n\t\t\tSet<NFAState> ncurrent = nq.remove();\t\t\t\n\t\t\t\n\t\t\t//loops through each character that is not 'e' to complete transitions\n\t\t\tfor(Character c : abc) {\n\t\t\t\tif(c != 'e') {\n\t\t\t\t\tSet<NFAState> getTo = new TreeSet<NFAState>();\n\t\t\t\t\tfor(NFAState state : ncurrent) {\n\t\t\t\t\t\tgetTo.addAll(state.getTo(c));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (getTo != null) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (NFAState s : getTo) {\n\t\t\t\t\t\t\t\tif(s.hasNextE()) { // check each next state for e closure\n\t\t\t\t\t\t\t\t\tif(eClosure(s) != null) {\n\t\t\t\t\t\t\t\t\t\t//add the states from eclosure to getTo set\n\t\t\t\t\t\t\t\t\t\tSet<NFAState> setWithE = eClosure(s);\t\t\n\t\t\t\t\t\t\t\t\t\tgetTo.addAll(setWithE);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Add state name and transitions to DFA state\n\t\t\t\t\t\n\t\t\t\t\t//check if the state is final\n\t\t\t\t\tBoolean isFinal = false;\n\t\t\t\t\tfor (NFAState s : getTo) {\n\t\t\t\t\t\tfor(State f : getFinalStates()) {\n\t\t\t\t\t\t\tif(f.getName().equals(s.getName())) {\n\t\t\t\t\t\t\t\tisFinal = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//check if the state already exists in the DFA\n\t\t\t\t\tBoolean inDFA = false;\t\t\n\t\t\t\t\tfor(DFAState dstate : dfa.getStates()) {\n\t\t\t\t\t\tif(dstate.getName().equals(getTo.toString())) {\n\t\t\t\t\t\t\tinDFA = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t//add the state to DFA if it is not already\n\t\t\t\t\tif(!inDFA) {\n\t\t\t\t\t\t//check if final\n\t\t\t\t\t\tif(isFinal) {\n\t\t\t\t\t\t\tdfa.addFinalState(getTo.toString());\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tdfa.addState(getTo.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnq.add(getTo); //add new set to queue\n\t\t\t\t\t}\n\t\t\t\t\t//create the transition\t\t\n\t\t\t\t\tdfa.addTransition(ncurrent.toString(), c, getTo.toString());\n\t\t\t\t}//end if\n\t\t\t}//end for\n\t\t}//end while\n\t\treturn dfa;\n\t}", "public String[] getNodeTypes()\r\n {\r\n\treturn ntMap.keySet().toArray(new String[ntMap.size()]);\r\n }", "public Flight[] getFlights() {\r\n // Get all the table of flights with columns as keys mapped to an ArrayList\r\n // of ordered rows\r\n HashMap<String, ArrayList<String>> flightInfo = getAllTableContents(\"flights\");\r\n ArrayList<Flight> flights = parseFlights(flightInfo);\r\n Flight[] temp = new Flight[flightInfo.get(\"flightNumber\").size()];\r\n return flights.toArray(temp);\r\n }", "public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }", "public List<AssetType> getAssetTypes() throws IOException {\n try {\n String strBody = null;\n Map<String, String> params = null;\n String correctPath = \"/AssetTypes\";\n UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + correctPath);\n String url = uriBuilder.build().toString();\n\n \n String response = this.DATA(url, strBody, params, \"GET\");\n TypeReference<List<AssetType>> typeRef = new TypeReference<List<AssetType>>() {};\n return apiClient.getObjectMapper().readValue(response, typeRef);\n\n } catch (IOException e) {\n throw xeroExceptionHandler.handleBadRequest(e.getMessage());\n } catch (XeroApiException e) {\n throw xeroExceptionHandler.handleBadRequest(e.getMessage(), e.getResponseCode(),JSONUtils.isJSONValid(e.getMessage()));\n }\n }", "com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlightOrBuilder getTransitFlightsOrBuilder(\n int index);", "@Test\n public void convertAFby() {\n DistEventType x = DistEventType.LocalEvent(\"x\", 0);\n DistEventType y = DistEventType.LocalEvent(\"y\", 0);\n\n TemporalInvariantSet synInvs = new TemporalInvariantSet();\n synInvs.add(new AlwaysFollowedInvariant(x, y, \"t\"));\n List<dynoptic.invariants.BinaryInvariant> dynInvs = DynopticMain\n .synInvsToDynInvs(synInvs);\n assertTrue(dynInvs.size() == 1);\n\n BinaryInvariant dInv = dynInvs.iterator().next();\n assertTrue(dInv instanceof AlwaysFollowedBy);\n assertTrue(dInv.getFirst().equals(x));\n assertTrue(dInv.getSecond().equals(y));\n }", "public interface IAutomatonType {\n\t\n\t/**\n\t * Get the name of this automaton type.\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Get an icon for this automaton type.\n\t */\n\tpublic ImageDescriptor getIcon();\n\n\t/**\n\t * Get a list of extension ids that all automata\n\t * of this type must have. Note also that the\n\t * extension ids must match exactly. If an automaton\n\t * uses more extension types than in assumed for this\n\t * type, it will not be of this type anymore. \n\t */\n\tpublic String[] getExtensionIds();\n\t\n\t/**\n\t * Get resolved dependencies for this type.\n\t */\n\tpublic String[] getResolvedDependencies();\n\t\n\t/**\n\t * Get dependencies for this type that \n\t * could not be resolved.\n\t */\n\tpublic String[] getUnresolvedDependencies();\n\n}", "public ArrayList<String> getNamesOfClasses(OWLOntology ontology){\n\t\t\n\t\tArrayList<String> classes = new ArrayList<String>();\n\t\tfor (OWLClass cls : ontology.getClassesInSignature())\n\t\t\tclasses.add( cls.getIRI().getFragment() );\n\t\t\t\n\t\treturn classes;\n\t}", "public List<C0446fs> mo4736a(String str) {\n if (str == null) {\n throw new IllegalArgumentException(\"No name specified.\");\n }\n ArrayList arrayList = new ArrayList(this.f1125c.size());\n for (C0446fs next : this.f1125c) {\n if (str.equalsIgnoreCase(next.mo4735a())) {\n arrayList.add(next);\n }\n }\n return arrayList;\n }", "@Override\n\tpublic List<Facilities_type> getAllFacilitiesType() {\n\t\treturn this.facilitiesDao.getAllFacilitiesType();\n\t}", "IClassDefinition[] resolveAncestry(ICompilerProject project);", "public static byte[] genAllTypes(){\n byte[] types = { DataType.BAG, DataType.BIGCHARARRAY, DataType.BOOLEAN, DataType.BYTE, DataType.BYTEARRAY,\n DataType.CHARARRAY, DataType.DOUBLE, DataType.FLOAT, DataType.DATETIME,\n DataType.GENERIC_WRITABLECOMPARABLE,\n DataType.INTEGER, DataType.INTERNALMAP,\n DataType.LONG, DataType.MAP, DataType.TUPLE, DataType.BIGINTEGER, DataType.BIGDECIMAL};\n return types;\n }", "public static List<ArchetypeDescriptor> getArchetypeDescriptors(String shortName, IArchetypeService service) {\r\n return getArchetypeDescriptors(new String[]{shortName}, service);\r\n }", "public List<Taskdef> parseForTaskdefs()\n {\n parseElementForTaskdefs(rootElement); // parse outside of targets - most common definition\n\n for (Iterator targetsIterator = rootElement.getDescendants(new ElementFilter(\"target\")); targetsIterator.hasNext();)\n {\n Element targetElement = (Element) targetsIterator.next();\n\n parseElementForTaskdefs(targetElement); // parse inside of targets (such as \"init\"\n }\n\n return localTaskdefs;\n }", "private void findConceptsForInstances() {\n\t\tSet<String> temp = new HashSet<String>();\n\n\t\tfor (String s : taskInput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskInput.clear();\n\t\ttaskInput.addAll(temp);\n\n\t\ttemp.clear();\n\t\tfor (String s : taskOutput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskOutput.clear();\n\t\ttaskOutput.addAll(temp);\n\n\t\tfor (Node s : serviceMap.values()) {\n\t\t\ttemp.clear();\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tfor (String i : inputs)\n\t\t\t\ttemp.add(taxonomyMap.get(i).parents.get(0).value);\n\t\t\tinputs.clear();\n\t\t\tinputs.addAll(temp);\n\n\t\t\ttemp.clear();\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tfor (String o : outputs)\n\t\t\t\ttemp.add(taxonomyMap.get(o).parents.get(0).value);\n\t\t\toutputs.clear();\n\t\t\toutputs.addAll(temp);\n\t\t}\n\t}", "@Test\n public void testGetDecalredClasses() {\n for (Class clazz : TestClass.class.getDeclaredClasses()) {\n System.out.println(clazz.getName());\n }\n }", "public DiscoveryActionsFunction() {\n\t\trf = new DiscoveryRewardFunction();\n\t\tfor ( DiscoveryDutyCycle dc : DiscoveryDutyCycle.values() ) {\n\t\t\tallActions.add( dc );\n\t\t}\n\t}", "List constructors();", "List<Defines> getDefines();", "public final List<Atom> getAtmTypeList() {\n return atmTypeList;\n }", "public List<String> getListOfAircraftModels() {\n \n List<AircraftModel> list = project.getAircraftModelList().getModelList();\n LinkedList<String> modelListInString = new LinkedList<>();\n for (AircraftModel model : list) {\n modelListInString.add(model.getId());\n }\n\n return modelListInString;\n }", "public abstract List<QualifiedName> getAffectedFeatureTypes();", "List<Factory> selectAll();", "Collection<ObjectFlowState> getObjectFlowStates();", "Collection<DynamicAttributeDTO> listActiveAttributes(String[] nodeTypes, boolean searchableOnly, String[] attributeTypes);", "public com.expedia.www.packagefinder.database.exppackage.ExpPackageProtos.transitFlight getTransitFlights(int index) {\n return transitFlights_.get(index);\n }", "public SemanticType[] family() {\n return values();\n }" ]
[ "0.5810042", "0.51572037", "0.5151993", "0.5114111", "0.5103796", "0.49672037", "0.49190247", "0.49144533", "0.48201513", "0.48100865", "0.4792576", "0.47901773", "0.47796726", "0.4772674", "0.47649696", "0.4757108", "0.47526282", "0.47403654", "0.47279945", "0.47276577", "0.47051424", "0.4688082", "0.46868268", "0.46853265", "0.46761465", "0.465968", "0.4647109", "0.46390653", "0.4629507", "0.46281192", "0.4628035", "0.4624504", "0.46222192", "0.460667", "0.46010098", "0.46002188", "0.4588469", "0.4583373", "0.45689842", "0.45682922", "0.4562604", "0.4558299", "0.4554516", "0.45486623", "0.45339784", "0.45320725", "0.45262742", "0.45118597", "0.45052487", "0.45029762", "0.45015514", "0.44968253", "0.4494023", "0.44924805", "0.4485442", "0.4482402", "0.4480742", "0.44806078", "0.4475941", "0.44721174", "0.44649988", "0.44638786", "0.4457824", "0.44520932", "0.44459397", "0.4443246", "0.44399822", "0.4438175", "0.4434461", "0.4426822", "0.44232917", "0.44226566", "0.44218323", "0.4420842", "0.4411784", "0.44115624", "0.440915", "0.44091064", "0.44053474", "0.4402547", "0.4401336", "0.4395017", "0.43779257", "0.43753496", "0.4371097", "0.43689528", "0.43611556", "0.43407568", "0.43385166", "0.4338396", "0.43380913", "0.4337396", "0.4335448", "0.43343028", "0.4329729", "0.43212092", "0.432077", "0.43183264", "0.43124163", "0.43120915" ]
0.5671461
1
write results to folder where .mgf file is
public void writeResults(ArrayList<SampleSpectrum> spectra, String mgfFilename, int maxResults) throws FileNotFoundException { File mgfFile = new File(mgfFilename); String parentFolder = mgfFile.getParent(); String resultFileName = mgfFile.getName().substring(0,mgfFile.getName().lastIndexOf("."))+"_Results.csv"; //Check if results exists and if not create results folder in mgf file folder File resultsDir = new File(parentFolder); if (!resultsDir.exists()) resultsDir.mkdir(); PrintWriter pw = new PrintWriter(resultsDir.toString()+"\\"+resultFileName); pw.println("MS2 ID,Retention Time (min),Rank,Identification," + "Precursor Mass,Library Mass,Delta m/z,Dot Product,Reverse Dot Product,Purity,Spectral Components,Optimal Polarity,LipiDex Spectrum,Library,Potential Fragments"); for (int i=0; i<spectra.size(); i++) { if (spectra.get(i).idArray.size() > 0) { if(spectra.get(i).idArray.get(0).dotProduct>1) { pw.println(spectra.get(i).toString(maxResults)); } } } pw.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeResults() {\n gfmBroker.storeResults(this.responses, fileOutputPath);\n }", "private void createOutputFiles(){\n\t\tFile folder = new File(C.appFolderPath + C.DEBUG_FOLDER);\n\t\tboolean success = true;\n\t\tif(folder.exists()){\n\t\t\t// erase the folder\n\t\t\tDeleteRecursive(folder);\n\t\t}\n\t\t\n\t\t// create necessary folders\n\t\tif (!folder.exists()) {\n\t\t success = folder.mkdir();\n\t\t Log.d(C.LOG_TAG, \"folder is not existed, create one\");\n\t\t} else {\n\t\t\tLog.e(C.LOG_TAG, \"ERROR: folder has not been deleted\");\n\t\t}\n\t\tFile monitorFolder = new File(C.appFolderPath + C.DEBUG_FOLDER + logFolder);\n\t\tmonitorFolder.mkdir();\n\n\t\ttry {\n\t\t\tmMatlabOutFile = new PrintWriter(new FileOutputStream(new File(C.appFolderPath+ C.DEBUG_FOLDER +\"matlab.txt\"),true));\n\t\t\tmMatlabOutFile.println(inputPrefix+audioSettingName);\n\t\t\tmMatlabOutFile.println(RECODER_CHANNEL_CNT);\n\t\t\tmMatlabOutFile.println(C.DEFAULT_VOL);\n\t\t\tmMatlabOutFile.close();\n\t\t\tmMatlabOutFile = null;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(C.LOG_TAG, \"ERROR: can't open sensor file to write\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void saveImgToDir(String resultsPath, String imgName, String addToImgName, Mat mat) {\r\n\r\n\t\t\tImgcodecs.imwrite(resultsPath + \"\\\\\"\r\n\t\t\t\t\t+ imgName.substring(0, imgName.length() - 4) + addToImgName\r\n\t\t\t\t\t+ imgName.substring(imgName.length() - 4,\r\n\t\t\t\t\t\t\timgName.length()),\r\n\t\t\t\t\tmat);\r\n\t}", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void generateAndwriteToFile() {\n List<GeneratedJavaFile> gjfs = generate();\n if (gjfs == null || gjfs.size() == 0) {\n return;\n }\n for (GeneratedJavaFile gjf : gjfs) {\n writeToFile(gjf);\n }\n }", "private void writeResults() {\n File externalStorage = Environment.getExternalStorageDirectory();\n if (!externalStorage.canWrite()) {\n Log.v(TAG, \"sdcard is not writable\");\n return;\n }\n File resultFile = new File(externalStorage, RESULT_FILE);\n resultFile.setWritable(true, false);\n try {\n BufferedWriter rsWriter = new BufferedWriter(new FileWriter(resultFile));\n Log.v(TAG, \"Saved results in: \" + resultFile.getAbsolutePath());\n java.text.DecimalFormat df = new java.text.DecimalFormat(\"######.##\");\n\n for (int ct=0; ct < IPTestListJB.TestName.values().length; ct++) {\n IPTestListJB.TestName t = IPTestListJB.TestName.values()[ct];\n final float r = mResults[ct];\n float r2 = rebase(r, t);\n String s = new String(\"\" + t.toString() + \", \" + df.format(r) + \", \" + df.format(r2));\n rsWriter.write(s + \"\\n\");\n }\n rsWriter.close();\n } catch (IOException e) {\n Log.v(TAG, \"Unable to write result file \" + e.getMessage());\n }\n }", "protected void write_results(String output) {\r\n\t\t// File OutputFile = new File(output_train_name.substring(1,\r\n\t\t// output_train_name.length()-1));\r\n\t\ttry {\r\n\t\t\tFileWriter file_write = new FileWriter(output);\r\n\r\n\t\t\tfile_write.write(IS.getHeader());\r\n\r\n\t\t\t// now, print the normalized data\r\n\t\t\tfile_write.write(\"@data\\n\");\r\n\t\t\tfor (int i = 0; i < ndatos; i++) {\r\n\t\t\t\tif (!filtered[i]) {\r\n\t\t\t\t\tfile_write.write(X[i][0]);\r\n\t\t\t\t\tfor (int j = 1; j < nvariables; j++) {\r\n\t\t\t\t\t\tfile_write.write(\",\" + X[i][j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfile_write.write(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfile_write.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"IO exception = \" + e);\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "@Override\n\tprotected void saveResults(){\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"_yyyy_MM_dd_HH:mm:ss\");\n\t\tDate date = new Date();\n\t\ttry(BufferedWriter bw=new BufferedWriter(new FileWriter(\"/home/daniel/results/\"+this.mAffinityType+\"/\"+this.getClass().getSimpleName()+\"/\"+MAX_TASK_AGE+\"/\"+mOutputFileName+dateFormat.format(date)))){\n\t\t\tbw.write(this.getClass().getSimpleName()+\" with max age=\"+MAX_TASK_AGE+\"\\n\");\n\t\t\tbw.write(\"Total processing time: \"+cycles+\" TU\\n\");\n\t\t\tint count=0;\n\t\t\tfor(Task t : mTasks){\n\t\t\t\tbw.write(++count + \":\");\n\t\t\t\tif(t.getmAge()>=MAX_TASK_AGE){\n\t\t\t\t\tbw.write(\"Aging used\\n\");\n\t\t\t\t}else{\n\t\t\t\t\tbw.write(\"Aging not used\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbw.write(\"###############################################################\\n\");\n\t\t\tfor(int i=0;i<Task.TYPES_OF_TASK_NUMBER;++i){\n\t\t\t\tfor(int j=0;j<Task.TYPES_OF_TASK_NUMBER;++j){\n\t\t\t\t\tfor(int k=0;k<Task.TYPES_OF_TASK_NUMBER;++k){\n\t\t\t\t\t\t DecimalFormat df = new DecimalFormat(\"0.0\");\n\t\t\t\t\t\tbw.write(\"[\"+df.format(AFFINITY3[i][j][k])+\"]\");\n\t\t\t\t\t}\n\t\t\t\t\tbw.write(\"\\n\");\n\t\t\t\t}\n\t\t\t\tbw.write(\"###############################################################\\n\");\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void writeResults() {\n\t\t//Sort hashMap before sending to file\n\t\tTreeSet<Word> mySet = new TreeSet<>(hm.values());\n\n\t\t//Create result.txt file and write treeMap out to it\n\t\tWriter writer = null;\n\t\ttry {\n\t\t\t//System.out.println(\"Here\");\n\t\t\twriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"output\\\\results.txt\")));\n\t\t\tfor (Word word : mySet) {\n\t\t\t\twriter.write(word.getValue() + \"\\t\" + word.getCount() + \"\\n\");\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\twriter.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void writeToFiles(Context resultContext) throws IOException {\n\t\tMap<String, Map<Object, ArrayList<Object>>> keyValMappingByBaseOutputPath = resultContext.getKeyValMappingsByBaseOutputPath(); \n\t\t//Write key & value to each baseOutputPath's \n\t\tPath targetOutputDir = null;\n\t\tMap<Object, ArrayList<Object>> keyValMapping = null;\n\t\tPath finalOutputBaseDir = this.config.getFinalOutputDir();\n\t\tfor (String baseOutputPath: keyValMappingByBaseOutputPath.keySet()) {\n\t\t\tif (baseOutputPath.equals(\"\")) {\n\t\t\t\t//Regular output goes into the mapper output buffer directory.\n\t\t\t\ttargetOutputDir = this.config.getMapOutputBufferDir();\n\t\t\t}else {\n\t\t\t\t//Multiple output to a particular outputPath which was \n\t\t\t\t//specified by user goes into the final output directory. \n\t\t\t\ttargetOutputDir = Paths.get(finalOutputBaseDir.toString(), baseOutputPath);\n\t\t\t}\n\t\t\tkeyValMapping = keyValMappingByBaseOutputPath.get(baseOutputPath);\n\t\t\tthis.writeEachMapping(targetOutputDir, keyValMapping);\n\t\t};\n\t}", "public void writeFile(HashMap<String, Float> results) throws IOException {\n for (Map.Entry<String, Float> entry : results.entrySet()) {\n writer.printf(\"%s %.2f\", entry.getKey(), entry.getValue());\n writer.println(\"%\");\n }\n writer.close();\n }", "private void saveLocalFile(ByteArrayOutputStream out) {\n //sava in local files\n FileWriter fw;\n File file = new File(\"/home/shaowen2/testdata/\" + \"vm\" +servers.getServerAddress().substring(15, 17) +\"-ouput.log\");\n\n try {\n if (!file.exists()) {\n file.createNewFile();\n }\n fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(out.toString());\n //bw.write(\"\\n\" + \"Query Count:\" + count + \"|| Time:\" + new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(new Date()) + \"\\n\");\n bw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void saveMD(Matchdata out, String region)\n {\n Gson outGS = new Gson();\n String outStream = outGS.toJson(out);\n \n \n FileOutputStream outputStream;\n\n try \n {\n outputStream = new FileOutputStream(\"Saves/\"+region+\"/\"+out.getPlayerName()+\"/\"+Long.toString(out.getMatchID())+\".txt\");\n outputStream.write(outStream.getBytes());\n outputStream.close();\n } \n \n catch (Exception e) \n {\n e.printStackTrace();\n }\n \n }", "public static void exportPSMs(String filePath, TagSearchResult result) throws IOException {\r\n // Init the buffered writer.\r\n BufferedWriter writer = new BufferedWriter(new FileWriter(new File(filePath)));\r\n try {\r\n\r\n int count = 1;\r\n\r\n // Peptide header.\r\n writer.append(getPSMHeader());\r\n writer.newLine();\r\n\r\n for (Entry e1 : result.getResultMap().entrySet()) {\r\n\r\n // Get the protein hit.\r\n ProteinFamilyHit proteinFamilyHit = (ProteinFamilyHit) e1.getValue();\r\n Set<Entry<String, ProteinHit>> proteins = proteinFamilyHit.getProteinHits().entrySet();\r\n\r\n for (Entry e2 : proteins) {\r\n ProteinHit proteinHit = (ProteinHit) e2.getValue();\r\n\r\n for (PeptideHit peptideHit : proteinHit.getPeptideHitList()) {\r\n\r\n // PSM results\r\n for (PeptideSpectrumMatch psm : peptideHit.getSpectrumMatchesList()) {\r\n writer.append(count++ + SEP);\r\n writer.append(psm.getSpectrumTitle() + SEP);\r\n writer.append(peptideHit.getSequence() + SEP);\r\n writer.append(proteinHit.getAccession() + SEP);\r\n writer.append(Formatter.roundDouble(psm.getIntensityScore(), 3) + SEP);\r\n writer.append(psm.getIntensityScore() + SEP);\r\n writer.append(psm.getMatchedPeaks() + SEP);\r\n writer.newLine();\r\n }\r\n }\r\n }\r\n writer.flush();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n } finally {\r\n writer.close();\r\n }\r\n }", "public void write(String outputFolder, String name) throws IOException {\n for (Gender gender : this.keySet1()) {\n for (EventScoringTable scoreTable : this.get(gender).values()) {\n File outFile = new File(String.format(\"%s/Table %s - %s - %s.csv\",\n outputFolder,\n name,\n gender,\n scoreTable.getEvent().getIaafName()\n ));\n if (outFile.getParentFile().mkdirs()) {\n System.out.println(\"Created directory: \" + outFile.getParent());\n }\n\n FileWriter fileWriter = new FileWriter(outFile);\n fileWriter.write(String.format(\"%s,%s%n\", \"performance\", \"points\"));\n\n for (Entry<Double, Integer> score : scoreTable.getPerformancePoints().entrySet()) {\n fileWriter.write(String.format(Locale.ENGLISH,\n \"%.2f,%d%n\",\n score.getKey(),\n score.getValue()\n ));\n }\n fileWriter.close();\n }\n }\n System.out.println(\"Written conversion tables to: \" + outputFolder);\n }", "private void batchExport(){\r\n \t \t\r\n \t// Retrieve all the rsml files\r\n \tFile f = new File(batchSourceFolder.getText());\r\n \tFile[] rsml = f.listFiles(new FilenameFilter() {\r\n \t\tpublic boolean accept(File directory, String fileName) {\r\n \t\t\treturn fileName.endsWith(\".rsml\");\r\n \t\t}\r\n \t});\r\n \t \t\r\n \tif(rsml.length < 100){\r\n\t \tSR.write(\"Batch export started for \"+rsml.length+\" files\");\r\n\t\r\n\t \t// Open the different RSML files, retriev their data and get their size.\r\n\t \tRootModel[] models = new RootModel[rsml.length];\r\n\t \tint w = 0; int h = 0;\r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\tmodels[i] = new RootModel(rsml[i].getAbsolutePath());\r\n\t \t \t\tif(models[i].getWidth(true) > w) w = models[i].getWidth(true);\r\n\t \t \t\tif(models[i].getHeight(true) > h) h = models[i].getHeight(true);\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tResultsTable rt = new ResultsTable();\r\n\t \t \tImageStack is= new ImageStack(w, h);\r\n\t \t \r\n\t \t \r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\t// Send the imagr to the stack\r\n\t \t \t\tif(batchImage.isSelected()) {\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),models[i].createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), w, h, batchConvex.isSelected())); \r\n\t \t \t\t\tis.addSlice(ip.getProcessor());\r\n\t \t \t \t\t// Save a single image\r\n\t \t \t \t\tif(batchSave.isSelected()){\r\n\t \t \t \t\t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\r\n\t \t \t \t\t}\r\n\t \t \t\t}\r\n\t\t \t \tif(!batchImage.isSelected() && batchSave.isSelected()){\r\n\t\t \t \t\tSR.write(rsml[i].getName());\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),models[i].createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), batchConvex.isSelected())); \r\n\t\t \t \t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\t \t \t}\t \t \t\t\r\n\t \t \t\t\r\n\t \t \t\t// Send the results to the Result Table\r\n\t \t \t\tif(batchResults.isSelected()){\r\n\t \t \t\t\tint sel = batchJCB.getSelectedIndex();\r\n\t \t \t\t\tswitch (sel) { \r\n\t \t \t\t\t\tcase 0: models[i].sendImageData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 1: models[i].sendRootData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 2: models[i].sendNodeData(rt, rsml[i].getName()); break;\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 \tif(batchResults.isSelected()) rt.show(batchJCB.getSelectedItem().toString()+\" data\");\r\n\t \t \tif(batchImage.isSelected()){\r\n\t \t \t\tImagePlus ip = new ImagePlus(\"RSML images\");\r\n\t \t \t\tip.setStack(is);\r\n\t \t \t\tip.show();\r\n\t \t \t}\t\t\t\r\n \t}\r\n \telse{\r\n\t \tSR.write(\"Batch export started for \"+rsml.length+\" files\");\r\n\t \t \tResultsTable rt = new ResultsTable();\r\n\t \t// Open the different RSML files, retriev their data and get their size.\r\n\t \tRootModel model;\r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\tmodel = new RootModel(rsml[i].getAbsolutePath());\r\n\t\t \t \tif(batchSave.isSelected()){\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),model.createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), batchConvex.isSelected())); \r\n\t\t \t \t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\t \t \t}\t \t \t\t\r\n\t \t \t\t\r\n\t \t \t\t// Send the results to the Result Table\r\n\t \t \t\tif(batchResults.isSelected()){\r\n\t \t \t\t\tint sel = batchJCB.getSelectedIndex();\r\n\t \t \t\t\tswitch (sel) { \r\n\t \t \t\t\t\tcase 0: model.sendImageData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 1: model.sendRootData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 2: model.sendNodeData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t}\r\n\t \t \t\t}\r\n\t \t \t}\r\n \t\trt.show(batchJCB.getSelectedItem().toString());\r\n \t}\r\n \t\r\n \t \tSR.write(\"Export done for \"+rsml.length+\" files\"); \r\n }", "public void saveResult() {\n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(new FileOutputStream(resultFile));\n\t\t\tout.println(record.resultToString());\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String args[]) throws Exception {\n String fileName;\n fileName = scan.nextLine();\n\n OutputStream outStream = null;\n\n String info = readLogFile(fileName);\n\n String outFileName = \"gifs_\" + fileName;\n\n\n try{\n outStream = new FileOutputStream(new File(outFileName), true);\n outStream.write(info.getBytes(), 0, info.length());\n } catch(IOException ioEx) {\n ioEx.printStackTrace();\n } finally {\n try {\n outStream.close();\n } catch( IOException exception ){\n exception.printStackTrace();\n }\n }\n\n }", "private void writeToFile(SVGGraphics2D generator, String path) throws IOException {\n\t\tFile file = new File(path);\n\t\tif (!file.exists())\n\t\t\tfile.createNewFile();\n\t\tFileWriter fw = new FileWriter(file);\n\t\tPrintWriter writer = new PrintWriter(fw);\n\t\tgenerator.stream(writer);\n\t\twriter.close();\n\t}", "public void outputToFile(String filemame)\n {\n }", "private static void pdfFilesOutput() {\n\n // make output directory if it doesn't already exist\n new File(\"output\").mkdirs();\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n try {\n airportFlightCounter.toPDFFile();\n flightInventory.toPDFFile();\n flightPassengerCounter.toPDFFile();\n mileageCounter.toPDFFile();\n } catch (DocumentException | FileNotFoundException e) {\n logger.error(\"Could not write to one or more PDF files - please close any open instances of that file\");\n e.printStackTrace();\n }\n\n logger.info(\"Output to PDF files completed\");\n }", "private static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public Path getOutputPath() {\n\t\t\n\t\tString name = getSimulationName();\t\t\n\t\tint l = name.length();\n\t\tString sim_name = name.substring(0, l-11); // \"_SIM_FOLDER\" contains 11 character\n\t\t\n\t\tPath path = Paths.get(outpath + \"\\\\\"+ sim_name);\n\t\tif(!Files.exists(path)) {\n\t\t try {\n\t\t Files.createDirectories(path);\n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t}\n\t\treturn path;\n\t}", "public void save(){\n try{\n Date date = new Date();\n \n PrintWriter writer = new PrintWriter(\"data.MBM\", \"UTF-8\");\n \n writer.println(\"version:\"+MBMDriver.version);\n writer.println(\"numworlds:\" + worlds.size());\n writer.println(\"lastclosed:\" + date.toString());\n writer.println(\"outDir:\"+outputDir.toPath());\n \n for(int i = 0; i < worlds.size(); i++){\n \n writer.println(\"MBMWORLD:\"+worlds.get(i).getWorldFile().getName()+\":\"+worlds.get(i).getName()+\":\"+worlds.get(i).getWorldFile().toPath()+\":\"+worlds.get(i).getLastBackupDate());\n }\n \n writer.close();\n }catch(FileNotFoundException e){\n System.out.println(\"ERROR: Failed to Find File\");\n }catch(UnsupportedEncodingException e){\n System.out.println(\"ERROR: Unsupported Encoding Exception\");\n }\n }", "public void saveFile() {\n\t\tPrintWriter output = null;\n\t\ttry {\n\t\t\toutput = new PrintWriter(\"/Users/katejeon/Documents/Spring_2020/CPSC_35339/avengers_project/game_result.txt\");\n\t\t\toutput.println(textArea.getText());\n\t\t\toutput.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"File doesn't exist.\");\n\t\t} finally {\n\t\t\toutput.close();\n\t\t}\n\t}", "private void outputToFile() {\n\t\tPath filePath = Paths.get(outputFile);\n\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tRowIterator iterator = currentGen.iterateRows();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tElemIterator elem = iterator.next();\n\t\t\t\twhile (elem.hasNext()) {\n\t\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\t\twriter.write(mElem.rowIndex() + \",\" + mElem.columnIndex());\n\t\t\t\t\twriter.newLine();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to write to the provided file\");\n\t\t}\n\n\t}", "private void writeFile(String path)\n {\n FileIO fileIO = new FileIO();\n StringBuffer stringBuf = new StringBuffer();\n for(int i = 0; i< getDrivers().getSize(); i++) // go through each driver in the collection\n {\n stringBuf.append(getDrivers().getDriver(i).getName() + \",\" + getDrivers().getDriver(i).getRanking() \n + \",\" + getDrivers().getDriver(i).getSpecialSkill() + ((i == (getDrivers().getSize() - 1)) ? \"\" :\"\\n\")); // append details to buffer\n }\n fileIO.setFileName(path);\n fileIO.writeFile(stringBuf.toString());\n }", "public void writeSHFP(Path outPath, OpenOption... options) throws IOException {\n // if(true)return;\n try (PrintWriter pw = new PrintWriter(Files.newBufferedWriter(outPath))) {\n // header\n String[] header = outputDSMHeader();\n Arrays.stream(header).forEach(pw::println);\n\n // structure\n String[] structurePart = STRUCTURE.toSHlines();\n Arrays.stream(structurePart).forEach(pw::println);\n\n // source\n pw.println(EVENT.getCmtLocation().getR() + \" \" + EVENT.getCmtLocation().getLatitude() + \" \" +\n EVENT.getCmtLocation().getLongitude());\n double[] mt = EVENT.getCmt().getDSMmt();\n pw.println(Arrays.stream(mt).mapToObj(Double::toString).collect(Collectors.joining(\" \")) +\n \" Moment Tensor (1.e25 dyne cm)\");\n\n // output info\n pw.println(\"c output directory\");\n pw.println(OUTPUT + \"/\");\n pw.println(EVENT);\n pw.println(\"c events and stations\");\n\n // horizontal positions for perturbation points\n pw.println(POSITIONS.length + \" nsta\");\n Arrays.stream(POSITIONS).forEach(pp -> pw.println(pp.getLatitude() + \" \" + pp.getLongitude()));\n\n // radii for perturbation points\n pw.println(RADII.length + \" nr\");\n Arrays.stream(RADII).forEach(pw::println);\n pw.println(\"end\");\n }\n }", "private void writeToFile(){\n try(BufferedWriter br = new BufferedWriter(new FileWriter(filename))){\n for(Teme x:getAll())\n br.write(x.toString()+\"\\n\");\n br.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n }", "private static void textFilesOutput() {\n\n // make output directory if it doesn't already exist\n new File(\"output\").mkdirs();\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n try {\n airportFlightCounter.toTextFile();\n flightInventory.toTextFile();\n flightPassengerCounter.toTextFile();\n mileageCounter.toTextFile();\n } catch (FileNotFoundException e) {\n logger.error(\"Could not write to one or more text files - please close any open instances of that file\");\n e.printStackTrace();\n }\n\n logger.info(\"Output to text files completed\");\n }", "public void saveSearchTaskResult(String writePath, JsonObject request) {\t\n\t\t\tthis.rwl.lockRead();\n\t\t\t//Search songs according to request\n\t\t\tJsonObject result = this.search(request);\t\n\t\t\tPath outpath = Paths.get(writePath);\n\t\t\t//Create the file.\n\t\t\toutpath.getParent().toFile().mkdir();\n\t\t\ttry(BufferedWriter output = Files.newBufferedWriter(outpath)) {\n\t\t\t\t//Write the result to the file.\n\t\t\t\toutput.write(result.toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Exception in saveSearchTaskResult in SongLibrary class!! \" + e.getMessage());\n\t\t\t}\n\t\t\tthis.rwl.unlockRead();\n\t\t}", "private void save() throws FileNotFoundException {\n\t\tm.write(new FileOutputStream(OUTPUT), \"RDF/XML\");\n\t}", "public void outputToFile(MethodCallExpr original, MethodCallExpr mutant) {\n if (comp_unit == null || currentMethodSignature == null){\n return;\n }\n num++;\n String f_name = getSourceName(\"ARGR\");\n String mutant_dir = getMuantID(\"ARGR\");\n try {\n PrintWriter out = getPrintWriter(f_name);\n ARGR_Writer writer = new ARGR_Writer(mutant_dir, out);\n writer.setMutant(original, mutant);\n writer.setMethodSignature(currentMethodSignature);\n writer.writeFile(comp_unit);\n out.flush();\n out.close();\n }\n catch (IOException e) {\n System.err.println(\"ARGR: Fails to create \" + f_name);\n logger.error(\"Fails to create \" + f_name);\n }\n }", "public void writeImage() {\n // Write generated image to a file\n try {\n // Save as JPEG\n File file = new File(\"Images/\" + name + \"INS\" + System.currentTimeMillis() + \".jpg\");\n ImageIO.write(bufferedImage, \"jpg\", file);\n\t\t\t\t\n\n } catch (IOException e) {\n }\n }", "private void outputResults()\n{\n try {\n PrintWriter pw = new PrintWriter(new FileWriter(output_file));\n pw.println(total_documents);\n for (Map.Entry<String,Integer> ent : document_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n }\n pw.println(START_KGRAMS);\n pw.println(total_kdocuments);\n for (Map.Entry<String,Integer> ent : kgram_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n } \n pw.close();\n }\n catch (IOException e) {\n IvyLog.logE(\"SWIFT\",\"Problem generating output\",e);\n }\n}", "public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void writeFile(String[] results) {\n\t\ttry {\n\t\t\tFile file = new File(outputFile);\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\n\t\t\tfor(int i = 0; i < results.length; i++) {\n\t\t\t\tString[] tuple = testTuples.get(i);\n\t\t\t\t// convert String[] to String\n\t\t\t\tString tupleString = \"\";\n\t\t\t\tfor(int j = 0; j < tuple.length; j++) {\n\t\t\t\t\ttupleString += tuple[j] + \",\";\n\t\t\t\t}\n\t\t\t\twriter.write(tupleString + results[i] + \"\\n\");\n\t\t\t}\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch(IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void writeSimScore() throws IOException, MalformedURLException, ParseException {\n FileWriter fw = new FileWriter(new File(scoreFile+new Double(alphaValue).toString()+\".txt\")); \r\n BufferedWriter bw = new BufferedWriter(fw);\r\n\r\n int numQueries = queryList.size();\r\n for (int i = 0; i < numQueries; i++) {\r\n String query1 = queryList.get(i);\r\n for (int j = 0; j < numQueries; j++) {\r\n String query2 = queryList.get(j);\r\n double sim = alphaValue * scorematrix[i][j] + (1 - alphaValue) * calSemanticSim(i, j);\r\n bw.write(new Double(sim).toString());\r\n bw.write(\" \");\r\n }\r\n // System.out.println(\"entered \" + i);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n\r\n }", "@Test\n\tpublic void testWriteToFile() {\n\t\tArrayList<ArrayList<String>> risultatoAnalisi = \n\t\t\t\tnew ArrayList<ArrayList<String>>();\n\t\toutput.setAnalysisResult(risultatoAnalisi);\n\t\tString percorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ora passo un path corretto e controllo che venga creato il fiile\n\t\t */\n\t\tpercorso = \"test-dir\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + File.separator + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ripeto il test con valori da scrivere\n\t\t */\n\t\tArrayList<String> datiCasuali = new ArrayList<String>();\n\t\tdatiCasuali.add(\"27\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"12\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"3245543\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\toutput.setAnalysisResult(risultatoAnalisi); \n\t\tpercorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\t\t\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t}", "protected void createHMetisOutFilePath() {\n\t\tString file = \"\";\n\t\tfile += \"TEMP_GRAPH_FILE.hgr.part.\";\n\t\tfile += this.getPartitioner().getPartition().getNumBlock();\n\t\tthis.setHMetisOutFile(file);\t\n\t}", "public void searchAndWriteQueryResultsToOutput() {\n\n List<String> queryList = fu.textFileToList(QUERY_FILE_PATH);\n\n for (int queryID = 0; queryID < queryList.size(); queryID++) {\n String query = queryList.get(queryID);\n // ===================================================\n // 4. Sort the documents by the BM25 scores.\n // ===================================================\n HashMap<String, Double> docScore = search(query);\n List<Map.Entry<String, Double>> rankedDocList =\n new LinkedList<Map.Entry<String, Double>>(docScore.entrySet());\n Collections.sort(rankedDocList, new MapComparatorByValues());\n\n // ===================================================\n // 5. Write Query Results to output\n // =================================================== \n String outputFilePath =\n RANKING_RESULTS_PATH + \"queryID_\" + (queryID + 1) + \".txt\";\n StringBuilder toOutput = new StringBuilder();\n // display results in console\n System.out.println(\"Found \" + docScore.size() + \" hits.\");\n int i = 0;\n for (Entry<String, Double> scoreEntry : rankedDocList) {\n if (i >= NUM_OF_RESULTS_TO_RETURN)\n break;\n String docId = scoreEntry.getKey();\n Double score = scoreEntry.getValue();\n String resultLine =\n (queryID + 1) + \" Q0 \" + docId + \" \" + (i + 1) + \" \" + score + \" BM25\";\n toOutput.append(resultLine);\n toOutput.append(System.getProperty(\"line.separator\"));\n System.out.println(resultLine);\n i++;\n }\n fu.writeStringToFile(toOutput.toString(), outputFilePath);\n }\n }", "public void save() {\n\t\tlog.log(\"Attempting to save...\");\n\t\tPath spath = Paths.get(getFullSavePath());\n\t\tPath cpath = Paths.get(getFullSavePath() + \"units/\");\n\t\ttry {\n\t\t\tif(!Files.exists(spath))\n\t\t\t\tFiles.createDirectory(spath);\n\t\t\tif(!Files.exists(cpath))\n\t\t\t\tFiles.createDirectory(cpath);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tFile[] files = new File(cpath.toString()).listFiles();\n\t\tfor(File f : files) {\n\t\t\tf.delete();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tBufferedWriter mfestWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"progress.txt\"));\n\t\t\tmfestWriter.write(name);\n\t\t\tmfestWriter.close();\n\t\t\tfor(MapCharacter mc : getFriendlies()) {\n\t\t\t\tBufferedWriter charWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"units/\"\n\t\t\t\t\t\t+ mc.getEnclosed().getDirName()));\n\t\t\t\tcharWriter.write(mc.getEnclosed().save());\n\t\t\t\tcharWriter.close();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\t\tlog.log(\"Game saved.\");\n\t}", "private void exportGraphML()\r\n {\r\n // Create the file filter.\r\n SimpleFileFilter[] filters = new SimpleFileFilter[] {\r\n new SimpleFileFilter(\"xml\", \"Graph ML (*.xml)\")\r\n };\r\n \r\n // Save the file.\r\n String file = openFileChooser(false, filters);\r\n \r\n // Write the file.\r\n if (file != null)\r\n {\r\n String extension = file.substring(file.length() - 4);\r\n if (!extension.equals(\".xml\")) file = file + \".xml\";\r\n Writer.writeGraphML(m_graph, file);\r\n }\r\n }", "private void writeToFile(){\n Calendar c = Calendar.getInstance();\n String dateMedTaken = DateFormat.getDateInstance(DateFormat.FULL).format(c);\n FileOutputStream fos = null;\n\n try {\n fos = openFileOutput(FILE_NAME, MODE_APPEND);\n fos.write(dateMedTaken.getBytes());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if(fos != null){\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }", "public void setOutputFile(File out) {\n rnaFile = out;\n }", "public void logResult() {\r\n resTime = resTime * 1000;\r\n int b = (int) Math.round(resTime);\r\n resTime = (double) b / 1000;\r\n double averageTime = resTime / countTESTS;\r\n averageTime = averageTime * 1000;\r\n int i = (int) Math.round(averageTime);\r\n averageTime = (double) i / 1000;\r\n try (FileWriter writer = new FileWriter(\".//result.txt\")) {\r\n writer.write(resultOpen);\r\n writer.write(resultTitle);\r\n writer.write(resultSource);\r\n writer.write(resultLinkByName);\r\n writer.write(resultLinkByHref);\r\n writer.write(\"Total tests: \" + countTESTS + \"\\n\");\r\n writer.write(\"Passed/Failed: \" + PASSED_TEST + \"/\" + FAILED_TEST + \"\\n\");\r\n writer.write(\"Total time: \" + resTime + \"\\n\");\r\n writer.write(\"Average time: \" + averageTime + \"\\n\");\r\n writer.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n public void exportSimulationData(String folderPath)\n {\n String algorithmName = simShortName();\n try\n {\n BufferedWriter bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t1dtnlog_\" + algorithmName + \".txt\"));\n PrintWriter pw = new PrintWriter(bw);\n for (GPSLog l : t1DTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t2dtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : t2DTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t3dtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : t3DTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\bhdtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : bhDTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\mhdtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : mhDTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\fhdtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : fhDTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\nfdtnlog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : nfgDTNLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t1gpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : t1GPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t2gpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : t2GPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\t3gpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : t3GPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\bhgpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : bhGPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\mhgpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : mhGPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\fhgpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : fhGPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\nfgpslog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (GPSLog l : nfgGPSLog)\n {\n pw.println(l);\n }\n pw.close();\n bw.close();\n bw = new BufferedWriter(new FileWriter(folderPath + \"\\\\percentagelog_\" + algorithmName + \".txt\"));\n pw = new PrintWriter(bw);\n for (String s : percentageLog)\n {\n pw.println(s);\n }\n pw.close();\n bw.close();\n } catch (IOException ex)\n {\n\n }\n }", "private static void writeResultToFile(FileWriter writer, NumberedQuery query,\n ScoreDoc result, Document doc, int rank) throws IOException {\n StringJoiner resultLine = new StringJoiner(\" \");\n resultLine.add( Integer.toString(query.getNumber()) ); // query-id\n resultLine.add( \"0\" ); // Q0\n resultLine.add( doc.get(DOCNO) ); // document-id\n resultLine.add( Integer.toString(rank) ); // rank\n resultLine.add( Float.toString(result.score) ); // score\n resultLine.add( \"STANDARD\\n\" ); // STANDARD\n writer.write(resultLine.toString());\n }", "public void processSaveAndClose() {\n\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\ttry {\n\t\t\t\twriter = new PrintWriter(classesOutFile);\n\n\t\t\t\tint i = 0;\n\t\t\t\tfor (FitnessClass fc: fitnessClass) {\n\n\t\t\t\t\tif (fc == null) {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tString fileOutput = fc.toStringClassesOut();\n\t\t\t\t\t\twriter.print(fileOutput);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally {\n\n\t\t\t\tif (writer != null) {\n\t\t\t\t\twriter.close();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t} \t\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tJOptionPane.showMessageDialog(null, \"File not found\",\n\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t}\t\t\t\t\n\n\t}", "public void saveMap() {\n this.scanMap();\n String userHome = System.getProperty(\"user.home\");\n BinaryExporter export = BinaryExporter.getInstance();\n File file = new File(userHome + \"world.j3o\");\n try {\n export.save(this.testNode, file); \n } catch (IOException ex) {\n Logger.getLogger(mapDevAppState_2.class.getName()).log(Level.SEVERE, \"File write error\");\n }\n }", "public void WritePredictionImages() {\r\n\r\n\t\tString str = new String();\r\n\r\n\t\tModelSimpleImage img = new ModelSimpleImage();\r\n\t\tCDVector texture = new CDVector();\r\n\t\tint n = m_pModel.Rc().NRows();\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\r\n\t\t\tm_pModel.Rc().Row(n - i - 1, texture); // take largest first\r\n\t\t\timg = m_pModel.ShapeFreeImage(texture, img);\r\n\t\t\t// str.format(\"Rc_image%02i.bmp\", i );\r\n\t\t\tstr = \"Rc_image\" + i + \".xml\";\r\n\t\t\tModelImage image = new ModelImage(img, str);\r\n\t\t\timage.saveImage(\"\", str, FileUtility.XML, false);\r\n\t\t}\r\n\t\tn = m_pModel.Rt().NRows();\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\r\n\t\t\tm_pModel.Rt().Row(i, texture);\r\n\t\t\timg = m_pModel.ShapeFreeImage(texture, img);\r\n\t\t\t// str.format(\"Rt_image%02i.bmp\", i );\r\n\t\t\tstr = \"Rt_image\" + i + \".xml\";\r\n\t\t\tModelImage image = new ModelImage(img, str);\r\n\t\t\timage.saveImage(\"\", str, FileUtility.XML, false);\r\n\t\t}\r\n\t}", "private void outputFile() {\n // Define output file name\n Scanner sc = new Scanner(System.in);\n System.out.println(\"What do you want to call this file?\");\n String name = sc.nextLine();\n\n // Output to file\n Path outputFile = Paths.get(\"submissions/\" + name + \".java\");\n try {\n Files.write(outputFile, imports);\n if (imports.size() > 0)\n Files.write(outputFile, Collections.singletonList(\"\"), StandardOpenOption.APPEND);\n Files.write(outputFile, lines, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private void createresultDir() throws IOException\n\t{\n\t\tString datepattern = \"yyyy-MM-dd\";\n\t\tSimpleDateFormat sdf =new SimpleDateFormat(datepattern);\n\t\t RESULTDIR = Parameters.RESULT_LOCAL_DIR+'/'+sdf.format(new Date());\n\t\t boolean exists = (new File(Parameters.RESULT_LOCAL_DIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(Parameters.RESULT_LOCAL_DIR)).mkdirs();\n\t\t exists = (new File(RESULTDIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(RESULTDIR)).mkdirs();\n\t\t boolean append = true;\n\t FileHandler fh = new FileHandler(RESULTDIR+\"/report.log\", append);\n\t fh.setFormatter(new LogFormatter());\n\t logfile.addHandler(fh);\n\t}", "public void writeToFile() {\n\t\ttry {\n\t\t\tFileOutputStream file = new FileOutputStream(pathName);\n\t\t\tObjectOutputStream output = new ObjectOutputStream(file);\n\n\t\t\tMap<String, HashSet<String>> toSerialize = tagToImg;\n\t\t\toutput.writeObject(toSerialize);\n\t\t\toutput.close();\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void saveToFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile target = new File(directory, FILE_NAME);\n\t\t\tif (!target.exists()) {\n\t\t\t\ttarget.createNewFile();\n\t\t\t}\n\t\t\tJsonWriter writer = new JsonWriter(new FileWriter(target));\n\t\t\twriter.setIndent(\" \");\n\t\t\twriter.beginArray();\n\t\t\tfor (Scoreboard scoreboard : scoreboards.values()) {\n\t\t\t\twriteScoreboard(writer, scoreboard);\n\t\t\t}\n\t\t\twriter.endArray();\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void writeGame(Game game, List<File> existingFiles) throws MoveAlreadyWrittenException, ResultAlreadyWrittenException;", "private static void LOG() {\n if (!RESULTFILE.exists()) {\n\n if (!RESULTFILE.getParentFile().exists()) {\n RESULTFILE.getParentFile().mkdirs();\n }\n\n try {\n RESULTFILE.createNewFile();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't create file \" + RESULTFILE.getName());\n System.err.println(\"ERROR\" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n BufferedWriter bw = new BufferedWriter(new FileWriter(RESULTFILE, true));\n bw.write(\"rank\" + \"\\t\" + \"DBID\" + \"\\n\");\n bw.close();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't write to file \" + RESULTFILE.getName());\n System.err.println(\"ERROR: \" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(RESULTFILE));\n out.writeObject(RESULTS);\n out.close();\n\n } catch (IOException ioe) {\n System.err.println(\"Couldn't write to file \" + RESULTFILE.getName());\n System.err.println(\"ERROR: \" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n }\n\n /**\n * print also SQL query into a sql file\n *\n */\n if (!SQLFILE.exists()) {\n if (!SQLFILE.getParentFile().exists()) {\n SQLFILE.getParentFile().mkdirs();\n }\n try {\n SQLFILE.createNewFile();\n } catch (IOException ioe) {\n System.err.println(\"Couldn't create file \" + SQLFILE.getName());\n System.err.println(\"ERROR\" + ioe.getLocalizedMessage());\n System.out.println(\"Exiting...\");\n System.exit(1);\n }\n try {\n BufferedWriter bw = new BufferedWriter(new FileWriter(SQLFILE, true));\n bw.write(UNKNOWN.getSortedQuery() + \"\\n\");\n bw.close();\n } catch (Exception e) {\n System.err.println(\"Konnte nicht in Datei \" + SQLFILE + \" schreiben!\");\n }\n }\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "void saveSimpleCodesToFile() {\n\t\tPrintWriter writer;\r\n\t\ttry {\r\n\t\t\t//writer = new PrintWriter(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\", \"UTF-8\");\r\n\t\t\twriter = new PrintWriter(\"Code.cg\", \"UTF-8\");\r\n\t\t\tfor (SimpleCode sc : SimpleCodeMap.values()) {\r\n\t\t\t\twriter.print(sc.getCodeName() + \"-CGSeparator-\" + sc.resultCodeToWrite());\r\n\t\t\t\twriter.print(\"-CGCodeSeparator-\");\r\n\t\t\t}\r\n\t\t\twriter.close();\r\n\t\t} catch (FileNotFoundException | UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void writeMCPToFile() throws FileNotFoundException\n\t{\n\t\t try {\n\t\t\t String a = null;\n\t\t\t switch (sortingAlgorithm) {\n\t\t\t\tcase SelectionSort:\n\t\t\t\t\ta = \"SelectionSort.txt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase InsertionSort:\n\t\t\t\t\ta = \"InsertionSort.txt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeSort:\n\t\t\t\t\ta = \"MergeSort.txt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase QuickSort:\n\t\t\t\t\ta = \"QuickSort.txt\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t FileWriter myWriter = new FileWriter(a);\n\t\t myWriter.write(this.toString());\n\t\t myWriter.close();\n\t\t System.out.println(\"File generated: SUCCESS\");\n\t\t } catch (IOException e) {\n\t\t System.out.println(\"File generated: ERROR\");\n\t\t e.printStackTrace();\n\t\t }\n\t}", "public void writeExamResult(String userName, float grade) {\r\n\t\t// Creating empty BufferedWriter out.\r\n\t\tBufferedWriter out = null;\r\n\t\ttry {\r\n\t\t\t// Creating FileWriter with the path for the text file.\r\n\t\t\tFileWriter fStream = new FileWriter(\"Examresults.txt\", true);\r\n\t\t\tout = new BufferedWriter(fStream);\r\n\t\t\t// Writing out the user name and the result to a text file.\r\n\t\t\tout.write(\" \");\r\n\t\t\tout.write(userName + \" \");\r\n\t\t\tout.write(grade + \";\" + \"\\n\");\r\n\t\t\tout.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void saveModel(String path) {\n try\n {\n for (int i=0; i<size; i++) {\n for (int j=0; j<size; j++) {\n PerformanceResultsPair resultsPair = resultsGrid[i][j];\n String directoryName = (i > j)?\n resultsPair.getP2FirstResults().getDescription():\n resultsPair.getP1FirstResults().getDescription();\n resultsPair.saveTo(path + FileUtil.FILE_SEPARATOR() + directoryName);\n }\n }\n } catch (IOException e) {\n throw new IllegalStateException(\"Could not save the model\", e);\n }\n }", "private void markOutputDirSuccessful(JobContext context) throws IOException {\r\n JobConf conf = context.getJobConf();\r\n // get the o/p path\r\n Path outputPath = FileOutputFormat.getOutputPath(conf);\r\n if (outputPath != null) {\r\n // get the filesys\r\n FileSystem fileSys = outputPath.getFileSystem(conf);\r\n // create a file in the output folder to mark the job completion\r\n Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);\r\n fileSys.create(filePath).close();\r\n }\r\n }", "private void writeTextFile(\r\n\t\t\tGDMSMain theMainHomePage,\r\n\t\t\tArrayList<QtlDetailElement> listOfAllQTLDetails, HashMap<Integer, String> hmOfQtlPosition, HashMap<String, Integer> hmOfQtlNameId,\r\n\t\t\tHashMap<Integer, String> hmOfQtlIdandName, String strSelectedExportType, boolean bQTLExists) throws GDMSException {\n\t\t\r\n\t\t\r\n\t\tString strFlapjackTextFile = \"Flapjack\";\r\n\t\tFile baseDirectory = theMainHomePage.getMainWindow().getApplication().getContext().getBaseDirectory();\r\n\t\tFile absoluteFile = baseDirectory.getAbsoluteFile();\r\n\r\n\t\tFile[] listFiles = absoluteFile.listFiles();\r\n\t\tFile fileExport = baseDirectory;\r\n\t\tfor (File file : listFiles) {\r\n\t\t\tif(file.getAbsolutePath().endsWith(\"Flapjack\")) {\r\n\t\t\t\tfileExport = file;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString strFilePath = fileExport.getAbsolutePath();\r\n\t\t//System.out.println(\"strFilePath=:\"+strFilePath);\r\n\t\tgeneratedTextFile = new File(strFilePath + \"\\\\\" + strFlapjackTextFile + \".txt\");\r\n\r\n\t\t/**\twriting tab delimited qtl file for FlapJack \r\n\t\t * \tconsisting of marker chromosome & position\r\n\t\t * \r\n\t\t * **/\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t//factory = new ManagerFactory(GDMSModel.getGDMSModel().getLocalParams(), GDMSModel.getGDMSModel().getCentralParams());\r\n\t\t\tfactory=GDMSModel.getGDMSModel().getManagerFactory();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tOntologyDataManager ontManager=factory.getOntologyDataManager();\r\n\t\t\t*/\r\n\t\t\tFileWriter flapjackTextWriter = new FileWriter(generatedTextFile);\r\n\t\t\tBufferedWriter flapjackBufferedWriter = new BufferedWriter(flapjackTextWriter);\r\n\t\t\t//getAllelicValuesByGidsAndMarkerNames\r\n\t\t\t//genoManager.getAlle\r\n\t\t\t//\t\t\t fjackQTL.write(\"QTL\\tChromosome\\tPosition\\tMinimum\\tMaximum\\tTrait\\tExperiment\\tTrait Group\\tLOD\\tR2\\tFlanking markers in original publication\");\r\n\t\t\tflapjackBufferedWriter.write(\"QTL\\tChromosome\\tPosition\\tMinimum\\tMaximum\\tTrait\\tExperiment\\tTrait Group\\tLOD\\tR2\\tFlanking markers in original publication\\teffect\");\r\n\t\t\tflapjackBufferedWriter.write(\"\\n\");\r\n\t\t\tfor (int i = 0 ; i < listOfAllQTLDetails.size(); i++){\r\n\t\t\t\t//System.out.println(listOfAllQTLDetails.get(i));\r\n\t\t\t\tQtlDetailElement qtlDetails = listOfAllQTLDetails.get(i);\r\n\t\t\t\t\r\n\t\t\t\t/*QtlDetailsPK id = qtlDetails.getQtlName().get.getId();\r\n\t\t\t\tInteger qtlId = id.getQtlId();*/\r\n\t\t\t\t//String strQtlName = hmOfQtlIdandName.get(qtlId);\r\n\t\t\t\tString strQtlName =qtlDetails.getQtlName();\r\n\t\t\t\tint qtlId=hmOfQtlNameId.get(strQtlName);\r\n\t\t\t\t//qtlDetails.get\r\n\t\t\t\t//Float clen = qtlDetails.getClen();\r\n\t\t\t\t//Float fEffect = qtlDetails.getEffect();\r\n\t\t\t\tint fEffect = qtlDetails.getEffect();\r\n\t\t\t\tFloat fMaxPosition = qtlDetails.getMaxPosition();\r\n\t\t\t\tFloat fMinPosition = qtlDetails.getMinPosition();\r\n\t\t\t\t//Float fPosition = qtlDetails.getPosition();\r\n\t\t\t\tString fPosition = hmOfQtlPosition.get(qtlId);\r\n\t\t\t\tFloat frSquare = qtlDetails.getRSquare();\r\n\t\t\t\tFloat fScoreValue = qtlDetails.getScoreValue();\r\n\t\t\t\tString strExperiment = qtlDetails.getExperiment();\r\n\t\t\t\t//String strHvAllele = qtlDetails..getHvAllele();\r\n\t\t\t\t//String strHvParent = qtlDetails.getHvParent();\r\n\t\t\t\t//String strInteractions = qtlDetails.getInteractions();\r\n\t\t\t\tString strLeftFlankingMarker = qtlDetails.getLeftFlankingMarker();\r\n\t\t\t\tString strLinkageGroup = qtlDetails.getChromosome();\r\n\t\t\t\t//String strLvAllele = qtlDetails.getLvAllele();\r\n\t\t\t\t//String strLvParent = qtlDetails.getLvParent();\r\n\t\t\t\tString strRightFM = qtlDetails.getRightFlankingMarker();\r\n\t\t\t\t//String strSeAdditive = qtlDetails.getSeAdditive();\r\n\t\t\t\t\r\n\t\t\t\t//String strTrait = qtlDetails.getTrait();\r\n\t\t\t\tString strTrait = qtlDetails.getTRName();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tflapjackBufferedWriter.write(strQtlName + \"\\t\" + strLinkageGroup + \"\\t\" + fPosition + \"\\t\" + fMinPosition + \"\\t\" + fMaxPosition + \"\\t\" +\r\n\t\t\t\t\t\tstrTrait + \"\\t\" + strExperiment + \"\\t \\t\" + fScoreValue + \"\\t\" + frSquare+\r\n\t \"\\t\" + strLeftFlankingMarker+\"/\"+strRightFM + \"\\t\" + fEffect);\r\n\t\t\t\t\r\n\t\t\t\tflapjackBufferedWriter.write(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tflapjackBufferedWriter.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new GDMSException(e.getMessage());\r\n\t\t} \r\n\t\t\r\n\t}", "void writeMemo(CaveGen g) {\n try {\n new File(\"output/!memo\").mkdir();\n BufferedWriter wr = new BufferedWriter(new FileWriter(\"output/!memo/\" \n + g.specialCaveInfoName + \"-\" + g.sublevel + \".txt\", true));\n \n wr.write(\">\" + Drawer.seedToString(g.initialSeed) + \"\\n\");\n wr.write(\"M\");\n for (MapUnit m: g.placedMapUnits) {\n wr.write(\"|\" + m.spawnListIdx + \"r\" + m.rotation + \"x\" + m.offsetX + \"z\" + m.offsetZ);\n }\n wr.write(\"\\n\");\n if (g.placedStart != null) {\n wr.write(\"S|\" + logSpawnPoint(g.placedStart) + \"\\n\");\n }\n if (g.placedHole != null) {\n wr.write(\"H|\" + logSpawnPoint(g.placedHole) + \"\\n\");\n }\n if (g.placedGeyser != null) {\n wr.write(\"G|\" + logSpawnPoint(g.placedGeyser) + \"\\n\");\n }\n for (int type: new int[] {5,8,1,0,6}) {\n boolean placed = false;\n for (Teki t: g.placedTekis) {\n if (t.type == type && t.spawnPoint.type != 9) {\n if (!placed) {\n wr.write(type + \"\");\n placed = true;\n }\n wr.write(\"|\" + t.spawnListIdx + logSpawnPoint(t.spawnPoint));\n }\n }\n if (placed) wr.write(\"\\n\");\n }\n {\n boolean placed = false;\n for (Item t: g.placedItems) {\n if (!placed) {\n wr.write(2 + \"\");\n placed = true;\n }\n wr.write(\"|\" + t.spawnListIdx + logSpawnPoint(t.spawnPoint));\n }\n if (placed) wr.write(\"\\n\");\n }\n for (char type: new char[] {'c','f'}) {\n boolean placed = false;\n for (Teki t: g.placedTekis) {\n if (t.spawnPoint.type == 9) {\n boolean c = type == 'c' && (t.fallType == 0 || g.isPomGroup(t));\n boolean f = type == 'f' && !(t.fallType == 0 || g.isPomGroup(t));\n if (c || f) {\n if (!placed) {\n wr.write(type + \"\");\n placed = true;\n }\n wr.write(\"|\" + t.spawnListIdx + logSpawnPoint(t.spawnPoint));\n }\n }\n }\n if (placed) wr.write(\"\\n\");\n }\n {\n boolean placed = false;\n for (Gate t: g.placedGates) {\n if (!placed) {\n wr.write(\"g\");\n placed = true;\n }\n wr.write(\"|\" + t.spawnListIdx + logSpawnPoint(t.spawnPoint));\n }\n if (placed) wr.write(\"\\n\");\n }\n wr.close();\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"Log failed\");\n } \n }", "private static void writeToOutput(String path, Apriori apriori){\n try{\n BufferedWriter output = new BufferedWriter(new FileWriter(path, false));\n for (String s : apriori.mItemSet){\n output.write(s);\n }\n output.close();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public void saveResults();", "public void write(File output) throws IOException {\n }", "public void saveGame(File fileLocation);", "private void logOutputFile(TestInfo test, ITestInvocationListener listener)\n throws DeviceNotAvailableException {\n File resFile = null;\n InputStreamSource outputSource = null;\n\n try {\n resFile = mTestDevice.pullFileFromExternal(mOutputFile);\n if (resFile != null) {\n // Save a copy of the output file\n CLog.d(\"Sending %d byte file %s into the logosphere!\",\n resFile.length(), resFile);\n outputSource = new FileInputStreamSource(resFile);\n listener.testLog(String.format(\"result-%s.txt\", test.mTestName), LogDataType.TEXT,\n outputSource);\n\n // Parse the results file and post results to test listener\n parseOutputFile(test, resFile, listener);\n }\n } finally {\n FileUtil.deleteFile(resFile);\n StreamUtil.cancel(outputSource);\n }\n }", "private void cmdGenMM(String filename) throws NoSystemException {\n MSystem system = system();\n PrintWriter out = null;\n try {\n if (filename == null)\n out = new PrintWriter(System.out);\n else {\n out = new PrintWriter(new BufferedWriter(new FileWriter(\n filename)));\n }\n MMVisitor v = new MMInstanceGenerator(out);\n system.model().processWithVisitor(v);\n } catch (IOException ex) {\n Log.error(ex.getMessage());\n } finally {\n if (out != null) {\n out.flush();\n if (filename != null)\n out.close();\n }\n }\n }", "private void saveResourceFile()\r\n\t{\t\r\n\t\tFile file = null;\r\n\t\tFileWriter fw = null;\r\n\t\t//File complete = null;//New file for the completed list\r\n\t\t//FileWriter fw2 = null;//Can't use the same filewriter to do both the end task and the complted products.\r\n\t\ttry{\r\n\t\t\tfile = new File(outFileName);\r\n\t\t\tfile.createNewFile();\r\n\t\t\tfw = new FileWriter(outFileName,true);\r\n\t\t\tfor(FactoryObject object : mFObjects)\r\n\t\t\t{\r\n\t\t\t\tif(object instanceof FactoryReporter) {\r\n\t\t\t\t\t((FactoryReporter)object).report(fw);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.out.println(ioe.getMessage());\r\n\t\t\tif(file != null) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif(fw != null) {\r\n\t\t\t\ttry{\r\n\t\t\t\t\tfw.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(\"Failed to close the filewriter!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void writeToFile(String[] data) {\n\t\t// Regatta hasn't been calculated.\n\t\tif(r == null) {\n\t\t\tSystem.out.println(\"\\nYou haven't processed a regatta yet! \\nUse regatta to begin processing.\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Just the command was specified, we need to get the filename.\n\t\tif(data.length == 1) {\n\t\t\tSystem.out.println(\"Oops, looks like you didn't specify an output file.\\n\");\n\t\t\tinitializeOutput(getFilename());\n\t\t}\n\n\t\t// Filename was specified but is invalid. Need to get another one.\n\t\tif(!isValidFileName(data[1])) {\n\t\t\tSystem.out.println(\"Looks like your filename is incorrect.\\n\");\n\t\t\tinitializeOutput(getFilename());\n\t\t}\n\n\t\tinitializeOutput(data[1]);\n\n\t\t// Write out.\n\t\tfileOutput.print(r.podium());\n\t\tfileOutput.close();\n\t}", "public void writeToImage() {\n imageWriter.writeToImage();\n }", "public final void saveToFile() {\n\t\tWrite.midi(getScore(), getName()+\".mid\"); \n\t}", "private void reportToFile() {\n try {\n fileWriter = new FileWriter(\"GameStats.txt\");\n fileWriter.write(reportContent);\n fileWriter.close();\n }\n catch (IOException ioe) {\n System.err.println(\"IO Exception thrown while trying to write to file GameStats.txt\");\n }\n }", "private boolean exportResult(){\n System.out.println(\"Writing to \" + \"out_\" + inputFile);\n return true;\n }", "public abstract String FileOutput();", "public void writeAverageOccupancy() {\n Writer writer = null;\n long steps = station.schedule.getSteps();\n\n String dirName = \"simulation_outputs\";\n File dir = new File(dirName);\n if (!dir.exists()) {\n dir.mkdir();\n }\n\n try {\n writer = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(dirName + \"/average_occupancy.txt\"), \"utf-8\"));\n for (int i = 0; i < numRows; i++) {\n for (int j = 0; j < numCols; j++) {\n writer.write(occupancyMatrix[i][j] / (double) steps + \"\");\n if (j != numCols - 1) {\n writer.write(\",\");\n }\n }\n writer.write(\"\\n\");\n }\n } catch (IOException ex) {\n System.out.println(\"Error writing to file\");\n } finally {\n try {\n writer.close();\n } catch (Exception ex) {\n System.out.println(\"Error closing file\");\n }\n }\n }", "public static void addBatchResultsEncode(Args args, double finalTime, long coded_size, float factor){\n BufferedWriter output;\n //The header is:\n // tilesize threshold seekrange gop | codeTime codedSize compressionFactor | decodeTime qualityFactor\n try {\n output = new BufferedWriter(new FileWriter(\"encodeBatch.txt\", true));\n String result = args.tileSize + \" \" + args.thresh + \" \" + args.seekRange + \" \" + args.gop + \" | \" + finalTime + \" \" + coded_size + \" \" + factor;\n output.append(result);\n output.close();\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void WriteFile(){\n String[] linha;\n FileWriter writer;\n try{\n writer = new FileWriter(logscommissions, true);\n PrintWriter printer = new PrintWriter(writer);\n linha = ManageCommissionerList.ReturnsCommissionerListInString(ManageCommissionerList.comms.size()-1);\n for(int i=0;i<19;i++){\n printer.append(linha[i]+ \"\\n\");\n }\n printer.close();\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(\"Unable to read file\\n\");\n }\n try{\n Commissions temp = ManageCommissionerList.comms.get(ManageCommissionerList.comms.size()-1);\n BufferedImage img = temp.GetWipImage();\n File fl = new File(\"wipimages/wip\" + temp.GetCommissionTitle() + temp.GetUniqueID() + \".jpg\");\n ImageIO.write(img, \"jpg\", fl);\n }catch (Exception e){\n e.printStackTrace();\n System.out.printf(\"Failure to write image file\");\n }\n \n }", "public void writeToImage() {\r\n\t\t_imageWriter.writeToImage();\r\n\t}", "static void writeToFiles() throws IOException {\n\n writeToFilePriceHistory();\n writeToFileEmployees();\n writeToFileInventory();\n writeToSaleItems();\n writeToOrder();\n writeToFileInventory();\n writeToRevenueLog();\n }", "public void writeToGameFile(String fileName) {\n\n try {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"Sifeb\");\n doc.appendChild(rootElement);\n Element game = doc.createElement(\"Game\");\n rootElement.appendChild(game);\n\n Element id = doc.createElement(\"Id\");\n id.appendChild(doc.createTextNode(\"001\"));\n game.appendChild(id);\n Element stories = doc.createElement(\"Stories\");\n game.appendChild(stories);\n\n for (int i = 1; i < 10; i++) {\n Element cap1 = doc.createElement(\"story\");\n Element image = doc.createElement(\"Image\");\n image.appendChild(doc.createTextNode(\"Mwheels\"));\n Element text = doc.createElement(\"Text\");\n text.appendChild(doc.createTextNode(\"STEP \" + i + \":\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eu.\"));\n cap1.appendChild(image);\n cap1.appendChild(text);\n stories.appendChild(cap1);\n }\n\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n File file = new File(SifebUtil.GAME_FILE_DIR + fileName + \".xml\");\n StreamResult result = new StreamResult(file);\n transformer.transform(source, result);\n\n System.out.println(\"File saved!\");\n\n } catch (ParserConfigurationException | TransformerException pce) {\n pce.printStackTrace();\n }\n\n }", "void saveAs() {\n writeFile.Export();\n }", "public synchronized void writeResults(WorkDirectory workDir, BackupPolicy backupPolicy)\n throws IOException {\n if (isMutable()) {\n throw new IllegalStateException(\"This TestResult is still mutable - set the status!\");\n }\n\n // could attempt a reload() I suppose\n if (props == null) {\n props = emptyStringArray;\n }\n\n String wrp = getWorkRelativePath(desc).replace('/', File.separatorChar);\n resultsFile = workDir.getFile(wrp);\n\n File resultsDir = resultsFile.getParentFile();\n resultsDir.mkdirs(); // ensure directory created for .jtr file\n\n File tempFile = createTempFile(workDir, backupPolicy);\n try {\n writeResults(tempFile, backupPolicy);\n } finally {\n if (tempFile.exists()) {\n tempFile.delete();\n }\n }\n }", "public static synchronized void writeMetricsToFile(String request) { \n\n Metric metric = getMetricByThread();\n BufferedWriter outputMetrics = null;\n try {\n FileWriter fstream = new FileWriter(cnvProject + \"/\" + metricsOutputFile, true); //true tells to append data.\n outputMetrics = new BufferedWriter(fstream);\n outputMetrics.write(metric.toString());\n outputMetrics.close();\n metric.resetMetrics();\n System.out.println(\"> [BIT]: Stored metrics in: \" + cnvProject + \"/\" + metricsOutputFile);\n return;\n }\n catch (Exception e) {\n System.out.println(\"> [BIT]: \" + e.getMessage());\n }\n }", "private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }", "private void write(HashMap<String, List<String>> result, String filename) {\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename));\n\n\t\t\tfor (String word : result.keySet()) {\n\t\t\t\tbw.write(String.format(\"%s: %s\\n\", word, result.get(word)));\n\t\t\t}\n\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected abstract void writeFile();", "public abstract void writeToFile( );", "@Test\n public void example9() throws Exception { \n example6();\n File f = File.createTempFile(\"agraph-test\", \".rdf\");\n FileWriter out = new FileWriter(f);\n println(\"export to \" + f.getCanonicalFile());\n conn.exportStatements(null, RDF.TYPE, null, false, new RDFXMLWriter(out));\n close(out);\n assertFiles(new File(\"src/test/tutorial-test9-expected.rdf\"), f);\n f.delete(); // delete if success\n }", "public void save()\r\n {\r\n \tfc=new JFileChooser();\r\n\t fc.setCurrentDirectory(new File(\"\"));\r\n\t if(fc.showSaveDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t \t//Try-Catch Block\r\n\t try\r\n\t {\r\n\t pw=new PrintWriter(new FileWriter(fc.getSelectedFile()+\".txt\")); //Print to the user-selected file\r\n\t\t \tfor(Organism o: e.getTree()) //IN PROGESS\r\n\t\t \t{\r\n\t\t\t\t\tint[] genes=o.getGenes(); //Getting genes from \r\n\t\t\t\t\tfor(int i=0; i<genes.length; i++)\r\n\t\t\t\t\t\tpw.print(genes[i]+\" \"); //Print each gene value in a line\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tpw.println(); //Starts printing on a new line\r\n\t\t\t\t}\r\n\t\t\t\tpw.close(); //Closes the File\r\n\t }\r\n\t catch (Exception ex) //Catch Any Exception\r\n\t {\r\n\t ex.printStackTrace();\r\n\t }\r\n }", "@Override\n\tpublic void writeFile(String file_out) {\n\t\tthis.writeFile(Mode.POINT_ONLY, 0, DEFAULT_AND_LOAD_FACTOR, file_out);\n\t}", "private void writeStatsToFile() {\n\t\tString fileName = \"TypeaheadStats.dat\";\n\t\tString contents = \"Typeahead_Tasks,Index_Hits,Hit_Ratio,Avg_Time,Suffix_Time,Pruning\\n\";\n\t\tcontents += numOfSearchTasks + \n\t\t\t\t\",\" + numOfIndexHits + \n\t\t\t\t\",\" + 1.0 * numOfIndexHits / numOfSearchTasks + \n\t\t\t\t\",\" + totalTime / numOfSearchTasks +\n\t\t\t\t\",\" + suffixTreeTime / numOfSearchTasks + \n\t\t\t\t\",\" + pruningPercentage / numOfSearchTasks;\n\t\tFileManager.writeToFile(fileName, contents);\n\t}", "public void saveAll() {\n try {\n writeObject(IMAGE_DATA_PATH, imageFiles);\n writeObject(EXISTING_TAGS_PATH, existingTags);\n } catch (IOException e) {\n // e.printStackTrace();\n }\n }", "private void actionSaveOutputAll ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t{\r\n\t\t\t\t\tString filePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t/*!*/DebugLogger.logMessage(\"Saving output of all images to file \" + filePath, LOG_MESSAGE_TYPE.INFO);\r\n\r\n\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(typeCSV))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".csv\")) { filePath += \".csv\"; }\r\n\r\n\t\t\t\t\t\tOutputController.saveFileAll(filePath, DataController.getTable(), OUTPUT_FORMAT.CSV);\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\tif (!filePath.substring(filePath.length() - 4).equals(\".txt\")) { filePath += \".txt\"; }\r\n\r\n\t\t\t\t\t\tOutputController.saveFileAll(filePath, DataController.getTable(), OUTPUT_FORMAT.TXT);\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\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "private static void spaceSaver(FileWriter output) throws IOException {\n\t\tint totalFrequency = 0;\n\t\tint modifiedCode = 0;\n\t\t\n\t\tfor(int i = 0; i < resultIndex; i++) {\n\t\t\tmodifiedCode += (((String) results[i][1]).length()) * (Integer)(results[i][2]);\n\t\t\ttotalFrequency += (Integer)results[i][2];\n\t\t}\n\t\t\n\t\tint saved = (totalFrequency * 8) - modifiedCode;\n\t\toutput.write(\"Space Saved: \" + saved + \"bits\");\n\t}", "@Override\r\n\tpublic void finishProcess() {\r\n\t\tfor (String soaFolder : this.SOA_Folders) {\r\n\t\t\tString strConfig = soaFolder;\r\n\t\t\tFile f = new File(strConfig + \"/exit\");\r\n\t\t\ttry {\r\n\t\t\t\tf.createNewFile();\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\r\n\t\t}\r\n\r\n\t}", "public void generateAndStoreToFolder(File folder, int maxNumberOfGenerated, double minimalTresholdForEachClass) {\n System.out.println(\"generating datasets\");\n List<Formula> formulae = generate(maxNumberOfGenerated);\n\n System.out.println(\"generating negated\");\n List<Formula> allSpace = generateNegatedFormulae(formulae);\n\n System.out.println(\"generating dataset\");\n List<Pair<Formula, List<Sample>>> datasets = generateDatasets(allSpace);\n\n System.out.println(\"threshold filter\");\n List<Pair<Formula, List<Sample>>> filteredDatasets = filterDatasets(datasets, minimalTresholdForEachClass);\n\n System.out.println(\"filtering same outputs\");\n List<Pair<Formula, List<Sample>>> finalDatasets = filterSameOutputs(filteredDatasets);\n System.out.println(\"final size\\t\" + finalDatasets.size());\n\n\n System.out.println(\"storing\");\n storeToFolder(folder, finalDatasets);\n\n System.out.println(\"done\");\n }" ]
[ "0.6615461", "0.62997544", "0.62638235", "0.6152965", "0.61506945", "0.61213684", "0.5881159", "0.58398974", "0.5800974", "0.5791863", "0.5774835", "0.57669646", "0.57241815", "0.5711406", "0.5702353", "0.56755877", "0.5675216", "0.56533587", "0.56429386", "0.56415737", "0.5631326", "0.5619794", "0.56194955", "0.5612897", "0.56083125", "0.55954725", "0.5532035", "0.55209076", "0.5519164", "0.5513615", "0.5486023", "0.54794747", "0.5454758", "0.54476905", "0.54461825", "0.5443392", "0.5432868", "0.5404245", "0.53837645", "0.5382787", "0.5369864", "0.5365876", "0.53628993", "0.53453106", "0.5344826", "0.53380394", "0.5336827", "0.53348917", "0.53081214", "0.5294718", "0.52790374", "0.5276735", "0.5273983", "0.5272882", "0.5270446", "0.52698267", "0.5269145", "0.5267991", "0.52660346", "0.5265717", "0.52585745", "0.5246529", "0.5246076", "0.5245614", "0.52385473", "0.5236695", "0.523179", "0.523074", "0.522926", "0.522909", "0.52221596", "0.5221831", "0.52049464", "0.519199", "0.5187653", "0.5184688", "0.5181591", "0.5174708", "0.5174622", "0.51730925", "0.517181", "0.5170391", "0.5168104", "0.5165346", "0.51631606", "0.5162198", "0.51615447", "0.5161338", "0.5160912", "0.5154616", "0.51533496", "0.51528835", "0.51429653", "0.5136033", "0.5133125", "0.51288027", "0.5126361", "0.51239794", "0.51203394", "0.51203173" ]
0.61910826
3
/ Create array of bins in which to store objects Bins are indexed by precursor mass
public void createBins(int arraySize) { //Check if any spectra from each polarity has been created if (librarySpectra.size()>0) { countBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin addedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin //Fill all positive bins with zeroes for (int i=0; i<countBin.length; i++) { countBin[i] = 0; addedBin[i] = 0; } //Create the array to store the actual spectra objects massBin = new LibrarySpectrum[arraySize][]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<B> getBins() {\n return ImmutableList.copyOf(bins);\n }", "private void computeHistogramBins() {\r\n int nBins = (int) Math.ceil(hismax / binWidth);\r\n histoBins = new double[nBins];\r\n for (int i = 0; i < nBins; i++) {\r\n histoBins[i] = binWidth * (double) i + binWidth;\r\n }\r\n }", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "List<String> getBins(String iisn);", "int xBins();", "public static LinkedHashMap<Integer, Integer> create(Bins bins){\n Integer min = bins.getMin(); //given the bin use the min to start making the keys\n Integer max = bins.getMax();//using the bin max to be the last key\n Integer index; // index of the value in a \"list\" of numbers that we're \"creating\" using the min and max values\n // from the bin will equal the key entry\n Integer defaultValue = 0; // the default value for each key will be zero until we run the list of roll results through\n for (index = min; index <= max; index++){ //iterating through a \"list\" created by the min and max of the bin\n resultsMap.put(index, defaultValue); //adding the min through max values as keys with the default value for a complete entry\n }\n return resultsMap; //returning the resulting map\n }", "public static <B> Histogram<B> withBins(Iterable<B> bins) {\n Histogram<B> hist = new Histogram<>();\n hist.addBins(bins);\n return hist;\n }", "public HashMap(int bins){\n\t\tthis.numOfBins=bins;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "private Histogram(int[] bins, double minValue, double maxValue) {\n this(bins.length - 2, minValue, maxValue);\n System.arraycopy(bins, 0, this.bins, 0, bins.length);\n }", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public void fillBins() {\n\t\t// grab our current data and then transpose it\n\t\tList<List<String>> currentData = dc.getDataFold().get(currentFold);\n\t\tList<List<String>> tranData = dc.transposeList(currentData);\n\t\tfor (int row = 0; row < tranData.size(); row++) {\n\t\t\t// for each row of attribute values, discretize it\n\t\t\tList<Double> procData = new ArrayList<>();\n\t\t\t// for each String of raw data, convert it into a value to place into a bin\n\t\t\tfor (String rawData : tranData.get(row)) {\n\t\t\t\tif (rawData.chars().allMatch(Character::isDigit) || rawData.contains(\".\")) {\n\t\t\t\t\tprocData.add(Double.parseDouble(rawData));\n\t\t\t\t} else {\n\t\t\t\t\t// not perfect, but useable in the small domain of values we use for data\n\t\t\t\t\tprocData.add((double) rawData.hashCode());\n\t\t\t\t} // end if-else\n\t\t\t} // end for\n\n\t\t\t// for each value we have, place it into a corresponding bin\n\t\t\tfor (double value : procData) {\n\t\t\t\tfor (Bin bin : attribBins.get(row)) {\n\t\t\t\t\tif (bin.binContains(value)) {\n\t\t\t\t\t\tbin.incrementFreq();\n\t\t\t\t\t} // end if\n\t\t\t\t} // end for\n\t\t\t} // end for\n\t\t} // end for\n\t}", "public static ArrayList < ArrayList < Double >> binPack(double weight[], int n, double bin_cap) { \r\n int binCount = 0;\r\n int k = 0;\r\n double[] bin_space = new double[n];\r\n\r\n ArrayList < Integer > bin = new ArrayList < Integer > ();\r\n ArrayList < Double > val = new ArrayList < Double > ();\r\n ArrayList < ArrayList < Double >> binVal = new ArrayList < ArrayList < Double >> ();\r\n binVal.add(k, new ArrayList < Double > ());\r\n System.out.println(\".......Commencing Calculation...........\\n\");\r\n startTime = System.nanoTime();\r\n for (int i = 0; i < n; i++) {\r\n int j;\r\n for (j = 0; j < binCount; j++) {\r\n \r\n if (bin_space[j] >= weight[i]) {\r\n bin_space[j] = bin_space[j] - weight[i];\r\n //val.add(weight[i]);\r\n (binVal.get(j)).add((weight[i]));\r\n k=j+1;\r\n System.out.println(\"---Bin \" + j + \" took in weight \" + weight[i]);\r\n break;\r\n }\r\n \r\n }\r\n System.out.println(\"*Bad fit for next weight size \"+ weight[i]+ \r\n \"\\n\\n ***NEW BIN CREATED***\\n\");\r\n if (j == binCount) {\r\n \r\n bin_space[binCount] = bin_cap - weight[i];\r\n //val.add(weight[i]);\r\n binCount++;\r\n //k++;\r\n bin.add(j);\r\n binVal.add(j, new ArrayList < Double > ());\r\n (binVal.get(j)).add((weight[i]));\r\n k=j+1;\r\n System.out.println(\"---Bin \" + k + \" took in weight **\" + weight[i]);\r\n }\r\n } \r\n endTime = System.nanoTime();\r\n elapsedTime = (endTime- startTime);\r\n System.out.println(\"\\nBIN PACKING ALGORITHM COMPLETE\\n\");\r\n \r\n return binVal;\r\n }", "private List<Bin> discretizeRow(List<String> rawData) {\n\t\tList<Bin> binForThisAttr = new ArrayList<>();\n\t\tList<Double> procData = new ArrayList<>();\n\t\t// are we working with numbers or actual Strings\n\t\t// convert strings into Double, add to data attributes\n\t\tfor (int i = 0; i < rawData.size(); i++) {\n\t\t\tString raw = rawData.get(i);\n\t\t\t// check current attribute value for String type or floating point type\n\t\t\tif ((rawData.get(i).chars().allMatch(Character::isDigit) || rawData.get(i).contains(\".\"))) {\n\t\t\t\t//convert number strings into Doubles, or strings into unique Doubles\n\t\t\t\tprocData.add(Double.valueOf(raw));\n\t\t\t} else {\n\t\t\t\t// convert Strings into unique integers, add to data attributes\n\t\t\t\tprocData.add((double) raw.hashCode());\n\t\t\t} // end if-else\n\t\t}\n\n\t\t// sort data into ascending list of values\n\t\tCollections.sort(procData);\n\n\t\t// generate bins based on Naive Estimator Process\n\t\tfor (int i = 0; i < procData.size(); i++) {\n\t\t\tif (i == 0) {\n\t\t\t\t// append bin with lowest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(Double.MIN_VALUE, procData.get(i), i));\n\t\t\t\t// binForThisAttr.get(binForT i = 0; i hisAttr.size() - 1).incrementFreq();\n\t\t\t} else if (i == procData.size() - 1) {\n\t\t\t\t// append bin with highest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(procData.get(i), Double.MAX_VALUE, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} else {\n\t\t\t\t// estimate the range of bin based on nearby points of data\n\t\t\t\tdouble lowBound = (procData.get(i - 1) + procData.get(i)) / 2;\n\t\t\t\tdouble highBound = (procData.get(i) + procData.get(i + 1)) / 2;\n\t\t\t\tbinForThisAttr.add(new Bin(lowBound, highBound, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} // end if-else statement\n\t\t} // end for\n\t\treturn binForThisAttr;\n\t}", "private void createBin(int size) \n\t{\n\t// create an array of the appropriate type\n\tfBin = (Object[]) Array.newInstance(fClass, size);\t\n\t}", "public SmartBin() {\n items = new ItemType[7];\n curWeight = 0;\n curArrayIndex = 0;\n binNumber = \"SM\" + generateBinNumber();\n }", "public Histogram(int bins, double minValue, double maxValue) {\n this.bins = new int[bins + 2];//Two additional bins for out-of-bounds values.\n this.minValue = minValue;\n this.maxValue = maxValue;\n binDiff = (maxValue - minValue) / bins;\n }", "public Binarization(int threshold) {\n this.threshold = threshold;\n }", "int yBins();", "public HistogramBuilder nBinsX(int bins) {\n this.nBinsX = bins;\n return this;\n }", "public static double[] getAllObjVal(int binCap, int numObj) \r\n {\r\n double value = 0;\r\n double[] allObjVal = new double[numObj];//organizes and assigns all of our values into a DS\r\n for (int i = 1; i <= numObj; i++) {\r\n value = getObjVal(binCap, numObj, i);\r\n allObjVal[i - 1] = value;\r\n }\r\n return allObjVal;\r\n }", "public static <B> Histogram<B> withBins(Iterable<B> bins, Iterable<String> series) {\n Histogram<B> hist = new Histogram<>();\n hist.addBins(bins);\n hist.addSeries(series);\n return hist;\n }", "private void generateIntervalArray(){\n BigDecimal maximumValue = this.getTfMaximumInterval();\n BigDecimal minimumValue = this.getTfMinimumInterval();\n BigDecimal stepValue = this.getTfStepInterval();\n \n intervalArray = new ArrayList<BigDecimal>();\n BigDecimal step = maximumValue;\n \n //Adiciona os valores \"inteiros\"\n while(step.doubleValue() >= minimumValue.doubleValue()){\n intervalArray.add(step);\n step = step.subtract(stepValue);\n }\n }", "public IntHistogram(int buckets, int min, int max) {\n \t// some code goes here\n this.min = min;\n this.max = max;\n this.buckets = new int[buckets];\n for(int i=0;i<buckets;++i){\n this.buckets[i] = 0;\n }\n totalCount = 0;\n int range = max - min + 1;\n\n capacity = range % buckets == 0 ? range / buckets : range / buckets + 1;\n }", "public NumericalDistributionModel( Integer binCount, Double span ){\n\t\tinterval = span / binCount.doubleValue();\n\t\tlog.info( \"bin-interval is {}\", interval );\n\t\thistogram = new Integer[ binCount ];\n\t\t\n\t\tfor( int i = 0; i < histogram.length; i++ )\n\t\t\thistogram[i] = 0;\n\t}", "public interface Binned2DData\n{\n\t/**\n\t * Number of bins on the X axis\n\t */\n\tint xBins();\n\t\n\t/**\n\t * Number of bins on the Y axis\n\t */\n\tint yBins();\n\t\n\t/**\n\t * Axis minimum on the X Axis\n\t */\n\tfloat xMin();\n\t\n\t/**\n\t * Axis maximum on the X Axis\n\t */\n\tfloat xMax();\n\t\n\t/**\n\t * Axis minimum on the Y Axis\n\t */\n\tfloat yMin();\n\t\n\t/**\n\t * Axis maximum on the Y Axis\n\t */\n\tfloat yMax();\n\t\n\t/**\n\t * Get Z value at the specified bin\n\t */\n\tfloat zAt(int xIndex, int yIndex);\n\t\n\t/**\n\t * Get the Color at the specified bin\n\t */\n\tColor3b colorAt(int xIndex, int yIndex);\n\t\n\t/**\n\t * Minimum data value on the Z Axis\n\t */\n\tfloat zMin();\n\t\n\t/**\n\t * Maximum data value on the Z Axis\n\t */\n\tfloat zMax();\n}", "private void constructBid() {\n Bid rawBid;\n double maxDemand = elements.first().demandWatt;\n // Minimum demand is also Max Production.\n double minDemand = elements.last().demandWatt;\n\n double minPriority = 0.0;\n double maxPriority = 1.0;\n\n // First make the ideal, continuous bid, that does not care about discrete running modes.\n rawBid = Bid.create(marketBasis)\n .add(priceOf(minPriority), maxDemand)\n .add(priceOf(maxPriority), minDemand)\n .build();\n\n // Now construct actual bid\n double[] rawDemand = rawBid.getDemand();\n newBid = new UnconstrainedBidElement[rawDemand.length];\n for (int i = 0; i < rawDemand.length; i++) {\n newBid[i] = getClosest(rawDemand[i]);\n }\n }", "public int calcArraySize(Double binSize, Double minMass, Double maxMass)\n\t{\n\t\treturn (int)((maxMass - minMass)/binSize)+1;\n\t}", "public NaiveBayesCountMinSketch(int nbOfHashes, int logNbOfBuckets, double threshold){\n this.nbOfHashes = nbOfHashes;\n this.logNbOfBuckets=logNbOfBuckets;\n this.threshold = threshold;\n\n /* FILL IN HERE */\n\n \n this.seeds = new int[nbOfHashes];\n Random rand = new Random();\n for (int i = 0; i<nbOfHashes; i++) {\n this.seeds[i] = rand.nextInt();\n }\n \n counts = new int[2][nbOfHashes][1 << logNbOfBuckets];\n classCounts =new int[2];\n \n \n for (int i = 0; i<2; i++) {\n for (int h = 0; h<nbOfHashes; h++) {\n \tArrays.fill(counts[i][h], 1);\n \n }\n \tclassCounts[i] = 1;\n } \n \n }", "public Set<Bookshelf> initialize(Bookshelf basis, int numShelfs)\n\t throws IllegalArgumentException {\n\tif (null == basis)\n\t throw new IllegalArgumentException(\"input cannot be null.\");\n\n\tidPairs = identifyInputs(basis); // tag | property -> neuron #\n\tint numBooks = basis.size();\n\tthis.numShelfs = numShelfs;\n\tdouble[][] inputValues = new double[numBooks][numTags];\n\n\tbrain = generateBrain(numTags, numShelfs);\n\n\tint i = 0;\n\n\t// parse through the properties and tags of each book and normalize the\n\t// weights.\n\tfor (Book book : basis) {\n\n\t Iterator<Map.Entry<String, Integer>> tags = book.enumerateTags()\n\t\t .iterator();\n\n\t while (tags.hasNext()) {\n\t\tMap.Entry<String, Integer> tag = tags.next();\n\t\tInteger index = idPairs.get(tag.getKey());\n\n\t\tif (index.intValue() > numTags) {\n\t\t System.out.println(\"ERROR: INDEX OUT OF BOUNDS!\");\n\t\t System.out.println(\"name: \" + tag.getKey() + \" index: \"\n\t\t\t + index);\n\t\t System.out.println(\"numTags: \" + numTags);\n\n\t\t} else if (index.intValue() == numTags) {\n\t\t // System.out.println(\"__OTHER__ detected!\");\n\t\t inputValues[i][index.intValue()] += ((double) tag\n\t\t\t .getValue() / (double) maxTagMag);\n\t\t} else {\n\t\t inputValues[i][index.intValue()] = ((double) tag.getValue() / (double) maxTagMag);\n\t\t}\n\t }\n\t ++i;\n\t}\n\n\tNeuralDataSet data = new BasicNeuralDataSet(inputValues, null);\n\n\ttrain(data);\n\n\t// Export current butler to ButlerWeights.\n\tcurrentWeights = new ButlerWeights(brain.getStructure().getSynapses()\n\t\t.get(0).getMatrix(), numTags, flatShelfs, idPairs);\n\tinitialized = true;\n\n\tMap<Integer, Bookshelf> newShelfs = new HashMap<Integer, Bookshelf>();\n\tfor (int j = 0; j < numShelfs; ++j)\n\t newShelfs.put(j, new VirtualBookshelf());\n\n\tfor (Book book : basis) {\n\n\t double[] outputValues = brain.compute(\n\t\t new BasicNeuralData(readyBook(book))).getData();\n\n\t if (!(outputValues.length == 0)) {\n\t\tdouble[] bestResult = max(outputValues);\n\t\tnewShelfs.get((int) bestResult[1]).insert(book);\n\t }\n\t}\n\n\tMap<Integer, Bookshelf> cleanShelfs = new HashMap<Integer, Bookshelf>();\n\tint j = 0;\n\tfor (Bookshelf b : newShelfs.values()) {\n\t // System.out.println(\"(clean up) shelf size: \" + b.size());\n\n\t if (!b.empty()) {\n\t\tcleanShelfs.put(j, b);\n\t\t++j;\n\t }\n\t}\n\n\t// System.out.println(\"numShelfs input: \" + numShelfs);\n\t// System.out.println(\"actual numShelfs: \" + cleanShelfs.size());\n\n\tif (cleanShelfs.size() < numShelfs) {\n\t // System.out.println(\"retraining needed. \" + numShelfs +\n\t // \" becomes \" + cleanShelfs.size());\n\t return initialize(basis, cleanShelfs.size()); // retrain with the\n\t // proper size.\n\t}\n\n\tCollection<FlatShelf> randomFlatShelfs = flattenAll(cleanShelfs\n\t\t.values());\n\tflatShelfs = new HashMap<Integer, FlatShelf>();\n\n\t// System.out.println(\"naming and sorting flatshelfs\");\n\n\tfor (FlatShelf fs : randomFlatShelfs) {\n\n\t String heaviestTagName = \"\";\n\t int heaviestTagWeight = Integer.MIN_VALUE;\n\t int k = checkBook(fs);\n\n\t Iterator<Map.Entry<String, Integer>> fsTags = fs.enumerateTags()\n\t\t .iterator();\n\n\t while (fsTags.hasNext()) {\n\n\t\tMap.Entry<String, Integer> tag = fsTags.next();\n\t\theaviestTagWeight = Math.max(heaviestTagWeight, tag.getValue());\n\n\t\tif (heaviestTagWeight == tag.getValue())\n\t\t heaviestTagName = tag.getKey();\n\n\t }\n\n\t try {\n\t\tcleanShelfs.get(k).setProperty(\"name\", heaviestTagName);\n\t } catch (Exception e) {\n\t\tint timeout = 0;\n\t\twhile (timeout < 10000) {\n\t\t System.out.println(heaviestTagName == null);\n\t\t System.out.println(cleanShelfs.get(k) == null);\n\t\t timeout++;\n\t\t}\n\t }\n\t // System.out.println(heaviestTagName + \" is shelf #\" + k);\n\n\t flatShelfs.put(k, new FlatShelf(cleanShelfs.get(k)));\n\n\t // System.out.println(flatShelfs.get(k).getProperty(\"name\"));\n\n\t}\n\n\t// System.out.println(\"cleanShelfs size: \" + cleanShelfs.size());\n\n\treturn new HashSet<Bookshelf>(cleanShelfs.values());\n }", "private void setRibs() {\n ribs[0] = new Rib(points[0],points[1]);\n ribs[1] = new Rib(points[1],points[2]);\n ribs[2] = new Rib(points[2],points[0]);\n }", "@Override\r\n\tpublic int[] getSample(Random rng) {\r\n\t\tif (!ready)\r\n\t\t\tthrow new RuntimeException(\"must normalize first\");\r\n\t\t\r\n\t\tint bins[] = new int[no_goods];\r\n\t\t\r\n\t\tfor (int i = 0; i<no_goods; i++) {\r\n\t\t\tdouble[] pmf = prob[i].get(r_tmp[i]);\r\n\t\r\n\t\t\t// choose a random spot on the cdf\r\n\t\t\tdouble random = rng.nextDouble();\r\n\t\t\t\r\n\t\t\t// compute cdf. todo: maybe we should precompute inverse of cdf in normalize() so that\r\n\t\t\t// we can avoid a loop here?\r\n\t\t\tdouble cdf = 0.0;\r\n\t\t\tfor (int j = 0; j<pmf.length; j++) {\r\n\t\t\t\tcdf += pmf[j];\r\n\t\t\t\t\r\n\t\t\t\tif (cdf >= random) {\r\n\t\t\t\t\tbins[i] = j;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// add index to realized so that in next round we get the pmf conditional\r\n\t\t\t\t\t// on our result for this round\r\n\t\t\t\t\tfor (int k = 0; k<=i; k++)\r\n\t\t\t\t\t\tr_tmp[i+1].d[k] = bins[k];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// go onto next good\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// sanity check: make sure we picked something. \r\n\t\t}\r\n\t\t\r\n\t\treturn bins;\r\n\t}", "public synchronized void setBinCount(int count)\n { binCount = count;\n this.whitener = new Whitener(binCount);\n this.binValues = new float[binCount];\n this.meanValues = new float[binCount];\n this.whiteBinValues = new float[binCount];\n this.peakBinValues = new float[binCount];\n }", "private Spatial getBin(Location loc)\r\n {\r\n return loc.getX()<mid.getX() \r\n ? (loc.getY()<mid.getY() ? bins[BL] : bins[TL])\r\n : (loc.getY()<mid.getY() ? bins[BR] : bins[TR]);\r\n }", "public void initialize(Collection<Bookshelf> basis)\n\t throws IllegalArgumentException {\n\n\tif (null == basis)\n\t throw new IllegalArgumentException(\"input cannot be null.\");\n\n\tIterator<Bookshelf> shelfs = basis.iterator();\n\n\tBookshelf masterShelf = BookshelfOperations.union(basis);\n\n\tidPairs = identifyInputs(masterShelf); // tag | property -> neuron #\n\tthis.numShelfs = basis.size();\n\tint numBooks = masterShelf.size();\n\n\tint i = 0;\n\tdouble[][] inputValues = new double[numBooks][numTags];\n\n\twhile (shelfs.hasNext()) {\n\n\t Bookshelf shelf = shelfs.next();\n\t Iterator<Book> books = shelf.iterator();\n\n\t // System.out.println(\"numShelfs: \" + String.valueOf(numShelfs));\n\n\t while (books.hasNext()) {\n\n\t\tBook book = books.next();\n\t\tIterator<Map.Entry<String, Integer>> tags = book\n\t\t\t.enumerateTags().iterator();\n\n\t\twhile (tags.hasNext()) {\n\n\t\t Map.Entry<String, Integer> tag = tags.next();\n\t\t int index = idPairs.get(tag.getKey());\n\n\t\t if (index > numTags) {\n\t\t\tSystem.out.println(\"ERROR: INDEX OUT OF BOUNDS!\");\n\t\t\tSystem.out.println(\"name: \" + tag.getKey() + \" index: \"\n\t\t\t\t+ index);\n\t\t\tSystem.out.println(\"numTags: \" + numTags);\n\n\t\t } else if (index == numTags) {\n\t\t\t// System.out.println(\"__OTHER__ detected!\");\n\t\t\tinputValues[i][index] += ((double) tag.getValue() / (double) maxTagMag);\n\t\t } else {\n\t\t\tinputValues[i][index] = ((double) tag.getValue() / (double) maxTagMag);\n\t\t }\n\t\t}\n\t\t++i;\n\t }\n\t}\n\n\tNeuralDataSet data = new BasicNeuralDataSet(inputValues, null);\n\n\tbrain = generateBrain(numTags, numShelfs);\n\ttrain(data);\n\n\tflatShelfs = new HashMap<Integer, FlatShelf>();\n\n\tfor (Bookshelf s : basis) {\n\t FlatShelf fs = new FlatShelf(s);\n\t flatShelfs.put(checkBook(fs), fs);\n\t}\n\n\tcurrentWeights = new ButlerWeights(brain.getStructure().getSynapses()\n\t\t.get(0).getMatrix(), numTags, flatShelfs, idPairs);\n\t// initialized = true;\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n List<Shape> shapes = new ArrayList<>();\n //System.out.println(\"Please enter the bin capacity\");\n Shape container = new Shape();\n container.containerPrompt();\n container.containerVolume();\n int binCapacity = container.containerVolume();\n //insert three items here\n System.out.println(\"How many cubes do want to store: 1, 2 or 3 \");\n int choice = scanner.nextInt();\n while (choice-- >0){\n Shape object = new Shape();\n object.objectPrompt();\n shapes.add(object);\n\n /*\n object.objectVolume();\n int one = object.containerVolume();*/\n }\n\n /*switch (choice){\n case 1:\n Shape shape1 = new Shape();\n shape1.objectPrompt();\n shape1.objectVolume();\n int one = shape1.containerVolume();\n break;\n case 2:\n Shape shape2 = new Shape();\n shape2.objectPrompt();\n shape2.objectVolume();\n int two = shape2.containerVolume();\n\n Shape shape3 = new Shape();\n shape3.objectPrompt();\n shape3.objectVolume();\n int one = shape1.containerVolume();\n break;\n\n case 3:\n Shape shape1 = new Shape();\n shape1.objectPrompt();\n shape1.objectVolume();\n int one = shape1.containerVolume();\n break;\n default:\n }*/\n List<Integer> items=new ArrayList<>();\n\n for (Shape shape: shapes){\n items.add(shape.containerVolume());\n System.out.println(shape.containerVolume());\n }\n\n\n\n //List<Integer> items = Arrays.asList(shapes.get(0).containerVolume());\n //insert the bin capacity\n // int binCapacity = 5;\n CheckBin algorithm = new CheckBin(items, binCapacity);\n algorithm.solvingBinPackingProblem();\n algorithm.showResults();\n // System.out.println(\"This is after committing\");\n\n\n }", "private void ObjectsKnapsack(int[] vol, int[][] M, int n, int V, int[] objects)\r\n {\r\n int i,W;\r\n W = V;\r\n \r\n for(i=n; i>=1; i--) {\r\n if(M[i][W] == M[i-1][W]) {\r\n objects[i] = 0;\r\n } else {\r\n \tobjects[i] = 1;\r\n W = W - vol[i];\r\n }\r\n }\r\n }", "private Binning getBins(TemporalElementStats elementStats, TimeSelector.TimeField field1) {\n if (field1 == TimeSelector.TimeField.TX_FROM) {\n return elementStats.getEstimatedTimeBins()[0];\n } else if (field1 == TX_TO) {\n return elementStats\n .getEstimatedTimeBins()[1];\n } else if (field1 == TimeSelector.TimeField.VAL_FROM) {\n return elementStats.getEstimatedTimeBins()[2];\n } else {\n return elementStats.getEstimatedTimeBins()[3];\n }\n }", "public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }", "public Bomb[] getBombs() {\r\n\t\treturn bombs;\r\n\t}", "public static ArrayList<Background> binnedDataToBackground (HashMap<String, HashMap<Integer, Integer>> frequencyMap, String detector){\r\n\r\n\t\t//get the data of the desired detector\r\n\t\tHashMap<Integer, Integer> frequencyTable = frequencyMap.get(detector);\r\n\r\n\t\t//arraylist of the bin minimums in the map so we can loop through all of them \r\n\t\tArrayList<Integer> binMinimums = new ArrayList<Integer>();\r\n\t\tbinMinimums .addAll(frequencyTable.keySet());\r\n\r\n\r\n\r\n\t\tArrayList<Background> actualReadings = new ArrayList<Background>();\r\n\r\n\t\t//initialise the values that the background object needs\r\n\t\tint currentFrequency;\r\n\t\tint currentMax;\r\n\t\tint currentMin;\r\n\r\n\t\t//loop throuhg the keyset of the frequency table \r\n\t\tfor (int binMin : binMinimums){\r\n\r\n\t\t\t//current frequency/events is the value in the frequency table\r\n\t\t\tcurrentFrequency = frequencyTable.get(binMin);\r\n\r\n\t\t\t//minimum is the key in the frequency table\r\n\t\t\tcurrentMin = binMin;\r\n\r\n\t\t\t//bin width of 1, so max is min +1\r\n\t\t\tcurrentMax = binMin +1;\r\n\r\n\r\n\t\t\t//make a new background object to be added to the arraylist\r\n\t\t\tBackground r = new Background();\r\n\r\n\t\t\t//set the events, min and max found above\r\n\t\t\tr.setEvents(currentFrequency);\r\n\t\t\tr.setMin(currentMin);\r\n\t\t\tr.setMax(currentMax);\r\n\r\n\t\t\t//add to the arraylist\r\n\t\t\tactualReadings.add(r);\r\n\r\n\t\t}\r\n\t\treturn actualReadings;\r\n\r\n\t}", "private void BScreate() {\n\n\t\tint sum=0;//全枝数のカウント\n\t\tfor(int i=0;i<banknode;i++) sum+=Bank.get(i).deg;\n\n\t\t//e,d,nの決定\n\t\tif(NW==\"BA\"){\n\t\tfor(int i=0;i<banknode;i++) {\n\t\t\tBank.get(i).totalassets=E*((double)Bank.get(i).deg/(double)sum);\n\t\t\tBank.get(i).n=Bank.get(i).totalassets*Bank.get(i).CAR;\n\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t}\n\t\t}\n\n\t\tif(NW==\"CM\"){\n\t\t\tfor(int i=0;i<banknode;i++){\n\t\t\t\tBank.get(i).totalassets=E/banknode;\n\t\t\t\tBank.get(i).n=Bank.get(i).totalassets*asyCAR;\n\t\t\t\tBank.get(i).forcelev=megaCAR;\n\t\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t\t}\n\n\t\t}\n\n\t}", "private void drawBins (Graphics g) {\n double dTime = (endT - begT) / parent.numBins;\n int j = 0; statesDrawn = 0; highestCt = 0;\n \n Vector v = parent.stateDef.stateVector;\n \n for (int i = 0; i < parent.numBins; i++) {\n //Limits of a bin\n double startTime = begT + (i * dTime); \n double finishTime = begT + ((i + 1) * dTime);\n int ct = 0;\n \n Info currState;\n while (j < v.size () &&\n ((currState = (Info)v.elementAt (j)).lenT < finishTime ||\n (currState.lenT == finishTime && currState.lenT == endT))) {\n if (startTime <= currState.lenT) {\n ct++;\n statesDrawn ++;\n }\n j++;\n }\n if (highestCt < ct) highestCt = ct;\n \n //draw the bin\n if (ct > 0) drawBin (g, i, ct);\n }\n }", "public BinaryHeap(E[] objects) {\n for(int i = 0; i < objects.length; i++) {\n add(objects[i]);\n }\n }", "static void initBin(int[] binToInt)\n {\n for(int i = 0; i < 32; i++)\n {\n binToInt[i] = 0;\n }\n }", "@Override\n\tpublic void buildBVH() {\n\t\tif(this.bvhObjList.size()<=4) {\n\t\t}else {\n\t\t BVH nebt1 = new BVH(this.bvHi);\n\t\t BVH nebt2 = new BVH(this.bvHi);\n\t\tint tmp = this.calculateSplitDimension(this.bvhBox.getMax().sub(this.bvhBox.getMin()));\n\t\tfloat splitpos;\n\t\tif(tmp==0) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).x();\n\t\t}else if(tmp==1) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).y();\n\t\t}else {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).z();\n\t\t\t\n\t\t}\n\t\tthis.distributeObjects(nebt1, nebt2, tmp, splitpos);\n\t\tthis.bvHi.add(nebt1);\n\t\tthis.neb1 = bvHi.indexOf(nebt1);\n\t\tthis.bvHi.add(nebt2);\n\t\tthis.neb2 = bvHi.indexOf(nebt2);\n\t\tnebt2.buildBVH();\n\t\tnebt1.buildBVH();\n\n\t\t}\n\t}", "public WeeklySchedule build(List bins) {\r\n\r\n /*\r\n * Iterate through bins and place into time slots.\r\n */\r\n\r\n Iterator i = bins.iterator();\r\n\r\n Schedule tempSchedule = null;\r\n\r\n HashMap kTimevTimeslotMap = new HashMap();\r\n\r\n while (i.hasNext()) {\r\n DailyBin currentBin = (DailyBin) i.next();\r\n\r\n /*\r\n * Build key\r\n */\r\n SimpleDate currentSimple = SimpleDate.factory.build(currentBin\r\n .getLowerBound());\r\n\r\n /*\r\n * Look up Schedule\r\n */\r\n WeeklyScheduleTimeSlot timeSlot = (WeeklyScheduleTimeSlot) kTimevTimeslotMap\r\n .get(getKey(currentSimple));\r\n /*\r\n * Create a new TimeSlot if we don't already have one.\r\n */\r\n if (timeSlot == null) {\r\n timeSlot = new WeeklyScheduleTimeSlot();\r\n\r\n kTimevTimeslotMap.put(getKey(currentSimple), timeSlot);\r\n }\r\n\r\n /*\r\n * Add bin to timeSlot.\r\n */\r\n timeSlot.addBin(currentBin);\r\n// timeSlot.setSettingsBroker(settingsBroker);\r\n }\r\n\r\n Collection timeslots = kTimevTimeslotMap.values();\r\n\r\n return new WeeklySchedule(timeslots);\r\n\r\n }", "private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}", "public int[] filterByPlateauSize(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= lower_threshold && this.plateau_size[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "@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 }", "protected static float[] getBinomialKernelSigmaZeroPointSevenOne() {\n float a = 1.f/200.f;\n return new float[]{9*a, 83*a, 0, -83*a, -9*a};\n }", "int[] maxAndMin() {\n\n // **** ****\n HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\n\n // **** traverse parrents array inserting into hashmap: O(n) ****\n for (int val : this.parents) {\n hm.put(val, hm.getOrDefault(val, 0) + 1);\n }\n\n // ???? ????\n // System.out.println(\"maxAndMin <<< hm: \" + hm.toString());\n\n // **** initialize the min and max values ****\n int min = Integer.MAX_VALUE;\n int max = Integer.MIN_VALUE;\n\n // **** traverse hashmap looking for min and max: O(n) ****\n Iterator<Entry<Integer, Integer>> it = hm.entrySet().iterator();\n while (it.hasNext()) {\n Entry<Integer, Integer> e = it.next();\n\n // **** skip this key ****\n if (e.getKey() == 0)\n continue;\n\n // **** update min and max ****\n min = Math.min(e.getValue(), min);\n max = Math.max(e.getValue(), max);\n }\n\n // **** package results ****\n int[] result = { min, max };\n\n // **** return results ****\n return result;\n }", "private int[] generate(int[] cells) {\n // Placeholder\n int[] newCells = new int[cells.length];\n\n // Boundary-elements, simply ignoring them..\n for (int x = 1; x < cells.length - 1; x++) {\n\n // Neighborhood\n int left = cells[x - 1];\n int mid = cells[x];\n int right = cells[x + 1];\n\n int newState = next(left, mid, right);\n\n newCells[x] = newState;\n }\n\n return newCells;\n }", "public static byte[] byMassFromMinerals(Rock rock) {\n return byMassFromMinerals(rock.getMinerals(), rock.getFractions());\n }", "public void setInBin(int n) {\n inBin=Translate.decTobinN(n, 4);\n }", "@Override public void map(Chunk c) {\n for( int i = 0; i < c._len; ++i ) {\n int x=1;\n if( c.isNA(i) ) continue;\n double r = c.atd(i);\n if( _h==-1 ) {\n for(; x < _counts.length; x++)\n if( r <= _breaks[x] ) break;\n x--; // back into the bin where count should go\n } else\n x = Math.min( _counts.length-1, (int)Math.floor( (r-_x0) / _h ) ); // Pick the bin floor( (x - x0) / h ) or ceil( (x-x0)/h - 1 ), choose the first since fewer ops!\n bumpCount(x);\n setMinMax(Double.doubleToRawLongBits(r),x);\n }\n }", "public static Attribute turnBinsAttribute(String name) {\n\t\tFastVector turnBins = new FastVector(SOT_BINS.length + EOT_BINS.length);\n\t\tfor (int i = 0; i < SOT_BINS.length; i++) {\n\t\t\tturnBins.addElement(SOT_BINS[i]);\n\t\t}\n\t\tfor (int i = 0; i < EOT_BINS.length; i++) {\n\t\t\tif (!turnBins.contains(EOT_BINS[i])) {\n\t\t\t\tturnBins.addElement(EOT_BINS[i]);\n\t\t\t}\n\t\t}\n\t\tAttribute a = new Attribute(name, turnBins);\n\t\treturn a;\t\t\n\t}", "protected static List<Critter> getBabies() {\r\n \t ArrayList<Critter> critterList = new ArrayList<Critter>();\r\n //iterator through the keys in the babies hash map\r\n Iterator<String> populationIterator = babies.keySet().iterator();\r\n while(populationIterator.hasNext()) {\r\n \tString coord = populationIterator.next();\r\n \t//iterator through the critter babies in a key in a hash map\r\n \tIterator<Critter> positionIterator = babies.get(coord).iterator();\r\n \twhile(positionIterator.hasNext()) {\r\n \t\tCritter critt = positionIterator.next();\r\n \t\t//add the babies to the critter population\r\n \t\tcritterList.add(critt);\r\n \t}\r\n }\r\n \r\n return critterList;\r\n }", "public final float[][][] exportBinaryLevelSet(boolean[] inside) {\n \tfloat[][][] levelset = new float[nx][ny][nz];\n \t\n \tfloat maximumDist = maxDist;\n \t\n \t\tfor (int x=0;x<nx;x++) for (int y=0;y<ny;y++) for (int z=0;z<nz;z++) {\n \t\t\tint xyz = x+nx*y+nx*ny*z;\n \t\t\t\n \t\t\tlevelset[x][y][z] = 0.0f;\n \t\t\tif (mgdmlabels[0][xyz]>-1) {\n\t\t\t\tif (inside[mgdmlabels[0][xyz]]) {\n\t\t\t\t\t// search for the next outside value, use constant if none\n\t\t\t\t\tint nout = -1;\n\t\t\t\t\tfor (int n=1;n<nmgdm && nout==-1;n++) {\n\t\t\t\t\t\tif (mgdmlabels[n][xyz]>-1 && !inside[mgdmlabels[n][xyz]]) nout = n;\n\t\t\t\t\t}\n\t\t\t\t\tif (nout>-1) {\n\t\t\t\t\t\tfor (int n=0;n<nout;n++) {\n\t\t\t\t\t\t\tlevelset[x][y][z] -= mgdmfunctions[n][xyz];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlevelset[x][y][z] = -maximumDist;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// search for the next inside value, use constant if none\n\t\t\t\t\tint nin = -1;\n\t\t\t\t\tfor (int n=1;n<nmgdm && nin==-1;n++) {\n\t\t\t\t\t\tif (mgdmlabels[n][xyz]>-1 && inside[mgdmlabels[n][xyz]]) nin = n;\n\t\t\t\t\t}\n\t\t\t\t\tif (nin>-1) {\n\t\t\t\t\t\tfor (int n=0;n<nin;n++) {\n\t\t\t\t\t\t\tlevelset[x][y][z] += mgdmfunctions[n][xyz];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlevelset[x][y][z] = maximumDist;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\t// outside by default\n\t\t\t\tlevelset[x][y][z] = maximumDist;\t\n\t\t\t}\n \t}\n \treturn levelset;\n }", "public OpenHistogram(String title, int numBins, long lowerBound) {\n super(title);\n stats = new OpenHistogramStat(numBins, lowerBound);\n this.setBars(.5, .2);\n this.setXRange(0, numBins - 1);\n }", "public BinNumber(int currentBinNum) {\n this.currentBinNum = currentBinNum;\n }", "public static Attribute eotBinsAttribute() {\n\t\tFastVector binnedTimesToEOT = new FastVector(EOT_BINS.length);\n\t\tfor (int i = 0; i < EOT_BINS.length; i++) {\n\t\t\tbinnedTimesToEOT.addElement(EOT_BINS[i]);\n\t\t}\n\t\tAttribute a = new Attribute(\"binnedTimeToEOT\", binnedTimesToEOT);\n\t\treturn a;\n\t}", "public abstract double[] getLowerBound();", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "private void discretizeData() {\n\t\tboolean generatedBins = false; // track bin generation\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i == testingFold) {\n\t\t\t\tcontinue; // skip over testing data\n\t\t\t} else {\n\t\t\t\tcurrentFold = i;\n\t\t\t\t// grab our current data fold and transpose it\n\t\t\t\tList<List<String>> currentData = dc.getDataFold().get(currentFold);\n\t\t\t\tList<List<String>> tranData = dc.transposeList(currentData);\n\n\t\t\t\tif (generatedBins == false) { // build bins first\n\t\t\t\t\tfor (int row = 0; row < tranData.size(); row++) {\n\t\t\t\t\t\tattribBins.add(discretizeRow(tranData.get(row)));\n\t\t\t\t\t}\n\t\t\t\t\tgeneratedBins = true;\n\t\t\t\t} else { // fill bins with data now\n\t\t\t\t\tfillBins();\n\t\t\t\t} // end if-else\n\t\t\t} // end if-else\n\t\t} // end for\n\t}", "public static int[] init(int in){\n int[] cells = new int[16];\n\n for(int i = 0; i < 16; i++){\n cells[i] = 1;\n }\n\n //sets the index passed-in to be 0\n cells[in] = 0;\n cells[15] = 14;\n\n return cells;\n }", "public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }", "public ByteArray getBin() {\n return bin;\n }", "private int[] bestFitModified(int[] chromosome) {\n\t\tint[] bins = new int[binCount];\n\t\tArrayList<Integer> cannotPackList = new ArrayList<Integer>();\n\n\t\t//honor chromosome listing when possible\n\t\tfor (int i = 0; i < chromosome.length; i++) {\n\t\t\t//if this bin isnt full & won't be after placement & this chrom hasnt gone off the end \n\t\t\t//(VERY RARE, only happens when binCount is reduced w/ elitism)\n\t\t\tif (chromosome[i] < bins.length && bins[chromosome[i]] + packageWeights[i] <= binSize) {\n\t\t\t\tbins[chromosome[i]] += packageWeights[i]; //put package into bin\n\t\t\t} else { //store those we can't honor\n\t\t\t\tchromosome[i] = -1;\n\t\t\t\tcannotPackList.add(new Integer(i)); //save all those packages whos original bins were full\n\t\t\t}\n\t\t}\n\n\t\t//best fit on all the rest whos bins were full up\n\t\tint tries = 0;\n\t\tfor (int j = 0; j < cannotPackList.size(); j++) {\n\t\t\tint i = cannotPackList.get(j);\n\t\t\tint bestBinIndex = -1;\n\n\t\t\twhile (bestBinIndex < 0 && tries < bins.length * 2) { //while we still havent found a bin to put this in and time isn't up\n\n\t\t\t\tint bestBinLeftOverSpace = binSize * 100; //how much space is left in the bin when the packages is placed in it (ideally 0 = full bin)\n\n\t\t\t\tfor (int bin = 0; bin < bins.length; bin++) {\n\t\t\t\t\t//if this bin is closer to full than the best bin and not overfilled save it\n\t\t\t\t\tif ((binSize - (bins[bin] + packageWeights[i])) >= 0 && (binSize - (bins[bin] + packageWeights[i])) < bestBinLeftOverSpace) {\n\t\t\t\t\t\tbestBinIndex = bin;\n\t\t\t\t\t\tbestBinLeftOverSpace = binSize - (bins[bin] + packageWeights[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bestBinIndex < 0) { //if could not pack, dump out a bin (mutation)\n\t\t\t\t\tj = 0;\n\t\t\t\t\tint dumpBin = rand.nextInt(binCount);\n\t\t\t\t\tfor (int binIndex = dumpBin; binIndex < binCount; binIndex++) {\n\t\t\t\t\t\tbins[binIndex] = 0;\n\t\t\t\t\t\tfor (int chromIndex = 0; chromIndex < chromosome.length; chromIndex++) {\n\t\t\t\t\t\t\tif (chromosome[chromIndex] == binIndex) {\n\t\t\t\t\t\t\t\tchromosome[chromIndex] = -1;\n\t\t\t\t\t\t\t\tcannotPackList.add(new Integer(chromIndex));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\ttries++;\n\t\t\t}\n\n\t\t\tif (tries >= bins.length * 2) {\n\t\t\t\treturn null; //this chromosome is unsalvageable because it is impossible to fit the packages in the bins\n\t\t\t}\n\n\n\t\t\tbins[bestBinIndex] += packageWeights[i];\n\t\t\tchromosome[i] = bestBinIndex;\n\t\t\tcannotPackList.remove(j);\n\t\t\tj--;\n\t\t}\n\n\t\treturn chromosome;\n\t}", "public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {\n\t\tBinomiale loi = new Binomiale(proba, nbRep, repetition);\n\t\treturn loi.simuler();\n\t}", "public static float[] getBinomialKernelSigmaZeroPointFive() {\n //1 -1 norm=0.5\n return new float[]{0.5f, 0.0f, -0.5f};\n }", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public int alphaBinNum(float[] values) {\n\n /* Check if histogram sampling is possible. */\n if (values == null || values.length == 0) {\n\n return currentBinNum;\n }\n\n float minBin = 10;\n float minLbl = 10;\n\n /* Show a depiction of the weights being used. */\n int i, j, n, n2;\n\n /*\n * Histogram case, the most complex, start by gathering the values. If\n * none are toggled on, we will base this on all inputs which exist.\n */\n\n float minVal, maxVal;\n minVal = maxVal = 0;\n n = values.length;\n n2 = 2 * n;\n\n for (i = j = 0; i < n2; i++) {\n j = i % n;\n if (i == j) {\n n2 = n;\n }\n\n float oneval = values[j];\n\n if (oneval == Float.NaN) {\n continue;\n }\n\n if (minVal == maxVal && maxVal == 0) {\n minVal = maxVal = oneval;\n } else if (oneval < minVal) {\n minVal = oneval;\n } else if (oneval > maxVal) {\n maxVal = oneval;\n }\n }\n\n /*\n * Compute the best size to use for the value bins (dv). This responds\n * to density by using smaller increments along the x-axis when density\n * is larger.\n */\n\n if (minVal >= maxVal) {\n\n return currentBinNum;\n }\n float dv = minBin;\n\n dv = (float) .5;\n float delLbl = minLbl * dv / minBin;\n if (dv == 0.5) {\n delLbl = 1;\n } else if (dv == 0 || (maxVal - minVal) > dv * 25) {\n float minDv = (maxVal > -minVal ? maxVal : -minVal) / 5000;\n if (dv < minDv) {\n dv = minDv;\n }\n computeBinDelta(dv, delLbl);\n } else if (dv != minBin) {\n computeBinDelta(dv, delLbl);\n }\n\n int nbMax = 20;\n if ((maxVal - minVal) / dv > nbMax) {\n float dvSeed, dvPrev;\n for (dvSeed = dvPrev = dv, i = 0; i < 100; i++) {\n dvSeed *= 1.4;\n dv = dvSeed;\n computeBinDelta(dv, delLbl);\n if (dv == dvPrev) {\n continue;\n }\n if ((maxVal - minVal) / dv < nbMax) {\n break;\n }\n dvPrev = dvSeed = dv;\n }\n }\n\n /*\n * We want edge of the bins to be at half the bin size, containing at\n * least two even values of del2.\n */\n\n float del2 = delLbl * 2;\n float edge = dv * (((int) (minVal / dv)) - (float) 0.5);\n while (minVal - edge > dv) {\n edge += dv;\n }\n while (edge > minVal) {\n edge -= dv;\n }\n minVal = edge;\n edge = dv * (((int) (maxVal / dv)) + (float) 0.5);\n while (edge - maxVal > dv) {\n edge -= dv;\n }\n while (edge < maxVal) {\n edge += dv;\n }\n maxVal = edge;\n int nbins = (int) (0.5 + (maxVal - minVal) / dv);\n float mean2 = (minVal + maxVal) / 2;\n mean2 = mean2 > 0 ? del2 * (int) (0.5 + mean2 / del2) : -del2\n * (int) (0.5 - mean2 / del2);\n while (minVal > mean2 - del2 && maxVal < mean2 + del2) {\n nbins += 2;\n minVal -= dv;\n maxVal += dv;\n }\n\n return nbins;\n }", "public BucketHash(Map<K, V> m) {\r\n\t\tnumBuckets = 101;\r\n\t\tbuckets = new Object[numBuckets];\r\n\t\tfor (int i = 0; i < numBuckets; i++) {\r\n\t\t\tbuckets[i] = new Bucket();\r\n\t\t}\r\n\t\tputAll(m);\r\n\t}", "private static int computeNumberOfBandsForThreshold(int nHashes, double jaccardThreshold) {\n int bands = nHashes;\n while (bands > 1) {\n if ((nHashes % bands) == 0) {\n double threshold = Math.pow((double) 1.0 / bands, (double) bands / nHashes);\n if (threshold > jaccardThreshold) {\n break;\n }\n }\n bands--;\n }\n return bands;\n }", "public int[] getHistogram()\r\n {\r\n\treturn histogram;\r\n }", "public Bin findMergeCandidates() {\n Bin candidate;\n Bin result = new Bin(0);\n for (int i = 0; i <= getMaxSize(); i++) {\n candidate = radixBins.get(i);\n if (candidate.count() + ((candidate.size == i) ? 0 : 1) >= radix) {\n logger.info(\"Adding Merge Candidate of size: \" + i);\n result.size = i;\n result.add(candidate);\n } else {\n break;\n }\n }\n return result;\n }", "public void populate(double[] realized) {\r\n\t\tIntegerArray binned = new IntegerArray(realized.length);\r\n\r\n\t\tfor (int i = 0; i<no_goods; i++) {\r\n\t\t\t// record max price witnessed\r\n\t\t\tif (realized[i] > witnessed_max_price)\r\n\t\t\t\twitnessed_max_price = realized[i];\r\n\t\t\t\r\n\t\t\t// ensure we do not exceed the maximum price, or we will exceed array bounds later.\r\n\t\t\t// note that this bins all prices above max as the max, which could produce a skewed\r\n\t\t\t// distribution.\r\n\t\t\tif (realized[i] > max_price)\r\n\t\t\t\trealized[i] = max_price;\r\n\t\t\t\r\n\t\t\t// bin the realized price for this good\r\n\t\t\tbinned.d[i] = bin(realized[i], precision);\r\n\t\t}\r\n\t\t\r\n\t\tpopulate(binned);\r\n\t}", "public void setMass(Bounds[] bounds)\n\t{\n\t\tfloat mass = 0;\n\t\tfor (Bounds b : bounds) {\n\t\t\tmass += b.getOvalArea();\n\t\t}\n\t\tthis.mass = mass;\n\t}", "private void initBars()\n\t{\n\t\tfor (int i = 0; i < Constants.MAX_VALUE; i++)\n\t\t{\n\t\t\trows[i] = new Bar();\n\t\t\tcolumns[i] = new Bar();\n\t\t\tgrids[i] = new Bar();\n\t\t}\n\n\t\tfor (int rowIndex = 0; rowIndex < this.nodes.length; rowIndex++)\n\t\t{\n\t\t\tNode[] row = this.nodes[rowIndex];\n\t\t\tfor (int colIndex = 0; colIndex < row.length; colIndex++)\n\t\t\t{\n\t\t\t\tNode node = row[colIndex];\n\n\t\t\t\t// Make Rows\n\t\t\t\tthis.rows[rowIndex].nodes[colIndex] = node;\n\t\t\t\tnode.setRow(this.rows[rowIndex]);\n\n\t\t\t\t// Make Columns\n\t\t\t\tthis.columns[colIndex].nodes[rowIndex] = node;\n\t\t\t\tnode.setColumn(this.columns[colIndex]);\n\n\t\t\t\t// Make Grid\n\t\t\t\t// the index of Grid Array\n\t\t\t\tint gridIndex = colIndex / 3 + (rowIndex / 3) * 3;\n\n\t\t\t\t// the index of nodes array of one grid object\n\t\t\t\tint gridNodeIndex = colIndex % 3 + (rowIndex % 3) * 3;\n\t\t\t\tthis.grids[gridIndex].nodes[gridNodeIndex] = node;\n\t\t\t\tnode.setGrid(this.grids[gridIndex]);\n\t\t\t}\n\t\t}\n\t}", "protected int[] getParticlesByIndexInside( ArrayList<Object> geomObjects,PointXY[] boundingBox ){\r\n\t\t\r\n\t\tArrayList<Integer> pset = new ArrayList<Integer>() ;\r\n\t\tPoint2D testP2D;\r\n\t\tRepulsionFieldParticle particle;\r\n\t\tObject geomObject;\r\n\t\t\r\n\t\tboolean covered;\r\n\t\t\r\n\t\t\r\n\r\n\t\tfor (int i= 0; i<particles.size() ;i++){\r\n\t\t\t\r\n\t\t\tparticle = particles.get(i) ;\r\n\t\t\t\r\n\t\t\t// within bounding box? no? skip the rest , -> next particle by index value\r\n\t\t\tif ((particle.x<boundingBox[0].x-averageDistance*1.1) || (particle.x>boundingBox[1].x+averageDistance*1.1)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif ((particle.y<boundingBox[0].y-averageDistance*1.1) || (particle.y>boundingBox[3].y+averageDistance*1.1)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t\r\n\t\t\ttestP2D = new Point2D( particle.x, particle.y);\r\n\t\t\t\r\n\t\t\t// test particle across all ellipses\r\n\t\t\tfor (int s=0;s<geomObjects.size();s++){\r\n\t\t\t\t\r\n\t\t\t\tgeomObject = geomObjects.get(s) ;\r\n\t\t\t\t \r\n\t\t\t\tcovered = isInsideGeomObject(geomObject,testP2D);\r\n\t\t\t\t\r\n\t\t\t\tif (covered) {\r\n\t\t\t\t\tif (pset.contains(i)==false){\r\n\t\t\t\t\t\tpset.add(i) ;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// out.print(2, \"+++ particle added, index:\"+i+\", location x,y:\" + df.format(particle.x)+\",\" + df.format(particle.y)+\" +++\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// out.print(2, \"--- particle NOT added, index:\"+i+\", location x,y:\" + df.format(particle.x)+\",\" + df.format(particle.y)+\" ---\");\r\n\t\t\t\t}\r\n\t\t\t} // s->\r\n\t\t\t\r\n\t\t} // i->\r\n\t\t\r\n\t\t\r\n\t\tint[] particleIndexes = new int[pset.size()] ;\r\n\t\t\r\n\t\tfor (int i=0;i< pset.size();i++){\r\n\t\t\tparticleIndexes[i] = pset.get(i) ;\r\n\t\t}\r\n\t\treturn particleIndexes;\r\n\t}", "@Before\n public void setUpBinaryMinHeaps() {\n empty = new BinaryMinHeap<>();\n emptyArr = new ArrayList<>();\n \n multipleElements = new BinaryMinHeap<>();\n multipleElements.insert(7);\n multipleElements.insert(8);\n multipleElements.insert(5);\n multipleElements.insert(3);\n multipleElements.insert(2);\n multipleElements.insert(6);\n \n multiArr = new ArrayList<>();\n multiArr.add(2);\n multiArr.add(3);\n multiArr.add(6);\n multiArr.add(8);\n multiArr.add(5);\n multiArr.add(7);\n \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}", "protected static float[] getBinomialKernelSigmaOne() {\n float a = 1.f/16.f;\n return new float[]{2*a, 4*a, 0, -4*a, -2*a};\n }", "public Bids[] populateBids() {\r\n\t\tint bidsLength = bids.size();\r\n\t\tint index = 0;\r\n\t\t\r\n\t\tBids[] auctionBids = new Bids[bidsLength];\r\n\t\tfor(Map.Entry<Integer, Bids> auctions: bids.entrySet()) {\r\n\t\t\tauctionBids[index] = auctions.getValue();\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn auctionBids;\r\n\t\r\n\t}", "private int getBinI(Location l)\r\n {\r\n return (int)((l.getX()-bl.getX())/di);\r\n }", "protected static float[] getBinomialKernelSigmaTwo() {\n double a = 1.f/33300l;\n return new float[]{\n (float) (1l * a), (float) (14l * a), (float) (90l * a),\n (float) (350l * a), (float) (910l * a), (float) (1638l * a),\n (float) (2002l * a), (float) (1430l * a), (float) (0l * a),\n (float) (-1430l * a), (float) (-2002l * a), (float) (-1638l * a),\n (float) (-910l * a), (float) (-350l * a), (float) (-90l * a),\n (float) (-14l * a), (float) (-1l * a)\n };\n }", "int getMines() {return mines;}", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "Bolsa(int n) {\r\n\t\tbolsa = new int[n];\r\n\t\tRandom rnd=new Random();\r\n\t\tbolsa[n-1] = 1;\r\n\t}", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints[] getScansArray();", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "private static ArrayList<double[]> createSamples(double p, int n) {\n\t\tArrayList<double[]> result = new ArrayList<double[]>();\n\t\tint cutoff = (int) Math.round(n * p);\n\t\tfor (int i = 0; i < cutoff; i++) result.add(new double[] {1});\n\t\tfor (int i = cutoff; i < n; i++) result.add(new double[] {0});\n\t\treturn result;\n\t}", "public int getStartingBombs() {\n \t\treturn 1;\n \t}", "BSet createBSet();", "public void createInhabitants(int nb) {\n\t\tSystem.out.println(\"Creating \" + nb + \" inhabitants\");\n\t\tfor(int i=0; i < nb; i++) {\n\t\t\tthis.inhabitants.add(new Inhabitant(\"inhabitant-\"+i, this));\n\t\t}\n\t}", "public void barrBMaker(int rowNum, int columnNum){\n \tfor (int i=0;i<rowNum;i++){\n \t\tfor (int j=0;j<columnNum;j++){\n \t\t\tBarrierBlock barrblock= new BarrierBlock(barrx+i*(barrw/rowNum),barry+j*(barrh/rowNum),barrw/rowNum,barrh/columnNum);\n \t\t\tbarrBList.add (barrblock);\n \t\t}\n \t}\n }", "public int[] getBarkUpperBoundaries(double sampleRate) throws IllegalArgumentException\n {\n int bark_upper[] = {100, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500}; // Hz\n int max = 0;\n int boundaries[];\n\n //check sampleRate\n if(sampleRate <= 0.0f)\n throw new IllegalArgumentException(\"the sample rate must be a positive value\");\n\n\n // ignore critical bands higher than the sampling frequnecy\n for (max = bark_upper.length-1; max >= 0 && bark_upper[max] > sampleRate/2; max--);\n\n //create new array of appropriate size\n boundaries = new int[max + 2];\n\n //copy upper boundaries\n for (int i = 0; i < boundaries.length; i++)\n boundaries[i] = bark_upper[i];\n\n return boundaries;\n }", "private double[][] a2() {\n double[][] r = a;\n for (int j = 0; j < nBinVars; j++) {\n final int v = intVars[j];\n if (existsBinConstraint(v)) {\n LOG.debug(\"existsBinConstraint\", v);\n this.nBinVars2--;\n continue;\n }\n double[] constraint = new double[n];\n constraint[v - 1] = 1d;\n r = Maths.append(r, constraint);\n }\n return r;\n }" ]
[ "0.6374558", "0.63650084", "0.6178943", "0.60915816", "0.60003185", "0.59288645", "0.58019674", "0.57945454", "0.5755405", "0.5672623", "0.5600853", "0.5586996", "0.55822164", "0.54853445", "0.54682595", "0.54424804", "0.543131", "0.540241", "0.5266186", "0.5206013", "0.51940227", "0.51846766", "0.51792216", "0.5145152", "0.5081714", "0.5067266", "0.5014162", "0.5007859", "0.49993163", "0.4992754", "0.49710518", "0.4969782", "0.49689552", "0.49466273", "0.49077794", "0.4870005", "0.48574415", "0.48562062", "0.48506573", "0.48448032", "0.48261586", "0.47898042", "0.47874543", "0.4784441", "0.47760603", "0.47713125", "0.47689673", "0.47543806", "0.47445002", "0.47365656", "0.47242597", "0.47151762", "0.47118452", "0.4709633", "0.47076905", "0.47011217", "0.46871427", "0.46842417", "0.46702173", "0.4663379", "0.46539357", "0.46510863", "0.46413714", "0.46408758", "0.46368298", "0.46265137", "0.46049604", "0.45990172", "0.45945817", "0.45933327", "0.4591599", "0.45906198", "0.45849252", "0.45829928", "0.4566189", "0.45625067", "0.4558484", "0.45556104", "0.45551974", "0.4554929", "0.4551424", "0.45500064", "0.45481628", "0.4546938", "0.45334348", "0.4533054", "0.4530919", "0.45288524", "0.4523008", "0.45224088", "0.45196524", "0.45171195", "0.45139065", "0.45122257", "0.45106587", "0.45102912", "0.4506011", "0.45052513", "0.45042104", "0.45008367" ]
0.6170257
3
Convert a precursor mass to the correct bin number
public int findBinIndex(Double precursor, Double binSize, Double minMass) { return (int)((precursor-minMass)/binSize); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setInBin(int n) {\n inBin=Translate.decTobinN(n, 4);\n }", "public void setParBin(int n) {\n parBin=Translate.decTobinN(n, 16);\n }", "public static float mw2pu(float mw) {return mw/100F;}", "public void setOpBin(int n) {\n opBin=Translate.decTobinN(n, 8);\n }", "public BinNumber(int currentBinNum) {\n this.currentBinNum = currentBinNum;\n }", "public int calculateBinNumWithConfig(ChartConfig config, float[] data) {\n\n ChartConfig.BinChooser binMethod = config.getBinChoicer();\n\n switch (binMethod) {\n case BIN_11:\n currentBinNum = 11;\n break;\n case BIN_9:\n currentBinNum = 9;\n break;\n case BIN_7:\n currentBinNum = 7;\n break;\n case BIN_5:\n currentBinNum = 5;\n break;\n case RISE_RULE:\n currentBinNum = riseRule(data.length);\n break;\n case SQUARE_ROOT:\n currentBinNum = squareRoot(data.length);\n break;\n case STURGES_FORMULA:\n currentBinNum = sturgesFormula(data.length);\n break;\n case BIN_ALPS:\n currentBinNum = alphaBinNum(data);\n break;\n default:\n\n break;\n }\n\n return currentBinNum;\n\n }", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "public static String decToBinR( int n ) { \n\tif (n == 0)\n\t return \"0\";\n\telse if (n == 1)\n\t return \"1\";\n\telse\n\t return n % 2 + decToBin(n / 2);\n }", "public static double atmosphereToBars(double num) { return (num*1.01325); }", "private int getBinI(Location l)\r\n {\r\n return (int)((l.getX()-bl.getX())/di);\r\n }", "public int calcArraySize(Double binSize, Double minMass, Double maxMass)\n\t{\n\t\treturn (int)((maxMass - minMass)/binSize)+1;\n\t}", "@Override\r\n public void convert(int wa) {\n hasil1 = wa / menit;\r\n String wat = Integer.toString(hasil1);\r\n hasil = wat + \" Menit \";\r\n }", "public static float mvar2pu(float mvar) {return mvar/100F;}", "private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}", "public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}", "int xBins();", "private int getBinJ(Location l)\r\n {\r\n return (int)((l.getY()-bl.getY())/dj);\r\n }", "protected final int calculateInterst1(int pr){\n\t\t return pr*10*1/100;\n\t }", "public int decToBin(int input) {\r\n\t String Binary = Integer.toBinaryString(input);\t\r\n\t\treturn Integer.valueOf(Binary);\t\t\r\n\t}", "private int sturgesFormula(int dataSize) {\n int binNum = currentBinNum;\n\n if (dataSize != 0) {\n binNum = 1 + (int) (.5 + Math.log((double) dataSize)\n / Math.log(2.0));\n }\n return binNum;\n }", "public int getMpen(){\n\t\treturn mpen;\n\t}", "public static double caratsToMilligrams(double num) { return (num*200); }", "public static int binarioInteiroParaDecimal(int[] numero) {\n if(numero.length > 32)\n throw new IllegalArgumentException(\"O numero nao pode ter mais do que 32 bits\");\n\n int potencia = 1;\n int soma = 0;\n for(int i = numero.length - 1; i > 0; i--) {\n soma += potencia * numero[i];\n potencia *= 2;\n }\n\n soma -= numero[0] * potencia;\n return soma;\n }", "public static float pu2mw(float pwr) {return pwr*100F;}", "private String MiniOneConversion() {\n int reading = ((raw[22] & 0xF0) >> 4) + ((raw[23] & 0x3F) << 4);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = m1Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "public static float pu2mvar(float pwr) {return pwr*100F;}", "public double toMB(int x){\n\t\tx = x - (x%10000);\n\t\tdouble temp = x;\n\t\treturn temp/1000000; \n\t}", "public static void main(String[] args) {\n System.out.println(-14>>>1);\n String bin = \"01111111111111111111111111111001\";\n double res = binToDec(bin);\n System.out.println(res);\n }", "double convertRpmToTicksPer100ms(double rpm) {\n return rpm / SECONDS_PER_MINUTE * TALON_TICKS_PER_REV / HUNDRED_MS_PER_SECOND;\n }", "private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}", "public Double findMaxPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass + ((ppm/1000000.0)*mass));\n\t}", "public static double fluidOuncesToMillilitres(double num) { return (num*29.574); }", "private static int batoi(byte[] inp) {\n int len = inp.length>4?4:inp.length;\n int total = 0;\n for (int i = 0; i < len; i++) {\n total += (inp[i]<0?256+inp[i]:(int)inp[i]) << (((len - 1) - i) * 8);\n }\n return total;\n }", "public static String decToBin( int n ) {\n\tString x = \"\";\n\twhile(n != 0){\n\t x = n % 2 + x;\n\t n /= 2;\n\t}\n\treturn x;\n }", "public String decimalToBinario(int numero) {\n\t\tSystem.out.print(\"Convirtiendo decimal (\" + numero + \") a binario >> \");\n\t\treturn Integer.toBinaryString(numero);\n\t}", "java.lang.String getNumb();", "public void setCurrentBinNum(ChartConfig config, float[] data) {\n this.currentBinNum = calculateBinNumWithConfig(config, data);\n }", "public int getAtomicMass()\n\t{\n\t\treturn protons+neutrons;\n\t}", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }", "public int binom(int n, int k) {\n isBinomValuesValid(n,k);\n if(isZeroOrEqual(n,k))\n return coeffs[n][k] = 1;\n else\n return coeffs[n][k] = coeffs[n - 1][k - 1] + coeffs[n - 1][k];\n }", "double convertTicksPer100msToRPM(double ticks) {\n return ticks * HUNDRED_MS_PER_SECOND / TALON_TICKS_PER_REV * SECONDS_PER_MINUTE;\n }", "public java.lang.String getBin() {\r\n return bin;\r\n }", "public int getBinCapacityLeft() {\n return binCapacityHeight - getBinCapicityFilled();\n }", "public static int valorInteiro(int[] binario) {\n \n // Calcula o valor inteiro absoluto do binario \n int potencia = 1;\n int valor = 0;\n for(int i = binario.length - 1; i >= 0; i--) {\n valor += potencia * binario[i];\n potencia *= 2;\n }\n \n return valor;\n }", "float compress(){\n float lower = mp.get(sequence.charAt(0)).lowRange;\n float upper = mp.get(sequence.charAt(0)).upperRange;\n for (int i = 1; i < sequence.length(); i++) {\n float newLower = lower + (upper - lower)*mp.get(sequence.charAt(i)).lowRange;\n float newUpper = lower + (upper - lower)*mp.get(sequence.charAt(i)).upperRange;\n lower = newLower;\n upper = newUpper;\n }\n ///picking value between final lower and upper\n float compressionCode = (float)(Math.floor(upper * 1000.0) / 1000.0);\n return compressionCode;\n }", "public void rcoFromInt(int coord) {\n coFromInt(coord % 2187);\n coord /= 2187;\n int i = 7;\n int k = 3;\n while(i >= 0 && k >= 0) {\n int binoCoef = 1;\n for (int j = 1, m = i; j <= k; j++, m--) {binoCoef = binoCoef * m / j;}\n if(coord >= binoCoef) {\n cp[i] = 0;\n i --;\n coord -= binoCoef;\n }\n else {\n cp[i] = 4;\n k --;\n i --;\n }\n }\n while(i >= 0) {\n cp[i] = 0;\n i --;\n }\n }", "private int unmapToInt(double x, double max, double min, int n) {\n\t\treturn (int) ( (x - max) * ( Math.pow(2, n) - 1 ) / (max - min) );\n\t}", "public int getAtomicMass() {\r\n\t\treturn protons + neutrons;\r\n\t}", "protected double toPounds(double weightOunces){\n\t\treturn 0.0625 * weightOunces;\n\t}", "public void binToDec(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toDec();\n\t\t\tthis.outDec();\n\t\t}\n\t}", "private float compruebaPorcentajeBarra(float porcentajeBarra)\n {\n if(porcentajeBarra<0)\n porcentajeBarra=0;\n return porcentajeBarra;\n }", "public static int binToDec(String bin) {\n\t\tint len = bin.length();\n\t\tif (len == 0)\n\t\t\treturn 0;\n\t\tString now = bin.substring(0, 1);\n\t\tString later = bin.substring(1);\n\t\treturn Integer.parseInt(now) * (int) Math.pow(2, len - 1) + binToDec(later);\n\t}", "public int getCurrentBinNum() {\n return currentBinNum;\n }", "public void setFlagBin(int n) {\n flagBin=Translate.decTobinN(n, 4);\n }", "private double binomeN_I(int n, int i) {\n double ni;\n double a1 = factorial(n);\n double a2 = factorial(i);\n double a3 = factorial(n - i);\n ni = a1 / (a2 * a3);\n return ni;\n }", "private int positiveBinToInt(String binary) {\n int w = 0;\n for (int i = binary.length() - 1, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * bitToInt(binary.charAt(i));\n }\n return w;\n }", "public int binToDec (String input) {\r\n\t int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn decimal;\t\t\r\n\t}", "private String decimalToBinary(int num) {\n String result = \"\";\n \n while(num > 0 ) \n {\n \n \n //get the remainder\n result = num % 2 + result;\n \n // Divide the positive decimal number by two( then divide the quotient by two)\n num = num /2;\n }\n \n return result;\n }", "public static byte[] byMassFromMinerals(Rock rock) {\n return byMassFromMinerals(rock.getMinerals(), rock.getFractions());\n }", "public static int getIntegerbpm() {\n return integerbpm;\n }", "private static int getBinaryCode(ArrayList<ArrayList<Integer>> tMat, int row){\r\n\t\tArrayList<Integer> currRow = tMat.get(row);\r\n\t\tString rowStr = currRow.toString().replaceAll(\"[^0-9]\", \"\");\r\n\t\treturn Integer.parseInt(rowStr, 2);\r\n\t}", "private void toDec(){\n\t\tlong temp = Long.parseLong(binary.substring(binary.length()/2, binary.length()));\n\t\tlong tempbin = 0;\n\t\tint j = 0;//splits the string in half with 2 for loops \n\t\tfor (int i = 0; i < binary.length()/2;i++){//second half of string\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));//convert binary to dec adding as it runs\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\ttemp = Long.parseLong(binary.substring(0, binary.length()/2));//first half of string\n\t\tfor (int i = 0; i <= binary.length()/2;i++){\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\tbinary = Long.toString(tempbin);\n\t}", "public static double kiloBitsToBits(double num) { return (num*1000); }", "public void setBin(java.lang.String bin) {\r\n this.bin = bin;\r\n }", "private List<Bin> discretizeRow(List<String> rawData) {\n\t\tList<Bin> binForThisAttr = new ArrayList<>();\n\t\tList<Double> procData = new ArrayList<>();\n\t\t// are we working with numbers or actual Strings\n\t\t// convert strings into Double, add to data attributes\n\t\tfor (int i = 0; i < rawData.size(); i++) {\n\t\t\tString raw = rawData.get(i);\n\t\t\t// check current attribute value for String type or floating point type\n\t\t\tif ((rawData.get(i).chars().allMatch(Character::isDigit) || rawData.get(i).contains(\".\"))) {\n\t\t\t\t//convert number strings into Doubles, or strings into unique Doubles\n\t\t\t\tprocData.add(Double.valueOf(raw));\n\t\t\t} else {\n\t\t\t\t// convert Strings into unique integers, add to data attributes\n\t\t\t\tprocData.add((double) raw.hashCode());\n\t\t\t} // end if-else\n\t\t}\n\n\t\t// sort data into ascending list of values\n\t\tCollections.sort(procData);\n\n\t\t// generate bins based on Naive Estimator Process\n\t\tfor (int i = 0; i < procData.size(); i++) {\n\t\t\tif (i == 0) {\n\t\t\t\t// append bin with lowest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(Double.MIN_VALUE, procData.get(i), i));\n\t\t\t\t// binForThisAttr.get(binForT i = 0; i hisAttr.size() - 1).incrementFreq();\n\t\t\t} else if (i == procData.size() - 1) {\n\t\t\t\t// append bin with highest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(procData.get(i), Double.MAX_VALUE, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} else {\n\t\t\t\t// estimate the range of bin based on nearby points of data\n\t\t\t\tdouble lowBound = (procData.get(i - 1) + procData.get(i)) / 2;\n\t\t\t\tdouble highBound = (procData.get(i) + procData.get(i + 1)) / 2;\n\t\t\t\tbinForThisAttr.add(new Bin(lowBound, highBound, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} // end if-else statement\n\t\t} // end for\n\t\treturn binForThisAttr;\n\t}", "protected int getBinIndex(double w){\n\t\tdouble lnw = Math.log(w);\n\t\tdouble i = Math.floor((lnw - m_lnA0)/m_lnR);\n\t\tint result = (int)i;\n\t\tif(result >= m_numBins.getValue() || result < 0){\n\t\t\tresult = -1;\n\t\t}\n\t\treturn result;\n\t}", "public static int getBinCap() //Obtains Bin Capacity\r\n {\r\n int binCap = -1;\r\n\r\n try {\r\n binCap = Integer.parseInt((JOptionPane.showInputDialog(\"Please enter (POSITIVE) INTEGER for BIN CAPACITY: \")));\r\n if (binCap <= 0) {\r\n throw new NumberFormatException();\r\n }\r\n } catch (Exception NumberFormatException) {\r\n JOptionPane.showMessageDialog(null, \"ERROR!!!\\n\" + \"-BIN CAPACITY MUST BE A (POSITIVE) INTEGER-\\n\" + \"Please try again!\", null, JOptionPane.ERROR_MESSAGE);\r\n binCap = getBinCap();\r\n //recursion\r\n }\r\n return binCap;\r\n }", "private static Double calcBMI(Double kilos, Double ms) {\n double bodyMassIndex;\n bodyMassIndex = kilos / (ms * ms);\n return bodyMassIndex;\n }", "private String BtaOneConversion() {\n int reading = (raw[25] & 0xFF) + ((raw[26] & 0x03) << 8);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = b1Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "private static int latToX(double lat) {\n return (int) ((lat - MIN_LAT) / (MAX_LAT - MIN_LAT) * 100 * 1000);\n }", "public Binary( int n ) {\n\t_decNum = n;\n\t_binNum = decToBin(n);\n }", "private void CalcChromNum()\r\n {\r\n max = 0;\r\n\r\n for(int i = 0; i < colorArray.length; i++)\r\n {\r\n if(colorArray[i] > max)\r\n {\r\n max = colorArray[i];\r\n }\r\n }\r\n }", "public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {\n\t\tBinomiale loi = new Binomiale(proba, nbRep, repetition);\n\t\treturn loi.simuler();\n\t}", "public Binarization(int threshold) {\n this.threshold = threshold;\n }", "public int getNumeroChampMag() {\n\t\treturn numeroChampMag;\n\t}", "public float getInitBGMVolume() {\n \t\treturn 1;\n \t}", "com.google.protobuf.ByteString\n getNum2Bytes();", "private static long recBinom(int n, int k) {\n if (bin.get(n).get(k) > 0) {\n return bin.get(n).get(k).longValue();\n }\n \n if (k == 0 || k == n) {\n bin.get(n).set(k, Long.valueOf(1));\n return 1;\n } \n\n long result = recBinom(n - 1, k - 1) + recBinom(n - 1, k);\n bin.get(n).set(k, Long.valueOf(result));\n\n return result;\n }", "public void binarycon()\n \t {\n\n\t int i,j,k,t;\n \t int temp[]=new int[10];\n\t int m=0;\n for(i=0;i<600000;i++)\n binary[i]=0;\n int b[]=new int[32];\n int dum;\n dum=max;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=24-i;\n for(k=j,t=i-1;k<(i+j);k++,t--)\n binary[k]=b[t];\n dum=73;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=32-i;\n for(k=j,t=i-1;k<32;k++,t--)\n binary[k]= b[t];\n m=32;\n for( i=0 ; i < max ; i++)\n \t {\n j=0;\n while( bytes[i]!= 0 )\n {\n temp[j++]=bytes[i]%2;\n bytes[i]=bytes[i]/2;\n\n\n\n }\n for( k=0;k<8-j ; k++)\n binary[m++]=0;\n for(k=j-1; k >=0 ; k--)\n binary[m++]=temp[k];\n }\n \t maxbinary=m;\n }", "public void setCurrentBinNum(int currentBinNum) {\n this.currentBinNum = currentBinNum;\n }", "public static String binConvertInt(long num) {\n\t\tString binString = \"\";\n\n\t\t// ORIGINAL CODE FOR INT BINCONVERT\n\n\t\tlong binary = 0;\n\t\tint count = 0;\n\n\t\tif (num >= 0) {\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t}\n\n\t\telse {\n\n\t\t\tnum = -1 * num;\n\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t\t// flip the binary to negative conversion\n\n\t\t\tchar ch[] = binString.toCharArray();\n\t\t\tboolean addedOne = false;\n\n\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\tif (ch[i] == '0') {\n\t\t\t\t\tch[i] = '1';\n\t\t\t\t} else {\n\t\t\t\t\tch[i] = '0';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (ch[binString.length() - 1] == '0') {\n\n\t\t\t\tch[binString.length() - 1] = '1';\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tch[binString.length() - 1] = '0';\n\t\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif(ch[i] == '1') {\n\t\t\t\t\t\tch[i] = '0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tch[i] = '1';\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\tbinString = new String(ch);\n\t\t}\n\n\t\t\n\t\treturn binString;\n\t}", "public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static long mass () { return mass;}", "private void findAbdomenCM() {\r\n \r\n if (foundCenterOfMass) return;\r\n int xcm = 0, ycm = 0, pixCount = 0;\r\n for (int idx= 0, y = 0; y < yDim; y++) {\r\n for (int x = 0; x < xDim; x++, idx++) {\r\n if (sliceBuffer[idx] == abdomenTissueLabel) {\r\n xcm += x;\r\n ycm += y;\r\n pixCount++;\r\n }\r\n } // end for (int x = 0; ...)\r\n } // end for (int idx = 0, ...)\r\n \r\n if (pixCount == 0) {\r\n// System.err.println(\"findAbdomenCM(): No pixels with abdomenTissueLabel in segmented image\");\r\n MipavUtil.displayError(\"findAbdomenCM(): No pixels with abdomenTissueLabel in segmented image\");\r\n return;\r\n }\r\n \r\n centerOfMass[0] = (short)(xcm / pixCount);\r\n centerOfMass[1] = (short)(ycm / pixCount);\r\n foundCenterOfMass = true;\r\n }", "private String MiniTwoConversion() {\n int reading = ((raw[23] & 0xC0) >> 6) + ((raw[24] & 0xFF) << 2);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = m2Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "public static void main(String[] args) {\n\t\tint x = ~0;\r\n\t\tSystem.out.println(Integer.toBinaryString(x));\r\n\t\tint y = x>>>8;\r\n\t\tSystem.out.println(Integer.toBinaryString(y));\r\n\t\tSystem.out.println(x+\" \"+y);\r\n\t\t\r\n\t\tint N = 1<<31;\r\n\t\tint M = 0b11;\r\n\t\tint j=2;\r\n\t\tint i=1;\r\n\t\tSystem.out.println(Integer.toBinaryString(N));\r\n\t\tSystem.out.println(Integer.toBinaryString(M));\r\n\t\tSystem.out.println(Integer.toBinaryString(insertMIntoNFromJtoI(M, N, j, i)));\r\n\t\t\r\n\t}", "public BinNumber(ChartConfig config, int dataSize) {\n this.currentBinNum = calculateBinNumWithConfig(config, dataSize);\n }", "public static int hammingWeight(int n) {\n if(n == 0) return 0;\n\n String s = n + \"\";\n int counter = 0;\n char[] chars = s.toCharArray();\n for(int i = 0; i < chars.length; i++)\n {\n if(chars[i] == '1')\n {\n counter++;\n }\n }\n return counter;\n }", "public int ConvertToDecimalInt() {\n int result = 0;\n int cont = 0;\n for (int index = binaries.length - 1; index > 0; index--) {\n result = result + ((int) (Math.pow(base, cont)) * binaries[index]);\n cont++;\n }\n return result;\n }", "private String calculateL100Km() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = (fuel * 100) / distance;\n return rounder(value);\n }", "public static String num2Bin(int a) {\n StringBuilder sb = new StringBuilder();\n for (int bitPow2 = 1, i = 0; i < Integer.SIZE; bitPow2 <<= 1,\n ++i) {\n if ((a & bitPow2) == bitPow2) {\n sb.append(\"1\");\n } else {\n sb.append(\"0\");\n }\n }\n return sb.reverse().toString();\n }", "public static void main(String[] args) {\r\n\r\n\t\tint N = 15;\r\n\t\tint reminder;\r\n\t\tint temp = 0;\r\n\t\tStringBuilder binaryValue = new StringBuilder();\r\n\t\tfor (int i = 0; N != 1; i++) {\r\n\t\t\treminder = N % 2;\r\n\r\n\t\t\tN = N / 2;\r\n\t\t\tbinaryValue = binaryValue.append(reminder);\r\n\t\t}\r\n\t\tif (N == 1) {\r\n\t\t\tbinaryValue.append(1);\r\n\t\t}\r\n\r\n\t\tbinaryValue = binaryValue.reverse();\r\n\t\t\r\n\t\tint counter = 0;\r\n\t\tfor (int i = 0; i < binaryValue.length(); i++) {\r\n\r\n\t\t\tif (binaryValue.charAt(i)=='1') {\r\n\t\t\t\tif (counter > temp) {\r\n\t\t\t\t\ttemp = counter;\r\n\t\t\t\t}\r\n\t\t\t\tcounter = 0;\r\n\t\t\t} else {\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t if(temp==0) {\r\n\t\t\t System.out.println(\"No Binary space\");\r\n\t\t }else {\r\n\t\t\t System.out.println(\"Binary space of given number is \" + temp); \r\n\t\t }\r\n\t\t\r\n\t}", "public SmartBin() {\n items = new ItemType[7];\n curWeight = 0;\n curArrayIndex = 0;\n binNumber = \"SM\" + generateBinNumber();\n }", "private float bitsToMb(float bps) {\n return bps / (1024 * 1024);\n }", "protected static float[] getBinomialKernelSigmaZeroPointSevenOne() {\n float a = 1.f/200.f;\n return new float[]{9*a, 83*a, 0, -83*a, -9*a};\n }", "protected float computeProbs(int n)\n\t{\n\t\tfloat Cmi = 0;\n\t\t// Compute probabilities\n\t\tfor (int k = 0; k < bins; k++)\n\t\tfor (int l = 0; l < bins; l++)\n\t\t{\n\t\t float Pkl = Puv[k*bins+l];\n\t\t if (Pkl > 0)\n\t\t\t Cmi -= Pkl / n * Math.log(n * Pkl / (Pu[k] * Pv[l]));\n\t\t}\n\t\treturn Cmi;\n\t}", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "@Override \n public int binom(int n, int k){\n this.binumInputCheck(n, k);\n if ( n == 0 || k == 0 || n == k )\n return 1;\n \n if(k > n/2)\n k = n - k; \n \n if(this.saveArr[n][k] != 0)\n return this.saveArr[n][k];\n \n this.saveArr[n][k] = binom(n-1, k-1) + binom(n-1, k);\n return this.saveArr[n][k];\n }", "public String getNormalizedN(int i) {\n\tint nb = getNb(i);\n\tif (nb == 1) return \"1\";\n\tint maxN = getMaxNb();\n\tif (maxN <= 5) return Integer.toString(nb);\n\tmaxN--;\n\tnb--;\n\tif (maxN < 21) {\n\t\tif (4*nb <= maxN) return \"1\";\n\t\tif (3*nb <= maxN) return \"2\";\n\t\tif (2*nb <= maxN) return \"3\";\n\t\tif (3*nb <= 2*maxN) return \"4\";\n\t\treturn \"5\";\n\t} else if (maxN < 100) {\n\t\tif (10*nb <= maxN) return \"1\";\n\t\tif (5*nb <= maxN) return \"2\";\n\t\tif (4*nb <= maxN) return \"3\";\n\t\tif (3*nb <= maxN) return \"4\";\n\t\tif (2*nb <= 1*maxN) return \"5\";\n\t\tif (3*nb <= 2*maxN) return \"6\";\n\t\treturn \"7\";\n\t} else {\n\t\tif (20*nb <= maxN) return \"1\";\n\t\tif (10*nb <= maxN) return \"2\";\n\t\tif (5*nb <= maxN) return \"3\";\n\t\tif (4*nb <= maxN) return \"4\";\n\t\tif (3*nb <= 1*maxN) return \"5\";\n\t\tif (2*nb <= 1*maxN) return \"6\";\n\t\treturn \"7\";\n\t}\n}" ]
[ "0.5666311", "0.54282767", "0.5266754", "0.523452", "0.52031136", "0.5172806", "0.511719", "0.5109256", "0.50935847", "0.5090343", "0.5060429", "0.50282335", "0.5023554", "0.50180316", "0.4996441", "0.49959308", "0.4991634", "0.4987769", "0.4985438", "0.4976965", "0.496465", "0.49407467", "0.49342903", "0.49232802", "0.4921269", "0.49185684", "0.48689657", "0.48680422", "0.48523262", "0.48519552", "0.4835346", "0.48256427", "0.48239595", "0.48112503", "0.48104528", "0.48036894", "0.48010033", "0.47976962", "0.47927994", "0.47900662", "0.4782195", "0.47781515", "0.47742158", "0.47576842", "0.4754974", "0.4750535", "0.474837", "0.47466847", "0.47418112", "0.47398373", "0.4731267", "0.4726149", "0.47239387", "0.4710305", "0.470837", "0.46998814", "0.4697727", "0.46869785", "0.46866384", "0.46800867", "0.46783477", "0.46778074", "0.46629503", "0.46622235", "0.46615797", "0.46605697", "0.46573305", "0.46543667", "0.46496332", "0.46344626", "0.46325105", "0.4624305", "0.46196616", "0.461782", "0.4617244", "0.46123955", "0.460695", "0.46015748", "0.46014518", "0.45907652", "0.45857424", "0.45845643", "0.45796525", "0.45777407", "0.4574066", "0.4573573", "0.45726252", "0.4570039", "0.45686185", "0.4566517", "0.45627934", "0.45615324", "0.45590356", "0.45550987", "0.45533028", "0.45518592", "0.455136", "0.4546893", "0.45416686", "0.45379826" ]
0.6987372
0
Calculate the correct array size based on a mass range
public int calcArraySize(Double binSize, Double minMass, Double maxMass) { return (int)((maxMass - minMass)/binSize)+1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract long[] GetApproximateSizes(Range[] range, int n) throws IOException, DecodeFailedException, BadFormatException;", "int calculateCapacity(int[] vesselArray);", "public abstract double getRangeSize();", "abstract int calculateMaximumSize(int axis);", "abstract int calculateMinimumSize(int axis);", "int sizeOfContactMeansArray();", "int sizeOfSpeedsArray();", "int sizeOfReferenceRangeArray();", "public int calculateSize( int numSamples )\n {\n return numSamples * 2;\n }", "Dimension[] getSizes();", "float getSize(float[] sizes);", "public int rangeSize() {\n return Math.abs(max - min);\n }", "int sizeOfDecisionSightDistanceArray();", "public static final int calcCapacity(int size) {\r\n\t\treturn ((size * 4) + 3) / 3;\r\n\t}", "public int[] getSizes() {\n\t\treturn new int[] { quoteMap.size(), bookMap.size(), _cumulativeVolumeTable.size() };\n\t}", "public int get_size() {\r\n return this.dimension * 2 * sizeof_float + 4 * sizeof_float + sizeof_dimension + sizeof_int;\r\n }", "private int getBufferSize() {\n int maxBandOff = bandOffsets[0];\n for (int i = 1; i < bandOffsets.length; i++) {\n maxBandOff = Math.max(maxBandOff, bandOffsets[i]);\n }\n\n if (maxBandOff < 0 || maxBandOff > (Integer.MAX_VALUE - 1)) {\n throw new IllegalArgumentException(\"Invalid band offset\");\n }\n\n if (pixelStride < 0 || pixelStride > (Integer.MAX_VALUE / width)) {\n throw new IllegalArgumentException(\"Invalid pixel stride\");\n }\n\n if (scanlineStride < 0 || scanlineStride > (Integer.MAX_VALUE / height)) {\n throw new IllegalArgumentException(\"Invalid scanline stride\");\n }\n\n int size = maxBandOff + 1;\n\n int val = pixelStride * (width - 1);\n\n if (val > (Integer.MAX_VALUE - size)) {\n throw new IllegalArgumentException(\"Invalid pixel stride\");\n }\n\n size += val;\n\n val = scanlineStride * (height - 1);\n\n if (val > (Integer.MAX_VALUE - size)) {\n throw new IllegalArgumentException(\"Invalid scan stride\");\n }\n\n size += val;\n\n return size;\n }", "public int[] findPlateauSize(int[] peaks) {\n int[] newPS = new int[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n newPS[i] = this.plateau_size[peaks[i]];\n }\n return newPS;\n }", "public abstract int getMaxIntermediateSize();", "public int arraySize();", "public void setMass(Bounds[] bounds)\n\t{\n\t\tfloat mass = 0;\n\t\tfor (Bounds b : bounds) {\n\t\t\tmass += b.getOvalArea();\n\t\t}\n\t\tthis.mass = mass;\n\t}", "private static int getSize(int type) {\n switch (type) {\n case 0:\n return 65535;\n case 1:\n return 78513;\n case 2:\n return 101597;//getModelCount();\n case 3:\n return 3696;\n case 4:\n return 4193;\n case 5:\n return 6827;\n case 6:\n return 8487;\n case 7:\n return 645;//midiIndices.length;\n /*case 8:\n return 0;//getAnimCount();\n case 9:\n return 0;//getMapAmount();\n case 10:\n return 34026;\n case 11:\n return 3159;\n case 12:\n return 1956;*/\n }\n return 0;\n }", "public static int arraySize(final int expected, final float f) {\n final long s = Math.max(2, HashCommon.nextPowerOfTwo((long) Math.ceil(expected / f)));\n if (s > (1 << 30))\n throw new IllegalArgumentException(\"Too large (\" + expected + \" expected elements with load factor \" + f + \")\");\n return (int) s;\n }", "@Override\n public int getStorageSize() {\n int nCells = nRows * nCols;\n return 16 + 8 * nCells;\n }", "public abstract long estimateMemorySize();", "protected abstract int getMaxDesiredSize();", "public float sizeMultiplier();", "private void calculateMapSize() {\n calculateMapSize(true);\n }", "double getSize();", "int sizeOfRoadsideArray();", "public static int size_cost() {\n return (16 / 8);\n }", "public static int size_amtype() {\n return (8 / 8);\n }", "public static int getCapacity () {\n\t\tcapacity = nbrOfHouses*Barn.getCapacity();\n\t\treturn capacity;\n\t}", "public int calcKernelSize() {\n\t\treturn 1+(int)Math.round(getStd()*3)*2;\n\t}", "public int getTrueSize() {\n int len = ArrayFuncs.computeSize(dataArray);\n return len;\n }", "public Vector2i getSizeInChunks() {\n return new Vector2i(getWidthInChunks(), getHeightInChunks());\n }", "private int getDoubleSize() {\n int oddNewSize = (sizeArray * 2) + 1;\n return primes.getNextPrime(oddNewSize);\n }", "@Override\n public int estimateSize() {\n return 8 + 8 + 1 + 32 + 64;\n }", "public abstract Extent getHeapSize();", "@Override\n public long estimateSize(){\n return ((long)upTo)-from+last;\n }", "public int[] askNewSizes(int min, int max, String titel);", "public static int size_min() {\n return (8 / 8);\n }", "final int calculateTypeConstraintMaxDiff(){\n int result=0;\n for(int i=0;i<MaximumNumberOfVerticesOfTypeZ.length;i++){\n result+=MaximumNumberOfVerticesOfTypeZ[i];\n }\n return result;\n }", "public int size() {\n\treturn slices*rows*columns;\n}", "int sizeOfTrafficVolumeArray();", "int sizeOfGuideArray();", "public static native int Capacity(long lpjFbxArrayVector2);", "long arrayLength();", "private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}", "@Override\n\tpublic double getSize() {\n\t\treturn Math.sqrt(getMySize())/2;\n\t}", "int givePropSize(List<Integer[]> coordsInProp) throws Exception;", "private int calcSize(int size)\n {\n return (((size - 1) / 9) + 1) * 9;\n }", "private int calcMaxSize(int capacity) {\n // Clip the upper bound so that there will always be at least one available slot.\n int upperBound = capacity - 1;\n return Math.min(upperBound, (int) (capacity * loadFactor));\n }", "public int minSetSize(int[] arr) {\n Arrays.sort(arr);\n\n // Make the List of Counts\n List<Integer> counts = new ArrayList<>();\n int currentRun = 1;\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] == arr[i - 1]) {\n currentRun += 1;\n continue;\n }\n counts.add(currentRun);\n currentRun = 1;\n }\n counts.add(currentRun);\n\n Collections.sort(counts);\n Collections.reverse(counts);\n\n // Remove numbers until at least half are removed.\n int numbersRemovedFromArr = 0;\n int setSize = 0;\n for (int count : counts) {\n numbersRemovedFromArr += count;\n setSize += 1;\n if (numbersRemovedFromArr >= arr.length / 2) {\n break;\n }\n }\n\n return setSize;\n }", "public Double findMaxPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass + ((ppm/1000000.0)*mass));\n\t}", "private void countSizes() {\r\n Double pageWidth = Double.valueOf(pageWidthParameter.getType().getValue().replace(\",\", \".\"));\r\n double pageHeight = Double.valueOf(pageHeightParameter.getType().getValue().replace(\",\", \".\"));\r\n Double max = Math.max(pageWidth, pageHeight);\r\n max /= PAPER_SIZE;\r\n widthSize = (int) (pageWidth / max);\r\n heightSize = (int) (pageHeight / max);\r\n }", "int sizeOfFinancialStatementsArray();", "public static int size_quality() {\n return (16 / 8);\n }", "public abstract long getMaxSize();", "static int capacity(final long count) {\n\n double capacity = count;\n\n while (capacity > PlainArray.MAX_SIZE) {\n capacity = PrimitiveMath.SQRT.invoke(capacity);\n }\n\n capacity = PrimitiveMath.SQRT.invoke(capacity);\n return 2 * (int) capacity;\n }", "public abstract float getSquareSize();", "public double getCapacity() {\n\t\tIterator<Ball> it = this.contents.iterator();\n\t\tdouble retVal = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tretVal += it.next().getCapacity();\n\t\t}\n\t\treturn retVal;\n\t}", "private static int[] computeBucketSizes(int size) {\n\t\tint numBuckets = 2;\n\t\tint bucketSize = 3 * BASE_SIZE / 4;\n\t\tint sizeInBuckets = 2 * bucketSize;\n\t\twhile (sizeInBuckets < size) {\n\t\t\tbucketSize *= FACTOR;\n\t\t\tsizeInBuckets += 2 * bucketSize;\n\t\t\tnumBuckets += 2;\n\t\t}\n\t\tnumBuckets--;\n\t\tint[] bucketSizes = new int[numBuckets];\n\t\tbucketSize = BASE_SIZE;\n\t\tint rest = size;\n\t\tint i = 0, j = numBuckets - 1;\n\t\twhile (i < j) {\n\t\t\tbucketSizes[i] = bucketSize / 2;\n\t\t\tbucketSizes[j] = bucketSize / 2;\n\t\t\trest -= bucketSizes[i] + bucketSizes[j];\n\t\t\tbucketSize *= FACTOR;\n\t\t\ti++;\n\t\t\tj--;\n\t\t}\n\t\tbucketSizes[i] = rest;\n\n\t\treturn bucketSizes;\n\t}", "public int linearEstimateForSize()\n {\n int ret = 1;\n if (parameterisedDimensions != null)\n for (int i = 0; i < parameterisedDimensions.length; i++)\n ret *= linearEstimateForSize(parameterisedDimensions[i]);\n if (simpleDimensions != null)\n for (int i = 0; i < simpleDimensions.length; i++)\n ret *= linearEstimateForSize(simpleDimensions[i]);\n return ret;\n }", "public static int getMaxSize(){\n\t\treturn 2* 4;\n\t}", "int sizeOfStockArray();", "private static int calculateInSampleSize(Options options, int reqWidth, int reqHeight) {\n\t\tfinal int height = options.outHeight;\r\n\t\tfinal int width = options.outWidth;\r\n\t\tint inSampleSize = 1;\r\n\r\n\t\tif (height > reqHeight || width > reqWidth) {\r\n\t\t\tif (width > height) {\r\n\t\t\t\tinSampleSize = Math.round((float) height / (float) reqHeight);\r\n\t\t\t} else {\r\n\t\t\t\tinSampleSize = Math.round((float) width / (float) reqWidth);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn inSampleSize;\r\n\t}", "public int getAtomicMass()\n\t{\n\t\treturn protons+neutrons;\n\t}", "int getArrayLength();", "int getArrayLength();", "int sizeOfStarArray();", "int sizeOfClassificationArray();", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "public int[] isScale(Region r) {\n\t\tint[] res=new int[2];\n\t\tint t=0;\n\t\tif (nearlyEquals(sizeX,r.sizeX) && nearlyEquals(sizeY,r.sizeY))\n\t\t\treturn res;\n\t\tif (!nearlyEquals(this.sizeX, r.sizeX) && !nearlyEquals(this.sizeY, r.sizeY)) {\n\t\t\tdouble factor=(double)r.sizeX/sizeX;\n\t\t\tif (Math.abs((double)r.sizeY/sizeY-factor)>0.2)\n\t\t\t\treturn res;\n\t\t\tfor (int i=0;i<sizeX/2;i++) {\n\t\t\t\tfor (int j=0;j<sizeY/2;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-1-i][j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[i][sizeY-1-j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2+Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-1-i][sizeY-1-j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), (int)(r.sizeY/2+Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\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\tif (t<square/5) {\n\t\t\t\tres[0]=3;\n\t\t\t\tres[1]=(r.sizeX-sizeX)/2;\n\t\t\t} \n\t\t\treturn res;\n\t\t}\n\t\t\n\t\tif (!nearlyEquals(sizeX,r.sizeX)) {\n\t\t\tdouble factor=(double)r.sizeX/sizeX;\n\t\t\tfor (int i=0;i<sizeX/2;i++) {\n\t\t\t\tfor (int j=0;j<sizeY;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get((int)(r.sizeX/2-Math.abs(sizeX/2-i)*factor), j)) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[sizeX-i-1][j]!=r.get((int)(r.sizeX/2+Math.abs(sizeX/2-i)*factor), j)) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\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\tif (t<square/5) {\n\t\t\t\tres[0]=1;\n\t\t\t\tres[1]=(r.sizeX-sizeX)/2;\n\t\t\t}\n\t\t} else {\n\t\t\tdouble factor=(double)r.sizeY/sizeY;\n\t\t\tfor (int i=0;i<sizeX;i++) {\n\t\t\t\tfor (int j=0;j<sizeY/2;j++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (info[i][j]!=r.get(i, (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t\tif (info[i][sizeY-1-j]!=r.get(i, (int)(r.sizeY/2-Math.abs(sizeY/2-j)*factor))) \n\t\t\t\t\t\t\tt++;\n\t\t\t\t\t} catch (Exception e) {\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\tif (t<square/5) {\n\t\t\t\tres[0]=2;\n\t\t\t\tres[1]=(r.sizeY-sizeY)/2;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public int getAtomicMass() {\r\n\t\treturn protons + neutrons;\r\n\t}", "public Double findMaxMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass + mzTol);\n\t}", "public float getCapacity();", "public static void determineSizes(){\n maxPieceSize = 65536*8;\n if(pieceSize > maxPieceSize){\n \t//make pieceSize equal to the max\n \tpieceSize = maxPieceSize - 1; //minus one because we want a buffer space\n }\n\n windowSize = fileSize/10 ;\n\t}", "public static int size_max() {\n return (8 / 8);\n }", "public int size() {\n //encapsulate\n int size = this.array.length;\n return size;\n }", "private void testSize(ArrayGenerator generator) {\n assertEquals(generator.getSize(), generator.getArray().length);\n }", "int getAreaSize();", "double getStepSize();", "private int calculateResizeThreshold() {\n\t\treturn (buffer.length >> 2) * 3;\n\t}", "public int[] getPlateauSize() {\n return this.plateau_size;\n }", "public int getSetSize(){ return Integer.parseInt(setSize.getText()); }", "long getOccupiedSize();", "protected void calcMinMax() {\n }", "int fixedSize();", "public int getSize() {\n\n\treturn getSectors().size() * getUnitSize(); // 254 byte sectors\n }", "public Integer[] sMapDimensions() {\n\t\tDualSteenrod AmodAn = new DualSteenrod(DualSteenrod.getDualAModAnGenerators(N));\n\t\tint topClassDim = Tools.milnorDimension(topClass());\n\t\tInteger[] AmodAnKeys = Tools.keysToSortedArray(AmodAn.getMonomialsAtOrBelow(topClassDim));\n\t\tMap<Integer, List<int[]>> filteredMonomials = getMonomialsByFilter(AmodAnKeys);\n\t\treturn Tools.keysToSortedArray(filteredMonomials);\n\t}", "int sizeOfPerformerArray();", "int getTotalSize();", "private int getGroupSize(double positiveProbability)\n {\n if (positiveProbability < eightIndividualsGroupMaxProbability)\n return 8;\n\n if (positiveProbability < fourIndividualsGroupMaxProbability)\n return 4;\n\n if (positiveProbability < twoIndividualsGroupMaxProbability)\n return 2;\n\n return 1;\n }", "int sizeOfTaskAbstractArray();", "public int getSize() {\n\t\treturn dist.length;\n\t}", "public int kernelSize();", "public abstract int getPuzzleLengthSize();", "int sizeOfObjectDefinitionArray();", "public void increaseArraySize(int minArraySize){\n\t\t\n\t\tint newArraySize = getNextPrime(minArraySize);\n\t\tmoveOldArray(newArraySize);\n\t\t\n\t}" ]
[ "0.6741079", "0.6601641", "0.65393627", "0.6250966", "0.60184085", "0.597105", "0.5902264", "0.57673264", "0.5755311", "0.5726337", "0.5714629", "0.57143426", "0.56850386", "0.5638472", "0.5615592", "0.5614791", "0.557017", "0.551729", "0.55097264", "0.55094475", "0.5492793", "0.548778", "0.54814184", "0.54737216", "0.5469451", "0.54603285", "0.54480886", "0.5447853", "0.543018", "0.54211307", "0.5405223", "0.53811276", "0.5370029", "0.5364762", "0.53621453", "0.53539896", "0.53526574", "0.5333285", "0.5321926", "0.5319571", "0.531659", "0.5315605", "0.5303119", "0.5297763", "0.52900743", "0.52782357", "0.5268805", "0.5264989", "0.52644056", "0.5263588", "0.525917", "0.5245756", "0.5234855", "0.52339816", "0.5227837", "0.52274895", "0.52259445", "0.5225521", "0.522364", "0.52202004", "0.5219443", "0.52173966", "0.5216639", "0.5212653", "0.52070063", "0.5191953", "0.5191662", "0.5182346", "0.51820093", "0.51820093", "0.5174347", "0.5172358", "0.5167156", "0.51484543", "0.51382744", "0.5124601", "0.51245064", "0.51241964", "0.512239", "0.5120989", "0.51201856", "0.5118633", "0.5117117", "0.51171166", "0.5114996", "0.51118153", "0.5108307", "0.5107604", "0.5104466", "0.5098997", "0.50910616", "0.5086028", "0.5083084", "0.5079145", "0.50780076", "0.5074474", "0.5072373", "0.5061896", "0.5061066", "0.5057576" ]
0.72227806
0
Calculate the difference between two masses in ppm
public Double calcPPMDiff(Double mass1, Double mass2) { return (Math.abs(mass1 - mass2)/(mass2))*1000000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public double forceBetween(Planet p1, Planet p2, double distance){ \n double rSquared = Math.pow(distance, 2);\n return (G * p1.mass * p2.mass) / rSquared;\n }", "public double masse () {return this.volume()*this.element.masseVolumique();}", "private static double calculateForce(double mass1, double mass2, double g, double distance) {\n if (distance > 0)\n return ((mass1 * mass2) * g) / (distance * distance);\n else\n return 0.0;\n }", "private double deltaAbs(DMatrixRMaj M1, DMatrixRMaj M2){\n int nElements = M1.numCols*M1.numCols;\n\n Equation eq = new Equation();\n eq.alias(M1, \"M1\", M2, \"M2\", nElements, \"n\");\n\n eq.process(\"d = sum(abs(M2 - M1)) / n\");\n\n return eq.lookupDouble(\"d\");\n }", "public double getMass();", "public double pendiente()\n {\n return (b.y()-a.y())/(b.x()-a.x());\n }", "public void calCollision(Manifold man){\n \tEntity a = man.a;\n \tEntity b = man.b;\n \tVector2f normal = man.getNormal(); // Normal\n \tfloat massA = a.getMass(), massB = b.getMass(); // Masses\n \tdouble fCor = (a.getMaterial().cor + b.getMaterial().cor)/2; // Final coefficient of restitution (average)\n \t\n \tif(a.getStatic())\n \t\tmassA = Float.MAX_VALUE; // Infinite mass!\n \tif(b.getStatic())\n \t\tmassB = Float.MAX_VALUE; // ...\n \t\n \t// VECTORS DEFINITIONS:\n \tVector2f ut = new Vector2f(-normal.y,normal.x); \t\t\t\t\t\t\t// Tangent\n \tVector2f v1 = new Vector2f((float)a.getDX(),(float)a.getDY()); \t\t\t\t// Original velocity\n \tVector2f v2 = new Vector2f((float)b.getDX(),(float)b.getDY()); \t\t\t\t// Original velocity\n \t\n \tdouble v1n = Util.dotProduct(v1,normal); \t\t\t\t\t\t\t\t\t// Velocity in normal direction\n \tdouble v1t = Util.dotProduct(ut,v1); \t\t\t\t\t\t\t\t\t\t// Velocity in tangent direction\n \tdouble v2n = Util.dotProduct(normal,v2); \t\t\t\t\t\t\t\t\t// Velocity in normal direction\n \tdouble v2t = Util.dotProduct(ut,v2); \t\t\t\t\t\t\t\t\t\t// Velocity in tangent direction\n\n\t\t// APPLY MOMENTUM CONSERVATION:\n\n \tdouble V1t = v1t, V2t = v2t;\n \tdouble V1n = (v1n*(massA-fCor*massB)+(1+fCor)*massB*v2n)/(massA+massB); \t// Velocity size using my custom equation\n \tdouble V2n = (v2n*(massB-fCor*massA)+(1+fCor)*massA*v1n)/(massA+massB); \t// Velocity size using my custom equation\n \t\n \tVector2f vV1n = new Vector2f((float)V1n*normal.x,(float)V1n*normal.y); \t\t// Getting the velocity for the normal direction\n \tVector2f vV1t = new Vector2f((float)V1t*ut.x,(float)V1t*ut.y); \t\t\t\t// Getting the velocity for the tangent direction\n \tVector2f vV2n = new Vector2f((float)V2n*normal.x,(float)V2n*normal.y); \t\t// Getting the velocity for the normal direction\n \tVector2f vV2t = new Vector2f((float)V2t*ut.x,(float)V2t*ut.y); \t\t\t\t// Getting the velocity for the tangent direction\n\n \tVector2f fV1 = new Vector2f(vV1n.x+vV1t.x,vV1n.y+vV1t.y); \t\t\t\t\t// Getting final velocity\n \tVector2f fV2 = new Vector2f(vV2n.x+vV2t.x,vV2n.y+vV2t.y); \t\t\t\t\t// Getting final velocity\n\n \t// OTHER INTERACTIONAL FORCES\n\n \t// FRICTION\n \t//Get the static and kinetic friction coefficient\n \tfinal double fMuk = (a.getMaterial().Muk+b.getMaterial().Muk)/2;\n \tfinal double fMus = (a.getMaterial().Mus+b.getMaterial().Mus)/2;\n \t// GET NORMAL FORCES\n \tfinal double fNa = Math.abs(a.getMass()*(v1n-v2n));\n \tfinal double fNb = Math.abs(b.getMass()*(v2n-v1n));\n \t//GET TANGENTIAL FORCES\n \tfinal double fTa = Math.abs(a.getMass()*(V1t-V2t));\n \tfinal double fTb = Math.abs(b.getMass()*(V2t-V1t));\n \t//CALCULATE FRICTION FORCES\n \tdouble f1 = -Math.abs((fTa > fMus*fNb)? fMuk*(v1n-v2n) : V1t);\n \tdouble f2 = -Math.abs((fTb > fMus*fNa)? fMuk*(v2n-v1n) : V2t);\n \t// CALCULATE FINAL FORCE\n \tUtil.normalize(vV1t);\n \tUtil.normalize(vV2t);\n\n \tif (Double.isNaN(f1))\n \t\tf1 = 0.0f;\n \tif (Double.isNaN(f2))\n \t\tf2 = 0.0f;\n\n \tVector2f F1 = new Vector2f((float)(vV1t.x*f1),(float)(vV1t.y*f1));\n \tVector2f F2 = new Vector2f((float)(vV2t.x*f2),(float)(vV2t.y*f2));\n\n \t//APPLY FORCE\n\t\tfV1.x += F1.x;\n\t\tfV1.y += F1.y;\n\t\tfV2.x += F2.x;\n\t\tfV2.y += F2.y;\n\n\t\t// set new velocities (including friction) ; dv = f*dt/m\n\t\tif (!a.getStatic())\n\t\t{\n\t\t\ta.setDX(fV1.x); // Set the new velocity\n\t\t\ta.setDY(fV1.y); // Set the new velocity\n\t\t}\n\n\t\tif (!b.getStatic())\n\t\t{\n\t\t\tb.setDX(fV2.x); // Set the new velocity\n\t\t\tb.setDY(fV2.y); // Set the new velocity\n\t\t}\n\n\t\t// PENETRATION\n \tman.fixPenetration(normal,massA,massB,this);\n \n\t\t// WAY #2 (Trigonometry):\n \t/*\n \tdouble fi = getAngle(normal,new Vector2f(1,0));\n \tdouble theta1 = Math.atan(a.getDY()/a.getDX());\n \tdouble theta2 = Math.atan(b.getDY()/b.getDX());\n \tif(a.getDX() == 0)\n \t\ttheta1=Math.PI/2;\n \tif(b.getDX() == 0)\n \t\ttheta2=Math.PI/2;\n \t\n\t a.setDX((a.getDX()*Math.cos(theta1-fi)*(massA-fCor*massB)+(1+fCor)*massB*b.getDX()*Math.cos(theta1-fi))/(massA+massB)*Math.cos(fi)+a.getDX()*Math.sin(theta1-fi)*Math.cos(fi+Math.PI/2));\n\t a.setDY(((a.getDY()*Math.cos(theta1-fi)*(massA-fCor*massB)+(1+fCor)*massB*b.getDY()*Math.cos(theta1-fi))/(massA+massB)*Math.sin(fi)+a.getDY()*Math.sin(theta1-fi)*Math.sin(fi+Math.PI/2)));\n \t\t\n\t b.setDX((b.getDX()*Math.cos(theta2-fi)*(massB-fCor*massA)+(1+fCor)*massA*a.getDX()*Math.cos(theta2-fi))/(massA+massB)*Math.cos(fi)+b.getDX()*Math.sin(theta2-fi)*Math.cos(fi+Math.PI/2));\n\t b.setDY(((b.getDY()*Math.cos(theta2-fi)*(massB-fCor*massA)+(1+fCor)*massA*a.getDY()*Math.cos(theta2-fi))/(massA+massB)*Math.sin(fi)+b.getDY()*Math.sin(theta2-fi)*Math.sin(fi+Math.PI/2)));\n \t\n \tSystem.out.println(a.getDY());\n \t*/\n }", "public double mass2() {\n\t\treturn this.m2();\n\t}", "public double getmass(int position){\n\t\treturn masses.get(position);\n\t}", "private double computeForceBetweenMolecules(Molecule m1, Molecule m2) {\r\n double potentialEnergy = 0;\r\n double dx = m1.x - m2.x;\r\n double dy = m1.y - m2.y;\r\n double r2 = dx * dx + dy * dy;\r\n if (r2 >= LJ_CUTOFF_SQUARED) {\r\n return 0.0;\r\n }\r\n if ( r2 < MIN_DISTANCE_SQUARED ) {\r\n r2 = MIN_DISTANCE_SQUARED;\r\n }\r\n double r2inv = 1.0 / r2;\r\n double r6inv = r2inv * r2inv * r2inv;\r\n double ljForceOverR = 48.0 * (r6inv - 0.5) * r6inv * r2inv;\r\n double fx = ljForceOverR * dx;\r\n double fy = ljForceOverR * dy;\r\n m1.ax += fx; // add this force on to i's acceleration (mass = 1)\r\n m1.ay += fy;\r\n m2.ax -= fx; // Newton's 3rd law reaction force\r\n m2.ay -= fy;\r\n potentialEnergy += 4 * r6inv * (r6inv - 1);\r\n potentialEnergy += LJ_CUTOFF_CORRECTION;\r\n return potentialEnergy;\r\n }", "private double d(Point a, Point b){\n\t\treturn Math.sqrt(Math.pow(b.getX()-a.getX(),2) + Math.pow(a.getY() - b.getY(), 2));\r\n\t}", "public double calcForceExertedBy(Planet p){\n\t\tdouble G = 6.67e-11;\n\t\tdouble r = this.calcDistance(p);\n\t\treturn G*mass*p.mass/(r*r);\n\t}", "public BigDecimal getMatchPODifference()\n\t{\n\t\tif (isDescription())\n\t\t\treturn Env.ZERO;\n\t\tBigDecimal retValue = getMovementQty();\n\t\tMMatchPO[] po = getMatchPO();\n\t\tfor (MMatchPO matchPO : po) {\n\t\t\tretValue = retValue.subtract (matchPO.getQty());\n\t\t}\n\t\tlog.finer(\"#\" + retValue);\n\t\treturn retValue;\n\t}", "public double getMass() { return modules.values().stream().mapToDouble(Module::getMass).sum(); }", "public double calcForceExertedBy(Planet p){\n\t\t\tdouble r = this.calcDistance(p);\n\n\t\treturn (G*this.mass*p.mass)/(r*r);\n\t}", "private double Distance(Point first, Point second){ // distance between two points \n\t\treturn Math.sqrt(Math.pow(second.getY()-first.getY(),2) + Math.pow(second.getX()-first.getX(),2));\n\t}", "public static long mass () { return mass;}", "public void calculateVelocity(Planet3D other) {\n\t\tVec3d temp = new Vec3d(other);\n\t\ttemp.sub(this);\n\t\tSystem.out.println(\"\\n[other]-[this]=[new dir] == [\"+other.x+\",\"+other.y+\",\"+other.z+\"]-[\"+this.x+\",\"+this.y+\",\"+this.z+\"]=[\"+temp.x+\",\"+temp.y+\",\"+temp.z+\"]\");\n\t\tdouble force=forceCalc(other.getMass(), temp.length());\n\t\ttemp.normalize();\n//\t\tSystem.out.println(\", and direction between is this:(\"+temp.x+\",\"+temp.y+\",\"+temp.z+\"),\\nthe other planet has a mass of \"+other.getMass());\n//\t\tSystem.out.println(\"the force added to the vector is:\"+(Math.abs(force)));\n\t\ttemp.mul(force);\t\n\t\tvelocity.sub(temp);\n\t\t\t\n\t}", "public void calculateMMage() {\n\t\t\n\t}", "@Override\r\n\tpublic double calculate() {\n\t\treturn n1 - n2;\r\n\t}", "public double calcForceExertedBy(Planet p){\n\t\tdouble distance = this.calcDistance(p);\n\t\treturn this.mass * p.mass * Planet.G / (distance* distance);\n\n\t}", "public abstract float getMass();", "public static double getDistance(GPSPosition first, GPSPosition second) {\n\t\tdouble distance = 0;\n\t\t\n\t\tdouble latitude_distance_in_radians = \n\t\t\t\tMath.toRadians(second.getLatitude() - first.getLatitude());\n\t\tdouble longitude_distance_in_radians = \n\t\t\t\tMath.toRadians(second.getLongitude() - first.getLongitude());\n\t\t// harvesin(d / R) = harvesin(lat1 - lat2) + cos(lat1) * cos(lat2) * harvesin(lng1 - lng2);\n\t\t// harvesin(angle) = sin(angle / 2) ^ 2;\n\t\t// d = 2 * R * arcsin(sqrt(harvesin));\n\t\tdouble harvesin_diff_lat = Math.pow(Math.sin(latitude_distance_in_radians / 2), 2);\n\t\tdouble harvesin_diff_lng = Math.pow(Math.sin(longitude_distance_in_radians / 2), 2);\n\t\tdouble cos_lat1 = Math.cos(Math.toRadians(first.getLatitude()));\n\t\tdouble cos_lat2 = Math.cos(Math.toRadians(second.getLatitude()));\n\t\tdouble harvesin = harvesin_diff_lat + cos_lat1 * cos_lat2 * harvesin_diff_lng;\n\n\t\tdistance = 2 * kEarthRadius * Math.atan2(Math.sqrt(harvesin), Math.sqrt(1 - harvesin));\n\t\treturn distance;\n\t}", "public double molarMass(){\n double c = comp.getCarbon()* PhysicalProperties.MOLARMASS_C;\n double h = comp.getHydrogen()* PhysicalProperties.MOLARMASS_H;\n double o = comp.getOxygen()* PhysicalProperties.MOLARMASS_O;\n double s = comp.getSulfur()* PhysicalProperties.MMOLARMASS_S;\n double n = comp.getNitrogen()* PhysicalProperties.MOLARMASS_N;\n return c + h + o + s + n;\n }", "double Q(DoubleMatrix1D pt1, DoubleMatrix1D pt2, DoubleMatrix1D scale){\n DoubleMatrix1D diff = pt2.copy().assign(pt1,Functions.minus);\n\n //ok now we just need a standard normal probability\n //total probability is product of single-variable probabiliies\n double prob = 1;\n for(int dof=0; dof<numDOFs; dof++){\n double v = diff.get(dof)/scale.get(dof);\n prob *= Math.exp(-v*v/2);//standard normal probability, unnormalized\n }\n \n return prob;\n }", "public double berechneFlaeche()\n {\n return (2 * p1.getX()) * (2 * p1.getX());\n }", "public double getBurntFuelMass();", "protected double getMPS() {\n\t\t\treturn this.getCost() / this.castPeriod;\n\t\t}", "public void prinRecaudacion()\n {\n System.out.println(\"La cantidad recaudada por la maquina1 es \" + maquina1.getTotal());\n System.out.println(\"La cantidad recaudada por la maquina2 es \" + maquina2.getTotal());\n System.out.println(\"La cantidad total es\" + ( maquina1.getTotal() + maquina2.getTotal()));\n}", "public double calcForceExertedBy(Planet p){\n final double G = 6.67e-11;\n double force = (G * p.mass * mass)/(this.calcDistance(p)* this.calcDistance(p));\n return force;\n }", "private double dist(Integer unit1, Integer unit2, StateView newstate) {\n\t\t//Creating two arrays of size 2 to store the position of the 2 units\n\t\tint[] pos1 = new int[2];\n\t\tint[] pos2 = new int[2];\n\t\t//Extracting the positional data\n\t\tpos1[0] = newstate.getUnit(unit1).getXPosition();\n\t\tpos1[1] = newstate.getUnit(unit1).getYPosition();\n\t\tpos2[0] = newstate.getUnit(unit2).getXPosition();\n\t\tpos2[1] = newstate.getUnit(unit2).getYPosition();\n\t\t//Calculating the distance\n\t\tdouble dx = Math.abs(pos1[0] - pos2[0]);\n\t\tdouble dy = Math.abs(pos1[1] - pos2[1]);\n\t\tdouble distance = Math.sqrt(Math.pow(dx, 2.0) + Math.pow(dy, 2.0));\n\t\treturn distance;\n\t}", "public double calcForceExertedBy(Planet p){\n\t\treturn (constantG*this.mass*p.mass\n\t\t\t/(this.calcDistance(p)*this.calcDistance(p)));\n\t}", "@Override\n\tpublic double subtract(double in1, double in2) {\n\t\treturn 0;\n\t}", "public double distance(Point p){\n\t\treturn (this.minus(p)).magnitude(); //creates a vector between the two points and measures its magnitude\n\t}", "public abstract double distance(AbstractPoisson o2);", "@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}", "public double getVelocityRPM();", "public Double getMass() {\n return mass;\n }", "public double getDifference()\n {\n return first - second;\n }", "public void collisionPhsysics (Body otherBody) {\n if (this.mass <= otherBody.mass) {\n this.merged = true;\n otherBody.mass += this.mass;\n this.x = 0;\n this.y = 0;\n this.temp_x = 0;\n this.temp_y = 0;\n }\n else {\n otherBody.merged = true;\n this.mass += otherBody.mass;\n otherBody.x = 0;\n otherBody.y = 0;\n otherBody.temp_x = 0;\n otherBody.temp_y = 0;\n }\n\n // momentum transfer\n if (this.mass <= otherBody.mass) {\n otherBody.vx = (this.mass*this.vx + otherBody.mass*otherBody.vx)/(this.mass + otherBody.mass);\n otherBody.vy = (this.mass*this.vy + otherBody.mass*otherBody.vy)/(this.mass + otherBody.mass);\n }\n else {\n this.vx = (this.mass*this.vx + otherBody.mass*otherBody.vx)/(this.mass + otherBody.mass);\n this.vy = (this.mass*this.vy + otherBody.mass*otherBody.vy)/(this.mass + otherBody.mass);\n }\n\n\n }", "public static double diff() {\n System.out.println(\"Enter minuend\");\n double a = getNumber();\n System.out.println(\"Enter subtrahend\");\n double b = getNumber();\n\n return a - b;\n }", "public Double getCpm() {\n return cpm;\n }", "@Override\r\n\tpublic double calculate() {\n\t\treturn n1 * n2;\r\n\t}", "public double get_yMas()\r\n {\r\n return yMas;\r\n }", "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}", "private double lPDistance(Instance one, Instance two, int p_value) {\n\n double distanceSum = 0;\n\n for (int i = 0; i < one.numAttributes() - 1; i++) {\n distanceSum += Math.pow(Math.abs(one.value(i) - two.value(i)), p_value);\n }\n\n distanceSum = Math.pow(distanceSum, 1.0 / p_value); // Root in base P\n\n return distanceSum;\n\n }", "public double getMass() {\n return mass;\n }", "public double getMass() {\n return mass;\n }", "double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\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 double Dist(Tumor other) {\r\n\t\t// Initializes a double for the square of the distance\r\n\t\tdouble distSquared = 0;\r\n\t\t// For loop to run through the characteristics arrays running the \r\n\t\t// Pythagorean Theorem for all the characteristics\r\n\t\tfor (int i = 0; i < this.characteristics.length; i++) {\r\n\t\t\t// Adds onto the distSquared double the square of the difference\r\n\t\t\t// between the two characteristics\r\n\t\t\tdistSquared += (Math.pow(this.characteristics[i] - \r\n\t\t\t\tother.getCharacteristics()[i], 2));\r\n\t\t} // End of for loop to run through characteristics array and doing\r\n\t\t // Pythagorean Theorem for the characteristics\r\n\t\t// Takes the square root of distSquared and returns it\r\n\t\treturn Math.sqrt(distSquared);\r\n\t}", "public Unit<Dimensionless> ppm() {return ppm;}", "public static UnitP Multiplication(double first, UnitP second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Multiplication,\n OperationsOther.GetOperationString(first, second, Operations.Multiplication)\n );\n }", "public double getMass(double mz) {\n return ((mz * this.getAbsCharge()) - this.getMass());\n }", "private double getDirectionalMomentum(double direction)\n\t{\n\t\t// P = m * v\n\t\treturn getMass() * getMovement().getDirectionalSpeed(direction);\n\t}", "public double permutasi(double num1, double num2){\n if (num1<num2||(num1<0&&num2<0)) {\n System.out.println(\"bilangan tidak benar\");\n return 0;\n }\n return faktorial(num1)/faktorial(num1-num2);\n }", "protected final double getModMassDiff(char modChar, BigDecimal mass, boolean subtractStatic) {\n double massDiff = mass.doubleValue() - getMonoAAMass(modChar); // AminoAcidUtils.monoMass(modChar);\n \n if(massDiff == mass.doubleValue()) {\n \t// If massDiff is the same as mass it means we did not find mass for this amino acid\n \t// This can happen for non-standard amino acids\n \t// We will log a warning\n \tlog.warn(\"No mass found for amino acid: \"+modChar);\n }\n // if this is amino acid has a static modification, subtract that \n // A residue could have both static and dynamic modifications(??)\n if(subtractStatic) {\n BigDecimal staticModMass = staticModMap.get(modChar);\n if(staticModMass != null) {\n massDiff -= staticModMass.doubleValue();\n }\n }\n return massDiff;\n }", "private double calculateDistance(Example first, Example second) {\n\t\tdouble distance = 0;\n\t\tfor (Attribute attribute : first.getAttributes()) {\n\t\t\tdouble diff = first.getValue(attribute) - second.getValue(attribute);\n\t\t\tdistance += diff * diff;\n\t\t}\n\t\treturn Math.sqrt(distance);\n\t}", "public double getMagnitud(){\n return Math.sqrt(x*x+y*y);\n }", "public String converterMassa(Medidas medidaUm, Medidas medidaDois) {\n String medidaUmUnidade = medidaUm.getUnidadeDeMassa();\n String medidaDoisUnidade = medidaDois.getUnidadeDeMassa();\n boolean unidadesIguais = medidaUmUnidade.equals(medidaDoisUnidade) ? true : false;\n String errorMessage = \"Não é possível realizar a conversão, pois as duas medidas já estão na mesma unidade.\";\n\n if (unidadesIguais)\n return errorMessage;\n else {\n double medidaUmMassaNova = (medidaUmUnidade == \"lb\") ? (medidaUm.getMassa() / 2.2046)\n : (medidaUm.getMassa() * 2.2046);\n medidaUm.setMassa(medidaUmMassaNova);\n String medidaUmUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaUm.setUnidadeDeMassa(medidaUmUnidadeDeMassaNova);\n\n double medidaDoisMassaNova = (medidaDoisUnidade == \"lb\") ? (medidaDois.getMassa() / 2.2046)\n : (medidaDois.getMassa() * 2.2046);\n medidaDois.setMassa(medidaDoisMassaNova);\n String medidaDoisUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaDois.setUnidadeDeMassa(medidaDoisUnidadeDeMassaNova);\n }\n\n String medidaUmConvertida = medidaUm.getMassa() + \" \" + medidaUm.getUnidadeDeMassa();\n String medidaDoisConvertida = medidaDois.getMassa() + \" \" + medidaDois.getUnidadeDeMassa();\n\n return (\"Massa 01: \" + medidaUmConvertida + \" | \" + \"Massa 02: \" + medidaDoisConvertida);\n }", "private static double calculaDistancia(double[] param1, double[] param2){\n\t\tdouble res1= Math.pow((param1[0]-param2[0]), 2);\n\t\tdouble res2= Math.pow((param1[1]-param2[1]), 2);\n\t\tdouble res3= Math.pow((param1[2]-param2[2]), 2);\n\t\tdouble res4= res1 + res2 + res3;\n\t\tdouble res5= res4/3;\n\t\tdouble res6= Math.sqrt(res5);\n\t\treturn res6;\n\t}", "public int differencePoints(){\n return player1Score - player2Score;\n }", "public double m2() {\n\t\treturn (this.e() * this.e() - this.vector.mag2());\n\t}", "public static double mahnattan(InputSpacePoint a , InputSpacePoint b) {\n double sum = 0.0;\n for(String s : a.getKeysAsCollection()) {\n sum += Math.abs(a.getValue(s) - b.getValue(s));\n }\n return sum;\n }", "public void diffuse() {\r\n\t\tdouble[][][] before = quantity;\r\n\t\t/* Index of the box in positive (negative) .. direction, taking account of the boundary conditions */\r\n\t\tint xAbove, xBelow, yAbove, yBelow, zAbove, zBelow;\r\n\t\t/* Quantity of chemical leaving the box in the positive (negative) .. direction */\r\n\t\tdouble qxAbove, qxBelow, qyAbove, qyBelow, qzAbove, qzBelow;\r\n\t\t/* Flags for leakiness at borders */\r\n\t\tboolean leaky[] = sim.getLeaky();\r\n\t\tdouble leakyRate[] = sim.getLeakyRate();\r\n\t\t/*\r\n\t\t * Flux of molecules crossing in the positive x-direction (Fick's law)\r\n\t\t * \tJ = -D(dC/dx) = -D*(C(x+dx)-C(x))/dx = -D*(N(x+dx)-N(x))/((dx)^2*dy*dz) molecules/(micron)^2/sec\r\n\t\t * Number of molecules transferred in the positive x-direction over dt\r\n\t\t * \txAbove = J*(dy*dz)*dt = -((D*dt)/(dx)^2)*(N(x+dx)-N(x)) = -kX*(N(x+dx)-N(x))\r\n\t\t * where kX = (D*dt)/(dx)^2 is a dimensionless constant\r\n\t\t */\r\n\t\tdouble normX = sim.getDt()/Math.pow(box[0],2);\r\n\t\tdouble normY = sim.getDt()/Math.pow(box[1],2);\r\n\t\tdouble normZ = sim.getDt()/Math.pow(box[2],2);\r\n\t\tdouble kX = diffusivity*normX;\r\n\t\tdouble kY = diffusivity*normY;\r\n\t\tdouble kZ = diffusivity*normZ;\r\n\t\tfor(int i=0;i<boxes[0];i++)\r\n\t\t\tfor(int j=0;j<boxes[1];j++)\r\n\t\t\t\tfor(int k=0;k<boxes[2];k++) {\t\r\n\t\t\t\t\t/* Is this box the last box? \r\n\t\t\t\t\t * \tIf so, is the boundary solid? If so, there is no box above, else, the box 'above' is the first box\r\n\t\t\t\t\t * \tElse, the box above is the next box */\r\n\t\t\t\t\txAbove = (i == boxes[0]-1 ? (sim.getSolid()[0] ? -1 : 0) : i+1);\r\n\t\t\t\t\txBelow = (i == 0 ? (sim.getSolid()[0] ? -1 : boxes[0]-1) : i-1);\r\n\t\t\t\t\tyAbove = (j == boxes[1]-1 ? (sim.getSolid()[1] ? -1 : 0) : j+1);\r\n\t\t\t\t\tyBelow = (j == 0 ? (sim.getSolid()[1] ? -1 : boxes[1]-1) : j-1);\r\n\t\t\t\t\tzAbove = (k == boxes[2]-1 ? (sim.getSolid()[2] ? -1 : 0) : k+1);\r\n\t\t\t\t\tzBelow = (k == 0 ? (sim.getSolid()[2] ? -1 : boxes[2]-1) : k-1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(xAbove != -1) {\r\n\t\t\t\t\t\t/* Calculate the quantity of chemical leaving the box in this direction */\r\n\t\t\t\t\t\tqxAbove = -kX*(before[xAbove][j][k]-before[i][j][k]);\r\n\t\t\t\t\t\t/* Add that quantity to the box above */ \r\n\t\t\t\t\t\tquantity[xAbove][j][k] += qxAbove;\r\n\t\t\t\t\t\t/* Remove it from this box */\r\n\t\t\t\t\t\tquantity[i][j][k] -= qxAbove;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[0]) {\r\n\t\t\t\t\t\t\t/* Calculate the quantity of chemical leaving the box in this direction (0 outside box if leaky)*/\r\n\t\t\t\t\t\t\tqxAbove = normX*leakyRate[0]*before[i][j][k];\r\n\t\t\t\t\t\t\t/* Remove it from this box */\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qxAbove;\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\tif(xBelow != -1) {\r\n\t\t\t\t\t\tqxBelow = -kX*(before[xBelow][j][k]-before[i][j][k]);\r\n\t\t\t\t\t\tquantity[xBelow][j][k] += qxBelow;\r\n\t\t\t\t\t\tquantity[i][j][k] -= qxBelow;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[1]) {\r\n\t\t\t\t\t\t\tqxBelow = normX*leakyRate[1]*before[i][j][k];\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qxBelow;\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\tif(yAbove != -1) {\r\n\t\t\t\t\t\tqyAbove = -kY*(before[i][yAbove][k]-before[i][j][k]);\r\n\t\t\t\t\t\tquantity[i][yAbove][k] += qyAbove;\r\n\t\t\t\t\t\tquantity[i][j][k] -= qyAbove;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[2]) {\r\n\t\t\t\t\t\t\tqyAbove = normY*leakyRate[2]*before[i][j][k];\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qyAbove;\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\tif(yBelow != -1) {\r\n\t\t\t\t\t\tqyBelow = -kY*(before[i][yBelow][k]-before[i][j][k]);\r\n\t\t\t\t\t\tquantity[i][yBelow][k] += qyBelow;\r\n\t\t\t\t\t\tquantity[i][j][k] -= qyBelow;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[3]) {\r\n\t\t\t\t\t\t\tqyBelow = normY*leakyRate[3]*before[i][j][k];\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qyBelow;\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\tif(zAbove != -1) {\r\n\t\t\t\t\t\tqzAbove = -kZ*(before[i][j][zAbove]-before[i][j][k]);\r\n\t\t\t\t\t\tquantity[i][j][zAbove] += qzAbove;\r\n\t\t\t\t\t\tquantity[i][j][k] -= qzAbove;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[4]) {\r\n\t\t\t\t\t\t\tqzAbove = normZ*leakyRate[4]*before[i][j][k];\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qzAbove;\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\tif(zBelow != -1) {\r\n\t\t\t\t\t\tqzBelow = -kZ*(before[i][j][zBelow]-before[i][j][k]);\r\n\t\t\t\t\t\tquantity[i][j][zBelow] += qzBelow;\r\n\t\t\t\t\t\tquantity[i][j][k] -= qzBelow;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (leaky[3]) {\r\n\t\t\t\t\t\t\tqzBelow = normZ*leakyRate[5]*before[i][j][k];\r\n\t\t\t\t\t\t\tquantity[i][j][k] -= qzBelow;\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}\r\n\t}", "double distance(Point p1,Point p2){\n\t\tdouble dx = p1.x - p2.x;\n\t\tdouble dy = p1.y - p2.y;\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "private static double getDistance(Point r_p1, Point r_p2, Point s_p1, Point s_p2, long time){\n\t\t// get the factors\n\t\tdouble a = getA(r_p1, r_p2, s_p1, s_p2);\n\t\tdouble b = getB(r_p1, r_p2, s_p1, s_p2);\n\t\tdouble c = getC(r_p1, r_p2, s_p1, s_p2);\n\t\t\n\t\tdouble dist = Math.sqrt(a*Math.pow(time, 2) + b*time + c);\n\t\t\n\t\treturn dist;\n\t}", "public double getProduct()\n {\n return first * second;\n }", "public double getMass()\n\t{\n\t\treturn this.mass;\n\t}", "public MassData getMassData () {\n\t\tbody.getMassData(massData2);\n\t\tmassData.center.set(massData2.center.x, massData2.center.y);\n\t\tmassData.I = massData2.I;\n\t\tmassData.mass = massData2.mass;\n\t\treturn massData;\n\t}", "double getActualKm();", "protected double getHPM() {\n\t\t\treturn this.getHealing() / this.getCost();\n\t\t}", "public Momentum() {\r\n m1 = m2 = v1 = v2 = p1 = p2 = comx = cv = 0.0;\r\n xp1 = 0.0;\r\n xp2 = 900.0;\r\n m1 = 2.0;\r\n m2 = 1.0;\r\n v1 = 1.0;\r\n v2 = -1.0;\r\n\r\n //m1 = m2 = 1.0;\r\n //v1 = 2.0;\r\n //v2 = -4.0;\r\n d = dc = 8.0;\r\n }", "public float getMass() {\n return mass;\n }", "@Test\n\tpublic void perpVector3D() {\n\t\tVector3f v1 = new Vector3f(this.random.nextDouble(), this.random.nextDouble(), this.random.nextDouble());\n\t\tVector3f v2 = new Vector3f(this.random.nextDouble(), this.random.nextDouble(), this.random.nextDouble());\n\t\t\n\t\tdouble dotProduct = v1.dot(v2);\n\t\tdouble perpProduct = Math.abs(v1.perp(v2));\n\t\tdouble angle = v1.angle(v2);\n\t\t\n\t\tassertEpsilonEquals(Math.tan(angle),perpProduct/dotProduct);\n\t\t\n\t}", "@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}", "public static UnitP Multiplication(UnitP first, double second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Multiplication, \n OperationsOther.GetOperationString(first, second, Operations.Multiplication)\n );\n }", "public abstract Vector2 getCentreOfMass();", "public static double absoluteDistance(Prototype one, Prototype two)\r\n {\r\n double[] oneInputs = one.getInputs();\r\n double[] twoInputs = two.getInputs();\r\n //int _size = one.numberOfInputs();\r\n double acc = 0.0;\r\n for (int i = 0; i < numberOfInputs; ++i)\r\n {\r\n acc += Math.abs(oneInputs[i] - twoInputs[i]);\r\n }\r\n\r\n return acc;\r\n }", "@Override\n public double getMass() {\n return 0;\n }", "private double calcDotProduct(Point2D.Double a, Point2D.Double b)\n\t{\t\n\t\treturn (a.getX() * b.getX()) + (a.getY() * b.getY());\n\t}", "public double calculateValue () {\n return double1 * double2;\n }", "@Override\r\n\tprotected double operate(double d1, double d2) {\n\t\tSystem.out.println(\"减法求值\");\r\n\t\treturn d1-d2;\r\n\t}", "double V2Dot(Position a, Position b){\r\n\t\treturn((a.getX() * b.getX())+(a.getY() * b.getY()));\r\n\t}", "protected double getDistance(Point p1, Point p2) {\n\t\treturn Math.sqrt((p1.getX()-p2.getX())*(p1.getX()-p2.getX()) + (p1.getY()-p2.getY())*(p1.getY()-p2.getY())); \n\t}", "private static Vector3f[] calculatePositionDifferences(Drone drone, Vector3f[] newVelocities, float dt) {\r\n\r\n\t\t\r\n\t\t// calculate the average linear velocity\r\n\t\tVector3f avgLinearVelocityW = average(drone.getLinearVelocity(), newVelocities[0]);\r\n\r\n\t\t// calculate the translation\r\n\t\tVector3f deltaPositionW = (Vector3f) avgLinearVelocityW.scale(dt);\r\n\r\n\t\t// calculate the average angular velocity\r\n\t\tVector3f avgAngularVelocityW = average(drone.getAngularVelocity(), newVelocities[1]);\r\n\r\n\t\t// calculate the rotation\r\n\t\tVector3f deltarotationW = ((Vector3f) avgAngularVelocityW.scale(dt));\r\n\r\n\t\treturn new Vector3f[] { deltaPositionW, deltarotationW };\r\n\t}", "public void multiply(Polynomial p1) {\n\t\tPolynomial p=new Polynomial();\r\n\t\t// taking 2 loops to multiply the coeff and storing it in this newly created polnomial\r\n\t\tfor(int i=0;i<p1.DynArray.length;i++) {\r\n\t\t\tfor(int j=0;j<this.DynArray.length;j++) {\r\n\t\t\t\t// checking if degree is smaller to initial degree then storing\r\n\t\t\t\tif(i + j <=p.degree)\r\n\t\t\t\t\tp.setDegreeCoefficient( i + j ,p.DynArray[i+j]+p1.DynArray[i] * this.DynArray[j]);\r\n\t\t\t\telse\r\n\t\t\t\t\t// otherwise we'll not have anythig there to add so just putting multiply result\r\n\t\t\t\t\t// this is similar step just like u do in maths multiplication\r\n\t\t\t\t\tp.setDegreeCoefficient(i + j ,p1.DynArray[i] * this.DynArray[j]);\r\n\t\t\t}\r\n\t\t}\r\n//\t\t// p2 -> this\r\n//\t\tint[] updatedArr = new int[10];\r\n//\t\t\r\n//\t\tfor(int i = 0; i < this.DynArray.length; i++) {\r\n//\t\t\tint[] temp = new int[10];\r\n//\t\t\tfor(int j = 0 ; j < p1.DynArray.length; j++) {\r\n//\t\t\t\tint index = i+j;\r\n//\t\t\t\ttemp[index] = this.DynArray[i]*p1.DynArray[j];\r\n//\t\t\t}\r\n//\t\t\t// adding empty arr/ updatedArr and temp arr\r\n//\t\t\tfor(int j = 0 ; j <temp.length; j++) {\r\n//\t \t\t\tupdatedArr[j] = updatedArr[j] + temp[j];\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\t\r\n//\t\t// coping all elements from updatedArr to p2/ this\r\n//\t\tfor(int i=0;i<updatedArr.length;i++) {\r\n//\t\t\tthis.DynArray[i] = updatedArr[i];\r\n//\t\t}\r\n\t}", "public double calculateObservedDisagreement();", "public double getMass() {\n\t\treturn _mass;\n\t}", "private int[] calculateMomentum(byte state){\n //pull out each particle.\n\n //each particle has an x and y momentum based on its direction\n //1 x = 1, y = 0\n //2 x = cos(pi/3), y = sin(pi/3)\n //3 x = cos(2pi/3), y = sin(2pi/3)\n //4 x = -1, y = 0\n //5 x = cos(4pi/3), y = sin(4pi/3)\n //6 x = cos(5pi/3), y = sin(5pi/3)\n\n\n// double x = 0.0;\n// double y = 0.0;\n//\n// double arg = 0.0;\n// for(int n = 0; n < SMASKS.length; n++){\n// if((incomingState & SMASKS[n]) == SMASKS[n]){\n// arg = (n*Math.PI)/3;\n// x += BigDecimal.valueOf(Math.cos(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// y += BigDecimal.valueOf(Math.sin(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// }\n// }\n// return new double[]{x, y};\n\n //each particle has an x and y momentum based on its direction\n //1 x = 100, y = 0000\n //2 x = 050, y = 087\n //3 x = -050, y = 087\n //4 x = -100, y = 000\n //5 x = -050, y = -087\n //6 x = 050, y = -087\n\n int x = 0;\n int y = 0;\n\n for(int n = 0; n < SMASKS.length; n++){\n if((state & SMASKS[n]) == SMASKS[n]){\n x += xm[n];\n y += ym[n];\n }\n }\n return new int[]{x, y};\n }", "public static double d(Prototype one, Prototype two)\r\n {\r\n return Math.sqrt(squaredEuclideanDistance(one, two));\r\n }", "private Vector3f getOrbitalVelocity(CelestialEntity entity1, CelestialEntity entity2) {\r\n\t\tVector3f p1 = entity1.getPosition();\r\n\t\tVector3f p2 = entity2.getPosition();\r\n\t\tfloat m1 = entity1.getMass();\r\n\t\tfloat m2 = entity2.getMass();\r\n\t\tVector3f r = Vector3f.sub(p2, p1);\r\n\t\t\r\n\t\tVector3f velocity = new Vector3f();\r\n\t\t// Perpendicular vector in the x-z plane\r\n\t\tvelocity.x = -r.z;\r\n\t\tvelocity.z = r.x;\r\n\t\t// Calculate velocity magnitude (speed)\r\n\t\tdouble distance = r.magnitude();\r\n\t\tdouble speed = Math.sqrt(Constants.G * (m1 + m2) / distance);\r\n\t\tvelocity.setMagnitude((float) speed);\r\n\t\t\r\n\t\treturn velocity;\r\n\t}", "public double calculateChangeToGive() {\r\n\t\treturn amountPaid - amountToPay;\r\n\t}", "public Deplacement getProchainMouvement();", "private static double calcError(Instances data, Instances data2) {\n\t\t// calculate the total l1 norm of the class values of the two data sets \n\t\tdouble error = 0;\n\t\tfor (int i=0; i < data.numInstances(); ++i) {\n\t\t\terror += Math.abs(data.instance(i).classValue() - data2.instance(i).classValue());\t\t\t\n\t\t}\n\t\treturn error;\n\t}", "double dist(pair p1){\n\t\tdouble dx=(p1.x-centre.x);\n\t\tdouble dy=(p1.y-centre.y);\n\t\tcount++;\n\t\treturn java.lang.Math.sqrt((dx*dx)+(dy*dy));\n\t}", "public PVector calcGravForce (ShiffmanShip ship) {\n // -----MOUSE CONTROL-------\n //PVector mouse = new PVector(mouseX, mouseY);\n //PVector force = PVector.sub(mouse,love.getLoc()); // get distance and magnitude PVector then \n // regular center located mass\n PVector force = PVector.sub(loc,ship.getLoc()); // get distance and magnitude PVector then \n float distance = force.mag();\n distance = constrain(distance,5.0f,25.0f);\n float gravityStrength = (G * mass * ship.getMass()) / (distance * distance);\n force.normalize();\n force.mult(gravityStrength);\n return force;\n }", "public double mod() \n\t{\n if (x!=0 || y!=0) {\n return Math.sqrt(x*x+y*y); //distance formular\n } else {\n return 0.0D;\n }\n }", "public double distancia2(GPS a2,GPS a3){\n return this.distancia(a2)+a2.distancia(a3);\n }", "public Mensaje calculate (){\n Mensaje msg2 = new Mensaje(((double)this.valor * (double)this.porcentaje / 100) + ((double)this.peso * 0.15));\n return msg2;\n }" ]
[ "0.58917284", "0.58411735", "0.58348024", "0.5755608", "0.57011175", "0.5668106", "0.5631191", "0.5610723", "0.5495688", "0.5410227", "0.5378318", "0.5375232", "0.53535205", "0.53382725", "0.53336984", "0.53312784", "0.5330097", "0.5327048", "0.5317741", "0.53171057", "0.5310209", "0.53085536", "0.5289354", "0.5282587", "0.524098", "0.5238447", "0.5198404", "0.51912147", "0.5188754", "0.5185834", "0.51692307", "0.516466", "0.51554936", "0.51497686", "0.5149204", "0.5132594", "0.5121553", "0.51214343", "0.5103531", "0.5084911", "0.5082384", "0.50740135", "0.5063065", "0.50615346", "0.5049278", "0.50363845", "0.5034899", "0.5034899", "0.5031882", "0.5015784", "0.501484", "0.5009403", "0.500435", "0.4998615", "0.49871138", "0.49861673", "0.49786395", "0.49758393", "0.4974648", "0.49733394", "0.4973133", "0.4971647", "0.49684703", "0.49619833", "0.49609867", "0.4958635", "0.4956606", "0.4954219", "0.49520198", "0.49516726", "0.4949015", "0.49486503", "0.492904", "0.49240664", "0.4923661", "0.4919452", "0.4919273", "0.49180934", "0.4910163", "0.4909332", "0.4908293", "0.4907386", "0.4906303", "0.49010718", "0.4898001", "0.48941457", "0.48936045", "0.48927063", "0.48925465", "0.4886761", "0.48865968", "0.48862094", "0.4881457", "0.48813397", "0.4878451", "0.4866342", "0.4865845", "0.48653445", "0.48632225", "0.48607656" ]
0.6927625
0
Find the minimum value of a range needed to search based on a precursor mass
public Double findMinPPMRange(Double mass, Double ppm) { return (mass - ((ppm/1000000.0)*mass)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Double findMinMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass - mzTol);\n\t}", "double getMin();", "double getMin();", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public T findMin();", "public PrimEdge calculateMinimum() {\n int minWage = Integer.MAX_VALUE;\n PrimEdge result = null;\n for (Map.Entry<Integer, PrimEdge> entry : dtable.entrySet()) {\n if (entry.getValue().getWage() < minWage) {\n result = entry.getValue();\n minWage = entry.getValue().getWage();\n }\n }\n return result;\n }", "private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "int getXMin();", "Double getMinimumValue();", "java.math.BigDecimal getWagerMinimum();", "int getMin( int min );", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "E minVal();", "public int findMin() {\r\n\t\treturn this.min.value;\r\n\t}", "float xMin();", "public int findMin() {\n\t\tint min = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ((int)data.get(count) < min)\n\t\t\t\tmin = (int)data.get(count);\n\t\treturn min;\n\t}", "public abstract int getMinimumValue();", "private float getMinX(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float minX = Float.POSITIVE_INFINITY;\n for (float [] point : points) {\n minX = Math.min(minX, point [0]);\n } \n return minX;\n }", "public double getMinRange() {\n return minRange;\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "public void minimum()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tif(rowTick[i]==8888)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(columnTick[j]==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cost[i][j]<min)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin=cost[i][j];\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}", "private static int findMin(int startPos,int[] x){\n\t\tint result = startPos;\n\t\tfor(int i= startPos;i<x.length;i++){\n\t\t\tif(x[i]<x[result]){\n\t\t\t\tresult = i;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "double getLeft(double min);", "static int findMin(int[] nums) {\r\n \r\n // **** sanity check(s) ****\r\n if (nums.length == 1)\r\n return nums[0];\r\n\r\n // **** initialization ****\r\n int left = 0;\r\n int right = nums.length - 1;\r\n\r\n // **** check if there is no rotation ****\r\n if (nums[right] > nums[left])\r\n return nums[left];\r\n\r\n // **** binary search approach ****\r\n while (left < right) {\r\n\r\n // **** compute mid point ****\r\n int mid = left + (right - left) / 2;\r\n\r\n // **** check if we found min ****\r\n if (nums[mid] > nums[mid + 1])\r\n return nums[mid + 1];\r\n\r\n if (nums[mid - 1] > nums[mid])\r\n return nums[mid];\r\n\r\n // **** decide which way to go ****\r\n if (nums[mid] > nums[0])\r\n left = mid + 1; // go right\r\n else\r\n right = mid - 1; // go left\r\n }\r\n\r\n // **** min not found (needed to keep the compiler happy) ****\r\n return 69696969;\r\n }", "int findMin(int[] arr){\n\t\tint minimum=1000;\n\t\tfor (int i=0; i<arr.length; i++) {\n\t\t\tif (arr[i]<minimum) {\n\t\t\t\tminimum=arr[i];\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "public double minXp(){\n\t\tmin = xp[0];\n\t\tfor(int i=1;i<xp.length;i++){\n\t\t\tif(xp[i]<min){\n\t\t\t\tmin=xp[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "public Money findMinPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney min = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (min.compareTo(current) == 1 || !flag) {\n\t\t\t\tmin = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t }\n\t\t}\n\t\treturn min;\n\t}", "org.apache.xmlbeans.XmlDecimal xgetWagerMinimum();", "int min();", "protected ValuePosition getMinimum() {\n\t\t// Calcule la position et la durée d'exécution de la requête la plus courte dans le tableau des requêtes\n\t\tValuePosition minimum = new ValuePosition();\n\t\tminimum.position = 0;\n\t\tfor(int pos=0; pos<requests.length; pos++) {\n\t\t\tRequest request = requests[pos];\n\t\t\tif(request == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minimum.value == null || request.getElapsedTime() < minimum.value) {\n\t\t\t\tminimum.position = pos;\n\t\t\t\tminimum.value = request.getElapsedTime();\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "public int findLeast() {\r\n\tint cor = 0;\r\n\tint x = 9;\r\n\tfor (int r = 0; r < 9; r++) {\r\n\t for (int c = 0; c < 9; c++) {\r\n\t\tif (!board[r][c].getIsDef()) {\r\n\t\t if (board[r][c].getNumPossible() == 2) {\r\n\t\t\treturn r*10 + c;\r\n\t\t }\r\n\t\t if (board[r][c].getNumPossible() < x) {\r\n\t\t\tcor = r*10 + c;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n\treturn cor;\r\n }", "public static int getMin(ArrayList<QuoteShort> data, int begin, int end) {\n\t\tint min = 999999999;\r\n\t\tint minIndex = -1;\r\n\t\tif (begin<=0) begin = 0;\r\n\t\tfor (int i=begin;i<=end;i++){\r\n\t\t\tif (data.get(i).getHigh5()<=min){\r\n\t\t\t\tmin = data.get(i).getLow5();\r\n\t\t\t\tminIndex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn minIndex;\r\n\t}", "java.math.BigDecimal getSingleBetMinimum();", "public final boolean searchMinimum(){\r\n\t\tif (!initialized()) minimum=true;\r\n\t\treturn minimum;\r\n\t}", "public int getMinimun(){\n int lowGrade = grades[0]; //assume que grades[0] é a menor nota\n \n //faz um loop pelo array de notas\n for(int grade: grades){\n //se nota for mais baixa que lowGrade, essa note é atribuida a lowGrade\n if(grade < lowGrade){\n lowGrade = grade;\n }\n }\n \n return lowGrade;\n }", "public int findMin(int[] num) {\n \t\n \tif (num.length == 1) {\n \t return num[0];\n \t}\n \t\n \tint up = num.length - 1,\n \t low = 0,\n \t mid = (up + low) / 2;\n \twhile (up > low) {\n \t if (mid + 1 < num.length && mid - 1 >= 0 && num[mid] < num[mid - 1] && num[mid] < num[mid + 1]) {\n \t return num[mid];\n \t }\n \t if (num[mid] > num[up]) {\n \t low = mid + 1;\n \t } else {\n \t up = mid - 1;\n \t }\n \t \n \t mid = (up + low) / 2;\n \t}\n \treturn num[mid];\n\t}", "private double getMinNumber(ArrayList<Double> provinceValues)\n {\n Double min = 999999999.0;\n\n for (Double type : provinceValues)\n {\n if (type < min)\n {\n min = type;\n }\n }\n return min;\n }", "public double min() {\n/* 305 */ Preconditions.checkState((this.count != 0L));\n/* 306 */ return this.min;\n/* */ }", "Coordinate getMinX();", "private int smallestF(){\r\n int smallest = 100000;\r\n int smallestIndex = 0;\r\n int size = _openSet.size();\r\n for(int i=0;i<size;i++){\r\n int thisF = _map.get_grid(_openSet.get(i)).get_Fnum();\r\n if(thisF < smallest){\r\n smallest = thisF;\r\n smallestIndex = i;\r\n }\r\n }\r\n return smallestIndex;\r\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "public int GetMinVal();", "public void setMinAmount(int min) {\n _min = min;\n }", "public float getminP() {\n Reading minPressureReading = null;\n float minPressure = 0;\n if (readings.size() >= 1) {\n minPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure < minPressure) {\n minPressure = readings.get(i).pressure;\n }\n }\n } else {\n minPressure = 0;\n }\n return minPressure;\n }", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "private StreamEvent findIfActualMin(AttributeDetails latestEvent) {\n int indexCurrentMin = valueStack.indexOf(currentMin);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMin;\n // If latest event is at a distance greater than maxPostBound from min, min is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMin.notEligibleForRealMin();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", 0, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMin.getValue() + currentMin.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMin - preBound >= 0) {\n if (valueStack.get(indexCurrentMin - preBound).getValue() >= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", preBound, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore min is not eligible to be sent as output.\n currentMin.notEligibleForRealMin();\n return null;\n }", "public double obterXmin() {\n\t\treturn xmin;\n\t}", "static int findMin(double[] pq)\n\t{\n\t\tint ind = -1; \n\t\tfor (int i = 0; i < pq.length; ++i)\n\t\t\tif (pq[i] >= 0 && (ind == -1 || pq[i] < pq[ind]))\n\t\t\t\tind = i;\n\t\treturn ind;\n\t}", "public double getMinimumDistance() { return minDistance; }", "public static int findPosMin(List<Integer> values, int start) {\r\n int bestGuessSoFar = start;\r\n for (int i = start + 1; i < values.size(); i++) {\r\n if (values.get(i) < values.get(bestGuessSoFar)) {\r\n bestGuessSoFar = i;\r\n } // if\r\n } // for\r\n return bestGuessSoFar;\r\n }", "public int getLowerBound ();", "public static long findMin(Equation e1, Equation e2, long low, long high) {\n if(high - low <= 0) return high;\n long median = (high + low)/2 ;\n System.out.println(low);\n System.out.println(median);\n System.out.println(high);\n\n long medianDifference = e2.evaluate(median) - e1.evaluate(median);\n long medianDifference1 = e2.evaluate(median + 1) - e1.evaluate(median + 1) ;\n\n if(medianDifference < 0) medianDifference = - medianDifference;\n if(medianDifference1 < 0) medianDifference1 = - medianDifference1;\n\n System.out.println(medianDifference);\n System.out.println(medianDifference1);\n System.out.println();\n\n if(medianDifference < medianDifference1) {\n return findMin(e1,e2,low,median);\n } else {\n return findMin(e1,e2,median + 1, high);\n }\n }", "public double getMinimumValue() { return this.minimumValue; }", "@Test\n public void min() {\n assertEquals(2103, SuggestionUtil.min(2103, 2103, 2103));\n\n // EP: two numbers same and one different\n assertEquals(2103, SuggestionUtil.min(2103, 2104, 2103));\n\n // EP: all three numbers different\n assertEquals(2103, SuggestionUtil.min(2103, 2104, 2105));\n }", "int minNoteValue();", "static int minimumInRange(int a[], int from, int to){ //\"O(to-from+1)\" O(m)\n int min = from;\n for(int i = from+1; i<= to; i++){ //n times\n if(a[i]<a[min]){\n min = i;\n }\n }\n return min;\n }", "public double minValue() {\n return 0;\r\n }", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }", "public int findMinOptimization(int[] nums) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n int target = nums[end];\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] <= target) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (nums[start] <= nums[end]) return nums[start];\n return nums[end];\n }", "protected double getMinDouble() {\r\n boolean handleOutOfMemoryError = false;\r\n double min = Double.POSITIVE_INFINITY;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n double value;\r\n int row;\r\n int col;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell(\r\n row,\r\n col);\r\n if (value != noDataValue) {\r\n min = Math.min(\r\n min,\r\n value);\r\n }\r\n }\r\n }\r\n return min;\r\n }", "private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }", "private Integer getMines(Integer xOpen, Integer yOpen){\n int counter=0;\r\n // System.out.println(\"getMines() [\"+xOpen+\"][\"+yOpen+\"]\");\r\n for(int i=xOpen-1; i<=(xOpen+1) ; i++){\r\n for(int j=yOpen-1; j<=(yOpen+1) ; j++){\r\n if(isValidCell(i,j) && grid[i][j].isMine()){ //split y && le quite uno\r\n counter++; //solo un operador and \r\n }\r\n }\r\n }\r\n// System.out.println(\" getMines().result = \"+counter);\r\n return counter; //contador de minas, el mismo no puede ser una mina \r\n }", "private int findMin(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n int left = 0;\n int right = nums.length - 1;\n while (left < right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] >= nums[left] && nums[mid] > nums[right]) {\n left = mid + 1;\n } else if (nums[mid] == nums[right]) {\n while (mid < right && nums[mid] == nums[right]) {\n right--;\n }\n } else {\n right = mid;\n }\n }\n return nums[left];\n }", "private int min(int profondeur)\n\t{\n\t\tif(profondeur == 0 || grille.fin())\n\t\t{\n\t\t\treturn eval();\n\t\t}\n\t\tint min_val = 1000;\n\t\tfor(int y = 0; y < grille.getTaille(); y++)\n\t\t{\n\t\t\tfor(int x = 0; x < grille.getTaille(); x++)\n\t\t\t{\n\t\t\t\tCoordonnee test = new Coordonnee(x, y);\n\t\t\t\tif(grille.getCase(test).getContenu() == grille.getCaseVide())\n\t\t\t\t{\n\t\t\t\t\tgrille.jouer(test, '?');\n\t\t\t\t\tint val = max(profondeur-1);\n\t\t\t\t\t//System.out.println(\" = \" + val);\n\t\t\t\t\t//grille.afficher();\n\t\t\t\t\tif(val < min_val)\n\t\t\t\t\t{\n\t\t\t\t\t\tmin_val = val;\n\t\t\t\t\t}\n\t\t\t\t\tannuler(test);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn min_val;\n\t}", "public static int findMin(){\n int min = array[0];\n for(int x = 1; x<array.length; x++ ){\n if(array[x]<min){\n min=array[x];\n }\n }\n return min;\n}", "public int getMinRange() {\r\n return fMinRange;\r\n }", "public double min() {\n\t\tif (count() > 0) {\n\t\t\treturn _min.get();\n\t\t}\n\t\treturn 0.0;\n\t}", "public Point getMin () {\r\n\r\n\treturn getA();\r\n }", "public double getMinDist(){\n\t\tquickSort(0, pnt.length - 1);\t// for divide\n\t\t/* CASE: same point */\n\t\tif(min == 0)\n\t\t\treturn 0;\n\n\t\tmin = getDist(pnt[0], pnt[pnt.length - 1]);\n\t\tdivide(0, pnt.length - 1);\n\n\t\treturn min;\n\t}", "public int findMin(int[] nums) {\n int n = nums.length;\n int l = 0;\n int r = n - 1;\n int m;\n while (l + 1 < r) {\n m = (l + r) / 2;\n if (nums[m] > nums[l]) {\n l = m;\n }\n else if (nums[m] < nums[r]) {\n r = m;\n }\n }\n \n return Math.min(nums[0], Math.min(nums[l], nums[r]));\n }", "private static int min_value(State curr_state) {\n\t\tcounterMinimax++;\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint min_value = Integer.MAX_VALUE;\r\n\t\t//Get the successors of the current state, as light always runs second\r\n\t\t//it will call minValue;\r\n\t\tState[] successors = curr_state.getSuccessors('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmin_value = Math.min(min_value, max_value(curr_state));\r\n\t\t}\r\n\r\n\r\n\t\t//Select the successor that returns the smallest(optimal) value\r\n\t\tfor(State state : successors){\r\n\t\t\tmin_value = Math.min(min_value, max_value(state));\r\n\t\t}\r\n\r\n\r\n\t\treturn min_value;\r\n\t}", "public int minQ(inValues input) {\n float qValue = (2 * input.orderCost * input.demandsArray[0][0] * (input.invCost + input.saleLossCost) * 360 / (input.invCost * input.saleLossCost));\n qValue = Math.round(Math.sqrt(qValue));\n return (int) qValue;\n }", "float getXStepMin();", "java.math.BigDecimal getMultipleBetMinimum();", "public static int argmin(double[] array, int from, int to) {\n\t\tif (from>=to) return -1;\n\t\tdouble max = array[from];\n\t\tint re = from;\n\t\tfor (int i=from+1; i<to; i++) {\n\t\t\tif (array[i]<max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public double min() {\n double resultat = Double.MAX_VALUE;\n double tmp = 0;\n for (int i = 0; i < tab.size(); i++) {\n tmp = CalculatorArray.min(tab.get(i));\n if (tmp < resultat) {\n resultat = tmp;\n }\n }\n\n System.out.println(\"Min colonne:\" + resultat);\n return resultat;\n }", "public double minValue(DateTime dt1, DateTime dt2) throws Exception {\r\n Candle[] cd = collectCandlesByIndex(find_index(dt1), find_index(dt2));\r\n double min;\r\n if (cd.length > 1) {\r\n min = cd[0].getLow();\r\n for (Candle c : cd) {\r\n if (c.getLow() < min){\r\n min = c.getLow();\r\n }\r\n }\r\n return min;\r\n } else if (cd.length == 1) {\r\n return cd[0].getLow();\r\n } else {\r\n return 0;\r\n }\r\n }", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "public double getMinDoubleValue();", "private Point lowestFInOpen() {\n\t\tPoint lowestP = null;\n\t\tfor (Point p : openset) {\n\t\t\tif (lowestP == null) \n\t\t\t\tlowestP = p;\n\t\t\telse if (fscores.get(p) < fscores.get(lowestP))\n\t\t\t\tlowestP = p;\n\t\t}\n\t\treturn lowestP;\n\t}", "static int findMin0(int[] nums) {\r\n \r\n // **** sanity check ****\r\n if (nums.length == 1)\r\n return nums[0];\r\n\r\n // **** check if there is no rotation ****\r\n if (nums[nums.length - 1] > nums[0])\r\n return nums[0];\r\n\r\n // **** loop looking for the next smallest value ****\r\n for (int i = 0; i < nums.length - 1; i++) {\r\n if (nums[i] > nums[i + 1])\r\n return nums[i + 1];\r\n }\r\n\r\n // **** min not found ****\r\n return -1;\r\n }", "private double getMin() {\n return min;\n }", "private static int indexOfSmallest(int[] a, int start) {\n int minNum = a[start];\n int minIndex = start;\n for(int i=start; i<a.length; i++){\n if(a[i]<minNum){\n minNum = a[i];\n minIndex = i;\n }\n\n }\n return minIndex;\n }", "public int getMinimumScore(){\n\n /*\n * creating variable of type int name it lowestScore go in to index 0 and sub 0\n * and lowestScore is refering to instance variable scores\n */\n int lowestScore = scores[0][0]; // assume this value is the smallest score value\n\n /* enhanced for loop with array of type int named gameScores and it will go trough scores array*/\n for (int[] gameScores : scores){\n\n /*\n * and another enhanced for loop inside first for loop\n * int variable, name score and it will iterate(go/repeat) through array gameScores\n *\n */\n for (int score : gameScores){\n if (score < lowestScore){\n lowestScore = score;\n }\n }\n }\n return lowestScore;\n }", "public static double findMin(double[] da) {\n\n\t\t// fjern = \"0.0\" når metoden implementeres for ikke få forkert minimum\n\t\tdouble min = da[0];\n\t\t\n\t\t// TODO\n\t\t// OPPGAVE - START\n\t\tfor(double d : da) {\n\t\t\tif(d < min) {\n\t\t\t\tmin = d;\n\t\t\t}\n\t\t}\n\t\t// OPPGAVE - SLUT\n\t\treturn min;\n\t}", "public DynamicPart min(float min) {\n this.min = min;\n return this;\n }", "private Position getPositionWormMinHealth(ArrayList<Worm> worms) {\n Worm wormWithMinHealth = worms.get(0);\n int i;\n for (Worm worm : worms) {\n if (worm.health < wormWithMinHealth.health) {\n wormWithMinHealth = worm;\n }\n }\n return (wormWithMinHealth.position);\n }", "private void regularMinDemo() {\n int min = numbers[0];\n for(int i = 1; i < numbers.length; i++) {\n if (numbers[i] < min) min = numbers[i];\n }\n System.out.println(min);\n }", "public Number getMinimum() {\n return ((ADocument) getDocument()).min;\n }", "int min() {\n return min;\r\n }", "public int findMin(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] < nums[start]) {\n end = mid;\n }\n else if (nums[mid] < nums[end]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (nums[start] < nums[end]) return nums[start];\n return nums[end];\n }", "public double getMinValue() {\n double min = Double.POSITIVE_INFINITY;\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (data[i][j] < min)\n min = data[i][j];\n }\n }\n return min;\n }", "public double getMinimumDistance() {\n double l = Double.POSITIVE_INFINITY;\n int stop = getDistanceEnd();\n\n calculateDistances();\n\n for (int i = 0; i < stop; i++) {\n l = Math.min(l, distances[i]);\n }\n\n return l;\n }", "public int getMinFloor();", "public int minMinValue(List<List<Integer>> positions) {\n int value = Integer.MAX_VALUE;\n for (final List<Integer> values : positions) {\n final int temp = Collections.min(values).intValue();\n if (temp < value) {\n value = temp;\n }\n }\n return value;\n }", "public static int findMin(int mat3d[][][]) {\n //creates int to check for minimum, valued at 100 because it's gaurenteed to be larger than any int in array\n int checker=100;\n //for loop, runs 3 times, get the pattern?\n for(int s=0; s<3; s++) {\n //holy shit, it' sthe same pattern as ^^\n for(int j=0; j<(3+2*s); j++) {\n //Have you caught on?\n for(int c=0; c<(s+j+1); c++) {\n //if statement which replaces checkder value, as the slot in array, if it's lower\n if(checker> mat3d[s][j][c]){\n checker=mat3d[s][j][c];\n }\n }\n }\n }\n //returns this int value\n return checker;\n \n \n }", "private double min(double value1 , double value2){\n double minValue = 0.0;\n if(value1 <= value2){\n minValue = value1;\n }else{\n minValue = value2;\n }\n\n return minValue;\n }" ]
[ "0.7134856", "0.6608645", "0.6608645", "0.65454", "0.648862", "0.6477615", "0.64712346", "0.6461058", "0.6454667", "0.6448383", "0.6370147", "0.63555425", "0.63442844", "0.63122857", "0.63040495", "0.6266372", "0.625926", "0.6246922", "0.62174547", "0.6207044", "0.6197404", "0.6196662", "0.61940306", "0.6179969", "0.61562675", "0.6131271", "0.6116949", "0.6100554", "0.60740316", "0.60627604", "0.6055848", "0.60466355", "0.6039249", "0.60354465", "0.60321045", "0.60150874", "0.60129946", "0.60028595", "0.6002126", "0.60015136", "0.5991458", "0.59796876", "0.5976174", "0.59702486", "0.5968617", "0.5966258", "0.5961015", "0.59583616", "0.5951003", "0.59491485", "0.5946278", "0.59462726", "0.59430957", "0.5922416", "0.5919643", "0.59157634", "0.5913857", "0.59103656", "0.5906753", "0.5905582", "0.5902974", "0.5894561", "0.5889013", "0.58840364", "0.58794284", "0.58762544", "0.5869408", "0.5868449", "0.5866382", "0.5865568", "0.5861217", "0.58545285", "0.5850004", "0.5844272", "0.5839157", "0.58379686", "0.58308864", "0.5828397", "0.58252954", "0.58239704", "0.58182216", "0.58181554", "0.5809075", "0.5809051", "0.58032924", "0.58023226", "0.57913923", "0.5788527", "0.5788315", "0.57872266", "0.57833236", "0.5774831", "0.5772456", "0.57699895", "0.5764449", "0.57604283", "0.5759", "0.574218", "0.5740143", "0.5739573" ]
0.76326406
0
Find the maximum value of a range needed to search based on a precursor mass
public Double findMaxPPMRange(Double mass, Double ppm) { return (mass + ((ppm/1000000.0)*mass)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Double findMaxMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass + mzTol);\n\t}", "public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}", "double getMax();", "double getMax();", "Double getMaximumValue();", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "int getMaximum();", "E maxVal();", "public int findMax(){\n return nilaiMaks(this.root);\n }", "public abstract int getMaximumValue();", "public Double findMinMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass - mzTol);\n\t}", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "Integer getMaximumResults();", "private double densityMax(int k, int m) {\n return (k >= m) ? 2 - (k - 1.0) / (m - 1) : 1;\n }", "public double getMaxRange() {\n return maxRange;\n }", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "private static void findMaxKi67(){\n int cellNum=0;//total cells in region\n Ki67=0;//total Ki67 in region\n float maxdivR=0;//tracks maximum Ki67 over all regions\n int[] inds = {0,0};//tracks indexes of maximum ki67\n for(int i=0;i<Data.aMX;i++){//loop over regions and find max activity\n for (int j = 0; j < Data.aMY; j++) {\n if(Data.activityMesh[i][j]>maxdivR){\n maxdivR=1.f*Data.activityMesh[i][j];\n inds[0]=i;\n inds[1]=j;\n }\n }\n }\n //redefine histology section based on maximum activity area\n Pars.histX=inds[0]*Pars.histSizeX;\n Pars.histY=inds[1]*Pars.histSizeY;\n for (int i = 0; i <cells.size(); i++) {//find %ki67 within max region\n Cell cell = (Cell) cells.get(i);\n //only count mass cells within the region of interest\n if(cell.mass && cell.x>=Pars.histX && cell.x<=Pars.histX+Pars.histSizeX && cell.y>=Pars.histY && cell.y<=Pars.histY+Pars.histSizeY) {\n Ki67+=cell.ki67;//add Ki67 val in area\n cellNum+=1;//add total cells in area\n }\n }\n Functions.writeFloat(Pars.outFile+\"data/Ki.txt\",Ki67/cellNum);//write to file\n }", "public static void findMinMax(Student[] student){\n int minMidterm=student[0].getExamGrade().getMidtermExamGrade();//this is first step to find min value of midterm because I describe first index of midterm value in array\n int maxMidterm=student[0].getExamGrade().getMidtermExamGrade();//this is first step to find max value of midterm because I describe first index of midterm value in array\n int minFinal=student[0].getExamGrade().getFinalExamGrade();//this is first step to find min value of final because I describe first index of final value in array\n int maxFinal=student[0].getExamGrade().getFinalExamGrade();//this is first step to find max value of final because I describe first index of final value in array\n\n for(int i=0;i<student.length;i++){\n if(student[i].getExamGrade().getMidtermExamGrade()<minMidterm){ // this condution find min value of midterm until this step \n minMidterm=student[i].getExamGrade().getMidtermExamGrade();\n }\n if(student[i].getExamGrade().getMidtermExamGrade()>maxMidterm){// this condution find max value of midterm until this step \n maxMidterm=student[i].getExamGrade().getMidtermExamGrade();\n }\n if(student[i].getExamGrade().getFinalExamGrade()<minFinal){// this condution find min value of final until this step \n minFinal=student[i].getExamGrade().getFinalExamGrade();\n }\n if(student[i].getExamGrade().getFinalExamGrade()>maxFinal){// this condution find max value of final until this step \n maxFinal=student[i].getExamGrade().getFinalExamGrade();\n }\n }\n\n System.out.println(\"Maximum Midterm Exam Grade: \"+maxMidterm+\" Minumum Midterm Exam Grade: \"+minMidterm);\n System.out.println(\"Maximum Final Exam Grade: \"+maxFinal+\" Minumum Final Exam Grade: \"+minFinal);\n }", "long getMaxItemFindings();", "public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }", "public long getPropertyBalanceMax();", "double getRight(double max);", "int getMax();", "public int getCustomerMaxTargetFloor();", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "public int getMaxFloor();", "@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "private int getPRFurthestUse() {\n int max = -1;\n int maxPR = -1;\n for (int i = 0; i < numPhysRegs - 1; i++) {\n if (PRNU[i] > max) {\n max = PRNU[i];\n maxPR = i;\n }\n }\n return maxPR; // no free physical register\n }", "public float getMaxAlturaCM();", "int range(){\n return fuelcap*mpg;\n }", "java.math.BigDecimal getWBMaximum();", "public int GetMaxVal();", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public int getMaxRange() {\n\t\treturn max_range;\n\t}", "public int getMax(){\n return tab[rangMax()];\n }", "Double maxOfDisplacements(ArrayList<Double> dispA){\r\n\t\tObject minvalobj = Collections.min(dispA);\r\n\t\tObject maxvalobj = Collections.max(dispA);\r\n\t\tIJ.log(\"Max displacement\" + maxvalobj);\r\n\t\tIJ.log(\"Min displacement\" + minvalobj);\r\n\t\tdouble minval = (Double) minvalobj;\r\n\t\tdouble maxval = (Double) maxvalobj;\t\t\r\n\t\tdouble maxdisp = maxval;\r\n\t\tif (Math.abs(maxval) < Math.abs(minval)) \r\n\t\t\tmaxdisp = minval;\r\n\t\telse\r\n\t\t\tmaxdisp = maxval;\t\t\r\n\t\treturn maxdisp;\r\n\t}", "org.apache.xmlbeans.XmlDecimal xgetMaximum();", "java.math.BigDecimal getMaximum();", "public double getMaximumScore() {\n return 0.9; // TODO: parameter\n }", "public Money findMaxPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney max = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (max.compareTo(current) == -1 || !flag) {\n\t\t\t\tmax = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn max;\n\t}", "int getMax( int max );", "public Factura getMaxNumeroFactura();", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "private int findMax(int begin, int end) {\n // you should NOT change this function\n int max = array[begin];\n for (int i = begin + 1; i <= end; i++) {\n if (array[i] > max) {\n max = array[i];\n }\n }\n return max;\n }", "private int max(int profondeur)\n\t{\n\t\tif(profondeur == 0 || grille.fin())\n\t\t{\n\t\t\treturn eval();\n\t\t}\n\t\tint max_val = -1000;\n\t\tfor(int y = 0; y < grille.getTaille(); y++)\n\t\t{\n\t\t\tfor(int x = 0; x < grille.getTaille(); x++)\n\t\t\t{\n\t\t\t\tCoordonnee test = new Coordonnee(x, y);\n\t\t\t\tif(grille.getCase(test).getContenu() == grille.getCaseVide())\n\t\t\t\t{\n\t\t\t\t\tgrille.jouer(test, getPion());\n\t\t\t\t\tint val = min(profondeur-1);\n\t\t\t\t\t//System.out.println(x + \" \" + y + \" : \" + val);\n\t\t\t\t\t//grille.afficher();\n\t\t\t\t\tif(val > max_val)\n\t\t\t\t\t{\n\t\t\t\t\t\tmax_val = val;\n\t\t\t\t\t}\n\t\t\t\t\tannuler(test);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn max_val;\n\t}", "int max();", "public Integer getMax() {\n\t\t\tif (hotMinMax) {\n\t\t\t\tConfigValue rawMinMax = new ConfigValue();\n\t\t\t\ttry {\n\t\t\t\t\trawSrv.getCfgMinMax(name, rawMinMax);\n\t\t\t\t\t// TODO: FIX HERE\n\t\t\t\t\treturn 100;\n\t\t\t\t} catch (TVMException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn new Integer(max);\n\t\t\t}\n\t\t\t// ....\n\t\t\treturn 100;\n\t\t}", "public double calcularAlvoMaximo() {\r\n\t\treturn calcularFrequenciaMaxima()*0.85;\r\n\t}", "public double getMaximumValue() { return this.maximumValue; }", "public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}", "public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (last-first)/2;\r\n\t\t\t\r\n\t\t\tif(A[mid]>A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\treturn A[mid];\r\n\t\t\telse if(A[mid]>A[mid-1] && A[mid]<A[mid+1])\r\n\t\t\t\tfirst=mid+1;\r\n\t\t\telse if(A[mid]<A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\tlast=mid-1;\r\n\t\t\telse return -1;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n\t\r\n}", "float xMax();", "int maxNoteValue();", "public long findMax(long[] incomes) {\n long current_max_index = 0;\n long current_max = incomes[0];\n for (long income : incomes)\n if (current_max < income)\n current_max = income;\n return current_max;\n }", "public int findMaxValue() {\n\t\treturn findMaxValue( this );\n\t}", "public int getMaximumPoints();", "public double getXRangeMax() {\n return xRangeMax;\n }", "int getMaxStamina();", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "public double getRangeToBestTarget()\n\t{\n\t\treturn getRangeToTarget(currentBestTarget);\n\t}", "public static int findMax(Integer[] X, int low, int high)\n\t\t{if (low + 1 > high) {return X[low];}\n\t\telse {return Math.max(Math.abs(X[low]), Math.abs(findMax(X, low + 1, high)));}\n\t\t}", "public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }", "private static int maxMp(int mp){\r\n int mMP = 0;\r\n mMP = mp + 5;\r\n return mMP;\r\n }", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "public double getMaximumDouble() {\n/* 255 */ return this.max;\n/* */ }", "private static final double maxDecel(double speed) {\n return limit(1, speed * 0.5 + 1, 2);\n }", "org.apache.xmlbeans.XmlDecimal xgetWBMaximum();", "@JSProperty(\"maxRange\")\n double getMaxRange();", "private long getAbsMax() {\n return Math.max(Math.abs(Visualizer.getLowerBound().get()),\n Visualizer.getUpperBound().get());\n }", "private int findMaxValue( XTreeNode<E> rootNode ) {\n\t\tif( rootNode == null ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\n\t\tint rootValue = (Integer) rootNode.getData();\n\t\tint maxValue = rootValue;\n\n\t\tint leftValue = findMaxValue( rootNode.getLeftChild() );\n\t\tint rightValue = findMaxValue( rootNode.getRightChild() );\n\n\t\t// not using if else if, as need to compare three values - root, left, right\n\t\tif( leftValue > rootValue ) {\n\t\t\tmaxValue = leftValue;\n\t\t}\n\t\tif( rightValue > maxValue ) {\n\t\t\tmaxValue = rightValue;\n\t\t}\n\t\treturn maxValue;\n\t}", "public int getMaximumEPC(int metadata);", "private StreamEvent findIfActualMax(AttributeDetails latestEvent) {\n int indexCurrentMax = valueStack.indexOf(currentMax);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMax;\n // If latest event is at a distance greater than maxPostBound from max, max is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMax.notEligibleForRealMax();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", 0, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMax.getValue() - currentMax.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMax - preBound >= 0) {\n if (valueStack.get(indexCurrentMax - preBound).getValue() <= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", preBound, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore max is not eligible to be sent as output.\n currentMax.notEligibleForRealMax();\n return null;\n }", "Expression getMax();", "public float getMaxCY5();", "public final boolean searchMaximum(){\r\n\t\tif (!initialized()) minimum=false;\r\n\t\treturn !minimum;\r\n\t}", "private float calculateMaxValue(int[] probes) {\r\n float max = 0f;\r\n float value;\r\n final int samples = experiment.getNumberOfSamples();\r\n for (int sample=0; sample<samples; sample++) {\r\n for (int probe=0; probe<probes.length; probe++) {\r\n value = experiment.get(probes[probe], sample);\r\n if (!Float.isNaN(value)) {\r\n max = Math.max(max, Math.abs(value));\r\n }\r\n }\r\n }\r\n return max;\r\n }", "private static double search(double min, double max, Function f) {\n\t\tdouble a = min;\n\t\tdouble c = max;\n\t\tdouble b = 0;\n\t\twhile (Math.abs(c - a) > MIN_DIFFERENCE) {\n\t\t\tb = (a + c) / 2;\n\t\t\tdouble fa = f.f(a);\n\t\t\tdouble fc = f.f(c);\n\t\t\t\n\t\t\tif (fa < fc) {\n\t\t\t\tc = b;\n\t\t\t} else {\n\t\t\t\ta = b;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn b;\n\t}", "double getMax() {\n\t\t\treturn value_max;\n\t\t}", "private double getMaxThreshold() {\n return maxThreshold;\n }", "private double getMaxOfPool(double[][] input, int rowStart, int colStart,\n int spatialExtent) {\n double max = input[rowStart][colStart];\n for (int row = rowStart; row < rowStart + spatialExtent; row++) {\n for (int col = colStart; col < colStart + spatialExtent; col++) {\n max = Math.max(max, input[row][col]);\n }\n }\n return max;\n }", "String getMax_res();", "public int getMaximumAir ( ) {\n\t\treturn extract ( handle -> handle.getMaximumAir ( ) );\n\t}", "@Override\n\tpublic int select_arm() {\n\t\tint countsSum = 0;\n\t\t\n\t\tfor(int arm : m_counts){\n\t\t\tif(arm == 0) return arm;\n\t\t\tcountsSum += arm;\n\t\t}\n\t\t\n\t\tdouble max = 0;\n\t\tint max_indx = 0;\n\t\tfor(int i = 0; i<m_counts.length; i++){\n\t\t\tdouble bonus = Math.sqrt((2 * Math.log(countsSum)) / m_counts[i]);\n\t\t\tdouble ucb_value = m_values[i] + bonus;\n\t\t\tif(ucb_value > max){ \n\t\t\t\tmax = ucb_value;\n\t\t\t\tmax_indx = i;\n\t\t\t}\n\t\t}\n\t\treturn max_indx;\n\t}", "public static int indexOfMaxInRange(int start, int end, double[] data)\r\n\t{\r\n\t\tint maxx=start;\r\n\t\tfor(int i=start;i<end;i++)\r\n\t\t{\r\n\t\t\tif(data[i]>data[maxx])\r\n\t\t\t\tmaxx=i;\r\n\t\t}\r\n\t\treturn maxx;\r\n\t}", "public double getMaximum() {\n return (max);\n }", "private static int findNext(List<List<Integer>> m, int k, int val)\n {\n int res = -1;\n int base = val % 100;\n // we ignore one-digit base (meaning no base can start with zero)\n if (base < 10) {\n return res;\n }\n\n int min = base * 100;\n int max = (base + 1) * 100;\n List<Integer> list = m.get(k);\n Iterator<Integer> iter = list.iterator();\n while (iter.hasNext()) {\n int n = iter.next();\n if (n >= max) {\n break;\n }\n if (n >= min) {\n res = n;\n break;\n }\n }\n return res;\n }", "public int getMinimun(){\n int lowGrade = grades[0]; //assume que grades[0] é a menor nota\n \n //faz um loop pelo array de notas\n for(int grade: grades){\n //se nota for mais baixa que lowGrade, essa note é atribuida a lowGrade\n if(grade < lowGrade){\n lowGrade = grade;\n }\n }\n \n return lowGrade;\n }", "int getMaxMana();", "public static int getMax(ArrayList<QuoteShort> data, int begin, int end) {\n\t\t\r\n\t\tint max = -1;\r\n\t\tint maxIndex = -1;\r\n\t\tif (begin<=0) begin = 0;\r\n\t\tfor (int i=begin;i<=end;i++){\r\n\t\t\tif (data.get(i).getHigh5()>=max){\r\n\t\t\t\tmax = data.get(i).getHigh5();\r\n\t\t\t\tmaxIndex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn maxIndex;\r\n\t}", "private static int upperBound(int[] A, int target) {\n int max = A.length;\n int min = -1;\n while (max - min > 1) {\n int mid = ( max + min ) / 2;\n if(A[mid] <= target) {\n min = mid;\n } else {\n max = mid;\n }\n }\n\n return max;\n\n }", "public int getMaxTotalCost();", "private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}", "private double getMaxNumber(ArrayList<Double> provinceValues)\n {\n Double max = 0.0;\n\n for (Double type : provinceValues)\n {\n if (type > max)\n {\n max = type;\n }\n }\n return max;\n }" ]
[ "0.7230798", "0.64268404", "0.64238477", "0.64238477", "0.62994844", "0.6271512", "0.6255003", "0.6230342", "0.6147841", "0.61439705", "0.61406004", "0.613108", "0.613108", "0.613108", "0.613108", "0.613108", "0.613108", "0.6093729", "0.6076454", "0.6029294", "0.59997225", "0.59857935", "0.5985598", "0.598003", "0.597181", "0.5955891", "0.59555304", "0.595437", "0.5943677", "0.59219635", "0.59100777", "0.59070754", "0.58847487", "0.58715075", "0.58584523", "0.58496755", "0.5844681", "0.58414334", "0.5839479", "0.58390963", "0.5835393", "0.5831126", "0.5827923", "0.5819386", "0.58153975", "0.5812752", "0.5805611", "0.5802749", "0.5792186", "0.57910645", "0.5760879", "0.575875", "0.5757062", "0.57531", "0.5752579", "0.57495725", "0.5747801", "0.57391554", "0.5737603", "0.5733311", "0.5719533", "0.5714842", "0.57042575", "0.5703881", "0.5698552", "0.56676143", "0.56660134", "0.566341", "0.5659709", "0.5656106", "0.56523263", "0.5651789", "0.563586", "0.5633894", "0.56317043", "0.56268597", "0.5621453", "0.56141", "0.5612684", "0.5604379", "0.55971664", "0.558922", "0.5571573", "0.5567848", "0.55606985", "0.5559066", "0.5556261", "0.55532634", "0.55506706", "0.5548064", "0.5544958", "0.5538375", "0.5538371", "0.5535974", "0.55351365", "0.55152166", "0.55140626", "0.55112284", "0.5510373", "0.55053914" ]
0.7444349
0
Find the minimum value of a range needed to search based on a precursor mass
public Double findMinMassRange(Double mass, Double mzTol) { return (mass - mzTol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}", "double getMin();", "double getMin();", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public T findMin();", "public PrimEdge calculateMinimum() {\n int minWage = Integer.MAX_VALUE;\n PrimEdge result = null;\n for (Map.Entry<Integer, PrimEdge> entry : dtable.entrySet()) {\n if (entry.getValue().getWage() < minWage) {\n result = entry.getValue();\n minWage = entry.getValue().getWage();\n }\n }\n return result;\n }", "private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "int getXMin();", "Double getMinimumValue();", "java.math.BigDecimal getWagerMinimum();", "int getMin( int min );", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "E minVal();", "public int findMin() {\r\n\t\treturn this.min.value;\r\n\t}", "float xMin();", "public int findMin() {\n\t\tint min = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ((int)data.get(count) < min)\n\t\t\t\tmin = (int)data.get(count);\n\t\treturn min;\n\t}", "public abstract int getMinimumValue();", "private float getMinX(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float minX = Float.POSITIVE_INFINITY;\n for (float [] point : points) {\n minX = Math.min(minX, point [0]);\n } \n return minX;\n }", "public double getMinRange() {\n return minRange;\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "public void minimum()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tif(rowTick[i]==8888)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(columnTick[j]==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cost[i][j]<min)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin=cost[i][j];\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}", "private static int findMin(int startPos,int[] x){\n\t\tint result = startPos;\n\t\tfor(int i= startPos;i<x.length;i++){\n\t\t\tif(x[i]<x[result]){\n\t\t\t\tresult = i;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "double getLeft(double min);", "static int findMin(int[] nums) {\r\n \r\n // **** sanity check(s) ****\r\n if (nums.length == 1)\r\n return nums[0];\r\n\r\n // **** initialization ****\r\n int left = 0;\r\n int right = nums.length - 1;\r\n\r\n // **** check if there is no rotation ****\r\n if (nums[right] > nums[left])\r\n return nums[left];\r\n\r\n // **** binary search approach ****\r\n while (left < right) {\r\n\r\n // **** compute mid point ****\r\n int mid = left + (right - left) / 2;\r\n\r\n // **** check if we found min ****\r\n if (nums[mid] > nums[mid + 1])\r\n return nums[mid + 1];\r\n\r\n if (nums[mid - 1] > nums[mid])\r\n return nums[mid];\r\n\r\n // **** decide which way to go ****\r\n if (nums[mid] > nums[0])\r\n left = mid + 1; // go right\r\n else\r\n right = mid - 1; // go left\r\n }\r\n\r\n // **** min not found (needed to keep the compiler happy) ****\r\n return 69696969;\r\n }", "int findMin(int[] arr){\n\t\tint minimum=1000;\n\t\tfor (int i=0; i<arr.length; i++) {\n\t\t\tif (arr[i]<minimum) {\n\t\t\t\tminimum=arr[i];\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "public double minXp(){\n\t\tmin = xp[0];\n\t\tfor(int i=1;i<xp.length;i++){\n\t\t\tif(xp[i]<min){\n\t\t\t\tmin=xp[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "public Money findMinPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney min = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (min.compareTo(current) == 1 || !flag) {\n\t\t\t\tmin = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t }\n\t\t}\n\t\treturn min;\n\t}", "org.apache.xmlbeans.XmlDecimal xgetWagerMinimum();", "int min();", "protected ValuePosition getMinimum() {\n\t\t// Calcule la position et la durée d'exécution de la requête la plus courte dans le tableau des requêtes\n\t\tValuePosition minimum = new ValuePosition();\n\t\tminimum.position = 0;\n\t\tfor(int pos=0; pos<requests.length; pos++) {\n\t\t\tRequest request = requests[pos];\n\t\t\tif(request == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minimum.value == null || request.getElapsedTime() < minimum.value) {\n\t\t\t\tminimum.position = pos;\n\t\t\t\tminimum.value = request.getElapsedTime();\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "public int findLeast() {\r\n\tint cor = 0;\r\n\tint x = 9;\r\n\tfor (int r = 0; r < 9; r++) {\r\n\t for (int c = 0; c < 9; c++) {\r\n\t\tif (!board[r][c].getIsDef()) {\r\n\t\t if (board[r][c].getNumPossible() == 2) {\r\n\t\t\treturn r*10 + c;\r\n\t\t }\r\n\t\t if (board[r][c].getNumPossible() < x) {\r\n\t\t\tcor = r*10 + c;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n\treturn cor;\r\n }", "public static int getMin(ArrayList<QuoteShort> data, int begin, int end) {\n\t\tint min = 999999999;\r\n\t\tint minIndex = -1;\r\n\t\tif (begin<=0) begin = 0;\r\n\t\tfor (int i=begin;i<=end;i++){\r\n\t\t\tif (data.get(i).getHigh5()<=min){\r\n\t\t\t\tmin = data.get(i).getLow5();\r\n\t\t\t\tminIndex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn minIndex;\r\n\t}", "java.math.BigDecimal getSingleBetMinimum();", "public final boolean searchMinimum(){\r\n\t\tif (!initialized()) minimum=true;\r\n\t\treturn minimum;\r\n\t}", "public int getMinimun(){\n int lowGrade = grades[0]; //assume que grades[0] é a menor nota\n \n //faz um loop pelo array de notas\n for(int grade: grades){\n //se nota for mais baixa que lowGrade, essa note é atribuida a lowGrade\n if(grade < lowGrade){\n lowGrade = grade;\n }\n }\n \n return lowGrade;\n }", "private double getMinNumber(ArrayList<Double> provinceValues)\n {\n Double min = 999999999.0;\n\n for (Double type : provinceValues)\n {\n if (type < min)\n {\n min = type;\n }\n }\n return min;\n }", "public int findMin(int[] num) {\n \t\n \tif (num.length == 1) {\n \t return num[0];\n \t}\n \t\n \tint up = num.length - 1,\n \t low = 0,\n \t mid = (up + low) / 2;\n \twhile (up > low) {\n \t if (mid + 1 < num.length && mid - 1 >= 0 && num[mid] < num[mid - 1] && num[mid] < num[mid + 1]) {\n \t return num[mid];\n \t }\n \t if (num[mid] > num[up]) {\n \t low = mid + 1;\n \t } else {\n \t up = mid - 1;\n \t }\n \t \n \t mid = (up + low) / 2;\n \t}\n \treturn num[mid];\n\t}", "public double min() {\n/* 305 */ Preconditions.checkState((this.count != 0L));\n/* 306 */ return this.min;\n/* */ }", "Coordinate getMinX();", "private int smallestF(){\r\n int smallest = 100000;\r\n int smallestIndex = 0;\r\n int size = _openSet.size();\r\n for(int i=0;i<size;i++){\r\n int thisF = _map.get_grid(_openSet.get(i)).get_Fnum();\r\n if(thisF < smallest){\r\n smallest = thisF;\r\n smallestIndex = i;\r\n }\r\n }\r\n return smallestIndex;\r\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "public int GetMinVal();", "public void setMinAmount(int min) {\n _min = min;\n }", "public float getminP() {\n Reading minPressureReading = null;\n float minPressure = 0;\n if (readings.size() >= 1) {\n minPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure < minPressure) {\n minPressure = readings.get(i).pressure;\n }\n }\n } else {\n minPressure = 0;\n }\n return minPressure;\n }", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "private StreamEvent findIfActualMin(AttributeDetails latestEvent) {\n int indexCurrentMin = valueStack.indexOf(currentMin);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMin;\n // If latest event is at a distance greater than maxPostBound from min, min is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMin.notEligibleForRealMin();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", 0, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMin.getValue() + currentMin.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMin - preBound >= 0) {\n if (valueStack.get(indexCurrentMin - preBound).getValue() >= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMin);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"min\", preBound, postBound });\n currentMin.sentOutputAsRealMin();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore min is not eligible to be sent as output.\n currentMin.notEligibleForRealMin();\n return null;\n }", "public double obterXmin() {\n\t\treturn xmin;\n\t}", "public double getMinimumDistance() { return minDistance; }", "static int findMin(double[] pq)\n\t{\n\t\tint ind = -1; \n\t\tfor (int i = 0; i < pq.length; ++i)\n\t\t\tif (pq[i] >= 0 && (ind == -1 || pq[i] < pq[ind]))\n\t\t\t\tind = i;\n\t\treturn ind;\n\t}", "public static int findPosMin(List<Integer> values, int start) {\r\n int bestGuessSoFar = start;\r\n for (int i = start + 1; i < values.size(); i++) {\r\n if (values.get(i) < values.get(bestGuessSoFar)) {\r\n bestGuessSoFar = i;\r\n } // if\r\n } // for\r\n return bestGuessSoFar;\r\n }", "public int getLowerBound ();", "public static long findMin(Equation e1, Equation e2, long low, long high) {\n if(high - low <= 0) return high;\n long median = (high + low)/2 ;\n System.out.println(low);\n System.out.println(median);\n System.out.println(high);\n\n long medianDifference = e2.evaluate(median) - e1.evaluate(median);\n long medianDifference1 = e2.evaluate(median + 1) - e1.evaluate(median + 1) ;\n\n if(medianDifference < 0) medianDifference = - medianDifference;\n if(medianDifference1 < 0) medianDifference1 = - medianDifference1;\n\n System.out.println(medianDifference);\n System.out.println(medianDifference1);\n System.out.println();\n\n if(medianDifference < medianDifference1) {\n return findMin(e1,e2,low,median);\n } else {\n return findMin(e1,e2,median + 1, high);\n }\n }", "public double getMinimumValue() { return this.minimumValue; }", "@Test\n public void min() {\n assertEquals(2103, SuggestionUtil.min(2103, 2103, 2103));\n\n // EP: two numbers same and one different\n assertEquals(2103, SuggestionUtil.min(2103, 2104, 2103));\n\n // EP: all three numbers different\n assertEquals(2103, SuggestionUtil.min(2103, 2104, 2105));\n }", "int minNoteValue();", "public double minValue() {\n return 0;\r\n }", "static int minimumInRange(int a[], int from, int to){ //\"O(to-from+1)\" O(m)\n int min = from;\n for(int i = from+1; i<= to; i++){ //n times\n if(a[i]<a[min]){\n min = i;\n }\n }\n return min;\n }", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }", "public int findMinOptimization(int[] nums) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n int target = nums[end];\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] <= target) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (nums[start] <= nums[end]) return nums[start];\n return nums[end];\n }", "protected double getMinDouble() {\r\n boolean handleOutOfMemoryError = false;\r\n double min = Double.POSITIVE_INFINITY;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n double value;\r\n int row;\r\n int col;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell(\r\n row,\r\n col);\r\n if (value != noDataValue) {\r\n min = Math.min(\r\n min,\r\n value);\r\n }\r\n }\r\n }\r\n return min;\r\n }", "private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }", "private Integer getMines(Integer xOpen, Integer yOpen){\n int counter=0;\r\n // System.out.println(\"getMines() [\"+xOpen+\"][\"+yOpen+\"]\");\r\n for(int i=xOpen-1; i<=(xOpen+1) ; i++){\r\n for(int j=yOpen-1; j<=(yOpen+1) ; j++){\r\n if(isValidCell(i,j) && grid[i][j].isMine()){ //split y && le quite uno\r\n counter++; //solo un operador and \r\n }\r\n }\r\n }\r\n// System.out.println(\" getMines().result = \"+counter);\r\n return counter; //contador de minas, el mismo no puede ser una mina \r\n }", "private int findMin(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n int left = 0;\n int right = nums.length - 1;\n while (left < right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] >= nums[left] && nums[mid] > nums[right]) {\n left = mid + 1;\n } else if (nums[mid] == nums[right]) {\n while (mid < right && nums[mid] == nums[right]) {\n right--;\n }\n } else {\n right = mid;\n }\n }\n return nums[left];\n }", "private int min(int profondeur)\n\t{\n\t\tif(profondeur == 0 || grille.fin())\n\t\t{\n\t\t\treturn eval();\n\t\t}\n\t\tint min_val = 1000;\n\t\tfor(int y = 0; y < grille.getTaille(); y++)\n\t\t{\n\t\t\tfor(int x = 0; x < grille.getTaille(); x++)\n\t\t\t{\n\t\t\t\tCoordonnee test = new Coordonnee(x, y);\n\t\t\t\tif(grille.getCase(test).getContenu() == grille.getCaseVide())\n\t\t\t\t{\n\t\t\t\t\tgrille.jouer(test, '?');\n\t\t\t\t\tint val = max(profondeur-1);\n\t\t\t\t\t//System.out.println(\" = \" + val);\n\t\t\t\t\t//grille.afficher();\n\t\t\t\t\tif(val < min_val)\n\t\t\t\t\t{\n\t\t\t\t\t\tmin_val = val;\n\t\t\t\t\t}\n\t\t\t\t\tannuler(test);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn min_val;\n\t}", "public static int findMin(){\n int min = array[0];\n for(int x = 1; x<array.length; x++ ){\n if(array[x]<min){\n min=array[x];\n }\n }\n return min;\n}", "public double min() {\n\t\tif (count() > 0) {\n\t\t\treturn _min.get();\n\t\t}\n\t\treturn 0.0;\n\t}", "public int getMinRange() {\r\n return fMinRange;\r\n }", "public Point getMin () {\r\n\r\n\treturn getA();\r\n }", "public double getMinDist(){\n\t\tquickSort(0, pnt.length - 1);\t// for divide\n\t\t/* CASE: same point */\n\t\tif(min == 0)\n\t\t\treturn 0;\n\n\t\tmin = getDist(pnt[0], pnt[pnt.length - 1]);\n\t\tdivide(0, pnt.length - 1);\n\n\t\treturn min;\n\t}", "public int findMin(int[] nums) {\n int n = nums.length;\n int l = 0;\n int r = n - 1;\n int m;\n while (l + 1 < r) {\n m = (l + r) / 2;\n if (nums[m] > nums[l]) {\n l = m;\n }\n else if (nums[m] < nums[r]) {\n r = m;\n }\n }\n \n return Math.min(nums[0], Math.min(nums[l], nums[r]));\n }", "private static int min_value(State curr_state) {\n\t\tcounterMinimax++;\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint min_value = Integer.MAX_VALUE;\r\n\t\t//Get the successors of the current state, as light always runs second\r\n\t\t//it will call minValue;\r\n\t\tState[] successors = curr_state.getSuccessors('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmin_value = Math.min(min_value, max_value(curr_state));\r\n\t\t}\r\n\r\n\r\n\t\t//Select the successor that returns the smallest(optimal) value\r\n\t\tfor(State state : successors){\r\n\t\t\tmin_value = Math.min(min_value, max_value(state));\r\n\t\t}\r\n\r\n\r\n\t\treturn min_value;\r\n\t}", "public int minQ(inValues input) {\n float qValue = (2 * input.orderCost * input.demandsArray[0][0] * (input.invCost + input.saleLossCost) * 360 / (input.invCost * input.saleLossCost));\n qValue = Math.round(Math.sqrt(qValue));\n return (int) qValue;\n }", "float getXStepMin();", "java.math.BigDecimal getMultipleBetMinimum();", "public static int argmin(double[] array, int from, int to) {\n\t\tif (from>=to) return -1;\n\t\tdouble max = array[from];\n\t\tint re = from;\n\t\tfor (int i=from+1; i<to; i++) {\n\t\t\tif (array[i]<max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public double min() {\n double resultat = Double.MAX_VALUE;\n double tmp = 0;\n for (int i = 0; i < tab.size(); i++) {\n tmp = CalculatorArray.min(tab.get(i));\n if (tmp < resultat) {\n resultat = tmp;\n }\n }\n\n System.out.println(\"Min colonne:\" + resultat);\n return resultat;\n }", "public double minValue(DateTime dt1, DateTime dt2) throws Exception {\r\n Candle[] cd = collectCandlesByIndex(find_index(dt1), find_index(dt2));\r\n double min;\r\n if (cd.length > 1) {\r\n min = cd[0].getLow();\r\n for (Candle c : cd) {\r\n if (c.getLow() < min){\r\n min = c.getLow();\r\n }\r\n }\r\n return min;\r\n } else if (cd.length == 1) {\r\n return cd[0].getLow();\r\n } else {\r\n return 0;\r\n }\r\n }", "public double getMinDoubleValue();", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "static int findMin0(int[] nums) {\r\n \r\n // **** sanity check ****\r\n if (nums.length == 1)\r\n return nums[0];\r\n\r\n // **** check if there is no rotation ****\r\n if (nums[nums.length - 1] > nums[0])\r\n return nums[0];\r\n\r\n // **** loop looking for the next smallest value ****\r\n for (int i = 0; i < nums.length - 1; i++) {\r\n if (nums[i] > nums[i + 1])\r\n return nums[i + 1];\r\n }\r\n\r\n // **** min not found ****\r\n return -1;\r\n }", "private Point lowestFInOpen() {\n\t\tPoint lowestP = null;\n\t\tfor (Point p : openset) {\n\t\t\tif (lowestP == null) \n\t\t\t\tlowestP = p;\n\t\t\telse if (fscores.get(p) < fscores.get(lowestP))\n\t\t\t\tlowestP = p;\n\t\t}\n\t\treturn lowestP;\n\t}", "private double getMin() {\n return min;\n }", "private static int indexOfSmallest(int[] a, int start) {\n int minNum = a[start];\n int minIndex = start;\n for(int i=start; i<a.length; i++){\n if(a[i]<minNum){\n minNum = a[i];\n minIndex = i;\n }\n\n }\n return minIndex;\n }", "public int getMinimumScore(){\n\n /*\n * creating variable of type int name it lowestScore go in to index 0 and sub 0\n * and lowestScore is refering to instance variable scores\n */\n int lowestScore = scores[0][0]; // assume this value is the smallest score value\n\n /* enhanced for loop with array of type int named gameScores and it will go trough scores array*/\n for (int[] gameScores : scores){\n\n /*\n * and another enhanced for loop inside first for loop\n * int variable, name score and it will iterate(go/repeat) through array gameScores\n *\n */\n for (int score : gameScores){\n if (score < lowestScore){\n lowestScore = score;\n }\n }\n }\n return lowestScore;\n }", "public DynamicPart min(float min) {\n this.min = min;\n return this;\n }", "public static double findMin(double[] da) {\n\n\t\t// fjern = \"0.0\" når metoden implementeres for ikke få forkert minimum\n\t\tdouble min = da[0];\n\t\t\n\t\t// TODO\n\t\t// OPPGAVE - START\n\t\tfor(double d : da) {\n\t\t\tif(d < min) {\n\t\t\t\tmin = d;\n\t\t\t}\n\t\t}\n\t\t// OPPGAVE - SLUT\n\t\treturn min;\n\t}", "private Position getPositionWormMinHealth(ArrayList<Worm> worms) {\n Worm wormWithMinHealth = worms.get(0);\n int i;\n for (Worm worm : worms) {\n if (worm.health < wormWithMinHealth.health) {\n wormWithMinHealth = worm;\n }\n }\n return (wormWithMinHealth.position);\n }", "private void regularMinDemo() {\n int min = numbers[0];\n for(int i = 1; i < numbers.length; i++) {\n if (numbers[i] < min) min = numbers[i];\n }\n System.out.println(min);\n }", "public Number getMinimum() {\n return ((ADocument) getDocument()).min;\n }", "int min() {\n return min;\r\n }", "public int findMin(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] < nums[start]) {\n end = mid;\n }\n else if (nums[mid] < nums[end]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (nums[start] < nums[end]) return nums[start];\n return nums[end];\n }", "public double getMinValue() {\n double min = Double.POSITIVE_INFINITY;\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (data[i][j] < min)\n min = data[i][j];\n }\n }\n return min;\n }", "public double getMinimumDistance() {\n double l = Double.POSITIVE_INFINITY;\n int stop = getDistanceEnd();\n\n calculateDistances();\n\n for (int i = 0; i < stop; i++) {\n l = Math.min(l, distances[i]);\n }\n\n return l;\n }", "public int getMinFloor();", "public int minMinValue(List<List<Integer>> positions) {\n int value = Integer.MAX_VALUE;\n for (final List<Integer> values : positions) {\n final int temp = Collections.min(values).intValue();\n if (temp < value) {\n value = temp;\n }\n }\n return value;\n }", "private double min(double value1 , double value2){\n double minValue = 0.0;\n if(value1 <= value2){\n minValue = value1;\n }else{\n minValue = value2;\n }\n\n return minValue;\n }", "public static int findMin(int mat3d[][][]) {\n //creates int to check for minimum, valued at 100 because it's gaurenteed to be larger than any int in array\n int checker=100;\n //for loop, runs 3 times, get the pattern?\n for(int s=0; s<3; s++) {\n //holy shit, it' sthe same pattern as ^^\n for(int j=0; j<(3+2*s); j++) {\n //Have you caught on?\n for(int c=0; c<(s+j+1); c++) {\n //if statement which replaces checkder value, as the slot in array, if it's lower\n if(checker> mat3d[s][j][c]){\n checker=mat3d[s][j][c];\n }\n }\n }\n }\n //returns this int value\n return checker;\n \n \n }" ]
[ "0.76334864", "0.66088736", "0.66088736", "0.654518", "0.64869964", "0.6477183", "0.647114", "0.6459666", "0.6453789", "0.64490724", "0.6370561", "0.63538647", "0.63425833", "0.631204", "0.6302553", "0.6266043", "0.6257665", "0.6246193", "0.6216752", "0.6206888", "0.6197156", "0.6195255", "0.6191045", "0.61799663", "0.6155211", "0.6130655", "0.61141324", "0.6098884", "0.6073732", "0.6061748", "0.60562676", "0.60447186", "0.60379493", "0.60345995", "0.60299313", "0.60159856", "0.6011527", "0.6002908", "0.6001036", "0.5999773", "0.5990475", "0.5977585", "0.59742486", "0.59696484", "0.59680045", "0.5966647", "0.5961302", "0.5959317", "0.5950024", "0.5948847", "0.5945873", "0.5944632", "0.59406793", "0.5921408", "0.5918024", "0.59161496", "0.59105694", "0.59097654", "0.5906107", "0.5903786", "0.59027743", "0.5892598", "0.58887374", "0.5882924", "0.58781624", "0.58734417", "0.5868607", "0.5867023", "0.5865247", "0.5865229", "0.5860233", "0.5853646", "0.58470434", "0.5842966", "0.58399665", "0.5838343", "0.58316076", "0.58261985", "0.58251226", "0.58231145", "0.5819242", "0.58169144", "0.5807154", "0.5807071", "0.5803734", "0.57997423", "0.5790384", "0.578915", "0.57876545", "0.5785787", "0.5781771", "0.57745093", "0.5771107", "0.5767506", "0.57642925", "0.57594943", "0.57573605", "0.5739943", "0.57391757", "0.57382923" ]
0.7134872
1
Find the maximum value of a range needed to search based on a precursor mass
public Double findMaxMassRange(Double mass, Double mzTol) { return (mass + mzTol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Double findMaxPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass + ((ppm/1000000.0)*mass));\n\t}", "public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}", "double getMax();", "double getMax();", "Double getMaximumValue();", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "int getMaximum();", "E maxVal();", "public int findMax(){\n return nilaiMaks(this.root);\n }", "public abstract int getMaximumValue();", "public Double findMinMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass - mzTol);\n\t}", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "int getMaxMP();", "Integer getMaximumResults();", "private double densityMax(int k, int m) {\n return (k >= m) ? 2 - (k - 1.0) / (m - 1) : 1;\n }", "public double getMaxRange() {\n return maxRange;\n }", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "public static void findMinMax(Student[] student){\n int minMidterm=student[0].getExamGrade().getMidtermExamGrade();//this is first step to find min value of midterm because I describe first index of midterm value in array\n int maxMidterm=student[0].getExamGrade().getMidtermExamGrade();//this is first step to find max value of midterm because I describe first index of midterm value in array\n int minFinal=student[0].getExamGrade().getFinalExamGrade();//this is first step to find min value of final because I describe first index of final value in array\n int maxFinal=student[0].getExamGrade().getFinalExamGrade();//this is first step to find max value of final because I describe first index of final value in array\n\n for(int i=0;i<student.length;i++){\n if(student[i].getExamGrade().getMidtermExamGrade()<minMidterm){ // this condution find min value of midterm until this step \n minMidterm=student[i].getExamGrade().getMidtermExamGrade();\n }\n if(student[i].getExamGrade().getMidtermExamGrade()>maxMidterm){// this condution find max value of midterm until this step \n maxMidterm=student[i].getExamGrade().getMidtermExamGrade();\n }\n if(student[i].getExamGrade().getFinalExamGrade()<minFinal){// this condution find min value of final until this step \n minFinal=student[i].getExamGrade().getFinalExamGrade();\n }\n if(student[i].getExamGrade().getFinalExamGrade()>maxFinal){// this condution find max value of final until this step \n maxFinal=student[i].getExamGrade().getFinalExamGrade();\n }\n }\n\n System.out.println(\"Maximum Midterm Exam Grade: \"+maxMidterm+\" Minumum Midterm Exam Grade: \"+minMidterm);\n System.out.println(\"Maximum Final Exam Grade: \"+maxFinal+\" Minumum Final Exam Grade: \"+minFinal);\n }", "private static void findMaxKi67(){\n int cellNum=0;//total cells in region\n Ki67=0;//total Ki67 in region\n float maxdivR=0;//tracks maximum Ki67 over all regions\n int[] inds = {0,0};//tracks indexes of maximum ki67\n for(int i=0;i<Data.aMX;i++){//loop over regions and find max activity\n for (int j = 0; j < Data.aMY; j++) {\n if(Data.activityMesh[i][j]>maxdivR){\n maxdivR=1.f*Data.activityMesh[i][j];\n inds[0]=i;\n inds[1]=j;\n }\n }\n }\n //redefine histology section based on maximum activity area\n Pars.histX=inds[0]*Pars.histSizeX;\n Pars.histY=inds[1]*Pars.histSizeY;\n for (int i = 0; i <cells.size(); i++) {//find %ki67 within max region\n Cell cell = (Cell) cells.get(i);\n //only count mass cells within the region of interest\n if(cell.mass && cell.x>=Pars.histX && cell.x<=Pars.histX+Pars.histSizeX && cell.y>=Pars.histY && cell.y<=Pars.histY+Pars.histSizeY) {\n Ki67+=cell.ki67;//add Ki67 val in area\n cellNum+=1;//add total cells in area\n }\n }\n Functions.writeFloat(Pars.outFile+\"data/Ki.txt\",Ki67/cellNum);//write to file\n }", "long getMaxItemFindings();", "public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }", "double getRight(double max);", "public long getPropertyBalanceMax();", "int getMax();", "public int getCustomerMaxTargetFloor();", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "public int getMaxFloor();", "@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "private int getPRFurthestUse() {\n int max = -1;\n int maxPR = -1;\n for (int i = 0; i < numPhysRegs - 1; i++) {\n if (PRNU[i] > max) {\n max = PRNU[i];\n maxPR = i;\n }\n }\n return maxPR; // no free physical register\n }", "public float getMaxAlturaCM();", "int range(){\n return fuelcap*mpg;\n }", "java.math.BigDecimal getWBMaximum();", "public int GetMaxVal();", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public int getMaxRange() {\n\t\treturn max_range;\n\t}", "public int getMax(){\n return tab[rangMax()];\n }", "Double maxOfDisplacements(ArrayList<Double> dispA){\r\n\t\tObject minvalobj = Collections.min(dispA);\r\n\t\tObject maxvalobj = Collections.max(dispA);\r\n\t\tIJ.log(\"Max displacement\" + maxvalobj);\r\n\t\tIJ.log(\"Min displacement\" + minvalobj);\r\n\t\tdouble minval = (Double) minvalobj;\r\n\t\tdouble maxval = (Double) maxvalobj;\t\t\r\n\t\tdouble maxdisp = maxval;\r\n\t\tif (Math.abs(maxval) < Math.abs(minval)) \r\n\t\t\tmaxdisp = minval;\r\n\t\telse\r\n\t\t\tmaxdisp = maxval;\t\t\r\n\t\treturn maxdisp;\r\n\t}", "org.apache.xmlbeans.XmlDecimal xgetMaximum();", "java.math.BigDecimal getMaximum();", "public double getMaximumScore() {\n return 0.9; // TODO: parameter\n }", "public Money findMaxPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney max = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (max.compareTo(current) == -1 || !flag) {\n\t\t\t\tmax = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn max;\n\t}", "int getMax( int max );", "public Factura getMaxNumeroFactura();", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "private int findMax(int begin, int end) {\n // you should NOT change this function\n int max = array[begin];\n for (int i = begin + 1; i <= end; i++) {\n if (array[i] > max) {\n max = array[i];\n }\n }\n return max;\n }", "private int max(int profondeur)\n\t{\n\t\tif(profondeur == 0 || grille.fin())\n\t\t{\n\t\t\treturn eval();\n\t\t}\n\t\tint max_val = -1000;\n\t\tfor(int y = 0; y < grille.getTaille(); y++)\n\t\t{\n\t\t\tfor(int x = 0; x < grille.getTaille(); x++)\n\t\t\t{\n\t\t\t\tCoordonnee test = new Coordonnee(x, y);\n\t\t\t\tif(grille.getCase(test).getContenu() == grille.getCaseVide())\n\t\t\t\t{\n\t\t\t\t\tgrille.jouer(test, getPion());\n\t\t\t\t\tint val = min(profondeur-1);\n\t\t\t\t\t//System.out.println(x + \" \" + y + \" : \" + val);\n\t\t\t\t\t//grille.afficher();\n\t\t\t\t\tif(val > max_val)\n\t\t\t\t\t{\n\t\t\t\t\t\tmax_val = val;\n\t\t\t\t\t}\n\t\t\t\t\tannuler(test);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn max_val;\n\t}", "int max();", "public Integer getMax() {\n\t\t\tif (hotMinMax) {\n\t\t\t\tConfigValue rawMinMax = new ConfigValue();\n\t\t\t\ttry {\n\t\t\t\t\trawSrv.getCfgMinMax(name, rawMinMax);\n\t\t\t\t\t// TODO: FIX HERE\n\t\t\t\t\treturn 100;\n\t\t\t\t} catch (TVMException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn new Integer(max);\n\t\t\t}\n\t\t\t// ....\n\t\t\treturn 100;\n\t\t}", "public double calcularAlvoMaximo() {\r\n\t\treturn calcularFrequenciaMaxima()*0.85;\r\n\t}", "public double getMaximumValue() { return this.maximumValue; }", "public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}", "public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (last-first)/2;\r\n\t\t\t\r\n\t\t\tif(A[mid]>A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\treturn A[mid];\r\n\t\t\telse if(A[mid]>A[mid-1] && A[mid]<A[mid+1])\r\n\t\t\t\tfirst=mid+1;\r\n\t\t\telse if(A[mid]<A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\tlast=mid-1;\r\n\t\t\telse return -1;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n\t\r\n}", "float xMax();", "int maxNoteValue();", "public long findMax(long[] incomes) {\n long current_max_index = 0;\n long current_max = incomes[0];\n for (long income : incomes)\n if (current_max < income)\n current_max = income;\n return current_max;\n }", "public int findMaxValue() {\n\t\treturn findMaxValue( this );\n\t}", "public int getMaximumPoints();", "public double getXRangeMax() {\n return xRangeMax;\n }", "int getMaxStamina();", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "public double getRangeToBestTarget()\n\t{\n\t\treturn getRangeToTarget(currentBestTarget);\n\t}", "public static int findMax(Integer[] X, int low, int high)\n\t\t{if (low + 1 > high) {return X[low];}\n\t\telse {return Math.max(Math.abs(X[low]), Math.abs(findMax(X, low + 1, high)));}\n\t\t}", "public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }", "private static int maxMp(int mp){\r\n int mMP = 0;\r\n mMP = mp + 5;\r\n return mMP;\r\n }", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "public double getMaximumDouble() {\n/* 255 */ return this.max;\n/* */ }", "private static final double maxDecel(double speed) {\n return limit(1, speed * 0.5 + 1, 2);\n }", "org.apache.xmlbeans.XmlDecimal xgetWBMaximum();", "@JSProperty(\"maxRange\")\n double getMaxRange();", "private long getAbsMax() {\n return Math.max(Math.abs(Visualizer.getLowerBound().get()),\n Visualizer.getUpperBound().get());\n }", "private int findMaxValue( XTreeNode<E> rootNode ) {\n\t\tif( rootNode == null ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\n\t\tint rootValue = (Integer) rootNode.getData();\n\t\tint maxValue = rootValue;\n\n\t\tint leftValue = findMaxValue( rootNode.getLeftChild() );\n\t\tint rightValue = findMaxValue( rootNode.getRightChild() );\n\n\t\t// not using if else if, as need to compare three values - root, left, right\n\t\tif( leftValue > rootValue ) {\n\t\t\tmaxValue = leftValue;\n\t\t}\n\t\tif( rightValue > maxValue ) {\n\t\t\tmaxValue = rightValue;\n\t\t}\n\t\treturn maxValue;\n\t}", "public int getMaximumEPC(int metadata);", "private StreamEvent findIfActualMax(AttributeDetails latestEvent) {\n int indexCurrentMax = valueStack.indexOf(currentMax);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMax;\n // If latest event is at a distance greater than maxPostBound from max, max is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMax.notEligibleForRealMax();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", 0, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMax.getValue() - currentMax.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMax - preBound >= 0) {\n if (valueStack.get(indexCurrentMax - preBound).getValue() <= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", preBound, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore max is not eligible to be sent as output.\n currentMax.notEligibleForRealMax();\n return null;\n }", "Expression getMax();", "public float getMaxCY5();", "public final boolean searchMaximum(){\r\n\t\tif (!initialized()) minimum=false;\r\n\t\treturn !minimum;\r\n\t}", "private float calculateMaxValue(int[] probes) {\r\n float max = 0f;\r\n float value;\r\n final int samples = experiment.getNumberOfSamples();\r\n for (int sample=0; sample<samples; sample++) {\r\n for (int probe=0; probe<probes.length; probe++) {\r\n value = experiment.get(probes[probe], sample);\r\n if (!Float.isNaN(value)) {\r\n max = Math.max(max, Math.abs(value));\r\n }\r\n }\r\n }\r\n return max;\r\n }", "private static double search(double min, double max, Function f) {\n\t\tdouble a = min;\n\t\tdouble c = max;\n\t\tdouble b = 0;\n\t\twhile (Math.abs(c - a) > MIN_DIFFERENCE) {\n\t\t\tb = (a + c) / 2;\n\t\t\tdouble fa = f.f(a);\n\t\t\tdouble fc = f.f(c);\n\t\t\t\n\t\t\tif (fa < fc) {\n\t\t\t\tc = b;\n\t\t\t} else {\n\t\t\t\ta = b;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn b;\n\t}", "double getMax() {\n\t\t\treturn value_max;\n\t\t}", "private double getMaxThreshold() {\n return maxThreshold;\n }", "private double getMaxOfPool(double[][] input, int rowStart, int colStart,\n int spatialExtent) {\n double max = input[rowStart][colStart];\n for (int row = rowStart; row < rowStart + spatialExtent; row++) {\n for (int col = colStart; col < colStart + spatialExtent; col++) {\n max = Math.max(max, input[row][col]);\n }\n }\n return max;\n }", "String getMax_res();", "public int getMaximumAir ( ) {\n\t\treturn extract ( handle -> handle.getMaximumAir ( ) );\n\t}", "@Override\n\tpublic int select_arm() {\n\t\tint countsSum = 0;\n\t\t\n\t\tfor(int arm : m_counts){\n\t\t\tif(arm == 0) return arm;\n\t\t\tcountsSum += arm;\n\t\t}\n\t\t\n\t\tdouble max = 0;\n\t\tint max_indx = 0;\n\t\tfor(int i = 0; i<m_counts.length; i++){\n\t\t\tdouble bonus = Math.sqrt((2 * Math.log(countsSum)) / m_counts[i]);\n\t\t\tdouble ucb_value = m_values[i] + bonus;\n\t\t\tif(ucb_value > max){ \n\t\t\t\tmax = ucb_value;\n\t\t\t\tmax_indx = i;\n\t\t\t}\n\t\t}\n\t\treturn max_indx;\n\t}", "public static int indexOfMaxInRange(int start, int end, double[] data)\r\n\t{\r\n\t\tint maxx=start;\r\n\t\tfor(int i=start;i<end;i++)\r\n\t\t{\r\n\t\t\tif(data[i]>data[maxx])\r\n\t\t\t\tmaxx=i;\r\n\t\t}\r\n\t\treturn maxx;\r\n\t}", "private static int findNext(List<List<Integer>> m, int k, int val)\n {\n int res = -1;\n int base = val % 100;\n // we ignore one-digit base (meaning no base can start with zero)\n if (base < 10) {\n return res;\n }\n\n int min = base * 100;\n int max = (base + 1) * 100;\n List<Integer> list = m.get(k);\n Iterator<Integer> iter = list.iterator();\n while (iter.hasNext()) {\n int n = iter.next();\n if (n >= max) {\n break;\n }\n if (n >= min) {\n res = n;\n break;\n }\n }\n return res;\n }", "public double getMaximum() {\n return (max);\n }", "int getMaxMana();", "public int getMinimun(){\n int lowGrade = grades[0]; //assume que grades[0] é a menor nota\n \n //faz um loop pelo array de notas\n for(int grade: grades){\n //se nota for mais baixa que lowGrade, essa note é atribuida a lowGrade\n if(grade < lowGrade){\n lowGrade = grade;\n }\n }\n \n return lowGrade;\n }", "public static int getMax(ArrayList<QuoteShort> data, int begin, int end) {\n\t\t\r\n\t\tint max = -1;\r\n\t\tint maxIndex = -1;\r\n\t\tif (begin<=0) begin = 0;\r\n\t\tfor (int i=begin;i<=end;i++){\r\n\t\t\tif (data.get(i).getHigh5()>=max){\r\n\t\t\t\tmax = data.get(i).getHigh5();\r\n\t\t\t\tmaxIndex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn maxIndex;\r\n\t}", "private static int upperBound(int[] A, int target) {\n int max = A.length;\n int min = -1;\n while (max - min > 1) {\n int mid = ( max + min ) / 2;\n if(A[mid] <= target) {\n min = mid;\n } else {\n max = mid;\n }\n }\n\n return max;\n\n }", "private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}", "public int getMaxTotalCost();", "private double getMaxNumber(ArrayList<Double> provinceValues)\n {\n Double max = 0.0;\n\n for (Double type : provinceValues)\n {\n if (type > max)\n {\n max = type;\n }\n }\n return max;\n }" ]
[ "0.74460304", "0.64273006", "0.64234567", "0.64234567", "0.6299311", "0.6270026", "0.6254972", "0.6230822", "0.6148608", "0.61442006", "0.61428", "0.61302394", "0.61302394", "0.61302394", "0.61302394", "0.61302394", "0.61302394", "0.6093566", "0.6076707", "0.6027815", "0.6000108", "0.59859115", "0.59846675", "0.5979359", "0.59708863", "0.5955293", "0.5955164", "0.5954456", "0.59424585", "0.59217477", "0.59083587", "0.59077525", "0.58823293", "0.58701015", "0.5859381", "0.58475965", "0.5845068", "0.5841475", "0.5839902", "0.5838495", "0.58339375", "0.5830858", "0.5828844", "0.5820195", "0.58158016", "0.5811644", "0.58067554", "0.5803187", "0.57919246", "0.57915545", "0.5761078", "0.575911", "0.57573676", "0.5753623", "0.57514083", "0.57498944", "0.57484305", "0.5738904", "0.57368416", "0.57331675", "0.5721718", "0.57146823", "0.5703219", "0.5701904", "0.56985885", "0.56660485", "0.5664485", "0.566372", "0.56595683", "0.5655852", "0.56525254", "0.56520563", "0.5636366", "0.5634702", "0.563014", "0.562631", "0.56217986", "0.56144106", "0.56128573", "0.56049013", "0.5597434", "0.5590082", "0.55719113", "0.5566851", "0.55605173", "0.55593127", "0.55564606", "0.55535793", "0.55506307", "0.55478185", "0.55441076", "0.5538968", "0.5537956", "0.5536431", "0.55338746", "0.5515066", "0.5513759", "0.5510846", "0.5510236", "0.5506328" ]
0.7233915
1
A method to bin all precursor masses
public void binMasses() { //Create arrays createBins(calcArraySize(massBinSize,minMass, maxMass)); //Check if any spectra from each polarity has been created if (librarySpectra.size()>0) { //Populate count array to correctly initialize array size for positive library spectra for (int i=0; i<librarySpectra.size(); i++) { countBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++; } updateProgress(17,"% - Creating Composite Library",true); //Use count bin to initialize new arrays to place positive spectra into hash table for (int i=0; i<countBin.length; i++) { massBin[i] = new LibrarySpectrum[countBin[i]]; } updateProgress(33,"% - Creating Composite Library",true); //Populate spectrum arrays for positive spectra for (int i=0; i<librarySpectra.size(); i++) { massBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] [addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i); addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++; } updateProgress(50,"% - Creating Composite Library",true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}", "public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}", "public int[] getMinimos()\n {\n return brazo.getMinimos();\n }", "protected static float[] getBinomialKernelSigmaZeroPointSevenOne() {\n float a = 1.f/200.f;\n return new float[]{9*a, 83*a, 0, -83*a, -9*a};\n }", "public void plantBombsInEmptyCells() {\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tgrid[i][j] = ( grid[i][j] < 0 ? 0 : grid[i][j] );\n\t\t\t}\n\t\t}\n\t}", "void genPromote(Collection ret, int from, int to, int bits) {\n\tfor (char i = KNIGHT; i <= QUEEN; ++i) {\n\tBouger g = new Bouger(from, to, i, (bits | 32), 'P');\n\tg.setScore(1000000 + (i * 10));\n\tret.add(g);\n\t}\n\t}", "int xBins();", "protected static float[] getBinomialKernelSigmaOne() {\n float a = 1.f/16.f;\n return new float[]{2*a, 4*a, 0, -4*a, -2*a};\n }", "public void computeNumberOfBombs() {\n\t\tfor (int row = 0; row < numRows; row++) {\n\t\t\tfor (int col = 0; col < numCols; col++) {\n\t\t\t\tint n = 0;\n\t\t\t\tn += isBombAt(row - 1, col - 1);\n\t\t\t\tn += isBombAt(row - 1, col);\n\t\t\t\tn += isBombAt(row - 1, col + 1);\n\t\t\t\tn += isBombAt(row, col - 1);\n\t\t\t\tn += isBombAt(row, col + 1);\n\t\t\t\tn += isBombAt(row + 1, col - 1);\n\t\t\t\tn += isBombAt(row + 1, col);\n\t\t\t\tn += isBombAt(row + 1, col + 1);\n\t\t\t\ttable[row][col].setNumberOfBombsAround(n);\n\t\t\t}\n\t\t}\n\t}", "public static float[] getBinomialKernelSigmaZeroPointFive() {\n //1 -1 norm=0.5\n return new float[]{0.5f, 0.0f, -0.5f};\n }", "private void tileSetSurroundingBombs() {\r\n for (int r = 0; r < gridSize; r++) {\r\n for (int c = 0; c < gridSize; c++) {\r\n int neighborBombs = neighborBombCount(grid[r][c]);\r\n grid[r][c].setSurroundingBombs(neighborBombs);\r\n }\r\n } \r\n }", "public void normalize() {\r\n\t\tfor (int i = 0; i<no_goods; i++) {\t\t\t\r\n\t\t\tfor (IntegerArray r : prob[i].keySet()) {\t\t\t\t\r\n\t\t\t\tdouble[] p = prob[i].get(r);\r\n\t\t\t\tint s = sum[i].get(r);\r\n\t\t\t\t\r\n\t\t\t\tfor (int j = 0; j<p.length; j++)\r\n\t\t\t\t\tp[j] /= s;\r\n\t\t\t}\r\n\r\n\t\t\t// compute the marginal distribution for this good\r\n\t\t\tfor (int j = 0; j<no_bins; j++)\r\n\t\t\t\tmarg_prob[i][j] /= marg_sum;\r\n\t\t}\r\n\t\t\r\n\t\tready = true;\r\n\t}", "public void fillBins() {\n\t\t// grab our current data and then transpose it\n\t\tList<List<String>> currentData = dc.getDataFold().get(currentFold);\n\t\tList<List<String>> tranData = dc.transposeList(currentData);\n\t\tfor (int row = 0; row < tranData.size(); row++) {\n\t\t\t// for each row of attribute values, discretize it\n\t\t\tList<Double> procData = new ArrayList<>();\n\t\t\t// for each String of raw data, convert it into a value to place into a bin\n\t\t\tfor (String rawData : tranData.get(row)) {\n\t\t\t\tif (rawData.chars().allMatch(Character::isDigit) || rawData.contains(\".\")) {\n\t\t\t\t\tprocData.add(Double.parseDouble(rawData));\n\t\t\t\t} else {\n\t\t\t\t\t// not perfect, but useable in the small domain of values we use for data\n\t\t\t\t\tprocData.add((double) rawData.hashCode());\n\t\t\t\t} // end if-else\n\t\t\t} // end for\n\n\t\t\t// for each value we have, place it into a corresponding bin\n\t\t\tfor (double value : procData) {\n\t\t\t\tfor (Bin bin : attribBins.get(row)) {\n\t\t\t\t\tif (bin.binContains(value)) {\n\t\t\t\t\t\tbin.incrementFreq();\n\t\t\t\t\t} // end if\n\t\t\t\t} // end for\n\t\t\t} // end for\n\t\t} // end for\n\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public static int[][] getMatrizBin(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n int[][] output = new int[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = 1;\r\n } else {\r\n output[x][y] = 0;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }", "protected static float[] getBinomialKernelSigmaOneSQRT2() {\n float a = 1.f/256.f;\n return new float[]{a*3, a*12, a*27, a*28,\n 0, -28*a, -27*a, -12*a, -3*a};\n }", "public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }", "private void computeHistogramBins() {\r\n int nBins = (int) Math.ceil(hismax / binWidth);\r\n histoBins = new double[nBins];\r\n for (int i = 0; i < nBins; i++) {\r\n histoBins[i] = binWidth * (double) i + binWidth;\r\n }\r\n }", "private List<Bin> discretizeRow(List<String> rawData) {\n\t\tList<Bin> binForThisAttr = new ArrayList<>();\n\t\tList<Double> procData = new ArrayList<>();\n\t\t// are we working with numbers or actual Strings\n\t\t// convert strings into Double, add to data attributes\n\t\tfor (int i = 0; i < rawData.size(); i++) {\n\t\t\tString raw = rawData.get(i);\n\t\t\t// check current attribute value for String type or floating point type\n\t\t\tif ((rawData.get(i).chars().allMatch(Character::isDigit) || rawData.get(i).contains(\".\"))) {\n\t\t\t\t//convert number strings into Doubles, or strings into unique Doubles\n\t\t\t\tprocData.add(Double.valueOf(raw));\n\t\t\t} else {\n\t\t\t\t// convert Strings into unique integers, add to data attributes\n\t\t\t\tprocData.add((double) raw.hashCode());\n\t\t\t} // end if-else\n\t\t}\n\n\t\t// sort data into ascending list of values\n\t\tCollections.sort(procData);\n\n\t\t// generate bins based on Naive Estimator Process\n\t\tfor (int i = 0; i < procData.size(); i++) {\n\t\t\tif (i == 0) {\n\t\t\t\t// append bin with lowest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(Double.MIN_VALUE, procData.get(i), i));\n\t\t\t\t// binForThisAttr.get(binForT i = 0; i hisAttr.size() - 1).incrementFreq();\n\t\t\t} else if (i == procData.size() - 1) {\n\t\t\t\t// append bin with highest possible value\n\t\t\t\tbinForThisAttr.add(new Bin(procData.get(i), Double.MAX_VALUE, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} else {\n\t\t\t\t// estimate the range of bin based on nearby points of data\n\t\t\t\tdouble lowBound = (procData.get(i - 1) + procData.get(i)) / 2;\n\t\t\t\tdouble highBound = (procData.get(i) + procData.get(i + 1)) / 2;\n\t\t\t\tbinForThisAttr.add(new Bin(lowBound, highBound, i));\n\t\t\t\t// binForThisAttr.get(binForThisAttr.size() - 1).incrementFreq();\n\t\t\t} // end if-else statement\n\t\t} // end for\n\t\treturn binForThisAttr;\n\t}", "public Binarization(int threshold) {\n this.threshold = threshold;\n }", "private int[] buscarMenores(ArrayList<ArbolCod> lista){\n int temp;\n int m1=1;\n int m2=0;\n float vm1,vm2,aux;\n \n vm1=lista.get(m1).getProbabilidad();\n vm2=lista.get(m2).getProbabilidad();\n if (vm1<=vm2){\n temp=m1;\n m1=m2;\n m2=temp;\n } \n for (int i=2;i<lista.size();i++){\n vm1=lista.get(m1).getProbabilidad();\n vm2=lista.get(m2).getProbabilidad();\n aux=lista.get(i).getProbabilidad();\n if (aux<=vm2){\n m1=m2;\n m2=i;\n } \n else if (aux<=vm1){\n m1=i;\n }\n }\n int[] res=new int[2];\n res[0]=m1;\n res[1]=m2;\n return res;\n }", "Long getResultMaskBoundary();", "private void coins_a1B(){\n\t\tthis.cube[22] = this.cube[9]; \n\t\tthis.cube[9] = this.cube[45];\n\t\tthis.cube[45] = this.cube[36];\n\t\tthis.cube[36] = this.cube[0];\n\t\tthis.cube[0] = this.cube[22];\n\t}", "public List<B> getBins() {\n return ImmutableList.copyOf(bins);\n }", "static void initBin(int[] binToInt)\n {\n for(int i = 0; i < 32; i++)\n {\n binToInt[i] = 0;\n }\n }", "int bubbleBeam();", "private int[] calculateMomentum(byte state){\n //pull out each particle.\n\n //each particle has an x and y momentum based on its direction\n //1 x = 1, y = 0\n //2 x = cos(pi/3), y = sin(pi/3)\n //3 x = cos(2pi/3), y = sin(2pi/3)\n //4 x = -1, y = 0\n //5 x = cos(4pi/3), y = sin(4pi/3)\n //6 x = cos(5pi/3), y = sin(5pi/3)\n\n\n// double x = 0.0;\n// double y = 0.0;\n//\n// double arg = 0.0;\n// for(int n = 0; n < SMASKS.length; n++){\n// if((incomingState & SMASKS[n]) == SMASKS[n]){\n// arg = (n*Math.PI)/3;\n// x += BigDecimal.valueOf(Math.cos(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// y += BigDecimal.valueOf(Math.sin(arg)).setScale(5, BigDecimal.ROUND_DOWN).doubleValue();\n// }\n// }\n// return new double[]{x, y};\n\n //each particle has an x and y momentum based on its direction\n //1 x = 100, y = 0000\n //2 x = 050, y = 087\n //3 x = -050, y = 087\n //4 x = -100, y = 000\n //5 x = -050, y = -087\n //6 x = 050, y = -087\n\n int x = 0;\n int y = 0;\n\n for(int n = 0; n < SMASKS.length; n++){\n if((state & SMASKS[n]) == SMASKS[n]){\n x += xm[n];\n y += ym[n];\n }\n }\n return new int[]{x, y};\n }", "public static void main(String args[]) throws IOException {\n Scanner s = new Scanner (System.in);\n int t = s.nextInt();\n while(t-- > 0)\n {\n int k = s.nextInt();\n int bucket_width [] = new int[k];\n for(int i = 0; i < k; i++)\n bucket_width[i] = s.nextInt();\n \n int n = s.nextInt();\n int balls_width[] = new int[n];\n for(int i = 0; i < n; i++)\n balls_width[i] = s.nextInt();\n \n int ball_bucket[] = new int[k];\n \n \n for(int i = 0; i < k; i++)\n ball_bucket[i] = 0;\n \n \n int j = 0;\n for(int i = 0; i < n; i++)\n {\n \n for( j = k - 1; j >= 0; j--)\n {\n if(bucket_width[j] >= balls_width[i] && ball_bucket[j] <= j )\n {\n ball_bucket[j] += 1;\n System.out.print(j + 1 + \" \");\n break;\n }\n }\n if(j < 0)\n System.out.print(\"0\" + \" \");\n }\n System.out.println();\n }\n }", "private Vector3D convexCellBarycenter(final Vertex start) {\n\n int n = 0;\n Vector3D sumB = Vector3D.ZERO;\n\n // loop around the cell\n for (Edge e = start.getOutgoing(); n == 0 || e.getStart() != start; e = e.getEnd().getOutgoing()) {\n sumB = new Vector3D(1, sumB, e.getLength(), e.getCircle().getPole());\n n++;\n }\n\n return sumB.normalize();\n\n }", "private void coins_a1W(){\n\t\tthis.cube[4] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[26];\n\t\tthis.cube[26] = this.cube[38];\n\t\tthis.cube[38] = this.cube[27];\n\t\tthis.cube[27] = this.cube[4];\n\t}", "public SmartBin() {\n items = new ItemType[7];\n curWeight = 0;\n curArrayIndex = 0;\n binNumber = \"SM\" + generateBinNumber();\n }", "public void startParallelBombing() {\n\t\tint x = _count;\n\t\t_active = true;\n\t\twhile (_active && x-- > 0) {\n\t\t\tparallelBomb(_count - x);\n\t\t}\n\t\t_active = false;\n\t}", "private int[] bestFitModified(int[] chromosome) {\n\t\tint[] bins = new int[binCount];\n\t\tArrayList<Integer> cannotPackList = new ArrayList<Integer>();\n\n\t\t//honor chromosome listing when possible\n\t\tfor (int i = 0; i < chromosome.length; i++) {\n\t\t\t//if this bin isnt full & won't be after placement & this chrom hasnt gone off the end \n\t\t\t//(VERY RARE, only happens when binCount is reduced w/ elitism)\n\t\t\tif (chromosome[i] < bins.length && bins[chromosome[i]] + packageWeights[i] <= binSize) {\n\t\t\t\tbins[chromosome[i]] += packageWeights[i]; //put package into bin\n\t\t\t} else { //store those we can't honor\n\t\t\t\tchromosome[i] = -1;\n\t\t\t\tcannotPackList.add(new Integer(i)); //save all those packages whos original bins were full\n\t\t\t}\n\t\t}\n\n\t\t//best fit on all the rest whos bins were full up\n\t\tint tries = 0;\n\t\tfor (int j = 0; j < cannotPackList.size(); j++) {\n\t\t\tint i = cannotPackList.get(j);\n\t\t\tint bestBinIndex = -1;\n\n\t\t\twhile (bestBinIndex < 0 && tries < bins.length * 2) { //while we still havent found a bin to put this in and time isn't up\n\n\t\t\t\tint bestBinLeftOverSpace = binSize * 100; //how much space is left in the bin when the packages is placed in it (ideally 0 = full bin)\n\n\t\t\t\tfor (int bin = 0; bin < bins.length; bin++) {\n\t\t\t\t\t//if this bin is closer to full than the best bin and not overfilled save it\n\t\t\t\t\tif ((binSize - (bins[bin] + packageWeights[i])) >= 0 && (binSize - (bins[bin] + packageWeights[i])) < bestBinLeftOverSpace) {\n\t\t\t\t\t\tbestBinIndex = bin;\n\t\t\t\t\t\tbestBinLeftOverSpace = binSize - (bins[bin] + packageWeights[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bestBinIndex < 0) { //if could not pack, dump out a bin (mutation)\n\t\t\t\t\tj = 0;\n\t\t\t\t\tint dumpBin = rand.nextInt(binCount);\n\t\t\t\t\tfor (int binIndex = dumpBin; binIndex < binCount; binIndex++) {\n\t\t\t\t\t\tbins[binIndex] = 0;\n\t\t\t\t\t\tfor (int chromIndex = 0; chromIndex < chromosome.length; chromIndex++) {\n\t\t\t\t\t\t\tif (chromosome[chromIndex] == binIndex) {\n\t\t\t\t\t\t\t\tchromosome[chromIndex] = -1;\n\t\t\t\t\t\t\t\tcannotPackList.add(new Integer(chromIndex));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\ttries++;\n\t\t\t}\n\n\t\t\tif (tries >= bins.length * 2) {\n\t\t\t\treturn null; //this chromosome is unsalvageable because it is impossible to fit the packages in the bins\n\t\t\t}\n\n\n\t\t\tbins[bestBinIndex] += packageWeights[i];\n\t\t\tchromosome[i] = bestBinIndex;\n\t\t\tcannotPackList.remove(j);\n\t\t\tj--;\n\t\t}\n\n\t\treturn chromosome;\n\t}", "public static BufferedImage binaritzation(BufferedImage image, int thrs) {\n //3-position array where we store R,G,B values of every pixel\n int[] colors;\n int[] black = new int[3];\n int[] white = new int[3];\n for (int i = 0; i < 3; i++) {\n black[i] = 0;\n white[i] = 255;\n }\n //We create a tesela so we can modify the image pixels\n WritableRaster bitmap = (WritableRaster) image.getData();\n WritableRaster tesela = bitmap.createWritableChild(image.getMinX(), image.getMinY(), image.getWidth(), image.getHeight(), 0,0, null);\n //We compute the mean of every pixel so we can decide if its black or white\n double mean;\n //Image iteration pixel by pixel\n for (int x = 0; x < image.getWidth(); x++){\n for (int y = 0; y < image.getHeight(); y++) {\n colors = getPixelColor(image,x,y);\n mean = colors[0] + colors[1] + colors[2];\n mean = mean/3;\n if (mean <= thrs) {\n bitmap.setPixel(x,y,black);\n } else {\n bitmap.setPixel(x,y,white);\n }\n }\n }\n //Create the binarized image and return it\n BufferedImage subImage = new BufferedImage(image.getColorModel(),tesela,image.isAlphaPremultiplied(),null);\n return subImage;\n }", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "private void coins_a1R(){\n\t\tthis.cube[13] = this.cube[51]; \n\t\tthis.cube[51] = this.cube[20];\n\t\tthis.cube[20] = this.cube[2];\n\t\tthis.cube[2] = this.cube[29];\n\t\tthis.cube[29] = this.cube[13];\n\t}", "private void coins_a2B(){\n\t\tthis.cube[22] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[51];\n\t\tthis.cube[51] = this.cube[42];\n\t\tthis.cube[42] = this.cube[6];\n\t\tthis.cube[6] = this.cube[22];\n\t}", "public static byte[] byMassFromMinerals(Rock rock) {\n return byMassFromMinerals(rock.getMinerals(), rock.getFractions());\n }", "private void cuentaminas() {\n\t//TODO: falta por hacer que calcule lasminas en el borde exterior\n\t//Probar a hacerlo con un try catch\n\tint minas = 0;\n\n\tfor (int i = 0; i < filas; i++) {\n\t for (int j = 0; j < columnas; j++) {\n\t\t//\t1 2 3\n\t\t//\t4 X 5\n\t\t//\t6 7 8\n\t\ttry {\n\t\t minas += arrayBotones[i - 1][j - 1].getMina();//1\n\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i - 1][j].getMina();//2\n\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i - 1][j + 1].getMina();//3\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i][j - 1].getMina();//4\n\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i][j + 1].getMina();//5\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i + 1][j - 1].getMina();//6 \t\t \n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i + 1][j].getMina();//7\n\t\t} catch (Exception e) {\n\t\t}\n\t\ttry {\n\t\t minas += arrayBotones[i + 1][j + 1].getMina();//8\n\t\t} catch (Exception e) {\n\t\t}\n\t\tarrayBotones[i][j].setNumeroMinasAlrededor(minas);\n\t\t//TODO: comentar la siguiente parte para que no aparezcan los numeros al iniciar\n//\t\tif (arrayBotones[i][j].getMina() == 0 && minas != 0) {\n//\t\t arrayBotones[i][j].setText(String.valueOf(minas));\n//\t\t}\n\t\tminas = 0;\n\t }\n\t}\n }", "public int getStartingBombs() {\n \t\treturn 1;\n \t}", "private void BScreate() {\n\n\t\tint sum=0;//全枝数のカウント\n\t\tfor(int i=0;i<banknode;i++) sum+=Bank.get(i).deg;\n\n\t\t//e,d,nの決定\n\t\tif(NW==\"BA\"){\n\t\tfor(int i=0;i<banknode;i++) {\n\t\t\tBank.get(i).totalassets=E*((double)Bank.get(i).deg/(double)sum);\n\t\t\tBank.get(i).n=Bank.get(i).totalassets*Bank.get(i).CAR;\n\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t}\n\t\t}\n\n\t\tif(NW==\"CM\"){\n\t\t\tfor(int i=0;i<banknode;i++){\n\t\t\t\tBank.get(i).totalassets=E/banknode;\n\t\t\t\tBank.get(i).n=Bank.get(i).totalassets*asyCAR;\n\t\t\t\tBank.get(i).forcelev=megaCAR;\n\t\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t\t}\n\n\t\t}\n\n\t}", "public void binarycon()\n \t {\n\n\t int i,j,k,t;\n \t int temp[]=new int[10];\n\t int m=0;\n for(i=0;i<600000;i++)\n binary[i]=0;\n int b[]=new int[32];\n int dum;\n dum=max;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=24-i;\n for(k=j,t=i-1;k<(i+j);k++,t--)\n binary[k]=b[t];\n dum=73;\n i=0;\n while(dum!=0)\n {\n b[i]=dum%2;\n i=i+1;\n dum/=2;\n }\n j=32-i;\n for(k=j,t=i-1;k<32;k++,t--)\n binary[k]= b[t];\n m=32;\n for( i=0 ; i < max ; i++)\n \t {\n j=0;\n while( bytes[i]!= 0 )\n {\n temp[j++]=bytes[i]%2;\n bytes[i]=bytes[i]/2;\n\n\n\n }\n for( k=0;k<8-j ; k++)\n binary[m++]=0;\n for(k=j-1; k >=0 ; k--)\n binary[m++]=temp[k];\n }\n \t maxbinary=m;\n }", "public void balayer()\r\n {\r\n int tot=0;\r\n for (int i=0;i<LONGUEUR;i++ )\r\n {\r\n for (int j=0; j<LARGEUR; j++ )\r\n {\r\n tot=0;\r\n Haut = lignesHor[i][j];\r\n Droite = lignesVert[i+1][j];\r\n Bas = lignesHor[i][j+1];\r\n Gauche = lignesVert[i][j];\r\n\r\n if (Haut)\r\n {\r\n tot++;\r\n Vision[i][j][1]=1;\r\n }\r\n\r\n if (Droite)\r\n {\r\n tot++;\r\n Vision[i][j][2]=1;\r\n }\r\n\r\n if (Bas)\r\n {\r\n tot++;\r\n Vision[i][j][3]=1;\r\n }\r\n\r\n\r\n if (Gauche)\r\n {\r\n tot++;\r\n Vision[i][j][4]=1;\r\n }\r\n\r\n Vision[i][j][0]=Vision[i][j][1]+Vision[i][j][2]+Vision[i][j][3]+Vision[i][j][4];\r\n }\r\n }\r\n }", "public void calculateBonuses(){\n\n\n }", "private float calculateAbsorption() {\n int i = getWeightedBucket();\n \n//System.out.println(\" bucket: \" + i);\n\n // the max modification is +/-5 % , broken into 0.5 % chunks\n float modifier = -0.05f;\n modifier += (float)(i * 0.005);\n \n return(modifier);\n }", "private List<Set<Mask>> chooseMinimalCover(Set<Mask> primCover) {\n\t\t// Izgradi polja implikanata i minterma (rub tablice):\n\t\tMask[] implicants = primCover.toArray(new Mask[primCover.size()]);\n\t\tInteger[] minterms = mintermSet.toArray(new Integer[mintermSet.size()]);\n\n\t\t// Mapiraj minterm u stupac u kojem se nalazi:\n\t\tMap<Integer, Integer> mintermToColumnMap = new HashMap<>();\n\t\tfor (int i = 0; i < minterms.length; i++) {\n\t\t\tInteger index = minterms[i];\n\t\t\tmintermToColumnMap.put(index, i);\n\t\t}\n\n\t\t// Napravi praznu tablicu pokrivenosti:\n\t\tboolean[][] table = buildCoverTable(implicants, minterms, mintermToColumnMap);\n\n\t\t// Donji redak tablice: koje sam minterme pokrio?\n\t\tboolean[] coveredMinterms = new boolean[minterms.length];\n\n\t\t// Pronađi primarne implikante...\n\t\tSet<Mask> importantSet = selectImportantPrimaryImplicants(implicants, mintermToColumnMap, table,\n\t\t\t\tcoveredMinterms);\n\n\t\tlogImportantImplicants(importantSet);\n\n\t\t// Izgradi funkciju pokrivenosti:\n\t\tList<Set<BitSet>> pFunction = buildPFunction(table, coveredMinterms);\n\n\t\tlogPFunction(pFunction);\n\n\t\tSet<BitSet> minset = new HashSet<>();\n\t\t// // Pronađi minimalne dopune:\n\t\tif (pFunction.size() != 0) {\n\t\t\tminset = findMinimalSet(pFunction);\n\t\t}\n\t\tlogMinimalSet(minset);\n\n\t\t// // Izgradi minimalne zapise funkcije:\n\t\tList<Set<Mask>> minimalForms = new ArrayList<>();\n\t\tif (minset.size() > 0) {\n\t\t\tfor (BitSet bs : minset) {\n\t\t\t\tSet<Mask> set = new LinkedHashSet<>(importantSet);\n\t\t\t\tbs.stream().forEach(i -> set.add(implicants[i]));\n\t\t\t\tminimalForms.add(set);\n\t\t\t}\n\t\t} else {\n\t\t\tminimalForms.add(importantSet);\n\t\t}\n\t\tlogMinimalForms(minimalForms);\n\t\treturn minimalForms;\n\t}", "@Override\n public NormalizationType get_normalization_type() {\n return NormalizationType.BIN;\n }", "private void atualizarBandeirasIa() {\n\t\tnumeroBombas = mapa.getBombas();\r\n\t\tfor(int i = 0; i < this.mapa.getCampo().length; i++) {\r\n\t\t\tfor(int j = 0; j < this.mapa.getCampo().length; j++) {\r\n\t\t\t\tif(celulaEscolhida(botoes[i][j]).isBandeira()) {\r\n\t\t\t\t\tbotoes[i][j].setEnabled(false);\r\n\t\t\t\t\tnumeroBombas--;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbotoes[i][j].setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(numeroBombas);\r\n\t}", "private NodoBin<T> buscarAS(T dato){\n if(esVacio())\n return (null);\n return (biselar(super.getRaiz(), dato));\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint value = 400;\r\n int[] array = { 10, 15, 20, 40, 50, 100, 120, 200, 400, 500, 600, 800 ,2222};\r\n busBin(array, 0, array.length - 1, value);\r\n System.out.println(\"Se encontro el numero a buscar \"+value+\" en el array.\");\r\n\r\n\t}", "public Bomb[] getBombs() {\r\n\t\treturn bombs;\r\n\t}", "private void updateAllBonuses() {\n\t\tfor(int i = 0; i < bonuses.length; i++)\n\t\t\tbonuses[i] = 0;\n\t\tfor(Item item : getItems()) {\n\t\t\tupdateBonus(null, item);\n\t\t}\n\t}", "private void normalize() {\r\n // GET MAX PRICE \r\n for (Alternative alt : alternatives) {\r\n if (alt.getPrice() > 0 && alt.getPrice() < minPrice) {\r\n minPrice = alt.getPrice();\r\n }\r\n }\r\n\r\n for (Alternative alt : alternatives) {\r\n // NORMALIZE PRICE - NON BENIFICIAL using max - min \r\n double price = alt.getPrice();\r\n double value = minPrice / price;\r\n alt.setPrice(value);\r\n // BENITIFICIAL v[i,j] = x[i,j] / x[max,j]\r\n double wood = alt.getWood();\r\n value = wood / maxWood;\r\n alt.setWood(value);\r\n\r\n double brand = alt.getBrand();\r\n value = wood / maxBrand;\r\n alt.setBrand(value);\r\n\r\n double origin = alt.getOrigin();\r\n value = origin / maxOrigin;\r\n alt.setOrigin(value);\r\n\r\n }\r\n }", "public int getBinCapicityFilled() {\n int binCapicity = 0;\n for( Packet p: packets) {\n binCapicity += p.getPacketHeight();\n }\n return binCapicity;\n\n }", "public void normalize()\n {\n\tdef += 200*counter;\n\tdmg -= 0.5*counter;\n\tcounter = 0;\n }", "private void coins_a1O(){\n\t\tthis.cube[40] = this.cube[6]; \n\t\tthis.cube[6] = this.cube[24];\n\t\tthis.cube[24] = this.cube[47];\n\t\tthis.cube[47] = this.cube[33];\n\t\tthis.cube[33] = this.cube[40];\n\t}", "public float getBP(Transform t) {\n\t\treturn broadPhaseLength * Math.abs(Math.max(t.scale.x, t.scale.y));\n\t}", "private void BC_bend(Grid gr){\r\n int i, j;\r\n double theta, rate, um, vm, pi=Math.PI;\r\n NSmax=(int)(30.0/dt); repL=0.1;\r\n\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions on upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions on left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\t\r\n // initial conditions; all those on other sides are zero. \r\n rate=0.5*pi/(double)(gr.mxRout-gr.mxRin); \r\n for(i = 0; i <= gr.mxRout; i++){ \r\n if(i <= gr.mxRin){ \r\n for(j = 1; j < mym; j++) \t u[i][j]=Umean;\r\n // u[i][j]=2.0*Umean*(1.0-4.0*(gr.y[1][j]+1.0)*(gr.y[1][j]+1.0)); \r\n }else{\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j< mym; j++) u[i][j]=u[0][j]*Math.cos(theta);\r\n }\r\n }\r\n\t\t\r\n for(i = gr.mxRin+1; i < mx; i++){ \r\n if(i <= gr.mxRout){\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j]*Math.sin(theta);\r\n }else{\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j];\r\n }\r\n }\r\n }", "private static BitSet makeBitSet( int... args ) {\n\tBitSet result = new BitSet( MAX_OPCODE + 1 ) ;\n\tfor (int value : args )\n\t result.set( value ) ;\n\treturn result ;\n }", "private void setRibs() {\n ribs[0] = new Rib(points[0],points[1]);\n ribs[1] = new Rib(points[1],points[2]);\n ribs[2] = new Rib(points[2],points[0]);\n }", "private void placeBombs() {\n\t\tfor (int i = 0; i < NUM_BOMBS; i++) {\n\t\t\tplaceBomb();\n\t\t}\n\t}", "void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }", "private static void addCombos() {\n\t\tcombos.put(\"All pixels, three LSB\", 13);\n\t\tcombos.put(\"All pixels, two LSB\", 12);\n\t\tcombos.put(\"Every even pixel, three LSB\", 23);\n\t\tcombos.put(\"Every odd pixel, three LSB\", 33);\n\t\tcombos.put(\"Every pixel, one LSB\", 11);\n\t\tcombos.put(\"Every even pixel, two LSB\",22);\n\t\tcombos.put(\"Every odd pixel, two LSB\", 32);\n\t\tcombos.put(\"Every third pixel, three LSB\",43);\n\t\tcombos.put(\"Every third pixel, two LSB\",42);\n\t\tcombos.put(\"Every even pixel, one LSB\",21);\n\t\tcombos.put(\"Every odd pixel, one LSB\",31);\n\t\tcombos.put(\"Every third pixel, one LSB\",41);\n\t\tcombos.put(\"Every prime-numbered pixel, three LSB\", 53);\n\t\tcombos.put(\"Every prime-numbered pixel, two LSB\",52);\n\t\tcombos.put(\"Every prime-numbered pixel, one LSB\",51);\n\n\n\t}", "Cone orderCone(Flavor[]balls) {\n\t \n }", "int getMines() {return mines;}", "private Pair[] bribeCalculateBag(final int maxCards,\n final HashMap<String, Integer> association) {\n final int minMoney = 5;\n final int maxBagSize = 3;\n if (getInventory().getMoney() < minMoney || numberOfIllegals(association) == 0) {\n return calculateBag(maxCards, association);\n }\n Pair[] result;\n if (numberOfIllegals(association) <= 2 || getInventory().getMoney() < minMoney * 2) {\n getInventory().getBagToGive().setBribe(minMoney);\n getInventory().setMoney(getInventory().getMoney() - minMoney);\n int duplicate = findIllegal(association);\n removeOneAsset(findIllegal(association));\n if (duplicate == findIllegal(association)) {\n result = new Pair[1];\n result[0] = new Pair<>(findIllegal(association), 2);\n getInventory().setNumberOfDeclared(2);\n } else {\n if (findIllegal(association) == -1) {\n result = new Pair[1];\n result[0] = new Pair<>(duplicate, 1);\n getInventory().setNumberOfDeclared(1);\n } else {\n result = new Pair[2];\n result[0] = new Pair<>(duplicate, 1);\n result[1] = new Pair<>(findIllegal(association), 1);\n getInventory().setNumberOfDeclared(2);\n }\n }\n removeOneAsset(findIllegal(association));\n getInventory().setDeclaredAssets(0);\n return result;\n } else {\n getInventory().getBagToGive().setBribe(minMoney * 2);\n getInventory().setMoney(getInventory().getMoney() - (minMoney * 2));\n int contor = maxCards - 1;\n final int contorStart = contor;\n int[] resultAux = new int[maxBagSize];\n getInventory().setDeclaredAssets(0);\n while (contor > 0 && findIllegal(association) != -1) {\n resultAux[findIllegal(association) % maxBagSize]++;\n removeOneAsset(findIllegal(association));\n contor--;\n }\n getInventory().setNumberOfDeclared(contorStart - contor);\n getInventory().setDeclaredAssets(0);\n contor = 0;\n for (int it : resultAux) {\n if (it != 0) {\n contor++;\n }\n }\n result = new Pair[contor];\n if (contor == maxBagSize) {\n result = new Pair[maxBagSize];\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n result[1] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n result[2] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n } else {\n if (contor == 1) {\n result = new Pair[1];\n if (resultAux[0] > 0) {\n result[0] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n }\n if (resultAux[1] > 0) {\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n }\n if (resultAux[2] > 0) {\n result[0] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n } else {\n result = new Pair[2];\n int i = 0;\n if (resultAux[0] > 0) {\n result[i] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n i++;\n }\n if (resultAux[1] > 0) {\n result[i] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n i++;\n }\n if (resultAux[2] > 0) {\n result[i] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n }\n }\n return result;\n }\n\n }", "protected static float[] getBinomialKernelSigmaTwo() {\n double a = 1.f/33300l;\n return new float[]{\n (float) (1l * a), (float) (14l * a), (float) (90l * a),\n (float) (350l * a), (float) (910l * a), (float) (1638l * a),\n (float) (2002l * a), (float) (1430l * a), (float) (0l * a),\n (float) (-1430l * a), (float) (-2002l * a), (float) (-1638l * a),\n (float) (-910l * a), (float) (-350l * a), (float) (-90l * a),\n (float) (-14l * a), (float) (-1l * a)\n };\n }", "private void getBinaryImage() {\n //apply gaussianfilter\n Imgproc.GaussianBlur(currentGray, currentGray, new Size(gauss,gauss), 0);\n\n // subtract backgroundGray from current image and store in currentGray\n Core.subtract(currentGray, backgroundGray, currentGray);\n\n //get Binary image using Otsu\n Imgproc.threshold(currentGray, binary, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU);\n }", "private void blobFix() { // (Solution)\n\t\tdouble deltaX = centroidX - width / 2.0; // (Solution)\n\t\ttargetRange = // (Solution)\n\t\tfocalPlaneDistance * targetRadius / Math.sqrt(targetArea / Math.PI); // (Solution)\n\t\ttargetBearing = Math.atan2(deltaX, focalPlaneDistance); // (Solution)\n\t}", "private static ArrayList<Integer> generateBinaryCodeList(ArrayList<ArrayList<Integer>> tMat){\r\n\t\tArrayList<Integer> bcList = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < tMat.size(); i++){\r\n\t\t\tint code = getBinaryCode(tMat, i);\r\n\t\t\tbcList.add(code);\r\n\t\t}\r\n\t\treturn bcList;\r\n\t}", "private void prepareAtomWeights(IAtomContainer mol) throws IOException\n {\n \tIMolecularFormula molecularFormula = MolecularFormulaManipulator.getMolecularFormula(mol);\n \n List<IElement> elements = MolecularFormulaManipulator.elements(molecularFormula);\n for (IElement element : elements) {\n \tIAtom a = new Atom(element);\n\t\t\tIsotopeFactory.getInstance(a.getBuilder()).configure(a);\n\t\t\t//get mass and store in map\n\t\t\tatomMasses.put(element.getSymbol(), a.getExactMass());\n\t\t}\n }", "private void coins_fB(){\n\t\tthis.cube[22] = this.cube[18]; \n\t\tthis.cube[18] = this.cube[24];\n\t\tthis.cube[24] = this.cube[26];\n\t\tthis.cube[26] = this.cube[20];\n\t\tthis.cube[20] = this.cube[22];\n\t}", "public void startSerialBombing() {\n\t\tint x = _count;\n\t\t_active = true;\n\t\twhile (_active && x-- > 0) {\n\t\t\tserialBomb(_count - x);\n\t\t}\n\t\t_active = false;\n\t}", "public static ArrayList < ArrayList < Double >> binPack(double weight[], int n, double bin_cap) { \r\n int binCount = 0;\r\n int k = 0;\r\n double[] bin_space = new double[n];\r\n\r\n ArrayList < Integer > bin = new ArrayList < Integer > ();\r\n ArrayList < Double > val = new ArrayList < Double > ();\r\n ArrayList < ArrayList < Double >> binVal = new ArrayList < ArrayList < Double >> ();\r\n binVal.add(k, new ArrayList < Double > ());\r\n System.out.println(\".......Commencing Calculation...........\\n\");\r\n startTime = System.nanoTime();\r\n for (int i = 0; i < n; i++) {\r\n int j;\r\n for (j = 0; j < binCount; j++) {\r\n \r\n if (bin_space[j] >= weight[i]) {\r\n bin_space[j] = bin_space[j] - weight[i];\r\n //val.add(weight[i]);\r\n (binVal.get(j)).add((weight[i]));\r\n k=j+1;\r\n System.out.println(\"---Bin \" + j + \" took in weight \" + weight[i]);\r\n break;\r\n }\r\n \r\n }\r\n System.out.println(\"*Bad fit for next weight size \"+ weight[i]+ \r\n \"\\n\\n ***NEW BIN CREATED***\\n\");\r\n if (j == binCount) {\r\n \r\n bin_space[binCount] = bin_cap - weight[i];\r\n //val.add(weight[i]);\r\n binCount++;\r\n //k++;\r\n bin.add(j);\r\n binVal.add(j, new ArrayList < Double > ());\r\n (binVal.get(j)).add((weight[i]));\r\n k=j+1;\r\n System.out.println(\"---Bin \" + k + \" took in weight **\" + weight[i]);\r\n }\r\n } \r\n endTime = System.nanoTime();\r\n elapsedTime = (endTime- startTime);\r\n System.out.println(\"\\nBIN PACKING ALGORITHM COMPLETE\\n\");\r\n \r\n return binVal;\r\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 }", "private Move produceHeuristicMove(Board board){\n\n\t\tint numRows = board.getNumberOfRows();\n\t\tint[][] bins = new int[numRows][BINARY_LENGTH];\n\t\tint[] binarySum = new int[BINARY_LENGTH];\n\t\tint bitIndex,higherThenOne=0,totalOnes=0,lastRow=0,lastLeft=0,lastSize=0,lastOneRow=0,lastOneLeft=0;\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\tbinarySum[bitIndex] = 0;\n\t\t}\n\t\t\n\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\n\t\t\tint curRowLength = board.getRowLength(k+1);\n\t\t\tint i = 0;\n\t\t\tint numOnes = 0;\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbins[k][bitIndex] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tdo {\n\t\t\t\tif(i<curRowLength && board.isStickUnmarked(k+1,i+1) ){\n\t\t\t\t\tnumOnes++;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tif(numOnes>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString curNum = Integer.toBinaryString(numOnes);\n\t\t\t\t\t\twhile(curNum.length()<BINARY_LENGTH){\n\t\t\t\t\t\t\tcurNum = \"0\" + curNum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\t\t\t\tbins[k][bitIndex] += curNum.charAt(bitIndex)-'0'; //Convert from char to int\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(numOnes>1){\n\t\t\t\t\t\t\thigherThenOne++;\n\t\t\t\t\t\t\tlastRow = k +1;\n\t\t\t\t\t\t\tlastLeft = i - numOnes + 1;\n\t\t\t\t\t\t\tlastSize = numOnes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttotalOnes++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastOneRow = k+1;\n\t\t\t\t\t\tlastOneLeft = i;\n\t\t\t\t\t\t\n\t\t\t\t\t\tnumOnes = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}while(i<=curRowLength);\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbinarySum[bitIndex] = (binarySum[bitIndex]+bins[k][bitIndex])%2;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//We only have single sticks\n\t\tif(higherThenOne==0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//We are at a finishing state\t\t\t\t\n\t\tif(higherThenOne<=1){\n\t\t\t\n\t\t\tif(totalOnes == 0){\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1) - 1);\n\t\t\t} else {\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1)-(1-totalOnes%2));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH-1;bitIndex++){\n\t\t\t\n\t\t\tif(binarySum[bitIndex]>0){\n\t\t\t\t\n\t\t\t\tint finalSum = 0,eraseRow = 0,eraseSize = 0,numRemove = 0;\n\t\t\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\t\t\n\t\t\t\t\tif(bins[k][bitIndex]>0){\n\t\t\t\t\t\teraseRow = k+1;\n\t\t\t\t\t\teraseSize = (int)Math.pow(2,BINARY_LENGTH-bitIndex-1);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int b2 = bitIndex+1;b2<BINARY_LENGTH;b2++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(binarySum[b2]>0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(bins[k][b2]==0){\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum + (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum - (int)Math.pow(2,BINARY_LENGTH-b2-1);\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}\n\t\t\t\t\t\t\t\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\t\n\t\t\t\tnumRemove = eraseSize - finalSum;\n\t\t\t\t\n\t\t\t\t//Now we find that part and remove from it the required piece\n\t\t\t\tint numOnes=0,i=0;\n\t\t\t\twhile(numOnes<eraseSize){\n\n\t\t\t\t\tif(board.isStickUnmarked(eraseRow,i+1)){\n\t\t\t\t\t\tnumOnes++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnumOnes=0;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn new Move(eraseRow,i-numOnes+1,i-numOnes+numRemove);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we reached here, and the board is not symmetric, then we only need to erase a single stick\n\t\tif(binarySum[BINARY_LENGTH-1]>0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//If we reached here, it means that the board is already symmetric, and then we simply mark one stick from the last sequence we saw:\n\t\treturn new Move(lastRow,lastLeft,lastLeft);\t\t\n\t}", "public static void main(String [] args){\n\t\tint [] A = {0,1,1,1}; //1110\r\n\t\tint [] B = {1,0,1,0};\r\n\t\tint [] C = new Hw2p1q4().binarySum(A, B, A.length);\r\n\t\tfor(int i=A.length; i>=0; i--){\r\n\t\t\tSystem.out.print(C[i]);\r\n\t\t}\r\n\t}", "private double centerX() {\n return (piece.boundingBox().getWidth() % 2) / 2.0;\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 }", "public static int[] bwor(BinaryNumber bn1, BinaryNumber bn2) {\n\t\tif (bn1.getLength() !=bn2.getLength()) {\n\t\t\tSystem.out.println(\"can't be doin that. Make them the same length.\");\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tint[] or = new int[bn1.length];\n\t\tfor(int i = 0;i < bn1.length;i++) {\n\t\t\tif(bn1.data[i] + bn2.data[i] != 0) {\n\t\t\t\tor[i] = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tor[i] = 0;\n\t\t\t}\n\t\t}\n\t\treturn or;\n\t}", "public ArrayList<Integer> obtenerYi(){\n ArrayList<Integer> res = new ArrayList<Integer>();\n int cont;\n \n for (float p:probabilidades){\n cont=0;\n while (Math.pow(base, cont)<1/p)\n cont++;\n res.add(cont);\n }\n return res;\n }", "private void detectBombs(int row, int col){\r\n int bombCount = 0; //Amount of bombs nearby\r\n //Check up\r\n if((row-1 >= 0) && row<map.length && col<map[0].length && col>=0 && map[row-1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down\r\n if((row+1 < map.length) && row>=0&& col<map[0].length && col>=0 && map[row+1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check right\r\n if((col+1 < map[0].length) && col>=0 && row<map.length && row>=0 && map[row][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check left\r\n if((col-1 >= 0) && col<map[0].length && row<map.length && row>=0 && map[row][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up right\r\n if((row-1 >= 0) && row<map.length && (col+1 < map[0].length) && col>=0 && map[row-1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up left\r\n if((row-1 >= 0) && row<map.length && (col-1 >= 0) && col<map[0].length&& map[row-1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down left\r\n if((row+1 < map.length) && row>=0 && (col-1 >= 0)&& col<map[0].length && map[row+1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //check down right\r\n if((row+1 < map.length) && row>=0 && (col+1 < map[0].length)&& col>=0 && map[row+1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n if(row>=0 && col>=0 && row<map.length && col<map[0].length && !map[row][col].getVisual().equals(\"F\") && map[row][col].getSafe() == true){\r\n if(bombCount==0){\r\n map[row][col].setVisual(zero);\r\n }\r\n if(bombCount==1){\r\n map[row][col].setVisual(one);\r\n }\r\n if(bombCount==2){\r\n map[row][col].setVisual(two);\r\n }\r\n if(bombCount==3){\r\n map[row][col].setVisual(three);\r\n }\r\n if(bombCount==4){\r\n map[row][col].setVisual(four);\r\n }\r\n if(bombCount==5){\r\n map[row][col].setVisual(five);\r\n }\r\n if(bombCount==6){\r\n map[row][col].setVisual(six);\r\n }\r\n if(bombCount==7){\r\n map[row][col].setVisual(seven);\r\n }\r\n if(bombCount==8){\r\n map[row][col].setVisual(eight);\r\n }\r\n map[row][col].setRevealed(true);\r\n }\r\n\r\n\r\n //return bombCount;\r\n\r\n\r\n }", "public void setBombs() {\n\t\tfor (int i = 0; i < numBombs; ) {\n\t\t\tint row = (int)(Math.random() * numRows);\n\t\t\tint col = (int)(Math.random() * numCols);\n\t\t\tif (!table[row][col].isBomb()){\n\t\t\t\ttable [row][col].setAsBomb();\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}", "Binarbre<E> equilibre();", "public static void normalize()\n {\n int sum;\n\n for(int i=0;i<12;i++)\n {\n for(int j=0;j<12;j++) {\n sum = sumAll(i,j);\n if (sum != 0)\n for (int n = 0; n < 12; n++)\n weights[i][j][n] /= sum;\n }\n }\n }", "protected void optimizeBushes() {\r\n\t\tfor (int i = 0; i < execBushes.size(); i++) {\r\n\t\t\tLog.info(String.format(\r\n\t\t\t\t\t\"Performing POR Analysis on Bush Sequence %d of %d\", i + 1,\r\n\t\t\t\t\texecBushes.size()));\r\n\r\n\t\t\t// optimization only works for sequence lengths >= 3\r\n\t\t\tList<EventType> sequence = execBushes.get(i);\r\n\t\t\tif (sequence.size() < 3)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// is bush already redundant?\r\n\t\t\tif (redundantExecBushes.contains(sequence)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// is bush PO-reducible?\r\n\t\t\tif (isPOReducible(sequence)) {\r\n\t\t\t\t// create redundant sequence (for later checking)\r\n\t\t\t\tList<EventType> redundantSequence = new ArrayList<EventType>();\r\n\t\t\t\tredundantSequence.add(sequence.get(1));\r\n\t\t\t\tredundantSequence.add(sequence.get(0));\r\n\t\t\t\tredundantSequence.add(sequence.get(2));\r\n\t\t\t\tredundantExecBushes.add(redundantSequence);\r\n\t\t\t}\r\n\r\n\t\t\trequiredExecBushes.add(sequence);\r\n\t\t}\r\n\t}", "public int[][] RdB() {\t\t\t\t\t\t\t\t// cherche les 4 points noirs\n\t\tint[][] pixNoirs = new int[img.getWidth()*img.getHeight()][2];\n\n\t\tint i=0;\n\t\tint radius=8;\t\t\t\t\t\t\t\t\t// 19= limite de detection de checkCircle\n\t\tfor (int ty=0; ty<img.getHeight();ty++) {\n\t\t\tfor (int tx=0;tx<img.getWidth();tx++) {\n\n\t\t\t\tColor tmp=new Color(img.getRGB(tx, ty));\n\t\t\t\tif (tmp.getGreen()<20) { \t\t\t\t//si le pixel est noir\n\t\t\t\t\tif (checkCircle(tx,ty,radius) ) {\t//verifie si un cercle de radius entoure le pixel\n\t\t\t\t\t\tpixNoirs[i][0]=tx;\n\t\t\t\t\t\tpixNoirs[i][1]=ty;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"fin\");\n\t\tint tmp=1;\n\t\tint centreX[][]=new int [img.getWidth()*img.getHeight()][2];\n\t\tcentreX[0]=pixNoirs[0];\n\t\tfor (int l=0;l<img.getHeight()*img.getWidth() && (pixNoirs[l][1]!=0 || pixNoirs[l][0]!=0);l++) {\n\t\t\tif((pixNoirs[l][0]-centreX[tmp-1][0])<5 || pixNoirs[l][1]-centreX[tmp-1][1]<5 ){\t\t//x-(x-1)>5 ou y-(y-1)>5\n\t\t\t\tcentreX[tmp][0]=pixNoirs[l][0];\t\t\t//efface le precedent roar2 si il était a 1 pixel de diff\n\t\t\t\tcentreX[tmp][1]=pixNoirs[l][1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttmp++;\n\t\t\t\tcentreX[tmp]=pixNoirs[l];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//boucle de determination des points noirs\n\t\t//System.out.println(\"roar2debut\");\n\t\tint points[][]=new int [4][2];\n\t\tint centres[][]=new int [centreX.length][2]; int boucl=0; int lasti=0;\n\t\tint t=0;\n\t\tfor (int l=1;l<=img.getHeight()*img.getWidth() && (centreX[l-1][1]!=0 || centreX[l-1][0]!=0);l++) {\n\n\n\t\t\t\n\t\t\tint diffx=centreX[l][0]-centreX[l-1][0];\n\t\t\tint diffy=centreX[l][1]-centreX[l-1][1];\n\t\t\tint diff=Math.abs(diffx)+Math.abs(diffy);\n\t\t\tif (diff>img.getWidth()*0.85)\n\t\t\t{\n\t\t\t\tpoints[t]=centreX[l];\n\t\t\t\tt++;\n\t\t\t}\n\t\t\t\n\t\t\tif (diffx<10 && diffy<10) {\n\t\t\t\tboucl++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcentres[lasti][0]=centreX[l-boucl/2][0];\n\t\t\t\tcentres[lasti][1]=centreX[l-boucl/2][1];\n\t\t\t\tlasti++;boucl=0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tfor (int l=0;l<=centres.length && (centres[l][1]!=0 || centres[l][0]!=0);l++) {\t\n\t\t\tboolean test=true;\n\t\t\tint maxPoint=0;\n\t\t\tfor (int li=0;li<=points.length && (points[li][1]!=0 || points[li][0]!=0);li++) {\n\t\t\t\tint diffx=\tMath.abs(centres[l][0]-points[li][0]);\n\t\t\t\tint diffy=\tMath.abs(centres[l][1]-points[li][1]);\n\t\t\t\tboolean testx=\t\tdiffx>img.getWidth()*0.85 \t|| diffx<img.getWidth()*0.2;\t//diff <0.1 ou >0.8 x la largeur de feuille\n\t\t\t\tboolean testy=\t\tdiffy>img.getHeight()*0.8 \t|| diffy<img.getWidth()*0.2;\n\t\t\t\tboolean Repeat=\tdiffx+diffy>img.getWidth()*0.2;\t //si point deja présent\n\n\t\t\t\tif (!Repeat || (!testx || !testy) )\t// si 0.2>diffx>0.8 ou \"diffy\" et \n\t\t\t\t{\n\t\t\t\t\ttest=false;\n\t\t\t\t}\n\t\t\t\tmaxPoint=li;\n\t\t\t}\n\t\t\t\n\t\t\tif(test && maxPoint<2) {\n\t\t\t\t//System.out.println(lastRoar[l][0]+\" \"+lastRoar[l][1]);\n\t\t\t\tpoints[maxPoint+1][0]=centres[l][0];\n\t\t\t\tpoints[maxPoint+1][1]=centres[l][1];\n\t\t\t}\n\t\t}\n\t\treturn points;\n\n\t}", "private void coins_a2W(){\n\t\tthis.cube[4] = this.cube[17]; \n\t\tthis.cube[17] = this.cube[20];\n\t\tthis.cube[20] = this.cube[36];\n\t\tthis.cube[36] = this.cube[33];\n\t\tthis.cube[33] = this.cube[4];\n\t}", "public void prepareBloque(){\n\t\tBloque b= game.getBloque();\n\t\timage = b.getImage();\n\t\ttemporal = image.getImage().getScaledInstance(b.getAncho(), b.getAlto(), Image.SCALE_SMOOTH);\n\t\tb.setImage(new ImageIcon(temporal));\n\t}", "public HistogramBuilder autoBinX(boolean autoBinX) {\n this.autoBinX = autoBinX;\n return this;\n }", "private void preComp(long from, long to) {\n\t\tfor (long i = from; i < to; i++) {\n\t\t\tif (isEmirp(i)) {\t\t\t\t\n\t\t\t\tpreComputedEmirps.add(i);\n\t\t\t}\n\t\t}\n\t\tlastComputedUpTo = to;\n\t}", "public void doMacrons(){\r\n\t\tDSElement<Verbum> w = words.first;\r\n\t\tint count = words.size(); // failsafe counter\r\n\t\twhile(count > 0){\r\n\t\t\t//Make sure word hasn't been macroned before\r\n\t\t\tif(w.getItem().macForm.isEmpty()){\r\n\t\t\t\t//delete nom endings\r\n\t\t\t\tdelNomFromMac(w.getItem());\r\n\t\t\t\t//insert macrons into forms\r\n\t\t\t\tmacsToForms(w.getItem());\r\n\t\t\t\t//System.out.println(w.getItem().macForm);\r\n\t\t\t\t//Insert special macrons \r\n\t\t\t\tspecialMacs(w.getItem());\r\n\t\t\t}\r\n\t\t\tw = w.getNext();\r\n\t\t\tif(w == null)\r\n\t\t\t\tw = words.first;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t}", "private void createHammed()\n\t{\n\t\tint j=0;\n\t\tboolean skip = false;\n\t\t\n\t\t\n\t\tfor (int i=0;i<binaryCode.length; i++)\n\t\t{\t\n\t\t\t//checks to see if the bit is a parity bit\n\t\t\tfor (int k=0; k<PARITY.length;k++)\n\t\t\t{\n\t\t\t\t//if it is a parity bit, it skips\n\t\t\t\tif (i==PARITY[k])\n\t\t\t\t{\n\t\t\t\t\tskip=true;\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\t\t\tif (skip)\n\t\t\t{\n\t\t\t\tskip=false;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//if it is not a parity bit, it places the value into the bit position\n\t\t\t\tbinaryCode[i]=binaryNumber.getBitValue(j);\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t}\n\t}", "private static int batoi(byte[] inp) {\n int len = inp.length>4?4:inp.length;\n int total = 0;\n for (int i = 0; i < len; i++) {\n total += (inp[i]<0?256+inp[i]:(int)inp[i]) << (((len - 1) - i) * 8);\n }\n return total;\n }", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "private ArrayList[] blxAlpha(ArrayList[] madre, ArrayList[] padre, Random al)\n\t{\n\t\tint numAtributos = madre.length;\n\t\tdouble max = 0;\n\t\tdouble min = 0;\n\t\tdouble I = 0;\n\t\tArrayList[] hijo = new ArrayList[numAtributos];\n\t\t\n\t\t\n\t\tfor (int i = 0; i < numAtributos; i++)\t\t//Para cada atributo\n\t\t{\n\t\t\thijo[i] = new ArrayList();\n\t\t\t\n\t\t\t// El primer y el último valor de cada atributo no cambia\n\t\t\thijo[i].add(madre[i].get(0));\n\t\t\t\n\t\t\tint numParticiones = madre[i].size();\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-1;j++)\n\t\t\t{\n\t\t\t\tif ((Double)(madre[i].get(j)) < (Double)(padre[i].get(j)))\n\t\t\t\t{\t\n\t\t\t\t\tmax = (Double)(padre[i].get(j));\n\t\t\t\t\tmin = (Double)(madre[i].get(j));\n\t\t\t\t}\n\t\t\t\telse\t\t\t\t\t\t\t//Si el gen de la madre es mayor\n\t\t\t\t{\n\t\t\t\t\tmin = (Double)(padre[i].get(j));\n\t\t\t\t\tmax = (Double)(madre[i].get(j));\n\t\t\t\t}\t\t\t\t\t \n\t\t\t\tI = max - min;\t//Obtenemos la diferencia\n\t\t\t\tmin = min - I * 0.15;\t//Calculamos el extremo inferior\n\t\t\t\tmax = max + I * 0.15;\t//Calculamos el extremo superior\n\t\t\t\thijo[i].add(min + al.nextDouble() * (max - min));\t//Calculamos un punto aleatorio dentro del intervalo\n\t\t\t}\n\t\t\t\n\t\t\t// El primer y el último valor de cada atributo no cambia\n\t\t\thijo[i].add(madre[i].get(numParticiones-1));\n\t\t}\n\t\t\n\t\t// Validación del individuo\n\t\t\n\t\t// Ponemos a mínimo los valores menores que el mínimo y al máximo los valores menores que el máximo\n\t\tfor(int i=0;i < numAtributos; i++)\n\t\t{\n\t\t\tint numParticiones = hijo[i].size();\n\t\t\t\n\t\t\tmin = ((Double)(hijo[i].get(0)));\n\t\t\tmax = ((Double)(hijo[i].get(numParticiones-1)));\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-1;j++)\n\t\t\t{\n\t\t\t\tif(((Double)(hijo[i].get(j))) < min)\n\t\t\t\t{\n\t\t\t\t\thijo[i].add(j, min);\n\t\t\t\t}\n\t\t\t\telse if((((Double)(hijo[i].get(j))) > max))\n\t\t\t\t{\n\t\t\t\t\thijo[i].add(j, max);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ordenamos los valores de menor a mayor\n\t\tfor(int i=0;i < numAtributos; i++)\n\t\t{\n\t\t\tint numParticiones = hijo[i].size();\n\t\t\t\n\t\t\tfor (int j = 1; j < numParticiones-2;j++)\n\t\t\t{\n\t\t\t\tfor(int k = 1; k < numParticiones-2; k++)\n\t\t\t\t{\n\t\t\t\t\tdouble temp = ((Double)(hijo[i].get(k)));\n\t\t\t\t\tdouble compara = ((Double)(hijo[i].get(k+1)));\n\t\t\t\t\t\n\t\t\t\t\tif(temp > compara)\n\t\t\t\t\t{\n\t\t\t\t\t\thijo[i].remove(k);\n\t\t\t\t\t\thijo[i].add(k, compara);\n\t\t\t\t\t\thijo[i].remove(k+1);\n\t\t\t\t\t\thijo[i].add(k+1, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn hijo;\t\n\t}", "void ec_dec_normalize() {\r\n\t\t/*If the range is too small, rescale it and input some bits.*/\r\n\t\twhile( this.rng <= EC_CODE_BOT ) {\r\n\t\t\tthis.nbits_total += EC_SYM_BITS;\r\n\t\t\tthis.rng <<= EC_SYM_BITS;\r\n\t\t\t/*Use up the remaining bits from our last symbol.*/\r\n\t\t\tint sym = this.rem;\r\n\t\t\t/*Read the next value from the input.*/\r\n\t\t\tthis.rem = ec_read_byte();\r\n\t\t\t/*Take the rest of the bits we need from this new symbol.*/\r\n\t\t\tsym = (sym << EC_SYM_BITS | this.rem) >> (EC_SYM_BITS - EC_CODE_EXTRA);\r\n\t\t\t/*And subtract them from val, capped to be less than EC_CODE_TOP.*/\r\n\t\t\tthis.val = ((this.val << EC_SYM_BITS) + (EC_SYM_MAX & ~sym)) & (EC_CODE_TOP - 1);\r\n\t\t}\r\n\t}", "@Override public void map(Chunk c) {\n for( int i = 0; i < c._len; ++i ) {\n int x=1;\n if( c.isNA(i) ) continue;\n double r = c.atd(i);\n if( _h==-1 ) {\n for(; x < _counts.length; x++)\n if( r <= _breaks[x] ) break;\n x--; // back into the bin where count should go\n } else\n x = Math.min( _counts.length-1, (int)Math.floor( (r-_x0) / _h ) ); // Pick the bin floor( (x - x0) / h ) or ceil( (x-x0)/h - 1 ), choose the first since fewer ops!\n bumpCount(x);\n setMinMax(Double.doubleToRawLongBits(r),x);\n }\n }", "private static int galoisMult(int a, int b)\n\t{\n\t\tint result = 0;\n\t\tfor (int i=0; i<8; i++)\n\t\t{\n\t\t\tif((b&1) == 1) //low bit of b set\n\t\t\t\tresult = result^a;\n\t\t\tboolean aHighSet = (a & 128) == 128; //8th bit of a set\n\t\t\ta <<= 1;\n\t\t\tassert (a&1) == 0;\n\t\t\t\n\t\t\ta &= 255; //getting rid of 9th bit\n\t\t\tassert ((a&256) != 256);\n\t\t\t\n\t\t\tif (aHighSet)\n\t\t\t\ta ^= (0x1b);\n\t\t\t\n\t\t\tb >>= 1;\n\t\t\tassert (b&128) != 128; //8 bit is zero\n\t\t}\n\t\treturn result;\n\t}", "public void histNormalize() {\n\n double max = max();\n double min = min();\n max = max - min;\n for (int i = 0; i < pixelData.length; i++) {\n double value = pixelData[i] & 0xff;\n pixelData[i] = (byte) Math.floor((value - min) * 255 / max);\n }\n }" ]
[ "0.5577444", "0.5472049", "0.5099241", "0.50893784", "0.50516", "0.50495577", "0.4946409", "0.49407056", "0.49308822", "0.48964196", "0.48663893", "0.48634356", "0.48419464", "0.48409238", "0.47918004", "0.4764046", "0.4757855", "0.47374913", "0.47360078", "0.47130242", "0.4700109", "0.46805936", "0.4667677", "0.46491492", "0.46263355", "0.46182", "0.46172944", "0.46079022", "0.46078476", "0.46077606", "0.458626", "0.45805603", "0.4579083", "0.457462", "0.45651948", "0.455995", "0.45578888", "0.45563814", "0.45525205", "0.45507765", "0.45432", "0.4539141", "0.4536585", "0.4526966", "0.45217362", "0.4516958", "0.45050436", "0.45000586", "0.44970435", "0.44964954", "0.44895345", "0.4489503", "0.44884852", "0.44868755", "0.44865203", "0.44824535", "0.44765958", "0.44747242", "0.4467659", "0.44666994", "0.4465769", "0.44642618", "0.44478774", "0.44438383", "0.44418088", "0.44340837", "0.44205967", "0.44075662", "0.44035122", "0.44003558", "0.43970707", "0.4395727", "0.43936342", "0.4391537", "0.4389525", "0.4389521", "0.4388178", "0.43873507", "0.43828872", "0.43799904", "0.43798053", "0.43784586", "0.4376221", "0.4370352", "0.4368589", "0.4368455", "0.4362845", "0.43571436", "0.43541044", "0.4345891", "0.43447953", "0.43442938", "0.4343903", "0.4343465", "0.43433627", "0.4334754", "0.43336457", "0.43304422", "0.43288854", "0.43235046" ]
0.6324056
0
Search all experimental mass spectra against libraries
public void matchLibrarySpectra(SampleSpectrum ms2, Double massBinSize, Double ms1Tol, Double ms2Tol) { Double dotProd = 0.0; Double reverseDotProd = 0.0; if (minMass < 9998.0 && ms2.precursor<maxMass && ms2.precursor>minMass) { //Scale MS2s to maximum peak in spectra (0-1000) and remove peaks below .5% ms2.scaleIntensities(); // Find range of mass bins which need to be searched int minIndex = findBinIndex(findMinMassRange(ms2.precursor,ms1Tol),massBinSize,minMass); int maxIndex = findBinIndex(findMaxMassRange(ms2.precursor,ms1Tol),massBinSize,minMass); if (minIndex<0) minIndex = 0; if (maxIndex>(massBin.length-1)) maxIndex = massBin.length-1; //Iterate through this mass bin range for (int i=minIndex; i<=maxIndex; i++) { //If the bin contains library spectra if (countBin[i]>0) { //For all spectra which are in the same mass bin for (int j=0; j<addedBin[i]; j++) { if (Math.abs(massBin[i][j].precursor-ms2.precursor)<ms1Tol) { //Calculate the dot product (spectral similarity) between the two spectra dotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,false, massWeight, intWeight); reverseDotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,true, massWeight, intWeight); if (dotProd>1) { //Add identification to array ms2.addID(massBin[i][j], dotProd, reverseDotProd,ms2Tol); } } } } } //Sort by dot product Collections.sort(ms2.idArray); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t//Bin MSP LibrarySpectra\n\t\t\tbinMasses();\n\n\t\t\tfor (double l=0.01; l<3.01; l=l+.01)\n\t\t\t{\n\t\t\t\tfor (double m=0.01; m<3.01; m=m+.01)\n\t\t\t\t{\n\t\t\t\t\tthis.intWeight = l;\n\t\t\t\t\tthis.massWeight = m;\n\n\t\t\t\t\t//Read in all mgf files\n\t\t\t\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateProgress((int)(Double.valueOf(i+1)\n\t\t\t\t\t\t\t\t/(Double.valueOf(mgfFiles.size())*100.0)),\"% - Loading Spectra\",true);\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Read in spectra and search\n\t\t\t\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mgf\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i)+\"_\"+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create mzxmlparser\n\t\t\t\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t\t\t\t//Read in mzxml files\n\t\t\t\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Parse MZXML\n\t\t\t\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t\t\t\t//Create SampleSpectrum objects\n\t\t\t\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mzxml\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\t\t\t\t\tupdateProgress(100,\"% - Completed\",true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void runSpectraSearch(ArrayList <File> lipidLibs, double mzTol) throws CustomException, IOException\n\t{\n\t\tthis.lipidLibs = lipidLibs;\n\n\t\t//Verifies no result files are open\n\t\tcheckFileStatus();\n\n\t\t//Read fatty acids\n\t\treadFattyAcids(\"src\\\\backup\\\\FattyAcids.csv\");\n\n\t\t//Read in MSP Files\n\t\ttry\n\t\t{\n\t\t\treadMSP();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tCustomError ce = new CustomError(\"Error loading library .msp\", e);\n\t\t}\n\n\n\t\t//Sort arrays by mass, lowest to highest\n\t\tCollections.sort(librarySpectra);\n\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t//Bin MSP LibrarySpectra\n\t\tbinMasses();\n\n\t\tupdateProgress(0,\"% - Searching Spectra\",true);\n\n\t\t//Read in all mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\t\t\ttimeStart = System.nanoTime();\n\t\t\tnumSpectra = 0;\n\n\t\t\t//Read in spectra and search\n\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t//Iterate through spectra and match\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\n\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\n\t\t\t}\n\n\t\t\t//Calculate purity values\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\t\t\t\n\t\t\t\tsampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);\n\t\t\t}\n\n\t\t\t//Write ouput files for mgf\n\t\t\ttry\n\t\t\t{\n\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i),maxResults);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tCustomError ce = new CustomError(\"Please close \"+mgfFiles.get(i)+\" and re-search the data\",null);\n\t\t\t}\n\n\t\t\t//Clear sample spectra\n\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\n\t\t\tupdateProgress((int)((Double.valueOf(i+1)\n\t\t\t\t\t/(Double.valueOf(mgfFiles.size())))*100.0),\"% - Searching Spectra\",true);\n\t\t}\n\n\t\t//Create mzxmlparser\n\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t//Read in mzxml files\n\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t{\n\t\t\ttimeStart = System.nanoTime();\n\t\t\tnumSpectra = 0;\n\n\t\t\t//Parse MZXML\n\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t//Create SampleSpectrum objects\n\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t{\n\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t}\n\n\t\t\t//Iterate through spectra and match\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\n\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t}\n\n\t\t\t//Calculate purity values\n\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t{\t\t\t\n\t\t\t\tsampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);\n\t\t\t}\n\n\t\t\t//Write ouput files for mzxml\n\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i),maxResults);\n\n\t\t\t//Clear sample spectra\n\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\n\t\t\tupdateProgress((int)((Double.valueOf(i+1)\n\t\t\t\t\t/(Double.valueOf(mgfFiles.size())))*100.0),\"% - Searching Spectra\",true);\n\t\t}\n\t\tupdateProgress(100,\"% - Completed\",true);\n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "public SpectrumSearcher(ArrayList <File> lipidLibs, ArrayList <String> mgfFiles, \n\t\t\tArrayList <String> mzxmlFile, JProgressBar progressBar, Double ms1Tol, \n\t\t\tDouble ms2Tol, int maxResults, Double minMassCutoff)\n\t{\n\t\t//Update class fields\n\t\tthis.minMS2Mass = minMassCutoff;\n\t\tthis.lipidLibs = lipidLibs;\n\t\tSpectrumSearcher.progressBar = progressBar;\n\t\tthis.ms1Tol = ms1Tol;\n\t\tthis.ms2Tol = ms2Tol;\n\t\tthis.mgfFiles = mgfFiles;\n\t\tthis.mzxmlFiles = mzxmlFile;\n\t\tmassBinSize = ms1Tol/10.0;\n\t\tminMass = 999.0;\n\t\tmaxMass = 0.0;\n\t\tlibrarySpectra = new ArrayList<LibrarySpectrum>();\n\t\tfattyAcidsDB = new ArrayList<FattyAcid>();\n\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\tthis.maxResults = maxResults;\n\t\tnumSpectra = 0;\n\t}", "public void addSpectrum(LibrarySpectrum spectrum)\n\t{\n\t\tlibrarySpectra.add(spectrum);\n\t\tif (spectrum.precursor > maxMass) maxMass = spectrum.precursor;\n\t\tif (spectrum.precursor < minMass) minMass = spectrum.precursor;\n\t\tspectrum.scaleIntensities();\n\t}", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "void lowResolutionInference(Spectrum spectrum){\n\t}", "@Test\n public void showHandledPeaksForInterestingCases() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n ISimilarityChecker checker = new FrankEtAlDotProductTester();\n ISimilarityChecker currentChecker = new FrankEtAlDotProduct(0.5F, 15, true);\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n String id1 = psm1.getId();\n if (!INTERESTING_ID_SET.contains(id1))\n continue; // not an interesting case\n\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n\n String id2 = psm2.getId();\n if (!INTERESTING_ID_SET.contains(id2))\n continue; // not an interesting case\n\n // System.out.println(\"Comparing \" + id1 + \" \" + id2);\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n //noinspection UnnecessaryLocalVariable,UnusedDeclaration,UnusedAssignment\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n\n // System.out.println(\"Peaks compared original Frank Et Al (when the code is written)\");\n // print usage\n // System.out.println(usedPeaksTester.toString());\n\n usedPeaksTester.setLength(0); // clear debug output\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n // print usage\n // System.out.println(\"Peaks compared current Frank Et Al \");\n // System.out.println(usedPeaksTester.toString());\n\n\n }\n\n }\n }", "AudioProcessor[] mo25073a();", "public void searchMotors() {\n\t\t\t\n\t\t// try to limit searching \n\t\tif(ports.contains(lights)) ports.remove(lights);\n\t\t\n\t\tUtil.debug(\"discovery for motors starting on \" + ports.size()+\" ports\", this); \n\t\n\t\t//for (int i = ports.size() - 1; i >= 0; i--) {\n\t\tfor (int i=0; i<ports.size(); i++) {\n\t\t\tif (state.get(State.values.serialport)!=null) { break; } // stop if find it\n\t\t\t//if (connect(ports.get(i), BAUD_RATES[1])) {\n\t\t\tif (connect(ports.get(i), 115200)) {\n\t\t\t\tUtil.delay(TIMEOUT*2);\n\t\t\t\tif (serialPort != null) { close(); }\n\t\t\t}\n\t\t}\n\t}", "private static URL[] findJARs() {\n\tFilenameFilter filter = new FilenameFilter() {\n\t\tpublic boolean accept(File dir, String name) {\n\t\t\tString lcname = name.toLowerCase();\n//System.out.println(lcname+\" => \"+(lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")));\n\t\t\treturn lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")/*no snapshots*/ && new File(dir, name).canRead();\n\t\t}\n\t};\n\n\t// look for JARs in same directory (or, during development, in c:/temp)\n//\tFile dir;\n\tString jar = URIs.decode/*in case space in path*/(Multivalent.class.getResource(\"Multivalent.class\").toString());\n//System.out.println(\"Bootstrap res = \"+jar);\n\tString top;\n\tif (jar.startsWith(\"jar:\")) { // deployment: e.g., \"jar:file:/C:/temp/Multivalent20011127.jar!/multivalent/Multivalent.class\"\n\t\tjar = jar.substring(\"jar:file:\".length(), jar.indexOf('!'));\n\t\ttop = jar.substring(0, jar.lastIndexOf('/')+1);\n\t//} else if (new File(\"/c:/temp\").exists()) { // my development => CLASSPATH\n\t//\ttop = \"/c:/temp\";\n\t\t// CLASSPATH is selfsame JAR -- ignore as ClassLoader gets anyhow\n\n\t} else { // others' development: e.g., \"file:/D:/prj/Multivalent/www/jar/multivalent/Multivalent.class\"\n\t\tint inx = jar.lastIndexOf('/'); // chop \"Multivalent.class\"\n\t\tinx = jar.lastIndexOf('/', inx-1); // chop \"multivalent\"\n\n\t\tjar = jar.substring(\"file:\".length(), inx+1);\n//System.out.println(\"jar = \"+jar);\n\t\ttop = jar;\n\t}\n\n\n\tList urls = new ArrayList(20);\n\n\tif (standalone_) System.out.println(\"Searching for JARs in \"+top);\n\ttry {\n\t\tFile[] f = new File(top).listFiles(filter);\n\t\tfor (int i=0,imax=f.length; i<imax; i++) {\n\t\t\turls.add(f[i].toURI().toURL());\n\t\t\tif (standalone_) System.out.println(\"\\t\"+f[i]);\n\t\t}\n\t} catch (MalformedURLException canthappen) { System.err.println(canthappen/*f[i]*/); System.err.println(\"Move to different directory\"); }\n\n\treturn (URL[])urls.toArray(new URL[0]);\n }", "@Test\r\n public void testMergeSpectra() throws Exception {\n }", "private List<SpectrumInterface> fetchSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\tif (spectrumIds == null)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tsetSpectrumIdsTarget(spectrumIds);\r\n\t\t/*\r\n\t\t * Reset spectrum data.\r\n\t\t */\r\n\t\tint nSpectra = spectrumIds.size();\r\n\t\tspectrumArray = new SpectrumImpl[nSpectra];\r\n\t\t\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t\r\n\t\t/*\r\n\t\t * Create list of mass and intensity data and get dataLength as side\r\n\t\t * result.\r\n\t\t */\r\n\t\tint dataLength = 0;\r\n\t\tList<Double> peakMassData = new ArrayList<Double>();\r\n\t\tList<Double> peakIntensityData = new ArrayList<Double>();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\tfloat basePeakIntensity = 0, totalIntensity = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tspectrumTagsFound = 0;\r\n\t\t\tinTargetSpectrumBlock = false;\r\n\t\t\tString line;\r\n\t\t\tint lineNo = 0;\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\tif (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * New spectrum\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"New spectrum: numberOfSpectra = \" + numberOfSpectra);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if data for previous peak list has been collected.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif (inTargetSpectrumBlock)\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\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Reset peak list data.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tdataLength = 0;\r\n\t\t\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add spectrum id to list if not already in it.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!getSpectrumIdsFound().contains(currentSpectrumIdStr))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if desired spectrum id found.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tspectrumIndex = -1;\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (currentSpectrumIdStr.equals(getSpectrumIdsTarget().get(i)))\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\t * Save information in order to get\r\n\t\t\t\t\t\t\t * spectrum mass and intensity values.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t\t\tinTargetSpectrumBlock = true;\r\n\t\t\t\t\t\t\tspectrumIndex = i;\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get new spectrum object to store retrieved data in.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tSpectrumImpl currentSpectrum = SpectrumImpl.buildSpectrum(); // changed slewis to allow class to change\r\n\t\t\t\t\t\t\tsetSpectrum(currentSpectrum);\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + spectrumIndex + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" found.\");\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get spectrum header data from PKL file\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\ttotalIntensity = 0;\r\n\t\t\t\t\t\t\tbasePeakIntensity = 0;\r\n\t\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\t\t\tFloat massToChargeRatio = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tFloat intensity = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tInteger chargeState = Integer.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\t// Store spectrum header values from PKL file\r\n\t\t\t\t\t\t\t//log.debug(\"SpectrumId = \\\"\" + getCurrentSpectrumId() + \"\\\" massToChargeRatio = \" + massToChargeRatio + \" intensity = \" + intensity + \" chargeState = \" + chargeState);\r\n\t\t\t\t\t\t\tSpectrumPrecursor spectrumPrecursor = SpectrumPrecursor.buildSpectrumPrecursor(); // changed slewis to support overrides\r\n\t\t\t\t\t\t\tspectrumPrecursor.setMassToChargeRatio(massToChargeRatio.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setIntensity(intensity.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setCharge(chargeState);\r\n\t\t\t\t\t\t\tList<SpectrumPrecursor> precursors = new ArrayList<SpectrumPrecursor>();\r\n\t\t\t\t\t\t\tprecursors.add(spectrumPrecursor);\r\n\t\t\t\t\t\t\tgetSpectrum().setPrecursors(precursors);\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 (inTargetSpectrumBlock && line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Collect data for peak.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\tdouble peakMass = Double.valueOf(st.nextToken());\r\n\t\t\t\t\tdouble peakIntensity = Double.valueOf(st.nextToken());\r\n\t\t\t\t\t//log.debug(\"Spectra line (\" + lineNo + \") = \\\"\" + line + \"\\\", peakMass = \" + peakMass + \" peakIntensity = \" + peakIntensity);\r\n\t\t\t\t\tpeakMassData.add(dataLength, peakMass);\r\n\t\t\t\t\tpeakIntensityData.add(dataLength, peakIntensity);\r\n\t\t\t\t\tdataLength++;\r\n\t\t\t\t\t// Update statistical spectrum values\r\n\t\t\t\t\tif (peakIntensity > basePeakIntensity)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePeakIntensity = (float) peakIntensity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttotalIntensity += peakIntensity;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Other line\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"Unidentified line (\" + lineNo + \") = \\\"\" + line + \"\\\"\");\r\n\t\t\t\t}\r\n\t\t\t\tlineNo++;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Check if data for peak list has been collected.\r\n\t\t\t */\r\n\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t */\r\n\t\t\t\tif (inTargetSpectrumBlock)\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t/*\r\n\t\t\t\t * Reset peak list data.\r\n\t\t\t\t */\r\n\t\t\t\tdataLength = 0;\r\n\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Return result of search for PKL spectra.\r\n\t\t\t */\r\n\t\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>(nSpectra);\r\n\t\t\tfor (int i = 0; i < nSpectra; i++)\r\n\t\t\t{\r\n\t\t\t\tspectrumList.add(i, spectrumArray[i]);\r\n\t\t\t}\r\n\t\t\treturn spectrumList;\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\tthrow new BaseException(message);\r\n\t\t}\r\n\t}", "public List<SpectrumMatch> getSpectrumMatches() {\r\n return spectrumMatches;\r\n }", "public interface IPeaklistScanner {\n public Map<Integer, List<SpectrumReference>> getSpectraPerMajorPeaks(String[] filenames, int nMajorPeaks) throws Exception;\n\n public List<SpectrumReference> getSpectrumReferences(String[] filenames) throws Exception;\n\n public List<List<IndexElement>> getFileIndices();\n}", "public static void usingModuleExtractors() throws ExtractorException {\n OWLOntology ont = OntologyLoader.loadOntologyAllAxioms(\"/path/to/ontology.owl\");\n\n //Create the module extractors - implement the Extractor interface\n AMEX amex = new AMEX(ont);\n STARAMEXHybridExtractor hybrid = new STARAMEXHybridExtractor(ont);\n //MEX mex = new MEX(ont);\n\n //Generate a set of 1000 random axioms from the ontology\n Set<OWLLogicalAxiom> randomAxs = ModuleUtils.generateRandomAxioms(ont.getLogicalAxioms(),1000);\n\n //Extract a module for the signature of each axiom\n for(OWLLogicalAxiom ax : randomAxs){\n\n //Signature of the axiom\n Set<OWLEntity> sig = ax.getSignature();\n\n //Extract the modules - N.B don't need a new extractor object for each signature\n Set<OWLLogicalAxiom> amexMod = amex.extractModule(sig);\n Set<OWLLogicalAxiom> hybridMod = hybrid.extractModule(sig);\n\n System.out.println(\"AMEX: \" + amexMod.size());\n System.out.println(\"HYBRID: \" + hybridMod.size());\n System.out.println(\"STAR: \" + hybrid.getStarModule().size()); //STAR module is computed through the hybrid module\n System.out.println();\n }\n\n }", "public String searchExportedPlugins()\n\t{\n\t\tFile parent = null;\n\t\tif (System.getProperty(\"eclipse.home.location\") != null)\n\t\t\tparent = new File(URI.create(System.getProperty(\"eclipse.home.location\").replaceAll(\" \", \"%20\")));\n\t\telse parent = new File(System.getProperty(\"user.dir\"));\n\n\t\tList<String> pluginLocations = exportModel.getPluginLocations();\n\t\tfor (String libName : NG_LIBS)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tboolean found = false;\n\t\t\twhile (!found && i < pluginLocations.size())\n\t\t\t{\n\t\t\t\tFile pluginLocation = new File(pluginLocations.get(i));\n\t\t\t\tif (!pluginLocation.isAbsolute())\n\t\t\t\t{\n\t\t\t\t\tpluginLocation = new File(parent, pluginLocations.get(i));\n\t\t\t\t}\n\t\t\t\tFileFilter filter = new WildcardFileFilter(libName);\n\t\t\t\tFile[] libs = pluginLocation.listFiles(filter);\n\t\t\t\tif (libs != null && libs.length > 0)\n\t\t\t\t{\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (!found) return libName;\n\t\t}\n\t\treturn null;\n\t}", "Map<Modification, Integer> getUsedModifications(SpectrumAnnotatorResult spectrumAnnotatorResult);", "public static void main(String[] a){\n\n try {\n log.info(\"loading..\");\n\n //ExonQuantSource qs = new ExonQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n //ExonEQTLSource es = new ExonEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n TransQuantSource qs = new TransQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n TransEQTLSource es = new TransEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n\n AggregatedDataSource aggregatedSource = new AggregatedDataSource(qs, es);\n\n log.info(\"loaded\");\n\n log.info(\" \" + ((GenericQuantDataSource)aggregatedSource.quantSource).getStats());\n log.info(\" \" + ((GenericEQTLDataSource)aggregatedSource.eQTLSource).getStats());\n\n String chr = \"1\";\n int start = 1628906;\n int stop = 1629906;\n\n log.info(\"selecting \" + chr + \":\" + start + \"-\" + stop);\n\n ArrayList<DataFeature> quantResult = null;\n ArrayList<DataFeature> eQTLResult = null;\n\n long startTime = System.currentTimeMillis();\n\n quantResult = aggregatedSource.locateQuantFeatures(chr, start, stop);\n eQTLResult = aggregatedSource.locateEQTLFeatures(chr, start, stop);\n\n //for(int i=9;i<1000;i++) {\n //}\n\n long estimatedTime = System.currentTimeMillis() - startTime;\n\n log.info(\"Estimated run time:\" + estimatedTime + \" Millis\");\n\n log.info(\"quantResult.size() = \" + quantResult.size());\n log.info(\"eQTLResult.size() = \" + eQTLResult.size());\n\n for (DataFeature f : quantResult) {\n log.info(\"1 f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore() );\n }\n\n for (DataFeature f : eQTLResult) {\n log.info(\"f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore());\n\n log.info(\"linked to :\");\n\n for (LinkedFeature l0 : f.getLinked()) {\n log.info(\" linked = \" + l0.getFeature().getId() + \" start:\" + l0.getFeature().getStart() +\n \" end:\" + l0.getFeature().getEnd() + \" link score:\" + l0.getLinkScore());\n }\n }\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// Auto-generated catch block\n\t\t\tlog.error(\"Error!\", e);\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n log.error(\"Error!\", e);\n\t\t}\n\t}", "private void setDetector() {\n\n try {\n AssetManager assetManager = getAssets();\n String[] fileList = assetManager.list(modelPath);\n String modelType = dlaasD.ReturnModelType(assetManager, modelPath);\n\n if (fileList.length != 0) {\n\n if (modelType.equals(\"mobilenet_1\")) {\n detector = new MobileNet(rs, assetManager, modelPath);\n } else {\n\n detector = new MobileNetSSD(rs, assetManager, modelPath);\n }\n } else {\n if (modelType.equals(\"mobilenet_1\")) {\n String modelDir = Environment.getExternalStorageDirectory().getPath() + \"/\" + modelPath;\n detector = new MobileNet(rs, assetManager, modelDir);\n } else {\n String modelDir = Environment.getExternalStorageDirectory().getPath() + \"/\" + modelPath;\n detector = new MobileNetSSD(rs, assetManager, modelDir);\n }\n\n }\n } catch (IOException e) {\n Log.d(\"onFindModule: \", e.toString());\n e.printStackTrace();\n }\n }", "public void testDifferentDotProducts() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n int total = 0;\n int different = 0;\n ISimilarityChecker checker = new FrankEtAlDotProduct(0.5F, 15, true);\n ISimilarityChecker currentChecker = new FrankEtAlDotProductJohannes();\n\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n if (Math.abs(dotOrg - dotNew) > 0.00001) {\n different++;\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n // these are the really interesting cases\n dotOrg = checker.assessSimilarity(psm1, psm2);\n\n double noClosestPeak = dotNew;\n dotNew = currentChecker.assessSimilarity(psm1, psm2);\n String id2 = psm2.getId();\n String id1 = psm1.getId();\n interestingIds.add(id1);\n interestingIds.add(id2);\n\n // System.out.println(usedPeaksTester.toString());\n // System.out.printf(id2 + \":\" + id1 + \" \" + \"Old: %8.3f Newx: %8.3f New: %8.3f\\tDiff: %8.3f\\n\", dotOrg, noClosestPeak, dotNew, dotOrg - dotNew);\n }\n total++;\n\n }\n\n }\n\n List<String> sorted = new ArrayList<>(interestingIds);\n Collections.sort(sorted);\n // System.out.println(\"Interesting Ids\");\n for (String s : sorted) {\n // System.out.println(s);\n }\n\n\n TestCase.assertEquals(0, different);\n }", "IIndexFragmentBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor) throws CoreException;", "public void searchLights() {\n\t\n\t\t// try to limit searching\n\t\tif(ports.contains(motors)) ports.remove(motors);\n\t\tif(state.get(State.values.serialport) != null) \n\t\t\tports.remove(state.get(State.values.serialport));\n\t\t\t\n\t\tUtil.debug(\"discovery for lights starting on ports: \" + ports.size(), this);\n\t\t\n\t\tfor (int i = ports.size() - 1; i >= 0; i--) {\n\t\t\tif (state.get(State.values.lightport)!=null) { break; } // stop if find it\n\t\t\t//if (connect(ports.get(i), BAUD_RATES[0])) {\t\n\t\t\tif (connect(ports.get(i), 57600)) {\n\t\t\t\tUtil.delay(TIMEOUT*2);\n\t\t\t\tif (serialPort != null) { close(); }\n\t\t\t}\n\t\t}\n\t}", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "public void features() throws MalformedURLException, IOException {\n\t\tMBFImage query = ImageUtilities.readMBF(new File(\"/home/marcus/eclipse_new/images/aviao01.jpg\"));\n\t\tMBFImage target = ImageUtilities.readMBF(new File(\"/home/marcus/eclipse_new/images/aviao02.jpg\"));\n\n\t\tDoGSIFTEngine engine = new DoGSIFTEngine();\n\t\tLocalFeatureList<Keypoint> queryKeypoints = engine.findFeatures(query.flatten());\n\t\tLocalFeatureList<Keypoint> targetKeypoints = engine.findFeatures(target.flatten());\n\t\tLocalFeatureMatcher<Keypoint> matcher1 = new BasicMatcher<Keypoint>(80);\n\t\tLocalFeatureMatcher<Keypoint> matcher = new BasicTwoWayMatcher<Keypoint>();\n\t\t/*\n\t\t * matcher.setModelFeatures(queryKeypoints);\n\t\t * matcher.findMatches(targetKeypoints); MBFImage basicMatches =\n\t\t * MatchingUtilities.drawMatches(query, target, matcher.getMatches(),\n\t\t * RGBColour.RED); DisplayUtilities.display(basicMatches);\n\t\t */\n\t\tRobustAffineTransformEstimator modelFitter = new RobustAffineTransformEstimator(5.0, 1500,\n\t\t\t\tnew RANSAC.PercentageInliersStoppingCondition(0.5));\n\t\tmatcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(new FastBasicKeypointMatcher<Keypoint>(8), modelFitter);\n\t\tmatcher.setModelFeatures(queryKeypoints);\n\t\tmatcher.findMatches(targetKeypoints);\n\t\tMBFImage consistentMatches = MatchingUtilities.drawMatches(query, target, matcher.getMatches(), RGBColour.RED);\n\t\tDisplayUtilities.display(consistentMatches);\n\t\ttarget.drawShape(query.getBounds().transform(modelFitter.getModel().getTransform().inverse()), 3,\n\t\t\t\tRGBColour.BLUE);\n\t\t// DisplayUtilities.display(target);\n\t}", "private List<Measurer> getMeasurers(String genomeId) {\n List<Measurer> retVal = new ArrayList<Measurer>(this.methods.size());\n Genome genome = this.getGenome(genomeId);\n this.genomeName1 = genome.getName();\n this.taxAnalysis1 = this.taxMethod.new Analysis(genome);\n for (var method : this.methods) {\n var measurer = method.getMeasurer(genome);\n retVal.add(measurer);\n }\n return retVal;\n }", "public static void main(String[] args) {\n Inventory inventory = new Inventory();\n initializeInventory(inventory);\n\n GuitarSpec test = \n new GuitarSpec(\"b\", \"b\", \"b\", \"b\");\n List matchingGuitars = inventory.search(test);\n if (!matchingGuitars.isEmpty()) {\n System.out.println(\"搜索结果----\");\n for (Iterator i = matchingGuitars.iterator(); i.hasNext(); ) {\n Guitar guitar = (Guitar)i.next();\n GuitarSpec spec = guitar.getSpec();\n System.out.println(\"你搜索的这款吉他:品牌为\" +spec.getBuilder() + \"--型号为\" + spec.getModel() + \"--类型为\" +\n spec.getType() + \"--材质为\" +spec.getWood() + \"--价格为¥\" +\n guitar.getPrice()+\"--ID为\"+guitar.getID());\n }\n } else {\n System.out.println(\"Sorry, 我们没有这一款吉他.\");\n }\n }", "public Lab[] getAvailableLabs()\n {\n List<Lab> labsList = new ArrayList<Lab> ();\n File [] files = directory.listFiles();\n for (File file : files)\n {\n Lab lab = Lab.getInstance(file);\n if (lab != null)\n labsList.add(lab);\n }\n return labsList.toArray(new Lab [0]);\n }", "private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}", "long getNumberOfSpectra(String experimentAccession);", "private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}", "public static List<IConfigurationElement> findRenderer(final Shell shell, final Object object) {\r\n String type = object.getClass().getSimpleName();\r\n List<IConfigurationElement> matchingConfigs = new ArrayList<IConfigurationElement>();\r\n // Get the extension registry.\r\n IExtensionRegistry registry = Platform.getExtensionRegistry();\r\n\r\n // Find all the config elements for the renderer extension point.\r\n IConfigurationElement[] rendererConfigs = registry\r\n .getConfigurationElementsFor(\"org.geocraft.ui.volumeviewer.renderer\");\r\n for (IConfigurationElement rendererConfig : rendererConfigs) {\r\n // Only match if the type matches.\r\n if (rendererConfig.getAttribute(\"type\").equals(type)) {\r\n matchingConfigs.add(rendererConfig);\r\n }\r\n }\r\n return matchingConfigs;\r\n }", "public List<Manufacturer> getManufactures(String name) throws IOException {\n return getManufactures(name,25,0);\n }", "private void generalFeatureExtraction () {\n Logger.log(\"Counting how many calls each method does\");\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n try {\n for (SootClass sclass : classes) {\n if (!isLibraryClass(sclass)) {\n System.out.println(ConsoleColors.RED_UNDERLINED + \"\\n\\n 🔍🔍 Checking invocations in \" +\n sclass.getName() + \" 🔍🔍 \" + ConsoleColors.RESET);\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n featuresMap.put(method, new Features(method));\n }\n }\n }\n } catch (Exception e) { \n }\n System.out.println(\"\\n\");\n }", "private void initModuleLibraries() {\r\n // local path in the temporarily directory for this module\r\n String localTmpPath = \"soundModule\";\r\n\r\n // path to jar\r\n String jarPath = System.getProperty(\"user.dir\") + File.separator\r\n + \"modules\" + File.separator + \"soundModule.jar\";\r\n\r\n // extract the jar files for sound module\r\n try {\r\n JarUtil.extractFileFromJar(jarPath, localTmpPath, \"lib\", \"jl1.0.jar\");\r\n JarUtil.extractFileFromJar(jarPath, localTmpPath, \"lib\",\r\n \"mp3spi1.9.4.jar\");\r\n JarUtil.extractFileFromJar(jarPath, localTmpPath, \"lib\",\r\n \"tritonus_share-0.3.6.jar\");\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n // add this path in the library path...\r\n JarUtil.setLibraryPath(localTmpPath);\r\n\r\n // load jars from that temporarily directory (sound required jars)\r\n JarUtil.loadJar(localTmpPath, \"tritonus_share-0.3.6.jar\");\r\n JarUtil.loadJar(localTmpPath, \"mp3spi1.9.4.jar\");\r\n JarUtil.loadJar(localTmpPath, \"jl1.0.jar\");\r\n }", "void parallelSearch(File searchFrom) {\n for (File file : searchFrom.listFiles()) {\n if (file.isDirectory()) {\n this.parallelSearch(file);\n }\n\n if (extensions.stream().anyMatch(x -> file.getName().endsWith(x))) {\n try {\n queue.put(file);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }", "void getSpectraAsMgfFile(String experimentAccession, File mgfFile, boolean rebuildCache);", "public int getNumberSpectra() {\n return numberSpectra;\n }", "private static Extension[] getExtensions( final ArrayList librarys )\n throws TaskException\n {\n final ArrayList extensions = new ArrayList();\n final Iterator iterator = librarys.iterator();\n while( iterator.hasNext() )\n {\n final LibFileSet fileSet = (LibFileSet)iterator.next();\n final DirectoryScanner scanner = ScannerUtil.getDirectoryScanner( fileSet );\n final File basedir = scanner.getBasedir();\n final String[] files = scanner.getIncludedFiles();\n for( int i = 0; i < files.length; i++ )\n {\n final File file = new File( basedir, files[ i ] );\n loadExtensions( file, extensions );\n }\n }\n return (Extension[])extensions.toArray( new Extension[ extensions.size() ] );\n }", "IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException;", "public void setSpectrumMatches(List<SpectrumMatch> spectrumMatches) {\r\n this.spectrumMatches = spectrumMatches;\r\n }", "private void ImportLibrary(){\n for(int i = 0; i < refact.size(); i++){\n if(refact.get(i).contains(\"import\")){\n for(String library : libraries){\n refact.add(i, library + \"\\r\");\n }\n break;\n }\n }\n\n\n }", "public String[] getSoundDevicesList();", "private void identification(JFrame frame) {\r\n\t\t// Recognito code\r\n\t\trecognito = new Recognito<>(16000.0f);\r\n\t\ttry {\r\n\t\t\tList<File> filesInFolder = Files.walk(Paths.get(\"sounds/patterns\")).filter(Files::isRegularFile).map(Path::toFile).collect(Collectors.toList());\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\trecognito.createVoicePrint(name, file);\r\n\t\t\t}\r\n\t\t\tList<MatchResult<String>> matches;\r\n\t\t\tmatches = recognito.identify(new File(\"sounds/samples/Person\" + MainWindow.identificationCount + \".wav\"));\r\n\t\t\tMatchResult<String> match = matches.get(0);\r\n\t\t\tfor (File file : filesInFolder) {\r\n\t\t\t\tString name = file.getName().replaceFirst(\"[.][^.]+$\", \"\");\r\n\t\t\t\tif(match.getKey().equals(name)) {\r\n\t\t\t\t\tResultWindow rw = new ResultWindow(name, match, frame);\r\n\t\t\t\t\trw.setVisible(true);\r\n\t\t\t\t\tframe.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (UnsupportedAudioFileException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "List<JModuleInfo> queryAll();", "@Override\n public List<SynthComponent> recognizeModules()\n throws SynthComponentException, ComponentBuildException\n {\n Reply reply;\n try {\n Request.Builder rb = Request.newBuilder();\n rb.setCommand(Request.Command.DESCRIBE);\n Request request = rb.build();\n sendRequest(request);\n\n reply = receiveReply();\n System.out.println(reply);\n\n } catch (IOException ex) {\n throw new ComponentBuildException(\n NetRackConnector.class.getSimpleName()\n + \": Network error. host=\" + host + \", port=\"\n + port, ex);\n }\n\n // Build modules from the description. \n List<SynthComponent> components = new ArrayList<SynthComponent>();\n for (Component cnComponent : reply.getComponentList()) {\n SynthComponent module = fetchComponent(cnComponent);\n if (module != null) {\n components.add(module);\n }\n }\n\n return components;\n }", "public List<Spectator> findAllSpectators(){\n\t\treturn spectatorRepository.findAll();\n\t}", "public static void main(String[] args) {\n\t\tString dir = \"C:\\\\Jat\\\\jat\\\\input\\\\\";\n\t\tString gpsmeasfile = \"gps\\\\rgpsmeas_rbar_geom1_mp.jat\";\n//\t\tString gpsmeasfile = \"gpsmeasblk.txt\";\n\t\tString insmeasfile = \"simu_rbar.jat\";\n\t\tString rinexfile = \"gps\\\\rinex.n\";\n//\t\tRGPS_MeasurementList gps = new RGPS_MeasurementList();\n//\t\tgps.readFromFile(dir+gpsmeasfile);\n\t\tRGPS_MeasurementList gps = RGPS_MeasurementList.recover(dir+gpsmeasfile);\n\t\tINS_MeasurementList ins = INS_MeasurementList.recover(dir+insmeasfile);\n//\t\tint big = ins.size();\n//\t\tSystem.out.println(\"ins size = \"+big);\n\t\tlong seed = -1;\n\t\tGPS_Constellation constellation = new GPS_Constellation(dir+rinexfile);\n\t\tLinePrinter lp1 = new LinePrinter(\"C:\\\\Jat\\\\jat\\\\output\\\\ekf_simu_rbar_geom1_mp_new_at_1.txt\");\n\t\tLinePrinter lp2 = new LinePrinter(\"C:\\\\Jat\\\\jat\\\\output\\\\ekf_simu_rbar_geom1_mp_new_at_2.txt\");\n\t\tLinePrinter lp3 = new LinePrinter(\"C:\\\\Jat\\\\jat\\\\output\\\\ekf_simu_rbar_geom1_mp_at_resid.txt\");\n\t\tProcessModel process = new RGPS_SIMU_ProcessModel(ins, constellation, lp1, lp2, lp3, seed);\n\t\tMeasurementModel meas = new RGPS_INS_MeasurementModel(gps, constellation);\n\t\tExtendedKalmanFilter ekf = new ExtendedKalmanFilter(meas, gps, process);\n\t\tlong ts = System.currentTimeMillis();\n\n\t\tekf.process();\n\t\t\n\t\tlong tf = System.currentTimeMillis();\n\t\tdouble dtf = (tf - ts)/(60.0 * 1000.0);\n\t\tSystem.out.println(\"EKF Time Elapsed: \"+dtf);\n\t\t\n\n\t}", "public static void main(String[] args) {\n Inventory inventory = new Inventory(); \n \n List<Guitar> allGuitars=initializeInventory();//添加guitar列表\n \n \n GuitarSpec whatErinLikes = \n new GuitarSpec(Builder.JIANGSU, \"Stratocastor\", \n Type.ACOUSTIC, Wood.CAMPHOR, Wood.CAMPHOR);\n List matchingGuitars = inventory.search(whatErinLikes,allGuitars);\n if (!matchingGuitars.isEmpty()) {\n System.out.println(\"Erin, you might like these guitars:\");\n for (Iterator i = matchingGuitars.iterator(); i.hasNext(); ) {\n Guitar guitar = (Guitar)i.next();\n GuitarSpec spec = guitar.getSpec();\n System.out.println(\" We have a \" +\n spec.getBuilder() + \" \" + spec.getModel() + \" \" +\n spec.getType() + \" guitar:\\n \" +\n spec.getBackWood() + \" back and sides,\\n \" +\n spec.getTopWood() + \" top.\\n You can have it for only $\" +\n guitar.getPrice() + \"!\\n ----\");\n }\n } else {\n System.out.println(\"Sorry, Erin, we have nothing for you.\");\n }\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 283, 353);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setTitle(\"Search\");\n\t\t\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedLookAndFeelException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tframe.getContentPane().add(panel, BorderLayout.CENTER);\n\t\tpanel.setLayout(new MigLayout(\"\", \"[421.00,grow,center]\", \"[][][][][][][][][]\"));\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title\");\n\t\tlblTitle.setFont(new Font(\"Tahoma\", Font.BOLD, 22));\n\t\tpanel.add(lblTitle, \"cell 0 0\");\n\t\t\n\t\ttitleField = new JTextField();\n\t\ttitleField.setFont(new Font(\"Tahoma\", Font.PLAIN, 24));\n\t\ttitleField.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tpanel.add(titleField, \"cell 0 1,growx\");\n\t\ttitleField.setColumns(10);\n\t\t\n\t\tJLabel lblMediaType = new JLabel(\"Media Type\");\n\t\tlblMediaType.setFont(new Font(\"Tahoma\", Font.BOLD, 22));\n\t\tpanel.add(lblMediaType, \"flowx,cell 0 2\");\n\t\t\n\t\tJLabel label = new JLabel(\"\");\n\t\tpanel.add(label, \"cell 0 2\");\n\t\t\n\t\tJButton btnSearch = new JButton(\"Search\");\n\t\t\n\t\tbtnSearch.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString title = titleField.getText();\n\t\t\t\tString prod = productionField.getText();\n\t\t\t\t\n\t\t\t\tif(productionField.getText().equals(\"\"))\n\t\t\t\t\tprod = \"*\";\n\t\t\t\t\n\t\t\t\tHashMap<String, String> infoMap = Database.search(title, \"movie\", prod);\n\t\t\t\t\n\t\t\t\tnew InformationGUI(infoMap);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tJComboBox<String> comboBox = new JComboBox<String>();\n\t\tcomboBox.setModel(new DefaultComboBoxModel<String>(new String[] {\"movie\", \"tv series\", \"tv movie\", \"video movie\", \"tv miniseries\", \"video game\"}));\n\t\t((JLabel)comboBox.getRenderer()).setHorizontalAlignment(SwingConstants.CENTER);\n\t\tpanel.add(comboBox, \"cell 0 3,growx\");\n\t\t\n\t\tJLabel lblProductionYear = new JLabel(\"Production Year\");\n\t\tlblProductionYear.setFont(new Font(\"Tahoma\", Font.BOLD, 20));\n\t\tpanel.add(lblProductionYear, \"cell 0 5\");\n\t\t\n\t\tproductionField = new JTextField();\n\t\tproductionField.setFont(new Font(\"Tahoma\", Font.PLAIN, 24));\n\t\tproductionField.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tpanel.add(productionField, \"cell 0 6,growx\");\n\t\tproductionField.setColumns(10);\n\t\tpanel.add(btnSearch, \"cell 0 8\");\n\t}", "public Iterator<SpectrumInterface> getSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\t/*\r\n\t\t * Search for desired spectra.\r\n\t\t */\r\n\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>();\r\n\t\tspectrumList = fetchSpectrum(spectrumIds);\r\n\t\tlog.debug(\"spectrumIds.size() = \" + spectrumIds.size() + \", spectrumList.size() = \" + spectrumList.size());\r\n\r\n\t\t/*\r\n\t\t * Return spectrum iterator.\r\n\t\t */\r\n\t\treturn spectrumList.iterator();\r\n\t}", "private List<String> fetchSpectrumIds()\r\n\t\t\tthrows InvalidDataException\r\n\t{\r\n\t\t/*\r\n\t\t * Reset search items.\r\n\t\t */\r\n\t\tresetIdsToFind();\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tString line;\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 (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// New spectrum\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return null if no items found.\r\n\t\t */\r\n\t\tif (getSpectrumIdsFound().size() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return result of search for spectrum id values.\r\n\t\t */\r\n\t\treturn getSpectrumIdsFound();\r\n\t}", "private List<List<XMLResults>> loadResults()\n {\n List<List<XMLResults>> ret = new ArrayList<List<XMLResults>>();\n\n for( Platform p : platforms ) {\n\n String platformResultsDir = p.resultsDir+\"/\"+p.libraryDir;\n\n File platformDir = new File(platformResultsDir);\n\n if( !platformDir.exists() ) {\n throw new RuntimeException(\"Results for \"+p.libraryDir+\" do not exist in \"+p.resultsDir);\n }\n\n List<XMLResults> opResults = new ArrayList<XMLResults>();\n\n File[] files = platformDir.listFiles();\n\n for( File f : files ) {\n String fileName = f.getName();\n\n if( fileName.contains(\".csv\")) {\n // extract the operation name\n String stripName = fileName.substring(0,fileName.length()-4);\n\n XMLResults r = new XMLResults();\n r.fileName = stripName;\n r.results = RuntimeResultsCsvIO.read(new File(f.getAbsolutePath()));\n\n opResults.add(r);\n }\n }\n\n ret.add( opResults );\n }\n\n return ret;\n }", "private JsonObject search(JsonObject request) {\n\t\t\tJsonObject result = new JsonObject();\n\t\t\tJsonArray artists = new JsonArray();\n\t\t\tJsonArray titles = new JsonArray();\n\t\t\tJsonArray tags = new JsonArray();\n\t\t\tJsonArray arSimilars = new JsonArray();\n\t\t\tJsonArray tiSimilars = new JsonArray();\n\t\t\tJsonArray taSimilars = new JsonArray();\n\t\t\t//Individually search by artist, by title and by tag. \n\t\t\tartists = request.getAsJsonArray(\"searchByArtist\");\n\t\t\ttitles = request.getAsJsonArray(\"searchByTitle\");\n\t\t\ttags = request.getAsJsonArray(\"searchByTag\");\n\t\t\t//If the request contains \"artist\", we search each artist's similar song, and add it to a JsonArray.\n\t\t\tif(artists != null && artists.size() >= 1) {\n\t\t\t\tfor(JsonElement artist: artists) {\n\t\t\t\t\tarSimilars.add(this.sl.searchByArtist(artist.getAsString()));\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByArtist\".\n\t\t\t\tresult.add(\"searchByArtist\", arSimilars);\n\t\t\t}\n\t\t\t//If the request contains \"tag\", we search each tag's similar song, and add it to a JsonArray.\n\t\t\tif(tags != null && tags.size() >= 1) {\n\t\t\t\tfor(JsonElement tag: tags) {\t\t\t\t\n\t\t\t\t\ttaSimilars.add(this.sl.searchByTag(tag.getAsString()));\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTag\".\n\t\t\t\tresult.add(\"searchByTag\", taSimilars);\n\t\t\t}\t\t\n\t\t\t//If the request contains title, we search each title's similar song, and add it to a JsonArray\n\t\t\tif(titles != null && titles.size() >= 1) {\t\t\t\n\t\t\t\tfor(JsonElement title: titles) {\n\t\t\t\t\ttiSimilars.add(this.sl.searchByTitle(title.getAsString()));\n\t\t\t\t}\n\t\t\t\t//We add the JsonArray to result, associated with \"searchByTiltle\".\n\t\t\t\tresult.add(\"searchByTitle\", tiSimilars);\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "public boolean selectFromAvailableModels() throws Exception{\r\n\t\t\r\n\t\tboolean rB=false;\r\n\t\t\t\r\n\t\tbaseFolder = soappProperties.getBaseModelFolder() ;\r\n\t\t\t\t\t // sth like: \"D:/data/projects/_classifierTesting/bank2/models\"\r\n\t\t\r\n\t\tactiveModel = soappProperties.getActiveModel() ; // sth like \"bank2\" \r\n\t\t// this refers to the name of the project as it is contained in the model file!!\r\n\t\t// on first loading, a catalog of available model will be created for faster access if it does not exists\r\n\t\r\n\t\tif (activeModel.length()>0){ \r\n\t\t\t\t\t\t\t\t\t\t\tout.print(2, \"checking model catalog associated with selected project ...\") ;\r\n\t\t\tcheckCreateLocationCatalog() ;\r\n\t\t} else{\r\n\t\t\t// alternatively, we set the active model to blank here, and provide the package name ;\r\n\t\t\t// whenever the active model name is given (and existing) it will be preferred!\r\n\t\t\t \r\n\t\t\tmodelPackageName = soappProperties.getModelPackageName();\r\n\t\t\tactiveModel = getModelThroughPackage(modelPackageName ) ;\r\n\t\t}\r\n\t\t\r\n\t\t// now reading from the modelcatalog.dat\r\n\t\t\r\n\t\t/*\r\n\t \t_MODELSELECT_LATEST = 1;\r\n\t\t_MODELSELECT_FIRSTFOUND = 2;\r\n\t\t_MODELSELECT_BEST = 4;\r\n\t\t_MODELSELECT_ROBUST = 8;\r\n\t\t_MODELSELECT_VERSION = 16 ;\r\n\t\t */\r\n\t\tModelCatalogItem mcItem= null, mci = null ;\r\n\r\n\t\tif (soappModelCatalog.size()>0){\r\n\t\t\tint m=0;\r\n\t\t\tboolean mciOK=false;\r\n\t\t\t\r\n\t\t\twhile ( (mciOK==false) && (mcItem==null) && (m<soappModelCatalog.size())){\r\n\t\t\t\t\r\n\t\t\t\tif (soappProperties.getModelSelectionMode() == SomAppProperties._MODELSELECT_FIRSTFOUND){\r\n\t\t\t\t\tmci = soappModelCatalog.getItem(m);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (soappProperties.getModelSelectionMode() == SomAppProperties._MODELSELECT_LATEST){\r\n\t\t\t\t\tmci = soappModelCatalog.getLatestItem();\r\n\t\t\t\t}\r\n\t\t\t\tif (soappProperties.getModelSelectionMode() == SomAppProperties._MODELSELECT_BEST){\r\n\t\t\t\t\tmci = soappModelCatalog.getBestItem();\r\n\t\t\t\t}\r\n\t\t\t\tif (soappProperties.getModelSelectionMode() == SomAppProperties._MODELSELECT_VERSION){\r\n\t\t\t\t\tmci = soappModelCatalog.getItemByModelname( activeModel, soappProperties.preferredModelVersion ) ;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// checking whether the model contains the required fields mcItem.requiredfields\r\n\t\t\t\tif (modelCheckRequirements(mci) == false ){\r\n\t\t\t\t\tsoappModelCatalog.addToExcludedItems(mci);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmciOK=true;\r\n\t\t\t\t\tmcItem = mci;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tm++;\r\n\t\t\t} // ->\r\n\t\t\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tmcItem=null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tactiveModel = \"\" ;\r\n\t\tactiveVersion = \"\" ;\r\n\t\t\r\n\t\tif (mcItem!=null){\r\n\t\t\tactiveVersion = mcItem.modelVersion;\r\n\t\t\tactiveModel = mcItem.modelName;\r\n\t\t\trB=true;\r\n\t\t\t\r\n\t\t\tif (activeModel.length()==0){\r\n\t\t\t\trB = false;\r\n\t\t\t}\r\n\t\t\tif (activeVersion.length()==0){\r\n\t\t\t\trB = false;\r\n\t\t\t}\r\n\r\n\t\t}else{ // mcItem ?\r\n\t\t\tout.print(2,\"No matching model (by required fields) found in the list (n=\"+soappModelCatalog.size()+\") of available models.\");\r\n\t\t}\r\n\t\treturn rB;\r\n\t}", "private void scan() {\n final ClassGraph classGraph = new ClassGraph();\n classGraph.enableAnnotationInfo().ignoreClassVisibility().blacklistLibOrExtJars()\n .removeTemporaryFilesAfterScan();\n if (whitelistedPackagesList.size() > 0) {\n classGraph.whitelistPackages(whitelistedPackagesList.toArray(new String[0]));\n }\n if (blacklistedPackagesList.size() > 0) {\n classGraph.blacklistPackages(blacklistedPackagesList.toArray(new String[0]));\n }\n final ScanResult scanResult = classGraph.scan();\n final ClassInfoList classInfoList = scanResult.getClassesWithAnnotation(MetricClass.class.getName());\n final Set<Class<?>> monitorClasses = new HashSet<>();\n monitorClasses.addAll(classInfoList.loadClasses(true));\n final List<CompositeData> metricClassCompositesList = new ArrayList<>();\n for (Class<?> monitorClass : monitorClasses) {\n try {\n final CompositeData metricClassComposite = new MonitorCompositeDataBuilder(monitorClass).getMetricClassData();\n metricClassCompositesList.add(metricClassComposite);\n } catch (OpenDataException ox) {\n logger.error(\"Build monitor metricaAnnotation failed: \" + monitorClass.getName());\n }\n }\n\n final int monitorCount = metricClassCompositesList.size();\n final String[] monitorKey = new String[monitorCount];\n final String[] monitorKeyDescription = new String[monitorCount];\n @SuppressWarnings(\"rawtypes\")\n final OpenType[] monitorType = new OpenType[monitorCount];\n final CompositeData[] metricClassComposites = metricClassCompositesList.toArray(new CompositeData[0]);\n for (int j = 0; j < metricClassComposites.length; j++) {\n final CompositeData metricClassComposite = metricClassComposites[j];\n monitorKey[j] = metricClassComposite.getCompositeType().getTypeName();\n monitorKeyDescription[j] = metricClassComposite.getCompositeType().getDescription();\n monitorType[j] = metricClassComposite.getCompositeType();\n }\n\n try {\n final CompositeType allMonitorCompositeType = new CompositeType(\"Monitor Metric\", \"Monitor Metric Info\", monitorKey,\n monitorKeyDescription, monitorType);\n allMonitorCompositeData = new CompositeDataSupport(allMonitorCompositeType, monitorKey, metricClassComposites);\n } catch (final OpenDataException ox) {\n logger.error(\"Creating CompositeData failed\", ox);\n }\n }", "private void searchImages()\n {\n searchWeb = false;\n search();\n }", "public featureBase findWheels(int num){\n return Array[2].findNum(num);\n }", "public void getAllResults()\n {\n for(String module: modules.keySet())\n {\n getResults(module);\n }\n }", "@Override\n public List<cScene> collectScenes() {\n List<Element> eScenes = root.getChild(\"library_visual_scenes\", ns).getChildren(\"visual_scene\", ns);\n List<cScene> scenes = new ArrayList<>();\n\n List<cCamera> cameras = collectCameras();\n List<cLight> lights = collectLights();\n List<cGeometry> geometries = collectGeometry();\n List<cMaterial> materials = collectMaterials();\n\n for (Element eScene : eScenes) {\n\n cScene scene = new cScene(); //<visual_scene>..\n scene.collect(eScene, ns);\n\n for (Element eNode : eScene.getChildren(\"node\", ns)) {\n\n cNode node = new cNode(); //<node>..\n node.collect(eNode, ns);\n\n Element eInstance_Nodes;\n cInstance_Node instance_node = null;\n if ((eInstance_Nodes = eNode.getChild(\"instance_light\", ns)) != null) { //<instance_..>..\n instance_node = new cInstance_Light();\n instance_node.collect(eInstance_Nodes, ns, lights);\n } else if ((eInstance_Nodes = eNode.getChild(\"instance_geometry\", ns)) != null) {\n instance_node = new cInstance_Geometry();\n\n Element eBind_Material;\n if ((eBind_Material = eInstance_Nodes.getChild(\"bind_material\", ns)) != null) {\n List<Element> instance_materials = eBind_Material.getChild(\"technique_common\",ns).getChildren(\"instance_material\",ns);\n\n for (Element eInstMaterial : instance_materials) {\n cInstance_Geometry.Instance_Material instance_material = ((cInstance_Geometry)instance_node).getInstanceMaterial();\n instance_material.collect(eInstMaterial, ns, materials);\n ((cInstance_Geometry)instance_node).boundedMaterials.add(instance_material);\n }\n }\n instance_node.collect(eInstance_Nodes, ns, geometries);\n }\n else if ((eInstance_Nodes = eNode.getChild(\"instance_camera\", ns)) != null) {\n instance_node = new cInstance_Camera();\n instance_node.collect(eInstance_Nodes, ns, cameras);\n }\n node.instanceNode = instance_node;\n scene.nodes.add(node);\n }\n scenes.add(scene);\n }\n\n cameras = null;\n lights = null;\n geometries = null;\n materials = null;\n\n return scenes;\n }", "public abstract String filterLibraryName(final String name);", "private Set<Product> findManufacturer(IListing l) {\n\t\t\n\t\tString manufacturer = l.getManufacturer().toLowerCase();\n\t\t\n\t\t// Look for canonical manufacturer names\n\t\tSet<Product> products = productsByManufacturer.get(manufacturer.toLowerCase());\n\t\t\n\t\tif (products == null) {\n\t\t\t// See if this is a synonym of a manufacturer\n\t\t\tproducts = manufacturerSynonyms.get(manufacturer);\n\t\t}\n\t\tif (products == null) {\n\t\t\t// Exact match not found. Look for another possible match by checking occurrences of manufacturer names in the listing\n\t\t\t\n\t\t\tString manufacturerWords[] = manufacturer.split(\"\\\\s+\");\n\t\t\t\n\t\t\tfor (String s : manufacturerWords) {\n\t\t\t\tproducts = productsByManufacturer.get(s.toLowerCase());\n\t\t\t\tif (products != null) {\n\t\t\t\t\t// Note this as a synonym of the manufacturer for future use, speeding up the matching of future listings with this manufacturer\n\t\t\t\t\tmanufacturerSynonyms.put(manufacturer, products);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Still no match. Now look for the words in the synonyms\n\t\t\tif (products == null) {\n\t\t\t\t\n\t\t\t\tfor (String s : manufacturerWords) {\n\t\t\t\t\tproducts = manufacturerSynonyms.get(s.toLowerCase());\n\t\t\t\t\tif (products != null) {\n\t\t\t\t\t\t// Note this as a synonym of the manufacturer for future use, speeding up the matching of future listings with this manufacturer\n\t\t\t\t\t\tmanufacturerSynonyms.put(manufacturer, products);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn products;\n\t}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public void audio() throws MalformedURLException {\n\n \tfinal XuggleAudio xa = new XuggleAudio(\n \t\t\tnew URL(\"http://www.audiocheck.net/download.php?filename=Audio/audiocheck.net_sweep20-20klin.wav\"));\n \t\n \t/*\n \tAudioPlayer.createAudioPlayer(xa).run();\n \tfinal AudioWaveform vis = new AudioWaveform(400,400);\n \tvis.showWindow(\"Waveform\");\n \tSampleChunk sc = null;\n \t/*\n \twhile( (sc = xa.nextSampleChunk()) != null )\n \t\tvis.setData( sc.getSampleBuffer() );\n \t*/\n \t/*\n \tFourierTransform fft = new FourierTransform(xa);\n \tsc = fft.nextSampleChunk();\n \twhile( sc != null ) {\n \t\tfloat[][] fftData = fft.getMagnitudes();\n \t\tdouble[] fftDataDouble = new double[fftData[0].length];\n \t\tfor (int d = 0; d < fftData[0].length; d++) {\n \t\t\tfftDataDouble[d] = (double) fftData[0][d];\n \t\t}\n \t\t//vis.setData(fftData[0]);\n \t\tvis.setData(fftDataDouble);\n \t\tsc = fft.nextSampleChunk();\n \t}\n \t*/\n \t/*\n \tEQFilter eq = new EQFilter(xa, EQType.LPF, 5000);\n \tFourierTransform fft = new FourierTransform(eq);\n \twhile ((sc = fft.nextSampleChunk()) != null) {\n \t\t\n \t}\n \t*/\n \t//MFCC mfcc = new MFCC(xa);\n }", "private void collectWorkspaceZDLModels(List<MetaModel> metamodels,\r\n\t\t\tIPath path, Map<IFile, Model> workspaceZDLs) {\r\n\r\n\t\tIResource res = wsroot.findMember(path);\r\n\r\n\t\tif ((res != null) && res.exists()) {\r\n\t\t\tfor (Map.Entry<IFile, Model> zdl : workspaceZDLs.entrySet()) {\r\n\t\t\t\tif (res.contains(zdl.getKey())) {\r\n\t\t\t\t\tmetamodels.add(new ZDLMetamodel(zdl.getValue()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void trainFeatureList(){\n File trainFolder = new File(SoundEffectDemo.s_basePath);\n File[] trainList = trainFolder.listFiles();\n\n try {\n\n FileWriter fwMs = new FileWriter(s_msFeaturePath);\n FileWriter fwEnergy = new FileWriter(s_energyFeaturePath);\n FileWriter fwZc = new FileWriter(s_zcFeaturePath);\n FileWriter fwMfcc = new FileWriter(s_mfccFeaturePath);\n\n for (int i = 0; i < trainList.length; i++) {\n WaveIO waveIO = new WaveIO();\n short[] signal = waveIO.readWave(trainList[i].getAbsolutePath());\n\n // Extract Magnitude Spectrum\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeature = ms.getFeature(signal);\n \n String line = trainList[i].getName() + \"\\t\";\n for (double f: msFeature){\n line += f + \"\\t\";\n }\n fwMs.append(line+\"\\n\");\n \n // Extract Energy\n Energy energy = new Energy();\n double[] energyFeature = energy.getFeature(signal);\n \n String line2 = trainList[i].getName() + \"\\t\";\n for (double f: energyFeature){\n line2 += f + \"\\t\";\n }\n fwEnergy.append(line2+\"\\n\");\n \n // Extract Zero Crossing\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeature = zc.getFeature(signal);\n \n String line3 = trainList[i].getName() + \"\\t\";\n for (double f: zcFeature){\n line3 += f + \"\\t\";\n }\n fwZc.append(line3+\"\\n\");\n \n // Extract mfcc\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(signal);\n double[] mfccFeature = mfcc.getMeanFeature();\n \n String line4 = trainList[i].getName() + \"\\t\";\n for (double f: mfccFeature){\n line4 += f + \"\\t\";\n }\n fwMfcc.append(line4+\"\\n\");\n \n System.out.println(\"@=========@\" + i);\n }\n fwMs.close();\n fwEnergy.close();\n fwZc.close();\n fwMfcc.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "private boolean searchSystem(String name) {\n for (ExternalSystem system : connectedExternalSystems) {\n if (system.getSystemName().equals(name)){\n return true;\n }\n }\n\n return false;\n }", "private static GeneralMassSpectrum calculateSpectrumFromBasisSpectra(final List<GeneralMassSpectrum> isotopeSpectrums,\n\t\t\tfinal int maxValues, final double minValue, final int charge, final int adduct, final Polarity polarity,\n\t\t\tfinal int numAdducts) {\n\t\tassert isotopeSpectrums.size() > 0;\n\t\t\n\t\tclass StackInformation {\n\t\t\tGeneralMassSpectrum basisSpectrum;\n\t\t\tint isotopeIndex;\n\t\t\tdouble probAccum;\n\t\t\tdouble massAccum;\n\t\t\t\n\t\t\tStackInformation(GeneralMassSpectrum basisSpectrum, int isotopeIndex, double probAccum, double massAccum) {\n\t\t\t\tthis.basisSpectrum = basisSpectrum;\n\t\t\t\tthis.isotopeIndex = isotopeIndex;\n\t\t\t\tthis.probAccum = probAccum;\n\t\t\t\tthis.massAccum = massAccum;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfinal GeneralMassSpectrum retval = new GeneralMassSpectrum(maxValues, numAdducts);\n\t\t\n\t\tfinal Deque<StackInformation> workingSpectra = new ArrayDeque<StackInformation>();\n\t\tfinal Deque<GeneralMassSpectrum> basisSpectra = new ArrayDeque<GeneralMassSpectrum>(isotopeSpectrums);\n\n\t\tfinal StackInformation initialElement = new StackInformation(basisSpectra.pop(), 0, 1.0, 0.0);\n\t\tworkingSpectra.push(initialElement);\n\n\t\twhile ( ! workingSpectra.isEmpty() ) {\n\t\t\tfinal StackInformation info = workingSpectra.peek();\n\t\t\tfinal GeneralMassSpectrum basisSpectrum = info.basisSpectrum;\n\t\t\tif ( info.isotopeIndex == basisSpectrum.size() ) {\n\t\t\t\tworkingSpectra.pop();\n\t\t\t\tbasisSpectra.push(basisSpectrum);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal double newProb = info.probAccum * basisSpectrum.getDistribution(info.isotopeIndex);\n\t\t\tdouble newMass = info.massAccum + basisSpectrum.getMass(info.isotopeIndex);\n\n\t\t\tinfo.isotopeIndex++;\n\t\t\tif ( newProb >= minValue ) {\n\t\t\t\tif ( workingSpectra.size() == isotopeSpectrums.size() ) {\n\t\t\t\t\t// We are at the bottom level, add the peak\n\t\t\t\t\tnewMass -= charge * PeriodicTable.electronmass;\n\t\t\t\t\tnewMass /= Math.abs(charge);\n\t\t\t\t\tfinal List<GeneralMolecularFormula> forms = new ArrayList<GeneralMolecularFormula>();\n\t\t\t\t\tfor ( StackInformation s : workingSpectra ) {\n\t\t\t\t\t\tforms.add(s.basisSpectrum.getIsotopicFormula(s.isotopeIndex - 1));\n\t\t\t\t\t}\n\n\t\t\t\t\tfinal GeneralMolecularFormula compositeGmf = GeneralMolecularFormula.mergeFormulae(forms);\n\t\t\t\t\tretval.add(newMass, newProb, adduct, polarity, compositeGmf);\n\t\t\t\t} else {\n\t\t\t\t\tfinal StackInformation newElement = new StackInformation(basisSpectra.pop(), 0, newProb, newMass);\n\t\t\t\t\tworkingSpectra.push(newElement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn retval;\n\t}", "public void searchByAlbum()\n {\n String input = JOptionPane.showInputDialog(null,\"Enter the album you'd like to search for:\");\n input = input.replaceAll(\" \", \"_\").toUpperCase();\n \n Collections.sort(catalog);\n int index = Collections.binarySearch(catalog, new Album(\"\",input,null), null);\n if(index >= 0)\n System.out.println(\"Album:\\t\" + catalog.get(index).getAlbum()\n + \"\\nArtist: \" + catalog.get(index).getArtist()+\"\\n\");\n else System.err.println(\"Album '\" + input + \"' not found!\\n\"); \n }", "@Test\n public void testMediaMovelSimples() {\n System.out.println(\"MediaMovelSimples\");\n int[] energia = null;\n int linhas = 0;\n double n = 0;\n Double[] expResult = null;\n Double[] resultArray = null;\n double[] result = ProjetoV1.MediaMovelSimples(energia, linhas, n);\n if (resultArray != null) {\n resultArray = ArrayUtils.converterParaArrayDouble(result);\n }\n assertArrayEquals(expResult, resultArray);\n\n }", "public static ArrayList<File> findDevices() {\n return findDevices(\"/dev/\");\n }", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void getProbe () {\n double prxg;\n int index;\n double effaoa = effective_aoa();\n /* get variables in the generating plane */\n if (Math.abs(ypval) < .01) ypval = .05;\n getPoints(xpval,ypval);\n\n solver.getVel(lrg,lthg);\n loadProbe();\n\n pxg = lxgt;\n pyg = lygt;\n prg = lrgt;\n pthg = lthgt;\n pxm = lxmt;\n pym = lymt;\n /* smoke */\n if (pboflag == 3 ) {\n prxg = xpval;\n for (index =1; index <=POINTS_COUNT; ++ index) {\n getPoints(prxg,ypval);\n xg[19][index] = lxgt;\n yg[19][index] = lygt;\n rg[19][index] = lrgt;\n thg[19][index] = lthgt;\n xm[19][index] = lxmt;\n ym[19][index] = lymt;\n if (stall_model_type != STALL_MODEL_IDEAL_FLOW) { // stall model\n double apos = stall_model_type == STALL_MODEL_DFLT ? +10 : stall_model_apos;\n double aneg = stall_model_type == STALL_MODEL_DFLT ? -10 : stall_model_aneg;\n if (xpval > 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n ym[19][index] = ym[19][1];\n } \n if (effaoa < aneg && ypval < 0.0) {\n ym[19][index] = ym[19][1];\n }\n }\n if (xpval < 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n } \n if (effaoa < aneg && ypval < 0.0) {\n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n }\n }\n }\n solver.getVel(lrg,lthg);\n prxg = prxg + vxdir*STEP_X;\n }\n }\n return;\n }", "private boolean findMatchingAvd(ConfigurationManager configurationManager, double imageRatio) {\n AndroidFacet facet = AndroidFacet.getInstance(configurationManager.getModule());\n if (facet == null) {\n // Unlikely, but has happened - see http://b.android.com/68091\n return false;\n }\n final AvdManager avdManager = AvdManagerUtils.getAvdManagerSilently(facet);\n if (avdManager != null) {\n final AvdInfo[] allAvds = avdManager.getAllAvds();\n for (AvdInfo avd : allAvds) {\n Device device = configurationManager.createDeviceForAvd(avd);\n if (device != null) {\n final Dimension screenSize = device.getScreenSize(myScreenOrientation);\n if (myImageSize.equals(screenSize) || ratioAlmostEqual(imageRatio, screenSize)) {\n String avdName = \"AVD: \" + avd.getName();\n myDevicesComboBox.addItem(avdName);\n myMatchingDevices.add(device);\n }\n }\n }\n }\n return !myMatchingDevices.isEmpty();\n }", "public void addSpectrumMatch(SpectrumMatch sm) {\r\n id2index.put(sm.getSpectrumId(), spectrumMatches.size());\r\n spectrumMatches.add(sm);\r\n }", "@Override\n\tpublic List<SecondaryMaterials> findFuliaoDetails(String name) throws Exception {\n\t\treturn fuliaoMapper.findFuliaoDetails(name);\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "public void discoverTargets(IProgressMonitor monitor) throws CoreException {\n\r\n }", "private static void mostrarLibros() {\n\n\t\tlibros\n\t\t.stream()\n\t\t.forEach(System.out::println);\n//\t\t\n//\t\tfor (Libro l :libros) {\n//\t\t\tSystem.out.println(l);\n//\t\t}\n\t}", "private static void getFiles(String root, Vector files) {\n Location f = new Location(root);\n String[] subs = f.list();\n if (subs == null) subs = new String[0];\n Arrays.sort(subs);\n \n // make sure that if a config file exists, it is first on the list\n for (int i=0; i<subs.length; i++) {\n if (subs[i].endsWith(\".bioformats\") && i != 0) {\n String tmp = subs[0];\n subs[0] = subs[i];\n subs[i] = tmp;\n break;\n }\n }\n \n if (subs == null) {\n LogTools.println(\"Invalid directory: \" + root);\n return;\n }\n \n ImageReader ir = new ImageReader();\n Vector similarFiles = new Vector();\n \n for (int i=0; i<subs.length; i++) {\n LogTools.println(\"Checking file \" + subs[i]);\n subs[i] = new Location(root, subs[i]).getAbsolutePath();\n if (isBadFile(subs[i]) || similarFiles.contains(subs[i])) {\n LogTools.println(subs[i] + \" is a bad file\");\n String[] matching = new FilePattern(subs[i]).getFiles();\n for (int j=0; j<matching.length; j++) {\n similarFiles.add(new Location(root, matching[j]).getAbsolutePath());\n }\n continue;\n }\n Location file = new Location(subs[i]);\n \n if (file.isDirectory()) getFiles(subs[i], files);\n else if (file.getName().equals(\".bioformats\")) {\n // special config file for the test suite\n configFiles.add(file.getAbsolutePath());\n }\n else {\n if (ir.isThisType(subs[i])) {\n LogTools.println(\"Adding \" + subs[i]);\n files.add(file.getAbsolutePath());\n }\n else LogTools.println(subs[i] + \" has invalid type\");\n }\n file = null;\n }\n }", "public int getNumberOfSpectra() {\r\n return nSpectrum;\r\n }", "public void searchProd(){\n\t\t\n\t\t// STEP 4:-\n\t\t// Enter 'mobile' in search bar.\n\t\tWebElement search = driver.findElement(By.name(\"q\"));\n\t\tsearch.sendKeys(\"mobiles\");\n\t\tsearch.sendKeys(Keys.ENTER);\n\t\tSystem.out.println(\"Enter name successfully\");\n\t\t\t\t\t\n\t\t// Click on search icon.\n\t\t//WebElement searchClick = driver.findElement(By.className(\"L0Z3Pu\"));\n\t\t//searchClick.click();\n\t\t//System.out.println(\"clicked search button successfully\");\n\t}", "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 initDeviceList(Configuration configuration) {\n myNoMatchingDevice = false;\n if (!myMatchingDevices.isEmpty()) {\n myMatchingDevices.clear();\n }\n if (myDevicesComboBox.getItemCount() > 0) {\n myDevicesComboBox.removeAllItems();\n }\n int lastNexusIndex = 0;\n int lastMatchIndex = 0;\n int lastNexusRatioIndex = 0;\n\n ConfigurationManager configurationManager = configuration.getConfigurationManager();\n List<Device> deviceList = configurationManager.getDevices();\n final double imageRatio = myImageSize.width / (double)myImageSize.height;\n myScreenOrientation = myImageSize.width <= myImageSize.height\n ? ScreenOrientation.PORTRAIT\n : ScreenOrientation.LANDSCAPE;\n for (Device device : deviceList) {\n final Dimension screenSize = device.getScreenSize(myScreenOrientation);\n if (screenSize == null) {\n continue;\n }\n if (myImageSize.equals(screenSize)) {\n if (isNexus(device)) {\n myMatchingDevices.add(lastNexusIndex++, device);\n }\n else if (isGeneric(device)) {\n myMatchingDevices.add(lastNexusIndex + lastMatchIndex++, device);\n }\n }\n else {\n if (ratioAlmostEqual(imageRatio, screenSize)) {\n if (isNexus(device)) {\n myMatchingDevices.add(lastNexusIndex + lastMatchIndex + lastNexusRatioIndex++, device);\n }\n else {\n myMatchingDevices.add(device);\n }\n }\n }\n }\n\n // if not physical device match the size of the mockup\n // Try to find on in the Avd\n if (myMatchingDevices.isEmpty()) {\n if (findMatchingAvd(configurationManager, imageRatio)) {\n return;\n }\n // If there is still no device matching the size or ratio of the mockup,\n // use the current selected device as best matching device.\n myMatchingDevices.add(configuration.getDevice());\n myNoMatchingDevice = true;\n }\n\n for (Device device : myMatchingDevices) {\n String deviceLabel;\n if (isNexus(device)) {\n deviceLabel = getNexusLabel(device);\n }\n else if (isGeneric(device)) {\n deviceLabel = getGenericLabel(device);\n }\n else {\n deviceLabel = device.getId();\n }\n if (device == myConfiguration.getDevice()) {\n // Set a special label for the current device\n // and display it on top if it matches the image ratio\n deviceLabel = String.format(\"* %s (current)\", deviceLabel);\n }\n myDevicesComboBox.addItem(deviceLabel);\n }\n mySelectedDevice = myMatchingDevices.get(0);\n myDevicesComboBox.setSelectedIndex(0);\n updateDevicePreview();\n }", "@Test\n public void testScanFile() throws DatabaseException {\n try (Engine instance = new Engine(getSettings())) {\n instance.addFileTypeAnalyzer(new JarAnalyzer());\n File file = BaseTest.getResourceAsFile(this, \"dwr.jar\");\n Dependency dwr = instance.scanFile(file);\n file = BaseTest.getResourceAsFile(this, \"org.mortbay.jmx.jar\");\n instance.scanFile(file);\n assertEquals(2, instance.getDependencies().length);\n\n file = BaseTest.getResourceAsFile(this, \"dwr.jar\");\n Dependency secondDwr = instance.scanFile(file);\n\n assertEquals(2, instance.getDependencies().length);\n }\n }", "public static void main(String[] args) {\n\t// write your code here\n\n\n Library library = new Library();\n //new students array for this library\n ArrayList<Student> studentsInLibrary = new ArrayList<>();\n ArrayList<Book> booksInLibrary = new ArrayList<>();\n ArrayList<Tablet> tabletsInLibrary = new ArrayList<>();\n\n //set the created arraylist to library registered students and fill it\n library.setRegisteredStudents(fillStudentsArray(studentsInLibrary));\n library.setBooksBank(fillBooksArray(booksInLibrary));\n library.setTabletsBank(fillTabletsArray(tabletsInLibrary));\n\n\n System.out.println(!false);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// //Debugging\n// for ( Student student1 : library.getRegisteredStudents() ) {\n//\n//\n// System.out.println(student1.toString());\n// }\n//\n//\n// for ( Book book : library.getBooksBank() ) {\n//\n//\n// System.out.println(book.toString());\n// }\n//\n// System.out.println(\"***********************************\");\n//\n// for ( Tablet tablet : library.getTabletsBank() ) {\n//\n//\n// System.out.println(tablet.toString());\n// }\n\n\n\n LibraryManager libraryManager =new LibraryManager();\n\n\n\n\n\n\n\n\n //pass the library to its manager\n libraryManager.setTheLibrary(library);\n\n }", "private void setupRecognizer(File assetsDir) throws IOException {\n\n recognizer = defaultSetup()\n .setAcousticModel(new File(assetsDir, \"en-us-ptm\"))\n .setDictionary(new File(assetsDir, \"cmudict-en-us.dict\"))\n\n // To disable logging of raw audio comment out this call (takes a lot of space on the device)\n .setRawLogDir(assetsDir)\n\n // Threshold to tune for keyphrase to balance between false alarms and misses\n .setKeywordThreshold(1e-45f)\n\n // Use context-independent phonetic search, context-dependent is too slow for mobile\n .setBoolean(\"-allphone_ci\", true)\n\n .getRecognizer();\n recognizer.addListener(this);\n\n /** In your application you might not need to add all those searches.\n * They are added here for demonstration. You can leave just one.\n */\n\n // Create keyword-activation search.\n recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);\n\n // Create grammar-based search for selection between demos\n File menuGrammar = new File(assetsDir, \"menu.gram\");\n recognizer.addGrammarSearch(MENU_SEARCH, menuGrammar);\n\n // Create grammar-based search for digit recognition\n File digitsGrammar = new File(assetsDir, \"digits.gram\");\n recognizer.addGrammarSearch(DIGITS_SEARCH, digitsGrammar);\n\n // Create language model search\n File languageModel = new File(assetsDir, \"weather.dmp\");\n recognizer.addNgramSearch(FORECAST_SEARCH, languageModel);\n\n // Phonetic search\n File phoneticModel = new File(assetsDir, \"en-phone.dmp\");\n recognizer.addAllphoneSearch(PHONE_SEARCH, phoneticModel);\n }", "@Override\n public double[] find(BufferedImage image, boolean debug) throws IOException {\n\n ListDisplayPanel panel = debug ? new ListDisplayPanel() : null;\n\n List<Shape> shapes = ImageProcessingPipeline.fromBufferedImage(image, panel)\n .gray()\n .medianBlur(3) // this is fairly critical\n .edges()\n .dilate()\n .contours()\n .polygons(0.05, 0.05)\n .getExternalShapes();\n\n int expectedWidth = 40 * 3; // 40mm\n int expectedHeight = 20 * 3; // 20mm\n int tolerancePct = 40;\n List<Shape> filtered = GeometryUtils.filterByArea(shapes, expectedWidth, expectedHeight, tolerancePct);\n List<Shape> nonOverlapping = GeometryUtils.filterNonOverlappingBoundingBoxes(filtered);\n\n if (debug) {\n System.out.println(shapes);\n System.out.println(filtered);\n System.out.println(nonOverlapping);\n ShowImages.showWindow(panel, \"Binary Operations\", true);\n }\n return new double[] { nonOverlapping.size() % 3 }; // just return as an int mod 3\n }", "private void getModules() throws BuildException {\n FilenameFilter fltr = new FilenameFilter() {\n @Override\n public boolean accept(final File dir, final String name) {\n return name.endsWith(\".war\");\n }\n };\n\n if (warDir == null) {\n throw new BuildException(\"No wardir supplied\");\n }\n\n String[] warnames = warDir.list(fltr);\n\n if (warnames == null) {\n throw new BuildException(\"No wars found at \" + warDir);\n }\n\n for (int wi = 0; wi < warnames.length; wi++) {\n wars.add(warnames[wi]);\n }\n\n for (FileSet fs: filesets) {\n DirectoryScanner ds = fs.getDirectoryScanner(getProject());\n\n String[] dsFiles = ds.getIncludedFiles();\n\n for (int dsi = 0; dsi < dsFiles.length; dsi++) {\n String fname = dsFiles[dsi];\n\n if (fname.endsWith(\".jar\")) {\n jars.add(fname);\n } else if (fname.endsWith(\".war\")) {\n wars.add(fname);\n }\n }\n }\n }", "private Instrument[] getAvailableInstruments() {\r\n\t\tInstrument[] allInstruments = synth.getAvailableInstruments();\r\n\t\tInstrument[] bank1 = new Instrument[128];\r\n\t\tfor (int i = 0; i < 128; i++) {\r\n\t\t\tif (allInstruments[i].getPatch().getBank() == 0)\r\n\t\t\t\tbank1[i] = allInstruments[i];\r\n\t\t}\r\n\t\treturn bank1;\r\n\t}", "private void mostrarLibros() {\n dlmLibros.clear();\n for (Libro libro : modelo.getLibros()) {\n dlmLibros.addElement(libro);\n }\n seleccionarLibrosOriginales();\n }", "public static Set<ILibrary> getRegisteredLibraries() {\n \t\tAcceleoWorkspaceUtil.refreshContributions();\n \t\treturn new LinkedHashSet<ILibrary>(LIBRARIES);\n \t}", "public ArrayList<Song> searchByYear(Integer year) \r\n {\r\n return musicLibraryYearKey.get(year);\r\n \r\n }", "public void searchByArtist()\n {\n String input = JOptionPane.showInputDialog(null,\"Enter the artist you'd like to search for:\");\n input = input.replaceAll(\" \", \"_\").toUpperCase(); //standardize output.\n \n Collections.sort(catalog, new ArtistComparator());\n int index = Collections.binarySearch(catalog, \n new Album(input,\"\",null), new ArtistComparator());\n //Since an artist could be listed multiple times, there is *no guarantee*\n //which artist index we find. So, we have to look at the artists\n //left and right of the initial match until we stop matching.\n if(index >= 0)\n {\n Album initial = catalog.get(index);\n String artist = initial.getArtist();\n \n ArrayList<Album> foundAlbums = new ArrayList<>();\n //this ArrayList will have only the albums of our found artist \n foundAlbums.add(initial);\n try { \n int j = index, k = index;\n while(artist.equalsIgnoreCase(catalog.get(j+1).getArtist()))\n {\n foundAlbums.add(catalog.get(j+1));\n j++;\n }\n while(artist.equalsIgnoreCase(catalog.get(k-1).getArtist()))\n {\n foundAlbums.add(catalog.get(k-1));\n k--;\n }\n }\n catch(IndexOutOfBoundsException e) {\n //happens on the last round of the while-loop test expressions\n //don't do anyhting because now we need to print out our albums.\n }\n System.out.print(\"Artist: \" + artist + \"\\nAlbums: \");\n for(Album a : foundAlbums)\n System.out.print(a.getAlbum() + \"\\n\\t\");\n System.out.println();\n }\n else System.err.println(\"Artist '\" + input + \"' not found!\\n\"); \n }", "public List<AudioInformation> getAudioInformationFunction(String path){\n File folder = new File(path);\n File[] listOfFiles = folder.listFiles((FileFilter) null);// get all files in folder\n if(listOfFiles!=null){\n int size = listOfFiles.length;\n numberOfFilesToProcess = numberOfFilesToProcess + size;\n if(progressBar!=null) {\n progressBar.setFilesToProcess(numberOfFilesToProcess);\n }\n\n for (int count = 0; count < size; count++) {\n File file = listOfFiles[count];\n boolean read=false;\n if (!(file.getName().charAt(0) == exclude)) { // if starts with exclude charcter ignore\n if (file.isFile()) {\n boolean isAudioFile = utilities.isAudioFile(file); // check if file is audio file\n if (isAudioFile == true) {\n AudioInformation information=extractAudioInformation.extractAudioInformationFromFile(file);\n if(onCD==true) {\n information.setWriteFieldsToFile(false);\n }\n\n informationList.add(information);\n\n }\n else if(utilities.getExtensionOfFile(file).equalsIgnoreCase(\"cue\")){\n try {\n CueSheet cueSheet=extractAudioInformation.getCueSheet(file);\n List<AudioInformation> tracks=cueSheet.getTracks();\n informationList.addAll(tracks);\n } catch (CueSheetExeception cueSheetExeception) {\n cueSheetExeception.printStackTrace();\n errorMessages.add(cueSheetExeception.getMessage());\n }\n }\n numberOfFilesProcessed++;\n if(progressBar!=null) {\n progressBar.setFilesProcessed(numberOfFilesProcessed);\n }\n } else if (file.isDirectory()) {\n numberOfFilesProcessed++;\n if(progressBar!=null) {\n\n progressBar.setFilesProcessed(numberOfFilesProcessed);\n }\n\n getAudioInformationFunction(listOfFiles[count].getPath());\n }\n if(updateLabel!=null) {\n updateLabel.setText(numberOfFilesToProcess + \" of \" + numberOfFilesToProcess + \"Files Processed\");\n }\n\n }\n }\n }\n return informationList;\n }", "private void copyNGLibs(File targetLibDir) throws ExportException, IOException\n\t{\n\t\tList<String> pluginLocations = exportModel.getPluginLocations();\n\t\tFile parent = null;\n\t\tif (System.getProperty(\"eclipse.home.location\") != null)\n\t\t\tparent = new File(URI.create(System.getProperty(\"eclipse.home.location\").replaceAll(\" \", \"%20\")));\n\t\telse parent = new File(System.getProperty(\"user.dir\"));\n\t\tfor (String libName : NG_LIBS)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tboolean found = false;\n\t\t\twhile (!found && i < pluginLocations.size())\n\t\t\t{\n\t\t\t\tFile pluginLocation = new File(pluginLocations.get(i));\n\t\t\t\tif (!pluginLocation.isAbsolute())\n\t\t\t\t{\n\t\t\t\t\tpluginLocation = new File(parent, pluginLocations.get(i));\n\t\t\t\t}\n\t\t\t\tFileFilter filter = new WildcardFileFilter(libName);\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFile[] libs = pluginLocation.listFiles(filter);\n\n\t\t\t\t\tif (libs == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(pluginLocation.toString() + \" is directory \" + pluginLocation.isDirectory());\n\t\t\t\t\t\tSystem.err.println(\"missing lib name: \" + libName);\n\t\t\t\t\t\tSystem.err.println(\"missing filter: \" + filter.toString());\n\t\t\t\t\t\tSystem.out.println(pluginLocation.listFiles());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (libs != null && libs.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFile file = libs[0];\n\t\t\t\t\t\tif (libName.contains(\"servoy_ngclient\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcopyNGClientJar(file, targetLibDir);\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\tcopyFile(file, new File(targetLibDir, file.getName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tcatch (IOException e)\n\t\t\t\t{\n\t\t\t\t\tDebug.error(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) throw new ExportException(libName + \" was not found. Please specify location\");\n\t\t}\n\t}", "public void setExternalSpectrumFile(String filename);", "public Set<String> getSpectrumFileNames() {\n\n \n return spectrumFiles.keySet();\n\n }", "private void setupRecognizer(File assetsDir) throws IOException {\n\n recognizer = SpeechRecognizerSetup.defaultSetup()\n .setAcousticModel(new File(assetsDir, \"ru-ru-ptm\"))\n .setDictionary(new File(assetsDir, \"dict_ru.dict\"))\n .setBoolean(\"-remove_noise\", true)\n //.setRawLogDir(assetsDir) // To disable logging of raw audio comment out this call (takes a lot of space on the device)\n .setKeywordThreshold(1e-7f)\n .getRecognizer();\n recognizer.addListener(this);\n\n /* In your application you might not need to add all those searches.\n They are added here for demonstration. You can leave just one.\n */\n\n\n // Create keyword-activation search.\n recognizer.addKeyphraseSearch(KEYPHRASE, KEYPHRASE);\n\n // Create grammar-based search for selection between demos\n File menuGrammar = new File(assetsDir, \"menu.gram\");\n recognizer.addGrammarSearch(MENU_SEARCH, menuGrammar);\n\n // Create grammar-based search for digit recognition\n File digitsGrammar = new File(assetsDir, \"digits.gram\");\n recognizer.addGrammarSearch(DIGITS_SEARCH, digitsGrammar);\n\n // Phonetic search\n File phoneticModel = new File(assetsDir, \"jsgf_ru.gram\");\n recognizer.addAllphoneSearch(ANIMAL_SEARCH, phoneticModel);\n }", "public void searchSong(String name)\n {\n for(int i=0; i<songs.size(); i++)\n if(songs.get(i).getFile().contains(name) || songs.get(i).getSinger().contains(name))\n {\n System.out.print((i+1) + \"- \");\n listSong(i);\n\n }\n }" ]
[ "0.6897322", "0.6218383", "0.57389843", "0.53381425", "0.5106041", "0.5049054", "0.4876247", "0.4814938", "0.48121658", "0.4807421", "0.48021513", "0.4795233", "0.47167805", "0.47158766", "0.47146517", "0.46816978", "0.46777788", "0.46773005", "0.46725062", "0.46679884", "0.46153346", "0.46146214", "0.46090898", "0.46081847", "0.45926827", "0.45690557", "0.45681247", "0.45646268", "0.45644778", "0.45595106", "0.45384806", "0.45149875", "0.4475187", "0.44738907", "0.44657475", "0.44222683", "0.44216722", "0.43859357", "0.43840033", "0.43792728", "0.43661368", "0.43636534", "0.43571872", "0.4356862", "0.43555397", "0.4346791", "0.4335425", "0.43330994", "0.43303668", "0.43188336", "0.43187475", "0.43128422", "0.43071842", "0.43047926", "0.43000484", "0.42993072", "0.4293991", "0.42920998", "0.4291424", "0.42666125", "0.42612538", "0.42516568", "0.42500034", "0.4249813", "0.4248194", "0.42467925", "0.42392442", "0.42367476", "0.42357063", "0.4235018", "0.4232911", "0.4232793", "0.42320076", "0.42243698", "0.4221513", "0.4221482", "0.4213226", "0.42092422", "0.42058662", "0.4205096", "0.42000514", "0.41889176", "0.41825232", "0.41816217", "0.41810158", "0.4180416", "0.41766056", "0.41755915", "0.41715997", "0.41678333", "0.41651124", "0.41638085", "0.41592515", "0.41569665", "0.4156367", "0.4153092", "0.4152834", "0.4151333", "0.41510242", "0.414873" ]
0.57605815
2
Method to read in all .msp files and add them to positive and negative arrays
public void readMSP() throws IOException { String line = ""; //Line for reading String fragType = ""; //Fragment type String polarity = ""; //Polarity of entry Double precursor = 0.0; //Precursor mass String name = ""; //Lipid name LibrarySpectrum entryTemp = null; //Temp library entry boolean peakStart = false; //Boolean if peak list beginning boolean isLipidex = false; //Boolean if spectra was generated using LipiDex boolean optimalPolarity = false; //Boolean if optimal polarity for class String[] split; //String array for parsing transitions for (int i=0; i<lipidLibs.size(); i++) { updateProgress((int)(Double.valueOf(i+1) /Double.valueOf(lipidLibs.size())*100.0),"% - Reading Libraries",true); BufferedReader reader = new BufferedReader(new FileReader(lipidLibs.get(i))); //read line if not empty while ((line = reader.readLine()) != null) { //read in retention time if (line.contains("Name:") || line.contains("NAME:")) { //Add entry if (precursor>0.0) addSpectrum(entryTemp); //Erase entry polarity = ""; precursor = 0.0; name = ""; fragType = ""; peakStart = false; isLipidex = false; optimalPolarity = false; if (line.contains("]+")) polarity = "+"; else polarity = "-"; name = line.substring(line.indexOf(":")+1); } //read in optimal polarity if (line.contains("OptimalPolarity=true")) { optimalPolarity = true; } if (line.contains("LipiDex")) isLipidex = true; if (line.contains("Num Peaks:")) { peakStart = true; entryTemp = new LibrarySpectrum(precursor, polarity, name, lipidLibs.get(i).getName(), isLipidex, optimalPolarity); } if (peakStart && line.contains(".") && !line.contains("Num")) { if (line.contains(" ")) split = line.split(" "); else split = line.split(" "); if (isLipidex) fragType = line.substring(line.indexOf("\"")+1,line.lastIndexOf("\"")); if (precursor-Double.valueOf(split[0])>2.0) entryTemp.addFrag(Double.valueOf(split[0]), Double.valueOf(split[1]), fragType, getTransitionType(fragType)); } if (line.contains("PRECURSORMZ:")) { precursor = Double.valueOf(line.substring(line.lastIndexOf(" ")+1)); } } addSpectrum(entryTemp); reader.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float[] accumulateSimpleMixFiles(ArrayList<File> files){\r\n\t\t\tfloat[] returnValue = new float[10];\r\n\t\t\tfloat[] values = new float[10];\r\n\t\t\t\r\n\t\t for(File file:files){\t\t\t\t\t\r\n\t\t BufferedReader reader;\r\n\t\t try{\r\n\t\t reader = new BufferedReader(new FileReader(file));\r\n\t\t String line = reader.readLine(); \r\n\t\t while(line != null){\t\r\n\t\t \tif(line.substring(0,5).equals(\"Total\")){\r\n\t\t \t\tString[] values2 = line.split(\" \");\r\n\t\t \t\t\r\n\t\t \t\tfor(int i = 2; i < values2.length; i++) values[i-2] += Float.valueOf(values2[i]);\r\n\t\t \t}\r\n\t\t \tline = reader.readLine();\r\n\t\t }\r\n\t\t \r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t System.err.println(\"FileNotFoundException: \" + e.getMessage());\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t System.err.println(\"Caught IOException: \" + e.getMessage());\r\n\t\t\t\t}\r\n\t\t }\r\n\r\n\t\t for(int j = 0; j < values.length; j++) returnValue[j] = (float)values[j]/files.size();\t\r\n\t\t \r\n\t\t return returnValue;\r\n\t\t}", "public float[] accumulateSimpleSilentPeriodFiles(ArrayList<File> files){\r\n\t\t\tfloat[] values = new float[10];\r\n\t\t\tfloat[] returnValue = new float[10];\r\n\t\t\t\r\n\t\t for(File file:files){\t\t\t\t\t\r\n\t\t BufferedReader reader;\r\n\t\t try{\r\n\t\t reader = new BufferedReader(new FileReader(file));\r\n\t\t String line = reader.readLine(); \r\n\t\t while(line != null){\t\r\n\t\t \tif(!line.substring(0,1).equals(\"#\")){\r\n\t\t \t\tString[] values2 = line.split(\" \");\r\n\t\t \t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t \t\tfor(int i = 1; i < values2.length; i++) {\r\n\t\t \t\t\tSystem.out.println(\"+ \" + values2[i]);\r\n\t\t \t\t\tvalues[i-1] += Float.valueOf(values2[i]);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t \tline = reader.readLine();\r\n\t\t }\r\n\t\t \r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t System.err.println(\"FileNotFoundException: \" + e.getMessage());\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t System.err.println(\"Caught IOException: \" + e.getMessage());\r\n\t\t\t\t}\r\n\t\t }\r\n\r\n\t\t for(int j = 0; j < values.length; j++) if(values[j] != 0) returnValue[j] = (float)values[j]/files.size();\r\n\t\t \r\n\t\t return returnValue;\r\n\t\t}", "private int[] getTotalScore_Positive() throws FileNotFoundException, IOException {\n \n String target_dir = \"src/testing_data/pos\";\n File dir = new File(target_dir);\n File[] files = dir.listFiles();\n String[] posWordList = null;\n ArrayList<String> stopWords = new ArrayList<>();\n int totalReviewScoreAfinn = 0;\n int totalReviewScoreMohan = 0;\n int[] totalScorePositive = new int[2];\n\n for (File f : files) {\n if(f.isFile()) {\n BufferedReader inputStream = null;\n\n try {\n inputStream = new BufferedReader(new FileReader(f));\n String line;\n\n while ((line = inputStream.readLine()) != null) {\n \n int reviewScore = 0;\n\n String result = line.replaceAll(\"[\\\\d+|\\\\p{P}\\\\p{S}]\" ,\"\");\n posWordList = result.toLowerCase().split(\" \");\n \n ArrayList<String> wordList = new ArrayList<>(Arrays.asList(posWordList)); \n\n for(String word : wordList){\n for(String sWord : stopWordList){\n if(word.equals(sWord)){\n stopWords.add(sWord);\n }\n }\n }\n \n wordList.removeAll(stopWords); \n \n for(String word: wordList){\n for(String key : afinnEnglishLibrary.keySet())\n {\n if(word.equals(key)){ \n reviewScore += afinnEnglishLibrary.get(key);\n }\n }\n }\n\n if(reviewScore>0){ \n totalReviewScoreAfinn++;\n }\n \n reviewScore = 0; \n for(String word: wordList){\n for (String key : mohanLibrary.keySet())\n {\n if(word.equals(key)){\n reviewScore += mohanLibrary.get(key);\n }\n }\n }\n\n if(reviewScore>0){\n totalReviewScoreMohan++;\n }\n }\n }\n finally {\n if (inputStream != null) {\n inputStream.close();\n }\n }\n } \n }\n totalScorePositive[0] = totalReviewScoreAfinn;\n totalScorePositive[1] = totalReviewScoreMohan;\n return totalScorePositive;\n }", "private int[] getTotalScore_Negative() throws FileNotFoundException, IOException {\n \n String target_dir = \"src/testing_data/neg\";\n File dir = new File(target_dir);\n File[] files = dir.listFiles();\n String[] negWordList = null;\n ArrayList<String> stopWords = new ArrayList<>();\n int totalReviewScoreAfinn = 0;\n int totalReviewScoreMohan = 0;\n int[] totalScoreNegative = new int[2];\n\n for (File f : files) {\n if(f.isFile()) {\n BufferedReader inputStream = null;\n try {\n inputStream = new BufferedReader(new FileReader(f));\n String line;\n while ((line = inputStream.readLine()) != null) { \n int reviewScore = 0;\n String result = line.replaceAll(\"[\\\\d+|\\\\p{P}\\\\p{S}]\" ,\"\");\n negWordList = result.toLowerCase().split(\" \");\n ArrayList<String> wordList = new ArrayList<>(Arrays.asList(negWordList)); \n for(String word : wordList){\n for(String sWord : stopWordList){\n if(word.equals(sWord)){\n stopWords.add(sWord);\n }\n }\n } \n wordList.removeAll(stopWords); \n \n \n for(String word: wordList){\n for (String key : afinnEnglishLibrary.keySet())\n {\n if(word.equals(key)){\n reviewScore += afinnEnglishLibrary.get(key);\n }\n }\n }\n if(reviewScore<0){\n totalReviewScoreAfinn++;\n }\n \n reviewScore = 0; \n for(String word: wordList){\n for (String key : mohanLibrary.keySet())\n {\n if(word.equals(key)){\n reviewScore += mohanLibrary.get(key);\n }\n }\n }\n if(reviewScore<0){\n totalReviewScoreMohan++;\n }\n }\n }\n finally {\n if (inputStream != null) {\n inputStream.close();\n }\n }\n } \n }\n totalScoreNegative[0] = totalReviewScoreAfinn;\n totalScoreNegative[1] = totalReviewScoreMohan;\n return totalScoreNegative;\n }", "public float[] accumulateDetailFiles(ArrayList<File> files){\r\n\t\tfloat[] values = new float[100];\r\n\t\tint counter = 0;\r\n\r\n\t for(File file:files){\t\t\r\n\t \tSystem.out.println(file.getName());\r\n\t \tcounter = 0;\r\n\t BufferedReader reader;\r\n\t try{\r\n\t reader = new BufferedReader(new FileReader(file));\r\n\t String line = reader.readLine(); \r\n\t while(line != null){\t\r\n\t \tif(!line.substring(0,1).equals(\"#\")){\r\n\t \t\tString[] values2 = line.split(\" \");\r\n\t \t\tvalues[counter] += Float.valueOf(values2[values2.length-1]);\r\n\t\t \tcounter++;\r\n\t \t}\r\n\t \tline = reader.readLine();\r\n\t }\r\n\t \r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t System.err.println(\"FileNotFoundException: \" + e.getMessage());\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t System.err.println(\"Caught IOException: \" + e.getMessage());\r\n\t\t\t}\r\n\t }\r\n\r\n\t float[] returnValues = new float[counter];\r\n\t \r\n\t for(int j = 0; j < returnValues.length; j++) \treturnValues[j] = ((float)values[j]/files.size());\r\n\t\r\n\t \r\n \treturn returnValues;\r\n\t}", "public void trainFeatureList(){\n File trainFolder = new File(SoundEffectDemo.s_basePath);\n File[] trainList = trainFolder.listFiles();\n\n try {\n\n FileWriter fwMs = new FileWriter(s_msFeaturePath);\n FileWriter fwEnergy = new FileWriter(s_energyFeaturePath);\n FileWriter fwZc = new FileWriter(s_zcFeaturePath);\n FileWriter fwMfcc = new FileWriter(s_mfccFeaturePath);\n\n for (int i = 0; i < trainList.length; i++) {\n WaveIO waveIO = new WaveIO();\n short[] signal = waveIO.readWave(trainList[i].getAbsolutePath());\n\n // Extract Magnitude Spectrum\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeature = ms.getFeature(signal);\n \n String line = trainList[i].getName() + \"\\t\";\n for (double f: msFeature){\n line += f + \"\\t\";\n }\n fwMs.append(line+\"\\n\");\n \n // Extract Energy\n Energy energy = new Energy();\n double[] energyFeature = energy.getFeature(signal);\n \n String line2 = trainList[i].getName() + \"\\t\";\n for (double f: energyFeature){\n line2 += f + \"\\t\";\n }\n fwEnergy.append(line2+\"\\n\");\n \n // Extract Zero Crossing\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeature = zc.getFeature(signal);\n \n String line3 = trainList[i].getName() + \"\\t\";\n for (double f: zcFeature){\n line3 += f + \"\\t\";\n }\n fwZc.append(line3+\"\\n\");\n \n // Extract mfcc\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(signal);\n double[] mfccFeature = mfcc.getMeanFeature();\n \n String line4 = trainList[i].getName() + \"\\t\";\n for (double f: mfccFeature){\n line4 += f + \"\\t\";\n }\n fwMfcc.append(line4+\"\\n\");\n \n System.out.println(\"@=========@\" + i);\n }\n fwMs.close();\n fwEnergy.close();\n fwZc.close();\n fwMfcc.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "public void ProcessFiles() {\n LOG.info(\"Processing SrcML files ...\");\n final Collection<File> allFiles = ctx.files.AllFiles();\n int processed = 0;\n final int numAllFiles = allFiles.size();\n final int logDiv = Math.max(1, Math.round(numAllFiles / 100f));\n\n for (File file : allFiles) {\n final String filePath = file.filePath;\n final FilePath fp = ctx.internFilePath(filePath);\n\n Document document = readSrcmlFile(filePath);\n DocWithFileAndCppDirectives extDoc = new DocWithFileAndCppDirectives(file, fp, document, ctx);\n\n internAllFunctionsInFile(file, document);\n processFeatureLocationsInFile(extDoc);\n\n if ((++processed) % logDiv == 0) {\n int percent = Math.round((100f * processed) / numAllFiles);\n LOG.info(\"Parsed SrcML file \" + processed + \"/\" + numAllFiles\n + \" (\" + percent + \"%) (\" + (numAllFiles - processed) + \" to go)\");\n }\n }\n\n LOG.info(\"Parsed all \" + processed + \" SrcML file(s).\");\n }", "private void readFileToArray(FileInputStream fis, Warship[] wsArr) throws Exception {\n\t\tScanner scanner = null;\n\t\ttry {\n\t\t\tscanner = new Scanner(fis);\n\t\t\tint i = 0;\n\t\t\twhile (scanner.hasNextLine()) {\n\t\t\t\twsArr[i] = this.getWarship(scanner.nextLine());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t} finally {\n\t\t\tif (scanner != null) {\n\t\t\t\tscanner.close();\n\t\t\t}\n\t\t}\n\t}", "private static void readFile(ArrayList<Process> processList, int availableRes[]){\n String processInfo;\n Scanner inputFile = openFile();\n if(inputFile == null){System.exit(-1);}\n\n initializeResArray(availableRes, inputFile);\n\n int processID = 0;\n while(inputFile.hasNextLine()){\n processInfo = inputFile.nextLine();\n Process toAdd = createProcessFromInput(processInfo);\n toAdd.setPID(processID);\n processList.add(toAdd);\n processID++;\n }\n inputFile.close();\n }", "void read() {\n try {\n pre_list = new ArrayList<>();\n suf_list = new ArrayList<>();\n p_name = new ArrayList<>();\n stem_word = new ArrayList<>();\n\n //reading place and town name\n for (File places : place_name.listFiles()) {\n fin = new FileInputStream(places);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n place.add(temp);\n }\n\n }\n\n //reading month name\n for (File mont : month_name.listFiles()) {\n fin = new FileInputStream(mont);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n month.add(temp);\n }\n }\n\n //reading compound words first\n for (File comp_word : com_word_first.listFiles()) {\n fin = new FileInputStream(comp_word);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n comp_first.add(temp);\n }\n }\n //reading next word of the compound\n for (File comp_word_next : com_word_next.listFiles()) {\n fin = new FileInputStream(comp_word_next);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n comp_next.add(temp);\n }\n }\n //reading chi square feature\n for (File entry : chifile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n chiunion.add(temp);\n }\n newunions.clear();\n newunions.addAll(chiunion);\n chiunion.clear();\n chiunion.addAll(newunions);\n chiunion.removeAll(stop_word_list);\n chiunion.removeAll(p_name);\n chiunion.removeAll(month);\n chiunion.removeAll(place);\n }\n //reading short form from abbrivation \n for (File short_list : abbrivation_short.listFiles()) {\n fin = new FileInputStream(short_list);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n shortform.add(temp);\n }\n }\n //reading long form from the abrivation \n for (File long_list : abbrivation_long.listFiles()) {\n fin = new FileInputStream(long_list);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n longform.add(temp);\n }\n }\n //reading file from stop word\n for (File stoplist : stop_word.listFiles()) {\n fin = new FileInputStream(stoplist);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n stop_word_list.add(temp);\n }\n }\n\n //reading person name list\n for (File per_name : person_name.listFiles()) {\n fin = new FileInputStream(per_name);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n p_name.add(temp);\n }\n }\n\n //reading intersection union\n for (File entry : interfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n interunion.add(temp);\n }\n }\n newunions.clear();\n newunions.addAll(interunion);\n interunion.clear();\n interunion.addAll(newunions);\n interunion.removeAll(stop_word_list);\n interunion.removeAll(p_name);\n interunion.removeAll(month);\n interunion.removeAll(place);\n }\n // reading ig union\n for (File entry : igfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n igunion.add(temp);\n }\n }\n for (String str : igunion) {\n int index = igunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n igunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(igunion);\n igunion.clear();\n igunion.addAll(newunions);\n igunion.removeAll(stop_word_list);\n igunion.removeAll(p_name);\n igunion.removeAll(month);\n igunion.removeAll(place);\n }\n //read df uinfion\n for (File entry : dffile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n dfunion.add(temp);\n }\n }\n for (String str : dfunion) {\n int index = dfunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n dfunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(dfunion);\n dfunion.clear();\n dfunion.addAll(newunions);\n dfunion.removeAll(stop_word_list);\n dfunion.removeAll(p_name);\n dfunion.removeAll(month);\n dfunion.removeAll(place);\n }\n //reading unified model\n for (File entry : unionall_3.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n union_3.add(temp);\n }\n }\n for (String str : union_3) {\n int index = union_3.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n union_3.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(union_3);\n union_3.clear();\n union_3.addAll(newunions);\n union_3.removeAll(stop_word_list);\n union_3.removeAll(p_name);\n union_3.removeAll(month);\n union_3.removeAll(place);\n }\n //unified feature for the new model\n for (File entry : unified.listFiles()) {\n\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n newunion.add(temp);\n\n }\n for (String str : newunion) {\n int index = newunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n newunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(newunion);\n newunion.clear();\n newunion.addAll(newunions);\n newunion.removeAll(stop_word_list);\n newunion.removeAll(p_name);\n newunion.removeAll(month);\n newunion.removeAll(place);\n\n // newunion.addAll(newunions);\n }\n // reading test file and predict the class\n for (File entry : test_doc.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n file_test.add(temp);\n\n }\n newunions.clear();\n newunions.addAll(file_test);\n file_test.clear();\n file_test.addAll(newunions);\n file_test.removeAll(stop_word_list);\n file_test.removeAll(p_name);\n file_test.removeAll(month);\n file_test.removeAll(place);\n }\n //reading the whole document under economy class\n for (File entry : economy.listFiles()) {\n fill = new File(economy + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n economydocument[count1] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n economydocument[count1].add(temp);\n if (temp.length() < 2) {\n economydocument[count1].remove(temp);\n }\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n economydocument[count1].remove(temp);\n }\n }\n for (String str : economydocument[count1]) {\n int index = economydocument[count1].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n economydocument[count1].set(index, stem_word.get(i));\n }\n }\n }\n }\n economydocument[count1].removeAll(stop_word_list);\n economydocument[count1].removeAll(p_name);\n economydocument[count1].removeAll(month);\n economydocument[count1].removeAll(place);\n allecofeature.addAll(economydocument[count1]);\n ecofeature.addAll(economydocument[count1]);\n allfeature.addAll(ecofeature);\n all.addAll(allecofeature);\n count1++;\n\n }\n //reading the whole documents under education category \n for (File entry : education.listFiles()) {\n fill = new File(education + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n educationdocument[count2] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n educationdocument[count2].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n educationdocument[count2].remove(temp);\n }\n }\n }\n\n for (String str : educationdocument[count2]) {\n int index = educationdocument[count2].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n educationdocument[count2].set(index, stem_word.get(i));\n }\n }\n }\n educationdocument[count2].removeAll(stop_word_list);\n educationdocument[count2].removeAll(p_name);\n educationdocument[count2].removeAll(month);\n educationdocument[count2].removeAll(place);\n alledufeature.addAll(educationdocument[count2]);\n edufeature.addAll(educationdocument[count2]);\n allfeature.addAll(edufeature);\n all.addAll(alledufeature);\n count2++;\n }\n// //reading all the documents under sport category\n for (File entry : sport.listFiles()) {\n fill = new File(sport + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n sportdocument[count3] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n sportdocument[count3].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n sportdocument[count3].remove(temp);\n }\n }\n }\n\n for (String str : sportdocument[count3]) {\n int index = sportdocument[count3].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n sportdocument[count3].set(index, stem_word.get(i));\n }\n }\n }\n sportdocument[count3].removeAll(stop_word_list);\n sportdocument[count3].removeAll(p_name);\n sportdocument[count3].removeAll(month);\n sportdocument[count3].removeAll(place);\n allspofeature.addAll(sportdocument[count3]);\n spofeature.addAll(sportdocument[count3]);\n allfeature.addAll(spofeature);\n all.addAll(allspofeature);\n count3++;\n }\n\n// //reading all the documents under culture category\n for (File entry : culture.listFiles()) {\n fill = new File(culture + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n culturedocument[count4] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n\n culturedocument[count4].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n culturedocument[count4].remove(temp);\n }\n }\n\n }\n for (String str : culturedocument[count4]) {\n int index = culturedocument[count4].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n culturedocument[count4].set(index, stem_word.get(i));\n }\n }\n }\n culturedocument[count4].removeAll(stop_word_list);\n culturedocument[count4].removeAll(p_name);\n culturedocument[count4].removeAll(month);\n culturedocument[count4].removeAll(place);\n allculfeature.addAll(culturedocument[count4]);\n culfeature.addAll(culturedocument[count4]);\n allfeature.addAll(culfeature);\n all.addAll(allculfeature);\n count4++;\n\n }\n\n// //reading all the documents under accident category\n for (File entry : accident.listFiles()) {\n fill = new File(accident + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n accedentdocument[count5] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n accedentdocument[count5].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n accedentdocument[count5].remove(temp);\n }\n }\n\n }\n\n for (String str : accedentdocument[count5]) {\n int index = accedentdocument[count5].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n accedentdocument[count5].set(index, stem_word.get(i));\n }\n }\n }\n accedentdocument[count5].removeAll(stop_word_list);\n accedentdocument[count5].removeAll(p_name);\n accedentdocument[count5].removeAll(month);\n accedentdocument[count5].removeAll(place);\n allaccfeature.addAll(accedentdocument[count5]);\n accfeature.addAll(accedentdocument[count5]);\n allfeature.addAll(accfeature);\n all.addAll(allaccfeature);\n count5++;\n }\n\n// //reading all the documents under environmental category\n for (File entry : environmntal.listFiles()) {\n fill = new File(environmntal + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n environmntaldocument[count6] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n environmntaldocument[count6].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n environmntaldocument[count6].remove(temp);\n }\n }\n }\n\n for (String str : environmntaldocument[count6]) {\n int index = environmntaldocument[count6].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n environmntaldocument[count6].set(index, stem_word.get(i));\n }\n }\n }\n environmntaldocument[count6].removeAll(stop_word_list);\n environmntaldocument[count6].removeAll(p_name);\n environmntaldocument[count6].removeAll(month);\n environmntaldocument[count6].removeAll(place);\n allenvfeature.addAll(environmntaldocument[count6]);\n envfeature.addAll(environmntaldocument[count6]);\n allfeature.addAll(envfeature);\n all.addAll(allenvfeature);\n count6++;\n }\n\n// //reading all the documents under foreign affairs category\n for (File entry : foreign_affair.listFiles()) {\n fill = new File(foreign_affair + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n foreign_affairdocument[count7] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n foreign_affairdocument[count7].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n foreign_affairdocument[count7].remove(temp);\n }\n }\n\n }\n for (String str : foreign_affairdocument[count7]) {\n int index = foreign_affairdocument[count7].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n foreign_affairdocument[count7].set(index, stem_word.get(i));\n }\n }\n }\n foreign_affairdocument[count7].removeAll(stop_word_list);\n foreign_affairdocument[count7].removeAll(p_name);\n foreign_affairdocument[count7].removeAll(month);\n foreign_affairdocument[count7].removeAll(place);\n alldepfeature.addAll(foreign_affairdocument[count7]);\n depfeature.addAll(foreign_affairdocument[count7]);\n allfeature.addAll(depfeature);\n all.addAll(alldepfeature);\n count7++;\n }\n\n// //reading all the documents under law and justices category\n for (File entry : law_justice.listFiles()) {\n fill = new File(law_justice + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n law_justicedocument[count8] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n law_justicedocument[count8].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n law_justicedocument[count8].remove(temp);\n }\n }\n\n }\n for (String str : law_justicedocument[count8]) {\n int index = law_justicedocument[count8].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n law_justicedocument[count8].set(index, stem_word.get(i));\n }\n }\n }\n law_justicedocument[count8].removeAll(stop_word_list);\n law_justicedocument[count8].removeAll(p_name);\n law_justicedocument[count8].removeAll(month);\n law_justicedocument[count8].removeAll(month);\n alllawfeature.addAll(law_justicedocument[count8]);\n lawfeature.addAll(law_justicedocument[count8]);\n allfeature.addAll(lawfeature);\n all.addAll(alllawfeature);\n count8++;\n }\n\n// //reading all the documents under other category\n for (File entry : agri.listFiles()) {\n fill = new File(agri + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n agriculture[count9] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n agriculture[count9].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n agriculture[count9].remove(temp);\n }\n }\n\n }\n for (String str : agriculture[count9]) {\n int index = agriculture[count9].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n agriculture[count9].set(index, stem_word.get(i));\n }\n }\n }\n agriculture[count9].removeAll(stop_word_list);\n agriculture[count9].removeAll(p_name);\n agriculture[count9].removeAll(month);\n agriculture[count9].removeAll(place);\n allagrifeature.addAll(agriculture[count9]);\n agrifeature.addAll(agriculture[count9]);\n allfeature.addAll(agrifeature);\n all.addAll(allagrifeature);\n count9++;\n }\n //reading all the documents under politics category\n for (File entry : politics.listFiles()) {\n fill = new File(politics + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n politicsdocument[count10] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n politicsdocument[count10].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n politicsdocument[count10].remove(temp);\n }\n }\n }\n for (String str : politicsdocument[count10]) {\n int index = politicsdocument[count10].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n politicsdocument[count10].set(index, stem_word.get(i));\n }\n }\n }\n politicsdocument[count10].removeAll(stop_word_list);\n politicsdocument[count10].removeAll(p_name);\n politicsdocument[count10].removeAll(month);\n politicsdocument[count10].removeAll(place);\n allpolfeature.addAll(politicsdocument[count10]);\n polfeature.addAll(politicsdocument[count10]);\n allfeature.addAll(polfeature);\n all.addAll(allpolfeature);\n count10++;\n }\n //reading all the documents under science and technology category\n for (File entry : science_technology.listFiles()) {\n fill = new File(science_technology + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n science_technologydocument[count12] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n science_technologydocument[count12].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n science_technologydocument[count12].remove(temp);\n }\n }\n\n }\n for (String str : science_technologydocument[count12]) {\n int index = science_technologydocument[count12].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n science_technologydocument[count12].set(index, stem_word.get(i));\n }\n }\n }\n science_technologydocument[count12].removeAll(stop_word_list);\n science_technologydocument[count12].removeAll(p_name);\n science_technologydocument[count12].removeAll(month);\n science_technologydocument[count12].removeAll(place);\n allscifeature.addAll(science_technologydocument[count12]);\n scifeature.addAll(science_technologydocument[count12]);\n allfeature.addAll(scifeature);\n all.addAll(allscifeature);\n count12++;\n\n }\n\n //reading all the documents under health category\n for (File entry : health.listFiles()) {\n fill = new File(health + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n healthdocument[count13] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n healthdocument[count13].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n healthdocument[count13].remove(temp);\n }\n }\n }\n for (String str : healthdocument[count13]) {\n int index = healthdocument[count13].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n healthdocument[count13].set(index, stem_word.get(i));\n }\n }\n }\n healthdocument[count13].removeAll(stop_word_list);\n healthdocument[count13].removeAll(p_name);\n healthdocument[count13].removeAll(month);\n healthdocument[count13].removeAll(place);\n allhelfeature.addAll(healthdocument[count13]);\n helfeature.addAll(healthdocument[count13]);\n allfeature.addAll(helfeature);\n all.addAll(allhelfeature);\n count13++;\n }\n\n //reading all the file of relgion categories \n for (File entry : army_file.listFiles()) {\n fill = new File(army_file + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n army[count14] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n army[count14].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n army[count14].remove(temp);\n }\n }\n\n }\n for (String str : army[count14]) {\n int index = army[count14].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n army[count14].set(index, stem_word.get(i));\n }\n }\n }\n army[count14].removeAll(stop_word_list);\n army[count14].removeAll(p_name);\n army[count14].removeAll(month);\n army[count14].removeAll(place);\n allarmfeature.addAll(army[count14]);\n armfeature.addAll(army[count14]);\n allfeature.addAll(armfeature);\n all.addAll(allarmfeature);\n count14++;\n }\n } catch (Exception ex) {\n System.out.println(\"here\");\n }\n }", "public void readPoemFiles(){\n try (Scanner fileScan = new Scanner(new File(\"poems.txt\"))) {\n //Poems.txt consist of a header (poet and theme) plus verse lines.\n //First loop reads the header and creates object 'PoetAndTheme'.\n while (fileScan.hasNextLine()){\n String themeAndPoet = fileScan.nextLine();\n PoetAndTheme addToList = new PoetAndTheme(themeAndPoet);\n //Second loop reads verse lines and adds them to object 'PoetAndTheme'.\n while(fileScan.hasNextLine()){\n String verseLine = fileScan.nextLine();\n if (verseLine.isEmpty()){\n break;\n }\n addToList.addVerseLine(verseLine);\n }\n poetsAndThemesList.add(addToList);\n }\n \n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public void storeValue() {\n\t\tScanner s;\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\SubR1.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tSubR1.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\SubR2.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tSubR2.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\SubIRR.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tSubIRR.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\PredR1.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tPredR1.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\PredR2.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tPredR2.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\PredR3.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tPredR3.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\ObjR1.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tObjR1.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\ObjR2.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tObjR2.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"Files\\\\PrepR1.txt\"));\t\t//Read the reference file.\n\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tPrepR1.add(s.nextLine());\t\t\t\t\t\t//Store the reference file in Arraylist.\n\t\t\t}\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static Wine[] read() {\r\n\t\t// We can add files we would like to parse in the following array. We use an array list\r\n\t\t// because it allows us to add dynamically.\r\n\t\tString[] file_adr = { \"data/winemag-data_first150k.txt\", \"data/winemag-data-130k-v2.csv\" };\r\n\t\tArrayList<Wine> arr_list = new ArrayList<Wine>();\r\n\t\t\r\n\t\tint k = 0;\r\n\t\twhile (k < file_adr.length) {\r\n\t\t\tboolean flag = false;\r\n\t\t\tif (file_adr[k].endsWith(\".csv\")) {\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t\tFile f = new File(file_adr[k]);\r\n\t\t\tScanner sc = null;\r\n\t\t\ttry {\r\n\t\t\t\tsc = new Scanner(f, \"UTF-8\");\r\n\t\t\t} catch (FileNotFoundException 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\tsc.nextLine();\r\n\t\t\tInteger id_count = 0;\r\n\t\t\tif(!flag) {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 10) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString variety = st[count+8];\r\n\t\t\t\t\tString winery = st[count+9];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] reviewer = {\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};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t\tString scanned = sc.nextLine();\r\n\t\t\t\t\t// if there is a blank line, skip it before a fail.\r\n\t\t\t\t\tif (scanned.isEmpty()) {\r\n\t\t\t\t\t\tscanned = sc.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// use this instead of StringTokenizer because it won't skip empty fields.\r\n\t\t\t\t\tString[] st = scanned.split(\",\");\r\n\t\t\t\t\t//System.out.println(arr_list.size());\r\n\t\t\t\t\tid_count = arr_list.size();\r\n\t\t\t\t\t/* was put here to make sure all fields show up.\r\n\t\t\t\t\tString toString = \"\";\r\n\t\t\t\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\t\t\t\ttoString += st[i] + \", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t//System.out.println(st[0]);\r\n\t\t\t\t\t/*if(Integer.parseInt(st[0]) == 30350) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tString country = st[1];\r\n\t\t\t\t\tString description = \"\";\r\n\t\t\t\t\t// This piece grabs our entire description! this paragraph has our delimiters so it gets split.\r\n\t\t\t\t\tint count = 0;\r\n\t\t\t\t\tfor (int i = 2; i < (st.length - 12) + 2; i++) {\r\n\t\t\t\t\t\tif (st[i].endsWith(\"\\\"\")) {\r\n\t\t\t\t\t\t\tdescription += st[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tdescription += st[i] + \", \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount++;\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\tString designation = st[count+2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// next two fields will fail if the field is empty, so make sure we assign it something.\r\n\t\t\t\t\tInteger points = !(st[count+3].isEmpty()) ? Integer.parseInt(st[count+3]) : -1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tDouble price = !(st[count+4].isEmpty()) ? Double.parseDouble(st[count+4]) : -1.0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString province = st[count+5];\r\n\t\t\t\t\tString[] region = {\r\n\t\t\t\t\t\t\tst[count+6],\r\n\t\t\t\t\t\t\tst[count+7]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString taster_name = st[count+8];\r\n\t\t\t\t\tString taster_handle = st[count+9];\r\n\t\t\t\t\tString variety = st[count+10];\r\n\t\t\t\t\tString winery = st[count+11];\r\n\t\t\t\t\t//System.out.println(id_count);\r\n\t\t\t\t\t// unique ID system because some wine bottles have empty names.\r\n\t\t\t\t\tInteger unique_id = id_count++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] items = {\r\n\t\t\t\t\t\t\tcountry,\r\n\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\tdesignation,\r\n\t\t\t\t\t\t\tprovince,\r\n\t\t\t\t\t\t\twinery,\r\n\t\t\t\t\t\t\tvariety\r\n\t\t\t\t\t};\r\n\t\t\t\t\tString[] reviewer = {\r\n\t\t\t\t\t\t\ttaster_name,\r\n\t\t\t\t\t\t\ttaster_handle\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tString[] taste = {};\r\n\t\t\t\t\t// Object constructor.\r\n\t\t\t\t\tWine curr_obj = new Wine(items, taste, region, points, unique_id, price, reviewer);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr_list.add(curr_obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tk++;\r\n\t\t\t\tsc.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// We no longer need an array list. we have our size required. Put into an array.\r\n\t\tWine[] array_wines = new Wine[arr_list.size()];\r\n\t\tarray_wines = arr_list.toArray(array_wines);\r\n\t\t\r\n\t\treturn array_wines;\r\n\t\r\n\t}", "public static void readArray(String fileName, int[] newArray) throws Exception{\n\n // Create DataInputStream object to read from binary file.\n // Use fileName from demo file and read into newArray in demo file.\n DataInputStream input = new DataInputStream(new FileInputStream(fileName));\n\n // Create boolean variable to determine End Of File\n boolean EOF = false;\n\n // While it's not the End Of File\n while(!EOF){\n\n // Try Catch Statement\n try{\n\n // for Loop to go through each integer in the binary file\n for(int i = 0; i < newArray.length; i++){\n\n // read the number and place it in the newArray\n newArray[i] = input.readInt();\n }\n }catch(EOFException e){ // Catch clause to find end of file\n // Change EOF to True\n EOF = true;\n }\n\n }\n // Close the file\n input.close();\n }", "private void processBulk()\n {\n File inDir = new File(m_inDir);\n String [] fileList = inDir.list();\n \n for (int j=0; j<fileList.length; j++)\n {\n String file = fileList[j];\n if (file.endsWith(\".xml\"))\n {\n m_inFile = m_inDir + \"/\" + file;\n m_localeStr = Utilities.extractLocaleFromFilename(file);\n processSingle();\n }\n }\n }", "public Vector loadAffyGCOSExpressionFile(File f) throws IOException {\r\n \tthis.setTMEVDataType();\r\n final int preSpotRows = this.sflp.getXRow()+1;\r\n final int preExperimentColumns = this.sflp.getXColumn();\r\n int numLines = this.getCountOfLines(f);\r\n int spotCount = numLines - preSpotRows;\r\n\r\n if (spotCount <= 0) {\r\n JOptionPane.showMessageDialog(superLoader.getFrame(), \"There is no spot data available.\", \"TDMS Load Error\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n \r\n int[] rows = new int[] {0, 1, 0};\r\n int[] columns = new int[] {0, 1, 0};\r\n //String value,pvalue;\r\n String detection;\r\n\r\n float cy3, cy5;\r\n\r\n String[] moreFields = new String[1];\r\n String[] extraFields=null;\r\n final int rColumns = 1;\r\n final int rRows = spotCount;\r\n \r\n ISlideData slideDataArray[]=null;\r\n AffySlideDataElement sde=null;\r\n FloatSlideData slideData=null;\r\n \r\n BufferedReader reader = new BufferedReader(new FileReader(f));\r\n StringSplitter ss = new StringSplitter((char)0x09);\r\n String currentLine;\r\n int counter, row, column,experimentCount=0;\r\n counter = 0;\r\n row = column = 1;\r\n this.setFilesCount(1);\r\n this.setRemain(1);\r\n this.setFilesProgress(0);\r\n this.setLinesCount(numLines);\r\n this.setFileProgress(0);\r\n float[] intensities = new float[2];\r\n \r\n while ((currentLine = reader.readLine()) != null) {\r\n if (stop) {\r\n return null;\r\n }\r\n// fix empty tabbs appending to the end of line by wwang\r\n while(currentLine.endsWith(\"\\t\")){\r\n \tcurrentLine=currentLine.substring(0,currentLine.length()-1);\r\n }\r\n ss.init(currentLine);\r\n \r\n if (counter == 0) { // parse header\r\n \t\r\n \tif(sflp.onlyIntensityRadioButton.isSelected()) \r\n \t\texperimentCount = ss.countTokens()- preExperimentColumns;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/2;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/3;\r\n \t\r\n \t\r\n \tslideDataArray = new ISlideData[experimentCount];\r\n \tSampleAnnotation sampAnn=new SampleAnnotation();\r\n \tslideDataArray[0] = new SlideData(rRows, rColumns, sampAnn);//Added by Sarita to include SampleAnnotation model.\r\n \r\n slideDataArray[0].setSlideFileName(f.getPath());\r\n for (int i=1; i<experimentCount; i++) {\r\n \tsampAnn=new SampleAnnotation();\r\n \tslideDataArray[i] = new FloatSlideData(slideDataArray[0].getSlideMetaData(),spotCount, sampAnn);//Added by Sarita \r\n \tslideDataArray[i].setSlideFileName(f.getPath());\r\n \t//System.out.println(\"slideDataArray[i].slide file name: \"+ f.getPath());\r\n }\r\n if(sflp.onlyIntensityRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[1];\r\n \t//extraFields = new String[1];\r\n \tfieldNames[0]=\"AffyID\";\r\n \tslideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[2];\r\n \textraFields = new String[1];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else{\r\n \tString [] fieldNames = new String[3];\r\n \textraFields = new String[2];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n fieldNames[2]=\"P-value\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n \r\n }\r\n ss.nextToken();//parse the blank on header\r\n for (int i=0; i<experimentCount; i++) {\r\n \tString val=ss.nextToken();\r\n\t\t\t\t\tslideDataArray[i].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\tslideDataArray[i].getSampleAnnotation().setAnnotation(\"Default Slide Name\", val);\r\n\t\t\t\t\tslideDataArray[i].setSlideDataName(val);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.mav.getData().setSampleAnnotationLoaded(true);\r\n\t\t\t \t \r\n if(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection\r\n ss.nextToken();//parse the pvalue\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection \r\n } \r\n }\r\n \r\n } else if (counter >= preSpotRows) { // data rows\r\n \trows[0] = rows[2] = row;\r\n \tcolumns[0] = columns[2] = column;\r\n \tif (column == rColumns) {\r\n \t\tcolumn = 1;\r\n \t\trow++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t} else {\r\n \t\tcolumn++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t}\r\n\r\n \t//affy ID\r\n \tmoreFields[0] = ss.nextToken();\r\n \r\n \t\r\n \t\r\n String cloneName = moreFields[0];\r\n if(_tempAnno.size()!=0) {\r\n \t \r\n \t \t \r\n \t if(((MevAnnotation)_tempAnno.get(cloneName))!=null) {\r\n \t\t MevAnnotation mevAnno = (MevAnnotation)_tempAnno.get(cloneName);\r\n\r\n \t\t sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields, mevAnno);\r\n \t }else {\r\n \t /**\r\n \t * Sarita: clone ID explicitly set here because if the data file\r\n \t * has a probe (for eg. Affy house keeping probes) for which Resourcerer\r\n \t * does not have annotation, MeV would still work fine. NA will be\r\n \t * appended for the rest of the fields. \r\n \t * \r\n \t * \r\n \t */\r\n \t\tMevAnnotation mevAnno = new MevAnnotation();\r\n \t\tmevAnno.setCloneID(cloneName);\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields, mevAnno);\r\n \t \t\t \r\n }\r\n }\r\n /* Added by Sarita\r\n * Checks if annotation was loaded and accordingly use\r\n * the appropriate constructor.\r\n * \r\n * \r\n */\r\n \r\n else {\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields);\r\n }\r\n \r\n \t\r\n \t//sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields);\r\n\r\n \tslideDataArray[0].addSlideDataElement(sde);\r\n \tint i=0;\r\n\r\n \tfor ( i=0; i<slideDataArray.length; i++) { \r\n \t\ttry {\t\r\n\r\n \t\t\t// Intensity\r\n \t\t\tintensities[0] = 1.0f;\r\n \t\t\tintensities[1] = ss.nextFloatToken(0.0f);\r\n \t\t\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t\textraFields[1]=ss.nextToken();//p-value\r\n \t\t\t\t\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t}\r\n\r\n \t\t} catch (Exception e) {\r\n \t\t\t\r\n \t\t\tintensities[1] = Float.NaN;\r\n \t\t}\r\n \t\tif(i==0){\r\n \t\t\t\r\n \t\t\tslideDataArray[i].setIntensities(counter - preSpotRows, intensities[0], intensities[1]);\r\n \t\t\t//sde.setExtraFields(extraFields);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t\tsde.setPvalue(new Float(extraFields[1]).floatValue());\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t}\r\n \t\t}else{\r\n \t\t\tif(i==1){\r\n \t\t\t\tmeta = slideDataArray[0].getSlideMetaData(); \t\r\n \t\t\t}\r\n \t\t\tslideDataArray[i].setIntensities(counter-preSpotRows,intensities[0],intensities[1]);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setPvalue(counter-preSpotRows,new Float(extraFields[1]).floatValue());\r\n \t\t\t}\r\n \t\t\tif(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n\r\n } else {\r\n //we have additional sample annoation\r\n \r\n \tfor (int i = 0; i < preExperimentColumns - 1; i++) {\r\n\t\t\t\t\tss.nextToken();\r\n\t\t\t\t}\r\n\t\t\t\tString key = ss.nextToken();\r\n\r\n\t\t\t\tfor (int j = 0; j < slideDataArray.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(slideDataArray[j].getSampleAnnotation()!=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tString val=ss.nextToken();\r\n\t\t\t\t\t\tslideDataArray[j].getSampleAnnotation().setAnnotation(key, val);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tSampleAnnotation sampAnn=new SampleAnnotation();\r\n\t\t\t\t\t\t\tsampAnn.setAnnotation(key, ss.nextToken());\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotation(sampAnn);\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \t}\r\n \t\r\n this.setFileProgress(counter);\r\n \tcounter++;\r\n \t//System.out.print(counter);\r\n \t}\r\n reader.close();\r\n \r\n \r\n Vector data = new Vector(slideDataArray.length);\r\n \r\n for(int j = 0; j < slideDataArray.length; j++)\r\n \tdata.add(slideDataArray[j]);\r\n \r\n this.setFilesProgress(1);\r\n return data;\r\n }", "public static PVector[] readFromFile(String filename) {\n ArrayList<PVector> ledPositionsList= new ArrayList<PVector> ();\n //try to read data from file\n try {\n File file = new File(filename);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n String[] pieces = line.split(\"\\t\");\n if (pieces.length>3) {\n ledPositionsList.add(new PVector( (Float.parseFloat(pieces[1])/4.0f), Float.parseFloat(pieces[2])/4.0f, Float.parseFloat(pieces[3])/4.0f)); //initialize Leds x,y,z,r,g,b\n }\n }\n scanner.close();\n } \n catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n //convert to vanilla Java Array\n PVector[] ledPositions= new PVector[ledPositionsList.size()];\n for (int i=0; i<ledPositionsList.size(); i++) {\n ledPositions[i]=ledPositionsList.get(i);\n }\n return ledPositions;\n }", "public static ArrayList<Integer> setZerosList(int numFiles){\n ArrayList<Integer> zerosList = new ArrayList<>();\n for(int i = 0; i < numFiles; i++)\n zerosList.add(0);\n\n return zerosList;\n\n }", "abstract void readSMF(File file) throws InvalidMidiDataException, IOException;", "public void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "public List<AudioInformation> getAudioInformationFunction(String path){\n File folder = new File(path);\n File[] listOfFiles = folder.listFiles((FileFilter) null);// get all files in folder\n if(listOfFiles!=null){\n int size = listOfFiles.length;\n numberOfFilesToProcess = numberOfFilesToProcess + size;\n if(progressBar!=null) {\n progressBar.setFilesToProcess(numberOfFilesToProcess);\n }\n\n for (int count = 0; count < size; count++) {\n File file = listOfFiles[count];\n boolean read=false;\n if (!(file.getName().charAt(0) == exclude)) { // if starts with exclude charcter ignore\n if (file.isFile()) {\n boolean isAudioFile = utilities.isAudioFile(file); // check if file is audio file\n if (isAudioFile == true) {\n AudioInformation information=extractAudioInformation.extractAudioInformationFromFile(file);\n if(onCD==true) {\n information.setWriteFieldsToFile(false);\n }\n\n informationList.add(information);\n\n }\n else if(utilities.getExtensionOfFile(file).equalsIgnoreCase(\"cue\")){\n try {\n CueSheet cueSheet=extractAudioInformation.getCueSheet(file);\n List<AudioInformation> tracks=cueSheet.getTracks();\n informationList.addAll(tracks);\n } catch (CueSheetExeception cueSheetExeception) {\n cueSheetExeception.printStackTrace();\n errorMessages.add(cueSheetExeception.getMessage());\n }\n }\n numberOfFilesProcessed++;\n if(progressBar!=null) {\n progressBar.setFilesProcessed(numberOfFilesProcessed);\n }\n } else if (file.isDirectory()) {\n numberOfFilesProcessed++;\n if(progressBar!=null) {\n\n progressBar.setFilesProcessed(numberOfFilesProcessed);\n }\n\n getAudioInformationFunction(listOfFiles[count].getPath());\n }\n if(updateLabel!=null) {\n updateLabel.setText(numberOfFilesToProcess + \" of \" + numberOfFilesToProcess + \"Files Processed\");\n }\n\n }\n }\n }\n return informationList;\n }", "private void readGraphsFromFiles() {\n\n\n \t\ttry {\t\n\t\t\t// where to find SN files\n\t\t\tString fileName = \"./networks/SN_20000\";\n\t\t\tint numberSNs = 5;\n\t\t\t\n\t\t\t// TODO CHANGE! IT IS JUST FOR TESTING. OUT OF MEMORY\n\t\t\tfileNamesGraphs = new String[numberSNs];\n\t\t\tfileNamesGraphs [0]= fileName + \"_0.001.dgs\";\n\t\t\tfileNamesGraphs [1]= fileName + \"_0.002.dgs\";\n\t\t\tfileNamesGraphs [2]= fileName + \"_0.003.dgs\";\n\t\t\tfileNamesGraphs [3]= fileName + \"_0.004.dgs\";\n\t\t\tfileNamesGraphs [4]= fileName + \"_0.005.dgs\";\n\t\t\t//files [5]= fileName + \"_0.001.dgs\";\n\t\t\t//files [6]= fileName + \"_0.001.dgs\";\n\t\t\t//files [7]= fileName + \"_0.001.dgs\";\n\t\t\t//files [8]= fileName + \"_0.001.dgs\";\n\t\t\t//files [9]= fileName + \"_0.001.dgs\";\n\n\t long time1 = System.currentTimeMillis( );\n\n\t\t\t// first create a list of Graphs\n\t\t\tthis.graphsFromFiles = new ArrayList<Graph>();\t\n\t\t\t\n\t\t\tfor (int i = 0; i < numberSNs; i++) {\n\t\t\t\tGraph graphFromFile;\n\t\t\t\tgraphFromFile = new SingleGraph(\"SN\" + i);\n\t\t\t\tthis.graphsFromFiles.add(graphFromFile);\n\t\t\t}\n\t\t\n\t\t\tFileSourceDGS fileSource = new FileSourceDGS();\n\t\t\t\t\t\n\t\t\tfor (int i = 0; i < numberSNs; i++) {\n\t\t\t\tfileSource.addSink(this.graphsFromFiles.get(i));\t\t\t\t\n\t\t\t\tfileSource.readAll(fileNamesGraphs[i]);\n\t\t\t\tfileSource.removeSink(this.graphsFromFiles.get(i));\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\tlong time2 = System.currentTimeMillis( );\n\t\t\tSystem.out.println(\"readGraphsFromFiles: \" + (double)(time2 - time1)/1000 \n\t\t\t\t\t+ \"s for reading the SN files\");\n\t \n\t\t\t\n\t\t} catch (IOException e) {\n\t\t \tSystem.out.println(\"Error when reading SN files\");\n\t\t}\n\t\t\t\t\t\n\t}", "static void ReadAndWriteDataSet(String folderName) throws IOException\n\t{\n\t\t\n\t\t String path = \"data\"+FS+\"data_stage_one\"+FS+folderName; // Folder path \n\t\t \n\t\t String filename, line;\n\t\t File folder = new File(path);\n\t\t File[] listOfFiles = folder.listFiles();\n\t\t BufferedReader br = null;\n\t\t for(int i=0; i < listOfFiles.length; i++)\n\t\t { \n\t\t\t System.out.println(listOfFiles[i].getName());\n\t\t\t filename = path+FS+listOfFiles[i].getName();\n\t\t\t try\n\t\t\t {\n\t\t\t\t br= new BufferedReader(new FileReader(new File(filename)));\n\t\t\t\t while((line = br.readLine())!= null)\n\t\t\t\t {\n\t\t\t\t\tfor(int j=0; j<prep.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t\t\twhile(st.hasMoreTokens())\n\t\t\t\t\t\t\tif(st.nextToken().equalsIgnoreCase(prep[j]))\n\t\t\t\t\t\t\t{\t//System.out.println(line);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(arr[j] == null)\n\t\t\t\t\t\t\t\t\tarr[j] = new ArrayList<String>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tarr[j].add(line.toLowerCase().replaceAll(\"\\\\p{Punct}\",\"\").trim().replaceAll(\"\\\\s+\", \" \"));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t \n\t\t\t }\n\t\t\t catch(Exception e)\n\t\t\t {\n\t\t\t\t System.err.println(\"exception: \"+e.getMessage() );\n\t\t\t\t e.printStackTrace();\n\t\t\t\t System.exit(0);\n\t\t\t }\n\t\t\t finally\n\t\t\t {\n\t\t\t\t br.close();\n\t\t\t }\n\t\t }\n\t\t \n\t\t // Writes the entire arraylist(preposition wise seperated files)\n\t\t \n\t\t WriteSeperated(folderName);\n\t\t \n\t\t for(int i=0; i<prep.length; i++)\n\t\t {\n\t\t\t arr[i].clear();\n\t\t }\n\t\t \n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "private static void tokenFiles() throws IOException\r\n\t{\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br1 = new BufferedReader(fr);\r\n\t\t\r\n\t\tDouble[] salaries = new Double[10];//array for salary\r\n\t\tInteger[] id = new Integer[10];//array for id\r\n\t\tInteger[] age = new Integer[10];//array for age\r\n\t\tString[] fName = new String[10];//array for first name\r\n\t\tString[] lName = new String[10];//array for last name\r\n\t\tString[] status = new String[10];//array for status\r\n\t\tDouble[] raises = new Double[10];//array for the raised salary\r\n\t\tString s1;//string for readLine of files\r\n\t\tint i = 0;//index for loop of arrays\r\n\t\t\r\n\t\tSystem.out.println(\"\\nWith a 2% raise\\n\");\r\n\t\t//while loop to convert to proper type\r\n\t\twhile ((s1 = br1.readLine())!=null && i<10)\r\n\t\t{\r\n\t\t\tStringTokenizer st = new StringTokenizer(s1);//create new obj tokenizer\r\n\t\t\tfName[i] = st.nextToken();\r\n\t\t\tlName[i] = st.nextToken();\r\n\t\t\tid[i] = Integer.parseInt(st.nextToken());\r\n\t\t\tage[i] = Integer.parseInt(st.nextToken());\t\t\t\t\r\n\t\t\tsalaries[i] = Double.parseDouble(st.nextToken());\r\n\t\t\tstatus[i] = st.nextToken();\r\n\t\t\t\r\n\t\t\tSystem.out.println(fName[i]+\" \"+ lName[i]+\" \"+ id[i]+\r\n\t\t\t\t\t\t\" \"+ age[i]+\" \"+salaries[i]+\" \"+status[i]);\t\r\n\t\t\t\r\n\t\t\traises[i]= (salaries[i]*.02) +salaries[i];//calculate new salaries\r\n\t\t\tSystem.out.println(\"Salary with raise: \" +raises[i]);//print raise amount\r\n\t\t\ti++;\r\n\t\t}//end while loop convert to proper type\r\n\t\tbr1.close();//close this buffered reader\r\n\t}", "private static void generateSequence() throws FileNotFoundException {\n Scanner s = new Scanner(new BufferedReader(new FileReader(inputPath + filename)));\n\t\tlrcSeq = new ArrayList<Integer>();\n\t\tmeloSeq = new ArrayList<Integer>();\n\t\tdurSeq = new ArrayList<Integer>();\n\t\t\n\t\tString line = null;\n\t\tint wordStress;\n\t\tint pitch;\n\t\tint melStress;\n\t\tint stress;\n\t\tint duration;\n\t\t\n\t\twhile(s.hasNextLine()) {\n\t\t\tline = s.nextLine();\n\t\t\tString[] temp = line.split(\",\");\n\t\t\t\n\t\t\twordStress = Integer.parseInt(temp[1]);\n\t\t\tpitch = Integer.parseInt(temp[2]);\n\t\t\tmelStress = Integer.parseInt(temp[3]);\n\t\t\tduration = Integer.parseInt(temp[4]);\n\t\t\t\n\n\t\t\t//combine word level stress and sentence level stress\n\t\t\tstress = wordStress * 3 + melStress;\n\t\t\t/*if(stress < 0 || stress > 9) {\n\t\t\t\tSystem.out.println(\"Stress range error\");\n\t\t\t}*/\n\t\t\tlrcSeq.add(stress);\n\t\t\tmeloSeq.add(pitch);\n\t\t\tdurSeq.add(duration);\n\t\t}\n\t\t\n\t\t//calculate relative value\n\t\tfor(int i = 0;i < lrcSeq.size() -1;++i) {\n\t\t\tlrcSeq.set(i, lrcSeq.get(i+1)-lrcSeq.get(i));\n\t\t\tmeloSeq.set(i, meloSeq.get(i+1) - meloSeq.get(i));\n\t\t\tif(durSeq.get(i+1) / durSeq.get(i)>=1)\n\t\t\t\tdurSeq.set(i, durSeq.get(i+1) / durSeq.get(i));\n\t\t\telse \n\t\t\t\tdurSeq.set(i,durSeq.get(i) / durSeq.get(i+1) * (-1));\n\t\t}\n\t\tlrcSeq.remove(lrcSeq.size()-1);\n\t\tmeloSeq.remove(meloSeq.size()-1);\n\t\tdurSeq.remove(durSeq.size()-1);\n\t\t\n\t}", "public static void readDatafiles() throws FileNotFoundException {\n int docNumber = 0;\n\n while(docNumber<totaldocument) { // loop will run until all 0 - 55 speech data is read\n String tempBuffer = \"\";\n\n Scanner sc_obj = new Scanner(new File(\"./inputFiles/speech_\"+docNumber+\".txt\"));\n sc_obj.nextLine(); //skip the first line of every document\n\n while(sc_obj.hasNext()) {\n tempBuffer = sc_obj.next();\n tempBuffer = tempBuffer.replaceAll(\"[^a-zA-Z]+\",\" \");\n\n String[] wordTerm = tempBuffer.split(\" |//.\"); // the read data will convert into single word from whole stream of characters\n // it will split according to white spaces . - , like special characters\n\n for (int i=0; i < wordTerm.length; i++) {\n\n String term = wordTerm[i].toLowerCase();\t\t//each splitted word will be converted into lower case\n term = RemoveSpecialCharacter(term);\t\t\t// it will remove all the characters apart from the english letters\n term = removeStopWords(term);\t\t\t\t\t// it will remove the stopWords and final version of the term in the form of tokens will form\n\n if(!term.equalsIgnoreCase(\"\") && term.length()>1) {\n term = Lemmatize(term);\t\t\t\t\t//all the words in the form of tokens will be lemmatized\n //increment frequency of word if it is already present in dictionary\n if(dictionary.containsKey(term)) {\t\t//all the lemmatized words will be placed in HashMap dictionary\n List<Integer> presentList = dictionary.get(term);\n int wordFrequency = presentList.get(docNumber);\n wordFrequency++;\n presentList.set(docNumber, wordFrequency);\t\t//frequency of all the lemmatized words in dictionary is maintained \t\t\t\t\t\t\t\t\t//i.e: Word <2.0,1.0,3.0,0.0 ...> here hashmap<String,List<Double> is used\n }\t\t\t\t\t\t\t\t\t\t//the 0th index shows the word appared 2 times in doc 0 and 1 times in doc 1 and so forth..\n else { // if word was not in the dictionary then it will be added\n // if word was found in 5 doc so from 0 to 4 index representing doc 0 to doc 4 (0.0) will be placed\n List<Integer>newList = new ArrayList<>();\n for(int j=0; j<57; j++) {\n if(j != docNumber)\n newList.add(0);\n else\n newList.add(1);\n }\n dictionary.put(term, newList);\n }\n }\n }\n\n }\n docNumber++;\n }\n }", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "void readFiles(Boolean smart) \n\t//throws IOException// more here for safety\n\t{\n\t\tint i;\n\t\tfor (i = 0; i<165; ++i)\n\t\tfor (int j = 0; j<11; ++j)\n\t\t{\t//if(smart)memoryFile.readInt(board(i,j));\n\t\t\t//else \n\t\t\t\tboard[i][j] = 0;\n\t\t}\n\t\t//try memoryFileStream.close(); catch (IOException e);\n\t}", "private void readFileAndStoreData_(String fileName) {\n In in = new In(fileName);\n int numberOfTeams = in.readInt();\n int teamNumber = 0;\n while (!in.isEmpty()) {\n assignTeam_(in, teamNumber);\n assignTeamInfo_(in, numberOfTeams, teamNumber);\n teamNumber++;\n }\n }", "public void readfiles1(String file_name){\n \n\n try{\n File fname1 = new File(file_name);\n Scanner sc = new Scanner(fname1);\n \n while (sc.hasNext()){\n String temp = sc.nextLine();\n String[] sts = temp.split(\" \");\n outs.addAll(Arrays.asList(sts));\n\n }\n\n // for (int i = 0;i<outs.size();i++){\n // System.out.println(outs.get(i));\n //}\n\n }catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n }", "private void getFiles() {\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inputFileName);\n\t\t\tinputBuffer = new BufferedReader(fr);\n\n\t\t\tFileWriter fw = new FileWriter(outputFileName);\n\t\t\toutputBuffer = new BufferedWriter(fw);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found: \" + e.getMessage());\n\t\t\tSystem.exit(-2);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IOException \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-3);\n\t\t}\n\t}", "private Point[] readTestFile(String filename) {\n In in = new In(filename);\n int N = in.readInt();\n Point[] points = new Point[N];\n for (int i = 0; i < N; i++) {\n int x = in.readInt();\n int y = in.readInt();\n points[i] = new Point(x, y);\n }\n return points;\n }", "public static void readTasks(String filename,\n ArrayList<Task> task1, ArrayList<Task> task2,\n ArrayList<Task> task3) {\n int start;\n int deadline;\n int mins;\n int id = 0;\n File file = new File(\"src/\" + filename);\n try{\n Scanner sc = new Scanner(file);\n while(sc.hasNextInt()){\n id += 1;\n start = Integer.parseInt(sc.next());\n deadline = Integer.parseInt(sc.next());\n mins = Integer.parseInt(sc.next());\n //for each set of three numbers, create three tasks\n Task t1 = new Task1(id, start, deadline, mins);\n Task t2 = new Task2(id, start, deadline, mins);\n Task t3 = new Task3(id, start, deadline, mins);\n //add each to their respected queues\n task1.add(t1);\n task2.add(t2);\n task3.add(t3);\n }\n }catch(FileNotFoundException e){\n e.printStackTrace();\n }\n\n\n }", "private void prepareAssignmentFiles() {\n for (Assignment assignment : assignments) {\n //---------- initialize the assignmentFiles array list ----------\n assignment.assignmentFiles = new ArrayList<>();\n\n //create a temporary assignment files array list\n ArrayList<File> assignmentFiles = new ArrayList<>();\n\n //---------- call the recursive findAssignmentFiles method ----------\n findAssignmentFiles(assignmentFiles, assignment.assignmentDirectory);\n\n //---------- set the language for the assignment ----------\n if (language.equals( IAGConstant.LANGUAGE_AUTO) ) {\n assignment.language = autoDetectLanguage(assignmentFiles);\n }\n else {\n assignment.language = language;\n }\n\n String[] extensions;\n\n switch (assignment.language) {\n case IAGConstant.LANGUAGE_PYTHON3:\n extensions = IAGConstant.PYTHON_EXTENSIONS;\n break;\n case IAGConstant.LANGUAGE_CPP:\n extensions = IAGConstant.CPP_EXTENSIONS;\n break;\n default: //unable to determine the language\n extensions = new String[] {};\n }\n\n //add only files of the right type to the assignment file list\n for (File f: assignmentFiles) {\n String f_extension = getFileExtension(f).toLowerCase();\n if (Arrays.asList(extensions).contains(f_extension)){\n //---------- if the extension on the file matches\n // one of the extension in the extensions list, add\n // it to the programming files list. ----------\n assignment.assignmentFiles.add(f);\n }\n }\n assignment.bAutoGraded = false; //indicate the assignment has not yet been auto-graded\n }\n\n }", "void readData(String fileName){ \r\n\t\ttry{ \r\n\t\t\tScanner sc = new Scanner(new File(fileName), \"UTF-8\");\r\n\t\t\t\r\n\t\t\t// input grid dimensions and simulation duration in timesteps\r\n\t\t\tdimt = sc.nextInt();\r\n\t\t\tdimx = sc.nextInt(); \r\n\t\t\tdimy = sc.nextInt();\r\n\t\t\t//System.out.println(dimt+\" \"+dimx + \" \"+dimy);\r\n\t\t\t// initialize and load advection (wind direction and strength) and convection\r\n\t\t\tadvection = new Vector[dimt][dimx][dimy];\r\n\t\t\tconvection = new float[dimt][dimx][dimy];\r\n\t\t\tfor(int t = 0; t < dimt; t++)\r\n\t\t\t\tfor(int x = 0; x < dimx; x++)\r\n\t\t\t\t\tfor(int y = 0; y < dimy; y++){\r\n\t\t\t\t\t\tadvection[t][x][y] = new Vector();\r\n\t\t\t\t\t\tadvection[t][x][y].x = Float.parseFloat(sc.next());\r\n\t\t\t\t\t\tadvection[t][x][y].y = Float.parseFloat(sc.next());\r\n\t\t\t\t\t\tconvection[t][x][y] = Float.parseFloat(sc.next());\r\n\t\t\t\t\t\t//System.out.println(advection[t][x][y].x+\" \"+advection[t][x][y].y + \" \"+convection[t][x][y]);\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\tclassification = new int[dimt][dimx][dimy];\r\n\t\t\tsc.close(); \r\n\t\t} \r\n\t\tcatch (IOException e){ \r\n\t\t\tSystem.out.println(\"Unable to open input file \"+fileName);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (InputMismatchException e){ \r\n\t\t\tSystem.out.println(\"Malformed input file \"+fileName);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void readAll() throws FileNotFoundException{ \n b = new BinaryIn(this.filename);\n this.x = b.readShort();\n this.y = b.readShort();\n \n int count = (x * y) / (8 * 8);\n this.blocks = new double[count][8][8][3];\n \n Node juuri = readTree();\n readDataToBlocks(juuri);\n }", "private static ArrayList<File> buildFilesArray() {\n ArrayList<File> result = new ArrayList<>();\n rAddFilesToArray(workingDirectory, result);\n return result;\n }", "public static void processData() {\n\t\tString dirName = \"C:\\\\research_data\\\\mouse_human\\\\homo_b47_data\\\\\";\r\n\t//\tString GNF1H_fName = \"GNF1H_genes_chopped\";\r\n\t//\tString GNF1M_fName = \"GNF1M_genes_chopped\";\r\n\t\tString GNF1H_fName = \"GNF1H\";\r\n\t\tString GNF1M_fName = \"GNF1M\";\r\n\t\tString mergedValues_fName = \"GNF1_merged_expression.txt\";\r\n\t\tString mergedPMA_fName = \"GNF1_merged_PMA.txt\";\r\n\t\tString discretizedMI_fName = \"GNF1_discretized_MI.txt\";\r\n\t\tString discretizedLevels_fName = \"GNF1_discretized_levels.txt\";\r\n\t\tString discretizedData_fName = \"GNF1_discretized_data.txt\";\r\n\t\t\r\n\t\tboolean useMotifs = false;\r\n\t\tMicroArrayData humanMotifs = null;\r\n\t\tMicroArrayData mouseMotifs = null;\r\n\t\t\r\n\t\tMicroArrayData GNF1H_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1H_PMA = new MicroArrayData();\r\n\t\tGNF1H_PMA.setDiscrete();\r\n\t\tMicroArrayData GNF1M_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1M_PMA = new MicroArrayData();\r\n\t\tGNF1M_PMA.setDiscrete();\r\n\t\t\r\n\t\ttry {\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma\"); */\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.txt.homob44\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.txt.homob44\"); */\r\n\t\t\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.sn.txt\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.sn.txt\");\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (useMotifs) {\r\n\t\t\thumanMotifs = new MicroArrayData();\r\n\t\t\tmouseMotifs = new MicroArrayData();\r\n\t\t\tloadMotifs(humanMotifs,GNF1H_value.geneNames,mouseMotifs,GNF1M_value.geneNames);\r\n\t\t}\r\n\t\t\r\n\t\t// combine replicates in PMA values\r\n\t\tint[][] H_PMA = new int[GNF1H_PMA.numRows][GNF1H_PMA.numCols/2];\r\n\t\tint[][] M_PMA = new int[GNF1M_PMA.numRows][GNF1M_PMA.numCols/2];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\tint v = 0;\r\n\t\tk = 0;\r\n\t\tj = 0;\r\n\t\twhile (j<GNF1H_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<H_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1H_PMA.dvalues[i][j] > 0 & GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0 | GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tH_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tj = 0;\r\n\t\tk = 0;\r\n\t\twhile (j<GNF1M_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<M_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1M_PMA.dvalues[i][j] > 0 & GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0 | GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tM_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tint numMatched = 31;\r\n\t\t\r\n\t/*\tGNF1H_value.numCols = numMatched;\r\n\t\tGNF1M_value.numCols = numMatched; */\r\n\t\t\r\n\t\tint[][] matchPairs = new int[numMatched][2];\r\n\t\tfor(i=0;i<numMatched;i++) {\r\n\t\t\tmatchPairs[i][0] = i;\r\n\t\t\tmatchPairs[i][1] = i + GNF1H_value.numCols;\r\n\t\t}\r\n\t\t\r\n\t//\tDiscretizeAffyData H_discretizer = new DiscretizeAffyData(GNF1H_value.values,H_PMA,0);\r\n\t//\tH_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1H_value.values,H_PMA,GNF1H_value.numCols);\r\n\t\t\r\n\t//\tDiscretizeAffyData M_discretizer = new DiscretizeAffyData(GNF1M_value.values,M_PMA,0);\r\n\t//\tM_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1M_value.values,M_PMA,GNF1M_value.numCols);\r\n\t\t\r\n\t\tdouble[][] mergedExpression = new double[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[][] mergedPMA = new int[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[] species = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1H_value.values[i],0,mergedExpression[i],0,GNF1H_value.numCols);\r\n\t\t\tSystem.arraycopy(H_PMA[i],0,mergedPMA[i],0,GNF1H_value.numCols);\t\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1M_value.values[i],0,mergedExpression[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t\tSystem.arraycopy(M_PMA[i],0,mergedPMA[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate experiment and gene names\r\n\t\tfor (i=0;i<GNF1H_value.numCols;i++) {\r\n\t\t\tGNF1H_value.experimentNames[i] = \"h_\" + GNF1H_value.experimentNames[i];\r\n\t\t\tspecies[i] = 1;\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numCols;i++) {\r\n\t\t\tGNF1M_value.experimentNames[i] = \"m_\" + GNF1M_value.experimentNames[i];\r\n\t\t\tspecies[i+GNF1H_value.numCols] = 2;\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedExperimentNames = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\tSystem.arraycopy(GNF1H_value.experimentNames,0,mergedExperimentNames,0,GNF1H_value.numCols);\r\n\t\tSystem.arraycopy(GNF1M_value.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\tif (useMotifs) {\r\n\t\t\tSystem.arraycopy(humanMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols,humanMotifs.numCols);\r\n\t\t\tSystem.arraycopy(mouseMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols+humanMotifs.numCols,mouseMotifs.numCols);\r\n\t\t\tfor (i=0;i<humanMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols] = 3;\r\n\t\t\t}\r\n\t\t\tfor (i=0;i<mouseMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols] = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedGeneNames = new String[GNF1H_value.numRows];\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tmergedGeneNames[i] = GNF1H_value.geneNames[i] + \"|\" + GNF1M_value.geneNames[i];\r\n\t\t}\r\n\t\t\r\n\t\tint[] filterList = new int[GNF1M_value.numRows];\r\n\t\tint numFiltered = 0;\r\n\t\tdouble maxExpressedPercent = 1.25;\r\n\t\tint maxExpressed_H = (int) Math.floor(maxExpressedPercent*((double) GNF1H_value.numCols));\r\n\t\tint maxExpressed_M = (int) Math.floor(maxExpressedPercent*((double) GNF1M_value.numCols));\r\n\t\tint numExpressed_H = 0;\r\n\t\tint numExpressed_M = 0;\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tnumExpressed_H = 0;\r\n\t\t\tfor (j=0;j<GNF1H_value.numCols;j++) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1H_value.values[i][j])) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t\t\tnumExpressed_H++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tnumExpressed_M = 0;\r\n\t\t\tfor (j=0;j<GNF1M_value.numCols;j++) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1M_value.values[i][j])) {\r\n\t\t\t\t\tnumExpressed_M++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (numExpressed_M >= maxExpressed_M | numExpressed_H >= maxExpressed_H) {\r\n\t\t\t\tfilterList[i] = 1;\r\n\t\t\t\tnumFiltered++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tGNF1H_value = null;\r\n\t\tGNF1H_PMA = null;\r\n\t\tGNF1M_value = null;\r\n\t\tGNF1M_PMA = null;\r\n\t\t\r\n\t\tdouble[][] mergedExpression2 = null;\r\n\t\tif (numFiltered > 0) {\r\n\t\t\tk = 0;\r\n\t\t\tint[][] mergedPMA2 = new int[mergedPMA.length-numFiltered][mergedPMA[0].length];\r\n\t\t\tif (!useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length];\r\n\t\t\t} else {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t}\r\n\t\t\tString[] mergedGeneNames2 = new String[mergedGeneNames.length-numFiltered];\r\n\t\t\tfor (i=0;i<filterList.length;i++) {\r\n\t\t\t\tif (filterList[i] == 0) {\r\n\t\t\t\t\tmergedPMA2[k] = mergedPMA[i];\r\n\t\t\t\t\tif (!useMotifs) {\r\n\t\t\t\t\t\tmergedExpression2[k] = mergedExpression[i];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[k],0,mergedExpression[i].length);\r\n\t\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[k],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[k],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmergedGeneNames2[k] = mergedGeneNames[i];\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmergedPMA = mergedPMA2;\r\n\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\tmergedGeneNames = mergedGeneNames2;\r\n\t\t} else {\r\n\t\t\tif (useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t\tfor (i=0;i<mergedExpression.length;i++) {\r\n\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[i],0,mergedExpression[i].length);\r\n\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[i],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[i],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t}\r\n\t\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tDiscretizeAffyPairedData discretizer = new DiscretizeAffyPairedData(mergedExpression,mergedPMA,matchPairs,20);\r\n\t\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = discretizer.expression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = discretizer.numExperiments;\r\n\t\tmergedData.numRows = discretizer.numGenes;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tdiscretizer.discretizeDownTree(dirName+discretizedMI_fName);\r\n\t\t\tdiscretizer.mergeDownLevels(3,dirName+discretizedLevels_fName);\r\n\t\t\tdiscretizer.transposeDExpression();\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t\tmergedData.dvalues = discretizer.dExpression;\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t/*\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = mergedExpression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = mergedExpression[0].length;\r\n\t\tmergedData.numRows = mergedExpression.length;\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t//\tmergedData.dvalues = simpleDiscretization(mergedExpression,mergedPMA);\r\n\t\t\tmergedData.dvalues = simpleDiscretization2(mergedExpression,species);\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} */\r\n\t\t\r\n\t}", "public File[] getUsedAudioFiles(){\n \tArrayList<File> afList=new ArrayList<File>();\n \tif(source instanceof FileAudioSource){\n \t\tafList.add(((FileAudioSource)source).getFile());\n \t}\n \tfor (AudioPlugin ap : plugins) {\n\t\t\tif (ap instanceof SourcePlugin) {\n\t\t\t\tAudioSource as = ((SourcePlugin) ap).getAudioSource();\n\t\t\t\tif (as instanceof FileAudioSource) {\n\t\t\t\t\tafList.add(((FileAudioSource) source).getFile());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \treturn afList.toArray(new File[0]);\n }", "private ArrayList<ArrayList<String>> initArrArrList(ArrayList<String> packetNames) throws FileNotFoundException, IOException {\n ArrayList<ArrayList<String>> arrList=new ArrayList();\n LoadAndSave las=new LoadAndSave();\n for(int x=0;x<packetNames.size();x++) {\n las.load(packetNames.get(x));\n arrList.add(las.loader1);\n arrList.add(las.loader2);\n }\n return arrList;\n \n }", "public void getDataFromFile(){\n\n try\n {\n File file = new File( fileName );\n FileInputStream fis = new FileInputStream( file );\n DataInputStream in = new DataInputStream(fis);\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String message = \"\", eachLine = \"\";\n\n while ((eachLine = br.readLine()) != null) {\n message += eachLine;\n }\n\n //System.out.println(message);\n StringTokenizer tokens = new StringTokenizer(message);\n\n //to set the coordination and demand of each customer\n size = Integer.parseInt(tokens.nextToken());\n processingTime = new double[size][size];\n\n for(int i = 0 ; i < size ; i ++ ){\n for(int j = 0 ; j < size ; j ++ ){\n processingTime[i][j] = Double.parseDouble(tokens.nextToken());\n }\n }\n } //end try\n catch( Exception e )\n {\n e.printStackTrace();\n System.out.println(e.toString());\n } // end catch\n //System.out.println( \"done\" );\n }", "public void inputForAnalysis() throws IOException\n {\n ArrayList<String> words = new ArrayList<String>(0);\n \n File fileName = new File(\"ciphertext.txt\");\n Scanner inFile = new Scanner(fileName);\n \n int index = 0;\n while(inFile.hasNext())\n {\n words.add(inFile.next());\n index++;\n }\n inFile.close();\n analyze(words);\n }", "public static void main(String[] args) throws IOException {\n\t String FinalContigWritePath=args[0];\n\t\tString ContigAfterPath=args[1];\n\t\tString ContigSPAdesPath=args[2];\n\t\tString MUMmerFile1=args[3];\n\t\tString MUMmerFile2=args[4];\n\t\tint SizeOfContigAfter=CommonClass.getFileLines(ContigAfterPath)/2;\n\t String ContigSetAfterArray[]=new String[SizeOfContigAfter];\n\t int RealSizeOfContigSetAfter=CommonClass.FastaToArray(ContigAfterPath,ContigSetAfterArray); \n\t System.out.println(\"The real size of ContigSetAfter is:\"+RealSizeOfContigSetAfter);\n\t\t//low.\n\t\tint SizeOfContigSPAdes=CommonClass.getFileLines(ContigSPAdesPath);\n\t String ContigSetSPAdesArray[]=new String[SizeOfContigSPAdes+1];\n\t int RealSizeOfContigSetSPAdes=CommonClass.FastaToArray(ContigSPAdesPath,ContigSetSPAdesArray); \n\t System.out.println(\"The real size of ContigSetSPAdes is:\"+RealSizeOfContigSetSPAdes);\n\t\t//Loading After.\n\t\tint LoadingContigAfterCount=0;\n\t\tString LoadingContigAfterArray[]=new String[RealSizeOfContigSetAfter]; \n\t\tfor(int r=0;r<RealSizeOfContigSetAfter;r++)\n\t\t{\n\t\t\t if(ContigSetAfterArray[r].length()>=64)\n\t\t\t {\n\t\t\t\t LoadingContigAfterArray[LoadingContigAfterCount++]=ContigSetAfterArray[r];\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(\"File After loading process end!\");\n\t\t//Alignment1.\n\t\tint SizeOfMUMmerFile1 = CommonClass.getFileLines(MUMmerFile1);\n\t\tString MUMerArray1[] = new String[SizeOfMUMmerFile1];\n\t\tint RealSizeMUMmer1 = CommonClass.FileToArray(MUMmerFile1, MUMerArray1);\n\t\tSystem.out.println(\"The real size of MUMmer1 is:\" + RealSizeMUMmer1);\n\t\t//Alignment.\n\t\tint SizeOfMUMmerFile2 = CommonClass.getFileLines(MUMmerFile2);\n\t\tString MUMerArray2[] = new String[SizeOfMUMmerFile2];\n\t\tint RealSizeMUMmer2 = CommonClass.FileToArray(MUMmerFile2, MUMerArray2);\n\t\tSystem.out.println(\"The real size of MUMmer2 is:\" + RealSizeMUMmer2);\n\t\t//Get ID1.\n\t\tSet<Integer> hashSet = new HashSet<Integer>();\n\t\tfor(int f=4;f<RealSizeMUMmer1;f++)\n\t\t{\n\t\t\tString[] SplitLine1 = MUMerArray1[f].split(\"\\t|\\\\s+\");\n\t\t\tif(SplitLine1.length==14 && (SplitLine1[13].equals(\"[CONTAINS]\") || SplitLine1[13].equals(\"[BEGIN]\") || SplitLine1[13].equals(\"[END]\")))\n\t\t\t{\n\t\t\t\tString[] SplitLine2 = SplitLine1[11].split(\"_\");\n\t\t\t\tint SPAdes_id = Integer.parseInt(SplitLine2[1]);\n\t\t\t\thashSet.add(SPAdes_id);\n\t\t\t}\n\t\t}\n\t\t//Get ID2.\n\t\tfor(int g=4;g<RealSizeMUMmer2;g++)\n\t\t{\n\t\t\tString[] SplitLine11 = MUMerArray2[g].split(\"\\t|\\\\s+\");\n\t\t\tString[] SplitLine12 = SplitLine11[12].split(\"_\");\n\t\t\tint SPAdes_id = Integer.parseInt(SplitLine12[1]);\n\t\t\thashSet.add(SPAdes_id);\n\t\t}\n\t //Write.\n\t\tint LineNum1=0;\n\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t {\n\t\t\t FileWriter writer1= new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t writer1.write(\">\"+(LineNum1++)+\":\"+LoadingContigAfterArray[x].length()+\"\\n\"+LoadingContigAfterArray[x]+\"\\n\");\n\t writer1.close();\n\t }\n\t //Filter.\n\t\tint CountAdd=0;\n\t\tSet<String> HashSetSave = new HashSet<String>();\n\t for(int k=0;k<RealSizeOfContigSetSPAdes;k++)\n\t {\n\t \tif(!hashSet.contains(k))\n\t \t{\n\t \t\tHashSetSave.add(ContigSetSPAdesArray[k]);\n\t \t}\n\t }\n\t\tSystem.out.println(\"The real size of un-useded contigs is:\" + HashSetSave.size());\n\t\t//Write.\n\t\tIterator<String> it = HashSetSave.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tString SPAdesString = it.next();\n\t\t\tint Flag=1;\n\t\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t\t {\n\t\t \tif((LoadingContigAfterArray[x].length()>=SPAdesString.length())&&(LoadingContigAfterArray[x].contains(SPAdesString)))\n\t\t \t{\n\t\t \t\tFlag=0;\n\t\t \t\tbreak;\n\t\t \t}\n\t\t }\n\t\t\tif(Flag==1)\n\t\t\t{\n\t\t\t\tFileWriter writer = new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t\t\t\twriter.write(\">Add:\"+(LineNum1++)+\"\\n\"+SPAdesString+\"\\n\");\n\t\t\t\twriter.close();\n\t\t\t\tCountAdd++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"The real size of add Complementary contigs is:\" + CountAdd);\n\t\tSystem.out.println(\"File write process end!\");\n }", "public ArrayList<BigInteger> read(String fileName) {\n String line = null; // current line from text file\n String[] numbers = null;\n try {\n BufferedReader lineReader = new BufferedReader\n ( (fileName == null || fileName.length() <= 0 || fileName.equals(\"-\"))\n ? new InputStreamReader(System.in)\n : new FileReader(fileName)\n );\n while ((line = lineReader.readLine()) != null) { // read and process lines\n if (! line.matches(\"\\\\s*#.*\") && ! line.matches(\"\\\\s*\")) { // no comment line, no empty line\n numbers = line.trim().split(\"\\\\s+\");\n int last = numbers.length - 1;\n /*\n try {\n int index = Integer.parseInt(numbers[0]);\n } catch (Exception exc) {\n }\n */\n sequence.add(new BigInteger(numbers[last]));\n } else {\n // ignore comment line\n }\n } // while ! eof\n lineReader.close();\n } catch (Exception exc) {\n log.error(exc.getMessage(), exc);\n } // try\n return sequence;\n }", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "private ArrayList<Integer> fileReader() {\n ArrayList<Integer> data = new ArrayList<>();\n try {\n Scanner scanner = new Scanner(new File(\"andmed.txt\"));\n while (scanner.hasNextLine()) {\n data.add(Integer.valueOf(scanner.nextLine()));\n }\n scanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return data;\n }", "private static void readFileIntoArray (String inputFileName) {\n Path path = Paths.get(inputFileName);\n array = new int[countLines(inputFileName)];\n try {\n Scanner sc = new Scanner(path);\n int i = 0;\n while (sc.hasNextLine()) {\n array[i] = Integer.parseInt(sc.nextLine());\n i++;\n }\n sc.close();\n //sort the array\n MergeSort.mergeSort(array);\n }\n catch(FileNotFoundException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\n catch(IOException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\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 Pairs[] getMeanOfGaussionsFromEM(String inputFolderPath, int numOfGaussions) throws Exception\n{\n\tdouble[][] mean = null;\n\tExpectationMaximizationAlgorithm EMA = new ExpectationMaximizationAlgorithm();\n\t//Read all arff files available in inputFolder\n\tFile[] arffFiles = EMA.readAllFiles(inputFolderPath);\n\t\n\tPairs pp[] = new Pairs[arffFiles.length]; \n\t\n\tfor(int i=0;i<arffFiles.length;i++)\n\t{\n\t\tEMA = new ExpectationMaximizationAlgorithm();\n\t\tBufferedReader datafile = EMA.readDataFile(arffFiles[i].getName().toString(),inputFolderPath);\n\t\tSystem.out.println(\"Converting..... : \"+arffFiles[i].getName().toString());\n\t\tInstances data = new Instances(datafile);\n\t\t\n\t\tEM EMObject = new EM();\n\t\tEMObject.setNumClusters(numOfGaussions);\n\t\tEMObject.buildClusterer(data);\n\t\tdouble[][][] attr = EMObject.getClusterModelsNumericAtts();\n\t\tmean = new double[data.numAttributes()][numOfGaussions];\n\t\tdouble[][] variance = new double[data.numAttributes()][numOfGaussions];\n\t\tfor(int j=0;j<numOfGaussions;j++)\n\t\t{\n\t\t\tfor(int k=0;k<data.numAttributes();k++)\n\t\t\t{\n\t\t\t\tmean[k][j]=attr[j][k][0];\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<numOfGaussions;j++)\n\t\t{\n\t\t\tfor(int k=0;k<data.numAttributes();k++)\n\t\t\t{\n\t\t\t\tvariance[k][j]=attr[j][k][1];\n\t\t\t}\n\t\t}\n\t\tpp[i] = new Pairs(arffFiles[i].getName().toString(), mean,variance);\n\t\t\n\t}\n\t\n\treturn pp;\n}", "public Files(){\n this.fileNameArray.add(\"bridge_1.txt\");\n this.fileNameArray.add(\"bridge_2.txt\");\n this.fileNameArray.add(\"bridge_3.txt\");\n this.fileNameArray.add(\"bridge_4.txt\");\n this.fileNameArray.add(\"bridge_5.txt\");\n this.fileNameArray.add(\"bridge_6.txt\");\n this.fileNameArray.add(\"bridge_7.txt\");\n this.fileNameArray.add(\"bridge_8.txt\");\n this.fileNameArray.add(\"bridge_9.txt\");\n this.fileNameArray.add(\"ladder_1.txt\");\n this.fileNameArray.add(\"ladder_2.txt\");\n this.fileNameArray.add(\"ladder_3.txt\");\n this.fileNameArray.add(\"ladder_4.txt\");\n this.fileNameArray.add(\"ladder_5.txt\");\n this.fileNameArray.add(\"ladder_6.txt\");\n this.fileNameArray.add(\"ladder_7.txt\");\n this.fileNameArray.add(\"ladder_8.txt\");\n this.fileNameArray.add(\"ladder_9.txt\");\n }", "public int[] readBasicInfo() throws IOException\n\t{\n\t\t//Creates a FileReader and BufferedReader to read from the file that you pass it\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textReader = new BufferedReader(fr);\n\t\t\n\t\t//Creates a new array to read the first line of data to (is an array because need to convert to int list)\n\t\tString textData;\n\t\t\n\t\t//Reads the first line of the text file into the array\n\t\ttextData = textReader.readLine();\n\t\t\n\t\tint[] data = new int[5];\n\t\t//Create a holding variable that will help to convert the String list over to an int list\n\t\tString[] tempList = new String[6];\n\t\t//List of deliminations that will be parsed out of the read strings in the string list that the function is passed\n\t\tString delims = \"[,()]+\";\n\t\t//Splits the strings from the file by the parenthesis and the commas\n\t\ttempList = textData.split(delims);\n\t\tfor (int i = 1; i < tempList.length; i++)\n\t\t\tdata[i-1] = Integer.parseInt(tempList[i]);\n\t\t\n\t\t//Returns the array containing the first line of the text file\n\t\treturn data;\n\t}", "public double[] importFlowRateDataFile(int pumpDataArraySize, String pumpDataFileName)\n\t{\n\t\tdouble[] pumpData = new double[pumpDataArraySize]; //26 as of first design\n\n\t\t////////////////////\n\t\t//Import file data//\n\t\t////////////////////\n\t\tString pumpDataString = \"\";\n\t\tString line = \"\";\n\t\t//search line by line \n\t\ttry{\n\t\t\tFileReader readFile = new FileReader(pumpDataFileName);\n\t\t\tBufferedReader reader = new BufferedReader(readFile);\n\n\t\t\tpumpDataString = reader.readLine();//reads first line\n\t\t\tpumpDataString = reader.readLine();//reads second line so first line isnt remebered\n\t\t\twhile(line != null)\n\t\t\t{\n\t\t\t\tpumpDataString += line + \"\\n\"; \n\t\t\t\tline = reader.readLine();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Error at 'importPumpDataFile' located in FileWorker: \" + e.toString());\n\t\t}\n\n\t\t//////////////\n\t\t//Parse Data//\n\t\t//////////////\n\t\tString[] stringArray = pumpDataString.split(\"\\n\");\n\t\tfor(int x = 0; x<= pumpDataArraySize-1; x++)\n\t\t{\n\t\t\tpumpData[x] = Double.parseDouble(stringArray[x].split(\"-\")[1]); //get the splitted string array, gets each element, splits and takes the data portion then parses to int and store in final array\n\t\t}\n\n\t\treturn pumpData;\n\t}", "@Override\n protected void process() {\n final List<File> srtFiles = new FileFinder().collect(new File(Constants.FILEFIXER_ROOT_DIR), Constants.SRT_EXTENSION);\n\n // process each file, making a backup first if it is enabled\n for (final File srtFile : srtFiles) {\n System.out.println(\"Processing subtitle file :: \" + srtFile.getName());\n\n if (Constants.MAKE_BACKUPS) {\n backupFile(srtFile);\n }\n\n fix(srtFile);\n }\n }", "public void fileToArrayList(String filename, ArrayList<Task> tasks)\n {\n \tTaskReader reader = new TaskReader();\n tasks.addAll(reader.getArrayFromFile(filename));\n }", "public void enquire_files()\n {\n out.println(\"ENQUIRY\");\n String rd_in = null;\n Matcher m_eom = eom.matcher(\"start\"); // initializing the matcher. \"start\" does not mean anything\n // get filenames till EOM message is received and update the files list\n try\n {\n while(!m_eom.find())\n {\n rd_in = in.readLine();\n m_eom = eom.matcher(rd_in);\n if(!m_eom.find())\n {\n String filename = rd_in;\n cnode.files.add(filename);\n } \n else { break; } // break out of loop when EOM is received\n }\n }\n catch (IOException e) \n {\n \tSystem.out.println(\"Read failed\");\n \tSystem.exit(-1);\n }\n }", "private void initializeFileArrays(){\n File downloadedFilesFolder = new File(MainActivity.DB_PATH);\n File[] files = downloadedFilesFolder.listFiles();\n System.out.println(\"*** \" + files.length + \" ***\");\n if(files != null){\n System.out.println(\"*** \" + files.length + \" ***\");\n for(File f : files){\n if(f != null){\n System.out.println(\"***\\n FILE FOUND - \" + f.getAbsolutePath()+\"\\nSIZE - \" +\n f.length() + \" BYTES \\n***\");\n fileNames.add(f.getName());\n fileSizes.add(f.length()+\"\");\n this.files.add(f);\n }\n }\n }\n }", "protected String[] parseMemoryFiles(String parseString)\n {\n\tVector<String> memFiles = new Vector<String>(10);\n\tStringTokenizer tokenizer = new StringTokenizer(parseString,\",\");\n\twhile (tokenizer.hasMoreTokens())\n\t {\n\t String memFile = tokenizer.nextToken();\n if (memFile.startsWith(\"%\"))\n\t {\n memFile = textSource.getI18NText(memFile,memFile);\n\t\t}\n\t memFiles.add(memFile);\n\t }\n\tObject[] contents = memFiles.toArray();\n\tString[] memStrings = new String[contents.length];\n\tfor (int i = 0; i < contents.length; i++)\n\t memStrings[i] = (String) contents[i];\n\treturn memStrings;\n\t}", "public void readInputFile(){\n no_of_videos = 5;\n video_size = new int [no_of_videos];\n\n }", "private static void jbptTest2() throws FileNotFoundException, Exception {\n\t\tFile folder = new File(\"models\");\n\t\t\n\t\tFile[] arModels = folder.listFiles(new FileUtil().getFileter(\"pnml\"));\n\t\tfor(File file: arModels)\n\t\t{\n\t\t\t//print the file name\n\t\t\tSystem.out.println(\"========\" + file.getName() + \"========\");\n\n\t\t\t//initialize the counter for conditions and events\n\t\t\tAbstractEvent.count = 0;\n\t\t\tAbstractCondition.count = 0;\n\n\t\t\t//get the file path\n\t\t\tString filePrefix = file.getPath();\n\t\t\tfilePrefix = filePrefix.substring(0, filePrefix.lastIndexOf('.'));\n\t\t\tString filePNG = filePrefix + \".png\";\n\t\t\tString fileCPU = filePrefix + \"-cpu.png\";\n\t\t\tString fileNet = filePrefix + \"-cpu.pnml\";\n\n\t\t\tPnmlImport pnmlImport = new PnmlImport();\n\t\t\tPetriNet p1 = pnmlImport.read(new FileInputStream(file));\n\n\t\t\t// ori\n\t\t\t/*ProvidedObject po1 = new ProvidedObject(\"petrinet\", p1);\n\t\t\t\n\t\t\tDotPngExport dpe1 = new DotPngExport();\n\t\t\tOutputStream image1 = new FileOutputStream(filePNG);\n\t\t\t\n\t\t\tdpe1.export(po1, image1);*/\n\n\t\t\tNetSystem ns = PetriNetConversion.convert(p1);\n\t\t\tProperCompletePrefixUnfolding cpu = new ProperCompletePrefixUnfolding(ns);\n\t\t\tNetSystem netPCPU = PetriNetConversion.convertCPU2NS(cpu);\n\t\t\t// cpu\n\t\t\tPetriNet p2 = PetriNetConversion.convert(netPCPU);\n\t\t\t\n\t\t\tProvidedObject po2 = new ProvidedObject(\"petrinet\", p2);\n\t\t\tDotPngExport dpe2 = new DotPngExport();\n\t\t\tOutputStream image2 = new FileOutputStream(fileCPU);\n\t\t\tdpe2.export(po2, image2);\n//\t\t\t\n\t\t\tExport(p2, fileNet);\n//\t\t\t// net\n//\t\t\tNetSystem nsCPU = PetriNetConversion.convertCPU2NS(cpu);\n//\t\t\tPetriNet pnCPU = PetriNetConversion.convertNS2PN(nsCPU);\n//\t\t\tProvidedObject po3 = new ProvidedObject(\"petrinet\", pnCPU);\n//\t\t\tDotPngExport dpe3 = new DotPngExport();\n//\t\t\tOutputStream image3 = new FileOutputStream(fileNet);\n//\t\t\tdpe3.export(po3, image3);\n\t\t}\n\t\t\tSystem.exit(0);\n\t}", "public void addAddFiles( String[] addfiles ) {\n if ( addfiles == null ) {\n return ;\n }\n for ( int i = 0; i < addfiles .length; i++ ) {\n addAddFile( addfiles[i] );\n }\n }", "public ArrayList<ArrayList<String>> readthePathOfMusicFiles()\n {\n File file = new File(path);\n String[] names = file.list();// all directories inside dataset1 direcory\n ArrayList<ArrayList<String>> pathOfMusicFiles = new ArrayList<>();\n String artistName = \"\";\n String trackName = \"\";\n Mp3File song = null;\n for (int i = 0; i < names.length; i++) \n {\n File file1 = new File(path + '/' + names[i]);\n if (file1.isDirectory())\n {\n String[] fileNames = file1.list();\n for (String fileName : fileNames)// all files in directory\n {\n if (fileName.contains(\".mp3\") && !(fileName.charAt(0) == '.'))\n {\n try\n {\n song = new Mp3File(path + '/' + names[i] + '/' + fileName);\n }\n catch (UnsupportedTagException | InvalidDataException | IOException e)\n {\n e.printStackTrace();\n }\n if(song!=null && song.hasId3v1Tag())\n {\n ID3v1 id3v1Tag = song.getId3v1Tag();\n artistName = id3v1Tag.getArtist();\n trackName = id3v1Tag.getTitle();\n }\n if(song!=null && song.hasId3v2Tag())\n {\n ID3v2 id3v2tag = song.getId3v2Tag();\n artistName = id3v2tag.getArtist();\n trackName = id3v2tag.getTitle();\n }\n if(artistName != null && artistName.length() >= 1 && trackName != null && artistName.length() >= 1)\n {\n if(artistName.charAt(0) >= startChar && artistName.charAt(0) <= endChar)\n {\n ArrayList<String> songAttributes = new ArrayList<>();\n songAttributes.add(path + '/' + names[i] + '/' + fileName);\n songAttributes.add(artistName);\n songAttributes.add(trackName);\n pathOfMusicFiles.add(songAttributes);\n }\n }\n }\n }\n }\n }\n return pathOfMusicFiles;\n }", "static int [] readFile() throws IOException {\n\n // Scanner used to get name of file from user\n Scanner in = new Scanner(System.in);\n System.out.println(\"Please enter the name of your file: \");\n String name = in.nextLine();\n\n File file = new File(name); \n \n // Scanner used to read file\n Scanner inputFile = new Scanner(file); \n // reads first line of file for length of array\n int x = inputFile.nextInt();\n\n //Creates array \n int [] scores = new int[x]; \n\n for (int i=0; i<x; i++) {\n int value = inputFile.nextInt();\n scores[i] = value;\n }\n inputFile.close();\n in.close();\n return scores; \n }", "public static boolean[] readAlerts(String path) {\n boolean[] stockArray = new boolean[5];\n\n try {\n File file = new File(sourcePath + path);\n BufferedReader br = new BufferedReader(new FileReader(file));\n\n String line;\n\n while ((line = br.readLine()) != null) {\n int tempLine = Integer.parseInt(line.trim());\n\n switch (tempLine) {\n case 5:\n stockArray[0] = true;\n break;\n case 10:\n stockArray[1] = true;\n break;\n case 20:\n stockArray[2] = true;\n break;\n case 50:\n stockArray[3] = true;\n break;\n case 100:\n stockArray[4] = true;\n break;\n default:\n break;\n }\n }\n\n if (file.delete())\n if (file.createNewFile())\n System.out.println(\"Successful file creation!\");\n else\n System.out.println(\"File already exists!\");\n else\n System.out.println(\"File not deleted!\");\n\n br.close();\n } catch (IOException e) {\n System.out.print(\"File not found!\");\n e.printStackTrace();\n }\n\n return stockArray;\n }", "public static void addOSMFilesToModel(Set<File> files) {\n ArrayList<File> sortedList = sortOsmFiles(files);\n addOSMFilesToModel(sortedList);\n }", "public static List<double[]> readAlpha(File f)\n/* */ throws Exception\n/* */ {\n/* 89 */ throw new Error(\"Unresolved compilation problem: \\n\");\n/* */ }", "private void joinFiles(String[] listFileContent, String filename0)\n\t{\n\t\tSystem.out.println(\"co vao day\");\n\t\tint[] start = new int[nu], next = new int[nu], copyPos = new int[nu];\n\t\tstart = intialStart();\n\t\tArrayList<Double> sumArray;\n\t\ttry {\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(filename0));\n\t\t\twhile (true)//while next1 = find (file1,+1)\n\t\t\t{\n\t\t\t\tnext = findNext(start, listFileContent);//find next\n\t\t\t\tif (checkNotFound(next)) break;\n\t\t\t\tcopyPos = findCopyPos(next);//find copyPos\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*printNam(\"Day la next1: \");System.out.println(next1);\n\t\t\t\tprintNam(\"next2: \"); System.out.println(next2);\n\t\t\t\tprintNam(\"start1: \"); System.out.println(start1);\n\t\t\t\tprintNam(\"start2: \"); System.out.println(start2);\n\t\t\t\tprintNam(\"file: \"); System.out.println(index);*/\n\t\t\t\t//concatString = file1.substring(start1, copyPos1).concat(file2.substring(start2, copyPos2));\n\t\t\t\t\n\t\t\t\tsumArray = genConcatString(listFileContent, start, copyPos);\n\t\t\t\t\n\t\t\t\twriteToFile(out, sumArray);//write to 0.data.\n\t\t\t\t//update start\n\t\t\t\tstart = updateStart(next);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/*sumArray = genConcatString(listFileContent, start);\n\t\t\t\t\n\t\t\twriteToFile(out, sumArray);*/\n\t\t\t\t\n\t\t\tout.close();\n\t\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} \n\t\t\n\t}", "public ArrayList<SoundInfo> readFile(String textFilePath) {\n\t\t\n\t\topenNewProject();\n\t\tprojectFileIO = new XMLReaderWriter(textFilePath);\n\t\t\n\t\t// Read the project file and save its contents to memory\n\t\tArrayList<SoundInfo> readSounds = projectFileIO.readFile();\n\t\tArrayList<Integer> removeSounds = new ArrayList<Integer>();\n\t\tfor (int s=0; s < readSounds.size(); s++) {\n\t\t\tSoundInfo currSound = readSounds.get(s);\n\t\t\tint keyCode = currSound.getKeyCode();\n\t\t\t\n\t\t\tif (!soundList.containsKey(keyCode)) {\n\t\t\t\tsoundList.put(keyCode, currSound);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Two sounds with the same key code were found in the file\n\t\t\t\t// Report this as a read error\n\t\t\t\tremoveSounds.add(s);\n\t\t\t\tcurrSound.close();\n\t\t\t\tprojectModified = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Remove sounds with duplicate key codes from the list\n\t\tfor (int i=0; i < removeSounds.size(); i++) {\n\t\t\tint index = removeSounds.get(i);\n\t\t\treadSounds.remove(index);\n\t\t}\n\t\t\n\t\t// The contents of the project file may have been modified in memory to make the values valid\n\t\tif (projectFileIO.getReadError()) {\n\t\t\tprojectModified = true;\n\t\t}\n\t\t\n return readSounds;\n\t}", "List<File> getSystemDescriptionFiles();", "public static Match[] init () throws FileNotFoundException{\n\n\t\tint numLine = 0;\n\t\t//reads the input file ExchangeRate.txt\n\t\tScanner input1 = new Scanner (new File (\"src/ExchangeRate.txt\"));\n\n\t\t//This loop goes through each line\n\t\twhile (input1.hasNextLine()) {\n\t\t\tinput1.nextLine();\n\t\t\tnumLine++;\n\t\t}\n\n\t\t//Close it in order to start from 0 again for the next loop\n\t\tinput1.close();\n\n\n\t\tMatch [] data = new Match [numLine];\n\t\tint i = 0;\n\t\tScanner input = new Scanner (new File(\"src/ExchangeRate.txt\"));\n\n\t\t//This while loop insures that the program names each section correctly. \n\t\twhile (input.hasNext()) {\n\t\t\tString curr1 = input.next(); //Set curr1 to the first section on the certain line\n\t\t\tString curr2 = input.next(); //Set curr2 to the second section on that same line\n\t\t\tdouble ex = input.nextDouble(); //Set ex to the third section on the same line\n\t\t\t//Sets currency2, currency2, and the exchange rate into an array\n\t\t\tdata[i] = new Match(curr1, curr2, ex);\n\t\t\ti++;\n\t\t}\n\t\tinput.close();\n\t\treturn data;\n\n\t}", "public static int[] buildArray() throws IOException {\r\n\r\n //Variable initializations\r\n int[] intArray = {};\r\n int sumOfElements = 0;\r\n int index = 0;\r\n \r\n //Initialization of File and Scanner objects\r\n \r\n File sumOfIntegers = new File(fileInput);\r\n Scanner elementScanner = new Scanner(sumOfIntegers);\r\n\r\n //Loop that increases the num of array elements by 1 every time\r\n //it acknowledges an integer value within the file and subtracts\r\n //1 from the array elements when the sentinel value is reached.\r\n while (elementScanner.hasNextInt()) {\r\n sumOfElements++;\r\n \r\n \r\n //Assign next int scanner method to x variable\r\n //Used to process if boolean condition\r\n int x = elementScanner.nextInt();\r\n\r\n //When -999 sentinel value is reached reduce num of array elements\r\n //by 1 since we do not want it included\r\n if (x == -999) {\r\n sumOfElements = sumOfElements - 1;\r\n intArray = new int[sumOfElements];\r\n }\r\n //Assign sumOfElements as num of array elements\r\n intArray = new int[sumOfElements]; \r\n\r\n }\r\n\r\n //new scanner to reset abstract cursor of file\r\n elementScanner = new Scanner(sumOfIntegers);\r\n for (index = 0; index < sumOfElements; index++) {\r\n int x = elementScanner.nextInt();\r\n\r\n if (x != -999) {\r\n intArray[index] = x;\r\n }\r\n\r\n }\r\n\r\n //Closes the file/scanner\r\n elementScanner.close();\r\n\r\n return intArray;\r\n }", "public static void readFiles () throws FileNotFoundException{\n try {\n data.setFeatures(data.readFeatures(\"features.txt\"));\n data.setUnknown(data.readFeatures(\"unknown.txt\"));\n data.setTargets(data.readTargets(\"targets.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"Document not found\");\n }\n }", "public ArrayList<String> readFromFile(){\n ArrayList<String> results = new ArrayList<>();\n //Wrap code in a try/ catch to help with exception handling.\n try{\n //Create a object of Scanner class\n Scanner s = new Scanner(new FileReader(path));\n //While loop for iterating thru the file.\n // Reads the data and adds it to the ArrayList.\n while(s.hasNext()) {\n String c1 = s.next();\n String c2 = s.next();\n String w = s.next();\n results.add(c1);\n results.add(c2);\n results.add(w);\n }return results;\n\n }//File not found exception block.\n catch(FileNotFoundException e){\n System.out.println(e);\n }\n return results;//default return.\n }", "private void train() throws IOException {\n\t\thamContent = new String();// the content of ham training files\n\t\tspamContent = new String();// the content of spam training files\n\t\tvocabulary = new ArrayList<String>();// all the\n\t\t\t\t\t\t\t\t\t\t\t\t// vocabulary\n\t\t\t\t\t\t\t\t\t\t\t\t// within\n\t\t\t\t\t\t\t\t\t\t\t\t// training\n\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\thamSenderDomainHash = new HashMap<String, Integer>();\n\t\thamTimeHash = new HashMap<String, Integer>();\n\t\thamReplyHash = new HashMap<String, Integer>();\n\t\thamNonCharNumHash = new HashMap<String, Integer>();\n\t\tspamSenderDomainHash = new HashMap<String, Integer>();\n\t\tspamTimeHash = new HashMap<String, Integer>();\n\t\tspamReplyHash = new HashMap<String, Integer>();\n\t\tspamNonCharNumHash = new HashMap<String, Integer>();\n\n\t\thamWordProb = new HashMap<String, Double>();\n\t\tspamWordProb = new HashMap<String, Double>();\n\t\tclassProb = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < 24; i++) {\n\t\t\thamTimeHash.put(String.valueOf(i), 0);\n\t\t\tspamTimeHash.put(String.valueOf(i), 0);\n\t\t}\n\t\tint numSpam = 0, numHam = 0, numFile = 0;// numbers of training files\n\t\tString buff;// file reading tmp buffer\n\n\t\t/* get all the files in the directory */\n\t\tFile directory = new File(inputDirectory);\n\t\tFile[] files = directory.listFiles();\n\n\t\t/*\n\t\t * assign the content of hams and spams while counting the number of\n\t\t * files\n\t\t */\n\t\tfor (File f : files) {\n\t\t\tif (f.getName().startsWith(\"spam\")) {\n\t\t\t\tString readbuffer = readFile(f, 1);\n\t\t\t\tif (!spamTime.equals(\"-1\")) {\n\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain, 0);\n\t\t\t\t\thamSenderDomainHash.put(spamSenderDomain, 0);\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum, 0);\n\t\t\t\t\thamNonCharNumHash.put(spamNonCharNum, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (f.getName().startsWith(\"ham\")) {\n\t\t\t\tString readbufferString = readFile(f, 0);\n\t\t\t\tif (!hamTime.equals(\"-1\")) {\n\t\t\t\t\tspamSenderDomainHash.put(hamSenderDomain, 0);\n\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain, 0);\n\t\t\t\t\tspamNonCharNumHash.put(hamNonCharNum, 0);\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (File f : files) {\n\t\t\tnumFile++;\n\t\t\t// System.out.println(f.getName());\n\t\t\tif (f.getName().startsWith(\"spam\")) {\n\t\t\t\tnumSpam++; // add to the number of spams\n\t\t\t\tString readbuffer = readFile(f, 1);\n\t\t\t\tif (!spamNonCharNumHash.containsKey(spamNonCharNum))\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum, 1);\n\t\t\t\telse if (spamNonCharNumHash.containsKey(spamNonCharNum))\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum,\n\t\t\t\t\t\t\tspamNonCharNumHash.get(spamNonCharNum) + 1);\n\t\t\t\tif (!spamTime.equals(\"-1\")) {\n\t\t\t\t\tif (!spamSenderDomainHash.containsKey(spamSenderDomain)\n\t\t\t\t\t\t\t&& !(spamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (spamSenderDomain.length() <= 3))\n\t\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain, 1);\n\t\t\t\t\telse if (spamSenderDomainHash.containsKey(spamSenderDomain)\n\t\t\t\t\t\t\t&& !(spamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (spamSenderDomain.length() <= 3))\n\t\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain,\n\t\t\t\t\t\t\t\tspamSenderDomainHash.get(spamSenderDomain) + 1);\n\t\t\t\t\tif (!spamTimeHash.containsKey(spamTime))\n\t\t\t\t\t\tspamTimeHash.put(spamTime, 1);\n\t\t\t\t\telse if (spamTimeHash.containsKey(spamTime))\n\t\t\t\t\t\tspamTimeHash.put(spamTime,\n\t\t\t\t\t\t\t\tspamTimeHash.get(spamTime) + 1);\n\t\t\t\t\tif (!spamReplyHash.containsKey(spamReply))\n\t\t\t\t\t\tspamReplyHash.put(spamReply, 1);\n\t\t\t\t\telse if (spamReplyHash.containsKey(spamReply))\n\t\t\t\t\t\tspamReplyHash.put(spamReply,\n\t\t\t\t\t\t\t\tspamReplyHash.get(spamReply) + 1);\n\n\t\t\t\t}\n\t\t\t\tspamContent += readbuffer.toLowerCase();\n\t\t\t\tspamContent = spamContent.replaceAll(\"[^a-zA-Z$\\n]+\", \" \");\n\n\t\t\t} else if (f.getName().startsWith(\"ham\")) { // the same thing for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ham\n\t\t\t\tnumHam++;\n\t\t\t\tString readbuffer = readFile(f, 0);\n\t\t\t\tif (!hamNonCharNumHash.containsKey(hamNonCharNum))\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum, 1);\n\t\t\t\telse if (hamNonCharNumHash.containsKey(hamNonCharNum))\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum,\n\t\t\t\t\t\t\thamNonCharNumHash.get(hamNonCharNum) + 1);\n\t\t\t\tif (!hamTime.equals(\"-1\")) {\n\t\t\t\t\tif (!hamSenderDomainHash.containsKey(hamSenderDomain)\n\t\t\t\t\t\t\t&& !(hamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (hamSenderDomain.length() <= 3))\n\t\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain, 1);\n\t\t\t\t\telse if (hamSenderDomainHash.containsKey(hamSenderDomain)\n\t\t\t\t\t\t\t&& !(hamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (hamSenderDomain.length() <= 3))\n\t\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain,\n\t\t\t\t\t\t\t\thamSenderDomainHash.get(hamSenderDomain) + 1);\n\n\t\t\t\t\tif (!hamTimeHash.containsKey(hamTime))\n\t\t\t\t\t\thamTimeHash.put(hamTime, 1);\n\t\t\t\t\telse if (hamTimeHash.containsKey(hamTime))\n\t\t\t\t\t\thamTimeHash.put(hamTime, hamTimeHash.get(hamTime) + 1);\n\t\t\t\t\tif (!hamReplyHash.containsKey(hamReply))\n\t\t\t\t\t\thamReplyHash.put(hamReply, 1);\n\t\t\t\t\telse if (hamReplyHash.containsKey(hamReply))\n\t\t\t\t\t\thamReplyHash.put(hamReply,\n\t\t\t\t\t\t\t\thamReplyHash.get(hamReply) + 1);\n\n\t\t\t\t}\n\t\t\t\thamContent += readbuffer.toLowerCase();\n\t\t\t\thamContent = hamContent.replaceAll(\"[^a-zA-Z$\\n]+\", \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"file read complete!!!\");\n\t\t// System.out.println(hamSenderDomainHash);\n\t\t// System.out.println(hamTimeHash);\n\t\t// System.out.println(hamReplyHash);\n\t\t// System.out.println(hamNonCharNumHash);\n\t\t// System.out.println(spamSenderDomainHash);\n\t\t// System.out.println(spamTimeHash);\n\t\t// System.out.println(spamReplyHash);\n\t\t// System.out.println(spamNonCharNumHash);\n\t\t// System.out.println(spamContent);\n\t\t// System.out.println(hamContent);\n\n\t\t/* calculate probabilities */\n\t\tpHam = (double) numHam / (double) numFile;\n\t\tpSpam = (double) numSpam / (double) numFile;\n\t\t// System.out.println(numHam);\n\t\t// System.out.println(numSpam);\n\t\t// System.out.println(numFile);\n\n\t\tclassProb.put(\"hamProb\", pHam);\n\t\tclassProb.put(\"spamProb\", pSpam);\n\n\t\t/* get vocabulary and its length */\n\t\tString[] hamWord = hamContent.split(\"\\\\s+\");\n\t\tHashMap<String, Integer> hamWordFreq = new HashMap<String, Integer>();\n\t\tfor (int i = 0; i < hamWord.length; i++) {\n\t\t\tif (hamWordFreq.containsKey(hamWord[i]))\n\t\t\t\thamWordFreq.put(hamWord[i], hamWordFreq.get(hamWord[i]) + 1);\n\t\t\tif (!hamWordFreq.containsKey(hamWord[i]))\n\t\t\t\thamWordFreq.put(hamWord[i], 1);\n\t\t}\n\t\thamWordCount = hamWord.length;\n\t\tString[] spamWord = spamContent.split(\"\\\\s+\");\n\t\tHashMap<String, Integer> spamWordFreq = new HashMap<String, Integer>();\n\t\tfor (int i = 0; i < spamWord.length; i++) {\n\t\t\tif (spamWordFreq.containsKey(spamWord[i]))\n\t\t\t\tspamWordFreq\n\t\t\t\t\t\t.put(spamWord[i], spamWordFreq.get(spamWord[i]) + 1);\n\t\t\tif (!spamWordFreq.containsKey(spamWord[i]))\n\t\t\t\tspamWordFreq.put(spamWord[i], 1);\n\t\t}\n\t\tspamWordCount = spamWord.length;\n\t\tSystem.out.println(hamWordFreq.size());\n\t\tSystem.out.println(spamWordFreq.size());\n\t\tSystem.out.println(\"count get!!!\");\n\t\t// System.out.println(hamWordCount);\n\t\t// System.out.println(spamWordCount);\n\t\tfor (int i = 0; i < hamWordCount; i++) {\n\t\t\tif (!vocabulary.contains(hamWord[i]) && !hamWord[i].equals(\"\"))\n\t\t\t\tvocabulary.add(hamWord[i]);\n\t\t}\n\t\t// System.out.println(hamWordFreq);\n\t\tfor (int i = 0; i < spamWordCount; i++)\n\t\t\tif (!vocabulary.contains(spamWord[i]) && !spamWord[i].equals(\"\"))\n\t\t\t\tvocabulary.add(spamWord[i]);\n\t\tvocabLen = vocabulary.size();\n\t\tSystem.out.println(\"vocab init\");\n\t\t/* remove unnecessary words */\n\t\tfor (int i = 0; i < vocabulary.size(); i++) {\n\t\t\tint hamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\thamwordFreq = hamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\thamwordFreq = 0;\n\t\t\t}\n\t\t\tint spamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\tspamwordFreq = spamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\tspamwordFreq = 0;\n\t\t\t}\n\t\t\tif ((hamwordFreq <= 3) && (spamwordFreq <= 3)) {\n\t\t\t\tvocabulary.remove(i);\n\t\t\t\ti--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (((double) ((double) hamwordFreq / (double) hamWordCount) >= 0.005)\n\t\t\t\t\t&& ((double) ((double) spamwordFreq / (double) spamWordCount) >= 0.005)) {\n\t\t\t\t// System.out.println(vocabulary.get(i));\n\t\t\t\tvocabulary.remove(i);\n\t\t\t\ti--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"vocab complete!!!\");\n\t\tSystem.out.println(vocabulary.size());\n\t\tvocabLen = vocabulary.size();\n\t\tfor (int i = 0; i < vocabulary.size(); i++) {\n\t\t\tint hamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\thamwordFreq = hamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\thamwordFreq = 0;\n\t\t\t}\n\t\t\tint spamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\tspamwordFreq = spamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\tspamwordFreq = 0;\n\t\t\t}\n\t\t\thamWordProb.put(\n\t\t\t\t\tvocabulary.get(i),\n\t\t\t\t\tjava.lang.Math.log((double) (hamwordFreq + 1)\n\t\t\t\t\t\t\t/ (double) (hamWordCount + vocabLen)));\n\t\t\tspamWordProb.put(\n\t\t\t\t\tvocabulary.get(i),\n\t\t\t\t\tjava.lang.Math.log((double) (spamwordFreq + 1)\n\t\t\t\t\t\t\t/ (double) (spamWordCount + vocabLen)));\n\t\t\t// System.out.println(i);\n\n\t\t}\n\t\t// System.out.println(hamWordCount);\n\t\t// System.out.println(hamContent);\n\t\t// System.out.println(hamWordProb.size());\n\t\t// System.out.println(spamWordProb.size());\n\t\t// System.out.println(vocabulary.size());\n\t\t//\n\t\t// System.out.println(hamWordProb.size());\n\t\t// System.out.println(vocabulary);\n\t\t// System.out.println(vocabLen);\n\t\tSystem.out.println(\"word prob complete!!!\");\n\t}", "public static ArrayList<Point> ReadData(String filePath) throws FileNotFoundException{\n \n ArrayList<Point> points = new ArrayList<>();\n\n Scanner inputStream = new Scanner(new File(filePath));\n\n String[] xs = inputStream.nextLine().split(\" \");\n String[] ys = inputStream.nextLine().split(\" \");\n\n int min = Math.min(xs.length, xs.length);\n\n for(int i = 0 ;i < min; i++){\n double x = Float.parseFloat(xs[i]);\n double y = Float.parseFloat(ys[i]);\n points.add(new Point(x,y));\n }\n\n\n\n return points;\n\n }", "public static void convertToWav(Map<String, String> filesToConvert)\n throws IOException {\n Process proc = null;\n String cmd = \"\";\n // If output location does not exist, create a directory\n File dir = new File(Constants.OUTPUT_FILE_LOCATION);\n if (!dir.exists()) dir.mkdir();\n for (Map.Entry<String, String> entry : filesToConvert.entrySet()) {\n cmd =\n Constants.LAME_LOCATION + Constants.SPACE\n + Constants.LAME_DECODE + Constants.SPACE\n + entry.getKey() + Constants.SPACE + entry.getValue();\n try {\n // Attach the process to execute the command\n proc = Runtime.getRuntime().exec(cmd);\n // Keep polling the errorStream of the spawned\n // process for any data:\n StreamReaderThread errorStreamReaderThread =\n new StreamReaderThread(proc.getErrorStream());\n // Keep polling the OutputStream of the spawned\n // process for any data:\n StreamReaderThread outputStreamReaderThread =\n new StreamReaderThread(proc.getInputStream());\n // Start the threads to poll the streams\n errorStreamReaderThread.start();\n outputStreamReaderThread.start();\n // Wait until the process has terminated\n proc.waitFor();\n } catch (Exception e) {}\n }\n }", "private static void addOSMFilesToModel(ArrayList<File> files) {\n if (files.size() < 1) {\n return;\n }\n for (File f : files) {\n String absPath = f.getAbsolutePath();\n // Don't add something that is either in progress\n // or already on the map.\n if (persistedOSMFiles.contains(absPath)) {\n continue;\n }\n ++totalFiles;\n persistedOSMFiles.add(absPath);\n File xmlFile = new File(absPath);\n OSMMapBuilder builder = new OSMMapBuilder(false);\n builder.executeOnExecutor(LARGE_STACK_THREAD_POOL_EXECUTOR, xmlFile);\n }\n setupProgressDialog(mapActivity);\n mapActivity.getMapView().invalidate();\n updateSharedPreferences();\n }", "private File[] getFiles() {\n\n if (mPPTFilePath == null) {\n mPPTFilePath = getArguments().getString(PPTPathString);\n }\n\n String Path = mPPTFilePath;\n File mFile = new File(Path);\n if (mFile.exists() && mFile.isDirectory() && mFile.listFiles()!=null) {\n\n return mFile.listFiles();\n } else {\n Log.d(TAG, \"File==null\");\n return null;\n }\n }", "public void pushData() {\n\t\t\tFile file = new File(Environment.getExternalStorageDirectory()\n\t\t\t\t\t.getAbsolutePath()\n\t\t\t\t\t+ \"/reverseme.pcm\");\n\t\t\t// Get the length of the audio stored in the file (16 bit so 2 bytes\n\t\t\t// per short)\n\t\t\t// and create a short array to store the recorded audio.\n\t\t\tint audioLength = (int) (file.length() / 2);\n\t\t\taudio = new short[audioLength];\n\n\t\t\ttry {\n\t\t\t\t// Create a DataInputStream to read the audio data back from the\n\t\t\t\t// saved file.\n\t\t\t\tInputStream is = new FileInputStream(file);\n\t\t\t\tBufferedInputStream bis = new BufferedInputStream(is);\n\t\t\t\tDataInputStream dis = new DataInputStream(bis);\n\n\t\t\t\t// Read the file into the music array.\n\t\t\t\tint i = 0;\n\t\t\t\twhile (dis.available() > 0) {\n\t\t\t\t\taudio[i] = dis.readShort();\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// Close the input streams.\n\t\t\t\tdis.close();\n\n\t\t\t} catch (Throwable t) {\n\t\t\t\tLog.e(\"AudioTrack\", \"Playback Failed\");\n\t\t\t}\n\t\t}", "public static void createArrays() {\n\t\tinitArrays();\n\t\tcreateNodeTable();\n\t\tcreateEdgeTables();\n\t\t// Helper.Time(\"Read File\");\n\t\tcreateOffsetTable();\n\t}", "private void gatherFile(FileStatus[] fstat)\r\n\t{\r\n\t inputSize = 0;\t\r\n\t paths = new Path[fstat.length];\t\r\n\t for(int i=0;i<fstat.length;i++)\r\n\t {\r\n\t inputSize+=fstat[i].getLen();\r\n\t paths[i] = fstat[i].getPath();\r\n\t }\r\n\t }", "private static List<String[]> process(String[] files) {\n String path = files[0];\n List<String[]> list = new ArrayList<String[]>();\n for (int i = 1, j = 0; i < files.length; i++) {\n String name = files[i];\n for (j = 0; j < name.length(); j++) {\n if (name.charAt(j) == '('){\n break;\n }\n }\n list.add(new String[]{path+\"/\"+name.substring(0, j), name.substring(j+1, name.length() - 1)});\n }\n \n return list;\n }", "public static void main(String[] args) {\n FilesParser filesParser = new FilesParser();\r\n ArrayList<Double> time = filesParser.get_timeList();\r\n Map<Double, ArrayList<Double>> expFile = new HashMap<>();\r\n ArrayList<Map<Double, ArrayList<Double>>> theorFiles = new ArrayList<>();\r\n\r\n try {\r\n expFile = filesParser.trimStringsAndGetData(0,\r\n filesParser.getDirectories()[0],\r\n filesParser.get_expFiles()[2]);\r\n List<String> fileList = filesParser.get_theorFileList();\r\n for (int i = 0; i < fileList.size(); i++) {\r\n theorFiles.add(filesParser.trimStringsAndGetData(1,\r\n filesParser.getDirectories()[1],\r\n filesParser.get_theorFileList().get(i)));\r\n }\r\n //System.out.println(expFile.get(0.00050));\r\n //System.out.println(expFile.get(-0.25));\r\n //System.out.println(expFile);\r\n //System.out.println(theorFiles.get(0.00050));\r\n //System.out.println(theorFiles);\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n /*for (int i = 0; i < theorFiles.size(); i++) {\r\n Map<Double, ArrayList<Double>> theorFile = theorFiles.get(i);\r\n for (int ik = 0; ik < time.size(); ik++) {\r\n ArrayList<Double> theorFileLine = theorFile.get(time.get(ik));\r\n if (theorFileLine != null) {\r\n for (int j = 0; j < theorFileLine.size(); j++) {\r\n double theord = theorFileLine.get(j);\r\n for (int k = 0; k < expFile.size(); k++) {\r\n ArrayList<Double> expFileLine = expFile.get(time.get(ik));\r\n if (expFileLine != null) {\r\n for (int l = 0; l < expFileLine.size(); l++) {\r\n double expd = expFileLine.get(l);\r\n\r\n double div = expd / theord;\r\n if (div == 1) System.out.println(i);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }*/\r\n\r\n }", "private static void loadFiles(String[] files) throws IOException {\n\t\tfor(String file : files){\n\n\t\t\t//Create reader for the file\n\t\t\tBufferedReader fileReader = new BufferedReader(new FileReader(file));\n\n\t\t\t//Create HashMap to store words and counts\n\t\t\tHashMap<String,WordCount> fileWordCounts = new HashMap<String,WordCount>();\n\t\t\tArrayList<String> sentences = new ArrayList<String>();\n\n\t\t\t//While the file still has more lines to be read from\n\t\t\twhile(fileReader.ready()){\n\n\t\t\t\t//Read a line from the file\n\t\t\t\tString fileLine = fileReader.readLine();\n\t\t\t\t//Add the line to file sentences\n\t\t\t\tsentences.add(fileLine);\n\t\t\t\t//Split the file and remove punctuation from words\n\t\t\t\tString[] fileWords = fileLine.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n\n\t\t\t\t//iterate through all words in each line\n\t\t\t\tfor (String word : fileWords)\n\t\t\t\t{\n\t\t\t\t\tWordCount count = fileWordCounts.get(word);\n\t\t\t\t\t//If word is not in file, add it \n\t\t\t\t\tif (count == null) {\n\t\t\t\t\t\tfileWordCounts.put(word,new WordCount(word));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcount.inc(); //If not, increment it\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t//Add file to fileDatabase \n\t\t\tfileDatabase.map.put(file, new FileObject(file, fileWordCounts, sentences));\n\n\t\t\tfileReader.close(); // Close File\n\n\t\t}//End of For Loop reading from all files\n\t}", "public void plzreadDataFiles(){\n\n //This line opens the file and returns an Input Stream data type\n InputStream itemIs = getResources().openRawResource(R.raw.card_data);\n\n //Read the file line by line\n BufferedReader reader = new BufferedReader(new InputStreamReader(itemIs, Charset.forName(\"UTF-8\")));\n\n //Initialize a var to track the line of the file being read in\n String line =\"\";\n\n // error proofing if the file is weird\n try {\n int i = 0;\n int k = 0;\n while ((line = reader.readLine()) != null){\n //split data by commas into an array of strings\n String[] token = line.split(\",\");\n\n itemArray[i] = new itemInfo();\n\n //Read the data\n itemArray[i].setCardType(token[0]);\n itemArray[i].setCardName(token[1]);\n itemArray[i].setItemType(token[2]);\n itemArray[i].setFrontText(token[3]);\n itemArray[i].setRearText(token[4]);\n itemArray[i].setDuration(token[5]);\n\n\n // Create a list of ITEM names for the autocomplete\n if ((itemArray[i].getCardType().intern()) == (\"Common Item\")){\n //itemSearchArray[i] = token[1];\n itemsOnlyList[k] = token[1];\n k = k + 1;\n }\n\n else if ((itemArray[i].getCardType().intern()) == (\"Unique Item\")){\n //itemSearchArray[i] = token[1];\n itemsOnlyList[k] = token[1];\n k = k + 1;\n }\n\n else if ((itemArray[i].getCardType().intern()) == (\"Spell\")){\n //itemSearchArray[i] = token[1];\n itemsOnlyList[k] = token[1];\n k = k + 1;\n }\n\n //Check that the damage column has a number in it, and write it in\n if (token[5].intern() != \"-\"){\n itemArray[i].setDamage(Integer.parseInt(token[5]));\n }\n else{\n //Set it to zero if the dash is detected\n itemArray[i].setDamage(0);\n }\n itemArray[i].setDuration(token[6]);\n\n i = i + 1;\n\n Log.d(\"My Activity\", \"Just added: \"+itemArray[i]);\n }\n\n } catch (IOException e) {\n Log.wtf(\"MyActivity\",\"Error reading data file on line\"+line,e);\n e.printStackTrace();\n }\n }", "public Vector loadExpressionFiles() throws IOException {\r\n \tif(isAnnotationSelected()) {\r\n \t\t\r\n \t\tthis.mav.getData().setAnnotationLoaded(true);\r\n\t\t\tFile annoFile=new File(getAnnotationFilePath());\r\n\t\t\tString extension=(annoFile.getName()).substring((annoFile.getName()).lastIndexOf('.')+1, annoFile.getName().length());\r\n\t\t\t\r\n\t\t\tif(annoFile.getName().endsWith(\"annot.csv\")){\r\n\t\t\t\t//System.out.println(\"Ends with annot.csv\");\r\n\t\t\t\tAffymetrixAnnotationParser aafp = AffymetrixAnnotationParser.createAnnotationFileParser(new File(getAnnotationFilePath()));\r\n\t\t\t\t_tempAnno = aafp.getAffyAnnotation();\r\n\t\t\t\t//chipAnno = aafp.getAffyChipAnnotation();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif(extension.equalsIgnoreCase(\"txt\")){\r\n\t\t\tAnnotationFileReader afr = AnnotationFileReader.createAnnotationFileReader(new File(getAnnotationFilePath()));\r\n\t\t\t_tempAnno = afr.getAffyAnnotation();\r\n\t\t\tchipAnno = afr.getAffyChipAnnotation();\r\n\t\t\t}\r\n \t\t \t\r\n }\r\n\r\n return loadAffyGCOSExpressionFile(new File(this.sflp.selectedFiles.getText()));\r\n }", "static ArrayList<String> loadShop() {\n //check directory, create if missing\n File dir = new File(\"./plugins/SkyblockShop/\");\n if (!dir.exists()) {if (!dir.mkdir()) { System.out.println(\"Failed to create SkyblockShop directory!\");}}\n\n //create fullShop to return all retrieved files\n ArrayList<String> fullShop = new ArrayList<>();\n\n //iterate through all files in directory and add them to fullShop\n File[] files = dir.listFiles();\n if (files != null) {\n for (File file : files) {\n if (file.getName().endsWith(\".txt\")) {\n fullShop.addAll(loadShop(file));\n }\n }\n }\n\n return fullShop;\n }", "private void getCal() {\n \t\t\n \t\tif(isnew) {\n \t\t\tString[] parts0, parts1, parts2, parts3, parts4, parts5, parts6;\n \t\t\t\n \t\t\tparts0 = asciiheader[9].split(\"\\t\");\n \t\t\tparts1 = asciiheader[10].split(\"\\t\");\n \t\t\tparts2 = asciiheader[11].split(\"\\t\");\n \t\t\tparts3 = asciiheader[12].split(\"\\t\");\n \t\t\tparts4 = asciiheader[13].split(\"\\t\");\n \t\t\tparts5 = asciiheader[14].split(\"\\t\");\n \t\t\tparts6 = asciiheader[15].split(\"\\t\");\n \t\t\t\n \t\t\tfor(int i = 0; i < 3; i++) {\n \t\t\t\tRGBcal[i] = Float.parseFloat(parts0[i]);\n \t\t\t\tvlam[i] = Float.parseFloat(parts1[i]);\n \t\t\t\tvp[i] = Float.parseFloat(parts2[i]);\n \t\t\t\tmel[i] = Float.parseFloat(parts3[i]);\n \t\t\t\tvmac[i] = Float.parseFloat(parts4[i]);\n \t\t\t\tsmac[i] = Float.parseFloat(parts5[i]);\n \t\t\t\tCLAcal[i] = Float.parseFloat(parts6[i]);\n \t\t\t}\n \t\t\tCLAcal[3] = Float.parseFloat(parts6[3]);\n \t\t\treturn;\n \n \t\t}\n \t\t\n \t\tint temp = 0;\n \t\tint j = 0;\n \t\tString workingDirectory = new String(System.getProperty(\"user.dir\")+ \"\\\\src\\\\data\");\n \t\t\n \t\tString[] s = loadStrings(workingDirectory + \"\\\\Day12_Cal_Values.txt\");\n \t\t\n \n \t\t//Scone/macula\n \t\tfor(int i = 0; i < s[1].length(); i++) {\n \t\t\tif(s[1].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\t//smac[j] = float(s[1].substring(temp, i));\n \t\t\t\t\tsmac[j] = Float.parseFloat(s[1].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t\t}\n \t\tsmac[j] = Float.parseFloat(s[1].substring(temp, s[1].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//Vlamda/macula\n \t\tfor(int i = 0; i < s[2].length(); i++) {\n \t\t\tif(s[2].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tvmac[j] = Float.parseFloat(s[2].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t\t}\n \t\tvmac[j] = Float.parseFloat(s[2].substring(temp, s[2].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//Melanopsin\n \t\tfor(int i = 0; i < s[3].length(); i++) {\n \t\t\tif(s[3].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tmel[j] = Float.parseFloat(s[3].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t}\n \t\tmel[j] = Float.parseFloat(s[3].substring(temp, s[3].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//Vprime\n \t\tfor(int i = 0; i < s[4].length(); i++) {\n \t\t\tif(s[4].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tvp[j] = Float.parseFloat(s[4].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t\t}\n \t\tvp[j] = Float.parseFloat(s[4].substring(temp, s[4].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//Vlamda\n \t\tfor(int i = 0; i < s[5].length(); i++) {\n \t\t\tif(s[5].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tvlam[j] = Float.parseFloat(s[5].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t\t}\n \t\tvlam[j] = Float.parseFloat(s[5].substring(temp, s[5].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//CLA\n \t\tfor(int i = 0; i < s[8].length(); i++) {\n \t\t\tif(s[8].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tCLAcal[j] = Float.parseFloat(s[8].substring(temp, i));\n \t\t\t\t\tj++;\n \t\t\t\t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t\t}\n \t\tCLAcal[j] = Float.parseFloat(s[8].substring(temp, s[8].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \n \t\t//RGBcal\n \t\ts = loadStrings(workingDirectory + \"\\\\Day12 RGB Values.txt\");\n \t\tfor(int i = 0; i < s[ID].length(); i++) {\n \t\t\tif(s[ID].charAt(i) == 9) {\n \t\t\t\tif(temp != 0) {\n \t\t\t\t\tRGBcal[j] = Float.parseFloat(s[ID].substring(temp, i));\n \t\t\t\t\tj++;\n \t}\n \t\t\t\ttemp = i;\n \t\t\t}\n \t}\n \t\tRGBcal[j] = Float.parseFloat(s[ID].substring(temp, s[ID].length()));\n \t\ttemp = 0;\n \t\tj = 0;\n \t}", "String [][] importData (String path);", "@SuppressWarnings(\"unchecked\")\n public ArrBag( String infileName ) throws Exception\n {\n count = 0; // i.e. logical size, actual number of elems in the array\n BufferedReader infile = new BufferedReader( new FileReader( infileName ) );\n while ( infile.ready() )\n this.add( (T) infile.readLine() );\n infile.close();\n }", "public void processRaw(String rawfilepath){\n\t\tbyte tempbyte[] = new byte[131072];\n\t\ttempbyte = loadBytes(rawfilepath);\n\t\tfor (int i=0; i < header.length; i++){\n\t\t\theader[i]= tempbyte[i];\n\t\t}\n\t\tfor (int i = 0; i < EEPROM.length;){\n\t\t\tEEPROM[i] = tempbyte[i+1024];\n\t\t}\n\t\torganizeEEPROM();\n\t\tprocessData();\n\t\tsavefile();\n\t}", "public static void main(String[] args) {\r\n\t\tList<String> tracklist = TracklistCreator.readTrackList(\"work\\\\all_wav.txt\");\r\n\t\tint filesProcessed = 0;\r\n\t\tfor (String wavFilePath : tracklist) {\r\n\t\t\ttry {\r\n\t\t\t\tString track = StringUtils.substringAfterLast(wavFilePath, File.separator);\r\n\t\t\t\tString beatFilePath = TARGET_DIR + track + PathConstants.EXT_BEAT;\r\n\t\t\t\tnew VampBeatTimesProvider(wavFilePath, beatFilePath, new Configuration().pre);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t if (++filesProcessed % 10 == 0) {\r\n\t \tLOG.info(filesProcessed + \" files were processed\");\r\n\t }\r\n\t\t}\r\n\t\tLOG.info(\"Done. \" + filesProcessed + \" files were saved to '\" + TARGET_DIR + \"'\");\r\n\t}", "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tString s = sc.nextLine();\r\n\t\t\t\t\t// If we come across an article, read its contents and add it to the file.\r\n\t\t\t\t\tif(s.startsWith(\"@ARTICLE{\")) {\r\n\t\t\t\t\t\tauthor = journal = title = year = volume = number = pages = doi = ISSN = month = \"\";\r\n\t\t\t\t\t\twhile (!s.equals(\"}\")) {\r\n\t\t\t\t\t\t\ts = sc.nextLine();\r\n\t\t\t\t\t\t\tparseValue(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Throw an exception if a field is missing.\r\n\t\t\t\t\t\tif (author.isEmpty() || journal.isEmpty() || title.isEmpty() || year.isEmpty() || volume.isEmpty() \r\n\t\t\t\t\t\t\t\t|| number.isEmpty() || pages.isEmpty() || doi.isEmpty() || ISSN.isEmpty() || month.isEmpty()) {\r\n\t\t\t\t\t\t\tthrow new FileInvalidException(\"One or more fields are missing.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add the article to the file if valid.\r\n\t\t\t\t\t\tString author1 = author.replaceAll(\" and\", \",\");\r\n\t\t\t\t\t\tint andIndex = author.indexOf(\"and\");\r\n\t\t\t\t\t\tString author2 = andIndex != -1 ? author.replaceAll(author.substring(andIndex,author.length()), \"et al\") : author;\r\n\t\t\t\t\t\tString author3 = author.replaceAll(\"and\", \"&\");\r\n\t\t\t\t\r\n\t\t\t\t\t\t// IEEE\r\n\t\t\t\t\t\toutWriters[i][0].println(author1+\". \\\"\"+title+\"\\\", \"+journal+\", vol. \"+volume+\", no. \"+number+\", p. \"+pages+\", \"+month+\" \"+year+\".\\r\\n\");\r\n\t\t\t\t\t\t// ACM\r\n\t\t\t\t\t\toutWriters[i][1].println(\"[\"+articleCount+\"]\\t\"+author2+\". \"+year+\". \"+title+\". \"+journal+\". \"+volume+\", \"+number+\" (\"+year+\"), \"+pages+\". DOI:https://doi.org/\"+doi+\".\\r\\n\");\r\n\t\t\t\t\t\t// NJ\r\n\t\t\t\t\t\toutWriters[i][2].println(author3+\". \"+title+\". \"+journal+\". \"+volume+\", \"+pages+\"(\"+year+\").\\r\\n\");\r\n\t\t\t\t\t\tarticleCount++;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t// Close output writers once file has been read.\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t}\r\n\t\t\t\tnumValidFiles++;\r\n\t\t\t}\r\n\t\t\t// If file is invalid, close and delete the output files.\r\n\t\t\tcatch (FileInvalidException e) {\r\n\t\t\t\tSystem.out.println(\"Error: Detected Empty Field!\" \r\n\t\t\t\t\t\t + \"\\n============================\"\r\n\t\t\t + \"\\nProblem detected with input file: Latex\" + (i + 1) + \".bib\"\r\n\t\t\t\t\t\t + \"\\nFile is invalid: \" + e.getMessage() + \" Processing stopped at this point. \"\r\n\t\t\t\t\t\t + \"Other empty/missing fields may be present as well.\\n\");\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t\toutFiles[i][j].delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Close input file after reading.\r\n\t\t\tsc.close();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> numbers = new ArrayList<>();\n\t\tint sum = 0;\n\t\ttry {\n\t\t\tfor (String line : Files.readAllLines(Paths.get(\"C:/My Workspace/R_W_Text_file/src/read.txt\"))) {\n\t\t\t\tfor (String part : line.split(\"\\\\s+\")) {\n\t\t\t\t\tInteger i = Integer.valueOf(part);\n\t\t\t\t\tnumbers.add(i);\n\t\t\t\t\tsum = sum + i;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ArrayList<WordMap> countWordOccurrences(String filePaths, WordMap corpus,\n Word.Polarity polarity) {\n\n Scanner sc1, sc2;\n ArrayList<WordMap> wordMaps = new ArrayList<WordMap>();\n\n // Where the training texts are located\n String subFolder;\n if (polarity == Word.Polarity.POSITIVE) subFolder = FOLDER_POSITIVE;\n else if (polarity == Word.Polarity.NEGATIVE) subFolder = FOLDER_NEGATIVE;\n else subFolder = FOLDER_NEUTRAL;\n\n try {\n String previousWord = \"\";\n\n sc1 = new Scanner(new File(filePaths));\n\n //For each training file\n while (sc1.hasNextLine()) {\n // Contains one filename per row\n String currentFile = FOLDER_TXT + subFolder + sc1.nextLine();\n\n sc2 = new Scanner(new File(currentFile));\n WordMap textMap = new WordMap(); // Map for this text\n\n while (sc2.hasNextLine()) {\n String[] words = sc2.nextLine().split(\" \");\n\n for (int j = 0; j < words.length; j++){\n //Replaces all characters which might cause us to miss the key\n String word = words[j].replaceAll(\"\\\\W\", \"\");\n\n //For each word, if it is in the WordMap increment the count\n if (corpus.has(word)) {\n // Store a new word if it has not been created\n if (!textMap.has(words[j])) {\n Word objWord = copyWord(corpus.get(word));\n textMap.put(word, objWord);\n }\n\n //If the words are negated, flip the count\n if (polarity == Word.Polarity.POSITIVE &&\n negations.contains(previousWord)) { // Negate\n textMap.addCountNegative(word);\n } else if (polarity == Word.Polarity.POSITIVE) {\n textMap.addCountPositive(word);\n } else if (polarity == Word.Polarity.NEGATIVE &&\n negations.contains(previousWord)) { // Negate\n textMap.addCountPositive(word);\n } else if (polarity == Word.Polarity.NEGATIVE) {\n textMap.addCountNegative(word);\n } else { // Neutral, don't negate\n textMap.addCountNeutral(word);\n }\n }\n\n previousWord = word;\n }\n }\n\n wordMaps.add(textMap);\n\n sc2.close();\n }\n\n sc1.close();\n } catch (Exception e) {\n System.err.println(\"Error in countWordOccurences\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n return null;\n }\n\n return wordMaps;\n }", "private void parseFiles() throws ParserException{\n NodeList fileNodesList = root.getElementsByTagName(\"file\");\n for(int i=0; i<fileNodesList.getLength(); i++){\n filesToProcess.add(getFile((Element) fileNodesList.item(i)));\n }\n }", "private void extractLibraryData( final ArrayList librarys,\n final ArrayList fileset )\n throws TaskException\n {\n if( !fileset.isEmpty() )\n {\n final Extension[] extensions = getExtensions( fileset );\n for( int i = 0; i < extensions.length; i++ )\n {\n librarys.add( extensions[ i ] );\n }\n }\n }", "private static ArrayList m5336a(File[] fileArr) {\n ArrayList arrayList = new ArrayList();\n int i = 0;\n while (i < fileArr.length) {\n if (fileArr[i].isFile() && fileArr[i].getName().length() == 10 && TextUtils.isDigitsOnly(fileArr[i].getName())) {\n arrayList.add(fileArr[i]);\n }\n i++;\n }\n return arrayList;\n }", "public static void main(String... av) throws Exception {\n\n\t\tif (av.length == 0) {\n\t\t\tthrow new IllegalArgumentException(\"Usage: pca FILES...\");\n\t\t}\n\n\t\tfor (String filename : av) {\n\t\t\ttry (DataReader dr = new DataReader(new FileReader(filename + \".data\"))) {\n\t\t\t\tdouble[] data = dr.getData();\n\t\t\t\tSystem.out.println(filename + \": vector length = \" + data.length);\n\n\t\t\t\tPCACoreHandler handler = new PCACoreHandler();\n\t\t\t\tPCACore pca = handler.fromSimpleTimeSeries(data);\n\n\t\t\t\tlog(filename + \"_pcomps.data\", filename + \": principle components\", pca.getPrincipalComponents());\n\t\t\t\tlog(filename + \"_lambda.data\", filename + \": lambda\", pca.getLambda());\n\t\t\t\tlog(filename + \"_pfacs.data\", filename + \": principle factors\", pca.getPrinicipalFactors());\n\n\t\t\t\tMatrix cc = handler.correlationCircle(pca);\n\t\t\t\tlog(filename + \"_cc.data\", filename + \": correlation circle\", cc);\n\n\t\t\t\tMatrix cumcon = handler.cumulativeContribution(pca);\n\t\t\t\tlog(filename + \"_cumcon.data\", filename + \": cumulative contributions\", cumcon);\n\t\t\t}\n\t\t}\n\t}", "private AupWaveTrack readWaveTrack(XMLStreamReader reader, Map<String, File> projectAudioFiles) throws XMLStreamException, UnsupportedAudioFileException, IOException {\n\t\tAupWaveTrack wavetrack = new AupWaveTrack(super.mTransformer);\n\t\t//get the stated rate on the wavetrack element, this since the au files headers seem to be locked 44100 regardless of actual\n\t\tString rate = reader.getAttributeValue(null, \"rate\");\n\t\twhile(reader.hasNext()) {\n\t\t\treader.next();\n\t\t\tif(reader.isEndElement() && reader.getLocalName().equals(\"wavetrack\")) {\n\t\t\t\tbreak;\n\t\t\t}else if(reader.isStartElement()) {\n\t\t\t\t//Note: we are only aware of simpleblockfile at this time\n\t\t\t\tif(reader.getLocalName().equals(\"simpleblockfile\")) {\n\t\t\t\t\tFile file = null;\n\t\t\t\t\tString len = \"unset\";\n\t\t\t\t\tfor (int i = 0; i < reader.getAttributeCount(); i++) {\n\t\t\t\t\t\tif(reader.getAttributeName(i).getLocalPart().equals(\"filename\")) {\n\t\t\t\t\t\t\tString filename = reader.getAttributeValue(i);\n\t\t\t\t\t\t\tfile = projectAudioFiles.get(filename);\n\t\t\t\t\t\t\tif(file==null) throw new FileNotFoundException(file.getAbsolutePath());\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(reader.getAttributeName(i).getLocalPart().equals(\"len\")) {\n\t\t\t\t\t\t\tlen = reader.getAttributeValue(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\twavetrack.add(new AupBlockFile(file,len,rate,super.mTransformer));\t\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t}\n\t\treturn wavetrack;\n\t}" ]
[ "0.6194019", "0.5927496", "0.5710768", "0.56035817", "0.55440855", "0.52651185", "0.5216804", "0.5209081", "0.51714736", "0.51558506", "0.5140903", "0.5125931", "0.51069903", "0.5082565", "0.5065659", "0.50633043", "0.5038315", "0.50272447", "0.5000327", "0.4996693", "0.4984484", "0.49651578", "0.49504176", "0.49438342", "0.49408308", "0.49392536", "0.49220276", "0.4920401", "0.49186322", "0.4912651", "0.4911648", "0.49086136", "0.48901954", "0.48517126", "0.48511672", "0.48479423", "0.4834818", "0.4830837", "0.4825401", "0.48082465", "0.48063755", "0.48059303", "0.48048243", "0.47860357", "0.47546643", "0.47541988", "0.4753991", "0.47537842", "0.47499207", "0.47412676", "0.4740891", "0.47383577", "0.47361353", "0.47324243", "0.47282192", "0.4712652", "0.4709754", "0.47070122", "0.4706028", "0.47023222", "0.46959963", "0.46926332", "0.46745002", "0.4666737", "0.46613184", "0.4660974", "0.46603182", "0.46527967", "0.46511632", "0.46510515", "0.46366936", "0.46351582", "0.46344277", "0.46274456", "0.4626686", "0.46137786", "0.4608205", "0.4605288", "0.4603352", "0.4602481", "0.459796", "0.45971316", "0.4596547", "0.4595725", "0.45921534", "0.4592007", "0.45898288", "0.4587027", "0.45838395", "0.4581341", "0.45803508", "0.45777887", "0.45691395", "0.4568425", "0.45666742", "0.45634902", "0.4562748", "0.45610625", "0.45593107", "0.4557858" ]
0.5392958
5
Method to add spectrum to proper array and update mass ranges
public void addSpectrum(LibrarySpectrum spectrum) { librarySpectra.add(spectrum); if (spectrum.precursor > maxMass) maxMass = spectrum.precursor; if (spectrum.precursor < minMass) minMass = spectrum.precursor; spectrum.scaleIntensities(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addSpectrum(Spectrum spectrum) {\n add(spectrum);\n }", "private static GeneralMassSpectrum calculateSpectrumFromBasisSpectra(final List<GeneralMassSpectrum> isotopeSpectrums,\n\t\t\tfinal int maxValues, final double minValue, final int charge, final int adduct, final Polarity polarity,\n\t\t\tfinal int numAdducts) {\n\t\tassert isotopeSpectrums.size() > 0;\n\t\t\n\t\tclass StackInformation {\n\t\t\tGeneralMassSpectrum basisSpectrum;\n\t\t\tint isotopeIndex;\n\t\t\tdouble probAccum;\n\t\t\tdouble massAccum;\n\t\t\t\n\t\t\tStackInformation(GeneralMassSpectrum basisSpectrum, int isotopeIndex, double probAccum, double massAccum) {\n\t\t\t\tthis.basisSpectrum = basisSpectrum;\n\t\t\t\tthis.isotopeIndex = isotopeIndex;\n\t\t\t\tthis.probAccum = probAccum;\n\t\t\t\tthis.massAccum = massAccum;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfinal GeneralMassSpectrum retval = new GeneralMassSpectrum(maxValues, numAdducts);\n\t\t\n\t\tfinal Deque<StackInformation> workingSpectra = new ArrayDeque<StackInformation>();\n\t\tfinal Deque<GeneralMassSpectrum> basisSpectra = new ArrayDeque<GeneralMassSpectrum>(isotopeSpectrums);\n\n\t\tfinal StackInformation initialElement = new StackInformation(basisSpectra.pop(), 0, 1.0, 0.0);\n\t\tworkingSpectra.push(initialElement);\n\n\t\twhile ( ! workingSpectra.isEmpty() ) {\n\t\t\tfinal StackInformation info = workingSpectra.peek();\n\t\t\tfinal GeneralMassSpectrum basisSpectrum = info.basisSpectrum;\n\t\t\tif ( info.isotopeIndex == basisSpectrum.size() ) {\n\t\t\t\tworkingSpectra.pop();\n\t\t\t\tbasisSpectra.push(basisSpectrum);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal double newProb = info.probAccum * basisSpectrum.getDistribution(info.isotopeIndex);\n\t\t\tdouble newMass = info.massAccum + basisSpectrum.getMass(info.isotopeIndex);\n\n\t\t\tinfo.isotopeIndex++;\n\t\t\tif ( newProb >= minValue ) {\n\t\t\t\tif ( workingSpectra.size() == isotopeSpectrums.size() ) {\n\t\t\t\t\t// We are at the bottom level, add the peak\n\t\t\t\t\tnewMass -= charge * PeriodicTable.electronmass;\n\t\t\t\t\tnewMass /= Math.abs(charge);\n\t\t\t\t\tfinal List<GeneralMolecularFormula> forms = new ArrayList<GeneralMolecularFormula>();\n\t\t\t\t\tfor ( StackInformation s : workingSpectra ) {\n\t\t\t\t\t\tforms.add(s.basisSpectrum.getIsotopicFormula(s.isotopeIndex - 1));\n\t\t\t\t\t}\n\n\t\t\t\t\tfinal GeneralMolecularFormula compositeGmf = GeneralMolecularFormula.mergeFormulae(forms);\n\t\t\t\t\tretval.add(newMass, newProb, adduct, polarity, compositeGmf);\n\t\t\t\t} else {\n\t\t\t\t\tfinal StackInformation newElement = new StackInformation(basisSpectra.pop(), 0, newProb, newMass);\n\t\t\t\t\tworkingSpectra.push(newElement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn retval;\n\t}", "public void setMass(Bounds[] bounds)\n\t{\n\t\tfloat mass = 0;\n\t\tfor (Bounds b : bounds) {\n\t\t\tmass += b.getOvalArea();\n\t\t}\n\t\tthis.mass = mass;\n\t}", "@Override\n\tpublic void process(TimeStamp startTime, TimeStamp endTime, float[] spectrum) {\n\t\tint numBins = maxBin - minBin;\n\t\t// 1. check to see if we need to create a new previousSpectrum cache\n\t\tif (lastBlockSize != spectrum.length) {\n\t\t\t// 2. calculate min and maxBin\n\t\t\tcalcMaxAndMinBin(spectrum.length);\n\n\t\t\t// 3. create a new spectrum cache of the appropriate size\n\t\t\tnumBins = maxBin - minBin;\n\t\t\tif (numBins > 0)\n\t\t\t\tpreviousSpectrum = new float[numBins];\n\n\t\t\tlastBlockSize = spectrum.length;\n\t\t}\n\n\t\tif (numBins > 0) {\n\t\t\tswitch (differenceType) {\n\t\t\tcase POSITIVERMS:\n\t\t\t\tfeatures = positiveRms(spectrum, minBin, previousSpectrum, 0,\n\t\t\t\t\t\tnumBins);\n\t\t\t\tbreak;\n\t\t\tcase RMS:\n\t\t\t\tfeatures = rms(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase POSITIVEMEANDIFFERENCE:\n\t\t\t\tfeatures = positiveMeanDifference(spectrum, minBin,\n\t\t\t\t\t\tpreviousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase MEANDIFFERENCE:\n\t\t\t\tfeatures = meanDifference(spectrum, minBin, previousSpectrum,\n\t\t\t\t\t\t0, numBins);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// finally copy the current spectrum\n\t\t\tSystem.arraycopy(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t}\n\t\tforward(startTime, endTime);\n\t}", "public void binMasses()\n\t{\n\t\t//Create arrays\n\t\tcreateBins(calcArraySize(massBinSize,minMass, maxMass));\n\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\t//Populate count array to correctly initialize array size for positive library spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tcountBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;\n\t\t\t}\n\t\t\tupdateProgress(17,\"% - Creating Composite Library\",true);\n\n\t\t\t//Use count bin to initialize new arrays to place positive spectra into hash table\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tmassBin[i] = new LibrarySpectrum[countBin[i]];\n\t\t\t}\n\t\t\tupdateProgress(33,\"% - Creating Composite Library\",true);\n\n\n\t\t\t//Populate spectrum arrays for positive spectra\n\t\t\tfor (int i=0; i<librarySpectra.size(); i++)\n\t\t\t{\n\t\t\t\tmassBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]\n\t\t\t\t\t\t[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);\n\t\t\t\taddedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;\n\t\t\t}\n\t\t\tupdateProgress(50,\"% - Creating Composite Library\",true);\n\t\t}\n\t}", "private void fillArrays(){\n\t\tdouble tIncrement = (endT-startT) / (double)plotPoints;\n\t\t\n\t\t//burn in\n\t\tfor(int i=0; i<burnIn; i++){\n\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\tising.update();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k=0; k<plotPoints+1 && !simulationThread.isInterrupted(); k++){\n\t\t\tising.reset();\n\t\t\tising.setTemperature(startT + k*tIncrement);\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<sweeps; i++){\n\t\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\t\tising.update();\n\t\t\t\t}\n\t\t\t\tising.updateSums();\n\t\t\t}\n\t\t\t\n\t\t\t//add values to arrays\n\t\t\ttemp[k] = ising.getTemperature();\n\t\t\t\n\t\t\t\n\t\t\tif(this.plotM){\n\t\t\t\tabsM[k] = ising.averageAbsM();\n\t\t\t\tsusceptibility[k][0] = ising.susceptibility();\n\t\t\t\tsusceptibility[k][1] = ising.errorSusceptibility();\n\t\t\t}\n\t\t\tif(this.plotE){\n\t\t\t\tE[k] = ising.averageE();\n\t\t\t\theatCapacity[k][0] = ising.heatCapacity();\n\t\t\t\theatCapacity[k][1] = ising.errorHearCapacity();\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t}", "public void parseMZArray(SampleSpectrum spec) throws CustomException\n\t{\n\t\tdouble[] values;\n\t\tbyte[] decoded = Base64.getDecoder().decode(mzArray);\n\t\tByteBuffer byteBuffer = ByteBuffer.wrap(decoded);\n\t\tbyteBuffer.order(ByteOrder.BIG_ENDIAN);\n\t\t\n\n\t\tvalues = new double[byteBuffer.asDoubleBuffer().capacity()];\n\t\tbyteBuffer.asDoubleBuffer().get(values);\n\t\t\n\t\tif (values.length % 2 > 0)\n\t\t\tthrow new CustomException(\"Different number of m/z and intensity values encountered in peak list.\", null);\n\t\t\n\t\tfor (int peakIndex = 0; peakIndex < values.length - 1; peakIndex += 2)\n\t\t{\n\t\t\tDouble mz = values[peakIndex];\n\t\t\tDouble intensity = values[peakIndex + 1];\n\t\t\tspec.addFrag(mz, intensity);\n\t\t}\n\t}", "double calculateGLBasicMass(int i1, int i2, int i3)\n {\n\n // Array of Glycerolipid's num of Carbon, Hydrogen repeated (for SN1 Dropdown Menu's values)\n int[] arrayGL_sn1 = {\n 5,10, 7,14, 9,18, 11,22, 13,26, 15,30, 16,32, 17,34,\n 17,32, 18,36, 18,34, 19,40, 19,38, 19,38, 19,36, 20,40,\n 20,38, 20,36, 21,44, 21,42, 21,42, 21,40, 21,40, 21,38,\n 21,36, 21,36, 21,34, 22,44, 23,48, 23,46, 23,46, 23,44,\n 23,42, 23,40, 23,38, 23,36, 24,48, 25,50, 25,48, 25,46,\n 25,44, 25,42, 25,40, 25,38, 26,52, 27,54, 27,52, 28,56, 29,58};\n\n // addCarbon array: Amount of increase in Carbon when on certain sn2 & sn3 index position\n int[] addCarbon = {\n 0, 2, 4, 6, 8, 10, 12, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17,\n 18, 18, 18, 18, 18, 18, 18, 19, 20, 20, 20, 20,\t20,\t20, 21, 22,\n 22,\t22,\t22,\t22, 22, 22, 23, 24, 24, 25, 26 };\n\n // addHydrogen array: Amount of increase in Hydrogen when on certain sn2 & sn3 index position\n int[] addHydrogen = {\n 0, 2, 6, 10, 14, 18, 22, 24, 26, 24, 28, 26, 30, 28, 32, 30, 28,\n 34,\t32,\t32,\t30,\t28,\t28,\t26,\t36,\t38,\t36,\t34,\t32,\t30,\t28,\t40,\t42,\n 40,\t38,\t36,\t34,\t32,\t30,\t44,\t46,\t44,\t48,\t50 };\n\n // Get the # of C & H depending on the index position of SN1's dropdown menu\n int numOfC = arrayGL_sn1[i1 * 2], numOfH = arrayGL_sn1[i1 * 2 + 1];\n\n // Add carbon & hydrogen depending on SN2 and SN3 dropdown menu's index position\n numOfC = numOfC + addCarbon[i2] + addCarbon[i3];\n numOfH = numOfH + addHydrogen[i2] + addHydrogen[i3];\n\n /* Set Number of Carbon & Hydrogen */\n setNumC(numOfC); setNumH(numOfH);\n\n /* Set Number of Oxygen */\n\n // If SN1 Dropdown index is not O or P\n if (i1 != 11 && i1 != 12 && i1 != 18 && i1 != 19 && i1 != 28 && i1 != 29) {\n\n if (i2 == 0 && i3 == 0){ setNumO(4); }\n else if (i2 == 0 || i3 == 0) { setNumO(5); }\n else setNumO(6);\n\n // If SN1 Dropdown index is O or P\n } else {\n\n if (i2 == 0 && i3 == 0){ setNumO(3); }\n else if (i2 == 0 || i3 == 0) { setNumO(4); }\n else setNumO(5);\n }\n\n // Sets the basic mass based on the elemental composition of the monoisotopic distribution\n setMass(calculateInitialMass(getNumC(), getNumH(), getNumO(), getNumN(), getNumAg(),\n getNumLi(), getNumNa(), getNumK(), getNumCl(), getNumP(), getNumS(), getNumF()));\n\n // Return basic mass\n return getMass();\n }", "public void createBins(int arraySize)\n\t{\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\tcountBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\t\t\taddedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\n\t\t\t//Fill all positive bins with zeroes\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tcountBin[i] = 0;\n\t\t\t\taddedBin[i] = 0;\n\t\t\t}\n\n\t\t\t//Create the array to store the actual spectra objects\n\t\t\tmassBin = new LibrarySpectrum[arraySize][];\n\t\t}\n\t}", "public void matchLibrarySpectra(SampleSpectrum ms2, Double massBinSize, Double ms1Tol, Double ms2Tol)\n\t{\n\t\tDouble dotProd = 0.0;\n\t\tDouble reverseDotProd = 0.0;\n\n\t\tif (minMass < 9998.0 && ms2.precursor<maxMass && ms2.precursor>minMass)\n\t\t{\n\t\t\t//Scale MS2s to maximum peak in spectra (0-1000) and remove peaks below .5%\n\t\t\tms2.scaleIntensities();\n\n\t\t\t// Find range of mass bins which need to be searched\n\t\t\tint minIndex = findBinIndex(findMinMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\t\t\tint maxIndex = findBinIndex(findMaxMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);\n\n\t\t\tif (minIndex<0) minIndex = 0;\n\t\t\tif (maxIndex>(massBin.length-1)) maxIndex = massBin.length-1;\n\n\t\t\t//Iterate through this mass bin range\n\t\t\tfor (int i=minIndex; i<=maxIndex; i++)\n\t\t\t{\n\t\t\t\t//If the bin contains library spectra\n\t\t\t\tif (countBin[i]>0)\n\t\t\t\t{\n\t\t\t\t\t//For all spectra which are in the same mass bin\n\t\t\t\t\tfor (int j=0; j<addedBin[i]; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (Math.abs(massBin[i][j].precursor-ms2.precursor)<ms1Tol)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Calculate the dot product (spectral similarity) between the two spectra \n\t\t\t\t\t\t\tdotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,false, massWeight, intWeight);\n\t\t\t\t\t\t\treverseDotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,true, massWeight, intWeight);\n\n\t\t\t\t\t\t\tif (dotProd>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Add identification to array\n\t\t\t\t\t\t\t\tms2.addID(massBin[i][j], dotProd, reverseDotProd,ms2Tol);\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\n\t\t\t//Sort by dot product\n\t\t\tCollections.sort(ms2.idArray);\n\t\t}\n\t}", "public void setMeasurementArray(){\n\t\tnResults = rt.size();\n\t\tData = new double[4][nResults];\n\t\tfor(int i =1; i<nResults; i++) {\n\t\t\tData[0][i]=i;\n\t\t\tData[1][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Mean\"),i); \n\t\t\tData[2][i]=rt.getValueAsDouble(rt.getColumnIndex(\"StdDev\"),i);\n\t\t\tData[3][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Max\"),i)-rt.getValueAsDouble(rt.getColumnIndex(\"Min\"),i);\n\t\t}\n\t\treturn;\n\t}", "public abstract float[] calcIntensityScaleExtrema(float maxRI, float minRI,\n float maxRaw, float minRaw,\n int sampleNbr);", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "public void updateSMA(){\n audioInput.read(audioBuffer, 0, bufferSize);\n Complex [] FFTarr = doFFT(shortToDouble(audioBuffer));\n FFTarr = bandPassFilter(FFTarr);\n double sum = 0;\n for(int i = 0; i<FFTarr.length;i++){\n sum+=Math.abs(FFTarr[i].re()); // take the absolute value of the FFT raw value\n }\n double bandPassAverage = sum/FFTarr.length;\n Log.d(LOGTAG, \"bandPassAverage: \" + bandPassAverage);\n\n //Cut out loud samples, otherwise compute rolling average as usual\n if(bandPassAverage>THROW_OUT_THRESHOLD){\n mySMA.compute(mySMA.currentAverage());\n }else {\n mySMA.compute(bandPassAverage);\n }\n }", "@Override\n\tpublic void addToSamples(short[] data) throws SoundOverflowException {\n\t\tfor (int i = 0; i < data.length; ++i) {\n\t\t\tdouble scale = 1.0;\n\t\t\tif (i < RAMPUP_SAMPLES) {\n\t\t\t\tscale = (double) i / (double) RAMPUP_SAMPLES;\n\t\t\t}\n\t\t\telse if (i > data.length - RAMPUP_SAMPLES) {\n\t\t\t\tscale = (double) (data.length - i) / (double) RAMPUP_SAMPLES;\n\t\t\t}\n\n\t\t\tdouble v = compute(i) * scale * amplitude;\n\t\t\t\n\t\t\tif (Short.MAX_VALUE - v < data[i]) { \n\t\t\t\tthrow new SoundOverflowException();\n\t\t\t}\n\t\t\t\n\t\t\tif (Short.MIN_VALUE + v > data[i]) {\n\t\t\t\tthrow new SoundOverflowException();\n\t\t\t}\n\t\t\tdata[i] += Math.round(v);\n\t\t}\n\t}", "public void addSpectrumMatch(SpectrumMatch sm) {\r\n id2index.put(sm.getSpectrumId(), spectrumMatches.size());\r\n spectrumMatches.add(sm);\r\n }", "private List<SpectrumInterface> fetchSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\tif (spectrumIds == null)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tsetSpectrumIdsTarget(spectrumIds);\r\n\t\t/*\r\n\t\t * Reset spectrum data.\r\n\t\t */\r\n\t\tint nSpectra = spectrumIds.size();\r\n\t\tspectrumArray = new SpectrumImpl[nSpectra];\r\n\t\t\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t\r\n\t\t/*\r\n\t\t * Create list of mass and intensity data and get dataLength as side\r\n\t\t * result.\r\n\t\t */\r\n\t\tint dataLength = 0;\r\n\t\tList<Double> peakMassData = new ArrayList<Double>();\r\n\t\tList<Double> peakIntensityData = new ArrayList<Double>();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\tfloat basePeakIntensity = 0, totalIntensity = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tspectrumTagsFound = 0;\r\n\t\t\tinTargetSpectrumBlock = false;\r\n\t\t\tString line;\r\n\t\t\tint lineNo = 0;\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\tif (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * New spectrum\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"New spectrum: numberOfSpectra = \" + numberOfSpectra);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if data for previous peak list has been collected.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif (inTargetSpectrumBlock)\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\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * Reset peak list data.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tdataLength = 0;\r\n\t\t\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add spectrum id to list if not already in it.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!getSpectrumIdsFound().contains(currentSpectrumIdStr))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Check if desired spectrum id found.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tspectrumIndex = -1;\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (currentSpectrumIdStr.equals(getSpectrumIdsTarget().get(i)))\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\t * Save information in order to get\r\n\t\t\t\t\t\t\t * spectrum mass and intensity values.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tsetCurrentSpectrumId(currentSpectrumIdStr);\r\n\t\t\t\t\t\t\tinTargetSpectrumBlock = true;\r\n\t\t\t\t\t\t\tspectrumIndex = i;\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get new spectrum object to store retrieved data in.\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tSpectrumImpl currentSpectrum = SpectrumImpl.buildSpectrum(); // changed slewis to allow class to change\r\n\t\t\t\t\t\t\tsetSpectrum(currentSpectrum);\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + spectrumIndex + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" found.\");\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * Get spectrum header data from PKL file\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\ttotalIntensity = 0;\r\n\t\t\t\t\t\t\tbasePeakIntensity = 0;\r\n\t\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\t\t\tFloat massToChargeRatio = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tFloat intensity = Float.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\tInteger chargeState = Integer.valueOf(st.nextToken());\r\n\t\t\t\t\t\t\t// Store spectrum header values from PKL file\r\n\t\t\t\t\t\t\t//log.debug(\"SpectrumId = \\\"\" + getCurrentSpectrumId() + \"\\\" massToChargeRatio = \" + massToChargeRatio + \" intensity = \" + intensity + \" chargeState = \" + chargeState);\r\n\t\t\t\t\t\t\tSpectrumPrecursor spectrumPrecursor = SpectrumPrecursor.buildSpectrumPrecursor(); // changed slewis to support overrides\r\n\t\t\t\t\t\t\tspectrumPrecursor.setMassToChargeRatio(massToChargeRatio.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setIntensity(intensity.doubleValue());\r\n\t\t\t\t\t\t\tspectrumPrecursor.setCharge(chargeState);\r\n\t\t\t\t\t\t\tList<SpectrumPrecursor> precursors = new ArrayList<SpectrumPrecursor>();\r\n\t\t\t\t\t\t\tprecursors.add(spectrumPrecursor);\r\n\t\t\t\t\t\t\tgetSpectrum().setPrecursors(precursors);\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 (inTargetSpectrumBlock && line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Collect data for peak.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\r\n\t\t\t\t\tdouble peakMass = Double.valueOf(st.nextToken());\r\n\t\t\t\t\tdouble peakIntensity = Double.valueOf(st.nextToken());\r\n\t\t\t\t\t//log.debug(\"Spectra line (\" + lineNo + \") = \\\"\" + line + \"\\\", peakMass = \" + peakMass + \" peakIntensity = \" + peakIntensity);\r\n\t\t\t\t\tpeakMassData.add(dataLength, peakMass);\r\n\t\t\t\t\tpeakIntensityData.add(dataLength, peakIntensity);\r\n\t\t\t\t\tdataLength++;\r\n\t\t\t\t\t// Update statistical spectrum values\r\n\t\t\t\t\tif (peakIntensity > basePeakIntensity)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePeakIntensity = (float) peakIntensity;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttotalIntensity += peakIntensity;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Other line\r\n\t\t\t\t\t */\r\n\t\t\t\t\t//log.debug(\"Unidentified line (\" + lineNo + \") = \\\"\" + line + \"\\\"\");\r\n\t\t\t\t}\r\n\t\t\t\tlineNo++;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Check if data for peak list has been collected.\r\n\t\t\t */\r\n\t\t\tif (numberOfSpectra > 0)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * Save peak data for previous peak list.\r\n\t\t\t\t */\r\n\t\t\t\tif (inTargetSpectrumBlock)\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Add retrieved spectrum data to all elements\r\n\t\t\t\t\t * in result list corresponding to current spectrum ids.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tfor (int i = 0; i < getSpectrumIdsTarget().size(); i++) {\r\n\t\t\t\t\t\tif (getCurrentSpectrumId().equals(getSpectrumIdsTarget().get(i)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Convert spectrum data arrays\r\n\t\t\t\t\t\t\tif (dataLength > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdouble peakMassArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tdouble peakIntensityArray[] = new double[dataLength];\r\n\t\t\t\t\t\t\t\tfor (int k = 0; k < dataLength; k++)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tpeakMassArray[k] = peakMassData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t\tpeakIntensityArray[k] = peakIntensityData.get(k).doubleValue();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tgetSpectrum().setMass(peakMassArray);\r\n\t\t\t\t\t\t\t\tgetSpectrum().setIntensities(peakIntensityArray);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tspectrumArray[i] = getSpectrum();\r\n\t\t\t\t\t\t\tspectrumTagsFound++;\r\n\t\t\t\t\t\t\tlog.debug(\"SpectrumId (\" + i + \") = \\\"\" + getCurrentSpectrumId() + \"\\\" processed, spectrumTagsFound = \" + spectrumTagsFound);\r\n\t\t\t\t\t\t\tlog.debug(\"-----------------------------------------------\");\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\tinTargetSpectrumBlock = false;\r\n\t\t\t\t/*\r\n\t\t\t\t * Reset peak list data.\r\n\t\t\t\t */\r\n\t\t\t\tdataLength = 0;\r\n\t\t\t\tpeakMassData = new ArrayList<Double>();\r\n\t\t\t\tpeakIntensityData = new ArrayList<Double>();\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Return result of search for PKL spectra.\r\n\t\t\t */\r\n\t\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>(nSpectra);\r\n\t\t\tfor (int i = 0; i < nSpectra; i++)\r\n\t\t\t{\r\n\t\t\t\tspectrumList.add(i, spectrumArray[i]);\r\n\t\t\t}\r\n\t\t\treturn spectrumList;\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\tthrow new BaseException(message);\r\n\t\t}\r\n\t}", "public void updateSamples();", "@Override\n void updateRealDistribution() {\n ArrayList<Integer> realDistribution = new ArrayList<>(numberOfBars);\n for (int i = 0; i < numberOfBars; i++)\n realDistribution.add(i, 0);\n for (Atom atom : atoms) {\n int barIndex = (int)Math.floor((HEIGHT - atom.y) / resolution);\n if (barIndex < 0 || barIndex >= numberOfBars)\n continue;\n realDistribution.set(barIndex, realDistribution.get(barIndex) + 1);\n }\n\n a = 2 * boltzmannAcceleration / meanSquareSpeed();\n\n ArrayList<Double> xData = new ArrayList<>();\n ArrayList<Double> yData = new ArrayList<>();\n for (int i = 0; i < numberOfBars; i++) {\n xData.add((double)i * resolution);\n xData.add((double)(i + 1) * resolution);\n yData.add((double)realDistribution.get(i));\n yData.add((double)realDistribution.get(i));\n }\n n0 = (int)(realDistribution.get(0) / resolution);\n updateDistribution();\n xyChart.updateXYSeries(\"Экспериментальное распределние\", xData, yData, null);\n }", "private void resizeBatteryArrays(int newSize) {\n if(newSize != mNumBatteries) {\n mNumBatteries = newSize;\n Float[] tempVoltages = new Float[mNumBatteries];\n Integer[] tempStatuses = new Integer[mNumBatteries];\n for (int i = 0; i < (mNumBatteries < mBatteryVoltages.length ? mNumBatteries : mBatteryVoltages.length); i++) {\n tempVoltages[i] = mBatteryVoltages[i];\n tempStatuses[i] = mBatteryStatuses[i];\n }\n if (mNumBatteries > mBatteryVoltages.length) {\n for (int j = mBatteryVoltages.length; j < mNumBatteries; j++) {\n tempVoltages[j] = DEFAULT_BATT_VOLTAGE;\n tempStatuses[j] = 0;\n }\n }\n mBatteryVoltages = tempVoltages;\n mBatteryStatuses = tempStatuses;\n mAdapter = new BatteryAdapter(mBatteryVoltages, mBatteryStatuses);\n recyclerView.setAdapter(mAdapter);\n recyclerView.postInvalidate();\n }\n }", "private void updatePointArray(\n\t\t\tJInternalFrame heart, JInternalFrame cal, JInternalFrame min, JInternalFrame sed)\n\t{\n\t\t\n\t\tPoint heartRateFramePoint = heart.getLocation();\n\t\tPoint calBurnFramePoint = cal.getLocation();\n\t\tPoint activeMinFramePoint = min.getLocation();\n\t\tPoint sedMinFramePoint = sed.getLocation();\n\t\t\n\t\tthis.setPointArray(heartRateFramePoint, calBurnFramePoint, activeMinFramePoint, sedMinFramePoint);\n\t\t\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "private void declareArrays() {\n int iNumTimesteps = m_oLegend.getNumberOfTimesteps(),\n i, j, k;\n \n //Create arrays to hold raw data.\n mp_fLiveTreeVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fSnagVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses]; \n mp_iLiveTreeCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_iSnagCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fLiveTreeDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fSnagDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fTallestLiveTrees = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n mp_fTallestSnags = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n \n //Initialize all values with 0s\n for (i = 0; i < mp_fTallestLiveTrees.length; i++) {\n for (j = 0; j < mp_fTallestLiveTrees[i].length; j++) {\n for (k = 0; k < mp_fTallestLiveTrees[i][j].length; k++) {\n mp_fTallestLiveTrees[i][j][k] = 0;\n mp_fTallestSnags[i][j][k] = 0;\n }\n }\n }\n \n for (i = 0; i < m_iNumSpecies; i++) {\n for (j = 0; j <= iNumTimesteps; j++) {\n mp_fLiveTreeDBHTotal[i][j] = 0;\n mp_fSnagDBHTotal[i][j] = 0;\n for (k = 0; k < m_iNumSizeClasses; k++) {\n mp_iLiveTreeCounts[i][j][k] = 0;\n mp_iSnagCounts[i][j][k] = 0;\n mp_fLiveTreeVolumeTotals[i][j][k] = 0;\n mp_fSnagVolumeTotals[i][j][k] = 0;\n }\n }\n }\n }", "private void setSteine() {\n\t\tfor(int i = 0; i<mulden.length; i++) {\n\t\t\tmulden[i] = 5;\n\t\t}\n\t}", "@Override\n\tprotected void uGenerate(float[] channels) \n\t{\n\t\tif (!isActivated)\n\t\t{\n\t\t\tArrays.fill( channels, begAmp );\n\t\t} \n\t\telse if (lineNow >= lineTime)\n\t\t{\n\t\t\tArrays.fill( channels, endAmp );\n\t\t} \n\t\telse \n\t\t{\n\t\t\tamp += ( endAmp - amp )*timeStepSize/( lineTime - lineNow );\n\t\t\t//Minim.debug(\" dampTime = \" + dampTime + \" begAmp = \" + begAmp + \" amp = \" + amp + \" dampNow = \" + dampNow);\n\t\t\tArrays.fill( channels, amp );\n\t\t\tlineNow += timeStepSize;\n\t\t}\n\t}", "protected void setValues() {\n values = new double[size];\n int pi = 0; // pixelIndex\n int siz = size - nanW - negW - posW;\n int biw = min < max ? negW : posW;\n int tiw = min < max ? posW : negW;\n double bv = min < max ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n double tv = min < max ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n double f = siz > 1 ? (max - min) / (siz - 1.) : 0.;\n for (int i = 0; i < biw && pi < size; i++,pi++) {\n values[pi] = bv;\n }\n for (int i = 0; i < siz && pi < size; i++,pi++) {\n double v = min + i * f;\n values[pi] = v;\n }\n for (int i = 0; i < tiw && pi < size; i++,pi++) {\n values[pi] = tv;\n }\n for (int i = 0; i < nanW && pi < size; i++,pi++) {\n values[pi] = Double.NaN;\n }\n }", "public void updateOscilloscopeData() {\n rmsSum = 0;\n boolean overshoot = false;\n int reactorFrequency = getReactorFrequency().intValue();\n int reactorAmplitude = getReactorAmplitude().intValue();\n double reactorPhase = getReactorPhase().doubleValue();\n int controlFrequency = getControlFrequency().intValue();\n int controlAmplitude = getControlAmplitude().intValue();\n double controlPhase = getControlPhase().doubleValue();\n for (int i = 0; i < 40; i++) { \n Double reactorValue = reactorAmplitude * Math.sin(2 * Math.PI * reactorFrequency * ((double) i * 5 / 10000) + reactorPhase);\n Double controlValue = controlAmplitude * Math.sin(2 * Math.PI * controlFrequency * ((double) i * 5 / 10000) + controlPhase);\n if (reactorValue + controlValue > 150) {\n this.outputData.get(0).getData().get(i).setYValue(149);\n overshoot = true;\n } else if (reactorValue + controlValue < -150) {\n this.outputData.get(0).getData().get(i).setYValue(-149);\n overshoot = true;\n } else {\n this.outputData.get(0).getData().get(i).setYValue(reactorValue + controlValue);\n }\n if (this.online == true) {\n this.rmsSum = this.rmsSum + Math.pow(reactorValue + controlValue, 2);\n }\n }\n calculateOutputPower();\n checkForInstability(overshoot);\n }", "public void AddToArray(Balanza mimaterial) {\n this.list.add(mimaterial);\n\n }", "void patchArray(long array[][], long scale)\n {\n // patch all numbers up by 100 to keep the order but to rid the negative\n // numbers\n for (int i = 0; i < array.length; i++)\n {\n array[i][0] += scale;\n array[i][1] += scale;\n }\n }", "private void resampleAbdomenVOI() {\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\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 && curve.contains(x, y)) {\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 = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\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 && curve.contains(x, y)) {\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 = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\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 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\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 && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), 0 ) );\r\n }\r\n }", "public void updateValues() {\n\t\tlightResistances = new float[width][height];\n\t\twalls = new boolean[width][height];\n\n\t\tfor (int x = 0; x < width; x++) {\n\t\t\tfor (int y = 0; y < height; y++) {\n\t\t\t\tlightResistances[x][y] = map[x][y].getLighting();\n\t\t\t\twalls[x][y] = map[x][y].isWall();\n\t\t\t}\n\t\t}\n\t}", "void setSpeedsArray(int i, org.landxml.schema.landXML11.SpeedsDocument.Speeds speeds);", "private void processSound() {\r\n if (!isEnabled) {\r\n return;\r\n }\r\n\r\n Thread.currentThread().setPriority(Thread.MAX_PRIORITY);\r\n\r\n byte[] data = new byte[line.available()];\r\n if (data.length == 0) {\r\n return;\r\n }\r\n\r\n line.read(data, 0, data.length);\r\n \r\n double[][] partitionedAndTransformedData =\r\n getPartitionedAndTransformedData(SOUND_PARTITIONS, data);\r\n \r\n double[] offMagnitudes = getPartitionedFrequencyMagnitudes(\r\n Constants.FREQUENCY_OFF,\r\n partitionedAndTransformedData,\r\n Constants.SAMPLE_RATE);\r\n double[] offOffsetMagnitudes = getPartitionedFrequencyMagnitudes(\r\n Constants.FREQUENCY_OFF + Constants.FREQUENCY_SECOND_OFFSET,\r\n partitionedAndTransformedData,\r\n Constants.SAMPLE_RATE);\r\n double[] onMagnitudes = getPartitionedFrequencyMagnitudes(\r\n Constants.FREQUENCY_ON,\r\n partitionedAndTransformedData,\r\n Constants.SAMPLE_RATE);\r\n double[] onOffsetMagnitudes = getPartitionedFrequencyMagnitudes(\r\n Constants.FREQUENCY_ON + Constants.FREQUENCY_SECOND_OFFSET,\r\n partitionedAndTransformedData,\r\n Constants.SAMPLE_RATE);\r\n \r\n double offMagnitudeSum = 0.0;\r\n double onMagnitudeSum = 0.0;\r\n \r\n for (int i = 0; i < SOUND_PARTITIONS; i++) {\r\n double offMagnitude = offMagnitudes[i] + offOffsetMagnitudes[i];\r\n double onMagnitude = onMagnitudes[i] + onOffsetMagnitudes[i];\r\n \r\n offMagnitudeSum += offMagnitude;\r\n onMagnitudeSum += onMagnitude;\r\n \r\n// System.out.printf(\"%.2f %.2f%n\", offMagnitude, onMagnitude);\r\n\r\n boolean value = onMagnitude > offMagnitude;\r\n \r\n audioSignalParser.addSignal(value);\r\n \r\n if (value) {\r\n offRunningAverage.add(offMagnitude);\r\n } else {\r\n onRunningAverage.add(onMagnitude);\r\n }\r\n }\r\n\r\n if (offRunningAverage.haveAverage() && onRunningAverage.haveAverage()) {\r\n double offMagnitudeAverage = offMagnitudeSum / SOUND_PARTITIONS;\r\n double onMagnitudeAverage = onMagnitudeSum / SOUND_PARTITIONS;\r\n\r\n boolean isLineFree = \r\n Statistics.isWithinAverage(\r\n onMagnitudeAverage,\r\n onRunningAverage.getAverage(),\r\n onRunningAverage.getStandardDeviation(),\r\n 3 /* deviations */)\r\n && Statistics.isWithinAverage(\r\n offMagnitudeAverage,\r\n offRunningAverage.getAverage(),\r\n offRunningAverage.getStandardDeviation(),\r\n 3 /* deviations */);\r\n lineActivity.add(isLineFree ? 0 : 1);\r\n }\r\n }", "void setStarArray(stars.StarType[] starArray);", "private void updateChartPanel() {\n\n Rectangle region = new Rectangle(0, 0, clip.getFrameCount(), clip.getFrameFreqSamples());\n\n //toClipCoords(region);\n region.y = clip.getFrameFreqSamples() - (region.y + region.height);\n\n final int endCol = region.x + region.width;\n final int endRow = region.y + region.height;\n\n //System.out.println(\"endCol = \" + endCol + \" endRow = \" + endRow);\n\n XYSeries xy = new XYSeries(\"data\");\n XYSeries xySpline = new XYSeries(\"spline\");\n\n // Displays the single MAX or STRONGEST Frequency for each column\n // captures every x'th element for fitting spline\n int maxItensity = 0;\n int[] rows = new int[endCol];\n int[] intensities = new int[endCol];\n\n int SPLINEPRECISION = jSlider2.getValue(); // 1 is highest precision; default = 40\n// int SPLINEPRECISION = 40; // 1 is highest precision; default = 40\n int splineCounter = 0;\n\n for (int col = region.x; col < endCol; col++) {\n Frame fr = clip.getFrame(col);\n int strongestFreq = 0;\n int strongestFreqStrength = 0;\n for (int row = region.y; row < endRow; row++) {\n // the following is a MUCH faster equivalent to: img.setRGB(col, row, greyVal);\n //int greyVal = (int) (brightness + (contrast * Math.log1p(Math.abs(preMult * val))));\n int greyVal = (int) (0 + (625.0 * Math.log1p(Math.abs(11.2 * fr.getReal(row)))));\n greyVal = Math.min(255, Math.max(0, greyVal));\n int thisFreqStrength = (greyVal << 16) | (greyVal << 8) | (greyVal);\n\n if (thisFreqStrength > strongestFreqStrength) {\n strongestFreqStrength = thisFreqStrength;\n strongestFreq = row;\n }\n if (thisFreqStrength > maxItensity) {\n maxItensity = thisFreqStrength;\n }\n }\n rows[col] = strongestFreq;\n intensities[col] = strongestFreqStrength;\n }\n //System.out.println(\"maxItensity = \" + maxItensity);\n\n // Average neighboring data values\n // Use minIntensity amoung neighbors for averaged row\n // Use threshold to exclude weak signals\n //int NUMPOINTSAVERAGED = 20;\n int NUMPOINTSAVERAGED = jSlider1.getValue(); // default = 20\n double INTENSITYTHRESHOLD = 0.95;\n int[] data = new int[endCol - NUMPOINTSAVERAGED];\n int[] dataAveraged = new int[endCol - NUMPOINTSAVERAGED];\n int[] minIntensities = new int[endCol - NUMPOINTSAVERAGED];\n for (int col = region.x; col < endCol - NUMPOINTSAVERAGED; col++) {\n int sumRows = 0;\n int minIntensity = maxItensity;\n for (int i = col; i < col + NUMPOINTSAVERAGED; i++) {\n sumRows += rows[i];\n minIntensity = java.lang.Math.min(minIntensity, intensities[i]);\n }\n data[col] = rows[col];\n dataAveraged[col] = java.lang.Math.round(sumRows / NUMPOINTSAVERAGED);\n minIntensities[col] = minIntensity;\n }\n\n for (int col = region.x; col < endCol - 2 * NUMPOINTSAVERAGED; col++) {\n splineCounter++;\n for (int row = region.y; row < endRow; row++) {\n if (row == data[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds actual data\n xy.add((double) col, calibrate((double) convertYCoordToFreq(row)));\n System.out.println(\"adding data point (\" + col + \",\" + calibrate((double) convertYCoordToFreq(row)) + \")\");\n }\n if (row == dataAveraged[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds averaged data\n //xy.add((double) col, (double) convertYCoordToFreq(row));\n //System.out.println(\"adding data point (\" + col + \",\" + row + \")\");\n if (splineCounter % SPLINEPRECISION == 0) {\n xySpline.add((double) (col + NUMPOINTSAVERAGED / 2), calibrate((double) convertYCoordToFreq(row)));\n }\n }\n }\n }\n //replace Data with new series\n dataset.removeSeries(1);\n dataset.removeSeries(0);\n dataset.addSeries(xy);\n dataset.addSeries(xySpline);\n\n XYPlot xyplot = (XYPlot) chartPanel.getChart().getPlot();\n XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();\n xylineandshaperenderer.setSeriesShapesVisible(0, jCheckBox1.isSelected());\n xylineandshaperenderer.setSeriesLinesVisible(1, jCheckBox2.isSelected());\n\n if (jCheckBox3.isSelected()) {\n xyplot.getRangeAxis().setLabel(jTextField8.getText() + \" (\" + jTextField3.getText() + \")\");\n } else {\n xyplot.getRangeAxis().setLabel(\"Frequency (Hz)\");\n }\n\n // Show Crosshairs\n chartPanel.setVerticalAxisTrace(true);\n\n chartPanel.repaint();\n }", "public void attachData(double[] newData) {\n\t\tdouble[] newDataArray = new double[data.length + newData.length];\n\t\tSystem.arraycopy(data, 0, newDataArray, 0, data.length);\n\t\tSystem.arraycopy(newData, 0, newDataArray, data.length, newData.length);\n\t\tdata = newDataArray;\n\t}", "public void setIntensity(double[] value){\n\t\tintensity = new double[value.length];\n\t\tintensity = value;\n\t}", "private synchronized void update() {\n int numberOfPoints = buffer.get(0).size();\n if (numberOfPoints == 0) return;\n\n for (int i = 0; i < getNumberOfSeries(); i++) {\n final List<Double> bufferSeries = buffer.get(i);\n final List<Double> dataSeries = data.get(i);\n dataSeries.clear();\n dataSeries.addAll(bufferSeries);\n bufferSeries.clear();\n }\n\n //D.info(SineSignalGenerator.this, \"Update triggered, ready: \" + getNumberOfSeries() + \" series, each: \" + data[0].length + \" points\");\n bufferIdx = 0;\n\n // Don't want to create event, just \"ping\" listeners\n setDataReady(true);\n setDataReady(false);\n }", "private void m18357t() {\n AudioProcessor[] k;\n ArrayList<AudioProcessor> newAudioProcessors = new ArrayList<>();\n for (AudioProcessor audioProcessor : m18348k()) {\n if (audioProcessor.mo25036a()) {\n newAudioProcessors.add(audioProcessor);\n } else {\n audioProcessor.flush();\n }\n }\n int count = newAudioProcessors.size();\n this.f16596P = (AudioProcessor[]) newAudioProcessors.toArray(new AudioProcessor[count]);\n this.f16597Q = new ByteBuffer[count];\n m18347j();\n }", "private void adjustStarData()\n\t{\n\t\tfor(int i = 0; i < starList.size(); i++)\n\t\t{\n\t\t\tStar aStar = starList.get(i);\n\t\t\tdouble rightAsc = aStar.getRA();\n\t\t\tdouble hourAngle = theCalculator.findHourAngle(rightAsc, userLocalTime);\n\t\t\taStar.setHourAngle(hourAngle);\n\t\t\tstarList.set(i, aStar);\n\t\t}\n\t}", "void lowResolutionInference(Spectrum spectrum){\n\t}", "@Override\n\tpublic void update(float[] val) {\n\t\t\n\t}", "public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t//Bin MSP LibrarySpectra\n\t\t\tbinMasses();\n\n\t\t\tfor (double l=0.01; l<3.01; l=l+.01)\n\t\t\t{\n\t\t\t\tfor (double m=0.01; m<3.01; m=m+.01)\n\t\t\t\t{\n\t\t\t\t\tthis.intWeight = l;\n\t\t\t\t\tthis.massWeight = m;\n\n\t\t\t\t\t//Read in all mgf files\n\t\t\t\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateProgress((int)(Double.valueOf(i+1)\n\t\t\t\t\t\t\t\t/(Double.valueOf(mgfFiles.size())*100.0)),\"% - Loading Spectra\",true);\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Read in spectra and search\n\t\t\t\t\t\treadMGF(mgfFiles.get(i));\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mgf\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mgfFiles.get(i)+\"_\"+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create mzxmlparser\n\t\t\t\t\tMZXMLParser parser = new MZXMLParser();\n\n\t\t\t\t\t//Read in mzxml files\n\t\t\t\t\tfor (int i=0; i<mzxmlFiles.size(); i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\ttimeStart = System.nanoTime();\n\t\t\t\t\t\tnumSpectra = 0;\n\n\t\t\t\t\t\t//Parse MZXML\n\t\t\t\t\t\tparser.readFile(mzxmlFiles.get(i));\n\n\t\t\t\t\t\t//Create SampleSpectrum objects\n\t\t\t\t\t\tfor (int j=0; j<parser.sampleSpecArray.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsampleMS2Spectra.add(parser.sampleSpecArray.get(j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Iterate through spectra and match\n\t\t\t\t\t\tfor (int j=0; j<sampleMS2Spectra.size(); j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmatchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Write ouput files for mzxml\n\t\t\t\t\t\twriteResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+\"_\"+m+\".csv\",maxResults);\n\n\t\t\t\t\t\t//Clear sample spectra\n\t\t\t\t\t\tsampleMS2Spectra = new ArrayList<SampleSpectrum>();\n\t\t\t\t\t}\n\t\t\t\t\tupdateProgress(100,\"% - Completed\",true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void initialize() {\n final Double optimismRate = new Double(0.0);\n _counts.clear();\n _values.clear();\n\n for (Integer index : Range.closed(0, _armsNo - 1).asSet(DiscreteDomains.integers())) {\n _counts.add(index, optimismRate.intValue());\n _values.add(index, optimismRate);\n }\n }", "void setArraySpec(ASTArraySpecNode arraySpecNode)\n {\n if (arraySpecNode != null)\n this.arraySpec = new ArraySpec(arraySpecNode);\n }", "protected abstract void addMaterialStats();", "public abstract void notifyArrayStart();", "void setStarArray(int i, stars.StarType star);", "private void fill() {\n\t\tseries1.clear();\n\t\tint m = 50;\n\t\tdouble tmpX, tmpZ;\n\n\t\tfor (double x=-m; x <= +m; x++) {\n\t\t\ttmpX = MathUtils.sqr(x/30);\n\t\t\tfor (double z=-m; z <= +m; z++) {\n\t\t\t\ttmpZ = MathUtils.sqr(z/30);\n\t\t\t\ttmpZ = Math.sqrt(tmpX+tmpZ);\n\t\t\t\tseries1.add(x, 4*Math.cos(3*tmpZ)*Math.exp(-0.5*tmpZ), z);\n\t\t\t}\n\t\t}\n\t }", "BlueSphere(int[] val) {\n value[0] = val[0];\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "void setStart(Object[] newStart);", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\n\t}", "void setSpeedsArray(org.landxml.schema.landXML11.SpeedsDocument.Speeds[] speedsArray);", "void setStockArray(int i, stockFilePT102.StockDocument.Stock stock);", "public void set_AllSpreadIndexToOne(){\r\n\t//test to see if the fuel moistures are greater than 33 percent.\r\n\t//if they are, set their index value to 1\r\n\tif ((FFM>33)){ // fine fuel greater than 33?\r\n\t\tGRASS=0; \r\n\t\tTIMBER=0;\r\n\t}else{\r\n\t\tTIMBER=1;\r\n\t}\r\n}", "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux[i] = RGBcal[0]*vlam[0]*r[i] + RGBcal[1]*vlam[1]*g[i] + RGBcal[2]*vlam[2]*b[i];\n \n\t\t\t//get CLA\n\t\t\tS = RGBcal[0]*smac[0]*r[i] + RGBcal[1]*smac[1]*g[i] + RGBcal[2]*smac[2]*b[i];\n\t\t\tM = RGBcal[0]*mel[0]*r[i] + RGBcal[1]*mel[1]*g[i] + RGBcal[2]*mel[2]*b[i];\n\t\t\tVPR = RGBcal[0]*vp[0]*r[i] + RGBcal[1]*vp[1]*g[i] + RGBcal[2]*vp[2]*b[i];\n\t\t\tVM = RGBcal[0]*vmac[0]*r[i] + RGBcal[1]*vmac[1]*g[i] + RGBcal[2]*vmac[2]*b[i];\n \n\t\t\tif(S > CLAcal[2]*VM) {\n\t\t\t\tCLA[i] = M + CLAcal[0]*(S - CLAcal[2]*VM) - CLAcal[1]*683*(1 - pow((float)2.71, (float)(-VPR/4439.5)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCLA[i] = M;\n\t\t\t}\n\t\t\tCLA[i] = CLA[i]*CLAcal[3];\n\t\t\tif(CLA[i] < 0) {\n\t\t\t\tCLA[i] = 0;\n\t\t\t}\n \n\t\t\t//get CS\n\t\t\tCS[i] = (float) (.7*(1 - (1/(1 + pow((float)(CLA[i]/355.7), (float)1.1026)))));\n \n\t\t\t//get activity\n\t\t\ta[i] = (float) (pow(a[i], (float).5) * .0039 * 4);\n\t\t}\n\t}", "private void populateData() {\r\n\t\tfor(int i = 0; i < this.incomeRanges.length; i++) {\r\n\t\t\tthis.addData(new Data(incomeRanges[i], 0), true);\r\n\t\t}\t// end for\r\n\t}", "public void setExternalSpectrumFile(String filename);", "void setStockArray(stockFilePT102.StockDocument.Stock[] stockArray);", "protected abstract void setValues(double[] values);", "public void addchargemass(int chrg, double mass){\n\t\tcharges.add(chrg);\n\t\tmasses.add(mass);\n\t}", "public static void updateResources(){\n for(int i = 0 ; i < releaseArr.length; i ++){\n resourceArr[i] += releaseArr[i];\n }\n }", "void hit(int frequency, double duration, double amplitude){\r\n \tSystem.out.println(\"Frequency: \"+frequency+\", Duration: \"+duration+\", Amplitude: \"+amplitude);\r\n \t\r\n\r\n\t\tadder.inputA.set(frequency); //fc !!!\r\n\t\tvibrato.frequency.set( frequency+80 ); // fm!!!\r\n\t\tvibrato.amplitude.set( (frequency+80)*2 ); // fm*2!!!\r\n \t\r\n\t\tint i=0;\r\n\t\tdata[i++] = 0.01;\t\t\t// Duration of first segment. \r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.13; \t// duration\r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.4; \t// duration \r\n\t\tdata[i++] = 0.0; \t\t\t// value \r\n\r\n\t\ti = 0;\r\n\t\tamplitude = 280*2;\r\n\t\tdata2[i++] = 0.01;\t\t\t// Duration of first segment. \r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.13; \t// duration\r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.4; \t// duration \r\n\t\tdata2[i++] = 0.0; \t\t\t// value \r\n\r\n\t\tenvData.write( 0, data, 0, i/2 );\r\n\t\tenvData2.write( 0, data2, 0, i/2 );\r\n \tenvPlayer.envelopePort.clear();\r\n \tenvPlayer2.envelopePort.clear();\r\n \tenvPlayer.envelopePort.queue( envData, 0, i/2 );\r\n \tenvPlayer2.envelopePort.queue( envData2, 0, i/2 );\r\n }", "public static void update_memory_rp(Memory[] memory_rp, int[] ncm_per_cycle_rp,int cycle_num){\n\t\tfor(int i=0;i<48;i++){\n\t\t\tncm_per_cycle_rp[cycle_num]+=memory_rp[i].ncm;\n\t\t\tmemory_rp[i].priority=threshold(memory_rp[i].ncm);\n\t\t\tmemory_rp[i].ncm=0;\n\t\t}\n\t}", "public void run() {\r\n /*try {\r\n AudioSystem.write(m_audioInputStream, m_targetType, outFile);\r\n } catch(IOException e) {\r\n e.printStackTrace();\r\n }*/\r\n //diagram.display();\r\n \r\n final java.util.List<Double> samples=new ArrayList<Double>();\r\n int nBytesRead=0;\r\n final int EXTERNAL_BUFFER_SIZE=(int)Math.pow(2, 13); //128000;\r\n byte[] abData=new byte[EXTERNAL_BUFFER_SIZE];\r\n //boolean isOn=false;\r\n while(nBytesRead != -1 && !stopped) {\r\n try {\r\n nBytesRead=m_audioInputStream.read(abData, 0, abData.length);\r\n } catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n if(nBytesRead > 0) {\r\n //System.err.println(\"data captured: \"+nBytesRead);\r\n final double[] in=new double[nBytesRead / 2+1]; // >>> 16 bit\r\n int j=0;\r\n for(int i=0; i < nBytesRead - 1; i+=2) {\r\n byte left=abData[i];\r\n int right=abData[i + 1];\r\n right<<=8;\r\n right|=(left & 0xFF);\r\n in[j+1]=right / 65536.0; // >>>65535=2^16\r\n j++;\r\n }\r\n\r\n double averageIntensity=0;\r\n try {\r\n final Sound intensitySound=Sound.Sound_createSimple(1, (in.length-1) / (double)SAMPLE_RATE, SAMPLE_RATE);\r\n intensitySound.z[1]=in;\r\n final SoundEditor edit=SoundEditor.SoundEditor_create(\"\", intensitySound);\r\n edit.computeIntensity();\r\n averageIntensity=edit.computeAverageIntensity();\r\n } catch(Exception e) {\r\n e.printStackTrace();\r\n continue; //>>>?\r\n }\r\n final double ai=averageIntensity;\r\n SwingUtilities.invokeLater(new Runnable() { //>>> not good\r\n public void run() {\r\n for(IntensityListener lis: itenListener) {\r\n lis.gotIntensity(ai); //notify listeners\r\n }\r\n }\r\n });\r\n\r\n /*if(INTENSITY_THRESHOLD<0) {\r\n INTENSITY_THRESHOLD=(int)ai+20;\r\n System.err.println(\"t:\"+ai);\r\n } else {*/\r\n//System.err.println(ai);\r\n if(ai>=settings.noiseLevel) { //filter weak noises\r\n //>>> too long? \r\n for(int i=1; i<in.length; i++) {\r\n samples.add(in[i]);\r\n }\r\n } else {\r\n analyzePitch(samples);\r\n samples.clear();\r\n }\r\n //}\r\n }\r\n }\r\n //System.err.println(\"got sample\");\r\n \r\n \r\n//System.err.println(\"done\");\r\n }", "protected abstract void fromSpace( float[] abc );", "protected void grow()\r\n\t{\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting grow\");\r\n\t\t}\r\n\t\t\r\n\t\tint[] temp = new int[count*2];\r\n\t\t\r\n\t\tfor(int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\ttemp[index] = numArray[index];\r\n\t\t\t\r\n\t\t\tif(debug)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Debug - temp[index] = \" + temp[index]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tnumArray = temp;\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Ending grow\");\r\n\t\t}\r\n\t}", "void setReferenceRangeArray(int i, org.hl7.fhir.ObservationReferenceRange referenceRange);", "public abstract void setRange(double value, int start, int count);", "RedSphere(int[] vals) {\n for (int i = 0; i < 6; i++) {\n value[i] = vals[i];\n }\n }", "public final void set(float m[]) {\n\tm00 = m[ 0]; m01 = m[ 1]; m02 = m[ 2];\n\tm10 = m[ 3]; m11 = m[ 4]; m12 = m[ 5];\n\tm20 = m[ 6]; m21 = m[ 7]; m22 = m[ 8];\n }", "public float[][] calcImmoniumPeaks(int min, int max, String seq, float[] mods, String filterIonTypes, int maxCharge, float dmass, float tol) {\n\t\tArrayList<Float> knownPeaks = calculatePeptideFragments(seq, mods, filterIonTypes, maxCharge, dmass);\n\t\t//ArrayList<Float> shiftedPeaks = new ArrayList<>();\n\t\t//for (Float peak : knownPeaks) //todo test?\n\t\t//\tshiftedPeaks.add(peak + dmass);\n\t\t//knownPeaks.addAll(shiftedPeaks);\n\n\t\tthis.averageIonMass = 0;\n\t\tArrayList<Peak> ps = new ArrayList<>();\n\t\tfor (int i = 0; i < peakMZ.length; i++) {\n\t\t\tif (peakMZ[i] > max) //todo remove min max\n\t\t\t\tbreak;\n\t\t\tif (peakMZ[i] > min) { //todo remove min max\n\t\t\t\tdouble absTol = peakMZ[i] * tol / 1000000;\n\t\t\t\tboolean skipFlag = false;\n\t\t\t\tfor (Float peak : knownPeaks) {\n\t\t\t\t\tif (Math.abs(peak - peakMZ[i]) < absTol) { //todo ppm tol\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\tif (skipFlag == false) {\n\t\t\t\t\tps.add(new Peak(peakMZ[i], peakInt[i], (float)absTol));\n\t\t\t\t\tthis.averageIonMass += peakMZ[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfloat[][] peaks = new float[ps.size()][3];\n\t\tfor (int i = 0; i < ps.size(); i++) {\n\t\t\tpeaks[i][0] = ps.get(i).MZ;\n\t\t\tpeaks[i][1] = ps.get(i).Int;\n\t\t\tpeaks[i][2] = ps.get(i).Tol;\n\t\t}\n\t\treturn peaks;\n\t}", "@Raw\n protected void setMass(double mass){\n \tthis.mass = mass;\n }", "public Spectrum(int nfrags) {\n\t\tpeakMZ = new float[nfrags];\n\t\tpeakInt = new float[nfrags];\n\t\tnorm = -1;\n\t\tif(fact == null) {\n\t\t\tfact = new float[128];\n\t\t\tfact[0] = 0;\n\t\t\tfor(int i = 1; i < 128; i++)\n\t\t\t\tfact[i] = (float)(fact[i-1] + Math.log(i));\n\t\t}\n\t\tbasePeakInt = findBasePeakInt();\n\t}", "public static void update_memory_r(Memory[] memory_r, int[] ncm_per_cycle_r,int cycle_num){\n\t\tfor(int i=0;i<48;i++){\n\t\t\tncm_per_cycle_r[cycle_num]+=memory_r[i].ncm;\n\t\t\tmemory_r[i].ncm=0;\n\t\t}\n\t}", "private float[] calculateData(float[] data) {\n float total=0;\n for(int i=0;i<data.length;i++)\n {\n total+=data[i];\n }\n for(int i=0;i<data.length;i++)\n {\n data[i]=360*(data[i]/total); \n }\n return data;\n\n }", "private void addScreenUsage() {\n double power = 0;\n long screenOnTimeMs = mStats.getScreenOnTime(mRawRealtimeUs, mStatsType) / 1000;\n power += screenOnTimeMs * mPowerProfile.getAveragePower(PowerProfile.POWER_SCREEN_ON);\n final double screenFullPower =\n mPowerProfile.getAveragePower(PowerProfile.POWER_SCREEN_FULL);\n for (int i = 0; i < BatteryStats.NUM_SCREEN_BRIGHTNESS_BINS; i++) {\n double screenBinPower = screenFullPower * (i + 0.5f)\n / BatteryStats.NUM_SCREEN_BRIGHTNESS_BINS;\n long brightnessTime = mStats.getScreenBrightnessTime(i, mRawRealtimeUs, mStatsType)\n / 1000;\n double p = screenBinPower * brightnessTime;\n if (DEBUG && p != 0) {\n Log.d(TAG, \"Screen bin #\" + i + \": time=\" + brightnessTime\n + \" power=\" + makemAh(p / (60 * 60 * 1000)));\n }\n power += p;\n }\n power /= (60 * 60 * 1000); // To hours\n if (power != 0) {\n addEntry(BatterySipper.DrainType.SCREEN, screenOnTimeMs, power);\n }\n }", "public void addSNArray(StickyNote toAdd);", "private void adjustBrightness(int[][] colorArray,double factor){\n\t\tfor(int i=0;i<colorArray.length;i++){\n\t\t\tfor(int j=0;j<colorArray[0].length;j++){\n\t\t\t\tdouble newVal=colorArray[i][j]*factor;\n\t\t\t\tif(newVal>255){//if the value exceeds the color limit assign to the max value\n\t\t\t\t\tnewVal=255.0;\n\t\t\t\t}\n\t\t\t\tcolorArray[i][j]=(int) newVal;\n\t\t\t}\n\t\t}\n\t\t//Your code ends here\n\t}", "public void setIntensity (short[][] intensity)\r\n {\r\n\tthis.intensity = intensity;\r\n }", "public void setSamples(int x, int y, int w, int h, int b, int iArray[], DataBuffer data) {\n // Bounds check for 'b' will be performed automatically\n if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {\n throw new ArrayIndexOutOfBoundsException(\"Coordinate out of bounds!\");\n }\n int lineOffset = y * scanlineStride + x * pixelStride + bandOffsets[b];\n int srcOffset = 0;\n\n for (int i = 0; i < h; i++) {\n int sampleOffset = lineOffset;\n for (int j = 0; j < w; j++) {\n data.setElem(bankIndices[b], sampleOffset, iArray[srcOffset++]);\n sampleOffset += pixelStride;\n }\n lineOffset += scanlineStride;\n }\n }", "private void setMultipliersArraySize(int i) {\r\n\t\tp_multiplier_name = new String[i];\r\n\t\tp_multiplier_value = new Double[i];\r\n\t\tp_multiplier_description = new String[i];\r\n\t}", "public void sample()\n\t{\n\t\tint nd = interval.numDimensions();\n\n\t\t// the order in which mpicbg expects\n\t\tp = new double[ nd ][ (int) N ];\n\t\tq = new double[ nd ][ (int) N ];\n\n\t\tdouble[] src = new double[ nd ];\n\t\tdouble[] tgt = new double[ nd ];\n\n\t\tint i = 0;\n\t\tIntervalIterator it = new IntervalIterator( interval );\n\t\twhile ( it.hasNext() )\n\t\t{\n\t\t\tit.fwd();\n\t\t\tit.localize( src );\n\t\t\txfm.apply( src, tgt );\n\n\t\t\tfor ( int d = 0; d < nd; d++ )\n\t\t\t{\n\t\t\t\tp[ d ][ i ] = src[ d ];\n\t\t\t\tq[ d ][ i ] = tgt[ d ];\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}", "private void setStartValues() {\n startValues = new float[9];\n mStartMatrix = new Matrix(getImageMatrix());\n mStartMatrix.getValues(startValues);\n calculatedMinScale = minScale * startValues[Matrix.MSCALE_X];\n calculatedMaxScale = maxScale * startValues[Matrix.MSCALE_X];\n }", "private void calculateRecForces(){\n\t\t\n\t\t\n\t\tfor(Particle p : this){\n\t\t\t//Pg 183 Lee[05]\n\t\t\t//For each grid point that this particle has been interpolated to\n\t\t\tfor(int dx = -ASSIGNMENT_SCHEME_ORDER; dx < ASSIGNMENT_SCHEME_ORDER; dx++)\n\t\t\t{\n\t\t\t\tfor(int dy = -ASSIGNMENT_SCHEME_ORDER; dy < ASSIGNMENT_SCHEME_ORDER; dy++)\n\t\t\t\t{\n\t\t\t\t\tdouble uX = p.getPosition().re()/1.0 * CELL_SIDE_COUNT;//Scaled fractional coordinate\n\t\t\t\t\tdouble uY = p.getPosition().im()/1.0 * CELL_SIDE_COUNT;//Scaled fractional coordinate\n\t\t\t\t\tint particleCellX = (int)Math.round(p.getPosition().re()/1.0 * CELL_SIDE_COUNT);\n\t\t\t\t\tint particleCellY = (int)Math.round(p.getPosition().im()/1.0 * CELL_SIDE_COUNT);\n\t\t\t\t\tint thisX = particleCellX + dx;\n\t\t\t\t\tint thisY = particleCellY + dy;\n\t\t\t\t\tif(thisX >= 0 && thisY >= 0 && thisX < CELL_SIDE_COUNT && thisY < CELL_SIDE_COUNT)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble dQdx = p.getCharge() * M.evaluateDerivative(uX - thisX) * M.evaluate(uY - thisY);\n\t\t\t\t\t\tdouble dQdy = p.getCharge() * M.evaluate(uX - thisX) * M.evaluateDerivative(uY - thisY);\n\t\t\t\t\t\tp.addToForce(-dQdx * convolutedMatrix[thisX][thisY].re(), -dQdy * convolutedMatrix[thisX][thisY].re()); //FIXME .re()?\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void setMass(double amount)\n\t{\n\t\tthis.mass = amount;\n\t}", "private static int[][] AddToArr(int[][] arr, int[][] symbol, int length, int offset) {\n\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\tfor (int j = 0; j < length; j++) {\r\n\t\t\t\tif (symbol[i][j] > 0) {\r\n\r\n\t\t\t\t\tarr[i][j + offset] = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "public void setAmplitude(float amplitude) {\n/* 79 */ this.amplitude = amplitude;\n/* */ }", "protected void initSupportedIntensityMeasureParams() {\n\n\t\t// Create saParam:\n\t\tDoubleDiscreteConstraint periodConstraint = new DoubleDiscreteConstraint();\n\t\tTreeSet set = new TreeSet();\n\t\tEnumeration keys = coefficientsBJF.keys();\n\t\twhile (keys.hasMoreElements()) {\n\t\t\tBJF_1997_AttenRelCoefficients coeff = (BJF_1997_AttenRelCoefficients)\n\t\t\tcoefficientsBJF.get(keys.nextElement());\n\t\t\tif (coeff.period >= 0) {\n\t\t\t\tset.add(new Double(coeff.period));\n\t\t\t}\n\t\t}\n\t\tIterator it = set.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tperiodConstraint.addDouble( (Double) it.next());\n\t\t}\n\t\tperiodConstraint.setNonEditable();\n\t\tsaPeriodParam = new PeriodParam(periodConstraint);\n\t\tsaDampingParam = new DampingParam();\n\t\tsaParam = new SA_Param(saPeriodParam, saDampingParam);\n\t\tsaParam.setNonEditable();\n\n\t\t// Create PGA Parameter (pgaParam):\n\t\tpgaParam = new PGA_Param();\n\t\tpgaParam.setNonEditable();\n\n\t\t// Create PGV Parameter (pgvParam):\n\t\tpgvParam = new PGV_Param();\n\t\tpgvParam.setNonEditable();\n\n\t\t// The MMI parameter\n\t\tmmiParam = new MMI_Param();\n\n\t\t// Add the warning listeners:\n\t\tsaParam.addParameterChangeWarningListener(listener);\n\t\tpgaParam.addParameterChangeWarningListener(listener);\n\t\tpgvParam.addParameterChangeWarningListener(listener);\n\n\t\t// create supported list\n\t\tsupportedIMParams.clear();\n\t\tsupportedIMParams.addParameter(saParam);\n\t\tsupportedIMParams.addParameter(pgaParam);\n\t\tsupportedIMParams.addParameter(pgvParam);\n\t\tsupportedIMParams.addParameter(mmiParam);\n\n\t}", "public void setSpectrumMatches(List<SpectrumMatch> spectrumMatches) {\r\n this.spectrumMatches = spectrumMatches;\r\n }", "private void initializeChartPanel() {\n\n Rectangle region = new Rectangle(0, 0, clip.getFrameCount(), clip.getFrameFreqSamples());\n\n //toClipCoords(region);\n region.y = clip.getFrameFreqSamples() - (region.y + region.height);\n\n final int endCol = region.x + region.width;\n final int endRow = region.y + region.height;\n\n //System.out.println(\"endCol = \" + endCol + \" endRow = \" + endRow);\n\n XYSeries xy = new XYSeries(\"data\");\n XYSeries xySpline = new XYSeries(\"spline\");\n\n // Displays the single MAX or STRONGEST Frequency for each column\n // captures every x'th element for fitting spline\n int maxItensity = 0;\n int[] rows = new int[endCol];\n int[] intensities = new int[endCol];\n\n// int SPLINEPRECISION = chartPrefJSlider2.getValue(); // 1 is highest precision; default = 40\n int SPLINEPRECISION = 40; // 1 is highest precision; default = 40\n int splineCounter = 0;\n\n for (int col = region.x; col < endCol; col++) {\n Frame fr = clip.getFrame(col);\n int strongestFreq = 0;\n int strongestFreqStrength = 0;\n for (int row = region.y; row < endRow; row++) {\n // the following is a MUCH faster equivalent to: img.setRGB(col, row, greyVal);\n //int greyVal = (int) (brightness + (contrast * Math.log1p(Math.abs(preMult * val))));\n int greyVal = (int) (0 + (625.0 * Math.log1p(Math.abs(11.2 * fr.getReal(row)))));\n greyVal = Math.min(255, Math.max(0, greyVal));\n int thisFreqStrength = (greyVal << 16) | (greyVal << 8) | (greyVal);\n\n if (thisFreqStrength > strongestFreqStrength) {\n strongestFreqStrength = thisFreqStrength;\n strongestFreq = row;\n }\n if (thisFreqStrength > maxItensity) {\n maxItensity = thisFreqStrength;\n }\n }\n rows[col] = strongestFreq;\n intensities[col] = strongestFreqStrength;\n }\n System.out.println(\"maxItensity = \" + maxItensity);\n\n // Average neighboring data values\n // Use minIntensity amoung neighbors for averaged row\n // Use threshold to exclude weak signals\n //int NUMPOINTSAVERAGED = 20;\n int NUMPOINTSAVERAGED = jSlider1.getValue(); // default = 20\n double INTENSITYTHRESHOLD = 0.95;\n int[] data = new int[endCol - NUMPOINTSAVERAGED];\n int[] dataAveraged = new int[endCol - NUMPOINTSAVERAGED];\n int[] minIntensities = new int[endCol - NUMPOINTSAVERAGED];\n for (int col = region.x; col < endCol - NUMPOINTSAVERAGED; col++) {\n int sumRows = 0;\n int minIntensity = maxItensity;\n for (int i = col; i < col + NUMPOINTSAVERAGED; i++) {\n sumRows += rows[i];\n minIntensity = java.lang.Math.min(minIntensity, intensities[i]);\n }\n data[col] = rows[col];\n dataAveraged[col] = java.lang.Math.round(sumRows / NUMPOINTSAVERAGED);\n minIntensities[col] = minIntensity;\n }\n\n for (int col = region.x; col < endCol - 2 * NUMPOINTSAVERAGED; col++) {\n splineCounter++;\n for (int row = region.y; row < endRow; row++) {\n if (row == data[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds actual data\n xy.add((double) col, (double) convertYCoordToFreq(row));\n //System.out.println(\"adding data point (\" + col + \",\" + row + \")\");\n }\n\n if (row == dataAveraged[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds averaged data\n //xy.add((double) col, (double) convertYCoordToFreq(row));\n //System.out.println(\"adding data point (\" + col + \",\" + row + \")\");\n if (splineCounter % SPLINEPRECISION == 0) {\n xySpline.add((double) (col + NUMPOINTSAVERAGED / 2), (double) convertYCoordToFreq(row));\n }\n }\n }\n }\n\n dataset.removeAllSeries();\n dataset.addSeries(xy);\n\n //XYSeriesCollection splineDataset = new XYSeriesCollection();\n dataset.addSeries(xySpline);\n\n JFreeChart chart = ChartFactory.createXYLineChart(\n //JFreeChart chart = ChartFactory.createScatterPlot(\n clip.getFileName(), \"Time (ms)\", \"Frequency (Hz)\", dataset, PlotOrientation.VERTICAL, true, true, false);\n XYPlot xyplot = (XYPlot) chart.getPlot();\n xyplot.setRenderer(new XYSplineRenderer());\n XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();\n xylineandshaperenderer.setSeriesShape(0, new java.awt.Rectangle(1, 1, 1, 1));\n xylineandshaperenderer.setSeriesLinesVisible(0, false);\n xylineandshaperenderer.setSeriesShapesVisible(0, true);\n xylineandshaperenderer.setSeriesLinesVisible(1, false);\n xylineandshaperenderer.setSeriesShapesVisible(1, false);\n\n// ChartFrame frame = new ChartFrame(\"First\", chart);\n// frame.pack();\n// frame.setVisible(true);\n\n\n jCheckBox1.setEnabled(true);\n jCheckBox1.setSelected(true);\n\n jCheckBox2.setEnabled(true);\n jCheckBox2.setSelected(false);\n\n jSlider1.setEnabled(true);\n jSlider2.setEnabled(true);\n\n jTextField9.setText(clip.getFileName());\n\n chartPanel = new ChartPanel(chart);\n }", "public void setMass(double value) {\n this.mass = value;\n }", "private void grow() {\n int oldCapacity = this.values.length;\n int newCapacity = oldCapacity + (oldCapacity >> 1);\n Object[] newValues = new Object[newCapacity];\n System.arraycopy(this.values, 0, newValues, 0, oldCapacity);\n this.values = newValues;\n }", "@Override protected void updateAxisRange() {\n final Axis<X> xa = getXAxis();\n final Axis<Y> ya = getYAxis();\n List<X> xData = null;\n List<Y> yData = null;\n if(xa.isAutoRanging()) xData = new ArrayList<X>();\n if(ya.isAutoRanging()) yData = new ArrayList<Y>();\n if(xData != null || yData != null) {\n for(Series<X,Y> series : getData()) {\n for(Data<X,Y> data: series.getData()) {\n if(xData != null) {\n xData.add(data.getXValue());\n xData.add(xa.toRealValue(xa.toNumericValue(data.getXValue()) + getLength(data.getExtraValue())));\n }\n if(yData != null){\n yData.add(data.getYValue());\n }\n }\n }\n if(xData != null) xa.invalidateRange(xData);\n if(yData != null) ya.invalidateRange(yData);\n }\n }", "void calcWave() {\n yoff += 0.01f;\n \n //For every x value, calculate a y value based on sine or cosine\n float x = yoff; //**OPTION #1****/\n //float x = 0.0f; //**OPTION #2****/\n for (int i = 0; i < yvalues.length; i++) {\n float n = 2*noise(x)-1.0f; //**OPTION #1****/ //scale noise to be between 1 and -1\n //float n = 2*noise(x,yoff)-1.0f; //**OPTION #2****/ //scale noise to be between 1 and -1\n yvalues[i] = n*amplitude;\n x+=dx;\n }\n }", "void _apply(float[] f, float[] t, Mismatch mm) throws PAModelException\n\t{\n\t\tint[] fndx = _bus.getFromBus(), tndx = _bus.getToBus();\n\t\tint n = size();\n\t\tfor(int i=0; i < n; ++i)\n\t\t{\n\t\t\tmm.add(fndx[i], f[i]);\n\t\t\tmm.add(tndx[i], t[i]);\n\t\t}\n\t}", "public abstract List<Double> updatePopulations();", "public void setup(int size){\n runValues = new double[size];\n hardwareValues = new double[size][];\n }" ]
[ "0.6156199", "0.582469", "0.57082355", "0.5698598", "0.56104803", "0.55037117", "0.52618366", "0.52350855", "0.52060354", "0.5178714", "0.5126516", "0.51251763", "0.506341", "0.505852", "0.50573266", "0.5050194", "0.50480676", "0.4985145", "0.4948936", "0.49156415", "0.49136013", "0.49115565", "0.49060705", "0.48856854", "0.48849052", "0.48779193", "0.487632", "0.48761144", "0.48643395", "0.4858013", "0.48414713", "0.48280516", "0.48204726", "0.4793046", "0.4791628", "0.4789185", "0.47800213", "0.4774974", "0.4765996", "0.4761179", "0.47291267", "0.47084942", "0.47021484", "0.468892", "0.46688336", "0.4661593", "0.4657545", "0.46518436", "0.4636937", "0.46356106", "0.46309388", "0.4618232", "0.46168765", "0.4611388", "0.4611127", "0.46105033", "0.46062726", "0.46024692", "0.46017575", "0.45975286", "0.45918447", "0.45810187", "0.45748082", "0.45712024", "0.45582053", "0.4554717", "0.45461467", "0.45425716", "0.45416123", "0.45277604", "0.45262003", "0.4521534", "0.4518874", "0.4514971", "0.45016366", "0.44977972", "0.44968137", "0.44924748", "0.44891787", "0.44808757", "0.4480352", "0.44775897", "0.4477262", "0.44769904", "0.44763115", "0.4476239", "0.44755292", "0.44663495", "0.4459076", "0.4457352", "0.4455317", "0.44550702", "0.4452224", "0.4452082", "0.44515005", "0.44474146", "0.44473502", "0.44448987", "0.44394016", "0.44345942" ]
0.6675819
0
Return transition type object corresponding to provided string
private static TransitionType getTransitionType(String s) { for (int i=0; i<transitionTypes.size(); i++) { if (transitionTypes.get(i).name.equals(s)) return transitionTypes.get(i); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ResourceOperation.Type parseType(String str) {\n if (StringComparator.isSameIgnoreCase(str, \"added\")) {\n return ADDED;\n } else if (StringComparator.isSameIgnoreCase(str, \"removed\")) {\n return REMOVED;\n } else if (StringComparator.isSameIgnoreCase(str, \"moved_from\")) {\n return MOVED_FROM;\n } else if (StringComparator.isSameIgnoreCase(str, \"moved_to\")) {\n return MOVED_TO;\n } else if (StringComparator.isSameIgnoreCase(str, \"renamed_from\")) {\n return RENAMED_FROM;\n } else if (StringComparator.isSameIgnoreCase(str, \"renamed_to\")) {\n return RENAMED_TO;\n }\n \n return OTHERS;\n }", "TransitionType createTransitionType();", "Transition createTransition(String literal);", "public static Type Type(String str) {\n\t\ttry {\n\t\t\tJavaIdentifierInputStream jin = new JavaIdentifierInputStream(str);\n\t\t\tBinaryInputStream bin = new BinaryInputStream(jin);\n\t\t\tBinaryAutomataReader reader = new BinaryAutomataReader(bin,\n\t\t\t\t\tTypes.SCHEMA);\n\t\t\tAutomaton automaton = reader.read();\n\t\t\treader.close();\n\n\t\t\treturn Type.construct(automaton);\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"runtime failure constructing type\", e);\n\t\t}\n\t}", "public static ResourceOperation.Target parseType(String str) {\n if (StringComparator.isSameIgnoreCase(str, \"jproject\")) {\n return JPROJECT;\n } else if (StringComparator.isSameIgnoreCase(str, \"jpackage\")) {\n return JPACKAGE;\n } else if (StringComparator.isSameIgnoreCase(str, \"jfile\")) {\n return JFILE;\n }\n \n return OTHERS;\n }", "public static CrossoverType fromString(String text) {\n if (text != null) {\n for (CrossoverType CT : CrossoverType.values()) {\n if (text.equalsIgnoreCase(CT.name)) {\n return CT;\n }\n }\n }\n return null;\n }", "StateMachineType createStateMachineType();", "@JsonCreator\n public static IntermediateType fromString(final String text) {\n if (text != null) {\n for (final IntermediateType v : IntermediateType.values()) {\n if (text.equalsIgnoreCase(v.text)) {\n return v;\n }\n }\n }\n throw new IllegalArgumentException(\"Unrecognized type: \" + text);\n }", "public static TransactionType getEnumFromString(String string) {\n for (TransactionType transactionType : TransactionType.values()) {\n if (transactionType.getTransactionType().equals(string)) {\n return transactionType;\n }\n }\n\n throw new UnsupportedOperationException(\"Zadali ste chybný názov transakcie\");\n }", "public static FileType fromString(String str) {\n if (str.equals(\"FILE\")) {\n return FILE;\n } else if (str.equals(\"DIRECTORY\")) {\n return DIRECTORY;\n } else if (str.equals(\"SYMLINK\")) {\n return SYMLINK;\n }\n //TODO: FIXME \n return FILE;\n }", "public static SimulationType getSimulationType(String str) {\n for(SimulationType type: SimulationType.values()) {\n if(type.name().equalsIgnoreCase(str)) {\n return type;\n }\n }\n return null;\n }", "private static ContextType stringToContextType(String s) \n {\n for (ContextType enumVal : ContextType.values())\n {\n if (enumVal.toString().equals(s))\n return enumVal;\n }\n \n // in case of failure:\n return ContextType.UNKNOWN;\n }", "<S> S fromStr(String s, Class<S> clazz);", "String convertTransition(Transition instanceValue);", "public static State fromString(String s) {\n if (s != null) {\n State[] vs = values();\n for (int i = 0; i < vs.length; i++) {\n if (vs[i].toString().equalsIgnoreCase(s)) {\n return vs[i];\n }\n }\n }\n return null;\n }", "private TYPE getType(final String type) {\n String temp = type.replaceAll(\"-\", \"_\");\n TYPE answer = Arrays.stream(\n TYPE.values()\n )\n .filter(value -> value.name().equals(temp))\n .findFirst()\n .orElse(TYPE.unknown);\n return answer;\n }", "public static RefactoringType getTypeRefactoring(String s) {\n\t\tif (s == null)\n\t\t\treturn null;\n\t\telse {\n\t\t\tRefactoringType res;\n\t\t\tswitch (s) {\n\t\t\tcase \"CollapseHierarchy\":\n\t\t\t\tres = RefactoringType.COLLAPSE_HIERARCHY; break;\n\t\t\tcase \"InlineClass\":\n\t\t\t\tres = RefactoringType.INLINE_CLASS; break;\n\t\t\tcase \"introduceParameterObject\":\n\t\t\t\tres = RefactoringType.INTRODUCE_PARAMETER_OBJECT; break;\n\t\t\tcase \"extractMethod\":\n\t\t\t\tres = RefactoringType.EXTRACT_METHOD; break;\n\t\t\tcase \"moveMethod\":\n\t\t\t\tres = RefactoringType.MOVE_METHOD; break;\n\t\t\tcase \"refactBlob\":\n\t\t\t\tres = RefactoringType.MOVE_METHOD; break;\n\t\t\tcase \"extractClass\":\n\t\t\t\tres = RefactoringType.EXTRACT_CLASS; break;\n\t\t\tcase \"RemoveParameter\":\n\t\t\t\tres = RefactoringType.REMOVE_PARAMETER; break;\n\t\t\tcase \"ReplaceMethodWithMethodObject\":\n\t\t\t\tres = RefactoringType.REPLACE_METHOD_WITH_METHOD_OJBECT; break;\n\t\t\tcase \"refactSpaghettiCode\":\n\t\t\t\tres = RefactoringType.EXTRACT_CLASS; break;\n\t\t\tdefault:\n\t\t\t\tSystem.err.println(\"New Smell detected: \" + s);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t}", "public StateType getStateTypeFromName(String name) {\n\t\tfor(StateType stateType : StateType.values()) {\n\t\t\tif(stateType.toString().equals(name)) {\n\t\t\t\treturn stateType;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Type type(String name);", "@JsonCreator\n public static QueryExecutionType fromString(String value) {\n QueryExecutionType[] items = QueryExecutionType.values();\n for (QueryExecutionType item : items) {\n if (item.toString().equalsIgnoreCase(value)) {\n return item;\n }\n }\n return null;\n }", "public static CMakeModuleType parse(String str) {\n return Enums.parse(CMakeModuleType.class, str);\n }", "private static ContextState stringToContextState(String s) \n {\n for (ContextState enumVal : ContextState.values())\n {\n if (enumVal.toString().equals(s))\n return enumVal;\n }\n \n // in case of failure:\n return ContextState.PUBLISHED;\n }", "public static State findState(String string) {\n String find = string.toUpperCase();\n\n if (find.contains(WAITING.name())) {\n return WAITING;\n }\n else if (find.contains(STARTING.name())) {\n return STARTING;\n }\n else if (find.contains(PLAYING.name())) {\n return PLAYING;\n }\n else if (find.contains(ENDING.name())) {\n return ENDING;\n }\n else if (find.contains(ENDED.name())) {\n return ENDED;\n }\n else {\n return OFFLINE;\n }\n }", "public static FieldType fromString(String s) \n {\n if (s!=null) \n for (FieldType t : FieldType.values())\n if (s.equalsIgnoreCase(t.name))\n return t;\n \n return null;\n }", "public static Obj enumType(String type) {\n\t\tif ((type != null) && !type.isEmpty() && (StrObj.containsKey(type)))\n\t\t\treturn StrObj.get(type);\n\t\telse\n\t\t\treturn Obj.UNKOBJ;\n\t}", "public static State parseString(String name)\n\t\t{\n\t\t\tif (FULL.toString().equals(name))\n\t\t\t\treturn FULL;\n\t\t\telse if (PARTIAL.toString().equals(name))\n\t\t\t\treturn PARTIAL;\n\t\t\telse if (DELETED.toString().equals(name))\n\t\t\t\treturn DELETED;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}", "@SuppressWarnings({\"unchecked\", \"deprecation\"})\n protected static <T extends ExpandableStringEnum<T>> T fromString(String name, Class<T> clazz) {\n if (name == null) {\n return null;\n }\n\n ConcurrentHashMap<String, ?> clazzValues = VALUES.computeIfAbsent(clazz, key -> new ConcurrentHashMap<>());\n T value = (T) clazzValues.get(name);\n\n if (value != null) {\n return value;\n } else {\n MethodHandle ctor = CONSTRUCTORS.computeIfAbsent(clazz, ExpandableStringEnum::getDefaultConstructor);\n\n if (ctor == null) {\n // logged in ExpandableStringEnum::getDefaultConstructor\n return null;\n }\n\n try {\n value = (T) ctor.invoke();\n } catch (Throwable e) {\n LOGGER.warning(\"Failed to create {}, default constructor threw exception\", clazz.getName(), e);\n return null;\n }\n\n return value.nameAndAddValue(name, value, clazz);\n }\n }", "public static DsoType parse(String text) {\n DsoType result = map.get(text);\n if (result == null) {\n throw new IllegalArgumentException(\"Unknown type: '\" + text + \"'\");\n }\n return result;\n }", "public static CMakeModuleType tryParse(String str) {\n return Enums.tryParse(CMakeModuleType.class, str);\n }", "public static Result<MessageType, JSONException> fromString(String str) {\r\n return Result.ofRuntime(() -> valueOf(str))\r\n .mapError(ignored -> new JSONException(\"command not recognised\"));\r\n }", "public static Enum forString(java.lang.String s)\r\n { return (Enum)table.forString(s); }", "public static TripStatus fromString(String str) {\n\t\tfor (TripStatus status : values()) {\n\t\t\tif (StringUtils.equalsIgnoreCase(status.name, str)) {\n\t\t\t\treturn status;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "StateType createStateType();", "public static WebDriverStrategyType fromString(String value) {\n try {\n return valueOf(value.toUpperCase());\n } catch (IllegalArgumentException e) {\n return UNKNOWN;\n }\n }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "private PileType getPileType(String sourceString) {\n String pileTyprString = sourceString.substring(0, 1);\n switch (pileTyprString) {\n case \"O\":\n return PileType.OPEN;\n case \"F\":\n return PileType.FOUNDATION;\n case \"C\":\n return PileType.CASCADE;\n default:\n // Should never return null - only called with valid strings\n return null;\n }\n }", "@JsonCreator\n public static TestMigrationState fromString(String name) {\n return fromString(name, TestMigrationState.class);\n }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "private static <T> Class<T> m31778a(String str) {\n try {\n return Class.forName(str);\n } catch (Throwable th) {\n return null;\n }\n }", "public static org.exolab.castor.mapping.xml.types.NodeType valueOf(java.lang.String string)\n {\n Object obj = null;\n if (string != null) obj = _memberTable.get(string);\n if (obj == null) {\n String err = \"'\" + string + \"' is not a valid NodeType\";\n throw new IllegalArgumentException(err);\n }\n return (NodeType) obj;\n }", "public static OperationType stateOf(String state) {\n for (OperationType stateEnum : values()) {\n if (stateEnum.getOperation().equals(state)) {\n return stateEnum;\n }\n }\n return null;\n }", "public static Type stringToType(final String newType) {\r\n\t\t\r\n\t\tType returnType = Type.Undeclared;\r\n\t\t\r\n\t\tif (newType.toLowerCase().equalsIgnoreCase(\"int\")) {\r\n\t\t\treturnType = Attribute.Type.Int;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"long\")) {\r\n\t\t\treturnType = Attribute.Type.Long;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"boolean\") \r\n\t\t\t\t|| newType.toLowerCase().equalsIgnoreCase(\"bool\")) {\r\n\t\t\treturnType = Attribute.Type.Boolean;\r\n\t\t} else if (newType.toLowerCase().toLowerCase().startsWith(\"char\") \r\n\t\t\t\t|| newType.toLowerCase().toLowerCase().startsWith(\"character\")) {\r\n\t\t\treturnType = Attribute.Type.Char;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"float\")) {\r\n\t\t\treturnType = Attribute.Type.Float;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"double\")) {\r\n\t\t\treturnType = Attribute.Type.Double;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"datetime\")) {\r\n\t\t\treturnType = Attribute.Type.DateTime;\r\n\t\t} else {\r\n\t\t\treturnType = Attribute.Type.Undeclared;\r\n\t\t}\t\r\n\t\treturn returnType;\r\n\t}", "public static String type(String s)\n {\n read_if_needed_();\n \n UmlBuiltin b = (UmlBuiltin) UmlSettings._map_builtins.get(s);\n \n return (b != null) ? b.java : s;\n }", "@JsonCreator\n public static ScheduleType fromString(String name) {\n return fromString(name, ScheduleType.class);\n }", "public static CompressorType fromString(String name) {\n for (CompressorType v : values()) {\n if (v.name().equalsIgnoreCase(name)) {\n return v;\n }\n }\n\n // cannot get here\n assert false;\n return null;\n }", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "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();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();" ]
[ "0.69923276", "0.6765903", "0.6695597", "0.63259107", "0.63014764", "0.6278109", "0.6252124", "0.6128643", "0.61250174", "0.60847586", "0.60802525", "0.607993", "0.6067634", "0.604857", "0.6037458", "0.60303104", "0.6012987", "0.59984297", "0.59912485", "0.59825057", "0.5965467", "0.59500325", "0.59377337", "0.5921611", "0.5921212", "0.59009176", "0.5861916", "0.58576536", "0.5833112", "0.5817784", "0.58058363", "0.5776264", "0.5772846", "0.57501096", "0.5746713", "0.5746314", "0.57442886", "0.5740841", "0.5737842", "0.5737842", "0.5737842", "0.5732998", "0.57275516", "0.5709102", "0.56859285", "0.5677174", "0.56606877", "0.5659679", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.56323695", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.55948126", "0.5586509", "0.5586509", "0.5586509", "0.5586509", "0.5586509", "0.5586509", "0.5586509" ]
0.78608096
0
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String url = ERROR; String msg; try { String bookID = request.getParameter("txtBookID"); String title = request.getParameter("txtTitle"); String author = request.getParameter("txtAuthor"); String catID = request.getParameter("cbCat"); String des = request.getParameter("txtDes"); float price = Float.parseFloat(request.getParameter("txtPrice")); int quantity = Integer.parseInt(request.getParameter("txtQuantity")); Date importDate = new Date(); String status = "Active"; String appPath = request.getServletContext().getRealPath("/"); String fullSavePath; if (appPath.endsWith("\\")) { fullSavePath = appPath + SAVE_DIRECTORY; } else { fullSavePath = appPath + "\\" + SAVE_DIRECTORY; } File fileSaveDir = new File(fullSavePath); if (!fileSaveDir.exists()) { fileSaveDir.mkdir(); } String image = ""; for (Part part : request.getParts()) { String fileName = MyUtils.extractFileName(part); if (fileName != null && fileName.length() > 0) { String extension = fileName.substring(fileName.lastIndexOf(".")); String filePath = fullSavePath + "\\" + bookID + extension; image = bookID + extension; part.write(filePath); } } BookDTO dto = new BookDTO(bookID, title, catID, author, des, image, status, price, quantity, importDate); BookDAO dao = new BookDAO(); if (dao.update(dto)) { msg = "Update success"; url = SUCCESS; } else { msg = "Update failed"; url = FAILED; } request.setAttribute("MSG", msg); } catch (SQLException | NamingException e) { log("ERROR at UpdateController: " + e.getMessage()); msg = "ERROR at UpdateController"; request.setAttribute("ERROR", msg); } finally { request.getRequestDispatcher(url).forward(request, response); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }" ]
[ "0.7004024", "0.66585696", "0.66031146", "0.6510023", "0.6447109", "0.64421695", "0.64405906", "0.64321136", "0.6428049", "0.6424289", "0.6424289", "0.6419742", "0.6419742", "0.6419742", "0.6418235", "0.64143145", "0.64143145", "0.6400266", "0.63939095", "0.63939095", "0.639271", "0.63919044", "0.63919044", "0.63903785", "0.63903785", "0.63903785", "0.63903785", "0.63887113", "0.63887113", "0.6380285", "0.63783026", "0.63781637", "0.637677", "0.63761306", "0.6370491", "0.63626", "0.63626", "0.63614637", "0.6355308", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896" ]
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197", "0.6515622", "0.6513045", "0.6512626", "0.6492367", "0.64817846", "0.6477479", "0.64725804", "0.6472099", "0.6469389", "0.6456206", "0.6452577", "0.6452577", "0.6452577", "0.6450273", "0.6450273", "0.6438126", "0.6437522", "0.64339423", "0.64253825", "0.6422238", "0.6420897", "0.6420897", "0.6420897", "0.6407662", "0.64041835", "0.64041835", "0.639631", "0.6395677", "0.6354875", "0.63334197", "0.6324263", "0.62959254", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6280875", "0.6272104", "0.6272104", "0.62711537", "0.62616795", "0.62544584", "0.6251865", "0.62274224", "0.6214439", "0.62137586", "0.621211", "0.620854", "0.62023044", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61638993", "0.61603814", "0.6148914", "0.61465937", "0.61465937", "0.614548", "0.6141879", "0.6136717", "0.61313903", "0.61300284", "0.6124381", "0.6118381", "0.6118128", "0.61063534", "0.60992104", "0.6098801", "0.6096766" ]
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }", "@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }" ]
[ "0.8763362", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.87320423", "0.8698972", "0.8698972", "0.8698972", "0.8698972", "0.8698972", "0.8698972", "0.8531154", "0.8531154", "0.85280526", "0.85280526", "0.85280526", "0.8527255", "0.8527255", "0.8527255", "0.8527255", "0.8527255", "0.8527255", "0.8516929", "0.8512195", "0.8511082", "0.8510197", "0.8496415" ]
0.0
-1
A SnippetStorage object handles generated snippet sets by name so that there is a history of created sets that all can be retrieved.
public interface SnippetStorage { /** * Get the latest added set. * @return The last added snippet set. */ SnippetSet getLatestSet(); boolean addSet(SnippetSet snippetSet); boolean addSet(String userName, SnippetSet snippetSet); boolean removeSet(String snippetSetName); boolean removeSet(String userName, String snippetSetName); SnippetSet renameSet(String oldSetName, String newSetName); SnippetSet renameSet(String userName, String oldSetName, String newSetName); List<String> getWorkingSetNames(); List<String> getWorkingSetNames(String userName); String[] storedContextIds(); SnippetSet getSet(String id); SnippetSet getSet(String userName, String id); Set<String> getAllSetNames(); void deleteSavedSets(List<String> savedSetNames ); void deleteSavedSets(String userName, List<String> savedSetNames ); boolean restoreContext(String id); boolean storeContext(String id); void setLogNote(String log, SnippetSet snippetSet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SnippetSet getLatestSet();", "public interface NamedStorage extends Iterable<String>, AutoCloseable {\n\n /**\n * Gets data stored by specified key and puts it to the provided stream.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to process data\n * @return true if data was found, false otherwise\n */\n boolean getInto(String key, OutputStream stream);\n\n /**\n * Saves data from stream using provided key. If there was data for this key it will be overwritten with new data.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to get data from\n */\n void saveFrom(String key, InputStream stream);\n\n /**\n * Checks that there is data stored for provided key\n * @param key data key\n * @return true if there is data for this key, false otherwise\n */\n boolean contains(String key);\n\n /**\n * Deletes key and associated data from storage. Does nothing if there is no such key in storage\n * @param key\n */\n void delete(String key);\n\n /**\n *\n * @return iterator for all keys. Order of keys is unknown.\n */\n Iterator<String> iterator();\n\n /**\n * Closes storage and flushes all changes on disk.\n */\n void close();\n\n /**\n * Copies all data to the specified storage\n * @param storage\n */\n void cloneTo(NamedStorage storage);\n}", "public interface Storage {\n\n String getId();\n}", "public interface SCStorage\r\n{\r\n\t/**\r\n\t * The server will register a driver before making any method calls\r\n\t *\r\n\t * @param driver the driver\r\n\t */\r\n\tpublic void setStorageServerDriver(SCStorageServerDriver driver);\r\n\r\n\t/**\r\n\t * Open the storage at the given path\r\n\t *\r\n\t * @param path path to the storage\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void\topen(File path) throws IOException;\r\n\r\n\t/**\r\n\t * Return the object associated with the given key\r\n\t *\r\n\t * @param key the key\r\n\t * @return the object or null if not found\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic SCDataSpec get(String key) throws IOException;\r\n\r\n\t/**\r\n\t * Add an object to the storage\r\n\t *\r\n\t * @param key key\r\n\t * @param data object\r\n\t * @param groups associated groups or null\r\n\t */\r\n\tpublic void put(String key, SCDataSpec data, SCGroupSpec groups);\r\n\r\n\t/**\r\n\t * Close the storage. The storage instance will be unusable afterwards.\r\n\t *\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void close() throws IOException;\r\n\r\n\t/**\r\n\t * Return the keys that match the given regular expression\r\n\t *\r\n\t * @param regex expression\r\n\t * @return matching keys\r\n\t */\r\n\tpublic Set<String> regexFindKeys(String regex);\r\n\r\n\t/**\r\n\t * Remove the given object\r\n\t *\r\n\t * @param key key of the object\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void remove(String key) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method deletes all objects\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to delete\r\n\t * @return list of keys deleted.\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> removeGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method lists all keys\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to list\r\n\t * @return list of keys\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> listGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * Returns storage statistics\r\n\t *\r\n\t * @param verbose if true, verbose stats are returned\r\n\t * @return list of stats\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> dumpStats(boolean verbose) throws IOException;\r\n\r\n\t/**\r\n\t * Write a tab delimited file with information about the key index\r\n\t *\r\n\t * @param f the file to write to\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void writeKeyData(File f) throws IOException;\r\n}", "public void getListAt( final String name, StorageLister lister ) throws TJSException;", "public interface Bucket {\n String getUid();\n\n String getName();\n\n Uri getImageUri();\n\n List<Selection> getSelections();\n\n void addSelection(Selection s);\n\n void removeSelection(Selection s);\n}", "public RecipeStorage getRecipeStorage() {\n return RecipeStorage.getInstance();\n }", "public DataStorage getDataStorage();", "OStorage getStorage();", "public HashMap<String, T> getStorage();", "StorageEntity getStorageById(Integer id);", "private void initStorage() {\n storageList = new ItemsList();\n storageList.add(new StorageItem(1, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pen.png\", \"pen\", 3));\n storageList.add(new StorageItem(2, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pencil.png\", \"pencil\", 2));\n storageList.add(new StorageItem(3, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\book.jpg\", \"book\", 21));\n storageList.add(new StorageItem(4, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\rubber.png\", \"rubber\", 1));\n storageList.add(new StorageItem(5, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\calculator.png\", \"calculator\", 15));\n storageList.add(new StorageItem(6, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\cover.jpg\", \"cover\", 4));\n storageList.add(new StorageItem(7, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\globe.png\", \"globe\", 46));\n storageList.add(new StorageItem(8, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\map.jpg\", \"map\", 10));\n storageList.add(new StorageItem(9, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\marker.png\", \"marker\", 6));\n\n }", "public Storage getStorage() {\n return this.storage;\n }", "public interface AggregationChunkStorage {\n\t/**\n\t * Creates a {@code StreamProducer} that streams records contained in the chunk.\n\t * The chunk to read is determined by {@code aggregationId} and {@code id}.\n\t *\n\t * @param recordClass class of chunk record\n\t * @param id id of chunk\n\t * @return StreamProducer, which will stream read records to its wired consumer.\n\t */\n\t<T> StreamProducer<T> chunkReader(Aggregation aggregation, List<String> keys, List<String> fields,\n\t Class<T> recordClass, long id, DefiningClassLoader classLoader);\n\n\t/**\n\t * Creates a {@code StreamConsumer} that persists streamed records.\n\t * The chunk to write is determined by {@code aggregationId} and {@code id}.\n\t *\n\t * @param fields fields of chunk record\n\t * @param recordClass class of chunk record\n\t * @param id id of chunk\n\t * @param producer producer of records\n\t */\n\t<T> void chunkWriter(Aggregation aggregation, List<String> keys, List<String> fields, Class<T>\n\t\t\trecordClass, long id, StreamProducer<T> producer, DefiningClassLoader classLoader, CompletionCallback callback);\n\n\t/**\n\t * Removes the chunk determined by {@code aggregationId} and {@code id}.\n\t *\n\t * @param id id of chunk\n\t * @param callback callback\n\t */\n\tvoid removeChunk(long id, CompletionCallback callback);\n}", "public Builder setItemStorage(int value) {\n bitField0_ |= 0x00000040;\n itemStorage_ = value;\n onChanged();\n return this;\n }", "public interface IStorage extends Serializable {\n\n /**\n * Removes all stored values.\n */\n void clear();\n\n /**\n * Removes the value stored under the given key (if one exists).\n *\n * @return {@code true} if a successful.\n */\n StoragePrimitive remove(String key);\n\n /**\n * Adds all mappings in {@code val} to this storage object, overwriting any existing values.\n *\n * @see #addAll(String, IStorage)\n */\n void addAll(IStorage val);\n\n /**\n * Adds all mappings in {@code val} to this storage object, where all keys are prefixed with\n * {@code prefix}. Any existing values are overwritten.\n */\n void addAll(String prefix, IStorage val);\n\n /**\n * @return All stored keys.\n * @see #getKeys(String)\n */\n Collection<String> getKeys();\n\n /**\n * @return A collection of all stored keys matching the given prefix, or all stored keys if the prefix is\n * {@code null}.\n */\n Collection<String> getKeys(@Nullable String prefix);\n\n /**\n * @return {@code true} if this storage object contains a mapping for the given key.\n */\n boolean contains(String key);\n\n /**\n * Returns raw value stored under the given key.\n */\n StoragePrimitive get(String key);\n\n /**\n * Returns value stored under the given key converted to a boolean.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n boolean getBoolean(String key, boolean defaultValue);\n\n /**\n * Convenience method for retrieving a 32-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to int.\n *\n * @see #getDouble(String, double)\n */\n int getInt(String key, int defaultValue);\n\n /**\n * Convenience method for retrieving a 64-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to long.\n *\n * @see #getDouble(String, double)\n */\n long getLong(String keyTotal, long defaultValue);\n\n /**\n * Returns value stored under the given key converted to a double.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n double getDouble(String key, double defaultValue);\n\n /**\n * Returns value stored under the given key converted to a string.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key.\n */\n String getString(String key, String defaultValue);\n\n /**\n * Stores a value under the given key. If {@code null}, removes any existing mapping for the given key\n * instead.\n */\n void set(String key, @Nullable StoragePrimitive val);\n\n /**\n * Stores a boolean value under the given key.\n *\n * @see #setString(String, String)\n */\n void setBoolean(String key, boolean val);\n\n /**\n * Convenience method for storing an integer. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setInt(String key, int val);\n\n /**\n * Convenience method for storing a long. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setLong(String key, long val);\n\n /**\n * Stores a double-precision floating point value under the given key.\n *\n * @see #setString(String, String)\n */\n void setDouble(String key, double val);\n\n /**\n * Stores a string value under the given key.\n *\n * @param val The value to store. If {@code null}, removes any existing mapping for the given key instead.\n */\n void setString(String key, String val);\n\n}", "@Override\n @Path(\"/storages/{sid}\")\n public IStorageResource findStorage(@PathParam(\"sid\") int storageId) {\n return new StorageResource(provider.getProviderId(), cluster.getClusterId(), storageId);\n }", "int getItemStorage();", "public interface StorageFactory {\n\n\t<T> List<T> createList();\n\t\n\t<T> Set<T> createSet();\n\t\n\t<V> Map<Character, V> createMap();\n\t\n}", "void cloneTo(NamedStorage storage);", "public com.hps.july.persistence.StoragePlaceAccessBean getStorage() {\n\treturn storage;\n}", "public interface IStorageManager {\n public IStorageBook getValue(String key);\n\n public void addStorageBook(String key, IStorageBook book);\n\n public void clear();\n\n public boolean isEmpty();\n\n public void remove(String key);\n}", "public void testCreateNewSet() {\n // browser.maximizeWindow();\n\n ListSetsPage listSetsPage = new ListSetsPage(browser);\n EditSetPage editSetPage = new EditSetPage(browser);\n String name = \"My First Set\";\n String description = \"This is the first set that I have built!\";\n List<Long> routineList = new ArrayList<Long>();\n // TO-DO: This needs to be refactored to populate its own routines (1 and 3 below)\n //routineList.add(1L);\n //routineList.add(3L);\n //editSetPage.createSet(name, description, routineList);\n browser.goTo(listSetsPage);\n listSetsPage.isAt();\n listSetsPage.hasSet(name);\n // TO-DO: Add tests to ensure the routines that should be in here are in here\n }", "public Storage(String s){\n this.path=s;\n }", "public interface Storage {\n\n public Collection<Developers> values();\n\n public int add(final Developers developer);\n\n public void edit(final Developers developer);\n\n public void delete(final int id);\n\n public Developers get(final int id);\n\n public Developers findByName(String name);\n\n public void close();\n}", "public void setStorage(Storage storage) {\n this.storage = storage;\n }", "public interface ContentDuplicator {\n\n /**\n * Gets the ID of the store from which content is to be retrieved\n * @return storeId of the FROM storage provider\n */\n public String getFromStoreId();\n\n /**\n * Gets the ID of the store to which content is to be duplicated\n * @return storeId of the TO storage provider\n */\n public String getToStoreId();\n\n /**\n * This method creates a newly duplicated content item in the arg spaceId\n * with the arg contentId.\n *\n * @param spaceId of content item\n * @param contentId of content item\n * @return checksum of content\n */\n public String createContent(String spaceId, String contentId);\n\n /**\n * This method updates an existing content item in the arg spaceId with the\n * arg contentId\n *\n * @param spaceId of content item\n * @param contentId of content item\n */\n public void updateContent(String spaceId, String contentId);\n\n /**\n * This method deletes an existing content item in the arg spaceId with the\n * arg contentId\n *\n * @param spaceId of content item\n * @param contentId of content item\n */\n public void deleteContent(String spaceId, String contentId);\n\n /**\n * This method performs any necessary clean-up of the ContentDuplicator.\n */\n public void stop();\n}", "private void genLoadSetCode(String name, String keyClassSimpleName) {\n\n int tabLevel = 1;\n String tabs = tabs(tabLevel);\n\n String keyCppType = cppType(keyClassSimpleName);\n\n String setType = \"std::set< \" + keyCppType + \" >\";\n\n load.println(\"\\t// \" + setType + \" this->\" + name);\n genDebug(load, \"\\tstd::cout << \\\"load \" + setType + \" \" + name + \"\\\" << std::endl;\");\n\n String vVarName = \"v\" + \"_\" + name;\n String lenVarName = vVarName + \"_length\";\n\n // read the length of the set\n load.println(tabs + \"int \" + lenVarName + \";\");\n\n load.println();\n load.println(tabs + INSTREAM_VAR_NAME + \".readInt(\" + lenVarName + \");\");\n\n genDebugDumpValue(load, lenVarName, tabs);\n\n load.println(tabs + setType + \"& \" + vVarName + \" = this->\" + name + \";\");\n\n // initialize & pre-allocate the set\n // load.println( tabs + vVarName + \".reserve( \" + lenVarName + \" );\");\n\n load.println();\n load.println(tabs + \"for( int i = 0; i < \" + lenVarName + \"; i++ ){\");\n\n tabs = tabs(++tabLevel);\n\n // load key\n String keyVarName = vVarName + \"_key\";\n load.println(tabs + keyCppType + \" \" + keyVarName + \";\");\n load.println(tabs + genReadCode(keyVarName, keyCppType));\n\n // add the new element to the set\n load.println(tabs + vVarName + \".insert( \" + keyVarName + \" );\");\n\n tabs = tabs(--tabLevel);\n load.println(tabs + \"}\");\n }", "IIndexFragmentFileSet createFileSet();", "public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);", "public void addStorage(StackType option);", "SequencerStorage getSequencerStorage();", "private void genSaveSetCode(String name, String keyClassSimpleName) {\n\n int tabLevel = 1;\n String tabs = tabs(tabLevel);\n\n String itVarName = \"i\" + \"_\" + name;\n String vVarName = \"v\" + \"_\" + name;\n\n String keyCppType = cppType(keyClassSimpleName);\n\n String setType = \"std::set< \" + keyCppType + \" >\";\n\n save.println(\"\\t// \" + setType + \" \" + name);\n genDebug(save, \"\\tstd::cout << \\\"save \" + setType + \" \" + name + \"\\\" << std::endl;\");\n\n // initialize local variable that points to the member set\n save.println(tabs + setType + \"& \" + vVarName + \" = this->\" + name + \";\");\n\n // number of elements in the set\n save.println(tabs + \"int \" + vVarName + \"_length = \" + vVarName + \".size();\");\n\n save.println();\n save.println(tabs + OUTSTREAM_VAR_NAME + \".writeInt( \" + vVarName + \"_length );\");\n\n genDebugDumpValue(save, vVarName + \"_length\", tabs);\n\n // loop through the elements and save each one\n save.println();\n save.println(tabs + setType + \"::iterator \" + itVarName + \";\");\n save.println(tabs + \"for( \" + itVarName + \" = \" + vVarName + \".begin(); \" + itVarName + \" != \" + vVarName + \".end(); ++\"\n + itVarName + \" ){\");\n\n tabs = tabs(++tabLevel);\n\n // save the key\n String keyVarName = vVarName + \"_key\";\n save.println(tabs + keyCppType + \" \" + keyVarName + \" = *\" + itVarName + \";\");\n save.println(tabs + genWriteCode(keyVarName, keyCppType));\n\n tabs = tabs(--tabLevel);\n save.println(tabs + \"}\");\n }", "@Override\n\tpublic ViewingObjectHolder getHolderFromFiles(String path) {\n\t\treturn new ViewingObjectHolder();\n\t}", "public static StorageInsights get(String name, Output<String> id, @Nullable StorageInsightsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {\n return new StorageInsights(name, id, state, options);\n }", "ContentStorage getContentStorage(TypeStorageMode mode) throws FxNotFoundException;", "StoreCollection getOrCreateCollection( String name);", "public interface Storage extends ClientListStorage, UserPrefsStorage, PolicyListStorage {\n\n @Override\n Optional<UserPrefs> readUserPrefs() throws DataConversionException, IOException;\n\n @Override\n void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException;\n\n @Override\n Path getClientListFilePath();\n\n @Override\n Optional<ReadOnlyClientList> readClientList() throws DataConversionException, IOException;\n\n @Override\n void saveClientList(ReadOnlyClientList clientList) throws IOException;\n\n @Override\n Path getPolicyListFilePath();\n\n @Override\n Optional<PolicyList> readPolicyList() throws DataConversionException, IOException;\n\n @Override\n void savePolicyList(PolicyList policyList) throws IOException;\n}", "Set createSet();", "public RandomizedSet() {\r\n\t\tbucket = new BucketItem[BUCKET_SIZE];\r\n\t}", "public StorageChunk() {\n\t\tsizeX = 0;\n\t\tsizeY = 0;\n\t\tsizeZ = 0;\n\t\ttileEntities = new ArrayList<TileEntity>();\n\t\tinventoryTiles = new ArrayList<TileEntity>();\n\t\tliquidTiles = new ArrayList<TileEntity>();\n\n\t\tworld = new WorldDummy(AdvancedRocketry.proxy.getProfiler(), this);\n\t}", "protected abstract RegistryStorage storage();", "public int getItemStorage() {\n return itemStorage_;\n }", "public interface IWritableStorage extends IStorage {\n\n\tpublic void setContents(InputStream source, IProgressMonitor monitor) throws CoreException;\n\t\n\tpublic IStatus validateEdit(Object context);\n}", "@Override\n @GET\n @Path(\"/storages\")\n @Produces(\"application/json\")\n public Response getStorages() {\n String json = String.format(\"Provider %d cluster %d storages.\", provider.getProviderId(), cluster.getClusterId());\n return Response.ok(json).build();\n }", "public <T extends SecretsStorage> T getSecretsStorage(Class<T> implementation, WithSecrets config) {\n\n return null;\n }", "public int getItemStorage() {\n return itemStorage_;\n }", "public CreateSnippet(PopupPanel parent, String buttonname) {\n\t\tthis.parent = parent;\n\n\t\tpnlRootPanel = new VerticalPanel();\n\t\tpnlProp = new HorizontalPanel();\n\t\tpnlControl = new HorizontalPanel();\n\t\tpnlTags = new HorizontalPanel();\n\t\tpnlAddedTags = new HorizontalPanel();\n\n\t\ttaglist = new ArrayList<String>();\n\n\t\tlblTitle = new Label(\"Create Snippet\");\n\t\tlblTitle.setStyleName(\"h3\");\n\n\t\tlblName = new Label();\n\t\tlblDesc = new Label();\n\t\tlblCode = new Label();\n\t\tlblLanguage = new Label();\n\t\ttxtName = new TextBox();\n\t\ttxtDescription = new TextArea();\n\t\ttxtCode = new TextArea();\n\t\tlstLanguage = new ListBox();\n\t\tlstCategory = new ListBox();\n\t\tlstLicense = new ListBox();\n\t\tlstLicense.addItem(\"CC\");\n\t\tlstLicense.addItem(\"GPL\");\n\n\t\ttxtCode.setSize(\"600px\", \"150px\");\n\n\t\t// updates the entries of the languages selector on demand\n\t\tlstLanguage.addChangeHandler(new ChangeHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onChange(ChangeEvent event) {\n\t\t\t\tif (lstLanguage.getSelectedIndex() != -1\n\t\t\t\t\t\t&& lstLanguage.getItemText(lstLanguage.getSelectedIndex()).equalsIgnoreCase(ISnippet.moreLanguages)) {\n\t\t\t\t\tlstLanguage.removeItem(lstLanguage.getSelectedIndex());\n\t\t\t\t\tfor (String lang : moreLanguageList)\n\t\t\t\t\t\tlstLanguage.addItem(lang);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tISnippet.Util.getInstance().getSupportedLanguages(new AsyncCallback<List<String>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tlblStatus.setText(\"Error retrieving supported languages\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<String> result) {\n\t\t\t\tif (result == null)\n\t\t\t\t\treturn;\n\t\t\t\tfor (String lang : result)\n\t\t\t\t\tlstLanguage.addItem(lang);\n\t\t\t}\n\t\t});\n\n\t\tISnippet.Util.getInstance().getMoreLanguages(new AsyncCallback<List<String>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tlblStatus.setText(\"Error retrieving supported languages\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<String> result) {\n\t\t\t\tif (result != null) {\n\t\t\t\t\tmoreLanguageList = result;\n\t\t\t\t} else {\n\t\t\t\t\tmoreLanguageList = new ArrayList<String>(0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tICategory.Util.getInstance().getCategories(null, new AsyncCallback<List<XCategory>>() {\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<XCategory> result) {\n\t\t\t\tif (result == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (XCategory category : result) {\n\t\t\t\t\tlstCategory.addItem(category.name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t// TODO Error handling\n\t\t\t\tlblStatus.setText(\"Error fetching categories list\");\n\t\t\t}\n\t\t});\n\n\t\ttxtTag = new TextBox();\n\t\ttxtTag.setStyleName(\"txtTag\");\n\t\ttxtTag.addKeyDownHandler(new KeyDownHandler() {\n\t\t\t@Override\n\t\t\tpublic void onKeyDown(KeyDownEvent event) {\n\t\t\t\tif (KeyCodes.KEY_ENTER == event.getNativeKeyCode()) {\n\t\t\t\t\taddTag(txtTag.getText());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tlblTags = new Label(\"Add Tags\");\n\t\tbtnTag = new Button(\"Add\");\n\t\tbtnTag.setStyleName(\"add\");\n\t\tbtnTag.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\n\t\t\t\taddTag(txtTag.getText());\n\t\t\t\ttxtTag.setText(\"\");\n\t\t\t}\n\t\t});\n\n\t\tbtCreate = new Button(buttonname);\n\t\tbtCreate.addClickHandler(new ClickHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tcreateSnippet();\n\t\t\t}\n\t\t});\n\t\tbtCancel = new Button(\"Cancel\");\n\t\tbtCancel.addClickHandler(new ClickHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\n\t\tlblStatus = new Label(\"\");\n\n\t\tlblName.setText(\"Snippet name\");\n\t\tlblDesc.setText(\"Description\");\n\t\tlblLanguage.setText(\"Language\");\n\t\tlblCode.setText(\"Snippet's code\");\n\n\t\tpnlControl.add(btCreate);\n\t\tpnlControl.add(btCancel);\n\n\t\tpnlProp.add(lstLanguage);\n\t\tpnlProp.add(lstCategory);\n\t\tpnlProp.add(lstLicense);\n\n\t\tpnlTags.add(txtTag);\n\t\tpnlTags.add(btnTag);\n\n\t\tpnlRootPanel.add(lblTitle);\n\t\tpnlRootPanel.add(lblName);\n\t\tpnlRootPanel.add(txtName);\n\t\tpnlRootPanel.add(lblDesc);\n\t\tpnlRootPanel.add(txtDescription);\n\t\tpnlRootPanel.add(lblCode);\n\t\tpnlRootPanel.add(txtCode);\n\n\t\tpnlRootPanel.add(pnlProp);\n\t\tpnlRootPanel.add(lblTags);\n\t\tpnlRootPanel.add(pnlTags);\n\t\tpnlRootPanel.add(pnlAddedTags);\n\t\tpnlRootPanel.add(pnlControl);\n\t\tpnlRootPanel.add(lblStatus);\n\n\t\tinitWidget(pnlRootPanel);\n\t}", "TreeStorage getTreeStorage();", "@NonNull\n public StorageReference getStorage() {\n return getTask().getStorage();\n }", "public JStorage storage() {\n return new JStorage(TH.THTensor_(storage)(this));\n }", "public SecretsStorage getSecretsStorageGoogle(GoogleSettings config, MagnoliaConfigurationProperties magnoliaConfigurationProperties) {\n return new SecretsStorageGoogleImpl();\n }", "public interface Storage {\n String SPLITTER = \" &&& \";\n\n /**\n * Gets the list of tasks held by the storage.\n * @return the list of tasks\n */\n TaskList getList();\n\n /**\n * Writes the task to the storage file.\n * @param task the task that is to be written in the task\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void addToList(Task task) throws InvalidCommandException;\n\n /**\n * Re-writes the storage file because of deletion or marking-as-done executed.\n * @param list the new task list used for updating the storage file\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void reWrite(TaskList list) throws InvalidCommandException;\n}", "Storage(String filepath) {\n this.filepath = filepath;\n tasks = new ArrayList<>();\n parser = new Parser();\n }", "List<Storage> selectByExample(StorageExample example);", "public interface Gallery {\n\n /**\n * Add the specified art piece to the gallery, replacing an equivalent in the gallery if existing.\n *\n * @param art the art piece to add to the gallery\n */\n void addArt(Art art);\n\n /**\n * Remove the specified art piece from the gallery if found.\n *\n * @param art he art piece to remove from the gallery\n */\n void deleteArt(Art art);\n\n /**\n * Return the collection of art pieces in the gallery, is cannot be modified.\n *\n * @return all the art pieces in the gallery\n */\n Set<Art> getAllArt();\n\n /**\n * Return list of unique artists with art represented in the gallery, in alphabetical order.\n *\n * @return list of artists\n */\n List<String> getArtists();\n\n /**\n * Return all art for the specified artist\n *\n * @param artist the artist for which to retrieve all art pieces\n *\n * @return all the art pieces for the artist\n */\n Set<Art> getArtByArtist(String artist);\n\n /**\n * Return all art pieces created in the gallery within the past year\n *\n * @return all art pieces created in the gallery within the past year\n */\n Set<Art> getRecentArt();\n\n /**\n * Return all art pieces with an asking price in between the specified upper and lower bands.\n *\n * @param upper the upper price band\n * @param lower the lower price band\n *\n * @return all art pieces with an asking price in between the specified upper and lower bands.\n */\n Set<Art> getArtByPrice(Double upper, Double lower);\n}", "public IntegerStorage getiStorage() {\n\t\treturn iStorage;\n\t}", "public IntegerStorage getiStorage() {\n\t\treturn iStorage;\n\t}", "public SecretsStorage getSecretsStorageAWS(AWSSettings config, MagnoliaConfigurationProperties magnoliaConfigurationProperties) {\n return new SecretsStorageAWSImpl();\n }", "java.lang.String getArtifactStorage();", "public java.util.Enumeration getStorages() {\n\ttry {\n\t\tStorageAccessBean bean = new StorageAccessBean();\n\t\treturn bean.findAllOrderByNameAsc();\n\t} catch(Exception e) {\n\t\treturn (new java.util.Vector()).elements();\n\t}\n}", "public interface StorageService {\n\n /**\n * List all the {@link Bucket}s in a given {@link com.google.openbidder.ui.entity.Project}.\n */\n List<Bucket> listAllBuckets(ProjectUser projectUser);\n\n /**\n * List all the objects in a given {@link Bucket}.\n */\n BucketContents listAllObjectsInBucket(ProjectUser projectUser, String bucketName);\n\n /**\n * List all objects in a given {@link Bucket} with a prefix.\n */\n BucketContents listAllObjectsInBucket(\n ProjectUser projectUser,\n String bucketName,\n String objectPrefix);\n\n /**\n * Remove the specified object.\n */\n void deleteObject(ProjectUser projectUser, String bucketName, String objectName);\n}", "public interface Storage {\r\n\r\n\tpublic void createSeat(int number, int situation, int musicalEvent,int iCategory);\r\n\tpublic int updateSeat(int number, int situation, int idMusicalEvent);\r\n\tpublic int deleteSeat(int number, int idMusicalEvent);\r\n\tpublic int getSeatNumber(int number, int idMusicalEvent);\r\n\tpublic Seat getSeat(int number, int idMusicalEvent);\r\n\tpublic Seat getSeatById(int id, int idMusicalEvent);\r\n\tpublic void createMusicalEvent(String eventName, Date date, String description);\r\n\tpublic String loadMusicalEvent();\r\n\tpublic MusicalEvent getMusicalEvent(int id);\r\n\tpublic void createClient(String firstname, String surname, String mobilePhone, String firstPhone, String secondPhone, String email,String passport,\r\n\t\t\tString rg, String address, String city, String cpf, Date bornDate);\r\n\tpublic Client getClient(String passport);\r\n\tpublic Client getClient(int id);\r\n\tpublic void updateClient(String firstname, String surname, String mobilePhone, String firstPhone, String secondPhone, String email,String passport,\r\n\t\t\tString rg, String address, String city, String cpf, Date bornDate);\r\n\tpublic String deleteClient(String idPassport);\r\n\tpublic String getSeats(String musicalEvent);\r\n\tpublic String getClients();\r\n\tpublic int createTicket(int musicalEvent,int seat, int price, Date saleDate, int client, String paidForm);\r\n\tpublic void createCategory(String name, int tax);\r\n\tpublic int updateCategory(String name, int tax);\r\n\tpublic int deleteCategory(String name);\r\n\tpublic SeatCategory findCategory (String name);\r\n\tpublic SeatCategory findCategory (int id);\r\n\tpublic String getCategories();\r\n\tpublic TicketSale getTicketSale(Client c, Seat s, Date date);\r\n\tpublic TicketSale getTicketSale(int id);\r\n\tpublic int getTaxFromCategory(Seat seat);\r\n\tpublic int deleteTicket(int idTicket);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n}", "LockStorage getLockStorage();", "public static TemplateStore getDjangoTemplateStore() {\n if (templatesStore == null) {\n \ttemplatesStore = new ContributionTemplateStore(\n \t\t\t\t\t\t\tgetDjangoContextTypeRegistry(),\n \t\t\t\t\t\t\tActivator.getDefault().getPreferenceStore(),\n \t\t\t\t\t\t\tDJANGO_CUSTOM_TEMPLATES_KEY\n \t\t\t\t\t\t);\n try {\n \tLogging.info(\"Inside the TemplateStore Method\");\n \ttemplatesStore.load();\n \tLogging.info(\"Outside the TemplateStore Method\");\n \tTemplate templates[]=templatesStore.getTemplates(\"com.gokul.second.templates.CryTemplateContext.cry\");\n \tLogging.info(\"Before the TemplateStore Method Loop\"+templates.length);\n \tfor(int i=0;i<templates.length;i++)\n \t{\n \t\tLogging.info(\"Inside the Display TemplateStore Method\"+templates[i].getDescription());\n \t\tSystem.out.println(templates.toString());\n \t}\n \t//List<Template> list=new ArrayList<Template>(Arrays.asList(templates))\n// \tfor(Template template: templates)\n// \t{\n// \t\tSystem.out.println(\"Inside TemplateStore\");\n// \t\tSystem.out.println(template.getDescription());\n// \t\tSystem.out.println(template.getContextTypeId());\n// \t}\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }\n return templatesStore;\n }", "public static void setStorage(Storage storage) {\n Parser.storage = storage;\n }", "public void updateToNBTTagStorage () {\r\n\t\t// no book saved?\r\n\t\tif (storage.getBoolean(\"isBook\") == null || storage.getBoolean(\"isBook\") == false)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tNBTTagCompound\ttag\t\t= new NBTTagCompound();\r\n\t\tString \t\t\tauthor\t= storage.getString\t(\"book-author\"\t);\r\n\t\tString\t\t\ttitle\t= storage.getString\t(\"book-title\"\t);\r\n\t\tint\t\t\t\tpages\t= storage.getInteger(\"book-pages\"\t);\r\n\t\tNBTTagList\t\tlist\t= new NBTTagList();\r\n\t\t\r\n\t\tfor (int i = 0; i < pages; i++) {\r\n\t\t\tString\t\t\tsiteContent\t= storage.getString(\"book-page-\"+i);\r\n\t\t\tNBTTagString\ttString\t\t= new NBTTagString(siteContent);\r\n\t\t\t\r\n\t\t\ttString.data\t= siteContent;\r\n\t\t\t\r\n\t\t\tlist.add(tString);\r\n\t\t}\r\n\t\t\r\n\t\ttag.setString\t(\"author\", \tauthor);\r\n\t\ttag.setString\t(\"title\",\ttitle);\r\n\t\ttag.set\t\t\t(\"pages\", \tlist);\r\n\t\tsetNBTTagCompound(tag);\r\n\t}", "public void setStorage(com.hps.july.persistence.StoragePlaceAccessBean newStorage) {\n\tstorage = newStorage;\n}", "public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}", "public Snippet(String name, String snippet, String description, Set<String> keywords, Language language) {\n super();\n\n if (name == null) {\n throw new NullPointerException(\"Name cannot be null\");\n }\n\n if (name.isEmpty()) {\n throw new IllegalArgumentException(\"Name cannot be empty\");\n }\n\n if (keywords == null) {\n throw new NullPointerException(\"Keywords cannot be null\");\n }\n\n this.name = name;\n this.snippet = snippet;\n this.description = description;\n this.keywords = keywords;\n this.language = language;\n }", "public InMemoryKeyValueStorage() {\n this(SEGMENT_IDENTIFIER);\n }", "@Override\n\tpublic void setStorage() {\n\t\tcom.setStorage(\"256g SSD\");\n\t}", "@Override\n\tpublic synchronized StorageOperationResponse<GetStoragePoolsResponse> getStoragePools(\n\t\t\tGetStoragePoolsRequest request) {\n\t\tlogger.log(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools: request:\" + request, null);\n\t\tGetStoragePoolsResponse payload = new GetStoragePoolsResponse();\n\t\tArrayList<StoragePool> storagePools = new ArrayList<StoragePool>();\n\t\tList<String> zones = null;\n\t\t BlockLimits blockLimits=openstackClient.getBlockStorageLimits();\n\t\t long totalSpaceGB=blockLimits.getAbsolute().getMaxTotalVolumeGigabytes();\n\t\t long usedSpaceGB=blockLimits.getAbsolute().getTotalGigabytesUsed();\n\t\t \n\t\tif (request.storageSystemId != null) {\n\t\t\tString region = openstackClient.getOpenstackId(request.storageSystemId);\n\t\t\ttry {\n\t\t\t\tzones = openstackClient.listAvailabilityZones(region);\n\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.traceThrowable(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools:\" + e.getMessage(), null,e);\n\t\t\t \treturn StorageAdapterImplHelper.createFailedResponse(e.getMessage(), GetStoragePoolsResponse.class); \n\t\t\t}\n\t\t\n\t\t\tfor (String zone:zones) {\n\t\t\t\tstoragePools.add(OpenstackAdapterUtil.createStoragePool(zone, region, accountId, totalSpaceGB, usedSpaceGB));\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t if (request.storagePoolIds == null || request.storagePoolIds.isEmpty()) {\n\t\t\t return StorageAdapterImplHelper.createFailedResponse(\"Bad request: both storageSystemId and storagePoolIds are null\", GetStoragePoolsResponse.class); \n\t\t }\n\t\t try {\n \n\t\t\t String zone = null;\n\t\t\t String region = null;\t\t \n\t\t\t for (String poolId:request.storagePoolIds) {\n\t\t\t\tif (poolId == null || poolId.indexOf(':') == -1) {\n\t\t\t\t\tstoragePools.add(null);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tzone = openstackClient.getOpenstackId(poolId);\n\t\t\t\tregion = openstackClient.getRegion(poolId);\n\t\t\t\t if (zone.equals(OpenstackConstants.Openstack_POOL_SNAPSHOTS)) {\n\t\t\t\t\t storagePools.add(OpenstackAdapterUtil.createStoragePool(OpenstackConstants.Openstack_POOL_SNAPSHOTS, region, accountId,totalSpaceGB, usedSpaceGB));\n\t\t\t\t } else {\n\t\t\t\t zones = openstackClient.listAvailabilityZones(region);\n\t\t\t\t if (zones.contains(zone)) {\n\t\t\t\t \tstoragePools.add(OpenstackAdapterUtil.createStoragePool(zone, region, accountId,totalSpaceGB, usedSpaceGB));\t\n\t\t\t\t\t} else {\n\t\t\t\t storagePools.add(null);\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\n\t\t } catch (Exception e) {\n\t\t\tlogger.traceThrowable(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools:\" + e.getMessage(), null,e);\n\t\t\treturn StorageAdapterImplHelper.createFailedResponse(e.getMessage(), GetStoragePoolsResponse.class); \n\t\t }\n\t\t \n\t\t}\n\t\tlogger.log(IJavaEeLog.SEVERITY_DEBUG, this.getClass().getName(), \"getStoragePools: pools found: \" + storagePools.size() + \" pools: \" + storagePools , null);\n\t\tpayload.storagePools = storagePools;\n\t\tStorageOperationResponse<GetStoragePoolsResponse> response = new StorageOperationResponse<GetStoragePoolsResponse>(payload);\n\t\tresponse.setPercentCompleted(100);\n\t\tresponse.setStatus(StorageOperationStatus.COMPLETED);\n\t\treturn response;\n\t}", "public interface StorageService {\n\n /**\n * Return the ReplicatSet configuration (list of services able to pin a file)\n * @return ReplicaSet List of PinningService\n */\n Set<PinningService> getReplicaSet();\n \n /**\n * Write content on the storage layer\n * @param content InputStream\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(InputStream content, boolean noPin);\n\n /**\n * Write content on the storage layer\n * @param content Byte array\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(byte[] content, boolean noPin);\n\n /**\n * Read content from the storage layer and write it in a ByteArrayOutputStream\n * @param id Content ID (hash, CID\n * @return content\n */\n OutputStream read(String id);\n \n /**\n * Read content from the storage layer and write it the OutputStream provided\n * @param id Content ID (hash, CID\n * @param output OutputStream to write content to\n * @return Outputstream passed as argument\n */\n OutputStream read(String id, OutputStream output);\n}", "public interface DistributeStorage<T> {\n public void store(String path, T t, boolean create) throws StorageException;\n\n public T get(String path, Class<T> tClass) throws StorageException;\n\n public void del(String path) throws StorageException;\n\n public boolean exist(String path) throws StorageException;\n}", "public static MappingSet createMappingSet(String mappingName, String inverseName, String purpose, String description, UUID editorStatus) \r\n\t\t\tthrows IOException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tAppContext.getRuntimeGlobals().disableAllCommitListeners();\r\n\r\n\t\t\t//We need to create a new concept - which itself is defining a dynamic sememe - so set that up here.\r\n\t\t\tDynamicSememeUsageDescription rdud = DynamicSememeUtility.createNewDynamicSememeUsageDescriptionConcept(\r\n\t\t\t\t\tmappingName, mappingName, description, \r\n\t\t\t\t\tnew DynamicSememeColumnInfo[] {\r\n\t\t\t\t\t\tnew DynamicSememeColumnInfo(0, IsaacMetadataConstants.DYNAMIC_SEMEME_COLUMN_ASSOCIATION_TARGET_COMPONENT.getUUID(), \r\n\t\t\t\t\t\t\t\tDynamicSememeDataType.UUID, null, false),\r\n\t\t\t\t\t\tnew DynamicSememeColumnInfo(1, IsaacMappingConstants.MAPPING_QUALIFIERS.getUUID(), DynamicSememeDataType.UUID, null, false, \r\n\t\t\t\t\t\t\t\tDynamicSememeValidatorType.IS_KIND_OF, new DynamicSememeUUID(IsaacMappingConstants.MAPPING_QUALIFIERS.getUUID())),\r\n\t\t\t\t\t\tnew DynamicSememeColumnInfo(2, IsaacMappingConstants.MAPPING_STATUS.getUUID(), DynamicSememeDataType.UUID, null, false, \r\n\t\t\t\t\t\t\t\tDynamicSememeValidatorType.IS_KIND_OF, new DynamicSememeUUID(IsaacMappingConstants.MAPPING_STATUS.getUUID()))}, \r\n\t\t\t\t\tnull, ObjectChronologyType.CONCEPT, null);\r\n\t\t\t\r\n\t\t\tUtility.execute(() ->\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tAppContext.getRuntimeGlobals().disableAllCommitListeners();\r\n\t\t\t\t\tDynamicSememeIndexerConfiguration.configureColumnsToIndex(rdud.getDynamicSememeUsageDescriptorSequence(), new Integer[] {0, 1, 2}, true);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\tLOG.error(\"Unexpected error enabling the index on newly created mapping set!\", e);\r\n\t\t\t\t}\r\n\t\t\t\tfinally\r\n\t\t\t\t{\r\n\t\t\t\t\tAppContext.getRuntimeGlobals().enableAllCommitListeners();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tConceptSnapshotService css = Get.conceptService().getSnapshot(\r\n\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getStampCoordinate().get(), \r\n\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getLanguageCoordinate().get());\r\n\t\t\t\r\n\t\t\t//Then, annotate the concept created above as a member of the MappingSet dynamic sememe, and add the inverse name, if present.\r\n\t\t\tConceptSnapshot cs = css.getConceptSnapshot(rdud.getDynamicSememeUsageDescriptorSequence());\r\n\t\t\tif (!StringUtils.isBlank(inverseName))\r\n\t\t\t{\r\n\t\t\t\tObjectChronology<?> builtDesc = LookupService.get().getService(DescriptionBuilderService.class).getDescriptionBuilder(inverseName, cs.getConceptSequence(), \r\n\t\t\t\t\t\tIsaacMetadataAuxiliaryBinding.SYNONYM, IsaacMetadataAuxiliaryBinding.ENGLISH).build(\r\n\t\t\t\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getEditCoordinate().get(), ChangeCheckerMode.ACTIVE);\r\n\t\t\t\t\r\n\t\t\t\tGet.sememeBuilderService().getDyanmicSememeBuilder(builtDesc.getNid(),IsaacMetadataConstants.DYNAMIC_SEMEME_ASSOCIATION_INVERSE_NAME.getSequence()).build(\r\n\t\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getEditCoordinate().get(), ChangeCheckerMode.ACTIVE);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@SuppressWarnings(\"rawtypes\")\r\n\t\t\tSememeChronology mappingAnnotation = Get.sememeBuilderService().getDyanmicSememeBuilder(Get.identifierService().getConceptNid(rdud.getDynamicSememeUsageDescriptorSequence()),\r\n\t\t\t\t\tIsaacMappingConstants.DYNAMIC_SEMEME_MAPPING_SEMEME_TYPE.getSequence(), \r\n\t\t\t\t\tnew DynamicSememeDataBI[] {\r\n\t\t\t\t\t\t\t(editorStatus == null ? null : new DynamicSememeUUID(editorStatus)),\r\n\t\t\t\t\t\t\t(StringUtils.isBlank(purpose) ? null : new DynamicSememeString(purpose))}).build(\r\n\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getEditCoordinate().get(), ChangeCheckerMode.ACTIVE);\r\n\r\n\t\t\t\r\n\t\t\tGet.sememeBuilderService().getDyanmicSememeBuilder(Get.identifierService().getConceptNid(rdud.getDynamicSememeUsageDescriptorSequence()),\r\n\t\t\t\t\tIsaacMetadataConstants.DYNAMIC_SEMEME_ASSOCIATION_SEMEME.getSequence()).build(\r\n\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getEditCoordinate().get(), ChangeCheckerMode.ACTIVE);\r\n\t\t\t\r\n\t\t\tTask<Optional<CommitRecord>> task = Get.commitService().commit(\"update mapping item\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\ttask.get();\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tOptional<LatestVersion<DynamicSememe<?>>> sememe = mappingAnnotation.getLatestVersion(DynamicSememe.class, \r\n\t\t\t\t\tExtendedAppContext.getUserProfileBindings().getStampCoordinate().get());\r\n\t\t\t\r\n\t\t\t//Find the constructed dynamic refset\r\n\t\t\treturn new MappingSet(sememe.get().value());\r\n\t\t\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tAppContext.getRuntimeGlobals().enableAllCommitListeners();\r\n\t\t}\r\n\t}", "public interface IStorageManager {\n\n\tpublic String getStorageType();\n\n\tpublic String getStorageId();\n\n\tpublic void initialize(String configFile) throws Exception;\n}", "edu.usfca.cs.dfs.StorageMessages.StoreChunk getStoreChunk();", "public void setStorage(String storage) {\n if (storage == null || storage.equals(\"\") || storage.equals(\" \")) {\n throw new IllegalArgumentException(\"storage must be provided\");\n }\n this.storage = storage;\n }", "public interface StorageModel {\n}", "public void setStorageplace(int newStorageplace) {\n\tstorageplace = newStorageplace;\n}", "void setTempStorage(Map<String, Object> storage);", "protected void setStorage(IStorage aStorage)\n\t{\n\n\t\tthis.storage = aStorage;\n\t}", "public SnippetBook()\n {\n\n MyAuthenticatedWebSession app_session = MyAuthenticatedWebSession.getYourAppSession();\n logger.info(\"web session is: \"+app_session.toString());\n\n EntityManager em = app_session.getEntityManager();\n\n\n List<Snip> tmp_snip_list= em.createQuery(\n \"SELECT s FROM Snip s WHERE users.id = :userID\")\n .setParameter(\"userID\", app_session.getAttribute(\"user\"))\n .getResultList(); //TODO: set max result number\n\n //logger.info(((Snip)tmp_snip_list.get(0)).getCode());\n /*AuthenticatedWebApplication.get().\n Class<? extends Session> session_class = getSession();.getClass();\n getSession().getApplication().getSessionStore();\n */\n // Add comment form\n\n add(new SnippetForm(\"commentForm\"));\n\n // Add commentListView of existing comments\n add(new PropertyListView<Snip>(\"comments\", snipList)\n {\n @Override\n public void populateItem(final ListItem<Snip> listItem)\n {\n //logger.info(listItem.toString());\n listItem.add(new Label(\"date\"));\n listItem.add(new MultiLineLabel(\"code\"));\n }\n }).setVersioned(false);\n Collections.reverse(tmp_snip_list);\n snipList.addAll(tmp_snip_list);\n }", "protected abstract void updateStorage(MasterMetaStorage storage) throws JSONException;", "protected BlockGrantGroupStorage newBlockGrantGroupStorage()\n\t{\n\t\treturn new DbCachedBlockGrantGroupStorage(new BlockGrantGroupStorageUser());\n\t}", "public void addStorage(AbstractStorageOfFoods storage) {\n storages.add(storage);\n }", "public EhcacheSessionDataStorage(String name) {\n this.sessions = CacheManager.getInstance().getCache(name);\n }", "public ShelterList() {\n shelters = new HashMap<>();\n }", "public void setStorageLocation(String storageLocation) {\n this.storageLocation = storageLocation;\n }", "public void setStorageGroup(PartialPath path) throws MetadataException {\n String[] nodeNames = path.getNodes();\n MetaFormatUtils.checkStorageGroup(path.getFullPath());\n if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {\n throw new IllegalPathException(path.getFullPath());\n }\n IMNode cur = root;\n int i = 1;\n // e.g., path = root.a.b.sg, create internal nodes for a, b\n while (i < nodeNames.length - 1) {\n IMNode temp = cur.getChild(nodeNames[i]);\n if (temp == null) {\n cur.addChild(nodeNames[i], new InternalMNode(cur, nodeNames[i]));\n } else if (temp.isStorageGroup()) {\n // before create database, check whether the database already exists\n throw new StorageGroupAlreadySetException(temp.getFullPath());\n }\n cur = cur.getChild(nodeNames[i]);\n i++;\n }\n\n // synchronize check and add, we need addChild operation be atomic.\n // only write operations on mtree will be synchronized\n synchronized (this) {\n if (cur.hasChild(nodeNames[i])) {\n // node b has child sg\n if (cur.getChild(nodeNames[i]).isStorageGroup()) {\n throw new StorageGroupAlreadySetException(path.getFullPath());\n } else {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n } else {\n IStorageGroupMNode storageGroupMNode =\n new StorageGroupMNode(\n cur, nodeNames[i], CommonDescriptor.getInstance().getConfig().getDefaultTTLInMs());\n\n IMNode result = cur.addChild(nodeNames[i], storageGroupMNode);\n\n if (result != storageGroupMNode) {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n }\n }\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n this.ui = new Ui();\n }", "void setPermStorage(Map<String, Object> storage);", "protected Collection getNewBucket()\n {\n return new ArrayList();\n }", "private Set func_177575_g() {\n/* 450 */ HashSet var1 = Sets.newHashSet();\n/* 451 */ ArrayList<?> var2 = Lists.newArrayList(this.variants.keySet());\n/* 452 */ Collections.sort(var2, new Comparator()\n/* */ {\n/* */ private static final String __OBFID = \"CL_00002390\";\n/* */ \n/* */ public int func_177505_a(ModelResourceLocation p_177505_1_, ModelResourceLocation p_177505_2_) {\n/* 457 */ return p_177505_1_.toString().compareTo(p_177505_2_.toString());\n/* */ }\n/* */ \n/* */ public int compare(Object p_compare_1_, Object p_compare_2_) {\n/* 461 */ return func_177505_a((ModelResourceLocation)p_compare_1_, (ModelResourceLocation)p_compare_2_);\n/* */ }\n/* */ });\n/* 464 */ Iterator<?> var3 = var2.iterator();\n/* */ \n/* 466 */ while (var3.hasNext()) {\n/* */ \n/* 468 */ ModelResourceLocation var4 = (ModelResourceLocation)var3.next();\n/* 469 */ ModelBlockDefinition.Variants var5 = (ModelBlockDefinition.Variants)this.variants.get(var4);\n/* 470 */ Iterator<ModelBlockDefinition.Variant> var6 = var5.getVariants().iterator();\n/* */ \n/* 472 */ while (var6.hasNext()) {\n/* */ \n/* 474 */ ModelBlockDefinition.Variant var7 = var6.next();\n/* 475 */ ModelBlock var8 = (ModelBlock)this.models.get(var7.getModelLocation());\n/* */ \n/* 477 */ if (var8 == null) {\n/* */ \n/* 479 */ LOGGER.warn(\"Missing model for: \" + var4);\n/* */ \n/* */ continue;\n/* */ } \n/* 483 */ var1.addAll(func_177585_a(var8));\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* 488 */ var1.addAll(field_177602_b);\n/* 489 */ return var1;\n/* */ }", "public SharedPreferenceStorage(Context context, String prefName) {\n prefs = context.getSharedPreferences(prefName == null ?\n SharedPreferenceStorage.class.getCanonicalName() : prefName, MODE_PRIVATE);\n }", "public DefaultStorage() {\n }", "public abstract String generateStorageString();", "public Set<String> getStringSet(@NonNull String name, Set<String> defaultValue) {\n SharedPreferences prefs = context.getSharedPreferences(filename, Context.MODE_PRIVATE);\n return prefs == null ? defaultValue : prefs.getStringSet(name, defaultValue);\n }", "@Override\n\tpublic String addInStorage(InStorage ins) {\n\t\treturn super.addObject(ins);\n\t}" ]
[ "0.55348146", "0.54461217", "0.5187794", "0.5097167", "0.49962378", "0.4977272", "0.49436858", "0.49182454", "0.49152753", "0.48996297", "0.48631203", "0.48579276", "0.4847698", "0.48458296", "0.48435307", "0.4832006", "0.48286483", "0.48083505", "0.47816494", "0.47783276", "0.47143465", "0.47071767", "0.4690711", "0.4671649", "0.46613753", "0.46599266", "0.46509126", "0.4649714", "0.46457422", "0.46306518", "0.46279335", "0.4618821", "0.46074343", "0.45894477", "0.4581145", "0.45721704", "0.45711166", "0.45607302", "0.45544082", "0.45424783", "0.45396855", "0.4538761", "0.45312274", "0.45190966", "0.45091897", "0.44768998", "0.44763166", "0.44727978", "0.44602603", "0.44196475", "0.44165117", "0.4386782", "0.4382961", "0.43793437", "0.43742192", "0.43587282", "0.43537334", "0.43537334", "0.43461695", "0.43452626", "0.43348762", "0.43288583", "0.43279603", "0.43201363", "0.43014693", "0.4299583", "0.42960748", "0.429595", "0.42950302", "0.42891058", "0.4283619", "0.42737916", "0.42706951", "0.4270348", "0.42673764", "0.42650077", "0.42525244", "0.4251172", "0.42455602", "0.42336577", "0.42297804", "0.42097655", "0.42075142", "0.42058045", "0.42053327", "0.41969305", "0.41957718", "0.41897282", "0.41838828", "0.4182284", "0.41756764", "0.4175247", "0.41719997", "0.41713026", "0.41702572", "0.41667488", "0.41639337", "0.416204", "0.4156419", "0.41562825" ]
0.7806722
0
Get the latest added set.
SnippetSet getLatestSet();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DataPoint getLastAddedPoint() {\n return lastAddedPoint;\n }", "public V getLatest() {\n return lastItemOfList(versions);\n }", "Set<Art> getRecentArt();", "public Item getLast();", "public SeleniumQueryObject last() {\n\t\treturn LastFunction.last(this, this.elements);\n\t}", "public T last() throws EmptyCollectionException;", "public O last()\r\n {\r\n if (isEmpty()) return null;\r\n return last.getObject();\r\n }", "private List<E> snapshot() {\n\t\tList<E> list = Lists.newArrayListWithExpectedSize(size());\n\t\tfor (Multiset.Entry<E> entry : entrySet()) {\n\t\t\tE element = entry.getElement();\n\t\t\tfor (int i = entry.getCount(); i > 0; i--) {\n\t\t\t\tlist.add(element);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public Object last() {\r\n\t\treturn elements.get(size() - 1);\r\n\t}", "public E pollLast() {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tE ret = (E) data.get(data.size() - 1);\r\n\t\tdata.remove(data.size() - 1);\r\n\t\treturn ret;\r\n\t}", "public Item getLast() {\n return items[size - 1];\n }", "public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }", "public Node getLast() {\r\n\t\treturn getNode(this.size());\r\n\t}", "public T getLast();", "public T getLast();", "public HistoryEntry getLastEntry() {\n\t\t\treturn null;\n\t\t}", "public E getLast() {\r\n\r\n\t\treturn (E) data.get(data.size() - 1);\r\n\t}", "T latest();", "private List<Multiset.Entry<E>> snapshot() {\n\t\t\tList<Multiset.Entry<E>> list = Lists\n\t\t\t\t\t.newArrayListWithExpectedSize(size());\n\t\t\tfor (Multiset.Entry<E> entry : this) {\n\t\t\t\tlist.add(entry);\n\t\t\t}\n\t\t\treturn list;\n\t\t}", "public T getMaxEntryCountSet() {\n IDataSet iDataSet;\n if (this.mDataSets == null || this.mDataSets.isEmpty()) {\n iDataSet = null;\n return (T)iDataSet;\n } else {\n IDataSet iDataSet2 = (IDataSet)this.mDataSets.get(0);\n Iterator<T> iterator = this.mDataSets.iterator();\n do {\n iDataSet = iDataSet2;\n if (!iterator.hasNext()) return (T)iDataSet;\n iDataSet = (IDataSet)iterator.next();\n if (iDataSet.getEntryCount() <= iDataSet2.getEntryCount()) continue;\n iDataSet2 = iDataSet;\n } while (true);\n }\n }", "public TypeHere getLast() {\n return items[size - 1];\n }", "public FeatureCollection getLastEditedFeatures(){\n return fcLastEdits;\n }", "public E pollLast();", "public Set<E> getNextSet()\r\n/* */ {\r\n/* 155 */ List<E> result = getNextArray();\r\n/* 156 */ if (result == null) {\r\n/* 157 */ return null;\r\n/* */ }\r\n/* */ \r\n/* 160 */ Set<E> resultSet = new LinkedHashSet(result);\r\n/* 161 */ return resultSet;\r\n/* */ }", "public Item getDeletedEntry() {\n Item item = deletedEntries.lastElement();\n deletedEntries.pop();\n return item;\n }", "String getAdded();", "@Override\r\n\tpublic E removeLast() {\n\t\treturn pollLast();\r\n\t}", "public ODataChangeset addChangeset() {\n closeCurrentItem();\n\n // stream dash boundary\n streamDashBoundary();\n\n final ODataChangesetResponseItem expectedResItem = new ODataChangesetResponseItem();\n expectedResItems.add(expectedResItem);\n\n currentItem = new ODataChangeset(req, expectedResItem);\n\n return (ODataChangeset) currentItem;\n }", "public Set getModified() {\r\n return Collections.unmodifiableSet(modified);\r\n }", "public T last() throws EmptyCollectionException{\n if (rear == null){\n throw new EmptyCollectionException(\"list\");\n }\n return rear.getElement();\n }", "public Set<Entry> getSet() {\n Set<Entry> litSet = this.litRegister;\n return litSet;\n }", "public Object peek() {return collection.get(collection.size() - 1);}", "public GPoint last() {\n\t\tif (points.isEmpty()) {\n\t\t\tthrow new IllegalStateException(\"line group is empty\");\n\t\t}\n\t\treturn points.get(points.size() - 1);\n\t}", "public Set entrySet() {\n\treturn new EntrySet(map.entrySet());\n }", "public Set<E> poll() {\n long now = Time.currentElapsedTime();\n long expirationTime = nextExpirationTime.get();\n if (now < expirationTime) {\n return Collections.emptySet();\n }\n\n Set<E> set = null;\n long newExpirationTime = expirationTime + expirationInterval;\n if (nextExpirationTime.compareAndSet(expirationTime, newExpirationTime)) {\n set = expiryMap.remove(expirationTime);\n }\n if (set == null) {\n return Collections.emptySet();\n }\n return set;\n }", "public Object last()throws ListExeption;", "Graph getRecentGraph();", "@Override\n public E getLast() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n return dequeue[tail];\n }", "public List getAdd() {\n return addDsData;\n }", "public Object lastElement();", "@Override\n public Set<T> asSet() {\n return new AbstractSet<T>() {\n @Override\n public Iterator<T> iterator() {\n return new Iterator<T>() {\n boolean foundNext;\n boolean hasNext;\n T next;\n \n private void findNext() {\n if (!foundNext) {\n hasNext = isPresent();\n if (hasNext) {\n try {\n next = get();\n } catch (NoSuchElementException e) {\n // in case there was a race and the value became absent\n hasNext = false;\n next = null;\n }\n } else {\n next = null;\n }\n foundNext = true;\n }\n }\n \n @Override\n public boolean hasNext() {\n findNext();\n return hasNext;\n }\n\n @Override\n public T next() {\n findNext();\n if (hasNext) {\n // no next after consuming the single present value \n hasNext = false;\n T ret = next;\n next = null;\n return ret;\n }\n throw new NoSuchElementException();\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }\n\n @Override\n public int size() {\n return isPresent() ? 1 : 0;\n }\n };\n }", "public Order readLatest() {\r\n\t\ttry (Connection connection = JDBCUtils.getInstance().getConnection();\r\n\t\t\t\tStatement statement = connection.createStatement();\r\n\t\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT o.customer_id, oi.order_id, \"\r\n\t\t\t\t\t\t+ \"GROUP_CONCAT(i.item_id, ',', i.name, ',', i.value, ',', oi.quantity SEPARATOR ';') items \"\r\n\t\t\t\t\t\t+ \"FROM orders o \"\r\n\t\t\t\t\t\t+ \"INNER JOIN orders_items oi \"\r\n\t\t\t\t\t\t+ \"ON o.order_id = oi.order_id \"\r\n\t\t\t\t\t\t+ \"INNER JOIN items i \"\r\n\t\t\t\t\t\t+ \"ON oi.item_id = i.item_id \"\r\n\t\t\t\t\t\t+ \"GROUP BY oi.order_id \"\r\n\t\t\t\t\t\t+ \"ORDER BY o.order_id DESC LIMIT 1\");) {\r\n\t\t\tresultSet.next();\r\n\t\t\treturn modelFromResultSet(resultSet);\r\n\t\t} catch (Exception e) {\r\n\t\t\tLOGGER.debug(e);\r\n\t\t\tLOGGER.error(e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public HashMap<String, String> get_toAdd() {\n return _toAdd;\n }", "public T getLast()\n\t{\n\t\treturn getLastNode().getData();\n\t}", "public T getLast()\n\t{\n\t\treturn getLastNode().getData();\n\t}", "public Set<T> getSet () {\r\n\t\treturn _set;\r\n\t}", "public Place tail(){\n return places.get(places.size()-1);\n }", "public T getLast() {\n\t\t//return the data in the last node\n\t\treturn getLastNode().getData();\n\t}", "public E pollLast() {\n\t\tif (mSize == 0)\n\t\t\treturn null;\n\t\n\t\tE retVal = remove(getNode(size() - 1));\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}", "public Subset getLeftMostElement() {\n\t\tSubset res = this;\n\t\twhile(res.left != res) {\n\t\t\tres = res.left;\n\t\t}\n\t\treturn res;\n\t}", "public process get_last() {\n\t\treturn queue.getLast();\n\t}", "public Set<Note> getNoteSet();", "public E getLast();", "public U getLast(){\r\n\t \tif (getArraySize()==0)\r\n\t \t\tthrow new IndexOutOfBoundsException();\r\n\t \t//calls get\r\n\t \treturn get(numElems-1);\r\n\t }", "@Override\n\tpublic FinanceData getLastData() {\n\t\treturn list_fr.get(0);\n\t}", "public List<Info> getLastInfo() {\n\t\treturn dao.getLastInfo();\n\t}", "@Override\n\tpublic Set<T> retrieveAllItems() {\n\t\treturn cache;\n\t}", "public String getLastItem();", "public Set<T> getHistoryEvents() {\n\t\tif (historyEvents == null) {\n\t\t\tcreateHistoryEvents();\n\t\t}\n\t\treturn historyEvents;\n\t}", "@Override\r\n\tpublic E pollLast() {\n\t\treturn null;\r\n\t}", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public Set<K> e() {\n return new c(this);\n }", "@Override // com.google.common.collect.ImmutableSortedSet\n public ImmutableSortedSet<C> createDescendingSet() {\n return new DescendingImmutableSortedSet(this);\n }", "public Object getLastObject()\n {\n\tcurrentObject = lastObject;\n\n if (lastObject == null)\n \treturn null;\n else\n \treturn AL.get(AL.size()-1);\n }", "public Node getLast()\n {\n return this.last;\n }", "public Object pop() {\n\t\tObject lastElement = peek();\n\t\t\n\t\tint indexOfLastElement = collection.size() - 1;\n\t\tcollection.remove(indexOfLastElement);\n\t\t\n\t\treturn lastElement;\n\t}", "public Set<Ticket> getTickets() { return Set.copyOf(tickets); }", "public CardSet takeSnapshot() {\n resetCardStates();\n\n CardSet snapshot = cardSet.getSnapshot();\n snapshots.push(snapshot);\n return snapshot;\n }", "public Heap<WeightedPoint> getOpenSet()\n {\n return openSet;\n }", "public Room getLastRoom() // from my understanding this pops the last entry and replaces it with the one before\n { // might need a if test to prevent a null return and say there are no rooms previous.\n Room room = roomHistory.pop();\n return room;\n }", "Collection<String> getSavedEntries() {\n return Collections.unmodifiableCollection(savedEntries);\n }", "public node getLast() {\n\t\tif(head == null) {\n\t\t\treturn null;\n\t\t}\n\t\tnode tmp = head;\n\t\twhile(tmp.next !=null) {\n\t\t\ttmp = tmp.next;\n\t\t}\n\t\treturn tmp;\n\n\t\t//OR\n\t\t//getAt(size()-1);\n\t}", "public String getAdded() {\r\n\t\treturn added;\r\n\t}", "public Long getLastOnsetTime() {\n if (timeInfos.isEmpty()) {\n return null;\n } else {\n int size = timeInfos.size();\n return timeInfos.get(size - 1).getOnsetTime();\n }\n }", "public Set getCreated() {\r\n return Collections.unmodifiableSet(created);\r\n }", "private void findLast(HashSet s, Set last) {\n for (Iterator i = this.succ.iterator(); i.hasNext(); ) {\n IdentityHashCodeWrapper ap = (IdentityHashCodeWrapper)i.next();\n if (!s.contains(ap)) {\n s.add(ap);\n AccessPath that = (AccessPath)ap.getObject();\n if (that._last) last.add(ap);\n that.findLast(s, last);\n }\n }\n }", "public int getEntriesSet() {\r\n return entriesSet;\r\n }", "@Override\r\n\tpublic Users findLatest() {\n\t\treturn (Users) sessionFactory.getCurrentSession().createQuery(\"from Users order by id DESC\").setMaxResults(1).uniqueResult();\r\n\t}", "public Set getSendAltLocsSet()\r\n {\r\n if ( sendAltLocSet == null )\r\n {// TODO2 use something like a LRUMap. But current LRUMap uses maxSize\r\n // as initial hash size. This would be much to big in most cases!\r\n // Currently this HashSet has no size boundry. We would need our own\r\n // LRUMap implementation with a low initial size and a different max size.\r\n sendAltLocSet = new HashSet();\r\n }\r\n return sendAltLocSet;\r\n }", "@Override\r\n\tpublic RequestsTracker getRecentRequests() {\r\n\t\treturn recentRequestsTracker.snapshot(true);\r\n\t}", "<T> Collection<T> getMostRecent(Class<T> t, int max);", "@Override\n\tpublic Set<String> getWordSet() {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getWordSet();\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "@Override\n public Set<Map.Entry<String, T>> entrySet() {\n Set<Map.Entry<String, T>> entrySet = new TreeSet<>();\n for (Map.Entry<String, Map.Entry<String, T>> v : entries.entrySet()) {\n entrySet.add(new Entry<>(v));\n }\n return entrySet;\n }", "public GPoint getLastPoint() {\n\t\treturn (points.size() > 0) ? points.get(points.size() - 1) : null;\n\t}", "public Set<Record> getRecords() {\n /*\n returns newly allocated Set\n to prevent sort of violations,\n like adding something to the returned value\n */\n return Collections.unmodifiableSet(records);\n }", "public Set entrySet() {\n return map.entrySet();\n }", "T last();", "long getChangeset();", "public LiveData<PersonEntity> getLatestEntry() {\n return latestPersonEntry;\n }", "@Override\n public Earthquake getLatestEarthquake() {\n return this.earthquakeRepository.findFirstByOrderByHappenedOnDesc();\n }", "public Taxi getLastInserted() {\n\t\t\n\t\tprepareStatement();\n\t\t\n\t\tquery = \"SELECT * FROM TAXI ORDER BY update DESC LIMIT 1\";\n\t\t\n\t\tlogger.debug(\"Taxi ->getLastInserted()\");\n\t\tlogger.debug(query);\n\t\t\n\t\texecuteStatement();\t\n\t\t\n\t\tassignResult();\n\t\t\n\t\treturn taxi;\n\t}", "public Node<T> getLast() {\r\n\t\treturn last;\r\n\t}", "@NonNull\n public Collection<Path> getLastPoll() {\n return lastPoll;\n }", "public Square getLastSquare() {\n\t\treturn squares.get(squares.size()-1);\n\t}", "Book getLatestBook();", "@Override\n\t@TimeComplexity(\"O(1)\")\n\tpublic Entry<K, V> lastEntry() {\n\t/* TCJ\n\t * Continuous operation: 1\n\t */\n\t\treturn safeEntry(map.size() - 1);\n\t}", "public String getLast()\n {\n return lastItem;\n }", "public IntSet getBackingSet() {\r\n return S;\r\n }", "public SetSet deepCopy(){\n\t\tSetSet copy = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tcopy.add(get(i).deepCopy());\n\t\t}\n\t\treturn copy;\n\t}", "public Set<Map.Entry<String, Object>> entrySet()\n {\n return data.entrySet();\n }" ]
[ "0.593924", "0.5895918", "0.58155596", "0.5815232", "0.57337934", "0.57306385", "0.56788236", "0.56741613", "0.5570328", "0.55568117", "0.55558175", "0.553951", "0.55286264", "0.5527051", "0.5527051", "0.5518607", "0.5511855", "0.54994404", "0.5488071", "0.5460423", "0.5459404", "0.54338735", "0.5414175", "0.5406613", "0.5403837", "0.5395112", "0.5394435", "0.5388962", "0.5386032", "0.53831774", "0.53575695", "0.53457934", "0.53315604", "0.5325472", "0.5318829", "0.5318232", "0.5300892", "0.5297339", "0.52960116", "0.5295785", "0.5294801", "0.52857506", "0.52815366", "0.52796394", "0.52796394", "0.5264439", "0.5262075", "0.5254362", "0.5243997", "0.5243985", "0.52369624", "0.523275", "0.52202517", "0.5216785", "0.5210805", "0.52031946", "0.52026093", "0.5195111", "0.51917243", "0.5181546", "0.5173289", "0.51723975", "0.5171696", "0.51690024", "0.5158335", "0.5152923", "0.5152444", "0.51498836", "0.5145196", "0.5130453", "0.5128304", "0.5123686", "0.51141393", "0.51139474", "0.5113454", "0.5100954", "0.50927085", "0.5092501", "0.50904554", "0.50902945", "0.508741", "0.5085421", "0.50777006", "0.50737196", "0.5070928", "0.5069635", "0.50665087", "0.50621796", "0.50480926", "0.50334984", "0.5026314", "0.5024507", "0.5024402", "0.5023388", "0.5019748", "0.50182515", "0.50146645", "0.5013653", "0.5009912", "0.50069726" ]
0.75324726
0
TODO Autogenerated method stub
@Override public void processActivate(String username, String validateCode) throws ParseException, ServiceException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); User user=userDao.findUserByLoginName(username); //验证用户是否存在 if(user!=null) { //验证用户激活状态 if(user.getStatus()==0) { ///没激活 Date currentTime = new Date();//获取当前时间 Date registerTime = user.getRegisterTime(); Date d1 =dateFormat.parse(dateFormat.format(currentTime)); Date d2 =dateFormat.parse(dateFormat.format(registerTime)); long diff = d1.getTime() - d2.getTime(); long days = diff / (1000 * 60 * 60 * 24); long hours = (diff-days*(1000 * 60 * 60 * 24))/(1000* 60 * 60); long minutes = (diff-days*(1000 * 60 * 60 * 24)-hours*(1000* 60 * 60))/(1000* 60); //验证链接是否过期 if(minutes < 15) { //验证激活码是否正确 if(validateCode.equals(user.getValidateCode())) { //激活成功, //并更新用户的激活状态,为已激活 logger.info("==sq==="+user.getStatus()); user.setStatus(1);//把状态改为激活 logger.info("==sh==="+user.getStatus()); userDao.updateByPrimaryKey(user); } else { throw new ServiceException("激活码不正确"); } } else { throw new ServiceException("激活码已过期!"); } } else { throw new ServiceException("邮箱已激活,请登录!"); } } else { throw new ServiceException("该邮箱未注册(邮箱地址不存在)!"); } }
{ "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
return session.selectOne(namespace + ".countPaging", cri);
public int countPaging(Criteria cri) throws Exception { return session.selectOne(namespace + ".countPaging"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic int countPaging(Criteria cri) throws Exception {\n\t\treturn session.selectOne(\"com.mapper.cook.countPaging\", cri);\r\n\t}", "int findAllCount() ;", "@Override\r\n\tpublic int getCount(PageBean bean) {\n\t\treturn session.selectOne(\"enter.getCount\", bean);\r\n\t}", "@Override\n\tpublic int countPaging(SearchCriteria cri) {\n\t\treturn session.selectOne(namespace+\".listSearchCount\", cri);\n\t}", "@Mapper\npublic interface TransactionRepository extends BaseRepository<Transaction,Long>{\n Integer save(Transaction transaction);\n\n @Select(\"select count(id) from transaction where transaction_no = #{transactionNo}\")\n Long countByTransactionNo(@Param(\"transactionNo\") String transactionId);\n}", "Long recordCount();", "@SelectProvider(type=NewsSqlProvider.class, method=\"countByExample\")\n int countByExample(NewsExample example);", "@Transactional(propagation=Propagation.SUPPORTS,readOnly=true)\r\n\tpublic Integer queryCount() {\n\t\tInteger count = musicdao.selectCount();\r\n\t\treturn count;\r\n\t}", "@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}", "Long getAllCount();", "public int query() {\n return count;\n }", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "@Override\n\tpublic int selectCount(Object ob) {\n\n\t\tint res = session.selectOne(\"play.all_count\", ob);\n\n\t\treturn res;\n\t}", "@Test()\n public void findCountPerfil() {\n try (Session session = factoryJpa.openSession()) {\n Long qtd = countPerfilCriteria(session, nome);\n System.out.println(\"QTD: \" + qtd);\n }\n }", "default long count() {\n\t\treturn select(Wildcard.count).fetchCount();\n\t}", "@Override\n public long count() {\n String countQuery = \"SELECT COUNT(*) FROM \" + getTableName();\n return getJdbcTemplate().query(countQuery, SingleColumnRowMapper.newInstance(Long.class))\n .get(0);\n }", "@Test\n public void learnToQueryForTotalCount() throws Exception {\n SqlSession session = null;\n\n // TODO: get a Koan06Mapper object\n Koan06Mapper mapper = null;\n\n // TODO: call a method on the mapper to get the count of number of countries\n // in the sakila db\n int totalCountries = 0;\n\n assertEquals(109, totalCountries);\n\n // REMINDER: be sure to close your session ...\n }", "Long queryCount(ProductSearchParm productSearchParm);", "@Repository\npublic interface ArticleCategoryDao {\n\n @Select(\"select id, name from xx_article_category where grade=0 order by orders limit #{limit}\")\n List<ArticleCategory> findRootList(@Param(value = \"limit\") Integer limit);\n}", "public int queryVipCarAmount(VipCar car) {\n\t Criteria criteria = getSession().createCriteria(VipCar.class);\n\t criteria.add(Restrictions.eq(\"parkId\", car.getParkId()));\n\t return Integer.valueOf(criteria.setProjection(Projections.rowCount()).uniqueResult().toString());\n}", "int getSessionCount();", "Long count();", "Long count();", "Long count();", "Long count();", "Long count();", "int count(IDynamoDBMapper mapper);", "public Integer getPageCount();", "UserCount selectByPrimaryKey(BigDecimal id);", "@Query(\"SELECT count(*) FROM DemoEntity d\")\r\n\tpublic Integer countDemo();", "@Query(value = \"SELECT COUNT(*) FROM coupons\", nativeQuery = true)\n int countAllCoupons();", "public int resultCount(){\n\n int c = 0;\n\n try{\n if(res.last()){\n c = res.getRow();\n res.beforeFirst();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return c;\n }", "public Container<PosPay> findPosPay(PosPay posPay,int firstResult ,int maxResults)throws DataAccessException;", "public int findRowCount () throws DataAccessException;", "abstract public TypedQuery<?> getCountQuery() ;", "@Override\r\n\tpublic long count(HttpSession session,String name,String unit)\r\n\t{\n\t\tString sql = \"select count(id) \" + createSql(session, name, unit);\r\n\t\treturn Sel.getcount(sql);\r\n\t}", "int getCount() throws DataAccessException;", "public int getRowsPerPage();", "@Override\r\n\tpublic int countData(PageCriteria pCri) throws Exception {\n\t\treturn ss.selectOne(\"countData\", pCri);\r\n\t}", "@GetMapping(path = \"/count\")\r\n\tpublic ResponseEntity<Long> getCount() {\r\n\t\tLong count = this.bl.getCount();\r\n\t\treturn ResponseEntity.status(HttpStatus.OK).body(count);\r\n\t}", "@Override\n\tpublic Long count(String hql, Object[] param) {\n\t\treturn null;\n\t}", "@Override\n\tpublic Object selectOne() {\n\t\t\n\t\tInteger pt_idx = session.selectOne(\"party.recently_insert\");\n\t\t\n\t\t\n\t\treturn pt_idx;\n\t}", "@Override\n public int findTotal(){\n try {\n return runner.query(con.getThreadConnection(),\"select count(*) from user\",new BeanHandler<Integer>(Integer.class));\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }", "long countNumberOfProductsInDatabase();", "Long pageCount(Long pageSize, Long...params);", "private Long countPerfilCriteria(Session session, String name) {\n CriteriaBuilder cb = session.getCriteriaBuilder();\n CriteriaQuery<Long> q = cb.createQuery(Long.class);\n Root<Perfil> entityRoot = q.from(Perfil.class);\n q.select(cb.count(entityRoot));\n ParameterExpression<String> p = cb.parameter(String.class);\n q.where(cb.equal(entityRoot.get(\"nome\"), name));\n System.out.println(\"QUERY : \" + session.createQuery(q).getQueryString());\n return session.createQuery(q).getSingleResult();\n }", "@Override\n\tpublic Long count(String hql) {\n\t\treturn null;\n\t}", "public int query() {\n return totalcount;\n }", "Integer countByExamplePages(T entity, Integer limit);", "public int count() {\r\n Session session = getSession();\r\n Long count = new Long(0);\r\n try {\r\n count = (Long) session.createQuery(\"select count(t) from \" + getPersistentClass().getName() + \" t \").uniqueResult();\r\n } catch (HibernateException e) {\r\n LOG.error(MODULE + \"Exception in count Method:\" + e, e);\r\n } finally {\r\n// if (session.isOpen()) {\r\n// session.close();\r\n// }\r\n }\r\n return count.intValue();\r\n }", "public int get_count();", "public int searchRowsCount(SearchCriteria cri);", "OResultSet fetchNext(int n);", "@Options(fetchSize = Integer.MIN_VALUE)\n @Select(\"SELECT * FROM USERS\")\n Cursor<User> listUsersWithFetchSize();", "int countByExample(MEsShoppingCartDTOCriteria example);", "Optional<Integer> getPageCount();", "public interface ReportRepository extends MongoRepository<Report, ObjectId> {\n\n /**\n * Get all unread reports count\n * @return\n */\n @Query(value = \"{'read': {'$exists' : false }}\", count = true)\n public int getUnreadCount();\n}", "@Repository\npublic interface TrafficMessageRepository extends MongoRepository<TrafficMessage, String> {\n //@Query(value = \"{}\", fields = \"{}\")\n //public List<TrafficMessage> findTrafficMessages(Pageable pageable);\n}", "@org.apache.ibatis.annotations.Mapper\npublic interface GoodsDao extends Mapper<Goods> {\n @Select(\"select * from tbl_goods\")\n @Results({\n @Result(property = \"cid\",column = \"cid\"),\n @Result(property = \"category\",column = \"cid\",one = @One(select = \"com.czxy.CategoryDao.selectByPrimaryKey\"))\n })\n List<Goods> findAll();\n\n}", "@SelectProvider(type=UserMasterSqlProvider.class, method=\"countByExample\")\r\n long countByExample(UserMasterDto example);", "@Transactional\r\n\tpublic Integer countUserss() {\r\n\t\treturn ((Long) usersDAO.createQuerySingleResult(\"select count(o) from Users o\").getSingleResult()).intValue();\r\n\t}", "@Override\r\n\tpublic int countPagingForInputList(Criteria cri) throws Exception {\n\t\treturn session.selectOne(namespace + \".countPagingForInputList\", cri);\r\n\t}", "@Transactional\n\t\tpublic Long getNumberRows (){\n\t\t\n\t\t\treturn pharmacyRepository1.getNumberOfRows();\n\t\t\t\n\t\t}", "@RepositoryRestResource(exported = false)\npublic interface TransactionRepository extends CrudRepository<Transaction, Long> {\n\n Long countByMemberIdAndDateOfReturnIsNull(Long memberId);\n\n Transaction findByBookIdAndDateOfReturnIsNull(Long bookId);\n \n\t@Query(value = \"SELECT member.id AS memberId, member.name, member.email, Count(transaction.member_id) AS bookCount FROM member INNER JOIN transaction ON member.id = transaction.member_id WHERE transaction.date_of_issue >= :startTime AND transaction.date_of_return <= :endTime GROUP BY transaction.member_id ORDER BY bookCount DESC LIMIT 5\", nativeQuery = true)\n\tList<Object[]> getTopMembers(@Param(\"startTime\") LocalDateTime startTime, @Param(\"endTime\") LocalDateTime endTime);\n}", "public int delegateSelectCountIgnoreFetchScopeTx(LdPublisherCB cb) {\r\n assertConditionBeanNotNull(cb);\r\n return getMyDao().selectCountIgnoreFetchScope(cb);\r\n }", "@Test\n public void queryByPage() {\n List<Album> albums = albumDao.SelectByPage(1, 5);\n for (Album album : albums) {\n System.out.println(album);\n }\n }", "int countByExample(PageItemCfgExample example);", "@Override\r\n\tpublic String paging(String sql) {\n\t\treturn null;\r\n\t}", "public int countAll() throws DAOException;", "public int count() {\n\t\treturn sm.selectOne(\"com.lanzhou.entity.Longpay.count\");\n\t}", "int countByExample(PageFuncExample example);", "public Integer countRecordReturns();", "long getCount();", "long getCount();", "public interface VoteRepository extends CrudRepository<Vote, Integer> {\n //public Long count();\n}", "int getResultsCount();", "int getResultsCount();", "@Override\n\tpublic Integer findCount() {\n\t\tInteger total;\n\t\tString hql=\"from Commodity\";\n\t\tList<Commodity> commoditylist=(List<Commodity>) this.getHibernateTemplate().find(hql, null);\n\t\ttotal=commoditylist.size();\n\t\treturn total;\n\t}", "List<T> findAll(Class<T> clazz, int first, int count);", "@SelectProvider(type= TApikeySqlProvider.class, method=\"countByExample\")\n long countByExample(TApikeyCriteria example);", "public int getSoupKitchenCount() {\n\n MapSqlParameterSource params = new MapSqlParameterSource();\n //here we want to get total from food pantry table\n String sql = \"SELECT COUNT(*) FROM cs6400_sp17_team073.Soup_kitchen\";\n\n Integer skcount = jdbc.queryForObject(sql,params,Integer.class);\n\n return skcount;\n }", "@Query(value = \"SELECT COUNT(*) FROM customers_coupons\", nativeQuery = true)\n int countAllCouponsPurchased();", "@Override\r\n\tpublic int getTotalCount(Class<T> type) {\n\t\treturn (int) super.getSessionFactory().getCurrentSession().createQuery(\"select count(1) as num from \"+\r\n\t\t\t\ttype.getName()+\"\").uniqueResult();\r\n\t}", "public Integer getPerPage();", "@SelectProvider(type=AddressSqlProvider.class, method=\"countByExample\")\n long countByExample(AddressCriteria example);", "@Override\r\n\tpublic PageUtil<T> find(String hql, List<Object> params,\r\n\t\t\tPageUtil<T> pageUtil,String countHQL) {\n\t\ttry {\r\n\t\t\tif (pageUtil==null || pageUtil.getPage()==null) {\r\n\t\t\t\tpageUtil = new PageUtil();\r\n\t\t\t}\r\n\t\t\tQuery q = this.getcurrentSession().createQuery(hql);\r\n\t\t\tif (params != null && params.size() > 0) {\r\n\t\t\t\tfor (int i = 0; i < params.size(); i++) {\r\n\t\t\t\t\tq.setParameter(i, params.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\tpageUtil.setTotal(this.count(countHQL, params));\r\n \r\n\t\t\tpageUtil.setDatas(q.setFirstResult(pageUtil.getStartPoint())\r\n\t\t\t\t\t.setMaxResults(pageUtil.getRows()).list());\r\n\t\t\treturn pageUtil;\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic int searchTotalCount(SearchCriteria cri) {\n\t\treturn sqlSession.selectOne(namespace + \".searchTotalCount\", cri);\r\n\t}", "@Override\r\n\tpublic int searchTotalCount(SearchCriteria cri) {\n\t\treturn sqlSession.selectOne(namespace + \".searchTotalCount\", cri);\r\n\t}", "io.dstore.values.IntegerValue getPageNo();", "io.dstore.values.IntegerValue getPageNo();", "int getTotalCount();", "public int totalRowsCount();", "long getPageSize();", "long getPageSize();", "long getPageSize();", "@Override\n\tpublic int selectCount(Object ob) {\n\t\t\n\t\tint res = session.selectOne(\"party.party_list_total_count\",ob);\n\t\t\n\t\treturn res;\n\t}", "default Integer getPageSize() {\n return 10;\n }", "@Override\n\tpublic int select(String queryString) {\n\t\t\n\t\treturn (Integer)getSession().createQuery(queryString).uniqueResult();\n\t}", "@Override\n\tpublic int selectCount(Map<String, Object> params) {\n\t\treturn this.tableConfigDao.selectCount(params);\n\t}" ]
[ "0.7145933", "0.6796415", "0.65262234", "0.64821297", "0.63301104", "0.62488717", "0.6227942", "0.6216088", "0.61595607", "0.61398536", "0.6133109", "0.6117304", "0.6117304", "0.6106932", "0.6101655", "0.6092592", "0.60407686", "0.60352683", "0.6019321", "0.60083413", "0.5985868", "0.59821343", "0.59806913", "0.59806913", "0.59806913", "0.59806913", "0.59806913", "0.5967247", "0.59621745", "0.5955636", "0.59516364", "0.5946487", "0.5938783", "0.5925563", "0.5925562", "0.59195316", "0.59100395", "0.5909012", "0.5895847", "0.5885523", "0.5870427", "0.5857355", "0.5851564", "0.58415973", "0.5840284", "0.5837471", "0.5821758", "0.58147585", "0.5812334", "0.580169", "0.57974565", "0.57937044", "0.57808447", "0.57806873", "0.5761553", "0.57602894", "0.5755444", "0.57527035", "0.57338446", "0.57081056", "0.5704596", "0.5701338", "0.5694391", "0.5692019", "0.56908077", "0.5689372", "0.56884557", "0.56875676", "0.56718355", "0.56510115", "0.56501925", "0.5645501", "0.56454206", "0.56370217", "0.56370217", "0.5634262", "0.5624808", "0.5624808", "0.5620934", "0.56187034", "0.5616273", "0.5612722", "0.56088346", "0.56074756", "0.5606563", "0.5601416", "0.56010187", "0.5598943", "0.5598943", "0.559489", "0.559489", "0.5593878", "0.559059", "0.5590345", "0.5590345", "0.5590345", "0.55827", "0.55815923", "0.5576864", "0.55768394" ]
0.6864256
1
We simply need .class files
private void processClassesFolderIfNotEmpty(Properties sonarProjectProperties, String classFolder) { if (FileUtils.iterateFiles(new File(classFolder), new String[] {"class"}, true).hasNext()) { LOG.debug("Class folder: {}", classFolder); appendProperty(sonarProjectProperties, SonarConfiguratorProperties.LIBRARIES_PROPERTY, classFolder + (classFolder.endsWith("/") ? "" : "/") + "*.class"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readClasses(SB_SingletonBook book) throws SB_FileException\r\n\t{\r\n\t for (Class javaClass : SB_ClassMap.getBaseJavaClasses()) {\r\n\t addJavaClass(book, javaClass.getSimpleName(), javaClass.getName());\r\n\t }\r\n\t \r\n\t List<String> importedClasses = _dataModel.getJavaScript().getImportedJavaClasses();\r\n\t\tfor( String javaClassName : importedClasses) {\r\n\t\t\tString classPackage = javaClassName;\r\n\t\t\tString className = javaClassName.substring(javaClassName.lastIndexOf('.') + 1);\r\n\t\t\taddJavaClass(book, className, classPackage);\r\n\t }\r\n\t\t\r\n\t\t//Now that all classes read in, convert class descriptions\r\n\t\ttry\r\n\t\t{\r\n\t\t book.getUserClassMap().convertClassDescriptions(book);\r\n\t\t}\r\n\t\tcatch(SB_Exception ex)\r\n\t\t{\r\n\t\t throw new SB_FileException(ex.toString());\r\n\t\t}\r\n\t}", "@Override\n public Class getJavaClass() throws IOException, ClassNotFoundException {\n open();\n URL url;\n int p = path.lastIndexOf('/');\n int p2 = path.substring(0,p-1).lastIndexOf('/');\n\n File f = new File(path.substring(0,p2));\n url = f.toURI().toURL();\n URL[] urls = new URL[1];\n urls[0] = url;\n ClassLoader loader = new URLClassLoader(urls);\n\n String cls = path.substring(p2 + 1, path.lastIndexOf('.')).replace('/', '.');\n\n if (cfile.getParentFile().getParentFile().getName().equals(\"production\")) {\n cls = cls.substring(cls.lastIndexOf('.') + 1);\n }\n\n\n\n return loader.loadClass(cls);\n }", "private ClassUtil() {}", "private void loadClasses() {\n\t\tString[] classes = new String[] { \"com.sssprog.delicious.api.ApiAsyncTask\" };\n\t\tfor (String c : classes) {\n\t\t\ttry {\n\t\t\t\tClass.forName(c);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "protected abstract void generatePackageFiles(ClassTree classtree) throws Exception;", "public String[] getClassesToCompile();", "private void createClassPath() {\n classPath = classFactory.createClassPath();\n }", "void initClasses() {\n\t\tif (programUnit == null) return;\n\n\t\t// Add all classes\n\t\tList<BdsNode> cdecls = BdsNodeWalker.findNodes(programUnit, ClassDeclaration.class, true, true);\n\t\tfor (BdsNode n : cdecls) {\n\t\t\tClassDeclaration cd = (ClassDeclaration) n;\n\t\t\tbdsvm.addType(cd.getType());\n\t\t}\n\t}", "public String[] readClasses();", "@SuppressWarnings(\"unchecked\")\n public void loadClasses(String pckgname) throws ClassNotFoundException {\n File directory = null;\n try {\n ClassLoader cld = Thread.currentThread().getContextClassLoader();\n String path = \"/\" + pckgname.replace(\".\", \"/\");\n URL resource = cld.getResource(path);\n if (resource == null) {\n throw new ClassNotFoundException(\"sem classes no package \" + path);\n }\n directory = new File(resource.getFile());\n }\n catch (NullPointerException x) {\n throw new ClassNotFoundException(pckgname + \" (\" + directory + \") package invalido\");\n }\n if (directory.exists()) {\n String[] files = directory.list();\n for (int i = 0; i < files.length; i++) {\n if (files[i].endsWith(\".class\") && !files[i].contains(\"$\")) {\n Class cl = Class.forName(pckgname + '.' + files[i].substring(0, files[i].length() - 6));\n Method methods[] = cl.getDeclaredMethods();\n boolean ok = false;\n for (Method m : methods) {\n if ((m.getReturnType().equals(List.class) || m.getReturnType().isArray()) && m.getParameterTypes().length == 0) {\n ok = true;\n break;\n }\n }\n if (ok) {\n classes.add(cl);\n }\n }\n }\n }\n else {\n throw new ClassNotFoundException(pckgname + \" package invalido\");\n }\n }", "private void buildClassPath() throws InterruptedException, IOException, CheckedAnalysisException {\n IClassPathBuilder builder = classFactory.createClassPathBuilder(bugReporter);\n\n for (String path : project.getFileArray()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), true);\n }\n for (String path : project.getAuxClasspathEntryList()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), false);\n }\n\n builder.scanNestedArchives(analysisOptions.scanNestedArchives);\n\n builder.build(classPath, progress);\n\n appClassList = builder.getAppClassList();\n\n if (PROGRESS) {\n System.out.println(appClassList.size() + \" classes scanned\");\n }\n\n // If any of the application codebases contain source code,\n // add them to the source path.\n // Also, use the last modified time of application codebases\n // to set the project timestamp.\n for (Iterator<? extends ICodeBase> i = classPath.appCodeBaseIterator(); i.hasNext();) {\n ICodeBase appCodeBase = i.next();\n\n if (appCodeBase.containsSourceFiles()) {\n String pathName = appCodeBase.getPathName();\n if (pathName != null) {\n project.addSourceDir(pathName);\n }\n }\n\n project.addTimestamp(appCodeBase.getLastModifiedTime());\n }\n\n }", "private File getClassFile(String name) {\n File file = new File(\"/Users/dingchenchen/Downloads/Test.class\");\n return file;\n }", "@Override\n\tprotected Class<?> findClass(String name) throws ClassNotFoundException {\n\t\tFile file = new File(getSimpleName(name) + \".class\");\n FileInputStream fis = null;\n Class<?> clazz = null;\n try {\n fis = new FileInputStream(file);\n int content = 0;\n int i = 0;\n byte[] data = new byte[fis.available()];\n while ((content = fis.read()) != -1) {\n // convert to char and display it\n data[i] = (byte) content;\n i++;\n }\n clazz = defineClass(name, data, 0, data.length);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n \t\tex.printStackTrace();\n \t}\n }\n return clazz;\n\t}", "private void generateClassFiles(ClassTree classtree) {\n String[] packageNames = configuration.classDocCatalog.packageNames();\n for (int packageNameIndex = 0; packageNameIndex < packageNames.length;\n packageNameIndex++) {\n generateClassFiles(configuration.classDocCatalog.allClasses(\n packageNames[packageNameIndex]), classtree);\n }\n }", "Object getClass_();", "Object getClass_();", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree);", "public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tIOUtils.loadMethodIODeps(\"cb\");\n\t\t\n\t\tFile clazz = new File(args[0]);\n\n\t\tfinal ClassReader cr1 = new ClassReader(new FileInputStream(clazz));\n//\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"z.txt\"));\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\t/*ClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_FRAMES) {\n\t\t\t@Override\n\t\t\tprotected String getCommonSuperClass(String type1, String type2) {\n\t\t\t\ttry {\n\t\t\t\t\treturn super.getCommonSuperClass(type1, type2);\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t//\t\t\t\t\tSystem.err.println(\"err btwn \" + type1 + \" \" +type2);\n\t\t\t\t\treturn \"java/lang/Unknown\";\n\t\t\t\t}\n\t\t\t}\n\t\t};*/\n\t\t\n\t\tClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_MAXS);\n\t\t\n\t\tcr1.accept(new ClassVisitor(Opcodes.ASM5, cw1) {\n\t\t\t@Override\n\t\t\tpublic MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);\n\t\t\t}\n\t\t}, ClassReader.EXPAND_FRAMES);\n\t\t\n\t\tfinal ClassReader cr = new ClassReader(cw1.toByteArray());\n\t\tTraceClassVisitor tcv = new TraceClassVisitor(null,new Textifier(),pw);\n\t\t//ClassWriter tcv = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);\n\t\tClassVisitor cv = new ClassVisitor(Opcodes.ASM5, tcv) {\n\t\t\tString className;\n\n\t\t\t@Override\n\t\t\tpublic void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {\n\t\t\t\tsuper.visit(version, access, name, signature, superName, interfaces);\n\t\t\t\tthis.className = name;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tboolean isSynthetic = ClassInfoUtils.checkAccess(access, Opcodes.ACC_SYNTHETIC);\n\t\t\t\tboolean isNative = ClassInfoUtils.checkAccess(access, Opcodes.ACC_NATIVE);\n\t\t\t\tboolean isInterface = ClassInfoUtils.checkAccess(access, Opcodes.ACC_INTERFACE);\n\t\t\t\tboolean isAbstract = ClassInfoUtils.checkAccess(access, Opcodes.ACC_ABSTRACT);\n\t\t\t\t\n\t\t\t\tMethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);\n\t\t\t\tif (name.equals(\"toString\") && desc.equals(\"()Ljava/lang/String;\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (name.equals(\"equals\") && desc.equals(\"(Ljava/lang/Object;)Z\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (name.equals(\"hashCode\") && desc.equals(\"()I\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (isSynthetic || isNative || isInterface || isAbstract) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else {\n\t\t\t\t\tmv = new DependencyAnalyzer(className, \n\t\t\t\t\t\t\taccess, \n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tdesc, \n\t\t\t\t\t\t\tsignature, \n\t\t\t\t\t\t\texceptions, \n\t\t\t\t\t\t\tmv, \n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tfalse, \n\t\t\t\t\t\t\ttrue, \n\t\t\t\t\t\t\ttrue);\n\t\t\t\t\t//mv = new CalleeAnalyzer(className, access, name, desc, signature, exceptions, mv, true);\n\t\t\t\t\treturn mv;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tcr.accept(cv, ClassReader.EXPAND_FRAMES);\n\t\tpw.flush();\n\t}", "void compileClass() throws IOException {\n tagBracketPrinter(CLASS_TAG, OPEN_TAG_BRACKET);\n try {\n compileClassHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(CLASS_TAG, CLOSE_TAG_BRACKET);\n\n }", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "private void installBasicClasses() {\n \tAbstractSymbol filename \n \t = AbstractTable.stringtable.addString(\"<basic class>\");\n \t\n \t// The following demonstrates how to create dummy parse trees to\n \t// refer to basic Cool classes. There's no need for method\n \t// bodies -- these are already built into the runtime system.\n \n \t// IMPORTANT: The results of the following expressions are\n \t// stored in local variables. You will want to do something\n \t// with those variables at the end of this method to make this\n \t// code meaningful.\n \n \t// The Object class has no parent class. Its methods are\n \t// cool_abort() : Object aborts the program\n \t// type_name() : Str returns a string representation \n \t// of class name\n \t// copy() : SELF_TYPE returns a copy of the object\n \n \tclass_c Object_class = \n \t new class_c(0, \n \t\t TreeConstants.Object_, \n \t\t TreeConstants.No_class,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0, \n \t\t\t\t\t TreeConstants.cool_abort, \n \t\t\t\t\t new Formals(0), \n \t\t\t\t\t TreeConstants.Object_, \n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.type_name,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.copy,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \t\n \t// The IO class inherits from Object. Its methods are\n \t// out_string(Str) : SELF_TYPE writes a string to the output\n \t// out_int(Int) : SELF_TYPE \" an int \" \" \"\n \t// in_string() : Str reads a string from the input\n \t// in_int() : Int \" an int \" \" \"\n \n \tclass_c IO_class = \n \t new class_c(0,\n \t\t TreeConstants.IO,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_string,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_int,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_string,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_int,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The Int class has no methods and only a single attribute, the\n \t// \"val\" for the integer.\n \n \tclass_c Int_class = \n \t new class_c(0,\n \t\t TreeConstants.Int,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// Bool also has only the \"val\" slot.\n \tclass_c Bool_class = \n \t new class_c(0,\n \t\t TreeConstants.Bool,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The class Str has a number of slots and operations:\n \t// val the length of the string\n \t// str_field the string itself\n \t// length() : Int returns length of the string\n \t// concat(arg: Str) : Str performs string concatenation\n \t// substr(arg: Int, arg2: Int): Str substring selection\n \n \tclass_c Str_class =\n \t new class_c(0,\n \t\t TreeConstants.Str,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.str_field,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.length,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.concat,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg, \n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.substr,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int))\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg2,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t/* Do somethind with Object_class, IO_class, Int_class,\n Bool_class, and Str_class here */\n nameToClass.put(TreeConstants.Object_.getString(), Object_class);\n nameToClass.put(TreeConstants.IO.getString(), IO_class);\n nameToClass.put(TreeConstants.Int.getString(), Int_class);\n nameToClass.put(TreeConstants.Bool.getString(), Bool_class);\n nameToClass.put(TreeConstants.Str.getString(), Str_class);\n adjacencyList.put(TreeConstants.Object_.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.IO.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Int.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Bool.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Str.getString(), new ArrayList<String>() );\n // Do the same for other basic classes\n basicClassList = new Classes(0);\n basicClassList.appendElement(Object_class);\n basicClassList.appendElement(IO_class);\n basicClassList.appendElement(Int_class);\n basicClassList.appendElement(Bool_class);\n basicClassList.appendElement(Str_class);\n \n }", "private static Class[] getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes.toArray(new Class[classes.size()]);\n }", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "private void dumpClassBytesToFile ()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int lastSlash =\n\t\t\t\tclassInternalName.lastIndexOf('/');\n\t\t\tfinal String pkg =\n\t\t\t\tclassInternalName.substring(0, lastSlash);\n\t\t\tfinal Path tempDir = Paths.get(\"debug\", \"jvm\");\n\t\t\tfinal Path dir = tempDir.resolve(Paths.get(pkg));\n\t\t\tFiles.createDirectories(dir);\n\t\t\tfinal String base = classInternalName.substring(lastSlash + 1);\n\t\t\tfinal Path classFile = dir.resolve(base + \".class\");\n\t\t\tFiles.write(classFile, stripNull(classBytes));\n\t\t}\n\t\tcatch (final IOException e)\n\t\t{\n\t\t\tInterpreter.log(\n\t\t\t\tInterpreter.loggerDebugJVM,\n\t\t\t\tLevel.WARNING,\n\t\t\t\t\"unable to write class bytes for generated class {0}\",\n\t\t\t\tclassInternalName);\n\t\t}\n\t}", "private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class> classes = new ArrayList<Class>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "private List<Class<?>> getClasses(String packageName) throws Exception {\n File directory = null;\n try {\n ClassLoader cld = getClassLoader();\n URL resource = getResource(packageName, cld);\n directory = new File(resource.getFile());\n } catch (NullPointerException ex) {\n throw new ClassNotFoundException(packageName + \" (\" + directory\n + \") does not appear to be a valid package\");\n }\n return collectClasses(packageName, directory);\n }", "java.lang.String getClass_();", "java.lang.String getClass_();", "public String getClassName(String path);", "List<String> getClassNames() {\n List<String> allGeneratedClasses = new ArrayList<String>();\n for (int i = 0; i < classesToScan.size(); i++) {\n String lookupName = classesToScan.get(i);\n byte classBytes[] = getClassBytes(lookupName);\n if (classBytes == null) {\n /*\n * Weird case: javac might generate a name and reference the class in\n * the bytecode but decide later that the class is unnecessary. In the\n * bytecode, a null is passed for the class.\n */\n continue;\n }\n \n /*\n * Add the class to the list only if it can be loaded to get around the\n * javac weirdness issue where javac refers a class but does not\n * generate it.\n */\n if (CompilingClassLoader.isClassnameGenerated(lookupName)\n && !allGeneratedClasses.contains(lookupName)) {\n allGeneratedClasses.add(lookupName);\n }\n AnonymousClassVisitor cv = new AnonymousClassVisitor();\n new ClassReader(classBytes).accept(cv, 0);\n List<String> innerClasses = cv.getInnerClassNames();\n for (String innerClass : innerClasses) {\n // The innerClass has to be an inner class of the lookupName\n if (!innerClass.startsWith(mainClass + \"$\")) {\n continue;\n }\n /*\n * TODO (amitmanjhi): consider making this a Set if necessary for\n * performance\n */\n // add the class to classes\n if (!classesToScan.contains(innerClass)) {\n classesToScan.add(innerClass);\n }\n }\n }\n Collections.sort(allGeneratedClasses, new GeneratedClassnameComparator());\n return allGeneratedClasses;\n }", "private List<Class> getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes;\n }", "public void makePackageClassesHtmls(SizeBreakdown breakdown)\n throws IOException {\n for (String packageName : GlobalInformation.packageToClasses.keySet()) {\n \n TreeMap<Float, String> sortedClasses = new TreeMap<Float, String>(\n Collections.reverseOrder());\n float maxSize = 0f;\n \n int maxDepCount = 1;\n \n for (String className : GlobalInformation.packageToClasses.get(packageName)) {\n \n float curSize = 0f;\n if (!breakdown.classToPartialSize.containsKey(className)) {\n // This class not present in this code collection\n } else {\n curSize = breakdown.classToPartialSize.get(className);\n }\n \n int depCount = 0;\n if (GlobalInformation.classToWhatItDependsOn.containsKey(className)) {\n depCount = GlobalInformation.classToWhatItDependsOn.get(className).size();\n }\n \n if (curSize != 0f) {\n \n sortedClasses.put(curSize, className);\n if (curSize > maxSize) {\n maxSize = curSize;\n }\n if (depCount > maxDepCount) {\n maxDepCount = depCount;\n }\n }\n }\n \n PrintWriter outFile = new PrintWriter(\n getOutFile(classesInPackageFileName(breakdown, packageName)));\n \n outFile.println(\"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01//EN\\\"\");\n outFile.println(\"\\\"http://www.w3.org/TR/html4/strict.dtd\\\">\");\n outFile.println(\"<html>\");\n outFile.println(\"<head>\");\n outFile.println(\"<meta http-equiv=\\\"content-type\\\" content=\\\"text/html;charset=ISO-8859-1\\\">\");\n outFile.println(\"<link rel=\\\"stylesheet\\\" href=\\\"classLevel.css\\\" media=\\\"screen\\\">\");\n outFile.println(\"<title>Classes in package \\\"\" + packageName\n + \"\\\"</title>\");\n outFile.println(\"</head>\");\n outFile.println(\"<body>\");\n \n outFile.println(\"<center>\");\n outFile.println(\"<h2>Classes in package \\\"\" + packageName + \"\\\"</h2>\");\n addHeaderWithBreakdownContext(breakdown, outFile);\n outFile.println(\"</center>\");\n \n outFile.println(\"<div style=\\\"width:90%; height:80%; overflow-y:auto; overflow-x:auto; top: 120px; left:70px; position:absolute; background-color:white\\\"\");\n \n int yOffset = 0;\n for (Float size : sortedClasses.keySet()) {\n \n String className = sortedClasses.get(size);\n \n // TODO(kprobst): switch out the commented/uncommented lines below when\n // showing dependencies\n // float ratio = (size / maxSize) * 45;\n float ratio = (size / maxSize) * 85;\n \n if (ratio < 3) {\n ratio = 3;\n }\n \n // TODO(kprobst): not currently used, but will be for dependencies\n // get the dependency count\n int depCount = 0;\n if (GlobalInformation.classToWhatItDependsOn.containsKey(className)) {\n depCount = GlobalInformation.classToWhatItDependsOn.get(className).size();\n }\n float depRatio = ((float) depCount / (float) maxDepCount) * 45f;\n if (depRatio < 3.0) {\n depRatio = 3;\n }\n \n outFile.println(\"<div class=\\\"box\\\" style=\\\"width:\" + ratio\n + \"%; top: \" + yOffset + \"px; left: 60px;\\\">\");\n outFile.println(\"<div id=\\\"lb\\\">\");\n outFile.println(\"<div id=\\\"rb\\\">\");\n outFile.println(\"<div id=\\\"bb\\\"><div id=\\\"blc\\\"><div id=\\\"brc\\\">\");\n outFile.println(\"<div id=\\\"tb\\\"><div id=\\\"tlc\\\"><div id=\\\"trc\\\">\");\n outFile.println(\"<div id=\\\"content\\\">\");\n outFile.println(\"</div>\");\n outFile.println(\"</div></div></div></div>\");\n outFile.println(\"</div></div></div></div>\");\n outFile.println(\"</div>\");\n \n // TODO(kprobst): not currently used, but will be for dependencies\n /*\n * outFile.println(\"<div class=\\\"box-right\\\" style=\\\"width:\" + depRatio\n * + \"%; top: \" + yOffset + \"px; left: 50%\\\">\");\n * outFile.println(\"<div id=\\\"lb\\\">\");\n * outFile.println(\"<div id=\\\"rb\\\">\");\n * outFile.println(\"<div id=\\\"bb\\\"><div id=\\\"blc\\\"><div id=\\\"brc\\\">\");\n * outFile.println(\"<div id=\\\"tb\\\"><div id=\\\"tlc\\\"><div id=\\\"trc\\\">\");\n * outFile.println(\"<div id=\\\"content\\\">\"); outFile.println(\"</div>\");\n * outFile.println(\"</div></div></div></div>\");\n * outFile.println(\"</div></div></div></div>\");\n * outFile.println(\"</div>\");\n */\n \n int yOffsetText = yOffset + 8;\n outFile.printf(\"<div class=\\\"barlabel\\\" style=\\\"top:\" + yOffsetText\n + \"px; left:5px;\\\">%.1f</div>\\n\", size);\n if (GlobalInformation.displayDependencies == true) {\n outFile.println(\"<div class=\\\"barlabel\\\" style=\\\"top:\" + yOffsetText\n + \"px; left:70px;\\\"><a href=\\\"methodDependencies-\"\n + filename(packageName) + \".html#\" + className + \"\\\">\"\n + className + \"</a></div>\");\n } else {\n outFile.println(\"<div class=\\\"barlabel\\\" style=\\\"top:\" + yOffsetText\n + \"px; left:70px;\\\">\" + className + \"</div>\");\n }\n /*\n * //TODO(kprobst) make this a link String drillDownFileName = className\n * + \"Deps.html\"; outFile.println(\"<div class=\\\"barlabel\\\" style=\\\"top:\"\n * + yOffsetText + \"px; left:50%;\\\"><a href=\\\"\" + drillDownFileName +\n * \"\\\" target=\\\"_top\\\">Dependencies: \" + depCount + \"</a></div>\");\n */\n yOffset = yOffset + 25;\n }\n \n outFile.println(\"</div>\");\n outFile.println(\"</body>\");\n outFile.println(\"</html>\");\n outFile.close();\n }\n }", "public static void main(String[] args) throws IOException {\n\t\t// creating local class objects \n\t\t\n\t}", "private static Class[] getClasses(String packageName)\n\t\t\tthrows ClassNotFoundException, IOException {\n\t\tClassLoader classLoader = Thread.currentThread()\n\t\t\t\t.getContextClassLoader();\n\t\tassert classLoader != null;\n\t\tString path = packageName.replace('.', '/');\n\t\tEnumeration<URL> resources = classLoader.getResources(path);\n\t\tList<File> dirs = new ArrayList<File>();\n\t\twhile (resources.hasMoreElements()) {\n\t\t\tURL resource = resources.nextElement();\n\t\t\tdirs.add(new File(resource.getFile()));\n\t\t}\n\t\tArrayList<Class> classes = new ArrayList<Class>();\n\t\tfor (File directory : dirs) {\n\t\t\tclasses.addAll(findClasses(directory, packageName));\n\t\t}\n\t\treturn classes.toArray(new Class[classes.size()]);\n\t}", "public void prepare() throws ClassNotFoundException {\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tClass<?> class1 = null;\r\n Class<?> class2 = null;\r\n Class<?> class3 = null;\r\n // 一般采用这种形式\r\n try {\r\n\t\t\tclass1 = Class.forName(\"net.xsoftlab.baike.TestReflect\");\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n// class2 = new TestReflect().getClass();\r\n// class3 = TestReflect.class;\r\n System.out.println(\"类名称 \" + class1.getName());\r\n System.out.println(\"类名称 \" + class2.getName());\r\n System.out.println(\"类名称 \" + class3.getName());\r\n\r\n}", "public static void load() throws IOException {\n ClassPath classPath = ClassPath.from(ClassLoader.getSystemClassLoader());\n //System.out.println(\"Length:\"+classPath.getTopLevelClasses(\"util\").size());\n for (ClassPath.ClassInfo classInfo : classPath.getTopLevelClasses(\"util\")) {\n Scene.v().addBasicClass(classInfo.getName(), SootClass.BODIES);\n sootClasses.add(classInfo.getName());\n }\n }", "public ClassFile[] getClassFiles() {\n\t\treturn getResult().getClassFiles();\n\t}", "public IJavaClassFile getMainClass();", "private static byte[] instrumentClassFile(byte[] classfileBuffer) {\n String className = new ClassReader(classfileBuffer).getClassName().replace(\"/\", \".\");\n ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();\n byte[] newClassfileBuffer = new EkstaziCFT().transform(currentClassLoader, className, null, null, classfileBuffer);\n return newClassfileBuffer;\n }", "String mainClass();", "@Override\n public Class<?> loadClassBytes(String name, ClassLoader cl) {\n return dexFile.loadClass(name.replace('.', '/'), cl);\n }", "private static byte[] loadClass(String action) throws IOException {\n switch (action.toLowerCase()) {\n case \"resetpassword\" :\n return readClassAsResource(ResetPassword.class);\n case \"manualresetpassword\" :\n return readClassAsResource(ManualResetPassword.class);\n case \"activeusers\" :\n return readClassAsResource(ActiveUsers.class);\n }\n\n throw new RuntimeException(\"Not supported operation.\");\n }", "LiveClassLoader()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.defineClassMethod = ClassLoader.class.getDeclaredMethod(\"defineClass\", String.class, byte[].class, int.class, int.class);\r\n\t\t\tthis.defineClassMethod.setAccessible(true);\r\n\t\t}\r\n\t\tcatch (NoSuchMethodException | SecurityException e)\r\n\t\t{\r\n\t\t\t// TODO: debug..\r\n\t\t\tSystem.out.println(\"CLASS LOADER >> Erro ao recuperar o metodo 'ClassLoader.defineClass()'!\");\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void initClasses() {\n\t // base class must be initialized first\n\t \t SoAction.initClass();\n\t \t \n\t \t SoCallbackAction.initClass();\n\t \t SoGLRenderAction.initClass();\n\t \t SoGetBoundingBoxAction.initClass();\n\t \t SoGetMatrixAction.initClass();\n\t \t SoGetPrimitiveCountAction.initClass();\n\t \t SoHandleEventAction.initClass();\n\t \t SoPickAction.initClass();\n\t \t SoRayPickAction.initClass();\n\t \t SoSearchAction.initClass();\n\t \t SoWriteAction.initClass();\n\t \t \t \t\n\t }", "private byte[] getClassBytes(String slashedName) {\n URL url = Thread.currentThread().getContextClassLoader().getResource(\n slashedName + \".class\");\n if (url == null) {\n logger.log(TreeLogger.DEBUG, \"Unable to find \" + slashedName\n + \" on the classPath\");\n return null;\n }\n String urlStr = url.toExternalForm();\n if (slashedName.equals(mainClass)) {\n // initialize the mainUrlBase for later use.\n mainUrlBase = urlStr.substring(0, urlStr.lastIndexOf('/'));\n } else {\n assert mainUrlBase != null;\n if (!mainUrlBase.equals(urlStr.substring(0, urlStr.lastIndexOf('/')))) {\n logger.log(TreeLogger.DEBUG, \"Found \" + slashedName + \" at \" + urlStr\n + \" The base location is different from that of \" + mainUrlBase\n + \" Not loading\");\n return null;\n }\n }\n \n // url != null, we found it on the class path.\n try {\n URLConnection conn = url.openConnection();\n return Util.readURLConnectionAsBytes(conn);\n } catch (IOException ignored) {\n logger.log(TreeLogger.DEBUG, \"Unable to load \" + urlStr\n + \", in trying to load \" + slashedName);\n // Fall through.\n }\n return null;\n }", "public static Hashtable<String, ArrayList<String>> createClassTable() {\n\t\tResourceHandler resourceHandler = getResourceHandler(CLASSES_DIR);\n\t\tHashtable<String, ArrayList<String>> table = new Hashtable<String, ArrayList<String>>();\n\t\tfor(String dir : resourceHandler.listDirs()){\n\t\t\ttable.put(dir, new ArrayList<String>());\n\t\t\tfor(String file : resourceHandler.listFiles(dir)){\n\t\t\t\tfile = file.replaceAll(\"/\", \"\");\n\t\t\t\tif(!dir.endsWith(\"/\")){\n\t\t\t\t\tfile = \"/\" + file;\n\t\t\t\t}\n\t\t\t\ttable.get(dir).add(StringUtils.toFileName((dir+file.replaceAll(\"\\\\.xml\", \"\"))));\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}", "private Map<String, Entity> parseJavaClasses(List<Path> classFiles) {\r\n logger.trace(\"parseJavaClass\");\r\n\r\n // Instantiate walker and listener\r\n ParseTreeWalker walker = new ParseTreeWalker();\r\n Java8CustomListener listener = new Java8CustomListener();\r\n\r\n classFiles.forEach(path -> {\r\n logger.trace(\"========== Parse: \" + path.toFile().getName() + \" ==========\");\r\n\r\n try {\r\n ParseTree tree = getTree(path);\r\n\r\n // walk through class\r\n walker.walk(listener, tree);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading creating tree for: {}\", path, e);\r\n }\r\n });\r\n\r\n return listener.getEntityMap();\r\n }", "public void initializeClass();", "private void init() throws ClassNotFoundException{\n }", "west.twouse.language.sparqlas.Class getClass_();", "public synchronized void defineClass(String fullClassName, byte[] bytes)\r\n {\r\n try\r\n {\r\n defineClass(fullClassName, bytes, 0, bytes.length);\r\n }\r\n finally\r\n {\r\n }\r\n }", "protected void generateClassFiles(RootDoc root, ClassTree classtree) {\n generateClassFiles(classtree);\n PackageDoc[] packages = root.specifiedPackages();\n for (int i = 0; i < packages.length; i++) {\n generateClassFiles(packages[i].allClasses(), classtree);\n }\n }", "public ClassFile getClassFile(String name) throws IOException {\n if (name.indexOf('.') > 0) {\n int i = name.lastIndexOf('.');\n String pathname = name.replace('.', File.separatorChar) + \".class\";\n if (baseFileName.equals(pathname) ||\n baseFileName.equals(pathname.substring(0, i) + \"$\" +\n pathname.substring(i+1, pathname.length()))) {\n return readClassFile(path);\n }\n } else {\n if (baseFileName.equals(name.replace('/', File.separatorChar) + \".class\")) {\n return readClassFile(path);\n }\n }\n return null;\n }", "public static void loadClass(String name) {\n\n }", "private static Class<?> loadClass(String className) {\n\t\tClass<?> theLogicClass = null;\n\t\ttry {\n\t\t\ttheLogicClass = ClassLoaderManager.getInstance().getLogicClassFromName(className);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tthrow new RuntimeException(\"Unable to load logic class: \" + className, ex);\n\t\t}\n\t\treturn theLogicClass;\n\t}", "@Override\n public List<Class> getAllUssdClasses(String packageName) {\n\n List<Class> commands = new ArrayList<Class>();\n List<String> classNames = new ArrayList<String>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(\n null, null, null);\n\n StandardLocation location = StandardLocation.CLASS_PATH;\n\n Set<JavaFileObject.Kind> kinds = new HashSet<>();\n kinds.add(JavaFileObject.Kind.CLASS);\n boolean recurse = false;\n Iterable<JavaFileObject> list = new ArrayList<>();\n try {\n list = fileManager.list(location, packageName,\n kinds, recurse);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n for (JavaFileObject javaFileObject : list) {\n String path = javaFileObject.toUri().getPath();\n String className = path.substring(path.lastIndexOf(\"/\") + 1, path.indexOf(\".\"));\n classNames.add(className);\n }\n\n for (String className : classNames) {\n Class klass = null;\n try {\n klass = Class.forName(packageName + \".\" + className);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n if (klass != null && klass.isAnnotationPresent(UssdService.class)) {\n commands.add(klass);\n }\n }\n return commands;\n }", "private List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class> classes = new ArrayList<Class>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "public Classpath() {\n _thePaths = new ArrayList<Path>();\n }", "private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class<?>> classes = new ArrayList<Class<?>>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "public static void\ninitClass()\n//\n////////////////////////////////////////////////////////////////////////\n{\n}", "private static void processClass(File file_name, final Histogram class_use, final Histogram method_use) {\n try {\n final InputStream object_stream=new FileInputStream(file_name);\n MethodCallEnumerator.analyzeClass(object_stream,class_use,method_use);\n object_stream.close();\n } catch (Exception e) {\n throw new IllegalStateException(\"while processing: \" + e);\n }\n }", "protected Class[] getSourceClassesImpl() throws Exception {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"add new class\");\n\n\t}", "@Test\n public void testGetClassesInPackage() throws Exception\n {\n\n WarMachine machine = TestHelpers.createWarMachine(WarNames.SERVLET);\n\n Set<String> clist1 = machine.getClassesInPackage(\"com.example.servlet\", false);\n assertEquals(\"number of classes in WEB-INF, non-recursive\", 1, clist1.size());\n assertTrue(\"searching for file in WEB-INF, non-recursive\", clist1.contains(\"com.example.servlet.SomeServlet\"));\n\n Set<String> clist2 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", false);\n assertEquals(\"number of classes in JAR, non-recursive\", 13, clist2.size());\n assertTrue(\"searching for classes in JAR, non-recursive\", clist2.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n\n Set<String> clist3 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", true);\n assertEquals(\"number of classes in JAR, recursive\", 17, clist3.size());\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.function.Constants\"));\n }", "public String getClassPath();", "public ClassCreator(){\n\n\n\t\tScanner fin = null;\n\n\t\ttry {\n\t\t\tString[] nameHandler = fileName.split(\"\\\\.\");\n\n\t\t\tString className = nameHandler[0].replaceAll(\" |_|\\\\s$|0|1|2|3|4|5|6|7|8|9\", \"\");\n\n\n\t\t\t//Setting Up Scanners/PrintWriter\n\t\t\tfin = new Scanner(new File(fileName));\n\n\n\t\t\tPrintWriter pw = new PrintWriter(className + \".java\");\n\n\n\t\t\tString[] prop = fin.nextLine().split(\"\\t\");\n\t\t\tString[] data = fin.nextLine().split(\"\\t\");\n\n\t\t\tfor(int i = 0; i<prop.length; i++) {\n\t\t\t\tpropertyList.add(new Properties(prop[i].replaceAll(\"\\\\s\", \"\"), getDataType(data[i])));\n\t\t\t}\n\n\t\t\t//Imports\n\t\t\tpw.println(\"import java.util.Scanner;\\n\\n\");\n\t\t\t\n\t\t\t//Class Line\n\t\t\tpw.println(\"\\npublic class \" + className + \" {\");\n\n\t\t\t//Properties\n\t\t\tpw.println(\"\\n\\t//======================================================= Properties\\n\");\n\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateProperty());\n\t\t\t}\n\n\t\t\t//Constructors\n\t\t\tpw.println(\"\\n\\t//======================================================= Constructors\\n\");\n\n\t\t\t//================= Workhorse Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getDataType() + \" \" + propertyList.get(i).getFieldName() + \", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getDataType() + \" \" \n\t\t\t\t\t+ propertyList.get(propertyList.size()-1).getFieldName() + \"){\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetCall(p));\n\t\t\t}\n\t\t\tpw.println(\"\\t}\\n\");\n\n\t\t\t//================= Scanner Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(Scanner fin) throws Exception {\\n\");\n\t\t\tpw.println(\"\\t\\tString[] parts = fin.nextLine().split(\\\"\\\\t\\\");\");\n\t\t\tint arrayCount = 0;\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tif(p.getDataType().equals(\"int\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Integer.parseInt(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"double\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Double.parseDouble(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"long\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Long.parseLong(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"boolean\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Boolean.parseBoolean(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpw.println(p.generateSetCall(\"parts[\" + arrayCount + \"]\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tpw.println(\"\\n\\t}\");\n\n\t\t\t//Methods\n\t\t\tpw.println(\"\\n\\t//======================================================= Methods\\n\");\n\n\t\t\t\t//Equals\n\t\t\tpw.println(\"\\tpublic boolean equals(Object obj) {\");\n\t\t\tpw.println(\"\\t\\tif(!(obj instanceof \" + className + \")) return false;\");\n\t\t\tpw.println(\"\\t\\t\" + className + \" \" + className.substring(0,1).toLowerCase() + \" = (\" + className + \")obj;\");\n\t\t\tpw.println(\"\\t\\treturn getEqualsString().equals(\" + className.substring(0,1).toLowerCase() + \".getEqualsString());\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//EqualsHelper\n\t\t\tpw.println(\"\\n\\tprivate String getEqualsString() {\");\n\t\t\tpw.print(\"\\t\\treturn \");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getFieldName() + \" + \\\"~\\\" + \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//toString\n\t\t\tpw.println(\"\\n\\tpublic String toString() {\");\n\t\t\tpw.print(\"\\t\\treturn \\\"\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).generateUpperCase() + \": \\\" + \" + propertyList.get(i).getFieldName() + \" + \\\", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).generateUpperCase() + \": \\\" + \" + propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\n\t\t\t//Getters/Setters\n\t\t\tpw.println(\"\\n\\t//======================================================= Getters/Setters\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateGetter());\n\t\t\t}\n\t\t\tpw.println();\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetter());\n\t\t\t}\n\n\t\t\t//End of the file code\n\t\t\tpw.print(\"\\n\\n}\");\n\t\t\tfin.close();\n\t\t\tpw.close();\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error: \" + e.getMessage());\n\t\t} finally { //Checked Last after try\n\t\t\ttry {fin.close();} catch (Exception e) {} //Just Double Checking\n\n\t\t}\n\n\n\n\n\t}", "private String getClassName(String fileName){\n String className = FilenameUtils.getBaseName(fileName);\n return className;\n }", "public ClassPathManager() {\n projectCP = new LinkedList<File>();\n buildCP = new LinkedList<File>();\n projectFilesCP = new LinkedList<File>();\n externalFilesCP = new LinkedList<File>();\n extraCP = new LinkedList<File>();\n// systemCP = new LinkedList<File>();\n// openFilesCP = new LinkedList<File>();\n }", "public ClassPath getClassPath();", "public void testJavaClassRepository871() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(Foreach.class.getCanonicalName());\n\t\tvar2730.getClass(CyclomaticMethods.class.getCanonicalName());\n\t\tvar2730.getClass(LineNumbersForConditionals.class.getCanonicalName());\n\t}", "private void scan() {\n if (classRefs != null)\n return;\n // Store ids rather than names to avoid multiple name building.\n Set classIDs = new HashSet();\n Set methodIDs = new HashSet();\n\n codePaths = 1; // there has to be at least one...\n\n offset = 0;\n int max = codeBytes.length;\n\twhile (offset < max) {\n\t int bcode = at(0);\n\t if (bcode == bc_wide) {\n\t\tbcode = at(1);\n\t\tint arg = shortAt(2);\n\t\tswitch (bcode) {\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret:\n\t\t\toffset += 4;\n\t\t\tbreak;\n\n\t\t case bc_iinc:\n\t\t\toffset += 6;\n\t\t\tbreak;\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t } else {\n\t\tswitch (bcode) {\n // These bcodes have CONSTANT_Class arguments\n case bc_instanceof: \n case bc_checkcast: case bc_new:\n {\n\t\t\tint index = shortAt(1);\n classIDs.add(new Integer(index));\n\t\t\toffset += 3;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_putstatic: case bc_getstatic:\n case bc_putfield: case bc_getfield: {\n\t\t\tint index = shortAt(1);\n CPFieldInfo fi = (CPFieldInfo)cpool.get(index);\n classIDs.add(new Integer(fi.getClassID()));\n\t\t\toffset += 3;\n\t\t\tbreak;\n }\n\n // These bcodes have CONSTANT_MethodRef_info arguments\n\t\t case bc_invokevirtual: case bc_invokespecial:\n case bc_invokestatic:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_jsr_w:\n\t\t case bc_invokeinterface:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n // Branch instructions\n\t\t case bc_ifeq: case bc_ifge: case bc_ifgt:\n\t\t case bc_ifle: case bc_iflt: case bc_ifne:\n\t\t case bc_if_icmpeq: case bc_if_icmpne: case bc_if_icmpge:\n\t\t case bc_if_icmpgt: case bc_if_icmple: case bc_if_icmplt:\n\t\t case bc_if_acmpeq: case bc_if_acmpne:\n\t\t case bc_ifnull: case bc_ifnonnull:\n\t\t case bc_jsr:\n codePaths++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n case bc_lcmp: case bc_fcmpl: case bc_fcmpg:\n case bc_dcmpl: case bc_dcmpg:\n codePaths++;\n\t\t\toffset++;\n break;\n\n\t\t case bc_tableswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tlong low = intAt(tbl, 1);\n\t\t\tlong high = intAt(tbl, 2);\n\t\t\ttbl += 3 << 2; \t\t\t// three int header\n\n // Find number of unique table addresses.\n // The default path is skipped so we find the\n // number of alternative paths here.\n Set set = new HashSet();\n int length = (int)(high - low + 1);\n for (int i = 0; i < length; i++) {\n int jumpAddr = (int)intAt (tbl, i) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n\n\t\t\toffset = tbl + (int)((high - low + 1) << 2);\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_lookupswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tint npairs = (int)intAt(tbl, 1);\n\t\t\tint nints = npairs * 2;\n\t\t\ttbl += 2 << 2; \t\t\t// two int header\n\n // Find number of unique table addresses\n Set set = new HashSet();\n for (int i = 0; i < nints; i += 2) {\n // use the address half of each pair\n int jumpAddr = (int)intAt (tbl, i + 1) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n \n\t\t\toffset = tbl + (nints << 2);\n\t\t\tbreak;\n\t\t }\n\n // Ignore other bcodes.\n\t\t case bc_anewarray: \n offset += 3;\n break;\n\n\t\t case bc_multianewarray: {\n\t\t\toffset += 4;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret: case bc_newarray:\n\t\t case bc_bipush: case bc_ldc:\n\t\t\toffset += 2;\n\t\t\tbreak;\n\t\t \n\t\t case bc_iinc: case bc_sipush:\n\t\t case bc_ldc_w: case bc_ldc2_w:\n\t\t case bc_goto:\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_goto_w:\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t }\n\t}\n classRefs = expandClassNames(classIDs);\n methodRefs = expandMethodNames(methodIDs);\n }", "private ClinicFileLoader() {\n\t}", "private static List<Class> findClasses(File directory, String packageName)\n\t\t\tthrows ClassNotFoundException {\n\t\tList<Class> classes = new ArrayList<Class>();\n\t\tif (directory.exists()) {\n\t\t\tFile[] files = directory.listFiles();\n\t\t\tfor (File file : files) {\n\t\t\t\tif (file.isDirectory()) {\n\t\t\t\t\tassert !file.getName().contains(\".\");\n\t\t\t\t\tclasses.addAll(findClasses(file,\n\t\t\t\t\t\t\tpackageName + \".\" + file.getName()));\n\t\t\t\t} else if (file.getName().endsWith(\".class\") && !file.getName().endsWith(\"Test.class\")) {\n\t\t\t\t\tclasses.add(Class.forName(packageName\n\t\t\t\t\t\t\t+ '.'\n\t\t\t\t\t\t\t+ file.getName().substring(0,\n\t\t\t\t\t\t\t\t\tfile.getName().length() - 6)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn classes;\n\t}", "public void testJavaClassRepository874() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(Gadget.class.getCanonicalName());\n\t\tvar2730.getClass(LoDStaticCall.class.getCanonicalName());\n\t}", "public static void main(String[] args) throws ClassNotFoundException {\n\t\tClass cc = Class.forName(\"JUnit.Test\");\n\t\tnew Test();\n\t\t//Test test = null;//\n\t\t//new Test();\n\t\t//ClassLoadTest t = new ClassLoadTest();\n\t}", "private Class<DimensionInterface>[] getAllClasses (String pckgname) {\n\t\t\n\t\ttry {\n\t\t \n\t\t\t// Classes will store our results\n\t\t\tArrayList classes = new ArrayList ();\n\t\t\t\n\n\t\t\t// Get a File object for the package \n\t\t File directory; \n\t\t \n\t\t \n\t\t // Load the package \n\t\t try { \n\t\t \tdirectory = new File (\n\t\t \t\tThread.currentThread ()\n\t\t \t\t\t.getContextClassLoader()\n\t\t \t\t\t.getResource (pckgname.replace('.', '/'))\n\t\t \t\t\t.getFile()\n\t\t \t); \n\t\t \n\t\t } catch (NullPointerException x) { \n\t\t \tSystem.out.println (\"Nullpointer\");\n\t\t \tthrow new ClassNotFoundException (pckgname + \" does not appear to be a valid package\"); \n\t\t }\n\t\t \n\t\t \n\t\t // IF we have found our package, then\n\t\t // obtain the files withtin\n\t\t if ( ! directory.exists ()) {\n\t\t \tSystem.out.println (\"Directory does not exist\");\n\t\t \tthrow new ClassNotFoundException(pckgname + \" does not appear to be a valid package\"); \n\t\t } \t\t \t\n\t\t \t\n\t\t \n\t \t// Get the list of the files contained in the package \n\t \tString[] files = directory.list ();\n\t\t \t\n\t\t \t\n\t \t// Get the files\n\t \tfor (int i=0; i<files.length; i++) { \n\n\t \t\t// we are only interested in .class files \n\t \t\tif ( ! files[i].endsWith(\".class\")) {\n\t \t\t\tcontinue;\n\t \t\t}\n\t \t\t\t\n \t\t\t// removes the .class extension \n \t\t\tclasses.add(Class.forName (pckgname + '.' + files[i].substring (0, files[i].length() - 6)));\n\t \t\t\t\n\t \t}\n\t\t \n\t\t \n\t \t// Convert the result in an array\n\t\t Class[] classesA = new Class[classes.size()]; \n\t\t classes.toArray (classesA); \n\t\t \n\t\t \n\t\t // Return\n\t\t return classesA;\n\t\t \n\t\t// Generic error\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public void testJavaClassRepository872() throws Exception {\n\t\tJavaClassRepository var2730 = new JavaClassRepository();\n\t\tvar2730.getClass(SingleMethodClass.class.getCanonicalName());\n\t\tvar2730.getClass(Example.class.getCanonicalName());\n\t}", "private Class<?> findInternalClass(String name){\n Class<?> clazz = null;\n for (int i = 0; i < urls.length; i++) {\n String root = urls[i].getPath();\n clazz = realFindClass(root,name);\n if(clazz != null)\n break;\n }\n if(clazz != null) {\n classes.put(name,clazz);\n return clazz;\n }\n return null;\n }", "private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {\n\t\tList<Class<?>> classes = new ArrayList<Class<?>>();\n\t\tif (!directory.exists()) {\n\t\t\treturn classes;\n\t\t}\n\t\tFile[] files = directory.listFiles();\n\t\tfor (File file : files) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tassert !file.getName().contains(\".\");\n\t\t\t\tclasses.addAll(findClasses(file, packageName + \".\" + file.getName()));\n\t\t\t} else if (file.getName().endsWith(\".class\")) {\n\t\t\t\tclasses.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n\t\t\t}\n\t\t}\n\t\treturn classes;\n\t}", "private static boolean isClassFile(WebFile aFile)\n {\n String path = aFile.getPath();\n if (!path.endsWith(\".class\"))\n return false;\n if (isIgnorePath(path))\n return false;\n return true;\n }", "@Override\n public ClassFileServices getClassFileServices() {\n return null;\n }", "@Test\n @Disabled(\"Not work in Java >=9\")\n void printAllClassJars() {\n var sysClassLoader = org.apache.commons.io.FileUtils.class.getClassLoader();\n var urLs = ((URLClassLoader) sysClassLoader).getURLs();\n for (var url : urLs) {\n System.out.println(url.getFile());\n }\n }", "public void importClass(String klass) throws Exception;", "String getMainClass();", "@SuppressWarnings(\"unused\")\n private void saveClassfileBufferForDebugging(String className, byte[] classfileBuffer) {\n try {\n if (className.contains(\"CX\")) {\n java.io.DataOutputStream tmpout = new java.io.DataOutputStream(new java.io.FileOutputStream(\"out\"));\n tmpout.write(classfileBuffer, 0, classfileBuffer.length);\n tmpout.close();\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public static void main(String[] args) throws ClassNotFoundException {\n Class.forName(\"Mgr01\");\n }", "@Override\n protected Class \n findClass\n (\n String cname\n ) \n throws ClassNotFoundException\n {\n byte bs[] = pContents.get(cname);\n if(bs == null) \n throw new ClassNotFoundException\n\t(\"Unable to find class (\" + cname + \")!\");\n\n return defineClass(cname, bs, 0, bs.length);\n }", "private void loadCssForThisClass() {\n\t\tString className = getClass().getName();\n\t\tString cssPath = className.replace(\".\", \"/\") + \".css\";\n\t\tURL cssUrl = getClass().getClassLoader().getResource(cssPath);\n\t\tloadCss(cssUrl);\n\n\t\t// System.out.println(\"CSS:\\n\" + getCssContent(cssUrl) );\n\t}", "private SourcecodePackage() {}", "static Class _mthclass$(String x0)\r\n\t {\n\t\t\treturn null;\r\n\t //x1;\r\n\t //throw new NoClassDefFoundError(x1.getMessage());\r\n\t }", "@Test\n\tpublic void testClassAndFileLinks() throws Exception\n\t{\n\t\tFile file = new File(System.getProperty(\"user.dir\"));\n\t\twhile (! file.getName().equals(\"swac-testbed\")) {\n\t\t\tfile = file.getParentFile();\n\t\t\tif (file == null)\n\t\t\t\tAssert.fail(\"Could not find create scenario scripts. Started from \" + System.getProperty(\"user.dir\") + \" and went up\");\n\t\t}\n\t\t\n\t\t// Find swac-assembly dir\n\t\tFile swacParent = file.getParentFile();\n\t\tif (swacParent == null)\n\t\t\tAssert.fail(\"Could not find create scenario scripts, no dir above swac-controller\");\n\t\t\n\t\tFile swacAssembly = new File(swacParent, \"swac-assembly\");\n\t\tif (swacAssembly == null || ! swacAssembly.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts, swac-assembly not parallel to swac-controller\");\n\t\t\n\t\t// Find windows and unix creat scenario scripts\n\t\tchar sep = File.separatorChar; \n\t\tFile swacAssemblyBin = new File(swacAssembly.getAbsolutePath() + sep + \"src\" + sep + \"main\" + sep + \"bin\");\n\t\tif (swacAssemblyBin == null || ! swacAssemblyBin.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts in swac-assembly/src/main/bin\");\n\t\t\n\t\tFile windowsScript = new File(swacAssemblyBin, \"swac-create-scenario.bat\");\n\t\tif (! windowsScript.exists())\n\t\t\tAssert.fail(\"Could not find windows create scenario script in swac-assembly/src/main/bin/swac-create-scenario.bat\");\n\t\t\n\t\tFile unixScript = new File(swacAssemblyBin, \"new-swac-create-scenario.sh\");\n\t\tif (! unixScript.exists())\n\t\t\tAssert.fail(\"Could not find unix create scenario script in swac-assembly/src/main/bin/new-swac-create-scenario.sh\");\n\n\n\t\t// Read in windows create scenario script, parse out file and class lists.\n\t\tSet<String> winFilesSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_name_templates\", windowsScript, winFilesSet);\n\t\tSet<String> winClassSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_classes\", windowsScript, winClassSet);\n\t\tAssert.assertEquals(\"For windows create scenario script, num of files != num of classes, file \" + winFilesSet.size() + \", classes \" + winClassSet.size(),\n\t\t\t\t\t\t\twinFilesSet.size(), winClassSet.size());\n\t\tMap<String, String> winFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(winFilesSet, winClassSet, winFileClassMap);\n\t\t\n\t\t// Read in unix create scenario script, parse out file and class lists. \n\t\t// Adjust some values to align with windows style to allow apple to apples comparisons\n\t\tSet<String> unixFilesSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Files\", unixScript, unixFilesSet);\n\t\tunixFilesSet = adjustUnixFiles(unixFilesSet, new LinkedHashSet<String>());\n\t\tSet<String> unixClassSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Classes\", unixScript, unixClassSet);\n\t\tunixClassSet = adjustUnixClasses(unixClassSet, new LinkedHashSet<String>());\n\t\tAssert.assertEquals(\"For unix create scenario script, num of files != num of classes, file \" + unixFilesSet.size() + \", classes \" + unixClassSet.size(),\n\t\t\t\tunixFilesSet.size(), unixClassSet.size());\n\t\tMap<String, String> unixFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(unixFilesSet, unixClassSet, unixFileClassMap); \n\n\t\t// Test if the classes in windows and unix scripts match up\n\t\tif (! winClassSet.equals(unixClassSet)) {\n\t\t\tLinkedHashSet<String> uniqueWindowClasses = new LinkedHashSet<String>(winClassSet);\n\t\t\tuniqueWindowClasses.removeAll(unixClassSet);\n\t\t\t\n\t\t\tLinkedHashSet<String> uniqueUnixClasses = new LinkedHashSet<String>(unixClassSet);\n\t\t\tuniqueUnixClasses.removeAll(winClassSet);\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\tif(! uniqueWindowClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique windows class(es): \").append(uniqueWindowClasses).append(\". \");\n\t\t\tif(! uniqueUnixClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique unix class(es): \").append(uniqueUnixClasses).append(\". \");\n\t\t\t\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t\t\n\t\t// Test if the files in windows and unix scripts match up\n\t\tStringBuilder sb = null;\n\t\tfor (Entry<String, String> winEntry : winFileClassMap.entrySet()) {\n\t\t\tString winFile = winEntry.getValue();\n\t\t\tString unixFile = unixFileClassMap.get(winEntry.getKey());\n\t\t\tif (! winFile.equals(unixFile)) {\n\t\t\t\tif (sb == null) {\n\t\t\t\t\tsb = new StringBuilder();\n\t\t\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\t\t}\n\t\t\t\tsb.append(\"Different files specified for class '\" + winEntry.getKey() + \"': windows: '\" + winFile + \"', unix: '\" + unixFile + \"'. \");\n\t\t\t}\n\t\t}\n\t\tif (sb != null) {\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t}", "public static Class get_CLASS()\n {\n Class clz;\n try\n {\n clz = Class.forName(\"com.tangosol.coherence/component/net/Security\".replace('/', '.'));\n }\n catch (ClassNotFoundException e)\n {\n throw new NoClassDefFoundError(e.getMessage());\n }\n return clz;\n }", "private ArrayList<Class<Critter>> getCritterClasses(Package pkg) {\n\t\tArrayList<Class<Critter>> classes = new ArrayList<Class<Critter>>();\n\t\tString packagename = pkg.getName();\n\t\tURL resource = ClassLoader.getSystemClassLoader().getResource(packagename);\n\t\tString path = resource.getFile(); //path to package\n\t\tFile directory;\n\t\ttry {\n\t\t\tdirectory = new File(resource.toURI());\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t\tif (directory.exists()) {\n\t\t\tString[] files = directory.list();\n\t\t\tfor (String file : files) {\n\t\t\t\tif (file.endsWith(\".class\")) {\n\t\t\t\t\t// removes the .class extension\n\t\t\t\t\tString className = packagename + '.' + file.substring(0, file.length() - 6);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tClass classObj = Class.forName(className);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tObject obj = classObj.newInstance();\n\t\t\t\t\t\t\tif (obj instanceof Critter) {\n\t\t\t\t\t\t\t\tclasses.add(classObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tcontinue; //Skip if class cannot be made into object\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn classes;\n\t}", "private static void Demo8() {\n\t\tClass<?> class1 = null;\r\n\t\ttry {\r\n\t\t\tclass1 = Class.forName(\"CH16.SuperMan\");\r\n\t\t\tString nameString = class1.getClassLoader().getClass().getName();\r\n\t\t\tSystem.out.println(\"Demo8: 类加载器类名: \" + nameString);\r\n\t\t} catch (ClassNotFoundException 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}", "public void testNewClassPathImplementation() throws Exception {\n\n\t\t// Create the source\n\t\tStringWriter buffer = new StringWriter();\n\t\tPrintWriter source = new PrintWriter(buffer);\n\t\tsource.println(\"package net.officefloor.test;\");\n\t\tsource.println(\"public class ExtraImpl extends \" + CLASS_LOADER_EXTRA_CLASS_NAME + \" {\");\n\t\tsource.println(\" public String getMessage() {\");\n\t\tsource.println(\" return \\\"TEST\\\";\");\n\t\tsource.println(\" }\");\n\t\tsource.println(\"}\");\n\t\tsource.flush();\n\n\t\t// Override compiler with extra class path\n\t\tURLClassLoader extraClassLoader = (URLClassLoader) createNewClassLoader();\n\t\tClassLoader classLoader = new URLClassLoader(extraClassLoader.getURLs()) {\n\t\t\t@Override\n\t\t\tpublic Class<?> loadClass(String name) throws ClassNotFoundException {\n\t\t\t\tif (OfficeFloorJavaCompilerImpl.class.getName().equals(name)) {\n\t\t\t\t\treturn OfficeFloorJavaCompilerImpl.class;\n\t\t\t\t} else {\n\t\t\t\t\treturn extraClassLoader.loadClass(name);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.compiler = OfficeFloorJavaCompiler.newInstance(getSourceContext(classLoader));\n\n\t\t// Compile the source\n\t\tJavaSource javaSource = this.compiler.addSource(\"net.officefloor.test.ExtraImpl\", buffer.toString());\n\t\tClass<?> clazz;\n\t\ttry {\n\t\t\tclazz = javaSource.compile();\n\t\t} catch (CompileError error) {\n\n\t\t\t// Maven + Java8 has class path issues in running Lombok\n\t\t\tif (!new ModulesJavaFacet().isSupported()) {\n\t\t\t\tSystem.err.println(\"KNOWN GOTCHA: \" + this.getClass().getSimpleName()\n\t\t\t\t\t\t+ \" new class path on Java8 with Maven is having Lombok issues\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Propagate failure\n\t\t\tthrow error;\n\t\t}\n\n\t\t// Ensure appropriate compile to extra class\n\t\tObject object = clazz.getConstructor().newInstance();\n\t\tassertEquals(\"Incorrect parent class from class path\", CLASS_LOADER_EXTRA_CLASS_NAME,\n\t\t\t\tobject.getClass().getSuperclass().getName());\n\t}", "public void buildClass(String pkgName, String className,\n\t List<Operation> operations) {\n\tList<ClassOperations> classOperations = new ArrayList<ClassOperations>();\n\n\tString visibility = \"public\";\n\tString returnType = \"void\";\n\tString parameters = \"\";\n\tString methodName = \"methodName\";\n\tString methodBody = \"return null;\";\n\n\t// Retrieve the operations.\n\tClassOperations operation;\n\tfor (Operation op : operations) {\n\t parameters = \"\";\n\t methodName = op.getName();\n\t returnType = op.getReturnType();\n\n\t // Iterating through a list of parameters\n\t for (Parameter param : op.getParameters()) {\n\t\t// Adding the parameters up\n\t\tparameters += param.getType() + \" \" + param.getName();\n\n\t\t// If not the last element in the list of parameters add a comma\n\t\tif (!param.equals(op.getParameters().get(\n\t\t\top.getParameters().size() - 1)))\n\t\t parameters += \", \";\n\t }\n\n\t if (parameters.equalsIgnoreCase(\"\"))\n\t\tmethodBody = \"return null;\";\n\t else\n\t\tmethodBody = \"System.out.println($1); return null;\";\n\t operation = new ClassOperations(visibility, returnType, methodName,\n\t\t parameters, methodBody);\n\t classOperations.add(operation);\n\t}\n\n\t// Check if the class exists\n\ttry {\n\t java.lang.reflect.Method m;\n\t m = ClassLoader.class.getDeclaredMethod(\"findLoadedClass\",\n\t\t new Class[] { String.class });\n\t m.setAccessible(true);\n\t ClassLoader cl = ClassLoader.getSystemClassLoader();\n\t Object testObject = m.invoke(cl, pkgName + \".\" + className);\n\t if (testObject != null) {\n\t\t// Something can be done after checking if the class exists or\n\t\t// not\n\t } else {\n\t\t// Something can be done after checking if the class exists or\n\t\t// not\n\t }\n\t} catch (SecurityException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (NoSuchMethodException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (IllegalArgumentException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (InvocationTargetException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t}\n\n\t// Build the compile time class\n\tsuper.build(pkgName, className, classOperations);\n\n\t// Refreshing the class loader for retrieving the loaded memory\n\tclassLoader = super.getClassLoader();\n }", "public JPClass getParsedClass(File f) throws Exception;", "public abstract List<String> scanAllClassNames();", "@BeforeClass\n public void loadGeneratedClasses() throws IOException, ClassNotFoundException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assertNotNull(classLoader, \"Unable to load ClassLoader to find generated JPA Java classes.\");\n \n Enumeration<URL> jpaClassFileURL = classLoader.getResources(\"com/goldstandard/model/\");\n assertTrue(jpaClassFileURL.hasMoreElements(), \"Cannot find com/goldstandard/model/ resource\");\n \n // There should only be one base resource directory\n File jpaClassFileDir = new File(jpaClassFileURL.nextElement().getFile());\n \n generatedClassList = new ArrayList<Class<?>>();\n generatedClassNameMap = new HashMap<String, Class<?>>();\n generatedEnumNameMap = new HashMap<String, Class<?>>();\n \n // Loop through all the class files in the com.goldstandard.model package\n for (File classFile : jpaClassFileDir.listFiles()) {\n Matcher matcher = GENERATED_CLASS_PATTERN.matcher(classFile.getCanonicalPath());\n if (matcher.matches()) {\n String packageName = matcher.group(1).replace('/', '.');\n String className = matcher.group(2);\n \n // Load up the generated class and add it to the data provider\n Class<?> generatedClass = Class.forName(packageName + \".\" + className);\n if (!generatedClass.isEnum()) {\n generatedClassList.add(generatedClass);\n generatedClassNameMap.put(generatedClass.getAnnotation(Table.class).name(), generatedClass);\n } else {\n generatedEnumNameMap.put(className, generatedClass);\n }\n }\n }\n \n assertTrue(generatedClassList.size() > 0, \"Did not find any generated classes\");\n }" ]
[ "0.66890335", "0.658208", "0.6424544", "0.6384533", "0.63660586", "0.6346557", "0.6343524", "0.63378346", "0.6312088", "0.6300512", "0.6293441", "0.6284997", "0.6243368", "0.6231843", "0.6228309", "0.6228309", "0.6211164", "0.62019545", "0.61708385", "0.6069757", "0.60657144", "0.60152763", "0.599517", "0.59842247", "0.597767", "0.5959561", "0.59523237", "0.59477484", "0.59477484", "0.5926486", "0.59263515", "0.5925134", "0.5922768", "0.5914006", "0.5907655", "0.59008145", "0.58992773", "0.5898536", "0.5896197", "0.5862825", "0.5856328", "0.58558035", "0.58439827", "0.5827822", "0.57987964", "0.57987094", "0.5795803", "0.57840705", "0.5782865", "0.5777724", "0.5765296", "0.5764733", "0.5763253", "0.5760088", "0.5753869", "0.57510066", "0.57409036", "0.5730155", "0.5723485", "0.57226187", "0.571522", "0.571172", "0.5706579", "0.5701802", "0.56921566", "0.5690652", "0.56904364", "0.5682191", "0.56714326", "0.56705326", "0.56698316", "0.5663229", "0.56556416", "0.56525576", "0.5651954", "0.5648335", "0.56419724", "0.5638461", "0.5629773", "0.56259435", "0.5621812", "0.56213856", "0.5611523", "0.5610236", "0.5609853", "0.56097114", "0.56065273", "0.5588228", "0.55864114", "0.558606", "0.55785936", "0.55692345", "0.5562995", "0.5557879", "0.555759", "0.55567026", "0.5552458", "0.554591", "0.55425346", "0.55414766", "0.5538614" ]
0.0
-1
Allows to determine directories with resources to exclude them from analysis, otherwise analysis might fail due to SONAR791. This is a kind of workaround, which is based on the fact that M2Eclipse configures exclusion pattern "" for directories with resources.
private boolean isSourceExcluded(IClasspathEntry entry) { IPath[] exclusionPatterns = entry.getExclusionPatterns(); if (exclusionPatterns != null) { for (IPath exclusionPattern : exclusionPatterns) { if ("**".equals(exclusionPattern.toString())) { return true; } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String[] getExcluded(Resource resource) {\n\n\t\tCollection<String> excludes = new LinkedList<String>();\n\n\t\tString relativePath = PathUtils.subtract(resource.getDirectory(),\n\t\t\t\tthis.project.getBasedir().getAbsolutePath()\n\t\t\t\t\t\t+ PathSeparator.get());\n\n\t\tfor (Platform platform : Platform.fromString(this.platforms)) {\n\n\t\t\tString preStart = platform.behave(this.preStart);\n\n\t\t\texcludes.add(PathUtils.subtract(preStart, relativePath));\n\t\t}\n\n\t\treturn excludes.toArray(new String[] {});\n\t}", "@Test\n public void resourceFolderWithoutResourcesTest() {\n Common.ArtifactLocation myLibRoot = sourceProto(\"com/google/mylib/res\");\n Common.ArtifactLocation anotherLibRoot = sourceProto(\"com/google/anotherlib/res\");\n Common.ArtifactLocation resourceAar = sourceProto(\"com/google/mylib/resources.aar\");\n\n IntellijIdeInfo.AndroidIdeInfo input =\n IntellijIdeInfo.AndroidIdeInfo.newBuilder()\n .addResFolders(\n IntellijIdeInfo.ResFolderLocation.newBuilder()\n .setRoot(myLibRoot)\n .setAar(resourceAar)\n .build())\n .addResFolders(\n IntellijIdeInfo.ResFolderLocation.newBuilder().setRoot(anotherLibRoot).build())\n .build();\n\n AndroidIdeInfo output = AndroidIdeInfo.fromProto(input);\n\n assertThat(\n output.getResources().stream()\n .map(AndroidResFolder::getRoot)\n .map(ArtifactLocation::getRelativePath)\n .collect(Collectors.toList()))\n .containsExactly(\"com/google/mylib/res\", \"com/google/anotherlib/res\");\n\n AndroidResFolder folder0 = output.getResources().get(0);\n AndroidResFolder folder1 = output.getResources().get(1);\n\n assertThat(folder0.getRoot()).isEqualTo(ArtifactLocation.fromProto(myLibRoot));\n assertThat(folder1.getRoot()).isEqualTo(ArtifactLocation.fromProto(anotherLibRoot));\n\n assertThat(folder0.getAar()).isEqualTo(ArtifactLocation.fromProto(resourceAar));\n }", "public List<String> getIgnoreFilePatterns() {\n if (!ignoreFilePatterns.isEmpty()) {\n if (!ignoreFileRes.isEmpty()) {\n throw new InvalidProject(\n \"ignore_file_res is a deprecated configuration field. it is replaced with \"\n + \"ignore_file_patterns. Only one of these should be set.\");\n }\n return ignoreFilePatterns;\n }\n return ignoreFileRes;\n }", "public String[] getExcludedDirectories()\n throws TaskException\n {\n slowScan();\n int count = dirsExcluded.size();\n String[] directories = new String[ count ];\n for( int i = 0; i < count; i++ )\n {\n directories[ i ] = (String)dirsExcluded.get( i );\n }\n return directories;\n }", "@Test\n public void testFileSwitchAllowsExcludeOfChildren() throws Exception {\n final File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH);\n Verifier verifier = newVerifier(testDir.getAbsolutePath());\n\n verifier.addCliArgument(\"-f\");\n verifier.addCliArgument(\"module-a\");\n verifier.addCliArgument(\"--non-recursive\");\n verifier.setLogFileName(\"log-non-recursive.txt\");\n verifier.addCliArgument(\"compile\");\n verifier.execute();\n verifyTextNotInLog(verifier, \"Building module-a-1 1.0\");\n }", "public String[] getNotIncludedDirectories()\n throws TaskException\n {\n slowScan();\n int count = dirsNotIncluded.size();\n String[] directories = new String[ count ];\n for( int i = 0; i < count; i++ )\n {\n directories[ i ] = (String)dirsNotIncluded.get( i );\n }\n return directories;\n }", "public void setExcludes( String[] excludes )\n {\n if( excludes == null )\n {\n this.excludes = null;\n }\n else\n {\n this.excludes = new String[ excludes.length ];\n for( int i = 0; i < excludes.length; i++ )\n {\n String pattern;\n pattern = excludes[ i ].replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar );\n if( pattern.endsWith( File.separator ) )\n {\n pattern += \"**\";\n }\n this.excludes[ i ] = pattern;\n }\n }\n }", "public GlobFileSet setExcludeDirPattern(String pattern)\n\t\t{\n\t\tm_excDirPattern = Pattern.compile(pattern);\n\t\treturn (this);\n\t\t}", "private void scanProject() {\n ProjectResources resources = ResourceManager.getInstance().getProjectResources(mProject);\n if (resources != null) {\n Collection<ResourceItem> layouts = resources.getResourceItemsOfType(LAYOUT);\n for (ResourceItem layout : layouts) {\n List<ResourceFile> sources = layout.getSourceFileList();\n for (ResourceFile source : sources) {\n updateFileIncludes(source, false);\n }\n }\n\n return;\n }\n }", "private void excludeFromWarPackaging() {\n getLog().info(\"excludeFromWarPackaging\");\n String pluginGroupId = \"org.apache.maven.plugins\";\n String pluginArtifactId = \"maven-war-plugin\";\n if (project.getBuildPlugins() != null) {\n for (Object o : project.getBuildPlugins()) {\n Plugin plugin = (Plugin) o;\n\n if (pluginGroupId.equals(plugin.getGroupId()) && pluginArtifactId.equals(plugin.getArtifactId())) {\n Xpp3Dom dom = (Xpp3Dom) plugin.getConfiguration();\n if (dom == null) {\n dom = new Xpp3Dom(\"configuration\");\n plugin.setConfiguration(dom);\n }\n Xpp3Dom excludes = dom.getChild(\"packagingExcludes\");\n if (excludes == null) {\n excludes = new Xpp3Dom(\"packagingExcludes\");\n dom.addChild(excludes);\n excludes.setValue(\"\");\n } else if (excludes.getValue().trim().length() > 0) {\n excludes.setValue(excludes.getValue() + \",\");\n }\n\n Set<Artifact> dependencies = getArtifacts();\n getLog().debug(\"Size of getArtifacts: \" + dependencies.size());\n String additionalExcludes = \"\";\n for (Artifact dependency : dependencies) {\n getLog().debug(\"Dependency: \" + dependency.getGroupId() + \":\" + dependency.getArtifactId() + \"type: \" + dependency.getType());\n if (!dependency.isOptional() && Types.JANGAROO_TYPE.equals(dependency.getType())) {\n getLog().debug(\"Excluding jangaroo dependency form war plugin [\" + dependency.toString() + \"]\");\n // Add two excludes. The first one is effective when no name clash occurs\n additionalExcludes += \"WEB-INF\" + File.separator + \"lib\" + File.separator + dependency.getArtifactId() + \"-\" + dependency.getVersion() + \".jar,\";\n // the second when a name clash occurs (artifact will hav groupId prepended before copying it into the lib dir)\n additionalExcludes += \"WEB-INF\" + File.separator + \"lib\" + File.separator + dependency.getGroupId() + \"-\" + dependency.getArtifactId() + \"-\" + dependency.getVersion() + \".jar,\";\n }\n }\n excludes.setValue(excludes.getValue() + additionalExcludes);\n }\n }\n }\n }", "@Override\r\n\tpublic String globNoPaths(String[] args) {\r\n\t\treturn \"\";\r\n\t}", "protected static String createClassPathExcludingTestClasses()\n {\n String sSep;\n if (\"\\\\\".endsWith(File.separator))\n {\n sSep = \"\\\\\\\\\";\n }\n else\n {\n sSep = File.separator;\n }\n String sPattern = String.format(\".*%sio%starget%s.*\", sSep, sSep, sSep);\n return ClassPath.automatic().excluding(sPattern).toString();\n }", "public void setExcludedPattern(String excludedPattern)\n/* */ {\n/* 101 */ setExcludedPatterns(new String[] { excludedPattern });\n/* */ }", "@Override\n protected FilterClassLoader.Filter getExtensionParentClassLoaderFilter() {\n return new FilterClassLoader.Filter() {\n @Override\n public boolean acceptResource(String resource) {\n return ALLOWED_RESOURCES.contains(resource);\n }\n\n @Override\n public boolean acceptPackage(String packageName) {\n return ALLOWED_PACKAGES.contains(packageName);\n }\n };\n }", "public String[] getExcludedPatterns()\n/* */ {\n/* 122 */ return this.excludedPatterns;\n/* */ }", "boolean shouldAllowMissingSourceDir() {\n return allowMissingSourceDir;\n }", "public void setExcludes(String excludes)\n {\n this.excludes = excludes;\n }", "public void excludeAllFiles(){\n for(Map.Entry<String,File> entry : dataSourcesDirectories.entrySet()){\n \n //Get directory\n File dir = entry.getValue();\n \n //List files contained in this directory\n File[] listOfFiles = dir.listFiles();\n \n //Delete each file contained in this directory\n for(File file : listOfFiles)\n file.delete();\n \n //Delete directory\n dir.delete();\n \n }\n \n //For each directory created for each service\n for(Map.Entry<String,File> entry : servicesDirectories.entrySet()){\n \n //Get directory\n File dir = entry.getValue();\n \n //List files contained in this directory\n File[] listOfFiles = dir.listFiles();\n \n //Delete each file contained in this directory\n for(File file : listOfFiles)\n file.delete();\n \n //Delete directory\n dir.delete();\n \n }\n \n //Finally, delete sessionDirectory\n if(sessionDirectory != null)\n sessionDirectory.delete();\n \n }", "public void addDefaultExcludes()\n {\n int excludesLength = excludes == null ? 0 : excludes.length;\n String[] newExcludes;\n newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ];\n if( excludesLength > 0 )\n {\n System.arraycopy( excludes, 0, newExcludes, 0, excludesLength );\n }\n for( int i = 0; i < DEFAULTEXCLUDES.length; i++ )\n {\n newExcludes[ i + excludesLength ] = DEFAULTEXCLUDES[ i ].replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar );\n }\n excludes = newExcludes;\n }", "private static boolean mayHaveNonStringTranslations(String dirName) {\n if (!dirName.contains(SdkConstants.RES_QUALIFIER_SEP)) {\n return true;\n }\n if (ResourceFolderType.getFolderType(dirName) != ResourceFolderType.VALUES) {\n return true;\n }\n FolderConfiguration config = FolderConfiguration.getConfigForFolder(dirName);\n // Conservatively say it's interesting if there is an unrecognized configuration.\n if (config == null) {\n return true;\n }\n // If this is a translation mixed with something else, consider it a translation directory.\n boolean hasTranslation = false;\n for (ResourceQualifier qualifier : config.getQualifiers()) {\n if (qualifier instanceof LocaleQualifier) {\n hasTranslation = true;\n }\n }\n return !hasTranslation;\n }", "public void setAnalysisRoots(List<String> includedPaths, List<String> excludedPaths);", "public boolean getProjectDirExcluded() {\n return projectDirExcluded_;\n }", "public String[] getExcludedFiles()\n throws TaskException\n {\n slowScan();\n int count = filesExcluded.size();\n String[] files = new String[ count ];\n for( int i = 0; i < count; i++ )\n {\n files[ i ] = (String)filesExcluded.get( i );\n }\n return files;\n }", "@Test\n public void testMatcherForGlobExpressionFalse() {\n\n PathMatcher result = FileUtil.matcherForGlobExpression(\"/temp\");\n Assertions.assertThat(FileUtil.matches(FOLDER, result)).isFalse();\n }", "public List<Path> getTestFiles() throws Exception {\n try (Stream<Path> stream = Files.list(Paths.get(BibTeXMLImporterTest.class.getResource(\"\").toURI()))) {\n return stream.filter(p -> !Files.isDirectory(p)).collect(Collectors.toList());\n }\n\n }", "@InputFiles\n @Incremental\n @PathSensitive(PathSensitivity.RELATIVE)\n public abstract ConfigurableFileCollection getDexFolders();", "private List<String> getNotComputedFilesPath(String absolutePath) {\r\n\t\tList<String> res = new ArrayList<String>();\r\n\t\tFile f = new File(absolutePath);\r\n\t\tString[] list = f.list();\r\n\t\t\r\n\t\tfor(String s : list) {\r\n\t\t\tString elemPath = AppUtil.createFilePath(new String[]{absolutePath, s});\r\n\t\t\tif(!s.contains(COMPUTED_FILES_FOLDER_NM)) {\r\n\t\t\t\tFile f2 = new File(elemPath);\r\n\t\t\t\tif(f2.isDirectory()) {\r\n\t\t\t\t\tres.addAll(getNotComputedFilesPath(elemPath));\r\n\t\t\t\t} else if(f2.isFile()) {\r\n\t\t\t\t\tres.add(elemPath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "protected String setPathToResourcesIfNotProvided(String[] args) {\n if (args.length == 0) {\n args = new String[1];\n args[0] = \"./src/main/resources/Code Test\";\n }\n return args[0];\n }", "protected void slowScan()\n throws TaskException\n {\n if( haveSlowResults )\n {\n return;\n }\n\n String[] excl = new String[ dirsExcluded.size() ];\n excl = (String[])dirsExcluded.toArray( excl );\n\n String[] notIncl = new String[ dirsNotIncluded.size() ];\n notIncl = (String[])dirsNotIncluded.toArray( notIncl );\n\n for( int i = 0; i < excl.length; i++ )\n {\n if( !couldHoldIncluded( excl[ i ] ) )\n {\n scandir( new File( basedir, excl[ i ] ),\n excl[ i ] + File.separator, false );\n }\n }\n\n for( int i = 0; i < notIncl.length; i++ )\n {\n if( !couldHoldIncluded( notIncl[ i ] ) )\n {\n scandir( new File( basedir, notIncl[ i ] ),\n notIncl[ i ] + File.separator, false );\n }\n }\n\n haveSlowResults = true;\n }", "public void testShaderWithoutExcludesShouldRemoveReferencesOfOriginalPattern() throws Exception {\n shaderWithPattern(\"org/shaded/plexus/util\", new File(\"target/foo-custom-without-excludes.jar\"), new String[]{});\n }", "abstract public String getTopResourcesDir();", "public boolean getProjectDirExcluded() {\n return projectDirExcluded_;\n }", "@Test\n public void testExcludesdefault() throws Exception {\n String testName = \"excludesdefault\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 2);\n }", "public boolean hasProjectDirExcluded() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "private File extractResources() {\r\n\t\tif (org.opensourcephysics.display.OSPRuntime.appletMode)\r\n\t\t\treturn null;\r\n\t\tFile descTempDirectory = new File(getTemporaryDir() + \"DescriptionPages/\");\r\n\t\tif (!descTempDirectory.exists()) {\r\n\t\t\tif (!descTempDirectory.mkdirs()) {\r\n\t\t\t\tSystem.err.println(\r\n\t\t\t\t\t\t\"DescriptionPages : Could not create directory : \" + descTempDirectory.getAbsolutePath());\r\n\t\t\t\tJOptionPane.showMessageDialog(openPageButton, Memory.getResource(\"DescriptionPages.CannotExtractFiles\"),\r\n\t\t\t\t\t\tMemory.getResource(\"Error\"), JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// System.err.println (\"Extracting description pages to folder :\r\n\t\t// \"+descTempDirectory.getAbsolutePath());\r\n\t\tfor (String filename : model._getClassEjsResources()) {\r\n\t\t\tif (extractToDirectory(filename, descTempDirectory, false) == null)\r\n\t\t\t\treturn null;\r\n\t\t}\r\n\t\textractToDirectory(\"/_ejs_library/css/ejss.css\", descTempDirectory, false); // New in %.3Failure to do this does\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// not invalidate the process\r\n\t\treturn descTempDirectory;\r\n\t}", "public String[] getExcludes()\n {\n return m_excludes;\n }", "@Test\n public void testExcludesuser() throws Exception {\n String testName = \"excludesuser\";\n EkstaziPaths.removeEkstaziDirectories(getClass(), testName);\n executeCleanTestStep(testName, 0, 2);\n }", "public String[] getNotIncludedFiles()\n throws TaskException\n {\n slowScan();\n int count = filesNotIncluded.size();\n String[] files = new String[ count ];\n for( int i = 0; i < count; i++ )\n {\n files[ i ] = (String)filesNotIncluded.get( i );\n }\n return files;\n }", "public boolean hasProjectDirExcluded() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "abstract public String getRingResourcesDir();", "@Override\r\n\tpublic String globFilesDirectories(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "@Override\n protected Collection<String> getRelevantScannedFolders(Collection<String> scannedFolders) {\n return scannedFolders == null ? Collections.emptyList() : scannedFolders;\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with excludedKeyValues of Monitoring Exporter on the top level.\")\n void testFilterExcludedKeysFromTopLevel() throws Exception {\n logger.info(\"Testing filtering only excluded specific app name in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"app=\\\"myear1\\\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"app=\\\"wls-exporter\\\"\");\n\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_excluded_webapp_name.yaml\",checkIncluded, checkExcluded);\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with excludedKeyValues for not existed key of Monitoring Exporter on \"\n + \" top level.\")\n void testFilterExcludedNotExistedKeysTopLevel() throws Exception {\n logger.info(\"Testing filtering excluded not existing app names in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"app=\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"app=notexisted\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_excluded_not_existedkey.yaml\",checkIncluded, checkExcluded);\n }", "protected boolean isExcluded( String name )\n {\n for( int i = 0; i < excludes.length; i++ )\n {\n if( matchPath( excludes[ i ], name, isCaseSensitive ) )\n {\n return true;\n }\n }\n return false;\n }", "@Test\n public void resourceFolderAndResourcesTest() {\n Common.ArtifactLocation myLibRoot = sourceProto(\"com/google/mylib/res\");\n Common.ArtifactLocation anotherLibRoot = sourceProto(\"com/google/anotherlib/res\");\n Common.ArtifactLocation resourceAar = sourceProto(\"com/google/mylib/resources.aar\");\n\n IntellijIdeInfo.AndroidIdeInfo input =\n IntellijIdeInfo.AndroidIdeInfo.newBuilder()\n .addResources(myLibRoot)\n .addResources(anotherLibRoot)\n .addResFolders(\n IntellijIdeInfo.ResFolderLocation.newBuilder()\n .setRoot(myLibRoot)\n .setAar(resourceAar)\n .build())\n .addResFolders(\n IntellijIdeInfo.ResFolderLocation.newBuilder().setRoot(anotherLibRoot).build())\n .build();\n\n AndroidIdeInfo output = AndroidIdeInfo.fromProto(input);\n\n assertThat(\n output.getResources().stream()\n .map(AndroidResFolder::getRoot)\n .map(ArtifactLocation::getRelativePath)\n .collect(Collectors.toList()))\n .containsExactly(\"com/google/mylib/res\", \"com/google/anotherlib/res\");\n\n AndroidResFolder folder0 = output.getResources().get(0);\n AndroidResFolder folder1 = output.getResources().get(1);\n\n assertThat(folder0.getRoot()).isEqualTo(ArtifactLocation.fromProto(myLibRoot));\n assertThat(folder1.getRoot()).isEqualTo(ArtifactLocation.fromProto(anotherLibRoot));\n\n assertThat(folder0.getAar()).isEqualTo(ArtifactLocation.fromProto(resourceAar));\n }", "abstract File getResourceDirectory();", "Collection<String> getExcludeExceptions();", "abstract public String getImageResourcesDir();", "List<String> getApplicationContextResourcePaths();", "private void removeOldFiles() {\n Set<File> existingFiles = new HashSet<File>();\n collectFiles(existingFiles);\n for (ResourceResponse r : cacheResponseProcessor.getResources()) {\n String remotePathId = r.pathId;\n String remotePath = localClasspathProcessor.getLocalClasspath().get(remotePathId);\n String localPath = localPathTranslation.get(remotePath);\n File localFile = new File(localPath);\n File file = new File(localFile, r.name);\n existingFiles.remove(file);\n }\n }", "public List<ExcludeClasses> getExcludes()\n {\n return excludes;\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with excludedKeyValues of Monitoring Exporter on sublevel.\")\n void testFilterExcludedKeysFromSubLevel() throws Exception {\n logger.info(\"Testing filtering only excluded specific app name in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"servletName=\\\"com.oracle.wls.exporter.webapp.MainServlet\\\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"servletName=\\\"com.oracle.wls.exporter.webapp.ExporterServlet\\\"\");\n\n replaceConfigurationWithFilter(RESOURCE_DIR + \"/exporter/rest_filter_excluded_servlet_name.yaml\",\n checkIncluded, checkExcluded);\n }", "abstract public String getDataResourcesDir();", "public Builder clearProjectDirExcluded() {\n bitField0_ = (bitField0_ & ~0x00000002);\n projectDirExcluded_ = false;\n onChanged();\n return this;\n }", "public List<Resource> getFileLocations() throws IOException;", "public Builder setProjectDirExcluded(boolean value) {\n bitField0_ |= 0x00000002;\n projectDirExcluded_ = value;\n onChanged();\n return this;\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with includedKeyValues for not existed key of Monitoring Exporter on \"\n + \" top level.\")\n void testFilterIncludedNotExistedKeysTopLevel() throws Exception {\n logger.info(\"Testing filtering included not existed app names in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"app=\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_included_not_existedkey.yaml\",checkIncluded, checkExcluded);\n }", "public void setExcludedQualifiers(String excludedQualifiers) {\r\n this.excludedQualifiers = excludedQualifiers;\r\n }", "ResourceFilesHandler() throws MissingResourceException {\n\t\tLocale locale = Locale.getDefault();\n\t\tif (!SUPPORTED_LOCALES.contains(locale)) {\n\t\t\tlocale = DEFAULT_LOCALE;\n\t\t}\n\n\t\t// generate the path to the *.properties files\n\t\tfinal String path = getClass().getPackage().getName().replaceAll(\"\\\\.\", ESCAPED_FILE_SEPERATOR);\n\n\t\t// create the ResourceBundle\n\t\tbundleConstants = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_CARD);\n\t\tbundleI18N = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_LANGUAGE, locale);\n\t}", "@Test\n @DisplayName(\"Test Filtering of the Metrics with excludedKeyValues for not existed key of Monitoring Exporter on \"\n + \" sub level.\")\n void testFilterExcludedNotExistedKeysSubLevel() throws Exception {\n logger.info(\"Testing filtering excluded not existing servlet in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"servletName=\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"servletName=notexisted\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_excluded_not_existedkey_sublevel.yaml\",checkIncluded, checkExcluded);\n }", "public ExcludeFromBuildpathAction(IWorkbenchSite site) {\r\n\t\tsuper(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Exclude_label, RubyPluginImages.DESC_ELCL_EXCLUDE_FROM_BUILDPATH);\r\n\t\tsetToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Exclude_tooltip);\r\n\t\tsetDisabledImageDescriptor(RubyPluginImages.DESC_DLCL_EXCLUDE_FROM_BUILDPATH);\r\n\t\tfSite= site;\r\n\t\tfSelectedElements= new ArrayList();\r\n\t}", "@Test\n @DisplayName(\"Test Filtering of the Metrics with includedKeyValues for not existed key of Monitoring Exporter on \"\n + \" sub level.\")\n void testFilterIncludedNotExistedKeysSubLevel() throws Exception {\n logger.info(\"Testing filtering included not existed servlet names in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"servletName=\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_included_not_existedkey_sublevel.yaml\",checkIncluded, checkExcluded);\n }", "@Experimental\n default Collection<String> getGeneratedResources() {\n info(\"EXPERIMENTAL: Compile time resource contribution to the context is experimental\", null);\n return Collections.emptyList();\n }", "public void registerExcluded(List<String> excludedFiles) {\n excluded.addAll(excludedFiles);\n }", "public void setExcludes( List<ExcludeClasses> excludes )\n {\n this.excludes = excludes;\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with includedKeyValues and excludedKeyValues of Monitoring Exporter on \"\n + \" top level.\")\n void testFilterIncludedExcludedKeysComboTopLevel() throws Exception {\n logger.info(\"Testing filtering included and excluded specific app names in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"app=\\\"myear1\\\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"app=\\\"myear123\\\"\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_included_excluded_webapp_names.yaml\",checkIncluded, checkExcluded);\n }", "@Experimental\n default @NonNull Iterable<URL> getClasspathResources(@NonNull String path) {\n return Collections.emptyList();\n }", "public java.util.List<String> getExclusionPatterns() {\n return exclusionPatterns;\n }", "@Test\n @DisplayName(\"Test Filtering of the Metrics with includedKeyValues \"\n + \"of Monitoring Exporter on both upper and sublevel.\")\n void testFilterExcludedKeysFromBothLevels() throws Exception {\n logger.info(\"Testing filtering only excluded specific app name in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"servletName=\\\"com.oracle.wls.exporter.webapp.ExporterServlet\\\"\");\n checkIncluded.add(\"app=\\\"myear1\\\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"servletName=\\\"com.oracle.wls.exporter.webapp.MainServlet\\\"\");\n checkExcluded.add(\"app=\\\"myear123\\\"\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_excluded_webapp_and_servlet_names.yaml\",checkIncluded, checkExcluded);\n }", "@Test\n public void resourceBackwardsCompatibilityTest() {\n IntellijIdeInfo.AndroidIdeInfo input =\n IntellijIdeInfo.AndroidIdeInfo.newBuilder()\n .addResources(sourceProto(\"com/google/mylib/res\"))\n .addResources(sourceProto(\"com/google/anotherlib/res\"))\n .build();\n\n AndroidIdeInfo output = AndroidIdeInfo.fromProto(input);\n\n assertThat(\n output.getResources().stream()\n .map(AndroidResFolder::getRoot)\n .map(ArtifactLocation::getRelativePath)\n .collect(Collectors.toList()))\n .containsExactly(\"com/google/mylib/res\", \"com/google/anotherlib/res\");\n }", "static void ignore() {\n }", "@Test\n\tpublic void testWellknownFileAnalyzers() {\n\t\tfinal File py = new File(\"./src/test/resources/file.py\");\n\t\tFileAnalyzer fa = FileAnalyzerFactory.buildFileAnalyzer(py);\n\t\tassertTrue(fa instanceof PythonFileAnalyzer);\n\t\t\n\t\tfinal File d = new File(\"./src/test/resources\");\n\t\tfa = FileAnalyzerFactory.buildFileAnalyzer(d);\n\t\tassertTrue(fa instanceof DirAnalyzer);\n\t\t\n\t\tfinal File ja = new File(\"./src/test/resources/file.java\");\n\t\tfa = FileAnalyzerFactory.buildFileAnalyzer(ja);\n\t\tassertTrue(fa instanceof JavaFileAnalyzer2);\n\t}", "private Directories() {\n\n\t}", "FileCollection getGeneratedSourcesDirs();", "@Test\n @DisplayName(\"Test Filtering of the Metrics with includedKeyValues of Monitoring Exporter on \"\n + \" upper and excludedKeyValues on sublevel.\")\n void testFilterIncludedTopExcludedKeysSubLevels() throws Exception {\n logger.info(\"Testing filtering only excluded specific app name in the metrics \");\n List<String> checkIncluded = new ArrayList<>();\n checkIncluded.add(\"app=\\\"wls-exporter\\\"\");\n List<String> checkExcluded = new ArrayList<>();\n checkExcluded.add(\"servletName=\\\"com.oracle.wls.exporter.webapp.ExporterServlet\\\"\");\n replaceConfigurationWithFilter(RESOURCE_DIR\n + \"/exporter/rest_filter_included_webapp_excluded_servlet_name.yaml\",checkIncluded, checkExcluded);\n }", "public GlobFileSet setExcludePattern(String pattern)\n\t\t{\n\t\tm_excPattern = Pattern.compile(pattern);\n\t\treturn (this);\n\t\t}", "@Override\n public String getSystemDir() {\n return null;\n }", "private void scanForIcons() {\n\t\t\ttry {\n\t\t\t\tFile graphicDir = new File(helpIconBase + File.separator);\n\t\t\t\tlist = filter(graphicDir.listFiles(), \"tip\", \".png\");\n\t\t\t} catch (NullPointerException npe) {\n\t\t\t\tSystem.err.println(npe);\n\t\t\t\tlist = null;\n\t\t\t}\n\t\t}", "public void addExcludedSourceFilePattern(String pattern) {\n\t\ttry {\n\t\t\tPattern regex = Pattern.compile(pattern);\n\t\t\texcludedSourceFileList.add(regex);\n\t\t} catch (PatternSyntaxException e) {\n\t\t\tgetLog().warn(\n\t\t\t\t\t\"Could not compile source file exclusion pattern \"\n\t\t\t\t\t\t\t+ pattern, e);\n\t\t}\n\t}", "private static ArrayList<Folder> hiddenFolders(Context context) {\n final String FILE_TYPE_NO_MEDIA = \".nomedia\";\n\n ArrayList<Folder> listOfHiddenFiles = new ArrayList<>();\n\n String nonMediaCondition = MediaStore.Files.FileColumns.MEDIA_TYPE\n + \"=\" + MediaStore.Files.FileColumns.MEDIA_TYPE_NONE;\n\n String where = nonMediaCondition + \" AND \"\n + MediaStore.Files.FileColumns.TITLE + \" LIKE ?\";\n\n String[] params = new String[]{\"%\" + FILE_TYPE_NO_MEDIA + \"%\"};\n\n Cursor cursor = context.getContentResolver().query(\n MediaStore.Files.getContentUri(\"external\"),\n new String[]{MediaStore.Files.FileColumns._ID,\n MediaStore.Files.FileColumns.DATA,\n MediaStore.Files.FileColumns.DISPLAY_NAME},\n where,\n params, null);\n\n // No Hidden file found\n if (cursor.getCount() == 0) {\n // showAll Nothing Found\n return listOfHiddenFiles;\n }\n\n ArrayList<File> ids = new ArrayList<>();\n\n // Add Hidden file name, path and directory in file object\n while (cursor.moveToNext()) {\n String id = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns._ID));\n\n Uri vidUri = Uri.withAppendedPath(MediaStore.Files.getContentUri(\"external\"), id);\n File file = new File(getRealPathFromHiddenURI(context, vidUri)).getParentFile();\n //Log.d(\"MEME\", file.getAbsolutePath());\n\n if (!ids.contains(file)) {\n ids.add(file);\n\n checkAndAddFolder(file, listOfHiddenFiles, true);\n }\n }\n cursor.close();\n\n return listOfHiddenFiles;\n }", "public Set<String> listManagedDirectories() throws ConfigurationException {\n\t\tConfiguration config = this.currentConfiguration();\n\t\treturn Sets.newHashSet(config.getDirectories());\n\t}", "public List<String> getExecutableFilePatterns() {\n if (!executableFilePatterns.isEmpty()) {\n if (!executableFileRes.isEmpty()) {\n throw new InvalidProject(\n \"executable_file_res is a deprecated configuration field. it is replaced with \"\n + \"executable_file_patterns. Only one of these should be set.\");\n }\n return executableFilePatterns;\n }\n return executableFileRes;\n }", "List<IDirectory> getSourcePath();", "protected void addMissingResources()\n {\n WebLogicResourceRules.addMissingJmsResources(this);\n }", "public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) {\n\t\tthis.ignoreResourceNotFound = ignoreResourceNotFound;\n\t}", "public static Collection<String> getURLResources(URL dirURL) throws IOException {\n if (dirURL.getProtocol().equals(\"file\")) {\n /* A file path: easy enough, but need to decode when path contains \"blanks\" (tested under windows) */\n try {\n return Arrays.asList(new File(URLDecoder.decode(dirURL.getPath(), \"UTF-8\")).list());\n } catch (Exception ignore) {\n try {\n return Arrays.asList(new File(dirURL.getPath()).list());\n } catch (Exception ex) {\n throw new IOException(\"Cannot list directory \" + dirURL.getPath(), ex);\n }\n }\n } else if (dirURL.getProtocol().equals(\"jar\")) {\n /* A JAR path */\n String urlPath = dirURL.getPath();\n int idx2 = urlPath.indexOf(\"!\");\n String jarPath = urlPath.substring(5, idx2); //strip out only the JAR file\n String resourceDir = urlPath.substring(idx2 + 2, urlPath.length());\n if (!resourceDir.endsWith(\"/\")) resourceDir = resourceDir + \"/\";\n JarFile jar;\n try {\n // there that say so: http://stackoverflow.com/questions/6247144/how-to-load-a-folder-from-a-jar\n jar = new JarFile(URLDecoder.decode(jarPath, \"UTF-8\"));\n } catch (Exception ignore) {\n try {\n // but on my Mac this sometimes doesn't work, but this works:\n jar = new JarFile(jarPath);\n } catch (Exception ex) {\n throw new IOException(\"Cannot open jar \" + jarPath + \" in \" + dirURL, ex);\n }\n }\n Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar\n Set<String> result = new HashSet<String>(); //avoid duplicates in case it is a subdirectory\n while (entries.hasMoreElements()) {\n String name = entries.nextElement().getName();\n if (name.length() > resourceDir.length() &&\n name.startsWith(resourceDir)) { //filter according to the path\n result.add(new File(name).getName());\n }\n }\n return result;\n } else {\n return readLines(dirURL);\n }\n }", "@Before\n public void setUp() throws Throwable\n {\n myLog.debug( \"entering\" );\n try\n {\n if ( Files.exists( Testconstants.ROOT_DIR ) )\n {\n Helper.deleteDirRecursive( Testconstants.ROOT_DIR );\n }\n \n Files.createDirectory( Testconstants.ROOT_DIR );\n FSOBJECTS.DIR1.setFsObject( Testconstants.createNewFolder( Testconstants.ROOT_DIR, \"existingDir1\" ) );\n FSOBJECTS.DIR2.setFsObject( Testconstants.createNewFolder( Testconstants.ROOT_DIR, \"existingDir2\" ) );\n FSOBJECTS.DIR3.setFsObject( Testconstants.createNewFolder( Testconstants.ROOT_DIR, \"existingDir3\" ) );\n FSOBJECTS.FILE1.setFsObject( Testconstants.createNewFile( Testconstants.ROOT_DIR, \"existingFile1.txt\" ) );\n FSOBJECTS.FILE2.setFsObject( Testconstants.createNewFile( Testconstants.ROOT_DIR, \"existingFile2.txt\" ) );\n FSOBJECTS.FILE3.setFsObject( Testconstants.createNewFile( Testconstants.ROOT_DIR, \"existingFile3.txt\" ) );\n FSOBJECTS.NOT1.setFsObject( Paths.get( Testconstants.ROOT_DIR.toString(), \"notExisting1\" ) );\n FSOBJECTS.NOT2.setFsObject( Paths.get( Testconstants.ROOT_DIR.toString(), \"notExisting2\" ) );\n FSOBJECTS.NOT3.setFsObject( Paths.get( Testconstants.ROOT_DIR.toString(), \"notExisting3\" ) );\n \n Files.deleteIfExists( Paths.get( EXCLUDE_FILE_NAME ) );\n myExcludeFile = Testconstants.createNewFile( Paths.get( \".\" ), EXCLUDE_FILE_NAME );\n FileUtils.writeLines( myExcludeFile.toFile(), Arrays.asList( new String[] { EXCLUDE_VALUE } ) );\n }\n catch ( Throwable t )\n {\n myLog.error( \"Throwable caught in setup\", t );\n throw t;\n }\n }", "public void execute() throws MojoExecutionException, MojoFailureException {\n\n File target = new File(getDistfolder());\n\n // only create the target directoty when it doesn't exist\n // no deletion\n if (!target.exists()) {\n target.mkdir();\n } else {\n getLog().warn(\"Using existing target directory \" + target.getAbsolutePath());\n }\n\n getLog().info(\"Target is \" + target);\n\n String excludes2 = getExcludes();\n\n if (excludes2 == null) {\n excludes2 = \"**/.svn/,**/.cvs/\";\n\n getLog().info(\"Configuration for excludes not set. Defaulting to: \\\"\" + excludes2\n + \"\\\". Excludes are ant-fileset-style.\");\n } else {\n if (excludes2.contains(\"__acl\") || excludes2.contains(\"__properties\")) {\n getLog().warn(\"Your excludes \\\"\" + excludes2\n + \"\\\" contains __acl or __properties. You do not want these to be excluded in order to have permissoins and properties work.\");\n }\n }\n\n try {\n String targetLibPath = getTargetLibPath();\n\n if ((null != targetLibPath) && !\"\".equals(targetLibPath)) {\n File targetLibDir = new File(target, targetLibPath);\n\n if (!targetLibDir.exists()) {\n targetLibDir.mkdirs();\n }\n\n if (!targetLibDir.isDirectory()) {\n throw new MojoExecutionException(\"Could not create targetLibdir: \" + targetLibDir.toString());\n }\n\n File jar = new File(jarFile);\n FileUtils.copyFileToDirectory(jar, targetLibDir);\n }\n\n for (Resource resource : srcResources) {\n File source = new File(resource.getDirectory());\n File currentTarget = null;\n\n if (resource.getTargetPath() != null) {\n currentTarget = new File(target, resource.getTargetPath());\n } else {\n currentTarget = target;\n }\n\n String normalized = source.getAbsolutePath();\n int offsetLength = normalized.length();\n\n getLog().debug(\"Normalzed sourcefolder is \" + normalized + \" (Offset is: \" + offsetLength + \")\");\n\n List<String> results = FileUtils.getFileAndDirectoryNames(source, null, excludes2, true, true, true,\n true);\n\n for (String fileName : results) {\n File file = new File(fileName);\n\n String normalizedParent = new File(file.getParent()).getAbsolutePath();\n\n if (offsetLength > normalizedParent.length()) {\n getLog().info(\"Skipping file (its the sourcefolder or a parent of it): \"\n + file.getAbsolutePath());\n getLog().debug(\"Parent: \" + normalizedParent + \" with length \" + normalizedParent.length());\n\n continue;\n }\n\n String relative = file.getParent();\n relative = relative.substring(offsetLength); // cut the target-dir away\n\n getLog().debug(\"Copy \" + file + \" to \" + currentTarget.getPath() + File.separator + relative);\n\n if (file.isFile()) {\n File parent = new File(currentTarget.getPath() + File.separator + relative);\n\n if (!parent.exists()) {\n // create dir if it does not exist\n parent.mkdirs();\n }\n\n FileUtils.copyFileToDirectory(file, parent);\n } else if (file.isDirectory()) {\n // take care about directories (so that empty dirs get created)\n\n File tocreate = new File(currentTarget.getPath() + File.separator + relative + File.separator\n + file.getName());\n getLog().debug(\"Creating dir\" + tocreate.toString());\n tocreate.mkdirs();\n }\n }\n }\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Could copy file(s) to directory\", ex);\n }\n }", "public static String[] scanFiles(File dir, String[] includes, String[] excludes) {\n // remove tailing '/' in patterns\n if (includes != null) {\n for (int i = 0; i < includes.length; i++)\n includes[i] = StringUtil.trimSuffix(includes[i], \"/\");\n }\n if (excludes != null) {\n for (int i = 0; i < excludes.length; i++)\n excludes[i] = StringUtil.trimSuffix(excludes[i], \"/\");\n }\n\n ArrayList result = new ArrayList();\n ArrayList queue = new ArrayList();\n queue.add(\"\");\n\n String dirPath, path;\n File dirFile, f;\n File[] files;\n while (!queue.isEmpty()) {\n dirPath = (String) queue.remove(queue.size() - 1);\n dirFile = dirPath.isEmpty() ? dir : new File(dir, dirPath);\n files = dirFile.listFiles();\n for (int i = 0; files != null && i < files.length; i++) {\n f = files[i];\n path = dirPath + (dirPath.isEmpty() ? \"\" : \"/\") + f.getName();\n if (f.isDirectory()) {\n // cut off excluded dir early\n if (scanFiles_isIncluded(path, null, excludes))\n queue.add(path);\n } else if (f.isFile()) {\n if (scanFiles_isIncluded(path, includes, excludes))\n result.add(path);\n }\n }\n }\n return (String[]) result.toArray(new String[result.size()]);\n }", "List<String> externalResources();", "@Test\n public void testIgnore_excludedClasses() throws Throwable {\n RunNotifier notifier = spy(new RunNotifier());\n RunListener listener = mock(RunListener.class);\n notifier.addListener(listener);\n Bundle ignores = new Bundle();\n ignores.putString(LongevityClassRunner.FILTER_OPTION, FailingTest.class.getCanonicalName());\n mRunner = spy(new LongevityClassRunner(FailingTest.class, ignores));\n mRunner.run(notifier);\n verify(listener, times(1)).testIgnored(any());\n }", "@Nullable\n public static PsiDirectory findResourceDirectory(@NotNull DataContext dataContext) {\n Project project = CommonDataKeys.PROJECT.getData(dataContext);\n if (project != null) {\n AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();\n if (pane.getId().equals(AndroidProjectView.ID)) {\n return null;\n }\n }\n\n VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);\n if (file != null) {\n // See if it's inside a res folder (or is equal to a resource folder)\n Module module = PlatformCoreDataKeys.MODULE.getData(dataContext);\n if (module != null) {\n LocalResourceManager manager = LocalResourceManager.getInstance(module);\n if (manager != null) {\n VirtualFile resFolder = getResFolderParent(manager, file);\n if (resFolder != null) {\n return AndroidPsiUtils.getPsiDirectorySafely(module.getProject(), resFolder);\n }\n }\n }\n }\n\n return null;\n }", "public boolean isExcluded()\n {\n return project.isExcluded(this);\n }", "@Test\n public void testMatchesAny() {\n\n Set<PathMatcher> patterns = new HashSet<PathMatcher>() {\n {\n add(FileUtil.matcherForGlobExpression(\"/notADir1\"));\n add(FileUtil.matcherForGlobExpression(\"/notADir2\"));\n }\n };\n\n Assertions.assertThat(FileUtil.matchesAny(FOLDER, patterns)).isFalse();\n\n patterns.add(FileUtil.matcherForGlobExpression(FOLDER.toString()));\n\n Assertions.assertThat(FileUtil.matchesAny(FOLDER, patterns)).isTrue();\n }", "public IPath[] getAdditionalResources();", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void setExcludedPatterns(String... excludedPatterns)\n/* */ {\n/* 110 */ Assert.notEmpty(excludedPatterns, \"'excludedPatterns' must not be empty\");\n/* 111 */ this.excludedPatterns = new String[excludedPatterns.length];\n/* 112 */ for (int i = 0; i < excludedPatterns.length; i++) {\n/* 113 */ this.excludedPatterns[i] = StringUtils.trimWhitespace(excludedPatterns[i]);\n/* */ }\n/* 115 */ initExcludedPatternRepresentation(this.excludedPatterns);\n/* */ }", "public List<String> getAllNotComputedFilesPath() throws TBException {\r\n\t\treturn getNotComputedFilesPath(new File(rootTBFolder).getAbsolutePath());\r\n\t\t\r\n\t}", "protected List <WebFile> getSourceDirChildFiles()\n{\n // Iterate over source dir and add child packages and files\n List children = new ArrayList();\n for(WebFile child : getFile().getFiles()) {\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, children);\n else children.add(child);\n }\n \n return children;\n}" ]
[ "0.631784", "0.5796043", "0.57221353", "0.56406265", "0.5561138", "0.55127144", "0.54166377", "0.5369766", "0.5346998", "0.534394", "0.5330572", "0.528478", "0.52743286", "0.525473", "0.5232022", "0.5204264", "0.5201248", "0.5175415", "0.5174123", "0.51564807", "0.5154997", "0.5143374", "0.5124187", "0.5123965", "0.51105183", "0.5088152", "0.5082297", "0.5081157", "0.50806624", "0.5067022", "0.50640595", "0.50500524", "0.50248706", "0.5006753", "0.49668106", "0.49620193", "0.49540457", "0.49379843", "0.4933094", "0.4932481", "0.49136162", "0.4908105", "0.49062157", "0.4881943", "0.4862568", "0.485868", "0.48456264", "0.48345506", "0.4834145", "0.4815118", "0.48121214", "0.4812119", "0.4793352", "0.47762504", "0.47657245", "0.4761232", "0.4756013", "0.47488225", "0.4737985", "0.47253233", "0.4714097", "0.46986243", "0.46903655", "0.46889445", "0.46840498", "0.46803743", "0.46767312", "0.4674313", "0.46740845", "0.46495765", "0.46491334", "0.46484688", "0.46425498", "0.46338114", "0.4633135", "0.46233782", "0.4621393", "0.46051848", "0.46032673", "0.4576479", "0.45718536", "0.4571099", "0.45600575", "0.45586935", "0.4551719", "0.45428392", "0.45389044", "0.45375943", "0.45365745", "0.4536538", "0.45327076", "0.45321378", "0.4529992", "0.4529187", "0.45253396", "0.45183402", "0.45168266", "0.45066294", "0.449768", "0.4497562" ]
0.55660874
4
Use this check to determine whether BLE is supported on the device. Then you can selectively disable BLErelated features.
public boolean checkBluetooth() { if (!mActivity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) { Toast.makeText(mActivity, R.string.ble_not_supported, Toast.LENGTH_SHORT).show(); } // Initializes a Bluetooth adapter. For API level 18 and above, get a reference to // BluetoothAdapter through BluetoothManager. final BluetoothManager bluetoothManager = (BluetoothManager) mActivity.getSystemService(Context.BLUETOOTH_SERVICE); mBluetoothAdapter = bluetoothManager.getAdapter(); // Checks if Bluetooth is supported on the device. if (mBluetoothAdapter == null) { Toast.makeText(mActivity, R.string.error_bluetooth_not_supported, Toast.LENGTH_SHORT).show(); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateBleSupport() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Snackbar.make(txtStatus, \"No LE Support.\", Snackbar.LENGTH_LONG).show();\n } else {\n\n /*\n * We need to enforce that Bluetooth is first enabled, and take the\n * user to settings to enable it if they have not done so.\n */\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter\n .getDefaultAdapter();\n\n if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"onResume: Bluetooth is disabled\");\n //Bluetooth is disabled, request enabling it\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivity(enableBtIntent);\n }\n }\n\n }", "private void checkBleSupportAndInitialize() {\n Log.d(TAG, \"checkBleSupportAndInitialize: \");\n // Use this check to determine whether BLE is supported on the device.\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.d(TAG,\"device_ble_not_supported \");\n Toast.makeText(this, R.string.device_ble_not_supported,Toast.LENGTH_SHORT).show();\n return;\n }\n // Initializes a Blue tooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n\n if (mBluetoothAdapter == null) {\n // Device does not support Blue tooth\n Log.d(TAG, \"device_ble_not_supported \");\n Toast.makeText(this,R.string.device_ble_not_supported, Toast.LENGTH_SHORT).show();\n return;\n }\n\n //打开蓝牙\n if (!mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"open bluetooth \");\n bluetoothUtils.openBluetooth();\n }\n }", "public void checkForBluetooth() {\n if (hasBluetoothSupport()) {\n ensureBluetoothEnabled();\n } else {\n showToast(\"Device does not support BlueTooth\");\n }\n }", "private boolean hasBluetoothSupport() {\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n return (mBluetoothAdapter != null);\n }", "public boolean isBluetoothEnabled() {\n BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();\n if (bluetooth == null)\n return false;//\"device not BT capable\";\n return bluetooth.isEnabled();\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkBluetooth() {\n\t\tboolean flag = oTest.checkBluetooth();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "@Override\n public void checkBluetoothInteface() {\n if (!isConnected) {\n checkForBluetooth();\n }\n }", "private boolean BluetoothAvailable()\n {\n if (BT == null)\n return false;\n else\n return true;\n }", "public boolean isCanBleed() {\n\t\treturn canBleed;\n\t}", "private void checkBluetoothEnabled()\r\n {\r\n if (!mBluetoothAdapter.isEnabled())\r\n {\r\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n startActivityForResult(enableBtIntent, BLUETOOTH_ENABLE_REQUEST_ID);\r\n } else\r\n checkNfcEnabled();\r\n }", "private void checkBTState() {\n\n if (btAdapter == null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void checkBTState() {\n\n if(btAdapter==null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "public static boolean isBleEnabled() {\n\t\tfinal BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n\t\treturn adapter != null && adapter.isEnabled();\n\t}", "private void CheckBtIsOn() {\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n if (!mBluetoothAdapter.isEnabled()) {\n Toast.makeText(getApplicationContext(), \"Bluetooth Disabled!\",\n Toast.LENGTH_SHORT).show();\n\n // Start activity to show bluetooth options\n Intent enableBtIntent = new Intent(mBluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "private void checkBTState() {\n if(bluetoothAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not supported\");\n } else {\n if (!bluetoothAdapter.isEnabled()) {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "public void checkBTState() {\n if(mAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not support\");\n } else {\n if (mAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth ON...\");\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n ((Activity) mContext).startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void checkBTState() {\n if(btAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not support\");\n } else {\n if (btAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth ON...\");\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void ensureBluetoothIsEnabled(){\r\n\t\t//if Bluetooth is not enabled, enable it now\r\n\t\tif (!mBtAdapter.isEnabled()) { \t\t\r\n \t enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n \t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\r\n \t}\r\n\t}", "private void checkBTState() {\n\n if(btAdapter==null) {\n Toast.makeText(getContext(), \"El dispositivo no soporta bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "public static boolean getBluetoothAdapterIsEnabled() {\n\t\treturn mBluetoothAdapterIsEnabled;\n\t}", "private void checkBTState() {\n\t\tif (btAdapter == null) {\n\t\t\terrorExit(\"Fatal Error\", \"Bluetooth not support\");\n\t\t} else {\n\t\t\tif (btAdapter.isEnabled()) {\n\t\t\t\tLog.d(TAG, \"...Bluetooth ON...\");\n\t\t\t} else {\n\t\t\t\t// Prompt user to turn on Bluetooth\n\t\t\t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t\t\tstartActivityForResult(enableBtIntent, 1);\n\t\t\t}\n\t\t}\n\t}", "boolean isPeripheralAccess();", "boolean hasCharacteristicDescription();", "private Boolean isDeviceYouWant(BleManager.DiscoveryListener.DiscoveryEvent event) {\n String name = event.device().getName_native();\n if (name.toLowerCase().startsWith(\"polar\")) {\n Log.v(TAG, event.device().getName_native());\n return true;\n }\n return false;\n\n// // Test with prototype BLE device, same repro.\n// byte[] b = event.device().getScanRecord();\n// if (null == b) {\n// return false;\n// }\n// if (b.length < 22) {\n// return false;\n// }\n//\n// byte[] kCompanyIdentifier = new byte[] {(byte)0x01, (byte)0x02, (byte)0x03};\n// byte[] companyIdentifier = new byte[] {b[19], b[20], b[21]};\n// if (Arrays.equals(kCompanyIdentifier, companyIdentifier)){\n// return true;\n// }\n// return false;\n }", "private void ensureBluetoothEnabled() {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n main.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n connectToBluetoothDevice(\"00:06:66:64:42:97\"); // Hard coded MAC of the BT-device.\n Log.i(tag, \"Connected to device!\");\n }\n }", "private void checkBTState() {\n if(btAdapter==null) {\n btState.setImageResource(R.drawable.ic_action_off);\n errorExit(\"Fatal Error\", \"Bluetooth не поддерживается\");\n\n } else {\n if (btAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth включен...\");\n btState.setImageResource(R.drawable.ic_action_on);\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(btAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }\n }", "private boolean BTEnabled() {\n if (!BT.isEnabled()) { // Ask user's permission to switch the Bluetooth adapter On.\n Intent enableIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\n return false;\n } else {\n DisplayToast(\"Bluetooth is already on\");\n return true;\n }\n }", "public void scanBleDevice(Boolean enable);", "public void checkBluetooth(BluetoothAdapter bluetoothAdapter){\n if(bluetoothAdapter == null || !bluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n mCheckBt = false;\n if (requestCode == REQUEST_ENABLE_BT && resultCode != RESULT_OK) {\n// mScanButton.setEnabled(false);\n Toast.makeText(this, getString(R.string.bluetooth_not_enabled), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void askPermission() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Uff\");\n builder.setMessage(\"This device does not support Bluetooth LE. Buy another phone.\");\n builder.setPositiveButton(android.R.string.ok, null);\n finish();\n }\n\n //Checking if the Bluetooth is on/off\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Uff\");\n builder.setMessage(\"This device does not support Bluetooth.\");\n builder.setPositiveButton(android.R.string.ok, null);\n } else {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 2);\n }\n }\n\n }", "boolean hasDevice();", "private void getBluetoothState() {\r\n\r\n\t\t if (bluetoothAdapter == null) {\r\n\t\t\t bluetoothStatusSetup.setText(\"Bluetooth NOT supported\");\r\n\t\t } else if (!(bluetoothAdapter.isEnabled())) {\r\n\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is NOT Enabled!\");\r\n\t\t\t Intent enableBtIntent = new Intent(\r\n\t\t\t\t\t BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\r\n\t\t\t getBluetoothState();\r\n\t\t }\r\n\r\n\t\t if (bluetoothAdapter.isEnabled()) {\r\n\r\n\t\t\t if (bluetoothAdapter.isDiscovering()) {\r\n\t\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is currently in device discovery process.\");\r\n\t\t\t } else {\r\n\t\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is Enabled.\");\r\n\t\t\t }\r\n\t\t }\r\n\t }", "private void initBLESetup() {\n // Initializes Bluetooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n //Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.\n //Obtaining dynamic permissions from the user\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { //23\n if (this.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"This app needs location access.\");\n builder.setMessage(\"Please grant location access to this app.\");\n builder.setPositiveButton(android.R.string.ok, null);\n builder.setOnDismissListener(new DialogInterface.OnDismissListener() {\n public void onDismiss(DialogInterface dialog) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);\n }\n\n });// See onRequestPermissionsResult callback method for negative behavior\n builder.show();\n }\n }\n // Create callback methods\n if (Build.VERSION.SDK_INT >= 21) //LOLLIPOP\n newerVersionScanCallback = new ScanCallback() {\n @Override\n public void onScanResult(int callbackType, ScanResult result) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n BluetoothDevice btDevice = result.getDevice();\n ScanRecord mScanRecord = result.getScanRecord();\n int rssi = result.getRssi();\n// Log.i(TAG, \"Address: \"+ btDevice.getAddress());\n// Log.i(TAG, \"TX Power Level: \" + result.getScanRecord().getTxPowerLevel());\n// Log.i(TAG, \"RSSI in DBm: \" + rssi);\n// Log.i(TAG, \"Manufacturer data: \"+ mScanRecord.getManufacturerSpecificData());\n// Log.i(TAG, \"device name: \"+ mScanRecord.getDeviceName());\n// Log.i(TAG, \"Advertise flag: \"+ mScanRecord.getAdvertiseFlags());\n// Log.i(TAG, \"service uuids: \"+ mScanRecord.getServiceUuids());\n// Log.i(TAG, \"Service data: \"+ mScanRecord.getServiceData());\n byte[] recordBytes = mScanRecord.getBytes();\n\n iBeacon ib = parseBLERecord(recordBytes);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n }\n\n @Override\n public void onScanFailed(int errorCode) {\n Log.e(\"Scan Failed\", \"Error Code: \" + errorCode);\n }\n };\n else\n olderVersionScanCallback =\n new BluetoothAdapter.LeScanCallback() {\n @Override\n public void onLeScan(final BluetoothDevice device, final int rssi,\n final byte[] scanRecord) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Log.i(\"onLeScan\", device.toString());\n\n iBeacon ib = parseBLERecord(scanRecord);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n });\n }\n };\n }", "private void enableBT() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else if (!bluetoothAdapter.isEnabled()) {\n bluetoothAdapter.enable();\n }\n }", "protected abstract boolean checkUnSupportedFeatures(TrafficSelector selector, TrafficTreatment treatment);", "public static boolean isSupported() {\n\t\tLog.v(\"trace\", \"Checking Vibrator is supported \" + mVibrator.hasVibrator() );\n\t\treturn mVibrator != null && mVibrator.hasVibrator();\n\t}", "private void checkEnableBt() {\n if (mBtAdapter == null || !mBtAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "public static void checkPhoneSettings(Activity activity){\n\t\tif (mBluetoothAdapter == null) {\n\t\t //!TODO\n\t\t} else {\n\t\t\tLog.v(\"\", \"Bluetooth is supported\");\n\t\t\t//Check if bluetooth is enabled. If not, request the user to enable it.\n\t\t\tif (!mBluetoothAdapter.isEnabled()) {\n\t\t\t\tLog.v(\"\", \"Bluetooth is not turned on\");\n\t\t\t Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t\t activity.startActivityForResult(enableBtIntent,REQUEST_ENABLE_BT);\n\t\t\t}\n\t\t}\n\t}", "private void initPlugin() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is supported\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBT = true;\");\n\n //test if BLE supported\n if (!mcordova.getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.e(LOG_TAG, \"BluetoothLE is not supported\");\n } else {\n Log.e(LOG_TAG, \"BluetoothLE is supported\");\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBTLE = true;\");\n }\n \n // test if BT is connected to a headset\n \n if (bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET) == BluetoothProfile.STATE_CONNECTED ) {\n Log.e(LOG_TAG, \" Bluetooth connected to headset\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.connected');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not connected to a headset \" + bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET));\n }\n\n //test if BT enabled\n if (bluetoothAdapter.isEnabled()) {\n Log.e(LOG_TAG, \"Bluetooth is enabled\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.BTenabled = true;\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.enabled');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not enabled\");\n }\n }\n }", "private boolean takeBertyCharacteristics() {\n Log.v(TAG, String.format(\"takeBertyCharacteristic called for device %s\", getMACAddress()));\n\n if (getPIDCharacteristic() != null && getWriterCharacteristic() != null) {\n Log.d(TAG, \"Berty characteristics already found\");\n return true;\n }\n\n List<BluetoothGattCharacteristic> characteristics = getBertyService().getCharacteristics();\n for (BluetoothGattCharacteristic characteristic : characteristics) {\n if (characteristic.getUuid().equals(GattServer.PID_UUID)) {\n Log.d(TAG, String.format(\"PID characteristic found for device %s\", getMACAddress()));\n if (checkCharacteristicProperties(characteristic,\n BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE)) {\n setPIDCharacteristic(characteristic);\n\n /*if (!getBluetoothGatt().setCharacteristicNotification(characteristic, true)) {\n Log.e(TAG, String.format(\"setCharacteristicNotification failed for device %s\", getMACAddress()));\n setPIDCharacteristic(null);\n return false;\n }*/\n }\n } else if (characteristic.getUuid().equals(GattServer.WRITER_UUID)) {\n Log.d(TAG, String.format(\"writer characteristic found for device: %s\", getMACAddress()));\n if (checkCharacteristicProperties(characteristic,\n BluetoothGattCharacteristic.PROPERTY_WRITE)) {\n setWriterCharacteristic(characteristic);\n }\n }\n }\n\n if (getPIDCharacteristic() != null && getWriterCharacteristic() != null) {\n return true;\n }\n\n Log.e(TAG, String.format(\"reader/writer characteristics not found for device %s\", getMACAddress()));\n return false;\n }", "public void setCanBleed(boolean canBleed) {\n\t\tthis.canBleed = canBleed;\n\t}", "private boolean isSupportedInternal() {\n boolean z = false;\n synchronized (this.mLock) {\n if (this.mServiceManager == null) {\n Log.e(TAG, \"isSupported: called but mServiceManager is null!?\");\n return false;\n }\n try {\n if (this.mServiceManager.getTransport(IWifi.kInterfaceName, HAL_INSTANCE_NAME) != (byte) 0) {\n z = true;\n }\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Exception while operating on IServiceManager: \" + e);\n return false;\n }\n }\n }", "public void checkPermission(){\n Log.d(\"BluetoothLeService\", \"initialize is \" + mBluetoothManager);\n if (mBluetoothManager == null) {\n mBluetoothManager = (BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE);\n if (mBluetoothManager == null) {\n Log.e(TAG, \"Unable to initialize BluetoothManager.\");\n return;\n }\n }\n\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n if (mBluetoothAdapter == null) {\n Log.e(TAG, \"Unable to obtain a BluetoothAdapter.\");\n return;\n }\n\n if (!mBluetoothAdapter.isEnabled()) mBluetoothAdapter.enable();\n\n int PERMISSION_ALL = 1;\n /*\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.GET_ACCOUNTS};\n */\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION\n };\n\n if (!hasPermissions(this, PERMISSIONS)) {\n ActivityCompat.requestPermissions( this, PERMISSIONS, PERMISSION_ALL);\n }\n }", "public interface BleInterface {\n //open ble\n public void openBle(Boolean enable);\n //scan ble,get device list\n public void scanBleDevice(Boolean enable);\n\n}", "protected boolean isAdvertisementDisabled(LocalDevice device) {\n/* 353 */ DiscoveryOptions options = getUpnpService().getRegistry().getDiscoveryOptions(device.getIdentity().getUdn());\n/* 354 */ return (options != null && !options.isAdvertised());\n/* */ }", "private void scanLeDevice(boolean enabled) {\n\n if (enabled) {\n\n Log.v(TAG, \"SCANNING START\");\n\n // Stops scanning after a pre-defined scan period.\n mHandler.postDelayed(new Runnable() {\n @Override\n public void run() {\n\n // if scanning stop previous scanning operation\n if (mScanning) {\n mScanning = false;\n mSwipeRefreshLayout.setRefreshing(false);\n mSwipeRefreshLayout.setEnabled(true);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Log.v(TAG, \"stopLeScan STOP scan is ended after SCAN_PERIOD\");\n mLeScanner.stopScan(mScanCallback);\n } else {\n mBluetoothAdapter.stopLeScan(mLeScanCallback);\n }\n\n mProgress.setVisibility(View.INVISIBLE);\n\n if (mLeDeviceListAdapter.getItemCount() == 0 && mAlertBlue == null && mAlertGps == null) {\n Log.v(TAG, \"NO DEVICES FOUND\");\n mNoDevice.setVisibility(View.VISIBLE);\n }\n }\n invalidateOptionsMenu();\n }\n }, SCAN_PERIOD);\n\n mScanning = true;\n mSwipeRefreshLayout.setRefreshing(true);\n mSwipeRefreshLayout.setEnabled(true);\n\n //setup the list of device and the adapter for the recycler view.\n bDevices = new ArrayList<>();\n mLeDeviceListAdapter = new LeDeviceAdapter(bDevices, R.layout.device_scan_row);\n mRecyclerView.setAdapter(mLeDeviceListAdapter);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Log.d(TAG, \"StartLeScan START NEW SCAN\");\n mLeScanner.startScan(null, mSettings, mScanCallback);\n } else {\n mBluetoothAdapter.startLeScan(mLeScanCallback);\n }\n\n } else {\n\n //stop the scan\n mScanning = false;\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Log.d(TAG, \"stopLeScan STOP scan is ended after SCAN_PERIOD\");\n //You can stop the scan only if the bluetooth is yet ON\n if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON)\n mLeScanner.stopScan(mScanCallback);\n } else {\n if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON)\n mBluetoothAdapter.stopLeScan(mLeScanCallback);\n }\n }\n invalidateOptionsMenu();\n }", "public static boolean hasTelephonyHardware(Context context) {\n if (context.getPackageManager().hasSystemFeature(\"android.hardware.telephony\")) {\n Log.d(\"HardwareFeatureTest\", \"Device can make phone calls\");\n return true;\n }\n return false;\n }", "Boolean isAvailable();", "public void findBluetooth() {\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n btStatusDisplay.setText(\"Device does not support Bluetooth\");\n }\n btStatusDisplay.setText(\"Trying to connect...\");\n\n /** Pops up request to enable if found not enabled */\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n /** Get reference to scale as Bluetooth device \"mmDevice\" */\n Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n if (device.getName().equals(\"BLUE\")) {\n mmDevice = device;\n btStatusDisplay.setText(\"Bluetooth device found\");\n break;\n }\n }\n }\n }", "private boolean canUseFeature(Policy.Feature feature) {\n return mBeaconingManager.mPolicy.allows(feature);\n }", "private void setupBLEScan() {\n if (Build.VERSION.SDK_INT >= 21) {//LOLLIPOP\n mLEScanner = mBluetoothAdapter.getBluetoothLeScanner();\n scanSettings = new ScanSettings.Builder()\n .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)\n .build();\n filters = new ArrayList<ScanFilter>();\n ScanFilter.Builder mBuilder = new ScanFilter.Builder();\n ByteBuffer mManufacturerData = ByteBuffer.allocate(23);\n ByteBuffer mManufacturerDataMask = ByteBuffer.allocate(24);\n byte[] uuid = getIdAsByte(UUID.fromString(\"B9407F30-F5F8-466E-AFF9-25556B575555\"));\n mManufacturerData.put(0, (byte) 0xBE);\n mManufacturerData.put(1, (byte) 0xAC);\n for (int i = 2; i <= 17; i++) {\n mManufacturerData.put(i, uuid[i - 2]);\n }\n for (int i = 0; i <= 17; i++) {\n mManufacturerDataMask.put((byte) 0x01);\n }\n mBuilder.setManufacturerData(76, mManufacturerData.array(), mManufacturerDataMask.array());\n ScanFilter mScanFilter = mBuilder.build();\n //TODO\n //filters.add(mScanFilter);\n\n }\n }", "@Override\n\tprotected void checkHardware() {\n\t\tsuper.checkHardware();\n\t}", "@Override\n\tpublic boolean gcGetAllFwVersion(BluetoothDevice device) {\n\t\treturn false;\n\t}", "public boolean initialize() {\n // For API level 18 and above, get a reference to BluetoothAdapter through\n // BluetoothManager.\n if (mBluetoothManager == null) {\n mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n if (mBluetoothManager == null) {\n Log.e(TAG, \"Unable to initialize BluetoothManager.\");\n return false;\n }\n }\n\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n if (mBluetoothAdapter == null) {\n Log.e(TAG, \"Unable to obtain a BluetoothAdapter.\");\n return false;\n }\n\n return true;\n }", "static boolean checkIsDeviceAvailable(JSONObject respJson)\n {\n String respStr = getCmdJsonStr(respJson);\n if (respStr != null)\n {\n return checkIsDeviceAvailable(respStr);\n }\n else\n {\n return false;\n }\n }", "private void checkLocationAndBluetoothPermissions() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Toast.makeText(this, \"This phone does not support Bluetooth 4.0. Bubble Hub Application requires Bluetooth 4.0 in order to operate.\", Toast.LENGTH_SHORT).show();\n finish();\n }\n\n if(!BluetoothAdapter.getDefaultAdapter().isEnabled()) { //if BT is present but is turned off\n CustomLogger.log(\"MainActivity: onCreate: Ask user to turn on BT.\");\n\n //Ask to the user turn the bluetooth on\n Intent turnBTon = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(turnBTon, 1);\n }\n\n if (Build.VERSION.SDK_INT >= 23) {\n if (!haveLocationPermissions()) {\n mDeviceList.setVisibility(View.GONE);\n mTopTextLinearLayout.setVisibility(View.GONE);\n mLocationPermissionWarningLinearLayout.setVisibility(View.VISIBLE);\n CustomLogger.log(\"MainActivity: onCreate: missing location permissions\");\n requestLocationPermission(this, LOCATION_PERMISSION_REQUEST_CODE);\n } else {\n CustomLogger.log(\"MainActivity: onCreate: got location permissions\");\n mLocationPermissionWarningLinearLayout.setVisibility(View.GONE);\n mDeviceList.setVisibility(View.VISIBLE);\n mTopTextLinearLayout.setVisibility(View.VISIBLE);\n }\n }\n }", "private boolean checkBatteryLevelOK() {\n return true;\n }", "@Test\n public void testEnableDisable() {\n Assert.assertFalse(mAdapterService.isEnabled());\n\n mAdapterService.enable();\n\n // Start GATT\n verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(1)).startService(any());\n milliSleep(CONTEXT_SWITCH_MS);\n mAdapterService.onProfileServiceStateChanged(GattService.class.getName(),\n BluetoothAdapter.STATE_ON);\n\n // Wait for the native initialization (remove when refactored)\n milliSleep(NATIVE_INIT_MS);\n\n mAdapterService.onLeServiceUp();\n milliSleep(ONE_SECOND_MS);\n\n // Start PBAP and PAN\n verify(mMockContext, timeout(ONE_SECOND_MS).times(3)).startService(any());\n mAdapterService.onProfileServiceStateChanged(PanService.class.getName(),\n BluetoothAdapter.STATE_ON);\n mAdapterService.onProfileServiceStateChanged(BluetoothPbapService.class.getName(),\n BluetoothAdapter.STATE_ON);\n\n milliSleep(CONTEXT_SWITCH_MS);\n\n Assert.assertTrue(mAdapterService.isEnabled());\n\n mAdapterService.disable();\n\n // Stop PBAP and PAN\n verify(mMockContext, timeout(ONE_SECOND_MS).times(5)).startService(any());\n mAdapterService.onProfileServiceStateChanged(PanService.class.getName(),\n BluetoothAdapter.STATE_OFF);\n mAdapterService.onProfileServiceStateChanged(BluetoothPbapService.class.getName(),\n BluetoothAdapter.STATE_OFF);\n\n milliSleep(ONE_SECOND_MS);\n\n mAdapterService.onBrEdrDown();\n milliSleep(ONE_SECOND_MS);\n\n // Stop GATT\n verify(mMockContext, timeout(ONE_SECOND_MS).times(6)).startService(any());\n mAdapterService.onProfileServiceStateChanged(GattService.class.getName(),\n BluetoothAdapter.STATE_OFF);\n\n Assert.assertFalse(mAdapterService.isEnabled());\n }", "boolean hasDeleteCharacteristic();", "private boolean isSupported(Context context, int sensorType) {\n\t\t\tsensorManager =\n\t\t (SensorManager) context\n\t\t .getSystemService(Context.SENSOR_SERVICE);\n\t\t List<Sensor> sensors = sensorManager.getSensorList(sensorType);\n\t\t return sensors.size() > 0;\n\t\t}", "public List<BluetoothGattCharacteristic> getCharacteristics() {\n/* 112 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "boolean isAvailable();", "boolean isAvailable();", "boolean isAvailable();", "boolean isAvailable();", "public void discoverable()\n {\n if(mEnable) {\n Log.d(LOGTAG, \"Make discoverable\");\n if(mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n listen(false); // Stop listening if were listening\n Intent i = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n i.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n mContext.startActivity(i);\n listen(true); // Start again\n }\n }\n }", "private void initWirelessCommunication() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n showToast(\"BLE is not supported\");\n finish();\n } else {\n showToast(\"BLE is supported\");\n // Access Location is a \"dangerous\" permission\n int hasAccessLocation = ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n if (hasAccessLocation != PackageManager.PERMISSION_GRANTED) {\n // ask the user for permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_ACCESS_LOCATION);\n // the callback method onRequestPermissionsResult gets the result of this request\n }\n }\n // enable wireless communication alternative\n if (communicationAdapter == null || !communicationAdapter.isReadyToBeUsed()) {\n assert communicationAdapter != null;\n Intent enableWirelessCommunicationIntent = new Intent(communicationAdapter.actionRequestEnable());\n startActivityForResult(enableWirelessCommunicationIntent, REQUEST_ENABLE_BT);\n }\n }", "public boolean isSupportNfcLedCover() {\r\n return sIsNfcLedCoverSystemFeatureEnabled;\r\n }", "private boolean isBiometricAvailable() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {\n return false;\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n BiometricManager biometricManager =\n getStyledContext().getSystemService(BiometricManager.class);\n return biometricManager != null\n && biometricManager.canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS;\n } else {\n // For API level < Q, we will use FingerprintManagerCompat to check enrolled\n // fingerprints. Note that for API level lower than 23, FingerprintManagerCompat behaves\n // like no fingerprint hardware and no enrolled fingerprints.\n FingerprintManagerCompat fingerprintManager =\n FingerprintManagerCompat.from(getStyledContext());\n return fingerprintManager != null && fingerprintManager.isHardwareDetected()\n && fingerprintManager.hasEnrolledFingerprints();\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Log.d(TAG, \"onActivityResult called\");\n\n if (requestCode == REQUEST_ENABLE_BT && resultCode == Activity.RESULT_CANCELED) {\n\n // User choose NOT to enable Bluetooth.\n mAlertBlue = null;\n showNegativeDialog(getResources().getString(R.string.blue_error_title),\n getResources().getString(R.string.blue_error_msg)\n );\n\n } else {\n\n // User choose to enable Bluetooth.\n mAlertBlue = null;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n verifyPermissions(mActivity);\n else {\n mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n scanLeDevice(true);\n }\n }\n }", "@Override\n public void onConnectionStateChange(BluetoothGatt gatt, int status,\n int newState) {\n Log.i(\"onConnectionStateChange\", \"The connection status has changed. status:\" + status + \" newState:\" + newState + \"\");\n try {\n if(status == BluetoothGatt.GATT_SUCCESS) {\n switch (newState) {\n // Has been connected to the device\n case BluetoothProfile.STATE_CONNECTED:\n Log.i(\"onConnectionStateChange\", \"Has been connected to the device\");\n if(_ConnectionStatus == ConnectionStatus.Connecting) {\n _ConnectionStatus = ConnectionStatus.Connected;\n try {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnConnected();\n if (gatt.getDevice().getBondState() == BluetoothDevice.BOND_BONDED){\n //Url : https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java\n Log.i(\"onConnectionStateChange\",\"Waiting 1600 ms for a possible Service Changed indication...\");\n // Connection successfully sleep 1600ms, the connection success rate will increase\n Thread.sleep(1600);\n }\n } catch (Exception e){}\n // Discover service\n gatt.discoverServices();\n }\n break;\n // The connection has been disconnected\n case BluetoothProfile.STATE_DISCONNECTED:\n Log.i(\"onConnectionStateChange\", \"The connection has been disconnected\");\n if(_ConnectionStatus == ConnectionStatus.Connected) {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n Close();\n _ConnectionStatus = ConnectionStatus.DisConnected;\n break;\n /*case BluetoothProfile.STATE_CONNECTING:\n Log.i(\"onConnectionStateChange\", \"Connecting ...\");\n _ConnectionStatus = ConnectionStatus.Connecting;\n break;\n case BluetoothProfile.STATE_DISCONNECTING:\n Log.i(\"onConnectionStateChange\", \"Disconnecting ...\");\n _ConnectionStatus = ConnectionStatus.DisConnecting;\n break;*/\n default:\n Log.e(\"onConnectionStateChange\", \"newState:\" + newState);\n break;\n }\n }else {\n Log.i(\"onConnectionStateChange\", \"GATT error\");\n Close();\n if(_ConnectionStatus == ConnectionStatus.Connecting\n && _Timeout - (new Date().getTime() - _ConnectStartTime.getTime()) > 0) {\n Log.i(\"Connect\", \"Gatt Error! Try to reconnect (\"+_ConnectIndex+\")...\");\n _ConnectionStatus = ConnectionStatus.DisConnected;\n Connect(); // Connect\n }else {\n _ConnectionStatus = ConnectionStatus.DisConnected;\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n }\n }catch (Exception ex){\n Log.e(\"onConnectionStateChange\", ex.toString());\n }\n super.onConnectionStateChange(gatt, status, newState);\n }", "public boolean isSupportLEDBackCover() {\r\n return sIsLEDBackCoverSystemFeatureEnabled;\r\n }", "private void ensureDiscoverable() {\n if (mBluetoothAdapter.getScanMode() !=\n BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n startActivity(discoverableIntent);\n }\n }", "private void ensureDiscoverable() {\n if (mBluetoothAdapter.getScanMode() !=\n BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n startActivity(discoverableIntent);\n }\n }", "public List<BluetoothGattService> getIncludedServices() {\n/* 104 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "static boolean checkIsDeviceAvailable(String respStr)\n {\n if (respStr.length() != CMD_LEN)\n {\n// log.warn(\"checkIsDeviceAvailable(): respStr is not valid:\" + respStr + \",return false\");\n return false;\n }\n MeshCommand cmd = new MeshCommand(respStr);\n if (!cmd.isValid())\n {\n// log.warn(\"checkIsDeviceAvailable(): cmd is not valid, cmd:\" + cmd + \",return false\");\n return false;\n }\n if (!cmd.isFree())\n {\n// log.warn(\"checkIsDeviceAvailable(): cap is not enought, return false\");\n return false;\n }\n return true;\n }", "private void ensureDiscoverable() {\n\t\tif (D)\n\t\t\tLog.d(TAG, \"ensure discoverable\");\n\t\tif (mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n\t\t\tIntent discoverableIntent = new Intent(\n\t\t\t\t\tBluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n\t\t\tdiscoverableIntent.putExtra(\n\t\t\t\t\tBluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n\t\t\tstartActivity(discoverableIntent);\n\t\t}\n\t}", "@Override\n public void gattServicesDiscovered() {\n BluetoothGattService mService = BLEService.mBluetoothGatt.getService(CapLEDConstants.CAPLED_SERVICE_UUID);\n\n mLedCharacteristic = mService.getCharacteristic(CapLEDConstants.CAPLED_LED_CHARACTERISTIC_UUID);\n mCapsenseCharacteristic = mService.getCharacteristic(CapLEDConstants.CAPLED_CAP_CHARACTERISTIC_UUID);\n mCapsenseNotification = mCapsenseCharacteristic.getDescriptor(CapLEDConstants.CAPLED_CAP_NOTIFICATION);\n\n readLedCharacteristic();\n sCapSwitch.setEnabled(true);\n }", "public interface BluetoothDevicePickerEx {\n public static final String EXTRA_FILTER_TYPE_1 =\n \"android.bluetooth.devicepicker.extra.FILTER_TYPE_1\";\n\n /* MTK Added : Begin */\n public static final int FILTER_TYPE_PRINTER = 5;\n /** Ask device picker to show BT devices that support BIP */\n public static final int FILTER_TYPE_BIP = 6;\n /** Ask device picker to show BT devices that support HID */\n public static final int FILTER_TYPE_HID = 7;\n public static final int FILTER_TYPE_PRX = 8;\n /* MTK Added : End */\n}", "boolean isFeatureSupported(String feature);", "public boolean isCharging() {\n return false;\n }", "public boolean isSupported() {\n\t\treturn true;\r\n\t}", "private boolean verifyBTConnected() {\n if (btSocket != null && btSocket.isConnected()) {\n return true;\n }\n\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTING);\n try {\n if (btDevice == null) {\n btDevice = btAdapter.getRemoteDevice(btAddress);\n }\n\n btSocket = btDevice.createInsecureRfcommSocketToServiceRecord(uuid);\n btSocket.connect();\n\n mmInStream = btSocket.getInputStream();\n mmOutStream = btSocket.getOutputStream();\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTED);\n return true;\n } catch (IOException e) {\n Log.d(TAG, \"Exception creating BT socket in BT thread: \" + e.toString());\n btDevice = null;\n return false;\n }\n }", "@Override\n public void onClick(View v) {\n if (mBluetoothAdapter.isEnabled()) {\n\n }\n }", "public boolean mBTInit1(){\n //Initialize the bluetooth adapter\n if (oBTadapter !=null) return true ;\n oBTadapter = BluetoothAdapter.getDefaultAdapter();\n return (oBTadapter != null);\n }", "public static boolean isLteSupport() {\n return SystemProperties.get(\"ro.boot.opt_lte_support\").equals(\"1\");\n }", "public interface IBlueToothService {\n\n\n boolean initialize();\n\n void function_data(byte[] data);\n\n void enable_JDY_ble(int p);\n\n\n void disconnect();\n\n /**\n * 执行指令\n * @param g\n * @param string_or_hex_data\n * @return\n */\n int command(String g, boolean string_or_hex_data);\n\n\n void Delay_ms(int ms);\n\n /**\n * 设置密码\n * @param pss\n */\n void set_APP_PASSWORD(String pss);\n\n\n boolean connect(String address);\n\n\n /**\n * 获取连接的ble设备所提供的服务列表\n * @return\n */\n List<BluetoothGattService> getSupportedGattServices();\n\n\n int get_connected_status(List<BluetoothGattService> gattServices);\n\n\n}", "private boolean canUseFeatureNow(Policy.Feature feature) {\n Policy policy = mBeaconingManager.mPolicy;\n return policy!= null && policy.allows(feature) && !isBotheringUser(policy);\n }", "@Override\r\n\tprotected void onHandleIntent(Intent intent) {\n\t\tfinal BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\r\n\t\tmBluetoothAdapter = bluetoothManager.getAdapter();\r\n\r\n\t\t// Checks if Bluetooth is supported on the device.\r\n\t\tif (mBluetoothAdapter == null) {\r\n\t\t\tLog.i(TAG, \"Bluetooth is not supported\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tLog.i(TAG, \"mBluetoothAdapter = \" + mBluetoothAdapter);\r\n\t\t}\r\n\r\n\t\t//启用蓝牙\r\n\t\t//mBluetoothAdapter.enable();\r\n\t\t//Log.i(TAG, \"mBluetoothAdapter.enable\");\r\n\t\t\r\n\t\tmBLE = new BluetoothLeClass(this);\r\n\t\t\r\n\t\tif (!mBLE.initialize()) {\r\n\t\t\tLog.e(TAG, \"Unable to initialize Bluetooth\");\r\n\t\t}\r\n\t\tLog.i(TAG, \"mBLE = e\" + mBLE);\r\n\r\n\t\t// 发现BLE终端的Service时回调\r\n\t\tmBLE.setOnServiceDiscoverListener(mOnServiceDiscover);\r\n\r\n\t\t// 收到BLE终端数据交互的事件\r\n\t\tmBLE.setOnDataAvailableListener(mOnDataAvailable);\r\n\t\t\r\n\t\t//开始扫描\r\n\t\tmBLE.scanLeDevice(true);\r\n\t\t\r\n\t\t/*\r\n\t\tMRBluetoothManage.Init(this, new MRBluetoothEvent() {\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultStatus(int result) {\r\n\t\t\t\tswitch (result) {\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_NOT_OPEN:\r\n\t\t\t\t\t//Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t\t\t//startActivityForResult(enableBtIntent, 100);\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_NOT_OPEN\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_INIT_OK:\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_INIT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_END:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_END\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_OK:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_CLOSE:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_CLOSE\");\r\n\t\t\t\t\tMRBluetoothManage.stop();\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\t//MRBluetoothManage.Init(BluetoothService.this, this);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultDevice(ArrayList<BluetoothDevice> deviceList) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultData(byte[] data) {\r\n\t\t\t\tLog.i(TAG, data.toString());\r\n\t\t\t\tbyte[] wenDuByte = new byte[2];\r\n\t\t\t\tbyte[] shiDuByte = new byte[2];\r\n\t\t\t\tbyte[] shuiFenByte = new byte[2];\r\n\t\t\t\tbyte[] ziWaiXianByte = new byte[2];\r\n\t\t\t\tSystem.arraycopy(data, 4, wenDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 6, shiDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 8, shuiFenByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 10, ziWaiXianByte, 0, 2);\r\n\t\t\t\tTestModel model = new TestModel();\r\n\t\t\t\tmodel.wenDu = BitConverter.toShort(wenDuByte);\r\n\t\t\t\tmodel.shiDu = BitConverter.toShort(shiDuByte);\r\n\t\t\t\tmodel.shuiFen = BitConverter.toShort(shuiFenByte);\r\n\t\t\t\tmodel.ziWaiXian = BitConverter.toShort(ziWaiXianByte);\r\n\t\t\t\t//Log.d(TAG, model.toString());\r\n\t\t\t\tsendData(model);\r\n\t\t\t}\r\n\t\t});\r\n\t\t*/\r\n\t}", "@Override\n\tpublic boolean isBusy() throws DeviceException {\n\t\treturn false;\n\t}", "private void doWiperAvailabiltiyCheck()\n {\n // Hardcode for now to make sure WPS is not triggered\n bWiperAvailable = true;\n\n mWifi = (WifiManager)getSystemService(mContext.WIFI_SERVICE);\n\n if ((mWifi == null) || ( (locationManager == null)|| ((locationProvider = locationManager.getProvider(LocationManager.NETWORK_PROVIDER )) == null)))\n {\n Log.e(TAG,\" Disable wiper : No object for WPS / Wifi Scans \");\n bWiperAvailable = false;\n }\n\n\n // call native function to trigger RPC from A11-> A9\n // informing about WPS capability\n //\n native_notify_wiper_available(bWiperAvailable);\n\n if (Config.LOGV)\n {\n Log.v(TAG, \"Wiper: Availability Check \"+ bWiperAvailable);\n }\n }", "public void bluetooth_enable_discoverability()\r\n {\n\t\t\r\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\r\n\t\tdiscoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\r\n\t\tLoaderActivity.m_Activity.startActivity(discoverableIntent);\r\n\t\tserver_connect_thread = new Server_Connect_Thread();\r\n\t\tserver_connect_thread.start();\r\n\t\tmessages.clear();\r\n }", "boolean hasSoftware();", "public boolean canRequestPower();", "private boolean isBtConnected(){\n \treturn false;\n }", "public static boolean isEnabledData(Context context) {\n TelephonyManager tm =\n (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n return tm == null ? false : (tm.getDataState() != TelephonyManager.DATA_DISCONNECTED);\n }", "public AsyncResult<Boolean> isSupported() {\r\n EntityCapabilitiesManager entityCapabilitiesManager = xmppSession.getManager(EntityCapabilitiesManager.class);\r\n return entityCapabilitiesManager.discoverCapabilities(xmppSession.getDomain())\r\n .thenApply(infoNode -> infoNode.getFeatures().contains(OfflineMessage.NAMESPACE));\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (bluetoothAdapter == null) {\n //Display a toast notifying the user that their device doesn’t support Bluetooth//\n Toast.makeText(getApplicationContext(), \"This device doesn’t support Bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n //If BluetoothAdapter doesn’t return null, then the device does support Bluetooth//\n Toast.makeText(getApplicationContext(), \"This device does support Bluetooth\", Toast.LENGTH_LONG).show();\n }\n }", "public boolean hasCharacteristicDescription() {\n return characteristicDescription_ != null;\n }" ]
[ "0.76762134", "0.74104947", "0.7264478", "0.7194611", "0.70840544", "0.6855239", "0.6840546", "0.67323333", "0.6692386", "0.66838706", "0.6611804", "0.6603218", "0.65296865", "0.6423284", "0.63525325", "0.6329183", "0.626041", "0.6235608", "0.62240183", "0.61773145", "0.61699307", "0.6166274", "0.605004", "0.6023954", "0.59991467", "0.59929353", "0.59795856", "0.5978425", "0.59627736", "0.5930594", "0.5901827", "0.58886623", "0.5852253", "0.5842465", "0.57827336", "0.57515913", "0.5741795", "0.57054406", "0.56992346", "0.5694535", "0.568533", "0.5658548", "0.56220907", "0.5592268", "0.55902755", "0.5585539", "0.5558846", "0.55573064", "0.55144143", "0.551332", "0.550465", "0.54973304", "0.54918", "0.5482586", "0.5480448", "0.5474924", "0.54729706", "0.54642355", "0.54543024", "0.54399085", "0.5426009", "0.5419931", "0.5415754", "0.5415754", "0.5415754", "0.5415754", "0.541071", "0.54017836", "0.53993124", "0.53935105", "0.539295", "0.53811216", "0.53787005", "0.537285", "0.537285", "0.53691137", "0.5350751", "0.5340182", "0.5329784", "0.5319771", "0.5315322", "0.5310587", "0.5297615", "0.52944195", "0.527704", "0.52661526", "0.52637786", "0.5263327", "0.52564037", "0.5249665", "0.52437603", "0.52285945", "0.5213061", "0.5212779", "0.521241", "0.5209416", "0.5204875", "0.51965517", "0.5184738", "0.51845026" ]
0.75268954
1
If the device is the correct one, go ahead and connect to it
@Override public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) { if(device.getName() == null) { //Not interested in these return; } //Log.i(TAG, "Found " + device.getName()); if(device.getName().equals(TARGET_SERVICE_NAME)) { Log.v(TAG, "Connecting to parallel demo"); mDeviceAddress = device.getAddress(); startBLEService(); scanLeDevice(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void connectDevice(Tl1Device device) {\n try {\n // Add device to TL1 controller\n DeviceId deviceId = DeviceId.deviceId(\n new URI(Tl1DeviceConfig.TL1, device.ip() + \":\" + device.port(), null));\n\n if (controller.addDevice(deviceId, device)) {\n SparseAnnotations ann = DefaultAnnotations.builder()\n .set(AnnotationKeys.PROTOCOL, Tl1DeviceConfig.TL1.toUpperCase())\n .build();\n // Register device in the core with default parameters and mark it as unavailable\n DeviceDescription dd = new DefaultDeviceDescription(deviceId.uri(),\n Device.Type.SWITCH,\n UNKNOWN, UNKNOWN,\n UNKNOWN, UNKNOWN,\n new ChassisId(),\n false, ann);\n providerService.deviceConnected(deviceId, dd);\n }\n } catch (URISyntaxException e) {\n log.error(\"Skipping device {}\", device, e);\n }\n }", "void tryConnection(String mac)\n {\n if (outstanding_connect != null || open_connection != null) {\n return;\n }\n \n Log.d(Constants.LOG_TAG, \"Attempting to connect to \" + mac);\n \n BluetoothDevice dev = bt_adapter.getRemoteDevice(mac);\n outstanding_connect = new ConnectThread(dev, handler);\n outstanding_connect.start();\n \n }", "private boolean mConnect2Device1(BluetoothDevice oDevice1){\n mStateSet(kBT_Connecting); //Connecting to a server\n if (mIsAndroidDevice(oDevice1)) {\n if (mConnect2Device_Sub(UUID_ANDROID_INSECURE, oDevice1)) {\n mStateSet(kBT_Connected1);\n mMsgLog(\"ANDROID Connected: \" +oDevice1.getName());\n oDevice=oDevice1;\n return true;\n }\n } else if (mIsClassic(oDevice1)) { // Classic bluetoot device\n if ( mConnect2Device_Sub(UUID_LMDEVICE_INSECURE, oDevice1)) {\n mStateSet(kBT_Connected1);\n mMsgLog(9,\"Classic bluetooth Connected: \" +oDevice1.getName() );\n oDevice=oDevice1;\n return true;\n }\n }\n mMsgDebug(\"Could not connect\");\n // mBTClose1();\n return false;\n}", "public boolean connect() {\n try {\n this.bluetoothSocket = this.device.createRfcommSocketToServiceRecord(this.device.getUuids()[0].getUuid());\n this.bluetoothSocket.connect();\n return true;\n } catch (IOException ex) {\n try {\n this.bluetoothSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n this.bluetoothSocket = null;\n }\n return false;\n }", "private void connectDevice(String address) {\n// // Get the device MAC address\n BluetoothDevice device = mBtAdapter.getRemoteDevice(address);\n// // Attempt to connect to the device\n mChatService.connect(device, true);\n }", "public void connect()\n\t{\n\t\tUUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805f9b34fb\"); //Standard SerialPortService ID\n\t\ttry\n\t\t{\n\t sock = dev.createRfcommSocketToServiceRecord(uuid); \n\t sock.connect();\n\t connected = true;\n\t dev_out = sock.getOutputStream();\n\t dev_in = sock.getInputStream();\n\t write(0);\n\t write(0);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t}", "private void bluetooth_connect_device() throws IOException\n {\n try\n {\n myBluetooth = BluetoothAdapter.getDefaultAdapter();\n address = myBluetooth.getAddress();\n pairedDevices = myBluetooth.getBondedDevices();\n if (pairedDevices.size()>0)\n {\n for(BluetoothDevice bt : pairedDevices)\n {\n address=bt.getAddress().toString();name = bt.getName().toString();\n Toast.makeText(getApplicationContext(),\"Connected\", Toast.LENGTH_SHORT).show();\n\n }\n }\n\n }\n catch(Exception we){}\n myBluetooth = BluetoothAdapter.getDefaultAdapter();//get the mobile bluetooth device\n BluetoothDevice dispositivo = myBluetooth.getRemoteDevice(address);//connects to the device's address and checks if it's available\n btSocket = dispositivo.createInsecureRfcommSocketToServiceRecord(myUUID);//create a RFCOMM (SPP) connection\n btSocket.connect();\n try { t1.setText(\"BT Name: \"+name+\"\\nBT Address: \"+address); }\n catch(Exception e){}\n }", "public void connectToAccessory() {\n\t\tif (mConnection != null)\n\t\t\treturn;\n\n\t\tif (getIntent().hasExtra(BTDeviceListActivity.EXTRA_DEVICE_ADDRESS)) {\n\t\t\tString address = getIntent().getStringExtra(\n\t\t\t\t\tBTDeviceListActivity.EXTRA_DEVICE_ADDRESS);\n\t\t\tLog.i(ADK.TAG, \"want to connect to \" + address);\n\t\t\tmConnection = new BTConnection(address);\n\t\t\tperformPostConnectionTasks();\n\t\t} else {\n\t\t\t// assume only one accessory (currently safe assumption)\n\t\t\tUsbAccessory[] accessories = mUSBManager.getAccessoryList();\n\t\t\tUsbAccessory accessory = (accessories == null ? null\n\t\t\t\t\t: accessories[0]);\n\t\t\tif (accessory != null) {\n\t\t\t\tif (mUSBManager.hasPermission(accessory)) {\n\t\t\t\t\topenAccessory(accessory);\n\t\t\t\t} else {\n\t\t\t\t\t// synchronized (mUsbReceiver) {\n\t\t\t\t\t// if (!mPermissionRequestPending) {\n\t\t\t\t\t// mUsbManager.requestPermission(accessory,\n\t\t\t\t\t// mPermissionIntent);\n\t\t\t\t\t// mPermissionRequestPending = true;\n\t\t\t\t\t// }\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Log.d(TAG, \"mAccessory is null\");\n\t\t\t}\n\t\t}\n\n\t}", "private void connectDevices() {\n Set<DeviceId> deviceSubjects =\n cfgRegistry.getSubjects(DeviceId.class, Tl1DeviceConfig.class);\n deviceSubjects.forEach(deviceId -> {\n Tl1DeviceConfig config =\n cfgRegistry.getConfig(deviceId, Tl1DeviceConfig.class);\n connectDevice(new DefaultTl1Device(config.ip(), config.port(), config.username(),\n config.password()));\n });\n }", "public boolean mConnect(String s) { //Find and mConnect to the bluetooth\n if (isBtOpen()==false)\n return false;\n if (isConnected(s))\n return true;\n if (bDevicePickerActive) return false; //Don't connect while picking device\n if (oDevice!=mBTDeviceByName(s)) mDisconnect();\n mDisconnect();\n oDevice=mBTDeviceByName(s);\n sDeviceName = s; //Set new device name\n oParent.mDeviceNameSet(s);\n if (mConnect2Device1(oDevice))\n return true;\n\n mStateSet(kBT_ConnectReq1);\n if (mBTOpen1()==false) { //If BT cannot be opened\n mStateSet(kBT_InvalidBT1);\n mErrMsg(\"No bluetooth port available\");\n return false;\n }\n if (mIsState(kBT_Connecting)) {\n mSleep(1000);\n if (oInput!=null)\n mStateSet(kBT_Connected1);\n else\n mStateSet(kBT_InvalidDevice1);\n return false;\n }\n if (oDevice==null) { //Device not found,\n oDevice=mBTDeviceByName(sDeviceName);\n if (oDevice==null){\n mStateSet(kBT_InvalidDevice1);\n mSleep(2000);\n }\n return false;\n }\n //set by mConnectDeviceWithName, mRequestConnection\n if (mIsState(kBT_ConnectReq1)) { //Try to connect first time\n if (mConnect2Device1(oDevice)==false) //mConnect sets mStateSet(kBT_DeviceConnected);\n mSleep(10);\n } else if (mIsState(cKonst.eSerial.kBT_BrokenConnection)) { //Try to reconnect\n mSleep(2000);\n bDoRedraw=true;\n return false;\n } else if (mIsState(kOverflow)){ //Fatal, overflow, donno what to do\n mConnectionStateClear();\n return false;\n } else {\n mSleep(2000); //Do nothing while connection was interrupted\n }\n return false;\n }", "private void connectToPeer() {\n mStatusText.append(\"Connecting to device...\\n\");\n\n String deviceKey = (String) mDevices.getSelectedItem();\n final WifiDirectDevice device = mGoodDevices.get(deviceKey);\n if (device == null) {\n mStatusText.append(\"Device no longer exists, refreshing peers...\\n\");\n discoverPeers();\n return;\n }\n\n WifiP2pConfig config = new WifiP2pConfig();\n config.deviceAddress = device.deviceAddress;\n config.wps.setup = WpsInfo.PBC; // push-button connect (as opposed to PIN, etc)\n\n // Set groupOwnerIntent so there aren't 2 groupowners.\n // It ranges between 0-15 , higher the value, higher\n // the possibility of becoming a groupOwner\n config.groupOwnerIntent = 0;\n\n if (mServiceDevices != null) {\n final WifiDirectDevice wDevice = mServiceDevices.get(deviceKey);\n if (wDevice != null && !wDevice.isGroupOwner && Integer.valueOf(wDevice.record.get(\"id\").toString()) < WifiDirectUtilities.ID) {\n// // Create a group\n// mManager.createGroup(mChannel, new WifiP2pManager.ActionListener() {\n// @Override\n// public void onSuccess() {\n// MainActivity.this.onGroupCreateResult(-1);\n// }\n//\n// @Override\n// public void onFailure(int reasonCode) {\n// MainActivity.this.onGroupCreateResult(reasonCode);\n// }\n// });\n this.mIsGO = true;\n config.groupOwnerIntent = 1;\n }\n }\n\n mManager.connect(mChannel, config, new WifiP2pManager.ActionListener() {\n\n @Override\n public void onSuccess() {\n mStatusText.append(\"Connected via WiFi!\\n\");\n // BroadcastReceiver will note when the connection changes in WIFI_P2P_PEERS_CHANGED_ACTION\n }\n\n @Override\n public void onFailure(int reasonCode) {\n logEvent(TAG, WifiDirectUtilities.getFailureReasonMessage(reasonCode));\n }\n });\n }", "private void connectToAdapter() {\n if (chosen) {\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n // creation and connection of a bluetooth socket\n try {\n BluetoothSocket socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n setBluetoothSocket(socket);\n connected = true;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n connect.setText(\"Disconnect\");\n connect.setTextColor(Color.RED);\n }\n });\n } catch (IOException e) {\n Log.d(\"Exception\", \"Bluetooth IO Exception c\");\n connected = false;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(currContext, R.string.cannotConnect, Toast.LENGTH_SHORT).show();\n connect.setText(\"Connect\");\n connect.setTextColor(Color.BLACK);\n mode.setEnabled(true);\n }\n });\n }\n }\n if (bluetoothSocket.getRemoteDevice().getAddress() != null)\n Log.d(TAG, \"Bluetooth connected\");\n Log.d(TAG, \"Device address: \" + bluetoothSocket.getRemoteDevice().getAddress());\n initializeCom();\n }", "private void connect() throws Exception {\n\n Log.i(TAG, \"Attempting connection to \" + address + \"...\");\n\n // Get this device's Bluetooth adapter\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n if ((adapter == null) || (!adapter.isEnabled())){\n throw new Exception(\"Bluetooth adapter not found or not enabled!\");\n }\n\n // Find the remote device\n BluetoothDevice remoteDevice = adapter.getRemoteDevice(address);\n\n // Create a socket with the remote device using this protocol\n socket = remoteDevice.createRfcommSocketToServiceRecord(uuid);\n\n // Make sure Bluetooth adapter is not in discovery mode\n adapter.cancelDiscovery();\n\n // Connect to the socket\n socket.connect();\n\n\n // Get input and output streams from the socket\n outStream = socket.getOutputStream();\n inStream = socket.getInputStream();\n\n Log.i(TAG, \"Connected successfully to \" + address + \".\");\n }", "private void connectBluetooth() {\n try {\n if (blueTooth == null && macSet) {\n Log.d(\"lol\", \"macSet connect bluetooootooththoth\");\n blueTooth = new BluetoothConnection(macAddress, this, listener);\n blueTooth.connect();\n }\n } catch (Exception e) {\n Log.d(\"lol\", \"Failed connection: \" + e.getMessage() + \" \" + e.getClass());\n }\n }", "private void bluetoothConnect() {\n\n btDevice = btAdapter.getRemoteDevice(EDISON_ADDRESS);\n if (btDevice == null) {\n Log.d(TAG,\"get remote device fail!\");\n finish();\n }\n\n try {\n btSocket = btDevice.createRfcommSocketToServiceRecord(SSP_UUID);\n } catch (IOException e) {\n Log.d(TAG,\"bluetooth socket create fail.\");\n }\n //save resource by cancel discovery\n btAdapter.cancelDiscovery();\n\n //connect\n try {\n btSocket.connect();\n Log.d(TAG,\"Connection established.\");\n } catch ( IOException e) {\n try {\n btSocket.close();\n }catch (IOException e2) {\n Log.d(TAG,\"unable to close socket after connect fail.\");\n }\n }\n\n //prepare outStream to send message\n try {\n outStream = btSocket.getOutputStream();\n } catch (IOException e) {\n Log.d(TAG,\"output stream init fail!\");\n }\n\n }", "protected synchronized boolean connect() {\n if (isConnecting.get()) {\n if (0 == connectReturnValue.await(connectionTimeout)) {\n return true;\n } else {\n isConnecting.set(false);\n }\n }\n\n\n int connectionValue = connectReturnValue.await(connectionTimeout);\n\n //are we just pretending to be connected? if yes: reconnect.\n if (0 == connectionValue && (BluetoothProfile.STATE_CONNECTED != bluetoothManager.getConnectionState(device, GATT))) {\n connectionValue = -1;\n }\n\n if (0 == connectionValue) {\n return true;\n }\n\n //Now we really are connecting\n isConnecting.set(true);\n connectReturnValue.reset();\n\n\n if (null == logger || null == deviceAddress || null == context || null == bluetoothManager) {\n isConnecting.set(false);\n return false;\n }\n\n\n BluetoothAdapter adapter = bluetoothManager.getAdapter();\n\n if (null == adapter) {\n isConnecting.set(false);\n return false;\n }\n\n\n if (null == device) {\n device = adapter.getRemoteDevice(deviceAddress);\n }\n\n if (null == device) {\n isConnecting.set(false);\n return false;\n }\n\n\n if(null != bleGatt ){\n bleGatt.close();\n }\n\n\n bleGatt = device.connectGatt(context, autoReconnect, this);\n\n if (null == bleGatt) {\n getLogger().println(\"Can't connect to \" + device.getName());\n isConnecting.set(false);\n return false;\n\n } else {\n if (!bleGatt.connect()) {\n isConnecting.set(false);\n return false;\n }\n }\n\n int ret = connectReturnValue.await(connectionTimeout);\n isConnecting.set(false);\n return ret == 0;\n }", "public void connect(final WifiP2pDevice device){\n WifiP2pConfig config = new WifiP2pConfig();\n config.deviceAddress = device.deviceAddress;\n config.wps.setup = WpsInfo.PBC;\n\n manager.connect(channel, config, new WifiP2pManager.ActionListener() {\n @Override\n public void onSuccess() {\n // keep the name of the latest device connected to keep track\n devicesConnected.add(device.deviceName);\n\n }\n\n\n @Override\n public void onFailure(int reason) {\n\n if(reason == WifiP2pManager.P2P_UNSUPPORTED){\n Toast.makeText(getContext(), \"P2P isn't supported on this device.\",\n Toast.LENGTH_SHORT).show();\n\n } else{\n Toast.makeText(getContext(), \"Connect failed. Retry.\",\n Toast.LENGTH_SHORT).show();\n }\n\n\n\n }\n });\n\n }", "public void connect(View view) {\n if (phoneNum.getText().toString().equals(\"\")) {\n Toast.makeText(getApplication(), \"Please enter a phone number\", Toast.LENGTH_SHORT).show();\n } else {\n phoneNum.setEnabled(false);\n HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList();\n if (!usbDevices.isEmpty()) {\n boolean keep = true;\n for (Map.Entry<String, UsbDevice> entry : usbDevices.entrySet()) {\n device = entry.getValue();\n int deviceVID = device.getVendorId();\n if (deviceVID == 0x2341)//Arduino Vendor ID\n {\n PendingIntent pi = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);\n usbManager.requestPermission(device, pi);\n keep = false;\n } else {\n connection = null;\n device = null;\n }\n\n if (!keep)\n break;\n }\n }\n }\n }", "private boolean connectReader() {\n BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n if (bluetoothManager == null) {\n Log.w(TAG, \"Unable to initialize BluetoothManager.\");\n updateConnectionState(BluetoothReader.STATE_DISCONNECTED);\n return false;\n }\n\n BluetoothAdapter bluetoothAdapter = bluetoothManager.getAdapter();\n if (bluetoothAdapter == null) {\n Log.w(TAG, \"Unable to obtain a BluetoothAdapter.\");\n updateConnectionState(BluetoothReader.STATE_DISCONNECTED);\n return false;\n }\n\n /*\n * Connect Device.\n */\n /* Clear old GATT connection. */\n if (mBluetoothGatt != null) {\n Log.i(TAG, \"Clear old GATT connection\");\n mBluetoothGatt.disconnect();\n mBluetoothGatt.close();\n mBluetoothGatt = null;\n }\n\n /* Create a new connection. */\n final BluetoothDevice device = bluetoothAdapter\n .getRemoteDevice(mDeviceAddress);\n\n if (device == null) {\n Log.w(TAG, \"Device not found. Unable to connect.\");\n return false;\n }\n\n /* Connect to GATT server. */\n updateConnectionState(BluetoothReader.STATE_CONNECTING);\n mBluetoothGatt = device.connectGatt(this, false, mGattCallback);\n return true;\n }", "public boolean connectToRemoteDevice(BluetoothDevice remoteDevice) {\n if (debugging) Log.d(TAG, \"connectToPegasusAP to: \" + remoteDevice);\n try {\n if (isConnectedToRemoteDevice() || socketStillAlive())\n disconnectFromRemoteDevice(); //if socket is exist disconnect from it\n setState(EBluetoothStates.CONNECTING);\n mConnectionManager.connectToRemoteDevice(remoteDevice, mSharedUUID);\n mConnectionManager.start(); //start the thread to handle socket\n setState(EBluetoothStates.CONNECTED);\n return true;\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n return false;\n }\n }", "@Override\n public boolean connect(BluetoothDevice bluetoothDevice) throws RemoteException {\n Parcel parcel = Parcel.obtain();\n Parcel parcel2 = Parcel.obtain();\n try {\n parcel.writeInterfaceToken(Stub.DESCRIPTOR);\n boolean bl = true;\n if (bluetoothDevice != null) {\n parcel.writeInt(1);\n bluetoothDevice.writeToParcel(parcel, 0);\n } else {\n parcel.writeInt(0);\n }\n if (!this.mRemote.transact(8, parcel, parcel2, 0) && Stub.getDefaultImpl() != null) {\n bl = Stub.getDefaultImpl().connect(bluetoothDevice);\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n parcel2.readException();\n int n = parcel2.readInt();\n if (n == 0) {\n bl = false;\n }\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n catch (Throwable throwable) {\n parcel2.recycle();\n parcel.recycle();\n throw throwable;\n }\n }", "public void connectDevice(Computer comp) {\n\n\t\tcomp.connect();\n\t}", "@Override\n public boolean isReachable(DeviceId deviceId) {\n try {\n // First check if device is already connected.\n // If not, try to open a socket.\n Tl1Device device = controller.getDevice(deviceId).get();\n if (device.isConnected()) {\n return true;\n }\n\n Socket socket = new Socket();\n socket.connect(new InetSocketAddress(device.ip().toInetAddress(), device.port()), REACHABILITY_TIMEOUT);\n socket.close();\n return true;\n } catch (NoSuchElementException | IOException | IllegalArgumentException e) {\n log.error(\"Cannot reach device {}\", deviceId, e);\n return false;\n }\n }", "private void connectToBluetoothDevice(String mac) {\n if (BluetoothAdapter.checkBluetoothAddress(mac)) {\n BluetoothDevice mBluetoothDevice = mBluetoothAdapter\n .getRemoteDevice(mac);\n mConnectThread = new ConnectThread(mBluetoothDevice);\n mConnectThread.start();\n }\n }", "private boolean ConnectKeyboard() throws IOException\n\t{\n\t\t// Standard Serial Port Service ID\n\t\tUUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\t\t\t\n\t\t\n\t\tmSocket = mDevice.createRfcommSocketToServiceRecord(uuid);\n\t\tmSocket.connect();\n\t\t\n\t\tif (mCommandManager != null)\n\t\t{\n\t\t\tShowToast(\"Already connected\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tmCommandManager = new CommandManager(this, mSocket);\n\t\treturn true;\n\t}", "public void doConnect() {\n Debug.logInfo(\"Connecting to \" + client.getServerURI() + \" with device name[\" + client.getClientId() + \"]\", MODULE);\n\n IMqttActionListener conListener = new IMqttActionListener() {\n\n public void onSuccess(IMqttToken asyncActionToken) {\n Debug.logInfo(\"Connected.\", MODULE);\n state = CONNECTED;\n carryOn();\n }\n\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n ex = exception;\n state = ERROR;\n Debug.logError(\"connect failed\" + exception.getMessage(), MODULE);\n carryOn();\n }\n\n public void carryOn() {\n synchronized (caller) {\n donext = true;\n caller.notifyAll();\n }\n }\n };\n\n try {\n // Connect using a non-blocking connect\n client.connect(conOpt, \"Connect sample context\", conListener);\n } catch (MqttException e) {\n // If though it is a non-blocking connect an exception can be\n // thrown if validation of parms fails or other checks such\n // as already connected fail.\n state = ERROR;\n donext = true;\n ex = e;\n }\n }", "public void startConnection(){\n startBTConnection(mBTDevice,MY_UUID_INSECURE);\n }", "@Override\n protected Void doInBackground(Void... devices){\n try {\n if (btSocket == null || !isBtConnected) {\n //get the mobile bluetooth device\n m_Bluetooth = BluetoothAdapter.getDefaultAdapter();\n //connects to the device's address and checks if it's available\n BluetoothDevice bluetoothDevice = m_Bluetooth.getRemoteDevice(address);\n //create a RFCOMM (SPP) connection\n btSocket = bluetoothDevice.createInsecureRfcommSocketToServiceRecord(myUUID);\n BluetoothAdapter.getDefaultAdapter().cancelDiscovery();\n btSocket.connect();//start connection\n }\n }\n catch (IOException e) {\n ConnectSuccess = false;//if the try failed, you can check the exception here\n }\n return null;\n }", "private boolean connect() {\n\t\tif (this.logging) {\n\t\t\tlogger.debug(\"trying to connect to \" + this.remoteName);\n\t\t}\n\n\t\tboolean connected = this.btc.connectTo(this.remoteName, null,\n\t\t\t\tNXTCommFactory.BLUETOOTH, NXTComm.PACKET);\n\t\tif (!connected) {\n\t\t\tif (this.logging) {\n\t\t\t\tlogger.info(\"not connected to \" + this.remoteName);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.dis = new ExtendedDataInputStream(this.btc.getDataIn());\n\t\t\tthis.dos = this.btc.getDataOut();\n\t\t\tif (this.logging) {\n\t\t\t\tlogger.info(\"connected to \" + this.remoteName);\n\t\t\t}\n\t\t}\n\n\t\treturn connected;\n\t}", "public final boolean connect() {\n if(this.connected) return true;\n if(this.connectThread == null || !this.connectThread.isAlive()){\n this.connectThread = new MdsConnect();\n this.connectThread.start();\n }\n this.connectThread.retry();\n if(!Thread.currentThread().getName().startsWith(\"AWT-EventQueue-\")) this.waitTried();\n if(this.connected) try{\n this.setup();\n }catch(final MdsException e){\n e.printStackTrace();\n this.close();\n }\n return this.connected;\n }", "public void autoConnect() {\n Log.i(TAG, \"HERE AUTOCONNECT\");\n connect(staticIp, staticPort);\n }", "public void connectToRemoteDevice(BluetoothDevice remoteDevice, UUID uuidToTry) throws IOException {\n mRemoteDevice = remoteDevice;\n BluetoothSocket tmp = null;\n try {\n // Get a BluetoothSocket for a connection with the given BluetoothDevice (Insecure)\n tmp = mRemoteDevice.createInsecureRfcommSocketToServiceRecord(uuidToTry);\n\n } catch (IOException e) {\n Log.e(TAG, \"create() failed\", e);\n }\n bluetoothSocket = new NativeBluetoothSocket(tmp);\n mUUID = uuidToTry;\n\n Log.i(TAG, \"BEGIN mConnectThread\");\n setName(\"ConnectThread\");\n try {\n connectToSocket();\n } catch (IOException e) {\n Log.e(TAG, e.getMessage());\n throw new IOException(TAG + \" Could not connectToPegasusAP to Socket\", e);\n }\n }", "public void connectToDevice(boolean autoConnect) {\n Log.d(TAG, \"connectToDevice: \" + getMACAddress());\n\n if (checkAndSetClientState(CONNECTION_STATE.DISCONNECTED, CONNECTION_STATE.CONNECTING)) {\n boolean status = BleDriver.mainHandler.postDelayed(new Runnable() {\n @Override\n public void run() {\n Log.d(TAG, \"mainQueue: connectToDevice: \" + getMACAddress());\n setBluetoothGatt(mBluetoothDevice.connectGatt(mContext, autoConnect,\n mGattCallback, BluetoothDevice.TRANSPORT_LE));\n startConnectionTimer();\n }\n }, 500);\n if (!status) {\n Log.e(TAG, String.format(\"connectToDevice error: can't add in job queue: device=%s\", getMACAddress()));\n }\n } else {\n Log.d(TAG, String.format(\"connectToDevice canceled, device %s is not disconnected\", getMACAddress()));\n }\n }", "private void connect() {\n\t\tString portName = deviceLocation.getText();\n\n\t\t// Check the Bandwidth SelectionBox and convert them:\n\t\tint bandWidthIndex = bandWidthList.getSelectedIndex();\n\t\tswitch (bandWidthIndex) {\n\t\tcase 0:\n\t\t\tbandRate = 9600;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tbandRate = 19200;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tbandRate = 38400;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tbandRate = 57600;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tbandRate = 115200;\n\t\t\tbreak;\n\t\t}\n\n\t\t// System Print Line: Connection information:\n\t\tlog.write(\"##############################\");\n\t\tlog.write(\"System Message: Trying to connect to:\" + portName\n\t\t\t\t+ \" with \" + bandRate + \" Bandwidth\");\n\n\t\t// Try to connect gameUi Class with specific device location and\n\t\t// bandwidth:\n\t\tif (!gameUi.connectSerial(portName, bandRate, this.log)) {\n\n\t\t\t// If Connection fails, shows an Error Message\n\t\t\tlog.write(\"System Message: Fails to connect to:\"\n\t\t\t\t\t+ portName + \" with \" + bandRate + \" Bandwidth\");\n\t\t\tlog.write(\"##############################\");\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\"Can't connect to this device, please check again.\",\n\t\t\t\t\t\"Connection Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t} else {\n\n\t\t\t// If Connection Success, then hide this connection Ui and\n\t\t\t// Change into GameUi:\n\t\t\tlog.write(\"System Message: Connect to:\" + portName\n\t\t\t\t\t+ \" with \" + bandRate + \" Bandwidth Seccessesfully\");\n\t\t\tlog.write(\"##############################\");\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\"Device Connected, have fun! :)\",\n\t\t\t\t\t\"Connection Success\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\tthis.setVisible(false);\n\t\t\tgameUi.setVisible(true);\n\t\t}\n\n\t}", "public void connect(String id) {\n // Android bluetooth API code\n BluetoothDevice device = null;\n try {\n device = mBluetoothAdapter.getRemoteDevice(id);\n mBluetoothAdapter.cancelDiscovery();\n }\n catch (Exception e) {\n // Show user error message\n // i.e. \"333 is not a valid bluetooth address\"\n Toast.makeText(getApplicationContext(), e.getMessage(),\n Toast.LENGTH_SHORT).show();\n }\n\n // If getRemoteDevice did not throw and device was set, connect to client\n // getRemoteDevice throws if its parameter is not a valid bluetooth address\n if (device != null) {\n try {\n btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);\n btSocket.connect();\n Toast.makeText(getApplicationContext(), \"Connection made\",\n Toast.LENGTH_SHORT).show();\n connectedStatus.setText(R.string.connection_connected);\n } catch (IOException e) {\n try {\n btSocket.close();\n } catch (IOException e2) {\n Log.d(TAG, \"Unable to end the connection\");\n }\n Log.d(TAG, \"Socket creation failed\");\n }\n }\n }", "public void connect()\n {\n \tLog.d(TAG, \"connect\");\n \t\n \tif(!this.isConnected ) {\n mContext.bindService(new Intent(\"com.google.tungsten.LedService\"), mServiceConnection, \n \t\tContext.BIND_AUTO_CREATE);\n \t}\n }", "protected void startConnect() {\n if (tcp) {\n connection = new TCPConnection(this);\n } else {\n connection = new UDPConnection(this, udpSize);\n }\n connection.connect(remoteAddr, localAddr);\n }", "@Override\r\n public void onDeviceConnecting(GenericDevice mDeviceHolder,\r\n PDeviceHolder innerDevice) {\n\r\n }", "@Override\n\tpublic boolean canConnect() {\n return false;\n }", "private void connectDevice(Intent data, boolean secure) {\n String address = data.getExtras()\n .getString(EXTRA_DEVICE_ADDRESS);\n // Get the BluetoothDevice object\n BluetoothDevice device = bluetoothAdapter.getRemoteDevice(address);\n // Attempt to connect to the device\n btService.connect(device, secure);\n }", "@Override\n public void run() {\n boolean isOk = mBluetoothLeService.connect(getDeviceName());// 根据地址通过后台services去连接BLE蓝牙\n L.d(reTryCount+\" -----connect ok ? >\"+ isOk);\n if(!isOk) {\n reTryConected();\n }\n }", "public synchronized void connect(BluetoothDevice device) {\n \tif (D) Log.d(TAG, \"connect to: \" + device);\n\n // Cancel any thread attempting to make a connection\n if (mState == STATE_CONNECTING) {\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n }\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n // Start the thread to connect with the given device\n mConnectThread = new ConnectThread(device);\n mConnectThread.start();\n setState(STATE_CONNECTING);\n }", "public void connect(View v) {\n turnOn(v);\n startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));\n Toast.makeText(getApplicationContext(), \"Select device\", Toast.LENGTH_LONG).show();\n System.err.println(bluetoothAdapter.getBondedDevices());\n }", "private void connectToDevice(Intent data, boolean secure){\n Log.i(TAG, \"-- connect to device --\");\n if(data == null){Log.e(TAG, \"data is null\");}\n // Get the device MAC address\n String address = data.getExtras()\n .getString(DeviceListActivity.EXTRA_DEVICE_ADDRESS);\n\n Log.i(TAG, \"-- getting to device --\");\n // Get the BluetoothDevice object\n BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);\n\n Log.i(TAG, \"-- connecting to device to device --\");\n // Attempt to connect to the device\n if(mClientService == null){Log.e(TAG, \"bluetooth client service is null\");}\n mClientService.connect(device, secure);\n Log.i(TAG,\"-- after connection function\");\n }", "private static boolean AttemptConnect() {\n try {\n if (Connect()) {\n Log.Confirmation(\"Connected to server on: \" + socket);\n // send connection type\n dos.writeUTF(\"viewer\");\n return true;\n } else {\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }", "protected synchronized boolean checkConnectivity() {\n return this.connect();\n }", "private void attemptToConnect() {\n LOG.warn(\"Attempting to connect....\");\n \n if (// No connection configuration\n getConnectionConfiguration() == null &&\n (getServerHostname() == null || getServerPort() == 0 ||\n getServiceName() == null || getFromAddress() == null ||\n getPassword() == null || getResource() == null)\n \n ||\n \n // Already logged in.\n getConnection() != null && getConnection().isAuthenticated()) {\n \n return;\n }\n \n try {\n if (getConnectionConfiguration() == null) {\n setConnectionConfiguration(new ConnectionConfiguration(\n getServerHostname(), getServerPort(), getServiceName()));\n }\n\n connect();\n }\n catch (Throwable t) {\n LOG.error(t);\n }\n }", "private void connectDevice(Intent data, boolean secure) {\n String address = data.getExtras()\n .getString(DeviceListActivity.EXTRA_DEVICE_ADDRESS);\n BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);\n mChatService.connect(device, secure);\n }", "public int connect() {\n if (this.mIsConnected) {\n HiLog.info(LOG_LABEL, \"Already connected, ignoring request.\", new Object[0]);\n return 1;\n }\n CallAppAbilityInfo callAppAbilityInfo = this.mInfo;\n if (callAppAbilityInfo == null || callAppAbilityInfo.getComponentName() == null) {\n HiLog.error(LOG_LABEL, \"no component to connect.\", new Object[0]);\n return 2;\n }\n HiLog.info(LOG_LABEL, \"Attempting to connect %{public}s.\", new Object[]{this.mInfo});\n this.mIsConnected = true;\n if (connectCallAppAbility(this.mInfo.getComponentName())) {\n return 1;\n }\n HiLog.error(LOG_LABEL, \"Failed to connect.\", new Object[0]);\n this.mIsConnected = false;\n return 2;\n }", "private void connectToSocket() throws IOException {\n // This is a blocking call and will only return on a exception\n bluetoothSocket.connect();// Create a connection to the BluetoothSocket\n\n }", "public void openConnection() {\n System.out.println(\"Opening connection...\");\n\n try {\n String HOST = \"192.168.4.1\";\n int PORT = 2323;\n connectionSocket = new Socket(HOST, PORT);\n connectionSocket.setTcpNoDelay(true);\n\n writer = new BufferedWriter(new OutputStreamWriter(new BufferedOutputStream(connectionSocket.getOutputStream())));\n reader = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));\n\n System.out.println(\"openConnection(): Success\");\n return;\n } catch (UnknownHostException e) {\n System.out.println(\"UnknownHostException at openConnection()\");\n } catch (IOException e) {\n System.out.println(\"IOException at openConnection()\");\n } catch (Exception e) {\n System.out.println(\"Exception at openConnection()\");\n System.out.println(e.toString());\n }\n\n System.out.println(\"Failed to connect\");\n }", "public void run() {\r\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\r\n adapter.cancelDiscovery();\r\n try {\r\n btSocket.connect();\r\n Log.d(\"TAG\", \"Device connected\");\r\n isConnected = true;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n handler.obtainMessage(CONNECTING_STATUS, 1, -1).sendToTarget();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n try {\r\n isConnected = false;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n btSocket.close();\r\n handler.obtainMessage(CONNECTING_STATUS, -1,-1).sendToTarget();\r\n } catch (IOException f) {\r\n f.printStackTrace();\r\n }\r\n return;\r\n }\r\n //Perform work from connection in a separate thread\r\n connectedThread = new ConnectedThread(btSocket);\r\n connectedThread.run();\r\n }", "public void run() {\n mBluetoothAdapter.cancelDiscovery();\n boolean success = false;\n try {\n\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n\n if(!mmSocket.isConnected()) {\n mmSocket.connect();\n success = true;\n }\n } catch (IOException e) {\n\n }\n\n if(mmSocket!=null){\n MainActivity.this.runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n Toast.makeText(MainActivity.this, \"successful\", Toast.LENGTH_SHORT).show();\n\n }\n });\n\n // Do work to manage the connection (in a separate thread)\n manageConnectedSocket(mmSocket);\n }\n }", "public void initBT() {\n\n\t\tStatusBox.setText(\"Connecting...\");\n\t\tLog.e(TAG, \"Connecting...\");\n\t\t\n\t\tif (D) {\n\t\t\tLog.e(TAG, \"+ ON RESUME +\");\n\t\t\tLog.e(TAG, \"+ ABOUT TO ATTEMPT CLIENT CONNECT +\");\n\t\t}\n\t\t\n\t\t//If Mac Address is null then stop this process and display message\n\t\tif(MAC_ADDRESS == \"\"){\n\t\t\tLog.e(TAG,\"No MAC Address Found...\");\n\t\t\tToast.makeText(getApplicationContext(), \"No Mac Address found. Please Enter using button.\",Toast.LENGTH_SHORT );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// When this returns, it will 'know' about the server,\n\t\t// via it's MAC address.\n\t\tBluetoothDevice device = null;\n\t\ttry {\n\t\t\tdevice = mBluetoothAdapter.getRemoteDevice(MAC_ADDRESS);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tToast.makeText(getApplicationContext(), \"NOT Valid BT MAC Address\", Toast.LENGTH_SHORT);\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\t// returns firefly e350\n\t\tLog.e(TAG, \"device name: \" + device.getName());\n\n\t\t// We need two things before we can successfully connect\n\t\t// (authentication issues aside): a MAC address, which we\n\t\t// already have, and an RFCOMM channel.\n\t\t// Because RFCOMM channels (aka ports) are limited in\n\t\t// number, Android doesn't allow you to use them directly;\n\t\t// instead you request a RFCOMM mapping based on a service\n\t\t// ID. In our case, we will use the well-known SPP Service\n\t\t// ID. This ID is in UUID (GUID to you Microsofties)\n\t\t// format. Given the UUID, Android will handle the\n\t\t// mapping for you. Generally, this will return RFCOMM 1,\n\t\t// but not always; it depends what other BlueTooth services\n\t\t// are in use on your Android device.\n\t\ttry {\n\t\t\t\n\t\t\tint currentapiVersion = android.os.Build.VERSION.SDK_INT;\n\t\t\t\n\t\t\t//RFCOMM connection varies depending on android version. Fixes bug in Gingerbread and newer where always asks for BT Pairing code.\n\t\t\tif (currentapiVersion >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android >= 2.3.3\n\t\t\t\tbtSocket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t} else if (currentapiVersion < android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android < 2.3.3\n\t\t\t\tbtSocket = device.createRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t}\n\t\t\t\n\t\t\tLog.e(TAG, \"ON RESUME: Socket created!\");\n\t\t\n\t\t\n\t\t\t// Discovery may be going on, e.g., if you're running a\n\t\t\t// 'scan for devices' search from your handset's Bluetooth\n\t\t\t// settings, so we call cancelDiscovery(). It doesn't hurt\n\t\t\t// to call it, but it might hurt not to... discovery is a\n\t\t\t// heavyweight process; you don't want it in progress when\n\t\t\t// a connection attempt is made.\n\t\t\tmBluetoothAdapter.cancelDiscovery();\n\n\t\t\tmyBT = new ConnectedThread(btSocket);\n\t\t\t\n\t\t\t\n\t\t\t// don't write to the streams unless they are created\n\t\t\tif (myBT.BTconnStatus) {\n\t\t\t\t\n\t\t\t\tStatusBox.setText(\"CONNECTED\");\n\t\t\t\tLog.e(TAG, \"CONNECTED\");\n\t\t\t\t\n\t\t\t\t// ST,255 enables remote configuration forever...need this if\n\t\t\t\t// resetting\n\t\t\t\t// PIO4 is held high on powerup then toggled 3 times to reset\n\n\t\t\t\t// GPIO Commands to BT device page 15 of commands datasheet\n\t\t\t\tbyte[] cmdMode = { '$', '$', '$' };\n\t\t\t\tmyBT.write(cmdMode);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S@,8080 temp sets GPIO-7 to an output\n\t\t\t\tbyte[] cmd1 = { 'S', '@', ',', '8', '0', '8', '0', 13 };\n\n\t\t\t\t// S%,8080 perm sets GPIO-7 to an output on powerup. only done once\n\t\t\t\t// byte [] cmd1 = {'S','%',',','8','0','8','0',13};\n\n\t\t\t\tmyBT.write(cmd1);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S&,8000 drives GPIO-7 low\n\t\t\t\t// byte [] cmd2 = {'S','^',',','8','0','0','0',13};\n\n\t\t\t\t// make it so cmd mode won't timeout even after factory reset\n\t\t\t\tbyte[] cmd3 = { 'S', 'T', ',', '2', '5', '5', 13 };\n\t\t\t\tmyBT.write(cmd3);\n\t\t\t\tmyBT.run();\n\n\t\t\t} else {\n\t\t\t\t//StatusBox.setText(\"NOT Connected\");\t\n\t\t\t\tLog.e(TAG, \"NOT Connected\");\n\t\t\t}\n\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\tif (D)\n\t\t\t\tLog.e(TAG, \"ON RESUME: Socket creation failed.\", e);\n\t\t}\n\n\t\t\n\t\t\n\t}", "public void initiateConnection() {\n\t\tif (Settings.getRemoteHostname() != null) {\n\t\t\ttry {\n\t\t\t\toutgoingConnection(new Socket(Settings.getRemoteHostname(), Settings.getRemotePort()));\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"failed to make connection to \" + Settings.getRemoteHostname() + \":\"\n\t\t\t\t\t\t+ Settings.getRemotePort() + \" :\" + e);\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}", "public void connect_bt(String deviceAddress) {\n Intent intent = new Intent(\"OBDStatus\");\n intent.putExtra(\"message\", \"Trying to connect with device\");\n context.sendBroadcast(intent);\n disconnect();\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n btAdapter.cancelDiscovery();\n if (deviceAddress == null || deviceAddress.isEmpty()) {\n intent.putExtra(\"message\", \"Device not found\");\n context.sendBroadcast(intent);\n return;\n }\n\n if (!btAdapter.isEnabled()) {\n intent.putExtra(\"message\", \"Bluetooth is disabled\");\n context.sendBroadcast(intent);\n return;\n }\n\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n\n try {\n socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n isConnected = true;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (IOException e) {\n Log.e(\"gping2\", \"There was an error while establishing Bluetooth connection. Falling back..\", e);\n Class<?> clazz = socket.getRemoteDevice().getClass();\n Class<?>[] paramTypes = new Class<?>[]{Integer.TYPE};\n BluetoothSocket sockFallback = null;\n try {\n Method m = clazz.getMethod(\"createInsecureRfcommSocket\", paramTypes);\n Object[] params = new Object[]{Integer.valueOf(1)};\n sockFallback = (BluetoothSocket) m.invoke(socket.getRemoteDevice(), params);\n sockFallback.connect();\n isConnected = true;\n socket = sockFallback;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (Exception e2) {\n intent.putExtra(\"message\", \"OBD Connection error\");\n context.sendBroadcast(intent);\n Log.e(\"gping2\", \"BT connect error\");\n }\n }\n this.deviceAddress = deviceAddress;\n saveNewAddress();\n }", "@RequestMapping(\"/ibmiot/deviceclient/connect\")\r\n\tpublic String connectDeviceclient() {\r\n\t\tThread t1 = new Thread(commandCallbackSubscriber);\r\n\t\tt1.start();\r\n\t\tmyClient.setCommandCallback(commandCallbackSubscriber);\r\n\t\t\r\n\t\t// Connect to the IBM Watson IoT Platform\r\n\t\ttry {\r\n\t\t\tmyClient.connect();\r\n\t\t} catch (MqttException e) {\r\n\t\t\treturn \"Failed to connected with IBM IoT deviced Client\";\r\n\t\t}\r\n\t\treturn \"Connected to IBM IoT deviced Client\";\r\n\t}", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "private void connect() {\n // after 10 seconds its connected\n new Handler().postDelayed(\n new Runnable() {\n public void run() {\n Log.d(TAG, \"Bluetooth Low Energy device is connected!!\");\n // Toast.makeText(getApplicationContext(),\"Connected!\",Toast.LENGTH_SHORT).show();\n stateService = Constants.STATE_SERVICE.CONNECTED;\n startForeground(Constants.NOTIFICATION_ID_FOREGROUND_SERVICE, prepareNotification());\n }\n }, 10000);\n\n }", "@Override\n public void connect() {\n super.connect();\n if (remoteMediaPlayer != null) {\n connected = true;\n reportConnected(connected);\n }\n }", "void onConnectDeviceComplete();", "public void connectWiFi() {\n\n // Agrego la red para poder conectarme\n conf.networkId = wifi.addNetwork(conf);\n if (conf.networkId == -1) {\n Log.i(\"#FSEM# SERVICE\", \"Fallo addNetwork\");\n return;\n }\n\n // Receiver para cambio de estado de WIFI\n IntentFilter intentFilter = new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION);\n intentFilter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);\n\n context.registerReceiver(this, intentFilter);\n\n // Mientras haya otra conexión con algun semaforo, espero a que se termine.\n while (SemComunication.staticState == StaticState.CONECTADO) {\n Log.i(\"#FSEM# SERVICE\", \"Me quiero conectar a \" + this.conf.SSID\n + \", pero sigue conectado a otro semaforo: \" + SemComunication.currentSSID);\n // Obligo a desconectarse.\n wifi.disconnect();\n SystemClock.sleep(1000);\n }\n\n // Me conecto con la red que quiero, y cuando lo logre\n // se ejecuta el receiver anterior\n wifi.disconnect();\n Log.i(\"#FSEM# SERVICE\", \"Me intento conectar con \" + (this.SSID));\n wifi.enableNetwork(this.conf.networkId, true);\n wifi.reconnect();\n SemComunication.staticState = StaticState.CONECTADO;\n SemComunication.networkId = this.conf.networkId;\n SemComunication.currentSSID = this.SSID;\n }", "public void connect() {}", "private synchronized boolean setAdbInterface(UsbDevice device, UsbInterface intf) throws IOException, InterruptedException {\n Log.d(\"Nightmare\", \"setAdbInterface\");\n if (adbTerminalConnection != null) {\n adbTerminalConnection.close();\n adbTerminalConnection = null;\n mDevice = null;\n }\n\n UsbManager mManager = (UsbManager) getSystemService(Context.USB_SERVICE);\n if (device != null && intf != null) {\n UsbDeviceConnection connection = mManager.openDevice(device);\n if (connection != null) {\n if (connection.claimInterface(intf, false)) {\n\n handler.sendEmptyMessage(Message.CONNECTING);\n\n adbTerminalConnection = AdbConnection.create(new UsbChannel(connection, intf), adbCrypto);\n\n adbTerminalConnection.connect();\n\n //TODO: DO NOT DELETE IT, I CAN'T EXPLAIN WHY\n// adbTerminalConnection.open(\"shell:exec date\");\n mDevice = device;\n handler.sendEmptyMessage(Message.DEVICE_FOUND);\n return true;\n } else {\n connection.close();\n }\n }\n }\n\n handler.sendEmptyMessage(Message.DEVICE_NOT_FOUND);\n\n mDevice = null;\n return false;\n }", "@Override\n public void clientTryingConnectionToHost(PiClient piClient) {\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(activity, \"Connecting\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "public void connect() throws ConnectionFailedException\n {\n isConnected = true;\n }", "public void createConnection() throws UsbGateException {\n mUsbConnection = mUsbManager.openDevice(mUsbDevice);\n if (mUsbConnection != null)\n connected = true;\n else\n throw new UsbGateException(\"Cannot get connection\");\n }", "public void onPickDevice(ConnectDevice device);", "@Override\n\tpublic boolean connect() {\n\t\treturn false;\n\t}", "boolean handleDeviceConnection(boolean connect, int device, String address,\n String deviceName) {\n if (AudioService.DEBUG_DEVICES) {\n Slog.i(TAG, \"handleDeviceConnection(\" + connect + \" dev:\"\n + Integer.toHexString(device) + \" address:\" + address\n + \" name:\" + deviceName + \")\");\n }\n synchronized (mConnectedDevices) {\n final String deviceKey = DeviceInfo.makeDeviceListKey(device, address);\n if (AudioService.DEBUG_DEVICES) {\n Slog.i(TAG, \"deviceKey:\" + deviceKey);\n }\n DeviceInfo di = mConnectedDevices.get(deviceKey);\n boolean isConnected = di != null;\n if (AudioService.DEBUG_DEVICES) {\n Slog.i(TAG, \"deviceInfo:\" + di + \" is(already)Connected:\" + isConnected);\n }\n if (connect && !isConnected) {\n final int res = AudioSystem.setDeviceConnectionState(device,\n AudioSystem.DEVICE_STATE_AVAILABLE, address, deviceName,\n AudioSystem.AUDIO_FORMAT_DEFAULT);\n if (res != AudioSystem.AUDIO_STATUS_OK) {\n Slog.e(TAG, \"not connecting device 0x\" + Integer.toHexString(device)\n + \" due to command error \" + res);\n return false;\n }\n mConnectedDevices.put(deviceKey, new DeviceInfo(\n device, deviceName, address, AudioSystem.AUDIO_FORMAT_DEFAULT));\n mDeviceBroker.postAccessoryPlugMediaUnmute(device);\n return true;\n } else if (!connect && isConnected) {\n AudioSystem.setDeviceConnectionState(device,\n AudioSystem.DEVICE_STATE_UNAVAILABLE, address, deviceName,\n AudioSystem.AUDIO_FORMAT_DEFAULT);\n // always remove even if disconnection failed\n mConnectedDevices.remove(deviceKey);\n return true;\n }\n Log.w(TAG, \"handleDeviceConnection() failed, deviceKey=\" + deviceKey\n + \", deviceSpec=\" + di + \", connect=\" + connect);\n }\n return false;\n }", "public void connect(DeviceType deviceType) throws ConnectionFailedException {\r\n\t\ttry {\r\n\t\t\trmiClient.connect(deviceType);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new ConnectionFailedException();\r\n\t\t}\r\n\t}", "public static boolean connect()\n\t\t{\n\t\tif(!use)\n\t\t\treturn false;\n\t\tif(object!=null)\n\t\t\treturn true;\n\t\telse\n\t\t\t{\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tconn = DBusConnection.getConnection(DBusConnection.SESSION);\n\t\t\t\tobject = conn.getRemoteObject(busName, \"/\", DBus.class);\n\t\t\t\t}\n\t\t\tcatch (DBusException e)\n\t\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tuse=false;\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcatch (NoClassDefFoundError e)\n\t\t\t\t{\n\t\t\t\tSystem.out.println(\"---- DBUS library not found\");\n\t\t\t\tuse=false;\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\treturn true;\n\t\t\t}\n\t\t}", "public void initDevice() {\n myBluetoothAdapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter();\n pairedDevices = myBluetoothAdapter.getBondedDevices();\n }", "public void connect() {\n\t\tint index = shell.getConnectionsCombo().getSelectionIndex();\n\t\tif (profiles.length == 0 || index < 0 || index >= profiles.length) {\n\t\t\tupdateSelection();\n\t\t\treturn;\n\t\t}\n\t\tIConnectionProfile profile = profiles[index];\n\t\tshell.setEnabled(false);\n\t\tnetworkManager.connect(profile, (s, r) -> {\n\t\t\tif (s) {\n\t\t\t\tcompleted = true;\n\t\t\t\tclose();\n\t\t\t} else {\n\t\t\t\tplugin.sync(() -> {\n\t\t\t\t\tMessageBox messageBox = new MessageBox(shell.isDisposed() ? null : shell, SWT.ICON_ERROR);\n\t\t\t\t\tmessageBox.setMessage(\"Failed to connect!\\n\" + r);\n\t\t\t\t\tmessageBox.open();\n\t\t\t\t\tshell.setEnabled(true);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "public void connectService() {\n log_d( \"connectService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) {\n\t\t\ttoast_short( \"No Action in debug\" );\n \treturn;\n }\n\t\t// connect the BT device at once\n\t\t// if there is a device address. \n\t\tString address = getPrefAddress();\n\t\tif ( isPrefUseDevice() && ( address != null) && !address.equals(\"\") ) {\n\t \tBluetoothDevice device = mBluetoothAdapter.getRemoteDevice( address );\n\t \tif ( mBluetoothService != null ) {\n\t \t log_d( \"connect \" + address );\n\t \tmBluetoothService.connect( device );\n\t }\n\t\t// otherwise\n\t\t// send message for the intent of the BT device list\n\t\t} else {\n\t\t\tnotifyDeviceList();\n\t\t}\n\t}", "public boolean isDeviceAlreadyConnected(IWifiP2pProxy.IFastConnectInfo info) {\n\t\tLog.d(TAG, \"mConnectedDevice = \" + mConnectedDevice.getDeviceAddress());\n\t\tLog.d(TAG, \"info = \" + info.getDeviceAddress());\n\t\tif (mConnectedDevice.getDeviceAddress().equalsIgnoreCase(info.getDeviceAddress())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void connDevice(String address) {\n MokoSupport.getInstance().connDevice(this, address, this);\n }", "private synchronized void beginRegistration() {\n if (mDeviceRegistering == null && mDevicesToRegister.size() > 0) {\n mDeviceRegistering = mDevicesToRegister.remove(0);\n if (!connectToDevice(mDeviceRegistering)) {\n endRegistration();\n }\n } else if (mDeviceRegistering == null && mDevicesToRegister.size() == 0) {\n // Run out of devices, so revert wifi connection\n resetWifiConnection();\n } else {\n // registering a device\n }\n }", "@Override\n public void checkBluetoothInteface() {\n if (!isConnected) {\n checkForBluetooth();\n }\n }", "public void buttonClick_connect(View view)\n\t{\n\t\tAppSettings.showConnectionLost = false;\n\t\tLog.i(TAG, \"showConnectionLost = false\");\n\t\t\n\t\tAppSettings.bluetoothConnection = new BluetoothConnection(this.getApplicationContext(), this.btConnectionHandler);\n\t\tBluetoothAdapter btAdapter = AppSettings.bluetoothConnection.getBluetoothAdapter();\n\t\t\n\t\t// If the adapter is null, then Bluetooth is not supported\n if (btAdapter == null) {\n \tToast.makeText(getApplicationContext(), R.string.bt_not_available, Toast.LENGTH_LONG).show();\n }\n else {\n \t// If Bluetooth is not on, request that it be enabled.\n if (!btAdapter.isEnabled()) {\n Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\n }\n else {\n \t// Launch the DeviceListActivity to see devices and do scan\n Intent serverIntent = new Intent(getApplicationContext(), DeviceListActivity.class);\n startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);\n }\n }\n\t}", "@Override\n public boolean connect() {\n\n if (!isConnected) {\n try {\n\n Socket socket = new Socket(hostName, portNumber);\n out = new PrintWriter(socket.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n isConnected = true;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return isConnected;\n }", "private void deviceDetected(String btMac) {\r\n\t\t// We only allow one doctor to be logged in at the same place\r\n\t\tif (doctor == null) {\r\n\t\t\t// Check db to see if it is a doctor if so log in\r\n\t\t\tDoctor d = dbAdapter.getDoctor(btMac);\r\n\t\t\tif (d != null) {\r\n\t\t\t\t// Successful login\r\n\t\t\t\tthis.doctor = d;\r\n\t\t\t\tthis.doctor.setOnline(1);\r\n\t\t\t\tdoLogin();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void connectDevice(String address) {\n try {\n device = bluetoothAdapter.getRemoteDevice(address);\n }catch(IllegalArgumentException e){\n Toast.makeText(NavigationDrawerActivity.this, \"Mac Address is not available!\", Toast.LENGTH_SHORT).show();\n }\n // Attempt to connect to the device\n chatService.connect(device);\n\n // replaceFragment(AnalysisFragment.NewInstance(),\"analysisfragment\");\n listViewNavDrawer.performItemClick(null,2,0);\n }", "private boolean verifyBTConnected() {\n if (btSocket != null && btSocket.isConnected()) {\n return true;\n }\n\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTING);\n try {\n if (btDevice == null) {\n btDevice = btAdapter.getRemoteDevice(btAddress);\n }\n\n btSocket = btDevice.createInsecureRfcommSocketToServiceRecord(uuid);\n btSocket.connect();\n\n mmInStream = btSocket.getInputStream();\n mmOutStream = btSocket.getOutputStream();\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTED);\n return true;\n } catch (IOException e) {\n Log.d(TAG, \"Exception creating BT socket in BT thread: \" + e.toString());\n btDevice = null;\n return false;\n }\n }", "private void openConnection () {\n String[] labels = {\"Host :\", \"Port :\"};\n String[] initialValues = {\"localhost\", \"1111\"};\n StandardDialogClient openHandler = new StandardDialogClient () {\n\t@Override\n\tpublic void dialogDismissed (StandardDialog d, int code) {\n\t try {\n\t InputDialog inputD = (InputDialog)d;\n\t if (inputD.wasCancelled ()) return;\n\t String[] results = inputD.getResults ();\n\t String host = results[0];\n\t String port = results[1];\n\t TwGateway connection =\n\t (TwGateway)TwGateway.openConnection (host, port);\n\t // The following call will fail if the G2 is secure.\n\t connection.login();\n\t setConnection (connection);\n\t } catch (Exception e) {\n\t new WarningDialog (null, \"Error During Connect\", true, e.toString (), null).setVisible (true);\n\t }\n\t}\n };\t \n\n new ConnectionInputDialog (getCurrentFrame (), \"Open Connection\",\n\t\t\t\t true, labels, initialValues,\n\t\t\t\t (StandardDialogClient) openHandler).setVisible (true);\n }", "public void connect() throws QualificationTimeoutException {\n Qualification qualificator = new Qualification(config);\n connectivityStatus = ConnectivityStatus.Starting;\n try {\n qualificator.run();\n } catch (QualificationTimeoutException e) {\n connectivityStatus = ConnectivityStatus.Offline;\n throw e;\n }\n connectivityStatus = ConnectivityStatus.Connected;\n myExternalAddress = qualificator.getMappedAddress();\n Inet6Address teredoPrefix = qualificator.getTeredoPrefix();\n myTeredoAddress = new TeredoAddress(teredoPrefix,\n config.getServerIp(),\n myExternalAddress);\n coneNat = qualificator.isConeNat();\n }", "private void connectToRoom(String appKey, String appSecret) {\n initializeSkylinkConnection();\n\n // Obtaining the Skylink connection string locally.\n // In a production environment the connection string should be given\n // by an entity external to the App,\n // such as an App server that holds the Skylink App secret.\n // This is to avoid keeping the App secret within the application\n String skylinkConnectionString = Utils.\n getSkylinkConnectionString(ROOM_NAME,\n appKey,\n appSecret, new Date(),\n SkylinkConnection\n .DEFAULT_DURATION);\n\n // The skylinkConnectionString should not be logged in production,\n // as it contains potentially sensitive information like the Skylink App key.\n\n boolean connectFailed;\n connectFailed = !skylinkConnection.connectToRoom(skylinkConnectionString, MY_USER_NAME);\n if (connectFailed) {\n String error = \"Unable to connect to Room! Rotate device to try again later.\";\n Toast.makeText(parentActivity, error, Toast.LENGTH_LONG).show();\n Log.e(TAG, error);\n return;\n }\n\n // Initialize and use the Audio router to switch between headphone and headset\n AudioRouter.startAudioRouting(parentActivity);\n }", "public void connectSSH() throws Exception{\n\t log.info(\"Trying to connect to the device \"+deviceIP+\" via SSH ....\\n\");\n\t try{\n\t\t session = jsch.getSession(deviceName, deviceIP);\n\t\t session.setPassword(devicePassword);\n\t\t session.setConfig(\"StrictHostKeyChecking\", \"no\");\n\t\t session.connect(60 * 1000); \n\t\t if(session.isConnected())\n\t\t \tlog.info(\"Successfully connected to device \"+deviceIP+\"\\n\");\n\t\t else{\n\t\t \tlog.error(\"Unable to connect to device \"+deviceIP+\" possibly because of wrong passowrd or username\\n\");\n\t\t \tthrow new Exception(\"UnableToConnectToTheDeviceBecauseOfInvalidUsernameOrPassword\");\n\t\t }\n\t\t \n\t }catch(Exception e){\n\t\t log.error(\"Unable to connect to the device \"+deviceIP+\"\\n\");\n\t\t throw new Exception(\"UnableToConnectToTheDevice\");\n\t }\n }", "void onConnectedAsServer(String deviceName);", "private void connect()\r\n\t{\r\n\t\tString remoteHostName = txtComputerName.getText();\r\n\t\tint remoteHostPort = Integer.parseInt(txtPort.getText());\r\n\t\tif (remoteHostName == null || remoteHostName.equals(\"\"))\r\n\t\t{\r\n\t\t\twriteLine(\"Enter a Computer Name\", 0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (remoteHostPort <= 0)\r\n\t\t\t{\r\n\t\t\t\twriteLine(\"Enter a Port\", 0);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// we can now connect\r\n\t\t\t\t// set our cursor to notify the user that they might need to\r\n\t\t\t\t// wait\r\n\t\t\t\twriteLine(\"Connecting to: \" + remoteHostName + \" : \"\r\n\t\t\t\t\t\t+ remoteHostPort, 0);\r\n\t\t\t\tthis.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\r\n\t\t\t\t// lets try to connect to the remote server\r\n\r\n\t\t\t\ttheSocket = new CommSocket(remoteHostName, remoteHostPort);\r\n\r\n\t\t\t\tif (theSocket.connect())\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\r\n\t\t\t\t\t\t\t\"We are successfuly connected to: \"\r\n\t\t\t\t\t\t\t\t\t+ theSocket.getRemoteHostIP(), 0);\r\n\t\t\t\t\twriteLine(\"On Port: \" + theSocket.getRemoteHostPort(), 0);\r\n\t\t\t\t\trunning = true;\r\n\t\t\t\t\t// socketListener();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"We failed to connect!\", 0);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setCursor(Cursor\r\n\t\t\t\t\t\t.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void connectionFailed() {\n // Send a failure message back to the Activity\n Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);\n Bundle bundle = new Bundle();\n bundle.putString(LOG, \"Unable to connect device\");\n msg.setData(bundle);\n handler.sendMessage(msg);\n\n // Start the service over to restart listening mode\n // BluetoothSerialServer.this.start();\n }", "public BluetoothDeviceSocketConnection(BluetoothDevice device) {\n this.device = device;\n }", "protected void connect(){\n MediaBrowserCompat mediaBrowser = mediaBrowserProvider.getMediaBrowser();\n if (mediaBrowser.isConnected()) {\n onConnected();\n }\n }", "@Test\n public void findDevice() throws Exception {\n MockUpnpService upnpService = new MockUpnpService();\n LocalDevice device = SampleData.createLocalDevice();\n upnpService.getRegistry().addDevice(device);\n\n UDN udn = device.getIdentity().getUdn();\n\n Registry registry = upnpService.getRegistry(); // DOC: FIND_ROOT_UDN\n Device foundDevice = registry.getDevice(udn, true);\n\n assertEquals(foundDevice.getIdentity().getUdn(), udn); // DOC: FIND_ROOT_UDN\n\n LocalDevice localDevice = registry.getLocalDevice(udn, true); // DOC: FIND_LOCAL_DEVICE\n assertEquals(localDevice.getIdentity().getUdn(), udn);\n\n SampleDeviceRootLocal.assertLocalResourcesMatch(\n upnpService.getConfiguration().getNamespace().getResources(device)\n );\n }", "private boolean connect() {\n final Intent intent = new Intent(ACTION_MEDIA_SESSION_COMPAT);\n intent.setComponent(MEDIA_SESSION_COMPAT_PROVIDER_SERVICE);\n\n boolean bound = false;\n try {\n bound = mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);\n } catch (Exception ex) {\n Log.e(TAG, \"Failed binding to the MediaSessionCompatProviderService of the \"\n + \"service app\");\n }\n\n if (bound) {\n try {\n mCountDownLatch.await(PROVIDER_SERVICE_CONNECTION_TIMEOUT_MS,\n TimeUnit.MILLISECONDS);\n } catch (InterruptedException ex) {\n Log.e(TAG, \"InterruptedException while waiting for onServiceConnected.\", ex);\n }\n }\n return mBinder != null;\n }", "public boolean connect(final String address)\n {\n Log.d(TAG, \"mBLEadapter: \" + mBLEadapter + \", BLE addr: \" + address +\n \", mBluetoothGattConnected: \" + mBluetoothGattConnected );\n\n if ((mBLEadapter == null) || (address == null) /*|| (mBluetoothGattConnected==false)*/)\n {\n Log.w(TAG, \"BluetoothAdapter not initialized or unspecified address.\");\n return false;\n }\n\n //Log.d(TAG, \"Trying to create a new connection. \" + address + \": mBLEgatt: \" + mBLEgatt.toString());\n\n if ( !address.equalsIgnoreCase(\"\") &&\n /*(address.equalsIgnoreCase(deviceAddress)) &&*/\n (mBLEgatt != null) )\n {\n Log.d(TAG, \"Trying to use an existing mBLEgatt for connection.\");\n if (mBLEgatt.connect()) return true;\n else return false;\n }\n\n Log.d(TAG, \"service, connect(), address: \" + address);\n\n\n if (!address.equalsIgnoreCase(\"\"))\n {\n final BluetoothDevice device = mBLEadapter.getRemoteDevice(address);\n if (device == null) {\n Log.w(TAG, \"Device not found, Unable to connect.\");\n return false;\n }\n mBLEgatt = device.connectGatt(this, false, gattCallback); // real to connect BLE device.\n deviceAddress = address;\n return true;\n }\n else\n {\n Log.w(TAG, \"Device addr:\" + address);\n return false;\n }\n\n }", "private void checkConnection(){\n NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();\n\n // if activeNetwork is not null, and a network connection is detected,\n // isConnected is true\n boolean isConnected = activeNetwork != null &&\n activeNetwork.isConnectedOrConnecting();\n\n // prepare output to indicate connection status\n String message = isConnected ? \"Connection Detected!\" : \"No Connection Detected!\";\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void testIfConnected() {\n }", "public boolean connect() {\n if (this.connection == null) {\n this.connection = JdbcUiUtil.connect(getSource(), getPassword());\n if (this.connection == null) {\n return false;\n }\n fireStateChanged();\n }\n return true;\n }", "protected abstract void onConnect();", "public boolean isConnecting ()\r\n\t{\r\n\t\tsynchronized (this)\r\n\t\t{\r\n\t\t\treturn _roboCOM!=null;\r\n\t\t}\r\n\t}" ]
[ "0.7423554", "0.71987605", "0.7073695", "0.69437283", "0.6904717", "0.6844241", "0.67548835", "0.6751089", "0.6734193", "0.67207026", "0.671776", "0.66983163", "0.6697614", "0.6695905", "0.6685922", "0.6662232", "0.66602176", "0.6648756", "0.66459024", "0.6611971", "0.6570254", "0.6556151", "0.65353453", "0.65021425", "0.6496833", "0.64714015", "0.64678633", "0.64642215", "0.6462238", "0.6459655", "0.64374906", "0.64096254", "0.6393393", "0.6390889", "0.6390331", "0.6378496", "0.63484335", "0.6317417", "0.6302322", "0.628204", "0.6254028", "0.6253351", "0.6250595", "0.62481546", "0.6232527", "0.62286836", "0.6228412", "0.6212557", "0.6207846", "0.6200103", "0.61984503", "0.6185563", "0.6181918", "0.6176113", "0.61756885", "0.6153646", "0.6143864", "0.6111914", "0.61067337", "0.610503", "0.61031777", "0.6101873", "0.60986835", "0.6093975", "0.6082157", "0.60742044", "0.60690886", "0.6063959", "0.6058988", "0.6058804", "0.6058768", "0.605179", "0.6038923", "0.60359544", "0.6031094", "0.6028794", "0.6022429", "0.60135835", "0.60060877", "0.6005937", "0.59963095", "0.59896976", "0.59895104", "0.59860784", "0.5985047", "0.59779817", "0.59737015", "0.59661055", "0.59582627", "0.59558755", "0.5955697", "0.595154", "0.5950421", "0.5940138", "0.5937759", "0.5932049", "0.5925587", "0.59109604", "0.5901979", "0.5898319", "0.58869743" ]
0.0
-1
Must be called after startBLEService
private void initializeBLEService(IBinder service) { mBluetoothLeService = ((BluetoothLeService.LocalBinder) service).getService(); if (!mBluetoothLeService.initialize()) { Log.e(TAG, "Unable to initialize Bluetooth"); } mActivity.registerReceiver(mGattUpdateReceiver, makeGattUpdateIntentFilter()); // Automatically connects to the device upon successful start-up initialization. // mActivity.runOnUiThread(new Runnable() { // @Override // public void run() { // mBluetoothLeService.connect(mDeviceAddress); // // } // }); mBluetoothLeService.connect(mDeviceAddress); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}", "@Override\n public void onServiceConnected(ComponentName componentName, IBinder service) {\n mNanoBLEService = ((NanoBLEService.LocalBinder) service).getService();\n\n //initialize bluetooth, if BLE is not available, then finish\n if (!mNanoBLEService.initialize()) {\n finish();\n }\n\n //Start scanning for devices that match DEVICE_NAME\n final BluetoothManager bluetoothManager =\n (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();\n if(mBluetoothLeScanner == null){\n finish();\n Toast.makeText(NewScanActivity.this, \"Please ensure Bluetooth is enabled and try again\", Toast.LENGTH_SHORT).show();\n }\n mHandler = new Handler();\n if (SettingsManager.getStringPref(mContext, SettingsManager.SharedPreferencesKeys.preferredDevice, null) != null) {\n preferredDevice = SettingsManager.getStringPref(mContext, SettingsManager.SharedPreferencesKeys.preferredDevice, null);\n scanPreferredLeDevice(true);\n } else {\n scanLeDevice(true);\n }\n }", "private void setupBTService(){\n btService = new BluetoothService(this, mHandler);\n\n // Initialize the buffer for outgoing messages\n outStringBuffer = new StringBuffer(\"\");\n\t}", "void bytetest() {\n byte[] myByteArray = new byte[256];\n for (int i = 0; i < 256; ++i) {\n myByteArray[i] = (byte)i;\n }\n\n Intent writeIntent = new Intent(BGXpressService.ACTION_WRITE_SERIAL_BIN_DATA);\n writeIntent.putExtra(\"value\", myByteArray);\n writeIntent.setClass(mContext, BGXpressService.class);\n writeIntent.putExtra(\"DeviceAddress\", mDeviceAddress);\n startService(writeIntent);\n }", "@Override\n public void run()\n {\n mBluetoothLeService\n .readCharacteristic(gattCharacteristic);\n }", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\t\tif (!isOperationDone) {\r\n\t\t\t\t\t\t\tMessage msg = mHandler.obtainMessage(BleService.INIT_PASSWORD);\r\n\t\t\t\t\t\t\t/*Bundle data = new Bundle();\r\n\t\t\t\t\t\t\tdata.putString(BleService.RESULT, BleService.FAIL);\r\n\t\t\t\t\t\t\tmsg.setData(data);*/\r\n\t\t\t\t\t\t\tmsg.sendToTarget();\r\n\t\t\t\t\t\t}\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}", "@Override\n public IBinder onBind(Intent intent) {\n\n AppConstants.RebootHF_reader = false;\n if (mBluetoothLeService != null) {\n final boolean result = mBluetoothLeService.connect(mDeviceAddress);\n Log.d(TAG, \"Connect request result=\" + result);\n }\n\n\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "@Override\n\tprotected void handleServiceConnected()\n\t{\n\t\t\n\t}", "@Override\n public void onServicesDiscovered(BluetoothGatt gatt, int status) {\n Log.i(\"onServicesDiscovered\", \"Obtaining device service information ......\");\n if (status == BluetoothGatt.GATT_SUCCESS) {\n try{\n String messages = \"-------------- (\"+Periphery.getAddress()+\")Service Services information : --------------------\\n\";\n List<BluetoothGattService> serviceList = gatt.getServices();\n messages += \"Total:\"+serviceList.size()+\"\\n\";\n for (int i = 0; i < serviceList.size(); i++) {\n BluetoothGattService theService = serviceList.get(i);\n BLEGattServiceList.add(new BLEGattService(theService));\n\n String serviceName = theService.getUuid().toString();\n String msg = \"---- Service UUID:\"+serviceName+\" -----\\n\";\n // Each Service contains multiple features\n List<BluetoothGattCharacteristic> characterList = theService.getCharacteristics();\n msg += \"Characteristic UUID List:\\n\";\n for (int j = 0; j < characterList.size(); j++) {\n BluetoothGattCharacteristic theCharacter = characterList.get(j);\n msg += \"(\"+(j+1)+\"):\"+theCharacter.getUuid()+\"\\n\";\n //msg += \" --> Value:\"+ StringConvertUtil.bytesToHexString(theCharacter.getValue())+\"\\n\";\n }\n msg += \"\\n\\n\";\n messages += msg;\n }\n messages += \"-------------- (\"+Periphery.getAddress()+\")--------------------\\n\";\n Log.i(\"onServicesDiscovered\", messages);\n }catch (Exception ex){\n Log.e(\"onServicesDiscovered\", \"Exception:\" + ex.toString());\n }\n }\n if (_PeripheryBluetoothServiceCallBack!=null){\n _PeripheryBluetoothServiceCallBack.OnServicesed(BLEGattServiceList);\n }\n super.onServicesDiscovered(gatt, status);\n }", "void doBindService() {\n\t\tbindService(new Intent(this, eidService.class), mConnection, Context.BIND_AUTO_CREATE);\n//\t\tLog.i(\"Convert\", \"At doBind2.\");\n\n\t\tmIsBound = true;\n\t\n\t\tif (mService != null) {\n//\t\t\tLog.i(\"Convert\", \"At doBind3.\");\n\t\t\ttry {\n\t\t\t\t//Request status update\n\t\t\t\tMessage msg = Message.obtain(null, eidService.MSG_UPDATE_STATUS, 0, 0);\n\t\t\t\tmsg.replyTo = mMessenger;\n\t\t\t\tmService.send(msg);\n\t\t\t\tLog.i(\"Convert\", \"At doBind4.\");\n\t\t\t\t//Request full log from service.\n\t\t\t\tmsg = Message.obtain(null, eidService.MSG_UPDATE_LOG_FULL, 0, 0);\n\t\t\t\tmService.send(msg);\n\t\t\t} catch (RemoteException e) {}\n\t\t}\n//\t\tLog.i(\"Convert\", \"At doBind5.\");\n\t}", "public void startConnection(){\n startBTConnection(mBTDevice,MY_UUID_INSECURE);\n }", "void doAccelBindService() {\n\t\tbindService(accelIntentDelay, accelConnection, Context.BIND_AUTO_CREATE);\n\t\taccelIsBound = true;\n\t}", "@Override\n public int onStartCommand(Intent intent, int flags, int startID)\n {\n // Initial Check of Action Packet to make sure it contains the device address and Action\n if (intent == null || intent.getAction() == null) {\n Log.w(TAG, \"Invalid Action Packet Received\");\n return INTENT_RETURN_POLICY;\n }\n\n // Action to be performed on the TexTronics Device\n Action action = Action.getAction(intent.getAction());\n\n\n // String deviceAddress = intent.getStringExtra(BluetoothLeConnectionService.INTENT_DEVICE);\n // Find out the exercise mode (i.e what type of data we are collecting)\n TexTronicsDevice device = mTexTronicsList.get(deviceAddress);\n// ExerciseMode exerciseMode1 = null;\n// if(device != null)\n// exerciseMode1 = device.getExerciseMode();\n\n // Make sure it is a valid Action\n if(action == null) {\n Log.w(TAG, \"Invalid Action Packet Received\");\n return INTENT_RETURN_POLICY;\n }\n\n String exerciseID = (String) intent.getSerializableExtra(EXTRA_EX_ID);\n String routineID = (String) intent.getSerializableExtra(EXTRA_ROUTINE_ID);\n\n\n // Device Address of the BLE Device corresponding to this Action Packet\n String deviceAddress = intent.getStringExtra(EXTRA_DEVICE);\n\n\n // Execute Action Packet (this can be done with multi-threading to be able to Service multiple Action Packets at once)\n switch (action)\n {\n case connect:\n {\n // Attempt to connect to BLE Device (Device Type and Transmitting Mode should be obtained during scan)\n if (!intent.hasExtra(EXTRA_TYPE) || !intent.hasExtra(EXTRA_MODE))\n {\n Log.w(TAG, \"Invalid connect Action Packet Received\");\n return INTENT_RETURN_POLICY;\n }\n // Get all connection info from the intent\n ExerciseMode exerciseMode = (ExerciseMode) intent.getSerializableExtra(EXTRA_MODE);\n DeviceType deviceType = (DeviceType) intent.getSerializableExtra(EXTRA_TYPE);\n Choice choice = (Choice) intent.getSerializableExtra(EXTRA_CHOICE);\n\n // Use data to connect to device\n connect(deviceAddress, exerciseMode, deviceType, choice, exerciseID, routineID);\n //transmit_flags();\n create_datalog(deviceAddress, MainActivity.exercise_mode, deviceType, choice, exerciseID, routineID);\n\n // publish(deviceAddress);\n //\n }\n break;\n case disconnect:\n // Attempt to disconnect from a currently connected BLE Device\n disconnect(deviceAddress);\n break;\n case publish:\n\n //connect(deviceAddress, exerciseMode, deviceType, choice, exerciseID, routineID);\n create_datalog(deviceAddress, MainActivity.exercise_mode, deviceType, choice, exerciseID, routineID);\n publish(deviceAddress);\n\n // transmit_flags();\n\n\n break;\n case stop:\n // Disconnect from each device, then stop services\n if(MainActivity.getmDeviceAddressList() != null &&\n MainActivity.getmDeviceAddressList().length != 0)\n {\n for(String address : MainActivity.getmDeviceAddressList())\n disconnect(address);\n }\n stopSelf();\n }\n\n return INTENT_RETURN_POLICY;\n }", "private Bluetooth() {}", "private void initService() {\n \tlog_d( \"initService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return;\n // Initialize the BluetoothChatService to perform bluetooth connections\n if ( mBluetoothService == null ) {\n log_d( \"new BluetoothService\" );\n \t\tmBluetoothService = new BluetoothService( mContext );\n\t }\n\t\tif ( mBluetoothService != null ) {\n log_d( \"set Handler\" );\n \t\tmBluetoothService.setHandler( sendHandler );\n\t }\t\t\n }", "public void onCreate() {\n\t\tSystem.out.println(\"This service is called!\");\n\t\tmyBluetoothAdapter= BluetoothAdapter.getDefaultAdapter();\n\t\tmyBluetoothAdapter.enable();\n\t\tSystemClock.sleep(5000);\n\t\tif (myBluetoothAdapter.isEnabled()){\n\t\t\tSystem.out.println(\"BT is enabled...\");\n\t\t\tdiscover = myBluetoothAdapter.startDiscovery();\n\t\t}\n\t\tSystem.out.println(myBluetoothAdapter.getScanMode());\n\t\t\n\t\tSystem.out.println(\"Discovering: \"+myBluetoothAdapter.isDiscovering());\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));\n\t\tIntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n\t\tIntentFilter filter2 = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\n\t\tthis.registerReceiver(bReceiver, filter1);\n\t\tthis.registerReceiver(bReceiver, filter2);\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED));\n\t}", "@Override\n public void onScanFailed() {\n Log.d(TAG, \"Scan Failed\");\n BluetoothManipulator.startScan();\n }", "@Override\n public void run() {\n boolean isOk = mBluetoothLeService.connect(getDeviceName());// 根据地址通过后台services去连接BLE蓝牙\n L.d(reTryCount+\" -----connect ok ? >\"+ isOk);\n if(!isOk) {\n reTryConected();\n }\n }", "@Override\n public void onResume() {\n super.onResume();\n mAbleBLEService = AbleDeviceScanActivity.getmBluetoothLeService();\n setScanButton();\n }", "public void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\tmBoundService = ((LocalService.LocalBinder) service).getService();\r\n\r\n\t\t\t// Wenn während des Setups der Service noch nicht fertig geladen\r\n\t\t\t// ist, wird solange Warte-Overlay angezeigt\r\n\t\t\t// Wenn der Service fertig ist wird das Overlay ausgeblendet\r\n\r\n\t\t\t// if (OverlayActivity.isCreated) {\r\n\t\t\t// OverlayActivity.getInstance().dismiss();\r\n\t\t\t// }\r\n\t\t\tSetupSearchDevicesFragment fragment = (SetupSearchDevicesFragment) getFragmentById(\"SetupSearchDevicesFragment\");\r\n\t\t\tif (fragment.isVisible()) {\r\n\t\t\t\tfragment.initViewBluetooth();\r\n\t\t\t}\r\n\r\n\t\t\t// Tell the user about this for our demo.\r\n\t\t\tLog.i(TAG, \"Service connected with app...\");\r\n\t\t\t// Toast.makeText(MainActivity.this, \"Service connected.\", Toast.LENGTH_SHORT).show();\r\n\r\n\t\t\t// Verbinde mit gespeichertem Device (falls noch keine Verbindung\r\n\t\t\t// besteht)\r\n\t\t\tif (mSharedPrefs.getConnectivityType() == 1) { // BEI BT\r\n\r\n\t\t\t\tfinal ConnectionInterface connection = mBoundService.getConnection();\r\n\t\t\t\tif (connection != null) {\r\n\t\t\t\t\tif (!connection.isConnected()) {\r\n\r\n\t\t\t\t\t\t// OnConnectedListener\r\n\t\t\t\t\t\tconnection.setOnConnectedListener(new OnConnectedListener() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void onConnectedListener(String deviceName) {\r\n\r\n\t\t\t\t\t\t\t\tconnection.registerDisconnectHandler();\r\n\r\n\t\t\t\t\t\t\t\tif (mSharedPrefs.getDeviceMode() == 1) { // ELTERN\r\n\t\t\t\t\t\t\t\t\t// HELLO Nachricht senden\r\n\t\t\t\t\t\t\t\t\tString msg = mContext.getString(R.string.BABYFON_MSG_CONNECTION_HELLO) + \";\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ mSharedPrefs.getHostAddress() + \";\" + mSharedPrefs.getPassword();\r\n\t\t\t\t\t\t\t\t\tconnection.sendMessage(msg);\r\n\r\n\t\t\t\t\t\t\t\t\tmSharedPrefs.setRemoteOnlineState(true);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif (mSharedPrefs.getDeviceMode() == 1) { // ELTERN\r\n\t\t\t\t\t\t\tif (mSharedPrefs.getRemoteAddress() != null) { // Gespeichertes Gerät\r\n\t\t\t\t\t\t\t\t// Verbinde\r\n\t\t\t\t\t\t\t\tmBoundService.connectTo(mSharedPrefs.getRemoteAddress());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (mSharedPrefs.getDeviceMode() == 0) { // BABY\r\n\t\t\t\t\t\t\t// Warte auf Verbindung\r\n\t\t\t\t\t\t\tmBoundService.startServer();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}", "private void initService() {\r\n\t}", "@Override\n public void onConnectionStateChange(BluetoothGatt gatt, int status,\n int newState) {\n Log.i(\"onConnectionStateChange\", \"The connection status has changed. status:\" + status + \" newState:\" + newState + \"\");\n try {\n if(status == BluetoothGatt.GATT_SUCCESS) {\n switch (newState) {\n // Has been connected to the device\n case BluetoothProfile.STATE_CONNECTED:\n Log.i(\"onConnectionStateChange\", \"Has been connected to the device\");\n if(_ConnectionStatus == ConnectionStatus.Connecting) {\n _ConnectionStatus = ConnectionStatus.Connected;\n try {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnConnected();\n if (gatt.getDevice().getBondState() == BluetoothDevice.BOND_BONDED){\n //Url : https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java\n Log.i(\"onConnectionStateChange\",\"Waiting 1600 ms for a possible Service Changed indication...\");\n // Connection successfully sleep 1600ms, the connection success rate will increase\n Thread.sleep(1600);\n }\n } catch (Exception e){}\n // Discover service\n gatt.discoverServices();\n }\n break;\n // The connection has been disconnected\n case BluetoothProfile.STATE_DISCONNECTED:\n Log.i(\"onConnectionStateChange\", \"The connection has been disconnected\");\n if(_ConnectionStatus == ConnectionStatus.Connected) {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n Close();\n _ConnectionStatus = ConnectionStatus.DisConnected;\n break;\n /*case BluetoothProfile.STATE_CONNECTING:\n Log.i(\"onConnectionStateChange\", \"Connecting ...\");\n _ConnectionStatus = ConnectionStatus.Connecting;\n break;\n case BluetoothProfile.STATE_DISCONNECTING:\n Log.i(\"onConnectionStateChange\", \"Disconnecting ...\");\n _ConnectionStatus = ConnectionStatus.DisConnecting;\n break;*/\n default:\n Log.e(\"onConnectionStateChange\", \"newState:\" + newState);\n break;\n }\n }else {\n Log.i(\"onConnectionStateChange\", \"GATT error\");\n Close();\n if(_ConnectionStatus == ConnectionStatus.Connecting\n && _Timeout - (new Date().getTime() - _ConnectStartTime.getTime()) > 0) {\n Log.i(\"Connect\", \"Gatt Error! Try to reconnect (\"+_ConnectIndex+\")...\");\n _ConnectionStatus = ConnectionStatus.DisConnected;\n Connect(); // Connect\n }else {\n _ConnectionStatus = ConnectionStatus.DisConnected;\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n }\n }catch (Exception ex){\n Log.e(\"onConnectionStateChange\", ex.toString());\n }\n super.onConnectionStateChange(gatt, status, newState);\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tif (HomeView.ble_status == 0\r\n\t\t\t\t\t\t\t\t\t\t|| HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tscanLeDevice(true);\r\n\t\t\t\t\t\t\t\t\t\tbluetoothSwitch = true;\r\n\t\t\t\t\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\twait_time++;\r\n\t\t\t\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\t\t\t\tsetUI();\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\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}", "@Override\n public void onScanFinished() {\n Log.d(TAG, \"Scan Finished\");\n if(dicePlus == null){\n BluetoothManipulator.startScan();\n }\n }", "@Override\n public void onBluetoothDeviceFound(BluetoothDevice btDevice) {\n }", "private void initBLESetup() {\n // Initializes Bluetooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n //Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.\n //Obtaining dynamic permissions from the user\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { //23\n if (this.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"This app needs location access.\");\n builder.setMessage(\"Please grant location access to this app.\");\n builder.setPositiveButton(android.R.string.ok, null);\n builder.setOnDismissListener(new DialogInterface.OnDismissListener() {\n public void onDismiss(DialogInterface dialog) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);\n }\n\n });// See onRequestPermissionsResult callback method for negative behavior\n builder.show();\n }\n }\n // Create callback methods\n if (Build.VERSION.SDK_INT >= 21) //LOLLIPOP\n newerVersionScanCallback = new ScanCallback() {\n @Override\n public void onScanResult(int callbackType, ScanResult result) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n BluetoothDevice btDevice = result.getDevice();\n ScanRecord mScanRecord = result.getScanRecord();\n int rssi = result.getRssi();\n// Log.i(TAG, \"Address: \"+ btDevice.getAddress());\n// Log.i(TAG, \"TX Power Level: \" + result.getScanRecord().getTxPowerLevel());\n// Log.i(TAG, \"RSSI in DBm: \" + rssi);\n// Log.i(TAG, \"Manufacturer data: \"+ mScanRecord.getManufacturerSpecificData());\n// Log.i(TAG, \"device name: \"+ mScanRecord.getDeviceName());\n// Log.i(TAG, \"Advertise flag: \"+ mScanRecord.getAdvertiseFlags());\n// Log.i(TAG, \"service uuids: \"+ mScanRecord.getServiceUuids());\n// Log.i(TAG, \"Service data: \"+ mScanRecord.getServiceData());\n byte[] recordBytes = mScanRecord.getBytes();\n\n iBeacon ib = parseBLERecord(recordBytes);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n }\n\n @Override\n public void onScanFailed(int errorCode) {\n Log.e(\"Scan Failed\", \"Error Code: \" + errorCode);\n }\n };\n else\n olderVersionScanCallback =\n new BluetoothAdapter.LeScanCallback() {\n @Override\n public void onLeScan(final BluetoothDevice device, final int rssi,\n final byte[] scanRecord) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Log.i(\"onLeScan\", device.toString());\n\n iBeacon ib = parseBLERecord(scanRecord);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n });\n }\n };\n }", "private boolean takeBertyService() {\n Log.v(TAG, String.format(\"takeBertyService: called for device %s\", getMACAddress()));\n if (getBertyService() != null) {\n Log.d(TAG, String.format(\"Berty service already found for device %s\", getMACAddress()));\n return true;\n }\n\n setBertyService(getBluetoothGatt().getService(GattServer.SERVICE_UUID));\n\n if (getBertyService() == null) {\n Log.i(TAG, String.format(\"Berty service not found for device %s\", getMACAddress()));\n return false;\n }\n\n Log.d(TAG, String.format(\"Berty service found for device %s\", getMACAddress()));\n return true;\n }", "private void setupApp() {\n Log.d(TAG, \"setupApp()\");\n\n // Initialize the BluetoothService to perform bluetooth connections\n mBTService = new BTService(getActivity(), mHandler);\n\n // Initialize the buffer for outgoing messages\n mOutStringBuffer = new StringBuffer(\"\");\n }", "@Override\n public void onConnectionFailed(Die die, Exception e) {\n Log.d(TAG, \"Connection failed\", e);\n dicePlus = null;\n BluetoothManipulator.startScan();\n }", "DiscoverServicesCommand(BluetoothGatt mBluetoothGatt) {\n this.mBluetoothGatt = mBluetoothGatt;\n }", "@SuppressLint(\"NewApi\")\n @Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n bleService = ((BleService.LocalBinder) service).getService();\n if (!bleService.init()) {\n finish();\n }\n bleService.connect(Home_Fragment.Device_Address);\n mpd = ProgressDialog.show(Dialog_Activity.this, null, \"正在连接设备...\");\n Log.i(\"DeviceConnect\", \"onServiceConnected: \");\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n//\t\t\t\tdevAddr = devices.get(position).split(\"\\\\|\")[1];\n//\t\t\t\tbtAdapt.cancelDiscovery();\n//\t\t\t\t\n//\t\t\t\tbtSocket = btAdapt.getRemoteDevice(devAddr).createRfcommSocketToServiceRecord(uuid);\n//\t\t\t\tbtSocket.connect();Log.e(tag, \"connected\");\n\t\t\t\tInetAddress severInetAddr=InetAddress.getByName(\"120.105.129.108\");\n\t\t\t\tWifisocket = new Socket(severInetAddr, 8101);\n\t\t\t\t\n\t\t\t\tsynchronized (this) {\n//\t\t\t\t\tbtIn = btSocket.getInputStream();\n//\t\t\t\t\tbtOut = btSocket.getOutputStream();\n\t\t\t\t\tbtIn = Wifisocket.getInputStream();\n\t\t\t\t\tbtOut = Wifisocket.getOutputStream();\n\t\t\t\t\tLog.e(tag, \"connected\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tThread.sleep(100);\n\t\t\t\tsetUpAsForeground(\"Wifi已連線\");\n\t\t\t} catch( IOException | InterruptedException e ){\n\t\t\t\te.printStackTrace();\n\t\t\t\ttry{\n//\t\t\t\t\tbtSocket.close();\n//\t\t\t\t\tWifisocket.close();\n\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\tsetUpAsForeground(\"Wifi未連線\");\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t} catch(InterruptedException e1){\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tLog.i(\"exiconne\", \"bluetoohservice bye!;\");\n\t\t\t\t}\n//\t\t\t\tbtSocket = null;\n\t\t\t\tWifisocket = null;\n\t\t\t\tmBTState = BTState.stopped;\n\t\t\t\tBluetoothConnect.mBTstate = BTstate.opened;\n\t\t\t}\n\n\t\t}", "public void bluetooth_setup_client()\r\n {\n\r\n\t\tIntentFilter filter = new IntentFilter();\r\n\t\tfilter.addAction(BluetoothDevice.ACTION_FOUND);\r\n\t\tfilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\r\n\t\tif(client_receiver != null) {\r\n\t\t\tLoaderActivity.m_Activity.unregisterReceiver(client_receiver);\r\n\t\t}\r\n\t\tclient_receiver = new Bluetooth_Device_Found_Revicer();\r\n\t\tLoaderActivity.m_Activity.registerReceiver(client_receiver, filter);\r\n\t\tbluetooth_adapter.startDiscovery();\r\n\t\tmessages.clear();\r\n }", "public boolean addService(BluetoothGattService service) {\n/* 60 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public interface IBlueToothService {\n\n\n boolean initialize();\n\n void function_data(byte[] data);\n\n void enable_JDY_ble(int p);\n\n\n void disconnect();\n\n /**\n * 执行指令\n * @param g\n * @param string_or_hex_data\n * @return\n */\n int command(String g, boolean string_or_hex_data);\n\n\n void Delay_ms(int ms);\n\n /**\n * 设置密码\n * @param pss\n */\n void set_APP_PASSWORD(String pss);\n\n\n boolean connect(String address);\n\n\n /**\n * 获取连接的ble设备所提供的服务列表\n * @return\n */\n List<BluetoothGattService> getSupportedGattServices();\n\n\n int get_connected_status(List<BluetoothGattService> gattServices);\n\n\n}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twait_time = 0;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tif (HomeView.ble_status == 0 || HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tscanLeDevice(true);\r\n\r\n\t\t\t\t\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbluetoothSwitch = true;\r\n\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\twait_time++;\r\n\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n\tprotected void onServiceBinded(UARTService.UARTBinder binder) {}", "@Override\n public void run() {\n scanLeDevice(false);\n }", "private void setupBluetooth() throws NullPointerException{\n if( Utils.isOS( Utils.OS.ANDROID ) ){\n \t\n // Gets bluetooth hardware from phone and makes sure that it is\n // non-null;\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n \n // If bluetooth hardware does not exist...\n if (adapter == null) {\n Log.d(TAG, \"BluetoothAdapter is is null\");\n throw new NullPointerException(\"BluetoothAdapter is null\");\n } else {\n Log.d(TAG, \"BluetoothAdapter is is non-null\");\n }\n \n bluetoothName = adapter.getName();\n \n //TODO: restart bluetooth?\n \t\n try {\n bluetoothConnectionThreads.add( new ServerThread(adapter, router, uuid) );\n } catch (NullPointerException e) {\n throw e;\n }\n if (Constants.DEBUG)\n Log.d(TAG, \"Sever Thread Created\");\n // Create a new clientThread\n bluetoothConnectionThreads.add( new ClientThread(adapter, router, uuid) );\n if (Constants.DEBUG)\n Log.d(TAG, \"Client Thread Created\");\n }\n else if( Utils.isOS( Utils.OS.WINDOWS ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.LINUX ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.OSX ) ){\n //TODO: implement this\n }\n else{\n //TODO: throw exception?\n }\n \n }", "public void service() {\n\t}", "@Override\n protected void onStarted() {\n\n super.onStarted();\n\n // No need for discovery services in Archive mode\n if (mIsArchive) return; //TODO: maybe remove this line - should be caught by the NETWORK_NONE case\n\n\n switch (mNetworkType) {\n case BabbleService.NETWORK_NONE:\n Log.i(TAG, \"NONE / Archive\");\n return;\n case BabbleService.NETWORK_WIFI:\n Log.i(TAG, \"WIFI / MDNS\");\n mAdvertiser = new MdnsAdvertiser(mGroupDescriptor, sDiscoveryPort, mAppContext);\n break;\n case BabbleService.NETWORK_P2P:\n Log.i(TAG, \"P2P\");\n mAdvertiser = P2PService.getInstance(mAppContext);\n break;\n }\n\n // mMdnsAdvertiser = new MdnsAdvertiser(mGroupDescriptor, sDiscoveryPort, mAppContext);\n\n Log.i(TAG, \"onStarted: Port \"+sDiscoveryPort);\n\n mHttpPeerDiscoveryServer = new HttpPeerDiscoveryServer(sDiscoveryPort, mBabbleNode); //TODO: use next available port?\n try {\n mHttpPeerDiscoveryServer.start();\n mAdvertiser.advertise(); // start mDNS advertising if server started\n mAdvertising = true;\n } catch (IOException ex) {\n //Probably the port is in use, we'll continue without the discovery service\n }\n }", "private void connect() {\n // after 10 seconds its connected\n new Handler().postDelayed(\n new Runnable() {\n public void run() {\n Log.d(TAG, \"Bluetooth Low Energy device is connected!!\");\n // Toast.makeText(getApplicationContext(),\"Connected!\",Toast.LENGTH_SHORT).show();\n stateService = Constants.STATE_SERVICE.CONNECTED;\n startForeground(Constants.NOTIFICATION_ID_FOREGROUND_SERVICE, prepareNotification());\n }\n }, 10000);\n\n }", "public void connect()\n {\n \tLog.d(TAG, \"connect\");\n \t\n \tif(!this.isConnected ) {\n mContext.bindService(new Intent(\"com.google.tungsten.LedService\"), mServiceConnection, \n \t\tContext.BIND_AUTO_CREATE);\n \t}\n }", "public void initBT() {\n\n\t\tStatusBox.setText(\"Connecting...\");\n\t\tLog.e(TAG, \"Connecting...\");\n\t\t\n\t\tif (D) {\n\t\t\tLog.e(TAG, \"+ ON RESUME +\");\n\t\t\tLog.e(TAG, \"+ ABOUT TO ATTEMPT CLIENT CONNECT +\");\n\t\t}\n\t\t\n\t\t//If Mac Address is null then stop this process and display message\n\t\tif(MAC_ADDRESS == \"\"){\n\t\t\tLog.e(TAG,\"No MAC Address Found...\");\n\t\t\tToast.makeText(getApplicationContext(), \"No Mac Address found. Please Enter using button.\",Toast.LENGTH_SHORT );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// When this returns, it will 'know' about the server,\n\t\t// via it's MAC address.\n\t\tBluetoothDevice device = null;\n\t\ttry {\n\t\t\tdevice = mBluetoothAdapter.getRemoteDevice(MAC_ADDRESS);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tToast.makeText(getApplicationContext(), \"NOT Valid BT MAC Address\", Toast.LENGTH_SHORT);\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\t// returns firefly e350\n\t\tLog.e(TAG, \"device name: \" + device.getName());\n\n\t\t// We need two things before we can successfully connect\n\t\t// (authentication issues aside): a MAC address, which we\n\t\t// already have, and an RFCOMM channel.\n\t\t// Because RFCOMM channels (aka ports) are limited in\n\t\t// number, Android doesn't allow you to use them directly;\n\t\t// instead you request a RFCOMM mapping based on a service\n\t\t// ID. In our case, we will use the well-known SPP Service\n\t\t// ID. This ID is in UUID (GUID to you Microsofties)\n\t\t// format. Given the UUID, Android will handle the\n\t\t// mapping for you. Generally, this will return RFCOMM 1,\n\t\t// but not always; it depends what other BlueTooth services\n\t\t// are in use on your Android device.\n\t\ttry {\n\t\t\t\n\t\t\tint currentapiVersion = android.os.Build.VERSION.SDK_INT;\n\t\t\t\n\t\t\t//RFCOMM connection varies depending on android version. Fixes bug in Gingerbread and newer where always asks for BT Pairing code.\n\t\t\tif (currentapiVersion >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android >= 2.3.3\n\t\t\t\tbtSocket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t} else if (currentapiVersion < android.os.Build.VERSION_CODES.GINGERBREAD_MR1){\n\t\t\t\t//used in android < 2.3.3\n\t\t\t\tbtSocket = device.createRfcommSocketToServiceRecord(MY_UUID);\n\t\t\t}\n\t\t\t\n\t\t\tLog.e(TAG, \"ON RESUME: Socket created!\");\n\t\t\n\t\t\n\t\t\t// Discovery may be going on, e.g., if you're running a\n\t\t\t// 'scan for devices' search from your handset's Bluetooth\n\t\t\t// settings, so we call cancelDiscovery(). It doesn't hurt\n\t\t\t// to call it, but it might hurt not to... discovery is a\n\t\t\t// heavyweight process; you don't want it in progress when\n\t\t\t// a connection attempt is made.\n\t\t\tmBluetoothAdapter.cancelDiscovery();\n\n\t\t\tmyBT = new ConnectedThread(btSocket);\n\t\t\t\n\t\t\t\n\t\t\t// don't write to the streams unless they are created\n\t\t\tif (myBT.BTconnStatus) {\n\t\t\t\t\n\t\t\t\tStatusBox.setText(\"CONNECTED\");\n\t\t\t\tLog.e(TAG, \"CONNECTED\");\n\t\t\t\t\n\t\t\t\t// ST,255 enables remote configuration forever...need this if\n\t\t\t\t// resetting\n\t\t\t\t// PIO4 is held high on powerup then toggled 3 times to reset\n\n\t\t\t\t// GPIO Commands to BT device page 15 of commands datasheet\n\t\t\t\tbyte[] cmdMode = { '$', '$', '$' };\n\t\t\t\tmyBT.write(cmdMode);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S@,8080 temp sets GPIO-7 to an output\n\t\t\t\tbyte[] cmd1 = { 'S', '@', ',', '8', '0', '8', '0', 13 };\n\n\t\t\t\t// S%,8080 perm sets GPIO-7 to an output on powerup. only done once\n\t\t\t\t// byte [] cmd1 = {'S','%',',','8','0','8','0',13};\n\n\t\t\t\tmyBT.write(cmd1);\n\t\t\t\tmyBT.run();\n\n\t\t\t\t// S&,8000 drives GPIO-7 low\n\t\t\t\t// byte [] cmd2 = {'S','^',',','8','0','0','0',13};\n\n\t\t\t\t// make it so cmd mode won't timeout even after factory reset\n\t\t\t\tbyte[] cmd3 = { 'S', 'T', ',', '2', '5', '5', 13 };\n\t\t\t\tmyBT.write(cmd3);\n\t\t\t\tmyBT.run();\n\n\t\t\t} else {\n\t\t\t\t//StatusBox.setText(\"NOT Connected\");\t\n\t\t\t\tLog.e(TAG, \"NOT Connected\");\n\t\t\t}\n\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\tif (D)\n\t\t\t\tLog.e(TAG, \"ON RESUME: Socket creation failed.\", e);\n\t\t}\n\n\t\t\n\t\t\n\t}", "private void enableBtmon() {\n System.out.println(\"Starting Btmon Service...\");\n try {\n btmonProcess = new ProcessBuilder(\"/usr/bin/btmon\").start();\n InputStreamReader inputStream = new InputStreamReader(btmonProcess.getInputStream());\n int size;\n char buffer[] = new char[1024];\n while ((size = inputStream.read(buffer, 0, 1024)) != -1) {\n // System.out.println(\" --- Read ----\");\n String data = String.valueOf(buffer, 0, size);\n processBeaconMessage(data);\n // Thread.sleep(1000);\n }\n } catch (IOException ex ) {\n ex.printStackTrace();\n } catch (Exception ex ) {\n ex.printStackTrace();\n } finally {\n if (btmonProcess != null)\n btmonProcess.destroy();\n }\n }", "@Override\r\n public void onCreate() {\n intent = new Intent(BROADCAST_ACTION);\r\n startBTService();\r\n// try{\r\n// mConnectedThread.write(\"2\".getBytes());\r\n// }catch(Exception e){\r\n//\r\n// }\r\n }", "protected void onFirstUse() {}", "@Override\n public void run() {\n super.run();\n Log.i(TAG, \"BlueTooth Start\");\n _BluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n if (_BluetoothAdapter != null){\n if(!_BluetoothAdapter.isEnabled())\n _BluetoothAdapter.enable();\n else{\n _BluetoothDevice = _BluetoothAdapter.getRemoteDevice(strAddress_BT_UART);\n if (_BluetoothDevice != null){\n Log.i(TAG, \"Starting BtConnect\");\n BtConnect BC = new BtConnect(_BluetoothDevice);\n BC.start();\n }\n }\n }\n }", "@Override\r\n public void onCreate() {\r\n Log.d(TAG, \"on service create\");\r\n }", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(1000);\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\r\n\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\tif (HomeView.ble_status == 0\r\n\t\t\t\t\t\t\t\t|| HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\t\t\t\t\t\t\twait_time = -10;\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tscanLeDevice(bluetoothSwitch);\r\n\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\t\tsetUI();\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} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twait_time++;\r\n\t\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\t\tsetUI();\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\treturn;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n public void checkBluetoothInteface() {\n if (!isConnected) {\n checkForBluetooth();\n }\n }", "void doBindService() {\n\n if (bindService(new Intent(MainActivity.this, PositionService.class),\n mConnection, Context.BIND_AUTO_CREATE)) {\n mBound = true;\n } else {\n Log.e(\"MY_APP_TAG\", \"Error: The requested service doesn't \" +\n \"exist, or this client isn't allowed access to it.\");\n }\n }", "public void onServiceConnected();", "@Override\n protected void onResume() {\n super.onResume();\n /**\n * 注册广播\n */\n registerReceiver(mGattUpdateReceiver, makeGattUpdateIntentFilter());\n if (mBluetoothLeService != null) {\n Log.e(\"a\", \"来了\");\n result = mBluetoothLeService.connect(mDeviceAddress);\n Log.e(\"a\", \"连接请求的结果=\" + result);\n\n }\n }", "@Override\n\t\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\t}", "private void checkBleSupportAndInitialize() {\n Log.d(TAG, \"checkBleSupportAndInitialize: \");\n // Use this check to determine whether BLE is supported on the device.\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.d(TAG,\"device_ble_not_supported \");\n Toast.makeText(this, R.string.device_ble_not_supported,Toast.LENGTH_SHORT).show();\n return;\n }\n // Initializes a Blue tooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n\n if (mBluetoothAdapter == null) {\n // Device does not support Blue tooth\n Log.d(TAG, \"device_ble_not_supported \");\n Toast.makeText(this,R.string.device_ble_not_supported, Toast.LENGTH_SHORT).show();\n return;\n }\n\n //打开蓝牙\n if (!mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"open bluetooth \");\n bluetoothUtils.openBluetooth();\n }\n }", "public void service_INIT(){\n }", "@Override\n protected void onResume() {\n Log.d(TAG, \"MyTracks.onResume\");\n serviceConnection.bindIfRunning();\n super.onResume();\n }", "@Override\n public void onStart(Intent intent, int startid) {\n }", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n System.out.println(\"绑定成功\");\n }", "public void InitService() {\n\t\ttry {\r\n\t\t\tgetCommManager().register(this); \r\n\t\t} catch (CommunicationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n // Synchronize against disconnecting while the service is being used in the OpenGL\n // thread or in the UI thread.\n synchronized (WiFiAugmentedRealityActivity.this) {\n try {\n TangoSupport.initialize();\n mConfig = setupTangoConfig(mTango);\n mTango.connect(mConfig);\n startupTango();\n mIsConnected = true;\n } catch (TangoOutOfDateException e) {\n Log.e(TAG, getString(R.string.exception_out_of_date), e);\n } catch (TangoErrorException e) {\n Log.e(TAG, getString(R.string.exception_tango_error), e);\n } catch (TangoInvalidException e) {\n Log.e(TAG, getString(R.string.exception_tango_invalid), e);\n }\n }\n }", "void doBindService() {\r\n\r\n bindService(new Intent(MainActivity.this, CurrentLocationUtil.class),\r\n connection, // ServiceConnection object\r\n Context.BIND_AUTO_CREATE); // Create service if not\r\n\r\n isBound = true;\r\n\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t}", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"service on create\");\n\t\tsuper.onCreate();\n\t}", "@Override\n public void gattServicesDiscovered() {\n BluetoothGattService mService = BLEService.mBluetoothGatt.getService(CapLEDConstants.CAPLED_SERVICE_UUID);\n\n mLedCharacteristic = mService.getCharacteristic(CapLEDConstants.CAPLED_LED_CHARACTERISTIC_UUID);\n mCapsenseCharacteristic = mService.getCharacteristic(CapLEDConstants.CAPLED_CAP_CHARACTERISTIC_UUID);\n mCapsenseNotification = mCapsenseCharacteristic.getDescriptor(CapLEDConstants.CAPLED_CAP_NOTIFICATION);\n\n readLedCharacteristic();\n sCapSwitch.setEnabled(true);\n }", "void onCloseBleComplete();", "@Override\r\n public void onStart(Intent intent, int startId) {\n }", "@Override\n public void run() {\n // Synchronize against disconnecting while the service is being used in the OpenGL\n // thread or in the UI thread.\n synchronized (WiFiAugmentedRealityActivity.this) {\n try {\n TangoSupport.initialize();\n mConfig = setupTangoConfig(mTango);\n mTango.connect(mConfig);\n startupTango();\n mIsConnected = true;\n } catch (TangoOutOfDateException e) {\n Log.e(TAG, getString(R.string.exception_out_of_date), e);\n } catch (TangoErrorException e) {\n Log.e(TAG, getString(R.string.exception_tango_error), e);\n } catch (TangoInvalidException e) {\n Log.e(TAG, getString(R.string.exception_tango_invalid), e);\n }\n }\n }", "@Override\r\n public void onStart() {\n super.onStart();\r\n Carteasy cs = new Carteasy();\r\n Map<String, String> data = cs.ViewData(String.valueOf(1), getApplicationContext());\r\n for (Map.Entry<String, String> entry : data.entrySet()) {\r\n //get the Id\r\n Log.d(\"Key: \",entry.getKey());\r\n Log.d(\"Value: \",entry.getValue());\r\n }\r\n if (!BTAdapter.isEnabled()) {\r\n // IT NEEDS BLUETOOTH PERMISSION\r\n // Intent to enable bluetooth, it will show the enable bluetooth\r\n // dialog\r\n Intent enableIntent = new Intent(\r\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n // this is to get a result if bluetooth was enabled or not\r\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\r\n // It will call onActivityResult method to determine if Bluetooth\r\n // was enabled or not\r\n } else {\r\n // Bluetooth is enabled\r\n }\r\n }", "@Override\r\n\tprotected void onHandleIntent(Intent intent) {\n\t\tfinal BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\r\n\t\tmBluetoothAdapter = bluetoothManager.getAdapter();\r\n\r\n\t\t// Checks if Bluetooth is supported on the device.\r\n\t\tif (mBluetoothAdapter == null) {\r\n\t\t\tLog.i(TAG, \"Bluetooth is not supported\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tLog.i(TAG, \"mBluetoothAdapter = \" + mBluetoothAdapter);\r\n\t\t}\r\n\r\n\t\t//启用蓝牙\r\n\t\t//mBluetoothAdapter.enable();\r\n\t\t//Log.i(TAG, \"mBluetoothAdapter.enable\");\r\n\t\t\r\n\t\tmBLE = new BluetoothLeClass(this);\r\n\t\t\r\n\t\tif (!mBLE.initialize()) {\r\n\t\t\tLog.e(TAG, \"Unable to initialize Bluetooth\");\r\n\t\t}\r\n\t\tLog.i(TAG, \"mBLE = e\" + mBLE);\r\n\r\n\t\t// 发现BLE终端的Service时回调\r\n\t\tmBLE.setOnServiceDiscoverListener(mOnServiceDiscover);\r\n\r\n\t\t// 收到BLE终端数据交互的事件\r\n\t\tmBLE.setOnDataAvailableListener(mOnDataAvailable);\r\n\t\t\r\n\t\t//开始扫描\r\n\t\tmBLE.scanLeDevice(true);\r\n\t\t\r\n\t\t/*\r\n\t\tMRBluetoothManage.Init(this, new MRBluetoothEvent() {\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultStatus(int result) {\r\n\t\t\t\tswitch (result) {\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_NOT_OPEN:\r\n\t\t\t\t\t//Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t\t\t//startActivityForResult(enableBtIntent, 100);\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_NOT_OPEN\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_INIT_OK:\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_INIT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_END:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_END\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_OK:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_CLOSE:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_CLOSE\");\r\n\t\t\t\t\tMRBluetoothManage.stop();\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\t//MRBluetoothManage.Init(BluetoothService.this, this);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultDevice(ArrayList<BluetoothDevice> deviceList) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultData(byte[] data) {\r\n\t\t\t\tLog.i(TAG, data.toString());\r\n\t\t\t\tbyte[] wenDuByte = new byte[2];\r\n\t\t\t\tbyte[] shiDuByte = new byte[2];\r\n\t\t\t\tbyte[] shuiFenByte = new byte[2];\r\n\t\t\t\tbyte[] ziWaiXianByte = new byte[2];\r\n\t\t\t\tSystem.arraycopy(data, 4, wenDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 6, shiDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 8, shuiFenByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 10, ziWaiXianByte, 0, 2);\r\n\t\t\t\tTestModel model = new TestModel();\r\n\t\t\t\tmodel.wenDu = BitConverter.toShort(wenDuByte);\r\n\t\t\t\tmodel.shiDu = BitConverter.toShort(shiDuByte);\r\n\t\t\t\tmodel.shuiFen = BitConverter.toShort(shuiFenByte);\r\n\t\t\t\tmodel.ziWaiXian = BitConverter.toShort(ziWaiXianByte);\r\n\t\t\t\t//Log.d(TAG, model.toString());\r\n\t\t\t\tsendData(model);\r\n\t\t\t}\r\n\t\t});\r\n\t\t*/\r\n\t}", "@Override\n public void bleState(BleState bleState) {\n switch (bleState) {\n case READY:\n Toast.makeText(ControlActivity.this, \"ble State: \" + bleState, Toast.LENGTH_SHORT).show();\n break;\n case BLUETOOTH_NOT_ENABLED:\n DialogUtil.showDialog(ControlActivity.this, R.string.service_ble_message);\n break;\n case BLUETOOTH_NOT_AVAILABLE:\n DialogUtil.showDialog(ControlActivity.this, R.string.error, R.string.ble_not_support);\n break;\n case LOCATION_SERVICES_NOT_ENABLED:\n break;\n case LOCATION_PERMISSION_NOT_GRANTED:\n DialogUtil.showDiaLogLocationPermission(ControlActivity.this);\n break;\n }\n }", "void onServiceBegin(int taskCode);", "private void initBluetooth() {\n IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n this.registerReceiver(mReceiver, filter);\n\n // Register for broadcasts when discovery has finished\n filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\n this.registerReceiver(mReceiver, filter);\n\n // Get the local Bluetooth adapter\n mBtAdapter = BluetoothAdapter.getDefaultAdapter();\n\n // Get a set of currently paired devices\n Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();\n\n // Initialize the BluetoothChatService to perform bluetooth connections\n mChatService = new BluetoothChatService(this, mHandler);\n }", "private void setupChat() {\n chatService = new BluetoothChatService(NavigationDrawerActivity.this, mHandler);\n\n }", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n TranscriptDownService.LocalBinder binder = (TranscriptDownService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "@Override\n protected void onStart() {\n\n try {\n\n executorService = Executors.newFixedThreadPool(1);\n\n cryptoAddressesNetworkServiceDatabaseFactory = new CryptoAddressesNetworkServiceDeveloperDatabaseFactory(pluginDatabaseSystem,pluginId);\n try {\n cryptoAddressesNetworkServiceDatabaseFactory.initializeDatabase();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n //DAO\n cryptoAddressesNetworkServiceDao = new CryptoAddressesNetworkServiceDao(pluginDatabaseSystem, pluginId);\n\n try {\n cryptoAddressesNetworkServiceDao.initialize();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n\n\n // change message state to process again first time\n reprocessPendingMessage();\n\n //declare a schedule to process waiting request message\n startTimer();\n\n }catch (Exception e){\n\n System.out.println(\" -- CRYPTO ADDRESS NS START ERROR \" + e.getMessage());\n e.printStackTrace();\n }\n\n\n\n\n }", "private void ensureBluetoothEnabled() {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n main.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n connectToBluetoothDevice(\"00:06:66:64:42:97\"); // Hard coded MAC of the BT-device.\n Log.i(tag, \"Connected to device!\");\n }\n }", "public void advertiseNow() {\n if (btLeAdv == null) {\r\n \tLog.v(TAG, \"btLeAdv is null!\");\r\n \tisAdvertising = false;\r\n \treturn;\r\n }\r\n\t\t\r\n\t\t// make our Base UUID the service UUID\r\n UUID serviceUUID = UUID.fromString(theBaseUUID);\r\n\t\t\r\n // make a new service\r\n theService = new BluetoothGattService(serviceUUID, BluetoothGattService.SERVICE_TYPE_PRIMARY);\r\n\t\t\r\n\t\t// loop over all the characteristics and add them to the service\r\n for (Entry<UUID, BluetoothGattCharacteristic> entry : myBGCs.entrySet()) {\r\n \t//entry.getKey();\r\n \ttheService.addCharacteristic(entry.getValue());\r\n }\r\n \r\n // make sure we're all cleared out before we add new stuff\r\n gattServices.clear();\r\n gattServiceIDs.clear();\r\n \r\n \tgattServices.add(theService);\r\n gattServiceIDs.add(new ParcelUuid(theService.getUuid()));\r\n\r\n \t// if we're already advertising, just quit here\r\n // TODO: if we get this far and advertising is already started, we may want reset everything!\r\n if(isAdvertising) return;\r\n\r\n // - calls bluetoothManager.openGattServer(activity, whatever_the_callback_is) as gattServer\r\n // --- this callback needs to override: onCharacteristicWriteRequest, onCharacteristicReadRequest,\r\n // ---- onServiceAdded, and onConnectionStateChange\r\n // then iterates over an ArrayList<BluetoothGattService> and calls .addService for each\r\n \r\n\r\n // start the gatt server and get a handle to it\r\n btGattServer = btMgr.openGattServer(thisContext, gattServerCallback);\r\n\r\n // loop over the ArrayList of BluetoothGattService(s) and add each to the gatt server \r\n for(int i = 0; i < gattServices.size(); i++) {\r\n \tbtGattServer.addService(gattServices.get(i));\r\n }\r\n \r\n\r\n // the AdvertiseData and AdvertiseSettings are both required\r\n //AdvertiseData.Builder dataBuilder = new AdvertiseData.Builder();\r\n AdvertisementData.Builder dataBuilder = new AdvertisementData.Builder();\r\n AdvertiseSettings.Builder settingsBuilder = new AdvertiseSettings.Builder();\r\n \r\n // allows us to fit in a 31 byte advertisement\r\n dataBuilder.setIncludeTxPowerLevel(false);\r\n \r\n // this is the operative call which gives the parceluuid info to our advertiser to link to our gatt server\r\n // dataBuilder.setServiceUuids(gattServiceIDs); // correspond to the advertisingServices UUIDs as ParcelUUIDs\r\n \r\n // API 5.0\r\n /*\r\n for (ParcelUuid pu: gattServiceIDs) {\r\n \tdataBuilder.addServiceUuid(pu);\r\n }\r\n */\r\n // API L\r\n dataBuilder.setServiceUuids(gattServiceIDs);\r\n \r\n // this spells FART, and right now apparently doesn't do anything\r\n byte[] serviceData = {0x46, 0x41, 0x52, 0x54}; \r\n \r\n UUID tUID = new UUID((long) 0x46, (long) 0x41);\r\n ParcelUuid serviceDataID = new ParcelUuid(tUID);\r\n \r\n // API 5.0\r\n // dataBuilder.addServiceData(serviceDataID, serviceData);\r\n \r\n // API L\r\n dataBuilder.setServiceData(serviceDataID, serviceData);\r\n \r\n // i guess we need all these things for our settings\r\n settingsBuilder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);\r\n settingsBuilder.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);\r\n \r\n // API L\r\n settingsBuilder.setType(AdvertiseSettings.ADVERTISE_TYPE_CONNECTABLE);\r\n \r\n // API 5.0 \r\n //settingsBuilder.setConnectable(true);\r\n \r\n // API L\r\n \r\n \r\n\r\n //settingsBuilder.setType(AdvertiseSettings.ADVERTISE_TYPE_CONNECTABLE);\r\n\r\n // we created this earlier with bluetoothAdapter.getBluetoothLeAdvertiser();\r\n // - looks like we also need to have an advertiseCallback\r\n // --- this needs to override onSuccess and onFailure, and really those are just for debug messages\r\n // --- but it looks like you HAVE to do this\r\n // set our boolean so we don't try to re-advertise\r\n isAdvertising = true;\r\n \r\n try {\r\n \tbtLeAdv.startAdvertising(settingsBuilder.build(), dataBuilder.build(), advertiseCallback);\r\n } catch (Exception ex) {\r\n \tisAdvertising = false;\t\r\n }\r\n \r\n\r\n\r\n\t}", "private void m6589F() {\n C1413m.f5712j = 1;\n this.f5402V = new Intent(this, RecordService.class);\n this.f5402V.putExtra(\"record_activity_type\", 101);\n this.f5403W = new C1291e(this, (C1296Ua) null);\n C0938a.m5002a(\"SR/SoundRecorder\", \"<initService> isAppForeground: \");\n try {\n if (Build.VERSION.SDK_INT >= 28) {\n startForegroundService(this.f5402V);\n } else {\n startService(this.f5402V);\n }\n } catch (Exception e) {\n C0938a.m5004b(\"SR/SoundRecorder\", \"initService\" + e);\n }\n bindService(this.f5402V, this.f5403W, 1);\n this.f5429m = true;\n m6600Q();\n m6599P();\n }", "public void startScan()\n {\n Toolbox.toast(getContext(), \"Starting scan...\");\n //------------------------------------------------------------\n // Clear the list of devices and make sure user has Bluetooth\n // turned on\n clearDeviceLists();\n if ( !Toolbox.checkBLEAdapter(bleAdapter) )\n {\n Toolbox.requestUserBluetooth(mainActivity);\n }\n else\n {\n scanLeDevice(true);\n }\n }", "@Override\n public void onStart()\n {\n }", "@Override\n protected void onStart() {\n super.onStart();\n\n if (mBangingTunesItent == null) {\n mBangingTunesItent = new Intent(this, BangingTunes.class);\n final boolean bindIndicator = bindService(mBangingTunesItent, mServiceConnection, Context.BIND_AUTO_CREATE);\n final ComponentName componentName = startService(mBangingTunesItent);\n }\n }", "@Override\r\n protected void onConnected() {\n \r\n }", "@Override\n public void start() {\n }", "@Override\n public void run() {\n UpnpService upnpService = new UpnpServiceImpl(listener);\n\n // Send a search message to all devices and services, they should respond soon\n upnpService.getControlPoint().search(new STAllHeader());\n\n // Let's wait 10 seconds for them to respond\n// System.out.println(\"Waiting 10 seconds before shutting down...\");\n try {\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n // Release all resources and advertise BYEBYE to other UPnP devices\n// System.out.println(\"Stopping Cling...\");\n upnpService.shutdown();\n\n\n }", "@Override\n public void onReceive(Context context, Intent intent)\n {\n Log.d(TAG, \"Received BLE Update\");\n // Get the MAC address and action from the intent\n String deviceAddress = intent.getStringExtra(BluetoothLeConnectionService.INTENT_DEVICE);\n String action = intent.getStringExtra(BluetoothLeConnectionService.INTENT_EXTRA);\n\n Log.d(TAG, \"Received BLE Update ACTION=====\"+ action);\n\n /*\n * The action holds what type of update we are dealing with. For each action, we\n * need to update the TT update receiver.\n */\n switch (action)\n {\n case BluetoothLeConnectionService.GATT_STATE_CONNECTING:\n TexTronicsUpdateReceiver.update(mContext, deviceAddress, TexTronicsUpdate.ble_connecting);\n break;\n case BluetoothLeConnectionService.GATT_STATE_CONNECTED:\n TexTronicsUpdateReceiver.update(mContext, deviceAddress, TexTronicsUpdate.ble_connected);\n // Once connected, we need to discover the services to find our characteristics\n mBleService.discoverServices(deviceAddress);\n\n MainActivity.CONNECTED = true;\n break;\n case BluetoothLeConnectionService.GATT_STATE_DISCONNECTING:\n TexTronicsUpdateReceiver.update(mContext, deviceAddress, TexTronicsUpdate.ble_disconnecting);\n\n // Before we disconnect, we need to publish any exercise data. Get the disconnecting device\n TexTronicsDevice disconnectingDevice = mTexTronicsList.get(deviceAddress);\n\n //TODO: DEBUG ME!!!!!\n\n // Send to Server via MQTT\n if(mMqttServiceBound && DeviceExerciseFragment.START_LOG)\n {\n try\n {\n byte[] buffer = IOUtil.readFile(disconnectingDevice.getCsvFile());\n String json = MqttConnectionService.generateJson(disconnectingDevice.getDate(),\n disconnectingDevice.getDeviceAddress(),\n Choice.toString(disconnectingDevice.getChoice()) ,\n disconnectingDevice.getExerciseID(),\n disconnectingDevice.getRoutineID(),\n new String(buffer));\n Log.d(\"SmartGlove\", \"JSON: \" + json);\n mMqttService.publishMessage(json);\n DeviceExerciseFragment.START_LOG = false;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n break;\n case BluetoothLeConnectionService.GATT_STATE_DISCONNECTED:\n TexTronicsUpdateReceiver.update(mContext, deviceAddress, TexTronicsUpdate.ble_disconnected);\n\n // It has now been disconnected and we've published the data, now we remove the device from our list\n TexTronicsDevice disconnectDevice = mTexTronicsList.get(deviceAddress);\n if(disconnectDevice == null) {\n Log.w(TAG, \"Device not Found\");\n return;\n }\n mTexTronicsList.remove(deviceAddress);\n\n MainActivity.CONNECTED = false;\n\n break;\n case BluetoothLeConnectionService.GATT_DISCOVERED_SERVICES:\n // Enable notifications on our RX characteristic which sends our data packets\n\n if(deviceAddress.equals(GattDevices.LEFT_GLOVE_ADDR)){\n BluetoothGattCharacteristic characteristic = mBleService.getCharacteristic(deviceAddress, GattServices.UART_SERVICE2, GattCharacteristics.RX_CHARACTERISTIC2);\n if (characteristic != null) {\n mBleService.enableNotifications(deviceAddress, characteristic);\n }\n }\n if(deviceAddress.equals(GattDevices.RIGHT_GLOVE_ADDR)||deviceAddress.equals(GattDevices.LEFT_SHOE_ADDR)||deviceAddress.equals(GattDevices.RIGHT_SHOE_ADDR)) {\n BluetoothGattCharacteristic characteristic = mBleService.getCharacteristic(deviceAddress, GattServices.UART_SERVICE, GattCharacteristics.RX_CHARACTERISTIC);\n if (characteristic != null) {\n mBleService.enableNotifications(deviceAddress, characteristic);\n }\n }\n\n\n// // Write to the txChar to notify the device\n// BluetoothGattCharacteristic txChar = mBleService.getCharacteristic(deviceAddress, GattServices.UART_SERVICE, GattCharacteristics.TX_CHARACTERISTIC);/**---------------------------------------------------------------------------------------------------------*/\n// /**\n// * added to sent 1 or 2 or 3 to the bluetooth device\n// */\n// if(ExerciseInstructionFragment.flag==1)\n// {mBleService.writeCharacteristic(deviceAddress, txChar, new byte[] {0x01});\n// Log.d(TAG, \"Data sent via flex\");}\n// else if(ExerciseInstructionFragment.flag==2)\n// {mBleService.writeCharacteristic(deviceAddress, txChar, new byte[] {0x02});\n// Log.d(TAG, \"Data sent via imu\");}\n// else if(ExerciseInstructionFragment.flag==3)\n// {mBleService.writeCharacteristic(deviceAddress, txChar, new byte[] {0x03});}\n//\n// /*-----------------------------------------------------------------------------------------------------------------------------------------*/\n\n break;\n case BluetoothLeConnectionService.GATT_CHARACTERISTIC_NOTIFY:\n /* Called whenever the value of our RX characteristic is changed, which\n * is equal to the sampling rate of our connected device.\n */\n UUID characterUUID = UUID.fromString(intent.getStringExtra(BluetoothLeConnectionService.INTENT_CHARACTERISTIC));\n if(characterUUID.equals(GattCharacteristics.RX_CHARACTERISTIC)||characterUUID.equals(GattCharacteristics.RX_CHARACTERISTIC2))\n {\n // Get the data packet\n Log.d(TAG, \"Data Received\");\n byte[] data = intent.getByteArrayExtra(BluetoothLeConnectionService.INTENT_DATA);\n\n // Find out the exercise mode (i.e what type of data we are collecting)\n TexTronicsDevice device = mTexTronicsList.get(deviceAddress);\n\n\n //String exerciseMode = null;\n String exerciseMode = null;\n if(device != null)\n //exerciseMode1 = device.getExerciseMode();\n exerciseMode = MainActivity.exercise_mode;\n\n if(exerciseMode != null)\n {\n try\n {\n /** alli edit - how the csv files is logged */\n /* if(exerciseMode.equals(\"Flex + Imu\")){\n device.setThumbFlex((((data[0] & 0x00FF) << 8) | ((data[1] & 0x00FF))));\n device.setIndexFlex((((data[2] & 0x00FF) << 8) | ((data[3] & 0x00FF))));\n device.setAccX(((data[4] & 0x00FF) << 8) | ((data[5] & 0x00FF)));\n device.setAccY(((data[6] & 0x00FF) << 8) | ((data[7] & 0x00FF)));\n device.setAccZ(((data[8] & 0x00FF) << 8) | ((data[9] & 0x00FF)));\n device.setGyrX(((data[10] & 0x00FF) << 8) | ((data[11] & 0x00FF)));\n device.setGyrY(((data[12] & 0x00FF) << 8) | ((data[13] & 0x00FF)));\n device.setGyrZ(((data[14] & 0x00FF) << 8) | ((data[15] & 0x00FF)));\n\n Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n\n // If in exercise, log this data to CSV file\n if(DeviceExerciseFragment.START_LOG){\n device.logData(mContext);\n } else {\n Log.w(TAG, \"Invalid Data Packet\");\n return;\n }\n }*/\n// else if(exerciseMode.equals(\"Flex Only\")){\n// Log.e(\"MODE:::--\" ,exerciseMode);\n// device.setThumbFlex((((data[1] & 0x00FF) << 8) | ((data[0] & 0x00FF))));\n// device.setIndexFlex((((data[3] & 0x00FF) << 8) | ((data[2] & 0x00FF))));\n// device.setMiddleFlex((((data[5] & 0x00FF) << 8) | ((data[4] & 0x00FF))));\n// device.setRingFlex((((data[7] & 0x00FF) << 8) | ((data[6] & 0x00FF))));\n// device.setPinkyFlex((((data[9] & 0x00FF) << 8) | ((data[8] & 0x00FF))));\n//\n// Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n//\n// if(DeviceExerciseFragment.START_LOG)\n// device.logData(mContext);\n//\n//\n// // Second Data Set\n// //device.setTimestamp((((data[6] & 0x00FF) << 8) | ((data[7] & 0x00FF))));\n// device.setThumbFlex((((data[11] & 0x00FF) << 8) | ((data[10] & 0x00FF))));\n// device.setIndexFlex((((data[13] & 0x00FF) << 8) | ((data[12] & 0x00FF))));\n// device.setMiddleFlex((((data[15] & 0x00FF) << 8) | ((data[14] & 0x00FF))));\n// device.setRingFlex((((data[17] & 0x00FF) << 8) | ((data[16] & 0x00FF))));\n// device.setPinkyFlex((((data[19] & 0x00FF) << 8) | ((data[18] & 0x00FF))));\n// Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n//\n// if(DeviceExerciseFragment.START_LOG)\n// device.logData(mContext);\n// }\n// else if(exerciseMode.equals(\"Imu Only\")){\n// Log.e(\"MODE:::--\" ,exerciseMode);\n// device.setAccX(((data[1] & 0x00FF) << 8) | ((data[0] & 0x00FF)));\n// device.setAccY(((data[3] & 0x00FF) << 8) | ((data[2] & 0x00FF)));\n// device.setAccZ(((data[5] & 0x00FF) << 8) | ((data[4] & 0x00FF)));\n// device.setGyrX(((data[7] & 0x00FF) << 8) | ((data[6] & 0x00FF)));\n// device.setGyrY(((data[9] & 0x00FF) << 8) | ((data[8] & 0x00FF)));\n// device.setGyrZ(((data[11] & 0x00FF) << 8) | ((data[10] & 0x00FF)));\n//\n// Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n//\n// if(DeviceExerciseFragment.START_LOG)\n// device.logData(mContext);\n//\n //}\n\n Log.e(\"MODE\",MainActivity.exercise_mode);\n Log.e(\"MODE:::--\" ,device.getExerciseMode().toString());\n\n switch (exerciseMode)\n {\n case \"Flex + IMU\":\n // Move data processing into Data Model?\n// //if (data[0] == PACKET_ID_1) {\n\n device.setTimestamp(((data[1] & 0x00FF) << 8) | ((data[0] & 0x00FF)));// | ((data[3] & 0x00FF) << 8) | (data[4] & 0x00FF));\n device.setThumbFlex((((data[3] & 0x00FF) << 8) | ((data[2] & 0x00FF))));\n device.setIndexFlex((((data[5] & 0x00FF) << 8) | ((data[4] & 0x00FF))));\n device.setRingFlex((((data[7] & 0x00FF) << 8) | ((data[6] & 0x00FF))));\n device.setAccX((short)(((data[9] & 0x00FF) << 8) | ((data[8] & 0x00FF))));\n device.setAccY((short)(((data[11] & 0x00FF) << 8) | ((data[10] & 0x00FF))));\n device.setAccZ((short)(((data[13] & 0x00FF) << 8) | ((data[12] & 0x00FF))));\n device.setGyrX((short)(((data[15] & 0x00FF) << 8) | ((data[14] & 0x00FF))));\n device.setGyrY((short)(((data[17] & 0x00FF) << 8) | ((data[16] & 0x00FF))));\n device.setGyrZ((short)(((data[19] & 0x00FF) << 8) | ((data[18] & 0x00FF))));\n\n\n\n Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n\n // If in exercise, log this data to CSV file\n if(DeviceExerciseFragment.START_LOG){\n device.logData(mContext);\n } else {\n Log.w(TAG, \"Invalid Data Packet\");\n return;\n }\n break;\n case \"Flex Only\":\n // First Data Set\n //device.setTimestamp((((data[0] & 0x00FF) << 8) | ((data[1] & 0x00FF))));\n\n device.setThumbFlex((((data[1] & 0x00FF) << 8) | ((data[0] & 0x00FF))));\n device.setIndexFlex((((data[3] & 0x00FF) << 8) | ((data[2] & 0x00FF))));\n device.setMiddleFlex((((data[5] & 0x00FF) << 8) | ((data[4] & 0x00FF))));\n device.setRingFlex((((data[7] & 0x00FF) << 8) | ((data[6] & 0x00FF))));\n device.setPinkyFlex((((data[9] & 0x00FF) << 8) | ((data[8] & 0x00FF))));\n\n Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n\n if(DeviceExerciseFragment.START_LOG)\n device.logData(mContext);\n\n\n // Second Data Set\n //device.setTimestamp((((data[6] & 0x00FF) << 8) | ((data[7] & 0x00FF))));\n device.setThumbFlex((((data[11] & 0x00FF) << 8) | ((data[10] & 0x00FF))));\n device.setIndexFlex((((data[13] & 0x00FF) << 8) | ((data[12] & 0x00FF))));\n device.setMiddleFlex((((data[15] & 0x00FF) << 8) | ((data[14] & 0x00FF))));\n device.setRingFlex((((data[17] & 0x00FF) << 8) | ((data[16] & 0x00FF))));\n device.setPinkyFlex((((data[19] & 0x00FF) << 8) | ((data[18] & 0x00FF))));\n Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n\n if(DeviceExerciseFragment.START_LOG)\n device.logData(mContext);\n break;\n // Third Data Set\n //device.setTimestamp((((data[12] & 0x00FF) << 8) | ((data[13] & 0x00FF))));\n //device.setThumbFlex((((data[14] & 0x00FF) << 8) | ((data[15] & 0x00FF))));\n //device.setIndexFlex((((data[16] & 0x00FF) << 8) | ((data[17] & 0x00FF))));\n\n // If in exercise, log data to CSV\n //if(DeviceExerciseFragment.START_LOG)\n // device.logData(mContext);\n\n case \"Imu Only\":\n device.setAccX((short) (((data[1] & 0x00FF) << 8) | ((data[0] & 0x00FF))));\n device.setAccY(( short)(((data[3] & 0x00FF) << 8) | ((data[2] & 0x00FF))));\n device.setAccZ((short)(((data[5] & 0x00FF) << 8) | ((data[4] & 0x00FF))));\n device.setGyrX(( short)(((data[7] & 0x00FF) << 8) | ((data[6] & 0x00FF))));\n device.setGyrY(( short)(((data[9] & 0x00FF) << 8) | ((data[8] & 0x00FF))));\n device.setGyrZ(( short)(((data[11] & 0x00FF) << 8) | ((data[10] & 0x00FF))));\n\n Log.d(\"START_LOG:::--\" ,String.valueOf(DeviceExerciseFragment.START_LOG));\n\n if(DeviceExerciseFragment.START_LOG)\n device.logData(mContext);\n break;\n }\n } catch (IllegalDeviceType | IOException e) {\n Log.e(TAG, e.toString());\n // TODO Handle Error Event\n return;\n }\n }\n }\n break;\n case BluetoothLeConnectionService.GATT_CHARACTERISTIC_READ:\n break;\n case BluetoothLeConnectionService.GATT_DESCRIPTOR_WRITE:\n break;\n case BluetoothLeConnectionService.GATT_NOTIFICATION_TOGGLED:\n break;\n case BluetoothLeConnectionService.GATT_DEVICE_INFO_READ:\n break;\n }\n }", "@Override\n public void onStart() {\n \n }", "@Override\n public void onStart() {\n \n }", "@Override\n\t\t\t\t\tpublic void onStart() {\n\n\t\t\t\t\t}", "private void assertService() {\n \t\n if(mLedService == null) {\n throw new IllegalStateException(\"LedClient not connected\");\n }\n }", "public BluetoothService(Activity activity){\n mActivity = activity;\n\n mUserWarningService = new UserWarningService(mActivity.getApplicationContext());\n\n\n/*\n float [][] testdata ={{1},{2},{6},{4},{5},{6},{7},{8},{9},{10}};\n float f1 = Mean(testdata, 0,10);\n float f2 = Var(testdata, 0,10);\n float f3 = Rms(testdata, 0,10);\n float f4 = Skew(testdata, 0,10);\n int x = 1;\n\n */\n }", "@Override\r\n public void onServiceDisconnected(ComponentName name) {\n Log.i(TAG, \"onServiceDisconnected in CardEmulation\");\r\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Log.v(TAG, \"txh onStartCommand, thread = \" + Thread.currentThread().getName());\n Toast.makeText(this, \"txh service starting\", Toast.LENGTH_SHORT).show();\n return super.onStartCommand(intent,flags,startId);\n }", "@Override\n protected void onResume() {\n\n super.onResume();\n\n bindService(serviceIntent, connection, BIND_AUTO_CREATE);\n\n }", "void connectServiceUnknownThread() {\n mMainHandler.post(() -> {\n try {\n final IAccessibilityServiceClient serviceInterface;\n final IBinder service;\n synchronized (mLock) {\n serviceInterface = mServiceInterface;\n mService = (serviceInterface == null) ? null : mServiceInterface.asBinder();\n service = mService;\n }\n // If the serviceInterface is null, the UiAutomation has been shut down on\n // another thread.\n if (serviceInterface != null) {\n service.linkToDeath(this, 0);\n serviceInterface.init(this, mId, mOverlayWindowToken);\n }\n } catch (RemoteException re) {\n Slog.w(LOG_TAG, \"Error initialized connection\", re);\n destroyUiAutomationService();\n }\n });\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n fetchListOfAppNames();\n// this.appNames = getListOfAllAppNames();\n this.appNames = getListOfInstalledAppNames();\n registerBroadcastReceiver();\n return START_STICKY;\n }", "@Override\n public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {\n if(device.getName() == null)\n {\n //Not interested in these\n return;\n }\n //Log.i(TAG, \"Found \" + device.getName());\n if(device.getName().equals(TARGET_SERVICE_NAME))\n {\n Log.v(TAG, \"Connecting to parallel demo\");\n mDeviceAddress = device.getAddress();\n startBLEService();\n scanLeDevice(false);\n }\n }", "@Override\n protected Void doInBackground(Void... params) {\n if (bluetoothSocket.isConnected()) {\n testCommands();\n }\n\n return null;\n }", "@SuppressWarnings(value = {\"deprecation\"})\n @Override\n public void onStartBleScan(long timeoutMillis) {\n if (mBluetooth != null) {\n isScanning = mBluetooth.startLeScan(leScanCallback);\n //timeoutHandler.postDelayed(timeoutRunnable, delay);\n Log.d(TAG, \"mBluetooth.startLeScan() \" + isScanning);\n } else {\n mScanCallback.onBleScanFailed(BleScanState.BLUETOOTH_OFF);//bluetooth is off\n }\n }" ]
[ "0.69436103", "0.67517424", "0.6716884", "0.6619459", "0.6588178", "0.6537906", "0.6534949", "0.65321416", "0.65171653", "0.6501972", "0.6479909", "0.64655083", "0.64643216", "0.6458709", "0.6454149", "0.6436195", "0.6414486", "0.6404026", "0.6402587", "0.6387016", "0.6323549", "0.63068336", "0.629524", "0.6272424", "0.62717575", "0.626879", "0.6245945", "0.6241607", "0.6237822", "0.62213886", "0.6211036", "0.6208854", "0.6197036", "0.6190459", "0.61832595", "0.6178288", "0.617488", "0.6169116", "0.61516654", "0.6147813", "0.6146975", "0.6145359", "0.6141786", "0.613638", "0.6136108", "0.6135606", "0.6122174", "0.6115913", "0.6107852", "0.61020184", "0.60888773", "0.60836595", "0.60633475", "0.6057632", "0.60553646", "0.6050651", "0.6043825", "0.6037661", "0.6031305", "0.6025142", "0.6019015", "0.6014436", "0.60142934", "0.6012166", "0.6011192", "0.60087276", "0.6007302", "0.59981585", "0.5997799", "0.59953773", "0.5974232", "0.5972848", "0.5963615", "0.59625924", "0.59581494", "0.59518427", "0.5950541", "0.59424645", "0.59411323", "0.5936257", "0.5932214", "0.59310824", "0.5930427", "0.59300745", "0.59297866", "0.5929288", "0.5922157", "0.5917415", "0.5917415", "0.59167373", "0.59097165", "0.59074634", "0.59034413", "0.58988714", "0.5897215", "0.5896646", "0.5895391", "0.5895131", "0.589393", "0.5874683" ]
0.6423057
16
todo: this is desperate for some error handling
public void runShutdown() { readCharacteristic(blecharMap, GattAttributes.SHUTDOWN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void correctError()\r\n\t{\r\n\t\t\r\n\t}", "private static void checkError(String result) {\n String err = Neo4jUtils.extractErrorData(result);\n if (err == null) {\n return;\n }\n throw new RuntimeException(err);\n }", "@Override\n\t\t\t\t\t\t\tpublic void error(Exception e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "private void parseData() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onIOException(IOException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "public void inquiryError() {\n\t\t\n\t}", "zzafe mo29840Y() throws RemoteException;", "void unableToListContents();", "public abstract void mo133131c() throws InvalidDataException;", "zzang mo29839S() throws RemoteException;", "@Override\n\t\tprotected String[] handleIrregulars(String s) {\n\t\t\treturn null;\n\t\t}", "private java.lang.String c(java.lang.String r7) {\n /*\n r6 = this;\n r2 = \"\";\n r0 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n if (r0 == 0) goto L_0x0050;\n L_0x0006:\n r0 = new java.lang.StringBuilder;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = java.lang.String.valueOf(r7);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0.<init>(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = \".\";\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.toString();\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x001f:\n r1 = r6.d;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r1.openFileInput(r0);\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x0025:\n r3 = new java.io.BufferedReader;\n r4 = new java.io.InputStreamReader;\n r0 = r1;\n r0 = (java.io.InputStream) r0;\n r5 = \"UTF-8\";\n r5 = java.nio.charset.Charset.forName(r5);\n r4.<init>(r0, r5);\n r3.<init>(r4);\n r0 = new java.lang.StringBuffer;\n r0.<init>();\n L_0x003d:\n r4 = r3.readLine();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n if (r4 != 0) goto L_0x0061;\n L_0x0043:\n r0 = r0.toString();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007d }\n r1.close();\t Catch:{ IOException -> 0x007d }\n r3.close();\t Catch:{ IOException -> 0x007d }\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = r7;\n goto L_0x001f;\n L_0x0052:\n r0 = move-exception;\n r0 = r6.d;\t Catch:{ IOException -> 0x005e }\n r0 = r0.getAssets();\t Catch:{ IOException -> 0x005e }\n r1 = r0.open(r7);\t Catch:{ IOException -> 0x005e }\n goto L_0x0025;\n L_0x005e:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0061:\n r0.append(r4);\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n goto L_0x003d;\n L_0x0065:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x0070 }\n r1.close();\t Catch:{ IOException -> 0x0070 }\n r3.close();\t Catch:{ IOException -> 0x0070 }\n r0 = r2;\n goto L_0x004f;\n L_0x0070:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0073:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007f }\n r1.close();\t Catch:{ IOException -> 0x007f }\n r3.close();\t Catch:{ IOException -> 0x007f }\n L_0x007c:\n throw r0;\n L_0x007d:\n r1 = move-exception;\n goto L_0x004f;\n L_0x007f:\n r1 = move-exception;\n goto L_0x007c;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.a.b.b.c(java.lang.String):java.lang.String\");\n }", "private void poetries() {\n\n\t}", "@Test(expected=RuntimeException.class)\n public void missingPartOfHeader(){\n Header h;\n SimpleReader sr = new SimpleReader();\n String fileForLexer = sr.FileToString(\"sample_abc/invalid_for_testing.abc\");\n abcLexer lex = new abcLexer(fileForLexer);\n abcParser parser = new abcParser(lex);\n h=parser.parseHeader();}", "public void mo1976s() throws cf {\r\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "public void m9741j() throws cf {\r\n }", "protected boolean continueOnWriteError() {\n/* 348 */ return true;\n/* */ }", "private void m2139m() {\n /*\n r18 = this;\n r3 = 0;\n r0 = r18;\n r15 = r0.f1119g;\t Catch:{ FileNotFoundException -> 0x0023 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ FileNotFoundException -> 0x0023 }\n r16 = r0;\n r3 = r15.openFileInput(r16);\t Catch:{ FileNotFoundException -> 0x0023 }\n r8 = android.util.Xml.newPullParser();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r8.setInput(r3, r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r12 = 0;\n L_0x0018:\n r15 = 1;\n if (r12 == r15) goto L_0x0025;\n L_0x001b:\n r15 = 2;\n if (r12 == r15) goto L_0x0025;\n L_0x001e:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0018;\n L_0x0023:\n r4 = move-exception;\n L_0x0024:\n return;\n L_0x0025:\n r15 = \"historical-records\";\n r16 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = r15.equals(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x0062;\n L_0x0031:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file does not start with historical-records tag.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0039:\n r14 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r14);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x005c:\n r3.close();\t Catch:{ IOException -> 0x0060 }\n goto L_0x0024;\n L_0x0060:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0062:\n r0 = r18;\n r5 = r0.f1118f;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.clear();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0069:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 1;\n if (r12 != r15) goto L_0x0078;\n L_0x0070:\n if (r3 == 0) goto L_0x0024;\n L_0x0072:\n r3.close();\t Catch:{ IOException -> 0x0076 }\n goto L_0x0024;\n L_0x0076:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0078:\n r15 = 3;\n if (r12 == r15) goto L_0x0069;\n L_0x007b:\n r15 = 4;\n if (r12 == r15) goto L_0x0069;\n L_0x007e:\n r7 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = \"historical-record\";\n r15 = r15.equals(r7);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x00bd;\n L_0x008a:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file not well-formed.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0092:\n r6 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r6);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x00b5:\n r3.close();\t Catch:{ IOException -> 0x00ba }\n goto L_0x0024;\n L_0x00ba:\n r15 = move-exception;\n goto L_0x0024;\n L_0x00bd:\n r15 = 0;\n r16 = \"activity\";\n r0 = r16;\n r2 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"time\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r10 = java.lang.Long.parseLong(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"weight\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r13 = java.lang.Float.parseFloat(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9 = new android.support.v7.internal.widget.b$d;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9.<init>(r2, r10, r13);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.add(r9);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0069;\n L_0x00e9:\n r15 = move-exception;\n if (r3 == 0) goto L_0x00ef;\n L_0x00ec:\n r3.close();\t Catch:{ IOException -> 0x00f0 }\n L_0x00ef:\n throw r15;\n L_0x00f0:\n r16 = move-exception;\n goto L_0x00ef;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v7.internal.widget.b.m():void\");\n }", "protected abstract void error(String err);", "private String m16127b(String str) {\n BufferedReader bufferedReader;\n BufferedReader bufferedReader2 = null;\n try {\n bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(\"getprop \" + str).getInputStream()), OguryChoiceManager.TcfV2.Purpose.DEVELOP_AND_IMPROVE_PRODUCTS);\n try {\n String readLine = bufferedReader.readLine();\n bufferedReader.close();\n C4647b.m16104a((Closeable) bufferedReader);\n return readLine;\n } catch (IOException unused) {\n C4647b.m16104a((Closeable) bufferedReader);\n return null;\n } catch (Throwable th) {\n th = th;\n bufferedReader2 = bufferedReader;\n C4647b.m16104a((Closeable) bufferedReader2);\n throw th;\n }\n } catch (IOException unused2) {\n bufferedReader = null;\n C4647b.m16104a((Closeable) bufferedReader);\n return null;\n } catch (Throwable th2) {\n th = th2;\n C4647b.m16104a((Closeable) bufferedReader2);\n throw th;\n }\n }", "@Override\n\tpublic void adjustToError() {\n\t\t\n\t}", "public void mo1964g() throws cf {\r\n }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "zzana mo29855eb() throws RemoteException;", "private void throwsError() throws OBException {\n }", "private void initErrorState()\n\t{\n\t\tthis.initErrorPath();\n\t\tthis.initErrorLoopCount();\n\t}", "java.lang.String getErr();", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "@Override\n\t\tpublic void onIOException(IOException e, Object state) {\n \n \t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public String uploadFile(String filename, InputStream is)\n {\n String url=null;\n try {\n \n FileMetadata metadata = client.files().uploadBuilder(\"/\"+filename).uploadAndFinish(is);\n SharedLinkMetadata sharedLinkMetadata = client.sharing().createSharedLinkWithSettings(\"/\"+filename);\n url=sharedLinkMetadata.getUrl();\n url=url.substring(0, url.length()-1)+\"1\";\n \n }\n// catch (FileNotFoundException fne)\n// {\n// System.out.println(\"96 : FileNotFoundException Caused By \"+fne.getLocalizedMessage());\n// }\n catch (IOException ioe)\n {\n System.out.println(\"100 : IOException Caused By \"+ioe.getLocalizedMessage());\n }\n// catch (DbxException dbxe)\n// {\n// \n// System.out.println(\"105 : DbxException Caused By \"+dbxe.getLocalizedMessage());\n// }\n catch(DbxException e)\n {\n System.out.println(\"--++--------+++++\");\n session = sfobj.openSession();\n tx = session.beginTransaction();\n\n System.out.println(\"line no= \"+e.getStackTrace()[2].getLineNumber());\n System.out.println(\"mathod name= \"+e.getStackTrace()[2].getMethodName());\n System.out.println(\"type= \"+e.toString());\n String nameofCurrMethod = new Throwable() \n .getStackTrace()[2] \n .getMethodName(); \n System.out.println(\"----method\"+nameofCurrMethod);\n // System.out.println(ea.getStackTrace().toString());\n System.out.println(\"class name= \"+e.getStackTrace()[2].getFileName());\n Errors ee=new Errors();\n ee.setGymid(gymid);\n ee.setError_name(\"line no= \"+e.getStackTrace()[2].getLineNumber()+\"type= \"+e.toString());\n ee.setMethod_name(e.getStackTrace()[2].getMethodName());\n session.save(ee);\n tx.commit();\n session.close();\n }\n return url;\n }", "@Override\n\tprotected void interr() {\n\t}", "private static java.io.File c(java.lang.String r8, java.lang.String r9) {\n /*\n r0 = 0;\n r1 = 0;\n r2 = new java.io.File;\t Catch:{ Exception -> 0x00e8, all -> 0x00e4 }\n r2.<init>(r8);\t Catch:{ Exception -> 0x00e8, all -> 0x00e4 }\n r8 = r2.exists();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n if (r8 != 0) goto L_0x001d;\n L_0x000d:\n r8 = \"DecryptUtils\";\n r9 = \"unZipSingleFile file don't exist\";\n r3 = new java.lang.Object[r0];\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.d.e(r8, r9, r3);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.b.a(r1);\n r2.delete();\n return r1;\n L_0x001d:\n r8 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.<init>();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = java.io.File.separator;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = \"unzip\";\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8 = r8.toString();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = new java.io.File;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9.<init>(r8);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.b.a(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3 = r9.exists();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n if (r3 != 0) goto L_0x0044;\n L_0x0041:\n r9.mkdirs();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n L_0x0044:\n r9 = new java.util.zip.ZipInputStream;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3 = new java.io.FileInputStream;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3.<init>(r2);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9.<init>(r3);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n L_0x004e:\n r3 = r9.getNextEntry();\t Catch:{ Exception -> 0x00dc }\n if (r3 == 0) goto L_0x00f4;\n L_0x0054:\n r4 = r3.getName();\t Catch:{ Exception -> 0x00dc }\n r3 = r3.isDirectory();\t Catch:{ Exception -> 0x00dc }\n if (r3 == 0) goto L_0x0085;\n L_0x005e:\n r3 = r4.length();\t Catch:{ Exception -> 0x00dc }\n r3 = r3 + -1;\n r3 = r4.substring(r0, r3);\t Catch:{ Exception -> 0x00dc }\n r4 = new java.io.File;\t Catch:{ Exception -> 0x00dc }\n r5 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00dc }\n r5.<init>();\t Catch:{ Exception -> 0x00dc }\n r5.append(r8);\t Catch:{ Exception -> 0x00dc }\n r6 = java.io.File.separator;\t Catch:{ Exception -> 0x00dc }\n r5.append(r6);\t Catch:{ Exception -> 0x00dc }\n r5.append(r3);\t Catch:{ Exception -> 0x00dc }\n r3 = r5.toString();\t Catch:{ Exception -> 0x00dc }\n r4.<init>(r3);\t Catch:{ Exception -> 0x00dc }\n r4.mkdirs();\t Catch:{ Exception -> 0x00dc }\n goto L_0x004e;\n L_0x0085:\n r3 = new java.io.File;\t Catch:{ Exception -> 0x00dc }\n r5 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00dc }\n r5.<init>();\t Catch:{ Exception -> 0x00dc }\n r5.append(r8);\t Catch:{ Exception -> 0x00dc }\n r6 = java.io.File.separator;\t Catch:{ Exception -> 0x00dc }\n r5.append(r6);\t Catch:{ Exception -> 0x00dc }\n r5.append(r4);\t Catch:{ Exception -> 0x00dc }\n r4 = r5.toString();\t Catch:{ Exception -> 0x00dc }\n r3.<init>(r4);\t Catch:{ Exception -> 0x00dc }\n r3.createNewFile();\t Catch:{ Exception -> 0x00dc }\n r4 = new java.io.FileOutputStream;\t Catch:{ Exception -> 0x00c7, all -> 0x00c4 }\n r4.<init>(r3);\t Catch:{ Exception -> 0x00c7, all -> 0x00c4 }\n r5 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n r5 = new byte[r5];\t Catch:{ Exception -> 0x00c2 }\n L_0x00aa:\n r6 = r9.read(r5);\t Catch:{ Exception -> 0x00c2 }\n r7 = -1;\n if (r6 == r7) goto L_0x00b8;\n L_0x00b1:\n r4.write(r5, r0, r6);\t Catch:{ Exception -> 0x00c2 }\n r4.flush();\t Catch:{ Exception -> 0x00c2 }\n goto L_0x00aa;\n L_0x00b8:\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n return r3;\n L_0x00c2:\n r3 = move-exception;\n goto L_0x00c9;\n L_0x00c4:\n r8 = move-exception;\n r4 = r1;\n goto L_0x00d8;\n L_0x00c7:\n r3 = move-exception;\n r4 = r1;\n L_0x00c9:\n r5 = \"DecryptUtils\";\n r6 = \"unZipSingleFile unZip hotfix patch file error\";\n r7 = new java.lang.Object[r0];\t Catch:{ all -> 0x00d7 }\n com.taobao.sophix.e.d.a(r5, r6, r3, r7);\t Catch:{ all -> 0x00d7 }\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n goto L_0x004e;\n L_0x00d7:\n r8 = move-exception;\n L_0x00d8:\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n throw r8;\t Catch:{ Exception -> 0x00dc }\n L_0x00dc:\n r8 = move-exception;\n goto L_0x00eb;\n L_0x00de:\n r8 = move-exception;\n r9 = r1;\n goto L_0x00fc;\n L_0x00e1:\n r8 = move-exception;\n r9 = r1;\n goto L_0x00eb;\n L_0x00e4:\n r8 = move-exception;\n r9 = r1;\n r2 = r9;\n goto L_0x00fc;\n L_0x00e8:\n r8 = move-exception;\n r9 = r1;\n r2 = r9;\n L_0x00eb:\n r3 = \"DecryptUtils\";\n r4 = \"unZipSingleFile unZip hotfix patch file error\";\n r0 = new java.lang.Object[r0];\t Catch:{ all -> 0x00fb }\n com.taobao.sophix.e.d.a(r3, r4, r8, r0);\t Catch:{ all -> 0x00fb }\n L_0x00f4:\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n return r1;\n L_0x00fb:\n r8 = move-exception;\n L_0x00fc:\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n throw r8;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.taobao.sophix.e.a.c(java.lang.String, java.lang.String):java.io.File\");\n }", "public static String i() {\n Object object;\n Object object2;\n Object object3;\n block24: {\n String string2;\n block22: {\n block25: {\n block23: {\n block21: {\n byte[] byArray;\n int n10 = 0;\n object3 = null;\n object2 = Runtime.getRuntime();\n object = \"getprop ro.board.platform\";\n object2 = ((Runtime)object2).exec((String)object);\n object = ((Process)object2).getInputStream();\n int n11 = 128;\n try {\n byArray = new byte[n11];\n ((InputStream)object).read(byArray);\n string2 = new String(byArray);\n object3 = \"\\n\";\n }\n catch (IOException iOException) {\n string2 = null;\n object3 = iOException;\n break block23;\n }\n try {\n n10 = string2.indexOf((String)object3);\n n11 = -1;\n if (n10 != n11) {\n n11 = 0;\n byArray = null;\n string2 = string2.substring(0, n10);\n }\n if (object == null) break block21;\n }\n catch (IOException iOException) {\n break block23;\n }\n try {\n ((InputStream)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n }\n if (object2 == null) return string2;\n break block22;\n catch (Throwable throwable) {\n object = null;\n object3 = throwable;\n break block24;\n }\n catch (IOException iOException) {\n string2 = null;\n object3 = iOException;\n object = null;\n break block23;\n }\n catch (Throwable throwable) {\n object = null;\n object3 = throwable;\n object2 = null;\n break block24;\n }\n catch (IOException iOException) {\n object = null;\n string2 = null;\n object3 = iOException;\n object2 = null;\n }\n }\n ((Throwable)object3).printStackTrace();\n if (object == null) break block25;\n try {\n ((InputStream)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n }\n if (object2 == null) return string2;\n }\n ((Process)object2).destroy();\n return string2;\n catch (Throwable throwable) {\n // empty catch block\n }\n }\n if (object != null) {\n try {\n ((InputStream)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n }\n if (object2 == null) throw object3;\n ((Process)object2).destroy();\n throw object3;\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\t\tpublic void loadError() {\n\t\t}", "@Override\n\tpublic void exucute() {\n\t\t\n\t}", "Object getFailonerror();", "Object getFailonerror();", "public void method_4270() {}", "@Override\n\t\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\n\t\t\t\t\t\t\t}", "String processing();", "public boolean errorFound()\r\n\t{\r\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Test(timeout = 4000)\n public void test049() throws Throwable {\n StringReader stringReader0 = new StringReader(\"Invalid escape character at line \");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n javaCharStream0.Done();\n // Undeclared exception!\n try { \n javaCharStream0.AdjustBuffSize();\n fail(\"Expecting exception: Error\");\n \n } catch(Error e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "private void verificaData() {\n\t\t\n\t}", "public static String j() {\n Object object;\n Object object2;\n block23: {\n block25: {\n block24: {\n block22: {\n block21: {\n object2 = null;\n object = \"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\";\n FileReader fileReader = new FileReader((String)object);\n object = new BufferedReader(fileReader);\n object2 = ((BufferedReader)object).readLine();\n object2 = ((String)object2).trim();\n try {\n ((BufferedReader)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n break block25;\n catch (IOException iOException) {\n break block21;\n }\n catch (FileNotFoundException fileNotFoundException) {\n break block22;\n }\n catch (Throwable throwable) {\n object = null;\n object2 = throwable;\n break block23;\n }\n catch (IOException iOException) {\n object = null;\n object2 = iOException;\n }\n }\n ((Throwable)object2).printStackTrace();\n if (object == null) break block24;\n ((BufferedReader)object).close();\n catch (FileNotFoundException fileNotFoundException) {\n object = null;\n object2 = fileNotFoundException;\n }\n }\n ((Throwable)object2).printStackTrace();\n if (object == null) break block24;\n try {\n ((BufferedReader)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n }\n object2 = \"N/A\";\n }\n return object2;\n catch (Throwable throwable) {\n // empty catch block\n }\n }\n if (object != null) {\n try {\n ((BufferedReader)object).close();\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n }\n throw object2;\n }", "private void inizia() throws Exception {\n }", "private V e() throws com.amap.api.col.n3.gh {\n /*\n r6 = this;\n r0 = 0\n r1 = 0\n L_0x0002:\n int r2 = r6.b\n if (r1 >= r2) goto L_0x00cd\n com.amap.api.col.n3.ki r2 = com.amap.api.col.n3.ki.c() // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n android.content.Context r3 = r6.d // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.net.Proxy r3 = com.amap.api.col.n3.ik.a(r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n r6.a((java.net.Proxy) r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n byte[] r2 = r2.a((com.amap.api.col.n3.kj) r6) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.lang.Object r2 = r6.a((byte[]) r2) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n int r0 = r6.b // Catch:{ ic -> 0x0025, gh -> 0x0020, Throwable -> 0x002a }\n r1 = r0\n r0 = r2\n goto L_0x0002\n L_0x0020:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0033\n L_0x0025:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0044\n L_0x002a:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"未知错误\"\n r0.<init>(r1)\n throw r0\n L_0x0032:\n r2 = move-exception\n L_0x0033:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 < r3) goto L_0x0002\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0043:\n r2 = move-exception\n L_0x0044:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 >= r3) goto L_0x008a\n int r3 = r6.e // Catch:{ InterruptedException -> 0x0053 }\n int r3 = r3 * 1000\n long r3 = (long) r3 // Catch:{ InterruptedException -> 0x0053 }\n java.lang.Thread.sleep(r3) // Catch:{ InterruptedException -> 0x0053 }\n goto L_0x0002\n L_0x0053:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x0078\n goto L_0x0082\n L_0x0078:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0082:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x008a:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"未知的错误\"\n java.lang.String r1 = r2.a()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x00bb\n goto L_0x00c5\n L_0x00bb:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x00c5:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x00cd:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amap.api.col.n3.gi.e():java.lang.Object\");\n }", "public void correctErrors();", "@Override\r\n\tprotected void processRespond() throws SGSException {\n\r\n\t}", "@Override\n\tpublic void process() throws Exception {\n\n\t}", "@Override\r\n\t\tpublic void onIOException(IOException e, Object state) {\n\t\t\t\r\n\t\t}", "protodef.b_error.info getError();", "protodef.b_error.info getError();", "@Override\n\tpublic void coreProblemExecution() {\n\t\t\n\t}", "@Override\n\tpublic void coreProblemExecution() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void calculateError() {\n\t\t\n\t}", "@Override\n\tpublic void processPacketDecodeError() {\n\t\t\n\t}", "zzand mo29852bb() throws RemoteException;", "void notSupported(String errorcode);", "private void inizia() throws Exception {\n }", "private void inizia() throws Exception {\n }", "private void inizia() throws Exception {\n }", "private void inizia() throws Exception {\n }", "private void inizia() throws Exception {\n }", "private void checkRep() throws RuntimeException {\r\n \t\r\n \t//check edge label\r\n if (this.label == null) {\r\n throw new RuntimeException(\"Edge label is undefined\");\r\n }\r\n \r\n //check parent node\r\n if (this.pnode.getName().toString().length() == 0) {\r\n throw new RuntimeException(\"Parent node name is invalid\");\r\n }\r\n\r\n if (this.pnode.getName() == null) {\r\n throw new RuntimeException(\"Parent node name is undefined\");\r\n }\r\n \r\n //check child node\r\n if (this.cnode.getName().toString().length() == 0) {\r\n throw new RuntimeException(\"Child node name is invalid\");\r\n }\r\n \r\n if (this.cnode.getName() == null) {\r\n throw new RuntimeException(\"Child node name is undefined\");\r\n }\r\n \r\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n\n }", "XfvhdlAntecedentMemFiles() {\r\n \t error = new XfvhdlError();\r\n \t }", "public void mo1944a() throws cf {\r\n }", "@Test(timeout = 4000)\n public void test369() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"J]'z8)\", \"J]'z8)\");\n // Undeclared exception!\n try { \n fileInput0.dfn((Object) \"J]'z8)\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "java.util.List<WorldUps.UErr> \n getErrorList();", "@Override\n\tprotected void processInput() {\n\t}", "@Override\n public void visitErrorNode(ErrorNode node) {\n\n }", "private static java.lang.String readStringFromFile(java.io.File r9) {\n /*\n r5 = 0\n r3 = 0\n java.io.FileReader r4 = new java.io.FileReader // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r4.<init>(r9) // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r7 = 128(0x80, float:1.794E-43)\n char[] r0 = new char[r7] // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n r6.<init>() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n L_0x0010:\n int r1 = r4.read(r0) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r1 <= 0) goto L_0x002a\n r7 = 0\n r6.append(r0, r7, r1) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n goto L_0x0010\n L_0x001b:\n r2 = move-exception\n r3 = r4\n L_0x001d:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"cannot find file to read\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x004f }\n L_0x0029:\n return r5\n L_0x002a:\n java.lang.String r5 = r6.toString() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r4 == 0) goto L_0x005b\n r4.close() // Catch:{ IOException -> 0x0035 }\n r3 = r4\n goto L_0x0029\n L_0x0035:\n r7 = move-exception\n r3 = r4\n goto L_0x0029\n L_0x0038:\n r2 = move-exception\n L_0x0039:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"error occurs while reading file\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x0046 }\n goto L_0x0029\n L_0x0046:\n r7 = move-exception\n goto L_0x0029\n L_0x0048:\n r7 = move-exception\n L_0x0049:\n if (r3 == 0) goto L_0x004e\n r3.close() // Catch:{ IOException -> 0x0051 }\n L_0x004e:\n throw r7\n L_0x004f:\n r7 = move-exception\n goto L_0x0029\n L_0x0051:\n r8 = move-exception\n goto L_0x004e\n L_0x0053:\n r7 = move-exception\n r3 = r4\n goto L_0x0049\n L_0x0056:\n r2 = move-exception\n r3 = r4\n goto L_0x0039\n L_0x0059:\n r2 = move-exception\n goto L_0x001d\n L_0x005b:\n r3 = r4\n goto L_0x0029\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.component.plugin.PluginNativeHelper.readStringFromFile(java.io.File):java.lang.String\");\n }", "private static java.lang.String[] b(android.content.Context r8, java.lang.String r9) {\n /*\n r2 = 0\n r3 = 0\n android.content.pm.PackageManager r0 = r8.getPackageManager() // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n r1 = 64\n android.content.pm.PackageInfo r0 = r0.getPackageInfo(r9, r1) // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n android.content.pm.Signature[] r5 = r0.signatures // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n if (r5 == 0) goto L_0x008f\n int r0 = r5.length // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n if (r0 <= 0) goto L_0x008f\n int r0 = r5.length // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n java.lang.String[] r1 = new java.lang.String[r0] // Catch:{ NameNotFoundException -> 0x0079, CertificateException -> 0x007d }\n r4 = r3\n L_0x0017:\n int r0 = r5.length // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n if (r4 >= r0) goto L_0x003b\n java.lang.String r0 = \"X.509\"\n java.security.cert.CertificateFactory r0 = java.security.cert.CertificateFactory.getInstance(r0) // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n java.io.ByteArrayInputStream r6 = new java.io.ByteArrayInputStream // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n r7 = r5[r4] // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n byte[] r7 = r7.toByteArray() // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n r6.<init>(r7) // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n java.security.cert.Certificate r0 = r0.generateCertificate(r6) // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n java.security.cert.X509Certificate r0 = (java.security.cert.X509Certificate) r0 // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n java.lang.String r0 = a(r0) // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n r1[r4] = r0 // Catch:{ NameNotFoundException -> 0x008d, CertificateException -> 0x008b }\n int r0 = r4 + 1\n r4 = r0\n goto L_0x0017\n L_0x003b:\n r0 = r1\n L_0x003c:\n r4 = r0\n L_0x003d:\n if (r4 == 0) goto L_0x008a\n int r0 = r4.length\n if (r0 <= 0) goto L_0x008a\n int r0 = r4.length\n java.lang.String[] r2 = new java.lang.String[r0]\n r0 = r3\n L_0x0046:\n int r1 = r4.length\n if (r0 >= r1) goto L_0x008a\n java.lang.StringBuffer r5 = new java.lang.StringBuffer\n r5.<init>()\n r1 = r3\n L_0x004f:\n r6 = r4[r0]\n int r6 = r6.length()\n if (r1 >= r6) goto L_0x0081\n r6 = r4[r0]\n char r6 = r6.charAt(r1)\n r5.append(r6)\n if (r1 <= 0) goto L_0x0076\n int r6 = r1 % 2\n r7 = 1\n if (r6 != r7) goto L_0x0076\n r6 = r4[r0]\n int r6 = r6.length()\n int r6 = r6 + -1\n if (r1 >= r6) goto L_0x0076\n java.lang.String r6 = \":\"\n r5.append(r6)\n L_0x0076:\n int r1 = r1 + 1\n goto L_0x004f\n L_0x0079:\n r0 = move-exception\n r1 = r2\n L_0x007b:\n r4 = r1\n goto L_0x003d\n L_0x007d:\n r0 = move-exception\n r1 = r2\n L_0x007f:\n r4 = r1\n goto L_0x003d\n L_0x0081:\n java.lang.String r1 = r5.toString()\n r2[r0] = r1\n int r0 = r0 + 1\n goto L_0x0046\n L_0x008a:\n return r2\n L_0x008b:\n r0 = move-exception\n goto L_0x007f\n L_0x008d:\n r0 = move-exception\n goto L_0x007b\n L_0x008f:\n r0 = r2\n goto L_0x003c\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.b.a.e.b(android.content.Context, java.lang.String):java.lang.String[]\");\n }", "public void mo1972o() throws cf {\r\n }", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "@Override\r\n\tprotected void processTarget() throws SGSException {\n\r\n\t}", "private boolean checkError(byte[] response) {\n\t\treturn Arrays.equals(response,\"error\".getBytes());\n\t}", "@Test\n void createInvalidSystemSnomed() throws IOException {\n Exception exception = executeMappingException(\"create-history-of-travel-invalid-system-snomed.json\");\n assertEquals(\"The system is not correct. It should be 'http://snomed.info/sct', but it was 'http://loinc.org'.\", exception.getMessage());\n }", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n StringReader stringReader0 = new StringReader(\"0(Hu\");\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer1 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer2 = new StreamTokenizer(stringReader0);\n JSTerm jSTerm0 = new JSTerm(streamTokenizer1);\n jSTerm0.add((Object) null);\n // Undeclared exception!\n try { \n jSTerm0.clonePF();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"umd.cs.shop.JSPredicateForm\", e);\n }\n }", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "protected void failed()\r\n {\r\n //overwrite\r\n }", "@Test\n public void testIOExceptionWhileEvaluatingQueries() {\n assertStackTraceOfIOExceptionWhileEvaluatingQueries(PROJOG_DEFAULT_PROPERTIES);\n }", "private stendhal() {\n\t}", "public void mo1970m() throws cf {\r\n }", "protected boolean func_70814_o() { return true; }", "@Test(timeout = 4000)\n public void test182() throws Throwable {\n ResultMatrixHTML resultMatrixHTML0 = new ResultMatrixHTML();\n ResultMatrixCSV resultMatrixCSV0 = new ResultMatrixCSV();\n ResultMatrixPlainText resultMatrixPlainText0 = new ResultMatrixPlainText();\n ResultMatrixSignificance resultMatrixSignificance0 = new ResultMatrixSignificance();\n resultMatrixSignificance0.getRevision();\n resultMatrixSignificance0.setColHidden(2, true);\n ResultMatrixSignificance resultMatrixSignificance1 = new ResultMatrixSignificance(resultMatrixHTML0);\n // Undeclared exception!\n try { \n resultMatrixSignificance1.getHeader(\"B|A2 e+ >ww+37F\");\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -1\n //\n verifyException(\"java.util.Vector\", e);\n }\n }", "public void testEntrySetIteratorHasProperMappings() {\n return;\r\n }", "static int size_of_xri(String passed){\n\t\treturn 2;\n\t}", "private static byte[] a(org.apache.http.HttpResponse r4) throws java.lang.IllegalStateException, java.io.IOException {\n /*\n r0 = 1024(0x400, float:1.435E-42)\n byte[] r0 = new byte[r0]\n r1 = 0\n org.apache.http.HttpEntity r4 = r4.getEntity() // Catch:{ all -> 0x0030 }\n java.io.InputStream r4 = r4.getContent() // Catch:{ all -> 0x0030 }\n java.io.ByteArrayOutputStream r2 = new java.io.ByteArrayOutputStream // Catch:{ all -> 0x002e }\n r2.<init>() // Catch:{ all -> 0x002e }\n L_0x0012:\n int r1 = r4.read(r0) // Catch:{ all -> 0x002b }\n r3 = -1\n if (r1 == r3) goto L_0x001e\n r3 = 0\n r2.write(r0, r3, r1) // Catch:{ all -> 0x002b }\n goto L_0x0012\n L_0x001e:\n byte[] r0 = r2.toByteArray() // Catch:{ all -> 0x002b }\n if (r4 == 0) goto L_0x0027\n r4.close() // Catch:{ Exception -> 0x0027 }\n L_0x0027:\n r2.close() // Catch:{ Exception -> 0x002a }\n L_0x002a:\n return r0\n L_0x002b:\n r0 = move-exception\n r1 = r2\n goto L_0x0032\n L_0x002e:\n r0 = move-exception\n goto L_0x0032\n L_0x0030:\n r0 = move-exception\n r4 = r1\n L_0x0032:\n if (r4 == 0) goto L_0x0039\n r4.close() // Catch:{ Exception -> 0x0038 }\n goto L_0x0039\n L_0x0038:\n L_0x0039:\n if (r1 == 0) goto L_0x003e\n r1.close() // Catch:{ Exception -> 0x003e }\n L_0x003e:\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.alipay.sdk.f.d.a(org.apache.http.HttpResponse):byte[]\");\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}" ]
[ "0.56737417", "0.52636606", "0.523638", "0.5235578", "0.5189172", "0.51629925", "0.5129701", "0.50992996", "0.5091085", "0.5083063", "0.5002704", "0.4955163", "0.49145404", "0.49139634", "0.49134055", "0.49074614", "0.49051484", "0.48782626", "0.48782626", "0.48712033", "0.48675746", "0.48627824", "0.48621783", "0.48619124", "0.48593298", "0.4858524", "0.48531482", "0.48464572", "0.48459578", "0.48433986", "0.48428228", "0.48363563", "0.48332074", "0.48259142", "0.4824724", "0.48214078", "0.48201287", "0.48095483", "0.48095104", "0.48081324", "0.479423", "0.47876406", "0.47876406", "0.47820544", "0.47808158", "0.4777734", "0.47749677", "0.47711623", "0.4769325", "0.47674328", "0.47669244", "0.4766803", "0.47665986", "0.47641236", "0.47639573", "0.476059", "0.475947", "0.47510952", "0.47510952", "0.4747325", "0.4747325", "0.47441924", "0.47407305", "0.47405595", "0.4733733", "0.47297192", "0.4719388", "0.4719388", "0.4719388", "0.4719388", "0.4719388", "0.47162464", "0.47154826", "0.47138262", "0.4711256", "0.47107965", "0.47103837", "0.47086707", "0.46963662", "0.4690985", "0.46830776", "0.46825373", "0.468205", "0.4681066", "0.4679827", "0.4679497", "0.4679275", "0.4679275", "0.4679275", "0.46790773", "0.46784115", "0.46780133", "0.4677592", "0.4676923", "0.46765965", "0.46711928", "0.46710637", "0.46695945", "0.46629664", "0.4660153", "0.4659221" ]
0.0
-1
/ Traverse the tree starting from the root. If either n1 or n2 matches with the root, then the root is LCA. Otherwise, we recur for the left and right subtree. If a node has one key present in its left subtree and the another key in the right subtree, then the node is the LCA. If both keys lie in the left subtree then the left subtree has LCA also, otherwise, LCA lies in the right subtree. TIME O(n) SPACE O(1)
public static void main(String[] args) { Node root = TreeUtilA.createNewTreeA1(); int n1 = 4; int n2 = 6; Node lca = findLCA(root, n1, n2); System.out.println(lca.data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Tree findLCA(Tree tree, int n1, int n2){\n\n if(tree == null){\n return null;\n }\n\n\n // If either n1 or n2 matches with root's key, report\n // the presence by returning root (Note that if a key is\n // ancestor of other, then the ancestor key becomes LCA\n if(tree.data==n1 || tree.data==n2){\n return tree;\n }\n\n Tree leftLCA = findLCA(tree.left, n1, n2);\n Tree rightLCA = findLCA(tree.right, n1, n2);\n\n // If both of the above calls return Non-NULL, then one key\n // is present in once subtree and other is present in other,\n // So this node is the LCA\n if(leftLCA!=null && rightLCA!=null) {\n return tree;\n }\n\n return leftLCA!=null?leftLCA:rightLCA;\n\n}", "public static Node LCA2(Node root, int n1, int n2) {\n if(root != null){\n if(root.data == n1 || root.data == n2)\n return root;\n\n Node l = LCA2(root.left, n1, n2);\n Node r = LCA2(root.right, n1, n2);\n if(l != null && r != null)\n return root;\n else if( l != null)\n return l;\n else if( r != null)\n return r;\n }\n return null;\n }", "static // Returns LCA if node n1, n2 are present in the given binary tree,\r\n// otherwise return -1\r\nint findLCA(BTNode root, int n1, int n2)\r\n{\n int[] path1 = null, path2 = null;\r\n \r\n // Find paths from root to n1 and root to n1. If either n1 or n2\r\n // is not present, return -1\r\n if ( !findPath(root, path1, n1) || !findPath(root, path2, n2))\r\n return -1;\r\n \r\n /* Compare the paths to get the first different value */\r\n int i;\r\n for (i = 0; i < path1.length && i < path2.length ; i++)\r\n if (path1[i] != path2[i])\r\n break;\r\n return path1[i-1];\r\n}", "public Node findLCA(Node root, int n1, int n2){\n\t\tif(root == null)\n\t\t\treturn null;\n\t\telse if(root.data > n1 && root.data > n2)\n\t\t\treturn findLCA(root.left, n1, n2);\n\t\telse if(root.data < n1 && root.data < n2)\n\t\t\treturn findLCA(root.right, n1, n2);\n\t\treturn root;\n\t}", "public TreeNode LCA(TreeNode root, int num1, int num2){\n if(root == null) return null;\n if(root.data < num1 && root.data < num2) {\n return LCA(root.right, num1, num2);\n }\n if(root.data > num1 && root.data > num2) {\n return LCA(root.left, num1, num2);\n }\n return root;\n }", "public static int lca(Node node, int d1, int d2) {\n ArrayList<Integer> al1=nodeToRootPath(node,d1);\n ArrayList<Integer> al2=nodeToRootPath(node,d2);\n\n\n int l1=al1.size()-1;\n int l2=al2.size()-1;\n\n while(l1>=0 && l2>=0){\n if(al1.get(l1)==al2.get(l2))\n {\n l1--;\n l2--;\n continue;\n }\n else\n break;\n }\n if(l1==al1.size()-1)\n return -1;\n return al1.get(l1+1);\n }", "public static BNode lcaIterative(BNode root, int n1, int n2) {\n\t\twhile (root != null) {\n\t\t\t// If both n1 and n2 are smaller than root, then LCA lies in left\n\t\t\tif (root.data > n1 && root.data > n2)\n\t\t\t\troot = root.left;\n\n\t\t\t// If both n1 and n2 are greater than root, then LCA lies in right\n\t\t\telse if (root.data < n1 && root.data < n2)\n\t\t\t\troot = root.right;\n\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\treturn root;\n\n\t}", "private Node findLCA(Node n1, Node n2) {\n\t\tif (n1 == n2) {\n\t\t\treturn n1;\n\t\t}\n\t\treturn findLCA(n1.parent, n2.parent);\n\t}", "public TreeNode LCA(TreeNode root, TreeNode one, TreeNode two) {\r\n\t\t// base case\r\n\t\tif (root == null || root == one || root == two) {\r\n\t\t\treturn root;\r\n\t\t}\r\n\t\t\r\n\t\t// recursion rules\r\n\t\tTreeNode lchild = LCA(root.left, one, two);\r\n\t\tTreeNode rchild = LCA(root.right, one, two);\r\n\t\t\r\n\t\tif(lchild == null && rchild == null) { // case 1.1 and 2.1\r\n\t\t\treturn null;\r\n\t\t} else if (lchild != null && rchild != null) { // case 2.3\r\n\t\t\treturn root;\r\n\t\t}\r\n\t\t\r\n\t\treturn lchild == null ? rchild : lchild; // case 1.2 and 2.2\r\n\t}", "public static Node LCA_BasedOnFindNode(Node r, int n1, int n2){\n if(r != null){\n if(r.data == n1 || r.data == n2)\n return r;\n\n Node left = LCA_BasedOnFindNode(r.left, n1, n2); \n Node right = LCA_BasedOnFindNode(r.right, n1, n2);\n\n if(left != null && right != null)\n return r;\n else if(left != null)\n return left;\n else if(right != null)\n return right;\n \n }\n return null;\n }", "public static Node findLca(Node root, Node node1, Node node2) {\n if (node1 == null || node2 == null) return null;\n if (root == null)\n throw new NullPointerException(\"Root in null\");\n\n Node temp = root;\n while (temp != null) {\n if (temp == node1 || temp == node2) return temp;\n Node left = temp.left;\n Node right = temp.right;\n\n if ((isLeft(temp, node1) && isRight(temp, node2))\n || (isLeft(temp, node2) && isRight(temp, node1))) {\n return temp;\n } else {\n if (isRight(temp, node1)) {\n temp = right;\n } else {\n temp = left;\n }\n }\n }\n\n return null;\n }", "TreeNode LCA(TreeNode root, TreeNode a, TreeNode b) {\n\t\t// teacher tang class ref\n\t\tif (root == null || root == a || root == b) {\n\t\t\treturn root;\n\t\t}\n\t\tTreeNode lc = LCA(root.left, a, b);\n\t\tTreeNode rc = LCA(root.right, a, b);\n\t\tif (lc != null && rc != null) {\n\t\t\treturn root;\n\t\t}\n\t\treturn lc == null ? rc : lc;\n\t}", "public static void main(String args[]) {\n\t\tBNode root = new BNode(4);\n\t\troot.left = new BNode(2);\n\t\troot.right = new BNode(6);\n\t\troot.left.left = new BNode(1);\n\t\troot.left.right = new BNode(3);\n\t\troot.right.left = new BNode(5);\n\t\troot.right.right = new BNode(7);\n\t\tSystem.out.println(\"LCA(4, 5) = \" + findLCA(root, 4, 5).data);\n\t\tSystem.out.println(\"itr LCA(4, 5) = \" + lcaIterative(root, 4, 5).data);\n\t\tSystem.out.println(\"LCA(4, 6) = \" + findLCA(root, 4, 6).data);\n\t\tSystem.out.println(\"itr LCA(4, 6) = \" + lcaIterative(root, 4, 6).data);\n\t\tSystem.out.println(\"LCA(3, 4) = \" + findLCA(root, 3, 4).data);\n\t\tSystem.out.println(\"itr LCA(3, 4) = \" + lcaIterative(root, 3, 4).data);\n\t\tSystem.out.println(\"LCA(2, 4) = \" + findLCA(root, 2, 4).data);\n\t\tSystem.out.println(\"itr LCA(2, 4) = \" + lcaIterative(root, 2, 4).data);\n\t\t\n\t\tSystem.out.println(\"itr LCA(2, 9) = \" + lcaIterative(root, 2, 9).data);\n\n\t\tBNode root2 = new BNode(4);\n\t\troot2.left = new BNode(2);\n\t\troot2.right = new BNode(6);\n\t\troot2.left.left = new BNode(1);\n\t\troot2.left.right = new BNode(3);\n\t\troot2.right.left = new BNode(5);\n\t\troot2.right.right = new BNode(7);\n\t\troot2.right.right.right = new BNode(8);\n\t\tSystem.out.println(\"-----------------------------------------------\");\n\t\tSystem.out.println(\"Dist (4, 5) = \" + findDistance(root2, 4, 5));\n\t\tSystem.out.println(\"Dist itr (4, 5) = \" + findDistance2(root2, 4, 5));\n\n\t\tSystem.out.println(\"Dist(4, 6) = \" + findDistance(root2, 4, 6));\n\t\tSystem.out.println(\"Dist itr (4, 6) = \" + findDistance2(root2, 4, 6));\n\n\t\tSystem.out.println(\"Dist(3, 4) = \" + findDistance(root2, 3, 4));\n\t\tSystem.out.println(\"Dist itr(3, 4) = \" + findDistance2(root2, 3, 4));\n\n\t\tSystem.out.println(\"Dist(2, 4) = \" + findDistance(root2, 2, 4));\n\t\tSystem.out.println(\"Dist itr(2, 4) = \" + findDistance2(root2, 2, 4));\n\n\t\tSystem.out.println(\"Dist(8, 5) = \" + findDistance(root2, 8, 5));\n\t\tSystem.out.println(\"Dist itr(8, 5) = \" + findDistance2(root2, 8, 5));\n\n\t}", "public static int lca(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraylist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Return the last common element from behind in ArrayList\r\n return path1.get(i+1);\r\n }", "private BinaryNode lca(BinaryNode node, E a, E b){\n if (exists(node.left, a) && exists(node.left, b)) return lca(node.left, a, b);\n else if (exists(node.right, a) && exists(node.right, b))return lca(node.right, a, b);\n else return node;\n }", "private static Node1 lca(Node1 root, int v1, int v2) {\n\t\tif (root.data < v1 && root.data < v2) return lca(root.right, v1, v2); //if root is smaller than vertexes\n\t\tif (root.data > v1 && root.data > v2) return lca(root.left, v1, v2); //if root is bigger than vertexes\n\t\treturn root; //else if is between vertexes the root is the lowest common divisor\n\t}", "public static TreeNode task12_LCA(TreeNode root, TreeNode one, TreeNode two) {\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (root == one) {\n\t\t\treturn root;\n\t\t}\n\t\tif (root == two) {\n\t\t\treturn root;\n\t\t}\n\t\tTreeNode left = task12_LCA(root.left, one, two);\n\t\tTreeNode right = task12_LCA(root.right, one, two);\n\n\t\tif (left != null && right != null) {\n\t\t\treturn root;\n\t\t}\n\n\t\treturn left != null ? left : right;\n\t}", "public static TreeNode task14_LCA(TreeNode root, TreeNode one, TreeNode two) {\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (one == null || two == null) {\n\t\t\treturn null;\n\t\t}\n\t\tWrapper wrapper = new Wrapper(false, false);\n\t\texist(root, one, two, wrapper);\n\t\tif (wrapper.firstExist == false || wrapper.secondExist == false) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t// both nodes are in root. \n\t\t\treturn task12_LCA(root, one, two);\n\t\t}\n\t}", "public static void main(String args[])\r\n{\r\n // Let us create the Binary Tree shown in above diagram.\r\n BTNode root = newNode(1);\r\n root.left = newNode(2);\r\n root.right = newNode(3);\r\n root.left.left = newNode(4);\r\n root.left.right = newNode(5);\r\n root.right.left = newNode(6);\r\n root.right.right = newNode(7);\r\n System.out.println(findLCA(root, 4, 5));\r\n System.out.println(findLCA(root, 4, 6));\r\n System.out.println(findLCA(root, 3, 4));\r\n System.out.println(findLCA(root, 2, 4));\r\n}", "public TreeNode findCommonAncestor2(TreeNode node, Integer key1, Integer key2) {\n\t\tif(node == null) return null;\n\n\t\tif((key1 != null && node.val == key1) || (key2 != null && node.val == key2)) return node;\n\t\tif(key1 == null && key2 == null) return null;\n\n\t\tTreeNode n1 = null, n2 = null;\n\t\n\t\tif(key1 != null && node.val < key1) {\n\t\t\treturn findCommonAncestor2(node.right, key1, key2);\n\t\t} else if(key2 != null && node.val > key2) {\n\t\t\treturn findCommonAncestor2(node.left, key1, key2);\n\t\t} else {\n\t\t\tn1 = node.left != null ? findCommonAncestor2(node.left, key1, null) : null;\n\t\t\tn2 = node.right != null ? findCommonAncestor2(node.right, null, key2): null;\n\n\t\t\treturn (n1 != null && n2 != null) ? node : (n1 != null ? n1 : n2);\n\t\t}\n\t}", "public TreeNode findCommonAncestor(TreeNode node, int key1, int key2){\n\t\tif(node == null) return null;\n\t\tif(node.val == key1 || node.val == key2) return node;\n\n\t\tTreeNode n1 = node.left != null ? findCommonAncestor(node.left, key1, key2) : null;\n\t\tTreeNode n2 = node.right != null ? findCommonAncestor(node.right, key1, key2) : null;\n\n\t\treturn (n1 != null && n2 != null) ? node : (n1 != null ? n1 : n2);\n\t}", "int LCA(int level[], int parent[], int x, int y) {\n while (rootOfSubtree[x] != rootOfSubtree[y]) {\n if (level[x] > level[y]) {\n x = rootOfSubtree[x];\n } else {\n y = rootOfSubtree[y];\n }\n }\n //now they are in the same section, so we trivially compute the LCA\n while (x != y) {\n if (level[x] > level[y]) {\n x = parent[x];\n } else {\n y = parent[y];\n }\n }\n return x;\n }", "public TreeNode findCommonAncestor3(TreeNode node, int key1, int key2){\n\t\tif(node == null) return null;\n\n\t\tif(node.val < key1){\n\t\t\treturn findCommonAncestor3(node.right, key1, key2);\n\t\t} else if(node.val > key2) {\n\t\t\treturn findCommonAncestor3(node.left, key1, key2);\n\t\t}\n\n\t\treturn node;\n\t}", "public static void main(String[] args) {\n\t\troot=new Node(1);\r\n\t\troot.left=new Node(2);\r\n\t\troot.right=new Node(3);\r\n\t\troot.left.left=new Node(4);\r\n\t\troot.left.right=new Node(5);\r\n\t\troot.right.left=new Node(6);\r\n\t\troot.right.right=new Node(7);\r\n\t\troot.left.left.left=new Node(8);\r\n\t\troot.left.left.right=new Node(9);\r\n\t\troot.left.right.left=new Node(10);\r\n\t\troot.left.right.right=new Node(11);\r\n\t\tNode temp1=root.left.left.left;\r\n\t\tNode temp2=root.left.right;\r\n\t\tSystem.out.println(LCA(root,temp1,temp2).data);\r\n\t}", "private static void commonNodesInOrdSuc(Node r1, Node r2)\n {\n Node n1 = r1, n2 = r2;\n \n if(n1==null || n2==null)\n return;\n \n while(n1.left != null)\n n1 = n1.left;\n \n while(n2.left!= null)\n n2 = n2.left;\n \n while(n1!=null && n2!=null)\n {\n if(n1.data < n2.data)\n n1 = inOrdSuc(n1);\n \n else if(n1.data > n2.data)\n n2 = inOrdSuc(n2);\n \n else\n {\n System.out.print(n1.data+\" \"); n1 = inOrdSuc(n1); n2 = inOrdSuc(n2);\n }\n }\n \n System.out.println();\n }", "public Key lowestCommonAncestor (Node node, Key key1, Key key2){\n \t\tif (node == null)\n return null;\n \t\tif (node.key == key1) {\n \t\t\treturn node.key;\n \t\t}\n \t\tif (node.key == key2) {\n \t\t\treturn node.key;\n \t\t}\n \t\tint cmp1 = node.key.compareTo(key1);\n \t\tint cmp2 = node.key.compareTo(key2);\n \t\t\n if (cmp1 >= 0 && cmp2 >= 0)\n return lowestCommonAncestor(node.left, key1, key2);\n \n if (cmp1 <= 0 && cmp2 <= 0)\n return lowestCommonAncestor(node.right, key1, key2);\n \n return node.key;\n \t}", "public static Node LCABinTree(Node r, int value1, int value2) {\n if( r != null) {\n if( r.data == value1 || r.data == value2)\n return r;\n Node nl = LCABinTree(r.left, value1, value2);\n Node nr = LCABinTree(r.right, value1, value2);\n if( nl != null && nr != null)\n return r;\n else if( nl != null)\n return nl;\n else if( nr != null)\n return nr;\n\n }\n return null;\n }", "int findLCA(int a, int b) {\n int n1 = (depth[a] > depth[b]) ? a : b;\n int n2 = (depth[a] > depth[b]) ? b : a;\n\n int toMove = depth[n1] - depth[n2];\n for (int i = 17; i >= 0; i--) {\n if (lcaSteps[i] <= toMove) {\n n1 = lcaArr[i][n1];\n toMove -= lcaSteps[i];\n }\n }\n\n // Find LCA\n if (n1 == n2) return n1;\n else {\n for (int i = 17; i >= 0; i--) {\n if (lcaArr[i][n1] != lcaArr[i][n2]) {\n n1 = lcaArr[i][n1];\n n2 = lcaArr[i][n2];\n }\n }\n }\n\n return lcaArr[0][n1];\n }", "public static void main(String[] args) {\n LowestCommonAncestor obj = new LowestCommonAncestor();\n obj.insert(4);\n obj.insert(2);\n obj.insert(1);\n obj.insert(3);\n obj.insert(6);\n obj.insert(5);\n obj.insert(7);\n System.out.println(\"LCA of 2 numbers is \" + obj.lcaRecursive(obj.root, 1,3).data);\n obj.inorder(obj.root);\n }", "public static boolean IdenticalTrees(Node n1,Node n2) {\n\t\n\tif(n1!=null && n2!=null && n1.key==n2.key)\n\t{\n\t\treturn IdenticalTrees(n1.left, n2.left) && IdenticalTrees(n1.right, n2.right);\n\t}\n\t\n\tif(n1==null && n2==null)\n\t\treturn true;\n\treturn false;\n}", "public static void main(String[] args) {\n \t\tTreeNode root = new TreeNode(3);\n \t\tTreeNode n5 = new TreeNode(5);\n \t\tTreeNode n1 = new TreeNode(1);\n \t\tTreeNode n6 = new TreeNode(6);\n \t\tTreeNode n2 = new TreeNode(2);\n \t\tTreeNode n7 = new TreeNode(7);\n \t\tTreeNode n4 = new TreeNode(4);\n \t\tTreeNode n0 = new TreeNode(0);\n \t\tTreeNode n8 = new TreeNode(8);\n \t\t\n \t\troot.left = n5;\n \t\troot.right = n1;\n \t\tn5.left = n6;\n \t\tn5.right =n2;\n \t\tn2.left = n7;\n \t\tn2.right = n4;\n \t\tn1.left = n0;\n \t\tn1.right = n8;\n \n \t\tint i = 6;\n \t\tint j = 0;\n \t\t\n \t\tSystem.out.println(\"Least common ancestor of \" + i + \" and \" + j + \" is \" + lca(root, i, j));\n }", "private int joinSecnodCase(AVLTree t1, IAVLNode x, AVLTree t2) {\r\n\t\t\t\t int returnValue = 0;\r\n\t\t\t\t IAVLNode curr = t1.getRoot(), parent;\r\n\t\t\t\t \r\n\t\t\t\t while(true) {\r\n\t\t\t\t\t if(curr.getHeight() <= t2.getRoot().getHeight())\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t if(curr.getRight().getHeight() == -1)\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t curr = curr.getRight();\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t parent = curr.getParent();\r\n\t\t\t\t \r\n\t\t\t\t if(t1.getRoot() == curr) {\r\n\t\t\t\t\t curr.setRight(x);\r\n\t\t\t\t\t x.setParent(curr);\r\n\t\t\t\t\t curr.setHeight(curr.getHeight() + 1 );\r\n\t\t\t\t\t return 0;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t returnValue = Math.abs(t2.getRoot().getHeight() - curr.getHeight());\r\n\t\t\t\t \r\n\t\t\t\t //replacing pointers\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(curr);\r\n\t\t\t\t x.setParent(parent);\r\n\t\t\t\t parent.setRight(x);\r\n\t\t\t\t curr.setParent(x);\r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t t2.setRoot(null);\r\n\t\t\t\t t2.setRoot(t1.getRoot());\r\n\t\t\t\t x.setHeight(Math.max(x.getRight().getHeight(), x.getLeft().getHeight()) + 1);\r\n\t\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t\t \r\n\t\t\t\t //t2.minimum = t1.minimum;\r\n\t\t\t\t t2.maximum = t1.maximum;\r\n\t\t\t\t \r\n\t\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t\t HieghtsUpdating(x);\r\n\t\t\t\t SizesUpdate(x);\r\n\t\t\r\n\t\t\t\t return returnValue;\r\n\t\t\t\t}", "public TreeNode lowestCommonAncestor_selfAC(TreeNode root, TreeNode one, TreeNode two) {\n\t\tif (root == null) { \n\t\t\treturn null;\n\t\t}\n\t\tif (one == null) {\n\t\t\treturn two;\n\t\t}\n\t\tif (two == null) {\n\t\t\treturn one;\n\t\t}\n\t\treturn helper(root, one, two);\n\t}", "private static void commonNodesIterInOrd(Node root1,Node root2)\n {\n if(root1 == null || root2 == null) return;\n \n LinkedList<Node> stack1 = new LinkedList<>();\n LinkedList<Node> stack2 = new LinkedList<>();\n \n Node n1 = root1, n2 = root2;\n \n while(true)\n {\n if(n1!=null)\n {\n stack1.push(n1); n1 = n1.left;\n }\n if(n2!=null)\n {\n stack2.push(n2); n2 = n2.left;\n } \n \n if(n1 == null && n2 == null)\n {\n if(stack1.size() == 0 || stack2.size() == 0)\n break;\n \n n1 = stack1.peekFirst(); n2 = stack2.peekFirst();\n \n if(n1.data < n2.data)\n {\n stack1.pop(); n1 = n1.right; n2 = null;\n }\n else if(n1.data > n2.data)\n {\n stack2.pop(); n2 = n2.right; n1 = null;\n }\n else\n {\n stack1.pop(); stack2.pop(); \n System.out.print(n1.data+\" \");\n n1 = n1.right; n2 = n2.right;\n }\n }\n }\n }", "public void LCA(int d1, int d2) {\n this.LCA(this.root, d1, d2);\n this.LCAHeight(this.root, d1, d2);\n this.LCADiameter(this.root, d1, d2);\n }", "public TreeNode LCA(TreeNode root, TreeNode p, TreeNode q) {\n if (root == null || root == p || root == q) {\n return root;\n }\n TreeNode left = LCA(root.left, p, q);\n TreeNode right = LCA(root.right, p, q);\n if (left == null) {\n return right;\n }\n if (right == null) {\n return left;\n }\n return root;\n }", "private boolean compare(TreeNode leftRoot, TreeNode rightRoot) {\n // Good shortcut\n //if(left==null || right==null) return left==right;\n if (leftRoot == null && rightRoot == null) return true;\n if (leftRoot == null || rightRoot == null) return false;\n if (leftRoot.val != rightRoot.val) return false;\n boolean isOutersEqual = compare(leftRoot.left, rightRoot.right);\n boolean isInnersEqual = compare(leftRoot.right, rightRoot.left);\n return isOutersEqual && isInnersEqual;\n }", "public void joinByLeft(AVLNode node, AVLTree hTree, char parentTree) {\n\t\tAVLNode bNode = (AVLNode) hTree.getRoot();\n\t\twhile (bNode.getHeight() > this.getRoot().getHeight()) { // connecting the trees\n\t\t\tbNode = (AVLNode) bNode.getLeft();\n\t\t}\n\t\tnode.setHeight(this.getRoot().getHeight() + 1);\n\t\tnode.setLeft(this.getRoot());\n\t\tthis.getRoot().setParent(node);\n\t\tnode.setRight(bNode);\n\t\tnode.setParent(bNode.getParent());\n\t\tnode.getParent().setLeft(node);\n\t\tnode.getRight().setParent(node);\n\t\t// end of concatenation\n\t\tif (node.getHeight() - node.getRight().getHeight() == 2) {\n\t\t\thTree.case1(node, 1);\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getHeight() == 1) {\n\t\t\tif (parentTree == 'L') {// higher tree is t, not our tree\n\t\t\t\tthis.root = hTree.getRoot();// we need to change our tree's root to the higher tree\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getParent().getRight().getHeight() == 2) {\n\t\t\thTree.singleRotation(node, 'L');\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\tnode.setHeight(node.getHeight() + 1);\n\t\t\tnode.getRight().setHeight(node.getRight().getHeight() + 1);\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.getParent().getHeight() - node.getParent().getRight().getHeight() == 1) {\n\t\t\thTree.case1(node, 1);\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "public static int distanceBetweenNodes(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraulist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Here returning i+1 and j+1 means there are i+1 elements left and j+1 elements left which are not common in \r\n //both ArrayList so answer will be addition of these, it will give us the distance between two nodes\r\n //+1 is two times for two edges between i to LCA and j to LCA\r\n return (i+1) + (j+1);\r\n }", "static Node findNode(Node root, int a, int b, int c) {\n Node x = getLCA(root, a, b);\n\n // lca of b, c\n Node y = getLCA(root, b, c);\n\n // lca of c, a\n Node z = getLCA(root, c, a);\n\n if (x.data == y.data)\n return z;\n else if (x.data == z.data)\n return y;\n else\n return x;\n }", "private static PhyloTreeNode findLeastCommonAncestor(PhyloTreeNode node1, PhyloTreeNode node2) {\n if(node1 == null || node2 == null) {\n return null;\n }\n else{\n String label1 = node1.getLabel();\n String label2 = node2.getLabel();\n if(label1.contains(label2) && (label2.contains(\"+\") || label1.equals(label2)))\n return node1;\n else if(label2.contains(label1) && (label2.contains(\"+\") || label2.equals(label1)))\n return node2;\n else{\n return findLeastCommonAncestor(node1.getParent(), node2.getParent());\n }\n }\n }", "public static void main(String[] args) {\n TreeNode node1 = new TreeNode(4);\n TreeNode node2 = new TreeNode(1);\n TreeNode node3 = new TreeNode(12);\n TreeNode node4 = new TreeNode(3);\n TreeNode node5 = new TreeNode(2);\n TreeNode node6 = new TreeNode(5);\n TreeNode node7 = new TreeNode(3);\n\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node3.right = node7;\n\n\n /*\n * 1\n * 3 2\n */\n TreeNode node11 = new TreeNode(1);\n TreeNode node21 = new TreeNode(3);\n TreeNode node31 = new TreeNode(2);\n\n node11.left = node21;\n node11.right = node31;\n\n /*\n * 1\n * 3 3\n */\n TreeNode node12 = new TreeNode(1);\n TreeNode node22 = new TreeNode(3);\n TreeNode node32 = new TreeNode(3);\n\n node12.left = node22;\n node12.right = node32;\n\n System.out.println(isRoot2SubTreeOfRoot1(node1, node11));\n System.out.println(isRoot2SubTreeOfRoot1(node1, node12));\n }", "private int joinFirstCase(AVLTree t1, IAVLNode x, AVLTree t2) {\r\n\t\t\t int returnValue = 0;\r\n\t\t\t IAVLNode curr = t2.getRoot();\r\n\t\t\t \r\n\t\t\t while(true) {\r\n\t\t\t\t if(curr.getHeight() <= t1.getRoot().getHeight())\r\n\t\t\t\t\t break;\r\n\t\t\t\t if(curr.getLeft().getHeight() == -1)\r\n\t\t\t\t\t break;\r\n\t\t\t\t curr = curr.getLeft();\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t if(t2.getRoot() == curr) {\r\n\t\t\t\t curr.setLeft(x);\r\n\t\t\t\t x.setParent(curr);\r\n\t\t\t\t curr.setHeight(curr.getHeight() + 1 );\r\n\t\t\t\t return 0;\r\n\t\t\t\t\t\t \r\n\t\t\t }\r\n\t\t\t returnValue = t2.getRoot().getHeight() - curr.getHeight();\r\n\t\t\r\n\t\t\t //replacing pointers\r\n\t\t\t x.setRight(curr);\r\n\t\t\t x.setParent(curr.getParent());\r\n\t\t\t curr.getParent().setLeft(x);\r\n\t\t\t curr.setParent(x);\r\n\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t t1.setRoot(t2.getRoot());\r\n\t\t\t x.setHeight(Math.max(x.getRight().getHeight(),x.getLeft().getHeight()) + 1);\r\n\t\t\t \r\n\t\t\t t2.minimum = t1.minimum;\r\n\t\t\t \r\n\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t HieghtsUpdating(x);\r\n\t\t\t SizesUpdate(x);\r\n\t\r\n\t\t\t return returnValue;\r\n\t\t\t \r\n\t\t}", "public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {\n\n int BOTH_DONE = 0;\n int LEFT_DONE = 1;\n int BOTH_PENDING = 2;\n\n Stack<Pair<TreeNode, Integer>> stack = new Stack<>();\n TreeNode LCA = null;\n stack.push(new Pair<>(root, BOTH_PENDING));\n\n while (!stack.isEmpty()) {\n Pair<TreeNode, Integer> topPair = stack.peek();\n if (topPair.second != BOTH_DONE) {\n //mark LCA on first entry, on back track , if reprocess then we'd send LCA incorrectly because\n //same p or q will be repeated when back tracking for example from left path\n if ((topPair.second == BOTH_PENDING) && (topPair.first == p || topPair.first == q)) {\n //node matched\n if (LCA != null) {\n return LCA;\n } else {\n LCA = topPair.first;\n }\n }\n\n //move left or right based on the state of the node\n TreeNode child;\n if (topPair.second == LEFT_DONE) {\n child = topPair.first.right;\n } else {\n child = topPair.first.left;\n }\n stack.pop();\n stack.push(new Pair<>(topPair.first, topPair.second - 1));\n if (child != null)\n stack.push(new Pair<>(child, BOTH_PENDING));\n\n } else {\n //if both childs visited, pop the element and move the LCA to the prior node which\n //was parent of the current node with LCA\n if (LCA == topPair.first) {\n stack.pop();\n LCA = stack.peek().first;\n } else {\n stack.pop();\n }\n }\n }\n return null;\n }", "private static void commonNodesBSTFind(Node r1, Node r2)\n {\n if(r1 == null || r2==null)\n return;\n commonNodesBSTFind(r1.left, r2);\n findNode(r2,r1.data);\n commonNodesBSTFind(r1.right,r2);\n }", "private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}", "public BTNode LCA(BTNode root, BTNode p, BTNode q) \n {\n \t if(root==null || p==null || q == null)\n \t {\n \t \treturn null;\n \t }\n \t \n \t \n \t if(root==p || root==q)\n \t {\n \t return root;\n \t }\n \t \n \t BTNode l = LCA(root.left, p, q);\n \t BTNode r = LCA(root.right, p, q);\n \t \n \t if(l!=null&&r!=null)\n \t {\n \t return root;\n \t }else if(l==null&&r==null)\n \t {\n \t return null;\n \t }else\n \t {\n \t return l==null?r:l;\n \t }\n }", "private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }", "public static boolean isSameBinaryTreeIterativeApproach(Node x, Node y) {\n\t\tif (x == null && y == null) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if first tree is empty (& second tree is non-empty), return false\n\t\tif (x == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if second tree is empty (& first tree is non-empty), return false\n\t\tif (y == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// create a stack to hold Node pairs\n\t\tDeque<Pair<Node, Node>> stack = new ArrayDeque<>();\n\t\tstack.add(Pair.of(x, y));\n\n\t\t// do till stack is not empty\n\t\twhile (!stack.isEmpty()) {\n\t\t\t// pop top pair from the stack and process it\n\t\t\tx = stack.peek().first;\n\t\t\ty = stack.peek().second;\n\t\t\tstack.poll();\n\n\t\t\t// if value of their root node don't match, return false\n\t\t\tif (x.data != y.data) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// if left subtree of both x and y exists, push their addresses\n\t\t\t// to stack else return false if only one left child exists\n\t\t\tif (x.left != null && y.left != null) {\n\t\t\t\tstack.add(Pair.of(x.left, y.left));\n\t\t\t} else if (x.left != null || y.left != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// if right subtree of both x and y exists, push their addresses\n\t\t\t// to stack else return false if only one right child exists\n\t\t\tif (x.right != null && y.right != null) {\n\t\t\t\tstack.add(Pair.of(x.right, y.right));\n\t\t\t} else if (x.right != null || y.right != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if we reach here, both binary trees are identical\n\t\treturn true;\n\t}", "public boolean subtree(TreeNode t1, TreeNode t2)\n {\n if(t2 == null)\n {\n return true;\n }\n \n if(t1 == null)\n {\n return false;\n }\n \n if(t1.data == t2.data)\n {\n if(match(t1, t2))\n {\n return true;\n }\n }\n \n return subtree(t1.left, t2) || subtree(t1.right, t2);\n }", "public TreeNode lowestCommonAncestor(TreeNode root,\n TreeNode one, TreeNode two) {\n if(root == null) return null;\n if(root.key == one.key || root.key == two.key) return root;\n \n TreeNode left = lowestCommonAncestor(root.left, one, two);\n TreeNode right = lowestCommonAncestor(root.right, one, two);\n \n if(left != null && right != null) return root;\n return left == null ? right : left;\n }", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "public static void main(String[] args) {\n Node root = new Node(10);\n root.right = new Node(-3);\n root.right.right = new Node(11);\n\n Node l1 = root.left = new Node(5);\n l1.right = new Node(2);\n l1.right.right = new Node(1);\n\n l1.left = new Node(3);\n l1.left.right = new Node(-2);\n l1.left.left = new Node(3);\n\n int k = 7;\n List<Node> path = new ArrayList<>();\n findPath(root, 7, path); //O(n^2) in worst, O(nlogn) if tree is balanced.\n\n }", "private static void joinWithRoot(AVLTree t1, IAVLNode x, AVLTree t2) \r\n {\t\t\r\n\t\t\t if (t1.getRoot().getKey() < x.getKey() && t2.getRoot().getKey() > x.getKey()) {\r\n\t\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.maximum = t2.maximum; \r\n\t\t\t }\r\n\t\t\t //case 2\r\n\t\t\t else {\r\n\t\t\t\t x.setRight(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.minimum = t2.minimum; \r\n\t\t\t }\r\n\t\t }", "public static void main(String[] args) {\n addNode(3);\n Node ans = lowestCommonAncestorFast(root.left, root.left.right.right);\n System.out.print(ans.val);\n }", "private List<BinaryTreeNode> findAncestor(BinaryTreeNode head, BinaryTreeNode node1, BinaryTreeNode node2) {\n if (head == null) {\n return new ArrayList<BinaryTreeNode>();\n }\n\n List<BinaryTreeNode> leftSearch = findAncestor(head.getLeft(), node1, node2);\n List<BinaryTreeNode> rightSearch = findAncestor(head.getRight(), node1, node2);\n\n leftSearch.addAll(rightSearch);\n if (leftSearch.contains(node1) && leftSearch.contains(node2)) {\n if (leftSearch.size() == 2) {\n leftSearch.add(head);\n }\n return leftSearch;\n }\n\n if (head.getValue() == node1.getValue() || head.getValue() == node2.getValue()) {\n leftSearch.add(head);\n }\n return leftSearch;\n }", "public static void test13() {\n\t\tTreeNodeP n1 =new TreeNodeP(1);\n\t\tTreeNodeP n2 =new TreeNodeP(2);\n\t\tTreeNodeP n3 =new TreeNodeP(3);\n\t\tTreeNodeP n4 =new TreeNodeP(4);\n\t\tTreeNodeP n5 =new TreeNodeP(5);\n\t\tTreeNodeP n6 =new TreeNodeP(6);\n\t\tTreeNodeP n7 =new TreeNodeP(7);\n\t\tTreeNodeP n8 =new TreeNodeP(8);\n\t\t\n\t\tn1.left = n2;\n\t\tn1.right = n3;\n\t\t\n\t\tn2.left = n4;\n\t\tn2.right = n5;\n\t\t\n\t\tn3.left = n6; \n\t\tn3.right = n7;\n\t\t\n\t\tn4.left = n8;\n\t\t\n\t\tn2.parent = n1;\n\t\tn3.parent = n1;\n\t\t\n\t\tn4.parent = n2;\n\t\tn5.parent = n2;\n\t\t\n\t\tn6.parent = n3;\n\t\tn7.parent = n3;\n\t\t\n\t\tn8.parent = n4;\n\t\t\n\t\tTreeNodeP n9 = new TreeNodeP(9);\n\t\tTreeNodeP lca = task13_LCA(n1, n7);\n\t\tif (lca != null) {\n\t\t\tSystem.out.println(\"lca.value = \" + lca.val);\n\t\t} else {\n\t\t\tSystem.out.println(\"LCA is null\");\n\t\t}\n\t\t\n\t}", "public static int distanceBetweenNodes(Node node, int d1, int d2){\n ArrayList<Integer> al1= nodeToRootPath(node,d1);\n ArrayList<Integer> al2=nodeToRootPath(node,d2);\n\n if(al1.size()==0 || al2.size()==0)\n return -1;\n int l1=al1.size()-1;\n int l2=al2.size()-1;\n\n while(l1>=0 && l2>=0)\n {\n if(al1.get(l1)==al2.get(l2))\n {\n l1--;l2--;continue;\n }\n else break;\n }\n return l1+l2+2;\n }", "private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }", "static void fillMap(TreeNode root, int d, int l) \n\t{ \n\t if(root == null) return; \n\t \n\t if(m.get(d) == null) \n\t { \n\t m.put(d, new PairNode(root.data, l)); \n\t } \n\t else if(m.get(d).second>l) \n\t { \n\t m.put(d, new PairNode(root.data, l)); \n\t } \n\t \n\t fillMap(root.left, d - 1, l + 1); \n\t fillMap(root.right, d + 1, l + 1); \n\t}", "private void checkMinKeys(BTreeNode<T> currentNode) {\n BTreeNode<T> parent = findParent(root, currentNode);\n int indexCurrentChild = getIndexChild(parent, currentNode);\n\n BTreeNode<T> leftBrother;\n BTreeNode<T> rightBrother;\n\n //Dependiendo del indice del hijo se realizaran las operaciones\n //de prestamo y union\n switch (indexCurrentChild) {\n \n //Si el indice es 0 solo tiene hermano derecho por ende\n //las operaciones se realizan con el hermano derecho\n case 0 -> {\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n //Si el hermano derecho tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, rightBrother, indexCurrentChild + 1, 1);\n }\n }\n \n //Si el indice es 5 solo tiene hermano izquierdo por ende las\n //operaciones solo se pueden realizar con el hermano izquierdo\n case 5 -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n\n //Si el hermano izquierdo tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n \n //Si el indice es cualquier otro las operaciones se pueden realizar\n //tanto con el hermano derecho como con el hermano izquierdo\n default -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n // Si cualquiera de los dos hermanos tiene mas de 2 llaves se\n //toma una de ellas, de lo contrario se realiza una union con\n //el hermano izquierdo.\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n }\n\n //Despues de realizar las operaciones en el nodo hijo se valida que \n //el nodo padre no quede con menos de 2 llaves\n if (parent != root && parent.getNumKeys() < 2) {\n checkMinKeys(parent);\n }\n }", "private String longestCommonPrefix(String[] strs, int left, int right) {\n if (left == right) {\n return strs[left];\n } else {\n int mid = left + (right - left) / 2;\n String leftPrefix = longestCommonPrefix(strs, left, mid);\n String rightPrefix = longestCommonPrefix(strs, mid + 1, right);\n return commonPrefix(leftPrefix, rightPrefix);\n }\n }", "double treeNodeSplitCost(treeNode node, Point centreA, Point centreB){\n\t\t//loop counter variable\n\t\tint i;\n\t\t\n\t\t//stores the cost\n\t\tdouble sum = 0.0;\n\t\t\n\t\tfor(i=0; i<node.n; i++){\n\t\t\t//loop counter variable\n\t\t\tint l;\t\n\n\t\t\t//stores the distance between p and centreA\n\t\t\tdouble distanceA = 0.0;\n\n\t\t\tfor(l=0;l<node.points[i].dimension;l++){\n\t\t\t\t//centroid coordinate of the point\n\t\t\t\tdouble centroidCoordinatePoint;\n\t\t\t\tif(node.points[i].weight != 0.0){\n\t\t\t\t\tcentroidCoordinatePoint = node.points[i].coordinates[l] / node.points[i].weight;\n\t\t\t\t} else {\n\t\t\t\t\tcentroidCoordinatePoint = node.points[i].coordinates[l];\n\t\t\t\t}\n\t\t\t\t//centroid coordinate of the centre\n\t\t\t\tdouble centroidCoordinateCentre;\n\t\t\t\tif(centreA.weight != 0.0){\n\t\t\t\t\tcentroidCoordinateCentre = centreA.coordinates[l] / centreA.weight;\n\t\t\t\t} else {\n\t\t\t\t\tcentroidCoordinateCentre = centreA.coordinates[l];\n\t\t\t\t}\n\n\t\t\t\tdistanceA += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t\t}\n\n\t\t\t//stores the distance between p and centreB\n\t\t\tdouble distanceB = 0.0;\n\n\t\t\tfor(l=0;l<node.points[i].dimension;l++){\n\t\t\t\t//centroid coordinate of the point\n\t\t\t\tdouble centroidCoordinatePoint;\n\t\t\t\tif(node.points[i].weight != 0.0){\n\t\t\t\t\tcentroidCoordinatePoint = node.points[i].coordinates[l] / node.points[i].weight;\n\t\t\t\t} else {\n\t\t\t\t\tcentroidCoordinatePoint = node.points[i].coordinates[l];\n\t\t\t\t}\n\t\t\t\t//centroid coordinate of the centre\n\t\t\t\tdouble centroidCoordinateCentre;\n\t\t\t\tif(centreB.weight != 0.0){\n\t\t\t\t\tcentroidCoordinateCentre = centreB.coordinates[l] / centreB.weight;\n\t\t\t\t} else {\n\t\t\t\t\tcentroidCoordinateCentre = centreB.coordinates[l];\n\t\t\t\t}\n\n\t\t\t\tdistanceB += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t\t}\n\n\t\t\t//add the cost of the closest centre to the sum\n\t\t\tif(distanceA < distanceB){\n\t\t\t\tsum += distanceA*node.points[i].weight;\n\t\t\t} else {\n\t\t\t\tsum += distanceB*node.points[i].weight;\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t//return the total cost\n\t\treturn sum;\n\n\t}", "public void joinByRight(AVLNode node, AVLTree lTree, char parentTree) {\n\t\tAVLNode bNode = (AVLNode) this.getRoot();\n\t\twhile (bNode.getHeight() > lTree.getRoot().getHeight()) { // connecting the trees\n\t\t\tbNode = (AVLNode) bNode.getRight();\n\t\t}\n\t\tnode.setHeight(lTree.getRoot().getHeight() + 1);\n\t\tnode.setRight(lTree.getRoot());\n\t\tlTree.getRoot().setParent(node);\n\t\tnode.setLeft(bNode);\n\t\tnode.setParent(bNode.getParent());\n\t\tnode.getParent().setRight(node);\n\t\tnode.getLeft().setParent(node);\n\t\t// end of concatenation\n\t\tif (node.getHeight() - node.getLeft().getHeight() == 2) {\n\t\t\tthis.case1(node, 2);\n\t\t\tif (parentTree == 'R') {\n\t\t\t\tlTree.root = this.root;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getHeight() == 1) {\n\t\t\tif (parentTree == 'R') {// higher tree is t, not our tree\n\t\t\t\tlTree.root = this.getRoot();// we need to change our tree's root to the higher tree\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getParent().getLeft().getHeight() == 2) {\n\t\t\tthis.singleRotation(node, 'R');\n\t\t\tif (parentTree == 'R') {\n\t\t\t\tlTree.root = this.root;\n\t\t\t}\n\t\t\tnode.setHeight(node.getHeight() + 1);\n\t\t\tnode.getLeft().setHeight(node.getLeft().getHeight() + 1);\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.getParent().getHeight() - node.getParent().getLeft().getHeight() == 1) {\n\t\t\tthis.case1(node, 2);\n\t\t\tif (parentTree == 'R') {\n\t\t\t\tlTree.root = this.root;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "void printKeysInGvnRange(Node node, int k1, int k2) {\n\n\t\t/* base case */\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Since the desired o/p is sorted, recurse for left subtree first If\n\t\t * root->data is greater than k1, then only we can get o/p keys in left\n\t\t * subtree\n\t\t */\n\t\tif (k1 < node.key) {\n\t\t\tprintKeysInGvnRange(node.left, k1, k2);\n\t\t}\n\n\t\t/* if root's data lies in range, then prints root's data */\n\t\tif (k1 <= node.key && k2 >= node.key) {\n\t\t\tSystem.out.print(node.key + \" \");\n\t\t}\n\n\t\t/*\n\t\t * If root->data is smaller than k2, then only we can get o/p keys in\n\t\t * right subtree\n\t\t */\n\t\tif (k2 > node.key) {\n\t\t\tprintKeysInGvnRange(node.right, k1, k2);\n\t\t}\n\t}", "public TreeNode lowestCommonAncestor1(TreeNode root, TreeNode p, TreeNode q) {\n\t\tif(root == null || root == p || root == q) return root;\n\t\tboolean pOnLeft = exists(root.left, p);\n\t\tboolean pOnRight = exists(root.right, p);\n\n\t\tboolean qOnLeft = exists(root.left, q);\n\t\tboolean qOnRight = exists(root.right, q);\n\n\n\t\tif((pOnLeft & qOnRight) || (qOnLeft & pOnRight)) {System.out.println(\"LCA found...\"); return root;}\n\t\telse if(pOnLeft & qOnLeft) {System.out.println(\"Inside left...\"); return lowestCommonAncestor(root.left, p, q);}\n\t\telse if(pOnRight & qOnRight) {System.out.println(\"Inside right...\"); return lowestCommonAncestor(root.right, p, q);}\n\t\treturn null;\n\t}", "public int join(IAVLNode x, AVLTree t)\r\n\t{\r\n\t\r\n\t\tint heighDiff = 0;\r\n\t\tif(this.empty()) {\r\n\t\t\tthis.root.setParent(x);\r\n\t\t\tthis.minimum = x;\r\n\t\t\tthis.maximum = x;\r\n\t\t\tif(t.empty()) {// both trees are empty\r\n\t\t\t\tthis.setRoot(x);\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\t }\t\r\n\t\tif(t.empty()) {\r\n\t\t\tt.root.setParent(x);\r\n\t\t\tt.minimum = x;\r\n\t\t\tt.maximum = x;\r\n\t\t}\r\n\t\t //both tree same height or 1\r\n\t\theighDiff = Math.abs(this.getRoot().getHeight() - t.getRoot().getHeight());\r\n\t\t if(heighDiff <= 1) {\r\n\t\t\t\t joinWithRoot(this,x,t);\r\n\t\t\t\t return heighDiff + 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t//case 1: keys(x,t) > keys() \r\n\t\t if(this.getRoot().getKey() <= x.getKey() && t.getRoot().getKey() >= x.getKey()) {\r\n\t\t // 1.1 : this tree is lower then t INPUT\r\n\t\t\t if(this.getRoot().getHeight() < t.getRoot().getHeight()) \r\n\t\t\t\t return 1 + joinFirstCase(this,x,t);\r\n\t\t \t\t// 1.2: this tree is higher then t INPUT\r\n\t\t\t else\r\n\t\t\t\t return 1 + joinSecnodCase(this,x,t);\r\n\t\t \r\n\t\t\t }\r\n\t\t\t //case 2: keys(x,t) < keys()\r\n\t\t else {\r\n\t\t\t if(this.getRoot().getHeight() < t.getRoot().getHeight()) \r\n\t\t\t\t return 1 + joinSecnodCase(t,x,this);\r\n\t\t \t\t// 1.2: this tree is higher then t INPUT\r\n\t\t\t else\r\n\t\t\t\t return 1 + joinFirstCase(t,x,this);\r\n\t\t }\r\n\t\t }", "public String lca(E a, E b) {\n\n // one of the items is not in the tree, so the other is its own ancestor\n if (!exists(root, a) || !exists(root, b)) {\n if (exists(root, a)) return a.toString();\n else return b.toString();\n }\n BinaryNode<E> ancestor = null;\n if (a.compareTo(b) < 0) {\n ancestor = lca(root, a, b);\n } else {\n ancestor = lca(root, b, a);\n }\n if (ancestor == null) return \"none\";\n else return ancestor.toString();\n }", "public TreeNode lowestCommonAncestor(TreeNode root, TreeNode one, TreeNode two) {\n\t\t// Assumptions: root is not null, one and two guaranteed to be in the tree and not null.\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\t// if root is one or two, we can ignore the later recursions.\n\t\tif (root == one || root == two) {\n\t\t\treturn root;\n\t\t}\n\t\tTreeNode ll = lowestCommonAncestor(root.left, one, two);\n\t\tTreeNode lr = lowestCommonAncestor(root.right, one, two);\n\t\tif (ll != null && lr != null) {\n\t\t\treturn root;\n\t\t}\n\t\treturn ll == null ? lr : ll;\n\t}", "private BSTNode<K> insertNode(BSTNode<K> currentNode, K key) \n throws DuplicateKeyException, IllegalArgumentException {\n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, create a new node, because of reaching a leaf\n if (currentNode == null) {\n BSTNode<K> newNode = new BSTNode<K>(key);\n return newNode;\n }\n // otherwise, keep searching through the tree until meet a leaf, or find a duplicated node \n else {\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(insertNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(insertNode(currentNode.getRightChild(), key));\n break;\n default:\n throw new DuplicateKeyException(\"A node with the same value is already existed\");\n }\n // after update currentNode's left and right childNote, let's check currentNode's balanceValue\n // ancestor two levels away from a lead node, its absolute balanceValue may exceeds 1,\n // so codes below has meaning for it \n int balanceValue = getNodeBalance(currentNode); \n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n switch (key.compareTo(currentNode.getLeftChild().getId())) {\n case -1: // after Left Left Case, balance is updated, so sent currentNode to its ancestor \n return rotateRight(currentNode); \n case 1: // after Left Right Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n switch (key.compareTo(currentNode.getRightChild().getId())){\n case 1: // after Right Right Case, balance is updated, so sent currentNode to its ancestor \n return rotateLeft(currentNode);\n case -1: // after Right Left Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n } \n }\n }\n // for leaf node's balanceValue == 0, and for -1 <= leaf node's first ancestor's balanceValue <= 1,\n // codes above(from balanceValue) has no meaning for it, return currentNode straight forward\n return currentNode;\n }", "private Node<K, V> balance() {\n if (this.isBlack()) {\n // PATTERN 1 & 2\n if (!this.getLeft().isEmpty()\n && !this.getLeft().isBlack()) {\n BinarySearchTree<K, V> l = this.getLeft();\n //////////////////////////////\n // PATTERN 1 : Left -> Left //\n //////////////////////////////\n if (!l.getLeft().isEmpty() \n && !l.getLeft().isBlack()) {\n return new Node<K, V>(l.getKey(), \n l.getValue(), \n this.c, // was l.c \n l.getLeft().makeBlack(),\n new Node<K, V>(this.key, \n this.value,\n this.c,\n l.getRight(),\n this.getRight(),\n true),\n false);\n }\n //////////////////////////////\n // PATTERN 2: Left -> Right //\n //////////////////////////////\n else if (!l.getRight().isEmpty() \n && !l.getRight().isBlack()) {\n BinarySearchTree<K, V> lr = l.getRight();\n \n return new Node<K, V>(lr.getKey(),\n lr.getValue(),\n this.c, // was lr.c\n new Node<K, V>(l.getKey(),\n l.getValue(),\n this.c, // was l.c\n l.getLeft(),\n lr.getLeft(),\n true),\n new Node<K, V>(this.key,\n this.value,\n this.c,\n lr.getRight(),\n this.getRight(),\n true),\n false);\n }\n }\n // PATTERN 3 & 4\n else if (!this.getRight().isEmpty()\n && !this.getRight().isBlack()) {\n BinarySearchTree<K, V> r = this.getRight();\n ///////////////////////////////\n // PATTERN 3: Right -> Right //\n ///////////////////////////////\n if (!r.getRight().isEmpty() \n && !r.getRight().isBlack()) {\n return new Node<K, V>(r.getKey(),\n r.getValue(),\n this.c, // was r.c\n new Node<K, V>(this.key,\n this.value,\n this.c,\n this.getLeft(),\n r.getLeft(),\n true),\n r.getRight().makeBlack(),\n false);\n }\n //////////////////////////////\n // PATTERN 4: Right -> Left //\n //////////////////////////////\n else if (!r.getLeft().isEmpty() \n && !r.getLeft().isBlack()) {\n BinarySearchTree<K, V> rl = r.getLeft();\n \n return new Node<K, V>(rl.getKey(),\n rl.getValue(),\n this.c, // was rl.c\n new Node<K, V>(this.key,\n this.value,\n this.c,\n this.getLeft(),\n rl.getLeft(),\n true),\n new Node<K, V>(r.getKey(),\n r.getValue(),\n this.c, // was r.c\n rl.getRight(),\n r.getRight(),\n true),\n false);\n }\n }\n }\n return this;\n }", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "public static synchronized TreeMap intersect(TreeMap left, TreeMap right)\n\t throws IcofException {\n\n\tString funcName = new String(\"intersect(TreeMap, TreeMap)\");\n\n\tTreeMap intersection = new TreeMap();\n\n\ttry {\n\n\t // the third parm 'false' means that not only are keys but olso\n\t // values are\n\t // compared to determine sameness for inclusion in the intersection.\n\t intersection = intersect(left, right, false);\n\n\t} catch (Exception e) {\n\t IcofException ie = new IcofException(CLASS_NAME, funcName,\n\t\t IcofException.SEVERE,\n\t\t \"Error creating intersection of TreeMaps \", \"\");\n\t throw (ie);\n\t}\n\n\treturn intersection;\n }", "void isABST(Node root, BSTNode correcttree){\n \n //the boolean value is a global variable and is set to false if there are any descrepencies. \n if(root.data != correcttree.data){\n isThisABST = false;\n } else {\n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.left != null && correcttree.left == null){\n isThisABST = false;\n } else if(root.left == null && correcttree.left != null){\n isThisABST = false;\n } else if(root.left != null & correcttree.left != null){\n isABST(root.left, correcttree.left);\n }\n \n //If one node is null and the other is not, set to false, otherwise just pass next nodes\n //to the function. \n if(root.right != null && correcttree.right == null){\n isThisABST = false;\n } else if(root.right == null && correcttree.right != null){\n isThisABST = false;\n } else if( root.right != null && correcttree.right != null){\n isABST(root.right, correcttree.right);\n }\n }\n \n \n }", "void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "private static boolean helper(TreeNode left, TreeNode right) {\n \tif(left == null || right == null){\n \t\treturn left == right;\n \t}\n \tif(left.val != right.val){\n \t\treturn false;\n \t}\n\t\treturn helper(left.right,right.left) && helper(left.left,right.right);\n\t}", "public TreeNode LCAForBST0(TreeNode root, TreeNode p, TreeNode q) {\n if (p.val > q.val) {\n TreeNode tmp = p;\n p = q;\n q = tmp;\n }\n if (root.val > q.val) {\n return LCAForBST0(root.left, p, q);\n } else if (root.val < p.val) {\n return LCAForBST0(root.right, p, q);\n } else {\n return root;\n }\n }", "private IAVLNode findSuccessor(IAVLNode node) \r\n\t {\r\n\t\t if(node.getRight().getHeight() != -1) \r\n\t\t\t return minPointer(node.getRight());\r\n\t\t IAVLNode parent = node.getParent();\r\n\t\t while(parent.getHeight() != -1 && node == parent.getRight())\r\n\t\t {\r\n\t\t\t node = parent;\r\n\t\t\t parent = node.getParent();\r\n\t\t }\r\n\t\t return parent;\t \r\n\t\t}", "public AVLNode findSuccessor(IAVLNode node) {\n\n\t\tif (node.getRight().getHeight() != -1) {\n\t\t\tAVLTree subtree = new AVLTree(node.getRight());\n\t\t\treturn subtree.findMin();\n\t\t}\n\t\tAVLNode parent = (AVLNode) node.getParent();\n\t\tAVLNode ourNode = (AVLNode) node;\n\t\twhile (parent.getHeight() != -1 && parent == ourNode.getParent() && ourNode.parentSide() != 'L') {\n\t\t\tourNode = parent;\n\t\t\tparent = (AVLNode) ourNode.getParent();\n\t\t}\n\t\treturn parent;\n\t}", "public TreeNode lowestCommonAncestor2(TreeNode root, TreeNode p, TreeNode q) {\r\n\t\t if(root == null || p == root || q == root)\r\n\t return root;\r\n\t \r\n\t TreeNode left = lowestCommonAncestor(root.left, p, q);\r\n\t TreeNode right = lowestCommonAncestor(root.right, p, q);\r\n\t \r\n\t if(left == null && right != null) { // both on right\r\n\t return right;\r\n\t }\r\n\t if(right == null && left != null) { // both on left\r\n\t return left;\r\n\t }\r\n\t if(right == null && left == null) { // not in left and right\r\n\t return null;\r\n\t }\r\n\t return root; // right != null && left != null, one in left, one in right\r\n\t }", "public String searchLCSPal(int left, int right) {\n List<Integer> key = new ArrayList<Integer>(2);\n key.add(left);\n key.add(right);\n // check for exit conditions\n // left and right cross each other or are equal\n if (left > right || right < left) {\n return \"\";\n }\n // if not, we compute its result\n if (!this.Memoize.containsKey(key)) {\n // assume the substring is a palindrome until proven other wise\n // it uses the endIndex as a countable int - strange but ok (e.g. why i use right + 1)\n String result = this.String.substring(left, right + 1);\n // check if the left and right substring is a palindrome\n // we don't need to compare the size because we know that anything\n // below in the rescursed calls will have smaller ranges\n if (!this.isPalindrome(result)) {\n // recurse into the 2 options of incrementing left\n // or decrementing right and pick witch one to select\n if (this.searchLCSPal(left + 1, right).length() > this.searchLCSPal(left, right - 1).length()) {\n result = this.searchLCSPal(left + 1, right);\n } else {\n result = this.searchLCSPal(left, right - 1);\n }\n }\n // cache the value\n this.Memoize.put(key, result);\n }\n // return the cached entry\n return this.Memoize.get(key);\n }", "public int checkLR(RBNode<T, E> node) {\r\n\r\n\t\tif (node.uniqueKey.compareTo(this.root.uniqueKey) < 0) {\r\n\t\t\t// Must be Left\r\n\t\t\treturn -1;\r\n\t\t} else if (node.uniqueKey.compareTo(this.root.uniqueKey) > 0) {\r\n\t\t\t// Must be Right\r\n\t\t\treturn 1;\r\n\t\t} else {\r\n\t\t\t// Must be Equal\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}", "public Data poll(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n if (next == null) {\n return null;\n } else {\n var ret = next.data;\n\n if (next.right != null && next.left != null) {\n int predHeight = 0;\n var pred = next.right;\n var predP = next;\n while (pred.left != null) {\n predP = pred;\n pred = pred.left;\n predHeight++;\n }\n\n int succHeight = 0;\n var succ = next.left;\n var succP = next;\n while (succ.right != null) {\n succP = succ;\n succ = succ.right;\n succHeight++;\n }\n \n Node newNode;\n Node newNodeP;\n Node newNodeS;\n if (succHeight > predHeight) {\n newNode = succ;\n newNodeP = succP;\n newNodeS = succ.left;\n } else {\n newNode = pred;\n newNodeP = predP;\n newNodeS = succ.right;\n }\n\n if (newNodeP.right == newNode) {\n newNodeP.right = newNodeS;\n } else {\n newNodeP.left = newNodeS;\n }\n\n next.key = newNode.key;\n next.data = newNode.data;\n } else {\n var child = next.right == null ? next.left\n : next.right;\n if (next == root) {\n root = child;\n } else {\n if (curr.left == next) {\n curr.left = child;\n } else {\n curr.right = child;\n }\n }\n }\n return ret;\n }\n }", "public static int CmpAscendancy( TaxoNode node1, TaxoNode node2 ) {\r\n\t\tif( node1 == null || node2 == null )\r\n\t\t\tthrow new RuntimeException( \"Bad node passed to CmpAscendancy\" );\r\n\t\tTaxoNode par = node1.parent;\r\n\t\twhile( par != null ) {\r\n\t\t\tif( par == node2 )\r\n\t\t\t\treturn 1; // Tag 2 is ascendant of tag1\r\n\t\t\tpar = par.parent;\r\n\t\t}\r\n\t\t// Okay, so tag2 is not above tag1. Look the other way\r\n\t\tpar = node2.parent;\r\n\t\twhile( par != null ) {\r\n\t\t\tif( par == node1 )\r\n\t\t\t\treturn -1; // Tag1 is ascendant of tag2\r\n\t\t\tpar = par.parent;\r\n\t\t}\r\n\t\t// If we got here, the nodes are not related\r\n\t\treturn 0;\r\n\t}", "public void searchByRange(Integer currentLine, int k1, int k2) {\r\n\t\t//Check if user typed values k1>k2 and swap if needed\r\n\t\tif(k1>k2) {\r\n\t\t\t//Temporary variable for storing k1 value\r\n\t\t\tint temp=k1;\r\n\t\t\t//Swap values of k1 & k2\r\n\t\t\tk1=k2;\r\n\t\t\tk2=temp;\r\n\t\t}\r\n\t\t//Base case\r\n\t\tif(increaseCompares() && currentLine==-1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//Recurse for left subtree first\r\n\t\tif(increaseCompares() && k1<getKey(currentLine)) {\r\n\t\t\tsearchByRange(getLeft(currentLine),k1,k2);\r\n\t\t}\r\n\t\t//If node's data lies in range, then print data\r\n\t\tif(increaseCompares() && (k1<=getKey(currentLine) && k2>=getKey(currentLine))) {\r\n\t\t\tSystem.out.print(getKey(currentLine)+ \",\");\r\n\t\t}\r\n\t\t//Recurse for right subtree\r\n\t\tif(increaseCompares() && k2>getKey(currentLine)) {\r\n\t\t\tsearchByRange(getRight(currentLine),k1,k2);\r\n\t\t}\r\n\t}", "public static Node rightAncestor(Node node) {\n\n\n if(node.parent!=null){\n if(node.key>node.parent.key){ // หา parent ตัวแรกี่มีคค่ามากกว่า\n return rightAncestor(node.parent);\n }\n else {return node.parent;}\n }else{return null;}//////\n }", "private static <V> IntTree<V> rebalanced(\n final long key, final V value, final IntTree<V> left, final IntTree<V> right) {\n if (left.size + right.size > 1) {\n if (left.size >= OMEGA * right.size) { // rotate to the right\n IntTree<V> ll = left.left, lr = left.right;\n if (lr.size < ALPHA * ll.size) // single rotation\n return new IntTree<V>(\n left.key + key,\n left.value,\n ll,\n new IntTree<V>(-left.key, value, lr.withKey(lr.key + left.key), right));\n else { // double rotation:\n IntTree<V> lrl = lr.left, lrr = lr.right;\n return new IntTree<V>(\n lr.key + left.key + key,\n lr.value,\n new IntTree<V>(-lr.key, left.value, ll, lrl.withKey(lrl.key + lr.key)),\n new IntTree<V>(\n -left.key - lr.key, value, lrr.withKey(lrr.key + lr.key + left.key), right));\n }\n } else if (right.size >= OMEGA * left.size) { // rotate to the left\n IntTree<V> rl = right.left, rr = right.right;\n if (rl.size < ALPHA * rr.size) // single rotation\n return new IntTree<V>(\n right.key + key,\n right.value,\n new IntTree<V>(-right.key, value, left, rl.withKey(rl.key + right.key)),\n rr);\n else { // double rotation:\n IntTree<V> rll = rl.left, rlr = rl.right;\n return new IntTree<V>(\n rl.key + right.key + key,\n rl.value,\n new IntTree<V>(\n -right.key - rl.key, value, left, rll.withKey(rll.key + rl.key + right.key)),\n new IntTree<V>(-rl.key, right.value, rlr.withKey(rlr.key + rl.key), rr));\n }\n }\n }\n // otherwise already balanced enough:\n return new IntTree<V>(key, value, left, right);\n }", "AVLNode llCase(AVLNode Node){\r\n\t\t\r\n\t\tAVLNode childL = Node.left;\r\n\t\tNode.left = childL.right;\r\n\t\tchildL.right = Node;\r\n\t\treturn childL;\r\n\t}", "private TreeNode cBST(int begin,int end){\n\n if(begin >= end){ return null;}\n\n int index = (begin + end)/2;\n\n //Left-Visit\n TreeNode l = cBST(begin,index);\n\n //Middle-Visit\n TreeNode root = new TreeNode(cur.val);\n root.left = l;\n cur = cur.next;\n\n //Right-Visit\n TreeNode r = cBST(index+1,end);\n\n //Post-Process and return values\n root.right = r;\n return root;\n }", "@Test\n public void differentLinearGraphsTest() throws Exception {\n EventNode[] g1Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"d\" });\n\n EventNode[] g2Nodes = getChainTraceGraphNodesInOrder(new String[] {\n \"a\", \"b\", \"c\", \"e\" });\n\n // ///////////////////\n // g1 and g2 are k-equivalent at first three nodes for k=1,2,3\n // respectively, but no further. Subsumption follows the same pattern.\n\n // \"INITIAL\" not at root:\n testKEqual(g1Nodes[0], g2Nodes[0], 1);\n testKEqual(g1Nodes[0], g2Nodes[0], 2);\n testKEqual(g1Nodes[0], g2Nodes[0], 3);\n testKEqual(g1Nodes[0], g2Nodes[0], 4);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 5);\n testNotKEqual(g1Nodes[0], g2Nodes[0], 6);\n\n // \"a\" node at root:\n testKEqual(g1Nodes[1], g2Nodes[1], 1);\n testKEqual(g1Nodes[1], g2Nodes[1], 2);\n testKEqual(g1Nodes[1], g2Nodes[1], 3);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 4);\n testNotKEqual(g1Nodes[1], g2Nodes[1], 5);\n\n // \"b\" node at root:\n testKEqual(g1Nodes[2], g2Nodes[2], 1);\n testKEqual(g1Nodes[2], g2Nodes[2], 2);\n testNotKEqual(g1Nodes[2], g2Nodes[2], 3);\n\n // \"c\" node at root:\n testKEqual(g1Nodes[3], g2Nodes[3], 1);\n testNotKEqual(g1Nodes[3], g2Nodes[3], 2);\n\n // \"d\" and \"e\" nodes at root:\n testNotKEqual(g1Nodes[4], g2Nodes[4], 1);\n }", "public static void main(String args[]) {\n LowestCommonAncestor tree = new LowestCommonAncestor();\n tree.root = new Node(20);\n tree.root.left = new Node(8);\n tree.root.right = new Node(22);\n tree.root.left.left = new Node(4);\n tree.root.left.right = new Node(12);\n tree.root.left.right.left = new Node(10);\n tree.root.left.right.right = new Node(14);\n\t\n Node an1 = ancestorNode(tree.root, 22, 8);\n System.out.println(\"The lowest common ancestor of 22 and 8 is \"+an1.data);\n Node an2 = ancestorNode(tree.root, 14, 8);\n System.out.println(\"The lowest common ancestor of 14 and 8 is \"+an2.data);\n\t}", "public int join(IAVLNode x, AVLTree t) {\n\t\tif (this.empty() && t.empty()) {\n\t\t\tthis.root = x;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (this.empty()) {// t is not empty\n\t\t\tint comp = t.getRoot().getHeight() + 1;\n\t\t\tt.insert(x.getKey(), x.getValue());\n\t\t\tthis.root = t.root;\n\t\t\treturn comp;\n\t\t}\n\n\t\tif (t.empty()) {// this is not empty\n\t\t\tint comp = this.getRoot().getHeight() + 1;\n\t\t\tthis.insert(x.getKey(), x.getValue());\n\t\t\treturn comp;\n\t\t}\n\n\t\tint thisRank = this.getRoot().getHeight();\n\t\tint otherRank = t.getRoot().getHeight();\n\t\tif (thisRank == otherRank) {\n\t\t\tif (this.getRoot().getKey() < x.getKey()) {\n\t\t\t\tx.setLeft(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setRight(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getLeft().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t} else {// this.getRoot().getKey() > x.getKey()\n\t\t\t\tx.setRight(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setLeft(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getRight().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t}\n\t\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t\t} // if we got here, than the trees aren't in the same height\n\t\tboolean newIsHigher;\n\t\tboolean newIsBigger;\n\t\tnewIsHigher = (this.getRoot().getHeight() < t.getRoot().getHeight());\n\t\tnewIsBigger = (this.getRoot().getKey() < this.getRoot().getKey());\n\t\tAVLNode tempX = (AVLNode) x;\n\t\tif (newIsHigher && newIsBigger) {\n\t\t\tt.joinByLeft(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && !newIsBigger) {\n\t\t\tthis.joinByLeft(tempX, t, 'L');\n\t\t}\n\t\tif (newIsHigher && !newIsBigger) {\n\t\t\tt.joinByRight(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && newIsBigger) {\n\t\t\tthis.joinByRight(tempX, t, 'L');\n\t\t}\n\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t}", "public int insert(int newKey){\n int i=n-1;\n int x =0;\n if (isLeaf){\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i]) \n return -1;//duplicate return withoiut doinganything\n key[i+1] = key[i];\n i--;\n \n }\n if(x>=0){\n n++;\n key[i+1]=newKey;\n }\n }\n else{\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i])\n return -1;// find duplictte return without doing anithing \n \n else\n i--;\n }\n if(x>=0){\n \n int insertChild = i+1; // Subtree where new key must be inserted\n if (c[insertChild].isFull()){\n x++;// one more node.\n // The root of the subtree where new key will be inserted has to be split\n // We promote the mediand of that root to the current node and\n // update keys and references accordingly\n \n //System.out.println(\"This is the full node we're going to break \");// Debugging code\n //c[insertChild].printNodes();\n //System.out.println(\"going to promote \" + c[insertChild].key[T-1]);\n n++;\n c[n]=c[n-1];\n for(int j = n-1;j>insertChild;j--){\n c[j] =c[j-1];\n key[j] = key[j-1];\n }\n key[insertChild]= c[insertChild].key[T-1];\n c[insertChild].n = T-1;\n \n BTreeNode newNode = new BTreeNode(T);\n for(int k=0;k<T-1;k++){\n newNode.c[k] = c[insertChild].c[k+T];\n newNode.key[k] = c[insertChild].key[k+T];\n }\n \n newNode.c[T-1] = c[insertChild].c[2*T-1];\n newNode.n=T-1;\n newNode.isLeaf = c[insertChild].isLeaf;\n c[insertChild+1]=newNode;\n \n //System.out.println(\"This is the left side \");\n //c[insertChild].printNodes(); \n //System.out.println(\"This is the right side \");\n //c[insertChild+1].printNodes();\n //c[insertChild+1].printNodes();\n \n if (newKey <key[insertChild]){\n c[insertChild].insert(newKey); }\n else{\n c[insertChild+1].insert(newKey); }\n }\n else\n c[insertChild].insert(newKey);\n }\n \n \n }\n return x ;\n }", "public Node insert(Node node, int key) {\n\n //first we insert the key the same way as BST\n if (node == null)\n return (new Node(key));\n\n if (key < node.key)\n node.left = insert(node.left, key);\n else if (key > node.key){\n node.right = insert(node.right, key);\n }\n else\n return node;\n\n //updating the height of ancestor node\n node.height = 1 + max(height(node.left), height(node.right));\n\n //checking if the ancestor got imbalanced\n int balance = balance(node);\n\n // in case it's imbalanced we considar these 4 cases:\n if (balance > 1 && key < node.left.key)\n return rotateright(node);\n\n if (balance < -1 && key > node.right.key)\n return rotateleft(node);\n\n if (balance > 1 && key > node.left.key) {\n node.left = rotateleft(node.left);\n return rotateright(node);\n }\n\n if (balance < -1 && key < node.right.key) {\n node.right = rotateright(node.right);\n return rotateleft(node);\n }\n\n //returning the node\n return node;\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "private Node bstFind(TKey key, Node currentNode) {\n return (currentNode == null || currentNode == NIL_NODE ||\n key.compareTo(currentNode.mKey) == 0) ?\n currentNode:\n ((key.compareTo(currentNode.mKey) < 0) ?\n bstFind(key, currentNode.mLeft) : \n bstFind(key, currentNode.mRight));\n // That's right. A ternary operator WITHIN a ternary operator.\n // That's how it's done, son.\n }" ]
[ "0.869271", "0.7296338", "0.72269905", "0.71847975", "0.7115611", "0.71040195", "0.7097815", "0.70960826", "0.70178515", "0.69095767", "0.6809934", "0.6666851", "0.6661835", "0.6574617", "0.65016615", "0.6408118", "0.63287127", "0.63217545", "0.63189846", "0.61969405", "0.61612904", "0.6099235", "0.6087937", "0.60044986", "0.5976134", "0.5918603", "0.58938915", "0.57705903", "0.5761174", "0.57526517", "0.5744932", "0.57264763", "0.568626", "0.5634144", "0.55760807", "0.5529405", "0.5491023", "0.5474293", "0.5471453", "0.54244983", "0.5411501", "0.541055", "0.5358362", "0.5354888", "0.5354446", "0.5339647", "0.53111225", "0.5287763", "0.52512527", "0.5225819", "0.5224328", "0.5213678", "0.51899827", "0.517854", "0.51643866", "0.5163631", "0.51564205", "0.5139618", "0.51367337", "0.5133245", "0.5128192", "0.5110491", "0.510933", "0.5101609", "0.50893956", "0.50857407", "0.50837046", "0.5081522", "0.5078151", "0.50651586", "0.5058673", "0.50362563", "0.49965227", "0.49858692", "0.4983702", "0.4981717", "0.49798098", "0.4955749", "0.49552986", "0.49536827", "0.49230593", "0.49209717", "0.4917488", "0.49156007", "0.49145186", "0.4905404", "0.49002194", "0.4900128", "0.48871407", "0.48831466", "0.48811057", "0.4873498", "0.48597625", "0.4854672", "0.4851334", "0.4851231", "0.48480514", "0.4844104", "0.48401135", "0.4838599" ]
0.5358887
42
Not necessary, no parameters for this layout.
@Override protected void setValue(String name, TipiValue tv) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void layout() {\n // TODO: not implemented\n }", "public void setupLayout() {\n // left empty for subclass to override\n }", "public abstract void doLayout();", "protected abstract void iniciarLayout();", "public Layout() {\n }", "@Override\n\tpublic int getLayoutId() {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void layoutContainer(Container arg0) {\n\t\t\r\n\t}", "@Override\n\tpublic String getLayout() {\n\t\treturn \"main\";\n\t}", "public Layout() {\n super(\"Chitrashala\");\n initComponents();\n }", "@Override\n\t\tpublic void layout (final int l, final int t, final int r, final int b) {\n\t\t}", "public testLayout() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "@Override\n public void createInitialLayout(IPageLayout layout) {\n defineActions(layout);\n defineLayout(layout);\n }", "public boolean requiresLayout() {\n return false;\n }", "public boolean requiresLayout() {\n return false;\n }", "public abstract int presentViewLayout();", "public Object getLayoutInfo() { return _layoutInfo; }", "public boolean requiresLayout() {\n return true;\n }", "@Override\n public JQLayout getLayout()\n {\n return layout;\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tmLayout.requestLayout();\r\n\t\t\t}", "public void layout() {\n TitleLayout ll1 = new TitleLayout(getContext(), sourceIconView, titleTextView);\n\n // All items in ll1 are vertically centered\n ll1.setGravity(Gravity.CENTER_VERTICAL);\n ll1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n ll1.addView(sourceIconView);\n ll1.addView(titleTextView);\n\n // Container layout for all the items\n if (mainLayout == null) {\n mainLayout = new LinearLayout(getContext());\n mainLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n mainLayout.setPadding(adaptSizeToDensity(LEFT_PADDING),\n adaptSizeToDensity(TOP_PADDING),\n adaptSizeToDensity(RIGHT_PADDING),\n adaptSizeToDensity(BOTTOM_PADDING));\n mainLayout.setOrientation(LinearLayout.VERTICAL);\n }\n\n mainLayout.addView(ll1);\n\n if(syncModeSet) {\n mainLayout.addView(syncModeSpinner);\n }\n\n this.addView(mainLayout);\n }", "@JsOverlay\n public final void layout() {\n Dagre.get().layout(this);\n }", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "@LayoutRes\n protected abstract int getLayoutId();", "void buildLayout(){\n\t\tsetText(\"Score: \" + GameModel.instance().getPoints());\n\t\tsetX(10);\n\t\tsetY(10);\n\t\tsetFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 20));\n\t\t\n\t}", "private void initLayout() {\n ListView<PropertyWrapper> attributes = new ListView<PropertyWrapper>(\"attributes\", createAttributesModel()) {\n\n @Override\n protected void populateItem(ListItem<PropertyWrapper> listItem) {\n populateListItem(listItem);\n\n if (!showEmptyProperties && isEmpty(listItem)) {\n listItem.setVisible(false);\n }\n }\n };\n add(attributes);\n\n //todo remove !!!\n final MultiLineLabel label = new MultiLineLabel(\"debug\", new AbstractReadOnlyModel<String>() {\n\n @Override\n public String getObject() {\n return showStatus();\n }\n });\n label.add(new AjaxEventBehavior(\"onClick\") {\n\n @Override\n protected void onEvent(AjaxRequestTarget target) {\n target.add(label);\n }\n });\n add(label);\n }", "@Override\n\t\tpublic void run() {\n\t\t\trequestLayout();\n\t\t}", "@Override\r\n\tprotected void initializeLayout() {\r\n\t\tlayout = GraphLayoutFactory.createLayout(layoutType, graph, 250, 250, properties, AttributeMapSet.PROCEDURES);\r\n\t}", "@Override\n protected void onLayout(boolean changed, int l, int t, int r, int b) {\n }", "private AbsoluteLayout buildMainLayout() {\n\t\tmainLayout = new AbsoluteLayout();\r\n\t\tmainLayout.setImmediate(false);\r\n\t\tmainLayout.setWidth(\"100%\");\r\n\t\tmainLayout.setHeight(\"100%\");\r\n\t\tmainLayout.setMargin(false);\r\n\t\t\r\n\t\t// top-level component properties\r\n\t\tmainLayout.setWidth(\"100.0%\");\r\n\t\tmainLayout.setHeight(\"100.0%\");\r\n\t\t\r\n\t\t// label\r\n\t\tlabel = new Label();\r\n\t\tlabel.setImmediate(false);\r\n\t\tlabel.setWidth(\"-1px\");\r\n\t\tlabel.setHeight(\"-1px\");\r\n\t\tlabel.setValue(\"Stellvertreter ernennen\");\r\n\t\tlabel.setStyleName(Runo.LABEL_H1);\r\n\t\tmainLayout.addComponent(label, \"top:25.0%;left:35.0%;\");\r\n\t\t\r\n\t\t// benutzer\r\n\t\tbenutzer = new ListSelect();\r\n\t\tbenutzer.setImmediate(false);\r\n\t\tbenutzer.setWidth(\"46.0%\");\r\n\t\tbenutzer.setHeight(\"70.0%\");\r\n\t\tmainLayout.addComponent(benutzer, \"top:35.0%;left:35.0%;\");\r\n\t\t\r\n\t\t// ok\r\n\t\tok = new Button();\r\n\t\tok.setCaption(\"Stellvertreter ernennen\");\r\n\t\tok.setImmediate(false);\r\n\t\tok.setWidth(\"25%\");\r\n\t\tok.setHeight(\"-1px\");\r\n\t\tok.addListener(this);\r\n\t\tmainLayout.addComponent(ok, \"top:83.0%;left:35.0%;\");\r\n\t\t\r\n\t\t// delete\r\n\t\tdelete = new Button();\r\n\t\tdelete.setCaption(\"Stellvertreter löschen\");\r\n\t\tdelete.setImmediate(false);\r\n\t\tdelete.setWidth(\"25%\");\r\n\t\tdelete.setHeight(\"-1px\");\r\n\t\tdelete.addListener(this);\r\n\t\tmainLayout.addComponent(delete, \"top:88.0%;left:35.0%;\");\r\n\t\t\r\n\t\t// logout\r\n\t\tlogout = new Button();\r\n\t\tlogout.setCaption(\"logout\");\r\n\t\tlogout.setImmediate(false);\r\n\t\tlogout.setWidth(\"-1px\");\r\n\t\tlogout.setHeight(\"-1px\");\r\n\t\tlogout.setStyleName(BaseTheme.BUTTON_LINK);\r\n\t\tlogout.addListener(this);\r\n\t\tmainLayout.addComponent(logout, \"top:97.0%;left:35.0%;\");\r\n\t\t\r\n\t\t// back\r\n\t\tback = new Button();\r\n\t\tback.setCaption(\"Startseite\");\r\n\t\tback.setImmediate(true);\r\n\t\tback.setWidth(\"-1px\");\r\n\t\tback.setHeight(\"-1px\");\r\n\t\tback.setStyleName(BaseTheme.BUTTON_LINK);\r\n\t\tback.addListener(this);\r\n\t\tmainLayout.addComponent(back, \"top:94.0%;left:35.0%;\");\r\n\t\t\r\n\t\treturn mainLayout;\r\n\t}", "public abstract int layoutId();", "protected void directUpdateLayout() {\n updateLayout();\n }", "public void recordLayout()\r\n\t{\n\t}", "void computeNewLayout();", "@Nonnull\n @Override\n public Layout getLayout()\n {\n throw new UnsupportedOperationException(\"Not supported.\");\n }", "interface HandleLayout {\n}", "@Override\n\tpublic java.lang.String getLayout() {\n\t\treturn _scienceApp.getLayout();\n\t}", "public mainLayoutController() {\n\t }", "public CalcLayout() {\n\t\tthis(0);\n\t}", "public void createInitialLayout(IPageLayout layout) {\n \n\t}", "@Override\n public void setLayout(Layout layout) {\n checkWidget();\n return;\n }", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "private void buildMainLayout(IAuthorizationContext pContext)\r\n throws UnauthorizedAccessAttemptException, IOException {\r\n\r\n createObjectEntry();\r\n\r\n if (parent.getParentUI().siteName.equals(parent.getParentUI().siteNameCVMA)) {\r\n defineInfoLayoutCVMA();\r\n } else {\r\n defineInfoLayoutStandard();\r\n }\r\n\r\n thumbLayout = new VerticalLayout();\r\n thumbLayout.setSizeFull();\r\n thumbLayout.setSpacing(false);\r\n thumbLayout.setMargin(false);\r\n thumbLayout.setStyleName(\"white\");\r\n thumbLayout.setHeight(\"150px\");\r\n thumbLayout.setWidth(\"161px\");\r\n\r\n // initialize thumbnail field and button\r\n setThumbButton();\r\n\r\n // build content layout\r\n buttonLayout = new VerticalLayout();\r\n buttonLayout.setSizeFull();\r\n buttonLayout.setSpacing(false);\r\n buttonLayout.setMargin(false);\r\n buttonLayout.setStyleName(\"white\");\r\n buttonLayout.setHeight(\"150px\");\r\n buttonLayout.setWidth(\"161px\");\r\n\r\n // set download button\r\n setDownloadButton();\r\n\r\n // set metadata viewer button\r\n setMetadataViewerButton();\r\n\r\n // download button\r\n setImageDownloadButton();\r\n\r\n // map button\r\n setMapButton();\r\n\r\n // build content layout\r\n contentLayout = new HorizontalLayout();\r\n contentLayout.setSizeFull();\r\n contentLayout.setMargin(false);\r\n contentLayout.setMargin(new MarginInfo(false, false, true, false));\r\n contentLayout.setStyleName(\"white\");\r\n contentLayout.addComponent(thumbLayout);\r\n contentLayout.addComponent(infoLayout);\r\n contentLayout.addComponent(buttonLayout);\r\n contentLayout.setComponentAlignment(thumbLayout, Alignment.TOP_LEFT);\r\n contentLayout.setComponentAlignment(infoLayout, Alignment.TOP_CENTER);\r\n contentLayout.setComponentAlignment(buttonLayout, Alignment.TOP_RIGHT);\r\n contentLayout.setExpandRatio(infoLayout, 11f);\r\n }", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\r\n\t\tpublic void layout(int l, int t, int r, int b) {\n\t\t\tLog.v(\"MyView01>layout\",\"f-1\");\r\n\t\t\tsuper.layout(l, t, r, b);\r\n\t\t\tLog.v(\"MyView01>layout\",\"f-2\");\r\n\t\t}", "@Override\n public void requestLayout() {\n super.requestLayout();\n Log.v(Log.SUBSYSTEM.LAYOUT, TAG, \"requestLayout(%s): root layout requested; posting\", getName());\n\n runOnGlThread(mLayoutRunnable);\n }", "@Override\n\t\tpublic void layout(int l, int t, int r, int b) {\n\t\t\tsuper.layout(l, t, r, b);\n\t\t\tLog.e(\"FYF\", getId() + \" ImageView layout\");\n\t\t}", "String getLayout();", "private void layout() {\n\n\n _abortButton= makeAbortButton();\n _abortButton.addStyleName(\"download-group-abort\");\n _content.addStyleName(\"download-group-content\");\n _detailUI= new DetailUIInfo[getPartCount(_monItem)];\n layoutDetails();\n }", "public void mo9839a() {\n onLayout(false, 0, 0, 0, 0);\n }", "public void forgetLayout()\r\n\t{\n\t}", "public OverlayLayout() {}", "protected abstract int getLayoutViewId();", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "public WorkFlowLayout() {\r\n WorkFlowLayout.this.setWidth(100, Unit.PERCENTAGE);\r\n WorkFlowLayout.this.setHeight(100, Unit.PERCENTAGE);\r\n\r\n VerticalLayout content = new VerticalLayout();\r\n content.setHeightUndefined();\r\n content.setWidth(100, Unit.PERCENTAGE);\r\n WorkFlowLayout.this.setContent(content);\r\n WorkFlowLayout.this.setStyleName(\"subframe\");\r\n\r\n content.setSpacing(true);\r\n\r\n Label titleLabel = new Label(\"SearchGUI-PeptideShaker-WorkFlow\");\r\n titleLabel.setStyleName(\"frametitle\");\r\n content.addComponent(titleLabel);\r\n\r\n searchSettingsFileList = new DropDownList(\"Search Settings (Select or Enter New Name)\");\r\n content.addComponent(searchSettingsFileList);\r\n searchSettingsFileList.setFocous();\r\n\r\n HorizontalLayout btnsFrame = new HorizontalLayout();\r\n btnsFrame.setWidthUndefined();\r\n btnsFrame.setSpacing(true);\r\n btnsFrame.setStyleName(\"bottomformlayout\");\r\n content.addComponent(btnsFrame);\r\n\r\n Label addNewSearchSettings = new Label(\"Add\");\r\n addNewSearchSettings.addStyleName(\"windowtitle\");\r\n btnsFrame.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {\r\n @Override\r\n public void layoutClick(LayoutEvents.LayoutClickEvent event) {\r\n Component c = event.getClickedComponent();\r\n if (c != null && c instanceof Label && ((Label) c).getValue().equalsIgnoreCase(\"Add\")) {\r\n String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();\r\n File file = new File(basepath + \"/VAADIN/default_searching.par\");\r\n SearchParameters searchParameters;\r\n try {\r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n searchParameters.setFastaFile(null);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchParameters.setDefaultAdvancedSettings();\r\n searchSettingsLayout.updateForms(searchParameters, null);\r\n editSearchOption.setPopupVisible(true);\r\n } else if (c != null && c instanceof Label && ((Label) c).getValue().equalsIgnoreCase(\"Edit\")) {\r\n\r\n try {\r\n File file = searchSettingsMap.get(searchSettingsFileList.getSelectedValue()).getFile();\r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchSettingsLayout.updateForms(searchParameters, searchSettingsFileList.getSelectedValue());\r\n editSearchOption.setPopupVisible(true);\r\n\r\n }\r\n }\r\n });\r\n btnsFrame.addComponent(addNewSearchSettings);\r\n Label editSearchSettings = new Label(\"Edit\");\r\n editSearchSettings.addStyleName(\"windowtitle\");\r\n btnsFrame.addComponent(editSearchSettings);\r\n searchSettingsLayout = new SearchSettingsLayout() {\r\n @Override\r\n public void saveSearchingFile(SearchParameters searchParameters, boolean editMode) {\r\n checkAndSaveSearchSettingsFile(searchParameters, editMode);\r\n editSearchOption.setPopupVisible(false);\r\n }\r\n\r\n @Override\r\n public void cancel() {\r\n editSearchOption.setPopupVisible(false);\r\n }\r\n\r\n };\r\n editSearchOption = new PopupWindow(\"Edit\");\r\n editSearchOption.setContent(searchSettingsLayout);\r\n editSearchOption.setSizeFull();\r\n editSearchOption.addStyleName(\"centerwindow\");\r\n\r\n Label searchSettingInfo = new Label();\r\n searchSettingInfo.setWidth(400, Unit.PIXELS);\r\n searchSettingInfo.setHeight(90, Unit.PIXELS);\r\n searchSettingInfo.setStyleName(\"subpanelframe\");\r\n searchSettingInfo.addStyleName(\"bottomformlayout\");\r\n searchSettingInfo.addStyleName(\"smallfontlongtext\");\r\n content.addComponent(searchSettingInfo);\r\n\r\n mgfFileList = new MultiSelectOptionGroup(\"Spectrum File(s)\", false);\r\n content.addComponent(mgfFileList);\r\n mgfFileList.setRequired(true, \"Select at least 1 MGF file\");\r\n mgfFileList.setViewList(true);\r\n\r\n MultiSelectOptionGroup searchEngines = new MultiSelectOptionGroup(\"Search Engines\", false);\r\n content.addComponent(searchEngines);\r\n searchEngines.setRequired(true, \"Select at least 1 search engine\");\r\n searchEngines.setViewList(true);\r\n\r\n Map<String, String> searchEngienList = new LinkedHashMap<>();\r\n searchEngienList.put(\"X!Tandem\", \"X!Tandem\");\r\n searchEngienList.put(\"MS-GF+\", \"MS-GF+\");\r\n searchEngienList.put(\"OMSSA\", \"OMSSA\");\r\n searchEngienList.put(\"Comet\", \"Comet\");\r\n searchEngienList.put(\"Tide\", \"Tide\");\r\n searchEngienList.put(\"MyriMatch\", \"MyriMatch\");\r\n searchEngienList.put(\"MS_Amanda\", \"MS_Amanda\");\r\n searchEngienList.put(\"DirecTag\", \"DirecTag\");\r\n searchEngienList.put(\"Novor (Select for non-commercial use only)\", \"Novor (Select for non-commercial use only)\");\r\n searchEngines.updateList(searchEngienList);\r\n searchEngines.setSelectedValue(\"X!Tandem\");\r\n searchEngines.setSelectedValue(\"MS-GF+\");\r\n searchEngines.setSelectedValue(\"OMSSA\");\r\n HorizontalLayout bottomLayout = new HorizontalLayout();\r\n bottomLayout.setStyleName(\"bottomformlayout\");\r\n bottomLayout.setWidth(400, Unit.PIXELS);\r\n bottomLayout.setSpacing(true);\r\n content.addComponent(bottomLayout);\r\n\r\n projectNameField = new HorizontalLabelTextField(\"<b>Project Name</b>\", \"New Project Name\", null);\r\n projectNameField.setWidth(100, Unit.PERCENTAGE);\r\n projectNameField.setRequired(true);\r\n bottomLayout.addComponent(projectNameField);\r\n bottomLayout.setExpandRatio(projectNameField, 70);\r\n\r\n Button executeWorkFlow = new Button(\"Execute\");\r\n executeWorkFlow.setStyleName(ValoTheme.BUTTON_SMALL);\r\n executeWorkFlow.addStyleName(ValoTheme.BUTTON_TINY);\r\n bottomLayout.addComponent(executeWorkFlow);\r\n bottomLayout.setComponentAlignment(executeWorkFlow, Alignment.TOP_RIGHT);\r\n bottomLayout.setExpandRatio(executeWorkFlow, 30);\r\n\r\n executeWorkFlow.addClickListener((Button.ClickEvent event) -> {\r\n String fastFileId = searchSettingsLayout.getFastaFileId();\r\n Set<String> spectrumIds = mgfFileList.getSelectedValue();\r\n Set<String> searchEnginesIds = searchEngines.getSelectedValue();\r\n String projectName = projectNameField.getSelectedValue().replace(\" \", \"_\").replace(\"-\", \"_\");\r\n if (!projectNameField.isValid() || fastFileId == null || spectrumIds == null || searchEnginesIds == null) {\r\n return;\r\n }\r\n Map<String, Boolean> selectedSearchEngines = new HashMap<>();\r\n searchEngienList.keySet().forEach((paramId) -> {\r\n selectedSearchEngines.put(paramId, searchEngines.getSelectedValue().contains(paramId));\r\n });\r\n executeWorkFlow(projectName, fastFileId, spectrumIds, searchEnginesIds, searchSettingsLayout.getSearchParameters(), selectedSearchEngines);\r\n });\r\n mgfFileList.setEnabled(false);\r\n searchEngines.setEnabled(false);\r\n projectNameField.setEnabled(false);\r\n editSearchSettings.setEnabled(false);\r\n executeWorkFlow.setEnabled(false);\r\n searchSettingsFileList.addValueChangeListener((Property.ValueChangeEvent event) -> {\r\n if (searchSettingsFileList.getSelectedValue() != null) {\r\n mgfFileList.setEnabled(true);\r\n searchEngines.setEnabled(true);\r\n projectNameField.setEnabled(true);\r\n editSearchSettings.setEnabled(true);\r\n executeWorkFlow.setEnabled(true); \r\n try { \r\n File file = searchSettingsMap.get(searchSettingsFileList.getSelectedValue()).getFile(); \r\n searchParameters = SearchParameters.getIdentificationParameters(file);\r\n String descrip = searchParameters.getShortDescription();\r\n descrip = descrip.replace(searchParameters.getFastaFile().getName(), searchSettingsLayout.getFastaFileName(searchParameters.getFastaFile().getName().split(\"__\")[0]));\r\n searchSettingInfo.setValue(descrip);\r\n } catch (IOException | ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n return;\r\n }\r\n searchSettingsLayout.updateForms(searchParameters, searchSettingsFileList.getSelectedValue());\r\n\r\n }\r\n });\r\n }", "@Override\n\tpublic ViewGroup GetDynamicLayout() {\n\t\treturn null;\n\t}", "abstract void snapshotLayout();", "public void layoutView()\n\t{\n\t\tthis.setLayout(new GridLayout(2,5));\n\t\tthis.add(expression);\n\t\tthis.add(var);\n\t\tthis.add(start);\n\t\tthis.add(end);\n\t\tthis.add(this.plot);\n\t\tthis.add(InputView.coords);\n\t\tthis.add(this.in);\n\t\tthis.add(this.out);\n\t}", "public VerticalLayout() {\n setWidth(\"100%\");\n setSpacing(true);\n setMargin(true);\n }", "@Override\n public void noteNewPlayout()\n {\n\n }", "private void doLayout()\n \t{\n \t\tModel model = doc.getModel();\n \t\tExtendedLayoutModel sbase = (ExtendedLayoutModel)model.getExtension(LayoutConstants.namespaceURI);\n \t\tif (sbase != null)\n \t\t{\n \t\t\tfor (Layout l : sbase.getListOfLayouts())\n \t\t\t{\n \t\t\t\t// TODO: list of compartment glyphs, text glyphs, etc...\n \t\t\t\tfor (SpeciesGlyph g : l.getListOfSpeciesGlyphs())\n \t\t\t\t{\n \t\t\t\t\tString sid = g.getSpecies();\n \t\t\t\t\tPeerSpecies sbr = getSpeciesPeer(sid);\n \t\t\t\t\tif (sbr != null) {\n \t\t\t\t\t\tsbr.setSpeciesGlyph(g);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public GroupLayoutRonald ()\n {\n groupFunction();\n }", "@Override\n protected Layout constructShellLayout() {\n GridLayout mainLayout = new GridLayout(1, false);\n\n return mainLayout;\n }", "protected void onLoadLayout(View view) {\n }", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "public CmsLayoutXmlContentHandler() {\n\n super();\n }", "@Override\n\tprotected void initContentView() {\n\t\t\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tint setLayout() {\n\t\treturn R.layout.product_bigimg;\r\n\t}", "@Override\n\tpublic View getLayout(Context context, ViewGroup container) {\n\t\treturn null;\n\t}", "@Override\n\tpublic View getLayout(Context context, ViewGroup container) {\n\t\treturn null;\n\t}", "@Override\n protected void initViewSetup() {\n }", "@Override\n\tpublic int bindLayout() {\n\t\treturn R.layout.activity_init;\n\t}", "@AutoGenerated\n\tprivate HorizontalLayout buildInfo_container() {\n\t\tinfo_container = new HorizontalLayout();\n\t\tinfo_container.setImmediate(false);\n\t\tinfo_container.setWidth(\"100.0%\");\n\t\tinfo_container.setHeight(\"-1px\");\n\t\tinfo_container.setMargin(false);\n\t\t\n\t\t// nativeButton_upVote\n\t\tnativeButton_upVote = new NativeButton();\n\t\tnativeButton_upVote.setCaption(\"Up Vote\");\n\t\tnativeButton_upVote.setImmediate(false);\n\t\tnativeButton_upVote.setWidth(\"-1px\");\n\t\tnativeButton_upVote.setHeight(\"-1px\");\n nativeButton_upVote.setStyleName(\"vote-button\");\n\t\tinfo_container.addComponent(nativeButton_upVote);\n\t\t\n\t\t// nativeButton_downVote\n\t\tnativeButton_downVote = new NativeButton();\n\t\tnativeButton_downVote.setCaption(\"Down Vote\");\n\t\tnativeButton_downVote.setImmediate(false);\n\t\tnativeButton_downVote.setWidth(\"-1px\");\n\t\tnativeButton_downVote.setHeight(\"-1px\");\n nativeButton_downVote.setStyleName(\"vote-button\");\n\t\tinfo_container.addComponent(nativeButton_downVote);\n\n //nativeButton_accept\n nativeButton_accept = new NativeButton();\n nativeButton_accept.setCaption(\"Accept\");\n nativeButton_accept.setVisible(false);\n nativeButton_accept.setStyleName(\"accept-button\");\n info_container.addComponent(nativeButton_accept);\n\n //label_date\n label_date = new Label();\n label_date.setStyleName(\"date-label\");\n label_date.setWidth(\"-1px\");\n label_date.setHeight(\"-1px\");\n info_container.addComponent(label_date);\n info_container.setExpandRatio(label_date, 1.0f);\n info_container.setComponentAlignment(label_date, Alignment.MIDDLE_RIGHT);\n\t\t\n\t\t// label_user\n\t\tlabel_user = new Label();\n\t\tlabel_user.setImmediate(false);\n\t\tlabel_user.setWidth(\"-1px\");\n\t\tlabel_user.setHeight(\"-1px\");\n\t\tlabel_user.setValue(\"By \");\n label_user.setStyleName(\"user-label\");\n\t\tinfo_container.addComponent(label_user);\n//\t\tinfo_container.setExpandRatio(label_user, 1.0f);\n\t\tinfo_container.setComponentAlignment(label_user, new Alignment(34));\n\t\t\n\t\treturn info_container;\n\t}", "@Override\n public boolean canResolveLayoutDirection() {return false;}", "private void setLayout() {\n\t\ttxtNickname.setId(\"txtNickname\");\n\t\ttxtPort.setId(\"txtPort\");\n\t\ttxtAdress.setId(\"txtAdress\");\n\t\tlblNickTaken.setId(\"lblNickTaken\");\n\n\t\tgrid.setPrefSize(516, 200);\n\t\tbtnLogin.setDisable(true);\n\t\ttxtNickname.setPrefSize(200, 25);\n\t\tlblNickTaken.setPrefSize(250, 10);\n\t\tlblNickTaken.setText(null);\n\t\tlblNickTaken.setTextFill(Color.RED);\n\t\tlblNick.setPrefSize(120, 50);\n\t\ttxtAdress.setText(\"localhost\");\n\t\ttxtPort.setText(\"4455\");\n\t\tlblCardDesign.setPrefSize(175, 25);\n\t\tcomboBoxCardDesign.getSelectionModel().select(0);\n\t\tbtnLogin.setGraphic(imvStart);\n\t}", "public DummyHandLayout() {\r\n//\t\tparent = null;\r\n\t}", "public boolean useBaseLayout() {\n return true;\n }", "@Override\n\tprotected Object displayYourself(DisplayDriver driver, Context context)\n\t{\n\t\tObject layout = driver.createLayout(this, 2);\n\t\tdriver.showComment(this, layout, 0, 0, super.getComments());\n\t\tdriver.showTitle(this, layout, 1, 0, Tokens.OnError.get(), context.getFactory().getSettings());\n\n\t\treturn layout;\n\t}", "public void makeLayout() {\n\t\tgl_layout.setHorizontalGroup(\n\t\t\tgl_layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_layout.createSequentialGroup()\n\t\t\t\t\t.addGap(150)\n\t\t\t\t\t.addComponent(favSearchTextField, GroupLayout.PREFERRED_SIZE, 400, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(10)\n\t\t\t\t\t.addComponent(button, GroupLayout.PREFERRED_SIZE, 98, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(10)\n\t\t\t\t\t.addComponent(refresh, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t)\n\t\t);\n\t\tgl_layout.setVerticalGroup(\n\t\t\tgl_layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_layout.createSequentialGroup()\n\t\t\t\t\t.addGap(10)\t\t\t\t\t\t\n\t\t\t\t\t.addComponent(favSearchTextField, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(10)\n\t\t\t\t)\n\t\t\t\t.addGroup(gl_layout.createSequentialGroup()\n\t\t\t\t\t.addGap(10)\n\t\t\t\t\t.addComponent(button, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(10)\n\t\t\t\t)\n\t\t\t\t.addGroup(gl_layout.createSequentialGroup()\n\t\t\t\t\t.addGap(10)\n\t\t\t\t\t.addComponent(refresh, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(10)\n\t\t\t\t)\n\t\t);\n\t\tthis.setLayout(gl_layout);\t\t\n\t}", "private void setupLayout()\n\t{\n\t\tbaseLayout.putConstraint(SpringLayout.NORTH, queryButton, 70, SpringLayout.NORTH, this);\n\t\tbaseLayout.putConstraint(SpringLayout.WEST, queryButton, 49, SpringLayout.WEST, this);\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\n\tpublic void onFinishLayout(View lay) {\n\t}", "int getLayoutId();", "protected abstract void closeLayout( );", "@Override\n public void prepareView() {\n }", "private void setupLayout()\n\t{\n\t\tbaseLayout.putConstraint(SpringLayout.WEST,firstButton,107,SpringLayout.WEST, this);\n\t\tbaseLayout.putConstraint(SpringLayout.SOUTH, firstButton, -32, SpringLayout.SOUTH, this);\n\t\tbaseLayout.putConstraint(SpringLayout.WEST, firstField, 37, SpringLayout.WEST, this);\n\t\tbaseLayout.putConstraint(SpringLayout.SOUTH, firstField, -24, SpringLayout.SOUTH, this);\n\t}", "public abstract\n @LayoutRes\n int getLayoutId();", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "@Override\n public void setContentView(int layoutResID){\n }", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "private void setViewLayout() {\n\t\tthis.setBorder(new EmptyBorder(15, 15, 15, 15));\n\t\tthis.setLayout(new GridLayout(2, 2, 15, 15));\n\t}", "protected void createLayout() {\n\t\tthis.layout = new GridLayout();\n\t\tthis.layout.numColumns = 2;\n\t\tthis.layout.marginWidth = 2;\n\t\tthis.setLayout(this.layout);\n\t}", "public void onSetLayoutDirection() {\n }", "protected abstract int getResLayout();" ]
[ "0.76326275", "0.7387468", "0.71588296", "0.7078681", "0.6937953", "0.6865011", "0.67167354", "0.6710618", "0.6662436", "0.6635227", "0.6596842", "0.6563882", "0.6496985", "0.6496985", "0.64894384", "0.64852214", "0.6449599", "0.64454746", "0.64366615", "0.6417581", "0.6416956", "0.64103097", "0.64103097", "0.64103097", "0.64046633", "0.6379658", "0.63785994", "0.63708115", "0.63648164", "0.6357468", "0.6347438", "0.6343084", "0.6328665", "0.6328468", "0.6319703", "0.63136804", "0.6307279", "0.6299532", "0.6293196", "0.6291897", "0.62887514", "0.6264699", "0.62477136", "0.62477136", "0.620812", "0.6203754", "0.6201251", "0.620058", "0.6193778", "0.61926", "0.6189192", "0.6156248", "0.6155778", "0.61545765", "0.6147401", "0.61395985", "0.61395985", "0.6111018", "0.60880744", "0.6088067", "0.6086047", "0.6069734", "0.605672", "0.6056291", "0.6043614", "0.6043185", "0.60341495", "0.60300505", "0.60291743", "0.60291743", "0.6028909", "0.6026274", "0.60242516", "0.60240084", "0.60228467", "0.60228467", "0.6022484", "0.6021681", "0.60152537", "0.60085565", "0.59850496", "0.5982544", "0.5971716", "0.5956421", "0.5948692", "0.5947937", "0.59413564", "0.59332883", "0.5924919", "0.59195095", "0.5909069", "0.5899012", "0.5898391", "0.58980006", "0.5890267", "0.58843553", "0.58843553", "0.58812535", "0.58728206", "0.58726186", "0.5869708" ]
0.0
-1
Construct a grammar for Vesper's CLI.
public Grammar(){ this.builder = Cli.<VesperCommand>builder("vesper") .withDescription("the nice CLI for Vesper") .withDefaultCommand(HelpCommand.class) .withCommand(HelpCommand.class) .withCommand(LogCommand.class) .withCommand(ResetCommand.class) .withCommand(InspectCommand.class) .withCommand(ReplCommand.class) .withCommand(ConfigCommand.class) .withCommand(AddCommand.class) .withCommand(OriginShow.class) .withCommand(PublishCommand.class) .withCommand(FormatCommand.class) .withCommand(DeduplicateCommand.class) .withCommand(OptimizeImportsCommand.class); builder.withGroup("whereis") .withDescription("Locates a program unit found in the tracked source") .withDefaultCommand(LocateClassCommand.class) .withCommand(LocateClassCommand.class) .withCommand(LocateMethodCommand.class) .withCommand(LocateParamCommand.class) .withCommand(LocateVarCommand.class) .withCommand(LocateFieldCommand.class); builder.withGroup("notes") .withDescription("Manage set of notes describing the tracked source") .withDefaultCommand(NotesShow.class) .withCommand(NotesShow.class) .withCommand(NoteAdd.class); builder.withGroup("rename") .withDescription("Manage set of renaming commands") .withDefaultCommand(RenameClassCommand.class) .withCommand(RenameClassCommand.class) .withCommand(RenameMethodCommand.class) .withCommand(RenameParameterCommand.class) .withCommand(RenameFieldCommand.class) .withCommand(RenameLocalVariableCommand.class); builder.withGroup("rm") .withDescription("Remove file contents from the tracked source") .withDefaultCommand(RemoveSourceCommand.class) .withCommand(RemoveSourceCommand.class) .withCommand(RemoveClassCommand.class) .withCommand(RemoveMethodCommand.class) .withCommand(RemoveParameterCommand.class) .withCommand(RemoveFieldCommand.class) .withCommand(RemoveLocalVariableCommand.class) .withCommand(RemoveRegionCommand.class); builder.withGroup("clip") .withDescription("Clip a code section from the tracked source") .withDefaultCommand(ClipRangeCommand.class) .withCommand(ClipRangeCommand.class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Grammar() {\n }", "IGrammarComp getGrammar();", "private TraceParser genParser() throws ParseException {\n TraceParser parser = new TraceParser();\n parser.addRegex(\"^(?<VTIME>)(?<TYPE>)$\");\n parser.addPartitionsSeparator(\"^--$\");\n return parser;\n }", "public Grammar()\n {\n this.rules = new ArrayList<Rule>();\n }", "private String tokenToGrammar(Token v) {\n\n if(v.getChVals().equals(\"$\")){\n return \"$\";\n }\n\n String type = v.getType();\n\n if(type.equals(\"keyword\")) {\n type = v.getChVals();\n }\n\n switch (type) {\n case \"begin\":\n return \"b\";\n case \"halt\":\n return \"t\";\n case \"cat\":\n return \"c\";\n case \"mouse\":\n return \"m\";\n case \"clockwise\":\n return \"l\";\n case \"move\":\n return \"o\";\n case \"north\":\n return \"n\";\n case \"south\":\n return \"s\";\n case \"east\":\n return \"e\";\n case \"west\":\n return \"w\";\n case \"hole\":\n return \"h\";\n case \"repeat\":\n return \"r\";\n case \"size\":\n return \"z\";\n case \"end\":\n return \"d\";\n case \"integer\":\n return \"i\";\n case \"variable\":\n return \"v\";\n default:\n return type;\n }\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\t// Scanner scanner = new Scanner(System.in);\r\n\t\t\t//Grammar grammar = new Grammar(\"(i * i) * (i + i) - i\");\r\n\t\t\tGrammar grammar = new Grammar(\"i + i * i\");\r\n\t\t\tgrammar.addTerminal(\"SYMBOL\", TokenType.ID, \"i\");\r\n\t\t\tgrammar.addTerminal(\"PLUS\", TokenType.OPERATOR, OperatorType.PLUS);\r\n\t\t\tgrammar.addTerminal(\"MINUS\", TokenType.OPERATOR, OperatorType.MINUS);\r\n\t\t\tgrammar.addTerminal(\"TIMES\", TokenType.OPERATOR, OperatorType.TIMES);\r\n\t\t\tgrammar.addTerminal(\"DIVIDE\", TokenType.OPERATOR,\r\n\t\t\t\t\tOperatorType.DIVIDE);\r\n\t\t\tgrammar.addTerminal(\"LPA\", TokenType.OPERATOR, OperatorType.LPARAN);\r\n\t\t\tgrammar.addTerminal(\"RPA\", TokenType.OPERATOR, OperatorType.RPARAN);\r\n\t\t\tgrammar.setEpsilonName(\"epsilon\");\r\n\t\t\tString[] nons = new String[] {\r\n\t\t\t\t\t\"E\", \"E1\", \"T\", \"T1\", \"F\", \"A\", \"M\"\r\n\t\t\t};\r\n\t\t\tfor (String non : nons){\r\n\t\t\t\tgrammar.addNonTerminal(non);\r\n\t\t\t}\r\n\t\t\tgrammar.infer(\"E -> T E1\");\r\n\t\t\tgrammar.infer(\"E1 -> A T E1 | @epsilon\");\r\n\t\t\tgrammar.infer(\"T -> F T1\");\r\n\t\t\tgrammar.infer(\"T1 -> M F T1 | @epsilon\");\r\n\t\t\tgrammar.infer(\"F -> @LPA E @RPA | @SYMBOL\");\r\n\t\t\tgrammar.infer(\"A -> @PLUS | @MINUS\");\r\n\t\t\tgrammar.infer(\"M -> @TIMES | @DIVIDE\");\r\n\t\t\tgrammar.initialize(\"E\");\r\n\t\t\tSystem.out.println(grammar.toString());\r\n\t\t\tSystem.out.println(grammar.getPredictionString());\r\n\t\t\tgrammar.run();\r\n\t\t\tSystem.out.println(grammar.getTokenString());\r\n\t\t\t// scanner.close();\r\n\t\t} catch (RegexException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SyntaxException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \"\r\n\t\t\t\t\t+ e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (GrammarException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \"\r\n\t\t\t\t\t+ e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void toGrammar() {\n System.out.println(\"<binary_expression> -> <arithmeitc_expression> <arithmetic_op> <arithmetic_expression>\");\n left.toGrammar();\n operator.toGrammar();\n right.toGrammar();\n prefix();\n }", "public CommandParser(){\n setLanguage(\"ENGLISH\");\n commandTranslations = getPatterns(new String[] {TRANSLATION});\n commands = new ArrayList<>();\n addErrors();\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\t//Scanner scanner = new Scanner(System.in);\r\n\t\t\tSyntax syntax = new Syntax();\r\n\t\t\tsyntax.addTerminal(\"PLUS\", TokenType.OPERATOR, OperatorType.PLUS);\r\n\t\t\tsyntax.addTerminal(\"MINUS\", TokenType.OPERATOR, OperatorType.MINUS);\r\n\t\t\tsyntax.addTerminal(\"TIMES\", TokenType.OPERATOR, OperatorType.TIMES);\r\n\t\t\tsyntax.addTerminal(\"DIVIDE\", TokenType.OPERATOR, OperatorType.DIVIDE);\r\n\t\t\tsyntax.addTerminal(\"LPA\", TokenType.OPERATOR, OperatorType.LPARAN);\r\n\t\t\tsyntax.addTerminal(\"RPA\", TokenType.OPERATOR, OperatorType.RPARAN);\r\n\t\t\tsyntax.addTerminal(\"SYMBOL\", TokenType.ID, \"i\");\r\n\t\t\tsyntax.addNonTerminal(\"E\");\r\n\t\t\tsyntax.addNonTerminal(\"T\");\r\n\t\t\tsyntax.addNonTerminal(\"F\");\r\n\t\t\tsyntax.addErrorHandler(\"sample\", null);\r\n\t\t\t//syntax.infer(\"E -> T `PLUS`<+> E | T `MINUS`<-> E | T\");\r\n\t\t\t//syntax.infer(\"T -> F `TIMES`<*> T | F `DIVIDE`</> T | F\");\r\n\t\t\t//syntax.infer(\"F -> `LPA`<(> E `RPA`<)> | `SYMBOL`<i>\");\r\n\t\t\tsyntax.infer(\"E -> E @PLUS<+> T\");\r\n\t\t\tsyntax.infer(\"E -> E @MINUS<-> T\");\r\n\t\t\tsyntax.infer(\"E -> T\");\r\n\t\t\tsyntax.infer(\"T -> T @TIMES<*> F\");\r\n\t\t\tsyntax.infer(\"T -> T @DIVIDE</> F\");\r\n\t\t\tsyntax.infer(\"T -> F\");\r\n\t\t\tsyntax.infer(\"F -> @LPA<(> E @RPA<)>\");\r\n\t\t\tsyntax.infer(\"F -> @SYMBOL<i>\");\r\n\t\t\tsyntax.initialize(\"E\");\r\n\t\t\tSystem.out.println(syntax.toString());\r\n\t\t\tSystem.out.println(syntax.getNGAString());\r\n\t\t\tSystem.out.println(syntax.getNPAString());\r\n\t\t\t//scanner.close();\r\n\t\t} catch (RegexException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SyntaxException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \" + e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private Grammar createGrammarFromXML( String resource, org.opencypher.grammar.Grammar.ParserOption... options )\n {\n String grammarString = null;\n try\n {\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n org.opencypher.grammar.Grammar oCGrammar = org.opencypher.grammar.Grammar.parseXML( Paths.get( resourceURL( resource ) ), options );\n Antlr4.write( oCGrammar, out );\n grammarString = out.toString( UTF_8.name() );\n }\n catch ( Throwable t )\n {\n fail( \"Unexpected error while writing antlr grammar: \" + t.getMessage() );\n }\n return parseGrammarFromString( grammarString );\n }", "public CopsOptionParser() {\n\t\tsuper();\n\t\taddOption(HELP);\n\t\taddOption(SCENARIO);\n\t\taddOption(VALIDATE_ONLY);\n\t\taddOption(CONF);\n\n\t}", "public interface GrammarConstants {\n\n /** End of File. */\n int EOF = 0;\n /** RegularExpression Id. */\n int SINGLE_LINE_COMMENT = 7;\n /** RegularExpression Id. */\n int FORMAL_COMMENT = 8;\n /** RegularExpression Id. */\n int MULTI_LINE_COMMENT = 9;\n /** RegularExpression Id. */\n int PLUS = 11;\n /** RegularExpression Id. */\n int MINUS = 12;\n /** RegularExpression Id. */\n int MULTIPLY = 13;\n /** RegularExpression Id. */\n int DIVIDE = 14;\n /** RegularExpression Id. */\n int MOD = 15;\n /** RegularExpression Id. */\n int UBANG = 16;\n /** RegularExpression Id. */\n int LESS_OP = 17;\n /** RegularExpression Id. */\n int MORE_OP = 18;\n /** RegularExpression Id. */\n int WHILE = 19;\n /** RegularExpression Id. */\n int IF = 20;\n /** RegularExpression Id. */\n int ELSE = 21;\n /** RegularExpression Id. */\n int BREAK = 22;\n /** RegularExpression Id. */\n int RETURN = 23;\n /** RegularExpression Id. */\n int CONTINUE = 24;\n /** RegularExpression Id. */\n int ID = 25;\n /** RegularExpression Id. */\n int LETTER = 26;\n /** RegularExpression Id. */\n int INT = 27;\n /** RegularExpression Id. */\n int SEMICOLON = 28;\n /** RegularExpression Id. */\n int LPAREN = 29;\n /** RegularExpression Id. */\n int RPAREN = 30;\n /** RegularExpression Id. */\n int LBRACKET = 31;\n /** RegularExpression Id. */\n int RBRACKET = 32;\n /** RegularExpression Id. */\n int EQUAL = 33;\n\n /** Lexical state. */\n int DEFAULT = 0;\n /** Lexical state. */\n int IN_FORMAL_COMMENT = 1;\n /** Lexical state. */\n int IN_MULTI_LINE_COMMENT = 2;\n\n /** Literal token values. */\n String[] tokenImage = {\n \"<EOF>\",\n \"\\\" \\\"\",\n \"\\\"\\\\r\\\"\",\n \"\\\"\\\\t\\\"\",\n \"\\\"\\\\n\\\"\",\n \"<token of kind 5>\",\n \"\\\"/*\\\"\",\n \"<SINGLE_LINE_COMMENT>\",\n \"\\\"*/\\\"\",\n \"\\\"*/\\\"\",\n \"<token of kind 10>\",\n \"\\\"+\\\"\",\n \"\\\"-\\\"\",\n \"\\\"*\\\"\",\n \"\\\"/\\\"\",\n \"\\\"%\\\"\",\n \"\\\"!\\\"\",\n \"\\\"<\\\"\",\n \"\\\">\\\"\",\n \"\\\"while\\\"\",\n \"\\\"if\\\"\",\n \"\\\"else\\\"\",\n \"\\\"break\\\"\",\n \"\\\"return\\\"\",\n \"\\\"continue\\\"\",\n \"<ID>\",\n \"<LETTER>\",\n \"<INT>\",\n \"\\\";\\\"\",\n \"\\\"(\\\"\",\n \"\\\")\\\"\",\n \"\\\"{\\\"\",\n \"\\\"}\\\"\",\n \"\\\"=\\\"\",\n \"\\\"?\\\"\",\n \"\\\":\\\"\",\n \"\\\"|\\\"\",\n \"\\\"&\\\"\",\n \"\\\"==\\\"\",\n \"\\\">=\\\"\",\n \"\\\"<=\\\"\",\n };\n\n}", "public Program parse() throws SyntaxException {\n\t\tProgram p = program();\n\t\tmatchEOF();\n\t\treturn p;\n\t}", "public CGrammar getGrammarStructure();", "public Parser compile( Grammar grammar)\n {\n grammar.augment();\n \n conflicts = 0;\n \n itemSets = createItemSets( grammar);\n State start = createStates( grammar, itemSets);\n grammar.freeGraph();\n\n log.infof( \"\\nFound %d conflicts in %d states.\", conflicts, itemSets.size());\n \n return new Parser( this, start);\n }", "public static void main(String[] args) {\n\t\t\n//\t\t//PA4 a\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"b\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 b\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");rhs11.add(\"b\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"c\");rhs12.add(\"d\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 c\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"U\");rhs11.add(\"S\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"S\");rhs12.add(\"S\");\t\t\n//\t\tArrayList<String> rhs13 = new ArrayList<>();\n//\t\trhs13.add(\"S\");rhs13.add(\"*\");\n//\t\tArrayList<String> rhs14 = new ArrayList<>();\n//\t\trhs14.add(\"(\");rhs14.add(\"S\");rhs14.add(\")\");\n//\t\tArrayList<String> rhs15 = new ArrayList<>();\n//\t\trhs15.add(\"a\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\trhs1.add(rhs13);\n//\t\trhs1.add(rhs14);\n//\t\trhs1.add(rhs15);\n//\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n\t\t\n//\t\t//PA-3 d\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"rexpr\");rhs11.add(\"U\");rhs11.add(\"rterm\");\t\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"rterm\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\tRule r1 = new Rule(\"rexpr\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"rterm\");rhs21.add(\"r factor\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"r factor\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"rterm\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"r factor\");rhs31.add(\"*\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"rprimary\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"r factor\", rhs3);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs4 = new ArrayList<>();\n//\t\tArrayList<String> rhs41 = new ArrayList<>();\n//\t\trhs41.add(\"a\");\n//\t\tArrayList<String> rhs42 = new ArrayList<>();\n//\t\trhs42.add(\"b\");\n//\t\trhs4.add(rhs41);\n//\t\trhs4.add(rhs42);\n//\t\tRule r4 = new Rule(\"rprimary\", rhs4);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\trules.add(r4);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\t\n\t\t\t\n//\t\t//PA-3 e\t\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"0\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"T\");rhs12.add(\"1\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"1\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"A\");rhs22.add(\"0\");\t\t\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\t\tRule r2 = new Rule(\"T\", rhs2);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\n\t\t\n//\t\t//PA-3 f\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"B\");rhs11.add(\"C\");\t\n//\t\trhs1.add(rhs11);\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"B\");rhs21.add(\"b\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"e\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"B\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"A\");rhs31.add(\"C\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"a\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"C\", rhs3);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tSystem.out.println(g);\n//\t\tg.eliminateEpsilonRule();\n//\t\tSystem.out.println(g);\n//\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\t}", "Program createProgram();", "Program createProgram();", "Program createProgram();", "private static Parser<Grammar> makeParser(final File grammar) {\n try {\n\n return Parser.compile(grammar, Grammar.ROOT);\n\n // translate these checked exceptions into unchecked\n // RuntimeExceptions,\n // because these failures indicate internal bugs rather than client\n // errors\n } catch (IOException e) {\n throw new RuntimeException(\"can't read the grammar file\", e);\n } catch (UnableToParseException e) {\n throw new IllegalArgumentException(\"the grammar has a syntax error\", e);\n }\n }", "Program parse() throws SyntaxException {\n\t\tProgram p = null;\n\t\tp = program();\n\t\tmatchEOF();\n\t\treturn p;\n\t}", "public static void main(final String[] args)\n {\n StdOut.println(\"RegExr Grammars:\");\n StdOut.println(\"COMMENTS : \" + Lexer.C_COMMENTS);\n StdOut.println(\"GROUPINGS : \" + CMinusLexer.C_GROUPINGS);\n StdOut.println(\"KEYWORDS : \" + CMinusLexer.C_KEYWORDS);\n StdOut.println(\"IDENTIFIERS: \" + CMinusLexer.C_IDENTIFIERS);\n StdOut.println(\"INTEGERS : \" + CMinusLexer.C_NUMBERS);\n StdOut.println(\"FLOATS : \" + CMinusLexer.C_NUMBERS);\n StdOut.println(\"OPERATORS : \" + CMinusLexer.C_OPERATORS);\n StdOut.println(\"WHITESPACES: \" + Lexer.C_WHITESPACES);\n StdOut.println();\n\n String input = Support.getInputString(null, \"Please provide an expression.\", \"Expression Lexer Input\");\n ( new CMinusLexer<TokenType>() ).lex(input, 0, false, true, true);\n }", "public interface JavaGrammarConstants {\n\n /** End of File. */\n int EOF = 0;\n /** RegularExpression Id. */\n int PLUS = 5;\n /** RegularExpression Id. */\n int MINUS = 6;\n /** RegularExpression Id. */\n int MULTIPLY = 7;\n /** RegularExpression Id. */\n int DIVIDE = 8;\n /** RegularExpression Id. */\n int OPEN_PARENTHESIS = 9;\n /** RegularExpression Id. */\n int CLOSED_PARENTHESIS = 10;\n /** RegularExpression Id. */\n int OPEN_BRACKET = 11;\n /** RegularExpression Id. */\n int CLOSED_BRACKET = 12;\n /** RegularExpression Id. */\n int OPEN_BRACE = 13;\n /** RegularExpression Id. */\n int CLOSED_BRACE = 14;\n /** RegularExpression Id. */\n int SEMICOLON = 15;\n /** RegularExpression Id. */\n int EQUALS = 16;\n /** RegularExpression Id. */\n int COMPARISON = 17;\n /** RegularExpression Id. */\n int LESS = 18;\n /** RegularExpression Id. */\n int GREATER = 19;\n /** RegularExpression Id. */\n int NUMBER = 20;\n /** RegularExpression Id. */\n int DIGIT = 21;\n /** RegularExpression Id. */\n int LETTER = 22;\n\n /** Lexical state. */\n int DEFAULT = 0;\n\n /** Literal token values. */\n String[] tokenImage = {\n \"<EOF>\",\n \"\\\" \\\"\",\n \"\\\"\\\\r\\\"\",\n \"\\\"\\\\t\\\"\",\n \"\\\"\\\\n\\\"\",\n \"\\\"+\\\"\",\n \"\\\"-\\\"\",\n \"\\\"*\\\"\",\n \"\\\"/\\\"\",\n \"\\\"(\\\"\",\n \"\\\")\\\"\",\n \"\\\"{\\\"\",\n \"\\\"}\\\"\",\n \"\\\"[\\\"\",\n \"\\\"]\\\"\",\n \"\\\";\\\"\",\n \"\\\"=\\\"\",\n \"<COMPARISON>\",\n \"\\\"<\\\"\",\n \"\\\">\\\"\",\n \"<NUMBER>\",\n \"<DIGIT>\",\n \"<LETTER>\",\n \"\\\"new\\\"\",\n \"\\\",\\\"\",\n \"\\\"System.out.println\\\"\",\n \"\\\"\\\\\\\"\\\"\",\n \"\\\"for\\\"\",\n \"\\\"int\\\"\",\n \"\\\"++\\\"\",\n \"\\\"--\\\"\",\n };\n\n}", "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;\r\n\t}", "public static void main(String...args) throws Throwable {\n \tSystem.out.println(toLexer(\"main[] = +hello ' ' +world ; hello = +'hel\\u0009lo'; world = 'world';\").parse(\"hel\tlo world\"));\n \t\n \t// demo using the csv grammar. Note the fact that it can match empty fields\n \tString csvGrammar = toString(new File(\"grammars/csv.g\"));\n \tLexer csvLexer = toLexer(csvGrammar);\n \tSystem.out.println(csvLexer.parse(\n \t\t\"line name,b column,some string\\n\"\n \t\t+\"line 1, some spaces ,\\\"got a comma , inside a quoted value to test protection\\\"\\n\"\n \t\t+\"line 2 with one field,,\\\"\\\"\\\"\\\"\\n\"\n \t));\n \t\n \t// demo/checking using the grammar of the grammar itself\n \tString lexerGrammar = toString(new File(\"src/lexer/lexer.g\"));\n \tLexer lexerLexer = LEXER_PARSER;\n \tNode node;\n \tfor (int i=0; i<4; i++) {\n\t \tnode = lexerLexer.parse(lexerGrammar);\n\t \tSystem.out.println(\"[\"+i+\"] ================================================\");\n\t \tSystem.out.println(node);\n\t \tlexerLexer = toLexer(node);\n \t}\n\t\t\n }", "public abstract ArgumentParser makeParser();", "Butternut(String grammar)\n\t{\n\t\tmain = selectGrammar(grammar);\n\t\ttext = \"123CAN Weldoer\".toCharArray();//new char[0];\n\t\ttree = main.parse(0);\n\t\t//experimentalParser(\"123CAN Weldoer\".toCharArray());\n\t}", "abstract protected Parser createSACParser();", "public void setGrammar(String grammar){\r\n this.grammar = grammar;\r\n }", "private PLPParser makeParser(String input) throws LexicalException {\n\t\t\tshow(input); //Display the input \n\t\t\tPLPScanner scanner = new PLPScanner(input).scan(); //Create a Scanner and initialize it\n\t\t\tshow(scanner); //Display the Scanner\n\t\t\tPLPParser parser = new PLPParser(scanner);\n\t\t\treturn parser;\n\t\t}", "public BindingLexer() {;}", "public String getGrammar(){\r\n return grammar;\r\n }", "@Before public void initParser() {\n\t\tparser = new CliParserImpl(\"-\", \"--\");\n\t}", "private Command parse() throws ParseException {\n next();\n expect(Token.COMMAND);\n cmd = new Command(text);\n next();\n while (!((token == Token.WHERE) || (token == Token.RETURN) || (token == Token.EOL))) {\n param();\n }\n if (token == Token.WHERE) {\n where();\n }\n if (token == Token.RETURN) {\n returns();\n }\n expect(Token.EOL);\n return cmd;\n }", "Program program() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tToken progName = match(IDENTIFIER);\r\n\t\tBlock block = block();\r\n\t\treturn new Program (first, progName, block);\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tmakeCFG(\"E -> T + T\\n \"\n\t\t\t\t+ \"E -> T - T\\n \"\n\t\t\t\t+ \"T -> F * F\\n \"\n\t\t\t\t+ \"T -> F / F\\n\", \"E\");\n\t\t\n\t\t\n//\t\tNontermianlSymbol procedure = new NontermianlSymbol(\"procedure\");\n//\t\tNontermianlSymbol subprocedure = new NontermianlSymbol(\"subprocedure\");\n//\t\tNontermianlSymbol constDefinition = new NontermianlSymbol(\"constDefinition\");\n//\t\tNontermianlSymbol varDefinition = new NontermianlSymbol(\"varDefinition\");\n//\t\tNontermianlSymbol statement = new NontermianlSymbol(\"statement\");\n//\t\tNontermianlSymbol condition = new NontermianlSymbol(\"condition\");\n//\t\tNontermianlSymbol expression = new NontermianlSymbol(\"expression\");\n//\t\tNontermianlSymbol term = new NontermianlSymbol(\"term\");\n//\t\tNontermianlSymbol factor = new NontermianlSymbol(\"factor\");\n\t\t\n\t\t\n//\t\tNontermianlSymbol S = new NontermianlSymbol(\"S\");\n//\t\tNontermianlSymbol T = new NontermianlSymbol(\"T\");\n//\t\t\n//\t\tTerminalSymbol a = new TerminalSymbol(\"a\");\n//\t\tTerminalSymbol and = new TerminalSymbol(\"^\");\n//\t\tTerminalSymbol lp = new TerminalSymbol(\"(\");\n//\t\tTerminalSymbol rp = new TerminalSymbol(\")\");\n//\t\tTerminalSymbol comma = new TerminalSymbol(\",\");\n//\t\t\n//\t\tRule r1 = new Rule(S, Arrays.asList(a));\n//\t\tRule r2 = new Rule(S, Arrays.asList(and));\n//\t\tRule r3 = new Rule(S, Arrays.asList(lp,T,rp));\n//\t\tRule r4 = new Rule(T, Arrays.asList(S));\n//\t\tRule r5 = new Rule(T, Arrays.asList(T,comma,S));\n//\t\t\n//\t\tSet<Rule> rules = new HashSet<>(Arrays.asList(r1,r2,r3,r4,r5));\n//\t\tSet<NontermianlSymbol> nonterminals = new HashSet<>(Arrays.asList(T,S));\n//\t\tSet<TerminalSymbol> terminals = new HashSet<>(Arrays.asList(a,and,lp,rp,comma));\n//\t\tNontermianlSymbol startSymbol = S;\n//\t\t\n//\t\tCFG cfg = new CFG(rules, nonterminals,terminals,startSymbol);\n//\t\t\n//\t\tSystem.out.println(cfg.isLL1());\n//\t\tcfg.removeLeftRecursion();\n//\t\tSystem.out.println(cfg.isLL1());\n// \n//\t\tfor(Rule rule : cfg.rules) {\n//\t\t\tSystem.out.println(rule.toString() + \"\\t\\t\" + cfg.SELECT(rule));\n//\t\t}\n\t}", "public void setGrammarStructure(CGrammar aGrammarStructure);", "@Test\n public void testExploratoryString() throws IOException {\n String simplestProgram = \"x := 1;\" +\n \"y :={0,1,2,33};\" +\n \"if (x>y) then \" +\n \"{x:=1;} \" +\n \"else \" +\n \"{y:=1;}\";\n\n CharStream inputCharStream = new ANTLRInputStream(new StringReader(simplestProgram));\n TokenSource tokenSource = new GrammarLexer(inputCharStream);\n TokenStream inputTokenStream = new CommonTokenStream(tokenSource);\n GrammarParser parser = new GrammarParser(inputTokenStream);\n\n //parser.addErrorListener(new TestErrorListener());\n parser.setErrorHandler(new BailErrorStrategy());\n\n GrammarParser.ProgramContext context = parser.program();\n\n System.out.println(context.getText());\n\n logger.info(context.toString());\n }", "public PolynomBuilder(String polyString) throws BadParsingException, UnstableStateException{\n//\t\tvarsInPolynom = new ArrayList<String>(givenVars); unneeded after rework \n\t\tcurrentTerm = new Term();\n\n\t\ttry{\n\t\t\twhile(position < polyString.length()){\n\t\t\t\tcurrentChar = polyString.charAt(this.position);\n\t\t\t\tcurrentState = parseChar(this.currentChar);\n\t\t\t\tposition++;\t\t\n\t\t\t}\n\t\t\tfinaliseTheTerm();\n\t\t\tif( currentState == States.COEFFICIENT ||\n\t\t\t\tcurrentState == States.DECIMAL ||\n\t\t\t\tcurrentState == States.VAR ||\n\t\t\t\tcurrentState == States.POWER ){\n\t\t\t\tSystem.out.println(\"Successfully parsed!\");\n\t\t\t} else{\n\t\t\t\tSystem.out.println(this.currentState);\n\t\t\t\tthrow new UnstableStateException(\"Polynom ended in unstable state\");\n\t\t\t}\n\t\t}catch(BadParsingException e){\n\t\t\tthrow e;\n\t\t}\n\t}", "Program program() throws SyntaxException {\n\t\tif(t.kind == IDENTIFIER){\n\t\t\tToken name = t, firstToken = t;\n\t\t\tconsume();\n\t\t\tArrayList<ASTNode> decsAndStatements = new ArrayList<>();\n\n\t\t\twhile (t.kind == KW_int || t.kind == KW_boolean || t.kind == KW_image\n\t\t\t\t\t|| t.kind == KW_url || t.kind == KW_file || t.kind == IDENTIFIER){\n\n\t\t\t\tif (t.kind == KW_int || t.kind == KW_boolean || t.kind == KW_image\n\t\t\t\t\t\t|| t.kind == KW_url || t.kind == KW_file){\n\t\t\t\t\tdecsAndStatements.add(declaration());\n\t\t\t\t}\n\t\t\t\telse if (t.kind == IDENTIFIER){\n\t\t\t\t\tdecsAndStatements.add(statement());\n\t\t\t\t}\n\t\t\t\tmatch(SEMI);\n\t\t\t}\n\n\t\t\treturn new Program(firstToken, name, decsAndStatements);\n\t\t}\n\t\telse {\n\t\t throw new SyntaxException(t, \"Input not valid. \\nProgram should start with an IDENTIFIER.\");\n }\n\t}", "public BNFrule()\n {\n lhs = \"\";\n rhsSymbols = new ArrayList<String>();\n }", "public static void main(String[] args) throws Exception {\r\n\t\tSpeechInput input = new SpeechInput();\r\n\t\tinput.afterPropertiesSet();\r\n\t\tRuleGrammar ruleGrammar = input.getGrammar().getRuleGrammar();\r\n\t\tSystem.out.println(\"Adding import\");\r\n\t\t\r\n\t\tRecognizer recognizer = ruleGrammar.getRecognizer();\r\n\t\tSystem.out.println(\"Loading: \" + new ClassPathResource(\"/grammar/hello.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/cooking.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/ingredient.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/recipe.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/step.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/timer.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/remy.gram\"));\r\n\t\t\r\n//\t\tRuleGrammar helloRules = loadGrammar(recognizer, new ClassPathResource(\"/grammar/hello.gram\"));\r\n//\t\tString name = helloRules.getName();\r\n//\t\tSystem.out.println(\"Adding grammar: \" + name);\r\n//\t\truleGrammar.addImport(new RuleName(\"hello.hello\"));\r\n\t\tSystem.out.println(\"Added\");\r\n\t\tSystem.out.println(\"Committing changes\");\r\n\t\t\r\n\t\tinput.getGrammar().commitChanges();\r\n\t\tSystem.out.println(\"Committed\");\r\n\t\tRule rule = ruleGrammar.getRule(\"command\");\r\n\t\tshowRule(rule, \"\");\r\n\t\taddGrammar(rule, \"hello\");\r\n\t\tList<String> ingredients = Arrays.asList(\r\n\t\t\t\t\"carrot\",\r\n\t\t\t\t\"broccoli\",\r\n\t\t\t\t\"kale\"\r\n\t\t\t\t);\r\n//\t\tString ingredientRuleStr = StringUtils.collectionToDelimitedString(ingredients, \"|\")\r\n//\t\t\t+ \";\";\r\n//\t\tRule ingredientsRule = ruleGrammar.ruleForJSGF(ingredientRuleStr);\r\n//\t\tRuleGrammar recipeGrammar = recognizer.getRuleGrammar(\"recipe\");\r\n//\t\trecipeGrammar.setRule(\"ingredient\", ingredientsRule, true);\r\n\t\tRuleGrammar ingredientGrammar = recognizer.getRuleGrammar(\"ingredient\");\r\n\t\tGrammarLoader.loadWords(\"ingredient\", ingredients, ingredientGrammar);\r\n\r\n//\t\trecipeGrammar.getRule(\"ingredient\");\r\n\t\t\r\n\t\t//ruleGrammar.getRecognizer().getRuleGrammar(s)\r\n\t\tinput.getGrammar().commitChanges();\r\n\t\tif (rule instanceof RuleAlternatives) {\r\n\t\t\tRuleAlternatives alts = (RuleAlternatives) rule;\r\n\t\t\tfor(Rule r: alts.getRules()) {\r\n\t\t\t\tshowRule(r, \"\");\r\n\t\t\t\tif (r instanceof RuleSequence) {\r\n\t\t\t\t\tfor (Rule rs : ((RuleSequence)r).getRules()) {\r\n\t\t\t\t\t\tshowRule(rs, \" \");\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//System.out.println(\"Alternatives: \" + r.getRules()\r\n\t\t\r\n//\t\tSystem.out.println(\"Random sentence:\");\r\n//\t\tString randomSentence = input.getGrammar().getRandomSentence();\r\n//\t\tSystem.out.println(\"\\t\" + randomSentence);\r\n\t\tSystem.out.println(\"Parsing...\");\r\n\t\tRuleParse result = ingredientGrammar.parse(\"kale\", \"ingredient\");\r\n\t\tSystem.out.println(\"Parse: \" + result);\r\n\t\t\r\n\t\tWhatWasSaid utterance = null;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Say something:\");\r\n\t\t\tutterance = input.recordUtterance();\r\n\t\t\tSystem.out.println(\"Got utterance: \" + utterance);\r\n\t\t} while (!utterance.getText().equals(\"quit\"));\r\n\t\t\r\n\t\tSystem.out.println(\"Quitting\");\r\n\t\tinput.destroy();\r\n\t}", "public ProgramParser(String prog, String input) {\n ProgramParser.programCode = new java.io.StringReader(prog);\n ProgramParser.stringInput = input;\n //System.out.println(\"Program: \" + prog + \" - input: \" + programInput);\n }", "public static void main (String[] args){\n if (args.length != 1){ // Check if there is the input regular expression\n System.out.println(\"Usage: java REcompiler <RegExp>\");\n return;\n }\n String input = args [0]; //Get the input regular expression\n inputCharArray = input.toCharArray(); //Convert the input string into char array\n set_state (0,\"START\",0,0); //Add the start state into the list\n int i = expression(); // Call the expression()\n if (hasError == true) System.out.println(\"GRAMMER ERROR\"); // IF there is any error, display the error message\n else {\n set_state (state, \"END\", 0,0); //Add the end state into the list\n int n1 , n2;\n n1 = n2 = getStartState(); // Get the start state of the FSM\n stateList.get(0).setN1(n1); stateList.get(0).setN2(n2); // Set the 'START' state's n1 and n2 to the start state\n stateList.forEach (state -> { //Print out all the elements in the list\n System.out.println(state.getState()+\",\"+state.getStr()+\",\"+state.getN1()+\",\"+state.getN2());\n });\n }\n }", "static void parse() {\r\n i = 0;\r\n j = 0;\r\n k = 0;\r\n varList.add(\"0\");\r\n\r\n // Find the first lexeme\r\n lex();\r\n\r\n // Check if the tokens form a statement\r\n if(checkStatement()) {\r\n System.out.println(\"\\nGRAMMAR IS CORRECT!\");\r\n //System.out.println(grammar);\r\n }\r\n else\r\n System.out.println(\"\\nERROR - UNEXPECTED LEXEME: \\\"\" + lexeme + \"\\\"\");\r\n\r\n i = 0;\r\n j = 0;\r\n k = 0;\r\n index = 0;\r\n lex();\r\n translate();\r\n }", "public SmartScriptParser(String text) {\n lexer = new SmartScriptLexer(text);\n documentNode = new DocumentNode();\n stack = new ObjectStack();\n parse();\n\n}", "public String grammar(Source source) {\r\n Stacker stacker = new Stacker();\r\n grammar = stacker.run(source);\r\n charInput = ! grammar.has(TI);\r\n if (grammar.op() == Error) return grammar.note();\r\n else return null;\r\n }", "public Grammar(List<String> rules) throws IllegalArgumentException {\n\t\tif (rules == null || rules.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfor (String line : rules) {\n\t\t\tString[] pieces = line.split(\"::=\");\n\t\t\tString[] subpieces = pieces[1].split(\"\\\\|\");\n\t\t\tfor (int i = 0; i < subpieces.length; i++) {\n\t\t\t\tsubpieces[i] = subpieces[i].trim();\n\t\t\t}\n List<String> listSubpieces = Arrays.asList(subpieces);\n\t\t\tif (!this.grammarRules.containsKey(pieces[0])) {\n\t\t\t\tthis.grammarRules.put(pieces[0].trim(), listSubpieces);\n\t\t\t} else {\n List<String> newSymbols = new ArrayList<String>();\n newSymbols.addAll(this.grammarRules.get(pieces[0]));\n newSymbols.addAll(listSubpieces);\n this.grammarRules.put(pieces[0].trim(), newSymbols);\n }\n\t\t}\t\n\t}", "CmdRule createCmdRule();", "public CLI()\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = \"\";\r\n\t\t//this.exitStr = exitStr;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "public synchronized void init() throws IOException\n {\n parserIn = new PipedOutputStream();\n PipedInputStream in = new PipedInputStream();\n parserIn.connect( in );\n antlrSchemaConverterLexer lexer = new antlrSchemaConverterLexer( in );\n parser = new antlrSchemaConverterParser( lexer );\n }", "private void writeGrammar() {\n grammar = new ArrayList<ArrayList<String>>();\n\n int programLine = 0;\n String inputLine = null;\n try {\n FileReader reader = new FileReader(grammarFile);\n BufferedReader bufferedReader = new BufferedReader(reader);\n\n while((inputLine = bufferedReader.readLine()) != null) {\n\n // removes all leading and trailing whitespaces and leading tabs\n String line = inputLine.trim().replaceFirst(\"\\\\t\", \"\");\n\n // processes a production rule on each nonempty program line\n if(!line.isEmpty() || !line.equals(\"\")) {\n String[] tokens = line.split(\"\\\\s+\");\n grammar.add(new ArrayList<String>(Arrays.asList(tokens)));\n }\n\n programLine++;\n }\n\n bufferedReader.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(\n grammarFile + \" not found\"\n );\n } catch(IOException e) {\n System.out.println(\n \"Error reading file \" + grammarFile\n );\n }\n\n // check to see if grammar correctly read from file\n// for(int i = 0; i < grammar.size(); i++) {\n// printArrayList(grammar.get(i));\n// System.out.println();\n// }\n }", "protected LR1_Grammar(Grammar grammar) {\n\t\tsuper(grammar);\n\t\tSet follow = new Set(1);\n\t\tfollow.append(END_OF_SOURCE);\n\t\tthis.start.follow = follow;\n\t}", "public Lexicon lex(Options.LexOptions op)\n/* */ {\n/* 514 */ return new BaseLexicon(op);\n/* */ }", "public ProgramParser(ProgramParserTokenManager tm) {\n token_source = tm;\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 14; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "private static void input(String[] args) {\n try (BufferedReader scanner = new BufferedReader(\n new InputStreamReader(args.length > 0 ? new FileInputStream(args[0]) : System.in))) {\n\n String linija;\n\n // regularne definicije\n while ((linija = scanner.readLine()) != null && linija.startsWith(\"{\")) {\n String tmp[] = linija.split(\" \");\n\n tmp[0] = tmp[0].substring(1, tmp[0].length() - 1);\n String naziv = tmp[0];\n String izraz = expandRegularDefinition(tmp[1]);\n\n regularneDefinicije.put(naziv, izraz);\n\n // System.out.println(naziv + \", \" + izraz);\n }\n\n // stanja\n while (!linija.startsWith(\"%X\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, stanjaLA);\n\n // leksicke jedinke\n while (!linija.startsWith(\"%L\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, leksickeJedinke);\n\n // pravila leksickog analizatora\n\n while ((linija = scanner.readLine()) != null) {\n while (!linija.startsWith(\"<\")) {\n linija = scanner.readLine();\n }\n\n String tmp[] = linija.split(\">\", 2);\n\n String stateName = tmp[0].substring(1, tmp[0].length());\n String regDef = tmp[1];\n\n regDef = expandRegularDefinition(regDef);\n\n // System.out.println(stateName + \"<> \" + regDef);\n LexerRule lexerRule = new LexerRule(regDef, stateName, 1, \"<\" + stateName + \">\" + regDef);\n lexerRules.add(lexerRule);\n\n scanner.readLine(); // preskoci {\n\n linija = scanner.readLine().trim();\n while (linija != null && scanner.ready() && !linija.equals(\"}\")) {\n // radi nesto s naredbom\n lexerRule.addAction(linija);\n linija = scanner.readLine().trim();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n CharStream stream;\n if(args.length == 1){\n try {\n stream = new ANTLRFileStream(args[0]);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler o ficheiro \\\"\" + args[0] + \"\\\".\");\n e.printStackTrace();\n return;\n }\n } else{\n try {\n stream = new ANTLRInputStream(System.in);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler do stdin.\");\n e.printStackTrace();\n return;\n }\n }\n\n System.out.println(stream.toString());\n\n LissLexer lexer = new LissLexer(stream);\n TokenStream token = new CommonTokenStream(lexer);\n LissParser parser = new LissParser(token);\n\n //create identifier table\n SymbolTable idT = new SymbolTable();\n ErrorTable e = new ErrorTable();\n Mips m = new Mips();\n parser.liss(idT, e, m);\n\n System.out.println(idT.toString());\n\n /*long total_memory = Runtime.getRuntime().totalMemory(); // Total available now (bytes)\n long free_memory = Runtime.getRuntime().freeMemory(); // Free memory now (bytes)\n long max_memory = Runtime.getRuntime().maxMemory(); // (bytes)\n long mb= (2^20);\n\n System.out.println(\"TOTAL_MEMORY: \"+total_memory +\" B\");\n System.out.println(\"FREE_MEMORY: \"+(free_memory)+\" B\");\n System.out.println(\"MAX_MEMORY: \"+(max_memory)+\" B\\n\");\n\n System.out.println(\"TOTAL_MEMORY: \"+total_memory/mb +\" MB\");\n System.out.println(\"FREE_MEMORY: \"+(free_memory/mb)+\" MB\");\n System.out.println(\"MAX_MEMORY: \"+(max_memory/mb)+\" MB\");*/\n\n }", "public TerminalGame()\n \t{\n \t\tsuper();\n \t\tbuilder = new StringBuilder();\n \t\tscanner = new Scanner(System.in);\n \t}", "public LuaGrammarCup(java_cup.runtime.Scanner s) {super(s);}", "public void compile(String[] args){\n CharStream stream;\n if(args.length == 1){\n try {\n stream = new ANTLRFileStream(args[0]);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler o ficheiro \\\"\" + args[0] + \"\\\".\");\n e.printStackTrace();\n return;\n }\n } else{\n try {\n stream = new ANTLRInputStream(System.in);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler do stdin.\");\n e.printStackTrace();\n return;\n }\n }\n\n System.out.println(stream.toString());\n\n LissLexer lexer = new LissLexer(stream);\n TokenStream token = new CommonTokenStream(lexer);\n LissParser parser = new LissParser(token);\n parser.liss(this.idt,this.errorTable,this.mips);\n }", "public A4Parser(java_cup.runtime.Scanner s) {super(s);}", "public A4Parser(java_cup.runtime.Scanner s) {super(s);}", "void initGrammarEvents() {\n\tg0.addProduction(new com.siemens.ct.exi.grammars.event.StartDocument(), g1);\n\tg1.addProduction(globalSE59, g2);\n\tg1.addProduction(globalSE62, g2);\n\tg1.addProduction(globalSE64, g2);\n\tg1.addProduction(globalSE66, g2);\n\tg1.addProduction(globalSE73, g2);\n\tg1.addProduction(globalSE75, g2);\n\tg1.addProduction(globalSE76, g2);\n\tg1.addProduction(globalSE78, g2);\n\tg1.addProduction(globalSE80, g2);\n\tg1.addProduction(globalSE82, g2);\n\tg1.addProduction(globalSE85, g2);\n\tg1.addProduction(globalSE91, g2);\n\tg1.addProduction(globalSE93, g2);\n\tg1.addProduction(globalSE95, g2);\n\tg1.addProduction(globalSE97, g2);\n\tg1.addProduction(globalSE101, g2);\n\tg1.addProduction(globalSE102, g2);\n\tg1.addProduction(globalSE104, g2);\n\tg1.addProduction(globalSE106, g2);\n\tg1.addProduction(globalSE109, g2);\n\tg1.addProduction(globalSE111, g2);\n\tg1.addProduction(globalSE113, g2);\n\tg1.addProduction(globalSE115, g2);\n\tg1.addProduction(globalSE119, g2);\n\tg1.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g2);\n\tg2.addProduction(new com.siemens.ct.exi.grammars.event.EndDocument(), g68);\n\tg3.addProduction(new com.siemens.ct.exi.grammars.event.StartDocument(), g4);\n\tg4.addProduction(globalSE59, g4);\n\tg4.addProduction(globalSE62, g4);\n\tg4.addProduction(globalSE64, g4);\n\tg4.addProduction(globalSE66, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc68, g7), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc69, g7), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc70, g27), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc72, g7), g4);\n\tg4.addProduction(globalSE73, g4);\n\tg4.addProduction(globalSE75, g4);\n\tg4.addProduction(globalSE76, g4);\n\tg4.addProduction(globalSE78, g4);\n\tg4.addProduction(globalSE80, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc81, g7), g4);\n\tg4.addProduction(globalSE82, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc84, g7), g4);\n\tg4.addProduction(globalSE85, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc87, g18), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc88, g18), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc89, g7), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc90, g7), g4);\n\tg4.addProduction(globalSE91, g4);\n\tg4.addProduction(globalSE93, g4);\n\tg4.addProduction(globalSE95, g4);\n\tg4.addProduction(globalSE97, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc99, g18), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc100, g7), g4);\n\tg4.addProduction(globalSE101, g4);\n\tg4.addProduction(globalSE102, g4);\n\tg4.addProduction(globalSE104, g4);\n\tg4.addProduction(globalSE106, g4);\n\tg4.addProduction(globalSE109, g4);\n\tg4.addProduction(globalSE111, g4);\n\tg4.addProduction(globalSE113, g4);\n\tg4.addProduction(globalSE115, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc117, g18), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc118, g18), g4);\n\tg4.addProduction(globalSE119, g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc121, g9), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc122, g16), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc124, g18), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc125, g17), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc126, g9), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc127, g9), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc128, g7), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g4);\n\tg4.addProduction(new com.siemens.ct.exi.grammars.event.EndDocument(), g68);\n\tg5.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc0, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g49);\n\tg6.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc84, g7), g71);\n\tg6.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc69, g7), g73);\n\tg6.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc128, g7), g74);\n\tg7.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryBase64Datatype(qnc61)), g69);\n\tg8.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g50);\n\tg8.addProduction(globalSE75, g79);\n\tg8.addProduction(globalSE76, g79);\n\tg8.addProduction(globalSE95, g79);\n\tg8.addProduction(globalSE119, g79);\n\tg8.addProduction(globalSE85, g79);\n\tg8.addProduction(globalSE97, g79);\n\tg8.addProduction(globalSE80, g79);\n\tg8.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g79);\n\tg8.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g99);\n\tg9.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.StringDatatype(qnc52)), g69);\n\tg10.addProduction(globalSE62, g80);\n\tg10.addProduction(globalSE91, g80);\n\tg10.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g80);\n\tg10.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g83);\n\tg11.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc81, g7), g81);\n\tg12.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc5, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g51);\n\tg12.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc6, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g52);\n\tg12.addProduction(globalSE115, g69);\n\tg12.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg13.addProduction(globalSE113, g85);\n\tg14.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc0, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g53);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc122, g16), g91);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc124, g18), g91);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc126, g9), g91);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc118, g18), g91);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc117, g18), g91);\n\tg15.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g91);\n\tg16.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc121, g9), g88);\n\tg17.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.IntegerDatatype(qnc43)), g69);\n\tg18.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryBase64Datatype(qnc27)), g69);\n\tg19.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc87, g18), g93);\n\tg19.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc88, g18), g94);\n\tg20.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc99, g18), g96);\n\tg21.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g54);\n\tg21.addProduction(globalSE93, g103);\n\tg22.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g55);\n\tg22.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc5, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g56);\n\tg22.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc6, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g57);\n\tg22.addProduction(globalSE115, g100);\n\tg22.addProduction(globalSE64, g101);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc1, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g58);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g59);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc3, new com.siemens.ct.exi.datatype.StringDatatype(qnc52)), g49);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg23.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg24.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g60);\n\tg24.addProduction(globalSE111, g108);\n\tg25.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g61);\n\tg25.addProduction(globalSE59, g105);\n\tg26.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc0, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g62);\n\tg27.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.IntegerDatatype(qnc71)), g69);\n\tg28.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g63);\n\tg28.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryBase64Datatype(qnc27)), g69);\n\tg29.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g64);\n\tg29.addProduction(globalSE106, g113);\n\tg30.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g65);\n\tg30.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc4, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g66);\n\tg31.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.ListDatatype(new com.siemens.ct.exi.datatype.StringDatatype(qnc14), qnc13)), g69);\n\tg32.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.StringDatatype(qnc14)), g69);\n\tg33.addProduction(new com.siemens.ct.exi.grammars.event.AttributeGeneric(), g33);\n\tg33.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg33.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg33.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg34.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BooleanDatatype(qnc28)), g69);\n\tg35.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.NBitUnsignedIntegerDatatype(com.siemens.ct.exi.values.IntegerValue.valueOf(-128), com.siemens.ct.exi.values.IntegerValue.valueOf(127), qnc29)), g69);\n\tg36.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.date, qnc30)), g69);\n\tg37.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.dateTime, qnc31)), g69);\n\tg38.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DecimalDatatype(qnc32)), g69);\n\tg39.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.FloatDatatype(qnc33)), g69);\n\tg40.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gDay, qnc36)), g69);\n\tg41.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gMonth, qnc37)), g69);\n\tg42.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gMonthDay, qnc38)), g69);\n\tg43.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gYear, qnc39)), g69);\n\tg44.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gYearMonth, qnc40)), g69);\n\tg45.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryHexDatatype(qnc41)), g69);\n\tg46.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.UnsignedIntegerDatatype(qnc47)), g69);\n\tg47.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.time, qnc53)), g69);\n\tg48.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.NBitUnsignedIntegerDatatype(com.siemens.ct.exi.values.IntegerValue.valueOf(0), com.siemens.ct.exi.values.IntegerValue.valueOf(255), qnc55)), g69);\n\tg49.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg49.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg49.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg50.addProduction(globalSE75, g79);\n\tg50.addProduction(globalSE76, g79);\n\tg50.addProduction(globalSE95, g79);\n\tg50.addProduction(globalSE119, g79);\n\tg50.addProduction(globalSE85, g79);\n\tg50.addProduction(globalSE97, g79);\n\tg50.addProduction(globalSE80, g79);\n\tg50.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g79);\n\tg50.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g99);\n\tg51.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc6, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g52);\n\tg51.addProduction(globalSE115, g69);\n\tg51.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg52.addProduction(globalSE115, g69);\n\tg52.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg53.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc127, g9), g84);\n\tg53.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g84);\n\tg53.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg53.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g84);\n\tg54.addProduction(globalSE93, g103);\n\tg55.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc5, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g56);\n\tg55.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc6, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g57);\n\tg55.addProduction(globalSE115, g100);\n\tg55.addProduction(globalSE64, g101);\n\tg56.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc6, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g57);\n\tg56.addProduction(globalSE115, g100);\n\tg56.addProduction(globalSE64, g101);\n\tg57.addProduction(globalSE115, g100);\n\tg57.addProduction(globalSE64, g101);\n\tg58.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc2, new com.siemens.ct.exi.datatype.StringDatatype(qnc15)), g59);\n\tg58.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc3, new com.siemens.ct.exi.datatype.StringDatatype(qnc52)), g49);\n\tg58.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg58.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg58.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg59.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc3, new com.siemens.ct.exi.datatype.StringDatatype(qnc52)), g49);\n\tg59.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg59.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg59.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg60.addProduction(globalSE111, g108);\n\tg61.addProduction(globalSE59, g105);\n\tg62.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc70, g27), g67);\n\tg62.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg62.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg62.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g106);\n\tg63.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryBase64Datatype(qnc27)), g69);\n\tg64.addProduction(globalSE106, g113);\n\tg65.addProduction(new com.siemens.ct.exi.grammars.event.Attribute(qnc4, new com.siemens.ct.exi.datatype.StringDatatype(qnc26)), g66);\n\tg66.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg66.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g112);\n\tg67.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg67.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg67.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g67);\n\tg69.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg70.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryBase64Datatype(qnc61)), g69);\n\tg71.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc90, g7), g72);\n\tg72.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc69, g7), g73);\n\tg72.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc128, g7), g74);\n\tg73.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc128, g7), g74);\n\tg74.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc72, g7), g75);\n\tg74.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc100, g7), g76);\n\tg74.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg75.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc100, g7), g76);\n\tg75.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg76.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc89, g7), g69);\n\tg77.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc84, g7), g71);\n\tg77.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc69, g7), g73);\n\tg77.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc128, g7), g74);\n\tg78.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.StringDatatype(qnc52)), g69);\n\tg79.addProduction(globalSE75, g79);\n\tg79.addProduction(globalSE76, g79);\n\tg79.addProduction(globalSE95, g79);\n\tg79.addProduction(globalSE119, g79);\n\tg79.addProduction(globalSE85, g79);\n\tg79.addProduction(globalSE97, g79);\n\tg79.addProduction(globalSE80, g79);\n\tg79.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g79);\n\tg79.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg79.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g79);\n\tg80.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg80.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g80);\n\tg81.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc68, g7), g69);\n\tg82.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc81, g7), g81);\n\tg83.addProduction(globalSE62, g80);\n\tg83.addProduction(globalSE91, g80);\n\tg83.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g80);\n\tg83.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g83);\n\tg84.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc127, g9), g84);\n\tg84.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g84);\n\tg84.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg84.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g84);\n\tg85.addProduction(globalSE113, g85);\n\tg85.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg86.addProduction(globalSE113, g85);\n\tg87.addProduction(globalSE115, g69);\n\tg87.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg88.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc125, g17), g69);\n\tg89.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.IntegerDatatype(qnc43)), g69);\n\tg90.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc121, g9), g88);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc122, g16), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc124, g18), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc126, g9), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc118, g18), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc117, g18), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g91);\n\tg91.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc122, g16), g91);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc124, g18), g91);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc126, g9), g91);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc118, g18), g91);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc117, g18), g91);\n\tg92.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g91);\n\tg93.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc88, g18), g94);\n\tg93.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g94);\n\tg93.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg94.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g94);\n\tg94.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg95.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc87, g18), g93);\n\tg95.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc88, g18), g94);\n\tg96.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc99, g18), g96);\n\tg96.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g97);\n\tg96.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg97.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc99, g18), g96);\n\tg97.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg98.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc99, g18), g96);\n\tg99.addProduction(globalSE75, g79);\n\tg99.addProduction(globalSE76, g79);\n\tg99.addProduction(globalSE95, g79);\n\tg99.addProduction(globalSE119, g79);\n\tg99.addProduction(globalSE85, g79);\n\tg99.addProduction(globalSE97, g79);\n\tg99.addProduction(globalSE80, g79);\n\tg99.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g79);\n\tg99.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g99);\n\tg100.addProduction(globalSE64, g101);\n\tg101.addProduction(globalSE66, g69);\n\tg102.addProduction(globalSE115, g100);\n\tg102.addProduction(globalSE64, g101);\n\tg103.addProduction(globalSE93, g103);\n\tg103.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg104.addProduction(globalSE93, g103);\n\tg105.addProduction(globalSE102, g104);\n\tg106.addProduction(new com.siemens.ct.exi.grammars.event.StartElement(qnc70, g27), g67);\n\tg106.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg106.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg106.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g106);\n\tg107.addProduction(globalSE59, g105);\n\tg108.addProduction(globalSE109, g109);\n\tg109.addProduction(globalSE73, g110);\n\tg109.addProduction(globalSE82, g110);\n\tg109.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg110.addProduction(globalSE82, g110);\n\tg110.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg111.addProduction(globalSE111, g108);\n\tg112.addProduction(new com.siemens.ct.exi.grammars.event.StartElementGeneric(), g67);\n\tg112.addProduction(new com.siemens.ct.exi.grammars.event.CharactersGeneric(), g112);\n\tg113.addProduction(globalSE106, g113);\n\tg113.addProduction(new com.siemens.ct.exi.grammars.event.EndElement(), g68);\n\tg114.addProduction(globalSE106, g113);\n\tg115.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.ListDatatype(new com.siemens.ct.exi.datatype.StringDatatype(qnc14), qnc13)), g69);\n\tg116.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BooleanDatatype(qnc28)), g69);\n\tg117.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.NBitUnsignedIntegerDatatype(com.siemens.ct.exi.values.IntegerValue.valueOf(-128), com.siemens.ct.exi.values.IntegerValue.valueOf(127), qnc29)), g69);\n\tg118.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.date, qnc30)), g69);\n\tg119.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.dateTime, qnc31)), g69);\n\tg120.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DecimalDatatype(qnc32)), g69);\n\tg121.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.FloatDatatype(qnc33)), g69);\n\tg122.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gDay, qnc36)), g69);\n\tg123.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gMonth, qnc37)), g69);\n\tg124.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gMonthDay, qnc38)), g69);\n\tg125.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gYear, qnc39)), g69);\n\tg126.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.gYearMonth, qnc40)), g69);\n\tg127.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.BinaryHexDatatype(qnc41)), g69);\n\tg128.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.UnsignedIntegerDatatype(qnc47)), g69);\n\tg129.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.DatetimeDatatype(com.siemens.ct.exi.types.DateTimeType.time, qnc53)), g69);\n\tg130.addProduction(new com.siemens.ct.exi.grammars.event.Characters(new com.siemens.ct.exi.datatype.NBitUnsignedIntegerDatatype(com.siemens.ct.exi.values.IntegerValue.valueOf(0), com.siemens.ct.exi.values.IntegerValue.valueOf(255), qnc55)), g69);\n\t/* END Grammar Events ----- */\n\n\t}", "public static Grammar convertToGrammar(List<String> grammarLines) throws GrammarSyntaxException {\r\n\t\tGrammar grammar = new Grammar();\r\n\t\t\r\n\t\t//Extract production\r\n\t\tfor (String line: grammarLines){\r\n\t\t\textractProduction(grammar, line);\r\n\t\t}\r\n\r\n\t\t//Axiom creation\r\n\t\tProduction axiomProduction = new Production();\r\n\t\taxiomProduction.setLeft(Grammar.AXIOM);\r\n\t\taxiomProduction.addRightElement(grammar.getProductions().get(0).getLeft());\r\n\t\taxiomProduction.addRightElement(Grammar.END_LINE);\r\n\r\n\t\tgrammar.setAxiomProduction(axiomProduction);\r\n\r\n\t\t//Calculate first and follow\r\n\t\tcalculateFirstAndFollow(grammar);\r\n\r\n\t\treturn grammar;\r\n\t}", "public LexicalAnalyzer(BufferedReader reader)\n\t{\n\t\tthis.reader = reader;\n\t\toperatorSet.add(\"*\");\n\t\toperatorSet.add(\"-\");\n\t\toperatorSet.add(\"+\");\n\t\toperatorSet.add(\"/\");\n\t\toperatorSet.add(\"=\");\n\t\toperatorSet.add(\"<\");\n\t\toperatorSet.add(\">\");\n\t\t\n\t\tsymbolSet.add(\".\");\n\t\tsymbolSet.add(\",\");\n\t\tsymbolSet.add(\";\");\n\t\tsymbolSet.add(\":\");\n\t\tsymbolSet.add(\"(\");\n\t\tsymbolSet.add(\")\");\n\t\t\n\t\tkeyWordSet.add(\"program\");\n\t\tkeyWordSet.add(\"begin\");\n\t\tkeyWordSet.add(\"end.\");\n\t\tkeyWordSet.add(\"integer\");\n\t\tkeyWordSet.add(\"array\");\n\t\tkeyWordSet.add(\"do\");\n\t\tkeyWordSet.add(\"assign\");\n\t\tkeyWordSet.add(\"to\");\n\t\tkeyWordSet.add(\"unless\");\n\t\tkeyWordSet.add(\"when\");\n\t\tkeyWordSet.add(\"in\");\n\t\tkeyWordSet.add(\"out\");\n\t\tkeyWordSet.add(\"else\");\n\t\tkeyWordSet.add(\"and\");\n\t\tkeyWordSet.add(\"or\");\n\t\tkeyWordSet.add(\"not\");\n\t\t\n\t\tsymbolTable.add(new SymbolTableEntry(\"program\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"begin\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"end.\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"integer\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"array\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"do\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"assign\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"to\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"unless\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"when\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"in\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"out\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"else\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"and\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"or\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"not\", \"keyword\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\".\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\",\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\";\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\":\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"(\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\")\", \"symbol\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"+\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"-\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"*\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"/\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"=\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\"<\", \"op\"));\n\t\tsymbolTable.add(new SymbolTableEntry(\">\", \"op\"));\n\t\t\n\t}", "void setGrammar(IGrammarComp aGrammar);", "public Parser(String[] userInput) {\n this.command = userInput[0];\n if (userInput.length > 1) {\n this.description = userInput[1];\n }\n }", "@Override\n public AddCommand parse(String args) throws ParseException {\n ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args,\n PREFIX_QUESTION, PREFIX_CHOICE, PREFIX_DEFINITION, PREFIX_TAG, PREFIX_ANSWER);\n if (!arePrefixesPresent(argMultimap,\n PREFIX_QUESTION, PREFIX_DEFINITION, PREFIX_ANSWER)\n || !argMultimap.getPreamble().isEmpty()) {\n throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT + AddCommand.MESSAGE_USAGE));\n }\n\n Question question = ParserUtil.parseWord(argMultimap.getValue(PREFIX_QUESTION).get());\n List<Choice> choices = ParserUtil.parseChoices(argMultimap.getAllValues(PREFIX_CHOICE));\n Definition definition = ParserUtil.parseDefinition(argMultimap.getValue(PREFIX_DEFINITION).get());\n Set<Tag> tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG));\n Answer answer = ParserUtil.parseAnswer(argMultimap.getValue(PREFIX_ANSWER).get());\n\n Flashcard flashcard;\n if (arePrefixesPresent(argMultimap, PREFIX_CHOICE)) {\n if (!choices.contains(new Choice(answer.getAnswer()))) {\n throw new ParseException(ANSWER_CHOICE_MISMATCH);\n } else {\n flashcard = new McqFlashcard(question, choices, definition, tagList, answer);\n }\n } else {\n flashcard = new ShortAnswerFlashcard(question, definition, tagList, answer);\n }\n\n return new AddCommand(flashcard);\n }", "public OptionParser() {\n\n\t}", "Parse createParse();", "public String getGrammarText();", "public interface IGrammarComp extends IPAMOJAComponent{\n \n /**\n * Returns the internal structure of this grammar.\n * \n * @return the internal structure of this grammar\n */\n public CGrammar getGrammarStructure();\n\n \n /**\n * Sets the value of the internal structure of this grammar, generates its corresponding string representation, performs grammar analysis and notifies observers about <code>GrammarStructure</code> property changes.\n * @param aGrammarStructure\n */\n public void setGrammarStructure(CGrammar aGrammarStructure);\n \n \n /**\n * Returns the string representation of this grammar.\n * \n * @return the string representation of this grammar\n */\n public String getGrammarText();\n\n /* \n * Set the string representation of this grammar.\n * Check well-formedness of the string representation of the grammar.\n * Signal an error if the string representation is invalid else compute the\n * internal representation of the grammar. Also generate analysis\n * information and fire a property change.\n *\n * @param aGrammarText the text representation of the grammar to set.\n * @pre: Grammar is well-formed(See <code>toText(String aGrammarText)</code>)\n *\n */\n\n /**\n *\n * @param aGrammarText\n */\n \n\n public void setGrammarText(String aGrammarText);\n \n /**\n * Returns <code>true</code> if this grammar is annotated with endmarker symbol, <code>false</code>\n * otherwise.\n *\n * @return <code>true</code> if this grammar is annotated with endmarker symbol, <code>false</code>\n * otherwise\n */\n public boolean isAugment();\n /**\n * Set the value of Augment and notify observers about <code>Augment</code> property changes.\n *\n * \n * @param aValue new value of Augment\n */\n public void setAugment(boolean aValue);\n \n /**\n * Returns <code>true</code> if a terminal symbol of this grammar has data, <code>false</code>\n * otherwise.\n * \n * @param aSym the code of this terminal symbol\n * @return <code>true</code> if this terminal symbol has data, <code>false</code>\n * otherwise\n */\n public boolean hasData(int aSym);\n \n /**\n * Returns structure representation of RE text.\n * @param aString\n * @return \n */\n // public CRE RETextToTree(String aString);\n /**\n * Removes all elements from the grammar component\n */\n public void clear();\n\n /**\n *\n * @return\n */\n public boolean ELL1();\n}", "public String run(Source source) {\r\n if (grammar == null) {\r\n System.err.println(\"Error: No grammar has been set up\");\r\n System.exit(1);\r\n }\r\n prepare(source);\r\n return runParser();\r\n }", "protected GrammarNode createGrammar() throws IOException {\n languageModel.allocate();\n Timer.start(\"LMGrammar.create\");\n GrammarNode firstNode = null;\n if (languageModel.getMaxDepth() > 2) {\n System.out.println(\"Warning: LMGrammar limited to bigrams\");\n }\n int identity = 0;\n List nodes = new ArrayList();\n Set words = languageModel.getVocabulary();\n // create all of the word nodes\n for (Iterator i = words.iterator(); i.hasNext();) {\n String word = (String) i.next();\n GrammarNode node = createGrammarNode(identity++, word);\n if (node != null && !node.isEmpty()) {\n if (node.getWord().equals(\n getDictionary().getSentenceStartWord())) {\n firstNode = node;\n } else if (node.getWord().equals(\n getDictionary().getSentenceEndWord())) {\n node.setFinalNode(true);\n }\n nodes.add(node);\n }\n }\n if (firstNode == null) {\n throw new Error(\"No sentence start found in language model\");\n }\n for (Iterator i = nodes.iterator(); i.hasNext();) {\n GrammarNode prevNode = (GrammarNode) i.next();\n // don't add any branches out of the final node\n if (prevNode.isFinalNode()) {\n continue;\n }\n for (Iterator j = nodes.iterator(); j.hasNext();) {\n GrammarNode nextNode = (GrammarNode) j.next();\n String prevWord = prevNode.getWord().getSpelling();\n String nextWord = nextNode.getWord().getSpelling();\n Word[] wordArray = {getDictionary().getWord(prevWord),\n getDictionary().getWord(nextWord)};\n float logProbability = languageModel\n .getProbability(WordSequence.getWordSequence(wordArray));\n prevNode.add(nextNode, logProbability);\n }\n }\n Timer.stop(\"LMGrammar.create\");\n languageModel.deallocate();\n return firstNode;\n }", "public DummyCommand parse(String userInput) throws ParseException {\n HashMap<String, String> aliasList = getAliasManager().getAliasList();\n\n if (aliasList.isEmpty()) {\n return new DummyCommand(MESSAGE_EMPTY);\n }\n\n StringBuilder sb = new StringBuilder();\n aliasList.forEach((alias, command) -> sb.append(String.format(\"%s: %s\\n\", alias, command)));\n\n return new DummyCommand(sb.toString());\n }", "public ProgramParser(java.io.InputStream stream, String encoding) {\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new ProgramParserTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 14; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "@Test\n\tpublic void testDec1() throws LexicalException, SyntaxException {\n\t\tString input = \"prog int k;\";\n\t\tshow(input);\n\t\tScanner scanner = new Scanner(input).scan(); // Create a Scanner and initialize it\n\t\tshow(scanner); // Display the Scanner\n\t\tSimpleParser parser = new SimpleParser(scanner); //\n\t\tparser.parse();\n\t}", "public parserCapas(LexCapas lex) {\n\t\tsuper(lex);\n\t}", "public Construct() {\n\tprefixes = new StringBuilder();\n\tvariables = new StringBuilder();\n\twheres = new StringBuilder();\n }", "@Override\n public Cli<C> build() {\n ParserMetadata<C> parserConfig = this.parserBuilder.build();\n\n CommandMetadata defaultCommandMetadata = null;\n List<CommandMetadata> allCommands = new ArrayList<CommandMetadata>();\n if (defaultCommand != null) {\n defaultCommandMetadata = MetadataLoader.loadCommand(defaultCommand, baseHelpSections, parserConfig);\n }\n\n List<CommandMetadata> defaultCommandGroup = defaultCommandGroupCommands != null\n ? MetadataLoader.loadCommands(defaultCommandGroupCommands, baseHelpSections, parserConfig)\n : new ArrayList<CommandMetadata>();\n\n allCommands.addAll(defaultCommandGroup);\n if (defaultCommandMetadata != null)\n allCommands.add(defaultCommandMetadata);\n\n // Build groups\n List<CommandGroupMetadata> commandGroups;\n if (groups != null) {\n commandGroups = new ArrayList<CommandGroupMetadata>();\n for (GroupBuilder<C> groupBuilder : groups.values()) {\n commandGroups.add(groupBuilder.build());\n }\n } else {\n commandGroups = new ArrayList<>();\n }\n\n // Find all commands registered in groups and sub-groups, we use this to\n // check this is a valid CLI with at least 1 command\n for (CommandGroupMetadata group : commandGroups) {\n allCommands.addAll(group.getCommands());\n if (group.getDefaultCommand() != null)\n allCommands.add(group.getDefaultCommand());\n\n // Make sure to scan sub-groups\n Queue<CommandGroupMetadata> subGroups = new LinkedList<CommandGroupMetadata>();\n subGroups.addAll(group.getSubGroups());\n while (!subGroups.isEmpty()) {\n CommandGroupMetadata subGroup = subGroups.poll();\n allCommands.addAll(subGroup.getCommands());\n if (subGroup.getDefaultCommand() != null)\n allCommands.add(subGroup.getDefaultCommand());\n subGroups.addAll(subGroup.getSubGroups());\n }\n }\n\n // add commands to groups based on the value of groups in the @Command\n // annotations\n // rather than change the entire way metadata is loaded, I figured just\n // post-processing was an easier, yet uglier, way to go\n MetadataLoader.loadCommandsIntoGroupsByAnnotation(allCommands, commandGroups, defaultCommandGroup,\n baseHelpSections, parserConfig);\n\n // Build restrictions\n // Use defaults if none specified\n if (restrictions.size() == 0)\n withDefaultRestrictions();\n\n if (allCommands.size() == 0)\n throw new IllegalArgumentException(\"Must specify at least one command to create a CLI\");\n\n // Build metadata objects\n GlobalMetadata<C> metadata = MetadataLoader.<C> loadGlobal(name, description, defaultCommandMetadata,\n ListUtils.unmodifiableList(defaultCommandGroup), ListUtils.unmodifiableList(commandGroups),\n ListUtils.unmodifiableList(restrictions), Collections.unmodifiableCollection(baseHelpSections.values()),\n parserConfig);\n\n return new Cli<C>(metadata);\n }", "RoverProgram createRoverProgram();", "public static GrammarInfo generateGrammar(ParserResult parserResult) throws IngridParserException {\n GrammarInfo grammar = new GrammarInfo(parserResult.grammarName);\n\n Map<String, Rule> rules = parserResult.rules;\n\n // Lexer rules must be resolved first so that parser rules can reference them\n // Lexer rules do not contain references to parser rules\n // We need to copy the array because we are changing it inside forEach\n new ArrayList<>(rules.keySet())\n .stream()\n .filter(name -> rules.get(name) instanceof LexerRule || rules.get(name) instanceof RegexRule)\n .forEach(name -> {\n FlatLexerRule flatRule = null;\n // We always get updated Rule from rule set again, because we might have updated it\n flatRule = flattenLexerRule(rules.get(name), rules);\n grammar.rules.put(name, flatRule);\n\n // We need to put it to the old set too, so resolving in the second step works too,\n // because we create new flatRule objects inside flattenLexerRule.\n rules.put(name, flatRule);\n });\n\n // We need to copy the array because we are changing it inside forEach\n new ArrayList<>(rules.values())\n .stream()\n .filter(r -> r instanceof ParserRule)\n .forEach(rule -> {\n resolveParserRule((ParserRule) rule, rules);\n\n // We do not call \"new Rule\" inside here, so we don't need to update old rule set.\n // Unlike in the first step, ParserRule objects stay the same, just their content is changed.\n grammar.rules.put(rule.name, rule);\n });\n\n grammar.rootRule = grammar.rules.get(parserResult.rootRule);\n\n for (String ruleToRemove : parserResult.fragmentLexerRules) {\n grammar.rules.remove(ruleToRemove);\n }\n\n return grammar;\n }", "public CompParser(java_cup.runtime.Scanner s) {super(s);}", "@Test\r\n\tpublic void test3() throws IOException, LexerException, ParserException {\r\n\t\tStringReader ex = new StringReader(\"(lam^s f.\\n\\t(lam^s x.x) (f 1))\\n(lam^c y.\\n\\t(lam^s z.z) y)\");\r\n\r\n\t\tParser parser = new Parser();\r\n\t\tTerm result = parser.Parsing(ex);\r\n\t}", "private void setup(Command cmd) throws RuntimeException, PropertyException, IOException, EngineException{\n\t\tbaseRec = new BaseRecognizer(((JSGFGrammar) cm.lookup(\"jsgfGrammar\")).getGrammarManager());\n\t\trecognizer = (Recognizer) cm.lookup(\"recognizer\");\n\t\tmicrophone = (Microphone) cm.lookup(\"microphone\");\n\n\t\tbaseRec.allocate();\n\t\trecognizer.allocate();\n\t}", "public ProgramParser(String[] args) throws InterpreterException {\n java.util.Scanner scanner;\n String text = \"\";\n try {\n scanner = new java.util.Scanner(new java.io.File(args[0]));\n text = scanner.useDelimiter(\"\\u005c\\u005cA\").next();\n scanner.close();\n ProgramParser.programCode = new java.io.StringReader(text);\n } catch (FileNotFoundException ex) {\n throw new InterpreterException(\"FileNotFoundException\", \"Check file path.\", ex.getMessage());\n }\n ProgramParser.stringInput = args[1];\n System.out.println(\"Program: \" + args[0] + \" - input: \" + stringInput);\n //System.out.println(\"code\\n\" + text + \"\\n---Done\");\n }", "public static void main(String[] args) throws IOException {\n InputStream is = ClassLoader.getSystemResourceAsStream(\"graph.gr\");\n \n //Loading the DSL script into the ANTLR stream.\n CharStream cs = new ANTLRInputStream(is);\n \n // generate lexer from input stream from dsl statements.\n GraphLexer lexer = new GraphLexer(cs);\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n \n // generate parser tree from lexer tokens stream.\n GraphParser parser = new GraphParser(tokens);\n \n //Semantic model to be populated\n Graph g = new Graph();\n GraphDslListener dslRuleListener = new GraphDslListener(g, parser);\n \n //Adding the listener to facilitate walking through parse tree. \n parser.addParseListener(dslRuleListener);\n \n //invoking the parser. \n parser.graph();\n \n Graph.printGraph(g);\n }", "public Parser() {}", "public OnionooParser() {\n\n\t}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public Grammar(CFSG<? extends Number> grammar) {\n\t\tthis(grammar.lexRules, grammar.internalRules);\n\t\tlogFile = Parameters.logFile;\n\t}", "public Programa(java.io.InputStream stream, String encoding) {\n if (jj_initialized_once) {\n System.out.println(\"ERROR: Second call to constructor of static parser. \");\n System.out.println(\" You must either use ReInit() or set the JavaCC option STATIC to false\");\n System.out.println(\" during parser generation.\");\n throw new Error();\n }\n jj_initialized_once = true;\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new ProgramaTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 2; i++) jj_la1[i] = -1;\n }", "public void parse(Lexer lex);" ]
[ "0.62812734", "0.5981583", "0.5910731", "0.5865507", "0.5837395", "0.582275", "0.5674307", "0.5578271", "0.5575832", "0.5540899", "0.5530906", "0.5528431", "0.5491893", "0.54841036", "0.5473227", "0.5472736", "0.5469174", "0.5469174", "0.5469174", "0.5433768", "0.5408123", "0.5401656", "0.53378075", "0.53343385", "0.53199285", "0.53197736", "0.5318515", "0.5315533", "0.5286507", "0.5276761", "0.5264529", "0.52636534", "0.52353305", "0.52253866", "0.51804143", "0.5171337", "0.5161928", "0.51277524", "0.51170415", "0.5093746", "0.509045", "0.50856125", "0.50843316", "0.5082236", "0.5077224", "0.5070666", "0.5070237", "0.50615686", "0.50271773", "0.5020795", "0.5020293", "0.5012643", "0.4992988", "0.49777937", "0.49751505", "0.49702334", "0.49642906", "0.4963525", "0.4960623", "0.49543914", "0.49531284", "0.49531284", "0.49406514", "0.49375656", "0.4920425", "0.49187928", "0.4887819", "0.48754734", "0.48747134", "0.4870151", "0.48645133", "0.48632818", "0.4863223", "0.48629585", "0.48593527", "0.48589125", "0.48577386", "0.48559958", "0.4854504", "0.48533827", "0.48421067", "0.4837943", "0.48357257", "0.48327833", "0.48266277", "0.48228234", "0.48217964", "0.4805529", "0.48042592", "0.4796611", "0.4796611", "0.4796611", "0.4796611", "0.4796611", "0.4796611", "0.4796611", "0.4796611", "0.47882932", "0.4783699", "0.47791004" ]
0.7532151
0
Constructs a new cuboid. Note that the world of both locations must be the same.
public Region3D(final Location3D startLoc, final Location3D endLoc) { this(startLoc.getWorldName(), startLoc.getBlockX(), startLoc.getBlockY(), startLoc.getBlockZ(), endLoc.getWorldName(), endLoc.getBlockX(), endLoc.getBlockY(), endLoc.getBlockZ()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Cube(int l, int b, int h)\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=l;\r\n\t\tbredth=b;\r\n\t\theight=h;\r\n\t}", "public CubeEarth() {\n this(1, null);\n }", "Cube()\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=10;\r\n\t\tbredth=20;\r\n\t\theight=30;\r\n\t}", "public DynamicModelPart addCuboids() {\n for (int i = 0; i < this.x.length; i++) {\n this.addCuboid(this.x[i], this.y[i], this.z[i], this.sizeX[i], this.sizeY[i],\n this.sizeZ[i], this.extra[i], this.u[i], this.v[i]);\n }\n return this;\n }", "public Region3D(final String world1, final int x1, final int y1, final int z1, final String world2, final int x2, final int y2, final int z2) {\n\t\tif (!(world1.equals(world2))) {\n\t\t\tSystem.out.println(\"Can't use two different worlds for Region3D!\");\n\t\t\tSystem.out.println(\"Using the world of the first location instead.\");\n\t\t}\n\t\t\n\t\tthis.world = world1;\n\t\t\n\t\tfinal int lowX = Math.min(x1, x2);\n\t\tfinal int lowY = Math.min(y1, y2);\n\t\tfinal int lowZ = Math.min(z1, z2);\n\t\t\n\t\tfinal int highX = Math.max(x1, x2);\n\t\tfinal int highY = Math.max(y1, y2);\n\t\tfinal int highZ = Math.max(z1, z2);\n\n\t\tlowPoint = new Location3D(this.world, lowX, lowY, lowZ);\n\t\thighPoint = new Location3D(this.world, highX, highY, highZ);\n\t}", "public void createNewCube() {\n CUBE = new Cube();\n }", "public RubiksCube(){\n\t\tString[] c = {\n\t\t\t\t\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\n\t\t\t\t\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\n\t\t\t\t\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\n\t\t\t\t\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\n\t\t\t\t\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\n\t\t\t\t\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\n\t\t};\n\t\tthis.cube = c;\n\t}", "public DynamicModelPart addCuboid(float x, float y, float z, int sizeX, int sizeY, int sizeZ,\n float extra, int textureOffsetU, int textureOffsetV) {\n this.setTextureOffset(textureOffsetU, textureOffsetV);\n this.addDynamicCuboid(this, this.textureOffsetU, this.textureOffsetV, x, y, z,\n (float) sizeX, (float) sizeY, (float) sizeZ, extra, extra, extra, this.mirror,\n false);\n return this;\n }", "public Cube(String shapeName, double sideLength){\n super(shapeName, sideLength, sideLength, sideLength);\n }", "public Cube(double sideLength) {\n super.setName(\"Cube\");\n if (sideLength > 0) {\n this.sideLength = sideLength;\n } else {\n throw new IllegalArgumentException(\n \"The side length should be greater than 0.\");\n }\n }", "public Asteroid() {\n\t\t// create, seed random number\n\t\trandomNumber = new Random();\n\n\t\t// random location\n\t\tlocation = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE);\n\n\t\t// random movement vector\n\t\tmovement = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED,\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED);\n\t\t\n\t\t// random radius\n\t\tsize = randomNumber.nextInt() % 20 + 1;\n\t\t\n\t\t// create Sphere\n\t\tsphere = new Sphere(size, location);\n\n\t}", "public VolcanoWorld() {\n this(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n }", "public Ocean()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n BF bf = new BF();\n addObject(bf,500,300);\n SF sf = new SF();\n addObject(sf,100,300);\n }", "public ChunkyCuboid(BlockVector pt1, BlockVector pt2) {\r\n setMinMaxPoints(pt1, pt2);\r\n }", "public CubeGL2() {\n // Define points for a cube.\n // X, Y, Z\n mCubeVertexData = new float[]\n {\n // Front face\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n // Right face\n 1.0f, 1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, -1.0f,\n 1.0f, 1.0f, -1.0f,\n // Back face\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n // Left face\n -1.0f, 1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, 1.0f, 1.0f,\n // Top face\n -1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n // Bottom face\n 1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n };\n // R, G, B, A\n mCubeColourData = new float[]\n {\n // Front face\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n // Right face\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n // Back face\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n // Left face\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n // Top face\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n // Bottom face\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f\n };\n // X, Y, Z\n mCubeNormalData = new float[]\n {\n // Front face\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n // Right face\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n // Back face\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n // Left face\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n // Top face\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n // Bottom face\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f\n };\n // X, Y\n // Texture coordinate data.\n mCubeTextureCoordinateData = new float[]\n {\n // Front face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Right face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Back face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Left face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Top face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Bottom face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f\n };\n // Initialize the buffers.\n mCubeVertices = ByteBuffer.allocateDirect(mCubeVertexData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeVertices.put(mCubeVertexData).position(0);\n mCubeColours = ByteBuffer.allocateDirect(mCubeColourData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeColours.put(mCubeColourData).position(0);\n mCubeNormals = ByteBuffer.allocateDirect(mCubeNormalData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeNormals.put(mCubeNormalData).position(0);\n mCubeTextureCoordinates = ByteBuffer.allocateDirect(mCubeTextureCoordinateData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeTextureCoordinates.put(mCubeTextureCoordinateData).position(0);\n Matrix.setIdentityM(mModelMatrix, 0);\n }", "public ParametrisedCuboid(ParametrisedCuboid original)\n\t{\n\t\tsuper(original);\n\t\t\n\t\twidth = original.width;\n\t\theight = original.height;\n\t\tdepth = original.depth;\n\t\tcentre = original.centre.clone();\n\t\tsurfaceProperty = original.surfaceProperty.clone();\n\t}", "public World(int width, int height, World other)\n {\n this(width, height, other, AIR_EL);\n }", "public DynamicModelPart addCuboid(float x, float y, float z, int sizeX, int sizeY, int sizeZ,\n float extra, int textureOffsetU, int textureOffsetV, DynamicPart[] seed) {\n this.setTextureOffset(textureOffsetU, textureOffsetV);\n this.addDynamicCuboid(this, this.textureOffsetU, this.textureOffsetV, x, y, z,\n (float) sizeX, (float) sizeY, (float) sizeZ, extra, extra, extra, this.mirror,\n false, seed);\n return this;\n }", "public Vec3(){\n\t\tthis(0,0,0);\n\t}", "public MultiblockCuboid(boolean hasFloor, boolean hasFrame, boolean hasCeiling) {\n this.hasCeiling = hasCeiling;\n this.hasFloor = hasFloor;\n this.hasFrame = hasFrame;\n }", "public Cube() {\n\t\t// a float is 4 bytes, therefore we multiply the number if\n\t\t// vertices with 4.\n\t\tByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);\n\t\tvbb.order(ByteOrder.nativeOrder());\n\t\tvertexBuffer = vbb.asFloatBuffer();\n\t\tvertexBuffer.put(vertices);\n\t\tvertexBuffer.position(0);\n\t\t\n\t\t// Setup texture-coords-array buffer, in float. An float has 4 bytes (NEW)\n\t ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);\n\t tbb.order(ByteOrder.nativeOrder());\n\t texBuffer = tbb.asFloatBuffer();\n\t texBuffer.put(texCoords);\n\t texBuffer.position(0);\n\t\t\n\t\t// short is 2 bytes, therefore we multiply the number if\n\t\t// vertices with 2.\n//\t\tByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);\n//\t\tibb.order(ByteOrder.nativeOrder());\n//\t\tindexBuffer = ibb.asShortBuffer();\n//\t\tindexBuffer.put(indices);\n//\t\tindexBuffer.position(0);\n\t}", "public PhysicalObject(Location location, Vector volume)\n\t{\n\t\tthis(location, volume, (volume.getX() * volume.getY() * volume.getZ()));\n\t}", "public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }", "public CubeGL2(double width, double height, double depth) {\n // Define points for a cube.\n // X, Y, Z\n mCubeVertexData = new float[]\n {\n // Front face\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n // Right face\n 1.0f, 1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, -1.0f,\n 1.0f, 1.0f, -1.0f,\n // Back face\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n // Left face\n -1.0f, 1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, 1.0f, 1.0f,\n // Top face\n -1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n // Bottom face\n 1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n };\n\n for (int i = 0; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) width;\n }\n for (int i = 1; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) height;\n }\n for (int i = 2; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) depth;\n }\n\n // R, G, B, A\n mCubeColourData = new float[]\n {\n // Front face\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n // Right face\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n // Back face\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n // Left face\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n // Top face\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n // Bottom face\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f\n };\n // X, Y, Z\n mCubeNormalData = new float[]\n {\n // Front face\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n // Right face\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n // Back face\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n // Left face\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n // Top face\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n // Bottom face\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f\n };\n // X, Y\n // Texture coordinate data.\n mCubeTextureCoordinateData = new float[]\n {\n // Front face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Right face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Back face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Left face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Top face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Bottom face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f\n };\n // Initialize the buffers.\n mCubeVertices = ByteBuffer.allocateDirect(mCubeVertexData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeVertices.put(mCubeVertexData).position(0);\n mCubeColours = ByteBuffer.allocateDirect(mCubeColourData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeColours.put(mCubeColourData).position(0);\n mCubeNormals = ByteBuffer.allocateDirect(mCubeNormalData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeNormals.put(mCubeNormalData).position(0);\n mCubeTextureCoordinates = ByteBuffer.allocateDirect(mCubeTextureCoordinateData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeTextureCoordinates.put(mCubeTextureCoordinateData).position(0);\n Matrix.setIdentityM(mModelMatrix, 0);\n }", "public Classroom()\n { \n // Create a new world with 10x6 cells with a cell size of 130x130 pixels.\n super(10, 6, 130); \n prepare();\n }", "CubeModel(CubeModel cube) {\n initialize(cube);\n\n }", "public World(){\r\n locations = new Location[3][3];\r\n for(int r=0; r<3; r+=1){\r\n for(int c=0; c<3; c+=1){\r\n locations[r][c] = new EmptyLocation(new Position(r,c), \"Nothing here to see.\");\r\n }\r\n }\r\n home = locations[0][0];\r\n players = new ArrayList<Player>();\r\n }", "public DungeonSubzone(CuboidSelection cuboid) {\n this.cuboid = new CuboidSelection(cuboid.getWorld(),cuboid.getMinimumPoint(),cuboid.getMaximumPoint());\n }", "public Cube(Square square)\n {\n this.edge = square.getSide();\n this.volume = Math.pow(this.edge,3);\n }", "public Square(Color emission, Material material,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, material, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }", "public void cuboid(int lenght,int width,int height)\r\n\t{\n\t\t\tSystem.out.println(\"Area of cuboid for given values is \"+lenght*width*height);\r\n\t}", "public Square(Color emission, int Shininess,\n double _Kd, double _Ks, double _Kr, double _Kt,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, Shininess, _Kd, _Ks, _Kr, _Kt, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }", "public Wall(float x, float y, float width, float height, World world)\n {\n super(x,y,width, height);\n this.world = world;\n }", "public CrabWorld()\n {\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n musica=new GreenfootSound(\"Ufo-t-balt.mp3\");\n super(560,560, 1);\n }", "@Test\n void get_normal() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,2);\n Vector3D actual1 = cuboid1.get_normal(point1);\n Vector3D expected1 = new Vector3D(0,0,1);\n assertEquals(expected1, actual1);\n\n Cuboid cuboid2 = new Cuboid(4, 4, 4, new Ray(new Vector3D(0,1,0)));\n Point3D point2 = new Point3D(0,2,0);\n Vector3D actual2 = cuboid2.get_normal(point2);\n Vector3D expected2 = new Vector3D(0,1,0);\n assertEquals(expected2, actual2);\n }", "public DynamicCuboid(DynamicModelPart parentModelPart, int u, int v, float x, float y,\n float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY,\n float extraZ, boolean mirror, float textureWidth, float textureHeight,\n DynamicPart[] seed) {\n super(u, v, x, y, z, sizeX, sizeY, extraX, sizeZ, extraY, extraZ, mirror, textureWidth,\n textureHeight);\n this.set(parentModelPart, u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ,\n mirror, textureWidth, textureHeight, seed).build();\n }", "public CoordinateSystem() {\r\n\t\torigin = new GuiPoint(0, 0);\r\n\t\tzoomFactor = 1f;\r\n\t}", "public Cube222 () {\n\t\tstate_ = new Cubie[8];\n\t\tstate_[0] = new Cubie('O','W','G',0); // front, clockwise\n\t\tstate_[1] = new Cubie('O','W','B',1);\n\t\tstate_[2] = new Cubie('R','W','B',2);\n\t\tstate_[3] = new Cubie('R','W','G',3);\n\t\tstate_[4] = new Cubie('O','Y','G',4); // back, behind front\n\t\tstate_[5] = new Cubie('O','Y','B',5);\n\t\tstate_[6] = new Cubie('R','Y','B',6);\n\t\tstate_[7] = new Cubie('R','Y','G',7);\n\t}", "public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }", "private void createCube(float x, float y, float z){\r\n\t\tboolean[] sides = checkCubeSides((int)x,(int)y,(int)z);\r\n\t\tfloat[] color = BlockType.color(blocks[(int)x][(int)y][(int)z]);\r\n\t\t\r\n//\t\t gl.glNormal3f(0.0f, 1.0f, 0.0f);\r\n\t\tif(sides[0]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n//\t // Bottom-face\r\n//\t gl.glNormal3f(0.0f, -1.0f, 0.0f);\r\n\t\t\r\n\t\tif(sides[1]){\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n//\t // Back-face\r\n//\t gl.glNormal3f(0.0f, 0.0f, -1.0f);\r\n\t\tif(sides[2]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n//\t // Front-face\r\n//\t gl.glNormal3f(0.0f, 0.0f, 1.0f);\r\n\t\tif(sides[3]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n//\t \r\n//\t // Left-face\r\n//\t gl.glNormal3f(-1.0f, 0.0f, 0.0f);\r\n\t\tif(sides[4]){\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n//\t // Right-face\r\n//\t gl.glNormal3f(1.0f, 0.0f, 0.0f);\r\n\t\tif(sides[5]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public World(int width, int height, World other, Element bgElement)\n {\n // construct self\n\n this(width, height, bgElement);\n\n // if the other width and height the same as this don't adjust\n\n if (other.width == width && other.height == height)\n {\n getGraphics().drawImage(other, 0, 0, null);\n return;\n }\n // locate content on other world\n\n int leftMost = -1;\n int rightMost = -1;\n int topMost = -1;\n int botMost = -1;\n\n // find left most particle\n\n for (int x = 0; leftMost == -1 && x < other.width; ++x)\n for (int y = 0; leftMost == -1 && y < other.height; ++y)\n if (other.getRGB(x, y) != background)\n leftMost = x;\n\n // if no content on other world, stop here\n\n if (leftMost == -1)\n return;\n\n // find right most particle\n\n for (int x = other.width - 1; rightMost == -1 && x >= 0; --x)\n for (int y = 0; rightMost == -1 && y < other.height; ++y)\n if (other.getRGB(x, y) != background)\n rightMost = x;\n\n // find top most particle\n\n for (int y = 0; topMost == -1 && y < other.height; ++y)\n for (int x = 0; topMost == -1 && x < other.width; ++x)\n if (other.getRGB(x, y) != background)\n topMost = y;\n\n // find top most particle\n\n for (int y = other.height - 1; botMost == -1 && y >= 0; --y)\n for (int x = 0; botMost == -1 && x < other.width; ++x)\n if (other.getRGB(x, y) != background)\n botMost = y;\n\n // copy world centered into new world\n\n int otherWidth = rightMost - leftMost + 1;\n int otherHeight = botMost - topMost + 1;\n\n BufferedImage content = other.getSubimage(\n leftMost, topMost, otherWidth, otherHeight);\n getGraphics().drawImage(content, \n (width - otherWidth) / 2, \n (height - otherHeight),\n null);\n }", "public World(int width, int height)\n {\n this(width, height, AIR_EL);\n }", "public WiuWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1xpixels.\n super(WIDTH_WORLD, HEIGHT_WORLD, 1); \n }", "public static List<Location> drawCube(Location location1, Location location2, Float density, boolean isBlock) {\n Location loc1 = location1.clone(), loc2 = location2.clone();\n\n loc1.setX(Math.min(location1.getX(),location2.getX()));\n loc1.setY(Math.min(location1.getY(),location2.getY()));\n loc1.setZ(Math.min(location1.getZ(),location2.getZ()));\n loc2.setX(Math.max(location1.getX(),location2.getX()));\n loc2.setY(Math.max(location1.getY(),location2.getY()));\n loc2.setZ(Math.max(location1.getZ(),location2.getZ()));\n\n if (isBlock) {\n loc1 = loc1.getBlock().getLocation();\n loc2 = loc2.getBlock().getLocation();\n loc2.add(1, 1, 1);\n }\n\n double deltaX = Math.abs(loc1.getX() - loc2.getX());\n double deltaY = Math.abs(loc1.getY() - loc2.getY());\n double deltaZ = Math.abs(loc1.getZ() - loc2.getZ());\n\n int dx = (int) Math.ceil(deltaX / density);\n int dy = (int) Math.ceil(deltaY / density);\n int dz = (int) Math.ceil(deltaZ / density);\n\n List<Location> collection = new ArrayList<>();\n int[][] var1 = {{0, 0}, {1, 0}, {0, 1}, {1, 1}};\n for (int[] i : var1) {\n Location locx = loc1.clone().add(i[0] * deltaX, 0, i[1] * deltaZ);\n collection.addAll(drawline(locx, locx.clone().add(0, deltaY, 0),dy));\n\n locx = loc1.clone().add(0, i[0] * deltaY, i[1] * deltaZ);\n collection.addAll(drawline(locx, locx.clone().add(deltaX, 0, 0),dx));\n\n locx = loc1.clone().add(i[0] * deltaX, i[1] * deltaY, 0);\n collection.addAll(drawline(locx, locx.clone().add(0, 0, deltaZ),dz));\n }\n return collection;\n }", "Block create(int xpos, int ypos);", "private void makeCorridor (Room r1, Room r2) {\n\t\tint centerX1 = (2 * r1.getCenterX() + r1.getSizeX()) / 2,\n\t\t\t\tcenterY1 = (2 * r1.getCenterY() + r1.getSizeY()) / 2,\n\t\t\t\tcenterX2 = (2 * r2.getCenterX() + r2.getSizeX()) / 2,\n\t\t\t\tcenterY2 = (2 * r2.getCenterY() + r2.getSizeY()) / 2;\n\t\t\n\t\tfor(int x = Math.min(centerX1, centerX2); x <= Math.max(centerX1, centerX2); x++ ) {\n\t\t\tthis.cell[centerY1][x].setReference(\"FLOOR\");\n\t\t}\n\t\tfor(int y = Math.min(centerY1, centerY2); y < Math.max(centerY1, centerY2); y++ ) {\n\t\t\t\tthis.cell[y][centerX2].setReference(\"FLOOR\");\n\t\t\t}\n\t}", "public Vector3f copyLocation() {\r\n Vector3f result = location.clone();\r\n return result;\r\n }", "public RegularUnit(Location location, int length, int width, int height){\n // initialise instance variables\n super(location, length, width, height, TYPE);\n }", "public GLRenderer(Context context){\n\n lastTime=System.currentTimeMillis();\n mCuboid=new ndCuboid();\n\n\n }", "CubeModel() {\n r = 0;\n c = 0;\n s = 4;\n grid = new boolean [4][4];\n the_cube = new boolean[6];\n moves = 0;\n\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "public Square(Point3D P1, Vector v1,\n Vector v2, double length) {\n super(P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }", "public BranchGroup cubo2(){\n\t\t\tBranchGroup objRoot = new BranchGroup();\n\n\t TransformGroup objScale = new TransformGroup();\n\t Transform3D t3d = new Transform3D();\n\t Transform3D rotate = new Transform3D();\n Transform3D tempRotate = new Transform3D();\n\t \t rotate.rotX(Math.PI/1.0d);\n tempRotate.rotY(Math.PI/1.80d);\n Matrix3d n = new Matrix3d();\n Vector3d op = new Vector3d(.2,.05,.2);\n tempRotate.setScale(op);\n Vector3d op2 = new Vector3d(.5,.6,.5);\n tempRotate.setTranslation(op2);\n rotate.mul(tempRotate);\n // rotate.mul(objScale);\n TransformGroup objRotate = new TransformGroup(rotate);\n \n //objRotate.addChild(new ColorCube(0.4));\n objRoot.addChild(objRotate);\n\t \n t3d.mul(rotate);\n\t objScale.setTransform(t3d);\n\t \n\t objRoot.addChild(objScale);\n\n\tTransformGroup objTrans = new TransformGroup();\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n\t\tobjTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n\t\t\t\t\t\n\t\t\n\t\tobjScale.addChild(objTrans);\n\n\t\tint flags = ObjectFile.RESIZE;\n\t\tif (!noTriangulate) flags |= ObjectFile.TRIANGULATE;\n\t\tif (!noStripify) flags |= ObjectFile.STRIPIFY;\n\t\tObjectFile f = new ObjectFile(flags, \n\t\t (float)(creaseAngle * Math.PI / 180.0));\n\t\tScene s = null;\n\t\ttry {\n\t\t s = f.load(filename);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (ParsingErrorException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\tcatch (IncorrectFormatException e) {\n\t\t System.err.println(e);\n\t\t System.exit(1);\n\t\t}\n\t\t \n\t\tobjTrans.addChild(s.getSceneGroup());\n\t\t\n \n \n\t\tBoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);\n\n\n\t \n\t // Set up the background\n\t Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);\n\t Background bgNode = new Background(bgColor);\n\t bgNode.setApplicationBounds(bounds);\n\t objRoot.addChild(bgNode);\n\n\t\treturn objRoot;\n\t\t \n\t }", "public Vector3D(Vector3D p1, Vector3D p2)\r\n\t{\r\n\t\tthis.x = p2.x - p1.x;\r\n\t\tthis.y = p2.y - p1.y;\r\n\t\tthis.z = p2.z - p1.z;\r\n\t}", "public Queen(boolean color, Location location, int posInArray)\n\n {\n super(color, location, posInArray);\n legalVectors.add(new Location (-1, -1));\n legalVectors.add(new Location (-1, 0));\n legalVectors.add(new Location (-1, 1));\n legalVectors.add(new Location (0, -1));\n legalVectors.add(new Location (0, 1));\n legalVectors.add(new Location (1, -1));\n legalVectors.add(new Location (1, 0));\n legalVectors.add(new Location (1, 1));\n\n }", "public Cylinder() {\n\t\tthis(1.0);\n\t}", "public Square copy() {\n\t\tSquare s = new Square(x,y);\n\t\ts.z = z;\n\t\ts.c = new Color(c.getRGB());\n\t\treturn s;\n\t}", "public DynamicCuboid(DynamicModelPart parentModelPart, int u, int v, float x, float y,\n float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY,\n float extraZ, boolean mirror, float textureWidth, float textureHeight) {\n super(u, v, x, y, z, sizeX, sizeY, extraX, sizeZ, extraY, extraZ, mirror, textureWidth,\n textureHeight);\n\n DynamicPart[] parts = new DynamicPart[DYNAMIC_ENUM_LENGTH];\n for (int i = 0; i < DYNAMIC_ENUM_LENGTH; i++) {\n parts[i] = new DynamicPart(DYNAMIC_ENUM.values()[i], true);\n }\n\n this.set(parentModelPart, u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ,\n mirror, textureWidth, textureHeight, parts).build();\n }", "public Cow(int _pos_x , int _pos_y)\n {\n pos_x = _pos_x;\n pos_y = _pos_y;\n availableProduct = false;\n hunger_countdown = 5;\n allowed_tiles = \"Grassland\";\n }", "public City() {\r\n\t\tthis.x = (int) (Math.random() * 200);\r\n\t\tthis.y = (int) (Math.random() * 200);\r\n\t}", "public FaweSchematic(CuboidRegion cuboid) {\n this.file = null;\n this.clipboard = new BlockArrayClipboard(cuboid, ReadOnlyClipboard.of(cuboid.getWorld(), cuboid));\n }", "public Vector3 () {\n }", "public City(){\n this.x = (int)(Math.random()*200);\n this.y = (int)(Math.random()*200);\n }", "private void initialize() {\n //Asteroid Shape (8 sided)\n polygon = new Vector2f[]{new Vector2f(400, -800), new Vector2f(-400, -800), new Vector2f(-800, -400),\n new Vector2f(-800, 400), new Vector2f(-400, 800), new Vector2f(400, 800), new Vector2f(800, 400), new Vector2f(800, -400)};\n //Translation variables\n this.tx = spawnX;\n this.ty = spawnY; //Start above screen to gain momentum\n this.velocity = new Vector2f();\n\n //World initialize\n this.world = new Matrix3x3f();\n\n }", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1000, 600, 1);\n planets();\n stars();\n }", "public Wall(int x1, int y1,int x2,int y2) {\r\n\tthis.x1 = x1 + TRANSLATION;\r\n\tthis.x2 = x2 + TRANSLATION;\r\n\tthis.y1 = y1 + TRANSLATION;\r\n\tthis.y2 = y2 + TRANSLATION;\r\n\tbustedWall = false; \r\n}", "public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }", "public DynamicModelPart addCuboidsUsingSeeds() {\n for (int i = 0; i < this.x.length; i++) {\n this.addCuboid(this.x[i], this.y[i], this.z[i], this.sizeX[i], this.sizeY[i],\n this.sizeZ[i], this.extra[i], this.u[i], this.v[i], this.seeds.get(i));\n }\n return this;\n }", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public three_d_object(int ob_x, int ob_y, int ob_z, int new_ob_size, int new_ob_rotation_X,\n\t\t\t\t\tint new_ob_rotation_Y) {\n\t\t\t\tx = ob_x;\n\t\t\t\ty = ob_y;\n\t\t\t\tz = ob_z;\n\t\t\t\tob_size = new_ob_size;\n\t\t\t\trotation_X = new_ob_rotation_X;\n\t\t\t\trotation_Y = new_ob_rotation_Y;\n\n\t\t\t}", "public City(int width, int height) {\r\n\t\tthis.size_w = width;\r\n\t\tthis.size_h = height;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}", "private void generateCube() {\n\t\tverts = new Vector[] {new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3)};\n\t\tverts[0].setElement(0, -1);\n\t\tverts[0].setElement(1, -1);\n\t\tverts[0].setElement(2, -1);\n\t\t\n\t\tverts[1].setElement(0, 1);\n\t\tverts[1].setElement(1, -1);\n\t\tverts[1].setElement(2, -1);\n\t\t\n\t\tverts[2].setElement(0, -1);\n\t\tverts[2].setElement(1, -1);\n\t\tverts[2].setElement(2, 1);\n\t\t\n\t\tverts[3].setElement(0, 1);\n\t\tverts[3].setElement(1, -1);\n\t\tverts[3].setElement(2, 1);\n\t\t\n\t\tverts[4].setElement(0, -1);\n\t\tverts[4].setElement(1, 1);\n\t\tverts[4].setElement(2, -1);\n\t\t\n\t\tverts[5].setElement(0, 1);\n\t\tverts[5].setElement(1, 1);\n\t\tverts[5].setElement(2, -1);\n\t\t\n\t\tverts[6].setElement(0, -1);\n\t\tverts[6].setElement(1, 1);\n\t\tverts[6].setElement(2, 1);\n\t\t\n\t\tverts[7].setElement(0, 1);\n\t\tverts[7].setElement(1, 1);\n\t\tverts[7].setElement(2, 1);\n\t\t\n\t\tfaces = new int[][] {{0, 3, 2}, {0, 1, 3}, {0, 4, 5}, {0, 5, 1}, {0, 2, 6}, {0, 6, 4}, {2, 7, 6}, {2, 3, 7}, {3, 1, 5}, {3, 5, 7}, {4, 7, 5}, {4, 6, 7}}; // List the vertices of each face by index in verts. Vertices must be listed in clockwise order from outside of the shape so that the faces pointing away from the camera can be culled or shaded differently\n\t}", "public Asteroid(double xLoc, double yLoc) {\n\t\tsuper(resource.Constants.SPR_ASTEROID);\n\t\tsetX(xLoc);\n\t\tsetY(yLoc);\n\t\tthis.xLoc = xLoc;\n\t\tthis.yLoc = yLoc;\n\t}", "public CubeState(){\n ep = new PermutationGroup(12);\n cp = new PermutationGroup(8);\n eo = new EdgeOrientation();\n co = new CubieOrientation();\n }", "Matrix( Vector a, Vector b )\n {\n x = b.times(a.x);\n y = b.times(a.y);\n z = b.times(a.z);\n }", "public ParametrisedCuboid(String description, double width, double height, double depth, Vector3D centre, SurfaceProperty surfaceProperty, SceneObject parent, Studio studio)\n\t{\n\t\tsuper(description, parent, studio);\n\n\t\tthis.width = width;\n\t\tthis.height = height; \n\t\tthis.depth = depth;\n\n\t\tthis.centre = centre;\n\n\t\tthis.surfaceProperty = surfaceProperty;\n\n\t\t// create all the scene objects that make up this cuboid\n\t\tsetup();\n\t}", "Rectangle()\n {\n this(1.0,1.0);\n }", "public Floor() {\r\n\t\tRoom[][] rooms = new Room[Constants.WIDTH][Constants.LENGTH];\r\n\t\tfor (int i = 0; i < Constants.WIDTH; i++) {\r\n\t\t\tfor (int j = 0; j < Constants.LENGTH; j++) {\r\n\t\t\t\trooms[i][j] = GenerationUtilities.randomRoom(i, j);\r\n\t\t\t\trooms[i][j].setFloor(this);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.rooms = rooms;\r\n\t\tthis.length = rooms.length;\r\n\t\tthis.width = rooms[0].length;\r\n\t\tGenerationUtilities.placeRandomItems(this);\r\n\t\tenemies = new ArrayList<>();\r\n\t}", "public static Vector fromCartesian(double x, double y){\n return new Vector(x, y);\n }", "public Piece(int xLoc, int yLoc)\n\t{\n\t\tl = new Location(xLoc, yLoc);\n\t}", "public MyWorld()\n {\n super(600, 400, 1);\n }", "public DynamicCuboid setXYZ(float x, float y, float z) {\n return this.setX(x).setY(y).setZ(z);\n }", "public Box(Double x1, Double y1, Double x2, Double y2) {\n\n\t\tsetX1(x1);\n\t\tsetY1(y1);\n\t\tsetX2(x2);\n\t\tsetY2(y2);\n\n\t}", "@Override\n\tpublic Location newInstance() {\n\t\treturn new Location(this.X,this.Y,0);\n\t}", "public Ocean() {\n for (int i=0; i < N; i++) {\n for (int j=0; j < N; j++) {\n zone[i][j] = new Zone(i,j);\n }\n }\n }", "public Location (java.lang.Long uniqueId) {\n \t\tsuper(uniqueId);\n \t}", "public Space_Object (){\n groundPosition = 0;\n }", "Coordinate createCoordinate();", "public BSimVertex(Vector3d newLocation){\r\n\t\tlocation = newLocation;\r\n\t}", "public MComplex() {\r\n\t\ta = b = r = phi = 0;\r\n\t\tcartesian = polar = true;\r\n\t}", "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 }", "public GameComponent(int topLeftXPosition, int topLeftYPosition, int width, int height)\n\t{\n\t\tthis.topLeftXPosition = topLeftXPosition;\n\t\tthis.topLeftYPosition = topLeftYPosition;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Vector3D() {\n zero();\n }", "private void makeCubes(int number) {\n for (int i = 0; i < number; i++) {\n // randomize 3D coordinates\n Vector3f loc = new Vector3f(\n FastMath.nextRandomInt(-20, 20),\n FastMath.nextRandomInt(-20, 20),\n FastMath.nextRandomInt(-20, 20));\n rootNode.attachChild(\n myBox(\"Cube\" + i, loc, ColorRGBA.randomColor()));\n }\n }", "public Unit(int x, int y, int width, int height) {\n super(x, y, width, height);\n LOGGER.log(Level.INFO, this.toString() + \" created at (\" + x + \",\" + y + \")\", this.getClass());\n }", "public Spatial(Location tr)\r\n {\r\n this(new Location.Location2D(0, 0), tr);\r\n }", "public zCoordinates(int x, int y){\n this.x = x;\n this.y = y;\n }", "public levelTwo()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n prepare();\n }", "public Location() {\n\t\t\n\t\txCoord=0;\n\t\tyCoord=0;\n\t\t\n\t}", "public Box() {\n \tsuper();\n \tthis.max = new Point3d( 1, 1, 1 );\n \tthis.min = new Point3d( -1, -1, -1 );\n }" ]
[ "0.6152252", "0.5948652", "0.587532", "0.57785445", "0.570838", "0.5646667", "0.55446637", "0.5497795", "0.54788053", "0.5462754", "0.539094", "0.53908193", "0.5389", "0.53761953", "0.5360036", "0.53548265", "0.5340568", "0.5307449", "0.52998066", "0.5266083", "0.5239345", "0.52155983", "0.5210262", "0.5182217", "0.5170657", "0.5160625", "0.5147617", "0.5146363", "0.513504", "0.51244015", "0.51229906", "0.5086714", "0.50720805", "0.50689656", "0.5062477", "0.5061752", "0.5037267", "0.5026191", "0.50188476", "0.501583", "0.5004122", "0.4991391", "0.49881113", "0.49713996", "0.49707726", "0.49621847", "0.49537367", "0.49489182", "0.4935712", "0.49232984", "0.49211758", "0.4919512", "0.4913199", "0.48991013", "0.4891056", "0.48726267", "0.48662546", "0.48636222", "0.4863002", "0.48574883", "0.48563418", "0.48513088", "0.48510447", "0.48278713", "0.48276067", "0.48219755", "0.4816779", "0.48115957", "0.48088682", "0.48076424", "0.48061895", "0.4803987", "0.47991475", "0.4798613", "0.47951952", "0.4788661", "0.47871107", "0.47854412", "0.4781952", "0.47799072", "0.47794932", "0.47782588", "0.47749323", "0.47567713", "0.47478548", "0.47453415", "0.47437674", "0.47338605", "0.47327656", "0.47272715", "0.47256604", "0.4725495", "0.47248936", "0.4721425", "0.4719863", "0.47198164", "0.47125617", "0.47118393", "0.47092918", "0.47087377" ]
0.5457977
10
Constructs a new cuboid with the given coordinates.
public Region3D(final String world1, final int x1, final int y1, final int z1, final String world2, final int x2, final int y2, final int z2) { if (!(world1.equals(world2))) { System.out.println("Can't use two different worlds for Region3D!"); System.out.println("Using the world of the first location instead."); } this.world = world1; final int lowX = Math.min(x1, x2); final int lowY = Math.min(y1, y2); final int lowZ = Math.min(z1, z2); final int highX = Math.max(x1, x2); final int highY = Math.max(y1, y2); final int highZ = Math.max(z1, z2); lowPoint = new Location3D(this.world, lowX, lowY, lowZ); highPoint = new Location3D(this.world, highX, highY, highZ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Cube(int l, int b, int h)\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=l;\r\n\t\tbredth=b;\r\n\t\theight=h;\r\n\t}", "public DynamicModelPart addCuboids() {\n for (int i = 0; i < this.x.length; i++) {\n this.addCuboid(this.x[i], this.y[i], this.z[i], this.sizeX[i], this.sizeY[i],\n this.sizeZ[i], this.extra[i], this.u[i], this.v[i]);\n }\n return this;\n }", "Cube()\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=10;\r\n\t\tbredth=20;\r\n\t\theight=30;\r\n\t}", "public void cuboid(int lenght,int width,int height)\r\n\t{\n\t\t\tSystem.out.println(\"Area of cuboid for given values is \"+lenght*width*height);\r\n\t}", "public RubiksCube(){\n\t\tString[] c = {\n\t\t\t\t\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\"W\",\n\t\t\t\t\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\"R\",\n\t\t\t\t\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\"B\",\n\t\t\t\t\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\"G\",\n\t\t\t\t\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\"O\",\n\t\t\t\t\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\"Y\",\n\t\t};\n\t\tthis.cube = c;\n\t}", "public DynamicModelPart addCuboid(float x, float y, float z, int sizeX, int sizeY, int sizeZ,\n float extra, int textureOffsetU, int textureOffsetV) {\n this.setTextureOffset(textureOffsetU, textureOffsetV);\n this.addDynamicCuboid(this, this.textureOffsetU, this.textureOffsetV, x, y, z,\n (float) sizeX, (float) sizeY, (float) sizeZ, extra, extra, extra, this.mirror,\n false);\n return this;\n }", "public Cube(Square square)\n {\n this.edge = square.getSide();\n this.volume = Math.pow(this.edge,3);\n }", "public DynamicCuboid(DynamicModelPart parentModelPart, int u, int v, float x, float y,\n float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY,\n float extraZ, boolean mirror, float textureWidth, float textureHeight) {\n super(u, v, x, y, z, sizeX, sizeY, extraX, sizeZ, extraY, extraZ, mirror, textureWidth,\n textureHeight);\n\n DynamicPart[] parts = new DynamicPart[DYNAMIC_ENUM_LENGTH];\n for (int i = 0; i < DYNAMIC_ENUM_LENGTH; i++) {\n parts[i] = new DynamicPart(DYNAMIC_ENUM.values()[i], true);\n }\n\n this.set(parentModelPart, u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ,\n mirror, textureWidth, textureHeight, parts).build();\n }", "public Cube() {\n\t\t// a float is 4 bytes, therefore we multiply the number if\n\t\t// vertices with 4.\n\t\tByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);\n\t\tvbb.order(ByteOrder.nativeOrder());\n\t\tvertexBuffer = vbb.asFloatBuffer();\n\t\tvertexBuffer.put(vertices);\n\t\tvertexBuffer.position(0);\n\t\t\n\t\t// Setup texture-coords-array buffer, in float. An float has 4 bytes (NEW)\n\t ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);\n\t tbb.order(ByteOrder.nativeOrder());\n\t texBuffer = tbb.asFloatBuffer();\n\t texBuffer.put(texCoords);\n\t texBuffer.position(0);\n\t\t\n\t\t// short is 2 bytes, therefore we multiply the number if\n\t\t// vertices with 2.\n//\t\tByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);\n//\t\tibb.order(ByteOrder.nativeOrder());\n//\t\tindexBuffer = ibb.asShortBuffer();\n//\t\tindexBuffer.put(indices);\n//\t\tindexBuffer.position(0);\n\t}", "public DynamicCuboid(DynamicModelPart parentModelPart, int u, int v, float x, float y,\n float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY,\n float extraZ, boolean mirror, float textureWidth, float textureHeight,\n DynamicPart[] seed) {\n super(u, v, x, y, z, sizeX, sizeY, extraX, sizeZ, extraY, extraZ, mirror, textureWidth,\n textureHeight);\n this.set(parentModelPart, u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ,\n mirror, textureWidth, textureHeight, seed).build();\n }", "public Cube(String shapeName, double sideLength){\n super(shapeName, sideLength, sideLength, sideLength);\n }", "public CubeEarth() {\n this(1, null);\n }", "public static Vect3 makeXYZ(double x, String ux, double y, String uy, double z, String uz) {\n\t\treturn new Vect3(Units.from(ux,x),Units.from(uy,y),Units.from(uz,z));\n\t}", "public ParametrisedCuboid(String description, double width, double height, double depth, Vector3D centre, SurfaceProperty surfaceProperty, SceneObject parent, Studio studio)\n\t{\n\t\tsuper(description, parent, studio);\n\n\t\tthis.width = width;\n\t\tthis.height = height; \n\t\tthis.depth = depth;\n\n\t\tthis.centre = centre;\n\n\t\tthis.surfaceProperty = surfaceProperty;\n\n\t\t// create all the scene objects that make up this cuboid\n\t\tsetup();\n\t}", "public Cube(double sideLength) {\n super.setName(\"Cube\");\n if (sideLength > 0) {\n this.sideLength = sideLength;\n } else {\n throw new IllegalArgumentException(\n \"The side length should be greater than 0.\");\n }\n }", "public Vec3(){\n\t\tthis(0,0,0);\n\t}", "private void makeCubes(int number) {\n for (int i = 0; i < number; i++) {\n // randomize 3D coordinates\n Vector3f loc = new Vector3f(\n FastMath.nextRandomInt(-20, 20),\n FastMath.nextRandomInt(-20, 20),\n FastMath.nextRandomInt(-20, 20));\n rootNode.attachChild(\n myBox(\"Cube\" + i, loc, ColorRGBA.randomColor()));\n }\n }", "public DynamicModelPart addCuboid(float x, float y, float z, int sizeX, int sizeY, int sizeZ,\n float extra, int textureOffsetU, int textureOffsetV, DynamicPart[] seed) {\n this.setTextureOffset(textureOffsetU, textureOffsetV);\n this.addDynamicCuboid(this, this.textureOffsetU, this.textureOffsetV, x, y, z,\n (float) sizeX, (float) sizeY, (float) sizeZ, extra, extra, extra, this.mirror,\n false, seed);\n return this;\n }", "public MultiblockCuboid(boolean hasFloor, boolean hasFrame, boolean hasCeiling) {\n this.hasCeiling = hasCeiling;\n this.hasFloor = hasFloor;\n this.hasFrame = hasFrame;\n }", "public DynamicCuboid setXYZ(float x, float y, float z) {\n return this.setX(x).setY(y).setZ(z);\n }", "public Square(int x, int y, int z) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tcontainingRows = new ArrayList<Row>();\n\t\tstate = null;\n\t}", "private void createCube(float x, float y, float z){\r\n\t\tboolean[] sides = checkCubeSides((int)x,(int)y,(int)z);\r\n\t\tfloat[] color = BlockType.color(blocks[(int)x][(int)y][(int)z]);\r\n\t\t\r\n//\t\t gl.glNormal3f(0.0f, 1.0f, 0.0f);\r\n\t\tif(sides[0]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n//\t // Bottom-face\r\n//\t gl.glNormal3f(0.0f, -1.0f, 0.0f);\r\n\t\t\r\n\t\tif(sides[1]){\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n//\t // Back-face\r\n//\t gl.glNormal3f(0.0f, 0.0f, -1.0f);\r\n\t\tif(sides[2]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n//\t // Front-face\r\n//\t gl.glNormal3f(0.0f, 0.0f, 1.0f);\r\n\t\tif(sides[3]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n//\t \r\n//\t // Left-face\r\n//\t gl.glNormal3f(-1.0f, 0.0f, 0.0f);\r\n\t\tif(sides[4]){\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put(len*x);\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(-1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n//\t // Right-face\r\n//\t gl.glNormal3f(1.0f, 0.0f, 0.0f);\r\n\t\tif(sides[5]){\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put((len)*(y+1.0f));\r\n\t\t\tvertexData.put(len*z);\r\n\t\t\t\r\n\t\t\tvertexData.put((len)*(x+1.0f));\r\n\t\t\tvertexData.put(len*y);\r\n\t\t\tvertexData.put((len)*(z+1.0f));\r\n\t\t\t\r\n\t\t\tvertexCount += 6;\r\n\t\t\tfor(int i = 0; i < 6; i++){\r\n\t\t\t\tnormalData.put(1f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tnormalData.put(0f);\r\n\t\t\t\tcolorsData.put(color[0]);\r\n\t\t\t\tcolorsData.put(color[1]);\r\n\t\t\t\tcolorsData.put(color[2]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void createNewCube() {\n CUBE = new Cube();\n }", "public Queen(boolean color, Location location, int posInArray)\n\n {\n super(color, location, posInArray);\n legalVectors.add(new Location (-1, -1));\n legalVectors.add(new Location (-1, 0));\n legalVectors.add(new Location (-1, 1));\n legalVectors.add(new Location (0, -1));\n legalVectors.add(new Location (0, 1));\n legalVectors.add(new Location (1, -1));\n legalVectors.add(new Location (1, 0));\n legalVectors.add(new Location (1, 1));\n\n }", "public static float[] createCube (float x, float y, float z) {\r\n int offset = CUBE_LENGTH/2;\r\n return new float[] {\r\n x + offset, y + offset, z,\r\n x - offset, y + offset, z,\r\n x - offset, y + offset, z - CUBE_LENGTH,\r\n x + offset, y + offset, z - CUBE_LENGTH,\r\n x + offset, y - offset, z - CUBE_LENGTH,\r\n x - offset, y - offset, z - CUBE_LENGTH,\r\n x - offset, y - offset, z,\r\n x + offset, y - offset, z,\r\n x + offset, y + offset, z - CUBE_LENGTH,\r\n x - offset, y + offset, z - CUBE_LENGTH,\r\n x - offset, y - offset, z - CUBE_LENGTH,\r\n x + offset, y - offset, z - CUBE_LENGTH,\r\n x + offset, y - offset, z,\r\n x - offset, y - offset, z,\r\n x - offset, y + offset, z,\r\n x + offset, y + offset, z,\r\n x - offset, y + offset, z - CUBE_LENGTH,\r\n x - offset, y + offset, z,\r\n x - offset, y - offset, z,\r\n x - offset, y - offset, z - CUBE_LENGTH,\r\n x + offset, y + offset, z,\r\n x + offset, y + offset, z - CUBE_LENGTH,\r\n x + offset, y - offset, z - CUBE_LENGTH,\r\n x + offset, y - offset, z\r\n };\r\n }", "public City(int width, int height) {\r\n\t\tthis.size_w = width;\r\n\t\tthis.size_h = height;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}", "public static Coordinate create3D(double x, double y, double z) {\r\n return new Coordinate(x, y, z, Double.NaN);\r\n }", "public ComplexSprite(double x, double y, double width, double height) {\r\n\t\tthis.factory = SpriteFactory.getInstance();\r\n\t\tthis.dx = factory.getDX();\r\n\t\tthis.dy = factory.getDY();\r\n\t\tthis.sprites = new ArrayList<>();\r\n\t}", "Matrix()\n {\n x = new Vector();\n y = new Vector();\n z = new Vector();\n }", "private void generateCube() {\n\t\tverts = new Vector[] {new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3), new Vector(3)};\n\t\tverts[0].setElement(0, -1);\n\t\tverts[0].setElement(1, -1);\n\t\tverts[0].setElement(2, -1);\n\t\t\n\t\tverts[1].setElement(0, 1);\n\t\tverts[1].setElement(1, -1);\n\t\tverts[1].setElement(2, -1);\n\t\t\n\t\tverts[2].setElement(0, -1);\n\t\tverts[2].setElement(1, -1);\n\t\tverts[2].setElement(2, 1);\n\t\t\n\t\tverts[3].setElement(0, 1);\n\t\tverts[3].setElement(1, -1);\n\t\tverts[3].setElement(2, 1);\n\t\t\n\t\tverts[4].setElement(0, -1);\n\t\tverts[4].setElement(1, 1);\n\t\tverts[4].setElement(2, -1);\n\t\t\n\t\tverts[5].setElement(0, 1);\n\t\tverts[5].setElement(1, 1);\n\t\tverts[5].setElement(2, -1);\n\t\t\n\t\tverts[6].setElement(0, -1);\n\t\tverts[6].setElement(1, 1);\n\t\tverts[6].setElement(2, 1);\n\t\t\n\t\tverts[7].setElement(0, 1);\n\t\tverts[7].setElement(1, 1);\n\t\tverts[7].setElement(2, 1);\n\t\t\n\t\tfaces = new int[][] {{0, 3, 2}, {0, 1, 3}, {0, 4, 5}, {0, 5, 1}, {0, 2, 6}, {0, 6, 4}, {2, 7, 6}, {2, 3, 7}, {3, 1, 5}, {3, 5, 7}, {4, 7, 5}, {4, 6, 7}}; // List the vertices of each face by index in verts. Vertices must be listed in clockwise order from outside of the shape so that the faces pointing away from the camera can be culled or shaded differently\n\t}", "private Vector3D(int x, int y, int z) {\n this(x, y, z, null);\n }", "public zCoordinates(int x, int y){\n this.x = x;\n this.y = y;\n }", "public GameComponent(int topLeftXPosition, int topLeftYPosition, int width, int height)\n\t{\n\t\tthis.topLeftXPosition = topLeftXPosition;\n\t\tthis.topLeftYPosition = topLeftYPosition;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Pj3dBox Box(int x, int y, int z)\r\n\t{\r\n\t\tPj3dBox b = new Pj3dBox(this, x, y, z);\r\n\t\treturn b;\r\n\t}", "public static Vect3 mkXYZ(double x, double y, double z) {\n\t\treturn new Vect3(x,y,z);\n\t}", "public Triangle (int x, int y, int z){ \r\n \r\n \r\n }", "public CollisionBox(String parameters) {\n\n\t\tString coordinates[] = parameters.split(\",\");\n\n\t\ttopleft.x = Integer.parseInt(coordinates[0]);\n\t\ttopleft.y = Integer.parseInt(coordinates[1]);\n\t\tbottomright.x = Integer.parseInt(coordinates[2]);\n\t\tbottomright.y = Integer.parseInt(coordinates[3]);\n\n\t}", "public Vector(double x, double y, double z) {\n super(new double[][] {\n { x },\n { y },\n { z },\n { 1 }\n });\n }", "public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }", "static void createCubes(double width, double height) {\n \t\r\n \tmaxY=f(startingBound);\r\n \tmaxX=startingBound;\r\n \t\r\n \t//need a function to find the max\r\n \tfor(double i=startingBound; i<=endingBound; i=i+dx) {\r\n \t\tif(f(i)>maxY)\r\n \t\t\tmaxY=f(i);\r\n \t\t\r\n \t\tif(i>maxX)\r\n \t\t\tmaxX=i;\r\n \t}\r\n \tdouble size=height/2-100;\r\n \tSystem.out.println(size);\r\n \tscaleY=maxY/(size);\r\n \tscaleX=(width-100)/maxX;\r\n \t\r\n \tfor(double x=startingBound; x<=endingBound; x=x+dx) {\r\n \t\t//System.out.println(x+\", \"+f(x));\r\n \t\tcubes.add(new Cube(x*scaleX, -f(x)/scaleY, 0, f(x)/scaleY, dx*scaleX));\r\n \t\t//cubes.add(new Cube(x, 100, 0, 100, 100));\r\n \t}\r\n \t\r\n \t\r\n }", "public Cube222 () {\n\t\tstate_ = new Cubie[8];\n\t\tstate_[0] = new Cubie('O','W','G',0); // front, clockwise\n\t\tstate_[1] = new Cubie('O','W','B',1);\n\t\tstate_[2] = new Cubie('R','W','B',2);\n\t\tstate_[3] = new Cubie('R','W','G',3);\n\t\tstate_[4] = new Cubie('O','Y','G',4); // back, behind front\n\t\tstate_[5] = new Cubie('O','Y','B',5);\n\t\tstate_[6] = new Cubie('R','Y','B',6);\n\t\tstate_[7] = new Cubie('R','Y','G',7);\n\t}", "public Sprite(float centerX, float centerY, float z, int width, int height) {\n \t_center = new Coordinates(centerX, centerY, z);\n \t_dimensions = new Coordinates(width, height, 0f);\n }", "public Unit(int x, int y, int width, int height) {\n super(x, y, width, height);\n LOGGER.log(Level.INFO, this.toString() + \" created at (\" + x + \",\" + y + \")\", this.getClass());\n }", "public HorizontalCoords() {\n }", "public ParametrisedCuboid(ParametrisedCuboid original)\n\t{\n\t\tsuper(original);\n\t\t\n\t\twidth = original.width;\n\t\theight = original.height;\n\t\tdepth = original.depth;\n\t\tcentre = original.centre.clone();\n\t\tsurfaceProperty = original.surfaceProperty.clone();\n\t}", "public Square() {\n this(\"x\", false, false);\n }", "public Vector3<T> build() {\n return new Vector3<>(x, y, z);\n }", "public Classroom()\n { \n // Create a new world with 10x6 cells with a cell size of 130x130 pixels.\n super(10, 6, 130); \n prepare();\n }", "public SquareGrid(int width, int height) {\n this.width = width;\n this.height = height;\n }", "public Box(float x, float y, float z)\n\t{\n\t\tsuper();\n\t\tupdateGeometry(Vector3f.ZERO, x, y, z);\n\t}", "public GameObject(int x, int y, int width, int height, int[] velocity){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.velocity= velocity;\n }", "public DynamicModelPart addCuboidsUsingSeeds() {\n for (int i = 0; i < this.x.length; i++) {\n this.addCuboid(this.x[i], this.y[i], this.z[i], this.sizeX[i], this.sizeY[i],\n this.sizeZ[i], this.extra[i], this.u[i], this.v[i], this.seeds.get(i));\n }\n return this;\n }", "CubeModel() {\n r = 0;\n c = 0;\n s = 4;\n grid = new boolean [4][4];\n the_cube = new boolean[6];\n moves = 0;\n\n }", "public QuadTree(int x, int y, int width, int height){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "public Vector(Coordinate x, Coordinate y, Coordinate z) {\n this(new Point3D(x, y, z));\n }", "public static Vect3 mk(double x, double y, double z) {\n\t\treturn new Vect3(x,y,z);\n\t}", "public Coordinate() { row = col = -1; }", "public Vector3(double x, double y,double z){\n \n double pytago;\n \n this.x = x;\n this.y = y;\n this.z = z;\n \n pytago = (x*x) + (y*y) + (z*z);\n \n magnitude = Math.sqrt(pytago);\n }", "public static Vect3 make(double x, double y, double z) {\n\t\treturn new Vect3(Units.from(\"NM\",x),Units.from(\"NM\",y),Units.from(\"ft\",z));\n\t}", "public Complex(){\r\n\t this(0,0);\r\n\t}", "public Board()\r\n\t{\r\n\t\tfor(int x = 0; x < 9; x++)\r\n\t\t\tfor(int y = 0 ; y < 9; y++)\r\n\t\t\t{\r\n\t\t\t\tboard[x][y] = new Cell();\r\n\t\t\t\tboard[x][y].setBoxID( 3*(x/3) + (y)/3+1);\r\n\t\t\t}\r\n\t}", "public Square() {\r\n\r\n }", "public Coordinate(final Coordinate c) { row = c.row; col = c.col; }", "public Triangle() {\n this(0,0,0,0,0);\n }", "public Square () {\r\n super();\r\n \r\n }", "public Position(double x, double y, double z) {\n xCoord = x;\n yCoord = y;\n zCoord = z;\n }", "public Position() {\n xCoord = 0;\n yCoord = 0;\n zCoord = 0;\n }", "public void makeCube (int subdivisions)\r\n {\r\n \tfloat horz[] = new float[subdivisions + 1];\r\n \tfloat vert[] = new float[subdivisions + 1];\r\n \t\r\n \t\r\n \t// Front face\r\n \tPoint p1 = new Point(-0.5f, -0.5f, 0.5f);\r\n \tPoint p2 = new Point(0.5f, -0.5f, 0.5f);\r\n \tPoint p3 = new Point(0.5f, 0.5f, 0.5f);\r\n \tPoint p4 = new Point(-0.5f, 0.5f, 0.5f);\r\n \t\r\n \tfloat h = p1.x;\r\n \tfloat v = p1.y;\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(horz[k], vert[j], 0.5f);\r\n \t\t\tPoint tempP2 = new Point(horz[k + 1], vert[j], 0.5f);\r\n \t\t\tPoint tempP3 = new Point(horz[k + 1], vert[j + 1], 0.5f);\r\n \t\t\tPoint tempP4 = new Point(horz[k], vert[j + 1], 0.5f);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n \t// Back face\r\n \tp1.y = p1.z = -0.5f;\r\n \tp1.x = 0.5f;\r\n \tp2.x = p2.y = p2.z = -0.5f;\r\n \tp3.x = p3.z = -0.5f;\r\n \tp3.y = 0.5f;\r\n \tp4.x = p4.y = 0.5f;\r\n \tp4.z = -0.5f;\r\n \t\r\n \th = p1.x;\r\n \tv = p1.y;\r\n \t\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h - (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(horz[k], vert[j], -0.5f);\r\n \t\t\tPoint tempP2 = new Point(horz[k + 1], vert[j], -0.5f);\r\n \t\t\tPoint tempP3 = new Point(horz[k + 1], vert[j + 1], -0.5f);\r\n \t\t\tPoint tempP4 = new Point(horz[k], vert[j + 1], -0.5f);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n \t// Left face\r\n \tp1.x = p1.y = p1.z = -0.5f;\r\n \tp2.x = p2.y = -0.5f;\r\n \tp2.z = 0.5f;\r\n \tp3.x = -0.5f;\r\n \tp3.y = p3.z = 0.5f;\r\n \tp4.y = 0.5f;\r\n \tp4.x = p4.z = -0.5f;\r\n \t\r\n \th = p1.z;\r\n \tv = p1.y;\r\n \t\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(-0.5f, vert[j], horz[k]);\r\n \t\t\tPoint tempP2 = new Point(-0.5f, vert[j], horz[k + 1]);\r\n \t\t\tPoint tempP3 = new Point(-0.5f, vert[j + 1], horz[k + 1]);\r\n \t\t\tPoint tempP4 = new Point(-0.5f, vert[j + 1], horz[k]);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n \t// Right face\r\n \tp1.x = p1.z = 0.5f;\r\n \tp1.y = -0.5f;\r\n \tp2.y = p2.z = -0.5f;\r\n \tp2.x = 0.5f;\r\n \tp3.x = p3.y = 0.5f;\r\n \tp3.z = -0.5f;\r\n \tp4.x = p4.y = p4.z = 0.5f;\r\n \t\r\n \t\r\n \th = p1.z;\r\n \tv = p1.y;\r\n \t\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h - (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(0.5f, vert[j], horz[k]);\r\n \t\t\tPoint tempP2 = new Point(0.5f, vert[j], horz[k + 1]);\r\n \t\t\tPoint tempP3 = new Point(0.5f, vert[j + 1], horz[k + 1]);\r\n \t\t\tPoint tempP4 = new Point(0.5f, vert[j + 1], horz[k]);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n \t// Top face\r\n \tp1.x = -0.5f;\r\n \tp1.y = p1.z = 0.5f;\r\n \tp2.x = p2.y = p2.z = 0.5f;\r\n \tp3.x = p3.y = 0.5f;\r\n \tp3.z = -0.5f;\r\n \tp4.x = p4.z = -0.5f;\r\n \tp4.y = 0.5f;\r\n \t\r\n \t\r\n \th = p1.x;\r\n \tv = p1.z;\r\n \t\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v - (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(horz[k], 0.5f, vert[j]);\r\n \t\t\tPoint tempP2 = new Point(horz[k + 1], 0.5f, vert[j]);\r\n \t\t\tPoint tempP3 = new Point(horz[k + 1], 0.5f, vert[j + 1]);\r\n \t\t\tPoint tempP4 = new Point(horz[k], 0.5f, vert[j + 1]);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n \t// Bottom face\r\n \tp1.x = p1.y = p1.z = -0.5f;\r\n \tp2.y = p2.z = 0.5f;\r\n \tp2.x = 0.5f;\r\n \tp3.x = p3.z = 0.5f;\r\n \tp3.y = -0.5f;\r\n \tp4.x = p4.y = -0.5f;\r\n \tp4.z = 0.5f;\r\n \t\r\n \t\r\n \th = p1.x;\r\n \tv = p1.z;\r\n \t\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++ )\r\n \t{\r\n \t\thorz[i] = h;\r\n \t\th = h + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int i = 0; i <= subdivisions; i++)\r\n \t{\r\n \t\tvert[i] = v;\r\n \t\tv = v + (float)(1/(float)subdivisions);\r\n \t}\r\n \t\r\n \tfor( int j = 0; j < vert.length - 1; j ++)\r\n \t\tfor( int k = 0; k < horz.length - 1; k ++)\r\n \t\t{\r\n \t\t\tPoint tempP1 = new Point(horz[k], -0.5f, vert[j]);\r\n \t\t\tPoint tempP2 = new Point(horz[k + 1], -0.5f, vert[j]);\r\n \t\t\tPoint tempP3 = new Point(horz[k + 1], -0.5f, vert[j + 1]);\r\n \t\t\tPoint tempP4 = new Point(horz[k], -0.5f, vert[j + 1]);\r\n \t\t\t\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP3.x, tempP3.y, tempP3.z, tempP4.x, tempP4.y, tempP4.z);\r\n \t\t\taddTriangle(tempP1.x, tempP1.y, tempP1.z, tempP2.x, tempP2.y, tempP2.z, tempP3.x, tempP3.y, tempP3.z);\r\n \t\t\t\r\n \t\t}\r\n \t\r\n }", "public Vec3D() {\n\t\tx = y = z = 0.0f;\n\t}", "public Quaternion()\n {\n this.x = 0.0f;\n this.y = 0.0f;\n this.z = 0.0f;\n this.w = 0.0f;\n }", "@SuppressWarnings(\"unused\")\n public Coordinate() {}", "public Vector3 () {\n }", "public Cow(int _pos_x , int _pos_y)\n {\n pos_x = _pos_x;\n pos_y = _pos_y;\n availableProduct = false;\n hunger_countdown = 5;\n allowed_tiles = \"Grassland\";\n }", "public Vector(double x, double y, double z) {\n this(new Point3D(x, y, z));\n }", "public Vector3(double x, double y, double z) {\n this.x = x; this.y = y; this.z = z;\n }", "public Square()\r\n {\r\n super();\r\n }", "public Vector3D(double x, double y, double z) {\r\n super(x, y, z);\r\n\t}", "public BoardCell(int x, int y){\n xCor=x;\n yCor=y;\n }", "public Coordinate(final int r, final int c) { row = r; col = c; }", "public Vec3(float x, float y, float z){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\ttrunc();\n\t}", "public Vector3 () {\r\n\t\tx = 0;\r\n\t\ty = 0;\r\n\t\tz = 0;\r\n\t}", "public CubeGL2(double width, double height, double depth) {\n // Define points for a cube.\n // X, Y, Z\n mCubeVertexData = new float[]\n {\n // Front face\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n // Right face\n 1.0f, 1.0f, 1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n 1.0f, -1.0f, -1.0f,\n 1.0f, 1.0f, -1.0f,\n // Back face\n 1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n 1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, -1.0f,\n // Left face\n -1.0f, 1.0f, -1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, 1.0f, 1.0f,\n // Top face\n -1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n -1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, 1.0f,\n 1.0f, 1.0f, -1.0f,\n // Bottom face\n 1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n 1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, 1.0f,\n -1.0f, -1.0f, -1.0f,\n };\n\n for (int i = 0; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) width;\n }\n for (int i = 1; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) height;\n }\n for (int i = 2; i < mCubeVertexData.length; i += 3) {\n mCubeVertexData[i] = mCubeVertexData[i] * (float) depth;\n }\n\n // R, G, B, A\n mCubeColourData = new float[]\n {\n // Front face\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n 1.0f, 0.0f, 0.0f, 1.0f,\n // Right face\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n 0.0f, 1.0f, 0.0f, 1.0f,\n // Back face\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n 0.0f, 0.0f, 1.0f, 1.0f,\n // Left face\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n 1.0f, 1.0f, 0.0f, 1.0f,\n // Top face\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n 0.0f, 1.0f, 1.0f, 1.0f,\n // Bottom face\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f,\n 1.0f, 0.0f, 1.0f, 1.0f\n };\n // X, Y, Z\n mCubeNormalData = new float[]\n {\n // Front face\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n 0.0f, 0.0f, 1.0f,\n // Right face\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n 1.0f, 0.0f, 0.0f,\n // Back face\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n 0.0f, 0.0f, -1.0f,\n // Left face\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n -1.0f, 0.0f, 0.0f,\n // Top face\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n 0.0f, 1.0f, 0.0f,\n // Bottom face\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f,\n 0.0f, -1.0f, 0.0f\n };\n // X, Y\n // Texture coordinate data.\n mCubeTextureCoordinateData = new float[]\n {\n // Front face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Right face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Back face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Left face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Top face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f,\n // Bottom face\n 0.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 0.0f,\n 0.0f, 1.0f,\n 1.0f, 1.0f,\n 1.0f, 0.0f\n };\n // Initialize the buffers.\n mCubeVertices = ByteBuffer.allocateDirect(mCubeVertexData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeVertices.put(mCubeVertexData).position(0);\n mCubeColours = ByteBuffer.allocateDirect(mCubeColourData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeColours.put(mCubeColourData).position(0);\n mCubeNormals = ByteBuffer.allocateDirect(mCubeNormalData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeNormals.put(mCubeNormalData).position(0);\n mCubeTextureCoordinates = ByteBuffer.allocateDirect(mCubeTextureCoordinateData.length * 4)\n .order(ByteOrder.nativeOrder()).asFloatBuffer();\n mCubeTextureCoordinates.put(mCubeTextureCoordinateData).position(0);\n Matrix.setIdentityM(mModelMatrix, 0);\n }", "public Vect3(double xx, double yy, double zz) {\n\t\tx = xx;\n\t\ty = yy;\n\t\tz = zz;\n\t}", "public RubiksCube(String[] c){\n\t\tif(c.length == 54){\n\t\t\tString[] tab = new String[c.length];\n\t\t\tfor(int i=0; i<c.length;i++){\n\t\t\t\ttab[i] = c[i];\n\t\t\t}\n\t\t\tthis.cube = tab;\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Wrong input table size : \" + c.length);\n\t\t}\n\t}", "public static Vector fromCartesian(double x, double y){\n return new Vector(x, y);\n }", "public Vector3 (double x, double y, double z) {\n set(x, y, z);\n }", "private SquareCoordinate(int x, int y)\n {\n \tthis.x = x;\n \tthis.y = y;\n }", "public CircularGrid() {\r\n\t\tthis(0, false, false);\r\n\t}", "public Corner(double posX,double posY)\n {\n // inicializa variáveis de instância\n this.posX=posX;\n this.posY=posY;\n }", "public TriangleGamePane(Grid grid, int width, int height) {\n super(grid, width, height);\n }", "public Vector(double x, double y, double z, double w) {\n super(new double[][] {\n { x },\n { y },\n { z },\n { w }\n });\n }", "private Geometry buildCube(ColorRGBA color) {\n Geometry cube = new Geometry(\"Box\", new Box(0.5f, 0.5f, 0.5f));\n Material mat = new Material(assetManager, \"TestMRT/MatDefs/ExtractRGB.j3md\");\n mat.setColor(\"Albedo\", color);\n cube.setMaterial(mat);\n return cube;\n }", "public Coordinate(int x,int y)\n {\n this.x = x;\n this.y = y;\n }", "public MComplex() {\r\n\t\ta = b = r = phi = 0;\r\n\t\tcartesian = polar = true;\r\n\t}", "public Box() {\n \tsuper();\n \tthis.max = new Point3d( 1, 1, 1 );\n \tthis.min = new Point3d( -1, -1, -1 );\n }", "CubeModel(CubeModel cube) {\n initialize(cube);\n\n }", "public PositionComponent(float x, float y, int z) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}", "public Box(Point center, double width , double height) {\n\n\t\tthis.center = center;\n\n\t\tthis.width = width;\n\n\t\tthis.height = height;\n\n\t\tPoint[] verts = {new Point(this.center.getX() - (width/2), this.center.getY() - (height/2)),\n\t\t\t\t\t\t new Point(this.center.getX() + (width/2), this.center.getY() - (height/2)),\n\t\t\t\t\t\t new Point(this.center.getX() - (width/2), this.center.getY() + (height/2)),\n\t\t\t\t\t\t new Point(this.center.getX() + (width/2), this.center.getY() + (height/2))};\n\t\t\t\t \n\t}", "Box(){\n System.out.println(\"constructing box\");\n width = 10;\n height = 10;\n depth = 10;\n}", "private GridNode(Grid grid, GridCoord coord, float x, float y, float z) {\n this(grid, coord);\n point = new Point(x, y, z);\n }", "public Queen(int r, int c)\r\n {\r\n row = r;\r\n column = c;\r\n }" ]
[ "0.6494905", "0.6406387", "0.6270742", "0.62101907", "0.60797584", "0.6035459", "0.5878379", "0.58269614", "0.5813", "0.5786582", "0.5785727", "0.57795036", "0.5751309", "0.57052916", "0.56934893", "0.5645543", "0.56425166", "0.56416464", "0.5641318", "0.55559695", "0.55483484", "0.5538193", "0.5522618", "0.54541963", "0.54456097", "0.54445654", "0.5440579", "0.54400915", "0.5420749", "0.54163533", "0.5406441", "0.5396668", "0.53655994", "0.5356304", "0.5337479", "0.53367263", "0.5327282", "0.5325985", "0.53050226", "0.5296026", "0.52879894", "0.5285194", "0.5283359", "0.5274359", "0.5270865", "0.5245668", "0.5236689", "0.52287745", "0.52256614", "0.52024454", "0.52023906", "0.5185391", "0.5185038", "0.5180588", "0.51789117", "0.5176284", "0.5169739", "0.51606756", "0.5148311", "0.5139391", "0.51368487", "0.5136216", "0.5130626", "0.5129369", "0.5126547", "0.50996494", "0.5095609", "0.50954175", "0.5092066", "0.5087129", "0.50826305", "0.50802255", "0.50780255", "0.5076779", "0.5075854", "0.50692743", "0.5062533", "0.5062178", "0.5059248", "0.50569826", "0.50542676", "0.5051354", "0.5047106", "0.50390047", "0.50362414", "0.50316834", "0.5030478", "0.5028734", "0.5028705", "0.5015224", "0.50093985", "0.5007307", "0.5007097", "0.500459", "0.5003145", "0.49985546", "0.4990855", "0.49879092", "0.4986958", "0.4985857", "0.49852774" ]
0.0
-1
Determines whether the passed area is within this area.
public boolean isAreaWithinArea(final Region3D area) { return (containsLoc(area.highPoint) && containsLoc(area.lowPoint)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public boolean isInArea(Rectangle2D Area)\r\n\t{\r\n\t\tPoint2D.Double point = new Point2D.Double( x(), y() );\r\n\t\treturn Area.contains(point);\r\n\t}", "private static boolean withinArea(Point dronePos) {\r\n\t\tvar droneLat = dronePos.latitude();\r\n\t\tvar droneLon = dronePos.longitude();\r\n\t\treturn droneLat<latUB && droneLat>latLB && droneLon<lonUB && droneLon>lonLB;\r\n\t}", "public isWithin() {\n\t\tsuper();\n\t}", "public boolean inBounds(Actor a)\n {\n boolean inX = Math.abs(a.getXPos()) < levelWidth/2;\n boolean inY = Math.abs(a.getYPos()) < levelHeight/2;\n return inX && inY;\n }", "public static boolean inArea(Location targetLoc, Location area1, Location area2) {\n if ((area1.getWorld() == area2.getWorld()) && (targetLoc.getWorld() == area1.getWorld())) {\n if ((targetLoc.getX() >= area1.getX() && targetLoc.getX() <= area2.getX())\n || (targetLoc.getX() <= area1.getX() && targetLoc.getX() >= area2.getX())) {\n if ((targetLoc.getY() >= area1.getY() && targetLoc.getY() <= area2.getY())\n || (targetLoc.getY() <= area1.getY() && targetLoc.getY() >= area2.getY())) {\n return (targetLoc.getZ() >= area1.getZ() && targetLoc.getZ() <= area2.getZ())\n || (targetLoc.getZ() <= area1.getZ() && targetLoc.getZ() >= area2.getZ());\n }\n }\n }\n return false;\n }", "public boolean in_area(char area) {\n return (areas != null) && (areas.indexOf(area) != -1);\n }", "public boolean isInside(Rectangle boundary) {\n\t\t\n\t\t// Use TLAP to see if it is or it is not\n\t\tif (x + diameter / 2 >= boundary.getX() - boundary.getWidth() && x + diameter / 2 <= boundary.getX() + boundary.getWidth()\n\t\t\t\t&& y + diameter / 2 >= boundary.getY() - boundary.getHeight() && y + diameter / 2 <= boundary.getY() + boundary.getHeight()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean isIncludeBounds();", "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 whithinRectangle(Point point1, Point point2) {\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 isInside(){\n\t\tinside = true;\n\t\tif(map.contains(new Rectangle(x,y,(int)spriteSize.getHeight(), (int)spriteSize.getWidth()))==false){\n\t\t\tinside = false;\n\t\t}\n\t\treturn(inside);\n\t}", "public boolean isInBoundaries() {\n\t return Referee.playfield.isInBoundaries(this);\n }", "Boolean CheckIfInside(float xVal, float yVal) {\r\n double distance = Math.sqrt((this.x-xVal)*(this.x-xVal) + (this.y-yVal)*(this.y-yVal));\r\n return (distance <= this.radius);\r\n }", "public boolean contains(Rectangle r) {\n\t\treturn (r.getX1() >= getX1() && r.getY1() >= getY1()\n\t\t\t\t&& r.getX2() < getX2() && r.getY2() < getY2());\n\t}", "protected boolean isInside(int x, int y){\n if(x <= super.getLocationX())\n return false;\n\n if(x >= (super.getLocationX() + super.getWidth() - 1))\n return false;\n\n if(y <= super.getLocationY())\n return false;\n\n if(y >= (super.getLocationY() + super.getHeight() - 1))\n return false;\n\n //return true if inside\n return true;\n\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 }", "private boolean withinRange(Enemy e) {\n \t\tRect r = e.r; //Get the collision box from the \n \t\tPoint rectCenter = new Point((int) r.exactCenterX(), (int) r.exactCenterY());\n \t\tif (Math.abs(center.x - rectCenter.x) <= (e.getSize()/2 + range)) {\n \t\t\tif (Math.abs(center.y - rectCenter.y) <= (e.getSize()/2 + range)) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t\treturn false;\t\n \t}", "boolean contains(double x, double y) {\r\n\t\t//cordinate of the left edge\r\n\t\tdouble xLeftEdge = this.getX() - this.width / 2;\r\n\t\t//cordinate of the right edge\r\n\t\tdouble xRightEdge = this.getX() + this.width / 2;\r\n\t\t////cordinate of the top edge\r\n\t\tdouble yTopEdge = this.getY() + this.height / 2;\r\n\t\t//cordinate of the bottom edge\r\n\t\tdouble yBottomEdge = this.getY() - this.height / 2;\r\n\r\n\t\t//if the point is between the edges it is inside the rectangle\r\n\t\treturn (x < xRightEdge) && (x > xLeftEdge) && (y < yTopEdge)\r\n\t\t\t\t&& (y > yBottomEdge) ? true : false;\r\n\t}", "public boolean contains(Point mousePt) {\r\n\t\treturn (x <= mousePt.x && mousePt.x <= (x + width + 1)\t&&\ty <= mousePt.y && mousePt.y <= (y + height + 1));\r\n\t}", "static boolean inAreaHuh ( PhoneNumber pn, int someArea ) {\n\t// return ... pn.areaCode ... pn.prefix ... pn.line ... someArea ;\n\treturn pn.areaCode == someArea ;\n }", "public boolean situatedInside(double x, double y) {\n if(y>this.bottomleft.x && y<this.topright.x && x <this.topright.y && x > this.bottomleft.y)\n return true;\n else\n return false;\n }", "protected boolean isFullyContained(Widget widget) {\r\n // Calling getPreferredBounds forces the bounds to be calculated if it\r\n // has not already been calculated. For example when the Widget was\r\n // just created and therefore has not had a chance to be displayed.\r\n Rectangle area = widget.getClientArea();\r\n\r\n boolean retVal = false;\r\n if (area != null) {\r\n Rectangle sceneArea = widget.convertLocalToScene(area);\r\n\r\n Rectangle localArea = scene.convertSceneToLocal(sceneArea);\r\n Rectangle myArea = scene.getClientArea();\r\n retVal = myArea.contains(localArea);\r\n }\r\n\r\n return retVal;\r\n }", "@Override\n public boolean contain(int x, int y) {\n return(x>=this.x && y>=this.y && x<=this.x+(int)a && y<=this.y+(int)b);\n }", "public boolean mouseWithinBox() {\n return (mouseX > x && mouseX < x + w && mouseY > y && mouseY < y + h);\r\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 boolean isInside(int x, int y) {\r\n if (this.state == 0) {\r\n if ((x >= this.x && x <= (this.x +width)) &&\r\n y >= this.y && y <= (this.y +height)) {\r\n return true;\r\n }\r\n } else if (this.state == 1) {\r\n if ((x <= this.x && x >= (this.x - height)) &&\r\n y >= this.y && y <= (this.y + width)) {\r\n return true;\r\n }\r\n } else if (this.state == 2) {\r\n if ((x <= this.x && x >= (this.x - width)) &&\r\n y <= this.y && y >= (this.y - height)) {\r\n return true;\r\n }\r\n } else if (this.state == 3) {\r\n if ((x >= this.x && x <= (this.x + height)) &&\r\n y <= this.y && y >= (this.y - width)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean contains(Point mousePt) {\r\n\t\treturn (p.x <= mousePt.x && mousePt.x <= (p.x + width + 1)\t&&\tp.y <= mousePt.y && mousePt.y <= (p.y + height + 1));\r\n\t}", "boolean overlaps(MyRectangle2D r) {\r\n\t\t//cordinates of the first corner of the parametar's rectangle\r\n\t\tdouble x1 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y1 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the second corner of the parametar's rectangle\r\n\t\tdouble x2 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y2 = r.getY() - (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the third corner of the parametar's rectangle\r\n\t\tdouble x3 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y3 = r.getY() - (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the fourth corner of the parametar's rectangle\r\n\t\tdouble x4 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y4 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\t//checking if calling rectangle has any of the corners inside itself\r\n\t\tboolean corner1Overlaps = this.contains(x1, y1);\r\n\t\tboolean corner2Overlaps = this.contains(x2, y2);\r\n\t\tboolean corner3Overlaps = this.contains(x3, y3);\r\n\t\tboolean corner4Overlaps = this.contains(x4, y4);\r\n\r\n\t\t//if it does contain any of the corners they overlap\r\n\t\treturn corner1Overlaps || corner2Overlaps || corner3Overlaps\r\n\t\t\t\t|| corner4Overlaps ? true : false;\r\n\t}", "@JsMethod(name = \"interiorContainsPoint\")\n public boolean interiorContains(double p) {\n return p > lo && p < hi;\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}", "public boolean includesPoint(Point p) {\n double ABC = getArea();\n double PAB = new Triangle(p, p1, p2).getArea();\n double PBC = new Triangle(p, p2, p3).getArea();\n double PAC = new Triangle(p, p1, p3).getArea();\n return abs(ABC - (PAB + PBC + PAC)) < 0.000000001;\n }", "public boolean isLargerThan(Rectangle other){\n\t\treturn this.getArea() > other.getArea();\n\t\n\t}", "public void checkClickedArea(int xMouse,int yMouse)\n {\n\n isSelected=false;\n if(targetable==true&&(xMouse>=xBeginMap+15&&xMouse<=xEndMap-15\n &&yMouse>=yBeginMap+15&&yMouse<=yEndMap-15))\n {\n\n isSelected=true;\n }\n\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}", "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 boolean detectBound(){\n if(posX < 0 || posX > width || posY < 0 || posY > height){\n return true;\n }\n else{\n return false;\n }\n }", "abstract void findArea();", "abstract void findArea();", "public static boolean pointInRectangle(int minX, int minY, int maxX, int maxY, int x, int y) {\n\t\treturn minX < x && maxX > x && minY < y && maxY > y;\n\t}", "@Override\n public boolean inBounds(int x, int y) {\n return x >= 0 && y >= 0 && x < this.bounds.width\n && y < this.bounds.height;\n }", "double area() {\n System.out.println(\"Inside Area for Rectangle.\");\n return dim1 * dim2;\n }", "public static boolean isInside(int nX, int nY,\n\t int nT, int nR, int nB, int nL, int nTol)\n\t{\n\t\tif (nR < nL) // swap the left and right bounds as needed\n\t\t{\n\t\t\tnR ^= nL;\n\t\t\tnL ^= nR;\n\t\t\tnR ^= nL;\n\t\t}\n\n\t\tif (nT < nB) // swap the top and bottom bounds as needed\n\t\t{\n\t\t\tnT ^= nB;\n\t\t\tnB ^= nT;\n\t\t\tnT ^= nB;\n\t\t}\n\n\t\t// expand the bounds by the tolerance\n\t\treturn (nX >= nL - nTol && nX <= nR + nTol\n\t\t && nY >= nB - nTol && nY <= nT + nTol);\n\t}", "public boolean isAround(Ball ball)\n {\n int delta = 10;\n Rectangle2D rectangle = new Rectangle2D.Double(mPosition.getX() - delta, mPosition.getY() - delta, 2 * delta, 2 * delta);\n \n return rectangle.contains(ball.getPosition());\n }", "boolean hasRect();", "private boolean hitSides() {\n if (b.numY + 60 >= BOX_HEIGHT || (b.numY - 60 <= 0)) {\n return true;\n } else {\n return false;\n }\n }", "private boolean withinGridDimensions(int startX, int startY, int endX, int endY) {\n boolean within = true;\n int largerX = Math.max(startX, endX);\n int smallerX = Math.min(startX, endX);\n int largerY = Math.max(startY, endY);\n int smallerY = Math.min(startY, endY);\n \n if (smallerX < 1 || smallerY < 1 || largerX > GRID_DIMENSIONS || largerY > GRID_DIMENSIONS) {\n within = false;\n }\n \n return within;\n }", "public boolean isWithinObject(int x, int y)\n {\n if( x > coX-Xsize/2 &&\n x < coX+Xsize/2 &&\n y > coY-Ysize/2 &&\n y < coY+Ysize/2 )\n return true;\n else\n return false;\n }", "private boolean verifyBounds() {\r\n\t if((x>RobotController.BOUNDS_X || y>RobotController.BOUNDS_Y)\r\n\t || x<0 || y<0){\r\n\t return false;\r\n\t }\r\n\t return true;\r\n\t }", "static boolean isInside(int x, int y, int N) {\n if (x >= 1 && x <= N && y >= 1 && y <= N) {\n return true;\n }\n return false;\n }", "public boolean isWithinMap(int x, int y) {\n return ((x >= 0 && x < this.width_) && (y >= 0 && y < this.height_));\n }", "private static boolean isInBounds(Location location, Vector3i min, Vector3i max) {\n return location.getX() >= min.x && location.getX() < max.x && location.getY() >= min.y\n && location.getY() < max.y && location.getZ() >= min.z && location.getZ() < max.z;\n }", "@Test\r\n\tpublic void testArea() {\r\n\t\tint area = LENGTH * WIDTH;\r\n\t\tassertEquals(area, validRectangle.area());\r\n\t}", "private boolean isInBounds(int x, int y) {\r\n\t\treturn x >= 0 && y >= 0 && x < getWidth() && y < getHeight();\r\n\t}", "private boolean isInBounds(float x, float y) {\n\n if (x <= 0 || x >= this.getWidth() || y <= 0 || y >= this.getHeight()) {\n\n return false;\n }\n return new RectF(0, 0, this.getWidth(), this.getHeight())\n .contains(x, y);\n }", "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}", "private boolean isOverRect(Point p) {\n Rectangle r = (Rectangle)component.rect.clone();\n r.grow(PROX_DIST, PROX_DIST);\n return r.contains(p);\n }", "public static boolean insideBounds(GameTile tile) {\n\n if (tile == null) {\n return false;\n } else {\n\n int x = tile.getXCoord();\n int y = tile.getYCoord();\n\n return !(x < 0 || y < 0) && !(x > TILE_COLS || y > TILE_ROWS);\n\n }\n\n }", "public boolean inBounds(Rectangle bounds)\n\t{\n\t\treturn bounds.contains(mX, mY);\n\t}", "@Override\n\tpublic boolean isInside(float x, float y, float z) {\n\t\treturn false;\n\t}", "public boolean isAccessibilityComputationAreaFromBoundingBox() {\n return accessibilityComputationAreaFromBoundingBox;\n }", "public boolean isWithinBounds(int x, int y) {\n\t\tif (x < 0 || x >= this.width)\n\t\t\treturn false;\n\n\t\tif (y < 0 || y >= this.height)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private boolean boundsChecker(Road road, Rectangle wholeGrid) {\n\t\tif(!Inclusive2DIntersectionVerifier.intersects(road, wholeGrid)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}", "public boolean isInside(final Tuple3d point) {\n final double distance = this.distanceToPoint(point);\n\n return IntersectionUtils.isGreaterOrEqual(distance, 0.0);\n }", "public boolean isIn(Position topLeft, Position bottomRight) {\n boolean withinTop = this.y <= topLeft.getY();\n boolean withinBottom = this.y >= bottomRight.getY();\n boolean withinLeft = this.x >= topLeft.getX();\n boolean withinRight = this.x <= bottomRight.getX();\n return withinTop && withinBottom && withinLeft && withinRight;\n }", "boolean hasRect2Value();", "public boolean checkWalkArea(int xMin, int xMax, float touchedX, float touchedY) {\n\t\tif (LOG_ON) Log.d(\"Clementime\", className + \"/checkWalkArea: touch y \" + touchedY);\n\t\t\n\t\tif (touchedY <= Constants.WALK_AREA_Y_POS\n\t\t\t\t&& touchedY >= Constants.WALK_AREA_Y_POS - Constants.WALK_AREA_SIZE\n\t\t\t\t&& touchedX >= xMin && touchedX <= xMax) return true;\n\t\telse return false;\n\t}", "@Override\n\tpublic boolean contains(Rectangle2D arg0) {\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 }", "private boolean isWithinBounds(Point3D point) {\n // Check if point is above min bounds\n if (point.getX() < minBounds.getX() || point.getY() < minBounds.getY() || point.getZ() < minBounds.getZ()) {\n return false;\n }\n // Check if point is below max bounds\n if (point.getX() > maxBounds.getX() || point.getY() > maxBounds.getY() || point.getZ() > maxBounds.getZ()) {\n return false;\n }\n return true;\n }", "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 boolean pInRect(Point2D p, RectHV rect) {\n if (p.x() >= rect.xmin() && p.x() <= rect.xmax() && p.y() >= rect.ymin() && p.y() <= rect.ymax()) return true;\n else return false;\n }", "public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }", "boolean contains(MyRectangle2D r) {\r\n\t\t// check if 1 pair of diagonal corner points\r\n\t\t// are contained in this rectangle\r\n\r\n\t\tdouble x1 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y1 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\tdouble x2 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y2 = r.getY() - (r.getHeight() / 2);\r\n\t\t\r\n\t\t//if diagonal corners are inside, the whole rectangle is contained\r\n\t\treturn this.contains(x1, y1) && this.contains(x2, y2) ? true : 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}", "public static final boolean isInside(int x, int y, Rect box) {\n return (box.x < x && x < box.x + box.w && box.y < y && y < box.y + box.h);\n }", "public boolean isInsideZone(int x, int y)\r\n\t{\r\n\t\tboolean inside = false;\r\n\t\tfor (Shape sh : _shapes)\r\n\t\t{\r\n\t\t\tif (sh.contains(x, y))\r\n\t\t\t{\r\n\t\t\t\tinside = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (_exShapes != null && inside)\r\n\t\t{\r\n\t\t\tfor (Shape sh : _exShapes)\r\n\t\t\t{\r\n\t\t\t\tif (sh.contains(x, y))\r\n\t\t\t\t{\r\n\t\t\t\t\tinside = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn inside;\r\n\t}", "@Override\r\n\tpublic boolean results(Element element)\r\n\t{\r\n\t\t// checks whether the x coordinate of the given element lies between the x coordinates of the two positions of this inPartOfBoard-condition\r\n\t\tif(((element.getPosition().getCoordX() >= this.getPosition1().getCoordX()) && (element.getPosition().getCoordX() <= this.getPosition2().getCoordX()))\r\n\t\t\t\t|| ((element.getPosition().getCoordX() <= this.getPosition1().getCoordX()) && (element.getPosition().getCoordX() >= this.getPosition2().getCoordX())))\r\n\t\t{\r\n\t\t\t// checks whether the y coordinate of the given element lies between the y coordinates of the two positions of this inPartOfBoard-condition\r\n\t\t\tif(((element.getPosition().getCoordY() >= this.getPosition1().getCoordY()) && (element.getPosition().getCoordY() <= this.getPosition2().getCoordY()))\r\n\t\t\t\t\t|| ((element.getPosition().getCoordY() <= this.getPosition1().getCoordY()) && (element.getPosition().getCoordY() >= this.getPosition2().getCoordY())))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic double area() {\r\n\r\n\t\treturn this.sideA*this.sideB;\r\n\t}", "public boolean boundsContains(double[] pt){\n return bounds.contains(pt);\n }", "private boolean isBetweenBounds(int x, int y, int[] bounds) {\n return x >= bounds[0] && x <= bounds[2] && y >= bounds[1] && y <= bounds[3];\n }", "public boolean isPointInside(int x, int y) {\r\n if (Integer.compare(x, _xLeft) <= 0) {\r\n return false;\r\n }\r\n \r\n if (Integer.compare(x, _xRight) >= 0) {\r\n return false;\r\n }\r\n \r\n if (Integer.compare(y, _yTop) <= 0) {\r\n return false;\r\n }\r\n \r\n if (Integer.compare(y, _yBottom) >= 0) {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public void isIntersects(WorldObject worldObject) {\n Area areaFromThisObject = new Area(this.getShape());\n Area areaFromWorldObject = new Area(worldObject.getShape());\n areaFromThisObject.intersect(areaFromWorldObject);\n this.collided = !areaFromThisObject.isEmpty();\n }", "public abstract boolean hit(Rectangle2D r);", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\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 }", "double getArea();", "double getArea();", "public static Boolean InsideBoundary(Double a, Double b, Double c)\n {\n if (a <= b && a > c)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public boolean isIntersectingWithViewport(ObjectWithPosition obj){\n if(this.bounds.intersect(obj.getBounds()))\n return true;\n else return false;\n }", "private boolean isInside(int i, int j) {\n\t\tif (i < 0 || j < 0 || i > side || j > side)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean intersects(BaseGameObject other) {\r\n return (other.getPosx() - this.getPosx())\r\n * (other.getPosx() - this.getPosx())\r\n + (other.getPosy() - this.getPosy())\r\n * (other.getPosy() - this.getPosy())\r\n < (other.bound + this.bound) * (other.bound + this.bound);\r\n }", "public boolean liesInRoom(Room r) {\n if ((this.getX() > r.getLeftCorner().getX() + 1 &&\n (this.getX() < (r.getLeftCorner().getX() - 1) + r.getWidth()))) {\n return (this.getY() > r.getLeftCorner().getY() + 1) &&\n (this.getY() < (r.getLeftCorner().getY() - 1) + r.getHeight());\n }\n return false;\n }", "public boolean isInShape(Point p) \n\t{\n\t\tPoint centre = new Point((int)posX + diam/2, (int)posY + diam/2);\n\t\t//If distance between two points if less than or equal to radius, true is\n\t\t//returned\n\t\treturn p.distance(centre) <= diam/2;\n\t}", "public boolean containsRectangle(double x, double y, double width, double height) {\n\t\treturn rectangleSelection.contains(x,y) && rectangleSelection.contains(x + width, y + height);\n\t}", "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}", "private boolean hitMyPaddle() {\n if (b.numX - 60 <= 0) {\n if ((b.numY <= (this.touchedY + 260)) && (b.numY >= (this.touchedY - 260))) {\n } else {\n this.wentOffWall();\n }\n return true;\n } else {\n return false;\n }\n }", "public boolean inside(final Point p)\n\t\t{\n\t\t\tif(obj.contains(p))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}" ]
[ "0.73336", "0.7264683", "0.71589863", "0.7070445", "0.68226385", "0.6809341", "0.6671611", "0.6561878", "0.6300765", "0.6228837", "0.6228743", "0.61955345", "0.6180065", "0.61711836", "0.613948", "0.6136853", "0.6133505", "0.6129479", "0.6099678", "0.60652584", "0.6061893", "0.6050604", "0.6042527", "0.6032773", "0.60252607", "0.60076624", "0.6000608", "0.59997946", "0.5994617", "0.59675395", "0.59637856", "0.596111", "0.59536934", "0.59536606", "0.5953571", "0.59528834", "0.5914079", "0.5903323", "0.58956033", "0.58956033", "0.58946526", "0.5887634", "0.5887237", "0.5862057", "0.5856404", "0.58398676", "0.5835255", "0.58342564", "0.579732", "0.5781158", "0.5771593", "0.5766687", "0.57663006", "0.5744943", "0.5721987", "0.57195336", "0.57192457", "0.5713517", "0.5705182", "0.56971526", "0.56916517", "0.5690256", "0.5681013", "0.56690174", "0.56632966", "0.5645212", "0.5642893", "0.5642436", "0.5641661", "0.56280434", "0.56267625", "0.56241405", "0.5623366", "0.5621765", "0.5619958", "0.5617765", "0.5616758", "0.56120265", "0.56110334", "0.56045437", "0.5604366", "0.56035423", "0.5602944", "0.55965215", "0.55962336", "0.5589084", "0.5588418", "0.55872154", "0.5586489", "0.5586489", "0.55846244", "0.5582063", "0.55807215", "0.557919", "0.55758446", "0.5573786", "0.5571333", "0.5569301", "0.55676067", "0.5560293" ]
0.7139255
3
Determines whether the this cuboid contains the passed location.
public boolean containsLoc(final Location3D loc) { if (loc == null || !loc.getWorld().equals(highPoint.getWorld())) { return false; } return lowPoint.getBlockX() <= loc.getBlockX() && highPoint.getBlockX() >= loc.getBlockX() && lowPoint.getBlockZ() <= loc.getBlockZ() && highPoint.getBlockZ() >= loc.getBlockZ() && lowPoint.getBlockY() <= loc.getBlockY() && highPoint.getBlockY() >= loc.getBlockY(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean contains(Location location) {\n String c = chunkToString(location.getChunk());\n ChunkWrapper chunk = chunks.get(c);\n return chunk.contains(location);\n }", "public boolean containsLocation(Location p) {\n\t\tint r = p.getRow();\n\t\tint c = p.getCol();\n\t\tint offR = r - topLeft.getRow();\n\t\tint offC = c - topLeft.getCol();\n\t\treturn 0 <= offR && offR < length && 0 <= offC && offC < width;\n\t}", "public abstract boolean locationExists(Location location);", "boolean hasLocation();", "boolean hasLocation();", "public boolean inRegion(Location loc)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x >= l1.getBlockX() && x <= l2.getBlockX()) && \n (z >= l1.getBlockZ() && z <= l2.getBlockZ()) && \n (y >= l1.getBlockY() && y <= l2.getBlockY()))\n return true;\n }\n \n // Returns false if the location is outside of the region.\n return ((x >= p1.getBlockX() && x <= p2.getBlockX()) && \n (z >= p1.getBlockZ() && z <= p2.getBlockZ()) && \n (y >= p1.getBlockY() && y <= p2.getBlockY()));\n }", "public boolean contains(double[] loc, double[] normal){\n double[] r = Vector3DOps.difference(loc, position);\n double proj = Vector3DOps.dot(normal, r);\n double s = Vector3DOps.dot(r, r);\n\n return s - proj*proj<radius*radius;\n\n }", "private boolean isOccupied(Location loc)\n\t{\n\t\treturn grid[loc.getRow()][loc.getCol()] != null;\n\t}", "private boolean isAssignedPosition(String location) {\n return productTypeRepository.findAll().stream().anyMatch(p -> p.getLocation().equals(location));\n }", "public boolean isAtLocation(Location loc) {\n return loc.equals(loc);\n }", "public boolean hasLocation()\n\t{\n\t\treturn location != null;\n\t}", "boolean contains(ShortPoint2D position);", "private boolean compareLocation(Location location){\n return location.getBlockX()==this.location.getBlockX() && location.getBlockY()==this.location.getBlockY() && location.getBlockZ() == this.location.getBlockZ();\n }", "public boolean hasLocation()\n {\n return targetLocation != null;\n }", "public boolean contains(Coord c) {\n\t\treturn getAWTRectangle().contains(c.getAWTPoint());\n\t}", "public boolean equals(Object loc)\r\n {\r\n\r\n //if the location does not equal anything (null) and is of the same\r\n //class as the location.\r\n //\"this\" literally refers to the class...meaning this.x is referring\r\n //to the location class variable. If THIS location's class is equal to\r\n //this other location class, then it is equal and we return true;\r\n if (loc != null && this.getClass() == loc.getClass())\r\n {\r\n //we set point equal to the value in loc...we can cast it now\r\n //that we know that it is of the same class. We do this to\r\n //make sure it works correctly\r\n Location point = (Location)loc;\r\n //here we actually check the members of the point and see if they\r\n //are equal to the instance variable\r\n if (point.x() == this.x() && point.y() == this.y())\r\n {\r\n //return true if everything is equal\r\n return true;\r\n }\r\n\r\n }\r\n\r\n return false;\r\n }", "public abstract Boolean isExist(LocationDto location);", "public boolean equals(Object aLocation)\n\t{\n\t\treturn (((Location) aLocation).mX == mX) && (((Location) aLocation).mY == mY);\n\t}", "public abstract boolean containsPoint(int x, int y);", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "default boolean contains(Vector3 point) {\r\n return contains(point.getX(), point.getY(), point.getZ());\r\n }", "public boolean contains(final Coords point)\r\n {\r\n return toRectangle().contains(point.toPoint());\r\n }", "public boolean contains(Block block) {\n return contains(block.getLocation());\n }", "boolean hasCoordinates();", "boolean hasCoordinates();", "boolean hasCoordinates();", "public boolean contains(Point p);", "public boolean hasLocation() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean isOccupiedByAnimal(Vector2d position);", "public boolean isAdjacent(NodeTree location){\n return isAdjacent(this.head, location);\n }", "@Override\n\tpublic boolean contains(Vec2f pnt) {\n\t\tboolean isIn = false;\n\t\tif (_shape != null) {\n\t\t\tisIn = _shape.contains(pnt);\n\t\t}\n\t\treturn isIn;\n\t}", "public boolean availableSquare(Location location)\n {\n boolean available = false;\n if(countTrees() + countGrasses() <= 10) {\n available = true;\n }\n return available;\n }", "public boolean hasLocation() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean equals(MC_Location loc) {\n\t\t if(x != loc.x) return false;\n\t\t if(y != loc.y) return false;\n\t\t if(z != loc.z) return false;\n\t\t if(dimension != loc.dimension) return false;\n\t\t if(Math.abs(yaw - loc.yaw) > 0.0001) return false;\n\t\t if(Math.abs(pitch - loc.pitch) > 0.0001) return false;\n\t\t return true;\n\t }", "@Override\n\tpublic boolean contains(Rectangle2D arg0) {\n\t\treturn false;\n\t}", "private boolean isInCategory(Location location, List<String> choosenCategories) {\n for(String category : choosenCategories) {\n if(location.getSubCategory().equals(category) || location.getSubCategory() == category)\n return true;\n }\n return false;\n }", "boolean contains( Geometry gmo );", "public boolean contains(int x, int y) {\n\t\treturn this.getShape().contains(x,y);\n\t}", "boolean isGoodLocation(World world, int x, int y, int z);", "public boolean canInteractWithBlock(Player player, Location location) {\n\t\tif (mayor.equals(player.getUniqueId()) || councils.containsKey(player.getUniqueId())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tPlot plot = getPlotHere(location);\n\t\t\treturn (inhabitants.contains(player.getUniqueId()) && plot == null) || (plot != null && plot.canBuild(player, location));\n\t\t}\n\t}", "public boolean contains(Ship s){\n\t\treturn myPolygon.contains(s.getX()-10, s.getY()-10,s.getW()/2,s.getH()/2);\n\t\t\n\t}", "public boolean inRegionRadius(Location loc, int radius)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x + radius >= l1.getBlockX() && x - radius <= l2.getBlockX()) && \n (z + radius >= l1.getBlockZ() && z - radius <= l2.getBlockZ()) && \n (y + radius >= l1.getBlockY() && y - radius <= l2.getBlockY()))\n return true;\n }\n \n return ((x + radius >= p1.getBlockX() && x - radius <= p2.getBlockX()) &&\n (z + radius >= p1.getBlockZ() && z - radius <= p2.getBlockZ()) &&\n (y + radius >= p1.getBlockY() && y - radius <= p2.getBlockY()));\n }", "public boolean contains(Point point) {\n\t\treturn false;\r\n\t}", "boolean contains(Polygon p);", "public boolean hasLocation() {\n return fieldSetFlags()[3];\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Location)) {\r\n return false;\r\n }\r\n Location other = (Location) object;\r\n if ((this.locId == null && other.locId != null) || (this.locId != null && !this.locId.equals(other.locId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object o) {\n if ((o == null) || !(o instanceof Location)) {\n return false;\n }\n\n // Check x- and y-coordinates.\n Location other = (Location) o;\n if ((this.x == other.x) && (this.y == other.y)) {\n return true;\n }\n\n return false;\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "public boolean contains(float x, float y);", "public boolean contains(float x, float y);", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\n\t\tif (!(obj instanceof Location))\n\t\t\treturn false;\n\n\t\tif (obj == this)\n\t\t\treturn true;\n\n\t\tLocation that = (Location) obj;\n\n\t\treturn this.map == that.map && this.y() == that.y() && this.x() == that.x();\n\t}", "public boolean isInside(){\n\t\tinside = true;\n\t\tif(map.contains(new Rectangle(x,y,(int)spriteSize.getHeight(), (int)spriteSize.getWidth()))==false){\n\t\t\tinside = false;\n\t\t}\n\t\treturn(inside);\n\t}", "public boolean inside(final Point p)\n\t\t{\n\t\t\tif(obj.contains(p))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "private boolean isMyPiece(Loc thisSpot) {\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tif (loc.row == thisSpot.row && loc.col == thisSpot.col) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean contains(MyRectangle2D r) {\r\n\t\t// check if 1 pair of diagonal corner points\r\n\t\t// are contained in this rectangle\r\n\r\n\t\tdouble x1 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y1 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\tdouble x2 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y2 = r.getY() - (r.getHeight() / 2);\r\n\t\t\r\n\t\t//if diagonal corners are inside, the whole rectangle is contained\r\n\t\treturn this.contains(x1, y1) && this.contains(x2, y2) ? true : false;\r\n\t}", "public boolean containsAnActor() {\n\t\treturn map.isAnActorAt(this);\n\t}", "boolean hasAuvLoc();", "private boolean checkInsideZone() {\n for (Zone z : shiftZones) {\n if (PolyUtil.containsLocation(userLocation, Arrays.asList(z.getCoords()), true)) {\n return true;\n }\n }\n return false;\n }", "public boolean containsContact(Contact c);", "public boolean hasRegionLocationMatrix() {\n return regionLocationMatrixBuilder_ != null || regionLocationMatrix_ != null;\n }", "boolean hasLocationNames();", "@java.lang.Override\n public boolean hasRegionLocationMatrix() {\n return regionLocationMatrix_ != null;\n }", "public boolean equals(Object obj) {\n\n if (obj instanceof Location) {\n\n Location other = (Location) obj;\n\n return row == other.getRow() && col == other.getCol();\n\n } else {\n\n return false;\n\n }\n }", "boolean hasLocationView();", "public boolean containsBlock(int x, int y, int z, Region chunkRegion) {\n return regionFunction.apply(x, y, z, chunkRegion);\n }", "boolean canPlaceCity(VertexLocation vertLoc);", "private boolean canEntityBuild(User user, Location location) {\n Collection<TownBlock> blocks = TownyUniverse.getInstance().getDataSource().getAllTownBlocks();\n\n int x = (int)Math.floor(location.getX() / 16.0);\n int z = (int)Math.floor(location.getZ() / 16.0);\n\n TownyWorld world;\n try {\n world = TownyUniverse.getInstance().getDataSource().getWorld(location.getWorld().getName());\n } catch (Exception e) {\n return true;\n }\n\n TownBlock block = new TownBlock(x, z, world);\n\n return !blocks.contains(block);\n }", "public boolean contains(Point p) {\n\t\tif ((p.y > (super.getY() - super.height/2)) && (p.x > (super.getX() - width/2)) && (p.y < (super.getY() + super.height/2 + super.height)) && (p.x < (super.getX() - width/2 + super.width))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(int x, int y)\n\t{\n\t\treturn (boundingBox.contains(x,y));\n\t}", "public boolean isAtELocation(Coordinate location, Direction direction) {\n return Coordinate.equals(this.location, location) && this.direction == direction;\n }", "public boolean isAssignedToLocation() {\n if (location == null) {\n return false;\n }\n return true;\n }", "public boolean contains(Unit u)\r\n\t{\r\n\t\treturn units.contains(u);\r\n\t}", "public boolean contains(GJPoint2D p) {\n\t\treturn this.contains(p.x(), p.y());\n\t}", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "public boolean isInCircle(LatLng location){\n float[] distance=new float[2];\n Location.distanceBetween( location.latitude, location.longitude,\n circle.getCenter().latitude, circle.getCenter().longitude, distance);\n return distance[0] <= circle.getRadius();\n\n }", "public boolean contains(int x, int y) {\n x -= this.getXPos();\n y -= this.getYPos();\n return this.containsLocal(x, y);\n }", "public boolean isInside(final Tuple3d point) {\n final double distance = this.distanceToPoint(point);\n\n return IntersectionUtils.isGreaterOrEqual(distance, 0.0);\n }", "boolean hasCoordInfo();", "@Override\n public boolean contains(Object o) {\n for (int i = 0; i < currentSize; i++) {\n if (container[i] == o) {\n return true;\n }\n }\n return false;\n }", "protected boolean isFullyContained(Widget widget) {\r\n // Calling getPreferredBounds forces the bounds to be calculated if it\r\n // has not already been calculated. For example when the Widget was\r\n // just created and therefore has not had a chance to be displayed.\r\n Rectangle area = widget.getClientArea();\r\n\r\n boolean retVal = false;\r\n if (area != null) {\r\n Rectangle sceneArea = widget.convertLocalToScene(area);\r\n\r\n Rectangle localArea = scene.convertSceneToLocal(sceneArea);\r\n Rectangle myArea = scene.getClientArea();\r\n retVal = myArea.contains(localArea);\r\n }\r\n\r\n return retVal;\r\n }", "private boolean containsPosition(Collection<Item> c, Position p) {\n return getItem(c, p) != null;\n }", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "public boolean equals(Location anotherLocation)\r\n\t{\r\n\t\treturn (this.getRow()==anotherLocation.getRow()) && (this.getColumn()==anotherLocation.getColumn());\r\n\t}", "public abstract boolean ContainsContactObjects();", "private boolean checkIfGoodSquare(MapLocation location) {\n return (location.x % 2 == location.y % 2) && !location.isAdjacentTo(Cache.myECLocation);\n }", "public boolean contains(Ball b) {\n\t\treturn this.contents.contains(b);\n\t}", "public boolean contains(int x, int y) {\n if (shape == null || !shape.getBounds().equals(getBounds())) {\n shape = new Ellipse2D.Float(0, 0, getWidth(), getHeight());\n }\n return shape.contains(x, y);\n }", "public boolean isSpawn(Location loc) {\n\t\treturn RegionManager.get().hasTag(loc, \"spawn\");\n\t}", "@Override\n public boolean onPlayAtLocation(GameState gameState, Location location) {\n if(gameState.tileAtLocation(location) && !gameState.wallAtLocation(location)) {\n gameState.addWall(location);\n return true;\n }\n else return false;\n }", "public boolean addVertex(GeographicPoint location)\n\t{\n\t\t// TODO: Implement this method in WEEK 3\n\t\tif (location == null) {\n\t\t\treturn false;\n\t\t}\n\t\telse if (!map.containsKey(location)) {\n\t\t\tmap.put(location, new MapNode(location));\n\t\t\tnumVertices++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(Rectangle2D r) {\n Geometry rect = rectangleToGeometry(r);\n\n return geometry.contains(rect);\n }", "public Boolean verifySearchResult(String location) {\r\n\t\tBoolean flag = false;\r\n\t\tWaitHelper wait = new WaitHelper(driver);\r\n\t\tWebElement confirmation = wait.setExplicitWait(driver, By.xpath(\"//div[@class='row searchWidgetRow propertySection']\"), 25);\r\n\t\tList<WebElement> searchConfirmation = confirmation.findElements(By.xpath(\".//strong\"));\r\n\t\tfor(WebElement eachElement: searchConfirmation){\r\n\t\t\tif(location.contains(eachElement.getText())){\r\n\t\t\t\tSystem.out.println(\"Search locality \"+location+\" contains the text \"+eachElement.getText());\r\n\t\t\t\tflag=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "public boolean contained(int x, int y) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean contains(Point pPtrRelPrnt, Point pCmpRelPrnt) {\n\t\tPoint loc = this.getLocation();\n\t\tint px = (int) pPtrRelPrnt.getX();\n\t\tint py = (int) pPtrRelPrnt.getY();\n\t\tint xLoc = (int) (pCmpRelPrnt.getX() + loc.getX());\n\t\tint yLoc = (int) (pCmpRelPrnt.getY() + loc.getY());\n\t\t\n\t\tif ((px >= xLoc) && (px <= xLoc + width) && (py >= yLoc) && (py <= yLoc + height)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean contains(JComponent c, int x, int y)\n/* */ {\n/* 339 */ return this.delegate.contains(c, x, y);\n/* */ }", "public static boolean isInside(World worldIn, BlockPos pos, NPCHouse npch)\n\t{\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\tint z = pos.getZ();\n\t\tint far_east = npch.getCorner(1).getX();\n\t\tint far_west = npch.getCorner(0).getX();\n\t\tint far_up = npch.getCorner(0).getY();\n\t\tint far_down = npch.getCorner(4).getY();\n\t\tint far_north = npch.getCorner(0).getZ();\n\t\tint far_south = npch.getCorner(2).getZ();\n\t\tif ((x <= far_east) && (x >= far_west))\n\t\t{\n\t\t\tif ((y <= far_up) && (y >= far_down))\n\t\t\t{\n\t\t\t\tif ((z <= far_south) && (z >= far_north))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"Attempted to search for null query\");\n return isItThisNode(root, p);\n }" ]
[ "0.7420301", "0.70708334", "0.6859434", "0.6832204", "0.6832204", "0.6580775", "0.65095764", "0.6441337", "0.64407855", "0.6439858", "0.64367133", "0.6273417", "0.62730944", "0.6237327", "0.61689323", "0.61544204", "0.6131282", "0.60935545", "0.6077933", "0.6066781", "0.60514814", "0.6046947", "0.6042111", "0.6011289", "0.6011289", "0.6011289", "0.60099757", "0.6004821", "0.5995957", "0.5984853", "0.5983995", "0.59747946", "0.594909", "0.5940744", "0.5934762", "0.59142035", "0.59075063", "0.59055185", "0.5885379", "0.5860096", "0.5812639", "0.5795593", "0.57899165", "0.5778019", "0.5777962", "0.5773288", "0.57674134", "0.5762874", "0.57592565", "0.57592565", "0.57475674", "0.5742909", "0.5732297", "0.572557", "0.5716117", "0.5712897", "0.56995434", "0.56904244", "0.5683456", "0.567376", "0.5670501", "0.5664374", "0.56632316", "0.5661912", "0.5657957", "0.5656396", "0.5641285", "0.5638668", "0.5629802", "0.5624047", "0.5622301", "0.5621136", "0.5619405", "0.56178385", "0.56178385", "0.56178385", "0.56178385", "0.5605046", "0.55958956", "0.5570501", "0.5569666", "0.5565343", "0.5565018", "0.55630445", "0.55620986", "0.5555252", "0.5552621", "0.55483574", "0.55469584", "0.5530968", "0.5529743", "0.55270445", "0.55212826", "0.5521168", "0.55116206", "0.55050075", "0.5499465", "0.5498235", "0.5497377", "0.54964936" ]
0.6690826
5
Returns the center of the cuboid.
public Location3D getCenter() { return new Location3D(world, lowPoint.getBlockX() + getXSize() / 2, lowPoint.getBlockY() + getYSize() / 2, lowPoint.getBlockZ() + getZSize() / 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }", "public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }", "public final Vector getCenter() {\n\t\treturn (center == null) ? computeCenter() : center;\n\t}", "public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }", "public Vector3D getCenter() {\n return center;\n }", "public Point getCenter() {\n \treturn new Point(x+width/2,y+height/2);\n }", "public Vector3f getCenter() {\r\n return center;\r\n }", "public Vector3f getSphereCenter() {\n\t\tfloat[] arr = getMinMax();\n\t\t\n\t\treturn new Vector3f((arr[0]+arr[1])/2,(arr[2]+arr[3])/2,(arr[4]+arr[5])/2);\n\t}", "public Vector2 getCenter() {\n\t\treturn new Vector2(position.x + size / 4f, position.y + size / 4f);\n\t}", "public Coords getCenter()\r\n {\r\n return new Coords(Math.round(x + width / 2), Math.round(y + height / 2));\r\n }", "PVector _getCenter() {\n PVector cen = new PVector(_hitboxCenter.x, _hitboxCenter.y);\n cen.rotate(_rotVector.heading() - _front);\n cen.x += _x;\n cen.y += _y;\n return cen;\n }", "public Coordinate getCenter() {\n return center;\n }", "public Point getCenter() {\n return new Point((int) getCenterX(), (int) getCenterY());\n }", "public double getCenter() {\n return 0.5 * (lo + hi);\n }", "public Vec3d getCenter() {\n\t\treturn set;\n\t}", "public Vector2 getCenter() {\n return center;\n }", "public Point getCenter() {\r\n\t\treturn center;\r\n\t}", "public Location getCenter() {\n return new Location(location.getWorld(), (float) getRectangle().getCenterX(), (float) getRectangle().getCenterY());\n }", "final public Vector2 getCenter()\n\t{\n\t\treturn center;\n\t}", "public Vector2 getCenter() {\n return new Vector2(rectangle.centerX(), rectangle.centerY());\n }", "Point getCenter();", "Point getCenter();", "public float getCenterX() {\n return cPosition.getX() + (float) cFishSizeX / 2;\n }", "public Point2D.Float getCenter() {\r\n\t\treturn center;\r\n\t}", "public int getCenter() {\n\t\t\treturn center;\n\t\t}", "public PointF getCenter() {\n return center;\n }", "public abstract Vector computeCenter();", "public Vec2 getCenter()\n {\n int numTriangles = numPoints - 2;\n\n // Calculate the average midpoint of each composite triangle\n Vec2 averageMidpoint = new Vec2(0, 0);\n float area = 0;\n for (int i=0; i<numTriangles; i++)\n {\n Triangle t = new Triangle(points[0], points[i+1], points[i+2]);\n Vec2 triangleMidpoint = t.getCenter();\n float triangleArea = t.getArea();\n\n averageMidpoint.addX(triangleMidpoint.getX() * triangleArea);\n averageMidpoint.addY(triangleMidpoint.getY() * triangleArea);\n\n area += triangleArea;\n\n// Color color;\n// if (i==0) color = Color.GREEN;\n// else color = Color.ORANGE;\n// SumoGame.ADD_DEBUG_DOT(points[0].getX(), points[0].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(points[i+1].getX(), points[i+1].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(points[i+2].getX(), points[i+2].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(triangleMidpoint.getX(), triangleMidpoint.getY(), triangleArea/2000, color);\n }\n\n averageMidpoint.div(area);\n\n// SumoGame.ADD_DEBUG_DOT(averageMidpoint.getX(), averageMidpoint.getY(), 20, Color.RED);\n\n return averageMidpoint;\n }", "public Vector3f getCenterOfProjection() {\n\t\treturn mCenterOfProjection;\n\t}", "public Point getCenter() {\n return center;\n }", "public int getCenterX() {\n\t\t\treturn (int) origin.x + halfWidth;\n\t\t}", "public Point getCenter() {\r\n return this.center;\r\n }", "public static int getCenter() {\n\t\treturn Center;\n\t}", "public Vector3D getCentrePosition()\n\t{\n\t\treturn centrePosition;\n\t}", "public Vector2D getArithmeticCenter()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tVector2D center = Vector2D.ZERO;\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tcenter = center.add(Vector2DMath.toVector(unit.getPosition()));\n\t\t}\n\t\tcenter = center.scale(1.0f / size());\n\n\t\treturn center;\n\t}", "private double centerX() {\n return (piece.boundingBox().getWidth() % 2) / 2.0;\n }", "public double[] getCenter() {\n return this.center;\n }", "public Point getCenter() {\n return location.center();\n }", "public Point2D getCentre() {\n return new Point2D.Float(centreX, centreY);\n }", "public EastNorth getCenter() {\n\t\treturn null;\n\t}", "public double getCenterX() { return centerX.get(); \t}", "public final int centerX() {\n return (left + right) >> 1;\n }", "@NotNull\n public Location<World> getCenterBlock() {\n int centerX = getMinChunk().getX() + 16;\n int centerZ = getMinChunk().getZ() + 16;\n return Tungsten.INSTANCE.getIslandWorld().getLocation(centerX * 16, 86, centerZ * 16);\n }", "public Vector3d getCurrentCollisionCenter() {\r\n return new Vector3d(collisionCenter.x + currentPosition.x, collisionCenter.y + currentPosition.y, collisionCenter.z + currentPosition.z);\r\n }", "public double getCenterX() {\n\t\treturn centerX;\n\t}", "public GJPoint2D center();", "public Vector getCentroid() {\n return centroid;\n }", "public float getCentreX() {\n return centreX;\n }", "public FPointType calculateCenter() {\n fRectBound = getBounds2D();\n FPointType fptCenter = new FPointType();\n fptCenter.x = fRectBound.x + fRectBound.width / 2.0f;\n fptCenter.y = fRectBound.y + fRectBound.height / 2.0f;\n calculate(fptCenter);\n \n rotateRadian = 0.0f;\n \n return fptCenter;\n }", "public double getCenterX()\n {\n return mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n }", "public Coordinates getCentroid() {\r\n return centroid;\r\n }", "public Point getCenterPx(){\n\t\tint centerX = images[0].getWidth()/2;\n\t\tint centerY = images[0].getHeight()/2;\n\t\tPoint centerPx = new Point(centerX,centerY);\n\t\treturn centerPx;\n\t}", "public Point getCentrePoint()\n\t\t{\n\t\t\tif(shape.equals(\"circle\") || shape.equals(\"ellipse\"))\n\t\t\t\treturn new Point((int)((Ellipse2D)obj).getCenterX(),(int)((Ellipse2D)obj).getCenterY());\n\t\t\tif(shape.equals(\"poly\"))\n\t\t\t{\n\t\t\t\tint xtot = 0;\n\t\t\t\tint ytot = 0;\n\t\t\t\tfor(int i=0; i < coords.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif((i % 2) == 0)\n\t\t\t\t\t\txtot += coords[i];\n\t\t\t\t\telse\n\t\t\t\t\t\tytot += coords[i];\n\t\t\t\t}\n\t\t\t\treturn new Point((xtot*2)/coords.length,(ytot*2)/coords.length);\n\t\t\t}else\n\t\t\t{\n\t\t\t\treturn new Point((int)((Rectangle)obj).getCenterX(),(int)((Rectangle)obj).getCenterY());\n\t\t\t}\n\t\t}", "Cell Center(){\n double sum_x = 0;\r\n double sum_y = 0;\r\n \r\n for(int i = 0; i < this.edgeCells.size(); i++){\r\n sum_x = this.edgeCells.get(i).x;\r\n sum_y = this.edgeCells.get(i).y;\r\n }\r\n \r\n for(int i = 0; i < this.seedCells.size(); i++){\r\n sum_x = this.seedCells.get(i).x;\r\n sum_y = this.seedCells.get(i).y;\r\n }\r\n \r\n sum_x = sum_x/(this.edgeCells.size() + this.seedCells.size()); //center of weight\r\n sum_y = sum_y/(this.edgeCells.size() + this.seedCells.size()); //\r\n \r\n center = new Cell((int)sum_x, (int)sum_y, this.edgeCells.get(0).z, this.edgeCells.get(0).id);\r\n \r\n \r\n return center;\r\n }", "public double getCenterX() {\n return this.getLayoutSlot().getX() + (int) (this.getLayoutSlot().getWidth() / 2);\n }", "public int centerX() {\n return mRect.centerX();\n }", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "public final Point getCenterPointOnScreen() {\n\t\treturn Calculations.tileToScreen(getLocalRegionX(), getLocalRegionY(),\n\t\t\t\t0.5D, 0.5D, 0);\n\t}", "public double getBorderCenterX()\n {\n return borderCenterX;\n }", "public Coordinate getCenteredCoordinate() {\n return coordinate.add(getHalfSize());\n }", "public Point2D.Double GetCentrePoint() {\n \t\treturn new Point2D.Double(centrePoint.getX(), centrePoint.getY());\n \t}", "private int getMidPoint(int cordinate)\n {\n int mid_point = ((cordinate + Player.getWidth_of_box()) / 2);\n return mid_point;\n }", "@Override\r\n\t\tpublic int cube() {\n\t\t\treturn width*width*width;\r\n\t\t}", "public LatLng getCenter() {\n return center;\n }", "double[] circleCentre()\n\t{\n\t\tdouble toOriginLength = Math.sqrt(originX*originX + originY*originY);\n\t\tdouble toCentreLength = toOriginLength + radius;\n\t\t\n\t\tdouble[] centrePoint = new double[2];\n\t\t\n\t\tcentrePoint[0] = (toCentreLength * originX)/toOriginLength;\n\t\tcentrePoint[1] = (toCentreLength * originY)/toOriginLength;\n\t\t\n\t\treturn centrePoint;\n\t}", "private PointF getCenterOfCropRect() {\n return new PointF(\n cropRect.centerX(),\n cropRect.centerY());\n }", "public Spatial boardCentre() {\r\n return tiles[2][2].tile;\r\n }", "public int getCenterX(){\r\n return centerX;\r\n }", "public PointF centroid()\n {\n if (cachedCentroid == null)\n {\n PointF centroid = new PointF();\n\n for (int i = 0; i < size(); i++)\n {\n PointF curr = get(i);\n PointF next = get(i + 1);\n\n float mult = curr.x * next.y - next.x * curr.y;\n centroid.x += (curr.x + next.x) * mult;\n centroid.y += (curr.y + next.y) * mult;\n }\n\n centroid.x /= 6 * signedArea();\n centroid.y /= 6 * signedArea();\n\n cachedCentroid = centroid;\n }\n\n return Geometry.clone(cachedCentroid);\n }", "public final int centerY() {\n return (top + bottom) >> 1;\n }", "public final float exactCenterX() {\n return (left + right) * 0.5f;\n }", "public final native LatLng getCenter() /*-{\n return this.getCenter();\n }-*/;", "public Point2D centerOfMass() \n {\n double cx = 0, cy = 0;\n double area = areaUnsigned();\n double factor = 0;\n for (Line2D line : lines) \n {\n factor = line.getP1().getX() * line.getP2().getY() - line.getP2().getX() * line.getP1().getY();\n cx += (line.getP1().getX() + line.getP2().getX()) * factor;\n cy += (line.getP1().getY() + line.getP2().getY()) * factor;\n }\n area *= 6.0d;\n factor = 1 / area;\n cx *= factor;\n cy *= factor;\n return new Point2D.Double(cx, cy);\n }", "public final Point getCenterPointOnScreen() {\n return bot.getManagers().getCalculations().tileToScreen(localRegionX, localRegionY,\n 0.5D, 0.5D, 0);\n }", "public int getXCenter() {\n return getXOrigin() + panelWidth/2;\n }", "public BoardCell getCenterCell() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Object getCentroid() {\n\t\treturn centroid;\n\t}", "public Point getCenterOfRotation() {\r\n\t\treturn centerOfRotation;\r\n\t}", "private Point getCentreCoordinate(Point t)\n {\n \treturn new Point (t.x + Constants.cell_length /2f, t.y, t.z+Constants.cell_length/2f );\n }", "public float[] getCenterCo(float x, float y)\n\t{\n\t\tfloat[] co = new float[2];\n\t\tint xco = getXVal(x);\n\t\tco[0] = (xco*PIXEL_WIDTH) - (PIXEL_WIDTH/2);\n\t\t\n\t\tint yco = getYVal(y);\n\t\tco[1] = (yco*PIXEL_HEIGHT) - (PIXEL_HEIGHT/2);\n\t\t\n\t\treturn co;\n\t}", "private static Point areaCentre() {\r\n\t\tvar centreLon = (lonLB + lonUB)/2;\r\n\t\tvar centreLat = (latLB + latUB)/2;\r\n\t\treturn Point.fromLngLat(centreLon, centreLat);\r\n\t}", "public static double getCenter(int index) {\n\t\tif (index==0) return -1.0;\n\t\telse return DEFAULT_CENTERS[index-1];\n\t}", "public abstract Vector2 getCentreOfMass();", "public Point2D.Double getImageCenter();", "public int getX() {\r\n return (int) center.getX();\r\n }", "public DoubleProperty centerXProperty() { \n\t\t\treturn centerX; \t\n\t\t}", "public String getCenterid() {\n return centerid;\n }", "public int getX() {\n return (int) center.getX();\n }", "public Point3d get3DCenter() {\n double xOfCenter = 0;\n double yOfCenter = 0;\n double zOfCenter = 0;\n for (IAtom atom : atoms) {\n xOfCenter += atom.getPoint3d().x;\n yOfCenter += atom.getPoint3d().y;\n zOfCenter += atom.getPoint3d().z;\n }\n\n return new Point3d(xOfCenter / getAtomCount(),\n yOfCenter / getAtomCount(),\n zOfCenter / getAtomCount());\n }", "public double getCenterY() { return centerY.get(); }", "protected Point getCenter(ArrayList<Unit> units) {\n\t\tint x = 0, y = 0;\n\t\t\n\t\tif(units.size() >= 1) {\n\t\t\tfor(Unit unit: units) {\n\t\t\t\tx += unit.getX();\n\t\t\t\ty += unit.getY();\n\t\t\t}\n\t\t\tx = x / units.size();\n\t\t\ty = y / units.size();\n\t\t}\n\t\treturn new Point(x,y);\n\t}", "public double getBorderCenterZ()\n {\n return borderCenterZ;\n }", "private int get_x() {\n return center_x;\n }", "private Point2D getCenterLatLon(){\n Point2D.Double result = new Point2D.Double();\n Point2D.Double screenCenter = new Point2D.Double();\n screenCenter.x = getWidth()/2; //contentpane width/height\n screenCenter.y = getHeight()/2;\n try{\n transform.inverseTransform(screenCenter,result); //transform to lat/lon using the current transform\n } catch (NoninvertibleTransformException e) {\n throw new RuntimeException(e);\n }\n return result;\n }", "public Vector3 getCenterOfMass() {\n //Does a weighted average of all the centers of mass of the modules\n Vector3 sum = Vector3.zero();\n for(Module module : modules.values())\n sum.addAltering(module.getCenterOfMass().multiply(module.getMass()));\n return sum.multiplyAltering(1.0/modules.values().size());\n }", "public Point centroid() {\n\t\t\tdouble xSum = 0.0;\n\t\t\tdouble ySum = 0.0;\n\t\t\tfor(Point point : clusterPointsList){\n\t\t\t\txSum += point.x;\n\t\t\t\tySum += point.y;\n\t\t\t}\n\t\t\tPoint centroid = new Point();\n\t\t\tcentroid.x = xSum / size();\n\t\t\tcentroid.y = ySum / size();\n\t\t\t\n\t\t\treturn centroid;\n\t\t}", "public native vector kbAreaGetCenter(int areaID);", "private Point middleLeft() {\n return this.topLeft.add(0, this.height / 2).asPoint();\n }", "public int getX() {\n return (int) this.center.getX();\n }", "int cubeCol() {\n return c; \n }" ]
[ "0.7896841", "0.7783275", "0.76617587", "0.76321507", "0.75220984", "0.7475531", "0.7456548", "0.7445626", "0.7438238", "0.74054503", "0.73782766", "0.73362875", "0.7284585", "0.72170407", "0.7193089", "0.71442384", "0.7125888", "0.7113249", "0.70985484", "0.709153", "0.70879006", "0.70879006", "0.70699686", "0.70348155", "0.70304507", "0.70286894", "0.70192415", "0.70174485", "0.7010181", "0.7008276", "0.70059735", "0.69840825", "0.6970691", "0.69506407", "0.6948315", "0.6923821", "0.68986017", "0.689735", "0.68711096", "0.68352747", "0.68320227", "0.68277884", "0.6800491", "0.67573166", "0.6756531", "0.6755627", "0.6676449", "0.6668262", "0.6661558", "0.6657562", "0.663064", "0.6608142", "0.6577933", "0.6560451", "0.6556932", "0.65561604", "0.653148", "0.650508", "0.6501972", "0.64834374", "0.64690226", "0.6467897", "0.64653224", "0.6443257", "0.64372313", "0.6427232", "0.642591", "0.6418241", "0.64179844", "0.64137024", "0.6388757", "0.6385949", "0.636787", "0.63633716", "0.63535964", "0.6350766", "0.63483423", "0.6312974", "0.6308458", "0.6283513", "0.62671375", "0.62286794", "0.622805", "0.6199898", "0.6146232", "0.61238986", "0.6119459", "0.6110128", "0.61058587", "0.6103484", "0.6100908", "0.60996073", "0.60988414", "0.60910857", "0.607475", "0.60698014", "0.6068001", "0.6061697", "0.60496", "0.6025729" ]
0.7640314
3
Returns the volume of this cuboid.
public long getSize() { return Math.abs(getXSize() * getYSize() * getZSize()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double volume() {\n\t\treturn this.iWidth * this.iLength * this.iDepth\r\n\t}", "public int volume() {\r\n int xLength = this.getMaximumPoint().getBlockX() - this.getMinimumPoint().getBlockX() + 1;\r\n int yLength = this.getMaximumPoint().getBlockY() - this.getMinimumPoint().getBlockY() + 1;\r\n int zLength = this.getMaximumPoint().getBlockZ() - this.getMinimumPoint().getBlockZ() + 1;\r\n\r\n int volume = xLength * yLength * zLength;\r\n return volume;\r\n }", "public double volume()\r\n {\r\n double volume = Math.pow(radius, 2) * (height / 3) * Math.PI;\r\n return volume;\r\n }", "@Override\n\tpublic float volume() {\n\t\tfloat volume = (float) ((4/3) * Math.PI * Math.pow(this.radius, 3));\n\t\treturn volume;\n\t}", "public double getVolume() {\n\t\treturn height * depth * length;\n\n\t}", "public double getVolume() {\n return (getArea() * height);\n }", "public double getVolume() {\n\n double volume = 0;\n\n double[] v = this.getVertices();\n int[] f = this.getFaces();\n\n for (int i = 0; i < f.length; i += 6) {\n Vector3D v0 = new Vector3D(v[3 * f[i]], v[3 * f[i] + 1], v[3 * f[i] + 2]);\n Vector3D v1 = new Vector3D(v[3 * f[i + 2]], v[3 * f[i + 2] + 1], v[3 * f[i + 2] + 2]);\n Vector3D v2 = new Vector3D(v[3 * f[i + 4]], v[3 * f[i + 4] + 1], v[3 * f[i + 4] + 2]);\n\n v0 = v0.crossProduct(v1);\n volume += v0.dotProduct(v2);\n }\n\n return Math.abs(volume / 6.0);\n }", "private double Volume() {\n\t\tdouble volume = (4f / 3f) * Math.PI * Math.pow(_radius, 3);\n\t\treturn volume;\n\t}", "public double getVolume() {\n\t\treturn base.getArea() * height;\n\t}", "@Override\n\tpublic float volume() {\n\t\treturn (float) ((4/3) * Math.PI * Math.pow(radius, 3));\n\t}", "public double getVolume() {\n return volume;\n }", "public double getVolume()\n {\n return volume / 512;\n }", "public int calculateVolume() {\n return (int) Math.pow(this.sideLength, 3) ;\n }", "public double volume () {return (4/3)*Math.PI*this.r*this.r*this.r;}", "public double getVolume()\n {\n return this.volume;\n }", "public double getVolume()\r\n\t{\r\n\t\treturn (super.getArea())*h;\r\n\t}", "public int getVolume() {\n return volume_;\n }", "public int getVolume() {\n return volume_;\n }", "public float getVolume()\n {\n return volume;\n }", "public int getVolume() {\n\t\treturn this.volume;\n\t}", "public int getVolume() {\r\n\t\treturn volume;\r\n\t}", "@Override\n\tpublic double getvolume(){\n\t\tdouble[] ab_cross_ac = calculate_vcp(getVector_AB(),getVector_AC());\n\t\t\n\t\t//dot product of ab_cross_ac and ad\n\t\tdouble S = calculate_vdp(ab_cross_ac,getVector_AD());\n\t\t\n\t\t//formula of tetrahedron's volume\n\t\treturn Math.abs(S)/6;\t\n\t}", "double volume()\n\t{\n\t\t\n\t\treturn width*height*depth;\n\t\t\n\t}", "public int getVolume() {\n return volume;\n }", "public double getVolume() {\n return super.getLado1() * super.getLado2() * this.altura;\n }", "@Override\n public double getVolume() {\n return liquids\n .stream()\n .mapToDouble(Liquid::getVolume)\n .sum();\n }", "public double getVolume() { return volume; }", "public abstract float volume();", "double volume(){\n\n return widgh*height*depth;\n\n }", "double volume() {\n\treturn width*height*depth;\n}", "Double volume() {\n return execute(\"player.volume\");\n }", "public String volume() {\n return mVolume;\n }", "public byte getVolume(){\r\n\t\treturn volume;\r\n\t}", "double volume() {\n\t\treturn 0;\n\t}", "public abstract double volume();", "int getVolume() {\n return this.volume;\n }", "BigDecimal getVolume();", "public double getTotalVolume() {\n return totalVolume;\n }", "public float getVolum() {\n return volum;\n }", "@Override\n\tpublic double volume() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic double volume() {\n\t\treturn 0;\n\t}", "public float getVolume() {\n return 1.0f;\n }", "public double getVolumeOfPipe(){\n double lengthPipeInches = lengthOfPipe / 0.0254;\n \n double outerRadius = diameterOfPipe / 2;\n outerRadius = Math.pow(outerRadius,2);\n double outervolumeOfPipe = (Math.PI * outerRadius) * lengthPipeInches;\n \n //get the inner volume pi * r^2 * height\n double innerRadius = (diameterOfPipe / 2) * 0.9;\n innerRadius = Math.pow(innerRadius,2);\n double innervolumeOfPipe = (Math.PI * innerRadius) * lengthPipeInches; \n \n //get the total volume of raw materials\n double totalVolume = outervolumeOfPipe - innervolumeOfPipe;\n \n return totalVolume;\n }", "public double getCyclinderVolume();", "@Override\n\tpublic float volume() {\n\t\treturn 0;\n\t}", "public int getVolume() {\n return mBundle.getInt(KEY_VOLUME);\n }", "public long getPropertyVolume()\n {\n return iPropertyVolume.getValue();\n }", "public long getPropertyVolumeUnity()\n {\n return iPropertyVolumeUnity.getValue();\n }", "public Float getVolume() throws DynamicCallException, ExecutionException {\n return (Float)call(\"getVolume\").get();\n }", "public double getcurrentVolume() {\n\t return this.currentVolume;\n\t}", "public double averageVolume() {\n if (numberOfIcosahedrons() == 0) {\n return 0;\n }\n else {\n return totalVolume() / numberOfIcosahedrons();\n }\n }", "public int getVolume();", "public double calcVolume(){\n double area=calcArea(); // calcArea of superclass used\r\n return area*h;\r\n }", "public abstract double getVolume();", "@Override\r\n\tpublic float getVolume() {\n\t\treturn 0;\r\n\t}", "double volume(){\n return width*height*depth;\n }", "public float getVolumeFactor() {\r\n\t\treturn volumeFactor;\r\n\t}", "@Override\r\n public double obtenerVolumen() {\n return Math.pow(getA(), 3);//eleva al cubo\r\n }", "public long getPropertyVolume();", "int getVolume();", "int getVolume();", "public int getCurrentVolume() {\n return mCurrentVolume;\n }", "public long getCurrentVolume() {\n return currentVolume;\n }", "public void calcVolume() {\n this.vol = (0.6666666666666667 * Math.PI) * Math.pow(r, 3);\n }", "public long getPropertyVolumeUnity();", "public int getSliderVolume() {\n return (int)(this.volume * 100);\n }", "public int getC_UOM_Volume_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_UOM_Volume_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public double getVolumeLitres() {\n return volumeLitres;\n }", "public Integer getVolumeSize() {\n return this.volumeSize;\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public abstract double calcVolume();", "public abstract double calcVolume();", "public Double getVolumeProgress() {\n return this.volumeProgress;\n }", "public String getVolumeId() {\n return this.volumeId;\n }", "private int getVol() {\r\n\r\n\t\treturn dayVolume;\r\n\t}", "int getOriginalVolume();", "public double get_volume(double r) {\n\t\treturn (Math.PI)*r*r*r*2/3;\t\t//dont 2/3*(Math.PI)*r*r*r -> ans 0\n\t}", "public static int getMusicVolume()\n\t{\n\t\treturn musicVolume;\n\t}", "public Future<Float> getVolume() throws DynamicCallException, ExecutionException {\n return call(\"getVolume\");\n }", "@Override\n\tpublic void volume() {\n\t\tsolido.volume = (solido.areaBase * altura) / 3;\n\t}", "public static double volume(double radius){\r\n return 4.0 / 3.0 * Math.PI * Math.pow(radius,3.0);\r\n }", "@ApiModelProperty(value = \"The number of shares exchanged during the trading day on the exchange.\")\n public BigDecimal getVolume() {\n return volume;\n }", "public void getProjVolume() {\n projVolume = (4/3) * 3.14 * pow(projRadius, 3);\n }", "public double totalVolume() {\n int index = 0;\n double total = 0.0;\n while (index < icosList.size()) {\n total += icosList.get(index).volume();\n index++; \n } \n return total;\n }", "public double totalVolume() {\r\n int index = 0;\r\n double listTotalVolume = 0;\r\n while (index < list.size()) {\r\n listTotalVolume += list.get(index).volume();\r\n index++;\r\n }\r\n return listTotalVolume;\r\n }", "private void calculateVolume() {\n\n\t\t/*\n\n\t\t */\n\t\tfor(int i=0; i<this._prismoidsLength.size(); i++) \n\t\t\tthis._prismoidsVolumes.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\tthis._prismoidsLength.get(i).divide(3)\n\t\t\t\t\t\t\t.times(\n\t\t\t\t\t\t\t\t\tthis._prismoidsSectionsAreas.get(i).getEstimatedValue()\n\t\t\t\t\t\t\t\t\t+ this._prismoidsSectionsAreas.get(i+1).getEstimatedValue()\n\t\t\t\t\t\t\t\t\t+ Math.sqrt(\n\t\t\t\t\t\t\t\t\t\t\tthis._prismoidsSectionsAreas.get(i)\n\t\t\t\t\t\t\t\t\t\t\t.times(this._prismoidsSectionsAreas.get(i+1))\n\t\t\t\t\t\t\t\t\t\t\t.getEstimatedValue()\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.CUBIC_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\n\t\tfor(int i=0; i<this._prismoidsVolumes.size(); i++)\n\t\t\tthis._fuelVolume = this._fuelVolume\n\t\t\t\t\t\t\t\t\t\t.plus(this._prismoidsVolumes.get(i));\n\t\tthis._fuelVolume = this._fuelVolume.times(2);\n\t\t\n\t}", "public Long getVolumeSizeInBytes() {\n return this.volumeSizeInBytes;\n }", "public float getSoundVolume() {\n return _soundVolume;\n }", "public int vol() {\r\n\t\treturn 3;\r\n\t}", "@Override\n public double obtenerVolumen(){\n return (1.0 / 3.0) * c.obtenerArea() * c.obtenerAltura();\n }", "public double getVolga() {\r\n return volga;\r\n }", "@Override\n\tpublic void calcularVolume() {\n\t\t\n\t}", "public static double cylinderVolume(double radius, double height){\n return Math.PI * square(radius) * height;\n }", "public float getVolumeMultiplier();", "public double getAlcoholVolume() {\n return isAlcoholic() ?\n liquids\n .stream()\n .filter(liquid -> liquid.getAlcoholPercent() > 0)\n .mapToDouble(liquid -> (liquid.getVolume() * (liquid.getAlcoholPercent() / 100)))\n .sum()\n : 0.0;\n }", "public List<V1Volume> getVolumes() {\n return volumes;\n }", "public Long[] getVolumes() { return this.volumes; }", "public static double volumeOfCylinder(double radius, double height) {\n\n //calculating the volume.\n double rSquared = Math.pow(radius, 2); // To do the power. Radius is in the base\n // and the 2 is in the power\n\n //doing the equation to get the volume of a cylinder\n double volume = Math.PI * rSquared * height;\n\n return volume; //send back the answer\n }", "public int VolumeGet();", "@Override\r\n\t\tpublic int dmr_getVolume() throws RemoteException {\n\t\t\tint current = soundManager.getVolume();\r\n\t\t\tUtils.printLog(TAG, \"current Volume\" + current);\r\n\t\t\treturn current;\r\n\t\t}", "@Override\r\n\t\tpublic int cube() {\n\t\t\treturn width*width*width;\r\n\t\t}" ]
[ "0.81957096", "0.8191939", "0.8024876", "0.7877016", "0.7827709", "0.77325594", "0.7684215", "0.7673877", "0.7654876", "0.7598761", "0.7570459", "0.75575155", "0.7532104", "0.7515729", "0.7491336", "0.7456409", "0.74451226", "0.7418493", "0.7417686", "0.7404129", "0.7398022", "0.73815805", "0.73790884", "0.73600125", "0.73050123", "0.7244597", "0.7240766", "0.71365845", "0.7134638", "0.7133793", "0.7114767", "0.7110659", "0.7096416", "0.7092873", "0.70892227", "0.7086658", "0.7065453", "0.7040581", "0.70403665", "0.7037652", "0.7037652", "0.7014653", "0.698378", "0.69524336", "0.6947768", "0.6931397", "0.69152117", "0.6866053", "0.6860784", "0.68488795", "0.68444383", "0.6841605", "0.6807029", "0.6787772", "0.6768152", "0.67557824", "0.6750873", "0.67453116", "0.6727967", "0.67025054", "0.67025054", "0.6627121", "0.66184187", "0.66011727", "0.6600635", "0.65900445", "0.6585734", "0.657497", "0.6558402", "0.65456444", "0.6491836", "0.6491836", "0.6452283", "0.64495957", "0.6445945", "0.644348", "0.64066654", "0.6347952", "0.6310883", "0.6307892", "0.62771404", "0.6268456", "0.6259001", "0.62561053", "0.6253903", "0.6245182", "0.62400764", "0.6236535", "0.6224707", "0.6187554", "0.6187069", "0.61713517", "0.61572385", "0.6154129", "0.61123836", "0.6097427", "0.6075891", "0.607334", "0.60730606", "0.6009336", "0.5983678" ]
0.0
-1
Returns whether the cuboid has no volume.
public boolean hasZeroVolume() { return getSize() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasVolume() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean hasVolume() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean isZero() {\r\n Vector3 veucl3 = this.getEuclidVector3();\r\n return (veucl3 == null) ? false : veucl3.isZero();\r\n }", "boolean hasVolume();", "public boolean isZero() {\n\t\treturn x == 0.0 && y == 0.0 && z == 0.0;\n\t}", "public boolean isZero() {\r\n for (int i = 0; i < this.getDimension(); i++) {\r\n if (this.getComponent(i) != 0)\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isZero() {\n\n return realPart == 0d && imaginaryPart == 0d;\n }", "public boolean isEmpty()\n\t{\n\t\treturn vertices.isEmpty();\n\t}", "boolean hasHadithVolumeNo();", "public boolean isEmpty() {\n return vertexLayer.isEmpty();\n }", "public boolean isCube(){\n\t\treturn !cubeDetectorL.get() && !cubeDetectorR.get();\n\t}", "public static boolean inventoryIsEmpty() {\n\t\treturn Inventory.getCount() == 0;\n\t}", "public boolean isSetOrderTotalVolume() {\n return EncodingUtils.testBit(__isset_bitfield, __ORDERTOTALVOLUME_ISSET_ID);\n }", "public boolean isZero() {\r\n return (this.getReal() == 0 && this.getImag() == 0) ? true : false;\r\n }", "public boolean isEmpty() {\n\t\tif (!rock && food == 0 && critter == null)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isEmpty() {\n\t\tif (player == ePlayer.none) return true;\n\t\treturn false;\n\t}", "public boolean test(FluidVolume volume) {\n\t\treturn volume.test(getFluid()) && volume.hasAvailable(getAmount());\n\t}", "public boolean is_empty() \n\t{\n\t\tif (this.nb_disk == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean deckIsEmpty(){\n return getSizeOfDeck() <= 0;\n }", "public boolean nothing() {\n return nodesNumber() == 0 && edgesNumber() == 0 && nonDirectionalEdgesNumber() == 0;\n }", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn vertices.isEmpty();\r\n\t}", "public boolean isEmpty() {\r\n return treasures.isEmpty();\r\n }", "public boolean isEmpty(){\n return mPezCount == 0;\n }", "public boolean isEmpty() {\n return qSize == 0;\n }", "public boolean isEmpty () {\n return mPezCount == 0;\n }", "private boolean isEmpty()\n {\n return dimensions.isEmpty();\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn super.isEmpty() || getFluid() == Fluids.EMPTY;\n\t}", "public boolean isEmpty() {\n\t\treturn this.deck.isEmpty();\n\t}", "public boolean isEmpty()\r\n {\r\n if(measurementQueue==null) return true;\r\n \r\n return measurementQueue.isEmpty();\r\n }", "public boolean isEmpty() throws XavaException {\n\t\treturn getMetaMembers().size() == 0;\n\t}", "public boolean currentIsEmpty() {\n Object o = evaluateCurrent();\n if (o == Util.nullValue || o == null) {\n return true;\n }\n final RolapCube measureCube = getMeasureCube();\n if (measureCube == null) {\n return false;\n }\n // For other cell values (e.g. zero), the cell is deemed empty if the\n // number of fact table rows is zero.\n final int savepoint = savepoint();\n try {\n setContext(measureCube.getFactCountMeasure());\n o = evaluateCurrent();\n } finally {\n restore(savepoint);\n }\n return o == null\n || (o instanceof Number && ((Number) o).intValue() == 0);\n }", "public boolean isEmpty() {\n\t\treturn vector.isEmpty();\n\t}", "public boolean isEmpty() {\n return deck.isEmpty();\n }", "public boolean isSetBidVolume() {\n return EncodingUtils.testBit(__isset_bitfield, __BIDVOLUME_ISSET_ID);\n }", "public boolean containsNoItems() {\n\t\treturn (this.items.size() == 0);\n\t}", "public boolean isZero()\n {\n return Native.fpaIsNumeralZero(getContext().nCtx(), getNativeObject());\n }", "public boolean isEmpty()\n {\n return deck.isEmpty();\n }", "public boolean isEmpty()\n\t{\n\t\treturn block == Block.EMPTY;\n\t}", "public boolean isMissingData() {\n return myModel.getRealtimeTimestamp() == 0;\n }", "public boolean isEmpty(){\n\t\tif(this.mVehicles.size() == 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isZero() {\n return mJavaSize == 0 && mRegisteredNativeSize == 0;\n }", "public boolean isEmtpyBySize(){\n\t\treturn size == 0;\n\t}", "public boolean hasEmptyHand(String pid) {\r\n return getPlayerHand(pid).isEmpty();\r\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn (getSize() == 0);\n\t}", "public boolean isSilent() {\n for(int iSndGrp = 0, i = 0;\n iSndGrp < XaAdpcmDecoder.ADPCM_SOUND_GROUPS_PER_SECTOR;\n iSndGrp++, i += XaAdpcmDecoder.SIZEOF_SOUND_GROUP)\n {\n // just check if all ADPCM values are 0\n for (int j = 16; j < XaAdpcmDecoder.SIZEOF_SOUND_GROUP; j++) {\n if (getCdSector().readUserDataByte(i+j) != 0)\n return false;\n }\n }\n return true;\n }", "public boolean hasNullSig() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_NULLSIG)) {\n // The Mek has Null-Sig\n return true;\n }\n }\n return false;\n }", "public boolean isEmpty() {\r\n\t\treturn objectCollection.isEmpty();\r\n\t}", "public boolean isEmpty() {\n return mPoints.isEmpty();\n }", "public boolean hasNoParents()\r\n\t{\treturn (this.strongParents.isEmpty()) && (this.weakParents.isEmpty());\t}", "public boolean isEmpty() {\n return mCrimes.isEmpty();\n }", "private boolean isEmpty(){\n return (numInstances() == 0);\n }", "public boolean isEmpty()\r\n\t{\r\n\t\treturn data.size() == 0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn tamano == 0;\n\t}", "public boolean isSetQuantity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(QUANTITY$10) != 0;\n }\n }", "public Boolean isEmpty()\n\t{\n\n\n\t\tif (getSize() == 0)\n\t\t{\n\n\t\t\treturn true;\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\treturn false;\n\n\t\t}\n\n\n\t}", "public boolean is_empty() {\n\t\treturn false;\n\t}", "public boolean isEmpty() {\n switch(size()) {\n case 0:\n return true;\n case 1:\n Element element = (Element) get(0);\n if (element.type() == Element.CHUNK && ((Chunk) element).isEmpty()) {\n return true;\n }\n return false;\n default:\n return false;\n }\n }", "@Override\n public boolean isEmpty() {\n return getSnapshot() == null;\n }", "public boolean isEmpty()\r\n\t{\r\n\t\tif (getSize() == 0)\r\n\t\t\treturn true;\r\n\t\telse\t\t\t\r\n\t\t\treturn false;\r\n\t}", "public boolean hasEmptySlots() {\n return (numMaxPlayers - activePlayers) != 0;\n }", "public boolean isRoot() {\n return isIndex() && parts.length == 0;\n }", "public boolean isEmpty() {\n\t\t\t\t\n\t\treturn length() == 0;\n\t}", "public Boolean isZERO(Ring ring) {\r\n return (re.isZero(ring) && im.isZero(ring));\r\n }", "public boolean isEmpty() {\r\n return (Double.isNaN(x) && Double.isNaN(y));\r\n }", "public boolean isEmpty() {\n return points.isEmpty();\n }", "public boolean isEmpty() {\n return getCardCount() <= 0;\n }", "public boolean isEmpty() {\n\t\treturn (N == 0);\t\n\t}", "public boolean isEmpty() {\n this.ensureAtLeastPartResolved();\n return isNull;\n }", "public boolean isEmpty()\n {\n return root == nil;\n }", "public boolean isEmpty()\n {\n return root == nil;\n }", "public boolean isEmpty() {\n\t\treturn length == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn length == 0;\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\tboolean bandera=true;\r\n\t\tif(vector.size()>0){\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tbandera=false;\r\n\t\t}\r\n\t\treturn bandera;\r\n\t}", "public boolean isEmpty(){\r\n\t\treturn size() == 0;\r\n\t}", "public Boolean emptyDeck(){\n return this.deckOfCards.isEmpty();\n }", "public boolean empty()\n {\n return deck.empty();\n }", "public boolean isNilZyhtVO()\n {\n synchronized (monitor())\n {\n check_orphaned();\n nc.vo.crd.bd.interf.zyhtvo.ZyhtVO target = null;\n target = (nc.vo.crd.bd.interf.zyhtvo.ZyhtVO)get_store().find_element_user(ZYHTVO$0, 0);\n if (target == null) return false;\n return target.isNil();\n }\n }", "public boolean isEmpty(){\n return (length == 0);\n }", "public boolean hasNoImages() {\n return noImages;\n }", "public boolean hasVertices() {\n if (vertices != null) {\n return vertices.length > 0;\n }\n return false;\n }", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean perdu() {\r\n return this.robots.isEmpty();\r\n }", "public boolean isEmpty() {\r\n return N == 0;\r\n }", "private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isNulled() {\n \t\treturn nulled;\n \t}", "public boolean isEmptyComplexValue() {\r\n if(complexValue==null){\r\n return true;\r\n }\r\n return complexValue.isEmpty();\r\n }", "public boolean isEmpty()\n {\n return length == 0;\n }", "@Override\n\tpublic boolean\n\tisZero()\n\t{\n\t\treturn( data[0] == 0 && data[1] == 0 && data[2] == 0 );\n\t}", "public boolean isEmpty() {\n\t\treturn Arrays.stream(inventory.getContents())\n\t\t\t\t.noneMatch(ItemStackUtils::isValid);\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty() {\n return (fifoEmpty.getBoolean());\n }", "public boolean isEmpty()\n {\n return cards.size() == 0;\n }", "public boolean isEmpty() {\n if (this.raiz == null) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isEmpty() {\n\t\treturn currentSize == 0;\n\t}", "public boolean isEmpty() {\n return N == 0;\n }" ]
[ "0.73230165", "0.73111635", "0.72389823", "0.70474267", "0.6805759", "0.66655755", "0.65963197", "0.6569363", "0.65670747", "0.6525944", "0.650666", "0.6487958", "0.6475656", "0.64592916", "0.6438378", "0.63584375", "0.6319647", "0.631086", "0.6299332", "0.6298671", "0.62290263", "0.62274987", "0.6220769", "0.6206655", "0.62024075", "0.6200143", "0.61928326", "0.61873907", "0.61453503", "0.613616", "0.61240774", "0.6118972", "0.61161005", "0.6114049", "0.61025465", "0.61019945", "0.60910165", "0.6090341", "0.60634995", "0.6057496", "0.6056118", "0.6050865", "0.6049366", "0.6044243", "0.6041834", "0.6032645", "0.60309213", "0.6030101", "0.60295033", "0.6023496", "0.60217637", "0.6018124", "0.60174006", "0.6016438", "0.6015422", "0.60125434", "0.60109574", "0.60058546", "0.6005322", "0.5997687", "0.5990308", "0.59890795", "0.59885055", "0.5986435", "0.59820616", "0.59817713", "0.5969633", "0.59693027", "0.596703", "0.596703", "0.5966263", "0.5966263", "0.5961546", "0.5952959", "0.594936", "0.5949344", "0.5944948", "0.5943317", "0.59265274", "0.59224427", "0.5921813", "0.5921813", "0.5921813", "0.5921813", "0.5921676", "0.5912881", "0.59123975", "0.5912095", "0.59104115", "0.5910134", "0.590993", "0.59097356", "0.5909646", "0.5909646", "0.5909646", "0.59094465", "0.590853", "0.5908091", "0.59076", "0.5906873" ]
0.8063682
0
Determines a random location inside the cuboid and returns it.
public Location getRandomLocation() { final Random randomGenerator = new Random(); Location result = new Location(getWorld(), highPoint.getBlockX(), highPoint.getBlockY(), highPoint.getBlockZ()); if (getSize() > 1) { final double randomX = lowPoint.getBlockX() + randomGenerator.nextInt(getXSize()); final double randomY = lowPoint.getBlockY() + randomGenerator.nextInt(getYSize()); final double randomZ = lowPoint.getBlockZ() + randomGenerator.nextInt(getZSize()); result = new Location(Bukkit.getWorld(world), randomX, randomY, randomZ); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}", "public Point randomLocation() {\r\n\t\tRandom rand = new Random();\r\n\t\treturn new Point(this.location.getPosition().getX()+ rand.nextInt() % location.getSize().getHeight(),this.location.getPosition().getY()+ rand.nextInt() % location.getSize().getWidth());\r\n\t}", "private Vector3 randomLocationDolphin() {\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 0.0f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) < 420f);\n\t\treturn randomPosition;\n\t}", "public Location getRandomLocationForMobs() {\n\t\tfinal Location temp = getRandomLocation();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX() + 0.5, temp.getBlockY() + 0.5, temp.getBlockZ() + 0.5);\n\t}", "public Location getRandomLocationForPlayers() {\n\t\tfinal Location temp = getRandomLocationForMobs();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX(), temp.getBlockY() + 1, temp.getBlockZ());\n\t}", "public static Location genRandomSpawn() {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, 0, z));\n }", "private static Position fetchRandomPosition(){\n return new Position(0,0).returnRandomPosition();\n }", "private Vector3 randomLocationMonster() {\n\t\t\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 1.5f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) > 380f);\n\t\treturn randomPosition;\n\t}", "public Position randposition()\r\n\t{\n\t\tRandom random = new Random();\r\n\t\tPosition position = new Position(random.nextInt(7680), random.nextInt(4320), random.nextDouble());\r\n\t\treturn position;\r\n\t}", "public Coordinate generatePosition() {\n Random rng = new Random();\n return new Coordinate(rng.nextFloat(), rng.nextFloat());\n }", "public Position sampleRandomUniformPosition();", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "public static Point pos(){\r\n\t\tRandom random = new Random();\r\n\t\tint x = 0;\r\n\t\tint y = 0;\r\n\t\t//acts as a 4 sided coin flip\r\n\t\t//this is to decide which side the asteroid will appear\r\n\t\tint pos = random.nextInt(4);\r\n\t\t//west\r\n\t\tif(pos == 0){\r\n\t\t\tx = 0;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//north\r\n\t\telse if(pos == 1){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 0;\r\n\t\t}\r\n\t\t//east\r\n\t\telse if(pos == 2){\r\n\t\t\tx = 800;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//\r\n\t\telse if(pos == 3){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 600;\r\n\t\t}\r\n\t\tPoint p = new Point(x,y);\r\n\t\treturn p;\r\n\t}", "public Point getLocation(){\n\t\tint x = widgetchild.getAbsoluteX();\n\t\tint y = widgetchild.getAbsoluteY();\n\t\tint rx = Random.nextInt(0, widgetchild.getWidth());\n\t\tint ry = Random.nextInt(0, widgetchild.getHeight());\n\t\treturn new Point(x+rx,y+ry);\n\t}", "private PointF getRandCoordinate() {\n Random r = new Random();\n float xRand = (r.nextInt(getWidth()) / density) + 1;\n float y = 10 / density;\n\n return new PointF(xRand, y);\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 static Location getUniqueLocation(){\n int randomIndex = randomNumber(femaleNames.getNames().length);\n return locations.getLocations()[randomIndex];\n }", "private GameWorld.Position randomAvatarPosition(GameWorld world) {\n int xVal = world.getRand().nextInt(world.WIDTH - 1);\n int yVal = world.getRand().nextInt(world.HEIGHT - 1);\n if (world.getNumOfSq() > 0) {\n while (!(world.world[xVal][yVal].equals(Tileset.FLOOR))) {\n xVal = world.getRand().nextInt(world.WIDTH - 1);\n yVal = world.getRand().nextInt(world.HEIGHT - 1);\n }\n System.out.println(yVal);\n System.out.println(\"therethere\");\n world.avatarPosition = new GameWorld.Position(xVal, yVal);\n return world.avatarPosition;\n }\n return new GameWorld.Position(xVal, yVal);\n }", "private Location generateRandomStartLocation() {\n\t\tif (!atLeastOneNonWallLocation()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"There is no free tile available for the player to be placed\");\n\t\t}\n\n\t\twhile (true) {\n\t\t\t// Generate a random location\n\t\t\tfinal Random random = new Random();\n\t\t\tfinal int randomRow = random.nextInt(this.map.getMapHeight());\n\t\t\tfinal int randomCol = random.nextInt(this.map.getMapWidth());\n\n\t\t\tfinal Location location = new Location(randomCol, randomRow);\n\n\t\t\tif (this.map.getMapCell(location).isWalkable()\n\t\t\t\t\t&& !otherPlayerOnTile(location, -1)) {\n\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t}", "public static Location genRandomSpawn(int y) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "private Vector3f getPlanetPosition() {\r\n\t\tVector3f position = new Vector3f();\r\n\t\tdouble theta = Math.random() * 2 * Math.PI;\r\n\t\tdouble r = MathUtils.randRange(MIN_ORBITAL_RADIUS, MAX_ORBITAL_RADIUS);\r\n\t\tposition.x = (float) (r * Math.cos(theta));\r\n\t\tposition.z = (float) (r * Math.sin(theta));\r\n\t\t// Introduce y variation\r\n\t\tposition.y = (float) MathUtils.randRange(MIN_PLANET_Y, MAX_PLANET_Y);\r\n\t\treturn position;\r\n\t}", "public Point randomPoint() \t // creates a random point for gameOjbects to be placed into\r\n\t{\n\t\tint x = rand.nextInt(900);\r\n\t\tx = x + 50;\r\n\t\tint y = rand.nextInt(900);\r\n\t\ty = y + 50;\r\n\t\tPoint p = new Point(x, y);\r\n\t\treturn p;\r\n\t}", "public City randomlyAssignCity()\n {\n int cityReferenceNumber = (int)(Math.random()*(getContainerSize() - 1)) + 1;\n City randomCity = cityContainer.get(cityReferenceNumber);\n \n return randomCity;\n }", "private Point randomIndex() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val1 = rand.nextInt(rows_size);\r\n\t\tint val2 = rand.nextInt(columns_size);\r\n\t\twhile (!isEmpty(val1,val2)) {\r\n\t\t\tval1 = rand.nextInt(rows_size);\r\n\t\t\tval2 = rand.nextInt(columns_size);\r\n\t\t}\r\n\t\treturn new Point(val1,val2);\r\n\t}", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "private static void spawnAtRandomLocation(World world, GameObject gameObject, double radius) {\n Location location = new Location();\n gameObject.setLocation(location);\n boolean found = false;\n while (!found) {\n double x = Math.random() * (world.mNortheast.getX() - world.mSouthwest.getX());\n double y = Math.random() * (world.mNortheast.getY() - world.mSouthwest.getY());\n location.setX(x);\n location.setY(y);\n found = !world.collides(gameObject, radius);\n }\n world.registerGameObject(gameObject);\n Main.logger.log(Logger.VERBOSE, \"Spawning \" + gameObject + \" @ \" + gameObject.getLocation());\n }", "private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }", "private String randomCityId(RandomNumberGenerator random) {\n long targetPop = (long) (random.rand() * totalPopulation);\n\n for (Map.Entry<String, Long> city : populationByCityId.entrySet()) {\n targetPop -= city.getValue();\n\n if (targetPop < 0) {\n return city.getKey();\n }\n }\n\n // should never happen\n throw new RuntimeException(\"Unable to select a random city id.\");\n }", "public static int weaponSpawnLocation(int cellCount)\r\n\t{\r\n\t\tRandom rng = new Random ();\t\r\n\t\treturn rng.nextInt(cellCount);\r\n\t}", "private static void spawnAtRandomLocation(World world, GameObject gameObject) {\n spawnAtRandomLocation(world, gameObject, 0.5);\n }", "private RandomLocationGen() {}", "public Point2D getRandomNodeLocation() {\n int validNum = 0;\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n validNum++;\n }\n }\n int randomIndex = RandomEnhanced.randInt(0,validNum-1);\n\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n if (randomIndex==0) return ((NavNode)graphNode).getPosition();\n randomIndex--;\n }\n }\n return null;\n }", "public Location getRandomLocation(ArenaWorld world, ArenaAnimal animal, List<Location> locations) {\n int HIGH = locations.size();\n int randomIndex = 0;\n Random randomize = new Random();\n if (HIGH > 0) {\n randomIndex = randomize.nextInt(HIGH);\n return locations.get(randomIndex);\n }\n return animal.getLocation();\n }", "public Color randColor() {\r\n return this.loc.get(this.rand.nextInt(this.loc.size()));\r\n }", "public void generateRandomPosition(Zone samusZone) {\n\t\t\n\t\tint i = samusZone.getI(), j = samusZone.getJ();\n\t\twhile(i == samusZone.getI() && j == samusZone.getJ()) {\n\t\t\ti = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t\tj = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t}\n\t\t\n\t\tsamusZone.getSamus().setI(i);\n\t\tsamusZone.getSamus().setJ(j);\n\t}", "public static int randomPosition(){\r\n int max = 4;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n int pos = randNum;\r\n \r\n return pos;\r\n }", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public Cell generatePosition(int r, int c) {\n\t\tdouble w = Math.random()*r+1;\r\n\t\tdouble q = Math.random()*c;\r\n\t\tint rows = (int) w;\r\n\t\tint b = (int) q;\r\n\t\tchar cols = (char) ('A' + b);\r\n\t\treturn recorrerMatrix(rows,cols,getFirst());\r\n\t}", "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 Cave getUnoccupiedOpenLocation() {\n\t\tCave tempCave = null;\n\t\tboolean tempBool = true;\n\t\twhile(tempBool) {\n\t\t\tdouble i = Math.random() * row;\n\t\t\tdouble j = Math.random() * columns;\n\t\t\t\ttempCave = caveArray[(int) i][(int) j];\n\t\t\t\tif((int)i == row-1 && (int)j == columns-1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (tempCave.isOccupied() == false && tempCave.isOpen())\n\t\t\t\t\treturn tempCave;\n\t\t\t}\n\t\t\n\t\treturn tempCave;\n\t\t\n\t}", "private Point3D getRandomSolarPoint(final int radius)\n \t{\n \t\t// Might want to change the min/max values here\n \t\tPoint3D point = null;\n \t\twhile (point == null || isOccupied(point, radius)) {\n \t\t\tpoint = new Point3D(MathUtils.getRandomIntBetween(-500, 500), MathUtils.getRandomIntBetween(-500, 500),\n \t\t\t\t\tMathUtils.getRandomIntBetween(-500, 500));\n \t\t}\n \t\treturn point;\n \t}", "public Location randomSpawn(Match m) {\r\n\t\treturn randomSpawn(teamName.ALONE, m);\r\n\t}", "private static Coordinates getRandomCoordinates() {\n Random r = new Random();\n double upperLimit = 180;\n double lowerLimit = -180;\n double lon = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n double lat = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n return new Coordinates(lat, lon);\n }", "public Cell randomCell() {\n ArrayList<Cell> available = this.randomCellHelper();\n return available.get(new Random().nextInt(available.size()));\n\n }", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "Chromosome getRandom();", "private void locate() {\n possibleLocations[0][0] = false;\n possibleLocations[0][1] = false;\n possibleLocations[1][0] = false;\n do {\n location.randomGenerate();\n } while (!possibleLocations[location.y][location.x]);\n }", "public static Offset getRandomOffsetForRoom() {\n return new Offset(5 + Math.random() * 90, 5 + Math.random() * 90);\n }", "private void locateApple() {\n xApplePosition = random.nextInt(32);\n yApplePosition = random.nextInt(21);\n }", "public Location computerMove()\n\t{\n\t\tArrayList<Location> possibleLocs = new ArrayList<Location>();\n\t\tfor (int row = 0; row < grid.length; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < grid[0].length; col++)\n\t\t\t{\n\t\t\t\tLocation temp = new Location(row, col);\n\t\t\t\tif (!isOccupied(temp))\n\t\t\t\t\tpossibleLocs.add(temp);\n\t\t\t}\n\t\t}\n\t\tfor (int count = 0; count < possibleLocs.size(); count++)\n\t\t{\n\t\t\tif (checkWin(1, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t\telse if (checkWin(0, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t}\n\t\treturn possibleLocs.get((int) (Math.random() * possibleLocs.size()));\n\t}", "public static Point randomPoint() {\r\n\t\tString n = \"\" + (char) (65 + rand.nextInt(26));\r\n\t\tint x = rand.nextInt(11);\r\n\t\tint y = rand.nextInt(11);\r\n\t\treturn new Point(n, x, y);\r\n\t}", "private float randomiseLatitude(){\n return randomiseFloat(-90,90);\n }", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "public City(){\n this.x = (int)(Math.random()*200);\n this.y = (int)(Math.random()*200);\n }", "public Location getSpawnLocation() {\n return this.spawnLocation;\n }", "public static Location genRandomSpawn(int y, int width) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = width / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }", "public static int getRandCell() {\n int num = (int) (Math.random() * 10); // Generate random numbers\n int randCell = 1;\n if (num >= MARG_FIRST && num <= MARG_LAST) { // Set boundaries\n randCell = num;\n }\n return randCell;\n }", "public Room getRandomRoom(){\n return (Room)rooms.get(random.nextInt(rooms.size()));\n }", "boolean isGoodLocation(World world, int x, int y, int z);", "public Room getRandomRoom() {\n random = new Random();\n Room portal = allrooms.get(random.nextInt(allrooms.size()-1));\n return portal;\n }", "private float randomiseLongitude(){\n return randomiseFloat(-180,180);\n }", "public Location getRandomBreedingLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingEightLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "public PositionInTheGameBoard()\r\n\t{\r\n\t\tthis.X = new Random().nextInt(PositionInTheGameBoard.max_X);\r\n\t\tthis.Y = new Random().nextInt(PositionInTheGameBoard.max_Y);\r\n\t}", "public int hideBomb() {\r\n\r\n\t\tint randomLocation = (int) Math.floor(Math.random() * 9);\r\n\t\trandomLocation = Math.round(randomLocation);\r\n\r\n\t\treturn randomLocation; \r\n\r\n\t}", "public Demographics randomCity(RandomNumberGenerator random) {\n if (city != null) {\n // if we're only generating one city at a time, just use the largest entry for that one city\n if (fixedCity == null) {\n fixedCity = demographics.values().stream()\n .filter(d -> d.city.equalsIgnoreCase(city))\n .sorted().findFirst().get();\n }\n return fixedCity;\n }\n return demographics.get(randomCityId(random));\n }", "public static int randomPos(int grid) {\n Random rand = new Random();\n return rand.nextInt((grid));\n }", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public BoardCell pickLocation(Set<BoardCell> targets){\n\t\tfor (BoardCell i: targets)\r\n\t\t\tif (i.isRoom() && !(((RoomCell) i).getInitial() == lastRoomVisited))\r\n\t\t\t\treturn i;\r\n\t\t//\tpick random cell\r\n\t\tObject[] cell = targets.toArray();\r\n\t\tRandom generator = new Random();\r\n\t\tint random = generator.nextInt(cell.length);\r\n\t\treturn (BoardCell) cell[random];\r\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public String randomCityName(RandomNumberGenerator random) {\n String cityId = randomCityId(random);\n return demographics.get(cityId).city;\n }", "MapLocation getPosition(Unit unit);", "public static Location localBlockCoords(Location location, double x0, double y0, double z0) {\n Location loc = location.clone();\n float a = loc.getYaw();\n double sin = 0d, cos = 0d;\n if (a < -135 || a >= 135) {\n sin = 0d;\n cos = -1d;\n } else if (a >= -135 && a < -45) {\n sin = -1d;\n cos = 0d;\n } else if (a >= -45 && a < 45) {\n sin = 0d;\n cos = 1d;\n } else if (a >= 45 && a < 135) {\n sin = 1d;\n cos = 0d;\n }\n double x = (x0 * cos) - (z0 * sin);\n double z = (x0 * sin) + (z0 * cos);\n return loc.add(x, y0, z);\n }", "public static CubeState getRandom(){\n CubeState cs = new CubeState();\n Random rand = new Random();\n for (int i = 0; i < 20; i++) {\n cs = cs.times(Solver.generators.get(rand.nextInt(18)));\n }\n return cs;\n }", "public Location mainSpawn(){\r\n\t\treturn mainSpawn;\r\n\t}", "public Location getRandomMoveLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingFourLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "private TetrisPiece randomPiece() {\n\t\tint rand = Math.abs(random.nextInt());\n\t\treturn new TetrisPiece(rand % (PIECE_COLORS.length));\n\t}", "public int getSquareLocation()\n\t\t{\n\t\t\treturn location; // return location of square\n\t\t}", "Point2i getFreeRandomPosition() {\n\t\tPoint2i p = new Point2i();\n\t\tint i = 0;\n\t\tint max = this.grid.getWidth() * this.grid.getHeight();\n\t\tdo {\n\t\t\tp.set(\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getWidth()),\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getHeight()));\n\t\t\t++i;\n\t\t}\n\t\twhile (!isFree(p.x(), p.y()) && i < max);\n\t\treturn (isFree(p.x(), p.y())) ? p : null;\n\t}", "private static ResourceLocation getRandomMonster(Random rand)\n\t{\n\t\tRandomCollection<ResourceLocation> monsters = new RandomCollection<ResourceLocation>();\n\t\t\n\t\tmonsters.add(10, EntityList.getKey(EntityZombie.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySkeleton.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySpider.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityGhost.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityBarbarian.class));\n\t\t//monsters.add(4, EntityList.getKey(EntityBandit.class));\n\t\tmonsters.add(3, EntityList.getKey(EntityBanshee.class));\n\t\tmonsters.add(1, EntityList.getKey(EntityGolem.class));\n\t\t\n\t\treturn monsters.next(rand);\n\t}", "Square getCurrentPosition();", "private double[] generateRandomCoordinates() {\n return generateRandomCoordinates(CoordinateDomain.GEOGRAPHIC, 0.05f);\n }", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "public City() {\r\n\t\tthis.x = (int) (Math.random() * 200);\r\n\t\tthis.y = (int) (Math.random() * 200);\r\n\t}", "void randomBlock() {\n\t\t// map generate (int map)\n\t\tfor (int i = 0; i < mapX; i += 2) {\n\t\t\tfor (int j = 0; j < mapY; j += 2) {\n\t\t\t\tint r = (int) Math.random() * 4;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 1);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 1);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 1);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 1);\n\n\t\t\t\t} else {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 0);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 0);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 0);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 0);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }", "public static Location worldLocsGet(UUID uuid) {\n\n\t\tLocation loc = null;\n\n\t\ttry {\n\n\t\t\tStatement st = conn.createStatement();\n\n\t\t\tResultSet rs = st.executeQuery(\"SELECT * FROM worldlocs WHERE uuid = '\" + uuid + \"'\");\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tdouble x = rs.getDouble(\"x\") + 0.5;\n\t\t\t\tdouble y = rs.getDouble(\"y\");\n\t\t\t\tdouble z = rs.getDouble(\"z\") + 0.5;\n\t\t\t\tloc = new Location(PvPTeleport.instance.getServer().getWorld(\"world\"), x, y, z);\n\n\t\t\t}\n\n\t\t\trs.close();\n\t\t\tst.close();\n\n\t\t} catch (Exception e) {\n\t\t\tPvPTeleport.instance.getLogger().info(e.getMessage());\n\t\t}\n\n\t\treturn loc;\n\n\t}", "protected Vector3f place (Vector3f position) {\n float radius = FloatMath.pow(\n FloatMath.random(\n innerRadius*innerRadius*innerRadius,\n outerRadius*outerRadius*outerRadius),\n 1f / 3f);\n // elevation based on the surface area distribution\n float sine = FloatMath.random(-1f, +1f);\n float cose = FloatMath.sqrt(1f - sine*sine);\n float angle = Randoms.threadLocal().getFloat(FloatMath.TWO_PI);\n return position.set(\n radius * FloatMath.cos(angle) * cose,\n radius * FloatMath.sin(angle) * cose,\n radius * sine);\n }", "public ImmutableSimpleLocation getSpawn() {\n return spawn;\n }", "public Point nextPoint() {\n\t\tRandom rand = new Random();\n\t\tint randomX = rand.nextInt(maxX);\n\t\tint randomY = rand.nextInt(maxY); \n\t\t\n\t\treturn new Point(randomX, randomY);\n\t}", "public void newCoord() {\n\t\tx = Data.generateRandomX();\n\t\ty = Data.generateRandomY();\n\t}", "public Square getSquare(Location loc)\n {\n return squares[loc.getRow()][loc.getCol()];\n }", "public Object getObjectAtLocation(Point p);", "public int getRandom() {\n return sub.get(rand.nextInt(sub.size()));\n }", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public static Ally getRandomCeleb () {\n return celebrity[(int) (Math.random() * celebrity.length)];\n }", "public Location selectMoveLocation(ArrayList<Location> locs)\n {\n int n = locs.size();\n if (n == 0)\n return getLocation();\n int r = (int) (Math.random() * n);\n return locs.get(r);\n }" ]
[ "0.7694373", "0.7388451", "0.72126335", "0.7160936", "0.7149114", "0.7106666", "0.6902656", "0.6868881", "0.6844593", "0.66735214", "0.66580147", "0.66418546", "0.6589905", "0.65276635", "0.6469215", "0.6413773", "0.6360353", "0.635241", "0.6344488", "0.6321221", "0.6312238", "0.6283428", "0.6237235", "0.6170766", "0.61519927", "0.614802", "0.61264575", "0.6117376", "0.6107786", "0.60909003", "0.608583", "0.6070599", "0.606947", "0.60581374", "0.60430706", "0.60277885", "0.60070467", "0.59938914", "0.59878796", "0.5986533", "0.5955454", "0.59443563", "0.5931596", "0.5928039", "0.59129786", "0.58870775", "0.58301765", "0.58270836", "0.582625", "0.5825513", "0.58236265", "0.58179176", "0.5786688", "0.57556534", "0.5747561", "0.57417214", "0.5741238", "0.5731178", "0.57310206", "0.56923765", "0.56853706", "0.56790096", "0.5672793", "0.5665222", "0.5651975", "0.5649486", "0.5646455", "0.56391317", "0.5633755", "0.5631292", "0.5629507", "0.56195736", "0.56159353", "0.55950093", "0.5587989", "0.5581313", "0.55789304", "0.55730546", "0.5565715", "0.55518574", "0.5551509", "0.55513984", "0.5546331", "0.5545358", "0.55407405", "0.5538446", "0.5532945", "0.5517467", "0.5517387", "0.55160433", "0.54950833", "0.54919606", "0.5490329", "0.5463626", "0.54628044", "0.5459049", "0.54582554", "0.5457643", "0.54540366", "0.54488665" ]
0.72359097
2
Determines a random location inside the cuboid that is suitable for mob spawning and returns it.
public Location getRandomLocationForMobs() { final Location temp = getRandomLocation(); return new Location(temp.getWorld(), temp.getBlockX() + 0.5, temp.getBlockY() + 0.5, temp.getBlockZ() + 0.5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}", "public Location getRandomLocationForPlayers() {\n\t\tfinal Location temp = getRandomLocationForMobs();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX(), temp.getBlockY() + 1, temp.getBlockZ());\n\t}", "public static Location genRandomSpawn() {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, 0, z));\n }", "public Point randomLocation() {\r\n\t\tRandom rand = new Random();\r\n\t\treturn new Point(this.location.getPosition().getX()+ rand.nextInt() % location.getSize().getHeight(),this.location.getPosition().getY()+ rand.nextInt() % location.getSize().getWidth());\r\n\t}", "private Vector3 randomLocationMonster() {\n\t\t\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 1.5f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) > 380f);\n\t\treturn randomPosition;\n\t}", "public Location getRandomLocation() {\n\t\tfinal Random randomGenerator = new Random();\n\n\t\tLocation result = new Location(getWorld(), highPoint.getBlockX(), highPoint.getBlockY(), highPoint.getBlockZ());\n\t\t\n\t\tif (getSize() > 1) {\n\t\t\tfinal double randomX = lowPoint.getBlockX() + randomGenerator.nextInt(getXSize());\n\t\t\tfinal double randomY = lowPoint.getBlockY() + randomGenerator.nextInt(getYSize());\n\t\t\tfinal double randomZ = lowPoint.getBlockZ() + randomGenerator.nextInt(getZSize());\n\t\t\t\n\t\t\tresult = new Location(Bukkit.getWorld(world), randomX, randomY, randomZ);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private Vector3 randomLocationDolphin() {\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 0.0f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) < 420f);\n\t\treturn randomPosition;\n\t}", "public Position randposition()\r\n\t{\n\t\tRandom random = new Random();\r\n\t\tPosition position = new Position(random.nextInt(7680), random.nextInt(4320), random.nextDouble());\r\n\t\treturn position;\r\n\t}", "private static Position fetchRandomPosition(){\n return new Position(0,0).returnRandomPosition();\n }", "private Location generateRandomStartLocation() {\n\t\tif (!atLeastOneNonWallLocation()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"There is no free tile available for the player to be placed\");\n\t\t}\n\n\t\twhile (true) {\n\t\t\t// Generate a random location\n\t\t\tfinal Random random = new Random();\n\t\t\tfinal int randomRow = random.nextInt(this.map.getMapHeight());\n\t\t\tfinal int randomCol = random.nextInt(this.map.getMapWidth());\n\n\t\t\tfinal Location location = new Location(randomCol, randomRow);\n\n\t\t\tif (this.map.getMapCell(location).isWalkable()\n\t\t\t\t\t&& !otherPlayerOnTile(location, -1)) {\n\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t}", "public Location randomSpawn(Match m) {\r\n\t\treturn randomSpawn(teamName.ALONE, m);\r\n\t}", "public Point getLocation(){\n\t\tint x = widgetchild.getAbsoluteX();\n\t\tint y = widgetchild.getAbsoluteY();\n\t\tint rx = Random.nextInt(0, widgetchild.getWidth());\n\t\tint ry = Random.nextInt(0, widgetchild.getHeight());\n\t\treturn new Point(x+rx,y+ry);\n\t}", "public Coordinate generatePosition() {\n Random rng = new Random();\n return new Coordinate(rng.nextFloat(), rng.nextFloat());\n }", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "public static Location genRandomSpawn(int y) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "private static void spawnAtRandomLocation(World world, GameObject gameObject) {\n spawnAtRandomLocation(world, gameObject, 0.5);\n }", "public Location getSpawnLocation() {\n return this.spawnLocation;\n }", "private GameWorld.Position randomAvatarPosition(GameWorld world) {\n int xVal = world.getRand().nextInt(world.WIDTH - 1);\n int yVal = world.getRand().nextInt(world.HEIGHT - 1);\n if (world.getNumOfSq() > 0) {\n while (!(world.world[xVal][yVal].equals(Tileset.FLOOR))) {\n xVal = world.getRand().nextInt(world.WIDTH - 1);\n yVal = world.getRand().nextInt(world.HEIGHT - 1);\n }\n System.out.println(yVal);\n System.out.println(\"therethere\");\n world.avatarPosition = new GameWorld.Position(xVal, yVal);\n return world.avatarPosition;\n }\n return new GameWorld.Position(xVal, yVal);\n }", "public static Location getUniqueLocation(){\n int randomIndex = randomNumber(femaleNames.getNames().length);\n return locations.getLocations()[randomIndex];\n }", "private static void spawnAtRandomLocation(World world, GameObject gameObject, double radius) {\n Location location = new Location();\n gameObject.setLocation(location);\n boolean found = false;\n while (!found) {\n double x = Math.random() * (world.mNortheast.getX() - world.mSouthwest.getX());\n double y = Math.random() * (world.mNortheast.getY() - world.mSouthwest.getY());\n location.setX(x);\n location.setY(y);\n found = !world.collides(gameObject, radius);\n }\n world.registerGameObject(gameObject);\n Main.logger.log(Logger.VERBOSE, \"Spawning \" + gameObject + \" @ \" + gameObject.getLocation());\n }", "public static Point pos(){\r\n\t\tRandom random = new Random();\r\n\t\tint x = 0;\r\n\t\tint y = 0;\r\n\t\t//acts as a 4 sided coin flip\r\n\t\t//this is to decide which side the asteroid will appear\r\n\t\tint pos = random.nextInt(4);\r\n\t\t//west\r\n\t\tif(pos == 0){\r\n\t\t\tx = 0;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//north\r\n\t\telse if(pos == 1){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 0;\r\n\t\t}\r\n\t\t//east\r\n\t\telse if(pos == 2){\r\n\t\t\tx = 800;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//\r\n\t\telse if(pos == 3){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 600;\r\n\t\t}\r\n\t\tPoint p = new Point(x,y);\r\n\t\treturn p;\r\n\t}", "public static int weaponSpawnLocation(int cellCount)\r\n\t{\r\n\t\tRandom rng = new Random ();\t\r\n\t\treturn rng.nextInt(cellCount);\r\n\t}", "public Position sampleRandomUniformPosition();", "public Location getRandomLocation(ArenaWorld world, ArenaAnimal animal, List<Location> locations) {\n int HIGH = locations.size();\n int randomIndex = 0;\n Random randomize = new Random();\n if (HIGH > 0) {\n randomIndex = randomize.nextInt(HIGH);\n return locations.get(randomIndex);\n }\n return animal.getLocation();\n }", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "private PointF getRandCoordinate() {\n Random r = new Random();\n float xRand = (r.nextInt(getWidth()) / density) + 1;\n float y = 10 / density;\n\n return new PointF(xRand, y);\n }", "public Location mainSpawn(){\r\n\t\treturn mainSpawn;\r\n\t}", "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}", "private RandomLocationGen() {}", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\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 ImmutableSimpleLocation getSpawn() {\n return spawn;\n }", "public Point randomPoint() \t // creates a random point for gameOjbects to be placed into\r\n\t{\n\t\tint x = rand.nextInt(900);\r\n\t\tx = x + 50;\r\n\t\tint y = rand.nextInt(900);\r\n\t\ty = y + 50;\r\n\t\tPoint p = new Point(x, y);\r\n\t\treturn p;\r\n\t}", "private Vector3f getPlanetPosition() {\r\n\t\tVector3f position = new Vector3f();\r\n\t\tdouble theta = Math.random() * 2 * Math.PI;\r\n\t\tdouble r = MathUtils.randRange(MIN_ORBITAL_RADIUS, MAX_ORBITAL_RADIUS);\r\n\t\tposition.x = (float) (r * Math.cos(theta));\r\n\t\tposition.z = (float) (r * Math.sin(theta));\r\n\t\t// Introduce y variation\r\n\t\tposition.y = (float) MathUtils.randRange(MIN_PLANET_Y, MAX_PLANET_Y);\r\n\t\treturn position;\r\n\t}", "public Point2D getRandomNodeLocation() {\n int validNum = 0;\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n validNum++;\n }\n }\n int randomIndex = RandomEnhanced.randInt(0,validNum-1);\n\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n if (randomIndex==0) return ((NavNode)graphNode).getPosition();\n randomIndex--;\n }\n }\n return null;\n }", "public Location computerMove()\n\t{\n\t\tArrayList<Location> possibleLocs = new ArrayList<Location>();\n\t\tfor (int row = 0; row < grid.length; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < grid[0].length; col++)\n\t\t\t{\n\t\t\t\tLocation temp = new Location(row, col);\n\t\t\t\tif (!isOccupied(temp))\n\t\t\t\t\tpossibleLocs.add(temp);\n\t\t\t}\n\t\t}\n\t\tfor (int count = 0; count < possibleLocs.size(); count++)\n\t\t{\n\t\t\tif (checkWin(1, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t\telse if (checkWin(0, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t}\n\t\treturn possibleLocs.get((int) (Math.random() * possibleLocs.size()));\n\t}", "public static Location genRandomSpawn(int y, int width) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = width / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "public static int randomPosition(){\r\n int max = 4;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n int pos = randNum;\r\n \r\n return pos;\r\n }", "private static ResourceLocation getRandomMonster(Random rand)\n\t{\n\t\tRandomCollection<ResourceLocation> monsters = new RandomCollection<ResourceLocation>();\n\t\t\n\t\tmonsters.add(10, EntityList.getKey(EntityZombie.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySkeleton.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySpider.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityGhost.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityBarbarian.class));\n\t\t//monsters.add(4, EntityList.getKey(EntityBandit.class));\n\t\tmonsters.add(3, EntityList.getKey(EntityBanshee.class));\n\t\tmonsters.add(1, EntityList.getKey(EntityGolem.class));\n\t\t\n\t\treturn monsters.next(rand);\n\t}", "private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }", "public int hideBomb() {\r\n\r\n\t\tint randomLocation = (int) Math.floor(Math.random() * 9);\r\n\t\trandomLocation = Math.round(randomLocation);\r\n\r\n\t\treturn randomLocation; \r\n\r\n\t}", "public void generateRandomPosition(Zone samusZone) {\n\t\t\n\t\tint i = samusZone.getI(), j = samusZone.getJ();\n\t\twhile(i == samusZone.getI() && j == samusZone.getJ()) {\n\t\t\ti = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t\tj = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t}\n\t\t\n\t\tsamusZone.getSamus().setI(i);\n\t\tsamusZone.getSamus().setJ(j);\n\t}", "void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }", "public Location getBedSpawnLocation ( ) {\n\t\treturn extract ( handle -> handle.getBedSpawnLocation ( ) );\n\t}", "public Point getSpawn() {\n\t\treturn spawn;\n\t}", "public Location getRandomMoveLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingFourLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "private void locate() {\n possibleLocations[0][0] = false;\n possibleLocations[0][1] = false;\n possibleLocations[1][0] = false;\n do {\n location.randomGenerate();\n } while (!possibleLocations[location.y][location.x]);\n }", "private void generateRandomPosition() {\r\n int indexX, indexY;\r\n boolean collidesWithPlayers;\r\n playerState.position.x = Integer.MIN_VALUE; // While we trying...\r\n playerState.position.y = Integer.MIN_VALUE;\r\n final ExtensiveMovingObject testObject = new ExtensiveMovingObject( 0.0f, 0.0f, 0.0f, 0.0f, GeneralConsts.WORM_WIDTH, GeneralConsts.WORM_HEIGHT );\r\n int positionGenerationTrialFailureCounter = 0;\r\n do {\r\n do {\r\n indexX = 1 + (int) ( Math.random() * ( map.getWidth () - 1 ) );\r\n indexY = 1 + (int) ( Math.random() * ( map.getHeight() - 1 ) );\r\n if ( positionGenerationTrialFailureCounter++ == MAX_POSITION_GENERATION_TRIAL_FAILURE_COUNT )\r\n if ( map.getWall( indexX, indexY ) == Map.WALL_STONE )\r\n map.setWall( indexX, indexY, Map.WALL_BRICK ); // Not to empty: it can be under water!!\r\n } while( map.getWall( indexX, indexY ) == Map.WALL_STONE ); // Stone can't be cleared: it can be part of swimming pool boundaries. (But if there isn't other places where to start, we clear it!)\r\n testObject.position.x = ( indexX << GeneralConsts.WALL_WIDTH_SHIFT ) + GeneralConsts.WALL_WIDTH / 2;\r\n testObject.position.y = ( indexY << GeneralConsts.WALL_HEIGHT_SHIFT ) + GeneralConsts.WALL_HEIGHT / 2;\r\n collidesWithPlayers = false;\r\n for ( int playerIndex = 0; playerIndex < players.length && !collidesWithPlayers; playerIndex++ )\r\n if ( playerIndex != ownIndex && players[ playerIndex ] != null && testObject.hitsExtensiveObject( players[ playerIndex ].playerState ) )\r\n collidesWithPlayers = true;\r\n try {\r\n Thread.sleep( 0, 100 );\r\n }\r\n catch( InterruptedException ie ) {\r\n }\r\n } while ( collidesWithPlayers );\r\n playerState.position.x = testObject.position.x;\r\n playerState.position.y = testObject.position.y;\r\n map.clearMapForEnteringPlayer( indexX, indexY );\r\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public City randomlyAssignCity()\n {\n int cityReferenceNumber = (int)(Math.random()*(getContainerSize() - 1)) + 1;\n City randomCity = cityContainer.get(cityReferenceNumber);\n \n return randomCity;\n }", "private void spawnRandomAsteroid() {\n\t\tRandom r = new Random();\n\n\t\t// The size of the asteroid is randomised.\n\t\tdouble size = r. nextDouble() * (AsteroidsAsteroid.maximumSize - AsteroidsAsteroid.minimumSize) + AsteroidsAsteroid.minimumSize;\n\n\t\t// The spawn distance is a fair distance away from the action.\n\t\tfinal double spawnDistance = cameraZoom * 2 + size;\n\n\t\t// Same with its velocity magnitude.\n\t\tdouble decidedVelocity = r.nextDouble() * (AsteroidsAsteroid.maximumVelocity - AsteroidsAsteroid.minimumVelocity) + AsteroidsAsteroid.minimumVelocity;\n\n\t\t// And the angle.\n\t\tdouble decidedAngle = r.nextDouble() * 360 - 180;\n\n\t\t// The velocity is then converted to a Vector3.\n\t\tVector3 velocity = new Vector3(decidedVelocity * -Math.sin(Math.toRadians(decidedAngle)), decidedVelocity * Math.cos(Math.toRadians(decidedAngle)));\n\n\t\t// Then we pick a random point on the screen.\n\t\tVector3 randomPoint = new Vector3(r.nextDouble() * 2 * cameraZoom - cameraZoom, r.nextDouble() * 2 * cameraZoom - cameraZoom);\n\n\t\t// We then set the asteroid's starting position as that spawn distance away from the point\n\t\t// in the reverse direction to its velocity.\n\t\tVector3 startingPosition = randomPoint.add(new Vector3(spawnDistance * Math.sin(Math.toDegrees(-decidedAngle)), spawnDistance * -Math.cos(Math.toDegrees(-decidedAngle))));\n\n\t\t// Then we just create the asteroid.\n\t\tAsteroidsAsteroid asteroid = new AsteroidsAsteroid(GameObject.ROOT, this, size, velocity);\n\t\tasteroid.translate(startingPosition);\n\t\tasteroids.add(asteroid);\n\n\t}", "private void locateApple() {\n xApplePosition = random.nextInt(32);\n yApplePosition = random.nextInt(21);\n }", "private Point randomIndex() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val1 = rand.nextInt(rows_size);\r\n\t\tint val2 = rand.nextInt(columns_size);\r\n\t\twhile (!isEmpty(val1,val2)) {\r\n\t\t\tval1 = rand.nextInt(rows_size);\r\n\t\t\tval2 = rand.nextInt(columns_size);\r\n\t\t}\r\n\t\treturn new Point(val1,val2);\r\n\t}", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public BoardCell pickLocation(Set<BoardCell> targets){\n\t\tfor (BoardCell i: targets)\r\n\t\t\tif (i.isRoom() && !(((RoomCell) i).getInitial() == lastRoomVisited))\r\n\t\t\t\treturn i;\r\n\t\t//\tpick random cell\r\n\t\tObject[] cell = targets.toArray();\r\n\t\tRandom generator = new Random();\r\n\t\tint random = generator.nextInt(cell.length);\r\n\t\treturn (BoardCell) cell[random];\r\n\t}", "public static Location newIntance() {\n\t\treturn new Location(null, \"mock model: \" + ((int) (1000 * Math.random())));\n\t}", "public String getSpawnLocationString(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tList<Location> locs = getSpawns();\n\t\tfor (int i=0;i<locs.size(); i++ ){\n\t\t\tif (locs.get(i) != null) sb.append(\"[\").append(i + 1).append(\":\").\n append(Util.getLocString(locs.get(i))).append(\"] \");\n\t\t}\n\t\treturn sb.toString();\n\t}", "public Location getRandomBreedingLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingEightLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "public Location selectMoveLocation(ArrayList<Location> locs)\n {\n int n = locs.size();\n if (n == 0)\n return getLocation();\n int r = (int) (Math.random() * n);\n return locs.get(r);\n }", "public Location randomSpawn(teamName team, Match m) {\r\n\t\tdouble distance = 0;\r\n\t\tint index = 0;\r\n\t\tboolean edited = false;\r\n\t\t\r\n\t\tfinal HashMap<String, teamName> players = new HashMap<String, teamName>(m.getPlayers());\r\n\t\tif (players.size()> 1){\r\n\t\t\tfor (Location spawn : spawnsList){\r\n\t\t\t\t\r\n\t\t\t\t//closest player to location\r\n\t\t\t\tdouble pDistance = 999;\r\n\t\t\t\tfor (String name : players.keySet()){\r\n\t\t\t\t\tif (players.get(name) != team || team.equals(teamName.ALONE)){\r\n\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name) != null){\r\n\t\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name).getLocation().getWorld().toString().equals(spawn.getWorld().toString())){\r\n\t\t\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name).getLocation().distance(spawn) < pDistance){\r\n\t\t\t\t\t\t\t\t\tpDistance = Bukkit.getServer().getPlayer(name).getLocation().distance(spawn);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (pDistance < 999 && pDistance > distance){\r\n\t\t\t\t\t//is edited? < 999, is not closer then 10 blocks?\r\n\t\t\t\t\t//the closest player is further away then the old distance\r\n\t\t\t\t\tdistance = pDistance;\r\n\t\t\t\t\tindex = spawnsList.indexOf(spawn);\r\n\t\t\t\t\tedited = true;\r\n\t\t\t\t}\r\n\t\t\t\t//TODO make it check for a location near teammates\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tindex = new Random().nextInt(spawnsList.size());\r\n\t\t}\r\n\t\t\r\n\t\tif (!edited){\r\n\t\t\t\r\n\t\t}\r\n\t\treturn spawnsList.get(index);\r\n\t}", "@Override\r\n\tpublic void spawn(Location location) {\n\t\t\r\n\t}", "public Room getRandomRoom(){\n return (Room)rooms.get(random.nextInt(rooms.size()));\n }", "public Location alliesSpawn(){\r\n\t\treturn alliesSpawn;\r\n\t}", "public void spawnNpcOnChance(Location location) {\r\n\t\t\tif(location.isOutdoors() && Math.random() < 0.20) {\r\n\t\t\t\tthis.spawnEnemy(location);\r\n\t\t\t}\r\n\t\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public void setRandomSpawn(final Random random)\r\n {\r\n final List<Double> rows = new ArrayList<>();\r\n \r\n final double column;\r\n \r\n //get a random true/false result\r\n if (random.nextBoolean())\r\n {\r\n //here we will do west\r\n column = 0.5;\r\n }\r\n else\r\n {\r\n //here we will do east\r\n column = COLUMNS - 0.5;\r\n }\r\n \r\n for (double row=0; row < ROWS; row++)\r\n {\r\n //if platform exists add this as a possibility\r\n if (getObject(Type.Platform, (int)column, row) != null)\r\n rows.add(row);\r\n }\r\n \r\n super.setCol(column);\r\n \r\n final int index = random.nextInt(rows.size());\r\n super.setRow(rows.get(index) + 0.5);\r\n }", "public Cave getUnoccupiedOpenLocation() {\n\t\tCave tempCave = null;\n\t\tboolean tempBool = true;\n\t\twhile(tempBool) {\n\t\t\tdouble i = Math.random() * row;\n\t\t\tdouble j = Math.random() * columns;\n\t\t\t\ttempCave = caveArray[(int) i][(int) j];\n\t\t\t\tif((int)i == row-1 && (int)j == columns-1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (tempCave.isOccupied() == false && tempCave.isOpen())\n\t\t\t\t\treturn tempCave;\n\t\t\t}\n\t\t\n\t\treturn tempCave;\n\t\t\n\t}", "private android.location.Location getMockLocation() {\n android.location.Location newLocation = new android.location.Location(\"flp\");\n newLocation.setLatitude(110);\n newLocation.setLongitude(150);\n newLocation.setAccuracy(3.0f);\n newLocation.setTime(System.currentTimeMillis());\n newLocation.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());\n return newLocation;\n }", "private String randomCityId(RandomNumberGenerator random) {\n long targetPop = (long) (random.rand() * totalPopulation);\n\n for (Map.Entry<String, Long> city : populationByCityId.entrySet()) {\n targetPop -= city.getValue();\n\n if (targetPop < 0) {\n return city.getKey();\n }\n }\n\n // should never happen\n throw new RuntimeException(\"Unable to select a random city id.\");\n }", "Spawn(LatLngBounds bounds) {\n Random rand = new Random();\n double rangeNS = bounds.northeast.latitude - bounds.southwest.latitude;\n double rangeEW = bounds.northeast.longitude - bounds.southwest.longitude;\n position = new LatLng(rand.nextDouble() * rangeNS + bounds.southwest.latitude,\n rand.nextDouble() * rangeEW + bounds.southwest.longitude);\n Log.w(\"spawnpoint\", \"Placed at \" + position.toString());\n return;\n }", "public Location getRespawnLocation() {\r\n Location respawn = null;\r\n if (getId() >= 5533 && getId() <= 5538) {\r\n respawn = Location.create(2913, 5467, 0);\r\n } else if (getId() >= 5539 && getId() <= 5546) {\r\n respawn = Location.create(2916, 5473, 0);\r\n } else if (getId() >= 5547 && getId() <= 5552) {\r\n respawn = Location.create(2910, 5476, 0);\r\n } else if (getId() >= 5553 && getId() <= 5558) {\r\n respawn = Location.create(2907, 5470, 0);\r\n }\r\n return respawn;\r\n }", "public Room getRandomRoom() {\n random = new Random();\n Room portal = allrooms.get(random.nextInt(allrooms.size()-1));\n return portal;\n }", "private Point getUnsafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p \t\t= new Point();\n\t\t\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t// position isn't occupied\n\t\t\tif(!occupiedPositions.contains(p))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn p;\n\t}", "public PositionInTheGameBoard()\r\n\t{\r\n\t\tthis.X = new Random().nextInt(PositionInTheGameBoard.max_X);\r\n\t\tthis.Y = new Random().nextInt(PositionInTheGameBoard.max_Y);\r\n\t}", "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 }", "Vec3 getHomeCoords(IGeneticMob geneticMob);", "public Actor getLocation(Location currentLocation, GameMap map) {\n Map<Actor, Location> dinosaursList = new HashMap<>();\n dinosaursList = getAllActors(map);\n Location minimalLocation = null;\n\n for (Map.Entry<Actor, Location> spot: dinosaursList.entrySet()) {\n Actor actor = spot.getValue().getActor();\n int x = spot.getValue().x();\n int y = spot.getValue().y();\n Location there = map.at(x,y);\n if (actor instanceof Dinosaur) {\n if (currentLocation != there) {\n if (minimalLocation == null) {\n minimalLocation = there;\n } else if (super.distance(currentLocation, there) < super.distance(currentLocation, minimalLocation)) {\n minimalLocation = there;\n }\n }\n }\n }\n\n return map.getActorAt(minimalLocation);\n }", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "MapLocation getPosition(Unit unit);", "private static void spawn(Actor actor, ActorWorld world)\n {\n Random generator = new Random();\n int row = generator.nextInt(10);\n int col = generator.nextInt(10);\n Location loc = new Location(row, col);\n while(world.getGrid().get(loc) != null)\n {\n row = generator.nextInt(10);\n col = generator.nextInt(10);\n loc = new Location(row, col);\n }\n world.add(loc, actor);\n }", "public static Offset getRandomOffsetForRoom() {\n return new Offset(5 + Math.random() * 90, 5 + Math.random() * 90);\n }", "@Override\n\tpublic void spawn(Location loc) {\n\t\t\n\t}", "public Cell generatePosition(int r, int c) {\n\t\tdouble w = Math.random()*r+1;\r\n\t\tdouble q = Math.random()*c;\r\n\t\tint rows = (int) w;\r\n\t\tint b = (int) q;\r\n\t\tchar cols = (char) ('A' + b);\r\n\t\treturn recorrerMatrix(rows,cols,getFirst());\r\n\t}", "public int pickDoorSpot() {\n\t\tint doorSpot = ThreadLocalRandom.current().nextInt(1, ((getRoomWidth() * 2) + ((getRoomLength() - 1) * 2)));\r\n\t\treturn doorSpot;\r\n\t}", "private float randomiseLatitude(){\n return randomiseFloat(-90,90);\n }", "private static Coordinates getRandomCoordinates() {\n Random r = new Random();\n double upperLimit = 180;\n double lowerLimit = -180;\n double lon = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n double lat = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n return new Coordinates(lat, lon);\n }", "Location getPlayerLocation();", "public static Vec3 findRandomTargetBlockTowards(EntityCreature aWaterMob, int xzFleeZoneSize, int yFleeZoneSize, Vec3 aTargetVectorPos, int aMinRangeXZ, int aMinDepth)\r\n{\r\n\r\n Vec3 _fleeingVector = Vec3.createVectorHelper(aTargetVectorPos.xCoord - aWaterMob.posX,aTargetVectorPos.yCoord - aWaterMob.posY,aTargetVectorPos.zCoord - aWaterMob.posZ);\r\n return findRandomTargetBlock(aWaterMob, xzFleeZoneSize, yFleeZoneSize,_fleeingVector,aMinRangeXZ,aMinDepth);\r\n}", "public int getSpawnY()\n {\n return spawnY;\n }", "public static Point randomPoint() {\r\n\t\tString n = \"\" + (char) (65 + rand.nextInt(26));\r\n\t\tint x = rand.nextInt(11);\r\n\t\tint y = rand.nextInt(11);\r\n\t\treturn new Point(n, x, y);\r\n\t}", "boolean isGoodLocation(World world, int x, int y, int z);", "Point2i getFreeRandomPosition() {\n\t\tPoint2i p = new Point2i();\n\t\tint i = 0;\n\t\tint max = this.grid.getWidth() * this.grid.getHeight();\n\t\tdo {\n\t\t\tp.set(\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getWidth()),\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getHeight()));\n\t\t\t++i;\n\t\t}\n\t\twhile (!isFree(p.x(), p.y()) && i < max);\n\t\treturn (isFree(p.x(), p.y())) ? p : null;\n\t}", "public LocationPoint(){\n this.mLocationID = UUID.randomUUID();\n }", "private float randomiseLongitude(){\n return randomiseFloat(-180,180);\n }", "public static Location getLocation(boolean circle, boolean checkPlayers, int spawnAttempts, Location center, int range, int minRange, int heightRange, Location cacheLoc)\n \t{\n \t\t// Make sure the centers world is valid\n \t\tif (center.getWorld() == null)\n \t\t{\n \t\t\tP.p().getLogger().warning(\"Null world passed to location generator\");\n \t\t\treturn center;\n \t\t}\n \t\t\n \t\t// Make sure range is larger than minRange\n \t\tif (range < minRange)\n \t\t{\n \t\t\trange = range ^ minRange;\n \t\t\tminRange = range ^ minRange;\n \t\t\trange = range ^ minRange;\n \t\t}\n \t\t\n \t\t// Height range must be at least 1\n \t\tif (heightRange < 0)\n \t\t\theightRange = 1;\n \t\t\n \t\t// Make sure range is bigger than minRange\n \t\tif (range == minRange)\n \t\t\t++range;\n \n \t\t// Calculate the total (up/down) range of heightRange\n \t\tint heightRange2 = heightRange << 1;\n \t\t\n \t\t// Copy the world\n \t\tcacheLoc.setWorld(center.getWorld());\n \t\t\n \t\t// Make X attempts to find a safe spawning location\n \t\tfor (int i = 0; i < spawnAttempts; ++i)\n \t\t{\n \t\t\t// Generate the appropriate type of location\n \t\t\tif (circle)\n \t\t\t{\n \t\t\t\tgetCircularLocation(center, range, minRange, cacheLoc);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tgetSquareLocation(center, range, minRange, cacheLoc);\n \t\t\t}\n \t\t\t\n \t\t\t// Generate coordinates for Y\n \t\t\tcacheLoc.setY(RandomUtil.i.nextInt(heightRange2) - heightRange + center.getBlockY() + 0.5);\n \t\t\t\t\n \t\t\t// If the location is safe we can return the location\n \t\t\tif ((!checkPlayers || !PlayerFinder.playerNear(cacheLoc, minRange, heightRange)) && findSafeY(cacheLoc, center.getBlockY(), heightRange))\n \t\t\t{\n \t\t\t\t// Generate a random Yaw/Pitch\n \t\t\t\tcacheLoc.setYaw(RandomUtil.i.nextFloat() * 360.0F);\n\t\t\t\tcacheLoc.setPitch(0.0F);\n \t\t\t\treturn cacheLoc;\n \t\t\t}\n \t\t}\n \t\t\n \t\t// If no safe location was found in a reasonable time frame just return the center\n \t\treturn center;\n \t}", "public void setSpawnLocation(Location spawnLocation) {\n this.spawnLocation = spawnLocation;\n }", "public synchronized int setDestinationFloor(){\n\t\tint randomFloor = random.nextInt((10-1)+1)+0;\n\t\twhile(this.arrivalFloor == randomFloor){\n\t\t\trandomFloor = random.nextInt((10-1)+1)+0;\n\t\t}\n\t\t\n\t\treturn randomFloor; \n\t}", "public Point getRobotLocation();" ]
[ "0.79494494", "0.7810956", "0.759639", "0.7595995", "0.758096", "0.75456774", "0.7232269", "0.71404904", "0.71388656", "0.6975363", "0.68839896", "0.6815535", "0.6740154", "0.6704786", "0.6679292", "0.6664731", "0.66633797", "0.6649373", "0.66139597", "0.65966314", "0.6572903", "0.6530024", "0.64984846", "0.64526397", "0.64259005", "0.6411246", "0.64054364", "0.6388469", "0.6306549", "0.63042694", "0.63040936", "0.62997514", "0.6261202", "0.6256843", "0.6256025", "0.6253474", "0.62531227", "0.62344843", "0.62303513", "0.6216503", "0.62152976", "0.6173764", "0.61619157", "0.6113642", "0.6108607", "0.6102873", "0.6089013", "0.606577", "0.60269004", "0.5994624", "0.59939945", "0.59930027", "0.599287", "0.59875584", "0.59743845", "0.59733945", "0.596794", "0.5967431", "0.59603626", "0.5957945", "0.5951668", "0.5941693", "0.5938372", "0.59261197", "0.59252596", "0.5925028", "0.5921231", "0.5915955", "0.59068155", "0.5902226", "0.5901764", "0.5879459", "0.5877248", "0.587469", "0.5871967", "0.58575916", "0.5855976", "0.5849885", "0.5835591", "0.5822268", "0.5821858", "0.58161", "0.58150417", "0.58073443", "0.5802084", "0.5800115", "0.5798967", "0.57970154", "0.57904106", "0.57822204", "0.5751043", "0.5749455", "0.5743105", "0.573414", "0.5719132", "0.5718644", "0.5713253", "0.5713058", "0.5674061", "0.5673041" ]
0.8011004
0
Determines a random location inside the cuboid that is suitable for player spawning and returns it.
public Location getRandomLocationForPlayers() { final Location temp = getRandomLocationForMobs(); return new Location(temp.getWorld(), temp.getBlockX(), temp.getBlockY() + 1, temp.getBlockZ()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}", "public static Location genRandomSpawn() {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, 0, z));\n }", "public Point randomLocation() {\r\n\t\tRandom rand = new Random();\r\n\t\treturn new Point(this.location.getPosition().getX()+ rand.nextInt() % location.getSize().getHeight(),this.location.getPosition().getY()+ rand.nextInt() % location.getSize().getWidth());\r\n\t}", "public Location getRandomLocation() {\n\t\tfinal Random randomGenerator = new Random();\n\n\t\tLocation result = new Location(getWorld(), highPoint.getBlockX(), highPoint.getBlockY(), highPoint.getBlockZ());\n\t\t\n\t\tif (getSize() > 1) {\n\t\t\tfinal double randomX = lowPoint.getBlockX() + randomGenerator.nextInt(getXSize());\n\t\t\tfinal double randomY = lowPoint.getBlockY() + randomGenerator.nextInt(getYSize());\n\t\t\tfinal double randomZ = lowPoint.getBlockZ() + randomGenerator.nextInt(getZSize());\n\t\t\t\n\t\t\tresult = new Location(Bukkit.getWorld(world), randomX, randomY, randomZ);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public Location getRandomLocationForMobs() {\n\t\tfinal Location temp = getRandomLocation();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX() + 0.5, temp.getBlockY() + 0.5, temp.getBlockZ() + 0.5);\n\t}", "private Vector3 randomLocationDolphin() {\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 0.0f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) < 420f);\n\t\treturn randomPosition;\n\t}", "private Vector3 randomLocationMonster() {\n\t\t\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 1.5f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) > 380f);\n\t\treturn randomPosition;\n\t}", "public Position randposition()\r\n\t{\n\t\tRandom random = new Random();\r\n\t\tPosition position = new Position(random.nextInt(7680), random.nextInt(4320), random.nextDouble());\r\n\t\treturn position;\r\n\t}", "private Location generateRandomStartLocation() {\n\t\tif (!atLeastOneNonWallLocation()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"There is no free tile available for the player to be placed\");\n\t\t}\n\n\t\twhile (true) {\n\t\t\t// Generate a random location\n\t\t\tfinal Random random = new Random();\n\t\t\tfinal int randomRow = random.nextInt(this.map.getMapHeight());\n\t\t\tfinal int randomCol = random.nextInt(this.map.getMapWidth());\n\n\t\t\tfinal Location location = new Location(randomCol, randomRow);\n\n\t\t\tif (this.map.getMapCell(location).isWalkable()\n\t\t\t\t\t&& !otherPlayerOnTile(location, -1)) {\n\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t}", "private static Position fetchRandomPosition(){\n return new Position(0,0).returnRandomPosition();\n }", "public static Point pos(){\r\n\t\tRandom random = new Random();\r\n\t\tint x = 0;\r\n\t\tint y = 0;\r\n\t\t//acts as a 4 sided coin flip\r\n\t\t//this is to decide which side the asteroid will appear\r\n\t\tint pos = random.nextInt(4);\r\n\t\t//west\r\n\t\tif(pos == 0){\r\n\t\t\tx = 0;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//north\r\n\t\telse if(pos == 1){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 0;\r\n\t\t}\r\n\t\t//east\r\n\t\telse if(pos == 2){\r\n\t\t\tx = 800;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//\r\n\t\telse if(pos == 3){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 600;\r\n\t\t}\r\n\t\tPoint p = new Point(x,y);\r\n\t\treturn p;\r\n\t}", "public Point getLocation(){\n\t\tint x = widgetchild.getAbsoluteX();\n\t\tint y = widgetchild.getAbsoluteY();\n\t\tint rx = Random.nextInt(0, widgetchild.getWidth());\n\t\tint ry = Random.nextInt(0, widgetchild.getHeight());\n\t\treturn new Point(x+rx,y+ry);\n\t}", "public Location randomSpawn(Match m) {\r\n\t\treturn randomSpawn(teamName.ALONE, m);\r\n\t}", "public static Location genRandomSpawn(int y) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "public Coordinate generatePosition() {\n Random rng = new Random();\n return new Coordinate(rng.nextFloat(), rng.nextFloat());\n }", "private GameWorld.Position randomAvatarPosition(GameWorld world) {\n int xVal = world.getRand().nextInt(world.WIDTH - 1);\n int yVal = world.getRand().nextInt(world.HEIGHT - 1);\n if (world.getNumOfSq() > 0) {\n while (!(world.world[xVal][yVal].equals(Tileset.FLOOR))) {\n xVal = world.getRand().nextInt(world.WIDTH - 1);\n yVal = world.getRand().nextInt(world.HEIGHT - 1);\n }\n System.out.println(yVal);\n System.out.println(\"therethere\");\n world.avatarPosition = new GameWorld.Position(xVal, yVal);\n return world.avatarPosition;\n }\n return new GameWorld.Position(xVal, yVal);\n }", "public Location getSpawnLocation() {\n return this.spawnLocation;\n }", "private static void spawnAtRandomLocation(World world, GameObject gameObject, double radius) {\n Location location = new Location();\n gameObject.setLocation(location);\n boolean found = false;\n while (!found) {\n double x = Math.random() * (world.mNortheast.getX() - world.mSouthwest.getX());\n double y = Math.random() * (world.mNortheast.getY() - world.mSouthwest.getY());\n location.setX(x);\n location.setY(y);\n found = !world.collides(gameObject, radius);\n }\n world.registerGameObject(gameObject);\n Main.logger.log(Logger.VERBOSE, \"Spawning \" + gameObject + \" @ \" + gameObject.getLocation());\n }", "private static void spawnAtRandomLocation(World world, GameObject gameObject) {\n spawnAtRandomLocation(world, gameObject, 0.5);\n }", "public Point randomPoint() \t // creates a random point for gameOjbects to be placed into\r\n\t{\n\t\tint x = rand.nextInt(900);\r\n\t\tx = x + 50;\r\n\t\tint y = rand.nextInt(900);\r\n\t\ty = y + 50;\r\n\t\tPoint p = new Point(x, y);\r\n\t\treturn p;\r\n\t}", "private Vector3f getPlanetPosition() {\r\n\t\tVector3f position = new Vector3f();\r\n\t\tdouble theta = Math.random() * 2 * Math.PI;\r\n\t\tdouble r = MathUtils.randRange(MIN_ORBITAL_RADIUS, MAX_ORBITAL_RADIUS);\r\n\t\tposition.x = (float) (r * Math.cos(theta));\r\n\t\tposition.z = (float) (r * Math.sin(theta));\r\n\t\t// Introduce y variation\r\n\t\tposition.y = (float) MathUtils.randRange(MIN_PLANET_Y, MAX_PLANET_Y);\r\n\t\treturn position;\r\n\t}", "private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\n }", "public static int weaponSpawnLocation(int cellCount)\r\n\t{\r\n\t\tRandom rng = new Random ();\t\r\n\t\treturn rng.nextInt(cellCount);\r\n\t}", "public static Location getUniqueLocation(){\n int randomIndex = randomNumber(femaleNames.getNames().length);\n return locations.getLocations()[randomIndex];\n }", "public Position sampleRandomUniformPosition();", "public Location computerMove()\n\t{\n\t\tArrayList<Location> possibleLocs = new ArrayList<Location>();\n\t\tfor (int row = 0; row < grid.length; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < grid[0].length; col++)\n\t\t\t{\n\t\t\t\tLocation temp = new Location(row, col);\n\t\t\t\tif (!isOccupied(temp))\n\t\t\t\t\tpossibleLocs.add(temp);\n\t\t\t}\n\t\t}\n\t\tfor (int count = 0; count < possibleLocs.size(); count++)\n\t\t{\n\t\t\tif (checkWin(1, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t\telse if (checkWin(0, possibleLocs.get(count)))\n\t\t\t\treturn possibleLocs.get(count);\n\t\t}\n\t\treturn possibleLocs.get((int) (Math.random() * possibleLocs.size()));\n\t}", "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}", "private PointF getRandCoordinate() {\n Random r = new Random();\n float xRand = (r.nextInt(getWidth()) / density) + 1;\n float y = 10 / density;\n\n return new PointF(xRand, y);\n }", "public static Location genRandomSpawn(int y, int width) {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = width / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, y, z));\n }", "public Location mainSpawn(){\r\n\t\treturn mainSpawn;\r\n\t}", "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 static int randomPosition(){\r\n int max = 4;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n int pos = randNum;\r\n \r\n return pos;\r\n }", "Location getPlayerLocation();", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "public Point2D getRandomNodeLocation() {\n int validNum = 0;\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n validNum++;\n }\n }\n int randomIndex = RandomEnhanced.randInt(0,validNum-1);\n\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n if (randomIndex==0) return ((NavNode)graphNode).getPosition();\n randomIndex--;\n }\n }\n return null;\n }", "public ImmutableSimpleLocation getSpawn() {\n return spawn;\n }", "public void generateRandomPosition(Zone samusZone) {\n\t\t\n\t\tint i = samusZone.getI(), j = samusZone.getJ();\n\t\twhile(i == samusZone.getI() && j == samusZone.getJ()) {\n\t\t\ti = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t\tj = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t}\n\t\t\n\t\tsamusZone.getSamus().setI(i);\n\t\tsamusZone.getSamus().setJ(j);\n\t}", "public Location randomSpawn(teamName team, Match m) {\r\n\t\tdouble distance = 0;\r\n\t\tint index = 0;\r\n\t\tboolean edited = false;\r\n\t\t\r\n\t\tfinal HashMap<String, teamName> players = new HashMap<String, teamName>(m.getPlayers());\r\n\t\tif (players.size()> 1){\r\n\t\t\tfor (Location spawn : spawnsList){\r\n\t\t\t\t\r\n\t\t\t\t//closest player to location\r\n\t\t\t\tdouble pDistance = 999;\r\n\t\t\t\tfor (String name : players.keySet()){\r\n\t\t\t\t\tif (players.get(name) != team || team.equals(teamName.ALONE)){\r\n\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name) != null){\r\n\t\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name).getLocation().getWorld().toString().equals(spawn.getWorld().toString())){\r\n\t\t\t\t\t\t\t\tif (Bukkit.getServer().getPlayer(name).getLocation().distance(spawn) < pDistance){\r\n\t\t\t\t\t\t\t\t\tpDistance = Bukkit.getServer().getPlayer(name).getLocation().distance(spawn);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (pDistance < 999 && pDistance > distance){\r\n\t\t\t\t\t//is edited? < 999, is not closer then 10 blocks?\r\n\t\t\t\t\t//the closest player is further away then the old distance\r\n\t\t\t\t\tdistance = pDistance;\r\n\t\t\t\t\tindex = spawnsList.indexOf(spawn);\r\n\t\t\t\t\tedited = true;\r\n\t\t\t\t}\r\n\t\t\t\t//TODO make it check for a location near teammates\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tindex = new Random().nextInt(spawnsList.size());\r\n\t\t}\r\n\t\t\r\n\t\tif (!edited){\r\n\t\t\t\r\n\t\t}\r\n\t\treturn spawnsList.get(index);\r\n\t}", "private void generateRandomPosition() {\r\n int indexX, indexY;\r\n boolean collidesWithPlayers;\r\n playerState.position.x = Integer.MIN_VALUE; // While we trying...\r\n playerState.position.y = Integer.MIN_VALUE;\r\n final ExtensiveMovingObject testObject = new ExtensiveMovingObject( 0.0f, 0.0f, 0.0f, 0.0f, GeneralConsts.WORM_WIDTH, GeneralConsts.WORM_HEIGHT );\r\n int positionGenerationTrialFailureCounter = 0;\r\n do {\r\n do {\r\n indexX = 1 + (int) ( Math.random() * ( map.getWidth () - 1 ) );\r\n indexY = 1 + (int) ( Math.random() * ( map.getHeight() - 1 ) );\r\n if ( positionGenerationTrialFailureCounter++ == MAX_POSITION_GENERATION_TRIAL_FAILURE_COUNT )\r\n if ( map.getWall( indexX, indexY ) == Map.WALL_STONE )\r\n map.setWall( indexX, indexY, Map.WALL_BRICK ); // Not to empty: it can be under water!!\r\n } while( map.getWall( indexX, indexY ) == Map.WALL_STONE ); // Stone can't be cleared: it can be part of swimming pool boundaries. (But if there isn't other places where to start, we clear it!)\r\n testObject.position.x = ( indexX << GeneralConsts.WALL_WIDTH_SHIFT ) + GeneralConsts.WALL_WIDTH / 2;\r\n testObject.position.y = ( indexY << GeneralConsts.WALL_HEIGHT_SHIFT ) + GeneralConsts.WALL_HEIGHT / 2;\r\n collidesWithPlayers = false;\r\n for ( int playerIndex = 0; playerIndex < players.length && !collidesWithPlayers; playerIndex++ )\r\n if ( playerIndex != ownIndex && players[ playerIndex ] != null && testObject.hitsExtensiveObject( players[ playerIndex ].playerState ) )\r\n collidesWithPlayers = true;\r\n try {\r\n Thread.sleep( 0, 100 );\r\n }\r\n catch( InterruptedException ie ) {\r\n }\r\n } while ( collidesWithPlayers );\r\n playerState.position.x = testObject.position.x;\r\n playerState.position.y = testObject.position.y;\r\n map.clearMapForEnteringPlayer( indexX, indexY );\r\n }", "public Location getRandomLocation(ArenaWorld world, ArenaAnimal animal, List<Location> locations) {\n int HIGH = locations.size();\n int randomIndex = 0;\n Random randomize = new Random();\n if (HIGH > 0) {\n randomIndex = randomize.nextInt(HIGH);\n return locations.get(randomIndex);\n }\n return animal.getLocation();\n }", "public Point getSpawn() {\n\t\treturn spawn;\n\t}", "private Point randomIndex() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val1 = rand.nextInt(rows_size);\r\n\t\tint val2 = rand.nextInt(columns_size);\r\n\t\twhile (!isEmpty(val1,val2)) {\r\n\t\t\tval1 = rand.nextInt(rows_size);\r\n\t\t\tval2 = rand.nextInt(columns_size);\r\n\t\t}\r\n\t\treturn new Point(val1,val2);\r\n\t}", "private RandomLocationGen() {}", "public PositionInTheGameBoard()\r\n\t{\r\n\t\tthis.X = new Random().nextInt(PositionInTheGameBoard.max_X);\r\n\t\tthis.Y = new Random().nextInt(PositionInTheGameBoard.max_Y);\r\n\t}", "public static Location getLocation(boolean circle, boolean checkPlayers, int spawnAttempts, Location center, int range, int minRange, int heightRange, Location cacheLoc)\n \t{\n \t\t// Make sure the centers world is valid\n \t\tif (center.getWorld() == null)\n \t\t{\n \t\t\tP.p().getLogger().warning(\"Null world passed to location generator\");\n \t\t\treturn center;\n \t\t}\n \t\t\n \t\t// Make sure range is larger than minRange\n \t\tif (range < minRange)\n \t\t{\n \t\t\trange = range ^ minRange;\n \t\t\tminRange = range ^ minRange;\n \t\t\trange = range ^ minRange;\n \t\t}\n \t\t\n \t\t// Height range must be at least 1\n \t\tif (heightRange < 0)\n \t\t\theightRange = 1;\n \t\t\n \t\t// Make sure range is bigger than minRange\n \t\tif (range == minRange)\n \t\t\t++range;\n \n \t\t// Calculate the total (up/down) range of heightRange\n \t\tint heightRange2 = heightRange << 1;\n \t\t\n \t\t// Copy the world\n \t\tcacheLoc.setWorld(center.getWorld());\n \t\t\n \t\t// Make X attempts to find a safe spawning location\n \t\tfor (int i = 0; i < spawnAttempts; ++i)\n \t\t{\n \t\t\t// Generate the appropriate type of location\n \t\t\tif (circle)\n \t\t\t{\n \t\t\t\tgetCircularLocation(center, range, minRange, cacheLoc);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tgetSquareLocation(center, range, minRange, cacheLoc);\n \t\t\t}\n \t\t\t\n \t\t\t// Generate coordinates for Y\n \t\t\tcacheLoc.setY(RandomUtil.i.nextInt(heightRange2) - heightRange + center.getBlockY() + 0.5);\n \t\t\t\t\n \t\t\t// If the location is safe we can return the location\n \t\t\tif ((!checkPlayers || !PlayerFinder.playerNear(cacheLoc, minRange, heightRange)) && findSafeY(cacheLoc, center.getBlockY(), heightRange))\n \t\t\t{\n \t\t\t\t// Generate a random Yaw/Pitch\n \t\t\t\tcacheLoc.setYaw(RandomUtil.i.nextFloat() * 360.0F);\n\t\t\t\tcacheLoc.setPitch(0.0F);\n \t\t\t\treturn cacheLoc;\n \t\t\t}\n \t\t}\n \t\t\n \t\t// If no safe location was found in a reasonable time frame just return the center\n \t\treturn center;\n \t}", "Spawn(LatLngBounds bounds) {\n Random rand = new Random();\n double rangeNS = bounds.northeast.latitude - bounds.southwest.latitude;\n double rangeEW = bounds.northeast.longitude - bounds.southwest.longitude;\n position = new LatLng(rand.nextDouble() * rangeNS + bounds.southwest.latitude,\n rand.nextDouble() * rangeEW + bounds.southwest.longitude);\n Log.w(\"spawnpoint\", \"Placed at \" + position.toString());\n return;\n }", "private Point3D getRandomSolarPoint(final int radius)\n \t{\n \t\t// Might want to change the min/max values here\n \t\tPoint3D point = null;\n \t\twhile (point == null || isOccupied(point, radius)) {\n \t\t\tpoint = new Point3D(MathUtils.getRandomIntBetween(-500, 500), MathUtils.getRandomIntBetween(-500, 500),\n \t\t\t\t\tMathUtils.getRandomIntBetween(-500, 500));\n \t\t}\n \t\treturn point;\n \t}", "void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "boolean isGoodLocation(World world, int x, int y, int z);", "public Location getBedSpawnLocation ( ) {\n\t\treturn extract ( handle -> handle.getBedSpawnLocation ( ) );\n\t}", "public static Point randomPoint() {\r\n\t\tString n = \"\" + (char) (65 + rand.nextInt(26));\r\n\t\tint x = rand.nextInt(11);\r\n\t\tint y = rand.nextInt(11);\r\n\t\treturn new Point(n, x, y);\r\n\t}", "private void locate() {\n possibleLocations[0][0] = false;\n possibleLocations[0][1] = false;\n possibleLocations[1][0] = false;\n do {\n location.randomGenerate();\n } while (!possibleLocations[location.y][location.x]);\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public int hideBomb() {\r\n\r\n\t\tint randomLocation = (int) Math.floor(Math.random() * 9);\r\n\t\trandomLocation = Math.round(randomLocation);\r\n\r\n\t\treturn randomLocation; \r\n\r\n\t}", "public Location getRandomMoveLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingFourLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "public String getSpawnLocationString(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tList<Location> locs = getSpawns();\n\t\tfor (int i=0;i<locs.size(); i++ ){\n\t\t\tif (locs.get(i) != null) sb.append(\"[\").append(i + 1).append(\":\").\n append(Util.getLocString(locs.get(i))).append(\"] \");\n\t\t}\n\t\treturn sb.toString();\n\t}", "private void spawnRandomAsteroid() {\n\t\tRandom r = new Random();\n\n\t\t// The size of the asteroid is randomised.\n\t\tdouble size = r. nextDouble() * (AsteroidsAsteroid.maximumSize - AsteroidsAsteroid.minimumSize) + AsteroidsAsteroid.minimumSize;\n\n\t\t// The spawn distance is a fair distance away from the action.\n\t\tfinal double spawnDistance = cameraZoom * 2 + size;\n\n\t\t// Same with its velocity magnitude.\n\t\tdouble decidedVelocity = r.nextDouble() * (AsteroidsAsteroid.maximumVelocity - AsteroidsAsteroid.minimumVelocity) + AsteroidsAsteroid.minimumVelocity;\n\n\t\t// And the angle.\n\t\tdouble decidedAngle = r.nextDouble() * 360 - 180;\n\n\t\t// The velocity is then converted to a Vector3.\n\t\tVector3 velocity = new Vector3(decidedVelocity * -Math.sin(Math.toRadians(decidedAngle)), decidedVelocity * Math.cos(Math.toRadians(decidedAngle)));\n\n\t\t// Then we pick a random point on the screen.\n\t\tVector3 randomPoint = new Vector3(r.nextDouble() * 2 * cameraZoom - cameraZoom, r.nextDouble() * 2 * cameraZoom - cameraZoom);\n\n\t\t// We then set the asteroid's starting position as that spawn distance away from the point\n\t\t// in the reverse direction to its velocity.\n\t\tVector3 startingPosition = randomPoint.add(new Vector3(spawnDistance * Math.sin(Math.toDegrees(-decidedAngle)), spawnDistance * -Math.cos(Math.toDegrees(-decidedAngle))));\n\n\t\t// Then we just create the asteroid.\n\t\tAsteroidsAsteroid asteroid = new AsteroidsAsteroid(GameObject.ROOT, this, size, velocity);\n\t\tasteroid.translate(startingPosition);\n\t\tasteroids.add(asteroid);\n\n\t}", "private Point getUnsafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p \t\t= new Point();\n\t\t\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t// position isn't occupied\n\t\t\tif(!occupiedPositions.contains(p))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn p;\n\t}", "private void locateApple() {\n xApplePosition = random.nextInt(32);\n yApplePosition = random.nextInt(21);\n }", "private static ResourceLocation getRandomMonster(Random rand)\n\t{\n\t\tRandomCollection<ResourceLocation> monsters = new RandomCollection<ResourceLocation>();\n\t\t\n\t\tmonsters.add(10, EntityList.getKey(EntityZombie.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySkeleton.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySpider.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityGhost.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityBarbarian.class));\n\t\t//monsters.add(4, EntityList.getKey(EntityBandit.class));\n\t\tmonsters.add(3, EntityList.getKey(EntityBanshee.class));\n\t\tmonsters.add(1, EntityList.getKey(EntityGolem.class));\n\t\t\n\t\treturn monsters.next(rand);\n\t}", "public Location alliesSpawn(){\r\n\t\treturn alliesSpawn;\r\n\t}", "Point2i getFreeRandomPosition() {\n\t\tPoint2i p = new Point2i();\n\t\tint i = 0;\n\t\tint max = this.grid.getWidth() * this.grid.getHeight();\n\t\tdo {\n\t\t\tp.set(\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getWidth()),\n\t\t\t\t\tRandomNumber.nextInt(this.grid.getHeight()));\n\t\t\t++i;\n\t\t}\n\t\twhile (!isFree(p.x(), p.y()) && i < max);\n\t\treturn (isFree(p.x(), p.y())) ? p : null;\n\t}", "public City randomlyAssignCity()\n {\n int cityReferenceNumber = (int)(Math.random()*(getContainerSize() - 1)) + 1;\n City randomCity = cityContainer.get(cityReferenceNumber);\n \n return randomCity;\n }", "public Cave getUnoccupiedOpenLocation() {\n\t\tCave tempCave = null;\n\t\tboolean tempBool = true;\n\t\twhile(tempBool) {\n\t\t\tdouble i = Math.random() * row;\n\t\t\tdouble j = Math.random() * columns;\n\t\t\t\ttempCave = caveArray[(int) i][(int) j];\n\t\t\t\tif((int)i == row-1 && (int)j == columns-1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (tempCave.isOccupied() == false && tempCave.isOpen())\n\t\t\t\t\treturn tempCave;\n\t\t\t}\n\t\t\n\t\treturn tempCave;\n\t\t\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public Location getRespawnLocation() {\r\n Location respawn = null;\r\n if (getId() >= 5533 && getId() <= 5538) {\r\n respawn = Location.create(2913, 5467, 0);\r\n } else if (getId() >= 5539 && getId() <= 5546) {\r\n respawn = Location.create(2916, 5473, 0);\r\n } else if (getId() >= 5547 && getId() <= 5552) {\r\n respawn = Location.create(2910, 5476, 0);\r\n } else if (getId() >= 5553 && getId() <= 5558) {\r\n respawn = Location.create(2907, 5470, 0);\r\n }\r\n return respawn;\r\n }", "private static Coordinates getRandomCoordinates() {\n Random r = new Random();\n double upperLimit = 180;\n double lowerLimit = -180;\n double lon = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n double lat = r.nextDouble() * (upperLimit - lowerLimit) + lowerLimit;\n return new Coordinates(lat, lon);\n }", "public Point nextPoint() {\n\t\tRandom rand = new Random();\n\t\tint randomX = rand.nextInt(maxX);\n\t\tint randomY = rand.nextInt(maxY); \n\t\t\n\t\treturn new Point(randomX, randomY);\n\t}", "public int getSpawnY()\n {\n return spawnY;\n }", "public static Offset getRandomOffsetForRoom() {\n return new Offset(5 + Math.random() * 90, 5 + Math.random() * 90);\n }", "public void setRandomSpawn(final Random random)\r\n {\r\n final List<Double> rows = new ArrayList<>();\r\n \r\n final double column;\r\n \r\n //get a random true/false result\r\n if (random.nextBoolean())\r\n {\r\n //here we will do west\r\n column = 0.5;\r\n }\r\n else\r\n {\r\n //here we will do east\r\n column = COLUMNS - 0.5;\r\n }\r\n \r\n for (double row=0; row < ROWS; row++)\r\n {\r\n //if platform exists add this as a possibility\r\n if (getObject(Type.Platform, (int)column, row) != null)\r\n rows.add(row);\r\n }\r\n \r\n super.setCol(column);\r\n \r\n final int index = random.nextInt(rows.size());\r\n super.setRow(rows.get(index) + 0.5);\r\n }", "private float randomiseLatitude(){\n return randomiseFloat(-90,90);\n }", "public Location getRandomBreedingLocation(ArenaWorld world, ArenaAnimal animal) {\n List<Location> surroundingLocations = getSurroundingEightLocations(animal.getLocation());\n List<Location> validSurroundingLocations = getValidSurroundingLocations(world, animal, surroundingLocations);\n\n return getRandomLocation(world, animal, validSurroundingLocations);\n }", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public Location selectMoveLocation(ArrayList<Location> locs)\n {\n int n = locs.size();\n if (n == 0)\n return getLocation();\n int r = (int) (Math.random() * n);\n return locs.get(r);\n }", "public Cell generatePosition(int r, int c) {\n\t\tdouble w = Math.random()*r+1;\r\n\t\tdouble q = Math.random()*c;\r\n\t\tint rows = (int) w;\r\n\t\tint b = (int) q;\r\n\t\tchar cols = (char) ('A' + b);\r\n\t\treturn recorrerMatrix(rows,cols,getFirst());\r\n\t}", "public Room getRandomRoom(){\n return (Room)rooms.get(random.nextInt(rooms.size()));\n }", "private Location verifyLocation(Location location)\n {\n Block playerBlock = location.getBlock();\n World world = location.getWorld();\n\n if (rootC.getStringList(RootNode.WORLDS).contains(world.getName()))\n {\n // Only spawn monsters in normal world. End is crowded with endermen\n // and nether is too extreme anyway, add config later\n int lightLvl = location.getBlock().getLightFromSky();\n if (world.getEnvironment() == Environment.NORMAL\n && (location.getY() < rootC.getInt(RootNode.MORE_MONSTERS_MAX_Y) && lightLvl < 3))\n {\n // the playerBlock should always be air, but if the player stands\n // on a slab he actually is in the slab, checking a few blocks under because player could have jumped etc..\n if (playerBlock.getType().equals(Material.AIR))\n {\n for (int i = 0; i <= 3; i++)\n {\n playerBlock = location.getBlock().getRelative(BlockFace.DOWN, 1);\n\n if (playerBlock.getType().equals(Material.AIR))\n {\n location.subtract(0, 1, 0);\n playerBlock = location.getBlock();\n // the playerBlock is now the block where the monster\n // should spawn on, next up: verify block\n }\n else\n {\n break;\n }\n }\n }\n // no spawning on steps, stairs and transparent blocks\n if (playerBlock.getType().name().endsWith(\"STEP\") || playerBlock.getType().name().endsWith(\"STAIRS\")\n || playerBlock.getType().isTransparent() || !playerBlock.getType().isOccluding() || playerBlock.getType().equals(Material.AIR))\n {\n // don't spawn here\n return null;\n }\n\n if (quickVerify(location))\n return location;\n }\n\n }\n return null;\n }", "public Room getRandomRoom() {\n random = new Random();\n Room portal = allrooms.get(random.nextInt(allrooms.size()-1));\n return portal;\n }", "public void attemptSpawn(Player player) {\n\n int min = plugin.CONFIG.SPAWNING_RADIUS_MIN;\n int max = plugin.CONFIG.SPAWNING_RADIUS_MAX;\n\n // choose random x,z coordinates within the allowed radius range\n int distance = rand.nextInt((max - min) + 1) + min;\n double angle = 2 * Math.PI * rand.nextDouble();\n double deltaX = distance * Math.cos(angle);\n double deltaZ = distance * Math.sin(angle);\n Location loc = player.getLocation().clone();\n loc.setX(player.getLocation().getX() + deltaX);\n loc.setZ(player.getLocation().getZ() + deltaZ);\n\n // pick a new y coordinate if the same level is not possible\n if (!isSpawnable(loc)) {\n int high = (loc.getBlockY() + 10 >= 255) ? 254 : loc.getBlockY() + 10;\n int low = (loc.getBlockY() - 10 <= 0) ? 1 : loc.getBlockY() - 10;\n for (int i = high; i >= low; i--) {\n loc.setY(i);\n if (!isSpawnable(loc)) return;\n }\n }\n\n // do the spawn\n player.getWorld().spawnEntity(loc, EntityType.ZOMBIE);\n\n }", "private String randomCityId(RandomNumberGenerator random) {\n long targetPop = (long) (random.rand() * totalPopulation);\n\n for (Map.Entry<String, Long> city : populationByCityId.entrySet()) {\n targetPop -= city.getValue();\n\n if (targetPop < 0) {\n return city.getKey();\n }\n }\n\n // should never happen\n throw new RuntimeException(\"Unable to select a random city id.\");\n }", "private Point getSafeTeleportPosition() {\n\t\tRandom number \t= new Random();\n\t\tPoint p\t\t\t= new Point();\n\t\twhile(true) {\n\t\t\tint x\t\t= number.nextInt(rows-1);\t\n\t\t\tint y\t\t= number.nextInt(cols-1);\n\t\t\tp.x\t\t\t= x;\n\t\t\tp.y\t\t\t= y;\n\t\t\t\n\t\t\t//if the point isn't in the array\n\t\t\tif(!occupiedPositions.contains(p)) {\n\t\t\t\t//check the surrounding of the point, need to be a \"safe teleport\"\n\t\t\t\tif(checkSurroundingOfPoint(p)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn p;\n\t}", "public int pickDoorSpot() {\n\t\tint doorSpot = ThreadLocalRandom.current().nextInt(1, ((getRoomWidth() * 2) + ((getRoomLength() - 1) * 2)));\r\n\t\treturn doorSpot;\r\n\t}", "public int getSpawnZ()\n {\n return spawnZ;\n }", "protected Vector3f place (Vector3f position) {\n float radius = FloatMath.pow(\n FloatMath.random(\n innerRadius*innerRadius*innerRadius,\n outerRadius*outerRadius*outerRadius),\n 1f / 3f);\n // elevation based on the surface area distribution\n float sine = FloatMath.random(-1f, +1f);\n float cose = FloatMath.sqrt(1f - sine*sine);\n float angle = Randoms.threadLocal().getFloat(FloatMath.TWO_PI);\n return position.set(\n radius * FloatMath.cos(angle) * cose,\n radius * FloatMath.sin(angle) * cose,\n radius * sine);\n }", "private void addRandomAsteroid() {\n ThreadLocalRandom rng = ThreadLocalRandom.current();\n Point.Double newAsteroidLocation;\n //TODO: dont spawn on top of players\n Point.Double shipLocation = new Point2D.Double(0,0);\n double distanceX, distanceY;\n do { // Iterate until a point is found that is far enough away from the player.\n newAsteroidLocation = new Point.Double(rng.nextDouble(0.0, 800.0), rng.nextDouble(0.0, 800.0));\n distanceX = newAsteroidLocation.x - shipLocation.x;\n distanceY = newAsteroidLocation.y - shipLocation.y;\n } while (distanceX * distanceX + distanceY * distanceY < 50 * 50); // Pythagorean theorem for distance between two points.\n\n double randomChance = rng.nextDouble();\n Point.Double randomVelocity = new Point.Double(rng.nextDouble() * 6 - 3, rng.nextDouble() * 6 - 3);\n AsteroidSize randomSize;\n if (randomChance < 0.333) { // 33% chance of spawning a large asteroid.\n randomSize = AsteroidSize.LARGE;\n } else if (randomChance < 0.666) { // 33% chance of spawning a medium asteroid.\n randomSize = AsteroidSize.MEDIUM;\n } else { // And finally a 33% chance of spawning a small asteroid.\n randomSize = AsteroidSize.SMALL;\n }\n this.game.getAsteroids().add(new Asteroid(newAsteroidLocation, randomVelocity, randomSize));\n }", "public Location inRange()\n\t{\n\t\tboolean equals = false;\n\t\tif(getGrid() == null)\n\t\t\treturn null;\n\t\tfor(int i = -5; i < 6; i++)\n\t\t{\n\t\t\tfor(int j = -5; j < 6; j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(getGrid().isValid(new Location(getLocation().getRow() + i, getLocation().getCol() + j)))\n\t\t\t\t{\n\t\t\t\t\tif(getGrid().get(new Location(getLocation().getRow() + i, getLocation().getCol() + j)) instanceof User)\n\t\t\t\t\t{\n\t\t\t\t\t\tequals = true;\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}\n\t\t}\n\t\tif(!equals)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\t return locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\treturn getLocation();\n\t\t}\n\t\t\t\n\t\tLocation moveLocation;\n\t\t\n\t\t\n\t\tif(getGrid().getNeighbors(getLocation()).contains(getGrid().getUser()))\n\t\t{\n\t\t\tmoveLocation = getGrid().getUser().getLocation();\n\t\t}\n\t\telse\n {\n PathFinder a = new PathFinder(getGrid(),20);\n Path path = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true);\n if(path.getLength() != 0)\n moveLocation = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true).getStep(0);\n else\n moveLocation = null;\n\n }\n\n\t\tif(moveLocation == null)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\tmoveLocation = locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\tmoveLocation = getLocation();\n\t\t}\n\t\t\n\t\treturn moveLocation;\n\t}", "public void spawnNpcOnChance(Location location) {\r\n\t\t\tif(location.isOutdoors() && Math.random() < 0.20) {\r\n\t\t\t\tthis.spawnEnemy(location);\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\tpublic void spawn(Location location) {\n\t\t\r\n\t}", "MapLocation getPosition(Unit unit);", "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 static Vec3 findRandomTargetBlockTowards(EntityCreature aWaterMob, int xzFleeZoneSize, int yFleeZoneSize, Vec3 aTargetVectorPos, int aMinRangeXZ, int aMinDepth)\r\n{\r\n\r\n Vec3 _fleeingVector = Vec3.createVectorHelper(aTargetVectorPos.xCoord - aWaterMob.posX,aTargetVectorPos.yCoord - aWaterMob.posY,aTargetVectorPos.zCoord - aWaterMob.posZ);\r\n return findRandomTargetBlock(aWaterMob, xzFleeZoneSize, yFleeZoneSize,_fleeingVector,aMinRangeXZ,aMinDepth);\r\n}", "public Location getTeamSpawn(Team team) {\n return this.config.getLocation(team.getName() + \".spawn\");\n }", "public int getSpawnY() {\n\t\treturn spawnY;\n\t}", "public Color randColor() {\r\n return this.loc.get(this.rand.nextInt(this.loc.size()));\r\n }" ]
[ "0.79340965", "0.7667087", "0.7649239", "0.7585702", "0.7534933", "0.74529195", "0.74265033", "0.7147623", "0.7126457", "0.71210945", "0.68314886", "0.6812887", "0.679384", "0.6786564", "0.677024", "0.67552584", "0.6750183", "0.6721311", "0.6649128", "0.66291326", "0.65718514", "0.65698147", "0.6549399", "0.654882", "0.65122724", "0.6509974", "0.65089107", "0.648949", "0.646798", "0.64422756", "0.64246297", "0.64173526", "0.6382999", "0.63780934", "0.6357396", "0.63095415", "0.6269696", "0.62676483", "0.62472737", "0.6227646", "0.6223261", "0.6205248", "0.6204231", "0.6165982", "0.6126853", "0.61128354", "0.6109969", "0.6088041", "0.60872966", "0.60496676", "0.60459477", "0.6038809", "0.60280454", "0.60233665", "0.60214996", "0.60097694", "0.6009429", "0.5990607", "0.5970827", "0.59683955", "0.59604037", "0.59576327", "0.59564173", "0.5947677", "0.5930349", "0.59198487", "0.59094507", "0.5902829", "0.5876613", "0.5875974", "0.58690643", "0.58622426", "0.5861085", "0.58485436", "0.58477056", "0.5832714", "0.580887", "0.5803868", "0.5797446", "0.5797136", "0.5793438", "0.57920414", "0.5788722", "0.57879066", "0.57870185", "0.5774564", "0.57617754", "0.57579935", "0.57573396", "0.57509005", "0.5749713", "0.574938", "0.5748596", "0.5747374", "0.574316", "0.5741038", "0.5725264", "0.57226413", "0.5720116", "0.5716123" ]
0.79552287
0
Returns the x span of this cuboid.
public int getXSize() { return (highPoint.getBlockX() - lowPoint.getBlockX()) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SVGLength getX() {\n return x;\n }", "public int getSpawnX() \n\t{\n\t\treturn spawnX;\n\t}", "public int getX() {\n\t\treturn this.x_indice * DIM_CASE;\n\t}", "public int getBlockX()\n\t {\n\t\t if(x >= 0.0) return (int)x;\n\t\t return -1 + (int)(x);\n\t }", "public int xPos() {\n\t\treturn Engine.scaleX(x);\n\t}", "public float getX() {\n return internalGroup.getX();\n }", "public int x() {\r\n\t\treturn xCoord;\r\n\t}", "public int getX() {\n return (int) Math.round(x);\n }", "public double getX() {\n\t\tRectangle2D bounds = _parentFigure.getBounds();\n\t\tdouble x = bounds.getX() + (_xt * bounds.getWidth());\n\t\treturn x;\n\t}", "public int getDimX() {\r\n return dimX;\r\n }", "public int getX() {\r\n\t\treturn xcoord;\r\n\t}", "public double getX() {\n\t\treturn sens.getXPos();\n\t}", "public double getXRangeIncr() {\n return xRangeIncr;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getX() {\n return x_;\n }", "public int getSpawnX()\n {\n return spawnX;\n }", "public float getX() {\n return x_;\n }", "public int getDimX ()\n {\n return m_dim_x;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public float getX() {\n return this.x;\n }", "public int intX()\n {\n return (int) Math.floor(this.x);\n }", "public int getGridX() {\r\n\t\treturn gridX;\r\n\t}", "public int getX() {\n\t\treturn this.x;\n\t}", "public int getX() {\n\t\treturn this.x;\n\t}", "public int getX() {\r\n\t\treturn this.x;\r\n\t}", "public int getSeilX() {\n\t\tif (this instanceof Seilaufhaenger) {\n\t\t\tif (((Seilaufhaenger) this).getHangingElement() != null) {\n\t\t\t\tElement hangingElement = ((Seilaufhaenger) this).getHangingElement();\n\t\t\t\treturn hangingElement.getMPoint().x;\n\t\t\t}\n\t\t}\n\t\treturn (getX() + (int) (seilxRel * xscale));\n\t}", "public int getX() {\n return xCoord;\n }", "public final int getLocalRegionX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}", "int getBoundsX();", "public float getX() {\n return x_;\n }", "public double getX() {\n\t\t\treturn x;\n\t\t}", "public int getXLeftUpper() {\n return xLeftUpper;\n }", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public int getX() {\n\t\treturn x;\n\t}", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "public double getX() {\n return x_;\n }", "@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}", "public float getX() {\r\n\t\treturn x;\r\n\t}", "public int getXPoint() {\r\n return this.x;\r\n }", "public int getX()\n\t{\n\t\treturn mX;\n\t}", "public int getX()\n\t{\n\t\treturn this.x;\n\t}", "public int getX()\n\t{\n\t\treturn this.x;\n\t}", "public float getX() {\n return x;\n }", "public float getX() {\n return x;\n }", "public float getX() {\n return x;\n }", "public float getX() {\n return pos.x;\n }", "@Override\n\tpublic float getX() {\n\t\treturn lilyPosX;\n\t}", "public double getX() {\n\t\t\t\treturn x;\n\t\t\t}", "public Range getXRange() {\r\n\t\treturn xRange;\r\n\t}", "public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}", "public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}", "public double getX() {\n return this.x;\n }", "public double getX() {\n return this.x;\n }", "public double getX() {\n return this.x;\n }", "public double getX() {\n return this.x;\n }", "public float getX() {\r\n return x;\r\n }", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public double getX() {\n\t\treturn x;\n\t}", "public int getX()\r\n {\r\n return xCoord;\r\n }", "public float getX() {\n return this.x;\n }", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}", "public int getX() {\r\n\t\treturn x;\r\n\t}" ]
[ "0.66441983", "0.65934837", "0.65529895", "0.65417117", "0.6493695", "0.6459926", "0.64371073", "0.6434804", "0.6377167", "0.6372886", "0.63262737", "0.6307153", "0.62957454", "0.6280731", "0.6280731", "0.6280731", "0.6280731", "0.6280731", "0.6280731", "0.6272899", "0.6270858", "0.62686074", "0.6268066", "0.6267569", "0.6267569", "0.6267569", "0.6267569", "0.6267569", "0.6267569", "0.6267569", "0.6266486", "0.6265075", "0.62500966", "0.6249563", "0.6249563", "0.6243577", "0.62420326", "0.62272847", "0.621826", "0.62164086", "0.6214767", "0.6214247", "0.6209988", "0.6209252", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.6192385", "0.61871624", "0.61871624", "0.61871624", "0.61871624", "0.61871624", "0.61871624", "0.61871624", "0.61871624", "0.6183296", "0.61826926", "0.617716", "0.6177141", "0.6176965", "0.6176965", "0.6172723", "0.6172723", "0.6172723", "0.6172011", "0.6166993", "0.6166452", "0.6166163", "0.6165341", "0.6165341", "0.616412", "0.616412", "0.616412", "0.616412", "0.61637115", "0.6161923", "0.6161923", "0.6161923", "0.6161923", "0.6161923", "0.6161923", "0.6161923", "0.6160335", "0.6156867", "0.6156086", "0.6156086", "0.6156086", "0.6156086", "0.6156086", "0.6156086", "0.6156086" ]
0.0
-1
Returns the y span of this cuboid.
public int getYSize() { return (highPoint.getBlockY() - lowPoint.getBlockY()) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int yPos() {\n\t\treturn Engine.scaleY(y);\n\t}", "public int getBlockY()\n\t {\n\t\t if(y >= 0.0) return (int)y;\n\t\t return -1 + (int)(y);\n\t }", "public double getY() {\n\t\tRectangle2D bounds = _parentFigure.getBounds();\n\t\tdouble y = bounds.getY() + (_yt * bounds.getHeight());\n\t\treturn y;\n\t}", "public int y() {\r\n\t\treturn yCoord;\r\n\t}", "public SVGLength getY() {\n return y;\n }", "public int getY() {\n\t\treturn this.y_indice * DIM_CASE;\n\t}", "public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}", "public double getMaximumY () {\n return minimumY + height;\n }", "public int getyCoord() {\n\t\treturn yCoord;\n\t}", "public int getY()\n\t{\n\t\treturn m_nPosY;\n\t}", "public double getyCoord() {\n\t\treturn yCoord;\n\t}", "public final int getMaxY() {\n return getMinY() + getHeight();\n }", "public float getY() {\n return internalGroup.getY();\n }", "public int getY() {\r\n\t\treturn this.y;\r\n\t}", "public double getY() {\n return this.y;\n }", "public double getY() {\n return this.y;\n }", "public double getY() {\n return this.y;\n }", "public double getY() {\r\n return this.y;\r\n }", "@Override\n\tpublic float getY() {\n\t\treturn lilyPosY;\n\t}", "public int getY() {\r\n return ix / numCols;\r\n }", "public int getY() {\n\t\treturn this.y;\n\t}", "public int getY() {\n\t\treturn this.y;\n\t}", "public int getY() {\n\t\treturn this.y;\n\t}", "public int y() {\n\t\treturn this.y;\n\t}", "public int getY()\n\t{\n\t\treturn this.y;\n\t}", "public int getY()\n\t{\n\t\treturn this.y;\n\t}", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public int getY() {\r\n\t\treturn y;\r\n\t}", "public int getY() {\r\n\t\treturn y;\r\n\t}", "public int getY() {\r\n\t\treturn y;\r\n\t}", "public float getUpperRightY()\n {\n return ((COSNumber)rectArray.get(3)).floatValue();\n }", "public int getY() {\n return (int) Math.round(y);\n }", "public double getMaxY() { return getY() + getHeight(); }", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n\t\treturn y;\n\t}", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public final double getY() {\n return y;\n }", "public int getY()\r\n\t{\r\n\t\treturn this.Y;\r\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getY() {\n return y_;\n }", "public double getyOffset() {\n\n return currentYOffset + yOffset;\n }", "public float getYHeight() {\n\t\treturn this.yHeight;\n\t}", "public final double getY() {\n return y;\n }", "public int getY() {\r\n\t\treturn ycoord;\r\n\t}", "public double getY() {\r\n return y;\r\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\n return y_;\n }", "public int getY() {\r\n return this.y;\r\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public double getY() {\n return y;\n }", "public Float getyBegin() {\r\n return yBegin;\r\n }", "public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY()\n\t{\n\t\treturn y;\n\t}", "public int getY() {\n\treturn baseYCoord;\n}", "public double getEndY() {\n\treturn v2.getY();\n }", "public double getY()\n\t{\n\t\treturn y;\n\t}", "public double getY();", "public int getY() {\n\t\treturn Y;\n\t}", "public int getY() {\r\n\t\t\r\n\t\treturn topY;\r\n\t}" ]
[ "0.7188916", "0.70940095", "0.7051512", "0.6968556", "0.69453037", "0.69314396", "0.6922271", "0.6912857", "0.6889724", "0.68539655", "0.68489635", "0.6808321", "0.6802232", "0.6799503", "0.6798091", "0.6798091", "0.6798091", "0.6789355", "0.67883295", "0.6786866", "0.6785531", "0.6785531", "0.6785531", "0.6784232", "0.67789525", "0.67789525", "0.677704", "0.677704", "0.677704", "0.677704", "0.677704", "0.677704", "0.677704", "0.67769915", "0.6772849", "0.6772849", "0.6772849", "0.67715967", "0.67691475", "0.67687404", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6767981", "0.6766166", "0.6766166", "0.6766166", "0.6766166", "0.6766166", "0.6764288", "0.6762705", "0.67605555", "0.67605555", "0.67605555", "0.67605555", "0.6748265", "0.6748265", "0.6748265", "0.67481583", "0.67481583", "0.67481583", "0.67481583", "0.67481583", "0.6744755", "0.6743529", "0.67401206", "0.6739816", "0.6731242", "0.67257833", "0.67257833", "0.67257833", "0.67257833", "0.67257833", "0.6723658", "0.67191446", "0.67191446", "0.67191446", "0.67191446", "0.67191446", "0.67191446", "0.67166287", "0.6715067", "0.6714569", "0.6714569", "0.6714569", "0.6714569", "0.6714569", "0.6714569", "0.67095184", "0.670912", "0.67049706", "0.6702001", "0.67017454", "0.6700083" ]
0.0
-1
Returns the z span of this cuboid.
public int getZSize() { return (highPoint.getBlockZ() - lowPoint.getBlockZ()) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }", "@Override\n\tpublic double getZLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn z-side;\n\t}", "public float getZ() {\n return z_;\n }", "public double getZ() {\n return position.getZ();\n }", "public int getZ() {\n\t\treturn -150;\n\t}", "public int getZ()\n {\n return zaxis;\n }", "public float getZ() {\n return z_;\n }", "public float getZ() {\r\n return z;\r\n }", "public int getZ() {\n\t\treturn z;\n\t}", "public double getZ() {\n\t\treturn z;\n\t}", "public double getZ() {\n\t\treturn z;\n\t}", "public float getZ(){\n\t\tif(!isRoot()){\n\t\t\treturn getParent().getZ() + z;\n\t\t}else{\n\t\t\treturn z;\n\t\t}\n\t}", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "public final double getZ() {\n return z;\n }", "public float getLocalZ(){\n\t\treturn this.z;\n\t}", "public double getZ() {\r\n\t\treturn z;\t\r\n\t\t}", "@Override\n\tpublic double getZ() {\n\t\treturn z;\n\t}", "public double getZ(){\n\t\treturn z;\n\t}", "public double getZ() {\r\n return z;\r\n }", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "public final double getZ()\n {\n return m_jso.getZ();\n }", "public double getZ() {\n\t\treturn point[2];\n\t}", "double getZLength();", "Double getZLength();", "public int getDimZ() {\r\n return dimZ;\r\n }", "public int getSpawnZ()\n {\n return spawnZ;\n }", "@java.lang.Override\n public godot.wire.Wire.Vector3 getZ() {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }", "float getZ();", "float getZ();", "float getZ();", "public int getZ() {\n return z;\n }", "public int getZ() {\r\n return z;\r\n }", "public int getzPos() {\n return zPos;\n }", "public Double z() {\n return z;\n }", "public double getZFactor() {\r\n\t\treturn z_factor;\r\n\t}", "public int getZ() {\n return Z;\n }", "public DynamicCuboid setSizeZ(float z) {\n this.sizeZ = z;\n return this;\n }", "@Override\n\tpublic int getZ() {\n\t\treturn 1000;\n\t}", "@Override\n public int getZ() {\n return (int) claim.getZ();\n }", "public double Z_r() {\r\n \t\treturn getZ();\r\n \t}", "public double getz0()\n\t{\n\t\treturn this.z0;\n\t}", "godot.wire.Wire.Vector3 getZ();", "public godot.wire.Wire.Vector3 getZ() {\n if (zBuilder_ == null) {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n } else {\n return zBuilder_.getMessage();\n }\n }", "double getZ() { return pos[2]; }", "public DynamicCuboid setZ(float z) {\n this.z = z;\n return this;\n }", "public double getDeltaZ() {\n return deltaZ;\n }", "public double getDeltaZ() {\n return deltaZ;\n }", "public int getZwid() {\n return zwid;\n }", "public float getZ()\n {\n return fz;\n }", "public double getDeltaZ() {\n return deltaZ;\n }", "public short getZDim() {\n\t\treturn getShort(ADACDictionary.Z_DIMENSIONS);\n\t}", "public final int getZOff() {\r\n\t\treturn zOff;\r\n\t}", "@Override\n\tpublic int getLowZ()\n\t{\n\t\treturn zoneZ1;\n\t}", "public int getZIndex() {\n return internalGroup.getZIndex();\n }", "public int getZ() {\n return Z;\n }", "@Override\n\tpublic double getZPos() {\n\t\treturn field_145849_e;\n\t}", "public final int zzb() {\n return this.zzc.zzc() + this.zza + this.zzb;\n }", "public final int zzc() {\n return this.zzc.zzc() + this.zza;\n }", "public double getBorderCenterZ()\n {\n return borderCenterZ;\n }", "@MavlinkFieldInfo(\n position = 8,\n unitSize = 2,\n signed = true,\n description = \"Ground Z Speed (Altitude, positive down)\"\n )\n public final int vz() {\n return this.vz;\n }", "public int zzu() {\n int zzu = super.zzu();\n if (this.zzcwX) {\n zzu += zzbyc.zzh(1, this.zzcwX);\n }\n if (this.score != 0) {\n zzu += zzbyc.zzL(2, this.score);\n }\n return (this.zzcwY == null || this.zzcwY.equals(\"\")) ? zzu : zzu + zzbyc.zzr(3, this.zzcwY);\n }", "public final int zzb() {\n return this.zzx;\n }", "public double getModZ() {\n return (modZ != 0 ? ( modZ > 0 ? (modZ - RESTADOR) : (modZ + RESTADOR) ) : modZ);\n }", "public Float getZwsalary() {\n return zwsalary;\n }", "public static Double LargeZ() {\n return LargeZ;\n }", "public double len() {\n \t\treturn Math.sqrt((double)x*x + (double)y*y + (double)z*z);\n \t}", "@java.lang.Override\n public godot.wire.Wire.Vector3OrBuilder getZOrBuilder() {\n return getZ();\n }", "abstract double getOrgZ();", "public static Double SmallZ() {\n return SmallZ;\n }", "public final zzgol<zzgop<?>> zzn() {\n zzr();\n return this.zzae;\n }", "int getZ();", "int getZ();", "int getZ();", "public float getRotateZ() { return rotateZ; }", "public int getGlrwzs() {\r\n\t\treturn glrwzs;\r\n\t}", "public final int zzc() {\n return this.zzz;\n }", "public godot.wire.Wire.Vector3OrBuilder getZOrBuilder() {\n if (zBuilder_ != null) {\n return zBuilder_.getMessageOrBuilder();\n } else {\n return z_ == null ?\n godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }\n }", "public final int zza() {\n int zza = super.zza();\n if (this.zzaue != null) {\n zza += zzacb.zzf(1, this.zzaue.intValue());\n }\n if (this.zzauf != null) {\n zza += zzacb.zzc(2, this.zzauf);\n }\n if (this.zzaug != null) {\n this.zzaug.booleanValue();\n zza += zzacb.zzaq(3) + 1;\n }\n if (this.zzauh == null || this.zzauh.length <= 0) {\n return zza;\n }\n int i = 0;\n int i2 = 0;\n int i3 = 0;\n while (i3 < this.zzauh.length) {\n int zzfr;\n String str = this.zzauh[i3];\n if (str != null) {\n i++;\n zzfr = zzacb.zzfr(str) + i2;\n } else {\n zzfr = i2;\n }\n i3++;\n i2 = zzfr;\n }\n return (zza + i2) + (i * 1);\n }", "double getz() {\nreturn this.z;\n }", "public float getLimit_lin_z_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 52);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 44);\n\t\t}\n\t}", "public Double z() {\n return this.f917a.getAsDouble(\"CFG_LOCATION_LATITUDE\");\n }", "public float max3DZ() {\n return Math.max(stop3D.z, start3D.z);\n }", "public com.google.protobuf.ByteString\n getZBytes() {\n java.lang.Object ref = z_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n z_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public godot.wire.Wire.Vector3.Builder getZBuilder() {\n \n onChanged();\n return getZFieldBuilder().getBuilder();\n }", "public Integer getZid() {\n return zid;\n }", "public final float getZIndex() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getZIndex()\");\n return ((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getZIndex();\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getZIndex()\");\n return ((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getZIndex();\n }\n }", "public float length(){\n return (float) Math.sqrt(Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2));\n }", "public double length() {\n return Math.sqrt(\n (Math.pow(getX(), 2)) +\n (Math.pow(getY(), 2)) +\n (Math.pow(getZ(), 2))\n );\n }", "public static int getIntZ(MutableVector loc) {\n return (int) (loc.getZ() * GRANULARITY);\n }", "public Float getZbjg() {\n return zbjg;\n }", "public double getDz() {\n return dz;\n }", "public final boolean zzh() {\n return zzq() && this.zzz <= zzgod.GROUP.zza();\n }", "float zMin();", "public float min3DZ() {\n return Math.min(stop3D.z, start3D.z);\n }", "public float getAccelZ() {\n return mAccelZ;\n }", "int getZOrder();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getZBytes() {\n java.lang.Object ref = z_;\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 z_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int getZX() {\n\t\treturn zX;\n\t}" ]
[ "0.7206029", "0.71651936", "0.704239", "0.70399386", "0.7014166", "0.700771", "0.69794863", "0.6943423", "0.694015", "0.69090873", "0.69090873", "0.69077057", "0.68586594", "0.68586594", "0.6857973", "0.68239504", "0.6800037", "0.6774667", "0.6751383", "0.6748", "0.67382276", "0.67382276", "0.67221206", "0.6718144", "0.67015344", "0.66962665", "0.6663878", "0.6620261", "0.6605395", "0.6584058", "0.6584058", "0.6584058", "0.65672874", "0.65640503", "0.65536934", "0.6467858", "0.64637494", "0.6449539", "0.64457154", "0.6384334", "0.63656425", "0.6350015", "0.6336138", "0.6323584", "0.6315026", "0.62536895", "0.62469614", "0.62363374", "0.62363374", "0.62218064", "0.6203733", "0.6188079", "0.61740595", "0.6145473", "0.6142428", "0.6114123", "0.6100273", "0.6065352", "0.60588896", "0.604244", "0.6042269", "0.6038725", "0.60105056", "0.5998399", "0.59878266", "0.5983904", "0.59642065", "0.5942996", "0.59150386", "0.5902744", "0.58982056", "0.5897539", "0.5856049", "0.5856049", "0.5856049", "0.5844679", "0.58287233", "0.5809353", "0.5806106", "0.5793967", "0.5787999", "0.57350445", "0.57087094", "0.5697029", "0.5661878", "0.5644928", "0.56433475", "0.56404656", "0.56224704", "0.5616973", "0.56154126", "0.5611824", "0.5593134", "0.55878717", "0.5582501", "0.5575938", "0.55755097", "0.5568732", "0.5566683", "0.55648166" ]
0.68140614
16